Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
# include <string.h>
int main() {
int vid, att, x;
scanf("%d %d", &vid, &att);
int poer = 0;
for (int i = 0; i < att; ++i){
scanf("%d", &x);
poer += x;
}
if (vid - poer > 0)
printf("No\n");
else
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%vid = alloca i32, align 4
%att = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %vid) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %att) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vid, ptr noundef nonnull %att)
%0 = load i32, ptr %att, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%poer.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%1 = load i32, ptr %vid, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %poer.0.lcssa
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %att) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %vid) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%poer.09 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load i32, ptr %x, align 4, !tbaa !5
%add = add nsw i32 %2, %poer.09
%inc = add nuw nsw i32 %i.010, 1
%3 = load i32, ptr %att, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 n, s;
int chk[101010];
int main(){
int a;
scanf("%d", &n);
s=n;
for (int i=0; i<n; i++) {
scanf("%d", &a);
if (a==s) {
printf("%d ", a);
for ( s--; s>0; s--) {
if (chk[s]) {
printf("%d ", s);
chk[s] = 0;
}
else break;
}
}
else chk[a]=1;
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26868/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26868/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@s = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@chk = dso_local local_unnamed_addr global [101010 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
store i32 %0, ptr @s, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end15, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
for.body: ; preds = %entry, %if.end15
%i.025 = phi i32 [ %inc, %if.end15 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr @s, align 4, !tbaa !5
%cmp2 = icmp eq i32 %1, %2
br i1 %cmp2, label %if.then, label %if.else12
if.then: ; preds = %for.body
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%storemerge.in.pr = load i32, ptr @s, align 4, !tbaa !5
%storemerge21 = add nsw i32 %storemerge.in.pr, -1
store i32 %storemerge21, ptr @s, align 4, !tbaa !5
%cmp522 = icmp sgt i32 %storemerge.in.pr, 1
br i1 %cmp522, label %for.body6, label %if.end15
for.body6: ; preds = %if.then, %if.then7
%storemerge23 = phi i32 [ %storemerge, %if.then7 ], [ %storemerge21, %if.then ]
%idxprom = zext i32 %storemerge23 to i64
%arrayidx = getelementptr inbounds [101010 x i32], ptr @chk, i64 0, i64 %idxprom
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %if.end15, label %if.then7
if.then7: ; preds = %for.body6
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %storemerge23)
%4 = load i32, ptr @s, align 4, !tbaa !5
%idxprom9 = sext i32 %4 to i64
%arrayidx10 = getelementptr inbounds [101010 x i32], ptr @chk, i64 0, i64 %idxprom9
store i32 0, ptr %arrayidx10, align 4, !tbaa !5
%storemerge = add nsw i32 %4, -1
store i32 %storemerge, ptr @s, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %4, 1
br i1 %cmp5, label %for.body6, label %if.end15, !llvm.loop !9
if.else12: ; preds = %for.body
%idxprom13 = sext i32 %1 to i64
%arrayidx14 = getelementptr inbounds [101010 x i32], ptr @chk, i64 0, i64 %idxprom13
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
br label %if.end15
if.end15: ; preds = %for.body6, %if.then7, %if.then, %if.else12
%putchar = call i32 @putchar(i32 10)
%inc = add nuw nsw i32 %i.025, 1
%5 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; 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}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
int i = 0,h,n,sum = 0,a;
scanf("%d%d",&h,&n);
for(i=0;i<n;i++){
scanf("%d",&a);
sum += a;
}
if(sum >= h) printf("Yes\n");
else printf("No\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268722/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268722/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%h = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, 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 %for.end
for.body: ; preds = %entry, %for.body
%sum.010 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.010
%inc = add nuw nsw i32 %i.09, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %sum.0.lcssa, %3
%str.str.4 = select i1 %cmp2.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
struct test {
long H;
int N;
int A[100000];
char *ans;
} td[] =
{
{
10, 3,
{4, 5, 6},
"Yes",
},
{
20, 3,
{4, 5, 6},
"No",
},
{
210, 5,
{31, 41, 59, 26, 53},
"Yes",
},
{
211, 5,
{31, 41, 59, 26, 53},
"No",
},
};
void
solver(long h, int n, int *a)
{
int i;
long sum=0;
for (i=0; i<n; i++)
sum += a[i];
if (h>sum)
printf("No\n");
else
{
printf("Yes\n");
}
}
int
main(int argc, char *argv[])
{
int tt;
#if 0
for(tt=0;tt<sizeof(td)/sizeof(struct test); tt++) {
solver(td[tt].H, td[tt].N, td[tt].A);
printf("%s\n",td[tt].ans);
}
#else
long H;
int N;
int A[100000];
scanf("%ld%d", &H, &N);
for(tt=0; tt<N; tt++) {
scanf("%d", A+tt);
}
solver(H, N, A);
#endif
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268766/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268766/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@td = dso_local local_unnamed_addr global <{ { i64, i32, <{ i32, i32, i32, [99997 x i32] }>, ptr }, { i64, i32, <{ i32, i32, i32, [99997 x i32] }>, ptr }, { i64, i32, <{ i32, i32, i32, i32, i32, [99995 x i32] }>, ptr }, { i64, i32, <{ i32, i32, i32, i32, i32, [99995 x i32] }>, ptr } }> <{ { i64, i32, <{ i32, i32, i32, [99997 x i32] }>, ptr } { i64 10, i32 3, <{ i32, i32, i32, [99997 x i32] }> <{ i32 4, i32 5, i32 6, [99997 x i32] zeroinitializer }>, ptr @str }, { i64, i32, <{ i32, i32, i32, [99997 x i32] }>, ptr } { i64 20, i32 3, <{ i32, i32, i32, [99997 x i32] }> <{ i32 4, i32 5, i32 6, [99997 x i32] zeroinitializer }>, ptr @str.6 }, { i64, i32, <{ i32, i32, i32, i32, i32, [99995 x i32] }>, ptr } { i64 210, i32 5, <{ i32, i32, i32, i32, i32, [99995 x i32] }> <{ i32 31, i32 41, i32 59, i32 26, i32 53, [99995 x i32] zeroinitializer }>, ptr @str }, { i64, i32, <{ i32, i32, i32, i32, i32, [99995 x i32] }>, ptr } { i64 211, i32 5, <{ i32, i32, i32, i32, i32, [99995 x i32] }> <{ i32 31, i32 41, i32 59, i32 26, i32 53, [99995 x i32] zeroinitializer }>, ptr @str.6 } }>, align 16
@.str.4 = private unnamed_addr constant [6 x i8] c"%ld%d\00", align 1
@.str.5 = 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.6 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @solver(i64 noundef %h, i32 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %n, 0
br i1 %cmp8, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 4
br i1 %min.iters.check, label %for.body.preheader14, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%0 = getelementptr inbounds i32, ptr %a, i64 %index
%wide.load = load <2 x i32>, ptr %0, align 4, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 2
%wide.load13 = load <2 x i32>, ptr %1, align 4, !tbaa !5
%2 = sext <2 x i32> %wide.load to <2 x i64>
%3 = sext <2 x i32> %wide.load13 to <2 x i64>
%4 = add <2 x i64> %vec.phi, %2
%5 = add <2 x i64> %vec.phi12, %3
%index.next = add nuw i64 %index, 4
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %5, %4
%7 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader14
for.body.preheader14: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%sum.010.ph = phi i64 [ 0, %for.body.preheader ], [ %7, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader14, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader14 ]
%sum.010 = phi i64 [ %add, %for.body ], [ %sum.010.ph, %for.body.preheader14 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%8 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sext i32 %8 to i64
%add = add nsw i64 %sum.010, %conv
%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 !13
for.end: ; preds = %for.body, %middle.block, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %7, %middle.block ], [ %add, %for.body ]
%cmp1 = icmp slt i64 %sum.0.lcssa, %h
%str.6.str = select i1 %cmp1, ptr @str.6, ptr @str
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.6.str)
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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%H = alloca i64, align 8
%N = alloca i32, align 4
%A = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %H) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%1 = load i64, ptr %H, align 8, !tbaa !14
br label %solver.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %add.ptr)
%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 !16
for.end: ; preds = %for.body
%4 = load i64, ptr %H, align 8, !tbaa !14
%cmp8.i = icmp sgt i32 %2, 0
br i1 %cmp8.i, label %for.body.preheader.i, label %solver.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %2 to i64
%min.iters.check = icmp ult i32 %2, 4
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%vec.phi11 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%5 = getelementptr inbounds i32, ptr %A, i64 %index
%wide.load = load <2 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 2
%wide.load12 = load <2 x i32>, ptr %6, align 8, !tbaa !5
%7 = sext <2 x i32> %wide.load to <2 x i64>
%8 = sext <2 x i32> %wide.load12 to <2 x i64>
%9 = add <2 x i64> %vec.phi, %7
%10 = add <2 x i64> %vec.phi11, %8
%index.next = add nuw i64 %index, 4
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %10, %9
%12 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %solver.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%sum.010.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %12, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%sum.010.i = phi i64 [ %add.i, %for.body.i ], [ %sum.010.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%13 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%conv.i = sext i32 %13 to i64
%add.i = add nsw i64 %sum.010.i, %conv.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 %solver.exit, label %for.body.i, !llvm.loop !18
solver.exit: ; preds = %for.body.i, %middle.block, %for.end.thread, %for.end
%14 = phi i64 [ %4, %for.end ], [ %1, %for.end.thread ], [ %4, %middle.block ], [ %4, %for.body.i ]
%sum.0.lcssa.i = phi i64 [ 0, %for.end ], [ 0, %for.end.thread ], [ %12, %middle.block ], [ %add.i, %for.body.i ]
%cmp1.i = icmp slt i64 %sum.0.lcssa.i, %14
%str.6.str.i = select i1 %cmp1.i, ptr @str.6, ptr @str
%puts.i = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.str.i)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %H) #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 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 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !11, !12}
!18 = distinct !{!18, !10, !12, !11}
|
#include<stdio.h>
int main()
{
int h,n,sum=0,a,i;
scanf("%d %d",&h,&n);
for(i=0;i<n;i++)
{
scanf("%d",&a);
sum+=a;
}
if(sum>=h)
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268809/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268809/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%sum.08 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.08
%inc = add nuw nsw i32 %i.09, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %sum.0.lcssa, %3
%.str.3..str.2 = select i1 %cmp2.not, ptr @.str.3, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int h, n, soma, s, i;
scanf("%d %d", &h, &n);
for(i = 0; i < n; i++)
{
scanf("%d", &s);
soma += s;
}
if(soma >= h)
{
printf("Yes");
}
else
{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268852/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268852/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%n = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %if.end
for.body: ; preds = %entry, %for.body
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%soma.08 = phi i32 [ %add, %for.body ], [ undef, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%1 = load i32, ptr %s, align 4, !tbaa !5
%add = add nsw i32 %1, %soma.08
%inc = add nuw nsw i32 %i.09, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%3 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %add, %3
%spec.select = select i1 %cmp2.not, ptr @.str.3, ptr @.str.2
br label %if.end
if.end: ; preds = %for.end, %entry
%.str.3.sink = phi ptr [ @.str.2, %entry ], [ %spec.select, %for.end ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int a,b,i,total=0;
int c[200000];
scanf("%d %d",&a,&b);
for(i=0;i<b;i++)
{
scanf("%d",&c[i]);
}
for(i=0;i<b;i++)
{
total += c[i];
}
if(total >= a)
{
printf("Yes");
}
else if(total < a)
{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268896/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268896/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %for.body, label %for.end9
for.cond2.preheader: ; preds = %for.body
%cmp325 = icmp sgt i32 %7, 0
br i1 %cmp325, label %for.body4.preheader, label %for.end9
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %7 to i64
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body4.preheader38, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi36 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [200000 x i32], ptr %c, 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.load37 = 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.load37, %vec.phi36
%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.end9, label %for.body4.preheader38
for.body4.preheader38: ; preds = %for.body4.preheader, %middle.block
%indvars.iv31.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%total.027.ph = phi i32 [ 0, %for.body4.preheader ], [ %6, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x i32], ptr %c, 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
%7 = load i32, ptr %b, 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.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader38, %for.body4
%indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.body4 ], [ %indvars.iv31.ph, %for.body4.preheader38 ]
%total.027 = phi i32 [ %add, %for.body4 ], [ %total.027.ph, %for.body4.preheader38 ]
%arrayidx6 = getelementptr inbounds [200000 x i32], ptr %c, i64 0, i64 %indvars.iv31
%9 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %9, %total.027
%indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
%exitcond.not = icmp eq i64 %indvars.iv.next32, %wide.trip.count
br i1 %exitcond.not, label %for.end9, label %for.body4, !llvm.loop !14
for.end9: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%total.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %6, %middle.block ], [ %add, %for.body4 ]
%10 = load i32, ptr %a, align 4, !tbaa !5
%cmp10.not = icmp slt i32 %total.0.lcssa, %10
%.str.3..str.2 = select i1 %cmp10.not, ptr @.str.3, ptr @.str.2
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main(void) {
int i;
int sum = 0;
int h, n;
int a[100000];
scanf("%d%d", &h, &n);
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
for (i = 0; i < n; i++)
sum += a[i];
if (h <= sum)
printf("Yes\n");
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268946/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268946/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%h = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.end9
for.cond2.preheader: ; preds = %for.body
%cmp322 = icmp sgt i32 %7, 0
br i1 %cmp322, label %for.body4.preheader, label %for.end9
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %7 to i64
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body4.preheader35, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi33 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [100000 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.load34 = 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.load34, %vec.phi33
%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.end9, label %for.body4.preheader35
for.body4.preheader35: ; preds = %for.body4.preheader, %middle.block
%indvars.iv28.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%sum.024.ph = phi i32 [ 0, %for.body4.preheader ], [ %6, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %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.1, 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.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader35, %for.body4
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.body4 ], [ %indvars.iv28.ph, %for.body4.preheader35 ]
%sum.024 = phi i32 [ %add, %for.body4 ], [ %sum.024.ph, %for.body4.preheader35 ]
%arrayidx6 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv28
%9 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %9, %sum.024
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%exitcond.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count
br i1 %exitcond.not, label %for.end9, label %for.body4, !llvm.loop !14
for.end9: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %6, %middle.block ], [ %add, %for.body4 ]
%10 = load i32, ptr %h, align 4, !tbaa !5
%cmp10.not = icmp sgt i32 %10, %sum.0.lcssa
%str.str.4 = select i1 %cmp10.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 t;
scanf("%d",&t);
while(t--) {
int n;
scanf("%d",&n);
int i=1;
if(n%2)
{ printf("3 1 2 "); i=4;}
for(;i<=n; i+=2)
printf("%d %d ",i+1,i);
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"3 1 2 \00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec12 = add nsw i32 %0, -1
store i32 %dec12, ptr %t, align 4, !tbaa !5
%tobool.not13 = icmp eq i32 %0, 0
br i1 %tobool.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = and i32 %1, 1
%tobool2.not = icmp eq i32 %2, 0
br i1 %tobool2.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%3 = phi i32 [ %.pre, %if.then ], [ %1, %while.body ]
%i.0 = phi i32 [ 4, %if.then ], [ 1, %while.body ]
%cmp.not10 = icmp sgt i32 %i.0, %3
br i1 %cmp.not10, label %for.end, label %for.body
for.body: ; preds = %if.end, %for.body
%i.111 = phi i32 [ %add5, %for.body ], [ %i.0, %if.end ]
%add = add nuw nsw i32 %i.111, 1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add, i32 noundef %i.111)
%add5 = add nuw nsw i32 %i.111, 2
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %add5, %4
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %if.end
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
%5 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %5, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %5, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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}
|
#include <stdio.h>
int main(void) {
int add[12];
int target;
int in,out;
int i;
int now;
while(1) {
scanf("%d",&target);
if(target==0)break;
for(i=0;i<12;i++) {
scanf("%d%d",&in,&out);
add[i]=in-out;
}
for(now=0,i=0;i<12;i++) {
now+=add[i];
if(now>=target) {
printf("%d\n",i+1);
break;
}
}
if(i>=12)puts("NA");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269053/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269053/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NA\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%target = alloca i32, align 4
%in = alloca i32, align 4
%out = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %target) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %in) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %out) #3
%call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %target)
%0 = load i32, ptr %target, align 4, !tbaa !5
%cmp35 = icmp eq i32 %0, 0
br i1 %cmp35, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end20
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%1 = load i32, ptr %in, align 4, !tbaa !5
%2 = load i32, ptr %out, align 4, !tbaa !5
%sub = sub nsw i32 %1, %2
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%3 = load i32, ptr %in, align 4, !tbaa !5
%4 = load i32, ptr %out, align 4, !tbaa !5
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%5 = load i32, ptr %in, align 4, !tbaa !5
%6 = load i32, ptr %out, align 4, !tbaa !5
%sub.2 = sub nsw i32 %5, %6
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%7 = load i32, ptr %in, align 4, !tbaa !5
%8 = load i32, ptr %out, align 4, !tbaa !5
%sub.3 = sub nsw i32 %7, %8
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%9 = load i32, ptr %in, align 4, !tbaa !5
%10 = load i32, ptr %out, align 4, !tbaa !5
%sub.4 = sub nsw i32 %9, %10
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%11 = load i32, ptr %in, align 4, !tbaa !5
%12 = load i32, ptr %out, align 4, !tbaa !5
%sub.5 = sub nsw i32 %11, %12
%call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%13 = load i32, ptr %in, align 4, !tbaa !5
%14 = load i32, ptr %out, align 4, !tbaa !5
%sub.6 = sub nsw i32 %13, %14
%call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%15 = load i32, ptr %in, align 4, !tbaa !5
%16 = load i32, ptr %out, align 4, !tbaa !5
%sub.7 = sub nsw i32 %15, %16
%call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%17 = load i32, ptr %in, align 4, !tbaa !5
%18 = load i32, ptr %out, align 4, !tbaa !5
%sub.8 = sub nsw i32 %17, %18
%call2.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%19 = load i32, ptr %in, align 4, !tbaa !5
%20 = load i32, ptr %out, align 4, !tbaa !5
%sub.9 = sub nsw i32 %19, %20
%call2.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%21 = load i32, ptr %in, align 4, !tbaa !5
%22 = load i32, ptr %out, align 4, !tbaa !5
%sub.10 = sub nsw i32 %21, %22
%call2.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %in, ptr noundef nonnull %out)
%23 = load i32, ptr %in, align 4, !tbaa !5
%24 = load i32, ptr %out, align 4, !tbaa !5
%sub.11 = sub nsw i32 %23, %24
%25 = load i32, ptr %target, align 4, !tbaa !5
%cmp9.not = icmp slt i32 %sub, %25
br i1 %cmp9.not, label %for.inc14, label %for.end16
for.inc14: ; preds = %for.cond.preheader
%sub.1 = sub nsw i32 %3, %4
%add8.1 = add nsw i32 %sub.1, %sub
%cmp9.not.1 = icmp slt i32 %add8.1, %25
br i1 %cmp9.not.1, label %for.inc14.1, label %for.end16
for.inc14.1: ; preds = %for.inc14
%add8.2 = add nsw i32 %sub.2, %add8.1
%cmp9.not.2 = icmp slt i32 %add8.2, %25
br i1 %cmp9.not.2, label %for.inc14.2, label %for.end16
for.inc14.2: ; preds = %for.inc14.1
%add8.3 = add nsw i32 %sub.3, %add8.2
%cmp9.not.3 = icmp slt i32 %add8.3, %25
br i1 %cmp9.not.3, label %for.inc14.3, label %for.end16
for.inc14.3: ; preds = %for.inc14.2
%add8.4 = add nsw i32 %sub.4, %add8.3
%cmp9.not.4 = icmp slt i32 %add8.4, %25
br i1 %cmp9.not.4, label %for.inc14.4, label %for.end16
for.inc14.4: ; preds = %for.inc14.3
%add8.5 = add nsw i32 %sub.5, %add8.4
%cmp9.not.5 = icmp slt i32 %add8.5, %25
br i1 %cmp9.not.5, label %for.inc14.5, label %for.end16
for.inc14.5: ; preds = %for.inc14.4
%add8.6 = add nsw i32 %sub.6, %add8.5
%cmp9.not.6 = icmp slt i32 %add8.6, %25
br i1 %cmp9.not.6, label %for.inc14.6, label %for.end16
for.inc14.6: ; preds = %for.inc14.5
%add8.7 = add nsw i32 %sub.7, %add8.6
%cmp9.not.7 = icmp slt i32 %add8.7, %25
br i1 %cmp9.not.7, label %for.inc14.7, label %for.end16
for.inc14.7: ; preds = %for.inc14.6
%add8.8 = add nsw i32 %sub.8, %add8.7
%cmp9.not.8 = icmp slt i32 %add8.8, %25
br i1 %cmp9.not.8, label %for.inc14.8, label %for.end16
for.inc14.8: ; preds = %for.inc14.7
%add8.9 = add nsw i32 %sub.9, %add8.8
%cmp9.not.9 = icmp slt i32 %add8.9, %25
br i1 %cmp9.not.9, label %for.inc14.9, label %for.end16
for.inc14.9: ; preds = %for.inc14.8
%add8.10 = add nsw i32 %sub.10, %add8.9
%cmp9.not.10 = icmp slt i32 %add8.10, %25
br i1 %cmp9.not.10, label %for.inc14.10, label %for.end16
for.inc14.10: ; preds = %for.inc14.9
%add8.11 = add nsw i32 %sub.11, %add8.10
%cmp9.not.11 = icmp slt i32 %add8.11, %25
br i1 %cmp9.not.11, label %for.inc14.11, label %for.end16
for.inc14.11: ; preds = %for.inc14.10
%call19 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end20
for.end16: ; preds = %for.inc14.10, %for.inc14.9, %for.inc14.8, %for.inc14.7, %for.inc14.6, %for.inc14.5, %for.inc14.4, %for.inc14.3, %for.inc14.2, %for.inc14.1, %for.inc14, %for.cond.preheader
%i.132.lcssa.wide = phi i32 [ 1, %for.cond.preheader ], [ 2, %for.inc14 ], [ 3, %for.inc14.1 ], [ 4, %for.inc14.2 ], [ 5, %for.inc14.3 ], [ 6, %for.inc14.4 ], [ 7, %for.inc14.5 ], [ 8, %for.inc14.6 ], [ 9, %for.inc14.7 ], [ 10, %for.inc14.8 ], [ 11, %for.inc14.9 ], [ 12, %for.inc14.10 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.132.lcssa.wide)
br label %if.end20
if.end20: ; preds = %for.end16, %for.inc14.11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %target)
%26 = load i32, ptr %target, align 4, !tbaa !5
%cmp = icmp eq i32 %26, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end20, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %out) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %in) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %target) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int d,c;
scanf("%d %d",&d,&c);
printf("%d\n",d*c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269097/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269097/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %c)
%0 = load i32, ptr %d, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int d, c;
scanf("%d%d", &d, &c);
printf("%d\n", d*c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269147/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269147/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %c)
%0 = load i32, ptr %d, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
//I am masatoy. nanimitenda katou seibutsu domo
#include <stdio.h>
int main(void){int d,c;scanf("%d %d",&d,&c);printf("%d\n",d*c);return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269198/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269198/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %c)
%0 = load i32, ptr %d, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int f,g;
scanf("%d %d",&f,&g);
printf("%d\n",f*g);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269240/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%f = alloca i32, align 4
%g = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %f, ptr noundef nonnull %g)
%0 = load i32, ptr %f, align 4, !tbaa !5
%1 = load i32, ptr %g, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c;
scanf("%d %d",&a,&b);
c=a*b;
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269284/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269284/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%mul = mul nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#define ll long long
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll dp[1000010];
int n;
int bs(ll x){
//dp[l]<x<=dp[r]
int l=0,r=n*n+1;
while(r-l>1){
int m=(l+r)/2;
if(dp[m]<x)l=m;
else r=m;
}
return r;
}
ll a[1010],b[1010];
int main(){
ll v;
scanf("%d%lld",&n,&v);
for(int i=0;i<n;i++)scanf("%lld",a+i);
for(int i=0;i<n;i++)scanf("%lld",b+i);
for(int i=0;i<n;i++)for(int j=0;j<n;j++)dp[i*n+j]=a[i]+b[j];
sortup(dp,n*n+1);
for(int i=0;i<n;i++)scanf("%lld",a+i);
for(int i=0;i<n;i++)scanf("%lld",b+i);
long ans=0;
for(int i=0;i<n;i++)for(int j=0;j<n;j++){
long t=v-(a[i]+b[j]);
if(t){
int l=bs(t);
if(dp[l]!=t)continue;
ans+=bs(t+1)-l;
}
}
printf("%ld\n",ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269327/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269327/source.c"
target datalayout = "e-m:e-p270: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 = dso_local global i32 0, align 4
@dp = dso_local global [1000010 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [7 x i8] c"%d%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@a = dso_local global [1010 x i64] zeroinitializer, align 16
@b = dso_local global [1010 x i64] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #6
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #6
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @bs(i64 noundef %x) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !9
%mul = mul nsw i32 %0, %0
%add = add nuw nsw i32 %mul, 1
%cmp8.not = icmp eq i32 %0, 0
br i1 %cmp8.not, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%l.010 = phi i32 [ %div.l.0, %while.body ], [ 0, %entry ]
%r.09 = phi i32 [ %r.0.div, %while.body ], [ %add, %entry ]
%add1 = add nsw i32 %l.010, %r.09
%div = sdiv i32 %add1, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds [1000010 x i64], ptr @dp, i64 0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp2 = icmp slt i64 %1, %x
%r.0.div = select i1 %cmp2, i32 %r.09, i32 %div
%div.l.0 = select i1 %cmp2, i32 %div, i32 %l.010
%sub = sub nsw i32 %r.0.div, %div.l.0
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ %add, %entry ], [ %r.0.div, %while.body ]
ret i32 %r.0.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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%v = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %v) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull %v)
%0 = load i32, ptr @n, align 4, !tbaa !9
%cmp145 = icmp sgt i32 %0, 0
br i1 %cmp145, label %for.body, label %for.cond.cleanup16
for.cond3.preheader: ; preds = %for.body
%cmp4147 = icmp sgt i32 %1, 0
br i1 %cmp4147, label %for.body6, label %for.cond.cleanup16
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i64, ptr @a, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond3.preheader, !llvm.loop !13
for.cond14.preheader: ; preds = %for.body6
%cmp15151 = icmp sgt i32 %16, 0
br i1 %cmp15151, label %for.cond18.preheader.us.preheader, label %for.cond.cleanup16
for.cond18.preheader.us.preheader: ; preds = %for.cond14.preheader
%3 = zext i32 %16 to i64
%wide.trip.count181 = zext i32 %16 to i64
%min.iters.check = icmp ult i32 %16, 4
%n.vec = and i64 %wide.trip.count181, 4294967292
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count181
br label %for.cond18.preheader.us
for.cond18.preheader.us: ; preds = %for.cond18.preheader.us.preheader, %for.cond18.for.cond.cleanup20_crit_edge.us
%indvars.iv177 = phi i64 [ 0, %for.cond18.preheader.us.preheader ], [ %indvars.iv.next178, %for.cond18.for.cond.cleanup20_crit_edge.us ]
%arrayidx.us = getelementptr inbounds [1010 x i64], ptr @a, i64 0, i64 %indvars.iv177
%4 = load i64, ptr %arrayidx.us, align 8, !tbaa !5
%5 = mul nsw i64 %indvars.iv177, %3
br i1 %min.iters.check, label %for.body21.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond18.preheader.us
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %4, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%6 = getelementptr inbounds [1010 x i64], ptr @b, i64 0, i64 %index
%wide.load = load <2 x i64>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i64, ptr %6, i64 2
%wide.load211 = load <2 x i64>, ptr %7, align 16, !tbaa !5
%8 = add nsw <2 x i64> %wide.load, %broadcast.splat
%9 = add nsw <2 x i64> %wide.load211, %broadcast.splat
%10 = add nuw nsw i64 %index, %5
%11 = getelementptr inbounds [1000010 x i64], ptr @dp, i64 0, i64 %10
store <2 x i64> %8, ptr %11, align 8, !tbaa !5
%12 = getelementptr inbounds i64, ptr %11, i64 2
store <2 x i64> %9, ptr %12, align 8, !tbaa !5
%index.next = add nuw i64 %index, 4
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond18.for.cond.cleanup20_crit_edge.us, label %for.body21.us.preheader
for.body21.us.preheader: ; preds = %for.cond18.preheader.us, %middle.block
%indvars.iv173.ph = phi i64 [ 0, %for.cond18.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body21.us
for.body21.us: ; preds = %for.body21.us.preheader, %for.body21.us
%indvars.iv173 = phi i64 [ %indvars.iv.next174, %for.body21.us ], [ %indvars.iv173.ph, %for.body21.us.preheader ]
%arrayidx23.us = getelementptr inbounds [1010 x i64], ptr @b, i64 0, i64 %indvars.iv173
%14 = load i64, ptr %arrayidx23.us, align 8, !tbaa !5
%add.us = add nsw i64 %14, %4
%15 = add nuw nsw i64 %indvars.iv173, %5
%arrayidx26.us = getelementptr inbounds [1000010 x i64], ptr @dp, i64 0, i64 %15
store i64 %add.us, ptr %arrayidx26.us, align 8, !tbaa !5
%indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
%exitcond.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count181
br i1 %exitcond.not, label %for.cond18.for.cond.cleanup20_crit_edge.us, label %for.body21.us, !llvm.loop !17
for.cond18.for.cond.cleanup20_crit_edge.us: ; preds = %for.body21.us, %middle.block
%indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1
%exitcond182.not = icmp eq i64 %indvars.iv.next178, %wide.trip.count181
br i1 %exitcond182.not, label %for.cond.cleanup16, label %for.cond18.preheader.us, !llvm.loop !18
for.body6: ; preds = %for.cond3.preheader, %for.body6
%indvars.iv170 = phi i64 [ %indvars.iv.next171, %for.body6 ], [ 0, %for.cond3.preheader ]
%add.ptr8 = getelementptr inbounds i64, ptr @b, i64 %indvars.iv170
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr8)
%indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
%16 = load i32, ptr @n, align 4, !tbaa !9
%17 = sext i32 %16 to i64
%cmp4 = icmp slt i64 %indvars.iv.next171, %17
br i1 %cmp4, label %for.body6, label %for.cond14.preheader, !llvm.loop !19
for.cond.cleanup16: ; preds = %for.cond18.for.cond.cleanup20_crit_edge.us, %entry, %for.cond3.preheader, %for.cond14.preheader
%.lcssa144202 = phi i32 [ %16, %for.cond14.preheader ], [ %1, %for.cond3.preheader ], [ %0, %entry ], [ %16, %for.cond18.for.cond.cleanup20_crit_edge.us ]
%mul33 = mul nsw i32 %.lcssa144202, %.lcssa144202
%add34 = add nuw nsw i32 %mul33, 1
%conv.i = zext i32 %add34 to i64
call void @qsort(ptr noundef nonnull @dp, i64 noundef %conv.i, i64 noundef 8, ptr noundef nonnull @upll) #6
%18 = load i32, ptr @n, align 4, !tbaa !9
%cmp37153 = icmp sgt i32 %18, 0
br i1 %cmp37153, label %for.body39, label %for.cond.cleanup60
for.cond47.preheader: ; preds = %for.body39
%cmp48156 = icmp sgt i32 %19, 0
br i1 %cmp48156, label %for.body50, label %for.cond.cleanup60
for.body39: ; preds = %for.cond.cleanup16, %for.body39
%indvars.iv183 = phi i64 [ %indvars.iv.next184, %for.body39 ], [ 0, %for.cond.cleanup16 ]
%add.ptr41 = getelementptr inbounds i64, ptr @a, i64 %indvars.iv183
%call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr41)
%indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
%19 = load i32, ptr @n, align 4, !tbaa !9
%20 = sext i32 %19 to i64
%cmp37 = icmp slt i64 %indvars.iv.next184, %20
br i1 %cmp37, label %for.body39, label %for.cond47.preheader, !llvm.loop !20
for.cond58.preheader: ; preds = %for.body50
%cmp59163 = icmp sgt i32 %.pr, 0
br i1 %cmp59163, label %for.cond63.preheader.lr.ph, label %for.cond.cleanup60
for.cond63.preheader.lr.ph: ; preds = %for.cond58.preheader
%21 = load i64, ptr %v, align 8
%mul.i = mul nsw i32 %.pr, %.pr
%add.i = add nuw nsw i32 %mul.i, 1
%wide.trip.count197 = zext i32 %.pr to i64
br label %for.cond63.preheader.us
for.cond63.preheader.us: ; preds = %for.cond63.for.cond.cleanup65_crit_edge.split.us, %for.cond63.preheader.lr.ph
%indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.cond63.for.cond.cleanup65_crit_edge.split.us ], [ 0, %for.cond63.preheader.lr.ph ]
%ans.0164.us = phi i64 [ %ans.4.us, %for.cond63.for.cond.cleanup65_crit_edge.split.us ], [ 0, %for.cond63.preheader.lr.ph ]
%arrayidx68.us = getelementptr inbounds [1010 x i64], ptr @a, i64 0, i64 %indvars.iv194
%22 = load i64, ptr %arrayidx68.us, align 8, !tbaa !5
br label %for.body66.us
for.body66.us: ; preds = %for.cond63.preheader.us, %cleanup82.us
%indvars.iv189 = phi i64 [ 0, %for.cond63.preheader.us ], [ %indvars.iv.next190, %cleanup82.us ]
%ans.1160.us = phi i64 [ %ans.0164.us, %for.cond63.preheader.us ], [ %ans.4.us, %cleanup82.us ]
%arrayidx70.us = getelementptr inbounds [1010 x i64], ptr @b, i64 0, i64 %indvars.iv189
%23 = load i64, ptr %arrayidx70.us, align 8, !tbaa !5
%add71.us = add nsw i64 %23, %22
%sub.us = sub nsw i64 %21, %add71.us
%tobool.not.us = icmp eq i64 %21, %add71.us
br i1 %tobool.not.us, label %cleanup82.us, label %while.body.i.us
while.body.i.us: ; preds = %for.body66.us, %while.body.i.us
%l.010.i.us = phi i32 [ %div.l.0.i.us, %while.body.i.us ], [ 0, %for.body66.us ]
%r.09.i.us = phi i32 [ %r.0.div.i.us, %while.body.i.us ], [ %add.i, %for.body66.us ]
%add1.i.us = add nsw i32 %r.09.i.us, %l.010.i.us
%div.i.us = sdiv i32 %add1.i.us, 2
%idxprom.i.us = sext i32 %div.i.us to i64
%arrayidx.i.us = getelementptr inbounds [1000010 x i64], ptr @dp, i64 0, i64 %idxprom.i.us
%24 = load i64, ptr %arrayidx.i.us, align 8, !tbaa !5
%cmp2.i.us = icmp slt i64 %24, %sub.us
%r.0.div.i.us = select i1 %cmp2.i.us, i32 %r.09.i.us, i32 %div.i.us
%div.l.0.i.us = select i1 %cmp2.i.us, i32 %div.i.us, i32 %l.010.i.us
%sub.i.us = sub nsw i32 %r.0.div.i.us, %div.l.0.i.us
%cmp.i.us = icmp sgt i32 %sub.i.us, 1
br i1 %cmp.i.us, label %while.body.i.us, label %bs.exit.us, !llvm.loop !11
bs.exit.us: ; preds = %while.body.i.us
%idxprom73.us = sext i32 %r.0.div.i.us to i64
%arrayidx74.us = getelementptr inbounds [1000010 x i64], ptr @dp, i64 0, i64 %idxprom73.us
%25 = load i64, ptr %arrayidx74.us, align 8, !tbaa !5
%cmp75.not.us = icmp eq i64 %25, %sub.us
br i1 %cmp75.not.us, label %while.body.i121.us, label %cleanup82.us
while.body.i121.us: ; preds = %bs.exit.us, %while.body.i121.us
%l.010.i122.us = phi i32 [ %div.l.0.i130.us, %while.body.i121.us ], [ 0, %bs.exit.us ]
%r.09.i123.us = phi i32 [ %r.0.div.i129.us, %while.body.i121.us ], [ %add.i, %bs.exit.us ]
%add1.i124.us = add nsw i32 %r.09.i123.us, %l.010.i122.us
%div.i125.us = sdiv i32 %add1.i124.us, 2
%idxprom.i126.us = sext i32 %div.i125.us to i64
%arrayidx.i127.us = getelementptr inbounds [1000010 x i64], ptr @dp, i64 0, i64 %idxprom.i126.us
%26 = load i64, ptr %arrayidx.i127.us, align 8, !tbaa !5
%cmp2.i128.not.us = icmp sgt i64 %26, %sub.us
%r.0.div.i129.us = select i1 %cmp2.i128.not.us, i32 %div.i125.us, i32 %r.09.i123.us
%div.l.0.i130.us = select i1 %cmp2.i128.not.us, i32 %l.010.i122.us, i32 %div.i125.us
%sub.i131.us = sub nsw i32 %r.0.div.i129.us, %div.l.0.i130.us
%cmp.i132.us = icmp sgt i32 %sub.i131.us, 1
br i1 %cmp.i132.us, label %while.body.i121.us, label %bs.exit134.loopexit.us, !llvm.loop !11
cleanup82.us: ; preds = %bs.exit134.loopexit.us, %bs.exit.us, %for.body66.us
%ans.4.us = phi i64 [ %ans.1160.us, %for.body66.us ], [ %add80.us, %bs.exit134.loopexit.us ], [ %ans.1160.us, %bs.exit.us ]
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%exitcond193.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count197
br i1 %exitcond193.not, label %for.cond63.for.cond.cleanup65_crit_edge.split.us, label %for.body66.us, !llvm.loop !21
bs.exit134.loopexit.us: ; preds = %while.body.i121.us
%sub79.us = sub nsw i32 %r.0.div.i129.us, %r.0.div.i.us
%conv.us = sext i32 %sub79.us to i64
%add80.us = add nsw i64 %ans.1160.us, %conv.us
br label %cleanup82.us
for.cond63.for.cond.cleanup65_crit_edge.split.us: ; preds = %cleanup82.us
%indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
%exitcond198.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count197
br i1 %exitcond198.not, label %for.cond.cleanup60, label %for.cond63.preheader.us, !llvm.loop !22
for.body50: ; preds = %for.cond47.preheader, %for.body50
%indvars.iv186 = phi i64 [ %indvars.iv.next187, %for.body50 ], [ 0, %for.cond47.preheader ]
%add.ptr52 = getelementptr inbounds i64, ptr @b, i64 %indvars.iv186
%call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr52)
%indvars.iv.next187 = add nuw nsw i64 %indvars.iv186, 1
%.pr = load i32, ptr @n, align 4, !tbaa !9
%27 = sext i32 %.pr to i64
%cmp48 = icmp slt i64 %indvars.iv.next187, %27
br i1 %cmp48, label %for.body50, label %for.cond58.preheader, !llvm.loop !23
for.cond.cleanup60: ; preds = %for.cond63.for.cond.cleanup65_crit_edge.split.us, %for.cond.cleanup16, %for.cond47.preheader, %for.cond58.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond58.preheader ], [ 0, %for.cond47.preheader ], [ 0, %for.cond.cleanup16 ], [ %ans.4.us, %for.cond63.for.cond.cleanup65_crit_edge.split.us ]
%call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %v) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <limits.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))
#define SWAP(type, a, b) { const type tmp = a; a = b; b = tmp; }
int compare_sz_asc(const void* a, const void* b) {
return *((size_t*)a) < *((size_t*)b) ? -1 : 1;
}
int compare_sz_desc(const void* a, const void* b) {
return *((size_t*)a) > * ((size_t*)b) ? -1 : 1;
}
int compare_i64_asc(const void* a, const void* b) {
return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}
int compare_i64_desc(const void* a, const void* b) {
return *((int64_t*)a) > * ((int64_t*)b) ? -1 : 1;
}
int compare_u64_asc(const void* a, const void* b) {
return *((uint64_t*)a) < *((uint64_t*)b) ? -1 : 1;
}
int compare_u64_desc(const void* a, const void* b) {
return *((uint64_t*)a) > * ((uint64_t*)b) ? -1 : 1;
}
int compare_c_asc(const void* a, const void* b) {
return *((char*)a) < *((char*)b) ? -1 : 1;
}
int compare_c_desc(const void* a, const void* b) {
return *((char*)a) > * ((char*)b) ? -1 : 1;
}
int compare_dp_asc(const void* a, const void* b) {
return *((double*)a) < *((double*)b) ? -1 : 1;
}
static uint64_t modinvU64(const uint64_t a, const uint64_t m) {
int64_t aa = (int64_t)a;
const int64_t mm = (int64_t)m;
int64_t b = mm;
int64_t u = 1;
int64_t v = 0;
while (b != 0) {
const int64_t t = aa / b;
aa -= t * b;
SWAP(uint64_t, aa, b);
u -= t * v;
SWAP(uint64_t, u, v);
}
u %= mm;
if (u < 0) {
u += m;
}
return (uint64_t)u;
}
static size_t powSz(const size_t base, const size_t exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp % 2 == 0) {
return powSz(base * base, exp / 2);
}
else {
return base * powSz(base, exp - 1);
}
}
static uint64_t powU64(const uint64_t base, const uint64_t exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp % 2 == 0) {
return powU64(base * base, exp / 2);
}
else {
return base * powU64(base, exp - 1);
}
}
static uint64_t powU64WMod(const uint64_t base, const uint64_t exp, const uint64_t m) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base % m;
}
if (exp % 2 == 0) {
return powU64WMod(base * base % m, exp / 2, m);
}
else {
return base * powU64WMod(base, exp - 1, m) % m;
}
}
static size_t combSz(const size_t n, const size_t r) {
size_t result = 1;
for (size_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t combU64(const uint64_t n, const uint64_t r) {
uint64_t result = 1;
for (uint64_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t combU64WMod(const uint64_t n, const uint64_t r, const uint64_t m) {
uint64_t result = 1;
uint64_t inv = 1;
for (uint64_t i = 0; i < r; i++) {
result = result * (n - i) % m;
inv = inv * (i + 1) % m;
}
return result * modinvU64(inv, m) % m;
}
static uint64_t permU64(const uint64_t n) {
uint64_t result = 1;
for (uint64_t v = 2; v <= n; v++) {
result *= v;
}
return result;
}
static uint64_t permU64WMod(const uint64_t n, const uint64_t m) {
uint64_t result = 1;
for (uint64_t v = 2; v <= n; v++) {
result *= v;
result %= m;
}
return result;
}
static size_t gcdZu(size_t m, size_t n) {
size_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
static uint64_t gcdU64(uint64_t m, uint64_t n)
{
uint64_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
static uint64_t popcntU64(uint64_t val) {
uint64_t cnt = 0;
while (val != 0) {
if ((val & UINT64_C(0x1)) != 0) {
cnt++;
}
val >>= UINT64_C(0x1);
}
return cnt;
}
typedef struct {
uint64_t val;
}BHeap_Val;
#define BHEAP_VAL_TYPE BHeap_Val
#define BHEAP_INVALID_NODE ((size_t)100000000)
typedef struct {
BHEAP_VAL_TYPE val;
} BHeap_Node;
struct _BHeap_Ctx {
size_t size;
int (*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node);
void(*notifyNodeChange)(const struct _BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList);
BHeap_Node* node;
};
typedef struct _BHeap_Ctx BHeap_Ctx;
static void bHeap_Init(BHeap_Ctx* const ctx, int(*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node), void(*notifyNodeChange)(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList), BHeap_Node* const nodes) {
ctx->size = 0;
ctx->compare = compare;
ctx->notifyNodeChange = notifyNodeChange;
ctx->node = nodes;
}
static void bHeap_Swap(BHeap_Ctx* const ctx, const size_t node0, const size_t node1) {
const BHEAP_VAL_TYPE tmp = ctx->node[node0].val;
ctx->node[node0].val = ctx->node[node1].val;
ctx->node[node1].val = tmp;
if (ctx->notifyNodeChange != NULL) {
const size_t nodeList[2] = { node0,node1 };
ctx->notifyNodeChange(ctx, 2, nodeList);
}
}
static void bHeap_UpHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (nodeIdx == 0) {
return;
}
const size_t parentIdx = (nodeIdx + 1) / 2 - 1;
const int compareResult = ctx->compare(&(ctx->node[parentIdx].val), &(ctx->node[nodeIdx].val));
if (0 < compareResult) {
bHeap_Swap(ctx, nodeIdx, parentIdx);
if (parentIdx != 0) {
bHeap_UpHeap(ctx, parentIdx);
}
}
}
static void bHeap_DownHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (ctx->size - 1 <= nodeIdx) {
return;
}
const size_t leftIdx = 2 * (nodeIdx + 1) - 1;
if (leftIdx < ctx->size) {
const int leftResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[leftIdx].val));
size_t swapTarget = leftResult < 0 ? BHEAP_INVALID_NODE : leftIdx;
const size_t rightIdx = leftIdx + 1;
if (rightIdx < ctx->size) {
const int rightResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[rightIdx].val));
if (swapTarget == BHEAP_INVALID_NODE) {
if (0 < rightResult) {
swapTarget = rightIdx;
}
}
else {
if (0 < rightResult) {
const int rightLeftResult = ctx->compare(&(ctx->node[leftIdx].val), &(ctx->node[rightIdx].val));
if (0 < rightLeftResult) {
swapTarget = rightIdx;
}
}
}
}
if (swapTarget != BHEAP_INVALID_NODE) {
bHeap_Swap(ctx, nodeIdx, swapTarget);
bHeap_DownHeap(ctx, swapTarget);
}
}
}
static void bHeap_Add(BHeap_Ctx* const ctx, const BHEAP_VAL_TYPE val) {
ctx->node[ctx->size].val = val;
ctx->size++;
if (ctx->notifyNodeChange != NULL) {
const size_t node = ctx->size - 1;
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_UpHeap(ctx, ctx->size - 1);
}
static void bHeap_RemoveTop(BHeap_Ctx* const ctx) {
if (ctx->size == 0) {
return;
}
if (ctx->size == 1) {
ctx->size--;
return;
}
ctx->node[0].val = ctx->node[ctx->size - 1].val;
if (ctx->notifyNodeChange != NULL) {
const size_t node = 0;
ctx->notifyNodeChange(ctx, 1, &node);
}
ctx->size--;
bHeap_DownHeap(ctx, 0);
}
static void bHeap_RemoveNode(BHeap_Ctx* const ctx, const size_t node) {
if (node == ctx->size - 1) {
ctx->size--;
}
else {
ctx->node[node].val = ctx->node[ctx->size - 1].val;
ctx->size--;
if (ctx->notifyNodeChange != NULL) {
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_DownHeap(ctx, node);
bHeap_UpHeap(ctx, node);
}
}
static BHEAP_VAL_TYPE* bHeap_GetTopVal(const BHeap_Ctx* const ctx) {
return ctx->size == 0 ? NULL : &(ctx->node[0].val);
}
typedef struct {
uint64_t cnt;
size_t* child;
size_t numChild;
size_t maxNumChild;
} Tree_Node;
#define TREE_INIT_ALLOC (128)
static Tree_Node tree_Node[200000];
static void tree_Init(const uint64_t N) {
for (uint64_t i = 0; i < N; i++) {
tree_Node[i].cnt = 0;
tree_Node[i].numChild = 0;
tree_Node[i].child = malloc(sizeof(size_t) * TREE_INIT_ALLOC);
tree_Node[i].maxNumChild = TREE_INIT_ALLOC;
}
}
static void tree_AddChild(const size_t parent, const size_t child) {
if (tree_Node[parent].maxNumChild <= tree_Node[parent].numChild) {
tree_Node[parent].child = realloc(tree_Node[parent].child, sizeof(size_t) * tree_Node[parent].maxNumChild * 2);
tree_Node[parent].maxNumChild *= 2;
}
tree_Node[parent].child[tree_Node[parent].numChild] = child;
tree_Node[parent].numChild++;
}
static BHeap_Node BN_Asc[200000];
static BHeap_Node BN_Desc[200000];
static int _bHeap_Compare_Asc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val <= node->val ? -1 : 1;
}
static int _bHeap_Compare_Desc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val >= node->val ? -1 : 1;
}
static size_t PBHeap_Asc_Idx[200000];
static size_t PBHeap_Desc_Idx[200000];
static void _bHeap_NotifyNodeChange_Asc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Asc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
static void _bHeap_NotifyNodeChange_Desc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Desc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
#define UF_ROOT ((size_t)10000000)
typedef struct {
size_t parent;
uint64_t w;
uint64_t v;
uint64_t wSum;
uint64_t vSum;
} UF_Node;
static UF_Node uf_Node[101];
static size_t uf_GetRoot(const size_t idx) {
if (uf_Node[idx].parent == UF_ROOT) {
return idx;
}
const size_t root = uf_GetRoot(uf_Node[idx].parent);
uf_Node[idx].parent = root;
return root;
}
static void uf_Merge(const size_t a, const size_t b) {
const size_t aRoot = uf_GetRoot(a);
const size_t bRoot = uf_GetRoot(b);
if (aRoot != bRoot) {
uf_Node[aRoot].parent = bRoot;
uf_Node[bRoot].wSum += uf_Node[aRoot].wSum;
uf_Node[bRoot].vSum += uf_Node[aRoot].vSum;
}
}
#define MOD_VAL (UINT64_C(1000000007))
static char S[200001];
static uint64_t dp[2][2019];
int main(void) {
scanf("%s", S);
const uint64_t len = (uint64_t)strlen(S);
uint64_t r = 0;
for (uint64_t i = 0; i < 2019; i++) {
dp[0][i] = 0;
}
dp[0][S[0] - '0'] = 1;
for (uint64_t i = 1; i < len; i++) {
for (uint64_t j = 0; j < 2019; j++) {
dp[i % 2][(10 * j + (uint64_t)(S[i] - '0')) % 2019] = dp[(i + 1) % 2][j];
}
dp[i % 2][S[i] - '0']++;
r += dp[i % 2][0];
}
printf("%"PRIu64, r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269370/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269370/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@S = internal global [200001 x i8] zeroinitializer, align 16
@dp = internal unnamed_addr global [2 x [2019 x i64]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%lu\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ugt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_u64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_u64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ugt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp slt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp sgt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_dp_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !10
%1 = load double, ptr %b, align 8, !tbaa !10
%cmp = fcmp olt double %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; 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 @S)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @S) #5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16152) @dp, i8 0, i64 16152, i1 false), !tbaa !5
%0 = load i8, ptr @S, align 16, !tbaa !9
%conv = sext i8 %0 to i64
%sub = add nsw i64 %conv, -48
%arrayidx2 = getelementptr inbounds [2019 x i64], ptr @dp, i64 0, i64 %sub
store i64 1, ptr %arrayidx2, align 8, !tbaa !5
%cmp559 = icmp ugt i64 %call1, 1
br i1 %cmp559, label %for.cond9.preheader, label %for.cond.cleanup7
for.cond9.preheader: ; preds = %entry, %for.cond.cleanup12
%i3.061 = phi i64 [ %inc41, %for.cond.cleanup12 ], [ 1, %entry ]
%r.060 = phi i64 [ %add39, %for.cond.cleanup12 ], [ 0, %entry ]
%1 = and i64 %i3.061, 1
%rem = xor i64 %1, 1
%arrayidx18 = getelementptr inbounds [200001 x i8], ptr @S, i64 0, i64 %i3.061
%2 = load i8, ptr %arrayidx18, align 1, !tbaa !9
%conv19 = sext i8 %2 to i64
br label %for.body13
for.cond.cleanup7: ; preds = %for.cond.cleanup12, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add39, %for.cond.cleanup12 ]
%call43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %r.0.lcssa)
ret i32 0
for.cond.cleanup12: ; preds = %for.body13
%arrayidx29 = getelementptr inbounds [2 x [2019 x i64]], ptr @dp, i64 0, i64 %1
%sub32 = add nsw i64 %conv19, -48
%arrayidx34 = getelementptr inbounds [2 x [2019 x i64]], ptr @dp, i64 0, i64 %1, i64 %sub32
%3 = load i64, ptr %arrayidx34, align 8, !tbaa !5
%inc35 = add i64 %3, 1
store i64 %inc35, ptr %arrayidx34, align 8, !tbaa !5
%4 = load i64, ptr %arrayidx29, align 8, !tbaa !5
%add39 = add i64 %4, %r.060
%inc41 = add nuw i64 %i3.061, 1
%exitcond62.not = icmp eq i64 %inc41, %call1
br i1 %exitcond62.not, label %for.cond.cleanup7, label %for.cond9.preheader, !llvm.loop !12
for.body13: ; preds = %for.body13.1, %for.cond9.preheader
%j.058 = phi i64 [ 0, %for.cond9.preheader ], [ %inc26.1, %for.body13.1 ]
%arrayidx15 = getelementptr inbounds [2 x [2019 x i64]], ptr @dp, i64 0, i64 %rem, i64 %j.058
%5 = load i64, ptr %arrayidx15, align 8, !tbaa !5
%mul = mul nuw nsw i64 %j.058, 10
%sub20 = add nsw i64 %mul, -48
%add22 = add nsw i64 %sub20, %conv19
%rem23 = urem i64 %add22, 2019
%arrayidx24 = getelementptr inbounds [2 x [2019 x i64]], ptr @dp, i64 0, i64 %1, i64 %rem23
store i64 %5, ptr %arrayidx24, align 8, !tbaa !5
%inc26 = or i64 %j.058, 1
%exitcond.not = icmp eq i64 %inc26, 2019
br i1 %exitcond.not, label %for.cond.cleanup12, label %for.body13.1, !llvm.loop !14
for.body13.1: ; preds = %for.body13
%arrayidx15.1 = getelementptr inbounds [2 x [2019 x i64]], ptr @dp, i64 0, i64 %rem, i64 %inc26
%6 = load i64, ptr %arrayidx15.1, align 8, !tbaa !5
%mul.1 = mul nuw nsw i64 %inc26, 10
%sub20.1 = add nsw i64 %mul.1, -48
%add22.1 = add nsw i64 %sub20.1, %conv19
%rem23.1 = urem i64 %add22.1, 2019
%arrayidx24.1 = getelementptr inbounds [2 x [2019 x i64]], ptr @dp, i64 0, i64 %1, i64 %rem23.1
store i64 %6, ptr %arrayidx24.1, align 8, !tbaa !5
%inc26.1 = add nuw nsw i64 %j.058, 2
br label %for.body13
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
#include<stdio.h>
#include<stdlib.h>
#define VMAX 999999999
typedef struct{
int n;
char c;
}member;
void quickSort(member *,int,int);
int partition(member *,int,int);
void swap(member *,member *);
void merge(member *,int,int,int);
void mergeSort(member *,int,int);
int main(){
int i,n,flag=0;
member *A,*B;
scanf("%d",&n);
A = (member *)malloc(n * sizeof(member));
B = (member *)malloc(n * sizeof(member));
for(i=0;i<n;i++){
scanf(" %c",&A[i].c);
scanf("%d",&A[i].n);
}
for(i=0;i<n;i++){
B[i].c=A[i].c;
B[i].n=A[i].n;
}
quickSort(A,0,n-1);
mergeSort(B,0,n);
for(i=0;i<n;i++){
if(!(A[i].c==B[i].c && A[i].n==B[i].n)){
flag = 1;
break;
}
}
if(flag==1) printf("Not stable\n");
else printf("Stable\n");
for(i=0;i<n;i++){
printf("%c %d\n",A[i].c,A[i].n);
}
free(A);
free(B);
return 0;
}
void quickSort(member *A,int p,int r){
int q;
if(p < r){
q = partition(A,p,r);
quickSort(A,p,q-1);
quickSort(A,q+1,r);
}
}
int partition(member *A,int p,int r){
int i,j;
member x;
x = A[r];
i = p-1;
for(j=p;j<r;j++){
if(A[j].n <= x.n){
i++;
swap(&A[i],&A[j]);
}
}
swap(&A[i+1],&A[r]);
return i+1;
}
void swap(member *x,member *y){
member r;
r=*x;
*x=*y;
*y=r;
}
void merge(member *A,int left,int mid,int right){
int n1,n2,i,j,k;
member *L,*R;
static int count;
n1 = mid - left;
n2 = right - mid;
L = (member *)malloc((n1+1) * sizeof(member));
R = (member *)malloc((n2+1) * sizeof(member));
for(i=0;i<n1;i++){
L[i].n=A[left+i].n;
L[i].c=A[left+i].c;
}
for(i=0;i<n2;i++){
R[i].n=A[mid+i].n;
R[i].c=A[mid+i].c;
}
L[n1].n=2147483647;
R[n2].n=2147483647;
i=0;
j=0;
for(k=left;k<right;k++){
count++;
if(L[i].n<=R[j].n){
A[k].n=L[i].n;
A[k].c=L[i].c;
i++;
}
else{
A[k].n=R[j].n;
A[k].c=R[j].c;
j++;
}
}
free(L);
free(R);
}
void mergeSort(member *A,int left,int right){
int mid;
if(left+1 < right){
mid = (left + right)/2;
mergeSort(A,left,mid);
mergeSort(A,mid,right);
merge(A,left,mid,right);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269420/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269420/source.c"
target datalayout = "e-m:e-p270: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.member = type { i32, i8 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@merge.count = internal unnamed_addr global i32 0, align 4
@str = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@str.5 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
%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, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #10
%call4 = call noalias ptr @malloc(i64 noundef %mul) #10
%cmp110 = icmp sgt i32 %0, 0
br i1 %cmp110, label %for.body, label %for.end29
for.cond11.preheader: ; preds = %for.body
%cmp12112 = icmp sgt i32 %2, 0
br i1 %cmp12112, label %for.body14.preheader, label %for.end29
for.body14.preheader: ; preds = %for.cond11.preheader
%wide.trip.count = zext i32 %2 to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %2, 1
br i1 %1, label %for.end29.loopexit.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.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv
%c = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv, i32 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %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.cond11.preheader, !llvm.loop !9
for.body14: ; preds = %for.body14, %for.body14.preheader.new
%indvars.iv120 = phi i64 [ 0, %for.body14.preheader.new ], [ %indvars.iv.next121.1, %for.body14 ]
%niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.1, %for.body14 ]
%arrayidx16 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv120
%c17 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv120, i32 1
%4 = load i8, ptr %c17, align 4, !tbaa !11
%arrayidx19 = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv120
%c20 = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv120, i32 1
store i8 %4, ptr %c20, align 4, !tbaa !11
%5 = load i32, ptr %arrayidx16, align 4, !tbaa !13
store i32 %5, ptr %arrayidx19, align 4, !tbaa !13
%indvars.iv.next121 = or i64 %indvars.iv120, 1
%arrayidx16.1 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv.next121
%c17.1 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv.next121, i32 1
%6 = load i8, ptr %c17.1, align 4, !tbaa !11
%arrayidx19.1 = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv.next121
%c20.1 = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv.next121, i32 1
store i8 %6, ptr %c20.1, align 4, !tbaa !11
%7 = load i32, ptr %arrayidx16.1, align 4, !tbaa !13
store i32 %7, ptr %arrayidx19.1, align 4, !tbaa !13
%indvars.iv.next121.1 = add nuw nsw i64 %indvars.iv120, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end29.loopexit.unr-lcssa, label %for.body14, !llvm.loop !14
for.end29.loopexit.unr-lcssa: ; preds = %for.body14, %for.body14.preheader
%indvars.iv120.unr = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next121.1, %for.body14 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.body14.epil
for.body14.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx16.epil = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv120.unr
%c17.epil = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv120.unr, i32 1
%8 = load i8, ptr %c17.epil, align 4, !tbaa !11
%arrayidx19.epil = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv120.unr
%c20.epil = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv120.unr, i32 1
store i8 %8, ptr %c20.epil, align 4, !tbaa !11
%9 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !13
store i32 %9, ptr %arrayidx19.epil, align 4, !tbaa !13
br label %for.end29
for.end29: ; preds = %for.body14.epil, %for.end29.loopexit.unr-lcssa, %entry, %for.cond11.preheader
%.lcssa133 = phi i32 [ %2, %for.cond11.preheader ], [ %0, %entry ], [ %2, %for.end29.loopexit.unr-lcssa ], [ %2, %for.body14.epil ]
%sub = add nsw i32 %.lcssa133, -1
call void @quickSort(ptr noundef %call1, i32 noundef 0, i32 noundef %sub)
call void @mergeSort(ptr noundef %call4, i32 noundef 0, i32 noundef %.lcssa133)
%10 = load i32, ptr %n, align 4, !tbaa !5
%cmp31114 = icmp sgt i32 %10, 0
br i1 %cmp31114, label %for.body33.preheader, label %if.end60
for.body33.preheader: ; preds = %for.end29
%wide.trip.count126 = zext i32 %10 to i64
br label %for.body33
for.cond30: ; preds = %land.lhs.true
%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 %if.end60, label %for.body33, !llvm.loop !15
for.body33: ; preds = %for.body33.preheader, %for.cond30
%indvars.iv123 = phi i64 [ 0, %for.body33.preheader ], [ %indvars.iv.next124, %for.cond30 ]
%c36 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv123, i32 1
%11 = load i8, ptr %c36, align 4, !tbaa !11
%c40 = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv123, i32 1
%12 = load i8, ptr %c40, align 4, !tbaa !11
%cmp42 = icmp eq i8 %11, %12
br i1 %cmp42, label %land.lhs.true, label %if.end60
land.lhs.true: ; preds = %for.body33
%arrayidx39 = getelementptr inbounds %struct.member, ptr %call4, i64 %indvars.iv123
%arrayidx35 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv123
%13 = load i32, ptr %arrayidx35, align 4, !tbaa !13
%14 = load i32, ptr %arrayidx39, align 4, !tbaa !13
%cmp50 = icmp eq i32 %13, %14
br i1 %cmp50, label %for.cond30, label %if.end60
if.end60: ; preds = %for.cond30, %for.body33, %land.lhs.true, %for.end29
%str.sink = phi ptr [ @str, %for.end29 ], [ @str.5, %land.lhs.true ], [ @str.5, %for.body33 ], [ @str, %for.cond30 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%15 = load i32, ptr %n, align 4, !tbaa !5
%cmp62116 = icmp sgt i32 %15, 0
br i1 %cmp62116, label %for.body64, label %for.end75
for.body64: ; preds = %if.end60, %for.body64
%indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.body64 ], [ 0, %if.end60 ]
%arrayidx66 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv128
%c67 = getelementptr inbounds %struct.member, ptr %call1, i64 %indvars.iv128, i32 1
%16 = load i8, ptr %c67, align 4, !tbaa !11
%conv68 = sext i8 %16 to i32
%17 = load i32, ptr %arrayidx66, align 4, !tbaa !13
%call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv68, i32 noundef %17)
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp62 = icmp slt i64 %indvars.iv.next129, %19
br i1 %cmp62, label %for.body64, label %for.end75, !llvm.loop !16
for.end75: ; preds = %for.body64, %if.end60
call void @free(ptr noundef %call1) #9
call void @free(ptr noundef %call4) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom.i
%0 = sub nsw i64 0, %idxprom.i
%invariant.gep = getelementptr %struct.member, ptr %A, i64 1
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.0.0.copyload.i = load i32, ptr %arrayidx.i, align 4, !tbaa.struct !17
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%arrayidx2.i.prol = getelementptr inbounds %struct.member, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.i.prol, align 4, !tbaa !13
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.0.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%idxprom5.i.prol = sext i32 %p.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.031.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.031.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.031.i.unr, %for.body.i.prol.loopexit ]
%arrayidx2.i = getelementptr inbounds %struct.member, ptr %A, i64 %indvars.iv.i
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !13
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.0.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.031.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.031.i, %for.body.i ]
%gep = getelementptr %struct.member, ptr %invariant.gep, i64 %indvars.iv.i
%11 = load i32, ptr %gep, align 4, !tbaa !13
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.0.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %gep, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %gep, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !19
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom10.i = sext i32 %14 to i64
%arrayidx11.i = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom10.i
%15 = load i64, ptr %arrayidx11.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx11.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %common.ret12
common.ret12: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
tail call void @merge(ptr noundef %A, i32 noundef %left, i32 noundef %div, i32 noundef %right)
br label %common.ret12
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #6 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom
%x.sroa.0.0.copyload = load i32, ptr %arrayidx, align 4, !tbaa.struct !17
%cmp29 = icmp slt i32 %p, %r
br i1 %cmp29, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds %struct.member, ptr %A, i64 %0
%2 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !13
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.0.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.031.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr %struct.member, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.031 = phi i32 [ %i.031.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds %struct.member, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !13
%cmp4.not = icmp sgt i32 %8, %x.sroa.0.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.031, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.031, %for.body ]
%gep = getelementptr %struct.member, ptr %invariant.gep, i64 %indvars.iv
%11 = load i32, ptr %gep, align 4, !tbaa !13
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.0.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %gep, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %gep, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !19
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom10 = sext i32 %i.0.lcssa to i64
%arrayidx11 = getelementptr inbounds %struct.member, ptr %A, i64 %idxprom10
%15 = load i64, ptr %arrayidx11, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx11, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #7 {
entry:
%0 = load i64, ptr %x, align 4
%1 = load i64, ptr %y, align 4
store i64 %1, ptr %x, align 4
store i64 %0, ptr %y, align 4
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%sub = sub nsw i32 %mid, %left
%sub1 = sub nsw i32 %right, %mid
%add = add nsw i32 %sub, 1
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 3
%call = tail call noalias ptr @malloc(i64 noundef %mul) #10
%add2 = add nsw i32 %sub1, 1
%conv3 = sext i32 %add2 to i64
%mul4 = shl nsw i64 %conv3, 3
%call5 = tail call noalias ptr @malloc(i64 noundef %mul4) #10
%cmp140 = icmp sgt i32 %sub, 0
br i1 %cmp140, label %for.body.preheader, label %for.cond17.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %sub, 1
br i1 %1, label %for.cond17.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.cond17.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond17.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond17.preheader.loopexit.unr-lcssa
%2 = add nsw i64 %indvars.iv.unr, %0
%arrayidx.epil = getelementptr inbounds %struct.member, ptr %A, i64 %2
%3 = load i32, ptr %arrayidx.epil, align 4, !tbaa !13
%arrayidx9.epil = getelementptr inbounds %struct.member, ptr %call, i64 %indvars.iv.unr
store i32 %3, ptr %arrayidx9.epil, align 4, !tbaa !13
%c.epil = getelementptr inbounds %struct.member, ptr %A, i64 %2, i32 1
%4 = load i8, ptr %c.epil, align 4, !tbaa !11
%c16.epil = getelementptr inbounds %struct.member, ptr %call, i64 %indvars.iv.unr, i32 1
store i8 %4, ptr %c16.epil, align 4, !tbaa !11
br label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.body.epil, %for.cond17.preheader.loopexit.unr-lcssa, %entry
%cmp18142 = icmp sgt i32 %sub1, 0
br i1 %cmp18142, label %for.body20.preheader, label %for.end37
for.body20.preheader: ; preds = %for.cond17.preheader
%5 = sext i32 %mid to i64
%wide.trip.count156 = zext i32 %sub1 to i64
%xtraiter164 = and i64 %wide.trip.count156, 1
%6 = icmp eq i32 %sub1, 1
br i1 %6, label %for.end37.loopexit.unr-lcssa, label %for.body20.preheader.new
for.body20.preheader.new: ; preds = %for.body20.preheader
%unroll_iter166 = and i64 %wide.trip.count156, 4294967294
br label %for.body20
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%7 = add nsw i64 %indvars.iv, %0
%arrayidx = getelementptr inbounds %struct.member, ptr %A, i64 %7
%8 = load i32, ptr %arrayidx, align 4, !tbaa !13
%arrayidx9 = getelementptr inbounds %struct.member, ptr %call, i64 %indvars.iv
store i32 %8, ptr %arrayidx9, align 4, !tbaa !13
%c = getelementptr inbounds %struct.member, ptr %A, i64 %7, i32 1
%9 = load i8, ptr %c, align 4, !tbaa !11
%c16 = getelementptr inbounds %struct.member, ptr %call, i64 %indvars.iv, i32 1
store i8 %9, ptr %c16, align 4, !tbaa !11
%indvars.iv.next = or i64 %indvars.iv, 1
%10 = add nsw i64 %indvars.iv.next, %0
%arrayidx.1 = getelementptr inbounds %struct.member, ptr %A, i64 %10
%11 = load i32, ptr %arrayidx.1, align 4, !tbaa !13
%arrayidx9.1 = getelementptr inbounds %struct.member, ptr %call, i64 %indvars.iv.next
store i32 %11, ptr %arrayidx9.1, align 4, !tbaa !13
%c.1 = getelementptr inbounds %struct.member, ptr %A, i64 %10, i32 1
%12 = load i8, ptr %c.1, align 4, !tbaa !11
%c16.1 = getelementptr inbounds %struct.member, ptr %call, i64 %indvars.iv.next, i32 1
store i8 %12, ptr %c16.1, align 4, !tbaa !11
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond17.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !20
for.body20: ; preds = %for.body20, %for.body20.preheader.new
%indvars.iv152 = phi i64 [ 0, %for.body20.preheader.new ], [ %indvars.iv.next153.1, %for.body20 ]
%niter167 = phi i64 [ 0, %for.body20.preheader.new ], [ %niter167.next.1, %for.body20 ]
%13 = add nsw i64 %indvars.iv152, %5
%arrayidx23 = getelementptr inbounds %struct.member, ptr %A, i64 %13
%14 = load i32, ptr %arrayidx23, align 4, !tbaa !13
%arrayidx26 = getelementptr inbounds %struct.member, ptr %call5, i64 %indvars.iv152
store i32 %14, ptr %arrayidx26, align 4, !tbaa !13
%c31 = getelementptr inbounds %struct.member, ptr %A, i64 %13, i32 1
%15 = load i8, ptr %c31, align 4, !tbaa !11
%c34 = getelementptr inbounds %struct.member, ptr %call5, i64 %indvars.iv152, i32 1
store i8 %15, ptr %c34, align 4, !tbaa !11
%indvars.iv.next153 = or i64 %indvars.iv152, 1
%16 = add nsw i64 %indvars.iv.next153, %5
%arrayidx23.1 = getelementptr inbounds %struct.member, ptr %A, i64 %16
%17 = load i32, ptr %arrayidx23.1, align 4, !tbaa !13
%arrayidx26.1 = getelementptr inbounds %struct.member, ptr %call5, i64 %indvars.iv.next153
store i32 %17, ptr %arrayidx26.1, align 4, !tbaa !13
%c31.1 = getelementptr inbounds %struct.member, ptr %A, i64 %16, i32 1
%18 = load i8, ptr %c31.1, align 4, !tbaa !11
%c34.1 = getelementptr inbounds %struct.member, ptr %call5, i64 %indvars.iv.next153, i32 1
store i8 %18, ptr %c34.1, align 4, !tbaa !11
%indvars.iv.next153.1 = add nuw nsw i64 %indvars.iv152, 2
%niter167.next.1 = add i64 %niter167, 2
%niter167.ncmp.1 = icmp eq i64 %niter167.next.1, %unroll_iter166
br i1 %niter167.ncmp.1, label %for.end37.loopexit.unr-lcssa, label %for.body20, !llvm.loop !21
for.end37.loopexit.unr-lcssa: ; preds = %for.body20, %for.body20.preheader
%indvars.iv152.unr = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next153.1, %for.body20 ]
%lcmp.mod165.not = icmp eq i64 %xtraiter164, 0
br i1 %lcmp.mod165.not, label %for.end37, label %for.body20.epil
for.body20.epil: ; preds = %for.end37.loopexit.unr-lcssa
%19 = add nsw i64 %indvars.iv152.unr, %5
%arrayidx23.epil = getelementptr inbounds %struct.member, ptr %A, i64 %19
%20 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !13
%arrayidx26.epil = getelementptr inbounds %struct.member, ptr %call5, i64 %indvars.iv152.unr
store i32 %20, ptr %arrayidx26.epil, align 4, !tbaa !13
%c31.epil = getelementptr inbounds %struct.member, ptr %A, i64 %19, i32 1
%21 = load i8, ptr %c31.epil, align 4, !tbaa !11
%c34.epil = getelementptr inbounds %struct.member, ptr %call5, i64 %indvars.iv152.unr, i32 1
store i8 %21, ptr %c34.epil, align 4, !tbaa !11
br label %for.end37
for.end37: ; preds = %for.body20.epil, %for.end37.loopexit.unr-lcssa, %for.cond17.preheader
%idxprom38 = sext i32 %sub to i64
%arrayidx39 = getelementptr inbounds %struct.member, ptr %call, i64 %idxprom38
store i32 2147483647, ptr %arrayidx39, align 4, !tbaa !13
%idxprom41 = sext i32 %sub1 to i64
%arrayidx42 = getelementptr inbounds %struct.member, ptr %call5, i64 %idxprom41
store i32 2147483647, ptr %arrayidx42, align 4, !tbaa !13
%cmp45145 = icmp slt i32 %left, %right
br i1 %cmp45145, label %for.body47.preheader, label %for.end85
for.body47.preheader: ; preds = %for.end37
%merge.count.promoted = load i32, ptr @merge.count, align 4, !tbaa !5
%22 = sext i32 %left to i64
%23 = add i32 %merge.count.promoted, %right
%wide.trip.count161 = sext i32 %right to i64
br label %for.body47
for.body47: ; preds = %for.body47.preheader, %for.inc83
%indvars.iv158 = phi i64 [ %22, %for.body47.preheader ], [ %indvars.iv.next159, %for.inc83 ]
%i.2149 = phi i32 [ 0, %for.body47.preheader ], [ %i.3, %for.inc83 ]
%j.0148 = phi i32 [ 0, %for.body47.preheader ], [ %j.1, %for.inc83 ]
%idxprom49 = sext i32 %i.2149 to i64
%arrayidx50 = getelementptr inbounds %struct.member, ptr %call, i64 %idxprom49
%24 = load i32, ptr %arrayidx50, align 4, !tbaa !13
%idxprom52 = sext i32 %j.0148 to i64
%arrayidx53 = getelementptr inbounds %struct.member, ptr %call5, i64 %idxprom52
%25 = load i32, ptr %arrayidx53, align 4, !tbaa !13
%cmp55.not = icmp sgt i32 %24, %25
br i1 %cmp55.not, label %if.else, label %if.then
if.then: ; preds = %for.body47
%c65 = getelementptr inbounds %struct.member, ptr %call, i64 %idxprom49, i32 1
%inc69 = add nsw i32 %i.2149, 1
br label %for.inc83
if.else: ; preds = %for.body47
%c78 = getelementptr inbounds %struct.member, ptr %call5, i64 %idxprom52, i32 1
%inc82 = add nsw i32 %j.0148, 1
br label %for.inc83
for.inc83: ; preds = %if.then, %if.else
%.sink163 = phi i32 [ %25, %if.else ], [ %24, %if.then ]
%.sink.in = phi ptr [ %c78, %if.else ], [ %c65, %if.then ]
%j.1 = phi i32 [ %inc82, %if.else ], [ %j.0148, %if.then ]
%i.3 = phi i32 [ %i.2149, %if.else ], [ %inc69, %if.then ]
%.sink = load i8, ptr %.sink.in, align 4, !tbaa !11
%26 = getelementptr inbounds %struct.member, ptr %A, i64 %indvars.iv158
store i32 %.sink163, ptr %26, align 4
%27 = getelementptr inbounds %struct.member, ptr %A, i64 %indvars.iv158, i32 1
store i8 %.sink, ptr %27, align 4
%indvars.iv.next159 = add nsw i64 %indvars.iv158, 1
%exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161
br i1 %exitcond162.not, label %for.cond44.for.end85_crit_edge, label %for.body47, !llvm.loop !22
for.cond44.for.end85_crit_edge: ; preds = %for.inc83
%28 = sub i32 %23, %left
store i32 %28, ptr @merge.count, align 4, !tbaa !5
br label %for.end85
for.end85: ; preds = %for.cond44.for.end85_crit_edge, %for.end37
tail call void @free(ptr noundef nonnull %call) #9
tail call void @free(ptr noundef nonnull %call5) #9
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree norecurse nosync nounwind memory(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 #7 = { 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 #8 = { nofree nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !7, i64 4}
!12 = !{!"", !6, i64 0, !7, i64 4}
!13 = !{!12, !6, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = !{i64 0, i64 4, !5, i64 4, i64 1, !18}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
|
#include<stdio.h>
#define N 100000
typedef struct{
char c;
int n;
int r;
}Card;
void quickSort(Card[],int,int);
int partition(Card[],int,int);
int isStable(Card[]);
int n;
int main(){
int i;
Card A[N];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf(" %c %d",&A[i].c,&A[i].n);
A[i].r=i;
}
quickSort(A,0,n-1);
if(isStable(A)) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++){
printf("%c %d\n",A[i].c,A[i].n);
}
return 0;
}
void quickSort(Card A[],int p,int r){
int q;
if(p<r){
q = partition(A,p,r);
quickSort(A,p,q-1);
quickSort(A,q+1,r);
}
return;
}
int partition(Card A[], int p, int r){
int x,i,j;
Card tmp;
x=A[r].n;
i = p-1;
for(j=p;j<r;j++){
if(A[j].n<=x){
i = i+1;
tmp=A[i];
A[i]=A[j];
A[j]=tmp;
}
}
tmp=A[i+1];
A[i+1]=A[r];
A[r]=tmp;
return i+1;
}
int isStable(Card A[]){
int i;
for(i=0;i<n;i++){
if( A[i].n == A[i+1].n && A[i].r > A[i+1].r ) return 0;
}
return 1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269479/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269479/source.c"
target datalayout = "e-m:e-p270: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.Card = type { i8, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [7 x i8] c" %c %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [100000 x %struct.Card], align 16
call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %A) #7
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub45 = add nsw i32 %0, -1
call void @quickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub45)
br label %if.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
%n = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %n)
%r = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 2
%1 = trunc i64 %indvars.iv to i32
store i32 %1, ptr %r, align 4, !tbaa !9
%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 !11
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
call void @quickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub)
%cmp20.i = icmp sgt i32 %2, 0
br i1 %cmp20.i, label %for.body.preheader.i, label %if.end
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %2 to i64
%n.phi.trans.insert.i = getelementptr inbounds %struct.Card, ptr %A, i64 0, i32 1
%.pre.i = load i32, ptr %n.phi.trans.insert.i, align 4, !tbaa !13
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%4 = phi i32 [ %.pre.i, %for.body.preheader.i ], [ %5, %for.inc.i ]
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%n3.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%5 = load i32, ptr %n3.i, align 4, !tbaa !13
%cmp4.i = icmp eq i32 %4, %5
br i1 %cmp4.i, label %land.lhs.true.i, label %for.inc.i
land.lhs.true.i: ; preds = %for.body.i
%r.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 2
%6 = load i32, ptr %r.i, align 4, !tbaa !9
%r10.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 2
%7 = load i32, ptr %r10.i, align 4, !tbaa !9
%cmp11.i = icmp sgt i32 %6, %7
br i1 %cmp11.i, label %if.end, label %for.inc.i
for.inc.i: ; preds = %land.lhs.true.i, %for.body.i
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %if.end, label %for.body.i, !llvm.loop !14
if.end: ; preds = %land.lhs.true.i, %for.inc.i, %for.end, %for.end.thread
%str.sink = phi ptr [ @str.5, %for.end.thread ], [ @str.5, %for.end ], [ @str.5, %for.inc.i ], [ @str, %land.lhs.true.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%8 = load i32, ptr @n, align 4, !tbaa !5
%cmp1137 = icmp sgt i32 %8, 0
br i1 %cmp1137, label %for.body12, label %for.end22
for.body12: ; preds = %if.end, %for.body12
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body12 ], [ 0, %if.end ]
%arrayidx14 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv41
%9 = load i8, ptr %arrayidx14, align 4, !tbaa !15
%conv = sext i8 %9 to i32
%n18 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv41, i32 1
%10 = load i32, ptr %n18, align 4, !tbaa !13
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %10)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%11 = load i32, ptr @n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp11 = icmp slt i64 %indvars.iv.next42, %12
br i1 %cmp11, label %for.body12, label %for.end22, !llvm.loop !16
for.end22: ; preds = %for.body12, %if.end
call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %A) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%tmp.i = alloca %struct.Card, align 4
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%n.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i, i32 1
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp.i)
%0 = load i32, ptr %n.i, align 4, !tbaa !13
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.047.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ]
%n3.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%2 = load i32, ptr %n3.i, align 4, !tbaa !13
%cmp4.not.i = icmp sgt i32 %2, %0
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%add.i = add nsw i32 %i.047.i, 1
%idxprom5.i = sext i32 %add.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, i64 12, i1 false), !tbaa.struct !17
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !17
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %partition.exit, label %for.body.i, !llvm.loop !19
partition.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
%idxprom14.i = sext i32 %3 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, i64 12, i1 false), !tbaa.struct !17
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp.i, i64 12, i1 false), !tbaa.struct !17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp.i)
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @isStable(ptr nocapture noundef readonly %A) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%n.phi.trans.insert = getelementptr inbounds %struct.Card, ptr %A, i64 0, i32 1
%.pre = load i32, ptr %n.phi.trans.insert, align 4, !tbaa !13
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%1 = phi i32 [ %.pre, %for.body.preheader ], [ %2, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%n3 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%2 = load i32, ptr %n3, align 4, !tbaa !13
%cmp4 = icmp eq i32 %1, %2
br i1 %cmp4, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%r = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 2
%3 = load i32, ptr %r, align 4, !tbaa !9
%r10 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 2
%4 = load i32, ptr %r10, align 4, !tbaa !9
%cmp11 = icmp sgt i32 %3, %4
br i1 %cmp11, label %cleanup, label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !14
cleanup: ; preds = %land.lhs.true, %for.inc, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ 0, %land.lhs.true ]
ret i32 %retval.0
}
; Function Attrs: nofree 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 nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%tmp = alloca %struct.Card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp)
%idxprom = sext i32 %r to i64
%n = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom, i32 1
%0 = load i32, ptr %n, align 4, !tbaa !13
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.047 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%n3 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%2 = load i32, ptr %n3, align 4, !tbaa !13
%cmp4.not = icmp sgt i32 %2, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%add = add nsw i32 %i.047, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, i64 12, i1 false), !tbaa.struct !17
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx6, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, ptr noundef nonnull align 4 dereferenceable(12) %tmp, i64 12, i1 false), !tbaa.struct !17
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.047, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !19
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %3, %for.end.loopexit ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, i64 12, i1 false), !tbaa.struct !17
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx15, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %tmp, i64 12, i1 false), !tbaa.struct !17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp)
ret i32 %i.0.lcssa
}
; 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) #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"", !7, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !12}
!15 = !{!10, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{i64 0, i64 1, !18, i64 4, i64 4, !5, i64 8, i64 4, !5}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !12}
|
#include<stdio.h>
#include<stdlib.h>
typedef struct{
char mark;
int num;
int order;
}card;
int partition(card *,int,int);
void sort(card *,int,int);
int main(){
card *C;
int i,j,n,judge=0;
char a,b;
scanf("%d%c",&n,&a);
C=(card*)malloc(sizeof(card)*n*2+1);
for(i=0;i<n;i++){
scanf("%c%c%d%c",&C[i].mark,&a,&C[i].num,&b);
C[i].order=i;
}
sort(C,0,i-1);
for(i=0;i<n;i++){
if(C[i].num==C[i+1].num){
if(C[i].order>C[i+1].order){
judge=1;
break;
}
}
}
if(judge==0){
printf("Stable\n");
}else{
printf("Not stable\n");
}
for(i=0;i<n;i++){
printf("%c %d\n",C[i].mark,C[i].num);
}
free(C);
return 0;
}
void sort(card *C,int p,int r){
int q;
if(p<r){
q=partition(C,p,r);
sort(C,p,q-1);
sort(C,q+1,r);
}
}
int partition(card *C,int p,int r){
card change;
int i=p-1,j;
int x=C[r].num;
for(j=p;j<r;j++){
if(C[j].num<=x){
i=i+1;
change=C[j];
C[j]=C[i];
C[i]=change;
}
}
change=C[r];
C[r]=C[i+1];
C[i+1]=change;
return i+1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269521/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269521/source.c"
target datalayout = "e-m:e-p270: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.card = type { i8, i32, i32 }
@.str = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%c%c%d%c\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i8, align 1
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul1 = mul nsw i64 %conv, 24
%add = or i64 %mul1, 1
%call2 = call noalias ptr @malloc(i64 noundef %add) #9
%cmp84 = icmp sgt i32 %0, 0
br i1 %cmp84, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
call void @sort(ptr noundef %call2, i32 noundef 0, i32 noundef -1)
br label %if.end41
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv
%num = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv, i32 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef nonnull %a, ptr noundef nonnull %num, ptr noundef nonnull %b)
%order = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv, i32 2
%1 = trunc i64 %indvars.iv to i32
store i32 %1, ptr %order, align 4, !tbaa !9
%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 !11
for.end: ; preds = %for.body
call void @sort(ptr noundef nonnull %call2, i32 noundef 0, i32 noundef %1)
%cmp10.not87 = icmp sgt i32 %2, 0
br i1 %cmp10.not87, label %for.body12.preheader, label %if.end41
for.body12.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %2 to i64
%num15.phi.trans.insert = getelementptr inbounds %struct.card, ptr %call2, i64 0, i32 1
%.pre = load i32, ptr %num15.phi.trans.insert, align 4, !tbaa !13
br label %for.body12
for.body12: ; preds = %for.body12.preheader, %for.inc33
%4 = phi i32 [ %.pre, %for.body12.preheader ], [ %5, %for.inc33 ]
%indvars.iv93 = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next94, %for.inc33 ]
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%num19 = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv.next94, i32 1
%5 = load i32, ptr %num19, align 4, !tbaa !13
%cmp20 = icmp eq i32 %4, %5
br i1 %cmp20, label %if.then, label %for.inc33
if.then: ; preds = %for.body12
%order24 = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv93, i32 2
%6 = load i32, ptr %order24, align 4, !tbaa !9
%order28 = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv.next94, i32 2
%7 = load i32, ptr %order28, align 4, !tbaa !9
%cmp29 = icmp sgt i32 %6, %7
br i1 %cmp29, label %if.end41, label %for.inc33
for.inc33: ; preds = %for.body12, %if.then
%exitcond.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count
br i1 %exitcond.not, label %if.end41, label %for.body12, !llvm.loop !14
if.end41: ; preds = %if.then, %for.inc33, %for.end, %for.end.thread
%str.sink = phi ptr [ @str.5, %for.end.thread ], [ @str.5, %for.end ], [ @str.5, %for.inc33 ], [ @str, %if.then ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp4389 = icmp sgt i32 %8, 0
br i1 %cmp4389, label %for.body45, label %for.end56
for.body45: ; preds = %if.end41, %for.body45
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.body45 ], [ 0, %if.end41 ]
%arrayidx47 = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv96
%9 = load i8, ptr %arrayidx47, align 4, !tbaa !15
%conv49 = sext i8 %9 to i32
%num52 = getelementptr inbounds %struct.card, ptr %call2, i64 %indvars.iv96, i32 1
%10 = load i32, ptr %num52, align 4, !tbaa !13
%call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv49, i32 noundef %10)
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp43 = icmp slt i64 %indvars.iv.next97, %12
br i1 %cmp43, label %for.body45, label %for.end56, !llvm.loop !16
for.end56: ; preds = %for.body45, %if.end41
call void @free(ptr noundef %call2) #8
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort(ptr nocapture noundef %C, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%change.i = alloca %struct.card, align 4
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%num.i = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom.i, i32 1
%arrayidx.i = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %change.i)
%0 = load i32, ptr %num.i, align 4, !tbaa !13
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.048.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ]
%num3.i = getelementptr inbounds %struct.card, ptr %C, i64 %indvars.iv.i, i32 1
%2 = load i32, ptr %num3.i, align 4, !tbaa !13
%cmp4.not.i = icmp sgt i32 %2, %0
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.card, ptr %C, i64 %indvars.iv.i
%add.i = add nsw i32 %i.048.i, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %change.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, i64 12, i1 false), !tbaa.struct !17
%idxprom9.i = sext i32 %add.i to i64
%arrayidx10.i = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom9.i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx10.i, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx10.i, ptr noundef nonnull align 4 dereferenceable(12) %change.i, i64 12, i1 false), !tbaa.struct !17
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %partition.exit, label %for.body.i, !llvm.loop !19
partition.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %change.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !17
%idxprom18.i = sext i32 %3 to i64
%arrayidx19.i = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom18.i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx19.i, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx19.i, ptr noundef nonnull align 4 dereferenceable(12) %change.i, i64 12, i1 false), !tbaa.struct !17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %change.i)
tail call void @sort(ptr noundef nonnull %C, i32 noundef %p.tr9, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %C, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%change = alloca %struct.card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %change)
%idxprom = sext i32 %r to i64
%num = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom, i32 1
%0 = load i32, ptr %num, align 4, !tbaa !13
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.048 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%num3 = getelementptr inbounds %struct.card, ptr %C, i64 %indvars.iv, i32 1
%2 = load i32, ptr %num3, align 4, !tbaa !13
%cmp4.not = icmp sgt i32 %2, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.card, ptr %C, i64 %indvars.iv
%add = add nsw i32 %i.048, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %change, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, i64 12, i1 false), !tbaa.struct !17
%idxprom9 = sext i32 %add to i64
%arrayidx10 = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom9
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx2, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx10, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx10, ptr noundef nonnull align 4 dereferenceable(12) %change, i64 12, i1 false), !tbaa.struct !17
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !19
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %3, %for.end.loopexit ]
%arrayidx = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %change, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !17
%idxprom18 = sext i32 %i.0.lcssa to i64
%arrayidx19 = getelementptr inbounds %struct.card, ptr %C, i64 %idxprom18
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx19, i64 12, i1 false), !tbaa.struct !17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx19, ptr noundef nonnull align 4 dereferenceable(12) %change, i64 12, i1 false), !tbaa.struct !17
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %change)
ret i32 %i.0.lcssa
}
; 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) #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"", !7, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 4}
!14 = distinct !{!14, !12}
!15 = !{!10, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = !{i64 0, i64 1, !18, i64 4, i64 4, !5, i64 8, i64 4, !5}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !12}
|
#include <stdio.h>
#define stn 200000000;
typedef struct{
char mk;
int num;
}C;
void merge(C A[],int n,int left,int mid,int right);
void mergeSort(C A[],int n,int left,int right);
int partition(C A[],int n,int p,int r);
void quickSort(C A[],int n,int p,int r);
int isStable(C in[],C out[]);
C L[50000],R[50000];
int n;
int main(){
int i;
C A[100001],A2[100001];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf(" %c%d",&A[i].mk,&A[i].num);
A2[i]=A[i];
}
mergeSort(A,n,0,n);
quickSort(A2,n,0,n-1);
if(isStable(A,A2)) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++) printf("%c %d\n",A2[i].mk,A2[i].num);
return 0;
}
int partition(C A[],int n,int p,int r)
{
int i,j;
C x,temp;
x = A[r];
i = p-1;
for(j=p;j<r;j++){
if(A[j].num<=x.num){
i=i+1;
temp=A[i];
A[i]=A[j];
A[j]=temp;
}
}
temp=A[i+1];
A[i+1]=A[r];
A[r]=temp;
return i+1;
}
void quickSort(C A[],int n,int p,int r)
{
int q;
if(p<r){
q=partition(A,n,p,r);
quickSort(A,n,p,q-1);
quickSort(A,n,q+1,r);
}
}
void merge(C A[],int n,int left,int mid,int right)
{
int i,j=0,k;
int n1=mid-left;
int n2=right-mid;
for(i=0;i<n1;i++) L[i]=A[left+i];
for(i=0;i<n2;i++) R[i]=A[mid+i];
L[n1].num=R[n2].num=stn;
i=0;
for(k=left;k<right;k++){
if(L[i].num<=R[j].num){
A[k]=L[i++];
}
else A[k]=R[j++];
}
}
void mergeSort(C A[],int n,int left,int right)
{
int mid;
if(left+1<right){
mid=(left+right)/2;
mergeSort(A,n,left,mid);
mergeSort(A,n,mid,right);
merge(A,n,left,mid,right);
}
}
int isStable(C A[],C A2[])
{
int i;
for(i=0;i<n;i++){
if( A[i].num != A2[i].num || A[i].mk != A2[i].mk )
return 0;
}
return 1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269572/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269572/source.c"
target datalayout = "e-m:e-p270: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.C = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [6 x i8] c" %c%d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@L = dso_local local_unnamed_addr global [50000 x %struct.C] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50000 x %struct.C] zeroinitializer, align 16
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [100001 x %struct.C], align 16
%A2 = alloca [100001 x %struct.C], align 16
call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %A) #9
call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %A2) #9
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, 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 [100001 x %struct.C], ptr %A, i64 0, i64 %indvars.iv
%num = getelementptr inbounds [100001 x %struct.C], ptr %A, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %num)
%arrayidx5 = getelementptr inbounds [100001 x %struct.C], ptr %A2, i64 0, i64 %indvars.iv
%1 = load i64, ptr %arrayidx, align 8
store i64 %1, ptr %arrayidx5, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr @n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%4 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
call void @quickSort(ptr noundef nonnull %A2, i32 noundef %4, i32 noundef 0, i32 noundef %sub)
%cmp20.i = icmp sgt i32 %4, 0
br i1 %cmp20.i, label %for.body.preheader.i, label %if.end
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %4 to i64
br label %for.body.i
for.cond.i: ; preds = %lor.lhs.false.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 %if.end, label %for.body.i, !llvm.loop !11
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%num.i = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.i, i32 1
%5 = load i32, ptr %num.i, align 4, !tbaa !12
%num3.i = getelementptr inbounds %struct.C, ptr %A2, i64 %indvars.iv.i, i32 1
%6 = load i32, ptr %num3.i, align 4, !tbaa !12
%cmp4.not.i = icmp eq i32 %5, %6
br i1 %cmp4.not.i, label %lor.lhs.false.i, label %if.end
lor.lhs.false.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.C, ptr %A2, i64 %indvars.iv.i
%arrayidx.i = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.i
%7 = load i8, ptr %arrayidx.i, align 8, !tbaa !14
%8 = load i8, ptr %arrayidx2.i, align 8, !tbaa !14
%cmp11.not.i = icmp eq i8 %7, %8
br i1 %cmp11.not.i, label %for.cond.i, label %if.end
if.end: ; preds = %lor.lhs.false.i, %for.body.i, %for.cond.i, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ @str.5, %for.cond.i ], [ @str, %for.body.i ], [ @str, %lor.lhs.false.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%9 = load i32, ptr @n, align 4, !tbaa !5
%cmp1541 = icmp sgt i32 %9, 0
br i1 %cmp1541, label %for.body16, label %for.end26
for.body16: ; preds = %if.end, %for.body16
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body16 ], [ 0, %if.end ]
%arrayidx18 = getelementptr inbounds [100001 x %struct.C], ptr %A2, i64 0, i64 %indvars.iv45
%10 = load i8, ptr %arrayidx18, align 8, !tbaa !14
%conv = sext i8 %10 to i32
%num22 = getelementptr inbounds [100001 x %struct.C], ptr %A2, i64 0, i64 %indvars.iv45, i32 1
%11 = load i32, ptr %num22, align 4, !tbaa !12
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %11)
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%12 = load i32, ptr @n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp15 = icmp slt i64 %indvars.iv.next46, %13
br i1 %cmp15, label %for.body16, label %for.end26, !llvm.loop !15
for.end26: ; preds = %for.body16, %if.end
call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %A2) #9
call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %A) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%A14 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp66.i = icmp sgt i32 %sub.i, 0
br i1 %cmp66.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.C, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A14
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load15 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load15, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !16
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !19
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp568.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp568.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count80.i = zext i32 %sub1.i to i64
%invariant.gep87.i = getelementptr %struct.C, ptr %A, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check20, label %for.body6.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A14
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body6.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count80.i, 4294967292
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %index27
%18 = getelementptr %struct.C, ptr %invariant.gep87.i, i64 %index27
%wide.load28 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load29 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load28, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load29, ptr %20, align 16
%index.next30 = add nuw i64 %index27, 4
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !21
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count80.i
br i1 %cmp.n25, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck16, %for.body6.preheader.i, %middle.block18
%indvars.iv76.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body6.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv76.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80.i
%xtraiter31 = and i64 %wide.trip.count80.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv76.i.prol = phi i64 [ %indvars.iv.next77.i.prol, %for.body6.i.prol ], [ %indvars.iv76.i.ph, %for.body6.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv76.i.prol
%gep88.i.prol = getelementptr %struct.C, ptr %invariant.gep87.i, i64 %indvars.iv76.i.prol
%24 = load i64, ptr %gep88.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next77.i.prol = add nuw nsw i64 %indvars.iv76.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !22
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv76.i.unr = phi i64 [ %indvars.iv76.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next77.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.C, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !23
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv76.i = phi i64 [ %indvars.iv.next77.i.3, %for.body6.i ], [ %indvars.iv76.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv76.i
%gep88.i = getelementptr %struct.C, ptr %invariant.gep87.i, i64 %indvars.iv76.i
%30 = load i64, ptr %gep88.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next77.i = add nuw nsw i64 %indvars.iv76.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next77.i
%gep88.i.1 = getelementptr %struct.C, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i
%31 = load i64, ptr %gep88.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next77.i.1 = add nuw nsw i64 %indvars.iv76.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next77.i.1
%gep88.i.2 = getelementptr %struct.C, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.1
%32 = load i64, ptr %gep88.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next77.i.2 = add nuw nsw i64 %indvars.iv76.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next77.i.2
%gep88.i.3 = getelementptr %struct.C, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.2
%33 = load i64, ptr %gep88.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next77.i.3 = add nuw nsw i64 %indvars.iv76.i, 4
%exitcond81.not.i.3 = icmp eq i64 %indvars.iv.next77.i.3, %wide.trip.count80.i
br i1 %exitcond81.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !24
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block18, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%num.i = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 200000000, ptr %num.i, align 4, !tbaa !12
%idxprom17.i = sext i32 %sub.i to i64
%num19.i = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 200000000, ptr %num19.i, align 4, !tbaa !12
%34 = sext i32 %left to i64
%wide.trip.count85.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv82.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next83.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.072.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%num25.i = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %num25.i, align 4, !tbaa !12
%idxprom26.i = zext i32 %j.072.i to i64
%num28.i = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %num28.i, align 4, !tbaa !12
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%inc37.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.072.i, %inc37.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc32.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc32.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv82.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next83.i = add nsw i64 %indvars.iv82.i, 1
%exitcond86.not.i = icmp eq i64 %indvars.iv.next83.i, %wide.trip.count85.i
br i1 %exitcond86.not.i, label %if.end, label %for.body22.i, !llvm.loop !25
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp10 = icmp slt i32 %p, %r
br i1 %cmp10, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr11 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !26
%sub.i = add nsw i32 %p.tr11, -1
%1 = sext i32 %p.tr11 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%num.i.prol = getelementptr inbounds %struct.C, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %num.i.prol, align 4, !tbaa !12
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.C, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr11 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr11, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%num.i = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %num.i, align 4, !tbaa !12
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.i
%add.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %add.i to i64
%arrayidx6.i = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%num.i.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %num.i.1, align 4, !tbaa !12
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next.i
%add.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %add.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %add.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !27
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %n, i32 noundef %p.tr11, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @isStable(ptr nocapture noundef readonly %A, ptr nocapture noundef readonly %A2) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond: ; preds = %lor.lhs.false
%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 ]
%num = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv, i32 1
%1 = load i32, ptr %num, align 4, !tbaa !12
%num3 = getelementptr inbounds %struct.C, ptr %A2, i64 %indvars.iv, i32 1
%2 = load i32, ptr %num3, align 4, !tbaa !12
%cmp4.not = icmp eq i32 %1, %2
br i1 %cmp4.not, label %lor.lhs.false, label %cleanup
lor.lhs.false: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.C, ptr %A2, i64 %indvars.iv
%arrayidx = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv
%3 = load i8, ptr %arrayidx, align 4, !tbaa !14
%4 = load i8, ptr %arrayidx2, align 4, !tbaa !14
%cmp11.not = icmp eq i8 %3, %4
br i1 %cmp11.not, label %for.cond, label %cleanup
cleanup: ; preds = %lor.lhs.false, %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ], [ 0, %lor.lhs.false ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #6 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !26
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%num.prol = getelementptr inbounds %struct.C, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %num.prol, align 4, !tbaa !12
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.C, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%num = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %num, align 4, !tbaa !12
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv
%add = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%num.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %num.1, align 4, !tbaa !12
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv.next
%add.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %add.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !27
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.C, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #7 {
entry:
%A89 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp66 = icmp sgt i32 %sub, 0
br i1 %cmp66, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.C, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader107, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A89
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader107, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.C, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load90 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load90, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !28
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader107
for.body.preheader107: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader107, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader107 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader107 ]
%arrayidx.prol = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !29
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader107
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader107 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp568 = icmp sgt i32 %sub1, 0
br i1 %cmp568, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count80 = zext i32 %sub1 to i64
%invariant.gep87 = getelementptr %struct.C, ptr %A, i64 %13
%min.iters.check95 = icmp ult i32 %sub1, 10
br i1 %min.iters.check95, label %for.body6.preheader106, label %vector.memcheck91
vector.memcheck91: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A89
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check92 = icmp ult i64 %16, 32
br i1 %diff.check92, label %for.body6.preheader106, label %vector.ph96
vector.ph96: ; preds = %vector.memcheck91
%n.vec98 = and i64 %wide.trip.count80, 4294967292
br label %vector.body101
vector.body101: ; preds = %vector.body101, %vector.ph96
%index102 = phi i64 [ 0, %vector.ph96 ], [ %index.next105, %vector.body101 ]
%17 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %index102
%18 = getelementptr %struct.C, ptr %invariant.gep87, i64 %index102
%wide.load103 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load104 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load103, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load104, ptr %20, align 16
%index.next105 = add nuw i64 %index102, 4
%21 = icmp eq i64 %index.next105, %n.vec98
br i1 %21, label %middle.block93, label %vector.body101, !llvm.loop !30
middle.block93: ; preds = %vector.body101
%cmp.n100 = icmp eq i64 %n.vec98, %wide.trip.count80
br i1 %cmp.n100, label %for.end14, label %for.body6.preheader106
for.body6.preheader106: ; preds = %vector.memcheck91, %for.body6.preheader, %middle.block93
%indvars.iv76.ph = phi i64 [ 0, %vector.memcheck91 ], [ 0, %for.body6.preheader ], [ %n.vec98, %middle.block93 ]
%22 = xor i64 %indvars.iv76.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80
%xtraiter108 = and i64 %wide.trip.count80, 3
%lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
br i1 %lcmp.mod109.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader106, %for.body6.prol
%indvars.iv76.prol = phi i64 [ %indvars.iv.next77.prol, %for.body6.prol ], [ %indvars.iv76.ph, %for.body6.preheader106 ]
%prol.iter110 = phi i64 [ %prol.iter110.next, %for.body6.prol ], [ 0, %for.body6.preheader106 ]
%arrayidx8.prol = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv76.prol
%gep88.prol = getelementptr %struct.C, ptr %invariant.gep87, i64 %indvars.iv76.prol
%24 = load i64, ptr %gep88.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next77.prol = add nuw nsw i64 %indvars.iv76.prol, 1
%prol.iter110.next = add i64 %prol.iter110, 1
%prol.iter110.cmp.not = icmp eq i64 %prol.iter110.next, %xtraiter108
br i1 %prol.iter110.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !31
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader106
%indvars.iv76.unr = phi i64 [ %indvars.iv76.ph, %for.body6.preheader106 ], [ %indvars.iv.next77.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.C, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !32
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv76 = phi i64 [ %indvars.iv.next77.3, %for.body6 ], [ %indvars.iv76.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv76
%gep88 = getelementptr %struct.C, ptr %invariant.gep87, i64 %indvars.iv76
%30 = load i64, ptr %gep88, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%arrayidx8.1 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next77
%gep88.1 = getelementptr %struct.C, ptr %invariant.gep87, i64 %indvars.iv.next77
%31 = load i64, ptr %gep88.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 2
%arrayidx8.2 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next77.1
%gep88.2 = getelementptr %struct.C, ptr %invariant.gep87, i64 %indvars.iv.next77.1
%32 = load i64, ptr %gep88.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next77.2 = add nuw nsw i64 %indvars.iv76, 3
%arrayidx8.3 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %indvars.iv.next77.2
%gep88.3 = getelementptr %struct.C, ptr %invariant.gep87, i64 %indvars.iv.next77.2
%33 = load i64, ptr %gep88.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next77.3 = add nuw nsw i64 %indvars.iv76, 4
%exitcond81.not.3 = icmp eq i64 %indvars.iv.next77.3, %wide.trip.count80
br i1 %exitcond81.not.3, label %for.end14, label %for.body6, !llvm.loop !33
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block93, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%num = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 200000000, ptr %num, align 4, !tbaa !12
%idxprom17 = sext i32 %sub to i64
%num19 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 200000000, ptr %num19, align 4, !tbaa !12
%cmp2170 = icmp slt i32 %left, %right
br i1 %cmp2170, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count85 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv82 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next83, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.072 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%num25 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %num25, align 4, !tbaa !12
%idxprom26 = zext i32 %j.072 to i64
%num28 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %num28, align 4, !tbaa !12
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [50000 x %struct.C], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50000 x %struct.C], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc37 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.072, %inc37
%not.cmp29.not = xor i1 %cmp29.not, true
%inc32 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc32
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.C, ptr %A, i64 %indvars.iv82
store i64 %.sink, ptr %37, align 4
%indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
br i1 %exitcond86.not, label %for.end42, label %for.body22, !llvm.loop !25
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #8 = { nofree nounwind }
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 = !{!"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, !6, i64 4}
!13 = !{!"", !7, i64 0, !6, i64 4}
!14 = !{!13, !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !10, !17, !18}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !10, !17}
!24 = distinct !{!24, !10, !17}
!25 = distinct !{!25, !10}
!26 = !{i64 0, i64 4, !5}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10, !17, !18}
!29 = distinct !{!29, !20}
!30 = distinct !{!30, !10, !17, !18}
!31 = distinct !{!31, !20}
!32 = distinct !{!32, !10, !17}
!33 = distinct !{!33, !10, !17}
|
#include<stdio.h>
#include<stdlib.h>
typedef struct{
int key;
char s;
}card;
int n;
int partition(card **A,int p,int r){
int x;
card *swap;
x=A[r]->key;
int i,j;
i=p;
for(j=p;j<=r;j++){
if((A[j]->key) <= x){
swap=A[i];
A[i]=A[j];
A[j]=swap;
i++;
}
}
return i-1;
}
void q_sort(card **A,int a,int b){
int q;
q=partition(A,a,b);
if(q-1 > a) q_sort(A,a,q-1);
if(q+1 < b) q_sort(A,q+1,b);
}
void stable(card **A,card **B){
int i,j,k=0;
for(i=0;i<n-1;i++){
if(A[i]->key !=A[i+1]->key) k=0;
else{
for(j=k;j<n;j++){
if(A[i]->key == B[j]->key){
if(A[i]->s!=B[j]->s){
printf("Not stable\n");
return;
}
k=j+1;
break;
}
}
}
}
printf("Stable\n");
}
int main(){
int i;
card **A,**B;
scanf("%d",&n);
A=malloc(n*sizeof(card *));
B=malloc(n*sizeof(card *));
for(i=0;i<n;i++){
A[i]=malloc(sizeof(card));
B[i]=malloc(sizeof(card));
scanf(" %c",&(A[i]->s));
scanf("%d",&(A[i]->key));
B[i]->key=A[i]->key;
B[i]->s=A[i]->s;
}
q_sort(A,0,n-1);
stable(A,B);
for(i=0;i<n;i++) printf("%c %d\n",A[i]->s,A[i]->key);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269622/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269622/source.c"
target datalayout = "e-m:e-p270: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.card = type { i32, i8 }
@n = dso_local global i32 0, align 4
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@str.5 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds ptr, ptr %A, i64 %idxprom
%0 = load ptr, ptr %arrayidx, align 8, !tbaa !5
%1 = load i32, ptr %0, align 4, !tbaa !9
%cmp.not28 = icmp sgt i32 %p, %r
br i1 %cmp.not28, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%2 = sext i32 %p to i64
%3 = add i32 %r, 1
%4 = sub i32 %3, %p
%xtraiter = and i32 %4, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds ptr, ptr %A, i64 %2
%5 = load ptr, ptr %arrayidx2.prol, align 8, !tbaa !5
%6 = load i32, ptr %5, align 4, !tbaa !9
%cmp4.not.prol = icmp sgt i32 %6, %1
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds ptr, ptr %A, i64 %idxprom5.prol
%7 = load ptr, ptr %arrayidx6.prol, align 8, !tbaa !5
store ptr %5, ptr %arrayidx6.prol, align 8, !tbaa !5
store ptr %7, ptr %arrayidx2.prol, align 8, !tbaa !5
%inc.prol = add nsw i32 %p, 1
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %inc.prol, %if.then.prol ], [ %p, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %2, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.029.unr = phi i32 [ %p, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%8 = icmp eq i32 %r, %p
br i1 %8, label %for.end, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr ptr, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.029 = phi i32 [ %i.029.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv
%9 = load ptr, ptr %arrayidx2, align 8, !tbaa !5
%10 = load i32, ptr %9, align 4, !tbaa !9
%cmp4.not = icmp sgt i32 %10, %1
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%idxprom5 = sext i32 %i.029 to i64
%arrayidx6 = getelementptr inbounds ptr, ptr %A, i64 %idxprom5
%11 = load ptr, ptr %arrayidx6, align 8, !tbaa !5
store ptr %9, ptr %arrayidx6, align 8, !tbaa !5
store ptr %11, ptr %arrayidx2, align 8, !tbaa !5
%inc = add nsw i32 %i.029, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.029, %for.body ]
%gep = getelementptr ptr, ptr %invariant.gep, i64 %indvars.iv
%12 = load ptr, ptr %gep, align 8, !tbaa !5
%13 = load i32, ptr %12, align 4, !tbaa !9
%cmp4.not.1 = icmp sgt i32 %13, %1
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%idxprom5.1 = sext i32 %i.1 to i64
%arrayidx6.1 = getelementptr inbounds ptr, ptr %A, i64 %idxprom5.1
%14 = load ptr, ptr %arrayidx6.1, align 8, !tbaa !5
store ptr %12, ptr %arrayidx6.1, align 8, !tbaa !5
store ptr %14, ptr %gep, align 8, !tbaa !5
%inc.1 = add nsw i32 %i.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
%exitcond.not.1 = icmp eq i32 %3, %lftr.wideiv.1
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body.prol.loopexit, %for.inc.1, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%sub = add nsw i32 %i.0.lcssa, -1
ret i32 %sub
}
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @q_sort(ptr nocapture noundef %A, i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%idxprom.i = sext i32 %b to i64
%arrayidx.i = getelementptr inbounds ptr, ptr %A, i64 %idxprom.i
%0 = add i32 %b, 1
%1 = add i32 %b, 1
%invariant.gep = getelementptr ptr, ptr %A, i64 1
br label %tailrecurse
tailrecurse: ; preds = %if.end, %entry
%a.tr = phi i32 [ %a, %entry ], [ %i.0.lcssa.i, %if.end ]
%2 = load ptr, ptr %arrayidx.i, align 8, !tbaa !5
%3 = load i32, ptr %2, align 4, !tbaa !9
%cmp.not28.i = icmp sgt i32 %a.tr, %b
br i1 %cmp.not28.i, label %partition.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %tailrecurse
%4 = sext i32 %a.tr to i64
%5 = sub i32 %1, %a.tr
%xtraiter = and i32 %5, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%arrayidx2.i.prol = getelementptr inbounds ptr, ptr %A, i64 %4
%6 = load ptr, ptr %arrayidx2.i.prol, align 8, !tbaa !5
%7 = load i32, ptr %6, align 4, !tbaa !9
%cmp4.not.i.prol = icmp sgt i32 %7, %3
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%idxprom5.i.prol = sext i32 %a.tr to i64
%arrayidx6.i.prol = getelementptr inbounds ptr, ptr %A, i64 %idxprom5.i.prol
%8 = load ptr, ptr %arrayidx6.i.prol, align 8, !tbaa !5
store ptr %6, ptr %arrayidx6.i.prol, align 8, !tbaa !5
store ptr %8, ptr %arrayidx2.i.prol, align 8, !tbaa !5
%inc.i.prol = add nsw i32 %a.tr, 1
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %inc.i.prol, %if.then.i.prol ], [ %a.tr, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %4, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %4, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.029.i.unr = phi i32 [ %a.tr, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%9 = icmp eq i32 %a.tr, %b
br i1 %9, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.029.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.029.i.unr, %for.body.i.prol.loopexit ]
%arrayidx2.i = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv.i
%10 = load ptr, ptr %arrayidx2.i, align 8, !tbaa !5
%11 = load i32, ptr %10, align 4, !tbaa !9
%cmp4.not.i = icmp sgt i32 %11, %3
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%idxprom5.i = sext i32 %i.029.i to i64
%arrayidx6.i = getelementptr inbounds ptr, ptr %A, i64 %idxprom5.i
%12 = load ptr, ptr %arrayidx6.i, align 8, !tbaa !5
store ptr %10, ptr %arrayidx6.i, align 8, !tbaa !5
store ptr %12, ptr %arrayidx2.i, align 8, !tbaa !5
%inc.i = add nsw i32 %i.029.i, 1
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.029.i, %for.body.i ]
%gep = getelementptr ptr, ptr %invariant.gep, i64 %indvars.iv.i
%13 = load ptr, ptr %gep, align 8, !tbaa !5
%14 = load i32, ptr %13, align 4, !tbaa !9
%cmp4.not.i.1 = icmp sgt i32 %14, %3
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%idxprom5.i.1 = sext i32 %i.1.i to i64
%arrayidx6.i.1 = getelementptr inbounds ptr, ptr %A, i64 %idxprom5.i.1
%15 = load ptr, ptr %arrayidx6.i.1, align 8, !tbaa !5
store ptr %13, ptr %arrayidx6.i.1, align 8, !tbaa !5
store ptr %15, ptr %gep, align 8, !tbaa !5
%inc.i.1 = add nsw i32 %i.1.i, 1
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%lftr.wideiv.i.1 = trunc i64 %indvars.iv.next.i.1 to i32
%exitcond.not.i.1 = icmp eq i32 %0, %lftr.wideiv.i.1
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !12
partition.exit: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1, %tailrecurse
%i.0.lcssa.i = phi i32 [ %a.tr, %tailrecurse ], [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%sub = add nsw i32 %i.0.lcssa.i, -2
%cmp = icmp sgt i32 %sub, %a.tr
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %partition.exit
tail call void @q_sort(ptr noundef nonnull %A, i32 noundef %a.tr, i32 noundef %sub)
br label %if.end
if.end: ; preds = %if.then, %partition.exit
%cmp2 = icmp slt i32 %i.0.lcssa.i, %b
br i1 %cmp2, label %tailrecurse, label %if.end5
if.end5: ; preds = %if.end
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @stable(ptr nocapture noundef readonly %A, ptr nocapture noundef readonly %B) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !14
%cmp51 = icmp sgt i32 %0, 1
br i1 %cmp51, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %0, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load ptr, ptr %A, align 8, !tbaa !5
%.pre61 = load i32, ptr %.pre, align 4, !tbaa !9
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc28
%1 = phi i32 [ %.pre61, %for.body.preheader ], [ %4, %for.inc28 ]
%2 = phi ptr [ %.pre, %for.body.preheader ], [ %3, %for.inc28 ]
%indvars.iv57 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next58, %for.inc28 ]
%k.053 = phi i32 [ 0, %for.body.preheader ], [ %k.1, %for.inc28 ]
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%arrayidx2 = getelementptr inbounds ptr, ptr %A, i64 %indvars.iv.next58
%3 = load ptr, ptr %arrayidx2, align 8, !tbaa !5
%4 = load i32, ptr %3, align 4, !tbaa !9
%cmp4.not = icmp eq i32 %1, %4
br i1 %cmp4.not, label %for.cond5.preheader, label %for.inc28
for.cond5.preheader: ; preds = %for.body
%cmp649 = icmp slt i32 %k.053, %0
br i1 %cmp649, label %for.body7.preheader, label %for.inc28
for.body7.preheader: ; preds = %for.cond5.preheader
%5 = sext i32 %k.053 to i64
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.inc
%indvars.iv = phi i64 [ %5, %for.body7.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx12 = getelementptr inbounds ptr, ptr %B, i64 %indvars.iv
%6 = load ptr, ptr %arrayidx12, align 8, !tbaa !5
%7 = load i32, ptr %6, align 4, !tbaa !9
%cmp14 = icmp eq i32 %1, %7
br i1 %cmp14, label %if.then15, label %for.inc
if.then15: ; preds = %for.body7
%s = getelementptr inbounds %struct.card, ptr %2, i64 0, i32 1
%8 = load i8, ptr %s, align 4, !tbaa !15
%s20 = getelementptr inbounds %struct.card, ptr %6, i64 0, i32 1
%9 = load i8, ptr %s20, align 4, !tbaa !15
%cmp22.not = icmp eq i8 %8, %9
br i1 %cmp22.not, label %if.end, label %cleanup
if.end: ; preds = %if.then15
%10 = trunc i64 %indvars.iv to i32
%add25 = add nsw i32 %10, 1
br label %for.inc28
for.inc: ; preds = %for.body7
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%lftr.wideiv = trunc i64 %indvars.iv.next to i32
%exitcond.not = icmp eq i32 %0, %lftr.wideiv
br i1 %exitcond.not, label %for.inc28, label %for.body7, !llvm.loop !16
for.inc28: ; preds = %for.inc, %for.cond5.preheader, %for.body, %if.end
%k.1 = phi i32 [ %add25, %if.end ], [ 0, %for.body ], [ %k.053, %for.cond5.preheader ], [ %k.053, %for.inc ]
%exitcond60.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count
br i1 %exitcond60.not, label %cleanup, label %for.body, !llvm.loop !17
cleanup: ; preds = %for.inc28, %if.then15, %entry
%str.sink = phi ptr [ @str, %entry ], [ @str.5, %if.then15 ], [ @str, %for.inc28 ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !14
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 3
%call1 = tail call noalias ptr @malloc(i64 noundef %mul) #6
%call4 = tail call noalias ptr @malloc(i64 noundef %mul) #6
%cmp70 = icmp sgt i32 %0, 0
br i1 %cmp70, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub81 = add nsw i32 %0, -1
tail call void @q_sort(ptr noundef %call1, i32 noundef 0, i32 noundef %sub81)
br label %stable.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call6 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #6
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv
store ptr %call6, ptr %arrayidx, align 8, !tbaa !5
%call7 = tail call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #6
%arrayidx9 = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv
store ptr %call7, ptr %arrayidx9, align 8, !tbaa !5
%s = getelementptr inbounds %struct.card, ptr %call6, i64 0, i32 1
%call12 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %s)
%call15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %call6)
%1 = load i32, ptr %call6, align 4, !tbaa !9
store i32 %1, ptr %call7, align 4, !tbaa !9
%2 = load i8, ptr %s, align 4, !tbaa !15
%s27 = getelementptr inbounds %struct.card, ptr %call7, i64 0, i32 1
store i8 %2, ptr %s27, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr @n, align 4, !tbaa !14
%3 = sext i32 %.pr to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !18
for.end: ; preds = %for.body
%sub = add nsw i32 %.pr, -1
tail call void @q_sort(ptr noundef nonnull %call1, i32 noundef 0, i32 noundef %sub)
%cmp51.i = icmp sgt i32 %.pr, 1
br i1 %cmp51.i, label %for.body.preheader.i, label %stable.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %sub to i64
%.pre.i = load ptr, ptr %call1, align 8, !tbaa !5
%.pre61.i = load i32, ptr %.pre.i, align 4, !tbaa !9
br label %for.body.i
for.body.i: ; preds = %for.inc28.i, %for.body.preheader.i
%4 = phi i32 [ %.pre61.i, %for.body.preheader.i ], [ %7, %for.inc28.i ]
%5 = phi ptr [ %.pre.i, %for.body.preheader.i ], [ %6, %for.inc28.i ]
%indvars.iv57.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next58.i, %for.inc28.i ]
%k.053.i = phi i32 [ 0, %for.body.preheader.i ], [ %k.1.i, %for.inc28.i ]
%indvars.iv.next58.i = add nuw nsw i64 %indvars.iv57.i, 1
%arrayidx2.i = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next58.i
%6 = load ptr, ptr %arrayidx2.i, align 8, !tbaa !5
%7 = load i32, ptr %6, align 4, !tbaa !9
%cmp4.not.i = icmp eq i32 %4, %7
br i1 %cmp4.not.i, label %for.cond5.preheader.i, label %for.inc28.i
for.cond5.preheader.i: ; preds = %for.body.i
%cmp649.i = icmp slt i32 %k.053.i, %.pr
br i1 %cmp649.i, label %for.body7.preheader.i, label %for.inc28.i
for.body7.preheader.i: ; preds = %for.cond5.preheader.i
%8 = sext i32 %k.053.i to i64
br label %for.body7.i
for.body7.i: ; preds = %for.inc.i, %for.body7.preheader.i
%indvars.iv.i = phi i64 [ %8, %for.body7.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx12.i = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv.i
%9 = load ptr, ptr %arrayidx12.i, align 8, !tbaa !5
%10 = load i32, ptr %9, align 4, !tbaa !9
%cmp14.i = icmp eq i32 %4, %10
br i1 %cmp14.i, label %if.then15.i, label %for.inc.i
if.then15.i: ; preds = %for.body7.i
%s.i = getelementptr inbounds %struct.card, ptr %5, i64 0, i32 1
%11 = load i8, ptr %s.i, align 4, !tbaa !15
%s20.i = getelementptr inbounds %struct.card, ptr %9, i64 0, i32 1
%12 = load i8, ptr %s20.i, align 4, !tbaa !15
%cmp22.not.i = icmp eq i8 %11, %12
br i1 %cmp22.not.i, label %if.end.i, label %stable.exit
if.end.i: ; preds = %if.then15.i
%13 = trunc i64 %indvars.iv.i to i32
%add25.i = add nsw i32 %13, 1
br label %for.inc28.i
for.inc.i: ; preds = %for.body7.i
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%lftr.wideiv.i = trunc i64 %indvars.iv.next.i to i32
%exitcond.not.i = icmp eq i32 %.pr, %lftr.wideiv.i
br i1 %exitcond.not.i, label %for.inc28.i, label %for.body7.i, !llvm.loop !16
for.inc28.i: ; preds = %for.inc.i, %if.end.i, %for.cond5.preheader.i, %for.body.i
%k.1.i = phi i32 [ %add25.i, %if.end.i ], [ 0, %for.body.i ], [ %k.053.i, %for.cond5.preheader.i ], [ %k.053.i, %for.inc.i ]
%exitcond60.not.i = icmp eq i64 %indvars.iv.next58.i, %wide.trip.count.i
br i1 %exitcond60.not.i, label %stable.exit, label %for.body.i, !llvm.loop !17
stable.exit: ; preds = %if.then15.i, %for.inc28.i, %for.end.thread, %for.end
%str.sink.i = phi ptr [ @str, %for.end ], [ @str, %for.end.thread ], [ @str, %for.inc28.i ], [ @str.5, %if.then15.i ]
%puts.i = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink.i)
%14 = load i32, ptr @n, align 4, !tbaa !14
%cmp2972 = icmp sgt i32 %14, 0
br i1 %cmp2972, label %for.body31, label %for.end42
for.body31: ; preds = %stable.exit, %for.body31
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body31 ], [ 0, %stable.exit ]
%arrayidx33 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv77
%15 = load ptr, ptr %arrayidx33, align 8, !tbaa !5
%s34 = getelementptr inbounds %struct.card, ptr %15, i64 0, i32 1
%16 = load i8, ptr %s34, align 4, !tbaa !15
%conv35 = sext i8 %16 to i32
%17 = load i32, ptr %15, align 4, !tbaa !9
%call39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv35, i32 noundef %17)
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%18 = load i32, ptr @n, align 4, !tbaa !14
%19 = sext i32 %18 to i64
%cmp29 = icmp slt i64 %indvars.iv.next78, %19
br i1 %cmp29, label %for.body31, label %for.end42, !llvm.loop !19
for.end42: ; preds = %for.body31, %stable.exit
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !7, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !7, i64 4}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
|
#include <stdio.h>
#include <stdbool.h>
#define MAX 100000
#define SENTINEL 2000000000
typedef struct Card_
{
char suit;
int value;
} Card;
Card L[MAX / 2 + 1];
Card R[MAX / 2 + 1];
static void merge(Card A[], int n, int left, int mid, int right)
{
int n1 = mid - left;
int n2 = right - mid;
for (int i = 0; i < n1; i++) {
L[i] = A[left + i];
}
for (int i = 0; i < n2; i++) {
R[i] = A[mid + i];
}
L[n1].value = R[n2].value = SENTINEL;
int i = 0, j = 0;
for (int k = left; k < right; k++) {
if (L[i].value <= R[j].value) {
A[k] = L[i++];
} else {
A[k] = R[j++];
}
}
}
static void mergeSort(Card A[], int n, int left, int right)
{
if (left + 1 < right) {
int mid = (left + right) / 2;
mergeSort(A, n, left, mid);
mergeSort(A, n, mid, right);
merge(A, n, left, mid, right);
}
}
static int partition(Card A[], int n, int p, int r)
{
Card x = A[r];
int i = p - 1;
for (int j = p; j < r; j++) {
if (A[j].value <= x.value) {
i++;
Card tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
i++;
Card tmp = A[i];
A[i] = A[r];
A[r] = tmp;
return i;
}
static void quickSort(Card A[], int n, int p, int r)
{
if (p < r) {
int q = partition(A, n, p, r);
quickSort(A, n, p, q - 1);
quickSort(A, n, q + 1, r);
}
}
int main()
{
int n;
Card A[MAX], B[MAX];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
char s[2];
int v;
scanf("%s %d", s, &v);
A[i].suit = B[i].suit = s[0];
A[i].value = B[i].value = v;
}
mergeSort(A, n, 0, n);
quickSort(B, n, 0, n - 1);
bool stable = true;
for (int i = 0; i < n; i++) {
if (A[i].suit != B[i].suit) {
stable = false;
break;
}
}
if (stable) {
printf("Stable\n");
} else {
printf("Not stable\n");
}
for (int i = 0; i < n; i++) {
printf("%c %d\n", B[i].suit, B[i].value);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269666/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269666/source.c"
target datalayout = "e-m:e-p270: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.Card_ = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@L = dso_local local_unnamed_addr global [50001 x %struct.Card_] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50001 x %struct.Card_] zeroinitializer, align 16
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\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 %struct.Card_], align 16
%B = alloca [100000 x %struct.Card_], align 16
%s = alloca [2 x i8], align 1
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #6
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp68 = icmp sgt i32 %0, 0
br i1 %cmp68, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %4, %for.body ]
call fastcc void @mergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa)
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
call fastcc void @quickSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %sub)
%cmp15.not70 = icmp sgt i32 %1, 0
br i1 %cmp15.not70, label %for.body17.preheader, label %if.end33
for.body17.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %1 to i64
br label %for.body17
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %v)
%2 = load i8, ptr %s, align 1, !tbaa !9
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card_], ptr %B, i64 0, i64 %indvars.iv
store i8 %2, ptr %arrayidx2, align 8, !tbaa !10
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card_], ptr %A, i64 0, i64 %indvars.iv
store i8 %2, ptr %arrayidx4, align 8, !tbaa !10
%3 = load i32, ptr %v, align 4, !tbaa !5
%value = getelementptr inbounds [100000 x %struct.Card_], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %3, ptr %value, align 4, !tbaa !12
%value10 = getelementptr inbounds [100000 x %struct.Card_], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %3, ptr %value10, align 4, !tbaa !12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %s) #6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond14: ; preds = %for.body17
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%exitcond.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count
br i1 %exitcond.not, label %if.end33, label %for.body17, !llvm.loop !15
for.body17: ; preds = %for.body17.preheader, %for.cond14
%indvars.iv76 = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next77, %for.cond14 ]
%arrayidx19 = getelementptr inbounds [100000 x %struct.Card_], ptr %A, i64 0, i64 %indvars.iv76
%6 = load i8, ptr %arrayidx19, align 8, !tbaa !10
%arrayidx22 = getelementptr inbounds [100000 x %struct.Card_], ptr %B, i64 0, i64 %indvars.iv76
%7 = load i8, ptr %arrayidx22, align 8, !tbaa !10
%cmp25.not = icmp eq i8 %6, %7
br i1 %cmp25.not, label %for.cond14, label %if.end33
if.end33: ; preds = %for.body17, %for.cond14, %for.cond.cleanup
%str.sink = phi ptr [ @str.5, %for.cond.cleanup ], [ @str.5, %for.cond14 ], [ @str, %for.body17 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp3672 = icmp sgt i32 %8, 0
br i1 %cmp3672, label %for.body39, label %for.cond.cleanup38
for.cond.cleanup38: ; preds = %for.body39, %if.end33
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #6
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.body39: ; preds = %if.end33, %for.body39
%indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body39 ], [ 0, %if.end33 ]
%arrayidx41 = getelementptr inbounds [100000 x %struct.Card_], ptr %B, i64 0, i64 %indvars.iv79
%9 = load i8, ptr %arrayidx41, align 8, !tbaa !10
%conv43 = sext i8 %9 to i32
%value46 = getelementptr inbounds [100000 x %struct.Card_], ptr %B, i64 0, i64 %indvars.iv79, i32 1
%10 = load i32, ptr %value46, align 4, !tbaa !12
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv43, i32 noundef %10)
%indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp36 = icmp slt i64 %indvars.iv.next80, %12
br i1 %cmp36, label %for.body39, label %for.cond.cleanup38, !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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define internal fastcc void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) unnamed_addr #3 {
entry:
%A1 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call fastcc void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call fastcc void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp68.i = icmp sgt i32 %sub.i, 0
br i1 %cmp68.i, label %for.body.preheader.i, label %for.cond5.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card_, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A1
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card_, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load2 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load2, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond5.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card_, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !20
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond5.preheader.i, label %for.body.i
for.cond5.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp670.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp670.i, label %for.body8.preheader.i, label %for.cond.cleanup7.i
for.body8.preheader.i: ; preds = %for.cond5.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count82.i = zext i32 %sub1.i to i64
%invariant.gep89.i = getelementptr %struct.Card_, ptr %A, i64 %13
%min.iters.check7 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check7, label %for.body8.i.preheader, label %vector.memcheck3
vector.memcheck3: ; preds = %for.body8.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A1
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check4 = icmp ult i64 %16, 32
br i1 %diff.check4, label %for.body8.i.preheader, label %vector.ph8
vector.ph8: ; preds = %vector.memcheck3
%n.vec10 = and i64 %wide.trip.count82.i, 4294967292
br label %vector.body13
vector.body13: ; preds = %vector.body13, %vector.ph8
%index14 = phi i64 [ 0, %vector.ph8 ], [ %index.next17, %vector.body13 ]
%17 = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %index14
%18 = getelementptr %struct.Card_, ptr %invariant.gep89.i, i64 %index14
%wide.load15 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load16 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load15, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load16, ptr %20, align 16
%index.next17 = add nuw i64 %index14, 4
%21 = icmp eq i64 %index.next17, %n.vec10
br i1 %21, label %middle.block5, label %vector.body13, !llvm.loop !22
middle.block5: ; preds = %vector.body13
%cmp.n12 = icmp eq i64 %n.vec10, %wide.trip.count82.i
br i1 %cmp.n12, label %for.cond.cleanup7.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %vector.memcheck3, %for.body8.preheader.i, %middle.block5
%indvars.iv78.i.ph = phi i64 [ 0, %vector.memcheck3 ], [ 0, %for.body8.preheader.i ], [ %n.vec10, %middle.block5 ]
%22 = xor i64 %indvars.iv78.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82.i
%xtraiter18 = and i64 %wide.trip.count82.i, 3
%lcmp.mod19.not = icmp eq i64 %xtraiter18, 0
br i1 %lcmp.mod19.not, label %for.body8.i.prol.loopexit, label %for.body8.i.prol
for.body8.i.prol: ; preds = %for.body8.i.preheader, %for.body8.i.prol
%indvars.iv78.i.prol = phi i64 [ %indvars.iv.next79.i.prol, %for.body8.i.prol ], [ %indvars.iv78.i.ph, %for.body8.i.preheader ]
%prol.iter20 = phi i64 [ %prol.iter20.next, %for.body8.i.prol ], [ 0, %for.body8.i.preheader ]
%arrayidx10.i.prol = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %indvars.iv78.i.prol
%gep90.i.prol = getelementptr %struct.Card_, ptr %invariant.gep89.i, i64 %indvars.iv78.i.prol
%24 = load i64, ptr %gep90.i.prol, align 4
store i64 %24, ptr %arrayidx10.i.prol, align 8
%indvars.iv.next79.i.prol = add nuw nsw i64 %indvars.iv78.i.prol, 1
%prol.iter20.next = add i64 %prol.iter20, 1
%prol.iter20.cmp.not = icmp eq i64 %prol.iter20.next, %xtraiter18
br i1 %prol.iter20.cmp.not, label %for.body8.i.prol.loopexit, label %for.body8.i.prol, !llvm.loop !23
for.body8.i.prol.loopexit: ; preds = %for.body8.i.prol, %for.body8.i.preheader
%indvars.iv78.i.unr = phi i64 [ %indvars.iv78.i.ph, %for.body8.i.preheader ], [ %indvars.iv.next79.i.prol, %for.body8.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup7.i, label %for.body8.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card_, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card_, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card_, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card_, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond5.preheader.i, label %for.body.i, !llvm.loop !24
for.cond.cleanup7.i: ; preds = %for.body8.i.prol.loopexit, %for.body8.i, %middle.block5, %for.cond5.preheader.i
%idxprom17.i = sext i32 %sub1.i to i64
%value.i = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %value.i, align 4, !tbaa !12
%idxprom19.i = sext i32 %sub.i to i64
%value21.i = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %idxprom19.i, i32 1
store i32 2000000000, ptr %value21.i, align 4, !tbaa !12
%30 = sext i32 %left to i64
%wide.trip.count87.i = sext i32 %right to i64
br label %for.body26.i
for.body8.i: ; preds = %for.body8.i.prol.loopexit, %for.body8.i
%indvars.iv78.i = phi i64 [ %indvars.iv.next79.i.3, %for.body8.i ], [ %indvars.iv78.i.unr, %for.body8.i.prol.loopexit ]
%arrayidx10.i = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %indvars.iv78.i
%gep90.i = getelementptr %struct.Card_, ptr %invariant.gep89.i, i64 %indvars.iv78.i
%31 = load i64, ptr %gep90.i, align 4
store i64 %31, ptr %arrayidx10.i, align 8
%indvars.iv.next79.i = add nuw nsw i64 %indvars.iv78.i, 1
%arrayidx10.i.1 = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %indvars.iv.next79.i
%gep90.i.1 = getelementptr %struct.Card_, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i
%32 = load i64, ptr %gep90.i.1, align 4
store i64 %32, ptr %arrayidx10.i.1, align 8
%indvars.iv.next79.i.1 = add nuw nsw i64 %indvars.iv78.i, 2
%arrayidx10.i.2 = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %indvars.iv.next79.i.1
%gep90.i.2 = getelementptr %struct.Card_, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.1
%33 = load i64, ptr %gep90.i.2, align 4
store i64 %33, ptr %arrayidx10.i.2, align 8
%indvars.iv.next79.i.2 = add nuw nsw i64 %indvars.iv78.i, 3
%arrayidx10.i.3 = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %indvars.iv.next79.i.2
%gep90.i.3 = getelementptr %struct.Card_, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.2
%34 = load i64, ptr %gep90.i.3, align 4
store i64 %34, ptr %arrayidx10.i.3, align 8
%indvars.iv.next79.i.3 = add nuw nsw i64 %indvars.iv78.i, 4
%exitcond83.not.i.3 = icmp eq i64 %indvars.iv.next79.i.3, %wide.trip.count82.i
br i1 %exitcond83.not.i.3, label %for.cond.cleanup7.i, label %for.body8.i, !llvm.loop !25
for.body26.i: ; preds = %for.body26.i, %for.cond.cleanup7.i
%indvars.iv84.i = phi i64 [ %30, %for.cond.cleanup7.i ], [ %indvars.iv.next85.i, %for.body26.i ]
%j.074.i = phi i32 [ 0, %for.cond.cleanup7.i ], [ %j.1.i, %for.body26.i ]
%i22.073.i = phi i32 [ 0, %for.cond.cleanup7.i ], [ %i22.1.i, %for.body26.i ]
%idxprom27.i = zext i32 %i22.073.i to i64
%value29.i = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %idxprom27.i, i32 1
%35 = load i32, ptr %value29.i, align 4, !tbaa !12
%idxprom30.i = zext i32 %j.074.i to i64
%value32.i = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %idxprom30.i, i32 1
%36 = load i32, ptr %value32.i, align 4, !tbaa !12
%cmp33.not.i = icmp sle i32 %35, %36
%arrayidx31.i = getelementptr inbounds [50001 x %struct.Card_], ptr @R, i64 0, i64 %idxprom30.i
%arrayidx28.i = getelementptr inbounds [50001 x %struct.Card_], ptr @L, i64 0, i64 %idxprom27.i
%.sink.in.i = select i1 %cmp33.not.i, ptr %arrayidx28.i, ptr %arrayidx31.i
%inc36.i = zext i1 %cmp33.not.i to i32
%i22.1.i = add nuw nsw i32 %i22.073.i, %inc36.i
%not.cmp33.not.i = xor i1 %cmp33.not.i, true
%inc41.i = zext i1 %not.cmp33.not.i to i32
%j.1.i = add nuw nsw i32 %j.074.i, %inc41.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card_, ptr %A, i64 %indvars.iv84.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next85.i = add nsw i64 %indvars.iv84.i, 1
%exitcond88.not.i = icmp eq i64 %indvars.iv.next85.i, %wide.trip.count87.i
br i1 %exitcond88.not.i, label %if.end, label %for.body26.i, !llvm.loop !26
if.end: ; preds = %for.body26.i, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define internal fastcc void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) unnamed_addr #4 {
entry:
%cmp10 = icmp slt i32 %p, %r
br i1 %cmp10, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card_, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr11 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr11, -1
%1 = sext i32 %p.tr11 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.Card_, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !12
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card_, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr11 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card_, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr11, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.Card_, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !12
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card_, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card_, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.Card_, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !12
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card_, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card_, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !28
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom16.i = sext i32 %14 to i64
%arrayidx17.i = getelementptr inbounds %struct.Card_, ptr %A, i64 %idxprom16.i
%15 = load i64, ptr %arrayidx17.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx17.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call fastcc void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr11, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %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 @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 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 0}
!11 = !{!"Card_", !7, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !14, !18, !19}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !14, !18}
!25 = distinct !{!25, !14, !18}
!26 = distinct !{!26, !14}
!27 = !{i64 0, i64 4, !5}
!28 = distinct !{!28, !14}
|
//Quick Sort
#include<stdio.h>
#include<stdlib.h>
#define SENTINEL 1000000001
typedef struct{
int num;
char suit;
}Data;
void Quicksort(Data*,int,int);
int Partition(Data*,int,int);
void Swap(Data*,Data*);
void Merge_sort(Data*,int,int);
void Merge(Data*,int,int,int);
int Test_stable(Data,Data);
int main(void){
int n;
Data *data,*stable_data;
int i;
char garbage;
scanf("%d",&n);
//%cは改行やスペースを読み込むのでその対策
scanf("%c",&garbage);
data=(Data*)malloc(n*sizeof(Data));
stable_data=(Data*)malloc(n*sizeof(Data));
for(i=0;i<n;i++){
scanf("%c %d",&data[i].suit,&data[i].num);
scanf("%c",&garbage);
stable_data[i]=data[i];
}
Quicksort(data,0,n-1);
Merge_sort(stable_data,0,n);
for(i=0;i<n;i++){
if(data[i].suit!=stable_data[i].suit){
printf("Not stable\n");
break;
}
}
if(i==n) printf("Stable\n");
for(i=0;i<n;i++) printf("%c %d\n",data[i].suit,data[i].num);
free(data);
free(stable_data);
return 0;
}
void Quicksort(Data *A,int p,int r){
int work;
if(p<r){
work=Partition(A,p,r);
Quicksort(A,p,work-1);
Quicksort(A,work+1,r);
}
}
int Partition(Data *A,int p,int r){
int pivot;
int i,j;
pivot=A[r].num;
j=p;
for(i=p;i<r;i++){
if(A[i].num<=pivot){
Swap(&A[i],&A[j]);
j++;
}
}
Swap(&A[j],&A[r]);
return j;
}
void Swap(Data *a,Data *b){
Data work;
work=*a;
*a=*b;
*b=work;
}
void Merge_sort(Data *A,int left,int right){
int mid;
if(left+1<right){
mid=(left+right)/2;
Merge_sort(A,left,mid);
Merge_sort(A,mid,right);
Merge(A,left,mid,right);
}
}
void Merge(Data *A,int left,int mid,int right){
int n1,n2;
Data *L,*R;
int i,j,k;
n1=mid-left;
n2=right-mid;
L=(Data*)malloc(sizeof(Data)*(n1+1));
R=(Data*)malloc(sizeof(Data)*(n2+1));
for(i=0;i<n1;i++) L[i]=A[left+i];
for(i=0;i<n2;i++) R[i]=A[mid+i];
L[n1].num=SENTINEL;
L[n1].suit=' ';
R[n2].num=SENTINEL;
R[n2].suit=' ';
i=0;
j=0;
for(k=left;k<right;k++){
if(L[i].num<=R[j].num){
A[k]=L[i];
i++;
}
else{
A[k]=R[j];
j++;
}
}
free(L);
free(R);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269716/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269716/source.c"
target datalayout = "e-m:e-p270: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.Data = type { i32, i8 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%c %d\00", align 1
@.str.5 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.6 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%garbage = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %garbage) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %garbage)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 3
%call2 = call noalias ptr @malloc(i64 noundef %mul) #11
%call5 = call noalias ptr @malloc(i64 noundef %mul) #11
%cmp80 = icmp sgt i32 %0, 0
br i1 %cmp80, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct.Data, ptr %call2, i64 %indvars.iv
%suit = getelementptr inbounds %struct.Data, ptr %call2, i64 %indvars.iv, i32 1
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %suit, ptr noundef %arrayidx)
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %garbage)
%arrayidx12 = getelementptr inbounds %struct.Data, ptr %call5, i64 %indvars.iv
%1 = load i64, ptr %arrayidx, align 4
store i64 %1, ptr %arrayidx12, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @Quicksort(ptr noundef %call2, i32 noundef 0, i32 noundef %sub)
call void @Merge_sort(ptr noundef %call5, i32 noundef 0, i32 noundef %.lcssa)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1682 = icmp sgt i32 %4, 0
br i1 %cmp1682, label %for.body18.preheader, label %for.end32
for.body18.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %4 to i64
br label %for.body18
for.body18: ; preds = %for.body18.preheader, %for.inc30
%indvars.iv90 = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next91, %for.inc30 ]
%suit21 = getelementptr inbounds %struct.Data, ptr %call2, i64 %indvars.iv90, i32 1
%5 = load i8, ptr %suit21, align 4, !tbaa !11
%suit25 = getelementptr inbounds %struct.Data, ptr %call5, i64 %indvars.iv90, i32 1
%6 = load i8, ptr %suit25, align 4, !tbaa !11
%cmp27.not = icmp eq i8 %5, %6
br i1 %cmp27.not, label %for.inc30, label %if.then
if.then: ; preds = %for.body18
%7 = trunc i64 %indvars.iv90 to i32
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end32
for.inc30: ; preds = %for.body18
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count
br i1 %exitcond.not, label %if.then35, label %for.body18, !llvm.loop !13
for.end32: ; preds = %for.end, %if.then
%8 = phi i32 [ %.pre, %if.then ], [ %4, %for.end ]
%i.179 = phi i32 [ %7, %if.then ], [ 0, %for.end ]
%cmp33 = icmp eq i32 %i.179, %8
br i1 %cmp33, label %if.then35, label %if.end37
if.then35: ; preds = %for.inc30, %for.end32
%puts77 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
%.pre96 = load i32, ptr %n, align 4, !tbaa !5
br label %if.end37
if.end37: ; preds = %if.then35, %for.end32
%9 = phi i32 [ %.pre96, %if.then35 ], [ %8, %for.end32 ]
%cmp3985 = icmp sgt i32 %9, 0
br i1 %cmp3985, label %for.body41, label %for.end52
for.body41: ; preds = %if.end37, %for.body41
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body41 ], [ 0, %if.end37 ]
%arrayidx43 = getelementptr inbounds %struct.Data, ptr %call2, i64 %indvars.iv93
%suit44 = getelementptr inbounds %struct.Data, ptr %call2, i64 %indvars.iv93, i32 1
%10 = load i8, ptr %suit44, align 4, !tbaa !11
%conv45 = sext i8 %10 to i32
%11 = load i32, ptr %arrayidx43, align 4, !tbaa !14
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %conv45, i32 noundef %11)
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp39 = icmp slt i64 %indvars.iv.next94, %13
br i1 %cmp39, label %for.body41, label %for.end52, !llvm.loop !15
for.end52: ; preds = %for.body41, %if.end37
call void @free(ptr noundef %call2) #10
call void @free(ptr noundef %call5) #10
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %garbage) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @Quicksort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #5 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom.i
%0 = sub nsw i64 0, %idxprom.i
%invariant.gep = getelementptr %struct.Data, ptr %A, i64 1
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %Partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %Partition.exit ]
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !14
%2 = sext i32 %p.tr9 to i64
%3 = sub nsw i64 %idxprom.i, %2
%xtraiter = and i64 %3, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%arrayidx2.i.prol = getelementptr inbounds %struct.Data, ptr %A, i64 %2
%4 = load i32, ptr %arrayidx2.i.prol, align 4, !tbaa !14
%cmp4.not.i.prol = icmp sgt i32 %4, %1
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%idxprom7.i.prol = sext i32 %p.tr9 to i64
%arrayidx8.i.prol = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom7.i.prol
%5 = load i64, ptr %arrayidx2.i.prol, align 4
%6 = load i64, ptr %arrayidx8.i.prol, align 4
store i64 %6, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx8.i.prol, align 4
%inc.i.prol = add nsw i32 %p.tr9, 1
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%j.1.i.prol = phi i32 [ %inc.i.prol, %if.then.i.prol ], [ %p.tr9, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %2, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%j.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %j.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%j.030.i.unr = phi i32 [ %p.tr9, %for.body.preheader.i ], [ %j.1.i.prol, %for.inc.i.prol ]
%7 = xor i64 %2, %0
%8 = icmp eq i64 %7, -1
br i1 %8, label %Partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%j.030.i = phi i32 [ %j.1.i.1, %for.inc.i.1 ], [ %j.030.i.unr, %for.body.i.prol.loopexit ]
%arrayidx2.i = getelementptr inbounds %struct.Data, ptr %A, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !14
%cmp4.not.i = icmp sgt i32 %9, %1
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%idxprom7.i = sext i32 %j.030.i to i64
%arrayidx8.i = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom7.i
%10 = load i64, ptr %arrayidx2.i, align 4
%11 = load i64, ptr %arrayidx8.i, align 4
store i64 %11, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx8.i, align 4
%inc.i = add nsw i32 %j.030.i, 1
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%j.1.i = phi i32 [ %inc.i, %if.then.i ], [ %j.030.i, %for.body.i ]
%gep = getelementptr %struct.Data, ptr %invariant.gep, i64 %indvars.iv.i
%12 = load i32, ptr %gep, align 4, !tbaa !14
%cmp4.not.i.1 = icmp sgt i32 %12, %1
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%idxprom7.i.1 = sext i32 %j.1.i to i64
%arrayidx8.i.1 = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom7.i.1
%13 = load i64, ptr %gep, align 4
%14 = load i64, ptr %arrayidx8.i.1, align 4
store i64 %14, ptr %gep, align 4
store i64 %13, ptr %arrayidx8.i.1, align 4
%inc.i.1 = add nsw i32 %j.1.i, 1
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%j.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %j.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %Partition.exit, label %for.body.i, !llvm.loop !16
Partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%j.1.i.lcssa = phi i32 [ %j.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %j.1.i.1, %for.inc.i.1 ]
%idxprom10.i = sext i32 %j.1.i.lcssa to i64
%arrayidx11.i = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom10.i
%15 = load i64, ptr %arrayidx11.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx11.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
%sub = add nsw i32 %j.1.i.lcssa, -1
tail call void @Quicksort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %sub)
%add = add nsw i32 %j.1.i.lcssa, 1
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %Partition.exit, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @Merge_sort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %common.ret12
common.ret12: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @Merge_sort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @Merge_sort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
tail call void @Merge(ptr noundef %A, i32 noundef %left, i32 noundef %div, i32 noundef %right)
br label %common.ret12
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6
; 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 i32 @Partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #7 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !14
%cmp28 = icmp slt i32 %p, %r
br i1 %cmp28, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds %struct.Data, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !14
%cmp4.not.prol = icmp sgt i32 %3, %0
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom7.prol = sext i32 %p to i64
%arrayidx8.prol = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom7.prol
%4 = load i64, ptr %arrayidx2.prol, align 4
%5 = load i64, ptr %arrayidx8.prol, align 4
store i64 %5, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx8.prol, align 4
%inc.prol = add nsw i32 %p, 1
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%j.1.prol = phi i32 [ %inc.prol, %if.then.prol ], [ %p, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%j.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %j.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%j.030.unr = phi i32 [ %p, %for.body.preheader ], [ %j.1.prol, %for.inc.prol ]
%6 = sub nsw i64 0, %idxprom
%7 = xor i64 %1, %6
%8 = icmp eq i64 %7, -1
br i1 %8, label %for.end, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr %struct.Data, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%j.030 = phi i32 [ %j.030.unr, %for.body.preheader.new ], [ %j.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds %struct.Data, ptr %A, i64 %indvars.iv
%9 = load i32, ptr %arrayidx2, align 4, !tbaa !14
%cmp4.not = icmp sgt i32 %9, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%idxprom7 = sext i32 %j.030 to i64
%arrayidx8 = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom7
%10 = load i64, ptr %arrayidx2, align 4
%11 = load i64, ptr %arrayidx8, align 4
store i64 %11, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx8, align 4
%inc = add nsw i32 %j.030, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%j.1 = phi i32 [ %inc, %if.then ], [ %j.030, %for.body ]
%gep = getelementptr %struct.Data, ptr %invariant.gep, i64 %indvars.iv
%12 = load i32, ptr %gep, align 4, !tbaa !14
%cmp4.not.1 = icmp sgt i32 %12, %0
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%idxprom7.1 = sext i32 %j.1 to i64
%arrayidx8.1 = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom7.1
%13 = load i64, ptr %gep, align 4
%14 = load i64, ptr %arrayidx8.1, align 4
store i64 %14, ptr %gep, align 4
store i64 %13, ptr %arrayidx8.1, align 4
%inc.1 = add nsw i32 %j.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%j.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %j.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !16
for.end: ; preds = %for.body.prol.loopexit, %for.inc.1, %entry
%j.0.lcssa = phi i32 [ %p, %entry ], [ %j.1.lcssa.unr, %for.body.prol.loopexit ], [ %j.1.1, %for.inc.1 ]
%idxprom10 = sext i32 %j.0.lcssa to i64
%arrayidx11 = getelementptr inbounds %struct.Data, ptr %A, i64 %idxprom10
%15 = load i64, ptr %arrayidx11, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx11, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %j.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @Swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #8 {
entry:
%0 = load i64, ptr %a, align 4
%1 = load i64, ptr %b, align 4
store i64 %1, ptr %a, align 4
store i64 %0, ptr %b, align 4
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @Merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%sub = sub nsw i32 %mid, %left
%sub1 = sub nsw i32 %right, %mid
%add = add nsw i32 %sub, 1
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 3
%call = tail call noalias ptr @malloc(i64 noundef %mul) #11
%add2 = add nsw i32 %sub1, 1
%conv3 = sext i32 %add2 to i64
%mul4 = shl nsw i64 %conv3, 3
%call5 = tail call noalias ptr @malloc(i64 noundef %mul4) #11
%cmp96 = icmp sgt i32 %sub, 0
br i1 %cmp96, label %for.body.preheader, label %for.cond10.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%1 = shl nsw i64 %0, 3
%scevgep = getelementptr i8, ptr %A, i64 %1
%2 = xor i32 %left, -1
%3 = add i32 %2, %mid
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = add nuw nsw i64 %5, 8
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false)
br label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.body.preheader, %entry
%cmp1198 = icmp sgt i32 %sub1, 0
br i1 %cmp1198, label %for.body13.preheader, label %for.end21
for.body13.preheader: ; preds = %for.cond10.preheader
%7 = sext i32 %mid to i64
%8 = shl nsw i64 %7, 3
%scevgep106 = getelementptr i8, ptr %A, i64 %8
%9 = xor i32 %mid, -1
%10 = add i32 %9, %right
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 3
%13 = add nuw nsw i64 %12, 8
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call5, ptr noundef nonnull align 4 dereferenceable(1) %scevgep106, i64 %13, i1 false)
br label %for.end21
for.end21: ; preds = %for.body13.preheader, %for.cond10.preheader
%idxprom22 = sext i32 %sub to i64
%arrayidx23 = getelementptr inbounds %struct.Data, ptr %call, i64 %idxprom22
store i32 1000000001, ptr %arrayidx23, align 4, !tbaa !14
%suit = getelementptr inbounds %struct.Data, ptr %call, i64 %idxprom22, i32 1
store i8 32, ptr %suit, align 4, !tbaa !11
%idxprom26 = sext i32 %sub1 to i64
%arrayidx27 = getelementptr inbounds %struct.Data, ptr %call5, i64 %idxprom26
store i32 1000000001, ptr %arrayidx27, align 4, !tbaa !14
%suit31 = getelementptr inbounds %struct.Data, ptr %call5, i64 %idxprom26, i32 1
store i8 32, ptr %suit31, align 4, !tbaa !11
%cmp33100 = icmp slt i32 %left, %right
br i1 %cmp33100, label %for.body35.preheader, label %for.end56
for.body35.preheader: ; preds = %for.end21
%14 = sext i32 %left to i64
%wide.trip.count = sext i32 %right to i64
%15 = sub nsw i64 %wide.trip.count, %14
%xtraiter = and i64 %15, 1
%16 = sub nsw i64 0, %wide.trip.count
%17 = xor i64 %14, %16
%18 = icmp eq i64 %17, -1
br i1 %18, label %for.end56.loopexit.unr-lcssa, label %for.body35.preheader.new
for.body35.preheader.new: ; preds = %for.body35.preheader
%unroll_iter = and i64 %15, -2
%invariant.gep = getelementptr %struct.Data, ptr %A, i64 1
br label %for.body35
for.body35: ; preds = %for.body35, %for.body35.preheader.new
%indvars.iv = phi i64 [ %14, %for.body35.preheader.new ], [ %indvars.iv.next.1, %for.body35 ]
%j.0102 = phi i32 [ 0, %for.body35.preheader.new ], [ %j.1.1, %for.body35 ]
%i.2101 = phi i32 [ 0, %for.body35.preheader.new ], [ %i.3.1, %for.body35 ]
%niter = phi i64 [ 0, %for.body35.preheader.new ], [ %niter.next.1, %for.body35 ]
%idxprom36 = zext i32 %i.2101 to i64
%arrayidx37 = getelementptr inbounds %struct.Data, ptr %call, i64 %idxprom36
%19 = load i32, ptr %arrayidx37, align 4, !tbaa !14
%idxprom39 = zext i32 %j.0102 to i64
%arrayidx40 = getelementptr inbounds %struct.Data, ptr %call5, i64 %idxprom39
%20 = load i32, ptr %arrayidx40, align 4, !tbaa !14
%cmp42.not = icmp sle i32 %19, %20
%.sink.in = select i1 %cmp42.not, ptr %arrayidx37, ptr %arrayidx40
%inc48 = zext i1 %cmp42.not to i32
%i.3 = add nuw nsw i32 %i.2101, %inc48
%not.cmp42.not = xor i1 %cmp42.not, true
%inc53 = zext i1 %not.cmp42.not to i32
%j.1 = add nuw nsw i32 %j.0102, %inc53
%.sink = load i64, ptr %.sink.in, align 4
%21 = getelementptr inbounds %struct.Data, ptr %A, i64 %indvars.iv
store i64 %.sink, ptr %21, align 4
%idxprom36.1 = zext i32 %i.3 to i64
%arrayidx37.1 = getelementptr inbounds %struct.Data, ptr %call, i64 %idxprom36.1
%22 = load i32, ptr %arrayidx37.1, align 4, !tbaa !14
%idxprom39.1 = zext i32 %j.1 to i64
%arrayidx40.1 = getelementptr inbounds %struct.Data, ptr %call5, i64 %idxprom39.1
%23 = load i32, ptr %arrayidx40.1, align 4, !tbaa !14
%cmp42.not.1 = icmp sle i32 %22, %23
%.sink.in.1 = select i1 %cmp42.not.1, ptr %arrayidx37.1, ptr %arrayidx40.1
%inc48.1 = zext i1 %cmp42.not.1 to i32
%i.3.1 = add nuw nsw i32 %i.3, %inc48.1
%not.cmp42.not.1 = xor i1 %cmp42.not.1, true
%inc53.1 = zext i1 %not.cmp42.not.1 to i32
%j.1.1 = add nuw nsw i32 %j.1, %inc53.1
%.sink.1 = load i64, ptr %.sink.in.1, align 4
%gep = getelementptr %struct.Data, ptr %invariant.gep, i64 %indvars.iv
store i64 %.sink.1, ptr %gep, align 4
%indvars.iv.next.1 = add 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.end56.loopexit.unr-lcssa.loopexit, label %for.body35, !llvm.loop !17
for.end56.loopexit.unr-lcssa.loopexit: ; preds = %for.body35
%24 = zext i32 %i.3.1 to i64
%25 = zext i32 %j.1.1 to i64
br label %for.end56.loopexit.unr-lcssa
for.end56.loopexit.unr-lcssa: ; preds = %for.end56.loopexit.unr-lcssa.loopexit, %for.body35.preheader
%indvars.iv.unr = phi i64 [ %14, %for.body35.preheader ], [ %indvars.iv.next.1, %for.end56.loopexit.unr-lcssa.loopexit ]
%j.0102.unr = phi i64 [ 0, %for.body35.preheader ], [ %25, %for.end56.loopexit.unr-lcssa.loopexit ]
%i.2101.unr = phi i64 [ 0, %for.body35.preheader ], [ %24, %for.end56.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end56, label %for.body35.epil
for.body35.epil: ; preds = %for.end56.loopexit.unr-lcssa
%arrayidx37.epil = getelementptr inbounds %struct.Data, ptr %call, i64 %i.2101.unr
%26 = load i32, ptr %arrayidx37.epil, align 4, !tbaa !14
%arrayidx40.epil = getelementptr inbounds %struct.Data, ptr %call5, i64 %j.0102.unr
%27 = load i32, ptr %arrayidx40.epil, align 4, !tbaa !14
%cmp42.not.epil.not = icmp sgt i32 %26, %27
%.sink.in.epil = select i1 %cmp42.not.epil.not, ptr %arrayidx40.epil, ptr %arrayidx37.epil
%.sink.epil = load i64, ptr %.sink.in.epil, align 4
%28 = getelementptr inbounds %struct.Data, ptr %A, i64 %indvars.iv.unr
store i64 %.sink.epil, ptr %28, align 4
br label %for.end56
for.end56: ; preds = %for.body35.epil, %for.end56.loopexit.unr-lcssa, %for.end21
tail call void @free(ptr noundef nonnull %call) #10
tail call void @free(ptr noundef nonnull %call5) #10
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind }
attributes #10 = { nounwind }
attributes #11 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !7, i64 4}
!12 = !{!"", !6, i64 0, !7, i64 4}
!13 = distinct !{!13, !10}
!14 = !{!12, !6, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
#define MAX 100000
#define SENTINEL 2000000000
struct Card {
char suit;
int value;
};
struct Card L[MAX / 2 + 2], R[MAX / 2 + 2];
void merge(struct Card A[], int n, int left, int mid, int right) {
int i, j, k;
int n1 = mid - left;
int n2 = right - mid;
for ( i = 0; i < n1; i++ ) L[i] = A[left + i];
for ( i = 0; i < n2; i++ ) R[i] = A[mid + i];
L[n1].value = R[n2].value = SENTINEL;
i = j = 0;
for ( k = left; k < right; k++ ) {
if ( L[i].value <= R[j].value ) {
A[k] = L[i++];
} else {
A[k] = R[j++];
}
}
}
void mergeSort(struct Card A[], int n, int left, int right) {
int mid;
if ( left + 1 < right ) {
mid = (left + right) / 2;
mergeSort(A, n, left, mid);
mergeSort(A, n, mid, right);
merge(A, n, left, mid, right);
}
}
int partition(struct Card A[], int n, int p, int r) {
int i, j;
struct Card t, x;
x = A[r];
i = p - 1;
for ( j = p; j < r; j++) {
if ( A[j].value <= x.value ) {
i++;
t = A[i]; A[i] = A[j]; A[j] = t;
}
}
t = A[i + 1]; A[i + 1] = A[r]; A[r] = t;
return i + 1;
}
void quickSort(struct Card A[], int n, int p, int r) {
int q;
if ( p < r ) {
q = partition(A, n, p, r);
quickSort(A, n, p, q - 1);
quickSort(A, n, q + 1, r);
}
}
int main() {
int n, i, v;
struct Card A[MAX], B[MAX];
char S[10];
int stable = 1;
scanf("%d", &n);
for ( i = 0; i < n; i++ ) {
scanf("%s %d", S, &v);
A[i].suit = B[i].suit = S[0];
A[i].value = B[i].value = v;
}
mergeSort(A, n, 0, n);
quickSort(B, n, 0, n-1);
for ( i = 0; i < n; i++ ) {
if ( A[i].suit != B[i].suit ) stable = 0;
}
if ( stable == 1 ) printf("Stable\n");
else printf("Not stable\n");
for ( i = 0; i < n; i++ ) {
printf("%c %d\n", B[i].suit, B[i].value);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269767/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269767/source.c"
target datalayout = "e-m:e-p270: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.Card = type { i8, i32 }
@L = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A89 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp66 = icmp sgt i32 %sub, 0
br i1 %cmp66, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader107, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A89
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader107, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load90 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load90, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader107
for.body.preheader107: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader107, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader107 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader107 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader107
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader107 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp568 = icmp sgt i32 %sub1, 0
br i1 %cmp568, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count80 = zext i32 %sub1 to i64
%invariant.gep87 = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check95 = icmp ult i32 %sub1, 10
br i1 %min.iters.check95, label %for.body6.preheader106, label %vector.memcheck91
vector.memcheck91: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A89
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check92 = icmp ult i64 %16, 32
br i1 %diff.check92, label %for.body6.preheader106, label %vector.ph96
vector.ph96: ; preds = %vector.memcheck91
%n.vec98 = and i64 %wide.trip.count80, 4294967292
br label %vector.body101
vector.body101: ; preds = %vector.body101, %vector.ph96
%index102 = phi i64 [ 0, %vector.ph96 ], [ %index.next105, %vector.body101 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index102
%18 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %index102
%wide.load103 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load104 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load103, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load104, ptr %20, align 16
%index.next105 = add nuw i64 %index102, 4
%21 = icmp eq i64 %index.next105, %n.vec98
br i1 %21, label %middle.block93, label %vector.body101, !llvm.loop !11
middle.block93: ; preds = %vector.body101
%cmp.n100 = icmp eq i64 %n.vec98, %wide.trip.count80
br i1 %cmp.n100, label %for.end14, label %for.body6.preheader106
for.body6.preheader106: ; preds = %vector.memcheck91, %for.body6.preheader, %middle.block93
%indvars.iv76.ph = phi i64 [ 0, %vector.memcheck91 ], [ 0, %for.body6.preheader ], [ %n.vec98, %middle.block93 ]
%22 = xor i64 %indvars.iv76.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80
%xtraiter108 = and i64 %wide.trip.count80, 3
%lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
br i1 %lcmp.mod109.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader106, %for.body6.prol
%indvars.iv76.prol = phi i64 [ %indvars.iv.next77.prol, %for.body6.prol ], [ %indvars.iv76.ph, %for.body6.preheader106 ]
%prol.iter110 = phi i64 [ %prol.iter110.next, %for.body6.prol ], [ 0, %for.body6.preheader106 ]
%arrayidx8.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.prol
%gep88.prol = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76.prol
%24 = load i64, ptr %gep88.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next77.prol = add nuw nsw i64 %indvars.iv76.prol, 1
%prol.iter110.next = add i64 %prol.iter110, 1
%prol.iter110.cmp.not = icmp eq i64 %prol.iter110.next, %xtraiter108
br i1 %prol.iter110.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !12
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader106
%indvars.iv76.unr = phi i64 [ %indvars.iv76.ph, %for.body6.preheader106 ], [ %indvars.iv.next77.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !13
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv76 = phi i64 [ %indvars.iv.next77.3, %for.body6 ], [ %indvars.iv76.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76
%gep88 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76
%30 = load i64, ptr %gep88, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%arrayidx8.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77
%gep88.1 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77
%31 = load i64, ptr %gep88.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 2
%arrayidx8.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.1
%gep88.2 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.1
%32 = load i64, ptr %gep88.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next77.2 = add nuw nsw i64 %indvars.iv76, 3
%arrayidx8.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.2
%gep88.3 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.2
%33 = load i64, ptr %gep88.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next77.3 = add nuw nsw i64 %indvars.iv76, 4
%exitcond81.not.3 = icmp eq i64 %indvars.iv.next77.3, %wide.trip.count80
br i1 %exitcond81.not.3, label %for.end14, label %for.body6, !llvm.loop !14
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block93, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%value = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 2000000000, ptr %value, align 4, !tbaa !15
%idxprom17 = sext i32 %sub to i64
%value19 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 2000000000, ptr %value19, align 4, !tbaa !15
%cmp2170 = icmp slt i32 %left, %right
br i1 %cmp2170, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count85 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv82 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next83, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.072 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%value25 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %value25, align 4, !tbaa !15
%idxprom26 = zext i32 %j.072 to i64
%value28 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %value28, align 4, !tbaa !15
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc37 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.072, %inc37
%not.cmp29.not = xor i1 %cmp29.not, true
%inc32 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc32
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82
store i64 %.sink, ptr %37, align 4
%indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
br i1 %exitcond86.not, label %for.end42, label %for.body22, !llvm.loop !20
for.end42: ; preds = %for.body22, %for.end14
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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A14 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp66.i = icmp sgt i32 %sub.i, 0
br i1 %cmp66.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A14
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load15 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load15, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp568.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp568.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count80.i = zext i32 %sub1.i to i64
%invariant.gep87.i = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check20, label %for.body6.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A14
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body6.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count80.i, 4294967292
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index27
%18 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %index27
%wide.load28 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load29 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load28, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load29, ptr %20, align 16
%index.next30 = add nuw i64 %index27, 4
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !23
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count80.i
br i1 %cmp.n25, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck16, %for.body6.preheader.i, %middle.block18
%indvars.iv76.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body6.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv76.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80.i
%xtraiter31 = and i64 %wide.trip.count80.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv76.i.prol = phi i64 [ %indvars.iv.next77.i.prol, %for.body6.i.prol ], [ %indvars.iv76.i.ph, %for.body6.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i.prol
%gep88.i.prol = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i.prol
%24 = load i64, ptr %gep88.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next77.i.prol = add nuw nsw i64 %indvars.iv76.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv76.i.unr = phi i64 [ %indvars.iv76.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next77.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv76.i = phi i64 [ %indvars.iv.next77.i.3, %for.body6.i ], [ %indvars.iv76.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i
%gep88.i = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i
%30 = load i64, ptr %gep88.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next77.i = add nuw nsw i64 %indvars.iv76.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i
%gep88.i.1 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i
%31 = load i64, ptr %gep88.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next77.i.1 = add nuw nsw i64 %indvars.iv76.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.1
%gep88.i.2 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.1
%32 = load i64, ptr %gep88.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next77.i.2 = add nuw nsw i64 %indvars.iv76.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.2
%gep88.i.3 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.2
%33 = load i64, ptr %gep88.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next77.i.3 = add nuw nsw i64 %indvars.iv76.i, 4
%exitcond81.not.i.3 = icmp eq i64 %indvars.iv.next77.i.3, %wide.trip.count80.i
br i1 %exitcond81.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block18, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%value.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 2000000000, ptr %value.i, align 4, !tbaa !15
%idxprom17.i = sext i32 %sub.i to i64
%value19.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %value19.i, align 4, !tbaa !15
%34 = sext i32 %left to i64
%wide.trip.count85.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv82.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next83.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.072.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%value25.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %value25.i, align 4, !tbaa !15
%idxprom26.i = zext i32 %j.072.i to i64
%value28.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %value28.i, align 4, !tbaa !15
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%inc37.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.072.i, %inc37.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc32.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc32.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next83.i = add nsw i64 %indvars.iv82.i, 1
%exitcond86.not.i = icmp eq i64 %indvars.iv.next83.i, %wide.trip.count85.i
br i1 %exitcond86.not.i, label %if.end, label %for.body22.i, !llvm.loop !20
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%value.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %value.prol, align 4, !tbaa !15
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%value = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %value, align 4, !tbaa !15
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%value.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %value.1, align 4, !tbaa !15
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp10 = icmp slt i32 %p, %r
br i1 %cmp10, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr11 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr11, -1
%1 = sext i32 %p.tr11 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !15
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr11 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr11, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !15
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !15
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %n, i32 noundef %p.tr11, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
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.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %v, align 4, !tbaa !28
%value = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value, align 4, !tbaa !15
%value10 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value10, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%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 !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef %5, i32 noundef 0, i32 noundef %sub)
%cmp1465 = icmp sgt i32 %5, 0
br i1 %cmp1465, label %for.body15.preheader, label %if.end33
for.body15.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end27.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body15
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv73 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067 = phi i32 [ 1, %for.body15.preheader.new ], [ %spec.select.3, %for.body15 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.3, %for.body15 ]
%arrayidx17 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i8, ptr %arrayidx17, align 16, !tbaa !31
%arrayidx20 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73
%8 = load i8, ptr %arrayidx20, align 16, !tbaa !31
%cmp23.not = icmp eq i8 %7, %8
%indvars.iv.next74 = or i64 %indvars.iv73, 1
%arrayidx17.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74
%9 = load i8, ptr %arrayidx17.1, align 8, !tbaa !31
%arrayidx20.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74
%10 = load i8, ptr %arrayidx20.1, align 8, !tbaa !31
%cmp23.not.1 = icmp eq i8 %9, %10
%indvars.iv.next74.1 = or i64 %indvars.iv73, 2
%arrayidx17.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.1
%11 = load i8, ptr %arrayidx17.2, align 16, !tbaa !31
%arrayidx20.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.1
%12 = load i8, ptr %arrayidx20.2, align 16, !tbaa !31
%cmp23.not.2 = icmp eq i8 %11, %12
%indvars.iv.next74.2 = or i64 %indvars.iv73, 3
%arrayidx17.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.2
%13 = load i8, ptr %arrayidx17.3, align 8, !tbaa !31
%arrayidx20.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.2
%14 = load i8, ptr %arrayidx20.3, align 8, !tbaa !31
%cmp23.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp23.not.3, i1 %cmp23.not.2, i1 false
%16 = select i1 %15, i1 %cmp23.not.1, i1 false
%17 = select i1 %16, i1 %cmp23.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.067, i32 0
%indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end27.unr-lcssa, label %for.body15, !llvm.loop !33
for.end27.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%indvars.iv73.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067.unr = phi i32 [ 1, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end27, label %for.body15.epil
for.body15.epil: ; preds = %for.end27.unr-lcssa, %for.body15.epil
%indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %for.body15.epil ], [ %indvars.iv73.unr, %for.end27.unr-lcssa ]
%stable.067.epil = phi i32 [ %spec.select.epil, %for.body15.epil ], [ %stable.067.unr, %for.end27.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body15.epil ], [ 0, %for.end27.unr-lcssa ]
%arrayidx17.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73.epil
%18 = load i8, ptr %arrayidx17.epil, align 8, !tbaa !31
%arrayidx20.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73.epil
%19 = load i8, ptr %arrayidx20.epil, align 8, !tbaa !31
%cmp23.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp23.not.epil, i32 %stable.067.epil, i32 0
%indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end27, label %for.body15.epil, !llvm.loop !34
for.end27: ; preds = %for.body15.epil, %for.end27.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end27.unr-lcssa ], [ %spec.select.epil, %for.body15.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select81 = select i1 %20, ptr @str.5, ptr @str
br label %if.end33
if.end33: ; preds = %for.end27, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select81, %for.end27 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr %n, align 4, !tbaa !28
%cmp3569 = icmp sgt i32 %21, 0
br i1 %cmp3569, label %for.body37, label %for.end48
for.body37: ; preds = %if.end33, %for.body37
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body37 ], [ 0, %if.end33 ]
%arrayidx39 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76
%22 = load i8, ptr %arrayidx39, align 8, !tbaa !31
%conv41 = sext i8 %22 to i32
%value44 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76, i32 1
%23 = load i32, ptr %value44, align 4, !tbaa !15
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv41, i32 noundef %23)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%24 = load i32, ptr %n, align 4, !tbaa !28
%25 = sext i32 %24 to i64
%cmp35 = icmp slt i64 %indvars.iv.next77, %25
br i1 %cmp35, label %for.body37, label %for.end48, !llvm.loop !35
for.end48: ; preds = %for.body37, %if.end33
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = distinct !{!14, !6, !7}
!15 = !{!16, !19, i64 4}
!16 = !{!"Card", !17, i64 0, !19, i64 4}
!17 = !{!"omnipotent char", !18, i64 0}
!18 = !{!"Simple C/C++ TBAA"}
!19 = !{!"int", !17, i64 0}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!19, !19, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!17, !17, i64 0}
!31 = !{!16, !17, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !6}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int is_sorted(int* A, int N)
{
int i;
for(i=1;i<N;i++)
{
if(*(A+i) < *(A+i-1))
{
return 0;
}
}
return 1;
}
void swap(int* a, int* b)
{
int tt;
tt = *a;
*a = *b;
*b = tt;
}
void Bubblesort(int* A, int N)
{
int i;
int j;
for(i=0;i<N;i++)
{
for(j=i+1;j<N;j++)
{
if( *(A+j) < *(A+i) )
{
swap(A+i,A+j);
}
}
}
}
void Quicksort(int* A, int N)
{
int pivot = *A;
int left = 1;
int right = N-1;
int finish = 0;
if(N == 2)
{
if(*A>*(A+1))
{
swap(A,A+1);
}
return;
}
else if(N<1000)
{
if(!is_sorted(A, N))
{
Bubblesort(A, N);
}
return;
}
while(left<right)
{
while(*(A+left) <= pivot)
{
left++;
if(left>right)
{
finish = -1;
}
}
if(finish)
{
break;
}
while(*(A+right) > pivot)
{
right--;
if(right<left)
{
finish = 1;
}
}
if(finish)
{
break;
}
swap(A+left,A+right);
}
if(finish == -1)
{
swap(A,A+(N-1));
Quicksort(A,N-1);
}
if(finish == 1)
{
swap(A,A+right);
if(!is_sorted(A,right))
{
Quicksort(A,right);
}
if(!is_sorted(A+right+1,N-right-1))
{
Quicksort(A+right+1,N-right-1);
}
}
return;
}
int main()
{
// variable in description
int T;
int N;
int K;
int* A;
int* B;
// variable to support
int* num;
long long int ans;
// variable to judge
int i;
int j;
int k;
int t;
scanf("%d",&T);
for(i=0;i<T;i++)
{
scanf("%d %d",&N,&K);
A = (int*)malloc(sizeof(int)*N);
B = (int*)malloc(sizeof(int)*K);
num = (int*)malloc(sizeof(int)*K);
for(j=0;j<N;j++)
{
scanf("%d",A+j);
}
for(j=0;j<K;j++)
{
scanf("%d",B+j);
*(num+j) = 0;
}
if(!is_sorted(A,N))
{
Quicksort(A,N);
}
if(!is_sorted(B,K))
{
Quicksort(B,K);
}
ans = 0;
t = N-1;
for(j=0;j<K;j++)
{
ans += *(A+t);
if(*(B+j) == 1)
{
ans += *(A+t);
}
t--;
}
t++;
for(j=0;j<K;j++)
{
if(*(B+j) != 1)
{
t -= (*(B+j)-1);
ans += *(A+t);
}
//printf("%5d\n",*(A+t));
}
printf("%lld\n",ans);
free(A);
free(B);
free(num);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26981/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26981/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @is_sorted(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp9 = icmp sgt i32 %N, 1
br i1 %cmp9, label %for.body.preheader, label %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 !5
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%add.ptr = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %add.ptr, align 4, !tbaa !7
%add.ptr3 = getelementptr inbounds i32, ptr %add.ptr, i64 -1
%1 = load i32, ptr %add.ptr3, align 4, !tbaa !7
%cmp4 = icmp slt i32 %0, %1
br i1 %cmp4, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !7
%1 = load i32, ptr %b, align 4, !tbaa !7
store i32 %1, ptr %a, align 4, !tbaa !7
store i32 %0, ptr %b, align 4, !tbaa !7
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @Bubblesort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #3 {
entry:
%cmp27 = icmp sgt i32 %N, 0
br i1 %cmp27, label %for.body.preheader, label %for.end13
for.body.preheader: ; preds = %entry
%0 = zext i32 %N to i64
%wide.trip.count35 = zext i32 %N to i64
br label %for.body
for.cond.loopexit: ; preds = %for.inc, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond36.not = icmp eq i64 %indvars.iv.next33, %wide.trip.count35
br i1 %exitcond36.not, label %for.end13, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.preheader, %for.cond.loopexit
%indvars.iv32 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next33, %for.cond.loopexit ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.cond.loopexit ]
%indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
%cmp225 = icmp ult i64 %indvars.iv.next33, %0
br i1 %cmp225, label %for.body3.lr.ph, label %for.cond.loopexit
for.body3.lr.ph: ; preds = %for.body
%add.ptr5 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv32
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.inc
%indvars.iv29 = phi i64 [ %indvars.iv, %for.body3.lr.ph ], [ %indvars.iv.next30, %for.inc ]
%add.ptr = getelementptr inbounds i32, ptr %A, i64 %indvars.iv29
%1 = load i32, ptr %add.ptr, align 4, !tbaa !7
%2 = load i32, ptr %add.ptr5, align 4, !tbaa !7
%cmp6 = icmp slt i32 %1, %2
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
store i32 %1, ptr %add.ptr5, align 4, !tbaa !7
store i32 %2, ptr %add.ptr, align 4, !tbaa !7
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
%exitcond.not = icmp eq i64 %indvars.iv.next30, %wide.trip.count35
br i1 %exitcond.not, label %for.cond.loopexit, label %for.body3, !llvm.loop !12
for.end13: ; preds = %for.cond.loopexit, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @Quicksort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %A, align 4, !tbaa !7
%cmp206214 = icmp eq i32 %N, 2
br i1 %cmp206214, label %if.then, label %if.else.lr.ph
tailrecurse.loopexit: ; preds = %for.body.i143
%1 = load i32, ptr %add.ptr55, align 4, !tbaa !7
%cmp206 = icmp eq i32 %sub57, 2
br i1 %cmp206, label %if.then, label %if.else.lr.ph
if.else.lr.ph: ; preds = %entry, %tailrecurse.loopexit
%2 = phi i32 [ %1, %tailrecurse.loopexit ], [ %0, %entry ]
%N.tr.ph216 = phi i32 [ %sub57, %tailrecurse.loopexit ], [ %N, %entry ]
%A.tr.ph215 = phi ptr [ %add.ptr55, %tailrecurse.loopexit ], [ %A, %entry ]
%3 = sext i32 %N.tr.ph216 to i64
%cmp4300 = icmp slt i32 %N.tr.ph216, 1000
br i1 %cmp4300, label %if.then5, label %while.cond11.preheader.preheader
if.then: ; preds = %tailrecurse.loopexit, %entry
%A.tr.ph.lcssa184 = phi ptr [ %A, %entry ], [ %add.ptr55, %tailrecurse.loopexit ]
%.lcssa174 = phi i32 [ %0, %entry ], [ %1, %tailrecurse.loopexit ]
%add.ptr = getelementptr inbounds i32, ptr %A.tr.ph.lcssa184, i64 1
%4 = load i32, ptr %add.ptr, align 4, !tbaa !7
%cmp1 = icmp sgt i32 %.lcssa174, %4
br i1 %cmp1, label %if.then2, label %cleanup
if.then2: ; preds = %if.then
store i32 %4, ptr %A.tr.ph.lcssa184, align 4, !tbaa !7
store i32 %.lcssa174, ptr %add.ptr, align 4, !tbaa !7
br label %cleanup
while.cond11.preheader.preheader: ; preds = %if.else.lr.ph, %if.end44.thread
%5 = phi i32 [ %22, %if.end44.thread ], [ %2, %if.else.lr.ph ]
%indvars.iv249301 = phi i64 [ %indvars.iv.next250302, %if.end44.thread ], [ %3, %if.else.lr.ph ]
%indvars.iv.next250302 = add nsw i64 %indvars.iv249301, -1
%6 = trunc i64 %indvars.iv.next250302 to i32
br label %while.cond11.preheader
if.then5: ; preds = %if.else.lr.ph, %if.end44.thread
%indvars.iv249.lcssa = phi i64 [ %indvars.iv.next250302, %if.end44.thread ], [ %3, %if.else.lr.ph ]
%7 = trunc i64 %indvars.iv249.lcssa to i32
%cmp9.i = icmp sgt i32 %7, 1
br i1 %cmp9.i, label %for.body.preheader.i, label %cleanup
for.body.preheader.i: ; preds = %if.then5
%wide.trip.count.i = and i64 %indvars.iv249.lcssa, 4294967295
br label %for.body.i
for.cond.i: ; preds = %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 %cleanup, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%add.ptr.i = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %indvars.iv.i
%8 = load i32, ptr %add.ptr.i, align 4, !tbaa !7
%add.ptr3.i = getelementptr inbounds i32, ptr %add.ptr.i, i64 -1
%9 = load i32, ptr %add.ptr3.i, align 4, !tbaa !7
%cmp4.i = icmp slt i32 %8, %9
br i1 %cmp4.i, label %for.body.i121, label %for.cond.i
for.cond.loopexit.i: ; preds = %for.inc.i, %for.body.i121
%indvars.iv.next.i123 = add nuw nsw i64 %indvars.iv.i122, 1
%exitcond36.not.i = icmp eq i64 %indvars.iv.next33.i, %wide.trip.count.i
br i1 %exitcond36.not.i, label %cleanup, label %for.body.i121, !llvm.loop !11
for.body.i121: ; preds = %for.body.i, %for.cond.loopexit.i
%indvars.iv32.i = phi i64 [ %indvars.iv.next33.i, %for.cond.loopexit.i ], [ 0, %for.body.i ]
%indvars.iv.i122 = phi i64 [ %indvars.iv.next.i123, %for.cond.loopexit.i ], [ 1, %for.body.i ]
%indvars.iv.next33.i = add nuw nsw i64 %indvars.iv32.i, 1
%cmp225.i = icmp ult i64 %indvars.iv.next33.i, %wide.trip.count.i
br i1 %cmp225.i, label %for.body3.lr.ph.i, label %for.cond.loopexit.i
for.body3.lr.ph.i: ; preds = %for.body.i121
%add.ptr5.i = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %indvars.iv32.i
br label %for.body3.i
for.body3.i: ; preds = %for.inc.i, %for.body3.lr.ph.i
%indvars.iv29.i = phi i64 [ %indvars.iv.i122, %for.body3.lr.ph.i ], [ %indvars.iv.next30.i, %for.inc.i ]
%add.ptr.i124 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %indvars.iv29.i
%10 = load i32, ptr %add.ptr.i124, align 4, !tbaa !7
%11 = load i32, ptr %add.ptr5.i, align 4, !tbaa !7
%cmp6.i = icmp slt i32 %10, %11
br i1 %cmp6.i, label %if.then.i, label %for.inc.i
if.then.i: ; preds = %for.body3.i
store i32 %10, ptr %add.ptr5.i, align 4, !tbaa !7
store i32 %11, ptr %add.ptr.i124, align 4, !tbaa !7
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body3.i
%indvars.iv.next30.i = add nuw nsw i64 %indvars.iv29.i, 1
%exitcond.not.i125 = icmp eq i64 %indvars.iv.next30.i, %wide.trip.count.i
br i1 %exitcond.not.i125, label %for.cond.loopexit.i, label %for.body3.i, !llvm.loop !12
while.cond11.preheader: ; preds = %while.cond11.preheader.preheader, %if.end32
%right.0204 = phi i32 [ %right.1.lcssa267, %if.end32 ], [ %6, %while.cond11.preheader.preheader ]
%left.0203 = phi i32 [ %left.1.lcssa258, %if.end32 ], [ 1, %while.cond11.preheader.preheader ]
%idx.ext185 = sext i32 %left.0203 to i64
%add.ptr12186 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %idx.ext185
%12 = load i32, ptr %add.ptr12186, align 4, !tbaa !7
%cmp13.not187 = icmp sgt i32 %12, %5
br i1 %cmp13.not187, label %while.cond21.preheader, label %while.body14.preheader
while.body14.preheader: ; preds = %while.cond11.preheader
%13 = sext i32 %right.0204 to i64
br label %while.body14
while.body14: ; preds = %while.body14.preheader, %while.body14
%indvars.iv = phi i64 [ %idx.ext185, %while.body14.preheader ], [ %indvars.iv.next, %while.body14 ]
%finish.1189 = phi i32 [ 0, %while.body14.preheader ], [ %spec.select, %while.body14 ]
%indvars.iv.next = add i64 %indvars.iv, 1
%cmp15.not = icmp slt i64 %indvars.iv, %13
%spec.select = select i1 %cmp15.not, i32 %finish.1189, i32 -1
%add.ptr12 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %indvars.iv.next
%14 = load i32, ptr %add.ptr12, align 4, !tbaa !7
%cmp13.not = icmp sgt i32 %14, %5
br i1 %cmp13.not, label %while.end, label %while.body14, !llvm.loop !13
while.end: ; preds = %while.body14
%15 = trunc i64 %indvars.iv.next to i32
%tobool18.not = icmp eq i32 %spec.select, 0
br i1 %tobool18.not, label %while.cond21.preheader, label %if.end44.thread
while.cond21.preheader: ; preds = %while.cond11.preheader, %while.end
%idx.ext185.pn = phi i64 [ %indvars.iv.next, %while.end ], [ %idx.ext185, %while.cond11.preheader ]
%.lcssa259 = phi i32 [ %14, %while.end ], [ %12, %while.cond11.preheader ]
%left.1.lcssa258 = phi i32 [ %15, %while.end ], [ %left.0203, %while.cond11.preheader ]
%add.ptr12.le260 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %idx.ext185.pn
%idx.ext22193 = sext i32 %right.0204 to i64
%add.ptr23194 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %idx.ext22193
%16 = load i32, ptr %add.ptr23194, align 4, !tbaa !7
%cmp24195 = icmp sgt i32 %16, %5
br i1 %cmp24195, label %while.body25.preheader, label %if.end32
while.body25.preheader: ; preds = %while.cond21.preheader
%17 = sext i32 %left.1.lcssa258 to i64
br label %while.body25
while.body25: ; preds = %while.body25.preheader, %while.body25
%indvars.iv246 = phi i64 [ %idx.ext22193, %while.body25.preheader ], [ %indvars.iv.next247, %while.body25 ]
%finish.3197 = phi i32 [ 0, %while.body25.preheader ], [ %spec.select119, %while.body25 ]
%indvars.iv.next247 = add i64 %indvars.iv246, -1
%cmp26.not = icmp sgt i64 %indvars.iv246, %17
%spec.select119 = select i1 %cmp26.not, i32 %finish.3197, i32 1
%add.ptr23 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %indvars.iv.next247
%18 = load i32, ptr %add.ptr23, align 4, !tbaa !7
%cmp24 = icmp sgt i32 %18, %5
br i1 %cmp24, label %while.body25, label %while.end29, !llvm.loop !14
while.end29: ; preds = %while.body25
%19 = trunc i64 %indvars.iv.next247 to i32
%tobool30.not = icmp eq i32 %spec.select119, 0
br i1 %tobool30.not, label %if.end32, label %if.then46
if.end32: ; preds = %while.cond21.preheader, %while.end29
%.lcssa173268 = phi i32 [ %18, %while.end29 ], [ %16, %while.cond21.preheader ]
%right.1.lcssa267 = phi i32 [ %19, %while.end29 ], [ %right.0204, %while.cond21.preheader ]
%idx.ext22.lcssa266 = phi i64 [ %indvars.iv.next247, %while.end29 ], [ %idx.ext22193, %while.cond21.preheader ]
%add.ptr23.le = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %idx.ext22.lcssa266
store i32 %.lcssa173268, ptr %add.ptr12.le260, align 4, !tbaa !7
store i32 %.lcssa259, ptr %add.ptr23.le, align 4, !tbaa !7
%cmp10 = icmp slt i32 %left.1.lcssa258, %right.1.lcssa267
br i1 %cmp10, label %while.cond11.preheader, label %cleanup, !llvm.loop !15
if.end44.thread: ; preds = %while.end
%add.ptr42 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %indvars.iv.next250302
%20 = load i32, ptr %A.tr.ph215, align 4, !tbaa !7
%21 = load i32, ptr %add.ptr42, align 4, !tbaa !7
store i32 %21, ptr %A.tr.ph215, align 4, !tbaa !7
store i32 %20, ptr %add.ptr42, align 4, !tbaa !7
%22 = load i32, ptr %A.tr.ph215, align 4, !tbaa !7
%cmp4 = icmp slt i64 %indvars.iv249301, 1001
br i1 %cmp4, label %if.then5, label %while.cond11.preheader.preheader
if.then46: ; preds = %while.end29
%23 = trunc i64 %indvars.iv249301 to i32
%sext = shl i64 %indvars.iv.next247, 32
%idx.ext47 = ashr exact i64 %sext, 32
%add.ptr48 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %idx.ext47
%24 = load i32, ptr %A.tr.ph215, align 4, !tbaa !7
%25 = load i32, ptr %add.ptr48, align 4, !tbaa !7
store i32 %25, ptr %A.tr.ph215, align 4, !tbaa !7
store i32 %24, ptr %add.ptr48, align 4, !tbaa !7
%cmp9.i126 = icmp sgt i32 %19, 1
br i1 %cmp9.i126, label %for.body.preheader.i128, label %if.end52
for.body.preheader.i128: ; preds = %if.then46
%wide.trip.count.i129 = and i64 %indvars.iv.next247, 4294967295
br label %for.body.i130
for.cond.i135: ; preds = %for.body.i130
%indvars.iv.next.i136 = add nuw nsw i64 %indvars.iv.i131, 1
%exitcond.not.i137 = icmp eq i64 %indvars.iv.next.i136, %wide.trip.count.i129
br i1 %exitcond.not.i137, label %if.end52, label %for.body.i130, !llvm.loop !5
for.body.i130: ; preds = %for.cond.i135, %for.body.preheader.i128
%indvars.iv.i131 = phi i64 [ 1, %for.body.preheader.i128 ], [ %indvars.iv.next.i136, %for.cond.i135 ]
%add.ptr.i132 = getelementptr inbounds i32, ptr %A.tr.ph215, i64 %indvars.iv.i131
%26 = load i32, ptr %add.ptr.i132, align 4, !tbaa !7
%add.ptr3.i133 = getelementptr inbounds i32, ptr %add.ptr.i132, i64 -1
%27 = load i32, ptr %add.ptr3.i133, align 4, !tbaa !7
%cmp4.i134 = icmp slt i32 %26, %27
br i1 %cmp4.i134, label %if.then51, label %for.cond.i135
if.then51: ; preds = %for.body.i130
tail call void @Quicksort(ptr noundef nonnull %A.tr.ph215, i32 noundef %19)
br label %if.end52
if.end52: ; preds = %for.cond.i135, %if.then46, %if.then51
%add.ptr55 = getelementptr inbounds i32, ptr %add.ptr48, i64 1
%28 = xor i32 %19, -1
%sub57 = add i32 %23, %28
%cmp9.i139 = icmp sgt i32 %sub57, 1
br i1 %cmp9.i139, label %for.body.preheader.i141, label %cleanup
for.body.preheader.i141: ; preds = %if.end52
%wide.trip.count.i142 = zext i32 %sub57 to i64
br label %for.body.i143
for.cond.i148: ; preds = %for.body.i143
%indvars.iv.next.i149 = add nuw nsw i64 %indvars.iv.i144, 1
%exitcond.not.i150 = icmp eq i64 %indvars.iv.next.i149, %wide.trip.count.i142
br i1 %exitcond.not.i150, label %cleanup, label %for.body.i143, !llvm.loop !5
for.body.i143: ; preds = %for.cond.i148, %for.body.preheader.i141
%indvars.iv.i144 = phi i64 [ 1, %for.body.preheader.i141 ], [ %indvars.iv.next.i149, %for.cond.i148 ]
%add.ptr.i145 = getelementptr inbounds i32, ptr %add.ptr55, i64 %indvars.iv.i144
%29 = load i32, ptr %add.ptr.i145, align 4, !tbaa !7
%add.ptr3.i146 = getelementptr inbounds i32, ptr %add.ptr.i145, i64 -1
%30 = load i32, ptr %add.ptr3.i146, align 4, !tbaa !7
%cmp4.i147 = icmp slt i32 %29, %30
br i1 %cmp4.i147, label %tailrecurse.loopexit, label %for.cond.i148
cleanup: ; preds = %if.end52, %for.cond.i148, %if.end32, %for.cond.i, %for.cond.loopexit.i, %if.then5, %if.then, %if.then2
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%T = alloca i32, align 4
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !7
%cmp144 = icmp sgt i32 %0, 0
br i1 %cmp144, label %for.body, label %for.end76
for.body: ; preds = %entry, %for.end72
%i.0145 = phi i32 [ %inc75, %for.end72 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N, ptr noundef nonnull %K)
%1 = load i32, ptr %N, align 4, !tbaa !7
%conv = sext i32 %1 to i64
%mul = shl nsw i64 %conv, 2
%call2 = call noalias ptr @malloc(i64 noundef %mul) #11
%2 = load i32, ptr %K, align 4, !tbaa !7
%conv3 = sext i32 %2 to i64
%mul4 = shl nsw i64 %conv3, 2
%call5 = call noalias ptr @malloc(i64 noundef %mul4) #11
%cmp10129 = icmp sgt i32 %1, 0
br i1 %cmp10129, label %for.body12, label %for.cond14.preheader
for.cond14.preheader.loopexit: ; preds = %for.body12
%.pre = load i32, ptr %K, align 4, !tbaa !7
br label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.cond14.preheader.loopexit, %for.body
%3 = phi i32 [ %5, %for.cond14.preheader.loopexit ], [ %1, %for.body ]
%4 = phi i32 [ %.pre, %for.cond14.preheader.loopexit ], [ %2, %for.body ]
%cmp15131 = icmp sgt i32 %4, 0
br i1 %cmp15131, label %for.body17, label %for.end25
for.body12: ; preds = %for.body, %for.body12
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body12 ], [ 0, %for.body ]
%add.ptr = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !7
%6 = sext i32 %5 to i64
%cmp10 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp10, label %for.body12, label %for.cond14.preheader.loopexit, !llvm.loop !16
for.body17: ; preds = %for.cond14.preheader, %for.body17
%indvars.iv148 = phi i64 [ %indvars.iv.next149, %for.body17 ], [ 0, %for.cond14.preheader ]
%add.ptr19 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv148
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr19)
%indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
%7 = load i32, ptr %K, align 4, !tbaa !7
%8 = sext i32 %7 to i64
%cmp15 = icmp slt i64 %indvars.iv.next149, %8
br i1 %cmp15, label %for.body17, label %for.end25.loopexit, !llvm.loop !17
for.end25.loopexit: ; preds = %for.body17
%.pre163 = load i32, ptr %N, align 4, !tbaa !7
br label %for.end25
for.end25: ; preds = %for.end25.loopexit, %for.cond14.preheader
%9 = phi i32 [ %3, %for.cond14.preheader ], [ %.pre163, %for.end25.loopexit ]
%.lcssa = phi i32 [ %4, %for.cond14.preheader ], [ %7, %for.end25.loopexit ]
%cmp9.i = icmp sgt i32 %9, 1
br i1 %cmp9.i, label %for.body.preheader.i, label %if.end
for.body.preheader.i: ; preds = %for.end25
%wide.trip.count.i = zext i32 %9 to i64
br label %for.body.i
for.cond.i: ; preds = %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 %if.end, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%add.ptr.i = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.i
%10 = load i32, ptr %add.ptr.i, align 4, !tbaa !7
%add.ptr3.i = getelementptr inbounds i32, ptr %add.ptr.i, i64 -1
%11 = load i32, ptr %add.ptr3.i, align 4, !tbaa !7
%cmp4.i = icmp slt i32 %10, %11
br i1 %cmp4.i, label %if.then, label %for.cond.i
if.then: ; preds = %for.body.i
call void @Quicksort(ptr noundef nonnull %call2, i32 noundef %9)
br label %if.end
if.end: ; preds = %for.cond.i, %for.end25, %if.then
%cmp9.i112 = icmp sgt i32 %.lcssa, 1
br i1 %cmp9.i112, label %for.body.preheader.i114, label %if.end30
for.body.preheader.i114: ; preds = %if.end
%wide.trip.count.i115 = zext i32 %.lcssa to i64
br label %for.body.i116
for.cond.i121: ; preds = %for.body.i116
%indvars.iv.next.i122 = add nuw nsw i64 %indvars.iv.i117, 1
%exitcond.not.i123 = icmp eq i64 %indvars.iv.next.i122, %wide.trip.count.i115
br i1 %exitcond.not.i123, label %if.end30, label %for.body.i116, !llvm.loop !5
for.body.i116: ; preds = %for.cond.i121, %for.body.preheader.i114
%indvars.iv.i117 = phi i64 [ 1, %for.body.preheader.i114 ], [ %indvars.iv.next.i122, %for.cond.i121 ]
%add.ptr.i118 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv.i117
%12 = load i32, ptr %add.ptr.i118, align 4, !tbaa !7
%add.ptr3.i119 = getelementptr inbounds i32, ptr %add.ptr.i118, i64 -1
%13 = load i32, ptr %add.ptr3.i119, align 4, !tbaa !7
%cmp4.i120 = icmp slt i32 %12, %13
br i1 %cmp4.i120, label %if.then29, label %for.cond.i121
if.then29: ; preds = %for.body.i116
call void @Quicksort(ptr noundef nonnull %call5, i32 noundef %.lcssa)
br label %if.end30
if.end30: ; preds = %for.cond.i121, %if.end, %if.then29
%cmp32133 = icmp sgt i32 %.lcssa, 0
br i1 %cmp32133, label %for.body34.preheader, label %for.end72
for.body34.preheader: ; preds = %if.end30
%14 = sext i32 %9 to i64
%wide.trip.count = zext i32 %.lcssa to i64
%min.iters.check = icmp ult i32 %.lcssa, 4
br i1 %min.iters.check, label %for.body34.preheader176, label %vector.ph
vector.ph: ; preds = %for.body34.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
%ind.end = sub nsw i64 %14, %n.vec
%invariant.gep = getelementptr i32, ptr %call2, i64 %14
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %28, %vector.body ]
%vec.phi171 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %29, %vector.body ]
%15 = xor i64 %index, -1
%gep = getelementptr i32, ptr %invariant.gep, i64 %15
%16 = getelementptr inbounds i32, ptr %gep, i64 -1
%wide.load = load <2 x i32>, ptr %16, align 4, !tbaa !7
%reverse = shufflevector <2 x i32> %wide.load, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
%17 = getelementptr inbounds i32, ptr %gep, i64 -3
%wide.load172 = load <2 x i32>, ptr %17, align 4, !tbaa !7
%reverse173 = shufflevector <2 x i32> %wide.load172, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
%18 = sext <2 x i32> %reverse to <2 x i64>
%19 = sext <2 x i32> %reverse173 to <2 x i64>
%20 = add <2 x i64> %vec.phi, %18
%21 = add <2 x i64> %vec.phi171, %19
%22 = getelementptr inbounds i32, ptr %call5, i64 %index
%wide.load174 = load <2 x i32>, ptr %22, align 4, !tbaa !7
%23 = getelementptr inbounds i32, ptr %22, i64 2
%wide.load175 = load <2 x i32>, ptr %23, align 4, !tbaa !7
%24 = icmp eq <2 x i32> %wide.load174, <i32 1, i32 1>
%25 = icmp eq <2 x i32> %wide.load175, <i32 1, i32 1>
%26 = select <2 x i1> %24, <2 x i64> %18, <2 x i64> zeroinitializer
%27 = select <2 x i1> %25, <2 x i64> %19, <2 x i64> zeroinitializer
%28 = add <2 x i64> %20, %26
%29 = add <2 x i64> %21, %27
%index.next = add nuw i64 %index, 4
%30 = icmp eq i64 %index.next, %n.vec
br i1 %30, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %29, %28
%31 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond52.preheader, label %for.body34.preheader176
for.body34.preheader176: ; preds = %for.body34.preheader, %middle.block
%indvars.iv153.ph = phi i64 [ 0, %for.body34.preheader ], [ %n.vec, %middle.block ]
%indvars.iv151.ph = phi i64 [ %14, %for.body34.preheader ], [ %ind.end, %middle.block ]
%ans.0135.ph = phi i64 [ 0, %for.body34.preheader ], [ %31, %middle.block ]
br label %for.body34
for.cond52.preheader: ; preds = %for.body34, %middle.block
%indvars.iv.next152.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next152, %for.body34 ]
%spec.select.lcssa = phi i64 [ %31, %middle.block ], [ %spec.select, %for.body34 ]
br i1 %cmp32133, label %for.body55.preheader, label %for.end72
for.body55.preheader: ; preds = %for.cond52.preheader
%32 = trunc i64 %indvars.iv.next152.lcssa to i32
%xtraiter = and i64 %wide.trip.count, 1
%33 = icmp eq i32 %.lcssa, 1
br i1 %33, label %for.end72.loopexit.unr-lcssa, label %for.body55.preheader.new
for.body55.preheader.new: ; preds = %for.body55.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body55
for.body34: ; preds = %for.body34.preheader176, %for.body34
%indvars.iv153 = phi i64 [ %indvars.iv.next154, %for.body34 ], [ %indvars.iv153.ph, %for.body34.preheader176 ]
%indvars.iv151 = phi i64 [ %indvars.iv.next152, %for.body34 ], [ %indvars.iv151.ph, %for.body34.preheader176 ]
%ans.0135 = phi i64 [ %spec.select, %for.body34 ], [ %ans.0135.ph, %for.body34.preheader176 ]
%indvars.iv.next152 = add nsw i64 %indvars.iv151, -1
%add.ptr36 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.next152
%34 = load i32, ptr %add.ptr36, align 4, !tbaa !7
%conv37 = sext i32 %34 to i64
%add = add nsw i64 %ans.0135, %conv37
%add.ptr39 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv153
%35 = load i32, ptr %add.ptr39, align 4, !tbaa !7
%cmp40 = icmp eq i32 %35, 1
%add46 = select i1 %cmp40, i64 %conv37, i64 0
%spec.select = add nsw i64 %add, %add46
%indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
%exitcond.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count
br i1 %exitcond.not, label %for.cond52.preheader, label %for.body34, !llvm.loop !21
for.body55: ; preds = %for.inc70.1, %for.body55.preheader.new
%indvars.iv158 = phi i64 [ 0, %for.body55.preheader.new ], [ %indvars.iv.next159.1, %for.inc70.1 ]
%t.1142 = phi i32 [ %32, %for.body55.preheader.new ], [ %t.2.1, %for.inc70.1 ]
%ans.2141 = phi i64 [ %spec.select.lcssa, %for.body55.preheader.new ], [ %ans.3.1, %for.inc70.1 ]
%niter = phi i64 [ 0, %for.body55.preheader.new ], [ %niter.next.1, %for.inc70.1 ]
%add.ptr57 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv158
%36 = load i32, ptr %add.ptr57, align 4, !tbaa !7
%cmp58.not = icmp eq i32 %36, 1
br i1 %cmp58.not, label %for.inc70, label %if.then60
if.then60: ; preds = %for.body55
%sub63.neg = add i32 %t.1142, 1
%sub64 = sub i32 %sub63.neg, %36
%idx.ext65 = sext i32 %sub64 to i64
%add.ptr66 = getelementptr inbounds i32, ptr %call2, i64 %idx.ext65
%37 = load i32, ptr %add.ptr66, align 4, !tbaa !7
%conv67 = sext i32 %37 to i64
%add68 = add nsw i64 %ans.2141, %conv67
br label %for.inc70
for.inc70: ; preds = %for.body55, %if.then60
%ans.3 = phi i64 [ %add68, %if.then60 ], [ %ans.2141, %for.body55 ]
%t.2 = phi i32 [ %sub64, %if.then60 ], [ %t.1142, %for.body55 ]
%indvars.iv.next159 = or i64 %indvars.iv158, 1
%add.ptr57.1 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv.next159
%38 = load i32, ptr %add.ptr57.1, align 4, !tbaa !7
%cmp58.not.1 = icmp eq i32 %38, 1
br i1 %cmp58.not.1, label %for.inc70.1, label %if.then60.1
if.then60.1: ; preds = %for.inc70
%sub63.neg.1 = add i32 %t.2, 1
%sub64.1 = sub i32 %sub63.neg.1, %38
%idx.ext65.1 = sext i32 %sub64.1 to i64
%add.ptr66.1 = getelementptr inbounds i32, ptr %call2, i64 %idx.ext65.1
%39 = load i32, ptr %add.ptr66.1, align 4, !tbaa !7
%conv67.1 = sext i32 %39 to i64
%add68.1 = add nsw i64 %ans.3, %conv67.1
br label %for.inc70.1
for.inc70.1: ; preds = %if.then60.1, %for.inc70
%ans.3.1 = phi i64 [ %add68.1, %if.then60.1 ], [ %ans.3, %for.inc70 ]
%t.2.1 = phi i32 [ %sub64.1, %if.then60.1 ], [ %t.2, %for.inc70 ]
%indvars.iv.next159.1 = add nuw nsw i64 %indvars.iv158, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end72.loopexit.unr-lcssa, label %for.body55, !llvm.loop !22
for.end72.loopexit.unr-lcssa: ; preds = %for.inc70.1, %for.body55.preheader
%ans.3.lcssa.ph = phi i64 [ undef, %for.body55.preheader ], [ %ans.3.1, %for.inc70.1 ]
%indvars.iv158.unr = phi i64 [ 0, %for.body55.preheader ], [ %indvars.iv.next159.1, %for.inc70.1 ]
%t.1142.unr = phi i32 [ %32, %for.body55.preheader ], [ %t.2.1, %for.inc70.1 ]
%ans.2141.unr = phi i64 [ %spec.select.lcssa, %for.body55.preheader ], [ %ans.3.1, %for.inc70.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end72, label %for.body55.epil
for.body55.epil: ; preds = %for.end72.loopexit.unr-lcssa
%add.ptr57.epil = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv158.unr
%40 = load i32, ptr %add.ptr57.epil, align 4, !tbaa !7
%cmp58.not.epil = icmp eq i32 %40, 1
br i1 %cmp58.not.epil, label %for.end72, label %if.then60.epil
if.then60.epil: ; preds = %for.body55.epil
%sub63.neg.epil = add i32 %t.1142.unr, 1
%sub64.epil = sub i32 %sub63.neg.epil, %40
%idx.ext65.epil = sext i32 %sub64.epil to i64
%add.ptr66.epil = getelementptr inbounds i32, ptr %call2, i64 %idx.ext65.epil
%41 = load i32, ptr %add.ptr66.epil, align 4, !tbaa !7
%conv67.epil = sext i32 %41 to i64
%add68.epil = add nsw i64 %ans.2141.unr, %conv67.epil
br label %for.end72
for.end72: ; preds = %for.end72.loopexit.unr-lcssa, %if.then60.epil, %for.body55.epil, %if.end30, %for.cond52.preheader
%ans.2.lcssa = phi i64 [ %spec.select.lcssa, %for.cond52.preheader ], [ 0, %if.end30 ], [ %ans.3.lcssa.ph, %for.end72.loopexit.unr-lcssa ], [ %add68.epil, %if.then60.epil ], [ %ans.2141.unr, %for.body55.epil ]
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.2.lcssa)
call void @free(ptr noundef %call2) #10
call void @free(ptr noundef %call5) #10
%inc75 = add nuw nsw i32 %i.0145, 1
%42 = load i32, ptr %T, align 4, !tbaa !7
%cmp = icmp slt i32 %inc75, %42
br i1 %cmp, label %for.body, label %for.end76, !llvm.loop !23
for.end76: ; preds = %for.end72, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #10
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #9
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn 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 #8 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind }
attributes #11 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !6, !20, !19}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !6}
|
#include<stdio.h>
#define INF 1000000001
#define MAX 100000
typedef struct{
char suit;
int num;
}Card;
int count;
void quickSort(Card *,int,int);
int Partition(Card *,int,int);
void merge(Card *,int,int,int);
void mergeSort(Card *,int,int);
int main(){
int i,n,flag=0;
Card A[MAX],B[MAX];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf(" %c %d",&A[i].suit,&A[i].num);
B[i].suit=A[i].suit;
B[i].num=A[i].num;
}
quickSort(A,0,n-1);
mergeSort(B,0,n);
for(i=0;i<n;i++){
if(A[i].num==B[i].num && A[i].suit==B[i].suit);
else{
flag=1;
break;
}
}
if(flag==1) printf("Not stable\n");
else printf("Stable\n");
for(i=0;i<n;i++) printf("%c %d\n",A[i].suit,A[i].num);
return 0;
}
void quickSort(Card *A,int p,int r){
int q;
if(p<r){
q=Partition(A,p,r);
quickSort(A,p,q-1);
quickSort(A,q+1,r);
}
}
int Partition(Card *A,int p,int r){
int i,j,x;
Card tmp;
x=A[r].num;
i=p-1;
for(j=p;j<r;j++){
if(A[j].num<=x){
i+=1;
tmp=A[i];
A[i]=A[j];
A[j]=tmp;
}
}
tmp=A[i+1];
A[i+1]=A[r];
A[r]=tmp;
return i+1;
}
void merge(Card *A,int left,int mid,int right){
int i,j,k,n1,n2;
Card L[250001],R[250001];
n1=mid-left;
n2=right-mid;
for(i=0;i<n1;i++) L[i]=A[left+i];
for(i=0;i<n2;i++) R[i]=A[mid+i];
L[n1].num=INF;
R[n2].num=INF;
i=0;
j=0;
for(k=left;k<right;k++){
if(L[i].num<=R[j].num){
A[k]=L[i];
i++;
count++;
}
else{
A[k]=R[j];
j++;
count++;
}
}
}
void mergeSort(Card *A,int left,int right){
int mid;
if(left+1<right){
mid=(left+right)/2;
mergeSort(A,left,mid);
mergeSort(A,mid,right);
merge(A,left,mid,right);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269860/source.c"
target datalayout = "e-m:e-p270: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.Card = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c" %c %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@count = dso_local local_unnamed_addr global i32 0, align 4
@str = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@str.5 = private unnamed_addr constant [11 x i8] c"Not stable\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 %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp79 = icmp sgt i32 %0, 0
br i1 %cmp79, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
%num = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %num)
%1 = load i8, ptr %arrayidx, align 8, !tbaa !9
%arrayidx8 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx8, align 8, !tbaa !9
%2 = load i32, ptr %num, align 4, !tbaa !11
%num15 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %num15, align 4, !tbaa !11
%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 !12
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @quickSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub)
call void @mergeSort(ptr noundef nonnull %B, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp1881 = icmp sgt i32 %5, 0
br i1 %cmp1881, label %for.body19.preheader, label %if.end45
for.body19.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
br label %for.body19
for.cond17: ; preds = %land.lhs.true
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%exitcond.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count
br i1 %exitcond.not, label %if.end45, label %for.body19, !llvm.loop !14
for.body19: ; preds = %for.body19.preheader, %for.cond17
%indvars.iv87 = phi i64 [ 0, %for.body19.preheader ], [ %indvars.iv.next88, %for.cond17 ]
%num22 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv87, i32 1
%6 = load i32, ptr %num22, align 4, !tbaa !11
%num25 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv87, i32 1
%7 = load i32, ptr %num25, align 4, !tbaa !11
%cmp26 = icmp eq i32 %6, %7
br i1 %cmp26, label %land.lhs.true, label %if.end45
land.lhs.true: ; preds = %for.body19
%arrayidx24 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv87
%arrayidx21 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv87
%8 = load i8, ptr %arrayidx21, align 8, !tbaa !9
%9 = load i8, ptr %arrayidx24, align 8, !tbaa !9
%cmp34 = icmp eq i8 %8, %9
br i1 %cmp34, label %for.cond17, label %if.end45
if.end45: ; preds = %for.cond17, %for.body19, %land.lhs.true, %for.end
%str.sink = phi ptr [ @str, %for.end ], [ @str.5, %land.lhs.true ], [ @str.5, %for.body19 ], [ @str, %for.cond17 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%10 = load i32, ptr %n, align 4, !tbaa !5
%cmp4783 = icmp sgt i32 %10, 0
br i1 %cmp4783, label %for.body49, label %for.end60
for.body49: ; preds = %if.end45, %for.body49
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body49 ], [ 0, %if.end45 ]
%arrayidx51 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv90
%11 = load i8, ptr %arrayidx51, align 8, !tbaa !9
%conv53 = sext i8 %11 to i32
%num56 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv90, i32 1
%12 = load i32, ptr %num56, align 4, !tbaa !11
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv53, i32 noundef %12)
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%13 = load i32, ptr %n, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp47 = icmp slt i64 %indvars.iv.next91, %14
br i1 %cmp47, label %for.body49, label %for.end60, !llvm.loop !15
for.end60: ; preds = %for.body49, %if.end45
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%num.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i, i32 1
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %Partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %Partition.exit ]
%1 = load i32, ptr %num.i, align 4, !tbaa !11
%sub.i = add nsw i32 %p.tr9, -1
%2 = sext i32 %p.tr9 to i64
%3 = sub nsw i64 %idxprom.i, %2
%xtraiter = and i64 %3, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%num3.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %2, i32 1
%4 = load i32, ptr %num3.i.prol, align 4, !tbaa !11
%cmp4.not.i.prol = icmp sgt i32 %4, %1
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %2
%idxprom5.i.prol = sext i32 %p.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%5 = load i64, ptr %arrayidx6.i.prol, align 4
%6 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %6, ptr %arrayidx6.i.prol, align 4
store i64 %5, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %2, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%7 = xor i64 %2, %0
%8 = icmp eq i64 %7, -1
br i1 %8, label %Partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%num3.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%9 = load i32, ptr %num3.i, align 4, !tbaa !11
%cmp4.not.i = icmp sgt i32 %9, %1
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%add.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %add.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%10 = load i64, ptr %arrayidx6.i, align 4
%11 = load i64, ptr %arrayidx2.i, align 4
store i64 %11, ptr %arrayidx6.i, align 4
store i64 %10, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%num3.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%12 = load i32, ptr %num3.i.1, align 4, !tbaa !11
%cmp4.not.i.1 = icmp sgt i32 %12, %1
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%add.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %add.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%13 = load i64, ptr %arrayidx6.i.1, align 4
%14 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %14, ptr %arrayidx6.i.1, align 4
store i64 %13, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %add.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %Partition.exit, label %for.body.i, !llvm.loop !16
Partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%15 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %15 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%16 = load i64, ptr %arrayidx15.i, align 4
%17 = load i64, ptr %arrayidx.i, align 4
store i64 %17, ptr %arrayidx15.i, align 4
store i64 %16, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %p.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %Partition.exit, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #4 {
entry:
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %common.ret12
common.ret12: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
tail call void @merge(ptr noundef %A, i32 noundef %left, i32 noundef %div, i32 noundef %right)
br label %common.ret12
}
; 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 i32 @Partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %r to i64
%num = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom, i32 1
%0 = load i32, ptr %num, align 4, !tbaa !11
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%num3.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %num3.prol, align 4, !tbaa !11
%cmp4.not.prol = icmp sgt i32 %3, %0
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%4 = load i64, ptr %arrayidx6.prol, align 4
%5 = load i64, ptr %arrayidx2.prol, align 4
store i64 %5, ptr %arrayidx6.prol, align 4
store i64 %4, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%6 = sub nsw i64 0, %idxprom
%7 = xor i64 %1, %6
%8 = icmp eq i64 %7, -1
br i1 %8, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%num3 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%9 = load i32, ptr %num3, align 4, !tbaa !11
%cmp4.not = icmp sgt i32 %9, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%add = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%10 = load i64, ptr %arrayidx6, align 4
%11 = load i64, ptr %arrayidx2, align 4
store i64 %11, ptr %arrayidx6, align 4
store i64 %10, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%num3.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%12 = load i32, ptr %num3.1, align 4, !tbaa !11
%cmp4.not.1 = icmp sgt i32 %12, %0
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%add.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %add.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%13 = load i64, ptr %arrayidx6.1, align 4
%14 = load i64, ptr %arrayidx2.1, align 4
store i64 %14, ptr %arrayidx6.1, align 4
store i64 %13, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !16
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%15 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %15, %for.end.loopexit ]
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%16 = load i64, ptr %arrayidx15, align 4
%17 = load i64, ptr %arrayidx, align 4
store i64 %17, ptr %arrayidx15, align 4
store i64 %16, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; 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) #6
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #4 {
entry:
%L = alloca [250001 x %struct.Card], align 16
%R = alloca [250001 x %struct.Card], align 16
call void @llvm.lifetime.start.p0(i64 2000008, ptr nonnull %L) #8
call void @llvm.lifetime.start.p0(i64 2000008, ptr nonnull %R) #8
%sub = sub nsw i32 %mid, %left
%sub1 = sub nsw i32 %right, %mid
%cmp70 = icmp sgt i32 %sub, 0
br i1 %cmp70, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%1 = shl nsw i64 %0, 3
%scevgep = getelementptr i8, ptr %A, i64 %1
%2 = xor i32 %left, -1
%3 = add i32 %2, %mid
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = add nuw nsw i64 %5, 8
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %L, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false)
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body.preheader, %entry
%cmp572 = icmp sgt i32 %sub1, 0
br i1 %cmp572, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%7 = sext i32 %mid to i64
%8 = shl nsw i64 %7, 3
%scevgep82 = getelementptr i8, ptr %A, i64 %8
%9 = xor i32 %mid, -1
%10 = add i32 %9, %right
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 3
%13 = add nuw nsw i64 %12, 8
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %R, ptr noundef nonnull align 4 dereferenceable(1) %scevgep82, i64 %13, i1 false)
br label %for.end14
for.end14: ; preds = %for.body6.preheader, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%num = getelementptr inbounds [250001 x %struct.Card], ptr %L, i64 0, i64 %idxprom15, i32 1
store i32 1000000001, ptr %num, align 4, !tbaa !11
%idxprom17 = sext i32 %sub1 to i64
%num19 = getelementptr inbounds [250001 x %struct.Card], ptr %R, i64 0, i64 %idxprom17, i32 1
store i32 1000000001, ptr %num19, align 4, !tbaa !11
%cmp2175 = icmp slt i32 %left, %right
br i1 %cmp2175, label %for.body22.preheader, label %for.end44
for.body22.preheader: ; preds = %for.end14
%count.promoted = load i32, ptr @count, align 4, !tbaa !5
%14 = sext i32 %left to i64
%15 = add i32 %count.promoted, %right
%wide.trip.count = sext i32 %right to i64
%16 = sub nsw i64 %wide.trip.count, %14
%xtraiter = and i64 %16, 1
%17 = sub nsw i64 0, %wide.trip.count
%18 = xor i64 %14, %17
%19 = icmp eq i64 %18, -1
br i1 %19, label %for.cond20.for.end44_crit_edge.unr-lcssa, label %for.body22.preheader.new
for.body22.preheader.new: ; preds = %for.body22.preheader
%unroll_iter = and i64 %16, -2
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 1
br label %for.body22
for.body22: ; preds = %for.body22, %for.body22.preheader.new
%indvars.iv = phi i64 [ %14, %for.body22.preheader.new ], [ %indvars.iv.next.1, %for.body22 ]
%i.279 = phi i32 [ 0, %for.body22.preheader.new ], [ %i.3.1, %for.body22 ]
%j.078 = phi i32 [ 0, %for.body22.preheader.new ], [ %j.1.1, %for.body22 ]
%niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.1, %for.body22 ]
%idxprom23 = zext i32 %i.279 to i64
%num25 = getelementptr inbounds [250001 x %struct.Card], ptr %L, i64 0, i64 %idxprom23, i32 1
%20 = load i32, ptr %num25, align 4, !tbaa !11
%idxprom26 = zext i32 %j.078 to i64
%num28 = getelementptr inbounds [250001 x %struct.Card], ptr %R, i64 0, i64 %idxprom26, i32 1
%21 = load i32, ptr %num28, align 4, !tbaa !11
%cmp29.not = icmp sgt i32 %20, %21
%arrayidx27 = getelementptr inbounds [250001 x %struct.Card], ptr %R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [250001 x %struct.Card], ptr %L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc40 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.078, %inc40
%not.cmp29.not = xor i1 %cmp29.not, true
%inc34 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.279, %inc34
%.sink = load i64, ptr %.sink.in, align 8
%22 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
store i64 %.sink, ptr %22, align 4
%idxprom23.1 = zext i32 %i.3 to i64
%num25.1 = getelementptr inbounds [250001 x %struct.Card], ptr %L, i64 0, i64 %idxprom23.1, i32 1
%23 = load i32, ptr %num25.1, align 4, !tbaa !11
%idxprom26.1 = zext i32 %j.1 to i64
%num28.1 = getelementptr inbounds [250001 x %struct.Card], ptr %R, i64 0, i64 %idxprom26.1, i32 1
%24 = load i32, ptr %num28.1, align 4, !tbaa !11
%cmp29.not.1 = icmp sgt i32 %23, %24
%arrayidx27.1 = getelementptr inbounds [250001 x %struct.Card], ptr %R, i64 0, i64 %idxprom26.1
%arrayidx24.1 = getelementptr inbounds [250001 x %struct.Card], ptr %L, i64 0, i64 %idxprom23.1
%.sink.in.1 = select i1 %cmp29.not.1, ptr %arrayidx27.1, ptr %arrayidx24.1
%inc40.1 = zext i1 %cmp29.not.1 to i32
%j.1.1 = add nuw nsw i32 %j.1, %inc40.1
%not.cmp29.not.1 = xor i1 %cmp29.not.1, true
%inc34.1 = zext i1 %not.cmp29.not.1 to i32
%i.3.1 = add nuw nsw i32 %i.3, %inc34.1
%.sink.1 = load i64, ptr %.sink.in.1, align 8
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
store i64 %.sink.1, ptr %gep, align 4
%indvars.iv.next.1 = add 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.cond20.for.end44_crit_edge.unr-lcssa.loopexit, label %for.body22, !llvm.loop !17
for.cond20.for.end44_crit_edge.unr-lcssa.loopexit: ; preds = %for.body22
%25 = zext i32 %i.3.1 to i64
%26 = zext i32 %j.1.1 to i64
br label %for.cond20.for.end44_crit_edge.unr-lcssa
for.cond20.for.end44_crit_edge.unr-lcssa: ; preds = %for.cond20.for.end44_crit_edge.unr-lcssa.loopexit, %for.body22.preheader
%indvars.iv.unr = phi i64 [ %14, %for.body22.preheader ], [ %indvars.iv.next.1, %for.cond20.for.end44_crit_edge.unr-lcssa.loopexit ]
%i.279.unr = phi i64 [ 0, %for.body22.preheader ], [ %25, %for.cond20.for.end44_crit_edge.unr-lcssa.loopexit ]
%j.078.unr = phi i64 [ 0, %for.body22.preheader ], [ %26, %for.cond20.for.end44_crit_edge.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond20.for.end44_crit_edge, label %for.body22.epil
for.body22.epil: ; preds = %for.cond20.for.end44_crit_edge.unr-lcssa
%num25.epil = getelementptr inbounds [250001 x %struct.Card], ptr %L, i64 0, i64 %i.279.unr, i32 1
%27 = load i32, ptr %num25.epil, align 4, !tbaa !11
%num28.epil = getelementptr inbounds [250001 x %struct.Card], ptr %R, i64 0, i64 %j.078.unr, i32 1
%28 = load i32, ptr %num28.epil, align 4, !tbaa !11
%cmp29.not.epil = icmp sgt i32 %27, %28
%arrayidx27.epil = getelementptr inbounds [250001 x %struct.Card], ptr %R, i64 0, i64 %j.078.unr
%arrayidx24.epil = getelementptr inbounds [250001 x %struct.Card], ptr %L, i64 0, i64 %i.279.unr
%.sink.in.epil = select i1 %cmp29.not.epil, ptr %arrayidx27.epil, ptr %arrayidx24.epil
%.sink.epil = load i64, ptr %.sink.in.epil, align 8
%29 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.unr
store i64 %.sink.epil, ptr %29, align 4
br label %for.cond20.for.end44_crit_edge
for.cond20.for.end44_crit_edge: ; preds = %for.cond20.for.end44_crit_edge.unr-lcssa, %for.body22.epil
%30 = sub i32 %15, %left
store i32 %30, ptr @count, align 4, !tbaa !5
br label %for.end44
for.end44: ; preds = %for.cond20.for.end44_crit_edge, %for.end14
call void @llvm.lifetime.end.p0(i64 2000008, ptr nonnull %R) #8
call void @llvm.lifetime.end.p0(i64 2000008, ptr nonnull %L) #8
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: 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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 0}
!10 = !{!"", !7, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
#define MAX 100000
#define SENTINEL 2000000000
struct Card{
char suit;
int value;
};
struct Card L[MAX/2+2],R[MAX/2+2];
void merge(struct Card A[] , int n , int left , int mid , int right)
{
int n1 = mid - left;
int n2 = right -mid;
for( int i = 0; i < n1; i++) L[i] = A[left+i];
for( int i = 0; i < n2; i++) R[i] = A[mid+i];
L[n1].value = R[n2].value = SENTINEL;
int i = 0 , j = 0;
for( int k = left; k < right; k++)
{
if(L[i].value <= R[j].value)
{
A[k] = L[i++];
}
else{
A[k] = R[j++];
}
}
}
void mergeSort(struct Card A[] , int n , int left , int right)
{
if(left + 1 < right)
{
int mid = (left+right)/2;
mergeSort(A,n,left,mid);
mergeSort(A,n,mid,right);
merge(A,n,left,mid,right);
}
}
int partition(struct Card A[] , int n , int p , int r)
{
struct Card x = A[r];
struct Card t;
int i = p-1;
int j;
for( j = p; j < r; j++)
{
if(A[j].value <= x.value)
{
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i+1];
A[i+1] = A[r];
A[r] = t;
return i+1;
}
void quickSort(struct Card A[], int n , int p , int r)
{
int q;
if(p < r){
q = partition(A,n,p,r);
quickSort(A,n,p,q-1);
quickSort(A,n,q+1,r);
}
}
int main(void)
{
int n , i , v;
struct Card A[MAX] , B[MAX];
char S[10];
int stable = 1;
scanf("%d",&n);
for( i = 0; i < n; i++)
{
scanf("%s %d",S,&v);
A[i].suit = B[i].suit = S[0];
A[i].value = B[i].value = v;
}
mergeSort(A,n,0,n);
quickSort(B,n,0,n-1);
for( i = 0; i < n; i++)
{
if(A[i].suit != B[i].suit) stable = 0;
}
if(stable == 1) printf("Stable\n");
else printf("Not stable\n");
for( i = 0; i < n; i++)
{
printf("%c %d\n",B[i].suit,B[i].value);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269910/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269910/source.c"
target datalayout = "e-m:e-p270: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.Card = type { i8, i32 }
@L = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A91 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp68 = icmp sgt i32 %sub, 0
br i1 %cmp68, label %for.body.preheader, label %for.cond5.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader109, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A91
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader109, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load92 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load92, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond5.preheader, label %for.body.preheader109
for.body.preheader109: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader109, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader109 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader109 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader109
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader109 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond5.preheader, label %for.body
for.cond5.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp670 = icmp sgt i32 %sub1, 0
br i1 %cmp670, label %for.body8.preheader, label %for.cond.cleanup7
for.body8.preheader: ; preds = %for.cond5.preheader
%13 = sext i32 %mid to i64
%wide.trip.count82 = zext i32 %sub1 to i64
%invariant.gep89 = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check97 = icmp ult i32 %sub1, 10
br i1 %min.iters.check97, label %for.body8.preheader108, label %vector.memcheck93
vector.memcheck93: ; preds = %for.body8.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A91
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check94 = icmp ult i64 %16, 32
br i1 %diff.check94, label %for.body8.preheader108, label %vector.ph98
vector.ph98: ; preds = %vector.memcheck93
%n.vec100 = and i64 %wide.trip.count82, 4294967292
br label %vector.body103
vector.body103: ; preds = %vector.body103, %vector.ph98
%index104 = phi i64 [ 0, %vector.ph98 ], [ %index.next107, %vector.body103 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index104
%18 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %index104
%wide.load105 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load106 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load105, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load106, ptr %20, align 16
%index.next107 = add nuw i64 %index104, 4
%21 = icmp eq i64 %index.next107, %n.vec100
br i1 %21, label %middle.block95, label %vector.body103, !llvm.loop !11
middle.block95: ; preds = %vector.body103
%cmp.n102 = icmp eq i64 %n.vec100, %wide.trip.count82
br i1 %cmp.n102, label %for.cond.cleanup7, label %for.body8.preheader108
for.body8.preheader108: ; preds = %vector.memcheck93, %for.body8.preheader, %middle.block95
%indvars.iv78.ph = phi i64 [ 0, %vector.memcheck93 ], [ 0, %for.body8.preheader ], [ %n.vec100, %middle.block95 ]
%22 = xor i64 %indvars.iv78.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82
%xtraiter110 = and i64 %wide.trip.count82, 3
%lcmp.mod111.not = icmp eq i64 %xtraiter110, 0
br i1 %lcmp.mod111.not, label %for.body8.prol.loopexit, label %for.body8.prol
for.body8.prol: ; preds = %for.body8.preheader108, %for.body8.prol
%indvars.iv78.prol = phi i64 [ %indvars.iv.next79.prol, %for.body8.prol ], [ %indvars.iv78.ph, %for.body8.preheader108 ]
%prol.iter112 = phi i64 [ %prol.iter112.next, %for.body8.prol ], [ 0, %for.body8.preheader108 ]
%arrayidx10.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78.prol
%gep90.prol = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv78.prol
%24 = load i64, ptr %gep90.prol, align 4
store i64 %24, ptr %arrayidx10.prol, align 8
%indvars.iv.next79.prol = add nuw nsw i64 %indvars.iv78.prol, 1
%prol.iter112.next = add i64 %prol.iter112, 1
%prol.iter112.cmp.not = icmp eq i64 %prol.iter112.next, %xtraiter110
br i1 %prol.iter112.cmp.not, label %for.body8.prol.loopexit, label %for.body8.prol, !llvm.loop !12
for.body8.prol.loopexit: ; preds = %for.body8.prol, %for.body8.preheader108
%indvars.iv78.unr = phi i64 [ %indvars.iv78.ph, %for.body8.preheader108 ], [ %indvars.iv.next79.prol, %for.body8.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup7, label %for.body8
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond5.preheader, label %for.body, !llvm.loop !13
for.cond.cleanup7: ; preds = %for.body8.prol.loopexit, %for.body8, %middle.block95, %for.cond5.preheader
%idxprom17 = sext i32 %sub1 to i64
%value = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom17, i32 1
store i32 2000000000, ptr %value, align 4, !tbaa !14
%idxprom19 = sext i32 %sub to i64
%value21 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom19, i32 1
store i32 2000000000, ptr %value21, align 4, !tbaa !14
%cmp2472 = icmp slt i32 %left, %right
br i1 %cmp2472, label %for.body26.preheader, label %for.cond.cleanup25
for.body26.preheader: ; preds = %for.cond.cleanup7
%30 = sext i32 %left to i64
%wide.trip.count87 = sext i32 %right to i64
br label %for.body26
for.body8: ; preds = %for.body8.prol.loopexit, %for.body8
%indvars.iv78 = phi i64 [ %indvars.iv.next79.3, %for.body8 ], [ %indvars.iv78.unr, %for.body8.prol.loopexit ]
%arrayidx10 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78
%gep90 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv78
%31 = load i64, ptr %gep90, align 4
store i64 %31, ptr %arrayidx10, align 8
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%arrayidx10.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79
%gep90.1 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv.next79
%32 = load i64, ptr %gep90.1, align 4
store i64 %32, ptr %arrayidx10.1, align 8
%indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
%arrayidx10.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.1
%gep90.2 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv.next79.1
%33 = load i64, ptr %gep90.2, align 4
store i64 %33, ptr %arrayidx10.2, align 8
%indvars.iv.next79.2 = add nuw nsw i64 %indvars.iv78, 3
%arrayidx10.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.2
%gep90.3 = getelementptr %struct.Card, ptr %invariant.gep89, i64 %indvars.iv.next79.2
%34 = load i64, ptr %gep90.3, align 4
store i64 %34, ptr %arrayidx10.3, align 8
%indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 4
%exitcond83.not.3 = icmp eq i64 %indvars.iv.next79.3, %wide.trip.count82
br i1 %exitcond83.not.3, label %for.cond.cleanup7, label %for.body8, !llvm.loop !19
for.cond.cleanup25: ; preds = %for.body26, %for.cond.cleanup7
ret void
for.body26: ; preds = %for.body26.preheader, %for.body26
%indvars.iv84 = phi i64 [ %30, %for.body26.preheader ], [ %indvars.iv.next85, %for.body26 ]
%j.074 = phi i32 [ 0, %for.body26.preheader ], [ %j.1, %for.body26 ]
%i22.073 = phi i32 [ 0, %for.body26.preheader ], [ %i22.1, %for.body26 ]
%idxprom27 = zext i32 %i22.073 to i64
%value29 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom27, i32 1
%35 = load i32, ptr %value29, align 4, !tbaa !14
%idxprom30 = zext i32 %j.074 to i64
%value32 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30, i32 1
%36 = load i32, ptr %value32, align 4, !tbaa !14
%cmp33.not = icmp sle i32 %35, %36
%arrayidx31 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30
%arrayidx28 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom27
%.sink.in = select i1 %cmp33.not, ptr %arrayidx28, ptr %arrayidx31
%inc36 = zext i1 %cmp33.not to i32
%i22.1 = add nuw nsw i32 %i22.073, %inc36
%not.cmp33.not = xor i1 %cmp33.not, true
%inc41 = zext i1 %not.cmp33.not to i32
%j.1 = add nuw nsw i32 %j.074, %inc41
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv84
store i64 %.sink, ptr %37, align 4
%indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
%exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
br i1 %exitcond88.not, label %for.cond.cleanup25, label %for.body26, !llvm.loop !20
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A14 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp68.i = icmp sgt i32 %sub.i, 0
br i1 %cmp68.i, label %for.body.preheader.i, label %for.cond5.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A14
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load15 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load15, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond5.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond5.preheader.i, label %for.body.i
for.cond5.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp670.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp670.i, label %for.body8.preheader.i, label %for.cond.cleanup7.i
for.body8.preheader.i: ; preds = %for.cond5.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count82.i = zext i32 %sub1.i to i64
%invariant.gep89.i = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check20, label %for.body8.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body8.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A14
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body8.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count82.i, 4294967292
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index27
%18 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %index27
%wide.load28 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load29 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load28, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load29, ptr %20, align 16
%index.next30 = add nuw i64 %index27, 4
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !23
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count82.i
br i1 %cmp.n25, label %for.cond.cleanup7.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %vector.memcheck16, %for.body8.preheader.i, %middle.block18
%indvars.iv78.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body8.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv78.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82.i
%xtraiter31 = and i64 %wide.trip.count82.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body8.i.prol.loopexit, label %for.body8.i.prol
for.body8.i.prol: ; preds = %for.body8.i.preheader, %for.body8.i.prol
%indvars.iv78.i.prol = phi i64 [ %indvars.iv.next79.i.prol, %for.body8.i.prol ], [ %indvars.iv78.i.ph, %for.body8.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body8.i.prol ], [ 0, %for.body8.i.preheader ]
%arrayidx10.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78.i.prol
%gep90.i.prol = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv78.i.prol
%24 = load i64, ptr %gep90.i.prol, align 4
store i64 %24, ptr %arrayidx10.i.prol, align 8
%indvars.iv.next79.i.prol = add nuw nsw i64 %indvars.iv78.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body8.i.prol.loopexit, label %for.body8.i.prol, !llvm.loop !24
for.body8.i.prol.loopexit: ; preds = %for.body8.i.prol, %for.body8.i.preheader
%indvars.iv78.i.unr = phi i64 [ %indvars.iv78.i.ph, %for.body8.i.preheader ], [ %indvars.iv.next79.i.prol, %for.body8.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup7.i, label %for.body8.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond5.preheader.i, label %for.body.i, !llvm.loop !25
for.cond.cleanup7.i: ; preds = %for.body8.i.prol.loopexit, %for.body8.i, %middle.block18, %for.cond5.preheader.i
%idxprom17.i = sext i32 %sub1.i to i64
%value.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %value.i, align 4, !tbaa !14
%idxprom19.i = sext i32 %sub.i to i64
%value21.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom19.i, i32 1
store i32 2000000000, ptr %value21.i, align 4, !tbaa !14
%30 = sext i32 %left to i64
%wide.trip.count87.i = sext i32 %right to i64
br label %for.body26.i
for.body8.i: ; preds = %for.body8.i.prol.loopexit, %for.body8.i
%indvars.iv78.i = phi i64 [ %indvars.iv.next79.i.3, %for.body8.i ], [ %indvars.iv78.i.unr, %for.body8.i.prol.loopexit ]
%arrayidx10.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv78.i
%gep90.i = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv78.i
%31 = load i64, ptr %gep90.i, align 4
store i64 %31, ptr %arrayidx10.i, align 8
%indvars.iv.next79.i = add nuw nsw i64 %indvars.iv78.i, 1
%arrayidx10.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.i
%gep90.i.1 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i
%32 = load i64, ptr %gep90.i.1, align 4
store i64 %32, ptr %arrayidx10.i.1, align 8
%indvars.iv.next79.i.1 = add nuw nsw i64 %indvars.iv78.i, 2
%arrayidx10.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.i.1
%gep90.i.2 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.1
%33 = load i64, ptr %gep90.i.2, align 4
store i64 %33, ptr %arrayidx10.i.2, align 8
%indvars.iv.next79.i.2 = add nuw nsw i64 %indvars.iv78.i, 3
%arrayidx10.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next79.i.2
%gep90.i.3 = getelementptr %struct.Card, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.2
%34 = load i64, ptr %gep90.i.3, align 4
store i64 %34, ptr %arrayidx10.i.3, align 8
%indvars.iv.next79.i.3 = add nuw nsw i64 %indvars.iv78.i, 4
%exitcond83.not.i.3 = icmp eq i64 %indvars.iv.next79.i.3, %wide.trip.count82.i
br i1 %exitcond83.not.i.3, label %for.cond.cleanup7.i, label %for.body8.i, !llvm.loop !26
for.body26.i: ; preds = %for.body26.i, %for.cond.cleanup7.i
%indvars.iv84.i = phi i64 [ %30, %for.cond.cleanup7.i ], [ %indvars.iv.next85.i, %for.body26.i ]
%j.074.i = phi i32 [ 0, %for.cond.cleanup7.i ], [ %j.1.i, %for.body26.i ]
%i22.073.i = phi i32 [ 0, %for.cond.cleanup7.i ], [ %i22.1.i, %for.body26.i ]
%idxprom27.i = zext i32 %i22.073.i to i64
%value29.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom27.i, i32 1
%35 = load i32, ptr %value29.i, align 4, !tbaa !14
%idxprom30.i = zext i32 %j.074.i to i64
%value32.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30.i, i32 1
%36 = load i32, ptr %value32.i, align 4, !tbaa !14
%cmp33.not.i = icmp sle i32 %35, %36
%arrayidx31.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom30.i
%arrayidx28.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom27.i
%.sink.in.i = select i1 %cmp33.not.i, ptr %arrayidx28.i, ptr %arrayidx31.i
%inc36.i = zext i1 %cmp33.not.i to i32
%i22.1.i = add nuw nsw i32 %i22.073.i, %inc36.i
%not.cmp33.not.i = xor i1 %cmp33.not.i, true
%inc41.i = zext i1 %not.cmp33.not.i to i32
%j.1.i = add nuw nsw i32 %j.074.i, %inc41.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv84.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next85.i = add nsw i64 %indvars.iv84.i, 1
%exitcond88.not.i = icmp eq i64 %indvars.iv.next85.i, %wide.trip.count87.i
br i1 %exitcond88.not.i, label %if.end, label %for.body26.i, !llvm.loop !20
if.end: ; preds = %for.body26.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%value.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %value.prol, align 4, !tbaa !14
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.047 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.047.unr, %for.body.prol.loopexit ]
%value = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %value, align 4, !tbaa !14
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.047, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%value.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %value.1, align 4, !tbaa !14
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp10 = icmp slt i32 %p, %r
br i1 %cmp10, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr11 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr11, -1
%1 = sext i32 %p.tr11 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !14
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr11 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr11, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.047.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.047.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.047.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !14
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !14
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %n, i32 noundef %p.tr11, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
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.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %v, align 4, !tbaa !28
%value = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value, align 4, !tbaa !14
%value10 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value10, align 4, !tbaa !14
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%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 !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef %5, i32 noundef 0, i32 noundef %sub)
%cmp1465 = icmp sgt i32 %5, 0
br i1 %cmp1465, label %for.body15.preheader, label %if.end33
for.body15.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end27.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body15
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv73 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067 = phi i32 [ 1, %for.body15.preheader.new ], [ %spec.select.3, %for.body15 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.3, %for.body15 ]
%arrayidx17 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i8, ptr %arrayidx17, align 16, !tbaa !31
%arrayidx20 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73
%8 = load i8, ptr %arrayidx20, align 16, !tbaa !31
%cmp23.not = icmp eq i8 %7, %8
%indvars.iv.next74 = or i64 %indvars.iv73, 1
%arrayidx17.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74
%9 = load i8, ptr %arrayidx17.1, align 8, !tbaa !31
%arrayidx20.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74
%10 = load i8, ptr %arrayidx20.1, align 8, !tbaa !31
%cmp23.not.1 = icmp eq i8 %9, %10
%indvars.iv.next74.1 = or i64 %indvars.iv73, 2
%arrayidx17.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.1
%11 = load i8, ptr %arrayidx17.2, align 16, !tbaa !31
%arrayidx20.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.1
%12 = load i8, ptr %arrayidx20.2, align 16, !tbaa !31
%cmp23.not.2 = icmp eq i8 %11, %12
%indvars.iv.next74.2 = or i64 %indvars.iv73, 3
%arrayidx17.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.2
%13 = load i8, ptr %arrayidx17.3, align 8, !tbaa !31
%arrayidx20.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.2
%14 = load i8, ptr %arrayidx20.3, align 8, !tbaa !31
%cmp23.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp23.not.3, i1 %cmp23.not.2, i1 false
%16 = select i1 %15, i1 %cmp23.not.1, i1 false
%17 = select i1 %16, i1 %cmp23.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.067, i32 0
%indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end27.unr-lcssa, label %for.body15, !llvm.loop !33
for.end27.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%indvars.iv73.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067.unr = phi i32 [ 1, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end27, label %for.body15.epil
for.body15.epil: ; preds = %for.end27.unr-lcssa, %for.body15.epil
%indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %for.body15.epil ], [ %indvars.iv73.unr, %for.end27.unr-lcssa ]
%stable.067.epil = phi i32 [ %spec.select.epil, %for.body15.epil ], [ %stable.067.unr, %for.end27.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body15.epil ], [ 0, %for.end27.unr-lcssa ]
%arrayidx17.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73.epil
%18 = load i8, ptr %arrayidx17.epil, align 8, !tbaa !31
%arrayidx20.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73.epil
%19 = load i8, ptr %arrayidx20.epil, align 8, !tbaa !31
%cmp23.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp23.not.epil, i32 %stable.067.epil, i32 0
%indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end27, label %for.body15.epil, !llvm.loop !34
for.end27: ; preds = %for.body15.epil, %for.end27.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end27.unr-lcssa ], [ %spec.select.epil, %for.body15.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select81 = select i1 %20, ptr @str.5, ptr @str
br label %if.end33
if.end33: ; preds = %for.end27, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select81, %for.end27 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr %n, align 4, !tbaa !28
%cmp3569 = icmp sgt i32 %21, 0
br i1 %cmp3569, label %for.body37, label %for.end48
for.body37: ; preds = %if.end33, %for.body37
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body37 ], [ 0, %if.end33 ]
%arrayidx39 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76
%22 = load i8, ptr %arrayidx39, align 8, !tbaa !31
%conv41 = sext i8 %22 to i32
%value44 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76, i32 1
%23 = load i32, ptr %value44, align 4, !tbaa !14
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv41, i32 noundef %23)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%24 = load i32, ptr %n, align 4, !tbaa !28
%25 = sext i32 %24 to i64
%cmp35 = icmp slt i64 %indvars.iv.next77, %25
br i1 %cmp35, label %for.body37, label %for.end48, !llvm.loop !35
for.end48: ; preds = %for.body37, %if.end33
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = !{!15, !18, i64 4}
!15 = !{!"Card", !16, i64 0, !18, i64 4}
!16 = !{!"omnipotent char", !17, i64 0}
!17 = !{!"Simple C/C++ TBAA"}
!18 = !{!"int", !16, i64 0}
!19 = distinct !{!19, !6, !7}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!18, !18, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!16, !16, i64 0}
!31 = !{!15, !16, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !6}
|
#include <stdio.h>
#define MAX 100000
#define SENTINEL 2000000000
struct Card {
char suit;
int value;
};
struct Card L[MAX/2+2], R[MAX/2+2];
void merge(struct Card A[], int n, int left, int mid, int right) {
int i, j, k;
int n1 = mid - left;
int n2 = right - mid;
for(i=0;i<n1;i++) L[i] = A[left + i];
for(i=0;i<n2;i++) R[i] = A[mid + i];
L[n1].value = R[n2].value = SENTINEL;
i = j = 0;
for(k=left; k<right; k++) {
if(L[i].value <= R[j].value) {
A[k] = L[i++];
} else {
A[k] = R[j++];
}
}
}
void mergeSort(struct Card A[], int n, int left, int right) {
if(left+1 < right) {
int mid = (left+right) / 2;
mergeSort(A,n,left,mid);
mergeSort(A,n,mid, right);
merge(A,n,left,mid,right);
}
}
int partition(struct Card A[], int n, int p, int r) {
int i, j;
struct Card t, x;
x = A[r];
i = p-1;
for(j=p; j<r; j++) {
if(A[j].value <= x.value) {
i++;
t=A[i]; A[i]=A[j]; A[j]=t;
}
}
t=A[i+1]; A[i+1]=A[r]; A[r]=t;
return i+1;
}
void quickSort(struct Card A[], int n, int p, int r) {
int q;
if(p<r) {
q = partition(A,n,p,r);
quickSort(A,n,p,q-1);
quickSort(A,n,q+1,r);
}
}
int main() {
int n, i, v;
struct Card A[MAX], B[MAX];
char S[10];
int stable = 1;
scanf("%d", &n);
for(i=0;i<n;i++) {
scanf("%s %d",S,&v);
A[i].suit = B[i].suit = S[0];
A[i].value = B[i].value = v;
}
mergeSort(A,n,0,n);
quickSort(B,n,0,n-1);
for(i=0;i<n;i++) {
// マージソートとクイックソートの結果を比べる
if(A[i].suit != B[i].suit) stable = 0;
}
if(stable==1) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++) {
printf("%c %d\n",B[i].suit,B[i].value);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_269954/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_269954/source.c"
target datalayout = "e-m:e-p270: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.Card = type { i8, i32 }
@L = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [50002 x %struct.Card] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A89 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp66 = icmp sgt i32 %sub, 0
br i1 %cmp66, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader107, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A89
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader107, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load90 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load90, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader107
for.body.preheader107: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader107, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader107 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader107 ]
%arrayidx.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !9
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader107
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader107 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp568 = icmp sgt i32 %sub1, 0
br i1 %cmp568, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count80 = zext i32 %sub1 to i64
%invariant.gep87 = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check95 = icmp ult i32 %sub1, 10
br i1 %min.iters.check95, label %for.body6.preheader106, label %vector.memcheck91
vector.memcheck91: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A89
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check92 = icmp ult i64 %16, 32
br i1 %diff.check92, label %for.body6.preheader106, label %vector.ph96
vector.ph96: ; preds = %vector.memcheck91
%n.vec98 = and i64 %wide.trip.count80, 4294967292
br label %vector.body101
vector.body101: ; preds = %vector.body101, %vector.ph96
%index102 = phi i64 [ 0, %vector.ph96 ], [ %index.next105, %vector.body101 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index102
%18 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %index102
%wide.load103 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load104 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load103, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load104, ptr %20, align 16
%index.next105 = add nuw i64 %index102, 4
%21 = icmp eq i64 %index.next105, %n.vec98
br i1 %21, label %middle.block93, label %vector.body101, !llvm.loop !11
middle.block93: ; preds = %vector.body101
%cmp.n100 = icmp eq i64 %n.vec98, %wide.trip.count80
br i1 %cmp.n100, label %for.end14, label %for.body6.preheader106
for.body6.preheader106: ; preds = %vector.memcheck91, %for.body6.preheader, %middle.block93
%indvars.iv76.ph = phi i64 [ 0, %vector.memcheck91 ], [ 0, %for.body6.preheader ], [ %n.vec98, %middle.block93 ]
%22 = xor i64 %indvars.iv76.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80
%xtraiter108 = and i64 %wide.trip.count80, 3
%lcmp.mod109.not = icmp eq i64 %xtraiter108, 0
br i1 %lcmp.mod109.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader106, %for.body6.prol
%indvars.iv76.prol = phi i64 [ %indvars.iv.next77.prol, %for.body6.prol ], [ %indvars.iv76.ph, %for.body6.preheader106 ]
%prol.iter110 = phi i64 [ %prol.iter110.next, %for.body6.prol ], [ 0, %for.body6.preheader106 ]
%arrayidx8.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.prol
%gep88.prol = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76.prol
%24 = load i64, ptr %gep88.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next77.prol = add nuw nsw i64 %indvars.iv76.prol, 1
%prol.iter110.next = add i64 %prol.iter110, 1
%prol.iter110.cmp.not = icmp eq i64 %prol.iter110.next, %xtraiter108
br i1 %prol.iter110.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !12
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader106
%indvars.iv76.unr = phi i64 [ %indvars.iv76.ph, %for.body6.preheader106 ], [ %indvars.iv.next77.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.Card, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !13
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv76 = phi i64 [ %indvars.iv.next77.3, %for.body6 ], [ %indvars.iv76.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76
%gep88 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv76
%30 = load i64, ptr %gep88, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%arrayidx8.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77
%gep88.1 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77
%31 = load i64, ptr %gep88.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 2
%arrayidx8.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.1
%gep88.2 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.1
%32 = load i64, ptr %gep88.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next77.2 = add nuw nsw i64 %indvars.iv76, 3
%arrayidx8.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.2
%gep88.3 = getelementptr %struct.Card, ptr %invariant.gep87, i64 %indvars.iv.next77.2
%33 = load i64, ptr %gep88.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next77.3 = add nuw nsw i64 %indvars.iv76, 4
%exitcond81.not.3 = icmp eq i64 %indvars.iv.next77.3, %wide.trip.count80
br i1 %exitcond81.not.3, label %for.end14, label %for.body6, !llvm.loop !14
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block93, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%value = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15, i32 1
store i32 2000000000, ptr %value, align 4, !tbaa !15
%idxprom17 = sext i32 %sub to i64
%value19 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17, i32 1
store i32 2000000000, ptr %value19, align 4, !tbaa !15
%cmp2170 = icmp slt i32 %left, %right
br i1 %cmp2170, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count85 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv82 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next83, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%j.072 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%value25 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %value25, align 4, !tbaa !15
%idxprom26 = zext i32 %j.072 to i64
%value28 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %value28, align 4, !tbaa !15
%cmp29.not = icmp sgt i32 %35, %36
%arrayidx27 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx27, ptr %arrayidx24
%inc37 = zext i1 %cmp29.not to i32
%j.1 = add nuw nsw i32 %j.072, %inc37
%not.cmp29.not = xor i1 %cmp29.not, true
%inc32 = zext i1 %not.cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc32
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82
store i64 %.sink, ptr %37, align 4
%indvars.iv.next83 = add nsw i64 %indvars.iv82, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count85
br i1 %exitcond86.not, label %for.end42, label %for.body22, !llvm.loop !20
for.end42: ; preds = %for.body22, %for.end14
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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A14 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp66.i = icmp sgt i32 %sub.i, 0
br i1 %cmp66.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.Card, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %A14
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load15 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load15, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp568.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp568.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count80.i = zext i32 %sub1.i to i64
%invariant.gep87.i = getelementptr %struct.Card, ptr %A, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check20, label %for.body6.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %A14
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body6.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count80.i, 4294967292
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %index27
%18 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %index27
%wide.load28 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load29 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load28, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load29, ptr %20, align 16
%index.next30 = add nuw i64 %index27, 4
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !23
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count80.i
br i1 %cmp.n25, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck16, %for.body6.preheader.i, %middle.block18
%indvars.iv76.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body6.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv76.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count80.i
%xtraiter31 = and i64 %wide.trip.count80.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv76.i.prol = phi i64 [ %indvars.iv.next77.i.prol, %for.body6.i.prol ], [ %indvars.iv76.i.ph, %for.body6.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i.prol
%gep88.i.prol = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i.prol
%24 = load i64, ptr %gep88.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next77.i.prol = add nuw nsw i64 %indvars.iv76.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv76.i.unr = phi i64 [ %indvars.iv76.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next77.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.Card, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv76.i = phi i64 [ %indvars.iv.next77.i.3, %for.body6.i ], [ %indvars.iv76.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv76.i
%gep88.i = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv76.i
%30 = load i64, ptr %gep88.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next77.i = add nuw nsw i64 %indvars.iv76.i, 1
%arrayidx8.i.1 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i
%gep88.i.1 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i
%31 = load i64, ptr %gep88.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next77.i.1 = add nuw nsw i64 %indvars.iv76.i, 2
%arrayidx8.i.2 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.1
%gep88.i.2 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.1
%32 = load i64, ptr %gep88.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next77.i.2 = add nuw nsw i64 %indvars.iv76.i, 3
%arrayidx8.i.3 = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %indvars.iv.next77.i.2
%gep88.i.3 = getelementptr %struct.Card, ptr %invariant.gep87.i, i64 %indvars.iv.next77.i.2
%33 = load i64, ptr %gep88.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next77.i.3 = add nuw nsw i64 %indvars.iv76.i, 4
%exitcond81.not.i.3 = icmp eq i64 %indvars.iv.next77.i.3, %wide.trip.count80.i
br i1 %exitcond81.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block18, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%value.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom15.i, i32 1
store i32 2000000000, ptr %value.i, align 4, !tbaa !15
%idxprom17.i = sext i32 %sub.i to i64
%value19.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom17.i, i32 1
store i32 2000000000, ptr %value19.i, align 4, !tbaa !15
%34 = sext i32 %left to i64
%wide.trip.count85.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv82.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next83.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%j.072.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%value25.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %value25.i, align 4, !tbaa !15
%idxprom26.i = zext i32 %j.072.i to i64
%value28.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %value28.i, align 4, !tbaa !15
%cmp29.not.i = icmp sgt i32 %35, %36
%arrayidx27.i = getelementptr inbounds [50002 x %struct.Card], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [50002 x %struct.Card], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx27.i, ptr %arrayidx24.i
%inc37.i = zext i1 %cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.072.i, %inc37.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc32.i = zext i1 %not.cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc32.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv82.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next83.i = add nsw i64 %indvars.iv82.i, 1
%exitcond86.not.i = icmp eq i64 %indvars.iv.next83.i, %wide.trip.count85.i
br i1 %exitcond86.not.i, label %if.end, label %for.body22.i, !llvm.loop !20
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !27
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%value.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0, i32 1
%2 = load i32, ptr %value.prol, align 4, !tbaa !15
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%value = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %value, align 4, !tbaa !15
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%value.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %value.1, align 4, !tbaa !15
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp10 = icmp slt i32 %p, %r
br i1 %cmp10, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr11 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !27
%sub.i = add nsw i32 %p.tr11, -1
%1 = sext i32 %p.tr11 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%value.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1, i32 1
%3 = load i32, ptr %value.i.prol, align 4, !tbaa !15
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr11 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr11, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%value.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %value.i, align 4, !tbaa !15
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%value.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %value.i.1, align 4, !tbaa !15
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.Card, ptr %A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %A, i32 noundef %n, i32 noundef %p.tr11, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%A = alloca [100000 x %struct.Card], align 16
%B = alloca [100000 x %struct.Card], align 16
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !28
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
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.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !30
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !31
%arrayidx4 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !31
%2 = load i32, ptr %v, align 4, !tbaa !28
%value = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value, align 4, !tbaa !15
%value10 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %value10, align 4, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !28
%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 !32
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr %n, align 4, !tbaa !28
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %B, i32 noundef %5, i32 noundef 0, i32 noundef %sub)
%cmp1465 = icmp sgt i32 %5, 0
br i1 %cmp1465, label %for.body15.preheader, label %if.end33
for.body15.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end27.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body15
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv73 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067 = phi i32 [ 1, %for.body15.preheader.new ], [ %spec.select.3, %for.body15 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.3, %for.body15 ]
%arrayidx17 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i8, ptr %arrayidx17, align 16, !tbaa !31
%arrayidx20 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73
%8 = load i8, ptr %arrayidx20, align 16, !tbaa !31
%cmp23.not = icmp eq i8 %7, %8
%indvars.iv.next74 = or i64 %indvars.iv73, 1
%arrayidx17.1 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74
%9 = load i8, ptr %arrayidx17.1, align 8, !tbaa !31
%arrayidx20.1 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74
%10 = load i8, ptr %arrayidx20.1, align 8, !tbaa !31
%cmp23.not.1 = icmp eq i8 %9, %10
%indvars.iv.next74.1 = or i64 %indvars.iv73, 2
%arrayidx17.2 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.1
%11 = load i8, ptr %arrayidx17.2, align 16, !tbaa !31
%arrayidx20.2 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.1
%12 = load i8, ptr %arrayidx20.2, align 16, !tbaa !31
%cmp23.not.2 = icmp eq i8 %11, %12
%indvars.iv.next74.2 = or i64 %indvars.iv73, 3
%arrayidx17.3 = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv.next74.2
%13 = load i8, ptr %arrayidx17.3, align 8, !tbaa !31
%arrayidx20.3 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv.next74.2
%14 = load i8, ptr %arrayidx20.3, align 8, !tbaa !31
%cmp23.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp23.not.3, i1 %cmp23.not.2, i1 false
%16 = select i1 %15, i1 %cmp23.not.1, i1 false
%17 = select i1 %16, i1 %cmp23.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.067, i32 0
%indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end27.unr-lcssa, label %for.body15, !llvm.loop !33
for.end27.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%indvars.iv73.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next74.3, %for.body15 ]
%stable.067.unr = phi i32 [ 1, %for.body15.preheader ], [ %spec.select.3, %for.body15 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end27, label %for.body15.epil
for.body15.epil: ; preds = %for.end27.unr-lcssa, %for.body15.epil
%indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %for.body15.epil ], [ %indvars.iv73.unr, %for.end27.unr-lcssa ]
%stable.067.epil = phi i32 [ %spec.select.epil, %for.body15.epil ], [ %stable.067.unr, %for.end27.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body15.epil ], [ 0, %for.end27.unr-lcssa ]
%arrayidx17.epil = getelementptr inbounds [100000 x %struct.Card], ptr %A, i64 0, i64 %indvars.iv73.epil
%18 = load i8, ptr %arrayidx17.epil, align 8, !tbaa !31
%arrayidx20.epil = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv73.epil
%19 = load i8, ptr %arrayidx20.epil, align 8, !tbaa !31
%cmp23.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp23.not.epil, i32 %stable.067.epil, i32 0
%indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end27, label %for.body15.epil, !llvm.loop !34
for.end27: ; preds = %for.body15.epil, %for.end27.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end27.unr-lcssa ], [ %spec.select.epil, %for.body15.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select81 = select i1 %20, ptr @str.5, ptr @str
br label %if.end33
if.end33: ; preds = %for.end27, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select81, %for.end27 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr %n, align 4, !tbaa !28
%cmp3569 = icmp sgt i32 %21, 0
br i1 %cmp3569, label %for.body37, label %for.end48
for.body37: ; preds = %if.end33, %for.body37
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body37 ], [ 0, %if.end33 ]
%arrayidx39 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76
%22 = load i8, ptr %arrayidx39, align 8, !tbaa !31
%conv41 = sext i8 %22 to i32
%value44 = getelementptr inbounds [100000 x %struct.Card], ptr %B, i64 0, i64 %indvars.iv76, i32 1
%23 = load i32, ptr %value44, align 4, !tbaa !15
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv41, i32 noundef %23)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%24 = load i32, ptr %n, align 4, !tbaa !28
%25 = sext i32 %24 to i64
%cmp35 = icmp slt i64 %indvars.iv.next77, %25
br i1 %cmp35, label %for.body37, label %for.end48, !llvm.loop !35
for.end48: ; preds = %for.body37, %if.end33
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %B) #8
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.unroll.disable"}
!11 = distinct !{!11, !6, !7, !8}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !6, !7}
!14 = distinct !{!14, !6, !7}
!15 = !{!16, !19, i64 4}
!16 = !{!"Card", !17, i64 0, !19, i64 4}
!17 = !{!"omnipotent char", !18, i64 0}
!18 = !{!"Simple C/C++ TBAA"}
!19 = !{!"int", !17, i64 0}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6, !7, !8}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !6, !7, !8}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !6, !7}
!26 = distinct !{!26, !6, !7}
!27 = !{i64 0, i64 4, !28}
!28 = !{!19, !19, i64 0}
!29 = distinct !{!29, !6}
!30 = !{!17, !17, i64 0}
!31 = !{!16, !17, i64 0}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !10}
!35 = distinct !{!35, !6}
|
#include<stdio.h>
#define N 100001
void QS(int p,int r);
int P(int p, int r);
struct Card{
int num;
char ch;
int m;
};
struct Card A[N];
int main(){
int i,j,n,f=0;
char m1,m2,m3;
scanf("%d%c",&n,&m1);
for(i=1;i<=n;i++){
scanf("%c%c%d%c",&A[i].ch,&m2,&A[i].num,&m3);
A[i].m = i;
}
j = P(1,n);
QS(1,n);
for(i=1;i<n;i++){
if((A[i].m > A[i+1].m) && (A[i].num == A[i+1].num)){
f = 1;
break;
}
}
if(f == 1)
printf("Not stable\n");
else printf("Stable\n");
for(i=1;i<=n;i++)
printf("%c %d\n",A[i].ch,A[i].num);
return 0;
}
int P(int p, int r){
int i,j;
struct Card x,tmp1,tmp2;
x.num = A[r].num;
i = p -1;
for(j = p; j <= r-1; j++){
if(A[j].num <= x.num){
i = i + 1;
tmp1 = A[i];
A[i] = A[j];
A[j] = tmp1;
}
}
tmp2 = A[i + 1];
A[i+1] = A[r];
A[r] = tmp2;
return i + 1;
}
void QS(int p,int r){
int q;
if(p < r){
q = P(p,r);
QS(p,q-1);
QS(q+1,r);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270002/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270002/source.c"
target datalayout = "e-m:e-p270: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.Card = type { i32, i8, i32 }
@.str = private unnamed_addr constant [5 x i8] c"%d%c\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%c%c%d%c\00", align 1
@A = dso_local global [100001 x %struct.Card] zeroinitializer, align 16
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@str = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
@str.5 = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%tmp1.i = alloca %struct.Card, align 4
%tmp2.i = alloca %struct.Card, align 4
%n = alloca i32, align 4
%m1 = alloca i8, align 1
%m2 = alloca i8, align 1
%m3 = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m1) #6
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m2) #6
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m3) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m1)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not62 = icmp slt i32 %0, 1
br i1 %cmp.not62, label %for.end.thread, label %for.body
for.end.thread: ; preds = %entry
%.pre76 = sext i32 %0 to i64
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp1.i)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp2.i)
%arrayidx.i79 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %.pre76
br label %P.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv
%ch = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ch, ptr noundef nonnull %m2, ptr noundef nonnull %arrayidx, ptr noundef nonnull %m3)
%m = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv, i32 2
%1 = trunc i64 %indvars.iv to i32
store i32 %1, ptr %m, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp1.i)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp2.i)
%arrayidx.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %3
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !13
%cmp.not.not40.i = icmp sgt i32 %2, 1
br i1 %cmp.not.not40.i, label %for.body.i, label %P.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 1, %for.end ]
%i.042.i = phi i32 [ %i.1.i, %for.inc.i ], [ 0, %for.end ]
%arrayidx4.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx4.i, align 4, !tbaa !13
%cmp7.not.i = icmp sgt i32 %5, %4
br i1 %cmp7.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.042.i, 1
%idxprom8.i = sext i32 %add.i to i64
%arrayidx9.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %idxprom8.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp1.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx9.i, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx9.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp1.i, i64 12, i1 false), !tbaa.struct !14
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.042.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, %3
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !16
for.end.loopexit.i: ; preds = %for.inc.i
%6 = add nsw i32 %i.1.i, 1
%7 = sext i32 %6 to i64
br label %P.exit
P.exit: ; preds = %for.end.thread, %for.end, %for.end.loopexit.i
%arrayidx.i82 = phi ptr [ %arrayidx.i, %for.end ], [ %arrayidx.i, %for.end.loopexit.i ], [ %arrayidx.i79, %for.end.thread ]
%.lcssa81 = phi i32 [ %2, %for.end ], [ %2, %for.end.loopexit.i ], [ %0, %for.end.thread ]
%i.0.lcssa.i = phi i64 [ 1, %for.end ], [ %7, %for.end.loopexit.i ], [ 1, %for.end.thread ]
%arrayidx18.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %i.0.lcssa.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp2.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx18.i, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx18.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i82, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i82, ptr noundef nonnull align 4 dereferenceable(12) %tmp2.i, i64 12, i1 false), !tbaa.struct !14
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp2.i)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp1.i)
call void @QS(i32 noundef 1, i32 noundef %.lcssa81)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp864 = icmp sgt i32 %8, 1
br i1 %cmp864, label %for.body9.preheader, label %if.end32
for.body9.preheader: ; preds = %P.exit
%wide.trip.count = zext i32 %8 to i64
%.pre = load i32, ptr getelementptr inbounds ([100001 x %struct.Card], ptr @A, i64 0, i64 1, i32 2), align 4, !tbaa !9
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.inc25
%9 = phi i32 [ %.pre, %for.body9.preheader ], [ %10, %for.inc25 ]
%indvars.iv70 = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next71, %for.inc25 ]
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%m15 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv.next71, i32 2
%10 = load i32, ptr %m15, align 4, !tbaa !9
%cmp16 = icmp sgt i32 %9, %10
br i1 %cmp16, label %land.lhs.true, label %for.inc25
land.lhs.true: ; preds = %for.body9
%arrayidx14 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv.next71
%arrayidx11 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv70
%11 = load i32, ptr %arrayidx11, align 4, !tbaa !13
%12 = load i32, ptr %arrayidx14, align 4, !tbaa !13
%cmp24 = icmp eq i32 %11, %12
br i1 %cmp24, label %if.end32, label %for.inc25
for.inc25: ; preds = %for.body9, %land.lhs.true
%exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count
br i1 %exitcond.not, label %if.end32, label %for.body9, !llvm.loop !17
if.end32: ; preds = %for.inc25, %land.lhs.true, %P.exit
%str.sink = phi ptr [ @str, %P.exit ], [ @str.5, %land.lhs.true ], [ @str, %for.inc25 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp34.not66 = icmp slt i32 %13, 1
br i1 %cmp34.not66, label %for.end45, label %for.body35
for.body35: ; preds = %if.end32, %for.body35
%indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.body35 ], [ 1, %if.end32 ]
%arrayidx37 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv73
%ch38 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv73, i32 1
%14 = load i8, ptr %ch38, align 4, !tbaa !18
%conv = sext i8 %14 to i32
%15 = load i32, ptr %arrayidx37, align 4, !tbaa !13
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv, i32 noundef %15)
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp34.not.not = icmp slt i64 %indvars.iv73, %17
br i1 %cmp34.not.not, label %for.body35, label %for.end45, !llvm.loop !19
for.end45: ; preds = %for.body35, %if.end32
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %m3) #6
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %m2) #6
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %m1) #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: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @P(i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%tmp1 = alloca %struct.Card, align 4
%tmp2 = alloca %struct.Card, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp1)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp2)
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !13
%cmp.not.not40 = icmp slt i32 %p, %r
br i1 %cmp.not.not40, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.042 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx4 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !13
%cmp7.not = icmp sgt i32 %2, %0
br i1 %cmp7.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.042, 1
%idxprom8 = sext i32 %add to i64
%arrayidx9 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %idxprom8
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp1, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx9, i64 12, i1 false), !tbaa.struct !14
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx9, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4, ptr noundef nonnull align 4 dereferenceable(12) %tmp1, i64 12, i1 false), !tbaa.struct !14
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.042, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !16
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %3, %for.end.loopexit ]
%idxprom17 = sext i32 %i.0.lcssa to i64
%arrayidx18 = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %idxprom17
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp2, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx18, i64 12, i1 false), !tbaa.struct !14
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx18, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx, ptr noundef nonnull align 4 dereferenceable(12) %tmp2, i64 12, i1 false), !tbaa.struct !14
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp1)
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @QS(i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%tmp1.i = alloca %struct.Card, align 4
%tmp2.i = alloca %struct.Card, align 4
%cmp6 = icmp slt i32 %p, %r
br i1 %cmp6, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %P.exit
%p.tr7 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %P.exit ]
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp1.i)
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %tmp2.i)
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !13
%sub.i = add nsw i32 %p.tr7, -1
%1 = sext i32 %p.tr7 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%i.042.i = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i, %for.inc.i ]
%arrayidx4.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %indvars.iv.i
%2 = load i32, ptr %arrayidx4.i, align 4, !tbaa !13
%cmp7.not.i = icmp sgt i32 %2, %0
br i1 %cmp7.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.042.i, 1
%idxprom8.i = sext i32 %add.i to i64
%arrayidx9.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %idxprom8.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp1.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx9.i, i64 12, i1 false), !tbaa.struct !14
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx9.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp1.i, i64 12, i1 false), !tbaa.struct !14
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.042.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %P.exit, label %for.body.i, !llvm.loop !16
P.exit: ; preds = %for.inc.i
%3 = add nsw i32 %i.1.i, 1
%idxprom17.i = sext i32 %3 to i64
%arrayidx18.i = getelementptr inbounds [100001 x %struct.Card], ptr @A, i64 0, i64 %idxprom17.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %tmp2.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx18.i, i64 12, i1 false), !tbaa.struct !14
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx18.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, i64 12, i1 false), !tbaa.struct !14
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx.i, ptr noundef nonnull align 4 dereferenceable(12) %tmp2.i, i64 12, i1 false), !tbaa.struct !14
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp2.i)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %tmp1.i)
tail call void @QS(i32 noundef %p.tr7, i32 noundef %i.1.i)
%add = add nsw i32 %i.1.i, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %P.exit, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
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 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = !{!10, !6, i64 8}
!10 = !{!"Card", !6, i64 0, !7, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!10, !6, i64 0}
!14 = !{i64 0, i64 4, !5, i64 4, i64 1, !15, i64 8, i64 4, !5}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{!10, !7, i64 4}
!19 = distinct !{!19, !12}
|
#include <stdio.h>
#include <limits.h>
#define N 1000000
typedef struct data{
char c;
int v;
}DATA;
DATA L[N],R[N];
int n;
void mergeSort(DATA *, int, int );
void merge(DATA *, int , int , int );
int partition(DATA *, int, int );
void quickSort(DATA *, int ,int );
int main(){
int i,v;
DATA Card_A[N],Card_B[N];
char S[5];
int stable =1;
scanf("%d",&n);
for(i=0; i < n; i++){
scanf("%s %d", S, &v);
Card_A[i].c = Card_B[i].c = S[0];
Card_A[i].v = Card_B[i].v = v;
}
mergeSort(Card_A, 0, n);
quickSort(Card_B, 0, n-1);
for(i=0;i<n;i++){
if(Card_A[i].c != Card_B[i].c)stable = 0;
}
if(stable == 1) printf("Stable\n");
else printf("Not stable\n");
for(i=0;i<n;i++){
printf("%c %d\n" ,Card_B[i].c, Card_B[i].v);
}
return 0;
}
void mergeSort( DATA Card_A[], int left, int right){
int mid;
if(left+1 < right){
mid = (left + right)/2;
mergeSort(Card_A,left,mid);
mergeSort(Card_A,mid,right);
merge(Card_A, left, mid, right);
}
}
void merge(DATA Card_A[], int left, int mid, int right){
int n1,n2;
int i,j,k;
n1 = mid -left;
n2 = right -mid;
for(i=0;i<n1;i++){
L[i] = Card_A[left+i];
}
for(i=0;i<n2;i++){
R[i] = Card_A[mid+i];
}
L[n1].v = INT_MAX;
R[n2].v = INT_MAX;
i=j=0;
for(k=left; k<right ; k++){
if(L[i].v <= R[j].v){
Card_A[k] = L[i];
i++;
}else{
Card_A[k] = R[j];
j++;
}
}
}
void quickSort(DATA Card_A[], int p, int r){
int q;
if( p < r ){
q = partition(Card_A,p,r);
quickSort(Card_A,p,q-1);
quickSort(Card_A,q+1,r);
}
}
int partition(DATA Card_A[] , int p ,int r ){
int i,j;
DATA t,x;
x = Card_A[r];
i = p-1;
for(j=p; j < r ; j++){
if(Card_A[j].v <= x.v){
i++;
t = Card_A[i];
Card_A[i] = Card_A[j];
Card_A[j] = t;
}
}
t = Card_A[i+1];
Card_A[i+1] = Card_A[r];
Card_A[r] = t;
return i+1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270046/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270046/source.c"
target datalayout = "e-m:e-p270: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.data = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %d\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@L = dso_local local_unnamed_addr global [1000000 x %struct.data] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [1000000 x %struct.data] zeroinitializer, align 16
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%v = alloca i32, align 4
%Card_A = alloca [1000000 x %struct.data], align 16
%Card_B = alloca [1000000 x %struct.data], align 16
%S = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #8
call void @llvm.lifetime.start.p0(i64 8000000, ptr nonnull %Card_A) #8
call void @llvm.lifetime.start.p0(i64 8000000, ptr nonnull %Card_B) #8
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %S) #8
%call = tail 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
br i1 %cmp64, label %for.body, label %for.end
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.1, ptr noundef nonnull %S, ptr noundef nonnull %v)
%1 = load i8, ptr %S, align 1, !tbaa !9
%arrayidx2 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx2, align 8, !tbaa !10
%arrayidx4 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_A, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx4, align 8, !tbaa !10
%2 = load i32, ptr %v, align 4, !tbaa !5
%v8 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %v8, align 4, !tbaa !12
%v11 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_A, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %v11, align 4, !tbaa !12
%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 !13
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
call void @mergeSort(ptr noundef nonnull %Card_A, i32 noundef 0, i32 noundef %.lcssa)
%5 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
call void @quickSort(ptr noundef nonnull %Card_B, i32 noundef 0, i32 noundef %sub)
%cmp1566 = icmp sgt i32 %5, 0
br i1 %cmp1566, label %for.body16.preheader, label %if.end34
for.body16.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %5, 4
br i1 %6, label %for.end28.unr-lcssa, label %for.body16.preheader.new
for.body16.preheader.new: ; preds = %for.body16.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body16
for.body16: ; preds = %for.body16, %for.body16.preheader.new
%indvars.iv74 = phi i64 [ 0, %for.body16.preheader.new ], [ %indvars.iv.next75.3, %for.body16 ]
%stable.068 = phi i32 [ 1, %for.body16.preheader.new ], [ %spec.select.3, %for.body16 ]
%niter = phi i64 [ 0, %for.body16.preheader.new ], [ %niter.next.3, %for.body16 ]
%arrayidx18 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_A, i64 0, i64 %indvars.iv74
%7 = load i8, ptr %arrayidx18, align 16, !tbaa !10
%arrayidx21 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv74
%8 = load i8, ptr %arrayidx21, align 16, !tbaa !10
%cmp24.not = icmp eq i8 %7, %8
%indvars.iv.next75 = or i64 %indvars.iv74, 1
%arrayidx18.1 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_A, i64 0, i64 %indvars.iv.next75
%9 = load i8, ptr %arrayidx18.1, align 8, !tbaa !10
%arrayidx21.1 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv.next75
%10 = load i8, ptr %arrayidx21.1, align 8, !tbaa !10
%cmp24.not.1 = icmp eq i8 %9, %10
%indvars.iv.next75.1 = or i64 %indvars.iv74, 2
%arrayidx18.2 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_A, i64 0, i64 %indvars.iv.next75.1
%11 = load i8, ptr %arrayidx18.2, align 16, !tbaa !10
%arrayidx21.2 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv.next75.1
%12 = load i8, ptr %arrayidx21.2, align 16, !tbaa !10
%cmp24.not.2 = icmp eq i8 %11, %12
%indvars.iv.next75.2 = or i64 %indvars.iv74, 3
%arrayidx18.3 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_A, i64 0, i64 %indvars.iv.next75.2
%13 = load i8, ptr %arrayidx18.3, align 8, !tbaa !10
%arrayidx21.3 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv.next75.2
%14 = load i8, ptr %arrayidx21.3, align 8, !tbaa !10
%cmp24.not.3 = icmp eq i8 %13, %14
%15 = select i1 %cmp24.not.3, i1 %cmp24.not.2, i1 false
%16 = select i1 %15, i1 %cmp24.not.1, i1 false
%17 = select i1 %16, i1 %cmp24.not, i1 false
%spec.select.3 = select i1 %17, i32 %stable.068, i32 0
%indvars.iv.next75.3 = add nuw nsw i64 %indvars.iv74, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end28.unr-lcssa, label %for.body16, !llvm.loop !15
for.end28.unr-lcssa: ; preds = %for.body16, %for.body16.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body16.preheader ], [ %spec.select.3, %for.body16 ]
%indvars.iv74.unr = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next75.3, %for.body16 ]
%stable.068.unr = phi i32 [ 1, %for.body16.preheader ], [ %spec.select.3, %for.body16 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end28, label %for.body16.epil
for.body16.epil: ; preds = %for.end28.unr-lcssa, %for.body16.epil
%indvars.iv74.epil = phi i64 [ %indvars.iv.next75.epil, %for.body16.epil ], [ %indvars.iv74.unr, %for.end28.unr-lcssa ]
%stable.068.epil = phi i32 [ %spec.select.epil, %for.body16.epil ], [ %stable.068.unr, %for.end28.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body16.epil ], [ 0, %for.end28.unr-lcssa ]
%arrayidx18.epil = getelementptr inbounds [1000000 x %struct.data], ptr %Card_A, i64 0, i64 %indvars.iv74.epil
%18 = load i8, ptr %arrayidx18.epil, align 8, !tbaa !10
%arrayidx21.epil = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv74.epil
%19 = load i8, ptr %arrayidx21.epil, align 8, !tbaa !10
%cmp24.not.epil = icmp eq i8 %18, %19
%spec.select.epil = select i1 %cmp24.not.epil, i32 %stable.068.epil, i32 0
%indvars.iv.next75.epil = add nuw nsw i64 %indvars.iv74.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end28, label %for.body16.epil, !llvm.loop !16
for.end28: ; preds = %for.body16.epil, %for.end28.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end28.unr-lcssa ], [ %spec.select.epil, %for.body16.epil ]
%20 = icmp eq i32 %spec.select.lcssa, 1
%spec.select82 = select i1 %20, ptr @str.5, ptr @str
br label %if.end34
if.end34: ; preds = %for.end28, %for.end
%str.sink = phi ptr [ @str.5, %for.end ], [ %spec.select82, %for.end28 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%21 = load i32, ptr @n, align 4, !tbaa !5
%cmp3670 = icmp sgt i32 %21, 0
br i1 %cmp3670, label %for.body38, label %for.end49
for.body38: ; preds = %if.end34, %for.body38
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body38 ], [ 0, %if.end34 ]
%arrayidx40 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv77
%22 = load i8, ptr %arrayidx40, align 8, !tbaa !10
%conv42 = sext i8 %22 to i32
%v45 = getelementptr inbounds [1000000 x %struct.data], ptr %Card_B, i64 0, i64 %indvars.iv77, i32 1
%23 = load i32, ptr %v45, align 4, !tbaa !12
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv42, i32 noundef %23)
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%24 = load i32, ptr @n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp36 = icmp slt i64 %indvars.iv.next78, %25
br i1 %cmp36, label %for.body38, label %for.end49, !llvm.loop !18
for.end49: ; preds = %for.body38, %if.end34
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %S) #8
call void @llvm.lifetime.end.p0(i64 8000000, ptr nonnull %Card_B) #8
call void @llvm.lifetime.end.p0(i64 8000000, ptr nonnull %Card_A) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %Card_A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #3 {
entry:
%Card_A12 = ptrtoint ptr %Card_A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %Card_A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %Card_A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp68.i = icmp sgt i32 %sub.i, 0
br i1 %cmp68.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr %struct.data, ptr %Card_A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %Card_A12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.data, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load13 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load13, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%arrayidx.i.prol = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.i.prol
%gep.i.prol = getelementptr %struct.data, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i64, ptr %gep.i.prol, align 4
store i64 %11, ptr %arrayidx.i.prol, align 8
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !22
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp570.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp570.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count82.i = zext i32 %sub1.i to i64
%invariant.gep89.i = getelementptr %struct.data, ptr %Card_A, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 10
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %Card_A12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count82.i, 4294967292
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %index25
%18 = getelementptr %struct.data, ptr %invariant.gep89.i, i64 %index25
%wide.load26 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load27 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load26, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load27, ptr %20, align 16
%index.next28 = add nuw i64 %index25, 4
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !23
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count82.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv78.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv78.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82.i
%xtraiter29 = and i64 %wide.trip.count82.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv78.i.prol = phi i64 [ %indvars.iv.next79.i.prol, %for.body6.i.prol ], [ %indvars.iv78.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%arrayidx8.i.prol = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv78.i.prol
%gep90.i.prol = getelementptr %struct.data, ptr %invariant.gep89.i, i64 %indvars.iv78.i.prol
%24 = load i64, ptr %gep90.i.prol, align 4
store i64 %24, ptr %arrayidx8.i.prol, align 8
%indvars.iv.next79.i.prol = add nuw nsw i64 %indvars.iv78.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !24
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv78.i.unr = phi i64 [ %indvars.iv78.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next79.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%arrayidx.i = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.i
%gep.i = getelementptr %struct.data, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i64, ptr %gep.i, align 4
store i64 %26, ptr %arrayidx.i, align 8
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.next.i
%gep.i.1 = getelementptr %struct.data, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i64, ptr %gep.i.1, align 4
store i64 %27, ptr %arrayidx.i.1, align 8
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%arrayidx.i.2 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.next.i.1
%gep.i.2 = getelementptr %struct.data, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i64, ptr %gep.i.2, align 4
store i64 %28, ptr %arrayidx.i.2, align 8
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i.3 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.next.i.2
%gep.i.3 = getelementptr %struct.data, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i64, ptr %gep.i.3, align 4
store i64 %29, ptr %arrayidx.i.3, align 8
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !25
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv78.i = phi i64 [ %indvars.iv.next79.i.3, %for.body6.i ], [ %indvars.iv78.i.unr, %for.body6.i.prol.loopexit ]
%arrayidx8.i = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv78.i
%gep90.i = getelementptr %struct.data, ptr %invariant.gep89.i, i64 %indvars.iv78.i
%30 = load i64, ptr %gep90.i, align 4
store i64 %30, ptr %arrayidx8.i, align 8
%indvars.iv.next79.i = add nuw nsw i64 %indvars.iv78.i, 1
%arrayidx8.i.1 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv.next79.i
%gep90.i.1 = getelementptr %struct.data, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i
%31 = load i64, ptr %gep90.i.1, align 4
store i64 %31, ptr %arrayidx8.i.1, align 8
%indvars.iv.next79.i.1 = add nuw nsw i64 %indvars.iv78.i, 2
%arrayidx8.i.2 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv.next79.i.1
%gep90.i.2 = getelementptr %struct.data, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.1
%32 = load i64, ptr %gep90.i.2, align 4
store i64 %32, ptr %arrayidx8.i.2, align 8
%indvars.iv.next79.i.2 = add nuw nsw i64 %indvars.iv78.i, 3
%arrayidx8.i.3 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv.next79.i.2
%gep90.i.3 = getelementptr %struct.data, ptr %invariant.gep89.i, i64 %indvars.iv.next79.i.2
%33 = load i64, ptr %gep90.i.3, align 4
store i64 %33, ptr %arrayidx8.i.3, align 8
%indvars.iv.next79.i.3 = add nuw nsw i64 %indvars.iv78.i, 4
%exitcond83.not.i.3 = icmp eq i64 %indvars.iv.next79.i.3, %wide.trip.count82.i
br i1 %exitcond83.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !26
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub.i to i64
%v.i = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %idxprom15.i, i32 1
store i32 2147483647, ptr %v.i, align 4, !tbaa !12
%idxprom17.i = sext i32 %sub1.i to i64
%v19.i = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %idxprom17.i, i32 1
store i32 2147483647, ptr %v19.i, align 4, !tbaa !12
%34 = sext i32 %left to i64
%wide.trip.count87.i = sext i32 %right to i64
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i, %for.end14.i
%indvars.iv84.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next85.i, %for.body22.i ]
%j.074.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body22.i ]
%i.273.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body22.i ]
%idxprom23.i = zext i32 %i.273.i to i64
%v25.i = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %idxprom23.i, i32 1
%35 = load i32, ptr %v25.i, align 4, !tbaa !12
%idxprom26.i = zext i32 %j.074.i to i64
%v28.i = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %idxprom26.i, i32 1
%36 = load i32, ptr %v28.i, align 4, !tbaa !12
%cmp29.not.i = icmp sle i32 %35, %36
%arrayidx27.i = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %idxprom26.i
%arrayidx24.i = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %idxprom23.i
%.sink.in.i = select i1 %cmp29.not.i, ptr %arrayidx24.i, ptr %arrayidx27.i
%inc34.i = zext i1 %cmp29.not.i to i32
%i.3.i = add nuw nsw i32 %i.273.i, %inc34.i
%not.cmp29.not.i = xor i1 %cmp29.not.i, true
%inc39.i = zext i1 %not.cmp29.not.i to i32
%j.1.i = add nuw nsw i32 %j.074.i, %inc39.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%37 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv84.i
store i64 %.sink.i, ptr %37, align 4
%indvars.iv.next85.i = add nsw i64 %indvars.iv84.i, 1
%exitcond88.not.i = icmp eq i64 %indvars.iv.next85.i, %wide.trip.count87.i
br i1 %exitcond88.not.i, label %if.end, label %for.body22.i, !llvm.loop !27
if.end: ; preds = %for.body22.i, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %Card_A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp8 = icmp slt i32 %p, %r
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %r to i64
%arrayidx.i = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom.i
%x.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 4
%0 = sub nsw i64 0, %idxprom.i
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%p.tr9 = phi i32 [ %p, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%x.sroa.3.0.copyload.i = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !28
%sub.i = add nsw i32 %p.tr9, -1
%1 = sext i32 %p.tr9 to i64
%2 = sub nsw i64 %idxprom.i, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%v.i.prol = getelementptr inbounds %struct.data, ptr %Card_A, i64 %1, i32 1
%3 = load i32, ptr %v.i.prol, align 4, !tbaa !12
%cmp4.not.i.prol = icmp sgt i32 %3, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.prol, label %for.inc.i.prol, label %if.then.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%arrayidx2.i.prol = getelementptr inbounds %struct.data, ptr %Card_A, i64 %1
%idxprom5.i.prol = sext i32 %p.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom5.i.prol
%4 = load i64, ptr %arrayidx6.i.prol, align 4
%5 = load i64, ptr %arrayidx2.i.prol, align 4
store i64 %5, ptr %arrayidx6.i.prol, align 4
store i64 %4, ptr %arrayidx2.i.prol, align 4
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %p.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %1, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.048.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %1, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.048.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.048.i.unr, %for.body.i.prol.loopexit ]
%v.i = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv.i, i32 1
%8 = load i32, ptr %v.i, align 4, !tbaa !12
%cmp4.not.i = icmp sgt i32 %8, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv.i
%inc.i = add nsw i32 %i.048.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom5.i
%9 = load i64, ptr %arrayidx6.i, align 4
%10 = load i64, ptr %arrayidx2.i, align 4
store i64 %10, ptr %arrayidx6.i, align 4
store i64 %9, ptr %arrayidx2.i, align 4
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%v.i.1 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv.next.i, i32 1
%11 = load i32, ptr %v.i.1, align 4, !tbaa !12
%cmp4.not.i.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload.i
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx2.i.1 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv.next.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom5.i.1
%12 = load i64, ptr %arrayidx6.i.1, align 4
%13 = load i64, ptr %arrayidx2.i.1, align 4
store i64 %13, ptr %arrayidx6.i.1, align 4
store i64 %12, ptr %arrayidx2.i.1, align 4
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !29
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%14 = add nsw i32 %i.1.i.lcssa, 1
%idxprom14.i = sext i32 %14 to i64
%arrayidx15.i = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom14.i
%15 = load i64, ptr %arrayidx15.i, align 4
%16 = load i64, ptr %arrayidx.i, align 4
store i64 %16, ptr %arrayidx15.i, align 4
store i64 %15, ptr %arrayidx.i, align 4
tail call void @quickSort(ptr noundef nonnull %Card_A, i32 noundef %p.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
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 @merge(ptr nocapture noundef %Card_A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #5 {
entry:
%Card_A91 = ptrtoint ptr %Card_A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp68 = icmp sgt i32 %sub, 0
br i1 %cmp68, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr %struct.data, ptr %Card_A, i64 %0
%min.iters.check = icmp ult i32 %sub, 10
br i1 %min.iters.check, label %for.body.preheader109, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 3
%2 = add i64 %1, %Card_A91
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader109, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %index
%5 = getelementptr %struct.data, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %5, align 4
%6 = getelementptr i64, ptr %5, i64 2
%wide.load92 = load <2 x i64>, ptr %6, align 4
store <2 x i64> %wide.load, ptr %4, align 16
%7 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> %wide.load92, ptr %7, align 16
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !30
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader109
for.body.preheader109: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader109, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader109 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader109 ]
%arrayidx.prol = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.prol
%gep.prol = getelementptr %struct.data, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i64, ptr %gep.prol, align 4
store i64 %11, ptr %arrayidx.prol, align 8
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !31
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader109
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader109 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp570 = icmp sgt i32 %sub1, 0
br i1 %cmp570, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count82 = zext i32 %sub1 to i64
%invariant.gep89 = getelementptr %struct.data, ptr %Card_A, i64 %13
%min.iters.check97 = icmp ult i32 %sub1, 10
br i1 %min.iters.check97, label %for.body6.preheader108, label %vector.memcheck93
vector.memcheck93: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 3
%15 = add i64 %14, %Card_A91
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check94 = icmp ult i64 %16, 32
br i1 %diff.check94, label %for.body6.preheader108, label %vector.ph98
vector.ph98: ; preds = %vector.memcheck93
%n.vec100 = and i64 %wide.trip.count82, 4294967292
br label %vector.body103
vector.body103: ; preds = %vector.body103, %vector.ph98
%index104 = phi i64 [ 0, %vector.ph98 ], [ %index.next107, %vector.body103 ]
%17 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %index104
%18 = getelementptr %struct.data, ptr %invariant.gep89, i64 %index104
%wide.load105 = load <2 x i64>, ptr %18, align 4
%19 = getelementptr i64, ptr %18, i64 2
%wide.load106 = load <2 x i64>, ptr %19, align 4
store <2 x i64> %wide.load105, ptr %17, align 16
%20 = getelementptr inbounds i64, ptr %17, i64 2
store <2 x i64> %wide.load106, ptr %20, align 16
%index.next107 = add nuw i64 %index104, 4
%21 = icmp eq i64 %index.next107, %n.vec100
br i1 %21, label %middle.block95, label %vector.body103, !llvm.loop !32
middle.block95: ; preds = %vector.body103
%cmp.n102 = icmp eq i64 %n.vec100, %wide.trip.count82
br i1 %cmp.n102, label %for.end14, label %for.body6.preheader108
for.body6.preheader108: ; preds = %vector.memcheck93, %for.body6.preheader, %middle.block95
%indvars.iv78.ph = phi i64 [ 0, %vector.memcheck93 ], [ 0, %for.body6.preheader ], [ %n.vec100, %middle.block95 ]
%22 = xor i64 %indvars.iv78.ph, -1
%23 = add nsw i64 %22, %wide.trip.count82
%xtraiter110 = and i64 %wide.trip.count82, 3
%lcmp.mod111.not = icmp eq i64 %xtraiter110, 0
br i1 %lcmp.mod111.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader108, %for.body6.prol
%indvars.iv78.prol = phi i64 [ %indvars.iv.next79.prol, %for.body6.prol ], [ %indvars.iv78.ph, %for.body6.preheader108 ]
%prol.iter112 = phi i64 [ %prol.iter112.next, %for.body6.prol ], [ 0, %for.body6.preheader108 ]
%arrayidx8.prol = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv78.prol
%gep90.prol = getelementptr %struct.data, ptr %invariant.gep89, i64 %indvars.iv78.prol
%24 = load i64, ptr %gep90.prol, align 4
store i64 %24, ptr %arrayidx8.prol, align 8
%indvars.iv.next79.prol = add nuw nsw i64 %indvars.iv78.prol, 1
%prol.iter112.next = add i64 %prol.iter112, 1
%prol.iter112.cmp.not = icmp eq i64 %prol.iter112.next, %xtraiter110
br i1 %prol.iter112.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !33
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader108
%indvars.iv78.unr = phi i64 [ %indvars.iv78.ph, %for.body6.preheader108 ], [ %indvars.iv.next79.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%arrayidx = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv
%gep = getelementptr %struct.data, ptr %invariant.gep, i64 %indvars.iv
%26 = load i64, ptr %gep, align 4
store i64 %26, ptr %arrayidx, align 8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.next
%gep.1 = getelementptr %struct.data, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i64, ptr %gep.1, align 4
store i64 %27, ptr %arrayidx.1, align 8
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.next.1
%gep.2 = getelementptr %struct.data, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i64, ptr %gep.2, align 4
store i64 %28, ptr %arrayidx.2, align 8
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %indvars.iv.next.2
%gep.3 = getelementptr %struct.data, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i64, ptr %gep.3, align 4
store i64 %29, ptr %arrayidx.3, align 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !34
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv78 = phi i64 [ %indvars.iv.next79.3, %for.body6 ], [ %indvars.iv78.unr, %for.body6.prol.loopexit ]
%arrayidx8 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv78
%gep90 = getelementptr %struct.data, ptr %invariant.gep89, i64 %indvars.iv78
%30 = load i64, ptr %gep90, align 4
store i64 %30, ptr %arrayidx8, align 8
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%arrayidx8.1 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv.next79
%gep90.1 = getelementptr %struct.data, ptr %invariant.gep89, i64 %indvars.iv.next79
%31 = load i64, ptr %gep90.1, align 4
store i64 %31, ptr %arrayidx8.1, align 8
%indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78, 2
%arrayidx8.2 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv.next79.1
%gep90.2 = getelementptr %struct.data, ptr %invariant.gep89, i64 %indvars.iv.next79.1
%32 = load i64, ptr %gep90.2, align 4
store i64 %32, ptr %arrayidx8.2, align 8
%indvars.iv.next79.2 = add nuw nsw i64 %indvars.iv78, 3
%arrayidx8.3 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %indvars.iv.next79.2
%gep90.3 = getelementptr %struct.data, ptr %invariant.gep89, i64 %indvars.iv.next79.2
%33 = load i64, ptr %gep90.3, align 4
store i64 %33, ptr %arrayidx8.3, align 8
%indvars.iv.next79.3 = add nuw nsw i64 %indvars.iv78, 4
%exitcond83.not.3 = icmp eq i64 %indvars.iv.next79.3, %wide.trip.count82
br i1 %exitcond83.not.3, label %for.end14, label %for.body6, !llvm.loop !35
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block95, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%v = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %idxprom15, i32 1
store i32 2147483647, ptr %v, align 4, !tbaa !12
%idxprom17 = sext i32 %sub1 to i64
%v19 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %idxprom17, i32 1
store i32 2147483647, ptr %v19, align 4, !tbaa !12
%cmp2172 = icmp slt i32 %left, %right
br i1 %cmp2172, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count87 = sext i32 %right to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv84 = phi i64 [ %34, %for.body22.preheader ], [ %indvars.iv.next85, %for.body22 ]
%j.074 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%idxprom23 = zext i32 %i.273 to i64
%v25 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %idxprom23, i32 1
%35 = load i32, ptr %v25, align 4, !tbaa !12
%idxprom26 = zext i32 %j.074 to i64
%v28 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %idxprom26, i32 1
%36 = load i32, ptr %v28, align 4, !tbaa !12
%cmp29.not = icmp sle i32 %35, %36
%arrayidx27 = getelementptr inbounds [1000000 x %struct.data], ptr @R, i64 0, i64 %idxprom26
%arrayidx24 = getelementptr inbounds [1000000 x %struct.data], ptr @L, i64 0, i64 %idxprom23
%.sink.in = select i1 %cmp29.not, ptr %arrayidx24, ptr %arrayidx27
%inc34 = zext i1 %cmp29.not to i32
%i.3 = add nuw nsw i32 %i.273, %inc34
%not.cmp29.not = xor i1 %cmp29.not, true
%inc39 = zext i1 %not.cmp29.not to i32
%j.1 = add nuw nsw i32 %j.074, %inc39
%.sink = load i64, ptr %.sink.in, align 8
%37 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv84
store i64 %.sink, ptr %37, align 4
%indvars.iv.next85 = add nsw i64 %indvars.iv84, 1
%exitcond88.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count87
br i1 %exitcond88.not, label %for.end42, label %for.body22, !llvm.loop !27
for.end42: ; preds = %for.body22, %for.end14
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %Card_A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #6 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom
%x.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
%x.sroa.3.0.copyload = load i32, ptr %x.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !28
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%0 = sext i32 %p to i64
%1 = sub nsw i64 %idxprom, %0
%xtraiter = and i64 %1, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%v.prol = getelementptr inbounds %struct.data, ptr %Card_A, i64 %0, i32 1
%2 = load i32, ptr %v.prol, align 4, !tbaa !12
%cmp4.not.prol = icmp sgt i32 %2, %x.sroa.3.0.copyload
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%arrayidx2.prol = getelementptr inbounds %struct.data, ptr %Card_A, i64 %0
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom5.prol
%3 = load i64, ptr %arrayidx6.prol, align 4
%4 = load i64, ptr %arrayidx2.prol, align 4
store i64 %4, ptr %arrayidx6.prol, align 4
store i64 %3, ptr %arrayidx2.prol, align 4
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %0, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %0, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body
for.body: ; preds = %for.body.prol.loopexit, %for.inc.1
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc.1 ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%i.048 = phi i32 [ %i.1.1, %for.inc.1 ], [ %i.048.unr, %for.body.prol.loopexit ]
%v = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv, i32 1
%8 = load i32, ptr %v, align 4, !tbaa !12
%cmp4.not = icmp sgt i32 %8, %x.sroa.3.0.copyload
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv
%inc = add nsw i32 %i.048, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom5
%9 = load i64, ptr %arrayidx6, align 4
%10 = load i64, ptr %arrayidx2, align 4
store i64 %10, ptr %arrayidx6, align 4
store i64 %9, ptr %arrayidx2, align 4
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.048, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%v.1 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv.next, i32 1
%11 = load i32, ptr %v.1, align 4, !tbaa !12
%cmp4.not.1 = icmp sgt i32 %11, %x.sroa.3.0.copyload
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%arrayidx2.1 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %indvars.iv.next
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom5.1
%12 = load i64, ptr %arrayidx6.1, align 4
%13 = load i64, ptr %arrayidx2.1, align 4
store i64 %13, ptr %arrayidx6.1, align 4
store i64 %12, ptr %arrayidx2.1, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !29
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%14 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %14, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds %struct.data, ptr %Card_A, i64 %idxprom14
%15 = load i64, ptr %arrayidx15, align 4
%16 = load i64, ptr %arrayidx, align 4
store i64 %16, ptr %arrayidx15, align 4
store i64 %15, ptr %arrayidx, align 4
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 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 #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !7, i64 0}
!11 = !{!"data", !7, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !14, !20, !21}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !14, !20}
!26 = distinct !{!26, !14, !20}
!27 = distinct !{!27, !14}
!28 = !{i64 0, i64 4, !5}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14, !20, !21}
!31 = distinct !{!31, !17}
!32 = distinct !{!32, !14, !20, !21}
!33 = distinct !{!33, !17}
!34 = distinct !{!34, !14, !20}
!35 = distinct !{!35, !14, !20}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int t,n;
scanf ("%d",&t);
while(t>0){
scanf("%d",&n);
if(n%4==0)
printf("YES\n");
else
printf("NO\n");
t--;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27009/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27009/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%t = alloca i32, align 4
%n = alloca i32, align 4
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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%.pr = load i32, ptr %t, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %.pr, 0
br i1 %cmp6, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = and i32 %0, 3
%cmp2 = icmp eq i32 %1, 0
%str.3.str = select i1 %cmp2, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%cmp = icmp sgt i32 %2, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
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: 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>
typedef struct{
char mark;
int number;
}Card;
void merge(int ,int ,int );
void mergesort(int ,int );
int partition(int ,int );//return element of head(now)
void quicksort(int ,int );
Card Merge[100000],Quick[100000],Left[50001],Right[50001],temp,final;
int n;
int main(void){
int i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf(" %c%d",&Merge[i].mark,&Merge[i].number);
Quick[i].mark=Merge[i].mark;
Quick[i].number=Merge[i].number;
}
mergesort(0,n);
quicksort(0,n-1);
i=0;
while(i<n){
if(Merge[i].mark!=Quick[i].mark){
i=0;
break;
}
i++;
}
if(i==n)printf("Stable\n");
else printf("Not stable\n");
i=0;
while(i<n){
printf("%c %d\n",Quick[i].mark,Quick[i].number);
i++;
}
return 0;
}
void mergesort(int left,int right){
int mid;
if(right-left>1){
mid=(left+right)/2;
mergesort(left,mid);
mergesort(mid,right);
merge(left,mid,right);
}
}
void merge(int left,int mid,int right){
int n1=mid-left,n2=right-mid,i,j,k;
for(i=0;i<n1;i++)
Left[i]=Merge[left+i];
for(i=0;i<n2;i++)
Right[i]=Merge[mid+i];
Left[n1].number=1000000001;
Right[n2].number=1000000001;
i=0;j=0;k=left;
while(k<right){
if(Left[i].number>Right[j].number)
Merge[k++]=Right[j++];
else Merge[k++]=Left[i++];
}
}
void quicksort(int head,int last){
int element;
if(last-head>0){
element=partition(head,last);
quicksort(head,element-1);
quicksort(element+1,last);
}
}
int partition(int head,int last){
int i,j;
final=Quick[last];
for(i=head;i<last;i++){
if(Quick[i].number<=final.number){
temp=Quick[head];
Quick[head++]=Quick[i];
Quick[i]=temp;
}
}
temp=Quick[head];
Quick[head]=Quick[last];
Quick[last]=temp;
return head;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270154/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270154/source.c"
target datalayout = "e-m:e-p270: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.Card = type { i8, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [6 x i8] c" %c%d\00", align 1
@Merge = dso_local global [100000 x %struct.Card] zeroinitializer, align 16
@Quick = dso_local local_unnamed_addr global [100000 x %struct.Card] zeroinitializer, align 16
@.str.4 = private unnamed_addr constant [7 x i8] c"%c %d\0A\00", align 1
@Left = dso_local local_unnamed_addr global [50001 x %struct.Card] zeroinitializer, align 16
@Right = dso_local local_unnamed_addr global [50001 x %struct.Card] zeroinitializer, align 16
@final = dso_local local_unnamed_addr global %struct.Card zeroinitializer, align 8
@temp = dso_local local_unnamed_addr global %struct.Card zeroinitializer, align 8
@str = private unnamed_addr constant [11 x i8] c"Not stable\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"Stable\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, 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 [100000 x %struct.Card], ptr @Merge, i64 0, i64 %indvars.iv
%number = getelementptr inbounds [100000 x %struct.Card], ptr @Merge, i64 0, i64 %indvars.iv, i32 1
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %number)
%1 = load i8, ptr %arrayidx, align 8, !tbaa !9
%arrayidx8 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv
store i8 %1, ptr %arrayidx8, align 8, !tbaa !9
%2 = load i32, ptr %number, align 4, !tbaa !11
%number15 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv, i32 1
store i32 %2, ptr %number15, align 4, !tbaa !11
%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 !12
for.end: ; preds = %for.body, %entry
%.lcssa64 = phi i32 [ %0, %entry ], [ %3, %for.body ]
tail call void @mergesort(i32 noundef 0, i32 noundef %.lcssa64)
%5 = load i32, ptr @n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
tail call void @quicksort(i32 noundef 0, i32 noundef %sub)
%6 = load i32, ptr @n, align 4, !tbaa !5
%cmp1667 = icmp sgt i32 %6, 0
br i1 %cmp1667, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %6 to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end
%indvars.iv76 = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next77, %if.end ]
%arrayidx18 = getelementptr inbounds [100000 x %struct.Card], ptr @Merge, i64 0, i64 %indvars.iv76
%7 = load i8, ptr %arrayidx18, align 8, !tbaa !9
%arrayidx21 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv76
%8 = load i8, ptr %arrayidx21, align 8, !tbaa !9
%cmp24.not = icmp eq i8 %7, %8
br i1 %cmp24.not, label %if.end, label %while.end
if.end: ; preds = %while.body
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%exitcond.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count
br i1 %exitcond.not, label %if.end32, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %for.end
%cmp27 = icmp eq i32 %6, 0
%spec.select = select i1 %cmp27, ptr @str.5, ptr @str
br label %if.end32
if.end32: ; preds = %if.end, %while.end
%str.sink = phi ptr [ %spec.select, %while.end ], [ @str.5, %if.end ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%9 = load i32, ptr @n, align 4, !tbaa !5
%cmp3473 = icmp sgt i32 %9, 0
br i1 %cmp3473, label %while.body36, label %while.end46
while.body36: ; preds = %if.end32, %while.body36
%indvars.iv79 = phi i64 [ %indvars.iv.next80, %while.body36 ], [ 0, %if.end32 ]
%arrayidx38 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv79
%10 = load i8, ptr %arrayidx38, align 8, !tbaa !9
%conv40 = sext i8 %10 to i32
%number43 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv79, i32 1
%11 = load i32, ptr %number43, align 4, !tbaa !11
%call44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %conv40, i32 noundef %11)
%indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
%12 = load i32, ptr @n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp34 = icmp slt i64 %indvars.iv.next80, %13
br i1 %cmp34, label %while.body36, label %while.end46, !llvm.loop !15
while.end46: ; preds = %while.body36, %if.end32
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @mergesort(i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%sub = sub nsw i32 %right, %left
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add = add nsw i32 %right, %left
%div = sdiv i32 %add, 2
tail call void @mergesort(i32 noundef %left, i32 noundef %div)
tail call void @mergesort(i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub nsw i32 %right, %div
%cmp59.i = icmp sgt i32 %sub.i, 0
br i1 %cmp59.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%1 = shl nsw i64 %0, 3
%scevgep.i = getelementptr i8, ptr @Merge, i64 %1
%2 = xor i32 %left, -1
%3 = add i32 %div, %2
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = add nuw nsw i64 %5, 8
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @Left, ptr noundef nonnull align 8 dereferenceable(1) %scevgep.i, i64 %6, i1 false)
br label %for.cond4.preheader.i
for.cond4.preheader.i: ; preds = %for.body.preheader.i, %if.then
%cmp561.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp561.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%7 = sext i32 %div to i64
%8 = shl nsw i64 %7, 3
%scevgep69.i = getelementptr i8, ptr @Merge, i64 %8
%9 = xor i32 %div, -1
%10 = add i32 %9, %right
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 3
%13 = add nuw nsw i64 %12, 8
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @Right, ptr noundef nonnull align 8 dereferenceable(1) %scevgep69.i, i64 %13, i1 false)
br label %for.end14.i
for.end14.i: ; preds = %for.body6.preheader.i, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub.i to i64
%number.i = getelementptr inbounds [50001 x %struct.Card], ptr @Left, i64 0, i64 %idxprom15.i, i32 1
store i32 1000000001, ptr %number.i, align 4, !tbaa !11
%idxprom17.i = sext i32 %sub1.i to i64
%number19.i = getelementptr inbounds [50001 x %struct.Card], ptr @Right, i64 0, i64 %idxprom17.i, i32 1
store i32 1000000001, ptr %number19.i, align 4, !tbaa !11
%cmp2063.i = icmp slt i32 %left, %right
br i1 %cmp2063.i, label %while.body.preheader.i, label %if.end
while.body.preheader.i: ; preds = %for.end14.i
%14 = sext i32 %left to i64
%wide.trip.count.i = sext i32 %right to i64
br label %while.body.i
while.body.i: ; preds = %while.body.i, %while.body.preheader.i
%indvars.iv.i = phi i64 [ %14, %while.body.preheader.i ], [ %indvars.iv.next.i, %while.body.i ]
%j.065.i = phi i32 [ 0, %while.body.preheader.i ], [ %j.1.i, %while.body.i ]
%i.264.i = phi i32 [ 0, %while.body.preheader.i ], [ %i.3.i, %while.body.i ]
%idxprom21.i = zext i32 %i.264.i to i64
%number23.i = getelementptr inbounds [50001 x %struct.Card], ptr @Left, i64 0, i64 %idxprom21.i, i32 1
%15 = load i32, ptr %number23.i, align 4, !tbaa !11
%idxprom24.i = zext i32 %j.065.i to i64
%number26.i = getelementptr inbounds [50001 x %struct.Card], ptr @Right, i64 0, i64 %idxprom24.i, i32 1
%16 = load i32, ptr %number26.i, align 4, !tbaa !11
%cmp27.i = icmp sle i32 %15, %16
%arrayidx25.i = getelementptr inbounds [50001 x %struct.Card], ptr @Right, i64 0, i64 %idxprom24.i
%arrayidx22.i = getelementptr inbounds [50001 x %struct.Card], ptr @Left, i64 0, i64 %idxprom21.i
%.sink.in.i = select i1 %cmp27.i, ptr %arrayidx22.i, ptr %arrayidx25.i
%inc37.i = zext i1 %cmp27.i to i32
%i.3.i = add nuw nsw i32 %i.264.i, %inc37.i
%not.cmp27.i = xor i1 %cmp27.i, true
%inc31.i = zext i1 %not.cmp27.i to i32
%j.1.i = add nuw nsw i32 %j.065.i, %inc31.i
%.sink.i = load i64, ptr %.sink.in.i, align 8
%17 = getelementptr inbounds [100000 x %struct.Card], ptr @Merge, i64 0, i64 %indvars.iv.i
store i64 %.sink.i, ptr %17, align 8
%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 %if.end, label %while.body.i, !llvm.loop !16
if.end: ; preds = %while.body.i, %for.end14.i, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @quicksort(i32 noundef %head, i32 noundef %last) local_unnamed_addr #3 {
entry:
%cmp7 = icmp sgt i32 %last, %head
br i1 %cmp7, label %for.body.lr.ph.i.lr.ph, label %if.end
for.body.lr.ph.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %last to i64
%arrayidx.i = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %idxprom.i
br label %for.body.lr.ph.i
for.body.lr.ph.i: ; preds = %for.body.lr.ph.i.lr.ph, %partition.exit
%head.tr8 = phi i32 [ %head, %for.body.lr.ph.i.lr.ph ], [ %add, %partition.exit ]
%0 = load i64, ptr %arrayidx.i, align 8
store i64 %0, ptr @final, align 8
%1 = lshr i64 %0, 32
%2 = trunc i64 %1 to i32
%3 = sext i32 %head.tr8 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ %3, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.inc.i ]
%head.addr.035.i = phi i32 [ %head.tr8, %for.body.lr.ph.i ], [ %head.addr.1.i, %for.inc.i ]
%number.i = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv.i, i32 1
%4 = load i32, ptr %number.i, align 4, !tbaa !11
%cmp3.not.i = icmp sgt i32 %4, %2
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%arrayidx2.i = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv.i
%idxprom4.i = sext i32 %head.addr.035.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %idxprom4.i
%5 = load i64, ptr %arrayidx5.i, align 8
%inc.i = add nsw i32 %head.addr.035.i, 1
%6 = load i64, ptr %arrayidx2.i, align 8
store i64 %6, ptr %arrayidx5.i, align 8
store i64 %5, ptr %arrayidx2.i, align 8
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%head.addr.1.i = phi i32 [ %inc.i, %if.then.i ], [ %head.addr.035.i, %for.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %partition.exit, label %for.body.i, !llvm.loop !17
partition.exit: ; preds = %for.inc.i
%.pre.i = load i64, ptr %arrayidx.i, align 8
%idxprom13.i = sext i32 %head.addr.1.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %idxprom13.i
%7 = load i64, ptr %arrayidx14.i, align 8
store i64 %7, ptr @temp, align 8
store i64 %.pre.i, ptr %arrayidx14.i, align 8
store i64 %7, ptr %arrayidx.i, align 8
%sub1 = add nsw i32 %head.addr.1.i, -1
tail call void @quicksort(i32 noundef %head.tr8, i32 noundef %sub1)
%add = add nsw i32 %head.addr.1.i, 1
%cmp = icmp slt i32 %add, %last
br i1 %cmp, label %for.body.lr.ph.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @merge(i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #2 {
entry:
%sub = sub nsw i32 %mid, %left
%sub1 = sub nsw i32 %right, %mid
%cmp59 = icmp sgt i32 %sub, 0
br i1 %cmp59, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%1 = shl nsw i64 %0, 3
%scevgep = getelementptr i8, ptr @Merge, i64 %1
%2 = xor i32 %left, -1
%3 = add i32 %2, %mid
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = add nuw nsw i64 %5, 8
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @Left, ptr noundef nonnull align 8 dereferenceable(1) %scevgep, i64 %6, i1 false)
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body.preheader, %entry
%cmp561 = icmp sgt i32 %sub1, 0
br i1 %cmp561, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%7 = sext i32 %mid to i64
%8 = shl nsw i64 %7, 3
%scevgep69 = getelementptr i8, ptr @Merge, i64 %8
%9 = xor i32 %mid, -1
%10 = add i32 %9, %right
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 3
%13 = add nuw nsw i64 %12, 8
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) @Right, ptr noundef nonnull align 8 dereferenceable(1) %scevgep69, i64 %13, i1 false)
br label %for.end14
for.end14: ; preds = %for.body6.preheader, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%number = getelementptr inbounds [50001 x %struct.Card], ptr @Left, i64 0, i64 %idxprom15, i32 1
store i32 1000000001, ptr %number, align 4, !tbaa !11
%idxprom17 = sext i32 %sub1 to i64
%number19 = getelementptr inbounds [50001 x %struct.Card], ptr @Right, i64 0, i64 %idxprom17, i32 1
store i32 1000000001, ptr %number19, align 4, !tbaa !11
%cmp2063 = icmp slt i32 %left, %right
br i1 %cmp2063, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %for.end14
%14 = sext i32 %left to i64
%wide.trip.count = sext i32 %right to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv = phi i64 [ %14, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%j.065 = phi i32 [ 0, %while.body.preheader ], [ %j.1, %while.body ]
%i.264 = phi i32 [ 0, %while.body.preheader ], [ %i.3, %while.body ]
%idxprom21 = zext i32 %i.264 to i64
%number23 = getelementptr inbounds [50001 x %struct.Card], ptr @Left, i64 0, i64 %idxprom21, i32 1
%15 = load i32, ptr %number23, align 4, !tbaa !11
%idxprom24 = zext i32 %j.065 to i64
%number26 = getelementptr inbounds [50001 x %struct.Card], ptr @Right, i64 0, i64 %idxprom24, i32 1
%16 = load i32, ptr %number26, align 4, !tbaa !11
%cmp27 = icmp sle i32 %15, %16
%arrayidx25 = getelementptr inbounds [50001 x %struct.Card], ptr @Right, i64 0, i64 %idxprom24
%arrayidx22 = getelementptr inbounds [50001 x %struct.Card], ptr @Left, i64 0, i64 %idxprom21
%.sink.in = select i1 %cmp27, ptr %arrayidx22, ptr %arrayidx25
%inc37 = zext i1 %cmp27 to i32
%i.3 = add nuw nsw i32 %i.264, %inc37
%not.cmp27 = xor i1 %cmp27, true
%inc31 = zext i1 %not.cmp27 to i32
%j.1 = add nuw nsw i32 %j.065, %inc31
%.sink = load i64, ptr %.sink.in, align 8
%17 = getelementptr inbounds [100000 x %struct.Card], ptr @Merge, i64 0, i64 %indvars.iv
store i64 %.sink, ptr %17, align 8
%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 %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %while.body, %for.end14
ret void
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %head, i32 noundef %last) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %last to i64
%arrayidx = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %idxprom
%0 = load i64, ptr %arrayidx, align 8
store i64 %0, ptr @final, align 8
%cmp33 = icmp slt i32 %head, %last
%1 = lshr i64 %0, 32
%2 = trunc i64 %1 to i32
br i1 %cmp33, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%3 = sext i32 %head to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ %3, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%head.addr.035 = phi i32 [ %head, %for.body.lr.ph ], [ %head.addr.1, %for.inc ]
%number = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv, i32 1
%4 = load i32, ptr %number, align 4, !tbaa !11
%cmp3.not = icmp sgt i32 %4, %2
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%arrayidx2 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %indvars.iv
%idxprom4 = sext i32 %head.addr.035 to i64
%arrayidx5 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %idxprom4
%5 = load i64, ptr %arrayidx5, align 8
%inc = add nsw i32 %head.addr.035, 1
%6 = load i64, ptr %arrayidx2, align 8
store i64 %6, ptr %arrayidx5, align 8
store i64 %5, ptr %arrayidx2, align 8
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%head.addr.1 = phi i32 [ %inc, %if.then ], [ %head.addr.035, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !17
for.end.loopexit: ; preds = %for.inc
%.pre = load i64, ptr %arrayidx, align 8
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%7 = phi i64 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%head.addr.0.lcssa = phi i32 [ %head, %entry ], [ %head.addr.1, %for.end.loopexit ]
%idxprom13 = sext i32 %head.addr.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x %struct.Card], ptr @Quick, i64 0, i64 %idxprom13
%8 = load i64, ptr %arrayidx14, align 8
store i64 %8, ptr @temp, align 8
store i64 %7, ptr %arrayidx14, align 8
store i64 %8, ptr %arrayidx, align 8
ret i32 %head.addr.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!10, !7, i64 0}
!10 = !{!"", !7, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
#include <string.h>
int main(){
int a,i;
char sen[1001];
scanf("%s\n%d",&sen,&a);
for(i=0;i<strlen(sen);i=i+a){
printf("%c",sen[i]);
}
printf("\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270211/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270211/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s\0A%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%sen = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %sen) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sen, ptr noundef nonnull %a)
%char0 = load i8, ptr %sen, align 16
%cmp10.not = icmp eq i8 %char0, 0
br i1 %cmp10.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%conv12 = phi i64 [ %conv, %for.body ], [ 0, %entry ]
%i.011 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 x i8], ptr %sen, i64 0, i64 %conv12
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv3 = sext i8 %0 to i32
%putchar8 = call i32 @putchar(i32 %conv3)
%1 = load i32, ptr %a, align 4, !tbaa !8
%add = add nsw i32 %1, %i.011
%conv = sext i32 %add to i64
%call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %sen) #6
%cmp = icmp ugt i64 %call1, %conv
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %sen) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
// AOJ 2581 Derangement
// 2018.3.9 bal4u
#include <stdio.h>
#include <string.h>
#define QMAX 10000
typedef struct { int t, s; } QUE;
QUE que[QMAX]; int qsize;
#define PARENT(i) ((i)>>1)
#define LEFT(i) ((i)<<1)
#define RIGHT(i) (((i)<<1)+1)
void min_heapify(int i)
{
int l, r, min;
QUE qt;
l = LEFT(i), r = RIGHT(i);
if (l < qsize && que[l].t < que[i].t) min = l; else min = i;
if (r < qsize && que[r].t < que[min].t) min = r;
if (min != i) {
qt = que[i], que[i] = que[min], que[min] = qt;
min_heapify(min);
}
}
void deq()
{
que[0] = que[--qsize];
min_heapify(0);
}
void enq(int s, int t)
{
int i, min;
QUE qt;
i = qsize++;
que[i].s = s, que[i].t = t;
while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
qt = que[i], que[i] = que[min], que[min] = qt;
i = min;
}
}
#define INF 0x10101010
#define MAX 205
typedef struct { int to, rev; int cap, cost; } EDGE;
EDGE edge[MAX][MAX]; int hi[MAX];
int V; // 頂点数
int potential[MAX], dist[MAX], prevv[MAX], preve[MAX];
void add_edge(int from, int to, int cap, int cost)
{
int f, t;
EDGE *ep;
f = hi[from]++, t = hi[to]++;
ep = &edge[from][f], ep->to = to, ep->cap = cap, ep->cost = cost, ep->rev = t;
ep = &edge[to][t], ep->to = from, ep->cap = 0, ep->cost = -cost, ep->rev = f;
}
int minCostFlow(int S, int T, int F)
{
int i, v, nv, t, nt, ret;
EDGE *ep;
ret = 0;
// memset(potential, 0, V << 2);
while (F > 0) {
memset(dist, INF, V << 2);
qsize = 0;
enq(S, 0), dist[S] = 0;
while (qsize) {
v = que[0].s, t = que[0].t, deq();
if (dist[v] < t) continue;
for (i = 0; i < hi[v]; i++) {
ep = &edge[v][i];
if (ep->cap <= 0) continue;
nv = ep->to;
nt = t + ep->cost - potential[nv] + potential[v];
if(dist[nv] > nt) {
dist[nv] = nt;
prevv[nv] = v, preve[nv] = i;
enq(nv, nt);
}
}
}
if (dist[T] == INF) return -1;
for (v = 0; v < V; v++) potential[v] += dist[v];
t = F;
for (v = T; v != S; v = prevv[v]) {
ep = &edge[prevv[v]][preve[v]];
if (t > ep->cap) t = ep->cap;
}
F -= t;
ret += t * potential[T];
for (v = T; v != S; v = prevv[v]) {
ep = &edge[prevv[v]][preve[v]];
ep->cap -= t;
edge[v][ep->rev].cap += t;
}
}
return ret;
}
//#define getchar_unlocked() getchar()
int in()
{
int n = 0;
int c = getchar_unlocked();
do n = 10*n + (c & 0xf), c = getchar_unlocked();
while (c >= '0');
return n;
}
int main()
{
int n, p, i, j;
int source, sink;
n = in();
source = n << 1, sink = source+1, V = sink+1;
for (i = 0; i < n; i++) {
add_edge(source, i, 1, 0);
p = in();
for (j = 0; j < i; j++) if (p != j+1)
add_edge(i, n+j, 1, (i-j)*p);
for ( ; j < n; j++) if (p != j+1)
add_edge(i, n+j, 1, (j-i)*p);
add_edge(n+i, sink, 1, 0);
}
printf("%d\n", minCostFlow(source, sink, n));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270262/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270262/source.c"
target datalayout = "e-m:e-p270: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.QUE = type { i32, i32 }
%struct.EDGE = type { i32, i32, i32, i32 }
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@qsize = dso_local local_unnamed_addr global i32 0, align 4
@que = dso_local local_unnamed_addr global [10000 x %struct.QUE] zeroinitializer, align 16
@hi = dso_local local_unnamed_addr global [205 x i32] zeroinitializer, align 16
@edge = dso_local local_unnamed_addr global [205 x [205 x %struct.EDGE]] zeroinitializer, align 16
@dist = dso_local local_unnamed_addr global [205 x i32] zeroinitializer, align 16
@V = dso_local local_unnamed_addr global i32 0, align 4
@potential = dso_local local_unnamed_addr global [205 x i32] zeroinitializer, align 16
@prevv = dso_local local_unnamed_addr global [205 x i32] zeroinitializer, align 16
@preve = dso_local local_unnamed_addr global [205 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @min_heapify(i32 noundef %i) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
br label %tailrecurse
tailrecurse: ; preds = %if.then18, %entry
%i.tr = phi i32 [ %i, %entry ], [ %min.1, %if.then18 ]
%shl = shl i32 %i.tr, 1
%add = or i32 %shl, 1
%cmp = icmp slt i32 %shl, %0
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %tailrecurse
%idxprom = sext i32 %shl to i64
%arrayidx = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 16, !tbaa !9
%idxprom2 = sext i32 %i.tr to i64
%arrayidx3 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom2
%2 = load i32, ptr %arrayidx3, align 8, !tbaa !9
%cmp5 = icmp slt i32 %1, %2
br i1 %cmp5, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %tailrecurse
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%min.0 = phi i32 [ %i.tr, %if.else ], [ %shl, %land.lhs.true ]
%cmp6 = icmp slt i32 %add, %0
br i1 %cmp6, label %land.lhs.true7, label %if.end16
land.lhs.true7: ; preds = %if.end
%idxprom8 = sext i32 %add to i64
%arrayidx9 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8
%3 = load i32, ptr %arrayidx9, align 8, !tbaa !9
%idxprom11 = sext i32 %min.0 to i64
%arrayidx12 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11
%4 = load i32, ptr %arrayidx12, align 8, !tbaa !9
%cmp14 = icmp slt i32 %3, %4
%spec.select = select i1 %cmp14, i32 %add, i32 %min.0
br label %if.end16
if.end16: ; preds = %land.lhs.true7, %if.end
%min.1 = phi i32 [ %min.0, %if.end ], [ %spec.select, %land.lhs.true7 ]
%cmp17.not = icmp eq i32 %min.1, %i.tr
br i1 %cmp17.not, label %if.end27, label %if.then18
if.then18: ; preds = %if.end16
%idxprom19 = sext i32 %i.tr to i64
%arrayidx20 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19
%5 = load i64, ptr %arrayidx20, align 8
%idxprom23 = sext i32 %min.1 to i64
%arrayidx24 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23
%6 = load i64, ptr %arrayidx24, align 8
store i64 %6, ptr %arrayidx20, align 8
store i64 %5, ptr %arrayidx24, align 8
br label %tailrecurse
if.end27: ; preds = %if.end16
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @deq() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8
store i64 %1, ptr @que, align 16
%2 = trunc i64 %1 to i32
br label %tailrecurse.i
tailrecurse.i: ; preds = %if.then18.i, %entry
%i.tr.i = phi i32 [ 0, %entry ], [ %min.1.i, %if.then18.i ]
%shl.i = shl i32 %i.tr.i, 1
%add.i = or i32 %shl.i, 1
%cmp.i = icmp slt i32 %shl.i, %dec
br i1 %cmp.i, label %land.lhs.true.i, label %if.else.i
land.lhs.true.i: ; preds = %tailrecurse.i
%idxprom.i = sext i32 %shl.i to i64
%arrayidx.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i
%3 = load i32, ptr %arrayidx.i, align 16, !tbaa !9
%cmp5.i = icmp slt i32 %3, %2
br i1 %cmp5.i, label %if.end.i, label %if.else.i
if.else.i: ; preds = %land.lhs.true.i, %tailrecurse.i
br label %if.end.i
if.end.i: ; preds = %if.else.i, %land.lhs.true.i
%min.0.i = phi i32 [ %i.tr.i, %if.else.i ], [ %shl.i, %land.lhs.true.i ]
%cmp6.i = icmp slt i32 %add.i, %dec
br i1 %cmp6.i, label %land.lhs.true7.i, label %if.end16.i
land.lhs.true7.i: ; preds = %if.end.i
%idxprom8.i = sext i32 %add.i to i64
%arrayidx9.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i
%4 = load i32, ptr %arrayidx9.i, align 8, !tbaa !9
%idxprom11.i = sext i32 %min.0.i to i64
%arrayidx12.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i
%5 = load i32, ptr %arrayidx12.i, align 8, !tbaa !9
%cmp14.i = icmp slt i32 %4, %5
%spec.select.i = select i1 %cmp14.i, i32 %add.i, i32 %min.0.i
br label %if.end16.i
if.end16.i: ; preds = %land.lhs.true7.i, %if.end.i
%min.1.i = phi i32 [ %min.0.i, %if.end.i ], [ %spec.select.i, %land.lhs.true7.i ]
%cmp17.not.i = icmp eq i32 %min.1.i, %i.tr.i
br i1 %cmp17.not.i, label %min_heapify.exit, label %if.then18.i
if.then18.i: ; preds = %if.end16.i
%idxprom19.i = sext i32 %i.tr.i to i64
%arrayidx20.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i
%idxprom23.i = sext i32 %min.1.i to i64
%arrayidx24.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i
%6 = load i64, ptr %arrayidx24.i, align 8
store i64 %6, ptr %arrayidx20.i, align 8
store i64 %1, ptr %arrayidx24.i, align 8
br label %tailrecurse.i
min_heapify.exit: ; preds = %if.end16.i
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @enq(i32 noundef %s, i32 noundef %t) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @qsize, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @qsize, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom
%s1 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom, i32 1
store i32 %s, ptr %s1, align 4, !tbaa !11
store i32 %t, ptr %arrayidx, align 8, !tbaa !9
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %land.rhs.preheader, label %while.end
land.rhs.preheader: ; preds = %entry
%idxprom8.phi.trans.insert = zext i32 %0 to i64
%arrayidx9.phi.trans.insert = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.phi.trans.insert
%.pre = load i32, ptr %arrayidx9.phi.trans.insert, align 8, !tbaa !9
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%1 = phi i32 [ %5, %while.body ], [ %.pre, %land.rhs.preheader ]
%i.029 = phi i32 [ %shr, %while.body ], [ %0, %land.rhs.preheader ]
%shr = lshr i32 %i.029, 1
%idxprom5 = zext i32 %shr to i64
%arrayidx6 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5
%2 = load i32, ptr %arrayidx6, align 8, !tbaa !9
%cmp11 = icmp sgt i32 %2, %1
br i1 %cmp11, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom8 = zext i32 %i.029 to i64
%arrayidx9 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8
%3 = load i64, ptr %arrayidx9, align 8
%4 = load i64, ptr %arrayidx6, align 8
store i64 %4, ptr %arrayidx9, align 8
store i64 %3, ptr %arrayidx6, align 8
%cmp.not = icmp ult i32 %i.029, 2
%5 = trunc i64 %3 to i32
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !12
while.end: ; preds = %land.rhs, %while.body, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @add_edge(i32 noundef %from, i32 noundef %to, i32 noundef %cap, i32 noundef %cost) local_unnamed_addr #1 {
entry:
%idxprom = sext i32 %from to i64
%arrayidx = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %to to i64
%arrayidx2 = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%inc3 = add nsw i32 %1, 1
store i32 %inc3, ptr %arrayidx2, align 4, !tbaa !5
%idxprom6 = sext i32 %0 to i64
%arrayidx7 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6
store i32 %to, ptr %arrayidx7, align 16, !tbaa !14
%cap9 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6, i32 2
store i32 %cap, ptr %cap9, align 8, !tbaa !16
%cost10 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6, i32 3
store i32 %cost, ptr %cost10, align 4, !tbaa !17
%rev = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom, i64 %idxprom6, i32 1
store i32 %1, ptr %rev, align 4, !tbaa !18
%idxprom13 = sext i32 %1 to i64
%arrayidx14 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13
store i32 %from, ptr %arrayidx14, align 16, !tbaa !14
%cap16 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13, i32 2
store i32 0, ptr %cap16, align 8, !tbaa !16
%sub = sub nsw i32 0, %cost
%cost17 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13, i32 3
store i32 %sub, ptr %cost17, align 4, !tbaa !17
%rev18 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1, i64 %idxprom13, i32 1
store i32 %0, ptr %rev18, align 4, !tbaa !18
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @minCostFlow(i32 noundef %S, i32 noundef %T, i32 noundef %F) local_unnamed_addr #2 {
entry:
%idxprom36 = sext i32 %T to i64
%arrayidx37 = getelementptr inbounds [205 x i32], ptr @dist, i64 0, i64 %idxprom36
%cmp203 = icmp sgt i32 %F, 0
br i1 %cmp203, label %enq.exit.lr.ph, label %cleanup
enq.exit.lr.ph: ; preds = %entry
%0 = load i32, ptr @V, align 4, !tbaa !5
%shl = shl i32 %0, 2
%conv = sext i32 %shl to i64
%idxprom = sext i32 %S to i64
%arrayidx = getelementptr inbounds [205 x i32], ptr @dist, i64 0, i64 %idxprom
%cmp43196 = icmp sgt i32 %0, 0
%cmp55.not198 = icmp eq i32 %T, %S
%arrayidx78 = getelementptr inbounds [205 x i32], ptr @potential, i64 0, i64 %idxprom36
%wide.trip.count215 = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
%n.vec = and i64 %wide.trip.count215, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count215
br label %while.body2.preheader
while.cond.loopexit: ; preds = %for.body83, %for.end75
%cmp = icmp sgt i32 %sub76, 0
br i1 %cmp, label %while.body2.preheader, label %cleanup.sink.split, !llvm.loop !19
while.body2.preheader: ; preds = %while.cond.loopexit, %enq.exit.lr.ph
%ret.0205 = phi i32 [ 0, %enq.exit.lr.ph ], [ %add79, %while.cond.loopexit ]
%F.addr.0204 = phi i32 [ %F, %enq.exit.lr.ph ], [ %sub76, %while.cond.loopexit ]
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @dist, i8 16, i64 %conv, i1 false)
store i32 %S, ptr getelementptr inbounds ([10000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !11
store i32 0, ptr @que, align 16, !tbaa !9
store i32 0, ptr %arrayidx, align 4, !tbaa !5
br label %while.body2
while.body2: ; preds = %while.body2.preheader, %while.cond1.backedge
%qsize.promoted188192 = phi i32 [ %inc.i162193, %while.cond1.backedge ], [ 1, %while.body2.preheader ]
%1 = load i32, ptr getelementptr inbounds ([10000 x %struct.QUE], ptr @que, i64 0, i64 0, i32 1), align 4, !tbaa !11
%2 = load i32, ptr @que, align 16, !tbaa !9
%dec.i = add nsw i32 %qsize.promoted188192, -1
%idxprom.i160 = sext i32 %dec.i to i64
%arrayidx.i161 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i160
%3 = load i64, ptr %arrayidx.i161, align 8
store i64 %3, ptr @que, align 16
%4 = trunc i64 %3 to i32
br label %tailrecurse.i.i
tailrecurse.i.i: ; preds = %if.then18.i.i, %while.body2
%i.tr.i.i = phi i32 [ 0, %while.body2 ], [ %min.1.i.i, %if.then18.i.i ]
%shl.i.i = shl i32 %i.tr.i.i, 1
%add.i.i = or i32 %shl.i.i, 1
%cmp.i.i = icmp slt i32 %shl.i.i, %dec.i
br i1 %cmp.i.i, label %land.lhs.true.i.i, label %if.else.i.i
land.lhs.true.i.i: ; preds = %tailrecurse.i.i
%idxprom.i.i = sext i32 %shl.i.i to i64
%arrayidx.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i.i
%5 = load i32, ptr %arrayidx.i.i, align 16, !tbaa !9
%cmp5.i.i = icmp slt i32 %5, %4
br i1 %cmp5.i.i, label %if.end.i.i, label %if.else.i.i
if.else.i.i: ; preds = %land.lhs.true.i.i, %tailrecurse.i.i
br label %if.end.i.i
if.end.i.i: ; preds = %if.else.i.i, %land.lhs.true.i.i
%min.0.i.i = phi i32 [ %i.tr.i.i, %if.else.i.i ], [ %shl.i.i, %land.lhs.true.i.i ]
%cmp6.i.i = icmp slt i32 %add.i.i, %dec.i
br i1 %cmp6.i.i, label %land.lhs.true7.i.i, label %if.end16.i.i
land.lhs.true7.i.i: ; preds = %if.end.i.i
%idxprom8.i.i = sext i32 %add.i.i to i64
%arrayidx9.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i.i
%6 = load i32, ptr %arrayidx9.i.i, align 8, !tbaa !9
%idxprom11.i.i = sext i32 %min.0.i.i to i64
%arrayidx12.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom11.i.i
%7 = load i32, ptr %arrayidx12.i.i, align 8, !tbaa !9
%cmp14.i.i = icmp slt i32 %6, %7
%spec.select.i.i = select i1 %cmp14.i.i, i32 %add.i.i, i32 %min.0.i.i
br label %if.end16.i.i
if.end16.i.i: ; preds = %land.lhs.true7.i.i, %if.end.i.i
%min.1.i.i = phi i32 [ %min.0.i.i, %if.end.i.i ], [ %spec.select.i.i, %land.lhs.true7.i.i ]
%cmp17.not.i.i = icmp eq i32 %min.1.i.i, %i.tr.i.i
br i1 %cmp17.not.i.i, label %deq.exit, label %if.then18.i.i
if.then18.i.i: ; preds = %if.end16.i.i
%idxprom19.i.i = sext i32 %i.tr.i.i to i64
%arrayidx20.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom19.i.i
%idxprom23.i.i = sext i32 %min.1.i.i to i64
%arrayidx24.i.i = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom23.i.i
%8 = load i64, ptr %arrayidx24.i.i, align 8
store i64 %8, ptr %arrayidx20.i.i, align 8
store i64 %3, ptr %arrayidx24.i.i, align 8
br label %tailrecurse.i.i
deq.exit: ; preds = %if.end16.i.i
%idxprom3 = sext i32 %1 to i64
%arrayidx4 = getelementptr inbounds [205 x i32], ptr @dist, i64 0, i64 %idxprom3
%9 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp slt i32 %9, %2
br i1 %cmp5, label %while.cond1.backedge, label %for.cond.preheader
while.cond1.backedge: ; preds = %for.inc, %for.cond.preheader, %deq.exit
%inc.i162193 = phi i32 [ %dec.i, %deq.exit ], [ %dec.i, %for.cond.preheader ], [ %inc.i162182, %for.inc ]
%tobool.not = icmp eq i32 %inc.i162193, 0
br i1 %tobool.not, label %while.end, label %while.body2, !llvm.loop !20
for.cond.preheader: ; preds = %deq.exit
%arrayidx8 = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %idxprom3
%10 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9184 = icmp sgt i32 %10, 0
br i1 %cmp9184, label %for.body.lr.ph, label %while.cond1.backedge, !llvm.loop !20
for.body.lr.ph: ; preds = %for.cond.preheader
%arrayidx22 = getelementptr inbounds [205 x i32], ptr @potential, i64 0, i64 %idxprom3
%wide.trip.count = zext i32 %10 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%inc.i162183185 = phi i32 [ %dec.i, %for.body.lr.ph ], [ %inc.i162182, %for.inc ]
%cap = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom3, i64 %indvars.iv, i32 2
%11 = load i32, ptr %cap, align 8, !tbaa !16
%cmp15 = icmp slt i32 %11, 1
br i1 %cmp15, label %for.inc, label %if.end18
if.end18: ; preds = %for.body
%arrayidx14 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom3, i64 %indvars.iv
%12 = load i32, ptr %arrayidx14, align 16, !tbaa !14
%cost = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom3, i64 %indvars.iv, i32 3
%13 = load i32, ptr %cost, align 4, !tbaa !17
%add = add nsw i32 %13, %2
%idxprom19 = sext i32 %12 to i64
%arrayidx20 = getelementptr inbounds [205 x i32], ptr @potential, i64 0, i64 %idxprom19
%14 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%sub = sub i32 %add, %14
%15 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%add23 = add nsw i32 %sub, %15
%arrayidx25 = getelementptr inbounds [205 x i32], ptr @dist, i64 0, i64 %idxprom19
%16 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26 = icmp sgt i32 %16, %add23
br i1 %cmp26, label %if.then28, label %for.inc
if.then28: ; preds = %if.end18
store i32 %add23, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx32 = getelementptr inbounds [205 x i32], ptr @prevv, i64 0, i64 %idxprom19
store i32 %1, ptr %arrayidx32, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds [205 x i32], ptr @preve, i64 0, i64 %idxprom19
%17 = trunc i64 %indvars.iv to i32
store i32 %17, ptr %arrayidx34, align 4, !tbaa !5
%inc.i162 = add nsw i32 %inc.i162183185, 1
%idxprom.i163 = sext i32 %inc.i162183185 to i64
%arrayidx.i164 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i163
%s1.i165 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom.i163, i32 1
store i32 %12, ptr %s1.i165, align 4, !tbaa !11
store i32 %add23, ptr %arrayidx.i164, align 8, !tbaa !9
%cmp28.i166 = icmp sgt i32 %inc.i162183185, 0
br i1 %cmp28.i166, label %land.rhs.preheader.i167, label %for.inc
land.rhs.preheader.i167: ; preds = %if.then28
%idxprom8.phi.trans.insert.i168 = zext i32 %inc.i162183185 to i64
%arrayidx9.phi.trans.insert.i169 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.phi.trans.insert.i168
%.pre.i170 = load i32, ptr %arrayidx9.phi.trans.insert.i169, align 8, !tbaa !9
br label %land.rhs.i171
land.rhs.i171: ; preds = %while.body.i177, %land.rhs.preheader.i167
%18 = phi i32 [ %22, %while.body.i177 ], [ %.pre.i170, %land.rhs.preheader.i167 ]
%i.029.i172 = phi i32 [ %shr.i173, %while.body.i177 ], [ %inc.i162183185, %land.rhs.preheader.i167 ]
%shr.i173 = lshr i32 %i.029.i172, 1
%idxprom5.i174 = zext i32 %shr.i173 to i64
%arrayidx6.i175 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom5.i174
%19 = load i32, ptr %arrayidx6.i175, align 8, !tbaa !9
%cmp11.i176 = icmp sgt i32 %19, %18
br i1 %cmp11.i176, label %while.body.i177, label %for.inc
while.body.i177: ; preds = %land.rhs.i171
%idxprom8.i178 = zext i32 %i.029.i172 to i64
%arrayidx9.i179 = getelementptr inbounds [10000 x %struct.QUE], ptr @que, i64 0, i64 %idxprom8.i178
%20 = load i64, ptr %arrayidx9.i179, align 8
%21 = load i64, ptr %arrayidx6.i175, align 8
store i64 %21, ptr %arrayidx9.i179, align 8
store i64 %20, ptr %arrayidx6.i175, align 8
%cmp.not.i180 = icmp ult i32 %i.029.i172, 2
%22 = trunc i64 %20 to i32
br i1 %cmp.not.i180, label %for.inc, label %land.rhs.i171, !llvm.loop !12
for.inc: ; preds = %while.body.i177, %land.rhs.i171, %if.then28, %if.end18, %for.body
%inc.i162182 = phi i32 [ %inc.i162, %if.then28 ], [ %inc.i162183185, %if.end18 ], [ %inc.i162183185, %for.body ], [ %inc.i162, %land.rhs.i171 ], [ %inc.i162, %while.body.i177 ]
%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 %while.cond1.backedge, label %for.body, !llvm.loop !21
while.end: ; preds = %while.cond1.backedge
%23 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%cmp38 = icmp eq i32 %23, 269488144
br i1 %cmp38, label %cleanup.sink.split, label %for.cond42.preheader
for.cond42.preheader: ; preds = %while.end
br i1 %cmp43196, label %for.body45.preheader, label %for.cond54.preheader
for.body45.preheader: ; preds = %for.cond42.preheader
br i1 %min.iters.check, label %for.body45.preheader236, label %vector.body
vector.body: ; preds = %for.body45.preheader, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.body45.preheader ]
%24 = getelementptr inbounds [205 x i32], ptr @dist, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %24, align 16, !tbaa !5
%25 = getelementptr inbounds i32, ptr %24, i64 4
%wide.load233 = load <4 x i32>, ptr %25, align 16, !tbaa !5
%26 = getelementptr inbounds [205 x i32], ptr @potential, i64 0, i64 %index
%wide.load234 = load <4 x i32>, ptr %26, align 16, !tbaa !5
%27 = getelementptr inbounds i32, ptr %26, i64 4
%wide.load235 = load <4 x i32>, ptr %27, align 16, !tbaa !5
%28 = add nsw <4 x i32> %wide.load234, %wide.load
%29 = add nsw <4 x i32> %wide.load235, %wide.load233
store <4 x i32> %28, ptr %26, align 16, !tbaa !5
store <4 x i32> %29, ptr %27, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%30 = icmp eq i64 %index.next, %n.vec
br i1 %30, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond54.preheader, label %for.body45.preheader236
for.body45.preheader236: ; preds = %for.body45.preheader, %middle.block
%indvars.iv212.ph = phi i64 [ 0, %for.body45.preheader ], [ %n.vec, %middle.block ]
br label %for.body45
for.cond54.preheader: ; preds = %for.body45, %middle.block, %for.cond42.preheader
br i1 %cmp55.not198, label %while.cond.loopexit.thread, label %for.body57
while.cond.loopexit.thread: ; preds = %for.cond54.preheader
%31 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%mul219 = mul nsw i32 %31, %F.addr.0204
%add79220 = add nsw i32 %mul219, %ret.0205
br label %cleanup.sink.split
for.body45: ; preds = %for.body45.preheader236, %for.body45
%indvars.iv212 = phi i64 [ %indvars.iv.next213, %for.body45 ], [ %indvars.iv212.ph, %for.body45.preheader236 ]
%arrayidx47 = getelementptr inbounds [205 x i32], ptr @dist, i64 0, i64 %indvars.iv212
%32 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%arrayidx49 = getelementptr inbounds [205 x i32], ptr @potential, i64 0, i64 %indvars.iv212
%33 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%add50 = add nsw i32 %33, %32
store i32 %add50, ptr %arrayidx49, align 4, !tbaa !5
%indvars.iv.next213 = add nuw nsw i64 %indvars.iv212, 1
%exitcond216.not = icmp eq i64 %indvars.iv.next213, %wide.trip.count215
br i1 %exitcond216.not, label %for.cond54.preheader, label %for.body45, !llvm.loop !25
for.body57: ; preds = %for.cond54.preheader, %for.body57
%t.0200 = phi i32 [ %spec.select, %for.body57 ], [ %F.addr.0204, %for.cond54.preheader ]
%v.1199 = phi i32 [ %34, %for.body57 ], [ %T, %for.cond54.preheader ]
%idxprom58 = sext i32 %v.1199 to i64
%arrayidx59 = getelementptr inbounds [205 x i32], ptr @prevv, i64 0, i64 %idxprom58
%34 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%idxprom60 = sext i32 %34 to i64
%arrayidx63 = getelementptr inbounds [205 x i32], ptr @preve, i64 0, i64 %idxprom58
%35 = load i32, ptr %arrayidx63, align 4, !tbaa !5
%idxprom64 = sext i32 %35 to i64
%cap66 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom60, i64 %idxprom64, i32 2
%36 = load i32, ptr %cap66, align 8, !tbaa !16
%spec.select = tail call i32 @llvm.smin.i32(i32 %t.0200, i32 %36)
%cmp55.not = icmp eq i32 %34, %S
br i1 %cmp55.not, label %for.end75, label %for.body57, !llvm.loop !26
for.end75: ; preds = %for.body57
%sub76 = sub nsw i32 %F.addr.0204, %spec.select
%37 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%mul = mul nsw i32 %37, %spec.select
%add79 = add nsw i32 %mul, %ret.0205
br i1 %cmp55.not198, label %while.cond.loopexit, label %for.body83
for.body83: ; preds = %for.end75, %for.body83
%v.2202 = phi i32 [ %38, %for.body83 ], [ %T, %for.end75 ]
%idxprom84 = sext i32 %v.2202 to i64
%arrayidx85 = getelementptr inbounds [205 x i32], ptr @prevv, i64 0, i64 %idxprom84
%38 = load i32, ptr %arrayidx85, align 4, !tbaa !5
%idxprom86 = sext i32 %38 to i64
%arrayidx89 = getelementptr inbounds [205 x i32], ptr @preve, i64 0, i64 %idxprom84
%39 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%idxprom90 = sext i32 %39 to i64
%cap92 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom86, i64 %idxprom90, i32 2
%40 = load i32, ptr %cap92, align 8, !tbaa !16
%sub93 = sub nsw i32 %40, %spec.select
store i32 %sub93, ptr %cap92, align 8, !tbaa !16
%rev = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom86, i64 %idxprom90, i32 1
%41 = load i32, ptr %rev, align 4, !tbaa !18
%idxprom96 = sext i32 %41 to i64
%cap98 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom84, i64 %idxprom96, i32 2
%42 = load i32, ptr %cap98, align 8, !tbaa !16
%add99 = add nsw i32 %42, %spec.select
store i32 %add99, ptr %cap98, align 8, !tbaa !16
%cmp81.not = icmp eq i32 %38, %S
br i1 %cmp81.not, label %while.cond.loopexit, label %for.body83, !llvm.loop !27
cleanup.sink.split: ; preds = %while.end, %while.cond.loopexit, %while.cond.loopexit.thread
%retval.0.ph = phi i32 [ %add79220, %while.cond.loopexit.thread ], [ %add79, %while.cond.loopexit ], [ -1, %while.end ]
store i32 0, ptr @qsize, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %entry
%retval.0 = phi i32 [ 0, %entry ], [ %retval.0.ph, %cleanup.sink.split ]
ret i32 %retval.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: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !28
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !30
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !34
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !35
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #8
%.pre14.pre = load ptr, ptr @stdin, align 8, !tbaa !28
br label %do.body.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !30
%3 = load i8, ptr %1, align 1, !tbaa !36
%conv3.i = zext i8 %3 to i32
br label %do.body.preheader
do.body.preheader: ; preds = %cond.true.i, %cond.false.i
%.ph = phi ptr [ %0, %cond.false.i ], [ %.pre14.pre, %cond.true.i ]
%c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit13
%4 = phi ptr [ %8, %getchar_unlocked.exit13 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add, %getchar_unlocked.exit13 ], [ 0, %do.body.preheader ]
%c.0 = phi i32 [ %cond.i9, %getchar_unlocked.exit13 ], [ %c.0.ph, %do.body.preheader ]
%mul = mul nsw i32 %n.0, 10
%and = and i32 %c.0, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4, align 8, !tbaa !30
%_IO_read_end.i5 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5, align 8, !tbaa !34
%cmp.not.i6 = icmp ult ptr %5, %6
br i1 %cmp.not.i6, label %cond.false.i10, label %cond.true.i7, !prof !35
cond.true.i7: ; preds = %do.body
%call.i8 = tail call i32 @__uflow(ptr noundef nonnull %4) #8
%.pre = load ptr, ptr @stdin, align 8, !tbaa !28
br label %getchar_unlocked.exit13
cond.false.i10: ; preds = %do.body
%incdec.ptr.i11 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11, ptr %_IO_read_ptr.i4, align 8, !tbaa !30
%7 = load i8, ptr %5, align 1, !tbaa !36
%conv3.i12 = zext i8 %7 to i32
br label %getchar_unlocked.exit13
getchar_unlocked.exit13: ; preds = %cond.true.i7, %cond.false.i10
%8 = phi ptr [ %.pre, %cond.true.i7 ], [ %4, %cond.false.i10 ]
%cond.i9 = phi i32 [ %call.i8, %cond.true.i7 ], [ %conv3.i12, %cond.false.i10 ]
%cmp = icmp sgt i32 %cond.i9, 47
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !37
do.end: ; preds = %getchar_unlocked.exit13
ret i32 %add
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !28
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !30
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !34
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !35
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #8
%.pre14.pre.i = load ptr, ptr @stdin, align 8, !tbaa !28
br label %do.body.i.preheader
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !30
%3 = load i8, ptr %1, align 1, !tbaa !36
%conv3.i.i = zext i8 %3 to i32
br label %do.body.i.preheader
do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i
%.ph165 = phi ptr [ %0, %cond.false.i.i ], [ %.pre14.pre.i, %cond.true.i.i ]
%c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit13.i
%4 = phi ptr [ %8, %getchar_unlocked.exit13.i ], [ %.ph165, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit13.i ], [ 0, %do.body.i.preheader ]
%c.0.i = phi i32 [ %cond.i9.i, %getchar_unlocked.exit13.i ], [ %c.0.i.ph, %do.body.i.preheader ]
%mul.i = mul nsw i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add nsw i32 %and.i, %mul.i
%_IO_read_ptr.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !30
%_IO_read_end.i5.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5.i, align 8, !tbaa !34
%cmp.not.i6.i = icmp ult ptr %5, %6
br i1 %cmp.not.i6.i, label %cond.false.i10.i, label %cond.true.i7.i, !prof !35
cond.true.i7.i: ; preds = %do.body.i
%call.i8.i = tail call i32 @__uflow(ptr noundef nonnull %4) #8
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !28
br label %getchar_unlocked.exit13.i
cond.false.i10.i: ; preds = %do.body.i
%incdec.ptr.i11.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11.i, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !30
%7 = load i8, ptr %5, align 1, !tbaa !36
%conv3.i12.i = zext i8 %7 to i32
br label %getchar_unlocked.exit13.i
getchar_unlocked.exit13.i: ; preds = %cond.false.i10.i, %cond.true.i7.i
%8 = phi ptr [ %.pre.i, %cond.true.i7.i ], [ %4, %cond.false.i10.i ]
%cond.i9.i = phi i32 [ %call.i8.i, %cond.true.i7.i ], [ %conv3.i12.i, %cond.false.i10.i ]
%cmp.i = icmp sgt i32 %cond.i9.i, 47
br i1 %cmp.i, label %do.body.i, label %in.exit, !llvm.loop !37
in.exit: ; preds = %getchar_unlocked.exit13.i
%shl = shl i32 %add.i, 1
%add = or i32 %shl, 1
%add1 = add i32 %shl, 2
store i32 %add1, ptr @V, align 4, !tbaa !5
%cmp142 = icmp sgt i32 %add.i, 0
br i1 %cmp142, label %for.body.lr.ph, label %for.end25
for.body.lr.ph: ; preds = %in.exit
%idxprom.i = sext i32 %shl to i64
%arrayidx.i = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %idxprom.i
%idxprom1.i125 = sext i32 %add to i64
%arrayidx2.i126 = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %idxprom1.i125
%9 = zext i32 %add.i to i64
%wide.trip.count160 = zext i32 %add.i to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.end21
%10 = phi ptr [ %8, %for.body.lr.ph ], [ %22, %for.end21 ]
%indvars.iv156 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next157, %for.end21 ]
%11 = load i32, ptr %arrayidx.i, align 8, !tbaa !5
%inc.i = add nsw i32 %11, 1
store i32 %inc.i, ptr %arrayidx.i, align 8, !tbaa !5
%arrayidx2.i = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %indvars.iv156
%12 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%inc3.i = add nsw i32 %12, 1
store i32 %inc3.i, ptr %arrayidx2.i, align 4, !tbaa !5
%idxprom6.i = sext i32 %11 to i64
%arrayidx7.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i
%13 = trunc i64 %indvars.iv156 to i32
store i32 %13, ptr %arrayidx7.i, align 16, !tbaa !14
%cap9.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i, i32 2
store i32 1, ptr %cap9.i, align 8, !tbaa !16
%cost10.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i, i32 3
store i32 0, ptr %cost10.i, align 4, !tbaa !17
%rev.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom.i, i64 %idxprom6.i, i32 1
store i32 %12, ptr %rev.i, align 4, !tbaa !18
%idxprom13.i = sext i32 %12 to i64
%arrayidx14.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom13.i
store i32 %shl, ptr %arrayidx14.i, align 16, !tbaa !14
%cap16.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom13.i, i32 2
store i32 0, ptr %cap16.i, align 8, !tbaa !16
%cost17.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom13.i, i32 3
store i32 0, ptr %cost17.i, align 4, !tbaa !17
%rev18.i = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom13.i, i32 1
store i32 %11, ptr %rev18.i, align 4, !tbaa !18
%_IO_read_ptr.i.i58 = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i.i58, align 8, !tbaa !30
%_IO_read_end.i.i59 = getelementptr inbounds %struct._IO_FILE, ptr %10, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i.i59, align 8, !tbaa !34
%cmp.not.i.i60 = icmp ult ptr %14, %15
br i1 %cmp.not.i.i60, label %cond.false.i.i85, label %cond.true.i.i61, !prof !35
cond.true.i.i61: ; preds = %for.body
%call.i.i62 = tail call i32 @__uflow(ptr noundef nonnull %10) #8
%.pre14.pre.i63 = load ptr, ptr @stdin, align 8, !tbaa !28
br label %do.body.i67.preheader
cond.false.i.i85: ; preds = %for.body
%incdec.ptr.i.i86 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i.i86, ptr %_IO_read_ptr.i.i58, align 8, !tbaa !30
%16 = load i8, ptr %14, align 1, !tbaa !36
%conv3.i.i87 = zext i8 %16 to i32
br label %do.body.i67.preheader
do.body.i67.preheader: ; preds = %cond.false.i.i85, %cond.true.i.i61
%.ph164 = phi ptr [ %10, %cond.false.i.i85 ], [ %.pre14.pre.i63, %cond.true.i.i61 ]
%c.0.i69.ph = phi i32 [ %conv3.i.i87, %cond.false.i.i85 ], [ %call.i.i62, %cond.true.i.i61 ]
br label %do.body.i67
do.body.i67: ; preds = %do.body.i67.preheader, %getchar_unlocked.exit13.i79
%17 = phi ptr [ %22, %getchar_unlocked.exit13.i79 ], [ %.ph164, %do.body.i67.preheader ]
%18 = phi ptr [ %23, %getchar_unlocked.exit13.i79 ], [ %.ph164, %do.body.i67.preheader ]
%n.0.i68 = phi i32 [ %add.i72, %getchar_unlocked.exit13.i79 ], [ 0, %do.body.i67.preheader ]
%c.0.i69 = phi i32 [ %cond.i9.i80, %getchar_unlocked.exit13.i79 ], [ %c.0.i69.ph, %do.body.i67.preheader ]
%mul.i70 = mul nsw i32 %n.0.i68, 10
%and.i71 = and i32 %c.0.i69, 15
%add.i72 = add nsw i32 %and.i71, %mul.i70
%_IO_read_ptr.i4.i73 = getelementptr inbounds %struct._IO_FILE, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %_IO_read_ptr.i4.i73, align 8, !tbaa !30
%_IO_read_end.i5.i74 = getelementptr inbounds %struct._IO_FILE, ptr %18, i64 0, i32 2
%20 = load ptr, ptr %_IO_read_end.i5.i74, align 8, !tbaa !34
%cmp.not.i6.i75 = icmp ult ptr %19, %20
br i1 %cmp.not.i6.i75, label %cond.false.i10.i82, label %cond.true.i7.i76, !prof !35
cond.true.i7.i76: ; preds = %do.body.i67
%call.i8.i77 = tail call i32 @__uflow(ptr noundef nonnull %18) #8
%.pre.i78 = load ptr, ptr @stdin, align 8, !tbaa !28
br label %getchar_unlocked.exit13.i79
cond.false.i10.i82: ; preds = %do.body.i67
%incdec.ptr.i11.i83 = getelementptr inbounds i8, ptr %19, i64 1
store ptr %incdec.ptr.i11.i83, ptr %_IO_read_ptr.i4.i73, align 8, !tbaa !30
%21 = load i8, ptr %19, align 1, !tbaa !36
%conv3.i12.i84 = zext i8 %21 to i32
br label %getchar_unlocked.exit13.i79
getchar_unlocked.exit13.i79: ; preds = %cond.false.i10.i82, %cond.true.i7.i76
%22 = phi ptr [ %.pre.i78, %cond.true.i7.i76 ], [ %17, %cond.false.i10.i82 ]
%23 = phi ptr [ %.pre.i78, %cond.true.i7.i76 ], [ %18, %cond.false.i10.i82 ]
%cond.i9.i80 = phi i32 [ %call.i8.i77, %cond.true.i7.i76 ], [ %conv3.i12.i84, %cond.false.i10.i82 ]
%cmp.i81 = icmp sgt i32 %cond.i9.i80, 47
br i1 %cmp.i81, label %do.body.i67, label %for.cond3.preheader, !llvm.loop !37
for.cond3.preheader: ; preds = %getchar_unlocked.exit13.i79
%cmp4138.not = icmp eq i64 %indvars.iv156, 0
br i1 %cmp4138.not, label %for.cond9.preheader, label %for.body5.preheader
for.body5.preheader: ; preds = %for.cond3.preheader
%24 = zext i32 %add.i72 to i64
%25 = zext i32 %add.i72 to i64
br label %for.body5
for.cond9.preheader: ; preds = %for.inc, %for.cond3.preheader
%cmp10140 = icmp sgt i32 %add.i, %13
br i1 %cmp10140, label %for.body11.preheader, label %for.end21
for.body11.preheader: ; preds = %for.cond9.preheader
%26 = and i64 %indvars.iv156, 4294967295
%27 = zext i32 %add.i72 to i64
%28 = zext i32 %add.i72 to i64
br label %for.body11
for.body5: ; preds = %for.body5.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp7.not = icmp eq i64 %indvars.iv.next, %24
br i1 %cmp7.not, label %for.inc, label %if.then
if.then: ; preds = %for.body5
%29 = add nuw nsw i64 %indvars.iv, %9
%30 = sub nsw i64 %indvars.iv156, %indvars.iv
%31 = mul i64 %30, %25
%32 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%inc.i91 = add nsw i32 %32, 1
store i32 %inc.i91, ptr %arrayidx2.i, align 4, !tbaa !5
%arrayidx2.i93 = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %29
%33 = load i32, ptr %arrayidx2.i93, align 4, !tbaa !5
%inc3.i94 = add nsw i32 %33, 1
store i32 %inc3.i94, ptr %arrayidx2.i93, align 4, !tbaa !5
%idxprom6.i95 = sext i32 %32 to i64
%arrayidx7.i96 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i95
%34 = trunc i64 %29 to i32
store i32 %34, ptr %arrayidx7.i96, align 16, !tbaa !14
%cap9.i97 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i95, i32 2
store i32 1, ptr %cap9.i97, align 8, !tbaa !16
%cost10.i98 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i95, i32 3
%35 = trunc i64 %31 to i32
store i32 %35, ptr %cost10.i98, align 4, !tbaa !17
%rev.i99 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i95, i32 1
store i32 %33, ptr %rev.i99, align 4, !tbaa !18
%idxprom13.i100 = sext i32 %33 to i64
%arrayidx14.i101 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %29, i64 %idxprom13.i100
store i32 %13, ptr %arrayidx14.i101, align 16, !tbaa !14
%cap16.i102 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %29, i64 %idxprom13.i100, i32 2
store i32 0, ptr %cap16.i102, align 8, !tbaa !16
%cost17.i103 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %29, i64 %idxprom13.i100, i32 3
%36 = trunc i64 %31 to i32
%37 = sub i32 0, %36
store i32 %37, ptr %cost17.i103, align 4, !tbaa !17
%rev18.i104 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %29, i64 %idxprom13.i100, i32 1
store i32 %32, ptr %rev18.i104, align 4, !tbaa !18
br label %for.inc
for.inc: ; preds = %for.body5, %if.then
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv156
br i1 %exitcond.not, label %for.cond9.preheader, label %for.body5, !llvm.loop !38
for.body11: ; preds = %for.body11.preheader, %for.inc19
%indvars.iv149 = phi i64 [ %26, %for.body11.preheader ], [ %indvars.iv.next150, %for.inc19 ]
%indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
%cmp13.not = icmp eq i64 %indvars.iv.next150, %27
br i1 %cmp13.not, label %for.inc19, label %if.then14
if.then14: ; preds = %for.body11
%38 = add nuw nsw i64 %indvars.iv149, %9
%39 = sub nsw i64 %indvars.iv149, %indvars.iv156
%40 = mul i64 %39, %28
%41 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%inc.i107 = add nsw i32 %41, 1
store i32 %inc.i107, ptr %arrayidx2.i, align 4, !tbaa !5
%arrayidx2.i109 = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %38
%42 = load i32, ptr %arrayidx2.i109, align 4, !tbaa !5
%inc3.i110 = add nsw i32 %42, 1
store i32 %inc3.i110, ptr %arrayidx2.i109, align 4, !tbaa !5
%idxprom6.i111 = sext i32 %41 to i64
%arrayidx7.i112 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i111
%43 = trunc i64 %38 to i32
store i32 %43, ptr %arrayidx7.i112, align 16, !tbaa !14
%cap9.i113 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i111, i32 2
store i32 1, ptr %cap9.i113, align 8, !tbaa !16
%cost10.i114 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i111, i32 3
%44 = trunc i64 %40 to i32
store i32 %44, ptr %cost10.i114, align 4, !tbaa !17
%rev.i115 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %indvars.iv156, i64 %idxprom6.i111, i32 1
store i32 %42, ptr %rev.i115, align 4, !tbaa !18
%idxprom13.i116 = sext i32 %42 to i64
%arrayidx14.i117 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %38, i64 %idxprom13.i116
store i32 %13, ptr %arrayidx14.i117, align 16, !tbaa !14
%cap16.i118 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %38, i64 %idxprom13.i116, i32 2
store i32 0, ptr %cap16.i118, align 8, !tbaa !16
%cost17.i120 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %38, i64 %idxprom13.i116, i32 3
%45 = trunc i64 %40 to i32
%46 = sub i32 0, %45
store i32 %46, ptr %cost17.i120, align 4, !tbaa !17
%rev18.i121 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %38, i64 %idxprom13.i116, i32 1
store i32 %41, ptr %rev18.i121, align 4, !tbaa !18
br label %for.inc19
for.inc19: ; preds = %for.body11, %if.then14
%cmp10 = icmp ult i64 %indvars.iv.next150, %9
br i1 %cmp10, label %for.body11, label %for.end21, !llvm.loop !39
for.end21: ; preds = %for.inc19, %for.cond9.preheader
%47 = add nuw nsw i64 %indvars.iv156, %9
%arrayidx.i123 = getelementptr inbounds [205 x i32], ptr @hi, i64 0, i64 %47
%48 = load i32, ptr %arrayidx.i123, align 4, !tbaa !5
%inc.i124 = add nsw i32 %48, 1
store i32 %inc.i124, ptr %arrayidx.i123, align 4, !tbaa !5
%49 = load i32, ptr %arrayidx2.i126, align 4, !tbaa !5
%inc3.i127 = add nsw i32 %49, 1
store i32 %inc3.i127, ptr %arrayidx2.i126, align 4, !tbaa !5
%idxprom6.i128 = sext i32 %48 to i64
%arrayidx7.i129 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %47, i64 %idxprom6.i128
store i32 %add, ptr %arrayidx7.i129, align 16, !tbaa !14
%cap9.i130 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %47, i64 %idxprom6.i128, i32 2
store i32 1, ptr %cap9.i130, align 8, !tbaa !16
%cost10.i131 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %47, i64 %idxprom6.i128, i32 3
store i32 0, ptr %cost10.i131, align 4, !tbaa !17
%rev.i132 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %47, i64 %idxprom6.i128, i32 1
store i32 %49, ptr %rev.i132, align 4, !tbaa !18
%idxprom13.i133 = sext i32 %49 to i64
%arrayidx14.i134 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i125, i64 %idxprom13.i133
%50 = trunc i64 %47 to i32
store i32 %50, ptr %arrayidx14.i134, align 16, !tbaa !14
%cap16.i135 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i125, i64 %idxprom13.i133, i32 2
store i32 0, ptr %cap16.i135, align 8, !tbaa !16
%cost17.i136 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i125, i64 %idxprom13.i133, i32 3
store i32 0, ptr %cost17.i136, align 4, !tbaa !17
%rev18.i137 = getelementptr inbounds [205 x [205 x %struct.EDGE]], ptr @edge, i64 0, i64 %idxprom1.i125, i64 %idxprom13.i133, i32 1
store i32 %48, ptr %rev18.i137, align 4, !tbaa !18
%indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
%exitcond161.not = icmp eq i64 %indvars.iv.next157, %wide.trip.count160
br i1 %exitcond161.not, label %for.end25, label %for.body, !llvm.loop !40
for.end25: ; preds = %for.end21, %in.exit
%call26 = tail call i32 @minCostFlow(i32 noundef %shl, i32 noundef %add, i32 noundef %add.i)
%call27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %call26)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
declare i32 @__uflow(ptr noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !6, i64 0}
!15 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!16 = !{!15, !6, i64 8}
!17 = !{!15, !6, i64 12}
!18 = !{!15, !6, i64 4}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !13, !24, !23}
!26 = distinct !{!26, !13}
!27 = distinct !{!27, !13}
!28 = !{!29, !29, i64 0}
!29 = !{!"any pointer", !7, i64 0}
!30 = !{!31, !29, i64 8}
!31 = !{!"_IO_FILE", !6, i64 0, !29, i64 8, !29, i64 16, !29, i64 24, !29, i64 32, !29, i64 40, !29, i64 48, !29, i64 56, !29, i64 64, !29, i64 72, !29, i64 80, !29, i64 88, !29, i64 96, !29, i64 104, !6, i64 112, !6, i64 116, !32, i64 120, !33, i64 128, !7, i64 130, !7, i64 131, !29, i64 136, !32, i64 144, !29, i64 152, !29, i64 160, !29, i64 168, !29, i64 176, !32, i64 184, !6, i64 192, !7, i64 196}
!32 = !{!"long", !7, i64 0}
!33 = !{!"short", !7, i64 0}
!34 = !{!31, !29, i64 16}
!35 = !{!"branch_weights", i32 2000, i32 1}
!36 = !{!7, !7, i64 0}
!37 = distinct !{!37, !13}
!38 = distinct !{!38, !13}
!39 = distinct !{!39, !13}
!40 = distinct !{!40, !13}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<assert.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
#define charsize 100005 //10^5+5
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}
int main(void){
// char ;
ll n,m,ans=0;
scanf("%lld%lld",&n,&m);
ll x[m],y[m];
rep(i,0,m){
scanf("%lld%lld",&x[i],&y[i]);
}
ll red[n],ball[n];
red[0]=1;
rep(i,1,n) red[i]=0;
rep(i,0,n) ball[i]=1;
rep(i,0,m){
ball[y[i]-1]++;
if(red[x[i]-1]) red[y[i]-1]=1;
ball[x[i]-1]--;
if(ball[x[i]-1]==0) red[x[i]-1]=0;
// rep(j,0,n){
// printf("%lld %lld ||",ball[j],red[j]);
// }
// PN;
}
rep(i,0,n){
if(red[i]) ans++;
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270305/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270305/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sgt i64 %a, %b
%cmp1.not = icmp sgt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 {
entry:
%cmp.not = icmp slt i64 %a, %b
%cmp1.not = icmp slt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cmp3 = icmp sgt i64 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %c.04.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %c.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %c.04, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod(i64 noundef %n) local_unnamed_addr #5 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%n.nonneg = sub i64 0, %n
%0 = urem i64 %n.nonneg, 1000000007
%1 = add nsw i64 %0, %n
%mul = sub i64 1000000007, %1
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, 1000000007
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #6 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #6 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #13
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #13
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #6 {
entry:
%0 = load i64, ptr %p, align 8, !tbaa !19
%1 = load i64, ptr %q, align 8, !tbaa !19
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #6 {
entry:
%0 = load i64, ptr %q, align 8, !tbaa !19
%1 = load i64, ptr %p, align 8, !tbaa !19
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #13
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #13
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %m, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %m, align 8, !tbaa !5
%vla1 = alloca i64, i64 %2, align 16
%cmp85 = icmp sgt i64 %2, 0
br i1 %cmp85, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %2, %entry ], [ %6, %for.body ]
%3 = load i64, ptr %n, align 8, !tbaa !5
%vla4 = alloca i64, i64 %3, align 16
%vla5 = alloca i64, i64 %3, align 16
store i64 1, ptr %vla4, align 16, !tbaa !5
%cmp987 = icmp sgt i64 %3, 1
br i1 %cmp987, label %for.cond17.preheader.thread, label %for.cond17.preheader
for.cond17.preheader.thread: ; preds = %for.cond.cleanup
%scevgep = getelementptr i8, ptr %vla4, i64 8
%4 = shl i64 %3, 3
%5 = add i64 %4, -8
call void @llvm.memset.p0.i64(ptr align 8 %scevgep, i8 0, i64 %5, i1 false), !tbaa !5
br label %for.body20.preheader
for.body: ; preds = %entry, %for.body
%i.086 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.086
%arrayidx2 = getelementptr inbounds i64, ptr %vla1, i64 %i.086
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%inc = add nuw nsw i64 %i.086, 1
%6 = load i64, ptr %m, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %6
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !21
for.cond17.preheader: ; preds = %for.cond.cleanup
%cmp1889 = icmp eq i64 %3, 1
br i1 %cmp1889, label %for.body20.preheader, label %for.cond26.preheader
for.body20.preheader: ; preds = %for.cond17.preheader.thread, %for.cond17.preheader
%min.iters.check = icmp ult i64 %3, 4
br i1 %min.iters.check, label %for.body20.preheader129, label %vector.ph
vector.ph: ; preds = %for.body20.preheader
%n.vec = and i64 %3, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%7 = getelementptr inbounds i64, ptr %vla5, i64 %index
store <2 x i64> <i64 1, i64 1>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i64, ptr %7, i64 2
store <2 x i64> <i64 1, i64 1>, ptr %8, align 16, !tbaa !5
%index.next = add nuw i64 %index, 4
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %3, %n.vec
br i1 %cmp.n, label %for.cond26.preheader, label %for.body20.preheader129
for.body20.preheader129: ; preds = %for.body20.preheader, %middle.block
%i16.090.ph = phi i64 [ 0, %for.body20.preheader ], [ %n.vec, %middle.block ]
br label %for.body20
for.cond26.preheader: ; preds = %for.body20, %middle.block, %for.cond17.preheader
%cmp1889107 = phi i1 [ false, %for.cond17.preheader ], [ true, %middle.block ], [ true, %for.body20 ]
%invariant.gep = getelementptr i64, ptr %vla5, i64 -1
%invariant.gep91 = getelementptr i64, ptr %vla4, i64 -1
%cmp2797 = icmp sgt i64 %.lcssa, 0
br i1 %cmp2797, label %for.body29.preheader, label %for.cond55.preheader
for.body29.preheader: ; preds = %for.cond26.preheader
%invariant.gep110 = getelementptr i64, ptr %vla4, i64 -1
br label %for.body29
for.body20: ; preds = %for.body20.preheader129, %for.body20
%i16.090 = phi i64 [ %inc23, %for.body20 ], [ %i16.090.ph, %for.body20.preheader129 ]
%arrayidx21 = getelementptr inbounds i64, ptr %vla5, i64 %i16.090
store i64 1, ptr %arrayidx21, align 8, !tbaa !5
%inc23 = add nuw nsw i64 %i16.090, 1
%exitcond.not = icmp eq i64 %inc23, %3
br i1 %exitcond.not, label %for.cond26.preheader, label %for.body20, !llvm.loop !23
for.cond55.preheader: ; preds = %for.inc51, %for.cond26.preheader
br i1 %cmp1889107, label %for.body58.preheader, label %for.cond.cleanup57
for.body58.preheader: ; preds = %for.cond55.preheader
%min.iters.check115 = icmp ult i64 %3, 4
br i1 %min.iters.check115, label %for.body58.preheader126, label %vector.ph116
vector.ph116: ; preds = %for.body58.preheader
%n.vec118 = and i64 %3, -4
br label %vector.body121
vector.body121: ; preds = %vector.body121, %vector.ph116
%index122 = phi i64 [ 0, %vector.ph116 ], [ %index.next125, %vector.body121 ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph116 ], [ %16, %vector.body121 ]
%vec.phi123 = phi <2 x i64> [ zeroinitializer, %vector.ph116 ], [ %17, %vector.body121 ]
%10 = getelementptr inbounds i64, ptr %vla4, i64 %index122
%wide.load = load <2 x i64>, ptr %10, align 16, !tbaa !5
%11 = getelementptr inbounds i64, ptr %10, i64 2
%wide.load124 = load <2 x i64>, ptr %11, align 16, !tbaa !5
%12 = icmp ne <2 x i64> %wide.load, zeroinitializer
%13 = icmp ne <2 x i64> %wide.load124, zeroinitializer
%14 = zext <2 x i1> %12 to <2 x i64>
%15 = zext <2 x i1> %13 to <2 x i64>
%16 = add <2 x i64> %vec.phi, %14
%17 = add <2 x i64> %vec.phi123, %15
%index.next125 = add nuw i64 %index122, 4
%18 = icmp eq i64 %index.next125, %n.vec118
br i1 %18, label %middle.block113, label %vector.body121, !llvm.loop !24
middle.block113: ; preds = %vector.body121
%bin.rdx = add <2 x i64> %17, %16
%19 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n120 = icmp eq i64 %3, %n.vec118
br i1 %cmp.n120, label %for.cond.cleanup57, label %for.body58.preheader126
for.body58.preheader126: ; preds = %for.body58.preheader, %middle.block113
%i54.0101.ph = phi i64 [ 0, %for.body58.preheader ], [ %n.vec118, %middle.block113 ]
%ans.0100.ph = phi i64 [ 0, %for.body58.preheader ], [ %19, %middle.block113 ]
br label %for.body58
for.body29: ; preds = %for.body29.preheader, %for.inc51
%i25.098 = phi i64 [ %inc52, %for.inc51 ], [ 0, %for.body29.preheader ]
%arrayidx30 = getelementptr inbounds i64, ptr %vla1, i64 %i25.098
%20 = load i64, ptr %arrayidx30, align 8, !tbaa !5
%gep = getelementptr i64, ptr %invariant.gep, i64 %20
%21 = load i64, ptr %gep, align 8, !tbaa !5
%inc32 = add nsw i64 %21, 1
store i64 %inc32, ptr %gep, align 8, !tbaa !5
%arrayidx33 = getelementptr inbounds i64, ptr %vla, i64 %i25.098
%22 = load i64, ptr %arrayidx33, align 8, !tbaa !5
%gep92 = getelementptr i64, ptr %invariant.gep91, i64 %22
%23 = load i64, ptr %gep92, align 8, !tbaa !5
%tobool.not = icmp eq i64 %23, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %for.body29
%gep94 = getelementptr i64, ptr %invariant.gep91, i64 %20
store i64 1, ptr %gep94, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body29
%gep96 = getelementptr i64, ptr %invariant.gep, i64 %22
%24 = load i64, ptr %gep96, align 8, !tbaa !5
%dec = add nsw i64 %24, -1
store i64 %dec, ptr %gep96, align 8, !tbaa !5
%cmp45 = icmp eq i64 %dec, 0
br i1 %cmp45, label %if.then46, label %for.inc51
if.then46: ; preds = %if.end
%gep111 = getelementptr i64, ptr %invariant.gep110, i64 %22
store i64 0, ptr %gep111, align 8, !tbaa !5
br label %for.inc51
for.inc51: ; preds = %if.end, %if.then46
%inc52 = add nuw nsw i64 %i25.098, 1
%exitcond104.not = icmp eq i64 %inc52, %.lcssa
br i1 %exitcond104.not, label %for.cond55.preheader, label %for.body29, !llvm.loop !25
for.cond.cleanup57: ; preds = %for.body58, %middle.block113, %for.cond55.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond55.preheader ], [ %19, %middle.block113 ], [ %spec.select, %for.body58 ]
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #13
ret i32 0
for.body58: ; preds = %for.body58.preheader126, %for.body58
%i54.0101 = phi i64 [ %inc65, %for.body58 ], [ %i54.0101.ph, %for.body58.preheader126 ]
%ans.0100 = phi i64 [ %spec.select, %for.body58 ], [ %ans.0100.ph, %for.body58.preheader126 ]
%arrayidx59 = getelementptr inbounds i64, ptr %vla4, i64 %i54.0101
%25 = load i64, ptr %arrayidx59, align 8, !tbaa !5
%tobool60.not = icmp ne i64 %25, 0
%inc62 = zext i1 %tobool60.not to i64
%spec.select = add nuw nsw i64 %ans.0100, %inc62
%inc65 = add nuw nsw i64 %i54.0101, 1
%exitcond105.not = icmp eq i64 %inc65, %3
br i1 %exitcond105.not, label %for.cond.cleanup57, label %for.body58, !llvm.loop !26
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #10
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #11
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !6, i64 8}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !11, !12}
!23 = distinct !{!23, !10, !12, !11}
!24 = distinct !{!24, !10, !11, !12}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10, !12, !11}
|
#include<stdio.h>
int main(void)
{
int n,m,a[10000],sum,i;
sum = 0;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d",&a[i]);
sum += a[i];
}
if(n<sum)
printf("-1");
else
printf("%d",n - sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270349/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270349/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-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
%a = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #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
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.013 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.013
%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.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp4 = icmp slt i32 %4, %sum.0.lcssa
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %for.end
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.end
%sub = sub nsw i32 %4, %sum.0.lcssa
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,m;
int *a;
int homework=0;
do{
scanf("%d%d",&n,&m);
}while(n<1||n>1000000||m<1||m>10000);
a=(int *)malloc(m*sizeof(int));
for(int i=0;i<m;i++){
do{
scanf("%d",&a[i]);
}while(a[i]<1||a[i]>10000);
homework+=a[i];
}
if(n-homework>=0){
printf("%d",n-homework);
}
else{
printf("%d",-1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270392/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270392/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
br label %do.body
do.body: ; preds = %do.body, %entry
%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
%1 = add i32 %0, -1000001
%or.cond = icmp ult i32 %1, -1000000
%2 = load i32, ptr %m, align 4
%cmp3 = icmp slt i32 %2, 1
%or.cond29 = select i1 %or.cond, i1 true, i1 %cmp3
%cmp4 = icmp sgt i32 %2, 10000
%or.cond30 = select i1 %or.cond29, i1 true, i1 %cmp4
br i1 %or.cond30, label %do.body, label %do.body8.preheader.preheader, !llvm.loop !5
do.body8.preheader.preheader: ; preds = %do.body
%conv = zext i32 %2 to i64
%mul = shl nuw nsw i64 %conv, 2
%call5 = call noalias ptr @malloc(i64 noundef %mul) #6
br label %do.body8.preheader
do.body8.preheader: ; preds = %do.body8.preheader.preheader, %do.end21
%indvars.iv = phi i64 [ 0, %do.body8.preheader.preheader ], [ %indvars.iv.next, %do.end21 ]
%homework.045 = phi i32 [ 0, %do.body8.preheader.preheader ], [ %add, %do.end21 ]
%arrayidx = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv
br label %do.body8
for.cond.cleanup: ; preds = %do.end21
%.pre = load i32, ptr %n, align 4, !tbaa !7
%sub = sub nsw i32 %.pre, %add
%sub. = call i32 @llvm.smax.i32(i32 %sub, i32 -1)
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.)
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
do.body8: ; preds = %do.body8.preheader, %do.body8
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !7
%4 = add i32 %3, -10001
%or.cond42 = icmp ult i32 %4, -10000
br i1 %or.cond42, label %do.body8, label %do.end21, !llvm.loop !11
do.end21: ; preds = %do.body8
%add = add nsw i32 %3, %homework.045
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %m, align 4, !tbaa !7
%6 = sext i32 %5 to i64
%cmp6 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp6, label %do.body8.preheader, label %for.cond.cleanup, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
|
#include <stdio.h>
int main(){
long n, m, a;
scanf("%ld %ld", &n, &m);
for(int i=0; i<m; i++){
scanf("%ld", &a);
n -= a;
if( n < 0 ){ printf("-1\n"); return 0; }
}
printf("%ld\n", n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270435/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270435/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
%a = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %m, align 8, !tbaa !5
%cmp.not11 = icmp sgt i64 %0, 0
br i1 %cmp.not11, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i64, ptr %n, align 8, !tbaa !5
br label %for.end
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i64, ptr %m, align 8, !tbaa !5
%cmp.not = icmp sgt i64 %1, %indvars.iv.next
br i1 %cmp.not, label %for.body, label %for.end, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%2 = load i64, ptr %a, align 8, !tbaa !5
%3 = load i64, ptr %n, align 8, !tbaa !5
%sub = sub nsw i64 %3, %2
store i64 %sub, ptr %n, align 8, !tbaa !5
%cmp3 = icmp slt i64 %sub, 0
br i1 %cmp3, label %if.then, label %for.cond
if.then: ; preds = %for.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup7
for.end: ; preds = %for.cond, %entry.for.end_crit_edge
%4 = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %sub, %for.cond ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %4)
br label %cleanup7
cleanup7: ; preds = %if.then, %for.end
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int n;
int m;
int a[10000];
int i;
int va;
int sum=0;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d ",&a[i]);
sum=sum+a[i];
}
va=n-sum;
if(va>=0)
printf("%d",va);
else
printf("%d",-1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270479/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270479/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \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
%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 4, ptr nonnull %m) #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, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.014 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.014
%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.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %4, %sum.0.lcssa
%sub. = call i32 @llvm.smax.i32(i32 %sub, i32 -1)
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub.)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n,m;
scanf("%d %d",&n,&m);
int a[m];
int i;
for(i=0;i<m;i++){
scanf("%d",&a[i]);
}
int sum=0;
for(i=0;i<m;i++){
sum+=a[i];
}
if(n-sum>=0){
printf("%d\n",n-sum);
}else{
printf("-1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270521/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270521/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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 %m, 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 %m, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %3, 0
br i1 %cmp21, label %for.body, label %for.end9
for.cond2.preheader: ; preds = %for.body
%cmp323 = icmp sgt i32 %10, 0
br i1 %cmp323, label %for.body4.preheader, label %for.end9
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %10 to i64
%min.iters.check = icmp ult i32 %10, 8
br i1 %min.iters.check, label %for.body4.preheader36, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi34 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%4 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load35 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load35, %vec.phi34
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = 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.end9, label %for.body4.preheader36
for.body4.preheader36: ; preds = %for.body4.preheader, %middle.block
%indvars.iv29.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%sum.025.ph = phi i32 [ 0, %for.body4.preheader ], [ %9, %middle.block ]
br label %for.body4
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
%10 = load i32, ptr %m, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader36, %for.body4
%indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body4 ], [ %indvars.iv29.ph, %for.body4.preheader36 ]
%sum.025 = phi i32 [ %add, %for.body4 ], [ %sum.025.ph, %for.body4.preheader36 ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv29
%12 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %12, %sum.025
%indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1
%exitcond.not = icmp eq i64 %indvars.iv.next30, %wide.trip.count
br i1 %exitcond.not, label %for.end9, label %for.body4, !llvm.loop !14
for.end9: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body4 ]
%13 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %13, %sum.0.lcssa
%cmp10 = icmp sgt i32 %sub, -1
br i1 %cmp10, label %if.then, label %if.else
if.then: ; preds = %for.end9
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.end9
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(void)
{
int n, m;
scanf("%d %d", &n, &m);
int a[m];
int i;
for(i=0; i<m; i++){
scanf("%d", &a[i]);
}
for(i=0; i<m; i++){
n = n - a[i];
}
if(n<0){
printf("-1\n");
}else{
printf("%d\n", n);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270565/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270565/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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 %m, 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 %m, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %3, 0
br i1 %cmp18, label %for.body, label %for.cond2.preheader.thread
for.cond2.preheader.thread: ; preds = %entry
%n.promoted30 = load i32, ptr %n, align 4, !tbaa !5
br label %for.end9
for.cond2.preheader: ; preds = %for.body
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
%cmp321 = icmp sgt i32 %11, 0
br i1 %cmp321, label %for.body4.preheader, label %for.end9
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %11 to i64
%min.iters.check = icmp ult i32 %11, 8
br i1 %min.iters.check, label %for.body4.preheader34, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%4 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %n.promoted, 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> [ %4, %vector.ph ], [ %7, %vector.body ]
%vec.phi32 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%5 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load33 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = sub <4 x i32> %vec.phi, %wide.load
%8 = sub <4 x i32> %vec.phi32, %wide.load33
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = 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.cond2.for.end9_crit_edge, label %for.body4.preheader34
for.body4.preheader34: ; preds = %for.body4.preheader, %middle.block
%indvars.iv26.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%sub2022.ph = phi i32 [ %n.promoted, %for.body4.preheader ], [ %10, %middle.block ]
br label %for.body4
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
%11 = load i32, ptr %m, 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.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader34, %for.body4
%indvars.iv26 = phi i64 [ %indvars.iv.next27, %for.body4 ], [ %indvars.iv26.ph, %for.body4.preheader34 ]
%sub2022 = phi i32 [ %sub, %for.body4 ], [ %sub2022.ph, %for.body4.preheader34 ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv26
%13 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub = sub nsw i32 %sub2022, %13
%indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1
%exitcond.not = icmp eq i64 %indvars.iv.next27, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.for.end9_crit_edge, label %for.body4, !llvm.loop !14
for.cond2.for.end9_crit_edge: ; preds = %for.body4, %middle.block
%sub.lcssa = phi i32 [ %10, %middle.block ], [ %sub, %for.body4 ]
store i32 %sub.lcssa, ptr %n, align 4, !tbaa !5
br label %for.end9
for.end9: ; preds = %for.cond2.preheader.thread, %for.cond2.for.end9_crit_edge, %for.cond2.preheader
%14 = phi i32 [ %sub.lcssa, %for.cond2.for.end9_crit_edge ], [ %n.promoted, %for.cond2.preheader ], [ %n.promoted30, %for.cond2.preheader.thread ]
%cmp10 = icmp slt i32 %14, 0
br i1 %cmp10, label %if.then, label %if.else
if.then: ; preds = %for.end9
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %for.end9
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %14)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main() {
int n;//日数
int m;//宿題数
int a[10000];//必要日数
int total = 0;//合計日数
int play = 0;//遊べる日数
scanf("%d%d", &n, &m);
for (int i = 0; i < m; i++) {
scanf("%d", &a[i]);
}
for (int j = 0; j < m; j++) {
total += a[j];
}
play = n - total;
if (play < 0) {
printf("-1");
}
else printf("%d", play);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270608/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270608/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [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
%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 4, ptr nonnull %m) #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, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.cond.cleanup4
for.cond2.preheader: ; preds = %for.body
%cmp322 = icmp sgt i32 %7, 0
br i1 %cmp322, label %for.body5.preheader, label %for.cond.cleanup4
for.body5.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %7 to i64
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body5.preheader35, label %vector.ph
vector.ph: ; preds = %for.body5.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.phi33 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [10000 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.load34 = 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.load34, %vec.phi33
%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.cond.cleanup4, label %for.body5.preheader35
for.body5.preheader35: ; preds = %for.body5.preheader, %middle.block
%indvars.iv28.ph = phi i64 [ 0, %for.body5.preheader ], [ %n.vec, %middle.block ]
%total.023.ph = phi i32 [ 0, %for.body5.preheader ], [ %6, %middle.block ]
br label %for.body5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 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
%7 = load i32, ptr %m, 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.cond2.preheader, !llvm.loop !13
for.cond.cleanup4: ; preds = %for.body5, %middle.block, %entry, %for.cond2.preheader
%total.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %6, %middle.block ], [ %add, %for.body5 ]
%9 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %9, %total.0.lcssa
%cmp11 = icmp slt i32 %sub, 0
br i1 %cmp11, label %if.then, label %if.else
for.body5: ; preds = %for.body5.preheader35, %for.body5
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.body5 ], [ %indvars.iv28.ph, %for.body5.preheader35 ]
%total.023 = phi i32 [ %add, %for.body5 ], [ %total.023.ph, %for.body5.preheader35 ]
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv28
%10 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %10, %total.023
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%exitcond.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup4, label %for.body5, !llvm.loop !14
if.then: ; preds = %for.cond.cleanup4
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.cond.cleanup4
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40000, 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.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main()
{
int n,m,i,sum=0,arr;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++)
{
scanf("%d",&arr);
sum=sum+arr;
}
if(sum<=n)
{
printf("%d\n",n-sum);
}
else{
printf("-1\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270651/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270651/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%arr = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %arr) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%sum.010 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arr)
%1 = load i32, ptr %arr, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.010
%inc = add nuw nsw i32 %i.09, 1
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %sum.0.lcssa, %3
br i1 %cmp2.not, label %if.else, label %if.then
if.then: ; preds = %for.end
%sub = sub nsw i32 %3, %sum.0.lcssa
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %arr) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int a,b,c,d,e,f,g;
d=0;
scanf("%d %d",&a,&b);
for(c=0;c<b;c++){
scanf("%d",&e);
d=d+e;
}
if(d>a){
printf("-1");
}else{
printf("%d",a-d);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270695/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270695/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\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
%e = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%c.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%d.09 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e)
%1 = load i32, ptr %e, align 4, !tbaa !5
%add = add nsw i32 %1, %d.09
%inc = add nuw nsw i32 %c.010, 1
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%d.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %d.0.lcssa, %3
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.end
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.end
%sub = sub nsw i32 %3, %d.0.lcssa
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int N,M;
int A[10000];
scanf("%d %d\n", &N, &M);
int i=0;
while(scanf("%d",&A[i])==1)
{
i++;
}
int sum;
sum = 0;
for(int k=0; k<M; k++)
{
sum += A[k];
}
if(sum <= N)
{
printf("%d\n",N-sum);
}
else
{
printf("-1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270738/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270738/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\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\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%A = alloca [10000 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 40000, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%cmp = icmp eq i32 %call1, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp, label %while.cond, label %for.cond.preheader, !llvm.loop !5
for.cond.preheader: ; preds = %while.cond
%0 = load i32, ptr %M, align 4, !tbaa !7
%cmp214 = icmp sgt i32 %0, 0
br i1 %cmp214, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader23, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi21 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !7
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load22 = load <4 x i32>, ptr %2, align 16, !tbaa !7
%3 = add <4 x i32> %wide.load, %vec.phi
%4 = add <4 x i32> %wide.load22, %vec.phi21
%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 !11
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.cond.cleanup, label %for.body.preheader23
for.body.preheader23: ; preds = %for.body.preheader, %middle.block
%indvars.iv18.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%sum.015.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %for.cond.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %6, %middle.block ], [ %add, %for.body ]
%7 = load i32, ptr %N, align 4, !tbaa !7
%cmp6.not = icmp sgt i32 %sum.0.lcssa, %7
br i1 %cmp6.not, label %if.else, label %if.then
for.body: ; preds = %for.body.preheader23, %for.body
%indvars.iv18 = phi i64 [ %indvars.iv.next19, %for.body ], [ %indvars.iv18.ph, %for.body.preheader23 ]
%sum.015 = phi i32 [ %add, %for.body ], [ %sum.015.ph, %for.body.preheader23 ]
%arrayidx4 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv18
%8 = load i32, ptr %arrayidx4, align 4, !tbaa !7
%add = add nsw i32 %8, %sum.015
%indvars.iv.next19 = add nuw nsw i64 %indvars.iv18, 1
%exitcond.not = icmp eq i64 %indvars.iv.next19, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14
if.then: ; preds = %for.cond.cleanup
%sub = sub nsw i32 %7, %sum.0.lcssa
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40000, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !6, !13, !12}
|
#include <stdio.h>
int main(void) {
int N, M, i, result;
int A[10001];
int sum = 0;
scanf("%d %d", &N, &M);
for (int i = 0; i < M; i++) {
scanf("%d", &A[i]);
sum = sum + A[i];
}
for (int i = 0; i < M; i++) {
result = N - sum;
}
if (result < 0) {
printf("-1");
}
else {
printf("%d", result);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270781/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270781/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-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
%A = alloca [10001 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 40004, 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 %M, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp22)
br label %for.body
for.cond6.preheader: ; preds = %for.body
%1 = icmp sgt i32 %4, 0
call void @llvm.assume(i1 %1)
%2 = load i32, ptr %N, align 4, !tbaa !5
%sub.le = sub nsw i32 %2, %add
%cmp13 = icmp slt i32 %sub.le, 0
br i1 %cmp13, label %if.then, label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.023 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %3, %sum.023
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %M, 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.cond6.preheader, !llvm.loop !9
if.then: ; preds = %for.cond6.preheader
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.cond6.preheader
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.le)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40004, 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 willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #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 willreturn memory(inaccessiblemem: 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>
int main (){
int n,m,i;
scanf ("%d%d", &n,&m);
for (i = 0; i < m; i++)
{
int x;
scanf ("%d", &x);
n -= x;
}
if (n >= 0){
printf ("%d\n", n);
} else {
printf ("-1\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270824/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270824/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%x = 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 %m, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %n, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
%inc = add nuw nsw i32 %i.07, 1
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%4 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %sub, %for.body ]
%cmp2 = icmp sgt i32 %4, -1
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.end
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4)
br label %if.end
if.else: ; preds = %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int N,M,Day;
int i;
char str[10000000];
fgets(str, sizeof(str), stdin);
N=atoi(strtok(str," "));
M=atoi(strtok(NULL," "));
fgets(str, sizeof(str), stdin);
Day=N-atoi(strtok(str," "));
for(i=1;i<M;i++){
Day-=atoi(strtok(NULL," "));
}
if(Day>=0){
printf("%d\n",Day);
}else{
printf("-1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270868/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270868/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [2 x i8] c" \00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [10000000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 10000000, ptr nonnull %str) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 10000000, ptr noundef %0)
%call2 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #5
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %call2, ptr noundef null, i32 noundef 10) #5
%conv.i = trunc i64 %call.i to i32
%call4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5
%call.i20 = call i64 @strtol(ptr nocapture noundef nonnull %call4, ptr noundef null, i32 noundef 10) #5
%conv.i21 = trunc i64 %call.i20 to i32
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call7 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 10000000, ptr noundef %1)
%call9 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #5
%call.i22 = call i64 @strtol(ptr nocapture noundef nonnull %call9, ptr noundef null, i32 noundef 10) #5
%conv.i23 = trunc i64 %call.i22 to i32
%sub = sub nsw i32 %conv.i, %conv.i23
%cmp26 = icmp sgt i32 %conv.i21, 1
br i1 %cmp26, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.028 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%Day.027 = phi i32 [ %sub13, %for.body ], [ %sub, %entry ]
%call11 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5
%call.i24 = call i64 @strtol(ptr nocapture noundef nonnull %call11, ptr noundef null, i32 noundef 10) #5
%conv.i25 = trunc i64 %call.i24 to i32
%sub13 = sub nsw i32 %Day.027, %conv.i25
%inc = add nuw nsw i32 %i.028, 1
%exitcond.not = icmp eq i32 %inc, %conv.i21
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%Day.0.lcssa = phi i32 [ %sub, %entry ], [ %sub13, %for.body ]
%cmp14 = icmp sgt i32 %Day.0.lcssa, -1
br i1 %cmp14, label %if.then, label %if.else
if.then: ; preds = %for.end
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %Day.0.lcssa)
br label %if.end
if.else: ; preds = %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 10000000, ptr nonnull %str) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) 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: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #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 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main() {
int i,n,m;
int array[10000];
int sum = 0;
scanf("%d %d",&n,&m);
for(i = 0;i < m;i++) {
scanf("%d",&array[i]);
sum += array[i];
}
if(n-sum >= 0) {
printf("%d\n",n-sum);
} else {
printf("-1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270910/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270910/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%array = 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 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %array) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %0, 0
br i1 %cmp13, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.015 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %array, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.015
%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.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %4, %sum.0.lcssa
%cmp4 = icmp sgt i32 %sub, -1
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %for.end
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %array) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 n,m,a[10000];
long long sum = 0;
int i;
scanf("%d %d", &n,&m);
for (i = 0; i < m; i++){
scanf("%d",&a[i]);
sum += a[i];
}
if(sum > n)
{
printf("-1");
}
else
{
printf("%d",n - sum);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270954/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270954/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-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
%a = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #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
%cmp15 = icmp sgt i32 %0, 0
br i1 %cmp15, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.016 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sext i32 %1 to i64
%add = add nsw i64 %sum.016, %conv
%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.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %n, align 4, !tbaa !5
%conv4 = sext i32 %4 to i64
%cmp5 = icmp sgt i64 %sum.0.lcssa, %conv4
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %for.end
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %for.end
%sub = sub nsw i64 %conv4, %sum.0.lcssa
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int i, j;
int n, m, sum, a[10000];
sum = 0;
scanf("%d%d", &n, &m);
for(i = 0; i < m; i++){
scanf("%d", &a[i]);
sum += a[i];
}
if(sum <= n){
printf("%d\n", n - sum);
}else{
printf("-1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_270998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_270998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = 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 4, ptr nonnull %m) #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, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.014 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.014
%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.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %sum.0.lcssa, %4
br i1 %cmp4.not, label %if.else, label %if.then
if.then: ; preds = %for.end
%sub = sub nsw i32 %4, %sum.0.lcssa
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end
if.else: ; preds = %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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()
{long long int t;
scanf("%lld",&t);
if(t>0 && t<=10000)
while(t--)
{long long int x;
scanf("%lld",&x);
if(x>2 && x<=1000000000)
if(x%4==0)
printf("YES\n");
else
printf("NO\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27104/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27104/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = 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:
%t = alloca i64, align 8
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8
%1 = add i64 %0, -1
%or.cond = icmp ult i64 %1, 10000
br i1 %or.cond, label %while.body.preheader, label %if.end12
while.body.preheader: ; preds = %entry
store i64 %1, ptr %t, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end11
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%2 = load i64, ptr %x, align 8
%3 = add i64 %2, -3
%or.cond13 = icmp ult i64 %3, 999999998
br i1 %or.cond13, label %if.then6, label %if.end11
if.then6: ; preds = %while.body
%rem = and i64 %2, 3
%cmp7 = icmp eq i64 %rem, 0
%str.3.str = select i1 %cmp7, ptr @str.3, ptr @str
%puts14 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
br label %if.end11
if.end11: ; preds = %if.then6, %while.body
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
%.pr = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %.pr, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %.pr, 0
br i1 %tobool.not, label %if.end12, label %while.body, !llvm.loop !9
if.end12: ; preds = %if.end11, %entry
call void @llvm.lifetime.end.p0(i64 8, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int square(int x) {
return x * x;
}
int main() {
int n, town[9][2];
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d %d", &town[i][0], &town[i][1]);
}
double ans = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
ans += sqrt( square(town[i][0] - town[j][0]) + square(town[i][1] - town[j][1]) );
}
}
ans = ans * 2 / n;
printf("%.16f", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271083/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271083/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%.16f\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @square(i32 noundef %x) local_unnamed_addr #0 {
entry:
%mul = mul nsw i32 %x, %x
ret i32 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%town = alloca [9 x [2 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %town) #5
%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.cleanup9
for.cond7.preheader: ; preds = %for.body
%cmp859 = icmp sgt i32 %1, 0
br i1 %cmp859, label %for.body10, label %for.cond.cleanup9
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv, i64 1
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %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.cond7.preheader, !llvm.loop !9
for.cond7.loopexit.loopexit: ; preds = %for.body14
%.pre = sext i32 %11 to i64
br label %for.cond7.loopexit
for.cond7.loopexit: ; preds = %for.cond7.loopexit.loopexit, %for.body10
%.pre-phi = phi i64 [ %.pre, %for.cond7.loopexit.loopexit ], [ %6, %for.body10 ]
%3 = phi i32 [ %11, %for.cond7.loopexit.loopexit ], [ %5, %for.body10 ]
%ans.1.lcssa = phi double [ %add32, %for.cond7.loopexit.loopexit ], [ %ans.060, %for.body10 ]
%cmp8 = icmp slt i64 %indvars.iv.next72, %.pre-phi
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
br i1 %cmp8, label %for.body10, label %for.cond.cleanup9.loopexit, !llvm.loop !11
for.cond.cleanup9.loopexit: ; preds = %for.cond7.loopexit
%4 = fmul double %ans.1.lcssa, 2.000000e+00
br label %for.cond.cleanup9
for.cond.cleanup9: ; preds = %entry, %for.cond.cleanup9.loopexit, %for.cond7.preheader
%ans.0.lcssa = phi double [ 0.000000e+00, %for.cond7.preheader ], [ %4, %for.cond.cleanup9.loopexit ], [ 0.000000e+00, %entry ]
%.lcssa = phi i32 [ %1, %for.cond7.preheader ], [ %3, %for.cond.cleanup9.loopexit ], [ %0, %entry ]
%conv39 = sitofp i32 %.lcssa to double
%div = fdiv double %ans.0.lcssa, %conv39
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div)
call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %town) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body10: ; preds = %for.cond7.preheader, %for.cond7.loopexit
%5 = phi i32 [ %3, %for.cond7.loopexit ], [ %1, %for.cond7.preheader ]
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.cond7.loopexit ], [ 0, %for.cond7.preheader ]
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.cond7.loopexit ], [ 1, %for.cond7.preheader ]
%ans.060 = phi double [ %ans.1.lcssa, %for.cond7.loopexit ], [ 0.000000e+00, %for.cond7.preheader ]
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%6 = sext i32 %5 to i64
%cmp1256 = icmp slt i64 %indvars.iv.next72, %6
br i1 %cmp1256, label %for.body14.lr.ph, label %for.cond7.loopexit
for.body14.lr.ph: ; preds = %for.body10
%arrayidx16 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv71
%arrayidx24 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv71, i64 1
br label %for.body14
for.body14: ; preds = %for.body14.lr.ph, %for.body14
%indvars.iv68 = phi i64 [ %indvars.iv66, %for.body14.lr.ph ], [ %indvars.iv.next69, %for.body14 ]
%ans.157 = phi double [ %ans.060, %for.body14.lr.ph ], [ %add32, %for.body14 ]
%7 = load i32, ptr %arrayidx16, align 8, !tbaa !5
%arrayidx19 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv68
%8 = load i32, ptr %arrayidx19, align 8, !tbaa !5
%sub = sub nsw i32 %7, %8
%mul.i = mul nsw i32 %sub, %sub
%9 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [9 x [2 x i32]], ptr %town, i64 0, i64 %indvars.iv68, i64 1
%10 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%sub28 = sub nsw i32 %9, %10
%mul.i53 = mul nsw i32 %sub28, %sub28
%add30 = add nuw nsw i32 %mul.i53, %mul.i
%conv = sitofp i32 %add30 to double
%call31 = call double @sqrt(double noundef %conv) #5
%add32 = fadd double %ans.157, %call31
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = trunc i64 %indvars.iv.next69 to i32
%cmp12 = icmp sgt i32 %11, %12
br i1 %cmp12, label %for.body14, label %for.cond7.loopexit.loopexit, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <math.h>
int main(void) {
int N,i,j;
scanf("%d",&N);
double A[10],B[10];
for(i=0;i<N;i++){
scanf("%lf %lf",&A[i],&B[i]);
}
double sum=0.0;
for(i=0;i<N;i++){
for(j=0;j<N;j++){
sum+=sqrt((B[i]-B[j])*(B[i]-B[j])+(A[i]-A[j])*(A[i]-A[j]));
}
}
printf("%.8lf\n",sum/(double)N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271126/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271126/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%.8lf\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 [10 x double], align 16
%B = alloca [10 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %B) #5
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp53 = icmp sgt i32 %0, 0
br i1 %cmp53, label %for.body, label %for.end36
for.cond4.preheader: ; preds = %for.body
%cmp558 = icmp sgt i32 %13, 0
br i1 %cmp558, label %for.cond7.preheader.us.preheader, label %for.end36
for.cond7.preheader.us.preheader: ; preds = %for.cond4.preheader
%wide.trip.count72 = zext i32 %13 to i64
%xtraiter = and i64 %wide.trip.count72, 1
%1 = icmp eq i32 %13, 1
%unroll_iter = and i64 %wide.trip.count72, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond7.preheader.us
for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.inc34_crit_edge.us
%indvars.iv69 = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next70, %for.cond7.for.inc34_crit_edge.us ]
%sum.060.us = phi double [ 0.000000e+00, %for.cond7.preheader.us.preheader ], [ %add.us.lcssa, %for.cond7.for.inc34_crit_edge.us ]
%arrayidx11.us = getelementptr inbounds [10 x double], ptr %B, i64 0, i64 %indvars.iv69
%2 = load double, ptr %arrayidx11.us, align 8, !tbaa !9
%arrayidx20.us = getelementptr inbounds [10 x double], ptr %A, i64 0, i64 %indvars.iv69
%3 = load double, ptr %arrayidx20.us, align 8, !tbaa !9
br i1 %1, label %for.cond7.for.inc34_crit_edge.us.unr-lcssa, label %for.body9.us
for.body9.us: ; preds = %for.cond7.preheader.us, %for.body9.us
%indvars.iv66 = phi i64 [ %indvars.iv.next67.1, %for.body9.us ], [ 0, %for.cond7.preheader.us ]
%sum.157.us = phi double [ %add.us.1, %for.body9.us ], [ %sum.060.us, %for.cond7.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body9.us ], [ 0, %for.cond7.preheader.us ]
%arrayidx13.us = getelementptr inbounds [10 x double], ptr %B, i64 0, i64 %indvars.iv66
%4 = load double, ptr %arrayidx13.us, align 16, !tbaa !9
%sub.us = fsub double %2, %4
%arrayidx22.us = getelementptr inbounds [10 x double], ptr %A, i64 0, i64 %indvars.iv66
%5 = load double, ptr %arrayidx22.us, align 16, !tbaa !9
%sub23.us = fsub double %3, %5
%mul29.us = fmul double %sub23.us, %sub23.us
%6 = call double @llvm.fmuladd.f64(double %sub.us, double %sub.us, double %mul29.us)
%sqrt.us = call double @llvm.sqrt.f64(double %6)
%add.us = fadd double %sum.157.us, %sqrt.us
%indvars.iv.next67 = or i64 %indvars.iv66, 1
%arrayidx13.us.1 = getelementptr inbounds [10 x double], ptr %B, i64 0, i64 %indvars.iv.next67
%7 = load double, ptr %arrayidx13.us.1, align 8, !tbaa !9
%sub.us.1 = fsub double %2, %7
%arrayidx22.us.1 = getelementptr inbounds [10 x double], ptr %A, i64 0, i64 %indvars.iv.next67
%8 = load double, ptr %arrayidx22.us.1, align 8, !tbaa !9
%sub23.us.1 = fsub double %3, %8
%mul29.us.1 = fmul double %sub23.us.1, %sub23.us.1
%9 = call double @llvm.fmuladd.f64(double %sub.us.1, double %sub.us.1, double %mul29.us.1)
%sqrt.us.1 = call double @llvm.sqrt.f64(double %9)
%add.us.1 = fadd double %add.us, %sqrt.us.1
%indvars.iv.next67.1 = add nuw nsw i64 %indvars.iv66, 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.cond7.for.inc34_crit_edge.us.unr-lcssa, label %for.body9.us, !llvm.loop !11
for.cond7.for.inc34_crit_edge.us.unr-lcssa: ; preds = %for.body9.us, %for.cond7.preheader.us
%add.us.lcssa.ph = phi double [ undef, %for.cond7.preheader.us ], [ %add.us.1, %for.body9.us ]
%indvars.iv66.unr = phi i64 [ 0, %for.cond7.preheader.us ], [ %indvars.iv.next67.1, %for.body9.us ]
%sum.157.us.unr = phi double [ %sum.060.us, %for.cond7.preheader.us ], [ %add.us.1, %for.body9.us ]
br i1 %lcmp.mod.not, label %for.cond7.for.inc34_crit_edge.us, label %for.body9.us.epil
for.body9.us.epil: ; preds = %for.cond7.for.inc34_crit_edge.us.unr-lcssa
%arrayidx13.us.epil = getelementptr inbounds [10 x double], ptr %B, i64 0, i64 %indvars.iv66.unr
%10 = load double, ptr %arrayidx13.us.epil, align 8, !tbaa !9
%sub.us.epil = fsub double %2, %10
%arrayidx22.us.epil = getelementptr inbounds [10 x double], ptr %A, i64 0, i64 %indvars.iv66.unr
%11 = load double, ptr %arrayidx22.us.epil, align 8, !tbaa !9
%sub23.us.epil = fsub double %3, %11
%mul29.us.epil = fmul double %sub23.us.epil, %sub23.us.epil
%12 = call double @llvm.fmuladd.f64(double %sub.us.epil, double %sub.us.epil, double %mul29.us.epil)
%sqrt.us.epil = call double @llvm.sqrt.f64(double %12)
%add.us.epil = fadd double %sum.157.us.unr, %sqrt.us.epil
br label %for.cond7.for.inc34_crit_edge.us
for.cond7.for.inc34_crit_edge.us: ; preds = %for.cond7.for.inc34_crit_edge.us.unr-lcssa, %for.body9.us.epil
%add.us.lcssa = phi double [ %add.us.lcssa.ph, %for.cond7.for.inc34_crit_edge.us.unr-lcssa ], [ %add.us.epil, %for.body9.us.epil ]
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
br i1 %exitcond73.not, label %for.end36, label %for.cond7.preheader.us, !llvm.loop !13
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10 x double], ptr %A, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [10 x double], ptr %B, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%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, !llvm.loop !14
for.end36: ; preds = %for.cond7.for.inc34_crit_edge.us, %entry, %for.cond4.preheader
%15 = phi i32 [ %13, %for.cond4.preheader ], [ %0, %entry ], [ %13, %for.cond7.for.inc34_crit_edge.us ]
%sum.0.lcssa = phi double [ 0.000000e+00, %for.cond4.preheader ], [ 0.000000e+00, %entry ], [ %add.us.lcssa, %for.cond7.for.inc34_crit_edge.us ]
%conv = sitofp i32 %15 to double
%div = fdiv double %sum.0.lcssa, %conv
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div)
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #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 speculatable willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
int main()
{
int test,i,n;
scanf("%d",&test);
for(i=0;i<test;i++){
scanf("%d",&n);
if(n>3 && n%4==0){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27117/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27117/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%test = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %test) #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 %test)
%0 = load i32, ptr %test, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, 3
%rem = and i32 %1, 3
%cmp3 = icmp eq i32 %rem, 0
%or.cond = and i1 %cmp2, %cmp3
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts7 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%inc = add nuw nsw i32 %i.09, 1
%2 = load i32, ptr %test, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %test) #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>
char map[101][101];
int dy[4]={0,1,0,-1};
int dx[4]={1,0,-1,0};
int H,W;
void dfs(int y,int x){
int ny,nx;
int i,j;
char c;
c=map[y][x];
map[y][x]='.';
for(i=0;i<4;i++){
nx=x+dx[i];
ny=y+dy[i];
if(0<=nx && nx<W && 0<=ny && ny<H && map[ny][nx]==c)dfs(ny,nx);
}
}
int main(){
int i,j;
int count;
while(1){
count=0;
for(j=0;j<100;j++){
for(i=0;i<100;i++){
map[j][i]='.';
}
}
scanf("%d %d",&H,&W);
if(H==0 && W==0)break;
for(i=0;i<H;i++){
scanf("%s",map[i]);
}
for(j=0;j<H;j++){
for(i=0;i<W;i++){
if(map[j][i]!='.'){
dfs(j,i);
count++;
}
}
}
printf("%d\n",count);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271212/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271212/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dy = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@dx = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16
@map = dso_local global [101 x [101 x i8]] zeroinitializer, align 16
@W = dso_local global i32 0, align 4
@H = dso_local global i32 0, align 4
@.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"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs(i32 noundef %y, i32 noundef %x) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %land.lhs.true18.3, %entry
%y.tr = phi i32 [ %y, %entry ], [ %add11.3, %land.lhs.true18.3 ]
%x.tr = phi i32 [ %x, %entry ], [ %add.3, %land.lhs.true18.3 ]
%idxprom = sext i32 %y.tr to i64
%idxprom1 = sext i32 %x.tr to i64
%arrayidx2 = getelementptr inbounds [101 x [101 x i8]], ptr @map, i64 0, i64 %idxprom, i64 %idxprom1
%0 = load i8, ptr %arrayidx2, align 1, !tbaa !5
store i8 46, ptr %arrayidx2, align 1, !tbaa !5
%1 = load i32, ptr @dx, align 16, !tbaa !8
%add = add nsw i32 %1, %x.tr
%2 = load i32, ptr @dy, align 16, !tbaa !8
%add11 = add nsw i32 %2, %y.tr
%cmp12 = icmp sgt i32 %add, -1
br i1 %cmp12, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %tailrecurse
%3 = load i32, ptr @W, align 4, !tbaa !8
%cmp13 = icmp slt i32 %add, %3
%cmp15 = icmp sgt i32 %add11, -1
%or.cond = select i1 %cmp13, i1 %cmp15, i1 false
%4 = load i32, ptr @H, align 4
%cmp17 = icmp slt i32 %add11, %4
%or.cond39 = select i1 %or.cond, i1 %cmp17, i1 false
br i1 %or.cond39, label %land.lhs.true18, label %for.inc
land.lhs.true18: ; preds = %land.lhs.true
%idxprom19 = zext i32 %add11 to i64
%idxprom21 = zext i32 %add to i64
%arrayidx22 = getelementptr inbounds [101 x [101 x i8]], ptr @map, i64 0, i64 %idxprom19, i64 %idxprom21
%5 = load i8, ptr %arrayidx22, align 1, !tbaa !5
%cmp24 = icmp eq i8 %5, %0
br i1 %cmp24, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true18
tail call void @dfs(i32 noundef %add11, i32 noundef %add)
br label %for.inc
for.inc: ; preds = %tailrecurse, %land.lhs.true, %land.lhs.true18, %if.then
%6 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !8
%add.1 = add nsw i32 %6, %x.tr
%7 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !8
%add11.1 = add nsw i32 %7, %y.tr
%cmp12.1 = icmp sgt i32 %add.1, -1
br i1 %cmp12.1, label %land.lhs.true.1, label %for.inc.1
land.lhs.true.1: ; preds = %for.inc
%8 = load i32, ptr @W, align 4, !tbaa !8
%cmp13.1 = icmp slt i32 %add.1, %8
%cmp15.1 = icmp sgt i32 %add11.1, -1
%or.cond.1 = select i1 %cmp13.1, i1 %cmp15.1, i1 false
%9 = load i32, ptr @H, align 4
%cmp17.1 = icmp slt i32 %add11.1, %9
%or.cond39.1 = select i1 %or.cond.1, i1 %cmp17.1, i1 false
br i1 %or.cond39.1, label %land.lhs.true18.1, label %for.inc.1
land.lhs.true18.1: ; preds = %land.lhs.true.1
%idxprom19.1 = zext i32 %add11.1 to i64
%idxprom21.1 = zext i32 %add.1 to i64
%arrayidx22.1 = getelementptr inbounds [101 x [101 x i8]], ptr @map, i64 0, i64 %idxprom19.1, i64 %idxprom21.1
%10 = load i8, ptr %arrayidx22.1, align 1, !tbaa !5
%cmp24.1 = icmp eq i8 %10, %0
br i1 %cmp24.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %land.lhs.true18.1
tail call void @dfs(i32 noundef %add11.1, i32 noundef %add.1)
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %land.lhs.true18.1, %land.lhs.true.1, %for.inc
%11 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !8
%add.2 = add nsw i32 %11, %x.tr
%12 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !8
%add11.2 = add nsw i32 %12, %y.tr
%cmp12.2 = icmp sgt i32 %add.2, -1
br i1 %cmp12.2, label %land.lhs.true.2, label %for.inc.2
land.lhs.true.2: ; preds = %for.inc.1
%13 = load i32, ptr @W, align 4, !tbaa !8
%cmp13.2 = icmp slt i32 %add.2, %13
%cmp15.2 = icmp sgt i32 %add11.2, -1
%or.cond.2 = select i1 %cmp13.2, i1 %cmp15.2, i1 false
%14 = load i32, ptr @H, align 4
%cmp17.2 = icmp slt i32 %add11.2, %14
%or.cond39.2 = select i1 %or.cond.2, i1 %cmp17.2, i1 false
br i1 %or.cond39.2, label %land.lhs.true18.2, label %for.inc.2
land.lhs.true18.2: ; preds = %land.lhs.true.2
%idxprom19.2 = zext i32 %add11.2 to i64
%idxprom21.2 = zext i32 %add.2 to i64
%arrayidx22.2 = getelementptr inbounds [101 x [101 x i8]], ptr @map, i64 0, i64 %idxprom19.2, i64 %idxprom21.2
%15 = load i8, ptr %arrayidx22.2, align 1, !tbaa !5
%cmp24.2 = icmp eq i8 %15, %0
br i1 %cmp24.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %land.lhs.true18.2
tail call void @dfs(i32 noundef %add11.2, i32 noundef %add.2)
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %land.lhs.true18.2, %land.lhs.true.2, %for.inc.1
%16 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !8
%add.3 = add nsw i32 %16, %x.tr
%17 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !8
%add11.3 = add nsw i32 %17, %y.tr
%cmp12.3 = icmp sgt i32 %add.3, -1
br i1 %cmp12.3, label %land.lhs.true.3, label %for.inc.3
land.lhs.true.3: ; preds = %for.inc.2
%18 = load i32, ptr @W, align 4, !tbaa !8
%cmp13.3 = icmp slt i32 %add.3, %18
%cmp15.3 = icmp sgt i32 %add11.3, -1
%or.cond.3 = select i1 %cmp13.3, i1 %cmp15.3, i1 false
%19 = load i32, ptr @H, align 4
%cmp17.3 = icmp slt i32 %add11.3, %19
%or.cond39.3 = select i1 %or.cond.3, i1 %cmp17.3, i1 false
br i1 %or.cond39.3, label %land.lhs.true18.3, label %for.inc.3
land.lhs.true18.3: ; preds = %land.lhs.true.3
%idxprom19.3 = zext i32 %add11.3 to i64
%idxprom21.3 = zext i32 %add.3 to i64
%arrayidx22.3 = getelementptr inbounds [101 x [101 x i8]], ptr @map, i64 0, i64 %idxprom19.3, i64 %idxprom21.3
%20 = load i8, ptr %arrayidx22.3, align 1, !tbaa !5
%cmp24.3 = icmp eq i8 %20, %0
br i1 %cmp24.3, label %tailrecurse, label %for.inc.3
for.inc.3: ; preds = %land.lhs.true18.3, %land.lhs.true.3, %for.inc.2
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.backedge, %entry
%indvar = phi i64 [ 0, %entry ], [ %indvar.be, %for.cond1.preheader.backedge ]
%0 = mul nuw nsw i64 %indvar, 101
%scevgep = getelementptr i8, ptr @map, i64 %0
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(100) %scevgep, i8 46, i64 100, i1 false), !tbaa !5
%indvar.next = add nuw nsw i64 %indvar, 1
%exitcond.not = icmp eq i64 %indvar.next, 100
br i1 %exitcond.not, label %for.end8, label %for.cond1.preheader.backedge
for.cond1.preheader.backedge: ; preds = %for.cond1.preheader, %for.end40
%indvar.be = phi i64 [ %indvar.next, %for.cond1.preheader ], [ 0, %for.end40 ]
br label %for.cond1.preheader, !llvm.loop !10
for.end8: ; preds = %for.cond1.preheader
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @H, ptr noundef nonnull @W)
%1 = load i32, ptr @H, align 4, !tbaa !8
%cmp9 = icmp eq i32 %1, 0
%2 = load i32, ptr @W, align 4
%cmp10 = icmp eq i32 %2, 0
%or.cond = select i1 %cmp9, i1 %cmp10, i1 false
br i1 %or.cond, label %while.end, label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.end8
%cmp1260 = icmp sgt i32 %1, 0
br i1 %cmp1260, label %for.body13, label %for.end40
for.cond20.preheader: ; preds = %for.body13
%cmp2165 = icmp sgt i32 %5, 0
%3 = load i32, ptr @W, align 4
%4 = icmp sgt i32 %3, 0
%or.cond83 = select i1 %cmp2165, i1 %4, i1 false
br i1 %or.cond83, label %for.cond23.preheader, label %for.end40
for.body13: ; preds = %for.cond11.preheader, %for.body13
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body13 ], [ 0, %for.cond11.preheader ]
%arrayidx15 = getelementptr inbounds [101 x [101 x i8]], ptr @map, i64 0, i64 %indvars.iv
%call16 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx15)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr @H, align 4, !tbaa !8
%6 = sext i32 %5 to i64
%cmp12 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp12, label %for.body13, label %for.cond20.preheader, !llvm.loop !12
for.cond23.preheader: ; preds = %for.cond20.preheader, %for.inc38
%7 = phi i32 [ %16, %for.inc38 ], [ %5, %for.cond20.preheader ]
%8 = phi i32 [ %17, %for.inc38 ], [ %3, %for.cond20.preheader ]
%9 = phi i32 [ %18, %for.inc38 ], [ %3, %for.cond20.preheader ]
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.inc38 ], [ 0, %for.cond20.preheader ]
%count.067 = phi i32 [ %count.1.lcssa, %for.inc38 ], [ 0, %for.cond20.preheader ]
%cmp2462 = icmp sgt i32 %9, 0
br i1 %cmp2462, label %for.body25.lr.ph, label %for.inc38
for.body25.lr.ph: ; preds = %for.cond23.preheader
%10 = trunc i64 %indvars.iv76 to i32
br label %for.body25
for.body25: ; preds = %for.body25.lr.ph, %for.inc35
%11 = phi i32 [ %8, %for.body25.lr.ph ], [ %14, %for.inc35 ]
%indvars.iv73 = phi i64 [ 0, %for.body25.lr.ph ], [ %indvars.iv.next74, %for.inc35 ]
%count.164 = phi i32 [ %count.067, %for.body25.lr.ph ], [ %count.2, %for.inc35 ]
%arrayidx29 = getelementptr inbounds [101 x [101 x i8]], ptr @map, i64 0, i64 %indvars.iv76, i64 %indvars.iv73
%12 = load i8, ptr %arrayidx29, align 1, !tbaa !5
%cmp30.not = icmp eq i8 %12, 46
br i1 %cmp30.not, label %for.inc35, label %if.then32
if.then32: ; preds = %for.body25
%13 = trunc i64 %indvars.iv73 to i32
tail call void @dfs(i32 noundef %10, i32 noundef %13)
%inc33 = add nsw i32 %count.164, 1
%.pre = load i32, ptr @W, align 4, !tbaa !8
br label %for.inc35
for.inc35: ; preds = %for.body25, %if.then32
%14 = phi i32 [ %.pre, %if.then32 ], [ %11, %for.body25 ]
%count.2 = phi i32 [ %inc33, %if.then32 ], [ %count.164, %for.body25 ]
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%15 = sext i32 %14 to i64
%cmp24 = icmp slt i64 %indvars.iv.next74, %15
br i1 %cmp24, label %for.body25, label %for.inc38.loopexit, !llvm.loop !13
for.inc38.loopexit: ; preds = %for.inc35
%.pre79 = load i32, ptr @H, align 4, !tbaa !8
br label %for.inc38
for.inc38: ; preds = %for.inc38.loopexit, %for.cond23.preheader
%16 = phi i32 [ %7, %for.cond23.preheader ], [ %.pre79, %for.inc38.loopexit ]
%17 = phi i32 [ %8, %for.cond23.preheader ], [ %14, %for.inc38.loopexit ]
%18 = phi i32 [ %9, %for.cond23.preheader ], [ %14, %for.inc38.loopexit ]
%count.1.lcssa = phi i32 [ %count.067, %for.cond23.preheader ], [ %count.2, %for.inc38.loopexit ]
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%19 = sext i32 %16 to i64
%cmp21 = icmp slt i64 %indvars.iv.next77, %19
br i1 %cmp21, label %for.cond23.preheader, label %for.end40, !llvm.loop !14
for.end40: ; preds = %for.inc38, %for.cond11.preheader, %for.cond20.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond20.preheader ], [ 0, %for.cond11.preheader ], [ %count.1.lcssa, %for.inc38 ]
%call41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa)
br label %for.cond1.preheader.backedge
while.end: ; preds = %for.end8
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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
|
/*
AOJ #2773
title:Periodic Sequence
@kankichi573
*/
#include <stdio.h>
#include <string.h>
int n,s[200000],hist[100000],fc;
int gcd(int a,int b)
{
int c;
while (b > 0) {
c = a % b;
a = b;
b = c;
}
return a;
}
int all_gcd(int n,int hist[])
{
int i,ret;
ret = n;
for(i=0;i<100000;i++)
if(hist[i])
{
//printf("%d[%d]\n",i,hist[i]);
ret = gcd(ret,hist[i]);
}
return(ret);
}
int check(int s[],int n,int g)
{
int i;
for(i=0;i<n-n/g;i++)
if(s[i]!=s[i+n/g])
return(0);
return(1);
}
int main()
{
int i,v,gcd_;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&v);
s[i]=v;
hist[v]++;
}
gcd_=all_gcd(n,hist);
//printf("all gcd=%d\n",gcd_);
for(i=gcd_;i>=2;i--)
if((gcd_ % i)==0 && check(s,n,i))
{
printf("%d\n",i);
goto END;
}
printf("1\n");
END:
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271263/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271263/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@s = dso_local local_unnamed_addr global [200000 x i32] zeroinitializer, align 16
@hist = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@fc = dso_local local_unnamed_addr global i32 0, align 4
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp sgt i32 %b, 0
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%cmp = icmp sgt i32 %rem, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @all_gcd(i32 noundef %n, ptr nocapture noundef readonly %hist) local_unnamed_addr #2 {
entry:
br label %for.body
for.body: ; preds = %for.inc.1, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.1, %for.inc.1 ]
%ret.09 = phi i32 [ %n, %entry ], [ %ret.1.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i32, ptr %hist, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !7
%cmp4.i = icmp sgt i32 %0, 0
br i1 %cmp4.i, label %while.body.i, label %for.inc
while.body.i: ; preds = %for.body, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %ret.09, %for.body ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %0, %for.body ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%cmp.i = icmp sgt i32 %rem.i, 0
br i1 %cmp.i, label %while.body.i, label %for.inc, !llvm.loop !5
for.inc: ; preds = %while.body.i, %for.body
%ret.1 = phi i32 [ %ret.09, %for.body ], [ %b.addr.05.i, %while.body.i ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %hist, i64 %indvars.iv.next
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !7
%cmp4.i.1 = icmp sgt i32 %1, 0
br i1 %cmp4.i.1, label %while.body.i.1, label %for.inc.1
while.body.i.1: ; preds = %for.inc, %while.body.i.1
%a.addr.06.i.1 = phi i32 [ %b.addr.05.i.1, %while.body.i.1 ], [ %ret.1, %for.inc ]
%b.addr.05.i.1 = phi i32 [ %rem.i.1, %while.body.i.1 ], [ %1, %for.inc ]
%rem.i.1 = srem i32 %a.addr.06.i.1, %b.addr.05.i.1
%cmp.i.1 = icmp sgt i32 %rem.i.1, 0
br i1 %cmp.i.1, label %while.body.i.1, label %for.inc.1, !llvm.loop !5
for.inc.1: ; preds = %while.body.i.1, %for.inc
%ret.1.1 = phi i32 [ %ret.1, %for.inc ], [ %b.addr.05.i.1, %while.body.i.1 ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 100000
br i1 %exitcond.not.1, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.inc.1
ret i32 %ret.1.1
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @check(ptr nocapture noundef readonly %s, i32 noundef %n, i32 noundef %g) local_unnamed_addr #2 {
entry:
%div = sdiv i32 %n, %g
%sub = sub nsw i32 %n, %div
%cmp12 = icmp sgt i32 %sub, 0
br i1 %cmp12, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%0 = sext i32 %div to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %s, i64 %0
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 !12
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %s, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !7
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%2 = load i32, ptr %gep, align 4, !tbaa !7
%cmp4.not = icmp eq i32 %1, %2
br i1 %cmp4.not, label %for.cond, label %cleanup
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !7
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
br label %for.body.i
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 %v)
%1 = load i32, ptr %v, align 4, !tbaa !7
%arrayidx = getelementptr inbounds [200000 x i32], ptr @s, i64 0, i64 %indvars.iv
store i32 %1, ptr %arrayidx, align 4, !tbaa !7
%idxprom2 = sext i32 %1 to i64
%arrayidx3 = getelementptr inbounds [100000 x i32], ptr @hist, i64 0, i64 %idxprom2
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !7
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx3, align 4, !tbaa !7
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !7
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.body.i.preheader, !llvm.loop !13
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%ret.09.i = phi i32 [ %.lcssa, %for.body.i.preheader ], [ %ret.1.i.1, %for.inc.i.1 ]
%arrayidx.i = getelementptr inbounds i32, ptr @hist, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx.i, align 8, !tbaa !7
%cmp4.i.i = icmp sgt i32 %5, 0
br i1 %cmp4.i.i, label %while.body.i.i, label %for.inc.i
while.body.i.i: ; preds = %for.body.i, %while.body.i.i
%a.addr.06.i.i = phi i32 [ %b.addr.05.i.i, %while.body.i.i ], [ %ret.09.i, %for.body.i ]
%b.addr.05.i.i = phi i32 [ %rem.i.i, %while.body.i.i ], [ %5, %for.body.i ]
%rem.i.i = srem i32 %a.addr.06.i.i, %b.addr.05.i.i
%cmp.i.i = icmp sgt i32 %rem.i.i, 0
br i1 %cmp.i.i, label %while.body.i.i, label %for.inc.i, !llvm.loop !5
for.inc.i: ; preds = %while.body.i.i, %for.body.i
%ret.1.i = phi i32 [ %ret.09.i, %for.body.i ], [ %b.addr.05.i.i, %while.body.i.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i32, ptr @hist, i64 %indvars.iv.next.i
%6 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !7
%cmp4.i.i.1 = icmp sgt i32 %6, 0
br i1 %cmp4.i.i.1, label %while.body.i.i.1, label %for.inc.i.1
while.body.i.i.1: ; preds = %for.inc.i, %while.body.i.i.1
%a.addr.06.i.i.1 = phi i32 [ %b.addr.05.i.i.1, %while.body.i.i.1 ], [ %ret.1.i, %for.inc.i ]
%b.addr.05.i.i.1 = phi i32 [ %rem.i.i.1, %while.body.i.i.1 ], [ %6, %for.inc.i ]
%rem.i.i.1 = srem i32 %a.addr.06.i.i.1, %b.addr.05.i.i.1
%cmp.i.i.1 = icmp sgt i32 %rem.i.i.1, 0
br i1 %cmp.i.i.1, label %while.body.i.i.1, label %for.inc.i.1, !llvm.loop !5
for.inc.i.1: ; preds = %while.body.i.i.1, %for.inc.i
%ret.1.i.1 = phi i32 [ %ret.1.i, %for.inc.i ], [ %b.addr.05.i.i.1, %while.body.i.i.1 ]
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, 100000
br i1 %exitcond.not.i.1, label %for.cond6.preheader, label %for.body.i, !llvm.loop !11
for.cond6.preheader: ; preds = %for.inc.i.1
%cmp736 = icmp sgt i32 %ret.1.i.1, 1
br i1 %cmp736, label %for.body8, label %for.end13
for.body8: ; preds = %for.cond6.preheader, %for.inc12
%i.137 = phi i32 [ %dec, %for.inc12 ], [ %ret.1.i.1, %for.cond6.preheader ]
%rem = srem i32 %ret.1.i.1, %i.137
%cmp9 = icmp eq i32 %rem, 0
br i1 %cmp9, label %land.lhs.true, label %for.inc12
land.lhs.true: ; preds = %for.body8
%div.i = sdiv i32 %.lcssa, %i.137
%sub.i = sub nsw i32 %.lcssa, %div.i
%cmp12.i = icmp sgt i32 %sub.i, 0
br i1 %cmp12.i, label %for.body.preheader.i, label %if.then
for.body.preheader.i: ; preds = %land.lhs.true
%7 = sext i32 %div.i to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr i32, ptr @s, i64 %7
br label %for.body.i23
for.cond.i: ; preds = %for.body.i23
%indvars.iv.next.i26 = add nuw nsw i64 %indvars.iv.i24, 1
%exitcond.not.i27 = icmp eq i64 %indvars.iv.next.i26, %wide.trip.count.i
br i1 %exitcond.not.i27, label %if.then, label %for.body.i23, !llvm.loop !12
for.body.i23: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i24 = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i26, %for.cond.i ]
%arrayidx.i25 = getelementptr inbounds i32, ptr @s, i64 %indvars.iv.i24
%8 = load i32, ptr %arrayidx.i25, align 4, !tbaa !7
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i24
%9 = load i32, ptr %gep.i, align 4, !tbaa !7
%cmp4.not.i = icmp eq i32 %8, %9
br i1 %cmp4.not.i, label %for.cond.i, label %for.inc12
if.then: ; preds = %land.lhs.true, %for.cond.i
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.137)
br label %END
for.inc12: ; preds = %for.body.i23, %for.body8
%dec = add nsw i32 %i.137, -1
%cmp7 = icmp sgt i32 %i.137, 2
br i1 %cmp7, label %for.body8, label %for.end13, !llvm.loop !14
for.end13: ; preds = %for.inc12, %for.cond6.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %END
END: ; preds = %for.end13, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
!14 = distinct !{!14, !6}
|
#include <stdio.h>
int main(void)
{
char str[1000];
int a = 0;
while (scanf("%c", &str[a]) != EOF){
if (str[a] >= 'a' && str[a] <= 'z'){
str[a] += 'A' - 'a';
}
printf("%c", str[a]);
a++;
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271328/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271328/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %str) #4
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%cmp.not24 = icmp eq i32 %call23, -1
br i1 %cmp.not24, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%arrayidx26 = phi ptr [ %arrayidx, %if.end ], [ %str, %entry ]
%0 = load i8, ptr %arrayidx26, align 1, !tbaa !5
%1 = add i8 %0, -97
%or.cond = icmp ult i8 %1, 26
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %while.body
%add = add nsw i8 %0, -32
store i8 %add, ptr %arrayidx26, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%2 = phi i8 [ %add, %if.then ], [ %0, %while.body ]
%conv16 = sext i8 %2 to i32
%putchar = call i32 @putchar(i32 %conv16)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [1000 x i8], ptr %str, i64 0, i64 %indvars.iv.next
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <ctype.h>
#include <stdio.h>
void tocaptital(char s[])
{
int i=0;
while(s[i]!='\0'){
if(isspace(s[i])==1){
i++;
}else{
s[i]=toupper(s[i]);
i++;
}
}
}
int main(void)
{
char str[200];
scanf("%[^\n]",str);
tocaptital(str);
printf("%s\n",str);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271407/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271407/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%[^\0A]\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @tocaptital(ptr nocapture noundef %s) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %s, align 1, !tbaa !5
%cmp.not28 = icmp eq i8 %0, 0
br i1 %cmp.not28, label %while.end, label %if.else.lr.ph
if.else.lr.ph: ; preds = %entry
%call10 = tail call ptr @__ctype_toupper_loc() #6
br label %if.else
if.else: ; preds = %if.else.lr.ph, %if.else
%indvars.iv = phi i64 [ 0, %if.else.lr.ph ], [ %indvars.iv.next, %if.else ]
%1 = phi i8 [ %0, %if.else.lr.ph ], [ %4, %if.else ]
%arrayidx30 = phi ptr [ %s, %if.else.lr.ph ], [ %arrayidx, %if.else ]
%idxprom5 = sext i8 %1 to i64
%2 = load ptr, ptr %call10, align 8, !tbaa !8
%arrayidx15 = getelementptr inbounds i32, ptr %2, i64 %idxprom5
%3 = load i32, ptr %arrayidx15, align 4, !tbaa !10
%conv16 = trunc i32 %3 to i8
store i8 %conv16, ptr %arrayidx30, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %4, 0
br i1 %cmp.not, label %while.end, label %if.else, !llvm.loop !12
while.end: ; preds = %if.else, %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 nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%str = alloca [200 x i8], align 16
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %str) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%0 = load i8, ptr %str, align 16, !tbaa !5
%cmp.not28.i = icmp eq i8 %0, 0
br i1 %cmp.not28.i, label %tocaptital.exit, label %if.else.lr.ph.i
if.else.lr.ph.i: ; preds = %entry
%call10.i = tail call ptr @__ctype_toupper_loc() #6
br label %if.else.i
if.else.i: ; preds = %if.else.i, %if.else.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %if.else.lr.ph.i ], [ %indvars.iv.next.i, %if.else.i ]
%1 = phi i8 [ %0, %if.else.lr.ph.i ], [ %4, %if.else.i ]
%arrayidx30.i = phi ptr [ %str, %if.else.lr.ph.i ], [ %arrayidx.i, %if.else.i ]
%idxprom5.i = sext i8 %1 to i64
%2 = load ptr, ptr %call10.i, align 8, !tbaa !8
%arrayidx15.i = getelementptr inbounds i32, ptr %2, i64 %idxprom5.i
%3 = load i32, ptr %arrayidx15.i, align 4, !tbaa !10
%conv16.i = trunc i32 %3 to i8
store i8 %conv16.i, ptr %arrayidx30.i, align 1, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next.i
%4 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%cmp.not.i = icmp eq i8 %4, 0
br i1 %cmp.not.i, label %tocaptital.exit, label %if.else.i, !llvm.loop !12
tocaptital.exit: ; preds = %if.else.i, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str)
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %str) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
char n;
while(~(n=getchar())){
if('a'<=n&&n<='z')n=n-'a'+'A';
putchar(n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271487/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271487/source.c"
target datalayout = "e-m:e-p270: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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i16 = tail call i32 @getc(ptr noundef %0)
%sext17 = shl i32 %call.i16, 24
%tobool.not18 = icmp eq i32 %sext17, -16777216
br i1 %tobool.not18, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%sext20 = phi i32 [ %sext, %while.body ], [ %sext17, %entry ]
%call.i19 = phi i32 [ %call.i, %while.body ], [ %call.i16, %entry ]
%1 = add i32 %sext20, -1610612737
%or.cond = icmp ult i32 %1, 452984831
%2 = shl i32 %call.i19, 24
%3 = add i32 %2, -536870912
%sext14 = select i1 %or.cond, i32 %3, i32 %2
%conv9 = ashr exact i32 %sext14, 24
%4 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i15 = tail call i32 @putc(i32 noundef %conv9, ptr noundef %4)
%5 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %5)
%sext = shl i32 %call.i, 24
%tobool.not = icmp eq i32 %sext, -16777216
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int a;
while((a=getchar())!=EOF){
if(a>='a' && a<='z'){
putchar(a-'a'+'A');
}else{
putchar(a);
}
}
//printf ("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271551/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271551/source.c"
target datalayout = "e-m:e-p270: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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i10 = tail call i32 @getc(ptr noundef %0)
%cmp.not11 = icmp eq i32 %call.i10, -1
br i1 %cmp.not11, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call.i12 = phi i32 [ %call.i, %while.body ], [ %call.i10, %entry ]
%1 = add i32 %call.i12, -97
%or.cond = icmp ult i32 %1, 26
%add = add nsw i32 %call.i12, -32
%call.i12.sink = select i1 %or.cond, i32 %add, i32 %call.i12
%2 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i9 = tail call i32 @putc(i32 noundef %call.i12.sink, ptr noundef %2)
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %3)
%cmp.not = icmp eq i32 %call.i, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
#define MAX 200
int main()
{
int i=0,len;
char str[MAX];
fgets(str, MAX+1, stdin);
len = strlen(str);
while (i<len)
{
if (*(str + i) >= 'a'&&*(str + i) <= 'z')
{
*(str + i) -= 32;
}
++i;
}
printf("%s", str);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271616/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271616/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [200 x i8], align 16
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %str) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 201, ptr noundef %0)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #5
%conv = trunc i64 %call2 to i32
%cmp25 = icmp sgt i32 %conv, 0
br i1 %cmp25, label %iter.check, label %while.end
iter.check: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %while.body.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check28 = icmp ult i64 %wide.trip.count, 16
br i1 %min.iters.check28, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.mod.vf = and i64 %call2, 15
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %pred.store.continue58, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue58 ]
%1 = getelementptr inbounds i8, ptr %str, i64 %index
%wide.load = load <16 x i8>, ptr %1, align 16, !tbaa !9
%2 = add <16 x i8> %wide.load, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
%3 = icmp ult <16 x i8> %2, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26>
%4 = extractelement <16 x i1> %3, i64 0
br i1 %4, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%5 = getelementptr inbounds i8, ptr %str, i64 %index
%6 = extractelement <16 x i8> %wide.load, i64 0
%7 = add nsw i8 %6, -32
store i8 %7, ptr %5, align 16, !tbaa !9
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%8 = extractelement <16 x i1> %3, i64 1
br i1 %8, label %pred.store.if29, label %pred.store.continue30
pred.store.if29: ; preds = %pred.store.continue
%9 = or i64 %index, 1
%10 = getelementptr inbounds i8, ptr %str, i64 %9
%11 = extractelement <16 x i8> %wide.load, i64 1
%12 = add nsw i8 %11, -32
store i8 %12, ptr %10, align 1, !tbaa !9
br label %pred.store.continue30
pred.store.continue30: ; preds = %pred.store.if29, %pred.store.continue
%13 = extractelement <16 x i1> %3, i64 2
br i1 %13, label %pred.store.if31, label %pred.store.continue32
pred.store.if31: ; preds = %pred.store.continue30
%14 = or i64 %index, 2
%15 = getelementptr inbounds i8, ptr %str, i64 %14
%16 = extractelement <16 x i8> %wide.load, i64 2
%17 = add nsw i8 %16, -32
store i8 %17, ptr %15, align 2, !tbaa !9
br label %pred.store.continue32
pred.store.continue32: ; preds = %pred.store.if31, %pred.store.continue30
%18 = extractelement <16 x i1> %3, i64 3
br i1 %18, label %pred.store.if33, label %pred.store.continue34
pred.store.if33: ; preds = %pred.store.continue32
%19 = or i64 %index, 3
%20 = getelementptr inbounds i8, ptr %str, i64 %19
%21 = extractelement <16 x i8> %wide.load, i64 3
%22 = add nsw i8 %21, -32
store i8 %22, ptr %20, align 1, !tbaa !9
br label %pred.store.continue34
pred.store.continue34: ; preds = %pred.store.if33, %pred.store.continue32
%23 = extractelement <16 x i1> %3, i64 4
br i1 %23, label %pred.store.if35, label %pred.store.continue36
pred.store.if35: ; preds = %pred.store.continue34
%24 = or i64 %index, 4
%25 = getelementptr inbounds i8, ptr %str, i64 %24
%26 = extractelement <16 x i8> %wide.load, i64 4
%27 = add nsw i8 %26, -32
store i8 %27, ptr %25, align 4, !tbaa !9
br label %pred.store.continue36
pred.store.continue36: ; preds = %pred.store.if35, %pred.store.continue34
%28 = extractelement <16 x i1> %3, i64 5
br i1 %28, label %pred.store.if37, label %pred.store.continue38
pred.store.if37: ; preds = %pred.store.continue36
%29 = or i64 %index, 5
%30 = getelementptr inbounds i8, ptr %str, i64 %29
%31 = extractelement <16 x i8> %wide.load, i64 5
%32 = add nsw i8 %31, -32
store i8 %32, ptr %30, align 1, !tbaa !9
br label %pred.store.continue38
pred.store.continue38: ; preds = %pred.store.if37, %pred.store.continue36
%33 = extractelement <16 x i1> %3, i64 6
br i1 %33, label %pred.store.if39, label %pred.store.continue40
pred.store.if39: ; preds = %pred.store.continue38
%34 = or i64 %index, 6
%35 = getelementptr inbounds i8, ptr %str, i64 %34
%36 = extractelement <16 x i8> %wide.load, i64 6
%37 = add nsw i8 %36, -32
store i8 %37, ptr %35, align 2, !tbaa !9
br label %pred.store.continue40
pred.store.continue40: ; preds = %pred.store.if39, %pred.store.continue38
%38 = extractelement <16 x i1> %3, i64 7
br i1 %38, label %pred.store.if41, label %pred.store.continue42
pred.store.if41: ; preds = %pred.store.continue40
%39 = or i64 %index, 7
%40 = getelementptr inbounds i8, ptr %str, i64 %39
%41 = extractelement <16 x i8> %wide.load, i64 7
%42 = add nsw i8 %41, -32
store i8 %42, ptr %40, align 1, !tbaa !9
br label %pred.store.continue42
pred.store.continue42: ; preds = %pred.store.if41, %pred.store.continue40
%43 = extractelement <16 x i1> %3, i64 8
br i1 %43, label %pred.store.if43, label %pred.store.continue44
pred.store.if43: ; preds = %pred.store.continue42
%44 = or i64 %index, 8
%45 = getelementptr inbounds i8, ptr %str, i64 %44
%46 = extractelement <16 x i8> %wide.load, i64 8
%47 = add nsw i8 %46, -32
store i8 %47, ptr %45, align 8, !tbaa !9
br label %pred.store.continue44
pred.store.continue44: ; preds = %pred.store.if43, %pred.store.continue42
%48 = extractelement <16 x i1> %3, i64 9
br i1 %48, label %pred.store.if45, label %pred.store.continue46
pred.store.if45: ; preds = %pred.store.continue44
%49 = or i64 %index, 9
%50 = getelementptr inbounds i8, ptr %str, i64 %49
%51 = extractelement <16 x i8> %wide.load, i64 9
%52 = add nsw i8 %51, -32
store i8 %52, ptr %50, align 1, !tbaa !9
br label %pred.store.continue46
pred.store.continue46: ; preds = %pred.store.if45, %pred.store.continue44
%53 = extractelement <16 x i1> %3, i64 10
br i1 %53, label %pred.store.if47, label %pred.store.continue48
pred.store.if47: ; preds = %pred.store.continue46
%54 = or i64 %index, 10
%55 = getelementptr inbounds i8, ptr %str, i64 %54
%56 = extractelement <16 x i8> %wide.load, i64 10
%57 = add nsw i8 %56, -32
store i8 %57, ptr %55, align 2, !tbaa !9
br label %pred.store.continue48
pred.store.continue48: ; preds = %pred.store.if47, %pred.store.continue46
%58 = extractelement <16 x i1> %3, i64 11
br i1 %58, label %pred.store.if49, label %pred.store.continue50
pred.store.if49: ; preds = %pred.store.continue48
%59 = or i64 %index, 11
%60 = getelementptr inbounds i8, ptr %str, i64 %59
%61 = extractelement <16 x i8> %wide.load, i64 11
%62 = add nsw i8 %61, -32
store i8 %62, ptr %60, align 1, !tbaa !9
br label %pred.store.continue50
pred.store.continue50: ; preds = %pred.store.if49, %pred.store.continue48
%63 = extractelement <16 x i1> %3, i64 12
br i1 %63, label %pred.store.if51, label %pred.store.continue52
pred.store.if51: ; preds = %pred.store.continue50
%64 = or i64 %index, 12
%65 = getelementptr inbounds i8, ptr %str, i64 %64
%66 = extractelement <16 x i8> %wide.load, i64 12
%67 = add nsw i8 %66, -32
store i8 %67, ptr %65, align 4, !tbaa !9
br label %pred.store.continue52
pred.store.continue52: ; preds = %pred.store.if51, %pred.store.continue50
%68 = extractelement <16 x i1> %3, i64 13
br i1 %68, label %pred.store.if53, label %pred.store.continue54
pred.store.if53: ; preds = %pred.store.continue52
%69 = or i64 %index, 13
%70 = getelementptr inbounds i8, ptr %str, i64 %69
%71 = extractelement <16 x i8> %wide.load, i64 13
%72 = add nsw i8 %71, -32
store i8 %72, ptr %70, align 1, !tbaa !9
br label %pred.store.continue54
pred.store.continue54: ; preds = %pred.store.if53, %pred.store.continue52
%73 = extractelement <16 x i1> %3, i64 14
br i1 %73, label %pred.store.if55, label %pred.store.continue56
pred.store.if55: ; preds = %pred.store.continue54
%74 = or i64 %index, 14
%75 = getelementptr inbounds i8, ptr %str, i64 %74
%76 = extractelement <16 x i8> %wide.load, i64 14
%77 = add nsw i8 %76, -32
store i8 %77, ptr %75, align 2, !tbaa !9
br label %pred.store.continue56
pred.store.continue56: ; preds = %pred.store.if55, %pred.store.continue54
%78 = extractelement <16 x i1> %3, i64 15
br i1 %78, label %pred.store.if57, label %pred.store.continue58
pred.store.if57: ; preds = %pred.store.continue56
%79 = or i64 %index, 15
%80 = getelementptr inbounds i8, ptr %str, i64 %79
%81 = extractelement <16 x i8> %wide.load, i64 15
%82 = add nsw i8 %81, -32
store i8 %82, ptr %80, align 1, !tbaa !9
br label %pred.store.continue58
pred.store.continue58: ; preds = %pred.store.if57, %pred.store.continue56
%index.next = add nuw i64 %index, 16
%83 = icmp eq i64 %index.next, %n.vec
br i1 %83, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %pred.store.continue58
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %while.end, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%min.epilog.iters.check = icmp ult i64 %n.mod.vf, 8
br i1 %min.epilog.iters.check, label %while.body.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.mod.vf59 = and i64 %call2, 7
%n.vec60 = sub nsw i64 %wide.trip.count, %n.mod.vf59
%invariant.gep = getelementptr i8, ptr %str, i64 1
%invariant.gep81 = getelementptr i8, ptr %str, i64 2
%invariant.gep83 = getelementptr i8, ptr %str, i64 3
%invariant.gep85 = getelementptr i8, ptr %str, i64 4
%invariant.gep87 = getelementptr i8, ptr %str, i64 5
%invariant.gep89 = getelementptr i8, ptr %str, i64 6
%invariant.gep91 = getelementptr i8, ptr %str, i64 7
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %pred.store.continue79, %vec.epilog.ph
%index62 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next80, %pred.store.continue79 ]
%84 = getelementptr inbounds i8, ptr %str, i64 %index62
%wide.load63 = load <8 x i8>, ptr %84, align 1, !tbaa !9
%85 = add <8 x i8> %wide.load63, <i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97, i8 -97>
%86 = icmp ult <8 x i8> %85, <i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26, i8 26>
%87 = extractelement <8 x i1> %86, i64 0
br i1 %87, label %pred.store.if64, label %pred.store.continue65
pred.store.if64: ; preds = %vec.epilog.vector.body
%88 = getelementptr inbounds i8, ptr %str, i64 %index62
%89 = extractelement <8 x i8> %wide.load63, i64 0
%90 = add nsw i8 %89, -32
store i8 %90, ptr %88, align 1, !tbaa !9
br label %pred.store.continue65
pred.store.continue65: ; preds = %pred.store.if64, %vec.epilog.vector.body
%91 = extractelement <8 x i1> %86, i64 1
br i1 %91, label %pred.store.if66, label %pred.store.continue67
pred.store.if66: ; preds = %pred.store.continue65
%gep = getelementptr i8, ptr %invariant.gep, i64 %index62
%92 = extractelement <8 x i8> %wide.load63, i64 1
%93 = add nsw i8 %92, -32
store i8 %93, ptr %gep, align 1, !tbaa !9
br label %pred.store.continue67
pred.store.continue67: ; preds = %pred.store.if66, %pred.store.continue65
%94 = extractelement <8 x i1> %86, i64 2
br i1 %94, label %pred.store.if68, label %pred.store.continue69
pred.store.if68: ; preds = %pred.store.continue67
%gep82 = getelementptr i8, ptr %invariant.gep81, i64 %index62
%95 = extractelement <8 x i8> %wide.load63, i64 2
%96 = add nsw i8 %95, -32
store i8 %96, ptr %gep82, align 1, !tbaa !9
br label %pred.store.continue69
pred.store.continue69: ; preds = %pred.store.if68, %pred.store.continue67
%97 = extractelement <8 x i1> %86, i64 3
br i1 %97, label %pred.store.if70, label %pred.store.continue71
pred.store.if70: ; preds = %pred.store.continue69
%gep84 = getelementptr i8, ptr %invariant.gep83, i64 %index62
%98 = extractelement <8 x i8> %wide.load63, i64 3
%99 = add nsw i8 %98, -32
store i8 %99, ptr %gep84, align 1, !tbaa !9
br label %pred.store.continue71
pred.store.continue71: ; preds = %pred.store.if70, %pred.store.continue69
%100 = extractelement <8 x i1> %86, i64 4
br i1 %100, label %pred.store.if72, label %pred.store.continue73
pred.store.if72: ; preds = %pred.store.continue71
%gep86 = getelementptr i8, ptr %invariant.gep85, i64 %index62
%101 = extractelement <8 x i8> %wide.load63, i64 4
%102 = add nsw i8 %101, -32
store i8 %102, ptr %gep86, align 1, !tbaa !9
br label %pred.store.continue73
pred.store.continue73: ; preds = %pred.store.if72, %pred.store.continue71
%103 = extractelement <8 x i1> %86, i64 5
br i1 %103, label %pred.store.if74, label %pred.store.continue75
pred.store.if74: ; preds = %pred.store.continue73
%gep88 = getelementptr i8, ptr %invariant.gep87, i64 %index62
%104 = extractelement <8 x i8> %wide.load63, i64 5
%105 = add nsw i8 %104, -32
store i8 %105, ptr %gep88, align 1, !tbaa !9
br label %pred.store.continue75
pred.store.continue75: ; preds = %pred.store.if74, %pred.store.continue73
%106 = extractelement <8 x i1> %86, i64 6
br i1 %106, label %pred.store.if76, label %pred.store.continue77
pred.store.if76: ; preds = %pred.store.continue75
%gep90 = getelementptr i8, ptr %invariant.gep89, i64 %index62
%107 = extractelement <8 x i8> %wide.load63, i64 6
%108 = add nsw i8 %107, -32
store i8 %108, ptr %gep90, align 1, !tbaa !9
br label %pred.store.continue77
pred.store.continue77: ; preds = %pred.store.if76, %pred.store.continue75
%109 = extractelement <8 x i1> %86, i64 7
br i1 %109, label %pred.store.if78, label %pred.store.continue79
pred.store.if78: ; preds = %pred.store.continue77
%gep92 = getelementptr i8, ptr %invariant.gep91, i64 %index62
%110 = extractelement <8 x i8> %wide.load63, i64 7
%111 = add nsw i8 %110, -32
store i8 %111, ptr %gep92, align 1, !tbaa !9
br label %pred.store.continue79
pred.store.continue79: ; preds = %pred.store.if78, %pred.store.continue77
%index.next80 = add nuw i64 %index62, 8
%112 = icmp eq i64 %index.next80, %n.vec60
br i1 %112, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !14
vec.epilog.middle.block: ; preds = %pred.store.continue79
%cmp.n61 = icmp eq i64 %n.mod.vf59, 0
br i1 %cmp.n61, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec60, %vec.epilog.middle.block ]
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ %indvars.iv.ph, %while.body.preheader ]
%add.ptr = getelementptr inbounds i8, ptr %str, i64 %indvars.iv
%113 = load i8, ptr %add.ptr, align 1, !tbaa !9
%114 = add i8 %113, -97
%or.cond = icmp ult i8 %114, 26
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %while.body
%sub = add nsw i8 %113, -32
store i8 %sub, ptr %add.ptr, align 1, !tbaa !9
br label %if.end
if.end: ; preds = %if.then, %while.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 %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %if.end, %middle.block, %vec.epilog.middle.block, %entry
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %str)
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !12, !13}
!15 = distinct !{!15, !11, !13, !12}
|
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int cnt = (n % 4 == 0);
for (int i = 0; i < 2 * n; ++i) {
int base = i * 2 - (i % 2 != 0);
for (int j = 0; j < 2 * n; ++j) {
if (i == 0 && j == 0)
continue;
int step = base + 2 * j;
if (step > n)
break;
if ((n - step) % (2 * (2 - i % 2)) != 0)
continue;
cnt += 4 * (1 + (j != 0 && i != 0));
}
}
printf("%d\n", cnt);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_27166/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_27166/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 = and i32 %0, 3
%cmp = icmp eq i32 %1, 0
%conv = zext i1 %cmp to i32
%cmp163 = icmp sgt i32 %0, 0
br i1 %cmp163, label %for.body.us.preheader, label %for.cond.cleanup
for.body.us.preheader: ; preds = %entry
%mul = shl nuw i32 %0, 1
%smax = call i32 @llvm.smax.i32(i32 %mul, i32 1)
%exitcond.peel.not = icmp eq i32 %smax, 1
%exitcond96.not.peel = icmp eq i32 %smax, 1
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %cleanup38.us
%cnt.066.us = phi i32 [ %cnt.1.lcssa.us, %cleanup38.us ], [ %conv, %for.body.us.preheader ]
%i.064.us = phi i32 [ %inc40.us, %cleanup38.us ], [ 0, %for.body.us.preheader ]
%mul3.us = shl nuw nsw i32 %i.064.us, 1
%rem4.us = and i32 %i.064.us, 1
%sub.us = sub nsw i32 %mul3.us, %rem4.us
%2 = shl nuw nsw i32 %rem4.us, 1
%mul25.us = sub nuw nsw i32 4, %2
%cmp33.us.not = icmp eq i32 %i.064.us, 0
br i1 %cmp33.us.not, label %for.inc.us.us.peel, label %if.end.us72.peel
for.inc.us.us.peel: ; preds = %for.body.us
br i1 %exitcond96.not.peel, label %cleanup38.us, label %for.body12.us.us
if.end.us72.peel: ; preds = %for.body.us
%cmp18.us75.peel = icmp sgt i32 %sub.us, %0
br i1 %cmp18.us75.peel, label %cleanup38.us, label %if.end21.us76.peel
if.end21.us76.peel: ; preds = %if.end.us72.peel
%sub22.us77.peel = sub nsw i32 %0, %sub.us
%rem26.us78.peel = srem i32 %sub22.us77.peel, %mul25.us
%cmp27.not.us79.peel = icmp eq i32 %rem26.us78.peel, 0
%add37.us89.peel = add nsw i32 %cnt.066.us, 4
%spec.select = select i1 %cmp27.not.us79.peel, i32 %add37.us89.peel, i32 %cnt.066.us
br i1 %exitcond.peel.not, label %cleanup38.us, label %if.end.us72
if.end.us72: ; preds = %if.end21.us76.peel, %if.end21.us76
%cnt.160.us69 = phi i32 [ %spec.select100, %if.end21.us76 ], [ %spec.select, %if.end21.us76.peel ]
%j.059.us70 = phi i32 [ %inc.us83, %if.end21.us76 ], [ 1, %if.end21.us76.peel ]
%mul17.us73 = shl nuw nsw i32 %j.059.us70, 1
%add.us74 = add nsw i32 %mul17.us73, %sub.us
%cmp18.us75 = icmp sgt i32 %add.us74, %0
br i1 %cmp18.us75, label %cleanup38.us, label %if.end21.us76
if.end21.us76: ; preds = %if.end.us72
%sub22.us77 = sub nsw i32 %0, %add.us74
%rem26.us78 = srem i32 %sub22.us77, %mul25.us
%cmp27.not.us79 = icmp eq i32 %rem26.us78, 0
%add37.us89 = add nsw i32 %cnt.160.us69, 8
%spec.select100 = select i1 %cmp27.not.us79, i32 %add37.us89, i32 %cnt.160.us69
%inc.us83 = add nuw nsw i32 %j.059.us70, 1
%exitcond.not = icmp eq i32 %mul, %inc.us83
br i1 %exitcond.not, label %cleanup38.us, label %if.end.us72, !llvm.loop !9
cleanup38.us: ; preds = %if.end21.us76, %if.end.us72, %for.inc.us.us.peel, %if.end21.us.us, %for.body12.us.us, %if.end.us72.peel, %if.end21.us76.peel
%cnt.1.lcssa.us = phi i32 [ %cnt.066.us, %if.end.us72.peel ], [ %spec.select, %if.end21.us76.peel ], [ %cnt.066.us, %for.inc.us.us.peel ], [ %spec.select92, %if.end21.us.us ], [ %cnt.160.us.us, %for.body12.us.us ], [ %spec.select100, %if.end21.us76 ], [ %cnt.160.us69, %if.end.us72 ]
%inc40.us = add nuw nsw i32 %i.064.us, 1
%exitcond97.not = icmp eq i32 %inc40.us, %smax
br i1 %exitcond97.not, label %for.cond.cleanup, label %for.body.us, !llvm.loop !12
for.body12.us.us: ; preds = %for.inc.us.us.peel, %if.end21.us.us
%cnt.160.us.us = phi i32 [ %spec.select92, %if.end21.us.us ], [ %cnt.066.us, %for.inc.us.us.peel ]
%j.059.us.us = phi i32 [ %inc.us.us, %if.end21.us.us ], [ 1, %for.inc.us.us.peel ]
%mul17.us.us = shl nuw nsw i32 %j.059.us.us, 1
%add.us.us = add nsw i32 %mul17.us.us, %sub.us
%cmp18.us.us = icmp sgt i32 %add.us.us, %0
br i1 %cmp18.us.us, label %cleanup38.us, label %if.end21.us.us
if.end21.us.us: ; preds = %for.body12.us.us
%sub22.us.us = sub nsw i32 %0, %add.us.us
%rem26.us.us = srem i32 %sub22.us.us, %mul25.us
%cmp27.not.us.us = icmp eq i32 %rem26.us.us, 0
%add37.us.us = add nsw i32 %cnt.160.us.us, 4
%spec.select92 = select i1 %cmp27.not.us.us, i32 %add37.us.us, i32 %cnt.160.us.us
%inc.us.us = add nuw nsw i32 %j.059.us.us, 1
%exitcond96.not = icmp eq i32 %mul, %inc.us.us
br i1 %exitcond96.not, label %cleanup38.us, label %for.body12.us.us, !llvm.loop !13
for.cond.cleanup: ; preds = %cleanup38.us, %entry
%cnt.0.lcssa = phi i32 [ %conv, %entry ], [ %cnt.1.lcssa.us, %cleanup38.us ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !11}
|
#include <stdio.h>
int main(void){
int N,i,count;
scanf("%d",&N);
int a[N+1];
a[0] = -1;
for(i=1;i<N+1;i++){
scanf("%d",&a[i]);
}
for(i=1;i<N+1;i++){
if(a[a[i]] == i){count++;}
}
count /= 2;
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271702/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271702/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
store i32 -1, ptr %vla, align 16, !tbaa !5
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not26 = icmp slt i32 %3, 1
br i1 %cmp.not26, label %for.end16, label %for.body
for.cond4.preheader: ; preds = %for.body
%cmp6.not28 = icmp slt i32 %8, 1
br i1 %cmp6.not28, label %for.end16, label %for.body7.preheader
for.body7.preheader: ; preds = %for.cond4.preheader
%4 = add nuw i32 %8, 1
%wide.trip.count = zext i32 %4 to i64
%5 = add nsw i64 %wide.trip.count, -1
%6 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %5, 3
%7 = icmp ult i64 %6, 3
br i1 %7, label %for.end16.loopexit.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = and i64 %5, -4
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %N, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %9
br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body7: ; preds = %for.body7, %for.body7.preheader.new
%indvars.iv34 = phi i64 [ 1, %for.body7.preheader.new ], [ %indvars.iv.next35.3, %for.body7 ]
%count.029 = phi i32 [ undef, %for.body7.preheader.new ], [ %spec.select.3, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.3, %for.body7 ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv34
%10 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%idxprom10 = sext i32 %10 to i64
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %idxprom10
%11 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%12 = zext i32 %11 to i64
%cmp12 = icmp eq i64 %indvars.iv34, %12
%inc13 = zext i1 %cmp12 to i32
%spec.select = add nsw i32 %count.029, %inc13
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%arrayidx9.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next35
%13 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%idxprom10.1 = sext i32 %13 to i64
%arrayidx11.1 = getelementptr inbounds i32, ptr %vla, i64 %idxprom10.1
%14 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%15 = zext i32 %14 to i64
%cmp12.1 = icmp eq i64 %indvars.iv.next35, %15
%inc13.1 = zext i1 %cmp12.1 to i32
%spec.select.1 = add nsw i32 %spec.select, %inc13.1
%indvars.iv.next35.1 = add nuw nsw i64 %indvars.iv34, 2
%arrayidx9.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next35.1
%16 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5
%idxprom10.2 = sext i32 %16 to i64
%arrayidx11.2 = getelementptr inbounds i32, ptr %vla, i64 %idxprom10.2
%17 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5
%18 = zext i32 %17 to i64
%cmp12.2 = icmp eq i64 %indvars.iv.next35.1, %18
%inc13.2 = zext i1 %cmp12.2 to i32
%spec.select.2 = add nsw i32 %spec.select.1, %inc13.2
%indvars.iv.next35.2 = add nuw nsw i64 %indvars.iv34, 3
%arrayidx9.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next35.2
%19 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5
%idxprom10.3 = sext i32 %19 to i64
%arrayidx11.3 = getelementptr inbounds i32, ptr %vla, i64 %idxprom10.3
%20 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%21 = zext i32 %20 to i64
%cmp12.3 = icmp eq i64 %indvars.iv.next35.2, %21
%inc13.3 = zext i1 %cmp12.3 to i32
%spec.select.3 = add nsw i32 %spec.select.2, %inc13.3
%indvars.iv.next35.3 = add nuw nsw i64 %indvars.iv34, 4
%niter.next.3 = add nuw i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end16.loopexit.unr-lcssa, label %for.body7, !llvm.loop !11
for.end16.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.preheader
%indvars.iv34.unr = phi i64 [ 1, %for.body7.preheader ], [ %indvars.iv.next35.3, %for.body7 ]
%count.029.unr = phi i32 [ undef, %for.body7.preheader ], [ %spec.select.3, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end16.loopexit, label %for.body7.epil
for.body7.epil: ; preds = %for.end16.loopexit.unr-lcssa, %for.body7.epil
%indvars.iv34.epil = phi i64 [ %indvars.iv.next35.epil, %for.body7.epil ], [ %indvars.iv34.unr, %for.end16.loopexit.unr-lcssa ]
%count.029.epil = phi i32 [ %spec.select.epil, %for.body7.epil ], [ %count.029.unr, %for.end16.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body7.epil ], [ 0, %for.end16.loopexit.unr-lcssa ]
%arrayidx9.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv34.epil
%22 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
%idxprom10.epil = sext i32 %22 to i64
%arrayidx11.epil = getelementptr inbounds i32, ptr %vla, i64 %idxprom10.epil
%23 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%24 = zext i32 %23 to i64
%cmp12.epil = icmp eq i64 %indvars.iv34.epil, %24
%inc13.epil = zext i1 %cmp12.epil to i32
%spec.select.epil = add nsw i32 %count.029.epil, %inc13.epil
%indvars.iv.next35.epil = add nuw nsw i64 %indvars.iv34.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end16.loopexit, label %for.body7.epil, !llvm.loop !12
for.end16.loopexit: ; preds = %for.body7.epil, %for.end16.loopexit.unr-lcssa
%spec.select.lcssa = phi i32 [ %count.029.unr, %for.end16.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body7.epil ]
%25 = sdiv i32 %spec.select.lcssa, 2
br label %for.end16
for.end16: ; preds = %entry, %for.end16.loopexit, %for.cond4.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ %25, %for.end16.loopexit ], [ 0, %entry ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main(void)
{
int card[4][13] = {{0}};
int n, i, rank;
char mark, gomi;
scanf("%d", &n);
for(i = 0;i < n;i++){
scanf("%c%c %d", &gomi, &mark, &rank);
if(mark == 'S'){
card[0][rank - 1] = 1;
} else if(mark == 'H'){
card[1][rank - 1] = 1;
} else if(mark == 'C'){
card[2][rank - 1] = 1;
} else if(mark == 'D'){
card[3][rank - 1] = 1;
}
}
for(i = 0;i < 13;i++){
if(card[0][i] == 0){
printf("S %d\n", i + 1);
}
}
for(i = 0;i < 13;i++){
if(card[1][i] == 0){
printf("H %d\n", i + 1);
}
}
for(i = 0;i < 13;i++){
if(card[2][i] == 0){
printf("C %d\n", i + 1);
}
}
for(i = 0;i < 13;i++){
if(card[3][i] == 0){
printf("D %d\n", i + 1);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271746/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271746/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%c%c %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%card = alloca [4 x [13 x i32]], align 16
%n = alloca i32, align 4
%rank = alloca i32, align 4
%mark = alloca i8, align 1
%gomi = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %card) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %card, i8 0, i64 208, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %rank) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %mark) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %gomi) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp114 = icmp sgt i32 %0, 0
br i1 %cmp114, label %for.body, label %for.cond34.preheader
for.cond34.preheader: ; preds = %for.inc, %entry
%1 = load i32, ptr %card, align 16, !tbaa !5
%cmp41 = icmp eq i32 %1, 0
br i1 %cmp41, label %if.then43, label %for.inc46
for.body: ; preds = %entry, %for.inc
%i.0115 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %gomi, ptr noundef nonnull %mark, ptr noundef nonnull %rank)
%2 = load i8, ptr %mark, align 1, !tbaa !9
switch i8 %2, label %for.inc [
i8 83, label %if.then
i8 72, label %if.then8
i8 67, label %if.then17
i8 68, label %if.then26
]
if.then: ; preds = %for.body
%3 = load i32, ptr %rank, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%idxprom = sext i32 %sub to i64
%arrayidx4 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 %idxprom
br label %for.inc.sink.split
if.then8: ; preds = %for.body
%4 = load i32, ptr %rank, align 4, !tbaa !5
%sub10 = add nsw i32 %4, -1
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 %idxprom11
br label %for.inc.sink.split
if.then17: ; preds = %for.body
%5 = load i32, ptr %rank, align 4, !tbaa !5
%sub19 = add nsw i32 %5, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 %idxprom20
br label %for.inc.sink.split
if.then26: ; preds = %for.body
%6 = load i32, ptr %rank, align 4, !tbaa !5
%sub28 = add nsw i32 %6, -1
%idxprom29 = sext i32 %sub28 to i64
%arrayidx30 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 %idxprom29
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then8, %if.then26, %if.then17, %if.then
%arrayidx4.sink = phi ptr [ %arrayidx4, %if.then ], [ %arrayidx21, %if.then17 ], [ %arrayidx30, %if.then26 ], [ %arrayidx12, %if.then8 ]
store i32 1, ptr %arrayidx4.sink, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc = add nuw nsw i32 %i.0115, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %7
br i1 %cmp, label %for.body, label %for.cond34.preheader, !llvm.loop !10
if.then43: ; preds = %for.cond34.preheader
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc46
for.inc46: ; preds = %for.cond34.preheader, %if.then43
%arrayidx40.1 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 1
%8 = load i32, ptr %arrayidx40.1, align 4, !tbaa !5
%cmp41.1 = icmp eq i32 %8, 0
br i1 %cmp41.1, label %if.then43.1, label %for.inc46.1
if.then43.1: ; preds = %for.inc46
%call44.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc46.1
for.inc46.1: ; preds = %if.then43.1, %for.inc46
%arrayidx40.2 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 2
%9 = load i32, ptr %arrayidx40.2, align 8, !tbaa !5
%cmp41.2 = icmp eq i32 %9, 0
br i1 %cmp41.2, label %if.then43.2, label %for.inc46.2
if.then43.2: ; preds = %for.inc46.1
%call44.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc46.2
for.inc46.2: ; preds = %if.then43.2, %for.inc46.1
%arrayidx40.3 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 3
%10 = load i32, ptr %arrayidx40.3, align 4, !tbaa !5
%cmp41.3 = icmp eq i32 %10, 0
br i1 %cmp41.3, label %if.then43.3, label %for.inc46.3
if.then43.3: ; preds = %for.inc46.2
%call44.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc46.3
for.inc46.3: ; preds = %if.then43.3, %for.inc46.2
%arrayidx40.4 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 4
%11 = load i32, ptr %arrayidx40.4, align 16, !tbaa !5
%cmp41.4 = icmp eq i32 %11, 0
br i1 %cmp41.4, label %if.then43.4, label %for.inc46.4
if.then43.4: ; preds = %for.inc46.3
%call44.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc46.4
for.inc46.4: ; preds = %if.then43.4, %for.inc46.3
%arrayidx40.5 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 5
%12 = load i32, ptr %arrayidx40.5, align 4, !tbaa !5
%cmp41.5 = icmp eq i32 %12, 0
br i1 %cmp41.5, label %if.then43.5, label %for.inc46.5
if.then43.5: ; preds = %for.inc46.4
%call44.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc46.5
for.inc46.5: ; preds = %if.then43.5, %for.inc46.4
%arrayidx40.6 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 6
%13 = load i32, ptr %arrayidx40.6, align 8, !tbaa !5
%cmp41.6 = icmp eq i32 %13, 0
br i1 %cmp41.6, label %if.then43.6, label %for.inc46.6
if.then43.6: ; preds = %for.inc46.5
%call44.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc46.6
for.inc46.6: ; preds = %if.then43.6, %for.inc46.5
%arrayidx40.7 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 7
%14 = load i32, ptr %arrayidx40.7, align 4, !tbaa !5
%cmp41.7 = icmp eq i32 %14, 0
br i1 %cmp41.7, label %if.then43.7, label %for.inc46.7
if.then43.7: ; preds = %for.inc46.6
%call44.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc46.7
for.inc46.7: ; preds = %if.then43.7, %for.inc46.6
%arrayidx40.8 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 8
%15 = load i32, ptr %arrayidx40.8, align 16, !tbaa !5
%cmp41.8 = icmp eq i32 %15, 0
br i1 %cmp41.8, label %if.then43.8, label %for.inc46.8
if.then43.8: ; preds = %for.inc46.7
%call44.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc46.8
for.inc46.8: ; preds = %if.then43.8, %for.inc46.7
%arrayidx40.9 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 9
%16 = load i32, ptr %arrayidx40.9, align 4, !tbaa !5
%cmp41.9 = icmp eq i32 %16, 0
br i1 %cmp41.9, label %if.then43.9, label %for.inc46.9
if.then43.9: ; preds = %for.inc46.8
%call44.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc46.9
for.inc46.9: ; preds = %if.then43.9, %for.inc46.8
%arrayidx40.10 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 10
%17 = load i32, ptr %arrayidx40.10, align 8, !tbaa !5
%cmp41.10 = icmp eq i32 %17, 0
br i1 %cmp41.10, label %if.then43.10, label %for.inc46.10
if.then43.10: ; preds = %for.inc46.9
%call44.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc46.10
for.inc46.10: ; preds = %if.then43.10, %for.inc46.9
%arrayidx40.11 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 11
%18 = load i32, ptr %arrayidx40.11, align 4, !tbaa !5
%cmp41.11 = icmp eq i32 %18, 0
br i1 %cmp41.11, label %if.then43.11, label %for.inc46.11
if.then43.11: ; preds = %for.inc46.10
%call44.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %for.inc46.11
for.inc46.11: ; preds = %if.then43.11, %for.inc46.10
%arrayidx40.12 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 12
%19 = load i32, ptr %arrayidx40.12, align 16, !tbaa !5
%cmp41.12 = icmp eq i32 %19, 0
br i1 %cmp41.12, label %if.then43.12, label %for.inc46.12
if.then43.12: ; preds = %for.inc46.11
%call44.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 13)
br label %for.inc46.12
for.inc46.12: ; preds = %if.then43.12, %for.inc46.11
%arrayidx55 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 0
%20 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%cmp56 = icmp eq i32 %20, 0
br i1 %cmp56, label %if.then58, label %for.inc62
if.then58: ; preds = %for.inc46.12
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc62
for.inc62: ; preds = %for.inc46.12, %if.then58
%arrayidx55.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 1
%21 = load i32, ptr %arrayidx55.1, align 8, !tbaa !5
%cmp56.1 = icmp eq i32 %21, 0
br i1 %cmp56.1, label %if.then58.1, label %for.inc62.1
if.then58.1: ; preds = %for.inc62
%call60.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc62.1
for.inc62.1: ; preds = %if.then58.1, %for.inc62
%arrayidx55.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 2
%22 = load i32, ptr %arrayidx55.2, align 4, !tbaa !5
%cmp56.2 = icmp eq i32 %22, 0
br i1 %cmp56.2, label %if.then58.2, label %for.inc62.2
if.then58.2: ; preds = %for.inc62.1
%call60.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc62.2
for.inc62.2: ; preds = %if.then58.2, %for.inc62.1
%arrayidx55.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 3
%23 = load i32, ptr %arrayidx55.3, align 16, !tbaa !5
%cmp56.3 = icmp eq i32 %23, 0
br i1 %cmp56.3, label %if.then58.3, label %for.inc62.3
if.then58.3: ; preds = %for.inc62.2
%call60.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc62.3
for.inc62.3: ; preds = %if.then58.3, %for.inc62.2
%arrayidx55.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 4
%24 = load i32, ptr %arrayidx55.4, align 4, !tbaa !5
%cmp56.4 = icmp eq i32 %24, 0
br i1 %cmp56.4, label %if.then58.4, label %for.inc62.4
if.then58.4: ; preds = %for.inc62.3
%call60.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc62.4
for.inc62.4: ; preds = %if.then58.4, %for.inc62.3
%arrayidx55.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 5
%25 = load i32, ptr %arrayidx55.5, align 8, !tbaa !5
%cmp56.5 = icmp eq i32 %25, 0
br i1 %cmp56.5, label %if.then58.5, label %for.inc62.5
if.then58.5: ; preds = %for.inc62.4
%call60.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc62.5
for.inc62.5: ; preds = %if.then58.5, %for.inc62.4
%arrayidx55.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 6
%26 = load i32, ptr %arrayidx55.6, align 4, !tbaa !5
%cmp56.6 = icmp eq i32 %26, 0
br i1 %cmp56.6, label %if.then58.6, label %for.inc62.6
if.then58.6: ; preds = %for.inc62.5
%call60.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc62.6
for.inc62.6: ; preds = %if.then58.6, %for.inc62.5
%arrayidx55.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 7
%27 = load i32, ptr %arrayidx55.7, align 16, !tbaa !5
%cmp56.7 = icmp eq i32 %27, 0
br i1 %cmp56.7, label %if.then58.7, label %for.inc62.7
if.then58.7: ; preds = %for.inc62.6
%call60.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc62.7
for.inc62.7: ; preds = %if.then58.7, %for.inc62.6
%arrayidx55.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 8
%28 = load i32, ptr %arrayidx55.8, align 4, !tbaa !5
%cmp56.8 = icmp eq i32 %28, 0
br i1 %cmp56.8, label %if.then58.8, label %for.inc62.8
if.then58.8: ; preds = %for.inc62.7
%call60.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc62.8
for.inc62.8: ; preds = %if.then58.8, %for.inc62.7
%arrayidx55.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 9
%29 = load i32, ptr %arrayidx55.9, align 8, !tbaa !5
%cmp56.9 = icmp eq i32 %29, 0
br i1 %cmp56.9, label %if.then58.9, label %for.inc62.9
if.then58.9: ; preds = %for.inc62.8
%call60.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc62.9
for.inc62.9: ; preds = %if.then58.9, %for.inc62.8
%arrayidx55.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 10
%30 = load i32, ptr %arrayidx55.10, align 4, !tbaa !5
%cmp56.10 = icmp eq i32 %30, 0
br i1 %cmp56.10, label %if.then58.10, label %for.inc62.10
if.then58.10: ; preds = %for.inc62.9
%call60.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc62.10
for.inc62.10: ; preds = %if.then58.10, %for.inc62.9
%arrayidx55.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 11
%31 = load i32, ptr %arrayidx55.11, align 16, !tbaa !5
%cmp56.11 = icmp eq i32 %31, 0
br i1 %cmp56.11, label %if.then58.11, label %for.inc62.11
if.then58.11: ; preds = %for.inc62.10
%call60.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc62.11
for.inc62.11: ; preds = %if.then58.11, %for.inc62.10
%arrayidx55.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 12
%32 = load i32, ptr %arrayidx55.12, align 4, !tbaa !5
%cmp56.12 = icmp eq i32 %32, 0
br i1 %cmp56.12, label %if.then58.12, label %for.inc62.12
if.then58.12: ; preds = %for.inc62.11
%call60.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 13)
br label %for.inc62.12
for.inc62.12: ; preds = %if.then58.12, %for.inc62.11
%arrayidx71 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 0
%33 = load i32, ptr %arrayidx71, align 8, !tbaa !5
%cmp72 = icmp eq i32 %33, 0
br i1 %cmp72, label %if.then74, label %for.inc78
if.then74: ; preds = %for.inc62.12
%call76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc78
for.inc78: ; preds = %for.inc62.12, %if.then74
%arrayidx71.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 1
%34 = load i32, ptr %arrayidx71.1, align 4, !tbaa !5
%cmp72.1 = icmp eq i32 %34, 0
br i1 %cmp72.1, label %if.then74.1, label %for.inc78.1
if.then74.1: ; preds = %for.inc78
%call76.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc78.1
for.inc78.1: ; preds = %if.then74.1, %for.inc78
%arrayidx71.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 2
%35 = load i32, ptr %arrayidx71.2, align 16, !tbaa !5
%cmp72.2 = icmp eq i32 %35, 0
br i1 %cmp72.2, label %if.then74.2, label %for.inc78.2
if.then74.2: ; preds = %for.inc78.1
%call76.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc78.2
for.inc78.2: ; preds = %if.then74.2, %for.inc78.1
%arrayidx71.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 3
%36 = load i32, ptr %arrayidx71.3, align 4, !tbaa !5
%cmp72.3 = icmp eq i32 %36, 0
br i1 %cmp72.3, label %if.then74.3, label %for.inc78.3
if.then74.3: ; preds = %for.inc78.2
%call76.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc78.3
for.inc78.3: ; preds = %if.then74.3, %for.inc78.2
%arrayidx71.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 4
%37 = load i32, ptr %arrayidx71.4, align 8, !tbaa !5
%cmp72.4 = icmp eq i32 %37, 0
br i1 %cmp72.4, label %if.then74.4, label %for.inc78.4
if.then74.4: ; preds = %for.inc78.3
%call76.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc78.4
for.inc78.4: ; preds = %if.then74.4, %for.inc78.3
%arrayidx71.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 5
%38 = load i32, ptr %arrayidx71.5, align 4, !tbaa !5
%cmp72.5 = icmp eq i32 %38, 0
br i1 %cmp72.5, label %if.then74.5, label %for.inc78.5
if.then74.5: ; preds = %for.inc78.4
%call76.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc78.5
for.inc78.5: ; preds = %if.then74.5, %for.inc78.4
%arrayidx71.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 6
%39 = load i32, ptr %arrayidx71.6, align 16, !tbaa !5
%cmp72.6 = icmp eq i32 %39, 0
br i1 %cmp72.6, label %if.then74.6, label %for.inc78.6
if.then74.6: ; preds = %for.inc78.5
%call76.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc78.6
for.inc78.6: ; preds = %if.then74.6, %for.inc78.5
%arrayidx71.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 7
%40 = load i32, ptr %arrayidx71.7, align 4, !tbaa !5
%cmp72.7 = icmp eq i32 %40, 0
br i1 %cmp72.7, label %if.then74.7, label %for.inc78.7
if.then74.7: ; preds = %for.inc78.6
%call76.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc78.7
for.inc78.7: ; preds = %if.then74.7, %for.inc78.6
%arrayidx71.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 8
%41 = load i32, ptr %arrayidx71.8, align 8, !tbaa !5
%cmp72.8 = icmp eq i32 %41, 0
br i1 %cmp72.8, label %if.then74.8, label %for.inc78.8
if.then74.8: ; preds = %for.inc78.7
%call76.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc78.8
for.inc78.8: ; preds = %if.then74.8, %for.inc78.7
%arrayidx71.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 9
%42 = load i32, ptr %arrayidx71.9, align 4, !tbaa !5
%cmp72.9 = icmp eq i32 %42, 0
br i1 %cmp72.9, label %if.then74.9, label %for.inc78.9
if.then74.9: ; preds = %for.inc78.8
%call76.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc78.9
for.inc78.9: ; preds = %if.then74.9, %for.inc78.8
%arrayidx71.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 10
%43 = load i32, ptr %arrayidx71.10, align 16, !tbaa !5
%cmp72.10 = icmp eq i32 %43, 0
br i1 %cmp72.10, label %if.then74.10, label %for.inc78.10
if.then74.10: ; preds = %for.inc78.9
%call76.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc78.10
for.inc78.10: ; preds = %if.then74.10, %for.inc78.9
%arrayidx71.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 11
%44 = load i32, ptr %arrayidx71.11, align 4, !tbaa !5
%cmp72.11 = icmp eq i32 %44, 0
br i1 %cmp72.11, label %if.then74.11, label %for.inc78.11
if.then74.11: ; preds = %for.inc78.10
%call76.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc78.11
for.inc78.11: ; preds = %if.then74.11, %for.inc78.10
%arrayidx71.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 12
%45 = load i32, ptr %arrayidx71.12, align 8, !tbaa !5
%cmp72.12 = icmp eq i32 %45, 0
br i1 %cmp72.12, label %if.then74.12, label %for.inc78.12
if.then74.12: ; preds = %for.inc78.11
%call76.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 13)
br label %for.inc78.12
for.inc78.12: ; preds = %if.then74.12, %for.inc78.11
%arrayidx87 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 0
%46 = load i32, ptr %arrayidx87, align 4, !tbaa !5
%cmp88 = icmp eq i32 %46, 0
br i1 %cmp88, label %if.then90, label %for.inc94
if.then90: ; preds = %for.inc78.12
%call92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc94
for.inc94: ; preds = %for.inc78.12, %if.then90
%arrayidx87.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 1
%47 = load i32, ptr %arrayidx87.1, align 16, !tbaa !5
%cmp88.1 = icmp eq i32 %47, 0
br i1 %cmp88.1, label %if.then90.1, label %for.inc94.1
if.then90.1: ; preds = %for.inc94
%call92.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc94.1
for.inc94.1: ; preds = %if.then90.1, %for.inc94
%arrayidx87.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 2
%48 = load i32, ptr %arrayidx87.2, align 4, !tbaa !5
%cmp88.2 = icmp eq i32 %48, 0
br i1 %cmp88.2, label %if.then90.2, label %for.inc94.2
if.then90.2: ; preds = %for.inc94.1
%call92.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc94.2
for.inc94.2: ; preds = %if.then90.2, %for.inc94.1
%arrayidx87.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 3
%49 = load i32, ptr %arrayidx87.3, align 8, !tbaa !5
%cmp88.3 = icmp eq i32 %49, 0
br i1 %cmp88.3, label %if.then90.3, label %for.inc94.3
if.then90.3: ; preds = %for.inc94.2
%call92.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc94.3
for.inc94.3: ; preds = %if.then90.3, %for.inc94.2
%arrayidx87.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 4
%50 = load i32, ptr %arrayidx87.4, align 4, !tbaa !5
%cmp88.4 = icmp eq i32 %50, 0
br i1 %cmp88.4, label %if.then90.4, label %for.inc94.4
if.then90.4: ; preds = %for.inc94.3
%call92.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc94.4
for.inc94.4: ; preds = %if.then90.4, %for.inc94.3
%arrayidx87.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 5
%51 = load i32, ptr %arrayidx87.5, align 16, !tbaa !5
%cmp88.5 = icmp eq i32 %51, 0
br i1 %cmp88.5, label %if.then90.5, label %for.inc94.5
if.then90.5: ; preds = %for.inc94.4
%call92.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc94.5
for.inc94.5: ; preds = %if.then90.5, %for.inc94.4
%arrayidx87.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 6
%52 = load i32, ptr %arrayidx87.6, align 4, !tbaa !5
%cmp88.6 = icmp eq i32 %52, 0
br i1 %cmp88.6, label %if.then90.6, label %for.inc94.6
if.then90.6: ; preds = %for.inc94.5
%call92.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc94.6
for.inc94.6: ; preds = %if.then90.6, %for.inc94.5
%arrayidx87.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 7
%53 = load i32, ptr %arrayidx87.7, align 8, !tbaa !5
%cmp88.7 = icmp eq i32 %53, 0
br i1 %cmp88.7, label %if.then90.7, label %for.inc94.7
if.then90.7: ; preds = %for.inc94.6
%call92.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc94.7
for.inc94.7: ; preds = %if.then90.7, %for.inc94.6
%arrayidx87.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 8
%54 = load i32, ptr %arrayidx87.8, align 4, !tbaa !5
%cmp88.8 = icmp eq i32 %54, 0
br i1 %cmp88.8, label %if.then90.8, label %for.inc94.8
if.then90.8: ; preds = %for.inc94.7
%call92.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc94.8
for.inc94.8: ; preds = %if.then90.8, %for.inc94.7
%arrayidx87.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 9
%55 = load i32, ptr %arrayidx87.9, align 16, !tbaa !5
%cmp88.9 = icmp eq i32 %55, 0
br i1 %cmp88.9, label %if.then90.9, label %for.inc94.9
if.then90.9: ; preds = %for.inc94.8
%call92.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc94.9
for.inc94.9: ; preds = %if.then90.9, %for.inc94.8
%arrayidx87.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 10
%56 = load i32, ptr %arrayidx87.10, align 4, !tbaa !5
%cmp88.10 = icmp eq i32 %56, 0
br i1 %cmp88.10, label %if.then90.10, label %for.inc94.10
if.then90.10: ; preds = %for.inc94.9
%call92.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc94.10
for.inc94.10: ; preds = %if.then90.10, %for.inc94.9
%arrayidx87.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 11
%57 = load i32, ptr %arrayidx87.11, align 8, !tbaa !5
%cmp88.11 = icmp eq i32 %57, 0
br i1 %cmp88.11, label %if.then90.11, label %for.inc94.11
if.then90.11: ; preds = %for.inc94.10
%call92.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc94.11
for.inc94.11: ; preds = %if.then90.11, %for.inc94.10
%arrayidx87.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 12
%58 = load i32, ptr %arrayidx87.12, align 4, !tbaa !5
%cmp88.12 = icmp eq i32 %58, 0
br i1 %cmp88.12, label %if.then90.12, label %for.inc94.12
if.then90.12: ; preds = %for.inc94.11
%call92.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 13)
br label %for.inc94.12
for.inc94.12: ; preds = %if.then90.12, %for.inc94.11
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %gomi) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %mark) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %rank) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %card) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
//
// main.c
// 15
//
// Created by x14005xx on 2016/05/09.
// Copyright (c) 2016??´ Isikawa yuuki. All rights reserved.
//
#include <stdio.h>
#include <stdbool.h>//boolean???????????????????????????
int main(int argc, const char * argv[])
{
int N,i,j,x;
char arr;//S???H???C???D?????\???
bool K[4][14];//???????????????true???false?????\???;
for(i=0;i<4;i++){
for(j=1;j<=13;j++){
K[i][j]=false;
}
}
scanf("%d",&N);
if(N<=52){
for(i=0;i<N;i++){
scanf(" %c %d",&arr,&x);
if(arr=='S'){
K[0][x]=true;
}else if(arr=='H'){
K[1][x]=true;
}else if(arr=='C'){
K[2][x]=true;
}else if(arr=='D'){
K[3][x]=true;
}
}
for(i=0;i<4;i++){
for(j=1;j<=13;j++){
if(K[i][j]!=true){
if(i==0){
printf("S %d\n",j);
}
if(i==1){
printf("H %d\n",j);
}
if(i==2){
printf("C %d\n",j);
}
if(i==3){
printf("D %d\n",j);
}
}
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c" %c %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%x = alloca i32, align 4
%arr = alloca i8, align 1
%K = alloca [4 x [14 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %arr) #4
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %K) #4
%scevgep = getelementptr inbounds i8, ptr %K, i64 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep, i8 0, i64 13, i1 false), !tbaa !5
%scevgep.1 = getelementptr inbounds i8, ptr %K, i64 15
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep.1, i8 0, i64 13, i1 false), !tbaa !5
%scevgep.2 = getelementptr inbounds i8, ptr %K, i64 29
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep.2, i8 0, i64 13, i1 false), !tbaa !5
%scevgep.3 = getelementptr inbounds i8, ptr %K, i64 43
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep.3, i8 0, i64 13, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !9
%cmp9 = icmp slt i32 %0, 53
br i1 %cmp9, label %for.cond10.preheader, label %if.end92
for.cond10.preheader: ; preds = %entry
%cmp11115 = icmp sgt i32 %0, 0
br i1 %cmp11115, label %for.body12, label %for.cond53.preheader.preheader
for.body12: ; preds = %for.cond10.preheader, %for.inc46
%i.1116 = phi i32 [ %inc47, %for.inc46 ], [ 0, %for.cond10.preheader ]
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arr, ptr noundef nonnull %x)
%1 = load i8, ptr %arr, align 1, !tbaa !11
switch i8 %1, label %for.inc46 [
i8 83, label %if.then16
i8 72, label %if.then23
i8 67, label %if.then31
i8 68, label %if.then39
]
if.then16: ; preds = %for.body12
%2 = load i32, ptr %x, align 4, !tbaa !9
%idxprom18 = sext i32 %2 to i64
%arrayidx19 = getelementptr inbounds [14 x i8], ptr %K, i64 0, i64 %idxprom18
br label %for.inc46.sink.split
if.then23: ; preds = %for.body12
%3 = load i32, ptr %x, align 4, !tbaa !9
%idxprom25 = sext i32 %3 to i64
%arrayidx26 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 1, i64 %idxprom25
br label %for.inc46.sink.split
if.then31: ; preds = %for.body12
%4 = load i32, ptr %x, align 4, !tbaa !9
%idxprom33 = sext i32 %4 to i64
%arrayidx34 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 2, i64 %idxprom33
br label %for.inc46.sink.split
if.then39: ; preds = %for.body12
%5 = load i32, ptr %x, align 4, !tbaa !9
%idxprom41 = sext i32 %5 to i64
%arrayidx42 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 3, i64 %idxprom41
br label %for.inc46.sink.split
for.inc46.sink.split: ; preds = %if.then23, %if.then39, %if.then31, %if.then16
%arrayidx19.sink = phi ptr [ %arrayidx19, %if.then16 ], [ %arrayidx34, %if.then31 ], [ %arrayidx42, %if.then39 ], [ %arrayidx26, %if.then23 ]
store i8 1, ptr %arrayidx19.sink, align 1, !tbaa !5
br label %for.inc46
for.inc46: ; preds = %for.inc46.sink.split, %for.body12
%inc47 = add nuw nsw i32 %i.1116, 1
%6 = load i32, ptr %N, align 4, !tbaa !9
%cmp11 = icmp slt i32 %inc47, %6
br i1 %cmp11, label %for.body12, label %for.cond53.preheader.preheader, !llvm.loop !12
for.cond53.preheader.preheader: ; preds = %for.inc46, %for.cond10.preheader
br label %for.cond53.preheader
for.cond53.preheader: ; preds = %for.cond53.preheader.preheader, %for.inc89
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc89 ], [ 0, %for.cond53.preheader.preheader ]
%7 = trunc i64 %indvars.iv to i32
switch i32 %7, label %for.inc89 [
i32 0, label %for.body56.us.preheader
i32 1, label %for.body56.us119.preheader
i32 2, label %for.body56.us129.preheader
i32 3, label %for.body56.us139.preheader
]
for.body56.us139.preheader: ; preds = %for.cond53.preheader
%arrayidx60.us142 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 1
%8 = load i8, ptr %arrayidx60.us142, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143 = icmp eq i8 %8, 0
br i1 %cmp62.not.not.us143, label %if.then64.us144, label %for.inc86.us145
for.body56.us129.preheader: ; preds = %for.cond53.preheader
%arrayidx60.us132 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 1
%9 = load i8, ptr %arrayidx60.us132, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133 = icmp eq i8 %9, 0
br i1 %cmp62.not.not.us133, label %if.then64.us134, label %for.inc86.us135
for.body56.us119.preheader: ; preds = %for.cond53.preheader
%arrayidx60.us122 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 1
%10 = load i8, ptr %arrayidx60.us122, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123 = icmp eq i8 %10, 0
br i1 %cmp62.not.not.us123, label %if.then64.us124, label %for.inc86.us125
for.body56.us.preheader: ; preds = %for.cond53.preheader
%arrayidx60.us = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 1
%11 = load i8, ptr %arrayidx60.us, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us = icmp eq i8 %11, 0
br i1 %cmp62.not.not.us, label %if.then64.us, label %for.inc86.us
if.then64.us: ; preds = %for.body56.us.preheader
%call68.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc86.us
for.inc86.us: ; preds = %if.then64.us, %for.body56.us.preheader
%arrayidx60.us.1 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 2
%12 = load i8, ptr %arrayidx60.us.1, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.1 = icmp eq i8 %12, 0
br i1 %cmp62.not.not.us.1, label %if.then64.us.1, label %for.inc86.us.1
if.then64.us.1: ; preds = %for.inc86.us
%call68.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc86.us.1
for.inc86.us.1: ; preds = %if.then64.us.1, %for.inc86.us
%arrayidx60.us.2 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 3
%13 = load i8, ptr %arrayidx60.us.2, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.2 = icmp eq i8 %13, 0
br i1 %cmp62.not.not.us.2, label %if.then64.us.2, label %for.inc86.us.2
if.then64.us.2: ; preds = %for.inc86.us.1
%call68.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc86.us.2
for.inc86.us.2: ; preds = %if.then64.us.2, %for.inc86.us.1
%arrayidx60.us.3 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 4
%14 = load i8, ptr %arrayidx60.us.3, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.3 = icmp eq i8 %14, 0
br i1 %cmp62.not.not.us.3, label %if.then64.us.3, label %for.inc86.us.3
if.then64.us.3: ; preds = %for.inc86.us.2
%call68.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc86.us.3
for.inc86.us.3: ; preds = %if.then64.us.3, %for.inc86.us.2
%arrayidx60.us.4 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 5
%15 = load i8, ptr %arrayidx60.us.4, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.4 = icmp eq i8 %15, 0
br i1 %cmp62.not.not.us.4, label %if.then64.us.4, label %for.inc86.us.4
if.then64.us.4: ; preds = %for.inc86.us.3
%call68.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc86.us.4
for.inc86.us.4: ; preds = %if.then64.us.4, %for.inc86.us.3
%arrayidx60.us.5 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 6
%16 = load i8, ptr %arrayidx60.us.5, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.5 = icmp eq i8 %16, 0
br i1 %cmp62.not.not.us.5, label %if.then64.us.5, label %for.inc86.us.5
if.then64.us.5: ; preds = %for.inc86.us.4
%call68.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc86.us.5
for.inc86.us.5: ; preds = %if.then64.us.5, %for.inc86.us.4
%arrayidx60.us.6 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 7
%17 = load i8, ptr %arrayidx60.us.6, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.6 = icmp eq i8 %17, 0
br i1 %cmp62.not.not.us.6, label %if.then64.us.6, label %for.inc86.us.6
if.then64.us.6: ; preds = %for.inc86.us.5
%call68.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc86.us.6
for.inc86.us.6: ; preds = %if.then64.us.6, %for.inc86.us.5
%arrayidx60.us.7 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 8
%18 = load i8, ptr %arrayidx60.us.7, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.7 = icmp eq i8 %18, 0
br i1 %cmp62.not.not.us.7, label %if.then64.us.7, label %for.inc86.us.7
if.then64.us.7: ; preds = %for.inc86.us.6
%call68.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc86.us.7
for.inc86.us.7: ; preds = %if.then64.us.7, %for.inc86.us.6
%arrayidx60.us.8 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 9
%19 = load i8, ptr %arrayidx60.us.8, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.8 = icmp eq i8 %19, 0
br i1 %cmp62.not.not.us.8, label %if.then64.us.8, label %for.inc86.us.8
if.then64.us.8: ; preds = %for.inc86.us.7
%call68.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc86.us.8
for.inc86.us.8: ; preds = %if.then64.us.8, %for.inc86.us.7
%arrayidx60.us.9 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 10
%20 = load i8, ptr %arrayidx60.us.9, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.9 = icmp eq i8 %20, 0
br i1 %cmp62.not.not.us.9, label %if.then64.us.9, label %for.inc86.us.9
if.then64.us.9: ; preds = %for.inc86.us.8
%call68.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc86.us.9
for.inc86.us.9: ; preds = %if.then64.us.9, %for.inc86.us.8
%arrayidx60.us.10 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 11
%21 = load i8, ptr %arrayidx60.us.10, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.10 = icmp eq i8 %21, 0
br i1 %cmp62.not.not.us.10, label %if.then64.us.10, label %for.inc86.us.10
if.then64.us.10: ; preds = %for.inc86.us.9
%call68.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc86.us.10
for.inc86.us.10: ; preds = %if.then64.us.10, %for.inc86.us.9
%arrayidx60.us.11 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 12
%22 = load i8, ptr %arrayidx60.us.11, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.11 = icmp eq i8 %22, 0
br i1 %cmp62.not.not.us.11, label %if.then64.us.11, label %for.inc86.us.11
if.then64.us.11: ; preds = %for.inc86.us.10
%call68.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %for.inc86.us.11
for.inc86.us.11: ; preds = %if.then64.us.11, %for.inc86.us.10
%arrayidx60.us.12 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 13
%23 = load i8, ptr %arrayidx60.us.12, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us.12 = icmp eq i8 %23, 0
br i1 %cmp62.not.not.us.12, label %for.inc89.sink.split, label %for.inc89
if.then64.us124: ; preds = %for.body56.us119.preheader
%call73.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc86.us125
for.inc86.us125: ; preds = %if.then64.us124, %for.body56.us119.preheader
%arrayidx60.us122.1 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 2
%24 = load i8, ptr %arrayidx60.us122.1, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.1 = icmp eq i8 %24, 0
br i1 %cmp62.not.not.us123.1, label %if.then64.us124.1, label %for.inc86.us125.1
if.then64.us124.1: ; preds = %for.inc86.us125
%call73.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc86.us125.1
for.inc86.us125.1: ; preds = %if.then64.us124.1, %for.inc86.us125
%arrayidx60.us122.2 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 3
%25 = load i8, ptr %arrayidx60.us122.2, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.2 = icmp eq i8 %25, 0
br i1 %cmp62.not.not.us123.2, label %if.then64.us124.2, label %for.inc86.us125.2
if.then64.us124.2: ; preds = %for.inc86.us125.1
%call73.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc86.us125.2
for.inc86.us125.2: ; preds = %if.then64.us124.2, %for.inc86.us125.1
%arrayidx60.us122.3 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 4
%26 = load i8, ptr %arrayidx60.us122.3, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.3 = icmp eq i8 %26, 0
br i1 %cmp62.not.not.us123.3, label %if.then64.us124.3, label %for.inc86.us125.3
if.then64.us124.3: ; preds = %for.inc86.us125.2
%call73.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc86.us125.3
for.inc86.us125.3: ; preds = %if.then64.us124.3, %for.inc86.us125.2
%arrayidx60.us122.4 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 5
%27 = load i8, ptr %arrayidx60.us122.4, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.4 = icmp eq i8 %27, 0
br i1 %cmp62.not.not.us123.4, label %if.then64.us124.4, label %for.inc86.us125.4
if.then64.us124.4: ; preds = %for.inc86.us125.3
%call73.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc86.us125.4
for.inc86.us125.4: ; preds = %if.then64.us124.4, %for.inc86.us125.3
%arrayidx60.us122.5 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 6
%28 = load i8, ptr %arrayidx60.us122.5, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.5 = icmp eq i8 %28, 0
br i1 %cmp62.not.not.us123.5, label %if.then64.us124.5, label %for.inc86.us125.5
if.then64.us124.5: ; preds = %for.inc86.us125.4
%call73.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc86.us125.5
for.inc86.us125.5: ; preds = %if.then64.us124.5, %for.inc86.us125.4
%arrayidx60.us122.6 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 7
%29 = load i8, ptr %arrayidx60.us122.6, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.6 = icmp eq i8 %29, 0
br i1 %cmp62.not.not.us123.6, label %if.then64.us124.6, label %for.inc86.us125.6
if.then64.us124.6: ; preds = %for.inc86.us125.5
%call73.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc86.us125.6
for.inc86.us125.6: ; preds = %if.then64.us124.6, %for.inc86.us125.5
%arrayidx60.us122.7 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 8
%30 = load i8, ptr %arrayidx60.us122.7, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.7 = icmp eq i8 %30, 0
br i1 %cmp62.not.not.us123.7, label %if.then64.us124.7, label %for.inc86.us125.7
if.then64.us124.7: ; preds = %for.inc86.us125.6
%call73.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc86.us125.7
for.inc86.us125.7: ; preds = %if.then64.us124.7, %for.inc86.us125.6
%arrayidx60.us122.8 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 9
%31 = load i8, ptr %arrayidx60.us122.8, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.8 = icmp eq i8 %31, 0
br i1 %cmp62.not.not.us123.8, label %if.then64.us124.8, label %for.inc86.us125.8
if.then64.us124.8: ; preds = %for.inc86.us125.7
%call73.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc86.us125.8
for.inc86.us125.8: ; preds = %if.then64.us124.8, %for.inc86.us125.7
%arrayidx60.us122.9 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 10
%32 = load i8, ptr %arrayidx60.us122.9, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.9 = icmp eq i8 %32, 0
br i1 %cmp62.not.not.us123.9, label %if.then64.us124.9, label %for.inc86.us125.9
if.then64.us124.9: ; preds = %for.inc86.us125.8
%call73.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc86.us125.9
for.inc86.us125.9: ; preds = %if.then64.us124.9, %for.inc86.us125.8
%arrayidx60.us122.10 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 11
%33 = load i8, ptr %arrayidx60.us122.10, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.10 = icmp eq i8 %33, 0
br i1 %cmp62.not.not.us123.10, label %if.then64.us124.10, label %for.inc86.us125.10
if.then64.us124.10: ; preds = %for.inc86.us125.9
%call73.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc86.us125.10
for.inc86.us125.10: ; preds = %if.then64.us124.10, %for.inc86.us125.9
%arrayidx60.us122.11 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 12
%34 = load i8, ptr %arrayidx60.us122.11, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.11 = icmp eq i8 %34, 0
br i1 %cmp62.not.not.us123.11, label %if.then64.us124.11, label %for.inc86.us125.11
if.then64.us124.11: ; preds = %for.inc86.us125.10
%call73.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc86.us125.11
for.inc86.us125.11: ; preds = %if.then64.us124.11, %for.inc86.us125.10
%arrayidx60.us122.12 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 13
%35 = load i8, ptr %arrayidx60.us122.12, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us123.12 = icmp eq i8 %35, 0
br i1 %cmp62.not.not.us123.12, label %for.inc89.sink.split, label %for.inc89
if.then64.us134: ; preds = %for.body56.us129.preheader
%call78.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc86.us135
for.inc86.us135: ; preds = %if.then64.us134, %for.body56.us129.preheader
%arrayidx60.us132.1 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 2
%36 = load i8, ptr %arrayidx60.us132.1, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.1 = icmp eq i8 %36, 0
br i1 %cmp62.not.not.us133.1, label %if.then64.us134.1, label %for.inc86.us135.1
if.then64.us134.1: ; preds = %for.inc86.us135
%call78.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc86.us135.1
for.inc86.us135.1: ; preds = %if.then64.us134.1, %for.inc86.us135
%arrayidx60.us132.2 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 3
%37 = load i8, ptr %arrayidx60.us132.2, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.2 = icmp eq i8 %37, 0
br i1 %cmp62.not.not.us133.2, label %if.then64.us134.2, label %for.inc86.us135.2
if.then64.us134.2: ; preds = %for.inc86.us135.1
%call78.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc86.us135.2
for.inc86.us135.2: ; preds = %if.then64.us134.2, %for.inc86.us135.1
%arrayidx60.us132.3 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 4
%38 = load i8, ptr %arrayidx60.us132.3, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.3 = icmp eq i8 %38, 0
br i1 %cmp62.not.not.us133.3, label %if.then64.us134.3, label %for.inc86.us135.3
if.then64.us134.3: ; preds = %for.inc86.us135.2
%call78.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc86.us135.3
for.inc86.us135.3: ; preds = %if.then64.us134.3, %for.inc86.us135.2
%arrayidx60.us132.4 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 5
%39 = load i8, ptr %arrayidx60.us132.4, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.4 = icmp eq i8 %39, 0
br i1 %cmp62.not.not.us133.4, label %if.then64.us134.4, label %for.inc86.us135.4
if.then64.us134.4: ; preds = %for.inc86.us135.3
%call78.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc86.us135.4
for.inc86.us135.4: ; preds = %if.then64.us134.4, %for.inc86.us135.3
%arrayidx60.us132.5 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 6
%40 = load i8, ptr %arrayidx60.us132.5, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.5 = icmp eq i8 %40, 0
br i1 %cmp62.not.not.us133.5, label %if.then64.us134.5, label %for.inc86.us135.5
if.then64.us134.5: ; preds = %for.inc86.us135.4
%call78.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc86.us135.5
for.inc86.us135.5: ; preds = %if.then64.us134.5, %for.inc86.us135.4
%arrayidx60.us132.6 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 7
%41 = load i8, ptr %arrayidx60.us132.6, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.6 = icmp eq i8 %41, 0
br i1 %cmp62.not.not.us133.6, label %if.then64.us134.6, label %for.inc86.us135.6
if.then64.us134.6: ; preds = %for.inc86.us135.5
%call78.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc86.us135.6
for.inc86.us135.6: ; preds = %if.then64.us134.6, %for.inc86.us135.5
%arrayidx60.us132.7 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 8
%42 = load i8, ptr %arrayidx60.us132.7, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.7 = icmp eq i8 %42, 0
br i1 %cmp62.not.not.us133.7, label %if.then64.us134.7, label %for.inc86.us135.7
if.then64.us134.7: ; preds = %for.inc86.us135.6
%call78.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc86.us135.7
for.inc86.us135.7: ; preds = %if.then64.us134.7, %for.inc86.us135.6
%arrayidx60.us132.8 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 9
%43 = load i8, ptr %arrayidx60.us132.8, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.8 = icmp eq i8 %43, 0
br i1 %cmp62.not.not.us133.8, label %if.then64.us134.8, label %for.inc86.us135.8
if.then64.us134.8: ; preds = %for.inc86.us135.7
%call78.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc86.us135.8
for.inc86.us135.8: ; preds = %if.then64.us134.8, %for.inc86.us135.7
%arrayidx60.us132.9 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 10
%44 = load i8, ptr %arrayidx60.us132.9, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.9 = icmp eq i8 %44, 0
br i1 %cmp62.not.not.us133.9, label %if.then64.us134.9, label %for.inc86.us135.9
if.then64.us134.9: ; preds = %for.inc86.us135.8
%call78.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc86.us135.9
for.inc86.us135.9: ; preds = %if.then64.us134.9, %for.inc86.us135.8
%arrayidx60.us132.10 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 11
%45 = load i8, ptr %arrayidx60.us132.10, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.10 = icmp eq i8 %45, 0
br i1 %cmp62.not.not.us133.10, label %if.then64.us134.10, label %for.inc86.us135.10
if.then64.us134.10: ; preds = %for.inc86.us135.9
%call78.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc86.us135.10
for.inc86.us135.10: ; preds = %if.then64.us134.10, %for.inc86.us135.9
%arrayidx60.us132.11 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 12
%46 = load i8, ptr %arrayidx60.us132.11, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.11 = icmp eq i8 %46, 0
br i1 %cmp62.not.not.us133.11, label %if.then64.us134.11, label %for.inc86.us135.11
if.then64.us134.11: ; preds = %for.inc86.us135.10
%call78.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc86.us135.11
for.inc86.us135.11: ; preds = %if.then64.us134.11, %for.inc86.us135.10
%arrayidx60.us132.12 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 13
%47 = load i8, ptr %arrayidx60.us132.12, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us133.12 = icmp eq i8 %47, 0
br i1 %cmp62.not.not.us133.12, label %for.inc89.sink.split, label %for.inc89
if.then64.us144: ; preds = %for.body56.us139.preheader
%call83.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc86.us145
for.inc86.us145: ; preds = %if.then64.us144, %for.body56.us139.preheader
%arrayidx60.us142.1 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 2
%48 = load i8, ptr %arrayidx60.us142.1, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.1 = icmp eq i8 %48, 0
br i1 %cmp62.not.not.us143.1, label %if.then64.us144.1, label %for.inc86.us145.1
if.then64.us144.1: ; preds = %for.inc86.us145
%call83.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc86.us145.1
for.inc86.us145.1: ; preds = %if.then64.us144.1, %for.inc86.us145
%arrayidx60.us142.2 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 3
%49 = load i8, ptr %arrayidx60.us142.2, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.2 = icmp eq i8 %49, 0
br i1 %cmp62.not.not.us143.2, label %if.then64.us144.2, label %for.inc86.us145.2
if.then64.us144.2: ; preds = %for.inc86.us145.1
%call83.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc86.us145.2
for.inc86.us145.2: ; preds = %if.then64.us144.2, %for.inc86.us145.1
%arrayidx60.us142.3 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 4
%50 = load i8, ptr %arrayidx60.us142.3, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.3 = icmp eq i8 %50, 0
br i1 %cmp62.not.not.us143.3, label %if.then64.us144.3, label %for.inc86.us145.3
if.then64.us144.3: ; preds = %for.inc86.us145.2
%call83.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc86.us145.3
for.inc86.us145.3: ; preds = %if.then64.us144.3, %for.inc86.us145.2
%arrayidx60.us142.4 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 5
%51 = load i8, ptr %arrayidx60.us142.4, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.4 = icmp eq i8 %51, 0
br i1 %cmp62.not.not.us143.4, label %if.then64.us144.4, label %for.inc86.us145.4
if.then64.us144.4: ; preds = %for.inc86.us145.3
%call83.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc86.us145.4
for.inc86.us145.4: ; preds = %if.then64.us144.4, %for.inc86.us145.3
%arrayidx60.us142.5 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 6
%52 = load i8, ptr %arrayidx60.us142.5, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.5 = icmp eq i8 %52, 0
br i1 %cmp62.not.not.us143.5, label %if.then64.us144.5, label %for.inc86.us145.5
if.then64.us144.5: ; preds = %for.inc86.us145.4
%call83.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc86.us145.5
for.inc86.us145.5: ; preds = %if.then64.us144.5, %for.inc86.us145.4
%arrayidx60.us142.6 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 7
%53 = load i8, ptr %arrayidx60.us142.6, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.6 = icmp eq i8 %53, 0
br i1 %cmp62.not.not.us143.6, label %if.then64.us144.6, label %for.inc86.us145.6
if.then64.us144.6: ; preds = %for.inc86.us145.5
%call83.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc86.us145.6
for.inc86.us145.6: ; preds = %if.then64.us144.6, %for.inc86.us145.5
%arrayidx60.us142.7 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 8
%54 = load i8, ptr %arrayidx60.us142.7, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.7 = icmp eq i8 %54, 0
br i1 %cmp62.not.not.us143.7, label %if.then64.us144.7, label %for.inc86.us145.7
if.then64.us144.7: ; preds = %for.inc86.us145.6
%call83.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc86.us145.7
for.inc86.us145.7: ; preds = %if.then64.us144.7, %for.inc86.us145.6
%arrayidx60.us142.8 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 9
%55 = load i8, ptr %arrayidx60.us142.8, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.8 = icmp eq i8 %55, 0
br i1 %cmp62.not.not.us143.8, label %if.then64.us144.8, label %for.inc86.us145.8
if.then64.us144.8: ; preds = %for.inc86.us145.7
%call83.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc86.us145.8
for.inc86.us145.8: ; preds = %if.then64.us144.8, %for.inc86.us145.7
%arrayidx60.us142.9 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 10
%56 = load i8, ptr %arrayidx60.us142.9, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.9 = icmp eq i8 %56, 0
br i1 %cmp62.not.not.us143.9, label %if.then64.us144.9, label %for.inc86.us145.9
if.then64.us144.9: ; preds = %for.inc86.us145.8
%call83.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc86.us145.9
for.inc86.us145.9: ; preds = %if.then64.us144.9, %for.inc86.us145.8
%arrayidx60.us142.10 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 11
%57 = load i8, ptr %arrayidx60.us142.10, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.10 = icmp eq i8 %57, 0
br i1 %cmp62.not.not.us143.10, label %if.then64.us144.10, label %for.inc86.us145.10
if.then64.us144.10: ; preds = %for.inc86.us145.9
%call83.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc86.us145.10
for.inc86.us145.10: ; preds = %if.then64.us144.10, %for.inc86.us145.9
%arrayidx60.us142.11 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 12
%58 = load i8, ptr %arrayidx60.us142.11, align 2, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.11 = icmp eq i8 %58, 0
br i1 %cmp62.not.not.us143.11, label %if.then64.us144.11, label %for.inc86.us145.11
if.then64.us144.11: ; preds = %for.inc86.us145.10
%call83.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc86.us145.11
for.inc86.us145.11: ; preds = %if.then64.us144.11, %for.inc86.us145.10
%arrayidx60.us142.12 = getelementptr inbounds [4 x [14 x i8]], ptr %K, i64 0, i64 %indvars.iv, i64 13
%59 = load i8, ptr %arrayidx60.us142.12, align 1, !tbaa !5, !range !14, !noundef !15
%cmp62.not.not.us143.12 = icmp eq i8 %59, 0
br i1 %cmp62.not.not.us143.12, label %for.inc89.sink.split, label %for.inc89
for.inc89.sink.split: ; preds = %for.inc86.us145.11, %for.inc86.us135.11, %for.inc86.us125.11, %for.inc86.us.11
%.str.5.sink = phi ptr [ @.str.2, %for.inc86.us.11 ], [ @.str.3, %for.inc86.us125.11 ], [ @.str.4, %for.inc86.us135.11 ], [ @.str.5, %for.inc86.us145.11 ]
%call83.us.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink, i32 noundef 13)
br label %for.inc89
for.inc89: ; preds = %for.inc89.sink.split, %for.inc86.us145.11, %for.inc86.us135.11, %for.inc86.us125.11, %for.inc86.us.11, %for.cond53.preheader
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %if.end92, label %for.cond53.preheader, !llvm.loop !16
if.end92: ; preds = %for.inc89, %entry
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %arr) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = distinct !{!16, !13}
|
#include <stdio.h>
int main(void)
{
int card[4][13];
int n;
char c;
int o;
int i;
int j;
for (i = 0; i < 4; i++){
for (j = 0; j < 13; j++){
card[i][j] = 0;
}
}
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf(" %c %d", &c, &o);
switch (c){
case 'S':
card[0][o - 1] = 1;
break;
case 'H':
card[1][o - 1] = 1;
break;
case 'C':
card[2][o - 1] = 1;
break;
case 'D':
card[3][o - 1] = 1;
break;
default:
printf("error\n");
break;
}
}
for (i = 0; i < 4; i++){
for (j = 0; j < 13; j++){
if (card[i][j] == 0){
switch (i){
case 0:
printf("S %d\n", j + 1);
break;
case 1:
printf("H %d\n", j + 1);
break;
case 2:
printf("C %d\n", j + 1);
break;
case 3:
printf("D %d\n", j + 1);
break;
}
}
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271847/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271847/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c" %c %d\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.6 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
@str = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%card = alloca [4 x [13 x i32]], align 16
%n = alloca i32, align 4
%c = alloca i8, align 1
%o = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %card) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %o) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %card, i8 0, i64 208, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1086 = icmp sgt i32 %0, 0
br i1 %cmp1086, label %for.body11, label %for.cond39.preheader.preheader
for.body11: ; preds = %entry, %for.inc32
%i.187 = phi i32 [ %inc33, %for.inc32 ], [ 0, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %o)
%1 = load i8, ptr %c, align 1, !tbaa !9
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.default [
i32 83, label %sw.bb
i32 72, label %sw.bb16
i32 67, label %sw.bb21
i32 68, label %sw.bb26
]
sw.bb: ; preds = %for.body11
%2 = load i32, ptr %o, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom14 = sext i32 %sub to i64
%arrayidx15 = getelementptr inbounds [13 x i32], ptr %card, i64 0, i64 %idxprom14
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc32
sw.bb16: ; preds = %for.body11
%3 = load i32, ptr %o, align 4, !tbaa !5
%sub18 = add nsw i32 %3, -1
%idxprom19 = sext i32 %sub18 to i64
%arrayidx20 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 1, i64 %idxprom19
store i32 1, ptr %arrayidx20, align 4, !tbaa !5
br label %for.inc32
sw.bb21: ; preds = %for.body11
%4 = load i32, ptr %o, align 4, !tbaa !5
%sub23 = add nsw i32 %4, -1
%idxprom24 = sext i32 %sub23 to i64
%arrayidx25 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 2, i64 %idxprom24
store i32 1, ptr %arrayidx25, align 4, !tbaa !5
br label %for.inc32
sw.bb26: ; preds = %for.body11
%5 = load i32, ptr %o, align 4, !tbaa !5
%sub28 = add nsw i32 %5, -1
%idxprom29 = sext i32 %sub28 to i64
%arrayidx30 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 3, i64 %idxprom29
store i32 1, ptr %arrayidx30, align 4, !tbaa !5
br label %for.inc32
sw.default: ; preds = %for.body11
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc32
for.inc32: ; preds = %sw.bb, %sw.bb16, %sw.bb21, %sw.bb26, %sw.default
%inc33 = add nuw nsw i32 %i.187, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc33, %6
br i1 %cmp10, label %for.body11, label %for.cond39.preheader.preheader, !llvm.loop !10
for.cond39.preheader.preheader: ; preds = %for.inc32, %entry
br label %for.cond39.preheader
for.cond39.preheader: ; preds = %for.cond39.preheader.preheader, %for.inc64
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc64 ], [ 0, %for.cond39.preheader.preheader ]
%7 = trunc i64 %indvars.iv to i32
switch i32 %7, label %for.inc64 [
i32 0, label %for.body42.us.preheader
i32 1, label %for.body42.us90.preheader
i32 2, label %for.body42.us100.preheader
i32 3, label %for.body42.us110.preheader
]
for.body42.us110.preheader: ; preds = %for.cond39.preheader
%arrayidx46.us113 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%8 = load i32, ptr %arrayidx46.us113, align 4, !tbaa !5
%cmp47.us114 = icmp eq i32 %8, 0
br i1 %cmp47.us114, label %if.then.us115, label %for.inc61.us116
for.body42.us100.preheader: ; preds = %for.cond39.preheader
%arrayidx46.us103 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%9 = load i32, ptr %arrayidx46.us103, align 4, !tbaa !5
%cmp47.us104 = icmp eq i32 %9, 0
br i1 %cmp47.us104, label %if.then.us105, label %for.inc61.us106
for.body42.us90.preheader: ; preds = %for.cond39.preheader
%arrayidx46.us93 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%10 = load i32, ptr %arrayidx46.us93, align 4, !tbaa !5
%cmp47.us94 = icmp eq i32 %10, 0
br i1 %cmp47.us94, label %if.then.us95, label %for.inc61.us96
for.body42.us.preheader: ; preds = %for.cond39.preheader
%arrayidx46.us = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 0
%11 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5
%cmp47.us = icmp eq i32 %11, 0
br i1 %cmp47.us, label %if.then.us, label %for.inc61.us
if.then.us: ; preds = %for.body42.us.preheader
%call50.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc61.us
for.inc61.us: ; preds = %if.then.us, %for.body42.us.preheader
%arrayidx46.us.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%12 = load i32, ptr %arrayidx46.us.1, align 4, !tbaa !5
%cmp47.us.1 = icmp eq i32 %12, 0
br i1 %cmp47.us.1, label %if.then.us.1, label %for.inc61.us.1
if.then.us.1: ; preds = %for.inc61.us
%call50.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc61.us.1
for.inc61.us.1: ; preds = %if.then.us.1, %for.inc61.us
%arrayidx46.us.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%13 = load i32, ptr %arrayidx46.us.2, align 4, !tbaa !5
%cmp47.us.2 = icmp eq i32 %13, 0
br i1 %cmp47.us.2, label %if.then.us.2, label %for.inc61.us.2
if.then.us.2: ; preds = %for.inc61.us.1
%call50.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc61.us.2
for.inc61.us.2: ; preds = %if.then.us.2, %for.inc61.us.1
%arrayidx46.us.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%14 = load i32, ptr %arrayidx46.us.3, align 4, !tbaa !5
%cmp47.us.3 = icmp eq i32 %14, 0
br i1 %cmp47.us.3, label %if.then.us.3, label %for.inc61.us.3
if.then.us.3: ; preds = %for.inc61.us.2
%call50.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc61.us.3
for.inc61.us.3: ; preds = %if.then.us.3, %for.inc61.us.2
%arrayidx46.us.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%15 = load i32, ptr %arrayidx46.us.4, align 4, !tbaa !5
%cmp47.us.4 = icmp eq i32 %15, 0
br i1 %cmp47.us.4, label %if.then.us.4, label %for.inc61.us.4
if.then.us.4: ; preds = %for.inc61.us.3
%call50.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc61.us.4
for.inc61.us.4: ; preds = %if.then.us.4, %for.inc61.us.3
%arrayidx46.us.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%16 = load i32, ptr %arrayidx46.us.5, align 4, !tbaa !5
%cmp47.us.5 = icmp eq i32 %16, 0
br i1 %cmp47.us.5, label %if.then.us.5, label %for.inc61.us.5
if.then.us.5: ; preds = %for.inc61.us.4
%call50.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc61.us.5
for.inc61.us.5: ; preds = %if.then.us.5, %for.inc61.us.4
%arrayidx46.us.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%17 = load i32, ptr %arrayidx46.us.6, align 4, !tbaa !5
%cmp47.us.6 = icmp eq i32 %17, 0
br i1 %cmp47.us.6, label %if.then.us.6, label %for.inc61.us.6
if.then.us.6: ; preds = %for.inc61.us.5
%call50.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc61.us.6
for.inc61.us.6: ; preds = %if.then.us.6, %for.inc61.us.5
%arrayidx46.us.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%18 = load i32, ptr %arrayidx46.us.7, align 4, !tbaa !5
%cmp47.us.7 = icmp eq i32 %18, 0
br i1 %cmp47.us.7, label %if.then.us.7, label %for.inc61.us.7
if.then.us.7: ; preds = %for.inc61.us.6
%call50.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc61.us.7
for.inc61.us.7: ; preds = %if.then.us.7, %for.inc61.us.6
%arrayidx46.us.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%19 = load i32, ptr %arrayidx46.us.8, align 4, !tbaa !5
%cmp47.us.8 = icmp eq i32 %19, 0
br i1 %cmp47.us.8, label %if.then.us.8, label %for.inc61.us.8
if.then.us.8: ; preds = %for.inc61.us.7
%call50.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc61.us.8
for.inc61.us.8: ; preds = %if.then.us.8, %for.inc61.us.7
%arrayidx46.us.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%20 = load i32, ptr %arrayidx46.us.9, align 4, !tbaa !5
%cmp47.us.9 = icmp eq i32 %20, 0
br i1 %cmp47.us.9, label %if.then.us.9, label %for.inc61.us.9
if.then.us.9: ; preds = %for.inc61.us.8
%call50.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc61.us.9
for.inc61.us.9: ; preds = %if.then.us.9, %for.inc61.us.8
%arrayidx46.us.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%21 = load i32, ptr %arrayidx46.us.10, align 4, !tbaa !5
%cmp47.us.10 = icmp eq i32 %21, 0
br i1 %cmp47.us.10, label %if.then.us.10, label %for.inc61.us.10
if.then.us.10: ; preds = %for.inc61.us.9
%call50.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc61.us.10
for.inc61.us.10: ; preds = %if.then.us.10, %for.inc61.us.9
%arrayidx46.us.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%22 = load i32, ptr %arrayidx46.us.11, align 4, !tbaa !5
%cmp47.us.11 = icmp eq i32 %22, 0
br i1 %cmp47.us.11, label %if.then.us.11, label %for.inc61.us.11
if.then.us.11: ; preds = %for.inc61.us.10
%call50.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc61.us.11
for.inc61.us.11: ; preds = %if.then.us.11, %for.inc61.us.10
%arrayidx46.us.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%23 = load i32, ptr %arrayidx46.us.12, align 4, !tbaa !5
%cmp47.us.12 = icmp eq i32 %23, 0
br i1 %cmp47.us.12, label %for.inc64.sink.split, label %for.inc64
if.then.us95: ; preds = %for.body42.us90.preheader
%call53.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc61.us96
for.inc61.us96: ; preds = %if.then.us95, %for.body42.us90.preheader
%arrayidx46.us93.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%24 = load i32, ptr %arrayidx46.us93.1, align 4, !tbaa !5
%cmp47.us94.1 = icmp eq i32 %24, 0
br i1 %cmp47.us94.1, label %if.then.us95.1, label %for.inc61.us96.1
if.then.us95.1: ; preds = %for.inc61.us96
%call53.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc61.us96.1
for.inc61.us96.1: ; preds = %if.then.us95.1, %for.inc61.us96
%arrayidx46.us93.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%25 = load i32, ptr %arrayidx46.us93.2, align 4, !tbaa !5
%cmp47.us94.2 = icmp eq i32 %25, 0
br i1 %cmp47.us94.2, label %if.then.us95.2, label %for.inc61.us96.2
if.then.us95.2: ; preds = %for.inc61.us96.1
%call53.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc61.us96.2
for.inc61.us96.2: ; preds = %if.then.us95.2, %for.inc61.us96.1
%arrayidx46.us93.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%26 = load i32, ptr %arrayidx46.us93.3, align 4, !tbaa !5
%cmp47.us94.3 = icmp eq i32 %26, 0
br i1 %cmp47.us94.3, label %if.then.us95.3, label %for.inc61.us96.3
if.then.us95.3: ; preds = %for.inc61.us96.2
%call53.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc61.us96.3
for.inc61.us96.3: ; preds = %if.then.us95.3, %for.inc61.us96.2
%arrayidx46.us93.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%27 = load i32, ptr %arrayidx46.us93.4, align 4, !tbaa !5
%cmp47.us94.4 = icmp eq i32 %27, 0
br i1 %cmp47.us94.4, label %if.then.us95.4, label %for.inc61.us96.4
if.then.us95.4: ; preds = %for.inc61.us96.3
%call53.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc61.us96.4
for.inc61.us96.4: ; preds = %if.then.us95.4, %for.inc61.us96.3
%arrayidx46.us93.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%28 = load i32, ptr %arrayidx46.us93.5, align 4, !tbaa !5
%cmp47.us94.5 = icmp eq i32 %28, 0
br i1 %cmp47.us94.5, label %if.then.us95.5, label %for.inc61.us96.5
if.then.us95.5: ; preds = %for.inc61.us96.4
%call53.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc61.us96.5
for.inc61.us96.5: ; preds = %if.then.us95.5, %for.inc61.us96.4
%arrayidx46.us93.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%29 = load i32, ptr %arrayidx46.us93.6, align 4, !tbaa !5
%cmp47.us94.6 = icmp eq i32 %29, 0
br i1 %cmp47.us94.6, label %if.then.us95.6, label %for.inc61.us96.6
if.then.us95.6: ; preds = %for.inc61.us96.5
%call53.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc61.us96.6
for.inc61.us96.6: ; preds = %if.then.us95.6, %for.inc61.us96.5
%arrayidx46.us93.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%30 = load i32, ptr %arrayidx46.us93.7, align 4, !tbaa !5
%cmp47.us94.7 = icmp eq i32 %30, 0
br i1 %cmp47.us94.7, label %if.then.us95.7, label %for.inc61.us96.7
if.then.us95.7: ; preds = %for.inc61.us96.6
%call53.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc61.us96.7
for.inc61.us96.7: ; preds = %if.then.us95.7, %for.inc61.us96.6
%arrayidx46.us93.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%31 = load i32, ptr %arrayidx46.us93.8, align 4, !tbaa !5
%cmp47.us94.8 = icmp eq i32 %31, 0
br i1 %cmp47.us94.8, label %if.then.us95.8, label %for.inc61.us96.8
if.then.us95.8: ; preds = %for.inc61.us96.7
%call53.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc61.us96.8
for.inc61.us96.8: ; preds = %if.then.us95.8, %for.inc61.us96.7
%arrayidx46.us93.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%32 = load i32, ptr %arrayidx46.us93.9, align 4, !tbaa !5
%cmp47.us94.9 = icmp eq i32 %32, 0
br i1 %cmp47.us94.9, label %if.then.us95.9, label %for.inc61.us96.9
if.then.us95.9: ; preds = %for.inc61.us96.8
%call53.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc61.us96.9
for.inc61.us96.9: ; preds = %if.then.us95.9, %for.inc61.us96.8
%arrayidx46.us93.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%33 = load i32, ptr %arrayidx46.us93.10, align 4, !tbaa !5
%cmp47.us94.10 = icmp eq i32 %33, 0
br i1 %cmp47.us94.10, label %if.then.us95.10, label %for.inc61.us96.10
if.then.us95.10: ; preds = %for.inc61.us96.9
%call53.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc61.us96.10
for.inc61.us96.10: ; preds = %if.then.us95.10, %for.inc61.us96.9
%arrayidx46.us93.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%34 = load i32, ptr %arrayidx46.us93.11, align 4, !tbaa !5
%cmp47.us94.11 = icmp eq i32 %34, 0
br i1 %cmp47.us94.11, label %if.then.us95.11, label %for.inc61.us96.11
if.then.us95.11: ; preds = %for.inc61.us96.10
%call53.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc61.us96.11
for.inc61.us96.11: ; preds = %if.then.us95.11, %for.inc61.us96.10
%arrayidx46.us93.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%35 = load i32, ptr %arrayidx46.us93.12, align 4, !tbaa !5
%cmp47.us94.12 = icmp eq i32 %35, 0
br i1 %cmp47.us94.12, label %for.inc64.sink.split, label %for.inc64
if.then.us105: ; preds = %for.body42.us100.preheader
%call56.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc61.us106
for.inc61.us106: ; preds = %if.then.us105, %for.body42.us100.preheader
%arrayidx46.us103.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%36 = load i32, ptr %arrayidx46.us103.1, align 4, !tbaa !5
%cmp47.us104.1 = icmp eq i32 %36, 0
br i1 %cmp47.us104.1, label %if.then.us105.1, label %for.inc61.us106.1
if.then.us105.1: ; preds = %for.inc61.us106
%call56.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc61.us106.1
for.inc61.us106.1: ; preds = %if.then.us105.1, %for.inc61.us106
%arrayidx46.us103.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%37 = load i32, ptr %arrayidx46.us103.2, align 4, !tbaa !5
%cmp47.us104.2 = icmp eq i32 %37, 0
br i1 %cmp47.us104.2, label %if.then.us105.2, label %for.inc61.us106.2
if.then.us105.2: ; preds = %for.inc61.us106.1
%call56.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc61.us106.2
for.inc61.us106.2: ; preds = %if.then.us105.2, %for.inc61.us106.1
%arrayidx46.us103.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%38 = load i32, ptr %arrayidx46.us103.3, align 4, !tbaa !5
%cmp47.us104.3 = icmp eq i32 %38, 0
br i1 %cmp47.us104.3, label %if.then.us105.3, label %for.inc61.us106.3
if.then.us105.3: ; preds = %for.inc61.us106.2
%call56.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc61.us106.3
for.inc61.us106.3: ; preds = %if.then.us105.3, %for.inc61.us106.2
%arrayidx46.us103.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%39 = load i32, ptr %arrayidx46.us103.4, align 4, !tbaa !5
%cmp47.us104.4 = icmp eq i32 %39, 0
br i1 %cmp47.us104.4, label %if.then.us105.4, label %for.inc61.us106.4
if.then.us105.4: ; preds = %for.inc61.us106.3
%call56.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc61.us106.4
for.inc61.us106.4: ; preds = %if.then.us105.4, %for.inc61.us106.3
%arrayidx46.us103.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%40 = load i32, ptr %arrayidx46.us103.5, align 4, !tbaa !5
%cmp47.us104.5 = icmp eq i32 %40, 0
br i1 %cmp47.us104.5, label %if.then.us105.5, label %for.inc61.us106.5
if.then.us105.5: ; preds = %for.inc61.us106.4
%call56.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc61.us106.5
for.inc61.us106.5: ; preds = %if.then.us105.5, %for.inc61.us106.4
%arrayidx46.us103.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%41 = load i32, ptr %arrayidx46.us103.6, align 4, !tbaa !5
%cmp47.us104.6 = icmp eq i32 %41, 0
br i1 %cmp47.us104.6, label %if.then.us105.6, label %for.inc61.us106.6
if.then.us105.6: ; preds = %for.inc61.us106.5
%call56.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc61.us106.6
for.inc61.us106.6: ; preds = %if.then.us105.6, %for.inc61.us106.5
%arrayidx46.us103.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%42 = load i32, ptr %arrayidx46.us103.7, align 4, !tbaa !5
%cmp47.us104.7 = icmp eq i32 %42, 0
br i1 %cmp47.us104.7, label %if.then.us105.7, label %for.inc61.us106.7
if.then.us105.7: ; preds = %for.inc61.us106.6
%call56.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc61.us106.7
for.inc61.us106.7: ; preds = %if.then.us105.7, %for.inc61.us106.6
%arrayidx46.us103.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%43 = load i32, ptr %arrayidx46.us103.8, align 4, !tbaa !5
%cmp47.us104.8 = icmp eq i32 %43, 0
br i1 %cmp47.us104.8, label %if.then.us105.8, label %for.inc61.us106.8
if.then.us105.8: ; preds = %for.inc61.us106.7
%call56.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc61.us106.8
for.inc61.us106.8: ; preds = %if.then.us105.8, %for.inc61.us106.7
%arrayidx46.us103.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%44 = load i32, ptr %arrayidx46.us103.9, align 4, !tbaa !5
%cmp47.us104.9 = icmp eq i32 %44, 0
br i1 %cmp47.us104.9, label %if.then.us105.9, label %for.inc61.us106.9
if.then.us105.9: ; preds = %for.inc61.us106.8
%call56.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc61.us106.9
for.inc61.us106.9: ; preds = %if.then.us105.9, %for.inc61.us106.8
%arrayidx46.us103.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%45 = load i32, ptr %arrayidx46.us103.10, align 4, !tbaa !5
%cmp47.us104.10 = icmp eq i32 %45, 0
br i1 %cmp47.us104.10, label %if.then.us105.10, label %for.inc61.us106.10
if.then.us105.10: ; preds = %for.inc61.us106.9
%call56.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc61.us106.10
for.inc61.us106.10: ; preds = %if.then.us105.10, %for.inc61.us106.9
%arrayidx46.us103.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%46 = load i32, ptr %arrayidx46.us103.11, align 4, !tbaa !5
%cmp47.us104.11 = icmp eq i32 %46, 0
br i1 %cmp47.us104.11, label %if.then.us105.11, label %for.inc61.us106.11
if.then.us105.11: ; preds = %for.inc61.us106.10
%call56.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc61.us106.11
for.inc61.us106.11: ; preds = %if.then.us105.11, %for.inc61.us106.10
%arrayidx46.us103.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%47 = load i32, ptr %arrayidx46.us103.12, align 4, !tbaa !5
%cmp47.us104.12 = icmp eq i32 %47, 0
br i1 %cmp47.us104.12, label %for.inc64.sink.split, label %for.inc64
if.then.us115: ; preds = %for.body42.us110.preheader
%call59.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 1)
br label %for.inc61.us116
for.inc61.us116: ; preds = %if.then.us115, %for.body42.us110.preheader
%arrayidx46.us113.1 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 1
%48 = load i32, ptr %arrayidx46.us113.1, align 4, !tbaa !5
%cmp47.us114.1 = icmp eq i32 %48, 0
br i1 %cmp47.us114.1, label %if.then.us115.1, label %for.inc61.us116.1
if.then.us115.1: ; preds = %for.inc61.us116
%call59.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 2)
br label %for.inc61.us116.1
for.inc61.us116.1: ; preds = %if.then.us115.1, %for.inc61.us116
%arrayidx46.us113.2 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 2
%49 = load i32, ptr %arrayidx46.us113.2, align 4, !tbaa !5
%cmp47.us114.2 = icmp eq i32 %49, 0
br i1 %cmp47.us114.2, label %if.then.us115.2, label %for.inc61.us116.2
if.then.us115.2: ; preds = %for.inc61.us116.1
%call59.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 3)
br label %for.inc61.us116.2
for.inc61.us116.2: ; preds = %if.then.us115.2, %for.inc61.us116.1
%arrayidx46.us113.3 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 3
%50 = load i32, ptr %arrayidx46.us113.3, align 4, !tbaa !5
%cmp47.us114.3 = icmp eq i32 %50, 0
br i1 %cmp47.us114.3, label %if.then.us115.3, label %for.inc61.us116.3
if.then.us115.3: ; preds = %for.inc61.us116.2
%call59.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 4)
br label %for.inc61.us116.3
for.inc61.us116.3: ; preds = %if.then.us115.3, %for.inc61.us116.2
%arrayidx46.us113.4 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 4
%51 = load i32, ptr %arrayidx46.us113.4, align 4, !tbaa !5
%cmp47.us114.4 = icmp eq i32 %51, 0
br i1 %cmp47.us114.4, label %if.then.us115.4, label %for.inc61.us116.4
if.then.us115.4: ; preds = %for.inc61.us116.3
%call59.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 5)
br label %for.inc61.us116.4
for.inc61.us116.4: ; preds = %if.then.us115.4, %for.inc61.us116.3
%arrayidx46.us113.5 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 5
%52 = load i32, ptr %arrayidx46.us113.5, align 4, !tbaa !5
%cmp47.us114.5 = icmp eq i32 %52, 0
br i1 %cmp47.us114.5, label %if.then.us115.5, label %for.inc61.us116.5
if.then.us115.5: ; preds = %for.inc61.us116.4
%call59.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 6)
br label %for.inc61.us116.5
for.inc61.us116.5: ; preds = %if.then.us115.5, %for.inc61.us116.4
%arrayidx46.us113.6 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 6
%53 = load i32, ptr %arrayidx46.us113.6, align 4, !tbaa !5
%cmp47.us114.6 = icmp eq i32 %53, 0
br i1 %cmp47.us114.6, label %if.then.us115.6, label %for.inc61.us116.6
if.then.us115.6: ; preds = %for.inc61.us116.5
%call59.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 7)
br label %for.inc61.us116.6
for.inc61.us116.6: ; preds = %if.then.us115.6, %for.inc61.us116.5
%arrayidx46.us113.7 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 7
%54 = load i32, ptr %arrayidx46.us113.7, align 4, !tbaa !5
%cmp47.us114.7 = icmp eq i32 %54, 0
br i1 %cmp47.us114.7, label %if.then.us115.7, label %for.inc61.us116.7
if.then.us115.7: ; preds = %for.inc61.us116.6
%call59.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 8)
br label %for.inc61.us116.7
for.inc61.us116.7: ; preds = %if.then.us115.7, %for.inc61.us116.6
%arrayidx46.us113.8 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 8
%55 = load i32, ptr %arrayidx46.us113.8, align 4, !tbaa !5
%cmp47.us114.8 = icmp eq i32 %55, 0
br i1 %cmp47.us114.8, label %if.then.us115.8, label %for.inc61.us116.8
if.then.us115.8: ; preds = %for.inc61.us116.7
%call59.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 9)
br label %for.inc61.us116.8
for.inc61.us116.8: ; preds = %if.then.us115.8, %for.inc61.us116.7
%arrayidx46.us113.9 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 9
%56 = load i32, ptr %arrayidx46.us113.9, align 4, !tbaa !5
%cmp47.us114.9 = icmp eq i32 %56, 0
br i1 %cmp47.us114.9, label %if.then.us115.9, label %for.inc61.us116.9
if.then.us115.9: ; preds = %for.inc61.us116.8
%call59.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 10)
br label %for.inc61.us116.9
for.inc61.us116.9: ; preds = %if.then.us115.9, %for.inc61.us116.8
%arrayidx46.us113.10 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 10
%57 = load i32, ptr %arrayidx46.us113.10, align 4, !tbaa !5
%cmp47.us114.10 = icmp eq i32 %57, 0
br i1 %cmp47.us114.10, label %if.then.us115.10, label %for.inc61.us116.10
if.then.us115.10: ; preds = %for.inc61.us116.9
%call59.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 11)
br label %for.inc61.us116.10
for.inc61.us116.10: ; preds = %if.then.us115.10, %for.inc61.us116.9
%arrayidx46.us113.11 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 11
%58 = load i32, ptr %arrayidx46.us113.11, align 4, !tbaa !5
%cmp47.us114.11 = icmp eq i32 %58, 0
br i1 %cmp47.us114.11, label %if.then.us115.11, label %for.inc61.us116.11
if.then.us115.11: ; preds = %for.inc61.us116.10
%call59.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef 12)
br label %for.inc61.us116.11
for.inc61.us116.11: ; preds = %if.then.us115.11, %for.inc61.us116.10
%arrayidx46.us113.12 = getelementptr inbounds [4 x [13 x i32]], ptr %card, i64 0, i64 %indvars.iv, i64 12
%59 = load i32, ptr %arrayidx46.us113.12, align 4, !tbaa !5
%cmp47.us114.12 = icmp eq i32 %59, 0
br i1 %cmp47.us114.12, label %for.inc64.sink.split, label %for.inc64
for.inc64.sink.split: ; preds = %for.inc61.us116.11, %for.inc61.us106.11, %for.inc61.us96.11, %for.inc61.us.11
%.str.6.sink = phi ptr [ @.str.3, %for.inc61.us.11 ], [ @.str.4, %for.inc61.us96.11 ], [ @.str.5, %for.inc61.us106.11 ], [ @.str.6, %for.inc61.us116.11 ]
%call59.us.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.6.sink, i32 noundef 13)
br label %for.inc64
for.inc64: ; preds = %for.inc64.sink.split, %for.inc61.us116.11, %for.inc61.us106.11, %for.inc61.us96.11, %for.inc61.us.11, %for.cond39.preheader
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end66, label %for.cond39.preheader, !llvm.loop !12
for.end66: ; preds = %for.inc64
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %o) #5
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %card) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main(void)
{
int i, j, n, N, cards[4][13] = {};
char m;
scanf("%d", &N);
for (i = 0; i < N; ++i) {
scanf(" %c %d", &m, &n);
if (m == 'S')
cards[0][n - 1] = 1;
else if (m == 'H')
cards[1][n - 1] = 1;
else if (m == 'C')
cards[2][n - 1] = 1;
else if (m == 'D')
cards[3][n - 1] = 1;
}
for (i = 0; i < 4; ++i) {
for (j = 0; j < 13; ++j) {
if (!cards[i][j]) {
if (i == 0)
printf("S %d\n", j + 1);
else if (i == 1)
printf("H %d\n", j + 1);
else if (i == 2)
printf("C %d\n", j + 1);
else if (i == 3)
printf("D %d\n", j + 1);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271890/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271890/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c" %c %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%N = alloca i32, align 4
%cards = alloca [4 x [13 x i32]], align 16
%m = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %cards) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %cards, i8 0, i64 208, i1 false)
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp94 = icmp sgt i32 %0, 0
br i1 %cmp94, label %for.body, label %for.cond38.preheader.preheader
for.body: ; preds = %entry, %for.inc
%i.095 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%1 = load i8, ptr %m, align 1, !tbaa !9
switch i8 %1, label %for.inc [
i8 83, label %if.then
i8 72, label %if.then8
i8 67, label %if.then17
i8 68, label %if.then26
]
if.then: ; preds = %for.body
%2 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%arrayidx4 = getelementptr inbounds [13 x i32], ptr %cards, i64 0, i64 %idxprom
br label %for.inc.sink.split
if.then8: ; preds = %for.body
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub10 = add nsw i32 %3, -1
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 1, i64 %idxprom11
br label %for.inc.sink.split
if.then17: ; preds = %for.body
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub19 = add nsw i32 %4, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 2, i64 %idxprom20
br label %for.inc.sink.split
if.then26: ; preds = %for.body
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub28 = add nsw i32 %5, -1
%idxprom29 = sext i32 %sub28 to i64
%arrayidx30 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 3, i64 %idxprom29
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then8, %if.then26, %if.then17, %if.then
%arrayidx4.sink = phi ptr [ %arrayidx4, %if.then ], [ %arrayidx21, %if.then17 ], [ %arrayidx30, %if.then26 ], [ %arrayidx12, %if.then8 ]
store i32 1, ptr %arrayidx4.sink, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc = add nuw nsw i32 %i.095, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.cond38.preheader.preheader, !llvm.loop !10
for.cond38.preheader.preheader: ; preds = %for.inc, %entry
br label %for.cond38.preheader
for.cond38.preheader: ; preds = %for.cond38.preheader.preheader, %for.inc77
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc77 ], [ 0, %for.cond38.preheader.preheader ]
%7 = trunc i64 %indvars.iv to i32
switch i32 %7, label %for.inc77 [
i32 0, label %for.body41.us.preheader
i32 1, label %for.body41.us98.preheader
i32 2, label %for.body41.us108.preheader
i32 3, label %for.body41.us118.preheader
]
for.body41.us118.preheader: ; preds = %for.cond38.preheader
%arrayidx45.us121 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%8 = load i32, ptr %arrayidx45.us121, align 4, !tbaa !5
%tobool.not.us122 = icmp eq i32 %8, 0
br i1 %tobool.not.us122, label %if.then46.us123, label %for.inc74.us124
for.body41.us108.preheader: ; preds = %for.cond38.preheader
%arrayidx45.us111 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%9 = load i32, ptr %arrayidx45.us111, align 4, !tbaa !5
%tobool.not.us112 = icmp eq i32 %9, 0
br i1 %tobool.not.us112, label %if.then46.us113, label %for.inc74.us114
for.body41.us98.preheader: ; preds = %for.cond38.preheader
%arrayidx45.us101 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%10 = load i32, ptr %arrayidx45.us101, align 4, !tbaa !5
%tobool.not.us102 = icmp eq i32 %10, 0
br i1 %tobool.not.us102, label %if.then46.us103, label %for.inc74.us104
for.body41.us.preheader: ; preds = %for.cond38.preheader
%arrayidx45.us = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 0
%11 = load i32, ptr %arrayidx45.us, align 4, !tbaa !5
%tobool.not.us = icmp eq i32 %11, 0
br i1 %tobool.not.us, label %if.then46.us, label %for.inc74.us
if.then46.us: ; preds = %for.body41.us.preheader
%call50.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc74.us
for.inc74.us: ; preds = %if.then46.us, %for.body41.us.preheader
%arrayidx45.us.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%12 = load i32, ptr %arrayidx45.us.1, align 4, !tbaa !5
%tobool.not.us.1 = icmp eq i32 %12, 0
br i1 %tobool.not.us.1, label %if.then46.us.1, label %for.inc74.us.1
if.then46.us.1: ; preds = %for.inc74.us
%call50.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc74.us.1
for.inc74.us.1: ; preds = %if.then46.us.1, %for.inc74.us
%arrayidx45.us.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%13 = load i32, ptr %arrayidx45.us.2, align 4, !tbaa !5
%tobool.not.us.2 = icmp eq i32 %13, 0
br i1 %tobool.not.us.2, label %if.then46.us.2, label %for.inc74.us.2
if.then46.us.2: ; preds = %for.inc74.us.1
%call50.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc74.us.2
for.inc74.us.2: ; preds = %if.then46.us.2, %for.inc74.us.1
%arrayidx45.us.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%14 = load i32, ptr %arrayidx45.us.3, align 4, !tbaa !5
%tobool.not.us.3 = icmp eq i32 %14, 0
br i1 %tobool.not.us.3, label %if.then46.us.3, label %for.inc74.us.3
if.then46.us.3: ; preds = %for.inc74.us.2
%call50.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc74.us.3
for.inc74.us.3: ; preds = %if.then46.us.3, %for.inc74.us.2
%arrayidx45.us.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%15 = load i32, ptr %arrayidx45.us.4, align 4, !tbaa !5
%tobool.not.us.4 = icmp eq i32 %15, 0
br i1 %tobool.not.us.4, label %if.then46.us.4, label %for.inc74.us.4
if.then46.us.4: ; preds = %for.inc74.us.3
%call50.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc74.us.4
for.inc74.us.4: ; preds = %if.then46.us.4, %for.inc74.us.3
%arrayidx45.us.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%16 = load i32, ptr %arrayidx45.us.5, align 4, !tbaa !5
%tobool.not.us.5 = icmp eq i32 %16, 0
br i1 %tobool.not.us.5, label %if.then46.us.5, label %for.inc74.us.5
if.then46.us.5: ; preds = %for.inc74.us.4
%call50.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc74.us.5
for.inc74.us.5: ; preds = %if.then46.us.5, %for.inc74.us.4
%arrayidx45.us.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%17 = load i32, ptr %arrayidx45.us.6, align 4, !tbaa !5
%tobool.not.us.6 = icmp eq i32 %17, 0
br i1 %tobool.not.us.6, label %if.then46.us.6, label %for.inc74.us.6
if.then46.us.6: ; preds = %for.inc74.us.5
%call50.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc74.us.6
for.inc74.us.6: ; preds = %if.then46.us.6, %for.inc74.us.5
%arrayidx45.us.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%18 = load i32, ptr %arrayidx45.us.7, align 4, !tbaa !5
%tobool.not.us.7 = icmp eq i32 %18, 0
br i1 %tobool.not.us.7, label %if.then46.us.7, label %for.inc74.us.7
if.then46.us.7: ; preds = %for.inc74.us.6
%call50.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc74.us.7
for.inc74.us.7: ; preds = %if.then46.us.7, %for.inc74.us.6
%arrayidx45.us.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%19 = load i32, ptr %arrayidx45.us.8, align 4, !tbaa !5
%tobool.not.us.8 = icmp eq i32 %19, 0
br i1 %tobool.not.us.8, label %if.then46.us.8, label %for.inc74.us.8
if.then46.us.8: ; preds = %for.inc74.us.7
%call50.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc74.us.8
for.inc74.us.8: ; preds = %if.then46.us.8, %for.inc74.us.7
%arrayidx45.us.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%20 = load i32, ptr %arrayidx45.us.9, align 4, !tbaa !5
%tobool.not.us.9 = icmp eq i32 %20, 0
br i1 %tobool.not.us.9, label %if.then46.us.9, label %for.inc74.us.9
if.then46.us.9: ; preds = %for.inc74.us.8
%call50.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc74.us.9
for.inc74.us.9: ; preds = %if.then46.us.9, %for.inc74.us.8
%arrayidx45.us.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%21 = load i32, ptr %arrayidx45.us.10, align 4, !tbaa !5
%tobool.not.us.10 = icmp eq i32 %21, 0
br i1 %tobool.not.us.10, label %if.then46.us.10, label %for.inc74.us.10
if.then46.us.10: ; preds = %for.inc74.us.9
%call50.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc74.us.10
for.inc74.us.10: ; preds = %if.then46.us.10, %for.inc74.us.9
%arrayidx45.us.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%22 = load i32, ptr %arrayidx45.us.11, align 4, !tbaa !5
%tobool.not.us.11 = icmp eq i32 %22, 0
br i1 %tobool.not.us.11, label %if.then46.us.11, label %for.inc74.us.11
if.then46.us.11: ; preds = %for.inc74.us.10
%call50.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %for.inc74.us.11
for.inc74.us.11: ; preds = %if.then46.us.11, %for.inc74.us.10
%arrayidx45.us.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%23 = load i32, ptr %arrayidx45.us.12, align 4, !tbaa !5
%tobool.not.us.12 = icmp eq i32 %23, 0
br i1 %tobool.not.us.12, label %for.inc77.sink.split, label %for.inc77
if.then46.us103: ; preds = %for.body41.us98.preheader
%call56.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc74.us104
for.inc74.us104: ; preds = %if.then46.us103, %for.body41.us98.preheader
%arrayidx45.us101.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%24 = load i32, ptr %arrayidx45.us101.1, align 4, !tbaa !5
%tobool.not.us102.1 = icmp eq i32 %24, 0
br i1 %tobool.not.us102.1, label %if.then46.us103.1, label %for.inc74.us104.1
if.then46.us103.1: ; preds = %for.inc74.us104
%call56.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc74.us104.1
for.inc74.us104.1: ; preds = %if.then46.us103.1, %for.inc74.us104
%arrayidx45.us101.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%25 = load i32, ptr %arrayidx45.us101.2, align 4, !tbaa !5
%tobool.not.us102.2 = icmp eq i32 %25, 0
br i1 %tobool.not.us102.2, label %if.then46.us103.2, label %for.inc74.us104.2
if.then46.us103.2: ; preds = %for.inc74.us104.1
%call56.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc74.us104.2
for.inc74.us104.2: ; preds = %if.then46.us103.2, %for.inc74.us104.1
%arrayidx45.us101.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%26 = load i32, ptr %arrayidx45.us101.3, align 4, !tbaa !5
%tobool.not.us102.3 = icmp eq i32 %26, 0
br i1 %tobool.not.us102.3, label %if.then46.us103.3, label %for.inc74.us104.3
if.then46.us103.3: ; preds = %for.inc74.us104.2
%call56.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc74.us104.3
for.inc74.us104.3: ; preds = %if.then46.us103.3, %for.inc74.us104.2
%arrayidx45.us101.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%27 = load i32, ptr %arrayidx45.us101.4, align 4, !tbaa !5
%tobool.not.us102.4 = icmp eq i32 %27, 0
br i1 %tobool.not.us102.4, label %if.then46.us103.4, label %for.inc74.us104.4
if.then46.us103.4: ; preds = %for.inc74.us104.3
%call56.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc74.us104.4
for.inc74.us104.4: ; preds = %if.then46.us103.4, %for.inc74.us104.3
%arrayidx45.us101.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%28 = load i32, ptr %arrayidx45.us101.5, align 4, !tbaa !5
%tobool.not.us102.5 = icmp eq i32 %28, 0
br i1 %tobool.not.us102.5, label %if.then46.us103.5, label %for.inc74.us104.5
if.then46.us103.5: ; preds = %for.inc74.us104.4
%call56.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc74.us104.5
for.inc74.us104.5: ; preds = %if.then46.us103.5, %for.inc74.us104.4
%arrayidx45.us101.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%29 = load i32, ptr %arrayidx45.us101.6, align 4, !tbaa !5
%tobool.not.us102.6 = icmp eq i32 %29, 0
br i1 %tobool.not.us102.6, label %if.then46.us103.6, label %for.inc74.us104.6
if.then46.us103.6: ; preds = %for.inc74.us104.5
%call56.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc74.us104.6
for.inc74.us104.6: ; preds = %if.then46.us103.6, %for.inc74.us104.5
%arrayidx45.us101.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%30 = load i32, ptr %arrayidx45.us101.7, align 4, !tbaa !5
%tobool.not.us102.7 = icmp eq i32 %30, 0
br i1 %tobool.not.us102.7, label %if.then46.us103.7, label %for.inc74.us104.7
if.then46.us103.7: ; preds = %for.inc74.us104.6
%call56.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc74.us104.7
for.inc74.us104.7: ; preds = %if.then46.us103.7, %for.inc74.us104.6
%arrayidx45.us101.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%31 = load i32, ptr %arrayidx45.us101.8, align 4, !tbaa !5
%tobool.not.us102.8 = icmp eq i32 %31, 0
br i1 %tobool.not.us102.8, label %if.then46.us103.8, label %for.inc74.us104.8
if.then46.us103.8: ; preds = %for.inc74.us104.7
%call56.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc74.us104.8
for.inc74.us104.8: ; preds = %if.then46.us103.8, %for.inc74.us104.7
%arrayidx45.us101.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%32 = load i32, ptr %arrayidx45.us101.9, align 4, !tbaa !5
%tobool.not.us102.9 = icmp eq i32 %32, 0
br i1 %tobool.not.us102.9, label %if.then46.us103.9, label %for.inc74.us104.9
if.then46.us103.9: ; preds = %for.inc74.us104.8
%call56.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc74.us104.9
for.inc74.us104.9: ; preds = %if.then46.us103.9, %for.inc74.us104.8
%arrayidx45.us101.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%33 = load i32, ptr %arrayidx45.us101.10, align 4, !tbaa !5
%tobool.not.us102.10 = icmp eq i32 %33, 0
br i1 %tobool.not.us102.10, label %if.then46.us103.10, label %for.inc74.us104.10
if.then46.us103.10: ; preds = %for.inc74.us104.9
%call56.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc74.us104.10
for.inc74.us104.10: ; preds = %if.then46.us103.10, %for.inc74.us104.9
%arrayidx45.us101.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%34 = load i32, ptr %arrayidx45.us101.11, align 4, !tbaa !5
%tobool.not.us102.11 = icmp eq i32 %34, 0
br i1 %tobool.not.us102.11, label %if.then46.us103.11, label %for.inc74.us104.11
if.then46.us103.11: ; preds = %for.inc74.us104.10
%call56.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc74.us104.11
for.inc74.us104.11: ; preds = %if.then46.us103.11, %for.inc74.us104.10
%arrayidx45.us101.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%35 = load i32, ptr %arrayidx45.us101.12, align 4, !tbaa !5
%tobool.not.us102.12 = icmp eq i32 %35, 0
br i1 %tobool.not.us102.12, label %for.inc77.sink.split, label %for.inc77
if.then46.us113: ; preds = %for.body41.us108.preheader
%call62.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc74.us114
for.inc74.us114: ; preds = %if.then46.us113, %for.body41.us108.preheader
%arrayidx45.us111.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%36 = load i32, ptr %arrayidx45.us111.1, align 4, !tbaa !5
%tobool.not.us112.1 = icmp eq i32 %36, 0
br i1 %tobool.not.us112.1, label %if.then46.us113.1, label %for.inc74.us114.1
if.then46.us113.1: ; preds = %for.inc74.us114
%call62.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc74.us114.1
for.inc74.us114.1: ; preds = %if.then46.us113.1, %for.inc74.us114
%arrayidx45.us111.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%37 = load i32, ptr %arrayidx45.us111.2, align 4, !tbaa !5
%tobool.not.us112.2 = icmp eq i32 %37, 0
br i1 %tobool.not.us112.2, label %if.then46.us113.2, label %for.inc74.us114.2
if.then46.us113.2: ; preds = %for.inc74.us114.1
%call62.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc74.us114.2
for.inc74.us114.2: ; preds = %if.then46.us113.2, %for.inc74.us114.1
%arrayidx45.us111.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%38 = load i32, ptr %arrayidx45.us111.3, align 4, !tbaa !5
%tobool.not.us112.3 = icmp eq i32 %38, 0
br i1 %tobool.not.us112.3, label %if.then46.us113.3, label %for.inc74.us114.3
if.then46.us113.3: ; preds = %for.inc74.us114.2
%call62.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc74.us114.3
for.inc74.us114.3: ; preds = %if.then46.us113.3, %for.inc74.us114.2
%arrayidx45.us111.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%39 = load i32, ptr %arrayidx45.us111.4, align 4, !tbaa !5
%tobool.not.us112.4 = icmp eq i32 %39, 0
br i1 %tobool.not.us112.4, label %if.then46.us113.4, label %for.inc74.us114.4
if.then46.us113.4: ; preds = %for.inc74.us114.3
%call62.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc74.us114.4
for.inc74.us114.4: ; preds = %if.then46.us113.4, %for.inc74.us114.3
%arrayidx45.us111.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%40 = load i32, ptr %arrayidx45.us111.5, align 4, !tbaa !5
%tobool.not.us112.5 = icmp eq i32 %40, 0
br i1 %tobool.not.us112.5, label %if.then46.us113.5, label %for.inc74.us114.5
if.then46.us113.5: ; preds = %for.inc74.us114.4
%call62.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc74.us114.5
for.inc74.us114.5: ; preds = %if.then46.us113.5, %for.inc74.us114.4
%arrayidx45.us111.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%41 = load i32, ptr %arrayidx45.us111.6, align 4, !tbaa !5
%tobool.not.us112.6 = icmp eq i32 %41, 0
br i1 %tobool.not.us112.6, label %if.then46.us113.6, label %for.inc74.us114.6
if.then46.us113.6: ; preds = %for.inc74.us114.5
%call62.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc74.us114.6
for.inc74.us114.6: ; preds = %if.then46.us113.6, %for.inc74.us114.5
%arrayidx45.us111.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%42 = load i32, ptr %arrayidx45.us111.7, align 4, !tbaa !5
%tobool.not.us112.7 = icmp eq i32 %42, 0
br i1 %tobool.not.us112.7, label %if.then46.us113.7, label %for.inc74.us114.7
if.then46.us113.7: ; preds = %for.inc74.us114.6
%call62.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc74.us114.7
for.inc74.us114.7: ; preds = %if.then46.us113.7, %for.inc74.us114.6
%arrayidx45.us111.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%43 = load i32, ptr %arrayidx45.us111.8, align 4, !tbaa !5
%tobool.not.us112.8 = icmp eq i32 %43, 0
br i1 %tobool.not.us112.8, label %if.then46.us113.8, label %for.inc74.us114.8
if.then46.us113.8: ; preds = %for.inc74.us114.7
%call62.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc74.us114.8
for.inc74.us114.8: ; preds = %if.then46.us113.8, %for.inc74.us114.7
%arrayidx45.us111.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%44 = load i32, ptr %arrayidx45.us111.9, align 4, !tbaa !5
%tobool.not.us112.9 = icmp eq i32 %44, 0
br i1 %tobool.not.us112.9, label %if.then46.us113.9, label %for.inc74.us114.9
if.then46.us113.9: ; preds = %for.inc74.us114.8
%call62.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc74.us114.9
for.inc74.us114.9: ; preds = %if.then46.us113.9, %for.inc74.us114.8
%arrayidx45.us111.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%45 = load i32, ptr %arrayidx45.us111.10, align 4, !tbaa !5
%tobool.not.us112.10 = icmp eq i32 %45, 0
br i1 %tobool.not.us112.10, label %if.then46.us113.10, label %for.inc74.us114.10
if.then46.us113.10: ; preds = %for.inc74.us114.9
%call62.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc74.us114.10
for.inc74.us114.10: ; preds = %if.then46.us113.10, %for.inc74.us114.9
%arrayidx45.us111.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%46 = load i32, ptr %arrayidx45.us111.11, align 4, !tbaa !5
%tobool.not.us112.11 = icmp eq i32 %46, 0
br i1 %tobool.not.us112.11, label %if.then46.us113.11, label %for.inc74.us114.11
if.then46.us113.11: ; preds = %for.inc74.us114.10
%call62.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc74.us114.11
for.inc74.us114.11: ; preds = %if.then46.us113.11, %for.inc74.us114.10
%arrayidx45.us111.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%47 = load i32, ptr %arrayidx45.us111.12, align 4, !tbaa !5
%tobool.not.us112.12 = icmp eq i32 %47, 0
br i1 %tobool.not.us112.12, label %for.inc77.sink.split, label %for.inc77
if.then46.us123: ; preds = %for.body41.us118.preheader
%call68.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc74.us124
for.inc74.us124: ; preds = %if.then46.us123, %for.body41.us118.preheader
%arrayidx45.us121.1 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%48 = load i32, ptr %arrayidx45.us121.1, align 4, !tbaa !5
%tobool.not.us122.1 = icmp eq i32 %48, 0
br i1 %tobool.not.us122.1, label %if.then46.us123.1, label %for.inc74.us124.1
if.then46.us123.1: ; preds = %for.inc74.us124
%call68.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc74.us124.1
for.inc74.us124.1: ; preds = %if.then46.us123.1, %for.inc74.us124
%arrayidx45.us121.2 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%49 = load i32, ptr %arrayidx45.us121.2, align 4, !tbaa !5
%tobool.not.us122.2 = icmp eq i32 %49, 0
br i1 %tobool.not.us122.2, label %if.then46.us123.2, label %for.inc74.us124.2
if.then46.us123.2: ; preds = %for.inc74.us124.1
%call68.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc74.us124.2
for.inc74.us124.2: ; preds = %if.then46.us123.2, %for.inc74.us124.1
%arrayidx45.us121.3 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%50 = load i32, ptr %arrayidx45.us121.3, align 4, !tbaa !5
%tobool.not.us122.3 = icmp eq i32 %50, 0
br i1 %tobool.not.us122.3, label %if.then46.us123.3, label %for.inc74.us124.3
if.then46.us123.3: ; preds = %for.inc74.us124.2
%call68.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc74.us124.3
for.inc74.us124.3: ; preds = %if.then46.us123.3, %for.inc74.us124.2
%arrayidx45.us121.4 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%51 = load i32, ptr %arrayidx45.us121.4, align 4, !tbaa !5
%tobool.not.us122.4 = icmp eq i32 %51, 0
br i1 %tobool.not.us122.4, label %if.then46.us123.4, label %for.inc74.us124.4
if.then46.us123.4: ; preds = %for.inc74.us124.3
%call68.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc74.us124.4
for.inc74.us124.4: ; preds = %if.then46.us123.4, %for.inc74.us124.3
%arrayidx45.us121.5 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%52 = load i32, ptr %arrayidx45.us121.5, align 4, !tbaa !5
%tobool.not.us122.5 = icmp eq i32 %52, 0
br i1 %tobool.not.us122.5, label %if.then46.us123.5, label %for.inc74.us124.5
if.then46.us123.5: ; preds = %for.inc74.us124.4
%call68.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc74.us124.5
for.inc74.us124.5: ; preds = %if.then46.us123.5, %for.inc74.us124.4
%arrayidx45.us121.6 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%53 = load i32, ptr %arrayidx45.us121.6, align 4, !tbaa !5
%tobool.not.us122.6 = icmp eq i32 %53, 0
br i1 %tobool.not.us122.6, label %if.then46.us123.6, label %for.inc74.us124.6
if.then46.us123.6: ; preds = %for.inc74.us124.5
%call68.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc74.us124.6
for.inc74.us124.6: ; preds = %if.then46.us123.6, %for.inc74.us124.5
%arrayidx45.us121.7 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%54 = load i32, ptr %arrayidx45.us121.7, align 4, !tbaa !5
%tobool.not.us122.7 = icmp eq i32 %54, 0
br i1 %tobool.not.us122.7, label %if.then46.us123.7, label %for.inc74.us124.7
if.then46.us123.7: ; preds = %for.inc74.us124.6
%call68.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc74.us124.7
for.inc74.us124.7: ; preds = %if.then46.us123.7, %for.inc74.us124.6
%arrayidx45.us121.8 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%55 = load i32, ptr %arrayidx45.us121.8, align 4, !tbaa !5
%tobool.not.us122.8 = icmp eq i32 %55, 0
br i1 %tobool.not.us122.8, label %if.then46.us123.8, label %for.inc74.us124.8
if.then46.us123.8: ; preds = %for.inc74.us124.7
%call68.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc74.us124.8
for.inc74.us124.8: ; preds = %if.then46.us123.8, %for.inc74.us124.7
%arrayidx45.us121.9 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%56 = load i32, ptr %arrayidx45.us121.9, align 4, !tbaa !5
%tobool.not.us122.9 = icmp eq i32 %56, 0
br i1 %tobool.not.us122.9, label %if.then46.us123.9, label %for.inc74.us124.9
if.then46.us123.9: ; preds = %for.inc74.us124.8
%call68.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc74.us124.9
for.inc74.us124.9: ; preds = %if.then46.us123.9, %for.inc74.us124.8
%arrayidx45.us121.10 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%57 = load i32, ptr %arrayidx45.us121.10, align 4, !tbaa !5
%tobool.not.us122.10 = icmp eq i32 %57, 0
br i1 %tobool.not.us122.10, label %if.then46.us123.10, label %for.inc74.us124.10
if.then46.us123.10: ; preds = %for.inc74.us124.9
%call68.us.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc74.us124.10
for.inc74.us124.10: ; preds = %if.then46.us123.10, %for.inc74.us124.9
%arrayidx45.us121.11 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%58 = load i32, ptr %arrayidx45.us121.11, align 4, !tbaa !5
%tobool.not.us122.11 = icmp eq i32 %58, 0
br i1 %tobool.not.us122.11, label %if.then46.us123.11, label %for.inc74.us124.11
if.then46.us123.11: ; preds = %for.inc74.us124.10
%call68.us.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc74.us124.11
for.inc74.us124.11: ; preds = %if.then46.us123.11, %for.inc74.us124.10
%arrayidx45.us121.12 = getelementptr inbounds [4 x [13 x i32]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%59 = load i32, ptr %arrayidx45.us121.12, align 4, !tbaa !5
%tobool.not.us122.12 = icmp eq i32 %59, 0
br i1 %tobool.not.us122.12, label %for.inc77.sink.split, label %for.inc77
for.inc77.sink.split: ; preds = %for.inc74.us124.11, %for.inc74.us114.11, %for.inc74.us104.11, %for.inc74.us.11
%.str.5.sink = phi ptr [ @.str.2, %for.inc74.us.11 ], [ @.str.3, %for.inc74.us104.11 ], [ @.str.4, %for.inc74.us114.11 ], [ @.str.5, %for.inc74.us124.11 ]
%call68.us.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.5.sink, i32 noundef 13)
br label %for.inc77
for.inc77: ; preds = %for.inc77.sink.split, %for.inc74.us124.11, %for.inc74.us114.11, %for.inc74.us104.11, %for.inc74.us.11, %for.cond38.preheader
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end79, label %for.cond38.preheader, !llvm.loop !12
for.end79: ; preds = %for.inc77
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %cards) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(void){
int i ,j ,n ,suji;
char cards[4][14] ,mark;
char suke[4] = {'S','H','C','D'};
for(i = 0;i<4;++i){
for(j=1;j<=13;++j)cards[i][j]=0;
}
scanf("%d",&n);
for(i=1;i<=n;++i){
scanf(" %c",&mark);
scanf("%d",&suji);
if(mark=='S')cards[0][suji]=1;
if(mark=='H')cards[1][suji]=1;
if(mark=='C')cards[2][suji]=1;
if(mark=='D')cards[3][suji]=1;
}
for(i=0;i<4;++i){
for(j=1;j<=13;++j){
if(cards[i][j]==0){
printf("%c %d\n",suke[i],j);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271933/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271933/source.c"
target datalayout = "e-m:e-p270: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.suke = private unnamed_addr constant [4 x i8] c"SHCD", align 1
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%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
%suji = alloca i32, align 4
%cards = alloca [4 x [14 x i8]], align 16
%mark = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %suji) #4
call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %cards) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %mark) #4
%scevgep = getelementptr inbounds i8, ptr %cards, i64 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep, i8 0, i64 13, i1 false), !tbaa !5
%scevgep.1 = getelementptr inbounds i8, ptr %cards, i64 15
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep.1, i8 0, i64 13, i1 false), !tbaa !5
%scevgep.2 = getelementptr inbounds i8, ptr %cards, i64 29
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep.2, i8 0, i64 13, i1 false), !tbaa !5
%scevgep.3 = getelementptr inbounds i8, ptr %cards, i64 43
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(13) %scevgep.3, i8 0, i64 13, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !8
%cmp10.not92 = icmp slt i32 %0, 1
br i1 %cmp10.not92, label %for.cond50.preheader.preheader, label %for.body11
for.body11: ; preds = %entry, %for.inc43
%i.193 = phi i32 [ %inc44, %for.inc43 ], [ 1, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %mark)
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %suji)
%1 = load i8, ptr %mark, align 1, !tbaa !5
switch i8 %1, label %for.inc43 [
i8 83, label %if.end.thread
i8 72, label %if.then22
i8 67, label %if.then30
i8 68, label %if.then38
]
if.end.thread: ; preds = %for.body11
%2 = load i32, ptr %suji, align 4, !tbaa !8
%idxprom17 = sext i32 %2 to i64
%arrayidx18 = getelementptr inbounds [14 x i8], ptr %cards, i64 0, i64 %idxprom17
br label %for.inc43.sink.split
if.then22: ; preds = %for.body11
%3 = load i32, ptr %suji, align 4, !tbaa !8
%idxprom24 = sext i32 %3 to i64
%arrayidx25 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 1, i64 %idxprom24
br label %for.inc43.sink.split
if.then30: ; preds = %for.body11
%4 = load i32, ptr %suji, align 4, !tbaa !8
%idxprom32 = sext i32 %4 to i64
%arrayidx33 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 2, i64 %idxprom32
br label %for.inc43.sink.split
if.then38: ; preds = %for.body11
%5 = load i32, ptr %suji, align 4, !tbaa !8
%idxprom40 = sext i32 %5 to i64
%arrayidx41 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 3, i64 %idxprom40
br label %for.inc43.sink.split
for.inc43.sink.split: ; preds = %if.then38, %if.then30, %if.end.thread, %if.then22
%arrayidx25.sink = phi ptr [ %arrayidx25, %if.then22 ], [ %arrayidx18, %if.end.thread ], [ %arrayidx33, %if.then30 ], [ %arrayidx41, %if.then38 ]
store i8 1, ptr %arrayidx25.sink, align 1, !tbaa !5
br label %for.inc43
for.inc43: ; preds = %for.inc43.sink.split, %for.body11
%inc44 = add nuw nsw i32 %i.193, 1
%6 = load i32, ptr %n, align 4, !tbaa !8
%cmp10.not.not = icmp slt i32 %i.193, %6
br i1 %cmp10.not.not, label %for.body11, label %for.cond50.preheader.preheader, !llvm.loop !10
for.cond50.preheader.preheader: ; preds = %for.inc43, %entry
br label %for.cond50.preheader
for.cond50.preheader: ; preds = %for.cond50.preheader.preheader, %for.inc67.12
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc67.12 ], [ 0, %for.cond50.preheader.preheader ]
%arrayidx63 = getelementptr inbounds [4 x i8], ptr @__const.main.suke, i64 0, i64 %indvars.iv
%arrayidx57 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 1
%7 = load i8, ptr %arrayidx57, align 1, !tbaa !5
%cmp59 = icmp eq i8 %7, 0
br i1 %cmp59, label %if.then61, label %for.inc67
if.then61: ; preds = %for.cond50.preheader
%8 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64 = sext i8 %8 to i32
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64, i32 noundef 1)
br label %for.inc67
for.inc67: ; preds = %for.cond50.preheader, %if.then61
%arrayidx57.1 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 2
%9 = load i8, ptr %arrayidx57.1, align 2, !tbaa !5
%cmp59.1 = icmp eq i8 %9, 0
br i1 %cmp59.1, label %if.then61.1, label %for.inc67.1
if.then61.1: ; preds = %for.inc67
%10 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.1 = sext i8 %10 to i32
%call65.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.1, i32 noundef 2)
br label %for.inc67.1
for.inc67.1: ; preds = %if.then61.1, %for.inc67
%arrayidx57.2 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 3
%11 = load i8, ptr %arrayidx57.2, align 1, !tbaa !5
%cmp59.2 = icmp eq i8 %11, 0
br i1 %cmp59.2, label %if.then61.2, label %for.inc67.2
if.then61.2: ; preds = %for.inc67.1
%12 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.2 = sext i8 %12 to i32
%call65.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.2, i32 noundef 3)
br label %for.inc67.2
for.inc67.2: ; preds = %if.then61.2, %for.inc67.1
%arrayidx57.3 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 4
%13 = load i8, ptr %arrayidx57.3, align 2, !tbaa !5
%cmp59.3 = icmp eq i8 %13, 0
br i1 %cmp59.3, label %if.then61.3, label %for.inc67.3
if.then61.3: ; preds = %for.inc67.2
%14 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.3 = sext i8 %14 to i32
%call65.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.3, i32 noundef 4)
br label %for.inc67.3
for.inc67.3: ; preds = %if.then61.3, %for.inc67.2
%arrayidx57.4 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 5
%15 = load i8, ptr %arrayidx57.4, align 1, !tbaa !5
%cmp59.4 = icmp eq i8 %15, 0
br i1 %cmp59.4, label %if.then61.4, label %for.inc67.4
if.then61.4: ; preds = %for.inc67.3
%16 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.4 = sext i8 %16 to i32
%call65.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.4, i32 noundef 5)
br label %for.inc67.4
for.inc67.4: ; preds = %if.then61.4, %for.inc67.3
%arrayidx57.5 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 6
%17 = load i8, ptr %arrayidx57.5, align 2, !tbaa !5
%cmp59.5 = icmp eq i8 %17, 0
br i1 %cmp59.5, label %if.then61.5, label %for.inc67.5
if.then61.5: ; preds = %for.inc67.4
%18 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.5 = sext i8 %18 to i32
%call65.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.5, i32 noundef 6)
br label %for.inc67.5
for.inc67.5: ; preds = %if.then61.5, %for.inc67.4
%arrayidx57.6 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 7
%19 = load i8, ptr %arrayidx57.6, align 1, !tbaa !5
%cmp59.6 = icmp eq i8 %19, 0
br i1 %cmp59.6, label %if.then61.6, label %for.inc67.6
if.then61.6: ; preds = %for.inc67.5
%20 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.6 = sext i8 %20 to i32
%call65.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.6, i32 noundef 7)
br label %for.inc67.6
for.inc67.6: ; preds = %if.then61.6, %for.inc67.5
%arrayidx57.7 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 8
%21 = load i8, ptr %arrayidx57.7, align 2, !tbaa !5
%cmp59.7 = icmp eq i8 %21, 0
br i1 %cmp59.7, label %if.then61.7, label %for.inc67.7
if.then61.7: ; preds = %for.inc67.6
%22 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.7 = sext i8 %22 to i32
%call65.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.7, i32 noundef 8)
br label %for.inc67.7
for.inc67.7: ; preds = %if.then61.7, %for.inc67.6
%arrayidx57.8 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 9
%23 = load i8, ptr %arrayidx57.8, align 1, !tbaa !5
%cmp59.8 = icmp eq i8 %23, 0
br i1 %cmp59.8, label %if.then61.8, label %for.inc67.8
if.then61.8: ; preds = %for.inc67.7
%24 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.8 = sext i8 %24 to i32
%call65.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.8, i32 noundef 9)
br label %for.inc67.8
for.inc67.8: ; preds = %if.then61.8, %for.inc67.7
%arrayidx57.9 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 10
%25 = load i8, ptr %arrayidx57.9, align 2, !tbaa !5
%cmp59.9 = icmp eq i8 %25, 0
br i1 %cmp59.9, label %if.then61.9, label %for.inc67.9
if.then61.9: ; preds = %for.inc67.8
%26 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.9 = sext i8 %26 to i32
%call65.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.9, i32 noundef 10)
br label %for.inc67.9
for.inc67.9: ; preds = %if.then61.9, %for.inc67.8
%arrayidx57.10 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 11
%27 = load i8, ptr %arrayidx57.10, align 1, !tbaa !5
%cmp59.10 = icmp eq i8 %27, 0
br i1 %cmp59.10, label %if.then61.10, label %for.inc67.10
if.then61.10: ; preds = %for.inc67.9
%28 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.10 = sext i8 %28 to i32
%call65.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.10, i32 noundef 11)
br label %for.inc67.10
for.inc67.10: ; preds = %if.then61.10, %for.inc67.9
%arrayidx57.11 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 12
%29 = load i8, ptr %arrayidx57.11, align 2, !tbaa !5
%cmp59.11 = icmp eq i8 %29, 0
br i1 %cmp59.11, label %if.then61.11, label %for.inc67.11
if.then61.11: ; preds = %for.inc67.10
%30 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.11 = sext i8 %30 to i32
%call65.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.11, i32 noundef 12)
br label %for.inc67.11
for.inc67.11: ; preds = %if.then61.11, %for.inc67.10
%arrayidx57.12 = getelementptr inbounds [4 x [14 x i8]], ptr %cards, i64 0, i64 %indvars.iv, i64 13
%31 = load i8, ptr %arrayidx57.12, align 1, !tbaa !5
%cmp59.12 = icmp eq i8 %31, 0
br i1 %cmp59.12, label %if.then61.12, label %for.inc67.12
if.then61.12: ; preds = %for.inc67.11
%32 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%conv64.12 = sext i8 %32 to i32
%call65.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv64.12, i32 noundef 13)
br label %for.inc67.12
for.inc67.12: ; preds = %if.then61.12, %for.inc67.11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %for.end72, label %for.cond50.preheader, !llvm.loop !12
for.end72: ; preds = %for.inc67.12
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %mark) #4
call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %cards) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %suji) #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(void)
{
int S[13],H[13],C[13],D[13],n,i,s;
char e;
for(i=0;i<13;i++)
S[i]=0;
for(i=0;i<13;i++)
H[i]=0;
for(i=0;i<13;i++)
C[i]=0;
for(i=0;i<13;i++)
D[i]=0;
scanf("%d",&n);
for(i=0;i<2*n;i++){
scanf("%c",&e);
scanf("%d",&s);
if(e=='S')
S[s-1]=1;
else if(e=='H')
H[s-1]=1;
else if(e=='C')
C[s-1]=1;
else if(e=='D')
D[s-1]=1;
}
for(i=0;i<13;i++){
if(S[i]==0)
printf("S %d\n",i+1);
}
for(i=0;i<13;i++){
if(H[i]==0)
printf("H %d\n",i+1);
}
for(i=0;i<13;i++){
if(C[i]==0)
printf("C %d\n",i+1);
}
for(i=0;i<13;i++){
if(D[i]==0)
printf("D %d\n",i+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_271977/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_271977/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"S %d\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"H %d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"C %d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"D %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [13 x i32], align 16
%H = alloca [13 x i32], align 16
%C = alloca [13 x i32], align 16
%D = alloca [13 x i32], align 16
%n = alloca i32, align 4
%s = alloca i32, align 4
%e = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %D) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %e) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %S, i8 0, i64 52, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %H, i8 0, i64 52, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %C, i8 0, i64 52, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %D, i8 0, i64 52, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp26156 = icmp sgt i32 %0, 0
br i1 %cmp26156, label %for.body27, label %if.then71
for.cond63.preheader: ; preds = %for.inc60
%.pre = load i32, ptr %S, align 16, !tbaa !5
%cmp69 = icmp eq i32 %.pre, 0
br i1 %cmp69, label %if.then71, label %for.inc74
for.body27: ; preds = %entry, %for.inc60
%i.4157 = phi i32 [ %inc61, %for.inc60 ], [ 0, %entry ]
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e)
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%1 = load i8, ptr %e, align 1, !tbaa !9
switch i8 %1, label %for.inc60 [
i8 83, label %for.inc60.sink.split
i8 72, label %if.then37
i8 67, label %if.then45
i8 68, label %if.then53
]
if.then37: ; preds = %for.body27
br label %for.inc60.sink.split
if.then45: ; preds = %for.body27
br label %for.inc60.sink.split
if.then53: ; preds = %for.body27
br label %for.inc60.sink.split
for.inc60.sink.split: ; preds = %for.body27, %if.then37, %if.then53, %if.then45
%S.sink = phi ptr [ %C, %if.then45 ], [ %D, %if.then53 ], [ %H, %if.then37 ], [ %S, %for.body27 ]
%.sink = load i32, ptr %s, align 4, !tbaa !5
%sub = add nsw i32 %.sink, -1
%idxprom32 = sext i32 %sub to i64
%arrayidx33 = getelementptr inbounds [13 x i32], ptr %S.sink, i64 0, i64 %idxprom32
store i32 1, ptr %arrayidx33, align 4, !tbaa !5
br label %for.inc60
for.inc60: ; preds = %for.inc60.sink.split, %for.body27
%inc61 = add nuw nsw i32 %i.4157, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl nsw i32 %2, 1
%cmp26 = icmp slt i32 %inc61, %mul
br i1 %cmp26, label %for.body27, label %for.cond63.preheader, !llvm.loop !10
if.then71: ; preds = %entry, %for.cond63.preheader
%call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1)
br label %for.inc74
for.inc74: ; preds = %for.cond63.preheader, %if.then71
%arrayidx68.1 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 1
%3 = load i32, ptr %arrayidx68.1, align 4, !tbaa !5
%cmp69.1 = icmp eq i32 %3, 0
br i1 %cmp69.1, label %if.then71.1, label %for.inc74.1
if.then71.1: ; preds = %for.inc74
%call72.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2)
br label %for.inc74.1
for.inc74.1: ; preds = %if.then71.1, %for.inc74
%arrayidx68.2 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 2
%4 = load i32, ptr %arrayidx68.2, align 8, !tbaa !5
%cmp69.2 = icmp eq i32 %4, 0
br i1 %cmp69.2, label %if.then71.2, label %for.inc74.2
if.then71.2: ; preds = %for.inc74.1
%call72.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3)
br label %for.inc74.2
for.inc74.2: ; preds = %if.then71.2, %for.inc74.1
%arrayidx68.3 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 3
%5 = load i32, ptr %arrayidx68.3, align 4, !tbaa !5
%cmp69.3 = icmp eq i32 %5, 0
br i1 %cmp69.3, label %if.then71.3, label %for.inc74.3
if.then71.3: ; preds = %for.inc74.2
%call72.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4)
br label %for.inc74.3
for.inc74.3: ; preds = %if.then71.3, %for.inc74.2
%arrayidx68.4 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 4
%6 = load i32, ptr %arrayidx68.4, align 16, !tbaa !5
%cmp69.4 = icmp eq i32 %6, 0
br i1 %cmp69.4, label %if.then71.4, label %for.inc74.4
if.then71.4: ; preds = %for.inc74.3
%call72.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 5)
br label %for.inc74.4
for.inc74.4: ; preds = %if.then71.4, %for.inc74.3
%arrayidx68.5 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 5
%7 = load i32, ptr %arrayidx68.5, align 4, !tbaa !5
%cmp69.5 = icmp eq i32 %7, 0
br i1 %cmp69.5, label %if.then71.5, label %for.inc74.5
if.then71.5: ; preds = %for.inc74.4
%call72.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 6)
br label %for.inc74.5
for.inc74.5: ; preds = %if.then71.5, %for.inc74.4
%arrayidx68.6 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 6
%8 = load i32, ptr %arrayidx68.6, align 8, !tbaa !5
%cmp69.6 = icmp eq i32 %8, 0
br i1 %cmp69.6, label %if.then71.6, label %for.inc74.6
if.then71.6: ; preds = %for.inc74.5
%call72.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 7)
br label %for.inc74.6
for.inc74.6: ; preds = %if.then71.6, %for.inc74.5
%arrayidx68.7 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 7
%9 = load i32, ptr %arrayidx68.7, align 4, !tbaa !5
%cmp69.7 = icmp eq i32 %9, 0
br i1 %cmp69.7, label %if.then71.7, label %for.inc74.7
if.then71.7: ; preds = %for.inc74.6
%call72.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 8)
br label %for.inc74.7
for.inc74.7: ; preds = %if.then71.7, %for.inc74.6
%arrayidx68.8 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 8
%10 = load i32, ptr %arrayidx68.8, align 16, !tbaa !5
%cmp69.8 = icmp eq i32 %10, 0
br i1 %cmp69.8, label %if.then71.8, label %for.inc74.8
if.then71.8: ; preds = %for.inc74.7
%call72.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 9)
br label %for.inc74.8
for.inc74.8: ; preds = %if.then71.8, %for.inc74.7
%arrayidx68.9 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 9
%11 = load i32, ptr %arrayidx68.9, align 4, !tbaa !5
%cmp69.9 = icmp eq i32 %11, 0
br i1 %cmp69.9, label %if.then71.9, label %for.inc74.9
if.then71.9: ; preds = %for.inc74.8
%call72.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 10)
br label %for.inc74.9
for.inc74.9: ; preds = %if.then71.9, %for.inc74.8
%arrayidx68.10 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 10
%12 = load i32, ptr %arrayidx68.10, align 8, !tbaa !5
%cmp69.10 = icmp eq i32 %12, 0
br i1 %cmp69.10, label %if.then71.10, label %for.inc74.10
if.then71.10: ; preds = %for.inc74.9
%call72.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 11)
br label %for.inc74.10
for.inc74.10: ; preds = %if.then71.10, %for.inc74.9
%arrayidx68.11 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 11
%13 = load i32, ptr %arrayidx68.11, align 4, !tbaa !5
%cmp69.11 = icmp eq i32 %13, 0
br i1 %cmp69.11, label %if.then71.11, label %for.inc74.11
if.then71.11: ; preds = %for.inc74.10
%call72.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 12)
br label %for.inc74.11
for.inc74.11: ; preds = %if.then71.11, %for.inc74.10
%arrayidx68.12 = getelementptr inbounds [13 x i32], ptr %S, i64 0, i64 12
%14 = load i32, ptr %arrayidx68.12, align 16, !tbaa !5
%cmp69.12 = icmp eq i32 %14, 0
br i1 %cmp69.12, label %if.then71.12, label %for.inc74.12
if.then71.12: ; preds = %for.inc74.11
%call72.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 13)
br label %for.inc74.12
for.inc74.12: ; preds = %if.then71.12, %for.inc74.11
%15 = load i32, ptr %H, align 16, !tbaa !5
%cmp83 = icmp eq i32 %15, 0
br i1 %cmp83, label %if.then85, label %for.inc89
if.then85: ; preds = %for.inc74.12
%call87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1)
br label %for.inc89
for.inc89: ; preds = %for.inc74.12, %if.then85
%arrayidx82.1 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 1
%16 = load i32, ptr %arrayidx82.1, align 4, !tbaa !5
%cmp83.1 = icmp eq i32 %16, 0
br i1 %cmp83.1, label %if.then85.1, label %for.inc89.1
if.then85.1: ; preds = %for.inc89
%call87.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 2)
br label %for.inc89.1
for.inc89.1: ; preds = %if.then85.1, %for.inc89
%arrayidx82.2 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 2
%17 = load i32, ptr %arrayidx82.2, align 8, !tbaa !5
%cmp83.2 = icmp eq i32 %17, 0
br i1 %cmp83.2, label %if.then85.2, label %for.inc89.2
if.then85.2: ; preds = %for.inc89.1
%call87.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 3)
br label %for.inc89.2
for.inc89.2: ; preds = %if.then85.2, %for.inc89.1
%arrayidx82.3 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 3
%18 = load i32, ptr %arrayidx82.3, align 4, !tbaa !5
%cmp83.3 = icmp eq i32 %18, 0
br i1 %cmp83.3, label %if.then85.3, label %for.inc89.3
if.then85.3: ; preds = %for.inc89.2
%call87.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4)
br label %for.inc89.3
for.inc89.3: ; preds = %if.then85.3, %for.inc89.2
%arrayidx82.4 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 4
%19 = load i32, ptr %arrayidx82.4, align 16, !tbaa !5
%cmp83.4 = icmp eq i32 %19, 0
br i1 %cmp83.4, label %if.then85.4, label %for.inc89.4
if.then85.4: ; preds = %for.inc89.3
%call87.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 5)
br label %for.inc89.4
for.inc89.4: ; preds = %if.then85.4, %for.inc89.3
%arrayidx82.5 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 5
%20 = load i32, ptr %arrayidx82.5, align 4, !tbaa !5
%cmp83.5 = icmp eq i32 %20, 0
br i1 %cmp83.5, label %if.then85.5, label %for.inc89.5
if.then85.5: ; preds = %for.inc89.4
%call87.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 6)
br label %for.inc89.5
for.inc89.5: ; preds = %if.then85.5, %for.inc89.4
%arrayidx82.6 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 6
%21 = load i32, ptr %arrayidx82.6, align 8, !tbaa !5
%cmp83.6 = icmp eq i32 %21, 0
br i1 %cmp83.6, label %if.then85.6, label %for.inc89.6
if.then85.6: ; preds = %for.inc89.5
%call87.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 7)
br label %for.inc89.6
for.inc89.6: ; preds = %if.then85.6, %for.inc89.5
%arrayidx82.7 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 7
%22 = load i32, ptr %arrayidx82.7, align 4, !tbaa !5
%cmp83.7 = icmp eq i32 %22, 0
br i1 %cmp83.7, label %if.then85.7, label %for.inc89.7
if.then85.7: ; preds = %for.inc89.6
%call87.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 8)
br label %for.inc89.7
for.inc89.7: ; preds = %if.then85.7, %for.inc89.6
%arrayidx82.8 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 8
%23 = load i32, ptr %arrayidx82.8, align 16, !tbaa !5
%cmp83.8 = icmp eq i32 %23, 0
br i1 %cmp83.8, label %if.then85.8, label %for.inc89.8
if.then85.8: ; preds = %for.inc89.7
%call87.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 9)
br label %for.inc89.8
for.inc89.8: ; preds = %if.then85.8, %for.inc89.7
%arrayidx82.9 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 9
%24 = load i32, ptr %arrayidx82.9, align 4, !tbaa !5
%cmp83.9 = icmp eq i32 %24, 0
br i1 %cmp83.9, label %if.then85.9, label %for.inc89.9
if.then85.9: ; preds = %for.inc89.8
%call87.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 10)
br label %for.inc89.9
for.inc89.9: ; preds = %if.then85.9, %for.inc89.8
%arrayidx82.10 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 10
%25 = load i32, ptr %arrayidx82.10, align 8, !tbaa !5
%cmp83.10 = icmp eq i32 %25, 0
br i1 %cmp83.10, label %if.then85.10, label %for.inc89.10
if.then85.10: ; preds = %for.inc89.9
%call87.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 11)
br label %for.inc89.10
for.inc89.10: ; preds = %if.then85.10, %for.inc89.9
%arrayidx82.11 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 11
%26 = load i32, ptr %arrayidx82.11, align 4, !tbaa !5
%cmp83.11 = icmp eq i32 %26, 0
br i1 %cmp83.11, label %if.then85.11, label %for.inc89.11
if.then85.11: ; preds = %for.inc89.10
%call87.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 12)
br label %for.inc89.11
for.inc89.11: ; preds = %if.then85.11, %for.inc89.10
%arrayidx82.12 = getelementptr inbounds [13 x i32], ptr %H, i64 0, i64 12
%27 = load i32, ptr %arrayidx82.12, align 16, !tbaa !5
%cmp83.12 = icmp eq i32 %27, 0
br i1 %cmp83.12, label %if.then85.12, label %for.inc89.12
if.then85.12: ; preds = %for.inc89.11
%call87.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 13)
br label %for.inc89.12
for.inc89.12: ; preds = %if.then85.12, %for.inc89.11
%28 = load i32, ptr %C, align 16, !tbaa !5
%cmp98 = icmp eq i32 %28, 0
br i1 %cmp98, label %if.then100, label %for.inc104
if.then100: ; preds = %for.inc89.12
%call102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 1)
br label %for.inc104
for.inc104: ; preds = %for.inc89.12, %if.then100
%arrayidx97.1 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 1
%29 = load i32, ptr %arrayidx97.1, align 4, !tbaa !5
%cmp98.1 = icmp eq i32 %29, 0
br i1 %cmp98.1, label %if.then100.1, label %for.inc104.1
if.then100.1: ; preds = %for.inc104
%call102.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 2)
br label %for.inc104.1
for.inc104.1: ; preds = %if.then100.1, %for.inc104
%arrayidx97.2 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 2
%30 = load i32, ptr %arrayidx97.2, align 8, !tbaa !5
%cmp98.2 = icmp eq i32 %30, 0
br i1 %cmp98.2, label %if.then100.2, label %for.inc104.2
if.then100.2: ; preds = %for.inc104.1
%call102.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 3)
br label %for.inc104.2
for.inc104.2: ; preds = %if.then100.2, %for.inc104.1
%arrayidx97.3 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 3
%31 = load i32, ptr %arrayidx97.3, align 4, !tbaa !5
%cmp98.3 = icmp eq i32 %31, 0
br i1 %cmp98.3, label %if.then100.3, label %for.inc104.3
if.then100.3: ; preds = %for.inc104.2
%call102.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 4)
br label %for.inc104.3
for.inc104.3: ; preds = %if.then100.3, %for.inc104.2
%arrayidx97.4 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 4
%32 = load i32, ptr %arrayidx97.4, align 16, !tbaa !5
%cmp98.4 = icmp eq i32 %32, 0
br i1 %cmp98.4, label %if.then100.4, label %for.inc104.4
if.then100.4: ; preds = %for.inc104.3
%call102.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 5)
br label %for.inc104.4
for.inc104.4: ; preds = %if.then100.4, %for.inc104.3
%arrayidx97.5 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 5
%33 = load i32, ptr %arrayidx97.5, align 4, !tbaa !5
%cmp98.5 = icmp eq i32 %33, 0
br i1 %cmp98.5, label %if.then100.5, label %for.inc104.5
if.then100.5: ; preds = %for.inc104.4
%call102.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 6)
br label %for.inc104.5
for.inc104.5: ; preds = %if.then100.5, %for.inc104.4
%arrayidx97.6 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 6
%34 = load i32, ptr %arrayidx97.6, align 8, !tbaa !5
%cmp98.6 = icmp eq i32 %34, 0
br i1 %cmp98.6, label %if.then100.6, label %for.inc104.6
if.then100.6: ; preds = %for.inc104.5
%call102.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 7)
br label %for.inc104.6
for.inc104.6: ; preds = %if.then100.6, %for.inc104.5
%arrayidx97.7 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 7
%35 = load i32, ptr %arrayidx97.7, align 4, !tbaa !5
%cmp98.7 = icmp eq i32 %35, 0
br i1 %cmp98.7, label %if.then100.7, label %for.inc104.7
if.then100.7: ; preds = %for.inc104.6
%call102.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 8)
br label %for.inc104.7
for.inc104.7: ; preds = %if.then100.7, %for.inc104.6
%arrayidx97.8 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 8
%36 = load i32, ptr %arrayidx97.8, align 16, !tbaa !5
%cmp98.8 = icmp eq i32 %36, 0
br i1 %cmp98.8, label %if.then100.8, label %for.inc104.8
if.then100.8: ; preds = %for.inc104.7
%call102.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 9)
br label %for.inc104.8
for.inc104.8: ; preds = %if.then100.8, %for.inc104.7
%arrayidx97.9 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 9
%37 = load i32, ptr %arrayidx97.9, align 4, !tbaa !5
%cmp98.9 = icmp eq i32 %37, 0
br i1 %cmp98.9, label %if.then100.9, label %for.inc104.9
if.then100.9: ; preds = %for.inc104.8
%call102.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 10)
br label %for.inc104.9
for.inc104.9: ; preds = %if.then100.9, %for.inc104.8
%arrayidx97.10 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 10
%38 = load i32, ptr %arrayidx97.10, align 8, !tbaa !5
%cmp98.10 = icmp eq i32 %38, 0
br i1 %cmp98.10, label %if.then100.10, label %for.inc104.10
if.then100.10: ; preds = %for.inc104.9
%call102.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 11)
br label %for.inc104.10
for.inc104.10: ; preds = %if.then100.10, %for.inc104.9
%arrayidx97.11 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 11
%39 = load i32, ptr %arrayidx97.11, align 4, !tbaa !5
%cmp98.11 = icmp eq i32 %39, 0
br i1 %cmp98.11, label %if.then100.11, label %for.inc104.11
if.then100.11: ; preds = %for.inc104.10
%call102.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 12)
br label %for.inc104.11
for.inc104.11: ; preds = %if.then100.11, %for.inc104.10
%arrayidx97.12 = getelementptr inbounds [13 x i32], ptr %C, i64 0, i64 12
%40 = load i32, ptr %arrayidx97.12, align 16, !tbaa !5
%cmp98.12 = icmp eq i32 %40, 0
br i1 %cmp98.12, label %if.then100.12, label %for.inc104.12
if.then100.12: ; preds = %for.inc104.11
%call102.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef 13)
br label %for.inc104.12
for.inc104.12: ; preds = %if.then100.12, %for.inc104.11
%41 = load i32, ptr %D, align 16, !tbaa !5
%cmp113 = icmp eq i32 %41, 0
br i1 %cmp113, label %if.then115, label %for.inc119
if.then115: ; preds = %for.inc104.12
%call117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1)
br label %for.inc119
for.inc119: ; preds = %for.inc104.12, %if.then115
%arrayidx112.1 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 1
%42 = load i32, ptr %arrayidx112.1, align 4, !tbaa !5
%cmp113.1 = icmp eq i32 %42, 0
br i1 %cmp113.1, label %if.then115.1, label %for.inc119.1
if.then115.1: ; preds = %for.inc119
%call117.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 2)
br label %for.inc119.1
for.inc119.1: ; preds = %if.then115.1, %for.inc119
%arrayidx112.2 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 2
%43 = load i32, ptr %arrayidx112.2, align 8, !tbaa !5
%cmp113.2 = icmp eq i32 %43, 0
br i1 %cmp113.2, label %if.then115.2, label %for.inc119.2
if.then115.2: ; preds = %for.inc119.1
%call117.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 3)
br label %for.inc119.2
for.inc119.2: ; preds = %if.then115.2, %for.inc119.1
%arrayidx112.3 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 3
%44 = load i32, ptr %arrayidx112.3, align 4, !tbaa !5
%cmp113.3 = icmp eq i32 %44, 0
br i1 %cmp113.3, label %if.then115.3, label %for.inc119.3
if.then115.3: ; preds = %for.inc119.2
%call117.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 4)
br label %for.inc119.3
for.inc119.3: ; preds = %if.then115.3, %for.inc119.2
%arrayidx112.4 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 4
%45 = load i32, ptr %arrayidx112.4, align 16, !tbaa !5
%cmp113.4 = icmp eq i32 %45, 0
br i1 %cmp113.4, label %if.then115.4, label %for.inc119.4
if.then115.4: ; preds = %for.inc119.3
%call117.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 5)
br label %for.inc119.4
for.inc119.4: ; preds = %if.then115.4, %for.inc119.3
%arrayidx112.5 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 5
%46 = load i32, ptr %arrayidx112.5, align 4, !tbaa !5
%cmp113.5 = icmp eq i32 %46, 0
br i1 %cmp113.5, label %if.then115.5, label %for.inc119.5
if.then115.5: ; preds = %for.inc119.4
%call117.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 6)
br label %for.inc119.5
for.inc119.5: ; preds = %if.then115.5, %for.inc119.4
%arrayidx112.6 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 6
%47 = load i32, ptr %arrayidx112.6, align 8, !tbaa !5
%cmp113.6 = icmp eq i32 %47, 0
br i1 %cmp113.6, label %if.then115.6, label %for.inc119.6
if.then115.6: ; preds = %for.inc119.5
%call117.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 7)
br label %for.inc119.6
for.inc119.6: ; preds = %if.then115.6, %for.inc119.5
%arrayidx112.7 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 7
%48 = load i32, ptr %arrayidx112.7, align 4, !tbaa !5
%cmp113.7 = icmp eq i32 %48, 0
br i1 %cmp113.7, label %if.then115.7, label %for.inc119.7
if.then115.7: ; preds = %for.inc119.6
%call117.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 8)
br label %for.inc119.7
for.inc119.7: ; preds = %if.then115.7, %for.inc119.6
%arrayidx112.8 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 8
%49 = load i32, ptr %arrayidx112.8, align 16, !tbaa !5
%cmp113.8 = icmp eq i32 %49, 0
br i1 %cmp113.8, label %if.then115.8, label %for.inc119.8
if.then115.8: ; preds = %for.inc119.7
%call117.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 9)
br label %for.inc119.8
for.inc119.8: ; preds = %if.then115.8, %for.inc119.7
%arrayidx112.9 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 9
%50 = load i32, ptr %arrayidx112.9, align 4, !tbaa !5
%cmp113.9 = icmp eq i32 %50, 0
br i1 %cmp113.9, label %if.then115.9, label %for.inc119.9
if.then115.9: ; preds = %for.inc119.8
%call117.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 10)
br label %for.inc119.9
for.inc119.9: ; preds = %if.then115.9, %for.inc119.8
%arrayidx112.10 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 10
%51 = load i32, ptr %arrayidx112.10, align 8, !tbaa !5
%cmp113.10 = icmp eq i32 %51, 0
br i1 %cmp113.10, label %if.then115.10, label %for.inc119.10
if.then115.10: ; preds = %for.inc119.9
%call117.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 11)
br label %for.inc119.10
for.inc119.10: ; preds = %if.then115.10, %for.inc119.9
%arrayidx112.11 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 11
%52 = load i32, ptr %arrayidx112.11, align 4, !tbaa !5
%cmp113.11 = icmp eq i32 %52, 0
br i1 %cmp113.11, label %if.then115.11, label %for.inc119.11
if.then115.11: ; preds = %for.inc119.10
%call117.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 12)
br label %for.inc119.11
for.inc119.11: ; preds = %if.then115.11, %for.inc119.10
%arrayidx112.12 = getelementptr inbounds [13 x i32], ptr %D, i64 0, i64 12
%53 = load i32, ptr %arrayidx112.12, align 16, !tbaa !5
%cmp113.12 = icmp eq i32 %53, 0
br i1 %cmp113.12, label %if.then115.12, label %for.inc119.12
if.then115.12: ; preds = %for.inc119.11
%call117.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 13)
br label %for.inc119.12
for.inc119.12: ; preds = %if.then115.12, %for.inc119.11
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %H) #4
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <limits.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))
#define SWAP(type, a, b) { const type tmp = a; a = b; b = tmp; }
int compare_sz_asc(const void* a, const void* b) {
return *((size_t*)a) < *((size_t*)b) ? -1 : 1;
}
int compare_sz_desc(const void* a, const void* b) {
return *((size_t*)a) > * ((size_t*)b) ? -1 : 1;
}
int compare_i64_asc(const void* a, const void* b) {
return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}
int compare_i64_desc(const void* a, const void* b) {
return *((int64_t*)a) > * ((int64_t*)b) ? -1 : 1;
}
int compare_u64_asc(const void* a, const void* b) {
return *((uint64_t*)a) < *((uint64_t*)b) ? -1 : 1;
}
int compare_u64_desc(const void* a, const void* b) {
return *((uint64_t*)a) > * ((uint64_t*)b) ? -1 : 1;
}
int compare_c_asc(const void* a, const void* b) {
return *((char*)a) < *((char*)b) ? -1 : 1;
}
int compare_c_desc(const void* a, const void* b) {
return *((char*)a) > * ((char*)b) ? -1 : 1;
}
int compare_dp_asc(const void* a, const void* b) {
return *((double*)a) < *((double*)b) ? -1 : 1;
}
static uint64_t modinvU64(const uint64_t a, const uint64_t m) {
int64_t aa = (int64_t)a;
const int64_t mm = (int64_t)m;
int64_t b = mm;
int64_t u = 1;
int64_t v = 0;
while (b != 0) {
const int64_t t = aa / b;
aa -= t * b;
SWAP(uint64_t, aa, b);
u -= t * v;
SWAP(uint64_t, u, v);
}
u %= mm;
if (u < 0) {
u += m;
}
return (uint64_t)u;
}
static size_t powSz(const size_t base, const size_t exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp % 2 == 0) {
return powSz(base * base, exp / 2);
}
else {
return base * powSz(base, exp - 1);
}
}
static uint64_t powU64(const uint64_t base, const uint64_t exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp % 2 == 0) {
return powU64(base * base, exp / 2);
}
else {
return base * powU64(base, exp - 1);
}
}
static uint64_t powU64WMod(const uint64_t base, const uint64_t exp, const uint64_t m) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base % m;
}
if (exp % 2 == 0) {
return powU64WMod(base * base % m, exp / 2, m);
}
else {
return base * powU64WMod(base, exp - 1, m) % m;
}
}
static size_t combSz(const size_t n, const size_t r) {
size_t result = 1;
for (size_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t combU64(const uint64_t n, const uint64_t r) {
uint64_t result = 1;
for (uint64_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t combU64WMod(const uint64_t n, const uint64_t r, const uint64_t m) {
uint64_t result = 1;
uint64_t inv = 1;
for (uint64_t i = 0; i < r; i++) {
result = result * (n - i) % m;
inv = inv * (i + 1) % m;
}
return result * modinvU64(inv, m) % m;
}
static uint64_t permU64(const uint64_t n) {
uint64_t result = 1;
for (uint64_t v = 2; v <= n; v++) {
result *= v;
}
return result;
}
static uint64_t permU64WMod(const uint64_t n, const uint64_t m) {
uint64_t result = 1;
for (uint64_t v = 2; v <= n; v++) {
result *= v;
result %= m;
}
return result;
}
static size_t gcdZu(size_t m, size_t n) {
size_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
static uint64_t gcdU64(uint64_t m, uint64_t n)
{
uint64_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
static uint64_t popcntU64(uint64_t val) {
uint64_t cnt = 0;
while (val != 0) {
if ((val & UINT64_C(0x1)) != 0) {
cnt++;
}
val >>= UINT64_C(0x1);
}
return cnt;
}
typedef struct {
uint64_t val;
}BHeap_Val;
#define BHEAP_VAL_TYPE BHeap_Val
#define BHEAP_INVALID_NODE ((size_t)100000000)
typedef struct {
BHEAP_VAL_TYPE val;
} BHeap_Node;
struct _BHeap_Ctx {
size_t size;
int (*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node);
void(*notifyNodeChange)(const struct _BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList);
BHeap_Node* node;
};
typedef struct _BHeap_Ctx BHeap_Ctx;
static void bHeap_Init(BHeap_Ctx* const ctx, int(*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node), void(*notifyNodeChange)(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList), BHeap_Node* const nodes) {
ctx->size = 0;
ctx->compare = compare;
ctx->notifyNodeChange = notifyNodeChange;
ctx->node = nodes;
}
static void bHeap_Swap(BHeap_Ctx* const ctx, const size_t node0, const size_t node1) {
const BHEAP_VAL_TYPE tmp = ctx->node[node0].val;
ctx->node[node0].val = ctx->node[node1].val;
ctx->node[node1].val = tmp;
if (ctx->notifyNodeChange != NULL) {
const size_t nodeList[2] = { node0,node1 };
ctx->notifyNodeChange(ctx, 2, nodeList);
}
}
static void bHeap_UpHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (nodeIdx == 0) {
return;
}
const size_t parentIdx = (nodeIdx + 1) / 2 - 1;
const int compareResult = ctx->compare(&(ctx->node[parentIdx].val), &(ctx->node[nodeIdx].val));
if (0 < compareResult) {
bHeap_Swap(ctx, nodeIdx, parentIdx);
if (parentIdx != 0) {
bHeap_UpHeap(ctx, parentIdx);
}
}
}
static void bHeap_DownHeap(BHeap_Ctx* const ctx, const size_t nodeIdx) {
if (ctx->size - 1 <= nodeIdx) {
return;
}
const size_t leftIdx = 2 * (nodeIdx + 1) - 1;
if (leftIdx < ctx->size) {
const int leftResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[leftIdx].val));
size_t swapTarget = leftResult < 0 ? BHEAP_INVALID_NODE : leftIdx;
const size_t rightIdx = leftIdx + 1;
if (rightIdx < ctx->size) {
const int rightResult = ctx->compare(&(ctx->node[nodeIdx].val), &(ctx->node[rightIdx].val));
if (swapTarget == BHEAP_INVALID_NODE) {
if (0 < rightResult) {
swapTarget = rightIdx;
}
}
else {
if (0 < rightResult) {
const int rightLeftResult = ctx->compare(&(ctx->node[leftIdx].val), &(ctx->node[rightIdx].val));
if (0 < rightLeftResult) {
swapTarget = rightIdx;
}
}
}
}
if (swapTarget != BHEAP_INVALID_NODE) {
bHeap_Swap(ctx, nodeIdx, swapTarget);
bHeap_DownHeap(ctx, swapTarget);
}
}
}
static void bHeap_Add(BHeap_Ctx* const ctx, const BHEAP_VAL_TYPE val) {
ctx->node[ctx->size].val = val;
ctx->size++;
if (ctx->notifyNodeChange != NULL) {
const size_t node = ctx->size - 1;
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_UpHeap(ctx, ctx->size - 1);
}
static void bHeap_RemoveTop(BHeap_Ctx* const ctx) {
if (ctx->size == 0) {
return;
}
if (ctx->size == 1) {
ctx->size--;
return;
}
ctx->node[0].val = ctx->node[ctx->size - 1].val;
if (ctx->notifyNodeChange != NULL) {
const size_t node = 0;
ctx->notifyNodeChange(ctx, 1, &node);
}
ctx->size--;
bHeap_DownHeap(ctx, 0);
}
static void bHeap_RemoveNode(BHeap_Ctx* const ctx, const size_t node) {
if (node == ctx->size - 1) {
ctx->size--;
}
else {
ctx->node[node].val = ctx->node[ctx->size - 1].val;
ctx->size--;
if (ctx->notifyNodeChange != NULL) {
ctx->notifyNodeChange(ctx, 1, &node);
}
bHeap_DownHeap(ctx, node);
bHeap_UpHeap(ctx, node);
}
}
static BHEAP_VAL_TYPE* bHeap_GetTopVal(const BHeap_Ctx* const ctx) {
return ctx->size == 0 ? NULL : &(ctx->node[0].val);
}
typedef struct {
uint64_t cnt;
size_t* child;
size_t numChild;
size_t maxNumChild;
} Tree_Node;
#define TREE_INIT_ALLOC (128)
static Tree_Node tree_Node[200000];
static void tree_Init(const uint64_t N) {
for (uint64_t i = 0; i < N; i++) {
tree_Node[i].cnt = 0;
tree_Node[i].numChild = 0;
tree_Node[i].child = malloc(sizeof(size_t) * TREE_INIT_ALLOC);
tree_Node[i].maxNumChild = TREE_INIT_ALLOC;
}
}
static void tree_AddChild(const size_t parent, const size_t child) {
if (tree_Node[parent].maxNumChild <= tree_Node[parent].numChild) {
tree_Node[parent].child = realloc(tree_Node[parent].child, sizeof(size_t) * tree_Node[parent].maxNumChild * 2);
tree_Node[parent].maxNumChild *= 2;
}
tree_Node[parent].child[tree_Node[parent].numChild] = child;
tree_Node[parent].numChild++;
}
static BHeap_Node BN_Asc[200000];
static BHeap_Node BN_Desc[200000];
static int _bHeap_Compare_Asc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val <= node->val ? -1 : 1;
}
static int _bHeap_Compare_Desc(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
return parent->val >= node->val ? -1 : 1;
}
static size_t PBHeap_Asc_Idx[200000];
static size_t PBHeap_Desc_Idx[200000];
static void _bHeap_NotifyNodeChange_Asc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Asc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
static void _bHeap_NotifyNodeChange_Desc(const BHeap_Ctx* const ctx, const size_t nodeListSize, const size_t* const nodeList) {
for (size_t i = 0; i < nodeListSize; i++) {
PBHeap_Desc_Idx[ctx->node[nodeList[i]].val.val] = nodeList[i];
}
}
#define UF_ROOT ((size_t)10000000)
typedef struct {
size_t parent;
uint64_t w;
uint64_t v;
uint64_t wSum;
uint64_t vSum;
} UF_Node;
static UF_Node uf_Node[101];
static size_t uf_GetRoot(const size_t idx) {
if (uf_Node[idx].parent == UF_ROOT) {
return idx;
}
const size_t root = uf_GetRoot(uf_Node[idx].parent);
uf_Node[idx].parent = root;
return root;
}
static void uf_Merge(const size_t a, const size_t b) {
const size_t aRoot = uf_GetRoot(a);
const size_t bRoot = uf_GetRoot(b);
if (aRoot != bRoot) {
uf_Node[aRoot].parent = bRoot;
uf_Node[bRoot].wSum += uf_Node[aRoot].wSum;
uf_Node[bRoot].vSum += uf_Node[aRoot].vSum;
}
}
#define MOD_VAL (UINT64_C(1000000007))
int main(void) {
uint64_t H, W;
char s[100][101];
uint64_t dp[100][100];
scanf("%"PRIu64"%"PRIu64, &H, &W);
for (uint64_t i = 0; i < H; i++) {
scanf("%s", s[i]);
for (uint64_t j = 0; j < W; j++) {
dp[i][j] = UINT64_MAX;
}
}
dp[0][0] = (s[0][0] == '#' ? 1 : 0);
for (uint64_t r = 0; r < H; r++) {
for (uint64_t c = 0; c < W; c++) {
if (0 < c) {
dp[r][c] = MIN(dp[r][c], dp[r][c - 1] + (s[r][c] == s[r][c - 1] || s[r][c] == '.' ? 0 : 1));
}
if (0 < r) {
dp[r][c] = MIN(dp[r][c], dp[r - 1][c] + (s[r][c] == s[r - 1][c] || s[r][c] == '.' ? 0 : 1));
}
}
}
printf("%"PRIu64, dp[H - 1][W - 1]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272552/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272552/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lu%lu\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"%lu\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ugt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_u64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_u64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ugt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp slt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp sgt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_dp_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !10
%1 = load double, ptr %b, align 8, !tbaa !10
%cmp = fcmp olt double %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%H = alloca i64, align 8
%W = alloca i64, align 8
%s = alloca [100 x [101 x i8]], align 16
%dp = alloca [100 x [100 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %H) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %W) #6
call void @llvm.lifetime.start.p0(i64 10100, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %dp) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i64, ptr %H, align 8, !tbaa !5
%cmp213.not = icmp eq i64 %0, 0
br i1 %cmp213.not, label %for.cond.cleanup.thread, label %for.body
for.cond.cleanup.thread: ; preds = %entry
%.pre251.pre = load i64, ptr %W, align 8, !tbaa !5
store i64 0, ptr %dp, align 16, !tbaa !5
br label %for.cond.cleanup21
for.cond.cleanup: ; preds = %for.cond.cleanup4
%.pre = load i8, ptr %s, align 16, !tbaa !9
%1 = icmp eq i8 %.pre, 35
%2 = zext i1 %1 to i64
store i64 %2, ptr %dp, align 16, !tbaa !5
%cmp19217.not = icmp eq i64 %17, 0
br i1 %cmp19217.not, label %for.cond.cleanup21, label %for.cond23.preheader.lr.ph
for.cond23.preheader.lr.ph: ; preds = %for.cond.cleanup
%cmp24215.not = icmp eq i64 %14, 0
br i1 %cmp24215.not, label %for.cond.cleanup21, label %for.cond23.preheader.us.preheader
for.cond23.preheader.us.preheader: ; preds = %for.cond23.preheader.lr.ph
%exitcond.peel.not = icmp eq i64 %14, 1
%exitcond244.peel.not = icmp eq i64 %14, 1
br label %for.cond23.preheader.us
for.cond23.preheader.us: ; preds = %for.cond23.preheader.us.preheader, %for.cond23.for.cond.cleanup26_crit_edge.us
%r.0218.us = phi i64 [ %inc143.us, %for.cond23.for.cond.cleanup26_crit_edge.us ], [ 0, %for.cond23.preheader.us.preheader ]
%cmp79.not.us = icmp eq i64 %r.0218.us, 0
%sub84.us = add i64 %r.0218.us, -1
br i1 %cmp79.not.us, label %if.end.us.us.peel, label %if.end.us235.peel
if.end.us235.peel: ; preds = %for.cond23.preheader.us
%arrayidx88.us.peel.phi.trans.insert = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %r.0218.us, i64 0
%.pre248 = load i8, ptr %arrayidx88.us.peel.phi.trans.insert, align 1, !tbaa !9
%arrayidx83.us.peel.phi.trans.insert = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 %r.0218.us, i64 0
%.pre247 = load i64, ptr %arrayidx83.us.peel.phi.trans.insert, align 16, !tbaa !5
%arrayidx83.us.peel = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 %r.0218.us, i64 0
%arrayidx86.us.peel = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 %sub84.us, i64 0
%3 = load i64, ptr %arrayidx86.us.peel, align 16, !tbaa !5
%arrayidx92.us.peel = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %sub84.us, i64 0
%4 = load i8, ptr %arrayidx92.us.peel, align 1, !tbaa !9
%cmp94.us.peel = icmp ne i8 %.pre248, %4
%cmp100.us.peel = icmp ne i8 %.pre248, 46
%spec.select207.not.us.peel = and i1 %cmp100.us.peel, %cmp94.us.peel
%conv104.us.peel = zext i1 %spec.select207.not.us.peel to i64
%add105.us.peel = add i64 %3, %conv104.us.peel
%spec.select210.us.peel = call i64 @llvm.umin.i64(i64 %.pre247, i64 %add105.us.peel)
store i64 %spec.select210.us.peel, ptr %arrayidx83.us.peel, align 16, !tbaa !5
br i1 %exitcond.peel.not, label %for.cond23.for.cond.cleanup26_crit_edge.us, label %if.end.us235
if.end.us.us.peel: ; preds = %for.cond23.preheader.us
br i1 %exitcond244.peel.not, label %for.cond23.for.cond.cleanup26_crit_edge.us, label %if.end.us.us.preheader
if.end.us.us.preheader: ; preds = %if.end.us.us.peel
%load_initial = load i64, ptr %dp, align 16
br label %if.end.us.us
if.end.us235: ; preds = %if.end.us235.peel, %if.end.us235
%5 = phi i64 [ %spec.select210.us, %if.end.us235 ], [ %spec.select210.us.peel, %if.end.us235.peel ]
%c.0216.us221 = phi i64 [ %inc140.us236, %if.end.us235 ], [ 1, %if.end.us235.peel ]
%arrayidx31.us224 = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 %r.0218.us, i64 %c.0216.us221
%6 = load i64, ptr %arrayidx31.us224, align 8, !tbaa !5
%sub.us225 = add i64 %c.0216.us221, -1
%arrayidx35.us227 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %r.0218.us, i64 %c.0216.us221
%7 = load i8, ptr %arrayidx35.us227, align 1, !tbaa !9
%arrayidx39.us228 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %r.0218.us, i64 %sub.us225
%8 = load i8, ptr %arrayidx39.us228, align 1, !tbaa !9
%cmp41.us229 = icmp ne i8 %7, %8
%cmp46.us230 = icmp ne i8 %7, 46
%spec.select.not.us231 = and i1 %cmp46.us230, %cmp41.us229
%conv49.us232 = zext i1 %spec.select.not.us231 to i64
%add.us233 = add i64 %5, %conv49.us232
%spec.select209.us234 = call i64 @llvm.umin.i64(i64 %6, i64 %add.us233)
%arrayidx83.us = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 %r.0218.us, i64 %c.0216.us221
%arrayidx86.us = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 %sub84.us, i64 %c.0216.us221
%9 = load i64, ptr %arrayidx86.us, align 8, !tbaa !5
%arrayidx92.us = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %sub84.us, i64 %c.0216.us221
%10 = load i8, ptr %arrayidx92.us, align 1, !tbaa !9
%cmp94.us = icmp ne i8 %7, %10
%cmp100.us = icmp ne i8 %7, 46
%spec.select207.not.us = and i1 %cmp100.us, %cmp94.us
%conv104.us = zext i1 %spec.select207.not.us to i64
%add105.us = add i64 %9, %conv104.us
%spec.select210.us = call i64 @llvm.umin.i64(i64 %spec.select209.us234, i64 %add105.us)
store i64 %spec.select210.us, ptr %arrayidx83.us, align 8, !tbaa !5
%inc140.us236 = add nuw i64 %c.0216.us221, 1
%exitcond.not = icmp eq i64 %inc140.us236, %14
br i1 %exitcond.not, label %for.cond23.for.cond.cleanup26_crit_edge.us, label %if.end.us235, !llvm.loop !12
for.cond23.for.cond.cleanup26_crit_edge.us: ; preds = %if.end.us235, %if.end.us.us, %if.end.us235.peel, %if.end.us.us.peel
%inc143.us = add nuw i64 %r.0218.us, 1
%exitcond246.not = icmp eq i64 %inc143.us, %17
br i1 %exitcond246.not, label %for.cond.cleanup21, label %for.cond23.preheader.us, !llvm.loop !15
if.end.us.us: ; preds = %if.end.us.us.preheader, %if.end.us.us
%store_forwarded = phi i64 [ %load_initial, %if.end.us.us.preheader ], [ %spec.select209.us.us, %if.end.us.us ]
%c.0216.us.us = phi i64 [ 1, %if.end.us.us.preheader ], [ %inc140.us.us, %if.end.us.us ]
%arrayidx31.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 0, i64 %c.0216.us.us
%11 = load i64, ptr %arrayidx31.us.us, align 8, !tbaa !5
%sub.us.us = add i64 %c.0216.us.us, -1
%arrayidx35.us.us = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 0, i64 %c.0216.us.us
%12 = load i8, ptr %arrayidx35.us.us, align 1, !tbaa !9
%arrayidx39.us.us = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 0, i64 %sub.us.us
%13 = load i8, ptr %arrayidx39.us.us, align 1, !tbaa !9
%cmp41.us.us = icmp ne i8 %12, %13
%cmp46.us.us = icmp ne i8 %12, 46
%spec.select.not.us.us = and i1 %cmp46.us.us, %cmp41.us.us
%conv49.us.us = zext i1 %spec.select.not.us.us to i64
%add.us.us = add i64 %store_forwarded, %conv49.us.us
%spec.select209.us.us = call i64 @llvm.umin.i64(i64 %11, i64 %add.us.us)
store i64 %spec.select209.us.us, ptr %arrayidx31.us.us, align 8, !tbaa !5
%inc140.us.us = add nuw i64 %c.0216.us.us, 1
%exitcond244.not = icmp eq i64 %inc140.us.us, %14
br i1 %exitcond244.not, label %for.cond23.for.cond.cleanup26_crit_edge.us, label %if.end.us.us, !llvm.loop !16
for.body: ; preds = %entry, %for.cond.cleanup4
%i.0214 = phi i64 [ %inc9, %for.cond.cleanup4 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %i.0214
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%14 = load i64, ptr %W, align 8, !tbaa !5
%cmp3211.not = icmp eq i64 %14, 0
br i1 %cmp3211.not, label %for.cond.cleanup4, label %for.body5.preheader
for.body5.preheader: ; preds = %for.body
%15 = mul i64 %i.0214, 800
%scevgep = getelementptr i8, ptr %dp, i64 %15
%16 = shl nuw i64 %14, 3
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 -1, i64 %16, i1 false), !tbaa !5
br label %for.cond.cleanup4
for.cond.cleanup4: ; preds = %for.body5.preheader, %for.body
%inc9 = add nuw i64 %i.0214, 1
%17 = load i64, ptr %H, align 8, !tbaa !5
%cmp = icmp ult i64 %inc9, %17
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !17
for.cond.cleanup21: ; preds = %for.cond23.for.cond.cleanup26_crit_edge.us, %for.cond23.preheader.lr.ph, %for.cond.cleanup.thread, %for.cond.cleanup
%.lcssa258 = phi i64 [ 0, %for.cond.cleanup.thread ], [ 0, %for.cond.cleanup ], [ %17, %for.cond23.preheader.lr.ph ], [ %17, %for.cond23.for.cond.cleanup26_crit_edge.us ]
%.pre251257 = phi i64 [ %.pre251.pre, %for.cond.cleanup.thread ], [ %14, %for.cond.cleanup ], [ 0, %for.cond23.preheader.lr.ph ], [ %14, %for.cond23.for.cond.cleanup26_crit_edge.us ]
%sub145 = add i64 %.lcssa258, -1
%sub147 = add i64 %.pre251257, -1
%arrayidx148 = getelementptr inbounds [100 x [100 x i64]], ptr %dp, i64 0, i64 %sub145, i64 %sub147
%18 = load i64, ptr %arrayidx148, align 8, !tbaa !5
%call149 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %18)
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %dp) #6
call void @llvm.lifetime.end.p0(i64 10100, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %W) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %H) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"double", !7, i64 0}
!12 = distinct !{!12, !13, !14}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.peeled.count", i32 1}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13, !14}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
int main(void)
{
int s, i, sum;
sum = 0;
for (i = 0; i < 10; i++){
scanf("%d", &s);
sum += s;
}
printf("%d\n", sum);
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272596/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272596/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%1 = load i32, ptr %s, align 4, !tbaa !5
%add.1 = add nsw i32 %1, %0
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%2 = load i32, ptr %s, align 4, !tbaa !5
%add.2 = add nsw i32 %2, %add.1
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%3 = load i32, ptr %s, align 4, !tbaa !5
%add.3 = add nsw i32 %3, %add.2
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%4 = load i32, ptr %s, align 4, !tbaa !5
%add.4 = add nsw i32 %4, %add.3
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%5 = load i32, ptr %s, align 4, !tbaa !5
%add.5 = add nsw i32 %5, %add.4
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%6 = load i32, ptr %s, align 4, !tbaa !5
%add.6 = add nsw i32 %6, %add.5
%call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%7 = load i32, ptr %s, align 4, !tbaa !5
%add.7 = add nsw i32 %7, %add.6
%call.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%8 = load i32, ptr %s, align 4, !tbaa !5
%add.8 = add nsw i32 %8, %add.7
%call.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%9 = load i32, ptr %s, align 4, !tbaa !5
%add.9 = add nsw i32 %9, %add.8
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.9)
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 a, b, c, d, e, f, g, h, i, j, sum;
scanf("%d %d %d %d %d %d %d %d %d %d",&a,&b,&c,&d,&e,&f,&g,&h,&i,&j);
sum = a + b + c + d + e + f + g + h + i + j;
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272639/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272639/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [30 x i8] c"%d %d %d %d %d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%f = alloca i32, align 4
%g = alloca i32, align 4
%h = alloca i32, align 4
%i = alloca i32, align 4
%j = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %f, ptr noundef nonnull %g, ptr noundef nonnull %h, ptr noundef nonnull %i, ptr noundef nonnull %j)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%3 = load i32, ptr %d, align 4, !tbaa !5
%add2 = add nsw i32 %add1, %3
%4 = load i32, ptr %e, align 4, !tbaa !5
%add3 = add nsw i32 %add2, %4
%5 = load i32, ptr %f, align 4, !tbaa !5
%add4 = add nsw i32 %add3, %5
%6 = load i32, ptr %g, align 4, !tbaa !5
%add5 = add nsw i32 %add4, %6
%7 = load i32, ptr %h, align 4, !tbaa !5
%add6 = add nsw i32 %add5, %7
%8 = load i32, ptr %i, align 4, !tbaa !5
%add7 = add nsw i32 %add6, %8
%9 = load i32, ptr %j, align 4, !tbaa !5
%add8 = add nsw i32 %add7, %9
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int sum,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10;
scanf("%d %d %d %d %d %d %d %d %d %d",&s1,&s2,&s3,&s4,&s5,&s6,&s7,&s8,&s9,&s10);
sum=s1+s2+s3+s4+s5+s6+s7+s8+s9+s10;
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272682/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [30 x i8] c"%d %d %d %d %d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca i32, align 4
%s2 = alloca i32, align 4
%s3 = alloca i32, align 4
%s4 = alloca i32, align 4
%s5 = alloca i32, align 4
%s6 = alloca i32, align 4
%s7 = alloca i32, align 4
%s8 = alloca i32, align 4
%s9 = alloca i32, align 4
%s10 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s3) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s4) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s5) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s6) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s7) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s8) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s9) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s10) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3, ptr noundef nonnull %s4, ptr noundef nonnull %s5, ptr noundef nonnull %s6, ptr noundef nonnull %s7, ptr noundef nonnull %s8, ptr noundef nonnull %s9, ptr noundef nonnull %s10)
%0 = load i32, ptr %s1, align 4, !tbaa !5
%1 = load i32, ptr %s2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %s3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%3 = load i32, ptr %s4, align 4, !tbaa !5
%add2 = add nsw i32 %add1, %3
%4 = load i32, ptr %s5, align 4, !tbaa !5
%add3 = add nsw i32 %add2, %4
%5 = load i32, ptr %s6, align 4, !tbaa !5
%add4 = add nsw i32 %add3, %5
%6 = load i32, ptr %s7, align 4, !tbaa !5
%add5 = add nsw i32 %add4, %6
%7 = load i32, ptr %s8, align 4, !tbaa !5
%add6 = add nsw i32 %add5, %7
%8 = load i32, ptr %s9, align 4, !tbaa !5
%add7 = add nsw i32 %add6, %8
%9 = load i32, ptr %s10, align 4, !tbaa !5
%add8 = add nsw i32 %add7, %9
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s10) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s9) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s8) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s7) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s6) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s5) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s4) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s3) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s1) #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[10],i,a=0;
for(i=0;i<10;i++){
scanf("%d\n",&s[i]);
a=a+s[i];
}
printf("%d\n",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272732/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272732/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx.1 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 1
%arrayidx.2 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 2
%arrayidx.3 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 3
%arrayidx.4 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 4
%arrayidx.5 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 5
%arrayidx.6 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 6
%arrayidx.7 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 7
%0 = load <4 x i32>, ptr %s, align 16
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <8 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%3 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%4 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%5 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%6 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6)
%7 = load i32, ptr %arrayidx.6, align 8, !tbaa !5
%call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.7)
%8 = load i32, ptr %arrayidx.7, align 4, !tbaa !5
%9 = insertelement <8 x i32> %1, i32 %2, i64 1
%10 = insertelement <8 x i32> %9, i32 %3, i64 2
%11 = insertelement <8 x i32> %10, i32 %4, i64 3
%12 = insertelement <8 x i32> %11, i32 %5, i64 4
%13 = insertelement <8 x i32> %12, i32 %6, i64 5
%14 = insertelement <8 x i32> %13, i32 %7, i64 6
%15 = insertelement <8 x i32> %14, i32 %8, i64 7
%arrayidx.8 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 8
%call.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.8)
%16 = load i32, ptr %arrayidx.8, align 16, !tbaa !5
%arrayidx.9 = getelementptr inbounds [10 x i32], ptr %s, i64 0, i64 9
%call.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.9)
%17 = load i32, ptr %arrayidx.9, align 4, !tbaa !5
%18 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %15)
%op.rdx = add i32 %18, %16
%op.rdx11 = add i32 %op.rdx, %17
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %op.rdx11)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v8i32(<8 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"}
|
#include <stdio.h>
int main(void){
int N, D, x, i, cnt = 0;
int a[10000];
scanf("%d %d %d", &N, &D, &x);
for(i = 0; i < N; i++){
scanf("%d", &a[i]);
}
for(i = 0; i < N; i++){
if(D % a[i] == 0){
cnt = cnt + (D / a[i]);
//printf("%d\n", cnt);
}else{
cnt = cnt + ((D / a[i])) + 1;
//printf("%d\n", cnt);
}
}
printf("%d\n", cnt + x);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272776/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272776/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%D = alloca i32, align 4
%x = alloca i32, align 4
%a = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D, ptr noundef nonnull %x)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.body, label %for.end17
for.cond2.preheader: ; preds = %for.body
%cmp331 = icmp sgt i32 %2, 0
br i1 %cmp331, label %for.body4.lr.ph, label %for.end17
for.body4.lr.ph: ; preds = %for.cond2.preheader
%1 = load i32, ptr %D, align 4, !tbaa !5
%wide.trip.count = zext i32 %2 to i64
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 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.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.lr.ph, %for.body4
%indvars.iv37 = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next38, %for.body4 ]
%cnt.033 = phi i32 [ 0, %for.body4.lr.ph ], [ %cnt.1, %for.body4 ]
%arrayidx6 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv37
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%rem = srem i32 %1, %4
%cmp7 = icmp ne i32 %rem, 0
%div = sdiv i32 %1, %4
%add13 = zext i1 %cmp7 to i32
%cnt.1.v = add i32 %cnt.033, %add13
%cnt.1 = add i32 %div, %cnt.1.v
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
br i1 %exitcond.not, label %for.end17, label %for.body4, !llvm.loop !11
for.end17: ; preds = %for.body4, %entry, %for.cond2.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %cnt.1, %for.body4 ]
%5 = load i32, ptr %x, align 4, !tbaa !5
%add18 = add nsw i32 %5, %cnt.0.lcssa
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add18)
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #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}
|
#include <stdio.h>
int main(void) {
int N, D, X;
int A[128];
int i;
int tomatuharuka = 0;
if (scanf("%d", &N) != 1) return 1;
if (scanf("%d%d", &D, &X) != 2) return 1;
for (i = 0; i < N; i++) {
if (scanf("%d", &A[i]) != 1) return 1;
}
for (i = 0; i < N; i++) {
tomatuharuka += (D + A[i] - 1) / A[i];
}
printf("%d\n", X + tomatuharuka);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272819/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272819/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%D = alloca i32, align 4
%X = alloca i32, align 4
%A = alloca [128 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %D, ptr noundef nonnull %X)
%cmp2.not = icmp eq i32 %call1, 2
br i1 %cmp2.not, label %for.cond.preheader, label %cleanup
for.cond.preheader: ; preds = %if.end
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp536 = icmp sgt i32 %0, 0
br i1 %cmp536, label %for.body, label %for.end20
for.cond: ; preds = %for.body
%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
%cmp5 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp5, label %for.body, label %for.cond10.preheader, !llvm.loop !9
for.cond10.preheader: ; preds = %for.cond
%cmp1138 = icmp sgt i32 %1, 0
br i1 %cmp1138, label %for.body12.lr.ph, label %for.end20
for.body12.lr.ph: ; preds = %for.cond10.preheader
%3 = load i32, ptr %D, align 4, !tbaa !5
%add = add i32 %3, -1
%wide.trip.count = zext i32 %1 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %1, 1
br i1 %4, label %for.end20.loopexit.unr-lcssa, label %for.body12.lr.ph.new
for.body12.lr.ph.new: ; preds = %for.body12.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body12
for.body: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [128 x i32], ptr %A, i64 0, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%cmp7.not = icmp eq i32 %call6, 1
br i1 %cmp7.not, label %for.cond, label %cleanup
for.body12: ; preds = %for.body12, %for.body12.lr.ph.new
%indvars.iv44 = phi i64 [ 0, %for.body12.lr.ph.new ], [ %indvars.iv.next45.1, %for.body12 ]
%tomatuharuka.040 = phi i32 [ 0, %for.body12.lr.ph.new ], [ %add17.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.lr.ph.new ], [ %niter.next.1, %for.body12 ]
%arrayidx14 = getelementptr inbounds [128 x i32], ptr %A, i64 0, i64 %indvars.iv44
%5 = load i32, ptr %arrayidx14, align 8, !tbaa !5
%sub = add i32 %add, %5
%div = sdiv i32 %sub, %5
%add17 = add nsw i32 %div, %tomatuharuka.040
%indvars.iv.next45 = or i64 %indvars.iv44, 1
%arrayidx14.1 = getelementptr inbounds [128 x i32], ptr %A, i64 0, i64 %indvars.iv.next45
%6 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%sub.1 = add i32 %add, %6
%div.1 = sdiv i32 %sub.1, %6
%add17.1 = add nsw i32 %div.1, %add17
%indvars.iv.next45.1 = add nuw nsw i64 %indvars.iv44, 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.end20.loopexit.unr-lcssa, label %for.body12, !llvm.loop !11
for.end20.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.lr.ph
%add17.lcssa.ph = phi i32 [ undef, %for.body12.lr.ph ], [ %add17.1, %for.body12 ]
%indvars.iv44.unr = phi i64 [ 0, %for.body12.lr.ph ], [ %indvars.iv.next45.1, %for.body12 ]
%tomatuharuka.040.unr = phi i32 [ 0, %for.body12.lr.ph ], [ %add17.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end20, label %for.body12.epil
for.body12.epil: ; preds = %for.end20.loopexit.unr-lcssa
%arrayidx14.epil = getelementptr inbounds [128 x i32], ptr %A, i64 0, i64 %indvars.iv44.unr
%7 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5
%sub.epil = add i32 %add, %7
%div.epil = sdiv i32 %sub.epil, %7
%add17.epil = add nsw i32 %div.epil, %tomatuharuka.040.unr
br label %for.end20
for.end20: ; preds = %for.body12.epil, %for.end20.loopexit.unr-lcssa, %for.cond.preheader, %for.cond10.preheader
%tomatuharuka.0.lcssa = phi i32 [ 0, %for.cond10.preheader ], [ 0, %for.cond.preheader ], [ %add17.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %add17.epil, %for.body12.epil ]
%8 = load i32, ptr %X, align 4, !tbaa !5
%add21 = add nsw i32 %8, %tomatuharuka.0.lcssa
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add21)
br label %cleanup
cleanup: ; preds = %for.body, %if.end, %entry, %for.end20
%retval.0 = phi i32 [ 0, %for.end20 ], [ 1, %entry ], [ 1, %if.end ], [ 1, %for.body ]
call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int N, D, X;
scanf("%d%d%d", &N, &D, &X);
int A[N];
for(int i = 0; i < N; i++){
scanf("%d", &A[i]);
X += (D-1) / A[i] + 1;
}
printf("%d\n", X);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%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
%D = alloca i32, align 4
%X = 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 %D) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D, ptr noundef nonnull %X)
%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
%cmp9 = icmp sgt i32 %3, 0
br i1 %cmp9, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = load i32, ptr %X, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%4 = phi i32 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %add4, %for.body ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #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 i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %D, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%div = sdiv i32 %sub, %6
%add = add nsw i32 %div, 1
%7 = load i32, ptr %X, align 4, !tbaa !5
%add4 = add nsw i32 %add, %7
store i32 %add4, ptr %X, 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.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int N,D,X;
int i;
scanf("%d",&N);
scanf("%d",&D);
scanf("%d",&X);
int A[N];
for(i=0;i<N;i++){
scanf("%d",&A[i]);
}
int ans=0;
int d;
for(i=0;i<N;i++){//人数
d=1;
while(d<=D){
ans++;
d+=A[i];
}
}
ans+=X;
printf("%d",ans);
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272905/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272905/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%D = 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 %D) #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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%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
%cmp24 = icmp sgt i32 %3, 0
br i1 %cmp24, label %for.body, label %for.end13
for.cond4.preheader: ; preds = %for.body
%cmp530 = icmp sgt i32 %6, 0
br i1 %cmp530, label %while.cond.preheader.lr.ph, label %for.end13
while.cond.preheader.lr.ph: ; preds = %for.cond4.preheader
%4 = load i32, ptr %D, align 4, !tbaa !5
%cmp7.not26 = icmp slt i32 %4, 1
br i1 %cmp7.not26, label %for.end13, label %while.cond.preheader.preheader
while.cond.preheader.preheader: ; preds = %while.cond.preheader.lr.ph
%5 = add nuw i32 %4, 1
%wide.trip.count = zext i32 %6 to i64
br label %while.cond.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
while.cond.preheader: ; preds = %while.cond.preheader.preheader, %while.cond.preheader
%indvars.iv37 = phi i64 [ 0, %while.cond.preheader.preheader ], [ %indvars.iv.next38, %while.cond.preheader ]
%ans.032 = phi i32 [ 0, %while.cond.preheader.preheader ], [ %17, %while.cond.preheader ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv37
%8 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%9 = add nsw i32 %8, 1
%smax = call i32 @llvm.smax.i32(i32 %9, i32 %5)
%10 = xor i32 %8, -1
%11 = add i32 %smax, %10
%12 = icmp ne i32 %11, 0
%umin = zext i1 %12 to i32
%13 = sub i32 %11, %umin
%umax = call i32 @llvm.umax.i32(i32 %8, i32 1)
%14 = udiv i32 %13, %umax
%15 = add i32 %ans.032, 1
%16 = add i32 %15, %umin
%17 = add i32 %16, %14
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
br i1 %exitcond.not, label %for.end13, label %while.cond.preheader, !llvm.loop !11
for.end13: ; preds = %while.cond.preheader, %entry, %while.cond.preheader.lr.ph, %for.cond4.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %while.cond.preheader.lr.ph ], [ 0, %entry ], [ %17, %while.cond.preheader ]
%18 = load i32, ptr %X, align 4, !tbaa !5
%add14 = add nsw i32 %18, %ans.0.lcssa
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add14)
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 %D) #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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
/*
cat <<EOF >mistaken-paste
*/
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 200000000000007LL
#define MOD 1000000007
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 200000
#define M_MAX 200000
#ifdef __cplusplus
#include <queue>
#include <stack>
// #include <tuple>
#include <set>
#include <map>
// using namespace std; // HELL
using std::queue;
using std::priority_queue;
using std::stack;
// using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
hwll a;
hwll b;
} linell;
typedef struct {
ull s;
ull t;
int32_t c;
} struct_a;
typedef struct {
int32_t from;
int32_t to;
sll cost;
} struct_b;
const hw vector8[8] = {
{-1, -1},
{-1, 0},
{-1, +1},
{ 0, -1},
{ 0, +1},
{+1, -1},
{+1, 0},
{+1, +1}
};
ull n, m;
ull h, w;
ull k;
ull q;
ull vua, vub, vuc, vud, vue, vuf;
sll vsa, vsb, vsc, vsd, vse, vsf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
size_t slen;
size_t tlen;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
void printUquotient (ull left, ull right) {
const int32_t digits = 20;
printf("%llu.", left / right);
left %= right;
for (int32_t i = 0; i < digits; i++) {
left *= 10;
printf("%1d", left / right);
left %= right;
}
puts("");
return;
}
void printSquotient (sll left, sll right) {
if (left * right < 0) putchar('-');
printUquotient(sdiff(left, 0), sdiff(right, 0));
return;
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
// #ifdef __cplusplus
// typedef struct {
// int32_t to;
// sll cost;
// } edge;
// typedef pair<sll, int32_t> P;
// std::vector<edge> g[N_MAX];
// void dijk_init (ull n, struct_b arr[]) {
// edge x;
// for (int32_t i = 0; i < n; i++) {
// x.to = arr[i].to;
// x.cost = arr[i].cost;
// g[arr[i].from].push_back(x);
// }
// }
// bool dijkstra (int s, sll distance[]) {
// priority_queue<P, std::vector<P>, greater<P> > que; // (最短距離, 頂点番号)
// que.push(P(distance[s], s));
// bool ischanged = false;
// while (!que.empty()) {
// P p = que.top();
// que.pop();
// sll v = p.second;
// if (distance[v] < p.first) continue;
// int32_t maxsize = g[v].size();
// for (int32_t i = 0; i < maxsize; i++) {
// edge e = g[v][i];
// if (distance[e.to] > distance[v] + e.cost) {
// distance[e.to] = distance[v] + e.cost;
// ischanged = true;
// que.push(P(distance[e.to], e.to));
// }
// }
// }
// return ischanged;
// }
// #endif
sll dist[N_MAX];
struct_b path[M_MAX * 2];
// ull a[N_MAX];
// ull a[M_MAX];
sll a[N_MAX];
// ull a[N_MAX][N_MAX];
// ull a[M_MAX][M_MAX];
// sll a[N_MAX][N_MAX];
ull b[N_MAX];
// ull b[M_MAX];
// sll b[N_MAX];
// ull c[N_MAX];
// sll c[M_MAX];
// char c[N_MAX];
char s[N_MAX + 1];
// char s[N_MAX + 1][N_MAX + 1];
// char s[N_MAX + 1][M_MAX + 1];
// char t[N_MAX + 1];
ull alphabets[26];
// ull blphabets[26];
// char alphabets[26];
// ull dp[N_MAX + 1];
// sll dp[N_MAX + 1];
// ull dp[N_MAX + 1][N_MAX + 1];
// sll dp[N_MAX + 1][N_MAX + 1];
// bool dp[N_MAX + 1];
// bool dp[N_MAX + 1][N_MAX + 1];
// bool dq[N_MAX];
hwll arr[N_MAX + 1];
// hwll arr[M_MAX];
hwll brr[N_MAX];
// sll dp[N_MAX + 1];
// ull color[N_MAX];
// set<sll> children[N_MAX];
// set<sll> leaf[N_MAX];
double distance (sll x1, sll y1, sll x2, sll y2) {
double xdist2, ydist2, origindist, dist;
xdist2 = (x1 - x2) * (x1 - x2);
ydist2 = (y1 - y2) * (y1 - y2);
return sqrt(xdist2 + ydist2);
}
int32_t pullcomp (const void *left, const void *right) {
ull l = *(ull*)left;
ull r = *(ull*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t phwllABcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
return 0;
}
ull accp (ull a, ull p) {
if (a == 0) {
return 0;
}
if (a == 1) {
return p;
}
return divide((MOD + bitpow(a, p, MOD) - 1) % MOD, a - 1, MOD);
}
ull solve () {
sll i, j, ki;
// ull result = 0;
sll result = 0;
// double result = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
ull item;
ull *dpcell;
sum = vub;
for (i = 0; i < n; i++) {
sum += ((vua - 1) / a[i]) + 1;
}
result = sum;
printf("%llu\n", result);
// printf("%.12lf\n", (double)result);
// puts(s);
return 0;
success:
puts("YES");
// puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("First");
return 0;
fail:
puts("NO");
// puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Second");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
// scanf("%lf", &vda, &vdb);
// scanf("%lld%lld%lld%lld", &vsa, &vsb, &vsc, &vsd);
// scanf("%llu%llu", &vua, &vub, &vuc, &vud);
// scanf("%llu%llu", &h, &w);
// scanf("%*llu%*llu");
scanf("%llu", &n, &m);
// scanf("%llu", &k, &n);
scanf("%llu%llu", &vua, &vub, &vuc, &vud, &vue, &vuf);
// scanf("%lld%lld", &vsa, &vsb, &vsc);
// scanf("%s", s);
// scanf("%s", t);
// scanf("%llu", &m);
// scanf("%llu", &q);
for (i = 0; i < n; i++) {
scanf("%lld", &a[i]);
// scanf("%llu", &b[i]);
// a[i]--;
// b[i]--;
}
// for (i = 0; i < n; i++) {
// scanf("%llu", &b[i]);
// }
// for (i = 0; i < h; i++) {
// for (j = 0; j < w; j++) {
// scanf("%llu", &a[i][j]);
// }
// }
// for (i = 0; i < n; i++) {
// scanf("%s", &s[i]);
// }
// scanf("%llu", &k);
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272949/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272949/source.c"
target datalayout = "e-m:e-p270: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.hw = type { i32, i32 }
%struct.struct_b = type { i32, i32, i64 }
%struct.hwll = type { i64, i64 }
@vector8 = dso_local local_unnamed_addr constant [8 x %struct.hw] [%struct.hw { i32 -1, i32 -1 }, %struct.hw { i32 -1, i32 0 }, %struct.hw { i32 -1, i32 1 }, %struct.hw { i32 0, i32 -1 }, %struct.hw { i32 0, i32 1 }, %struct.hw { i32 1, i32 -1 }, %struct.hw { i32 1, i32 0 }, %struct.hw { i32 1, i32 1 }], align 16
@.str = private unnamed_addr constant [6 x i8] c"%llu.\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%1d\00", align 1
@vub = dso_local global i64 0, align 8
@n = dso_local global i64 0, align 8
@vua = dso_local global i64 0, align 8
@a = dso_local global [200000 x i64] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1
@.str.6 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@m = dso_local global i64 0, align 8
@.str.7 = private unnamed_addr constant [9 x i8] c"%llu%llu\00", align 1
@vuc = dso_local global i64 0, align 8
@vud = dso_local global i64 0, align 8
@vue = dso_local global i64 0, align 8
@vuf = dso_local global i64 0, align 8
@.str.8 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@vsa = dso_local local_unnamed_addr global i64 0, align 8
@vsb = dso_local local_unnamed_addr global i64 0, align 8
@vsc = dso_local local_unnamed_addr global i64 0, align 8
@vsd = dso_local local_unnamed_addr global i64 0, align 8
@vse = dso_local local_unnamed_addr global i64 0, align 8
@vsf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@slen = dso_local local_unnamed_addr global i64 0, align 8
@tlen = dso_local local_unnamed_addr global i64 0, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@dist = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16
@path = dso_local local_unnamed_addr global [400000 x %struct.struct_b] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [200000 x i64] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [200001 x i8] zeroinitializer, align 16
@alphabets = dso_local local_unnamed_addr global [26 x i64] zeroinitializer, align 16
@arr = dso_local local_unnamed_addr global [200001 x %struct.hwll] zeroinitializer, align 16
@brr = dso_local local_unnamed_addr global [200000 x %struct.hwll] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ]
%y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ]
%cmp = icmp ult i64 %x.tr, %y.tr
br i1 %cmp, label %tailrecurse.backedge, label %if.else
if.else: ; preds = %tailrecurse
%cmp1 = icmp eq i64 %y.tr, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%rem = urem i64 %x.tr, %y.tr
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.else3, %tailrecurse
%y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ]
br label %tailrecurse
return: ; preds = %if.else
ret i64 %x.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printUquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 {
entry:
%div = udiv i64 %left, %right
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div)
%left.addr.0 = urem i64 %left, %right
%mul = mul i64 %left.addr.0, 10
%div1 = udiv i64 %mul, %right
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1)
%left.addr.0.1 = urem i64 %mul, %right
%mul.1 = mul i64 %left.addr.0.1, 10
%div1.1 = udiv i64 %mul.1, %right
%call2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.1)
%left.addr.0.2 = urem i64 %mul.1, %right
%mul.2 = mul i64 %left.addr.0.2, 10
%div1.2 = udiv i64 %mul.2, %right
%call2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.2)
%left.addr.0.3 = urem i64 %mul.2, %right
%mul.3 = mul i64 %left.addr.0.3, 10
%div1.3 = udiv i64 %mul.3, %right
%call2.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.3)
%left.addr.0.4 = urem i64 %mul.3, %right
%mul.4 = mul i64 %left.addr.0.4, 10
%div1.4 = udiv i64 %mul.4, %right
%call2.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.4)
%left.addr.0.5 = urem i64 %mul.4, %right
%mul.5 = mul i64 %left.addr.0.5, 10
%div1.5 = udiv i64 %mul.5, %right
%call2.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.5)
%left.addr.0.6 = urem i64 %mul.5, %right
%mul.6 = mul i64 %left.addr.0.6, 10
%div1.6 = udiv i64 %mul.6, %right
%call2.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.6)
%left.addr.0.7 = urem i64 %mul.6, %right
%mul.7 = mul i64 %left.addr.0.7, 10
%div1.7 = udiv i64 %mul.7, %right
%call2.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.7)
%left.addr.0.8 = urem i64 %mul.7, %right
%mul.8 = mul i64 %left.addr.0.8, 10
%div1.8 = udiv i64 %mul.8, %right
%call2.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.8)
%left.addr.0.9 = urem i64 %mul.8, %right
%mul.9 = mul i64 %left.addr.0.9, 10
%div1.9 = udiv i64 %mul.9, %right
%call2.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.9)
%left.addr.0.10 = urem i64 %mul.9, %right
%mul.10 = mul i64 %left.addr.0.10, 10
%div1.10 = udiv i64 %mul.10, %right
%call2.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.10)
%left.addr.0.11 = urem i64 %mul.10, %right
%mul.11 = mul i64 %left.addr.0.11, 10
%div1.11 = udiv i64 %mul.11, %right
%call2.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.11)
%left.addr.0.12 = urem i64 %mul.11, %right
%mul.12 = mul i64 %left.addr.0.12, 10
%div1.12 = udiv i64 %mul.12, %right
%call2.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.12)
%left.addr.0.13 = urem i64 %mul.12, %right
%mul.13 = mul i64 %left.addr.0.13, 10
%div1.13 = udiv i64 %mul.13, %right
%call2.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.13)
%left.addr.0.14 = urem i64 %mul.13, %right
%mul.14 = mul i64 %left.addr.0.14, 10
%div1.14 = udiv i64 %mul.14, %right
%call2.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.14)
%left.addr.0.15 = urem i64 %mul.14, %right
%mul.15 = mul i64 %left.addr.0.15, 10
%div1.15 = udiv i64 %mul.15, %right
%call2.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.15)
%left.addr.0.16 = urem i64 %mul.15, %right
%mul.16 = mul i64 %left.addr.0.16, 10
%div1.16 = udiv i64 %mul.16, %right
%call2.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.16)
%left.addr.0.17 = urem i64 %mul.16, %right
%mul.17 = mul i64 %left.addr.0.17, 10
%div1.17 = udiv i64 %mul.17, %right
%call2.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.17)
%left.addr.0.18 = urem i64 %mul.17, %right
%mul.18 = mul i64 %left.addr.0.18, 10
%div1.18 = udiv i64 %mul.18, %right
%call2.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.18)
%left.addr.0.19 = urem i64 %mul.18, %right
%mul.19 = mul i64 %left.addr.0.19, 10
%div1.19 = udiv i64 %mul.19, %right
%call2.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.19)
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %0)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @printSquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 {
entry:
%mul = mul nsw i64 %right, %left
%cmp = icmp slt i64 %mul, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 45, ptr noundef %0)
br label %if.end
if.end: ; preds = %if.then, %entry
%retval.0.i = tail call i64 @llvm.abs.i64(i64 %left, i1 true)
%retval.0.i5 = tail call i64 @llvm.abs.i64(i64 %right, i1 true)
tail call void @printUquotient(i64 noundef %retval.0.i, i64 noundef %retval.0.i5)
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local double @distance(i64 noundef %x1, i64 noundef %y1, i64 noundef %x2, i64 noundef %y2) local_unnamed_addr #5 {
entry:
%sub = sub nsw i64 %x1, %x2
%mul = mul nsw i64 %sub, %sub
%conv = sitofp i64 %mul to double
%sub2 = sub nsw i64 %y1, %y2
%mul4 = mul nsw i64 %sub2, %sub2
%conv5 = sitofp i64 %mul4 to double
%add = fadd double %conv, %conv5
%call = tail call double @sqrt(double noundef %add) #9
ret double %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #7 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !12
%1 = load i64, ptr %right, align 8, !tbaa !12
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #7 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !14
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !14
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @accp(i64 noundef %a, i64 noundef %p) local_unnamed_addr #1 {
entry:
switch i64 %a, label %if.end3 [
i64 0, label %return
i64 1, label %if.then2
]
if.then2: ; preds = %entry
br label %return
if.end3: ; preds = %entry
%tobool.not12.i = icmp eq i64 %p, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %if.end3, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %if.end3 ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %a, %if.end3 ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %p, %if.end3 ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, 1000000007
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, 1000000007
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit.loopexit, label %while.body.i, !llvm.loop !5
bitpow.exit.loopexit: ; preds = %if.end.i
%0 = add nuw nsw i64 %result.1.i, 1000000006
%1 = urem i64 %0, 1000000007
br label %bitpow.exit
bitpow.exit: ; preds = %bitpow.exit.loopexit, %if.end3
%result.0.lcssa.i = phi i64 [ 0, %if.end3 ], [ %1, %bitpow.exit.loopexit ]
%sub4 = add i64 %a, -1
br label %while.body.i.i
while.body.i.i: ; preds = %if.end.i.i, %bitpow.exit
%result.015.i.i = phi i64 [ %result.1.i.i, %if.end.i.i ], [ 1, %bitpow.exit ]
%a.addr.014.i.i = phi i64 [ %rem3.i.i, %if.end.i.i ], [ %sub4, %bitpow.exit ]
%x.addr.013.i.i = phi i64 [ %div11.i.i, %if.end.i.i ], [ 1000000005, %bitpow.exit ]
%and.i.i = and i64 %x.addr.013.i.i, 1
%tobool1.not.i.i = icmp eq i64 %and.i.i, 0
br i1 %tobool1.not.i.i, label %if.end.i.i, label %if.then.i.i
if.then.i.i: ; preds = %while.body.i.i
%mul.i.i = mul i64 %a.addr.014.i.i, %result.015.i.i
%rem.i.i = urem i64 %mul.i.i, 1000000007
br label %if.end.i.i
if.end.i.i: ; preds = %if.then.i.i, %while.body.i.i
%result.1.i.i = phi i64 [ %rem.i.i, %if.then.i.i ], [ %result.015.i.i, %while.body.i.i ]
%div11.i.i = lshr i64 %x.addr.013.i.i, 1
%mul2.i.i = mul i64 %a.addr.014.i.i, %a.addr.014.i.i
%rem3.i.i = urem i64 %mul2.i.i, 1000000007
%tobool.not.i.i = icmp ult i64 %x.addr.013.i.i, 2
br i1 %tobool.not.i.i, label %divide.exit, label %while.body.i.i, !llvm.loop !5
divide.exit: ; preds = %if.end.i.i
%mul.i10 = mul nuw nsw i64 %result.1.i.i, %result.0.lcssa.i
%rem.i11 = urem i64 %mul.i10, 1000000007
br label %return
return: ; preds = %entry, %divide.exit, %if.then2
%retval.0 = phi i64 [ %p, %if.then2 ], [ %rem.i11, %divide.exit ], [ %a, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #3 {
entry:
%0 = load i64, ptr @vub, align 8, !tbaa !12
%1 = load i64, ptr @n, align 8, !tbaa !12
%cmp14.not = icmp eq i64 %1, 0
br i1 %cmp14.not, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%2 = load i64, ptr @vua, align 8, !tbaa !12
%sub = add i64 %2, -1
%xtraiter = and i64 %1, 1
%3 = icmp eq i64 %1, 1
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %1, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%i.016 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%sum.015 = phi i64 [ %0, %for.body.lr.ph.new ], [ %add1.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %i.016
%4 = load i64, ptr %arrayidx, align 16, !tbaa !12
%div = udiv i64 %sub, %4
%add = add i64 %sum.015, 1
%add1 = add i64 %add, %div
%inc = or i64 %i.016, 1
%arrayidx.1 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %inc
%5 = load i64, ptr %arrayidx.1, align 8, !tbaa !12
%div.1 = udiv i64 %sub, %5
%add.1 = add i64 %add1, 1
%add1.1 = add i64 %add.1, %div.1
%inc.1 = add nuw nsw i64 %i.016, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !16
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%add1.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %add1.1, %for.body ]
%i.016.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.1, %for.body ]
%sum.015.unr = phi i64 [ %0, %for.body.lr.ph ], [ %add1.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %i.016.unr
%6 = load i64, ptr %arrayidx.epil, align 8, !tbaa !12
%div.epil = udiv i64 %sub, %6
%add.epil = add i64 %sum.015.unr, 1
%add1.epil = add i64 %add.epil, %div.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%sum.0.lcssa = phi i64 [ %0, %entry ], [ %add1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add1.epil, %for.body.epil ]
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %sum.0.lcssa)
ret i64 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @n, ptr noundef nonnull @m)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull @vua, ptr noundef nonnull @vub, ptr noundef nonnull @vuc, ptr noundef nonnull @vud, ptr noundef nonnull @vue, ptr noundef nonnull @vuf)
%0 = load i64, ptr @n, align 8, !tbaa !12
%cmp7.not = icmp eq i64 %0, 0
br i1 %cmp7.not, label %for.end.thread, label %for.body
for.end.thread: ; preds = %entry
%1 = load i64, ptr @vub, align 8, !tbaa !12
br label %solve.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %indvars.iv
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%2 = load i64, ptr @n, align 8, !tbaa !12
%cmp = icmp ugt i64 %2, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !17
for.end: ; preds = %for.body
%3 = load i64, ptr @vub, align 8, !tbaa !12
%cmp14.not.i = icmp eq i64 %2, 0
br i1 %cmp14.not.i, label %solve.exit, label %for.body.lr.ph.i
for.body.lr.ph.i: ; preds = %for.end
%4 = load i64, ptr @vua, align 8, !tbaa !12
%sub.i = add i64 %4, -1
%xtraiter = and i64 %2, 1
%5 = icmp eq i64 %2, 1
br i1 %5, label %solve.exit.loopexit.unr-lcssa, label %for.body.lr.ph.i.new
for.body.lr.ph.i.new: ; preds = %for.body.lr.ph.i
%unroll_iter = and i64 %2, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i.new
%i.016.i = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %inc.i.1, %for.body.i ]
%sum.015.i = phi i64 [ %3, %for.body.lr.ph.i.new ], [ %add1.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.lr.ph.i.new ], [ %niter.next.1, %for.body.i ]
%arrayidx.i = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %i.016.i
%6 = load i64, ptr %arrayidx.i, align 16, !tbaa !12
%div.i = udiv i64 %sub.i, %6
%add.i = add i64 %sum.015.i, 1
%add1.i = add i64 %add.i, %div.i
%inc.i = or i64 %i.016.i, 1
%arrayidx.i.1 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %inc.i
%7 = load i64, ptr %arrayidx.i.1, align 8, !tbaa !12
%div.i.1 = udiv i64 %sub.i, %7
%add.i.1 = add i64 %add1.i, 1
%add1.i.1 = add i64 %add.i.1, %div.i.1
%inc.i.1 = add nuw nsw i64 %i.016.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 %solve.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !16
solve.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.lr.ph.i
%add1.i.lcssa.ph = phi i64 [ undef, %for.body.lr.ph.i ], [ %add1.i.1, %for.body.i ]
%i.016.i.unr = phi i64 [ 0, %for.body.lr.ph.i ], [ %inc.i.1, %for.body.i ]
%sum.015.i.unr = phi i64 [ %3, %for.body.lr.ph.i ], [ %add1.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %solve.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %solve.exit.loopexit.unr-lcssa
%arrayidx.i.epil = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %i.016.i.unr
%8 = load i64, ptr %arrayidx.i.epil, align 8, !tbaa !12
%div.i.epil = udiv i64 %sub.i, %8
%add.i.epil = add i64 %sum.015.i.unr, 1
%add1.i.epil = add i64 %add.i.epil, %div.i.epil
br label %solve.exit
solve.exit: ; preds = %for.body.i.epil, %solve.exit.loopexit.unr-lcssa, %for.end.thread, %for.end
%sum.0.lcssa.i = phi i64 [ %3, %for.end ], [ %1, %for.end.thread ], [ %add1.i.lcssa.ph, %solve.exit.loopexit.unr-lcssa ], [ %add1.i.epil, %for.body.i.epil ]
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %sum.0.lcssa.i)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #8
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 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 #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!15 = !{i64 0, i64 8, !12}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
|
#include<stdio.h>
int main(void)
{
int n,day,r,eat[100],i,counter=0,t,ans=0;
scanf("%d %d %d",&n,&day,&r);
for(i=0;i<n;i++)
{
scanf("%d",&eat[i]);
t=1;
while(day >= t)
{
counter++;
t = t + eat[i];
}
}
ans = r + counter;
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_272992/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_272992/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%day = alloca i32, align 4
%r = alloca i32, align 4
%eat = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %day) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %eat) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %day, ptr noundef nonnull %r)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%counter.018 = phi i32 [ %counter.1.lcssa, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %eat, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %day, align 4, !tbaa !5
%cmp2.not13 = icmp slt i32 %1, 1
br i1 %cmp2.not13, label %for.inc, label %while.body.lr.ph
while.body.lr.ph: ; preds = %for.body
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%3 = add nsw i32 %2, 1
%4 = add nuw i32 %1, 1
%smax = call i32 @llvm.smax.i32(i32 %3, i32 %4)
%5 = xor i32 %2, -1
%6 = add i32 %smax, %5
%7 = icmp ne i32 %6, 0
%umin = zext i1 %7 to i32
%8 = sub i32 %6, %umin
%umax = call i32 @llvm.umax.i32(i32 %2, i32 1)
%9 = udiv i32 %8, %umax
%10 = add i32 %counter.018, 1
%11 = add i32 %10, %umin
%12 = add i32 %11, %9
br label %for.inc
for.inc: ; preds = %while.body.lr.ph, %for.body
%counter.1.lcssa = phi i32 [ %counter.018, %for.body ], [ %12, %while.body.lr.ph ]
%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.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%counter.0.lcssa = phi i32 [ 0, %entry ], [ %counter.1.lcssa, %for.inc ]
%15 = load i32, ptr %r, align 4, !tbaa !5
%add6 = add nsw i32 %15, %counter.0.lcssa
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add6)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %eat) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %day) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
char item[200005][15];
void mergsort(int l, int r) {
if (r - l <= 0) return;
int mid = l + (r - l >> 1);
mergsort(l, mid);
mergsort(mid + 1, r);
char a[r + 1][15];
int tl = l, tr = mid + 1;
for (int i = l; i <= r; i++) {
memset(a[i], 0, 15);
if (tl != mid + 1 && (tr == r + 1 || strcmp(item[tl], item[tr]) <= 0)) {
for (int j = 0; j < strlen(item[tl]); j++)
a[i][j] = item[tl][j];
tl++;
}
else {
for (int j = 0; j < strlen(item[tr]); j++)
a[i][j] = item[tr][j];
tr++;
}
}
for (int i = l; i <= r; i++) {
memset(item[i], 0, 15);
for (int j = 0; j < strlen(a[i]); j++)
item[i][j] = a[i][j];
}
return;
}
int main() {
int n; scanf("%d", &n);
int cnt = 0;
for (int i = 0; i < n; i++)
scanf("%s", item[i]);
mergsort(0, n - 1);
for (int i = 1; i < n; i++)
if (strcmp(item[i], item[i - 1]) != 0) cnt++;
printf("%d\n", cnt + 1);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273056/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273056/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@item = dso_local global [200005 x [15 x i8]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @mergsort(i32 noundef %l, i32 noundef %r) local_unnamed_addr #0 {
entry:
%sub = sub nsw i32 %r, %l
%cmp = icmp slt i32 %sub, 1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%shr = lshr i32 %sub, 1
%add = add nsw i32 %shr, %l
tail call void @mergsort(i32 noundef %l, i32 noundef %add)
%add2 = add nsw i32 %add, 1
tail call void @mergsort(i32 noundef %add2, i32 noundef %r)
%add3 = add i32 %r, 1
%0 = zext i32 %add3 to i64
%1 = tail call ptr @llvm.stacksave.p0()
%vla = alloca [15 x i8], i64 %0, align 16
%cmp5.not144 = icmp sgt i32 %l, %r
br i1 %cmp5.not144, label %for.cond.cleanup67, label %for.body.preheader
for.body.preheader: ; preds = %if.end
%2 = sext i32 %l to i64
%3 = sub i32 %add3, %l
br label %for.body
for.cond64.preheader: ; preds = %for.inc60
br i1 %cmp5.not144, label %for.cond.cleanup67, label %for.body68.preheader
for.body68.preheader: ; preds = %for.cond64.preheader
%4 = sext i32 %l to i64
%5 = sub i32 %add3, %l
br label %for.body68
for.body: ; preds = %for.body.preheader, %for.inc60
%indvars.iv = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next, %for.inc60 ]
%indvar = phi i64 [ 0, %for.body.preheader ], [ %indvar.next, %for.inc60 ]
%tr.0146 = phi i32 [ %add2, %for.body.preheader ], [ %tr.1, %for.inc60 ]
%tl.0145 = phi i32 [ %l, %for.body.preheader ], [ %tl.1, %for.inc60 ]
%6 = add i64 %indvar, %2
%7 = mul i64 %6, 15
%scevgep155 = getelementptr i8, ptr %vla, i64 %7
%arrayidx = getelementptr inbounds [15 x i8], ptr %vla, i64 %indvars.iv
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %arrayidx, i8 0, i64 15, i1 false)
%cmp7.not = icmp eq i32 %tl.0145, %add2
br i1 %cmp7.not, label %for.body.if.else_crit_edge, label %land.lhs.true
for.body.if.else_crit_edge: ; preds = %for.body
%.pre = sext i32 %tr.0146 to i64
br label %if.else
land.lhs.true: ; preds = %for.body
%cmp9 = icmp eq i32 %tr.0146, %add3
%.pre173 = sext i32 %tl.0145 to i64
br i1 %cmp9, label %if.then17, label %lor.lhs.false
lor.lhs.false: ; preds = %land.lhs.true
%arrayidx11 = getelementptr inbounds [200005 x [15 x i8]], ptr @item, i64 0, i64 %.pre173
%idxprom13 = sext i32 %tr.0146 to i64
%arrayidx14 = getelementptr inbounds [200005 x [15 x i8]], ptr @item, i64 0, i64 %idxprom13
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx11, ptr noundef nonnull dereferenceable(1) %arrayidx14) #7
%cmp16 = icmp slt i32 %call, 1
br i1 %cmp16, label %if.then17, label %if.else
if.then17: ; preds = %land.lhs.true, %lor.lhs.false
%arrayidx20 = getelementptr inbounds [200005 x [15 x i8]], ptr @item, i64 0, i64 %.pre173
%call22 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx20) #7
%cmp23138.not = icmp eq i64 %call22, 0
br i1 %cmp23138.not, label %for.cond.cleanup25, label %for.body26.preheader
for.body26.preheader: ; preds = %if.then17
%8 = mul nsw i64 %.pre173, 15
%scevgep153 = getelementptr i8, ptr @item, i64 %8
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep155, ptr align 1 %scevgep153, i64 %call22, i1 false), !tbaa !5
br label %for.cond.cleanup25
for.cond.cleanup25: ; preds = %for.body26.preheader, %if.then17
%inc35 = add nsw i32 %tl.0145, 1
br label %for.inc60
if.else: ; preds = %for.body.if.else_crit_edge, %lor.lhs.false
%idxprom39.pre-phi = phi i64 [ %.pre, %for.body.if.else_crit_edge ], [ %idxprom13, %lor.lhs.false ]
%arrayidx40 = getelementptr inbounds [200005 x [15 x i8]], ptr @item, i64 0, i64 %idxprom39.pre-phi
%call42 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx40) #7
%cmp43141.not = icmp eq i64 %call42, 0
br i1 %cmp43141.not, label %for.cond.cleanup45, label %for.body46.preheader
for.body46.preheader: ; preds = %if.else
%9 = mul nsw i64 %idxprom39.pre-phi, 15
%scevgep156 = getelementptr i8, ptr @item, i64 %9
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep155, ptr align 1 %scevgep156, i64 %call42, i1 false), !tbaa !5
br label %for.cond.cleanup45
for.cond.cleanup45: ; preds = %for.body46.preheader, %if.else
%inc58 = add nsw i32 %tr.0146, 1
br label %for.inc60
for.inc60: ; preds = %for.cond.cleanup25, %for.cond.cleanup45
%tl.1 = phi i32 [ %inc35, %for.cond.cleanup25 ], [ %tl.0145, %for.cond.cleanup45 ]
%tr.1 = phi i32 [ %tr.0146, %for.cond.cleanup25 ], [ %inc58, %for.cond.cleanup45 ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%indvar.next = add nuw nsw i64 %indvar, 1
%lftr.wideiv = trunc i64 %indvar.next to i32
%exitcond.not = icmp eq i32 %3, %lftr.wideiv
br i1 %exitcond.not, label %for.cond64.preheader, label %for.body, !llvm.loop !8
for.cond.cleanup67: ; preds = %for.cond.cleanup81, %if.end, %for.cond64.preheader
tail call void @llvm.stackrestore.p0(ptr %1)
br label %return
for.body68: ; preds = %for.body68.preheader, %for.cond.cleanup81
%indvars.iv168 = phi i64 [ %4, %for.body68.preheader ], [ %indvars.iv.next169, %for.cond.cleanup81 ]
%indvar160 = phi i64 [ 0, %for.body68.preheader ], [ %indvar.next161, %for.cond.cleanup81 ]
%arrayidx70 = getelementptr inbounds [200005 x [15 x i8]], ptr @item, i64 0, i64 %indvars.iv168
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %arrayidx70, i8 0, i64 15, i1 false)
%arrayidx76 = getelementptr inbounds [15 x i8], ptr %vla, i64 %indvars.iv168
%call78 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx76) #7
%cmp79148.not = icmp eq i64 %call78, 0
br i1 %cmp79148.not, label %for.cond.cleanup81, label %for.body82.preheader
for.body82.preheader: ; preds = %for.body68
%10 = add i64 %indvar160, %4
%11 = mul i64 %10, 15
%scevgep163 = getelementptr i8, ptr %vla, i64 %11
%scevgep162 = getelementptr i8, ptr @item, i64 %11
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep162, ptr align 1 %scevgep163, i64 %call78, i1 false), !tbaa !5
br label %for.cond.cleanup81
for.cond.cleanup81: ; preds = %for.body82.preheader, %for.body68
%indvars.iv.next169 = add nsw i64 %indvars.iv168, 1
%indvar.next161 = add nuw nsw i64 %indvar160, 1
%lftr.wideiv171 = trunc i64 %indvar.next161 to i32
%exitcond172.not = icmp eq i32 %5, %lftr.wideiv171
br i1 %exitcond172.not, label %for.cond.cleanup67, label %for.body68, !llvm.loop !10
return: ; preds = %entry, %for.cond.cleanup67
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
declare ptr @llvm.stacksave.p0() #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2
; 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) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !11
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @mergsort(i32 noundef 0, i32 noundef %sub)
%1 = load i32, ptr %n, align 4, !tbaa !11
%cmp429 = icmp sgt i32 %1, 1
br i1 %cmp429, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %1 to i64
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200005 x [15 x i8]], ptr @item, 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 !11
%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 !13
for.cond.cleanup5.loopexit: ; preds = %for.body6
%4 = add nuw nsw i32 %spec.select, 1
br label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.cond.cleanup5.loopexit, %for.cond.cleanup
%cnt.0.lcssa = phi i32 [ 1, %for.cond.cleanup ], [ %4, %for.cond.cleanup5.loopexit ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
for.body6: ; preds = %for.body6.preheader, %for.body6
%indvars.iv35 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next36, %for.body6 ]
%cnt.030 = phi i32 [ 0, %for.body6.preheader ], [ %spec.select, %for.body6 ]
%arrayidx8 = getelementptr inbounds [200005 x [15 x i8]], ptr @item, i64 0, i64 %indvars.iv35
%5 = add nsw i64 %indvars.iv35, -1
%arrayidx12 = getelementptr inbounds [200005 x [15 x i8]], ptr @item, i64 0, i64 %5
%call14 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx8, ptr noundef nonnull dereferenceable(1) %arrayidx12) #7
%cmp15.not = icmp ne i32 %call14, 0
%inc16 = zext i1 %cmp15.not to i32
%spec.select = add nuw nsw i32 %cnt.030, %inc16
%indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
%exitcond.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup5.loopexit, label %for.body6, !llvm.loop !14
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
char S[200000][12];
int comp(const void* a, const void* b){
return strcmp(a, b);
}
int main(void){
int N;
int i;
scanf("%d", &N);
for(i=0;i<N;i++){
scanf("%11s", S[i]);
}
qsort(S, N, sizeof(*S), comp);
int ans = 1;
for(i=1;i<N;i++){
if(strcmp(S[i-1], S[i]) != 0){
ans++;
}
}
printf("%d", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273171/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273171/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%11s\00", align 1
@S = dso_local global [200000 x [12 x i8]] zeroinitializer, align 16
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #6
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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x [12 x i8]], ptr @S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull @S, i64 noundef %conv.pre-phi, i64 noundef 12, ptr noundef nonnull @comp) #7
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp329 = icmp sgt i32 %3, 1
br i1 %cmp329, label %for.body5.preheader, label %for.end18
for.body5.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv35 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next36, %for.body5 ]
%ans.031 = phi i32 [ 1, %for.body5.preheader ], [ %spec.select, %for.body5 ]
%4 = add nsw i64 %indvars.iv35, -1
%arrayidx7 = getelementptr inbounds [200000 x [12 x i8]], ptr @S, i64 0, i64 %4
%arrayidx10 = getelementptr inbounds [200000 x [12 x i8]], ptr @S, i64 0, i64 %indvars.iv35
%call12 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx7, ptr noundef nonnull dereferenceable(1) %arrayidx10) #6
%cmp13.not = icmp ne i32 %call12, 0
%inc15 = zext i1 %cmp13.not to i32
%spec.select = add nuw nsw i32 %ans.031, %inc15
%indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
%exitcond.not = icmp eq i64 %indvars.iv.next36, %wide.trip.count
br i1 %exitcond.not, label %for.end18, label %for.body5, !llvm.loop !11
for.end18: ; preds = %for.body5, %for.end
%ans.0.lcssa = phi i32 [ 1, %for.end ], [ %spec.select, %for.body5 ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
//AtCoder用
//プリプロセッサ系
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#define MOD 1000000007
#define INFTY 2147483646
#define DEBUG 1
#define END printf("\n");return 0;
#define QS09(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09);
#define QS90(how_data,data) qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90);
//↓この2つはCE対策のために適当にdefineしてるだけだから使う際は「構造体クイックソート設定」をコピペ
#define ST_NAME _GD
#define KEY_NAME how_vertex
#define ST09(how_data,data) qsort(data,how_data,sizeof(ST_NAME),(int (*)(const void *,const void *))qsort_st09);
#define ST90(how_data,data) qsort(data,how_data,sizeof(ST_NAME),(int (*)(const void *,const void *))qsort_st90);
#define In(a) long a;scanf("%ld",&a);
#define Out(a) printf("%ld\n",a);
#define dprintf if(DEBUG)printf
#define ifdebug if(DEBUG)
#define MAKE_ARRAY_DATA In(how_data);long data[how_data];input_array(how_data,data);
#define update_max(a,b) a=(a>b?a:b);
#define update_min(a,b) a=(a<b?a:b);
#define input_long(A) int A;scanf("%d",&A)
//構造体クイックソート設定 使用時はmainに以下をコピペ、ST_NAMEとKEY_NAMEを書き換え
/*
#undef ST_NAME
#undef KEY_NAME
#define ST_NAME _GD
#define KEY_NAME how_vertex
ST09(how_data,data);
*/
//関数
void input_array(long how_data,long *data); //配列の入力
void output_array(long how_data,long *data); //配列の出力
void input_array2(long first , long second , long data[][3]); //2次元配列の入力
void format_array(long how_data ,long *data,long what); //配列初期化
long get_random(long min, long max); //min~max範囲の乱数生成
long factorial(long n); //n!
long fibonacci(long n); //n番目のフィボナッチ
int qsort_09(const int *sys1 , const int *sys2);
int qsort_90(const int *sys1 , const int *sys2);
int qsort_st09(const void *c1, const void *c2);
int qsort_st90(const void *c1, const void *c2);
long sel_max(long a , long b);
long sel_min(long a , long b);
long array_max(long how_data,long *data);
long array_min(long how_data,long *data);
long array_search(long how_data,long *data,long what);
long can_DP(long how_data,long *data,long how_can,bool *can);
long array_sum(long how_data,long *data);
long Leven_dist(char *now , char *target);
long get_digit(long target);
long rounding(double target);
long roundingdown(double target);
long roundingup(double target);
long ncr(long n , long r);
long npr(long n , long r);
long nhr(long n , long r);
int fifw(long add,long *data);
long fifr(long *data);
void GRAPH_input(void);
void GRAPH_dfs(long now);
bool check_prime(long target);
long get_lcm(long a,long b);
long get_gcd(long a,long b);
void digit_cut(int how_data,char *s,int *i); //文字列として与えられた数列を1桁ずつ分割
//グローバル変数一覧
long fifo[1000]={0};//fifo[0]はデータ件数
long loop1,loop2,loop3,loop4,loop5;
long g_ans=0; //answerグローバル変数用
typedef struct{
long how_vertex;
long how_edge;
long edge_data[1000][2];
bool aleady_searched_vertex[500];
bool all_searched;
} _GD;//GraphData
_GD GRAPH={0,0,{{0}},{0},0};
char c_temp;
//loop5 loop4 loop3 loop2 loop1 input_long
//--------------ここから
int abc164c(const void * left,const void *right){
char *left_char = (char *)left;
char *right_char = (char *)right;
return strcmp( left_char, right_char );
}
int main(void){
In(how_data);
char data[how_data][15];
for(loop1=0;loop1<how_data;loop1++){
scanf("%s",data[loop1]);
}
qsort((void*)data,how_data,sizeof(data[0]),abc164c);
/*for(loop1=0;loop1<how_data;loop1++){
printf("%s\n",data[loop1]);
}*/
int count=how_data;
for(loop1=0;loop1<how_data-1;loop1++){
if(strcmp(data[loop1],data[loop1+1])==0){
count--;
}
}
printf("%d",count);
END;
}
//--------------ここまで
void input_array(long how_data,long *data){
long loop;
for(loop=0;loop<how_data;loop++){
scanf("%ld",&data[loop]);
}
return ;
}
void output_array(long how_data,long *data){
long loop;
for(loop=0;loop<how_data;loop++){
printf("%ld",data[loop]);
if(loop!=how_data-1){
printf(" ");
}
}
printf("\n");
return ;
}
void input_array2(long first,long second,long data[][3]){
long loopA,loopB;
for(loopA=0;loopA<first;loopA++){
for(loopB=0;loopB<second;loopB++){
scanf("%ld",&data[loopA][loopB]);
}
}
return ;
}
void format_array(long how_data ,long *data,long what){
long loopA;
for(loopA=0;loopA<how_data;loopA++){
data[loopA]=what;
}
return ;
}
long get_random(long min, long max){ //指定の範囲から乱数を1つ返すやつ
//srand((unsigned int)time(0)); //現在時刻で疑似乱数初期化
rand();rand();rand();rand(); //乱数を空打ち
return (rand()%(max+1-min))+min;
}
long factorial(long n){//n!のMOD10^9+7を返すやつ
unsigned long long int ret=1;
for(long i=1;i<=n;i++)ret=(ret*i)%1000000007;
return (long)ret;
}
int qsort_09(const int *sys1 , const int *sys2){ //小さいのが上にくるやつ
//qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_09);
if(*sys1<*sys2){
return -1;
}else if(*sys1==*sys2){
return 0;
}else{
return 1;
}
}
int qsort_90(const int *sys1, const int *sys2){ //大きいのが上にくるやつ
//qsort(data,how_data,sizeof(long),(int (*)(const void *,const void *))qsort_90);
if(*sys1<*sys2){
return 1;
}else if(*sys1==*sys2){
return 0;
}else{
return -1;
}
}
int qsort_st09(const void *c1, const void *c2){
ST_NAME hikaku1= *(ST_NAME *)c1;
ST_NAME hikaku2= *(ST_NAME *)c2;
return hikaku1.KEY_NAME - hikaku2.KEY_NAME;
}
int qsort_st90(const void *c1, const void *c2){
ST_NAME hikaku1= *(ST_NAME *)c1;
ST_NAME hikaku2= *(ST_NAME *)c2;
return hikaku2.KEY_NAME - hikaku1.KEY_NAME;
}
long fibonacci(long n){
switch(n){
case 0:return 0;
case 1:return 1;
default :return fibonacci(n-1)+fibonacci(n-2);
}
}
long sel_max(long a,long b){
if(a>b)return a;
return b;
}
long sel_min(long a,long b){
if(a>b)return b;
return a;
}
long can_DP(long how_data,long *data,long how_can,bool *can){//Typical DP Contest A
//data内で組み合わせられる和をcanに0 or 1で入れる
//返り値はパターン数
long loopA,loopB;
long ret=0;
for(loopA=0;loopA<how_can;loopA++){//初期化
can[loopA]=0;
}
can[0]=1;//絶対にありえる
for(loopA=0;loopA<how_data;loopA++){
for(loopB=how_can-1;loopB>=0;loopB--){
if(can[loopB]==1 && loopB+data[loopA]<how_can){
can[loopB+data[loopA]]=1;
}
}
}
for(loopA=0;loopA<how_can;loopA++){
if(can[loopA]==1){
ret++;
}
}
return ret;
}
long array_max(long how_data,long *data){
long loop;
long ret=data[0];
for(loop=0;loop<how_data;loop++){
if(ret<data[loop])ret=data[loop];
}
return ret;
}
long array_min(long how_data,long *data){
long loop;
long ret=data[0];
for(loop=0;loop<how_data;loop++){
if(ret>data[loop])ret=data[loop];
}
return ret;
}
long array_sum(long how_data,long *data){
long ret=0;
long loop;
for(loop=0;loop<how_data;loop++){
ret+=data[loop];
}
return ret;
}
long array_search(long how_data,long *data,long what){
long loop;
for(loop=0;loop<how_data;loop++){
if(data[loop]==what){
return loop;
}
}
return -1;
}
long Leven_dist(char *now , char *target){
long loopA,loopB;
//レーベンシュタイン距離を求める
// 参考文献
// http://nw.tsuda.ac.jp/class/algoB/c13.html (アルゴリズム理解)
// http://d.hatena.ne.jp/ohnishiakira/20090809/1249845529 (実装)
long len_now=strlen(now)+1;
long len_target=strlen(target)+1;
long d[len_now][len_target]; //計算用
for(loopA=0;loopA<len_now;loopA++) d[loopA][0]=loopA;
for(loopA=0;loopA<len_target;loopA++) d[0][loopA]=loopA;
for(loopA=1;loopA<len_now;loopA++){
for(loopB=1;loopB<len_target;loopB++){
long cost=(now[loopA-1]==target[loopB-1] ? 0:1);
d[loopA][loopB]=sel_min(sel_min(d[loopA-1][loopB]+1,d[loopA][loopB-1]+1),d[loopA-1][loopB-1]+cost);
}
}
return d[len_now-1][len_target-1];
}
long get_digit(long target){
return (long)(log10(target)+1);
}
long ncr(long n , long r){
//パスカルの三角形
long loopA,loopB;
long pascal[100][102]={{0}};
pascal[1][0]=1;
pascal[1][1]=1;
for(loopA=2;loopA<100;loopA++){
pascal[loopA][0]=1;
for(loopB=1;loopB<loopA;loopB++){
pascal[loopA][loopB]=pascal[loopA-1][loopB-1]+pascal[loopA-1][loopB];
}
pascal[loopA][loopA]=1;
}
return pascal[n][r];
}
long npr(long n, long r){
return ncr(n,r)*factorial(r);
}
long nhr(long n , long r){
return ncr(n+r-1,r);
}
long rounding(double target){
return (long)target+0.50;
}
long roundingup(double target){
return (long)ceil(target);
}
long roundingdown(double target){
return (long)floor(target);
}
int fifw(long add,long *data){
data[data[0]+1]=add;
data[0]++;
return data[0]; //現在のデータ件数を返す
}
long fifr(long *data){
long ret=data[1];
data[0]--;
for(int i=1;i<999;i++){
data[i]=data[i+1];
}
return ret;
}
void GRAPH_input(void){
scanf("%ld %ld\n",&GRAPH.how_vertex,&GRAPH.how_edge);
for(long loopA=0;loopA<GRAPH.how_edge;loopA++){
scanf("%ld %ld\n",&GRAPH.edge_data[loopA][0],&GRAPH.edge_data[loopA][1]);
}
return;
}
void GRAPH_dfs(long now){
GRAPH.aleady_searched_vertex[now]=1;
for(int loopA=0;loopA<GRAPH.how_edge;loopA++){
if(GRAPH.edge_data[loopA][0]==now && GRAPH.aleady_searched_vertex[GRAPH.edge_data[loopA][1]]==0){
GRAPH_dfs(GRAPH.edge_data[loopA][1]);
}
if(GRAPH.edge_data[loopA][1]==now && GRAPH.aleady_searched_vertex[GRAPH.edge_data[loopA][0]]==0){
GRAPH_dfs(GRAPH.edge_data[loopA][0]);
}
}
return ;
}
bool check_prime(long target){//素数判定、素数なら1
if(target==2)return 1;
if(target<=1 || target%2==0)return 0;
for(int loopA=3;loopA<=sqrt(target)+1;loopA+=2)if(target%loopA==0)return 0;
return 1;
}
long get_lcm(long a,long b){//最小公倍数
return (a*b)/get_gcd(a,b);
}
long get_gcd(long a,long b){//最大公約数 参考:https://webkaru.net/clang/find-gcd-of-two-number/
// a>b
if(a<b){
int tem=a;
a=b;
b=tem;
}
long r=a%b;
while(r!=0){
a=b;
b=r;
r=a%b;
}
return b;
}
void digit_cut(int how_data,char *s,int *i){
for(int loopA=0;loopA<how_data;loopA++){
i[loopA]=atoi(&s[loopA]);
}
return ;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273214/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273214/source.c"
target datalayout = "e-m:e-p270: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._GD = type { i64, i64, [1000 x [2 x i64]], [500 x i8], i8 }
@fifo = dso_local local_unnamed_addr global [1000 x i64] zeroinitializer, align 16
@g_ans = dso_local local_unnamed_addr global i64 0, align 8
@GRAPH = dso_local global %struct._GD zeroinitializer, align 8
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@loop1 = dso_local local_unnamed_addr global i64 0, align 8
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.5 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1
@loop2 = dso_local local_unnamed_addr global i64 0, align 8
@loop3 = dso_local local_unnamed_addr global i64 0, align 8
@loop4 = dso_local local_unnamed_addr global i64 0, align 8
@loop5 = dso_local local_unnamed_addr global i64 0, align 8
@c_temp = dso_local local_unnamed_addr global i8 0, align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @abc164c(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) #0 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %left, ptr noundef nonnull dereferenceable(1) %right) #31
ret i32 %call
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%how_data = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %how_data) #32
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %how_data)
%0 = load i64, ptr %how_data, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca [15 x i8], i64 %0, align 16
store i64 0, ptr @loop1, align 8, !tbaa !5
%2 = load i64, ptr %how_data, align 8, !tbaa !5
%cmp22 = icmp sgt i64 %2, 0
br i1 %cmp22, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%storemerge23 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [15 x i8], ptr %vla, i64 %storemerge23
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%3 = load i64, ptr @loop1, align 8, !tbaa !5
%inc = add nsw i64 %3, 1
store i64 %inc, ptr @loop1, align 8, !tbaa !5
%4 = load i64, ptr %how_data, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %2, %entry ], [ %4, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %.lcssa, i64 noundef 15, ptr noundef nonnull @abc164c) #32
%5 = load i64, ptr %how_data, align 8, !tbaa !5
%conv = trunc i64 %5 to i32
%sub = add i64 %5, -1
%cmp324 = icmp sgt i64 %5, 1
br i1 %cmp324, label %for.body5, label %for.end15
for.body5: ; preds = %for.end, %for.body5
%count.026 = phi i32 [ %spec.select, %for.body5 ], [ %conv, %for.end ]
%storemerge2125 = phi i64 [ %inc14, %for.body5 ], [ 0, %for.end ]
%arrayidx6 = getelementptr inbounds [15 x i8], ptr %vla, i64 %storemerge2125
%arrayidx8 = getelementptr [15 x i8], ptr %arrayidx6, i64 1
%call10 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx6, ptr noundef nonnull dereferenceable(1) %arrayidx8) #31
%cmp11 = icmp eq i32 %call10, 0
%dec = sext i1 %cmp11 to i32
%spec.select = add nsw i32 %count.026, %dec
%inc14 = add nuw nsw i64 %storemerge2125, 1
%exitcond.not = icmp eq i64 %inc14, %sub
br i1 %exitcond.not, label %for.end15, label %for.body5, !llvm.loop !11
for.end15: ; preds = %for.body5, %for.end
%storemerge21.lcssa = phi i64 [ 0, %for.end ], [ %sub, %for.body5 ]
%count.0.lcssa = phi i32 [ %conv, %for.end ], [ %spec.select, %for.body5 ]
store i64 %storemerge21.lcssa, ptr @loop1, align 8, !tbaa !5
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa)
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %how_data) #32
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @input_array(i64 noundef %how_data, ptr noundef %data) local_unnamed_addr #3 {
entry:
%cmp3 = icmp sgt i64 %how_data, 0
br i1 %cmp3, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%loop.04 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.04
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%inc = add nuw nsw i64 %loop.04, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @output_array(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #3 {
entry:
%cmp9 = icmp sgt i64 %how_data, 0
br i1 %cmp9, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub = add nsw i64 %how_data, -1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%loop.010 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.010
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %0)
%cmp1.not = icmp eq i64 %loop.010, %sub
br i1 %cmp1.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%putchar8 = tail call i32 @putchar(i32 32)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%inc = add nuw nsw i64 %loop.010, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.inc, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @input_array2(i64 noundef %first, i64 noundef %second, ptr noundef %data) local_unnamed_addr #3 {
entry:
%cmp14 = icmp sgt i64 %first, 0
%cmp212 = icmp sgt i64 %second, 0
%or.cond = and i1 %cmp14, %cmp212
br i1 %or.cond, label %for.cond1.preheader.us, label %for.end7
for.cond1.preheader.us: ; preds = %entry, %for.cond1.for.inc5_crit_edge.us
%loopA.015.us = phi i64 [ %inc6.us, %for.cond1.for.inc5_crit_edge.us ], [ 0, %entry ]
br label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.body3.us
%loopB.013.us = phi i64 [ 0, %for.cond1.preheader.us ], [ %inc.us, %for.body3.us ]
%arrayidx4.us = getelementptr inbounds [3 x i64], ptr %data, i64 %loopA.015.us, i64 %loopB.013.us
%call.us = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx4.us)
%inc.us = add nuw nsw i64 %loopB.013.us, 1
%exitcond.not = icmp eq i64 %inc.us, %second
br i1 %exitcond.not, label %for.cond1.for.inc5_crit_edge.us, label %for.body3.us, !llvm.loop !14
for.cond1.for.inc5_crit_edge.us: ; preds = %for.body3.us
%inc6.us = add nuw nsw i64 %loopA.015.us, 1
%exitcond17.not = icmp eq i64 %inc6.us, %first
br i1 %exitcond17.not, label %for.end7, label %for.cond1.preheader.us, !llvm.loop !15
for.end7: ; preds = %for.cond1.for.inc5_crit_edge.us, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local void @format_array(i64 noundef %how_data, ptr nocapture noundef writeonly %data, i64 noundef %what) local_unnamed_addr #7 {
entry:
%cmp3 = icmp sgt i64 %how_data, 0
br i1 %cmp3, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader5, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %what, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds i64, ptr %data, i64 %index
store <2 x i64> %broadcast.splat, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
store <2 x i64> %broadcast.splat, ptr %1, align 8, !tbaa !5
%index.next = add nuw i64 %index, 4
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !16
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader5
for.body.preheader5: ; preds = %for.body.preheader, %middle.block
%loopA.04.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader5, %for.body
%loopA.04 = phi i64 [ %inc, %for.body ], [ %loopA.04.ph, %for.body.preheader5 ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loopA.04
store i64 %what, ptr %arrayidx, align 8, !tbaa !5
%inc = add nuw nsw i64 %loopA.04, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !19
for.end: ; preds = %for.body, %middle.block, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i64 @get_random(i64 noundef %min, i64 noundef %max) local_unnamed_addr #8 {
entry:
%call = tail call i32 @rand() #32
%call1 = tail call i32 @rand() #32
%call2 = tail call i32 @rand() #32
%call3 = tail call i32 @rand() #32
%call4 = tail call i32 @rand() #32
%conv = sext i32 %call4 to i64
%reass.sub = sub i64 %max, %min
%sub = add i64 %reass.sub, 1
%rem = srem i64 %conv, %sub
%add5 = add nsw i64 %rem, %min
ret i64 %add5
}
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #9
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @factorial(i64 noundef %n) local_unnamed_addr #10 {
entry:
%cmp.not4 = icmp slt i64 %n, 1
br i1 %cmp.not4, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %n, 3
%0 = icmp ult i64 %n, 4
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %n, -4
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%i.06.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.3, %for.body ]
%ret.05.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%i.06.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.06.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%ret.05.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %ret.05.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul i64 %i.06.epil, %ret.05.epil
%rem.epil = urem i64 %mul.epil, 1000000007
%inc.epil = add nuw i64 %i.06.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !20
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%ret.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
ret i64 %ret.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%i.06 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ]
%ret.05 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul i64 %i.06, %ret.05
%rem = urem i64 %mul, 1000000007
%inc = add nuw nsw i64 %i.06, 1
%mul.1 = mul i64 %inc, %rem
%rem.1 = urem i64 %mul.1, 1000000007
%inc.1 = add nuw nsw i64 %i.06, 2
%mul.2 = mul i64 %inc.1, %rem.1
%rem.2 = urem i64 %mul.2, 1000000007
%inc.2 = add nuw i64 %i.06, 3
%mul.3 = mul i64 %inc.2, %rem.2
%rem.3 = urem i64 %mul.3, 1000000007
%inc.3 = add nuw i64 %i.06, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !22
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @qsort_09(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) local_unnamed_addr #11 {
entry:
%0 = load i32, ptr %sys1, align 4, !tbaa !23
%1 = load i32, ptr %sys2, align 4, !tbaa !23
%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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @qsort_90(ptr nocapture noundef readonly %sys1, ptr nocapture noundef readonly %sys2) local_unnamed_addr #11 {
entry:
%0 = load i32, ptr %sys1, align 4, !tbaa !23
%1 = load i32, ptr %sys2, align 4, !tbaa !23
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @qsort_st09(ptr nocapture noundef readonly %c1, ptr nocapture noundef readonly %c2) local_unnamed_addr #11 {
entry:
%hikaku1.sroa.0.0.copyload = load i64, ptr %c1, align 8, !tbaa.struct !25
%hikaku2.sroa.0.0.copyload = load i64, ptr %c2, align 8, !tbaa.struct !25
%sub = sub nsw i64 %hikaku1.sroa.0.0.copyload, %hikaku2.sroa.0.0.copyload
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @qsort_st90(ptr nocapture noundef readonly %c1, ptr nocapture noundef readonly %c2) local_unnamed_addr #11 {
entry:
%hikaku1.sroa.0.0.copyload = load i64, ptr %c1, align 8, !tbaa.struct !25
%hikaku2.sroa.0.0.copyload = load i64, ptr %c2, align 8, !tbaa.struct !25
%sub = sub nsw i64 %hikaku2.sroa.0.0.copyload, %hikaku1.sroa.0.0.copyload
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @fibonacci(i64 noundef %n) local_unnamed_addr #12 {
entry:
%switch13 = icmp ult i64 %n, 2
br i1 %switch13, label %return, label %sw.default
sw.default: ; preds = %entry, %sw.default
%n.tr15 = phi i64 [ %sub2, %sw.default ], [ %n, %entry ]
%accumulator.tr14 = phi i64 [ %add, %sw.default ], [ 0, %entry ]
%sub = add nsw i64 %n.tr15, -1
%call = tail call i64 @fibonacci(i64 noundef %sub)
%sub2 = add nsw i64 %n.tr15, -2
%add = add nsw i64 %call, %accumulator.tr14
%switch = icmp ult i64 %sub2, 2
br i1 %switch, label %return, label %sw.default
return: ; preds = %sw.default, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %sw.default ]
%n.tr.lcssa = phi i64 [ %n, %entry ], [ %sub2, %sw.default ]
%accumulator.ret.tr = add nsw i64 %n.tr.lcssa, %accumulator.tr.lcssa
ret i64 %accumulator.ret.tr
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sel_max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #13 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sel_min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #13 {
entry:
%b.a = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %b.a
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i64 @can_DP(i64 noundef %how_data, ptr nocapture noundef readonly %data, i64 noundef %how_can, ptr nocapture noundef %can) local_unnamed_addr #14 {
entry:
%cmp59 = icmp sgt i64 %how_can, 0
br i1 %cmp59, label %for.end, label %for.end.thread
for.end: ; preds = %entry
tail call void @llvm.memset.p0.i64(ptr align 1 %can, i8 0, i64 %how_can, i1 false), !tbaa !27
store i8 1, ptr %can, align 1, !tbaa !27
%cmp364 = icmp sgt i64 %how_data, 0
br i1 %cmp364, label %for.cond5.preheader.us.preheader, label %for.cond22.preheader
for.cond5.preheader.us.preheader: ; preds = %for.end
%xtraiter = and i64 %how_can, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%loopB.063.us.prol = add nsw i64 %how_can, -1
%arrayidx8.us.prol = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.prol
%0 = icmp eq i64 %how_can, 1
br label %for.cond5.preheader.us
for.end.thread: ; preds = %entry
store i8 1, ptr %can, align 1, !tbaa !27
br label %for.end36
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc19_crit_edge.us
%loopA.165.us = phi i64 [ %inc20.us, %for.cond5.for.inc19_crit_edge.us ], [ 0, %for.cond5.preheader.us.preheader ]
%arrayidx11.us = getelementptr inbounds i64, ptr %data, i64 %loopA.165.us
br i1 %lcmp.mod.not, label %for.body7.us.prol.loopexit, label %for.body7.us.prol
for.body7.us.prol: ; preds = %for.cond5.preheader.us
%1 = load i8, ptr %arrayidx8.us.prol, align 1, !tbaa !27, !range !29, !noundef !30
%tobool.not.us.prol = icmp eq i8 %1, 0
br i1 %tobool.not.us.prol, label %for.body7.us.prol.loopexit, label %land.lhs.true.us.prol
land.lhs.true.us.prol: ; preds = %for.body7.us.prol
%2 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5
%add.us.prol = add nsw i64 %2, %loopB.063.us.prol
%cmp12.us.prol = icmp slt i64 %add.us.prol, %how_can
br i1 %cmp12.us.prol, label %if.then.us.prol, label %for.body7.us.prol.loopexit
if.then.us.prol: ; preds = %land.lhs.true.us.prol
%arrayidx16.us.prol = getelementptr inbounds i8, ptr %can, i64 %add.us.prol
store i8 1, ptr %arrayidx16.us.prol, align 1, !tbaa !27
br label %for.body7.us.prol.loopexit
for.body7.us.prol.loopexit: ; preds = %for.body7.us.prol, %land.lhs.true.us.prol, %if.then.us.prol, %for.cond5.preheader.us
%loopB.063.us.in.unr = phi i64 [ %how_can, %for.cond5.preheader.us ], [ %loopB.063.us.prol, %if.then.us.prol ], [ %loopB.063.us.prol, %land.lhs.true.us.prol ], [ %loopB.063.us.prol, %for.body7.us.prol ]
br i1 %0, label %for.cond5.for.inc19_crit_edge.us, label %for.body7.us
for.body7.us: ; preds = %for.body7.us.prol.loopexit, %for.inc17.us.1
%loopB.063.us.in = phi i64 [ %loopB.063.us.1, %for.inc17.us.1 ], [ %loopB.063.us.in.unr, %for.body7.us.prol.loopexit ]
%loopB.063.us = add nsw i64 %loopB.063.us.in, -1
%arrayidx8.us = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us
%3 = load i8, ptr %arrayidx8.us, align 1, !tbaa !27, !range !29, !noundef !30
%tobool.not.us = icmp eq i8 %3, 0
br i1 %tobool.not.us, label %for.inc17.us, label %land.lhs.true.us
land.lhs.true.us: ; preds = %for.body7.us
%4 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5
%add.us = add nsw i64 %4, %loopB.063.us
%cmp12.us = icmp slt i64 %add.us, %how_can
br i1 %cmp12.us, label %if.then.us, label %for.inc17.us
if.then.us: ; preds = %land.lhs.true.us
%arrayidx16.us = getelementptr inbounds i8, ptr %can, i64 %add.us
store i8 1, ptr %arrayidx16.us, align 1, !tbaa !27
br label %for.inc17.us
for.inc17.us: ; preds = %if.then.us, %land.lhs.true.us, %for.body7.us
%loopB.063.us.1 = add nsw i64 %loopB.063.us.in, -2
%arrayidx8.us.1 = getelementptr inbounds i8, ptr %can, i64 %loopB.063.us.1
%5 = load i8, ptr %arrayidx8.us.1, align 1, !tbaa !27, !range !29, !noundef !30
%tobool.not.us.1 = icmp eq i8 %5, 0
br i1 %tobool.not.us.1, label %for.inc17.us.1, label %land.lhs.true.us.1
land.lhs.true.us.1: ; preds = %for.inc17.us
%6 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5
%add.us.1 = add nsw i64 %6, %loopB.063.us.1
%cmp12.us.1 = icmp slt i64 %add.us.1, %how_can
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc17.us.1
if.then.us.1: ; preds = %land.lhs.true.us.1
%arrayidx16.us.1 = getelementptr inbounds i8, ptr %can, i64 %add.us.1
store i8 1, ptr %arrayidx16.us.1, align 1, !tbaa !27
br label %for.inc17.us.1
for.inc17.us.1: ; preds = %if.then.us.1, %land.lhs.true.us.1, %for.inc17.us
%cmp6.us.1 = icmp sgt i64 %loopB.063.us.in, 2
br i1 %cmp6.us.1, label %for.body7.us, label %for.cond5.for.inc19_crit_edge.us, !llvm.loop !31
for.cond5.for.inc19_crit_edge.us: ; preds = %for.inc17.us.1, %for.body7.us.prol.loopexit
%inc20.us = add nuw nsw i64 %loopA.165.us, 1
%exitcond.not = icmp eq i64 %inc20.us, %how_data
br i1 %exitcond.not, label %for.cond22.preheader, label %for.cond5.preheader.us, !llvm.loop !32
for.cond22.preheader: ; preds = %for.cond5.for.inc19_crit_edge.us, %for.end
br i1 %cmp59, label %for.body25.preheader, label %for.end36
for.body25.preheader: ; preds = %for.cond22.preheader
%xtraiter72 = and i64 %how_can, 7
%7 = icmp ult i64 %how_can, 8
br i1 %7, label %for.end36.loopexit.unr-lcssa, label %for.body25.preheader.new
for.body25.preheader.new: ; preds = %for.body25.preheader
%unroll_iter = and i64 %how_can, -8
br label %for.body25
for.body25: ; preds = %for.body25, %for.body25.preheader.new
%ret.068 = phi i64 [ 0, %for.body25.preheader.new ], [ %spec.select.7, %for.body25 ]
%loopA.267 = phi i64 [ 0, %for.body25.preheader.new ], [ %inc35.7, %for.body25 ]
%niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.7, %for.body25 ]
%arrayidx26 = getelementptr inbounds i8, ptr %can, i64 %loopA.267
%8 = load i8, ptr %arrayidx26, align 1, !tbaa !27, !range !29, !noundef !30
%inc32 = zext i8 %8 to i64
%spec.select = add nuw nsw i64 %ret.068, %inc32
%inc35 = or i64 %loopA.267, 1
%arrayidx26.1 = getelementptr inbounds i8, ptr %can, i64 %inc35
%9 = load i8, ptr %arrayidx26.1, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.1 = zext i8 %9 to i64
%spec.select.1 = add nuw nsw i64 %spec.select, %inc32.1
%inc35.1 = or i64 %loopA.267, 2
%arrayidx26.2 = getelementptr inbounds i8, ptr %can, i64 %inc35.1
%10 = load i8, ptr %arrayidx26.2, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.2 = zext i8 %10 to i64
%spec.select.2 = add nuw nsw i64 %spec.select.1, %inc32.2
%inc35.2 = or i64 %loopA.267, 3
%arrayidx26.3 = getelementptr inbounds i8, ptr %can, i64 %inc35.2
%11 = load i8, ptr %arrayidx26.3, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.3 = zext i8 %11 to i64
%spec.select.3 = add nuw nsw i64 %spec.select.2, %inc32.3
%inc35.3 = or i64 %loopA.267, 4
%arrayidx26.4 = getelementptr inbounds i8, ptr %can, i64 %inc35.3
%12 = load i8, ptr %arrayidx26.4, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.4 = zext i8 %12 to i64
%spec.select.4 = add nuw nsw i64 %spec.select.3, %inc32.4
%inc35.4 = or i64 %loopA.267, 5
%arrayidx26.5 = getelementptr inbounds i8, ptr %can, i64 %inc35.4
%13 = load i8, ptr %arrayidx26.5, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.5 = zext i8 %13 to i64
%spec.select.5 = add nuw nsw i64 %spec.select.4, %inc32.5
%inc35.5 = or i64 %loopA.267, 6
%arrayidx26.6 = getelementptr inbounds i8, ptr %can, i64 %inc35.5
%14 = load i8, ptr %arrayidx26.6, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.6 = zext i8 %14 to i64
%spec.select.6 = add nuw nsw i64 %spec.select.5, %inc32.6
%inc35.6 = or i64 %loopA.267, 7
%arrayidx26.7 = getelementptr inbounds i8, ptr %can, i64 %inc35.6
%15 = load i8, ptr %arrayidx26.7, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.7 = zext i8 %15 to i64
%spec.select.7 = add nuw nsw i64 %spec.select.6, %inc32.7
%inc35.7 = add nuw nsw i64 %loopA.267, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end36.loopexit.unr-lcssa, label %for.body25, !llvm.loop !33
for.end36.loopexit.unr-lcssa: ; preds = %for.body25, %for.body25.preheader
%spec.select.lcssa.ph = phi i64 [ undef, %for.body25.preheader ], [ %spec.select.7, %for.body25 ]
%ret.068.unr = phi i64 [ 0, %for.body25.preheader ], [ %spec.select.7, %for.body25 ]
%loopA.267.unr = phi i64 [ 0, %for.body25.preheader ], [ %inc35.7, %for.body25 ]
%lcmp.mod73.not = icmp eq i64 %xtraiter72, 0
br i1 %lcmp.mod73.not, label %for.end36, label %for.body25.epil
for.body25.epil: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil
%ret.068.epil = phi i64 [ %spec.select.epil, %for.body25.epil ], [ %ret.068.unr, %for.end36.loopexit.unr-lcssa ]
%loopA.267.epil = phi i64 [ %inc35.epil, %for.body25.epil ], [ %loopA.267.unr, %for.end36.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body25.epil ], [ 0, %for.end36.loopexit.unr-lcssa ]
%arrayidx26.epil = getelementptr inbounds i8, ptr %can, i64 %loopA.267.epil
%16 = load i8, ptr %arrayidx26.epil, align 1, !tbaa !27, !range !29, !noundef !30
%inc32.epil = zext i8 %16 to i64
%spec.select.epil = add nuw nsw i64 %ret.068.epil, %inc32.epil
%inc35.epil = add nuw nsw i64 %loopA.267.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter72
br i1 %epil.iter.cmp.not, label %for.end36, label %for.body25.epil, !llvm.loop !34
for.end36: ; preds = %for.end36.loopexit.unr-lcssa, %for.body25.epil, %for.end.thread, %for.cond22.preheader
%ret.0.lcssa = phi i64 [ 0, %for.cond22.preheader ], [ 0, %for.end.thread ], [ %spec.select.lcssa.ph, %for.end36.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body25.epil ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_max(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #15 {
entry:
%0 = load i64, ptr %data, align 8, !tbaa !5
%cmp10 = icmp sgt i64 %how_data, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%4 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14)
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !35
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %3, <2 x i64> %4)
%6 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ]
%loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ]
%loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ]
%arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011
%7 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%spec.select = tail call i64 @llvm.smax.i64(i64 %ret.012, i64 %7)
%inc = add nuw nsw i64 %loop.011, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !36
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_min(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #15 {
entry:
%0 = load i64, ptr %data, align 8, !tbaa !5
%cmp10 = icmp sgt i64 %how_data, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %0, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %3, %vector.body ]
%vec.phi13 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load14 = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%4 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi13, <2 x i64> %wide.load14)
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !37
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %3, <2 x i64> %4)
%6 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%ret.012.ph = phi i64 [ %0, %for.body.preheader ], [ %6, %middle.block ]
%loop.011.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%ret.012 = phi i64 [ %spec.select, %for.body ], [ %ret.012.ph, %for.body.preheader15 ]
%loop.011 = phi i64 [ %inc, %for.body ], [ %loop.011.ph, %for.body.preheader15 ]
%arrayidx1 = getelementptr inbounds i64, ptr %data, i64 %loop.011
%7 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%spec.select = tail call i64 @llvm.smin.i64(i64 %ret.012, i64 %7)
%inc = add nuw nsw i64 %loop.011, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !38
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ %0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_sum(i64 noundef %how_data, ptr nocapture noundef readonly %data) local_unnamed_addr #16 {
entry:
%cmp4 = icmp sgt i64 %how_data, 0
br i1 %cmp4, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %how_data, 4
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %how_data, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ]
%vec.phi7 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %data, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load8 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = add <2 x i64> %wide.load, %vec.phi
%3 = add <2 x i64> %wide.load8, %vec.phi7
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !39
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %3, %2
%5 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %how_data
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%loop.06.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ret.05.ph = phi i64 [ 0, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%loop.06 = phi i64 [ %inc, %for.body ], [ %loop.06.ph, %for.body.preheader9 ]
%ret.05 = phi i64 [ %add, %for.body ], [ %ret.05.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.06
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%add = add nsw i64 %6, %ret.05
%inc = add nuw nsw i64 %loop.06, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !40
for.end: ; preds = %for.body, %middle.block, %entry
%ret.0.lcssa = phi i64 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ]
ret i64 %ret.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @array_search(i64 noundef %how_data, ptr nocapture noundef readonly %data, i64 noundef %what) local_unnamed_addr #16 {
entry:
%cmp5 = icmp sgt i64 %how_data, 0
br i1 %cmp5, label %for.body, label %cleanup
for.body: ; preds = %entry, %for.inc
%loop.06 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %data, i64 %loop.06
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp1 = icmp eq i64 %0, %what
br i1 %cmp1, label %cleanup, label %for.inc
for.inc: ; preds = %for.body
%inc = add nuw nsw i64 %loop.06, 1
%exitcond.not = icmp eq i64 %inc, %how_data
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !41
cleanup: ; preds = %for.body, %for.inc, %entry
%retval.0 = phi i64 [ -1, %entry ], [ -1, %for.inc ], [ %loop.06, %for.body ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i64 @Leven_dist(ptr nocapture noundef readonly %now, ptr nocapture noundef readonly %target) local_unnamed_addr #17 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %now) #31
%add = add i64 %call, 1
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %target) #31
%add2 = add i64 %call1, 1
%0 = mul nuw i64 %add2, %add
%vla = alloca i64, i64 %0, align 16
%cmp81 = icmp ult i64 %call, 9223372036854775807
br i1 %cmp81, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %add, 3
%1 = icmp ult i64 %call, 3
br i1 %1, label %for.cond4.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %add, -4
br label %for.body
for.cond4.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%loopA.082.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond4.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil
%loopA.082.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %loopA.082.unr, %for.cond4.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond4.preheader.loopexit.unr-lcssa ]
%2 = mul nsw i64 %loopA.082.epil, %add2
%arrayidx.epil = getelementptr inbounds i64, ptr %vla, i64 %2
store i64 %loopA.082.epil, ptr %arrayidx.epil, align 8, !tbaa !5
%inc.epil = add nuw nsw i64 %loopA.082.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond4.preheader, label %for.body.epil, !llvm.loop !42
for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit.unr-lcssa, %for.body.epil, %entry
%cmp583 = icmp ult i64 %call1, 9223372036854775807
br i1 %cmp583, label %for.body6.preheader, label %for.cond12.preheader
for.body6.preheader: ; preds = %for.cond4.preheader
%min.iters.check = icmp ult i64 %add2, 4
br i1 %min.iters.check, label %for.body6.preheader95, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %add2, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%3 = getelementptr inbounds i64, ptr %vla, i64 %index
store <2 x i64> %vec.ind, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds i64, ptr %3, i64 2
store <2 x i64> %step.add, ptr %4, align 16, !tbaa !5
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !43
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %add2, %n.vec
br i1 %cmp.n, label %for.cond12.preheader, label %for.body6.preheader95
for.body6.preheader95: ; preds = %for.body6.preheader, %middle.block
%loopA.184.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
br label %for.body6
for.body: ; preds = %for.body, %for.body.preheader.new
%loopA.082 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%6 = mul nsw i64 %loopA.082, %add2
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %6
store i64 %loopA.082, ptr %arrayidx, align 16, !tbaa !5
%inc = or i64 %loopA.082, 1
%7 = mul nsw i64 %inc, %add2
%arrayidx.1 = getelementptr inbounds i64, ptr %vla, i64 %7
store i64 %inc, ptr %arrayidx.1, align 8, !tbaa !5
%inc.1 = or i64 %loopA.082, 2
%8 = mul nsw i64 %inc.1, %add2
%arrayidx.2 = getelementptr inbounds i64, ptr %vla, i64 %8
store i64 %inc.1, ptr %arrayidx.2, align 16, !tbaa !5
%inc.2 = or i64 %loopA.082, 3
%9 = mul nsw i64 %inc.2, %add2
%arrayidx.3 = getelementptr inbounds i64, ptr %vla, i64 %9
store i64 %inc.2, ptr %arrayidx.3, align 8, !tbaa !5
%inc.3 = add nuw nsw i64 %loopA.082, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond4.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !44
for.cond12.preheader: ; preds = %for.body6, %middle.block, %for.cond4.preheader
%cmp1387 = icmp sgt i64 %add, 1
%cmp1685 = icmp sgt i64 %add2, 1
%or.cond = select i1 %cmp1387, i1 %cmp1685, i1 false
br i1 %or.cond, label %for.cond15.preheader.us, label %for.end47
for.cond15.preheader.us: ; preds = %for.cond12.preheader, %for.cond15.for.inc45_crit_edge.us
%loopA.288.us = phi i64 [ %inc46.us, %for.cond15.for.inc45_crit_edge.us ], [ 1, %for.cond12.preheader ]
%sub.us = add nsw i64 %loopA.288.us, -1
%arrayidx18.us = getelementptr inbounds i8, ptr %now, i64 %sub.us
%10 = load i8, ptr %arrayidx18.us, align 1, !tbaa !26
%11 = mul nsw i64 %sub.us, %add2
%arrayidx26.us = getelementptr inbounds i64, ptr %vla, i64 %11
%12 = mul nsw i64 %loopA.288.us, %add2
%arrayidx29.us = getelementptr inbounds i64, ptr %vla, i64 %12
%.pre = load i64, ptr %arrayidx29.us, align 8, !tbaa !5
br label %for.body17.us
for.body17.us: ; preds = %for.cond15.preheader.us, %for.body17.us
%13 = phi i64 [ %.pre, %for.cond15.preheader.us ], [ %b.a.i80.us, %for.body17.us ]
%loopB.086.us = phi i64 [ 1, %for.cond15.preheader.us ], [ %inc43.us, %for.body17.us ]
%sub19.us = add nsw i64 %loopB.086.us, -1
%arrayidx20.us = getelementptr inbounds i8, ptr %target, i64 %sub19.us
%14 = load i8, ptr %arrayidx20.us, align 1, !tbaa !26
%cmp22.us = icmp ne i8 %10, %14
%conv24.us = zext i1 %cmp22.us to i64
%arrayidx27.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %loopB.086.us
%15 = load i64, ptr %arrayidx27.us, align 8, !tbaa !5
%add28.us = add nsw i64 %15, 1
%add32.us = add nsw i64 %13, 1
%b.a.i.us = tail call i64 @llvm.smin.i64(i64 %add28.us, i64 %add32.us)
%arrayidx37.us = getelementptr inbounds i64, ptr %arrayidx26.us, i64 %sub19.us
%16 = load i64, ptr %arrayidx37.us, align 8, !tbaa !5
%add38.us = add nsw i64 %16, %conv24.us
%b.a.i80.us = tail call i64 @llvm.smin.i64(i64 %b.a.i.us, i64 %add38.us)
%arrayidx41.us = getelementptr inbounds i64, ptr %arrayidx29.us, i64 %loopB.086.us
store i64 %b.a.i80.us, ptr %arrayidx41.us, align 8, !tbaa !5
%inc43.us = add nuw nsw i64 %loopB.086.us, 1
%exitcond92.not = icmp eq i64 %loopB.086.us, %call1
br i1 %exitcond92.not, label %for.cond15.for.inc45_crit_edge.us, label %for.body17.us, !llvm.loop !45
for.cond15.for.inc45_crit_edge.us: ; preds = %for.body17.us
%inc46.us = add nuw nsw i64 %loopA.288.us, 1
%exitcond93.not = icmp eq i64 %loopA.288.us, %call
br i1 %exitcond93.not, label %for.end47, label %for.cond15.preheader.us, !llvm.loop !46
for.body6: ; preds = %for.body6.preheader95, %for.body6
%loopA.184 = phi i64 [ %inc10, %for.body6 ], [ %loopA.184.ph, %for.body6.preheader95 ]
%arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %loopA.184
store i64 %loopA.184, ptr %arrayidx8, align 8, !tbaa !5
%inc10 = add nuw nsw i64 %loopA.184, 1
%exitcond91.not = icmp eq i64 %loopA.184, %call1
br i1 %exitcond91.not, label %for.cond12.preheader, label %for.body6, !llvm.loop !47
for.end47: ; preds = %for.cond15.for.inc45_crit_edge.us, %for.cond12.preheader
%17 = mul nsw i64 %add2, %call
%arrayidx49 = getelementptr inbounds i64, ptr %vla, i64 %17
%arrayidx51 = getelementptr inbounds i64, ptr %arrayidx49, i64 %call1
%18 = load i64, ptr %arrayidx51, align 8, !tbaa !5
ret i64 %18
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @get_digit(i64 noundef %target) local_unnamed_addr #18 {
entry:
%conv = sitofp i64 %target to double
%call = tail call double @log10(double noundef %conv) #32
%add = fadd double %call, 1.000000e+00
%conv1 = fptosi double %add to i64
ret i64 %conv1
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log10(double noundef) local_unnamed_addr #19
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @ncr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #12 {
entry:
%pascal = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal) #32
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal, i8 0, i64 81600, i1 false)
%arrayidx = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1
store i64 1, ptr %arrayidx, align 16, !tbaa !5
%arrayidx3 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3, align 8, !tbaa !5
br label %for.body
for.body: ; preds = %entry, %for.end
%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.end ]
%loopA.037 = phi i64 [ 2, %entry ], [ %inc20, %for.end ]
%0 = add i64 %indvar, 1
%arrayidx4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037
store i64 1, ptr %arrayidx4, align 16, !tbaa !5
%sub = add nsw i64 %loopA.037, -1
%arrayidx11.phi.trans.insert = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 0
%.pre = load i64, ptr %arrayidx11.phi.trans.insert, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !5
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !48
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body ]
%loopB.036.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%scalar.recur = phi i64 [ %6, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader ]
%loopB.036 = phi i64 [ %inc, %for.body8 ], [ %loopB.036.ph, %for.body8.preheader ]
%arrayidx14 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %sub, i64 %loopB.036
%6 = load i64, ptr %arrayidx14, align 8, !tbaa !5
%add = add nsw i64 %6, %scalar.recur
%arrayidx16 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopB.036
store i64 %add, ptr %arrayidx16, align 8, !tbaa !5
%inc = add nuw nsw i64 %loopB.036, 1
%exitcond.not = icmp eq i64 %inc, %loopA.037
br i1 %exitcond.not, label %for.end, label %for.body8, !llvm.loop !49
for.end: ; preds = %for.body8, %middle.block
%arrayidx18 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %loopA.037, i64 %loopA.037
store i64 1, ptr %arrayidx18, align 8, !tbaa !5
%inc20 = add nuw nsw i64 %loopA.037, 1
%exitcond38.not = icmp eq i64 %inc20, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not, label %for.end21, label %for.body, !llvm.loop !50
for.end21: ; preds = %for.end
%arrayidx23 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal, i64 0, i64 %n, i64 %r
%7 = load i64, ptr %arrayidx23, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal) #32
ret i64 %7
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #20
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @npr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #12 {
entry:
%pascal.i = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #32
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false)
%arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1
store i64 1, ptr %arrayidx.i, align 16, !tbaa !5
%arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3.i, align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.end.i, %entry
%indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ]
%loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ]
%0 = add i64 %indvar, 1
%arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i
store i64 1, ptr %arrayidx4.i, align 16, !tbaa !5
%sub.i = add nsw i64 %loopA.037.i, -1
%arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0
%.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.i
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !5
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !51
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %for.body.i, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ]
%loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ]
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ]
%loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ]
%arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i
%6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !5
%add.i = add nsw i64 %6, %scalar.recur
%arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i
store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !5
%inc.i = add nuw nsw i64 %loopB.036.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !52
for.end.i: ; preds = %for.body8.i, %middle.block
%arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i
store i64 1, ptr %arrayidx18.i, align 8, !tbaa !5
%inc20.i = add nuw nsw i64 %loopA.037.i, 1
%exitcond38.not.i = icmp eq i64 %inc20.i, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !50
ncr.exit: ; preds = %for.end.i
%arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %n, i64 %r
%7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #32
%cmp.not4.i = icmp slt i64 %r, 1
br i1 %cmp.not4.i, label %factorial.exit, label %for.body.i3.preheader
for.body.i3.preheader: ; preds = %ncr.exit
%xtraiter = and i64 %r, 3
%8 = icmp ult i64 %r, 4
br i1 %8, label %factorial.exit.loopexit.unr-lcssa, label %for.body.i3.preheader.new
for.body.i3.preheader.new: ; preds = %for.body.i3.preheader
%unroll_iter = and i64 %r, -4
br label %for.body.i3
for.body.i3: ; preds = %for.body.i3, %for.body.i3.preheader.new
%i.06.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %inc.i4.3, %for.body.i3 ]
%ret.05.i = phi i64 [ 1, %for.body.i3.preheader.new ], [ %rem.i.3, %for.body.i3 ]
%niter = phi i64 [ 0, %for.body.i3.preheader.new ], [ %niter.next.3, %for.body.i3 ]
%mul.i = mul i64 %ret.05.i, %i.06.i
%rem.i = urem i64 %mul.i, 1000000007
%inc.i4 = add nuw nsw i64 %i.06.i, 1
%mul.i.1 = mul i64 %rem.i, %inc.i4
%rem.i.1 = urem i64 %mul.i.1, 1000000007
%inc.i4.1 = add nuw nsw i64 %i.06.i, 2
%mul.i.2 = mul i64 %rem.i.1, %inc.i4.1
%rem.i.2 = urem i64 %mul.i.2, 1000000007
%inc.i4.2 = add nuw i64 %i.06.i, 3
%mul.i.3 = mul i64 %rem.i.2, %inc.i4.2
%rem.i.3 = urem i64 %mul.i.3, 1000000007
%inc.i4.3 = add nuw i64 %i.06.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %factorial.exit.loopexit.unr-lcssa, label %for.body.i3, !llvm.loop !22
factorial.exit.loopexit.unr-lcssa: ; preds = %for.body.i3, %for.body.i3.preheader
%rem.i.lcssa.ph = phi i64 [ undef, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ]
%i.06.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %inc.i4.3, %for.body.i3 ]
%ret.05.i.unr = phi i64 [ 1, %for.body.i3.preheader ], [ %rem.i.3, %for.body.i3 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %factorial.exit, label %for.body.i3.epil
for.body.i3.epil: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil
%i.06.i.epil = phi i64 [ %inc.i4.epil, %for.body.i3.epil ], [ %i.06.i.unr, %factorial.exit.loopexit.unr-lcssa ]
%ret.05.i.epil = phi i64 [ %rem.i.epil, %for.body.i3.epil ], [ %ret.05.i.unr, %factorial.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i3.epil ], [ 0, %factorial.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul i64 %ret.05.i.epil, %i.06.i.epil
%rem.i.epil = urem i64 %mul.i.epil, 1000000007
%inc.i4.epil = add nuw i64 %i.06.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %factorial.exit, label %for.body.i3.epil, !llvm.loop !53
factorial.exit: ; preds = %factorial.exit.loopexit.unr-lcssa, %for.body.i3.epil, %ncr.exit
%ret.0.lcssa.i = phi i64 [ 1, %ncr.exit ], [ %rem.i.lcssa.ph, %factorial.exit.loopexit.unr-lcssa ], [ %rem.i.epil, %for.body.i3.epil ]
%mul = mul nsw i64 %ret.0.lcssa.i, %7
ret i64 %mul
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @nhr(i64 noundef %n, i64 noundef %r) local_unnamed_addr #12 {
entry:
%pascal.i = alloca [100 x [102 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 81600, ptr nonnull %pascal.i) #32
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81600) %pascal.i, i8 0, i64 81600, i1 false)
%arrayidx.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1
store i64 1, ptr %arrayidx.i, align 16, !tbaa !5
%arrayidx3.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 1, i64 1
store i64 1, ptr %arrayidx3.i, align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.end.i, %entry
%indvar = phi i64 [ %indvar.next, %for.end.i ], [ 0, %entry ]
%loopA.037.i = phi i64 [ %inc20.i, %for.end.i ], [ 2, %entry ]
%0 = add i64 %indvar, 1
%arrayidx4.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i
store i64 1, ptr %arrayidx4.i, align 16, !tbaa !5
%sub.i = add nsw i64 %loopA.037.i, -1
%arrayidx11.phi.trans.insert.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 0
%.pre.i = load i64, ptr %arrayidx11.phi.trans.insert.i, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %0, 2
br i1 %min.iters.check, label %for.body8.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.i
%n.vec = and i64 %0, -2
%ind.end = or i64 %0, 1
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre.i, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%3 = add nsw <2 x i64> %wide.load, %2
%4 = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %offset.idx
store <2 x i64> %3, ptr %4, align 8, !tbaa !5
%index.next = add nuw i64 %index, 2
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !54
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load, i64 1
br i1 %cmp.n, label %for.end.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %for.body.i, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body.i ]
%loopB.036.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body.i ]
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%scalar.recur = phi i64 [ %6, %for.body8.i ], [ %scalar.recur.ph, %for.body8.i.preheader ]
%loopB.036.i = phi i64 [ %inc.i, %for.body8.i ], [ %loopB.036.i.ph, %for.body8.i.preheader ]
%arrayidx14.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub.i, i64 %loopB.036.i
%6 = load i64, ptr %arrayidx14.i, align 8, !tbaa !5
%add.i = add nsw i64 %6, %scalar.recur
%arrayidx16.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopB.036.i
store i64 %add.i, ptr %arrayidx16.i, align 8, !tbaa !5
%inc.i = add nuw nsw i64 %loopB.036.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %loopA.037.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body8.i, !llvm.loop !55
for.end.i: ; preds = %for.body8.i, %middle.block
%arrayidx18.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %loopA.037.i, i64 %loopA.037.i
store i64 1, ptr %arrayidx18.i, align 8, !tbaa !5
%inc20.i = add nuw nsw i64 %loopA.037.i, 1
%exitcond38.not.i = icmp eq i64 %inc20.i, 100
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not.i, label %ncr.exit, label %for.body.i, !llvm.loop !50
ncr.exit: ; preds = %for.end.i
%add = add i64 %n, -1
%sub = add i64 %add, %r
%arrayidx23.i = getelementptr inbounds [100 x [102 x i64]], ptr %pascal.i, i64 0, i64 %sub, i64 %r
%7 = load i64, ptr %arrayidx23.i, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 81600, ptr nonnull %pascal.i) #32
ret i64 %7
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @rounding(double noundef %target) local_unnamed_addr #21 {
entry:
%conv = fptosi double %target to i64
%conv1 = sitofp i64 %conv to double
%add = fadd double %conv1, 5.000000e-01
%conv2 = fptosi double %add to i64
ret i64 %conv2
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @roundingup(double noundef %target) local_unnamed_addr #13 {
entry:
%0 = tail call double @llvm.ceil.f64(double %target)
%conv = fptosi double %0 to i64
ret i64 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #22
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @roundingdown(double noundef %target) local_unnamed_addr #13 {
entry:
%0 = tail call double @llvm.floor.f64(double %target)
%conv = fptosi double %0 to i64
ret i64 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #22
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local i32 @fifw(i64 noundef %add, ptr nocapture noundef %data) local_unnamed_addr #23 {
entry:
%0 = load i64, ptr %data, align 8, !tbaa !5
%1 = getelementptr i64, ptr %data, i64 %0
%arrayidx2 = getelementptr i64, ptr %1, i64 1
store i64 %add, ptr %arrayidx2, align 8, !tbaa !5
%2 = load i64, ptr %data, align 8, !tbaa !5
%inc = add nsw i64 %2, 1
store i64 %inc, ptr %data, align 8, !tbaa !5
%conv = trunc i64 %inc to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local i64 @fifr(ptr nocapture noundef %data) local_unnamed_addr #24 {
entry:
%arrayidx = getelementptr i64, ptr %data, i64 1
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%1 = load i64, ptr %data, align 8, !tbaa !5
%dec = add nsw i64 %1, -1
store i64 %dec, ptr %data, align 8, !tbaa !5
%scevgep12 = getelementptr i8, ptr %data, i64 16
tail call void @llvm.memmove.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(7984) %arrayidx, ptr noundef nonnull align 8 dereferenceable(7984) %scevgep12, i64 7984, i1 false), !tbaa !5
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @GRAPH_input() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @GRAPH, ptr noundef nonnull getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1))
%0 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !56
%cmp8 = icmp sgt i64 %0, 0
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %entry, %for.body
%loopA.09 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %loopA.09
%arrayidx3 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %loopA.09, i64 1
%call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%inc = add nuw nsw i64 %loopA.09, 1
%1 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !56
%cmp = icmp slt i64 %inc, %1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !58
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @GRAPH_dfs(i64 noundef %now) local_unnamed_addr #25 {
entry:
%arrayidx = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 3, i64 %now
store i8 1, ptr %arrayidx, align 1, !tbaa !27
%0 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !56
%cmp44 = icmp sgt i64 %0, 0
br i1 %cmp44, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
ret void
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %indvars.iv
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%cmp4 = icmp eq i64 %1, %now
br i1 %cmp4, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.body
%arrayidx8 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %indvars.iv, i64 1
%2 = load i64, ptr %arrayidx8, align 8, !tbaa !5
%arrayidx9 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 3, i64 %2
%3 = load i8, ptr %arrayidx9, align 1, !tbaa !27, !range !29, !noundef !30
%cmp11 = icmp eq i8 %3, 0
br i1 %cmp11, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true
tail call void @GRAPH_dfs(i64 noundef %2)
br label %if.end
if.end: ; preds = %if.then, %land.lhs.true, %for.body
%arrayidx18 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 2, i64 %indvars.iv, i64 1
%4 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%cmp19 = icmp eq i64 %4, %now
br i1 %cmp19, label %land.lhs.true21, label %for.inc
land.lhs.true21: ; preds = %if.end
%5 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%arrayidx25 = getelementptr inbounds %struct._GD, ptr @GRAPH, i64 0, i32 3, i64 %5
%6 = load i8, ptr %arrayidx25, align 1, !tbaa !27, !range !29, !noundef !30
%cmp28 = icmp eq i8 %6, 0
br i1 %cmp28, label %if.then30, label %for.inc
if.then30: ; preds = %land.lhs.true21
tail call void @GRAPH_dfs(i64 noundef %5)
br label %for.inc
for.inc: ; preds = %if.end, %land.lhs.true21, %if.then30
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i64, ptr getelementptr inbounds (%struct._GD, ptr @GRAPH, i64 0, i32 1), align 8, !tbaa !56
%cmp = icmp sgt i64 %7, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !59
}
; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local zeroext i1 @check_prime(i64 noundef %target) local_unnamed_addr #26 {
entry:
%cmp = icmp eq i64 %target, 2
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%cmp1 = icmp slt i64 %target, 2
%rem = and i64 %target, 1
%cmp2 = icmp eq i64 %rem, 0
%or.cond = or i1 %cmp1, %cmp2
br i1 %or.cond, label %return, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end
%conv5 = sitofp i64 %target to double
%call21 = tail call double @sqrt(double noundef %conv5) #32
%add22 = fadd double %call21, 1.000000e+00
%cmp623 = fcmp ult double %add22, 3.000000e+00
br i1 %cmp623, label %return, label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 2
%0 = trunc i64 %indvars.iv.next to i32
%conv = sitofp i32 %0 to double
%call = tail call double @sqrt(double noundef %conv5) #32
%add = fadd double %call, 1.000000e+00
%cmp6 = fcmp ult double %add, %conv
br i1 %cmp6, label %return, label %for.body, !llvm.loop !60
for.body: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 3, %for.cond.preheader ]
%rem9 = srem i64 %target, %indvars.iv
%cmp10.not = icmp ne i64 %rem9, 0
br i1 %cmp10.not, label %for.cond, label %return
return: ; preds = %for.body, %for.cond, %for.cond.preheader, %if.end, %entry
%retval.1 = phi i1 [ true, %entry ], [ false, %if.end ], [ true, %for.cond.preheader ], [ %cmp10.not, %for.cond ], [ %cmp10.not, %for.body ]
ret i1 %retval.1
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #19
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @get_lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #12 {
entry:
%cmp.i = icmp slt i64 %a, %b
%sext.i = shl i64 %a, 32
%conv1.i = ashr exact i64 %sext.i, 32
%b.addr.0.i = select i1 %cmp.i, i64 %conv1.i, i64 %b
%a.addr.0.i = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
%rem.i = srem i64 %a.addr.0.i, %b.addr.0.i
%cmp2.not14.i = icmp eq i64 %rem.i, 0
br i1 %cmp2.not14.i, label %get_gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%r.016.i = phi i64 [ %rem4.i, %while.body.i ], [ %rem.i, %entry ]
%b.addr.115.i = phi i64 [ %r.016.i, %while.body.i ], [ %b.addr.0.i, %entry ]
%rem4.i = srem i64 %b.addr.115.i, %r.016.i
%cmp2.not.i = icmp eq i64 %rem4.i, 0
br i1 %cmp2.not.i, label %get_gcd.exit, label %while.body.i, !llvm.loop !61
get_gcd.exit: ; preds = %while.body.i, %entry
%b.addr.1.lcssa.i = phi i64 [ %b.addr.0.i, %entry ], [ %r.016.i, %while.body.i ]
%mul = mul nsw i64 %b, %a
%div = sdiv i64 %mul, %b.addr.1.lcssa.i
ret i64 %div
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @get_gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #12 {
entry:
%cmp = icmp slt i64 %a, %b
%sext = shl i64 %a, 32
%conv1 = ashr exact i64 %sext, 32
%b.addr.0 = select i1 %cmp, i64 %conv1, i64 %b
%a.addr.0 = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
%rem = srem i64 %a.addr.0, %b.addr.0
%cmp2.not14 = icmp eq i64 %rem, 0
br i1 %cmp2.not14, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.016 = phi i64 [ %rem4, %while.body ], [ %rem, %entry ]
%b.addr.115 = phi i64 [ %r.016, %while.body ], [ %b.addr.0, %entry ]
%rem4 = srem i64 %b.addr.115, %r.016
%cmp2.not = icmp eq i64 %rem4, 0
br i1 %cmp2.not, label %while.end, label %while.body, !llvm.loop !61
while.end: ; preds = %while.body, %entry
%b.addr.1.lcssa = phi i64 [ %b.addr.0, %entry ], [ %r.016, %while.body ]
ret i64 %b.addr.1.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @digit_cut(i32 noundef %how_data, ptr nocapture noundef readonly %s, ptr nocapture noundef writeonly %i) local_unnamed_addr #3 {
entry:
%cmp6 = icmp sgt i32 %how_data, 0
br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %how_data 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 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull %arrayidx, ptr noundef null, i32 noundef 10) #32
%conv.i = trunc i64 %call.i to i32
%arrayidx2 = getelementptr inbounds i32, ptr %i, i64 %indvars.iv
store i32 %conv.i, ptr %arrayidx2, align 4, !tbaa !23
%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 !62
}
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #27
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #28
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #29
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #29
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #30
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #29
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #29
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #29
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #29
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #29
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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { nofree norecurse nosync nounwind memory(argmem: 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 #8 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree 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 #11 = { 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 #12 = { 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 #13 = { 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 #14 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #15 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #16 = { 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 #17 = { nofree 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 #18 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #19 = { 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 #20 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #21 = { 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 #22 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #23 = { 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 #24 = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #25 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #26 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #27 = { 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 #28 = { nofree nounwind }
attributes #29 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #30 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #31 = { nounwind willreturn memory(read) }
attributes #32 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !10, !18, !17}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !10}
!23 = !{!24, !24, i64 0}
!24 = !{!"int", !7, i64 0}
!25 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 16000, !26, i64 16016, i64 500, !26, i64 16516, i64 1, !27}
!26 = !{!7, !7, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"_Bool", !7, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !21}
!35 = distinct !{!35, !10, !17, !18}
!36 = distinct !{!36, !10, !18, !17}
!37 = distinct !{!37, !10, !17, !18}
!38 = distinct !{!38, !10, !18, !17}
!39 = distinct !{!39, !10, !17, !18}
!40 = distinct !{!40, !10, !18, !17}
!41 = distinct !{!41, !10}
!42 = distinct !{!42, !21}
!43 = distinct !{!43, !10, !17, !18}
!44 = distinct !{!44, !10}
!45 = distinct !{!45, !10}
!46 = distinct !{!46, !10}
!47 = distinct !{!47, !10, !18, !17}
!48 = distinct !{!48, !10, !17, !18}
!49 = distinct !{!49, !10, !18, !17}
!50 = distinct !{!50, !10}
!51 = distinct !{!51, !10, !17, !18}
!52 = distinct !{!52, !10, !18, !17}
!53 = distinct !{!53, !21}
!54 = distinct !{!54, !10, !17, !18}
!55 = distinct !{!55, !10, !18, !17}
!56 = !{!57, !6, i64 8}
!57 = !{!"", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 16016, !28, i64 16516}
!58 = distinct !{!58, !10}
!59 = distinct !{!59, !10}
!60 = distinct !{!60, !10}
!61 = distinct !{!61, !10}
!62 = distinct !{!62, !10}
|
#include<stdio.h>
int main(void){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if((a*100+b*10+c)%4==0)
printf("YES");
else
printf("NO");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273258/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273258/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %b, align 4, !tbaa !5
%mul1 = shl i32 %0, 1
%1 = load i32, ptr %c, align 4, !tbaa !5
%add2 = add i32 %mul1, %1
%2 = and i32 %add2, 3
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int r,g,b;
scanf("%d %d %d",&r,&g,&b);
if(((100*r)+(10*g)+b)%4==0){
printf("YES");
}
else
{
printf("NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273308/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273308/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
%g = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #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 %r, ptr noundef nonnull %g, ptr noundef nonnull %b)
%0 = load i32, ptr %g, align 4, !tbaa !5
%mul1 = shl i32 %0, 1
%1 = load i32, ptr %b, align 4, !tbaa !5
%add2 = add i32 %mul1, %1
%2 = and i32 %add2, 3
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if((a*100+b*10+c)%4==0)printf("YES");
else printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273359/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273359/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %b, align 4, !tbaa !5
%mul1 = shl i32 %0, 1
%1 = load i32, ptr %c, align 4, !tbaa !5
%add2 = add i32 %mul1, %1
%2 = and i32 %add2, 3
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int d;
d=100*a+10*b+c;
if(d%4==0) puts("YES");
else
puts("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273401/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273401/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %b, align 4, !tbaa !5
%mul1 = shl i32 %0, 1
%1 = load i32, ptr %c, align 4, !tbaa !5
%add2 = add i32 %mul1, %1
%2 = and i32 %add2, 3
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 r, g, b;
scanf("%d %d %d", &r, &g, &b);
if((10*g+b)%4 == 0) {
printf("YES\n");
} else {
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273445/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273445/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
%g = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #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 %r, ptr noundef nonnull %g, ptr noundef nonnull %b)
%0 = load i32, ptr %g, align 4, !tbaa !5
%mul = shl i32 %0, 1
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add i32 %mul, %1
%2 = and i32 %add, 3
%cmp = icmp eq i32 %2, 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 %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int r,g,b,N;
scanf("%d %d %d",&r,&g,&b);
N = 100*r+ 10*g + b;
if(N % 4 == 0) printf("YES\n");
else printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273489/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273489/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
%g = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #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 %r, ptr noundef nonnull %g, ptr noundef nonnull %b)
%0 = load i32, ptr %g, align 4, !tbaa !5
%mul1 = shl i32 %0, 1
%1 = load i32, ptr %b, align 4, !tbaa !5
%add2 = add i32 %mul1, %1
%2 = and i32 %add2, 3
%cmp = icmp eq i32 %2, 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 %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 r,g,b;
scanf("%d %d %d",&r,&g,&b);
if((g*10+b)%4==0){
printf("YES\n");
} else{
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273531/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273531/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
%g = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #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 %r, ptr noundef nonnull %g, ptr noundef nonnull %b)
%0 = load i32, ptr %g, align 4, !tbaa !5
%mul = shl i32 %0, 1
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add i32 %mul, %1
%2 = and i32 %add, 3
%cmp = icmp eq i32 %2, 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 %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 r,g,b;
scanf("%d %d %d",&r,&g,&b);
if((r*100+g*10+b)%4==0) printf("YES\n");
else printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273582/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273582/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
%g = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #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 %r, ptr noundef nonnull %g, ptr noundef nonnull %b)
%0 = load i32, ptr %g, align 4, !tbaa !5
%mul1 = shl i32 %0, 1
%1 = load i32, ptr %b, align 4, !tbaa !5
%add2 = add i32 %mul1, %1
%2 = and i32 %add2, 3
%cmp = icmp eq i32 %2, 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 %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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)
{
char S[100];
int N,i,y=0;
scanf("%d",&N);
for(i=0;i<N;i++)
scanf("%c",&S[i]);
for(i=0;i<N;i++)
if(S[i]=='Y') y++;
if(y>0) printf("Four\n");
else printf("Three\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273632/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273632/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@str = private unnamed_addr constant [6 x i8] c"Three\00", align 1
@str.4 = private unnamed_addr constant [5 x i8] c"Four\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [100 x i8], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #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
%cmp26 = icmp sgt i32 %0, 0
br i1 %cmp26, label %for.body, label %if.else
for.cond2.preheader: ; preds = %for.body
%cmp328 = icmp sgt i32 %11, 0
br i1 %cmp328, label %for.body4.preheader, label %if.else
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %11 to i64
%min.iters.check = icmp ult i32 %11, 8
br i1 %min.iters.check, label %for.body4.preheader42, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi40 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%1 = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %1, align 8, !tbaa !9
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load41 = load <4 x i8>, ptr %2, align 4, !tbaa !9
%3 = icmp eq <4 x i8> %wide.load, <i8 89, i8 89, i8 89, i8 89>
%4 = icmp eq <4 x i8> %wide.load41, <i8 89, i8 89, i8 89, i8 89>
%5 = zext <4 x i1> %3 to <4 x i32>
%6 = zext <4 x i1> %4 to <4 x i32>
%7 = add <4 x i32> %vec.phi, %5
%8 = add <4 x i32> %vec.phi40, %6
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = 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.end12, label %for.body4.preheader42
for.body4.preheader42: ; preds = %for.body4.preheader, %middle.block
%indvars.iv34.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%y.030.ph = phi i32 [ 0, %for.body4.preheader ], [ %10, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond2.preheader, !llvm.loop !14
for.body4: ; preds = %for.body4.preheader42, %for.body4
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %for.body4 ], [ %indvars.iv34.ph, %for.body4.preheader42 ]
%y.030 = phi i32 [ %spec.select, %for.body4 ], [ %y.030.ph, %for.body4.preheader42 ]
%arrayidx6 = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv34
%13 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp7 = icmp eq i8 %13, 89
%inc9 = zext i1 %cmp7 to i32
%spec.select = add nuw nsw i32 %y.030, %inc9
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count
br i1 %exitcond.not, label %for.end12, label %for.body4, !llvm.loop !15
for.end12: ; preds = %for.body4, %middle.block
%spec.select.lcssa = phi i32 [ %10, %middle.block ], [ %spec.select, %for.body4 ]
%.not = icmp eq i32 %spec.select.lcssa, 0
br i1 %.not, label %if.else, label %if.end18
if.else: ; preds = %entry, %for.cond2.preheader, %for.end12
br label %if.end18
if.end18: ; preds = %for.end12, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.4, %for.end12 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11, !13, !12}
|
#include<stdio.h>
int main(void)
{
int n,cnt;
char s[100];
cnt=0;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%c",&s[i]);
if(s[i]=='Y'){
cnt=1;
}
}
if(cnt==1){
puts("Four");
}else{
puts("Three");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273676/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273676/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Four\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"Three\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %0, 0
br i1 %cmp15, label %for.body, label %if.else
for.cond.cleanup: ; preds = %for.body
%1 = icmp eq i32 %spec.select, 1
br i1 %1, label %if.end11, label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%cnt.016 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp4 = icmp eq i8 %2, 89
%spec.select = select i1 %cmp4, i32 1, i32 %cnt.016
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !10
if.else: ; preds = %entry, %for.cond.cleanup
br label %if.end11
if.end11: ; preds = %for.cond.cleanup, %if.else
%.str.3.sink = phi ptr [ @.str.3, %if.else ], [ @.str.2, %for.cond.cleanup ]
%call10 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #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 @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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <stdbool.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define PI 3.14159265358979323846;
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
/*
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r)
*/
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r)
#define TYPE long long
#define ll long long
#define MEMSET(a) memset(a,0,sizeof(a))
#define MEMSET_U(a) memset(a,-1,sizeof(a))
#define bool _Bool
const int mod = (int)1e09 + 7;
//#define DEBUG1
//#define DEBUG2
//#define DEBUGF
#define DUMMY
int in(void) { int i; scanf("%d", &i); return i; }
long long llin(void) { long long i; scanf("%lld", &i); return i; }
double din(void) { double i; scanf("%lf", &i); return i; }
void chin(char s[]) { scanf("%s", s); }
void print(int a) { printf("%d\n", a); }
void llprint(long long a) { printf("%lld\n", a); }
void dprint(double a) { printf("%.10f\n", a); }
void print2(int a, int b) { printf("%d %d\n", a, b); }
int Max(int a, int b) { if (a > b) { return a; }return b; }
int Min(int a, int b) { if (a < b) { return a; }return b; }
long long llmax(long long a, long long b) { return a > b ? a : b; }
long long llmin(long long a, long long b) { return a < b ? a : b; }
double dmax(double a, double b) { return a > b ? a : b; }
double dmin(double a, double b) { return a < b ? a : b; }
//long long llmax(long long a, long long b) { return a > b ? a : b; }
//long long llmin(long long a, long long b) { return a < b ? a : b; }
//double dmax(double a, double b) { return a > b ? a : b; }
int cmp(const void *a, const void *b) { return *(TYPE *)a - *(TYPE *)b; }
int cmp_r(const void *a, const void *b) { return *(TYPE *)b - *(TYPE *)a; }
int char_cmp(const void *a, const void *b) { return strcmp((char *)a, (char *)b); }
int char_cmp_r(const void *a, const void *b) { return strcmp((char *)b, (char *)a); }
void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; }
int main() {
int N;
char S[2];
int ans = 0;
scanf("%d", &N);
for (int i = 0; i < N; i++) {
scanf("%s", S);
if (S[0] == 'Y'){
ans = 1;
break;
}
}
if (ans) {
printf("%s\n", "Four");
}
else {
printf("%s\n", "Three");
}
#ifdef DEBUGF
getch();
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273719/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273719/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@.str.9 = private unnamed_addr constant [5 x i8] c"Four\00", align 1
@.str.10 = private unnamed_addr constant [6 x i8] c"Three\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #11
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b)
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmin(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp olt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !9
%1 = load i64, ptr %a, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #8 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%S = alloca [2 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #11
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %S) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not13 = icmp sgt i32 %0, 0
br i1 %cmp.not13, label %for.body, label %if.end7
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %i.014, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not = icmp slt i32 %inc, %1
br i1 %cmp.not, label %for.body, label %if.end7, !llvm.loop !13
for.body: ; preds = %entry, %for.cond
%i.014 = phi i32 [ %inc, %for.cond ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %S)
%2 = load i8, ptr %S, align 1, !tbaa !15
%cmp2 = icmp eq i8 %2, 89
br i1 %cmp2, label %if.end7, label %for.cond
if.end7: ; preds = %for.cond, %for.body, %entry
%.str.10.sink = phi ptr [ @.str.10, %entry ], [ @.str.9, %for.body ], [ @.str.10, %for.cond ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %.str.10.sink)
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %S) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #11
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #9
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #9
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nofree nounwind }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdbool.h>
#define COL 'Y'
int main(void) {
int n, i;
char c;
bool four_flag = false;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%c", &c);
if (c == COL) four_flag = true;
}
if (four_flag) puts("Four");
else puts("Three");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273762/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273762/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Four\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"Three\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %if.else
for.body: ; preds = %entry, %for.body
%four_flag.011 = phi i8 [ %spec.select, %for.body ], [ 0, %entry ]
%i.010 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%1 = load i8, ptr %c, align 1, !tbaa !9
%cmp2 = icmp eq i8 %1, 89
%spec.select = select i1 %cmp2, i8 1, i8 %four_flag.011
%inc = add nuw nsw i32 %i.010, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body
%3 = and i8 %spec.select, 1
%4 = icmp eq i8 %3, 0
br i1 %4, label %if.else, label %if.end7
if.else: ; preds = %entry, %for.end
br label %if.end7
if.end7: ; preds = %for.end, %if.else
%.str.3.sink = phi ptr [ @.str.3, %if.else ], [ @.str.2, %for.end ]
%call6 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n,i,flag=0;
char a;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%c",&a);
if(a=='Y')flag=1;
}
if(flag==0)printf("Three");
else printf("Four");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273805/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273805/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"Three\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"Four\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 i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 1, 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
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %if.end9
for.body: ; preds = %entry, %for.body
%flag.013 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%i.012 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%1 = load i8, ptr %a, align 1, !tbaa !9
%cmp2 = icmp eq i8 %1, 89
%spec.select = select i1 %cmp2, i32 1, i32 %flag.013
%inc = add nuw nsw i32 %i.012, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body
%3 = icmp eq i32 %spec.select, 0
%spec.select15 = select i1 %3, ptr @.str.2, ptr @.str.3
br label %if.end9
if.end9: ; preds = %for.end, %entry
%.str.3.sink = phi ptr [ @.str.2, %entry ], [ %spec.select15, %for.end ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 1, 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
void insert(int len, int a[len]);
int main()
{
int n;
scanf("%d",&n);
int a[n];
int b[n];
int c[n-1];
insert(n, a);
insert(n, b);
insert(n-1, c);
int i;
i = 0;
int satisfaction;
satisfaction = 0;
while (i < n)
{
satisfaction += b[a[i] - 1];
if (i != n-1 && a[i] + 1 == a[i + 1])
{
satisfaction += c[a[i] - 1];
}
i++;
}
printf("%d",satisfaction);
}
void insert(int len, int a[len])
{
int i;
i = 0;
while (i < len)
{
scanf("%d",&a[i]);
i++;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273849/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273849/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #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
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%sub = add nsw i32 %3, -1
%5 = zext i32 %sub to i64
%vla2 = alloca i32, i64 %5, align 16
%cmp4.i = icmp sgt i32 %3, 0
br i1 %cmp4.i, label %while.body.i, label %while.end
while.body.i: ; preds = %entry, %while.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i ], [ 0, %entry ]
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %4
br i1 %exitcond.not.i, label %insert.exit, label %while.body.i, !llvm.loop !9
insert.exit: ; preds = %while.body.i
%.pre = load i32, ptr %n, align 4, !tbaa !5
%cmp4.i31 = icmp sgt i32 %.pre, 0
br i1 %cmp4.i31, label %while.body.preheader.i32, label %while.end
while.body.preheader.i32: ; preds = %insert.exit
%wide.trip.count.i33 = zext i32 %.pre to i64
br label %while.body.i34
while.body.i34: ; preds = %while.body.i34, %while.body.preheader.i32
%indvars.iv.i35 = phi i64 [ 0, %while.body.preheader.i32 ], [ %indvars.iv.next.i38, %while.body.i34 ]
%arrayidx.i36 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.i35
%call.i37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i36)
%indvars.iv.next.i38 = add nuw nsw i64 %indvars.iv.i35, 1
%exitcond.not.i39 = icmp eq i64 %indvars.iv.next.i38, %wide.trip.count.i33
br i1 %exitcond.not.i39, label %insert.exit40, label %while.body.i34, !llvm.loop !9
insert.exit40: ; preds = %while.body.i34
%.pre56 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.i41 = icmp sgt i32 %.pre56, 1
br i1 %cmp4.i41, label %while.body.preheader.i42, label %insert.exit50
while.body.preheader.i42: ; preds = %insert.exit40
%sub3 = add nsw i32 %.pre56, -1
%wide.trip.count.i43 = zext i32 %sub3 to i64
br label %while.body.i44
while.body.i44: ; preds = %while.body.i44, %while.body.preheader.i42
%indvars.iv.i45 = phi i64 [ 0, %while.body.preheader.i42 ], [ %indvars.iv.next.i48, %while.body.i44 ]
%arrayidx.i46 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.i45
%call.i47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i46)
%indvars.iv.next.i48 = add nuw nsw i64 %indvars.iv.i45, 1
%exitcond.not.i49 = icmp eq i64 %indvars.iv.next.i48, %wide.trip.count.i43
br i1 %exitcond.not.i49, label %insert.exit50.loopexit, label %while.body.i44, !llvm.loop !9
insert.exit50.loopexit: ; preds = %while.body.i44
%.pre57 = load i32, ptr %n, align 4, !tbaa !5
br label %insert.exit50
insert.exit50: ; preds = %insert.exit50.loopexit, %insert.exit40
%6 = phi i32 [ %.pre57, %insert.exit50.loopexit ], [ %.pre56, %insert.exit40 ]
%cmp51 = icmp sgt i32 %6, 0
br i1 %cmp51, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %insert.exit50
%sub7 = add nsw i32 %6, -1
%7 = zext i32 %sub7 to i64
%wide.trip.count = zext i32 %6 to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next.pre-phi, %if.end ]
%satisfaction.053 = phi i32 [ 0, %while.body.lr.ph ], [ %satisfaction.1, %if.end ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%8 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub4 = add nsw i32 %8, -1
%idxprom5 = sext i32 %sub4 to i64
%arrayidx6 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom5
%9 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %9, %satisfaction.053
%cmp8.not = icmp eq i64 %indvars.iv, %7
br i1 %cmp8.not, label %while.body.if.end_crit_edge, label %land.lhs.true
while.body.if.end_crit_edge: ; preds = %while.body
%.pre58 = add nuw nsw i64 %indvars.iv, 1
br label %if.end
land.lhs.true: ; preds = %while.body
%add11 = add nsw i32 %8, 1
%10 = add nuw nsw i64 %indvars.iv, 1
%arrayidx14 = getelementptr inbounds i32, ptr %vla, i64 %10
%11 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp eq i32 %add11, %11
br i1 %cmp15, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true
%arrayidx20 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom5
%12 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add21 = add nsw i32 %12, %add
br label %if.end
if.end: ; preds = %while.body.if.end_crit_edge, %if.then, %land.lhs.true
%indvars.iv.next.pre-phi = phi i64 [ %.pre58, %while.body.if.end_crit_edge ], [ %10, %if.then ], [ %10, %land.lhs.true ]
%satisfaction.1 = phi i32 [ %add, %while.body.if.end_crit_edge ], [ %add21, %if.then ], [ %add, %land.lhs.true ]
%exitcond.not = icmp eq i64 %indvars.iv.next.pre-phi, %wide.trip.count
br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %if.end, %insert.exit, %entry, %insert.exit50
%satisfaction.0.lcssa = phi i32 [ 0, %insert.exit50 ], [ 0, %entry ], [ 0, %insert.exit ], [ %satisfaction.1, %if.end ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %satisfaction.0.lcssa)
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 uwtable
define dso_local void @insert(i32 noundef %len, ptr noundef %a) local_unnamed_addr #0 {
entry:
%cmp4 = icmp sgt i32 %len, 0
br i1 %cmp4, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %len to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%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 %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int n,i,sum=0;
scanf("%d",&n);
int a[n+1],b[n+1],c[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-1;i++) scanf("%d",&c[i]);
for(i=0;i<n;i++){
sum+=b[a[i]-1];
if(i>0) if(a[i]-a[i-1]==1) sum+=c[a[i]-2];
}
printf("%d",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_273892/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_273892/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%add1 = add nsw i32 %3, 1
%4 = zext i32 %add1 to i64
%vla2 = alloca i32, i64 %4, align 16
%5 = zext i32 %3 to i64
%vla3 = alloca i32, i64 %5, align 16
%cmp69 = icmp sgt i32 %3, 0
br i1 %cmp69, label %for.body, label %for.end50
for.cond5.preheader: ; preds = %for.body
%cmp671 = icmp sgt i32 %6, 0
br i1 %cmp671, label %for.body7, label %for.end50
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
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9
for.cond14.preheader: ; preds = %for.body7
%cmp1574 = icmp sgt i32 %8, 1
br i1 %cmp1574, label %for.body16, label %for.cond23.preheader
for.body7: ; preds = %for.cond5.preheader, %for.body7
%indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.body7 ], [ 0, %for.cond5.preheader ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv82
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9)
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp6 = icmp slt i64 %indvars.iv.next83, %9
br i1 %cmp6, label %for.body7, label %for.cond14.preheader, !llvm.loop !11
for.cond23.preheader: ; preds = %for.body16, %for.cond14.preheader
%.lcssa = phi i32 [ %8, %for.cond14.preheader ], [ %12, %for.body16 ]
%cmp2476 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2476, label %for.inc48.peel, label %for.end50
for.inc48.peel: ; preds = %for.cond23.preheader
%wide.trip.count = zext i32 %.lcssa to i64
%10 = load i32, ptr %vla, align 16, !tbaa !5
%sub28.peel = add nsw i32 %10, -1
%idxprom29.peel = sext i32 %sub28.peel to i64
%arrayidx30.peel = getelementptr inbounds i32, ptr %vla2, i64 %idxprom29.peel
%11 = load i32, ptr %arrayidx30.peel, align 4, !tbaa !5
%exitcond.peel.not = icmp eq i32 %.lcssa, 1
br i1 %exitcond.peel.not, label %for.end50, label %if.then
for.body16: ; preds = %for.cond14.preheader, %for.body16
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.body16 ], [ 0, %for.cond14.preheader ]
%arrayidx18 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv85
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx18)
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %12, -1
%13 = sext i32 %sub to i64
%cmp15 = icmp slt i64 %indvars.iv.next86, %13
br i1 %cmp15, label %for.body16, label %for.cond23.preheader, !llvm.loop !12
if.then: ; preds = %for.inc48.peel, %for.inc48
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.inc48 ], [ 1, %for.inc48.peel ]
%sum.077 = phi i32 [ %sum.1, %for.inc48 ], [ %11, %for.inc48.peel ]
%arrayidx27 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv88
%14 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%sub28 = add nsw i32 %14, -1
%idxprom29 = sext i32 %sub28 to i64
%arrayidx30 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom29
%15 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%add31 = add nsw i32 %15, %sum.077
%16 = add nuw i64 %indvars.iv88, 4294967295
%idxprom36 = and i64 %16, 4294967295
%arrayidx37 = getelementptr inbounds i32, ptr %vla, i64 %idxprom36
%17 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%sub38 = sub nsw i32 %14, %17
%cmp39 = icmp eq i32 %sub38, 1
br i1 %cmp39, label %if.then40, label %for.inc48
if.then40: ; preds = %if.then
%sub43 = add nsw i32 %14, -2
%idxprom44 = sext i32 %sub43 to i64
%arrayidx45 = getelementptr inbounds i32, ptr %vla3, i64 %idxprom44
%18 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%add46 = add nsw i32 %18, %add31
br label %for.inc48
for.inc48: ; preds = %if.then40, %if.then
%sum.1 = phi i32 [ %add46, %if.then40 ], [ %add31, %if.then ]
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
br i1 %exitcond.not, label %for.end50, label %if.then, !llvm.loop !13
for.end50: ; preds = %for.inc48, %for.cond5.preheader, %entry, %for.inc48.peel, %for.cond23.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond23.preheader ], [ %11, %for.inc48.peel ], [ 0, %entry ], [ 0, %for.cond5.preheader ], [ %sum.1, %for.inc48 ]
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sum.0.lcssa)
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}
!14 = !{!"llvm.loop.peeled.count", i32 1}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.