Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int main()
{
int a[4],b[4],h,d,i,j;
while((scanf("%d%d%d%d",&a[0],&a[1],&a[2],&a[3])) != EOF){
scanf("%d%d%d%d",&b[0],&b[1],&b[2],&b[3]);
h=d=0;
for(i=0;i<4;i++){
for(j=0;j<4;j++){
if(a[i] == b[j]) {
if (i==j) h++;
else d++;
}
}
}
printf("%d %d\n",h,d);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231692/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231692/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x i32], align 16
%b = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #4
%arrayidx1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3
%call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not41 = icmp eq i32 %call40, -1
br i1 %cmp.not41, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx5 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1
%arrayidx6 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2
%arrayidx7 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7)
%0 = load <4 x i32>, ptr %b, align 16, !tbaa !5
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <8 x i32> <i32 3, i32 0, i32 2, i32 3, i32 0, i32 1, i32 3, i32 0>
%2 = load <4 x i32>, ptr %a, align 16, !tbaa !5
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 3>
%4 = icmp eq <8 x i32> %3, %1
%5 = bitcast <8 x i1> %4 to i8
%6 = call i8 @llvm.ctpop.i8(i8 %5), !range !9
%7 = zext i8 %6 to i32
%8 = shufflevector <4 x i32> %2, <4 x i32> poison, <8 x i32> <i32 3, i32 3, i32 3, i32 2, i32 1, i32 0, i32 0, i32 0>
%9 = shufflevector <4 x i32> %0, <4 x i32> poison, <8 x i32> <i32 3, i32 2, i32 1, i32 2, i32 1, i32 2, i32 1, i32 0>
%10 = icmp eq <8 x i32> %8, %9
%11 = extractelement <8 x i1> %10, i64 7
%spec.select = zext i1 %11 to i32
%12 = extractelement <8 x i1> %10, i64 6
%d.2.1 = zext i1 %12 to i32
%inc19.2 = select i1 %12, i32 2, i32 1
%13 = extractelement <8 x i1> %10, i64 5
%d.2.2 = select i1 %13, i32 %inc19.2, i32 %d.2.1
%inc.1.1 = select i1 %11, i32 2, i32 1
%14 = extractelement <8 x i1> %10, i64 4
%h.2.1.1 = select i1 %14, i32 %inc.1.1, i32 %spec.select
%15 = extractelement <8 x i1> %10, i64 3
%inc.2.2 = zext i1 %15 to i32
%h.2.2.2 = add nuw nsw i32 %h.2.1.1, %inc.2.2
%16 = extractelement <8 x i1> %10, i64 2
%inc19.1.3 = zext i1 %16 to i32
%17 = extractelement <8 x i1> %10, i64 1
%inc19.2.3 = zext i1 %17 to i32
%op.rdx = add nuw nsw i32 %7, %inc19.1.3
%op.rdx74 = add nuw nsw i32 %d.2.2, %inc19.2.3
%op.rdx75 = add nuw nsw i32 %op.rdx, %op.rdx74
%18 = extractelement <8 x i1> %10, i64 0
%inc.3.3 = zext i1 %18 to i32
%h.2.3.3 = add nuw nsw i32 %h.2.2.2, %inc.3.3
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h.2.3.3, i32 noundef %op.rdx75)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 16, 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 i8 @llvm.ctpop.i8(i8) #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 = !{i8 0, i8 9}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int x[4],y[4],h,b,i,j;
while(scanf("%d",&x[0])!=EOF){
for(i=1;i<4;i++)scanf("%d",&x[i]);
for(i=0;i<4;i++)scanf("%d",&y[i]);
h=b=0;
for(i=0;i<4;i++){
if(x[i]==y[i]){
h++;
y[i]=10;
}
}
for(i=0;i<4;i++)for(j=0;j<4;j++)if(x[i]==y[j])b++;
printf("%d %d\n",h,b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231742/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231742/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [4 x i32], align 16
%y = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %y) #4
%call73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%cmp.not74 = icmp eq i32 %call73, -1
br i1 %cmp.not74, label %while.end, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %entry
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %x, i64 0, i64 1
%arrayidx2.1 = getelementptr inbounds [4 x i32], ptr %x, i64 0, i64 2
%arrayidx2.2 = getelementptr inbounds [4 x i32], ptr %x, i64 0, i64 3
%arrayidx8.1 = getelementptr inbounds [4 x i32], ptr %y, i64 0, i64 1
%arrayidx8.2 = getelementptr inbounds [4 x i32], ptr %y, i64 0, i64 2
%arrayidx8.3 = getelementptr inbounds [4 x i32], ptr %y, i64 0, i64 3
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.inc24.3
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2)
%call3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2.1)
%call3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2.2)
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%call9.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.1)
%call9.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.2)
%call9.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8.3)
%0 = load i32, ptr %x, align 16, !tbaa !5
%1 = load i32, ptr %y, align 16, !tbaa !5
%cmp20 = icmp eq i32 %0, %1
br i1 %cmp20, label %if.then, label %for.inc24
if.then: ; preds = %for.cond.preheader
store i32 10, ptr %y, align 16, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.cond.preheader, %if.then
%2 = phi i32 [ 10, %if.then ], [ %1, %for.cond.preheader ]
%h.1 = phi i32 [ 1, %if.then ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%cmp20.1 = icmp eq i32 %3, %4
%5 = insertelement <2 x i32> poison, i32 %4, i64 0
%6 = insertelement <2 x i32> %5, i32 %h.1, i64 1
br i1 %cmp20.1, label %if.then.1, label %for.inc24.1
if.then.1: ; preds = %for.inc24
%inc21.1 = add nuw nsw i32 %h.1, 1
store i32 10, ptr %arrayidx8.1, align 4, !tbaa !5
%7 = insertelement <2 x i32> <i32 10, i32 poison>, i32 %inc21.1, i64 1
br label %for.inc24.1
for.inc24.1: ; preds = %if.then.1, %for.inc24
%8 = phi <2 x i32> [ %7, %if.then.1 ], [ %6, %for.inc24 ]
%9 = load i32, ptr %arrayidx2.1, align 8, !tbaa !5
%10 = load i32, ptr %arrayidx8.2, align 8, !tbaa !5
%cmp20.2 = icmp eq i32 %9, %10
%11 = insertelement <2 x i32> %8, i32 %10, i64 0
br i1 %cmp20.2, label %if.then.2, label %for.inc24.2
if.then.2: ; preds = %for.inc24.1
%12 = extractelement <2 x i32> %8, i64 1
%inc21.2 = add nuw nsw i32 %12, 1
store i32 10, ptr %arrayidx8.2, align 8, !tbaa !5
%13 = insertelement <2 x i32> <i32 10, i32 poison>, i32 %inc21.2, i64 1
br label %for.inc24.2
for.inc24.2: ; preds = %if.then.2, %for.inc24.1
%14 = phi <2 x i32> [ %13, %if.then.2 ], [ %11, %for.inc24.1 ]
%15 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx8.3, align 4, !tbaa !5
%cmp20.3 = icmp eq i32 %15, %16
%17 = extractelement <2 x i32> %14, i64 1
br i1 %cmp20.3, label %if.then.3, label %for.inc24.3
if.then.3: ; preds = %for.inc24.2
%inc21.3 = add nuw nsw i32 %17, 1
store i32 10, ptr %arrayidx8.3, align 4, !tbaa !5
br label %for.inc24.3
for.inc24.3: ; preds = %if.then.3, %for.inc24.2
%18 = phi i32 [ 10, %if.then.3 ], [ %16, %for.inc24.2 ]
%h.1.3 = phi i32 [ %inc21.3, %if.then.3 ], [ %17, %for.inc24.2 ]
%19 = insertelement <16 x i32> poison, i32 %0, i64 0
%20 = insertelement <16 x i32> %19, i32 %3, i64 1
%21 = insertelement <16 x i32> %20, i32 %9, i64 2
%22 = insertelement <16 x i32> %21, i32 %15, i64 3
%23 = shufflevector <16 x i32> %22, <16 x i32> poison, <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 2, i32 3, i32 3, i32 3, i32 3>
%24 = shufflevector <2 x i32> %8, <2 x i32> poison, <16 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%25 = insertelement <16 x i32> %24, i32 %2, i64 1
%26 = shufflevector <2 x i32> %14, <2 x i32> poison, <16 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%27 = shufflevector <16 x i32> %25, <16 x i32> %26, <16 x i32> <i32 0, i32 1, i32 16, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%28 = insertelement <16 x i32> %27, i32 %18, i64 3
%29 = shufflevector <16 x i32> %28, <16 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3>
%30 = icmp eq <16 x i32> %23, %29
%31 = bitcast <16 x i1> %30 to i16
%32 = call i16 @llvm.ctpop.i16(i16 %31), !range !9
%33 = zext i16 %32 to i32
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h.1.3, i32 noundef %33)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !10
while.end: ; preds = %for.inc24.3, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.ctpop.i16(i16) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i16 0, i16 17}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int count=0,a[4],b[4],ans[100][2],hit,blow,i,j;
while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=-1) {
scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
hit=0,blow=0;
for(i=0;i<4;i++) {
if(a[i]==b[i]) hit++;
}
ans[count][0]=hit;
for(i=0;i<4;i++){
for(j=0;j<4;j++){
if (b[i]==a[j]) blow++;
}
}
ans[count][1]=blow-hit;
count++;
}
for(i=0;i<count;i++) printf("%d %d\n",ans[i][0],ans[i][1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231793/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231793/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x i32], align 16
%b = alloca [4 x i32], align 16
%ans = alloca [100 x [2 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %ans) #3
%arrayidx1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3
%call80 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not81 = icmp eq i32 %call80, -1
br i1 %cmp.not81, label %for.end54, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx5 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1
%arrayidx6 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2
%arrayidx7 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3
br label %while.body
for.cond42.preheader: ; preds = %while.body
%0 = and i64 %indvars.iv.next, 4294967295
%cmp4383.not = icmp eq i64 %0, 0
br i1 %cmp4383.not, label %for.end54, label %for.body44.preheader
for.body44.preheader: ; preds = %for.cond42.preheader
%wide.trip.count = and i64 %indvars.iv.next, 4294967295
br label %for.body44
while.body: ; preds = %while.body.lr.ph, %while.body
%indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %while.body ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7)
%1 = load <4 x i32>, ptr %a, align 16, !tbaa !5
%2 = load <4 x i32>, ptr %b, align 16, !tbaa !5
%arrayidx16 = getelementptr inbounds [100 x [2 x i32]], ptr %ans, i64 0, i64 %indvars.iv
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%4 = shufflevector <4 x i32> %1, <4 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%5 = shufflevector <16 x i32> %3, <16 x i32> %4, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 19, i32 18, i32 17, i32 16, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%6 = shufflevector <16 x i32> %5, <16 x i32> poison, <16 x i32> <i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 2, i32 2, i32 2, i32 3, i32 3, i32 3, i32 4, i32 5, i32 6, i32 7>
%7 = shufflevector <4 x i32> %1, <4 x i32> poison, <16 x i32> <i32 2, i32 1, i32 0, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%8 = shufflevector <16 x i32> %7, <16 x i32> %3, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 16, i32 17, i32 18, i32 19, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%9 = shufflevector <16 x i32> %8, <16 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 1, i32 2, i32 3, i32 0, i32 2, i32 3, i32 0, i32 1, i32 4, i32 5, i32 6, i32 7>
%10 = icmp eq <16 x i32> %6, %9
%11 = extractelement <16 x i1> %10, i64 15
%inc = zext i1 %11 to i32
%12 = extractelement <16 x i1> %10, i64 14
%inc.1 = zext i1 %12 to i32
%spec.select.1 = add nuw nsw i32 %inc, %inc.1
%13 = extractelement <16 x i1> %10, i64 13
%inc.2 = zext i1 %13 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2
%14 = extractelement <16 x i1> %10, i64 12
%inc.3 = zext i1 %14 to i32
%spec.select.3 = add nuw nsw i32 %spec.select.2, %inc.3
store i32 %spec.select.3, ptr %arrayidx16, align 8, !tbaa !5
%15 = extractelement <16 x i1> %10, i64 11
%inc30.1 = zext i1 %15 to i32
%spec.select73.1 = add nuw nsw i32 %inc, %inc30.1
%16 = extractelement <16 x i1> %10, i64 10
%inc30.2 = zext i1 %16 to i32
%spec.select73.2 = add nuw nsw i32 %spec.select73.1, %inc30.2
%17 = extractelement <16 x i1> %10, i64 9
%inc30.3 = zext i1 %17 to i32
%spec.select73.3 = add nuw nsw i32 %spec.select73.2, %inc30.3
%18 = extractelement <16 x i1> %10, i64 8
%inc30.189 = zext i1 %18 to i32
%spec.select73.190 = add nuw nsw i32 %spec.select73.3, %inc30.189
%spec.select73.1.1 = add nuw nsw i32 %spec.select73.190, %inc.1
%19 = extractelement <16 x i1> %10, i64 7
%inc30.2.1 = zext i1 %19 to i32
%spec.select73.2.1 = add nuw nsw i32 %spec.select73.1.1, %inc30.2.1
%20 = extractelement <16 x i1> %10, i64 6
%inc30.3.1 = zext i1 %20 to i32
%spec.select73.3.1 = add nuw nsw i32 %spec.select73.2.1, %inc30.3.1
%21 = extractelement <16 x i1> %10, i64 5
%inc30.292 = zext i1 %21 to i32
%spec.select73.293 = add nuw nsw i32 %spec.select73.3.1, %inc30.292
%22 = extractelement <16 x i1> %10, i64 4
%inc30.1.2 = zext i1 %22 to i32
%spec.select73.1.2 = add nuw nsw i32 %spec.select73.293, %inc30.1.2
%spec.select73.2.2 = add nuw nsw i32 %spec.select73.1.2, %inc.2
%23 = extractelement <16 x i1> %10, i64 3
%inc30.3.2 = zext i1 %23 to i32
%spec.select73.3.2 = add nuw nsw i32 %spec.select73.2.2, %inc30.3.2
%24 = extractelement <16 x i1> %10, i64 2
%inc30.395 = zext i1 %24 to i32
%spec.select73.396 = add nuw nsw i32 %spec.select73.3.2, %inc30.395
%25 = extractelement <16 x i1> %10, i64 1
%inc30.1.3 = zext i1 %25 to i32
%spec.select73.1.3 = add nuw nsw i32 %spec.select73.396, %inc30.1.3
%26 = extractelement <16 x i1> %10, i64 0
%inc30.2.3 = zext i1 %26 to i32
%spec.select73.2.3 = add nuw nsw i32 %spec.select73.1.3, %inc30.2.3
%spec.select73.3.3 = add nuw nsw i32 %spec.select73.2.3, %inc.3
%sub = sub nsw i32 %spec.select73.3.3, %spec.select.3
%arrayidx40 = getelementptr inbounds [100 x [2 x i32]], ptr %ans, i64 0, i64 %indvars.iv, i64 1
store i32 %sub, ptr %arrayidx40, align 4, !tbaa !5
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond42.preheader, label %while.body, !llvm.loop !9
for.body44: ; preds = %for.body44.preheader, %for.body44
%indvars.iv98 = phi i64 [ 0, %for.body44.preheader ], [ %indvars.iv.next99, %for.body44 ]
%arrayidx46 = getelementptr inbounds [100 x [2 x i32]], ptr %ans, i64 0, i64 %indvars.iv98
%27 = load i32, ptr %arrayidx46, align 8, !tbaa !5
%arrayidx50 = getelementptr inbounds [100 x [2 x i32]], ptr %ans, i64 0, i64 %indvars.iv98, i64 1
%28 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %27, i32 noundef %28)
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count
br i1 %exitcond.not, label %for.end54, label %for.body44, !llvm.loop !11
for.end54: ; preds = %for.body44, %entry, %for.cond42.preheader
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %ans) #3
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
/* https://img.atcoder.jp/arc077/editorial.pdf */
#include <stdio.h>
#include <string.h>
#define N 200000
#define A 26
#define K 100
int max(int a, int b) { return a > b ? a : b; }
int period(char *cc, int n) {
static int zz[N];
int i, l, r;
for (i = 1, l = r = 0; i < n; i++)
if (zz[i - l] < r - i)
zz[i] = zz[i - l];
else {
l = i, r = max(r, l);
while (r < n && cc[r] == cc[r - l])
r++;
zz[i] = r - l;
}
for (i = 1; i < n; i++)
if (zz[i] == n - i)
break;
return i;
}
long long ans[A];
void solve(char *cc, int n, int m, long long r, int sign) {
static long long len[K], cnt[K][A];
int h, i, a, k;
len[0] = m, memset(cnt[0], 0, sizeof cnt[0]);
for (i = 0; i < m; i++)
cnt[0][cc[i] - 'a']++;
len[1] = n, memset(cnt[1], 0, sizeof cnt[1]);
for (i = 0; i < n; i++)
cnt[1][cc[i] - 'a']++;
k = 2;
while (len[k - 1] < r) {
len[k] = len[k - 1] + len[k - 2];
for (a = 0; a < A; a++)
cnt[k][a] = cnt[k - 1][a] + cnt[k - 2][a];
k++;
}
for (h = k - 1; h >= 0; h--)
if (r >= len[h]) {
for (a = 0; a < A; a++)
ans[a] += cnt[h][a] * sign;
r -= len[h];
}
for (i = 0; i < r; i++)
ans[cc[i] - 'a'] += sign;
}
int main() {
static char cc[N + 1];
int n, m, a;
long long l, r;
scanf("%s%lld%lld", cc, &l, &r), n = strlen(cc) / 2, l--;
m = period(cc, n);
solve(cc, n, m, r, 1), solve(cc, n, m, l, -1);
for (a = 0; a < A; a++)
printf("%lld ", ans[a]);
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231836/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231836/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@period.zz = internal unnamed_addr global [200000 x i32] zeroinitializer, align 16
@solve.len = internal unnamed_addr global [100 x i64] zeroinitializer, align 16
@solve.cnt = internal unnamed_addr global [100 x [26 x i64]] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global [26 x i64] zeroinitializer, align 16
@main.cc = internal global [200001 x i8] zeroinitializer, align 16
@.str = private unnamed_addr constant [11 x i8] c"%s%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @period(ptr nocapture noundef readonly %cc, i32 noundef %n) local_unnamed_addr #1 {
entry:
%cmp64 = icmp sgt i32 %n, 1
br i1 %cmp64, label %for.body.preheader, label %for.end34
for.body.preheader: ; preds = %entry
%0 = zext i32 %n to i64
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond21.preheader: ; preds = %for.inc
br i1 %cmp64, label %for.body24.preheader, label %for.end34
for.body24.preheader: ; preds = %for.cond21.preheader
%wide.trip.count82 = zext i32 %n to i64
br label %for.body24
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv74 = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next75, %for.inc ]
%r.067 = phi i32 [ 0, %for.body.preheader ], [ %r.2, %for.inc ]
%l.066 = phi i32 [ 0, %for.body.preheader ], [ %l.1, %for.inc ]
%indvars77 = trunc i64 %indvars.iv74 to i32
%1 = sext i32 %l.066 to i64
%2 = sub nsw i64 %indvars.iv74, %1
%arrayidx = getelementptr inbounds [200000 x i32], ptr @period.zz, i64 0, i64 %2
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub1 = sub nsw i32 %r.067, %indvars77
%cmp2 = icmp slt i32 %3, %sub1
br i1 %cmp2, label %for.inc, label %if.else
if.else: ; preds = %for.body
%cond.i = tail call i32 @llvm.smax.i32(i32 %r.067, i32 %indvars77)
%cmp861 = icmp slt i32 %cond.i, %n
br i1 %cmp861, label %land.rhs.preheader, label %while.end
land.rhs.preheader: ; preds = %if.else
%4 = zext i32 %cond.i to i64
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%indvars.iv = phi i64 [ %4, %land.rhs.preheader ], [ %indvars.iv.next, %while.body ]
%arrayidx10 = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv
%5 = load i8, ptr %arrayidx10, align 1, !tbaa !9
%6 = sub nsw i64 %indvars.iv, %indvars.iv74
%arrayidx13 = getelementptr inbounds i8, ptr %cc, i64 %6
%7 = load i8, ptr %arrayidx13, align 1, !tbaa !9
%cmp15 = icmp eq i8 %5, %7
br i1 %cmp15, label %while.body, label %while.end.loopexit.split.loop.exit84
while.body: ; preds = %land.rhs
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp8 = icmp ult i64 %indvars.iv.next, %0
br i1 %cmp8, label %land.rhs, label %while.end, !llvm.loop !10
while.end.loopexit.split.loop.exit84: ; preds = %land.rhs
%8 = trunc i64 %indvars.iv to i32
br label %while.end
while.end: ; preds = %while.body, %while.end.loopexit.split.loop.exit84, %if.else
%r.1.lcssa = phi i32 [ %cond.i, %if.else ], [ %8, %while.end.loopexit.split.loop.exit84 ], [ %n, %while.body ]
%sub17 = sub nsw i32 %r.1.lcssa, %indvars77
br label %for.inc
for.inc: ; preds = %for.body, %while.end
%.sink = phi i32 [ %sub17, %while.end ], [ %3, %for.body ]
%l.1 = phi i32 [ %indvars77, %while.end ], [ %l.066, %for.body ]
%r.2 = phi i32 [ %r.1.lcssa, %while.end ], [ %r.067, %for.body ]
%arrayidx7 = getelementptr inbounds [200000 x i32], ptr @period.zz, i64 0, i64 %indvars.iv74
store i32 %.sink, ptr %arrayidx7, align 4, !tbaa !5
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%exitcond.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count
br i1 %exitcond.not, label %for.cond21.preheader, label %for.body, !llvm.loop !12
for.body24: ; preds = %for.body24.preheader, %for.inc32
%indvars.iv78 = phi i64 [ 1, %for.body24.preheader ], [ %indvars.iv.next79, %for.inc32 ]
%arrayidx26 = getelementptr inbounds [200000 x i32], ptr @period.zz, i64 0, i64 %indvars.iv78
%9 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%10 = trunc i64 %indvars.iv78 to i32
%11 = sub i32 %n, %10
%cmp28 = icmp eq i32 %9, %11
br i1 %cmp28, label %for.end34.loopexit.split.loop.exit, label %for.inc32
for.inc32: ; preds = %for.body24
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%exitcond83.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count82
br i1 %exitcond83.not, label %for.end34, label %for.body24, !llvm.loop !13
for.end34.loopexit.split.loop.exit: ; preds = %for.body24
%12 = trunc i64 %indvars.iv78 to i32
br label %for.end34
for.end34: ; preds = %for.inc32, %for.end34.loopexit.split.loop.exit, %entry, %for.cond21.preheader
%i.1.lcssa = phi i32 [ 1, %for.cond21.preheader ], [ 1, %entry ], [ %12, %for.end34.loopexit.split.loop.exit ], [ %n, %for.inc32 ]
ret i32 %i.1.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @solve(ptr nocapture noundef readonly %cc, i32 noundef %n, i32 noundef %m, i64 noundef %r, i32 noundef %sign) local_unnamed_addr #1 {
entry:
%conv = sext i32 %m to i64
store i64 %conv, ptr @solve.len, align 16, !tbaa !14
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) @solve.cnt, i8 0, i64 208, i1 false)
%cmp138 = icmp sgt i32 %m, 0
br i1 %cmp138, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %m to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %m, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv2 = sext i8 %1 to i64
%sub = add nsw i64 %conv2, -97
%arrayidx4 = getelementptr inbounds [26 x i64], ptr @solve.cnt, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx4, align 8, !tbaa !14
%inc = add nsw i64 %2, 1
store i64 %inc, ptr %arrayidx4, align 8, !tbaa !14
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%conv2.1 = sext i8 %3 to i64
%sub.1 = add nsw i64 %conv2.1, -97
%arrayidx4.1 = getelementptr inbounds [26 x i64], ptr @solve.cnt, i64 0, i64 %sub.1
%4 = load i64, ptr %arrayidx4.1, align 8, !tbaa !14
%inc.1 = add nsw i64 %4, 1
store i64 %inc.1, ptr %arrayidx4.1, align 8, !tbaa !14
%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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !16
for.end.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.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv.unr
%5 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%conv2.epil = sext i8 %5 to i64
%sub.epil = add nsw i64 %conv2.epil, -97
%arrayidx4.epil = getelementptr inbounds [26 x i64], ptr @solve.cnt, i64 0, i64 %sub.epil
%6 = load i64, ptr %arrayidx4.epil, align 8, !tbaa !14
%inc.epil = add nsw i64 %6, 1
store i64 %inc.epil, ptr %arrayidx4.epil, align 8, !tbaa !14
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%conv6 = sext i32 %n to i64
store i64 %conv6, ptr getelementptr inbounds ([100 x i64], ptr @solve.len, i64 0, i64 1), align 8, !tbaa !14
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) getelementptr inbounds ([100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 1), i8 0, i64 208, i1 false)
%cmp8140 = icmp sgt i32 %n, 0
br i1 %cmp8140, label %for.body10.preheader, label %while.cond.preheader
for.body10.preheader: ; preds = %for.end
%wide.trip.count156 = zext i32 %n to i64
%xtraiter201 = and i64 %wide.trip.count156, 1
%7 = icmp eq i32 %n, 1
br i1 %7, label %while.cond.preheader.loopexit.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter203 = and i64 %wide.trip.count156, 4294967294
br label %for.body10
while.cond.preheader.loopexit.unr-lcssa: ; preds = %for.body10, %for.body10.preheader
%indvars.iv153.unr = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next154.1, %for.body10 ]
%lcmp.mod202.not = icmp eq i64 %xtraiter201, 0
br i1 %lcmp.mod202.not, label %while.cond.preheader, label %for.body10.epil
for.body10.epil: ; preds = %while.cond.preheader.loopexit.unr-lcssa
%arrayidx12.epil = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv153.unr
%8 = load i8, ptr %arrayidx12.epil, align 1, !tbaa !9
%conv13.epil = sext i8 %8 to i64
%sub14.epil = add nsw i64 %conv13.epil, -97
%arrayidx16.epil = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 1, i64 %sub14.epil
%9 = load i64, ptr %arrayidx16.epil, align 8, !tbaa !14
%inc17.epil = add nsw i64 %9, 1
store i64 %inc17.epil, ptr %arrayidx16.epil, align 8, !tbaa !14
br label %while.cond.preheader
while.cond.preheader: ; preds = %for.body10.epil, %while.cond.preheader.loopexit.unr-lcssa, %for.end
%cmp24143 = icmp slt i64 %conv6, %r
br i1 %cmp24143, label %while.body.preheader, label %for.cond58.preheader
while.body.preheader: ; preds = %while.cond.preheader
%.pre = load i64, ptr getelementptr inbounds ([100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 1, i64 12), align 16, !tbaa !14
br label %while.body
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%indvars.iv153 = phi i64 [ 0, %for.body10.preheader.new ], [ %indvars.iv.next154.1, %for.body10 ]
%niter204 = phi i64 [ 0, %for.body10.preheader.new ], [ %niter204.next.1, %for.body10 ]
%arrayidx12 = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv153
%10 = load i8, ptr %arrayidx12, align 1, !tbaa !9
%conv13 = sext i8 %10 to i64
%sub14 = add nsw i64 %conv13, -97
%arrayidx16 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 1, i64 %sub14
%11 = load i64, ptr %arrayidx16, align 8, !tbaa !14
%inc17 = add nsw i64 %11, 1
store i64 %inc17, ptr %arrayidx16, align 8, !tbaa !14
%indvars.iv.next154 = or i64 %indvars.iv153, 1
%arrayidx12.1 = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv.next154
%12 = load i8, ptr %arrayidx12.1, align 1, !tbaa !9
%conv13.1 = sext i8 %12 to i64
%sub14.1 = add nsw i64 %conv13.1, -97
%arrayidx16.1 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 1, i64 %sub14.1
%13 = load i64, ptr %arrayidx16.1, align 8, !tbaa !14
%inc17.1 = add nsw i64 %13, 1
store i64 %inc17.1, ptr %arrayidx16.1, align 8, !tbaa !14
%indvars.iv.next154.1 = add nuw nsw i64 %indvars.iv153, 2
%niter204.next.1 = add i64 %niter204, 2
%niter204.ncmp.1 = icmp eq i64 %niter204.next.1, %unroll_iter203
br i1 %niter204.ncmp.1, label %while.cond.preheader.loopexit.unr-lcssa, label %for.body10, !llvm.loop !17
for.cond58.preheader.loopexit: ; preds = %while.body
%14 = and i64 %indvars.iv162, 4294967295
br label %for.cond58.preheader
for.cond58.preheader: ; preds = %for.cond58.preheader.loopexit, %while.cond.preheader
%sub21.lcssa = phi i64 [ 1, %while.cond.preheader ], [ %14, %for.cond58.preheader.loopexit ]
%conv74 = sext i32 %sign to i64
%ans.promoted = load i64, ptr @ans, align 16, !tbaa !14
%.promoted = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 1), align 8, !tbaa !14
%.promoted177 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 2), align 16, !tbaa !14
%.promoted178 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 3), align 8, !tbaa !14
%.promoted179 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 4), align 16, !tbaa !14
%.promoted180 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 5), align 8, !tbaa !14
%.promoted181 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 6), align 16, !tbaa !14
%.promoted182 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 7), align 8, !tbaa !14
%.promoted183 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 8), align 16, !tbaa !14
%.promoted184 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 9), align 8, !tbaa !14
%.promoted185 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 10), align 16, !tbaa !14
%.promoted186 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 11), align 8, !tbaa !14
%.promoted187 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 12), align 16, !tbaa !14
%.promoted188 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 13), align 8, !tbaa !14
%.promoted189 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 14), align 16, !tbaa !14
%.promoted190 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 15), align 8, !tbaa !14
%.promoted191 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 16), align 16, !tbaa !14
%.promoted192 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 17), align 8, !tbaa !14
%.promoted193 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 18), align 16, !tbaa !14
%.promoted194 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 19), align 8, !tbaa !14
%.promoted195 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 20), align 16, !tbaa !14
%.promoted196 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 21), align 8, !tbaa !14
%.promoted197 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 22), align 16, !tbaa !14
%.promoted198 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 23), align 8, !tbaa !14
%.promoted199 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 24), align 16, !tbaa !14
%.promoted200 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 25), align 8, !tbaa !14
br label %for.body61
while.body: ; preds = %while.body.preheader, %while.body
%15 = phi i64 [ %.pre, %while.body.preheader ], [ %add48.12, %while.body ]
%indvars.iv162 = phi i64 [ 2, %while.body.preheader ], [ %indvars.iv.next163, %while.body ]
%16 = phi i64 [ %conv6, %while.body.preheader ], [ %58, %while.body ]
%idxprom22145 = phi i64 [ 1, %while.body.preheader ], [ %indvars.iv162, %while.body ]
%17 = add nsw i64 %indvars.iv162, -2
%arrayidx31 = getelementptr inbounds [100 x i64], ptr @solve.len, i64 0, i64 %17
%18 = load i64, ptr %arrayidx31, align 8, !tbaa !14
%add = add nsw i64 %18, %16
%arrayidx33 = getelementptr inbounds [100 x i64], ptr @solve.len, i64 0, i64 %indvars.iv162
store i64 %add, ptr %arrayidx33, align 8, !tbaa !14
%arrayidx42 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 0
%arrayidx47 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 0
%arrayidx52 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 0
%19 = load <2 x i64>, ptr %arrayidx42, align 16, !tbaa !14
%20 = load <2 x i64>, ptr %arrayidx47, align 16, !tbaa !14
%21 = add nsw <2 x i64> %20, %19
store <2 x i64> %21, ptr %arrayidx52, align 16, !tbaa !14
%arrayidx42.2 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 2
%arrayidx47.2 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 2
%arrayidx52.2 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 2
%22 = load <2 x i64>, ptr %arrayidx42.2, align 16, !tbaa !14
%23 = load <2 x i64>, ptr %arrayidx47.2, align 16, !tbaa !14
%24 = add nsw <2 x i64> %23, %22
store <2 x i64> %24, ptr %arrayidx52.2, align 16, !tbaa !14
%arrayidx42.4 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 4
%arrayidx47.4 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 4
%arrayidx52.4 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 4
%25 = load <2 x i64>, ptr %arrayidx42.4, align 16, !tbaa !14
%26 = load <2 x i64>, ptr %arrayidx47.4, align 16, !tbaa !14
%27 = add nsw <2 x i64> %26, %25
store <2 x i64> %27, ptr %arrayidx52.4, align 16, !tbaa !14
%arrayidx42.6 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 6
%arrayidx47.6 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 6
%arrayidx52.6 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 6
%28 = load <2 x i64>, ptr %arrayidx42.6, align 16, !tbaa !14
%29 = load <2 x i64>, ptr %arrayidx47.6, align 16, !tbaa !14
%30 = add nsw <2 x i64> %29, %28
store <2 x i64> %30, ptr %arrayidx52.6, align 16, !tbaa !14
%arrayidx42.8 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 8
%arrayidx47.8 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 8
%arrayidx52.8 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 8
%31 = load <2 x i64>, ptr %arrayidx42.8, align 16, !tbaa !14
%32 = load <2 x i64>, ptr %arrayidx47.8, align 16, !tbaa !14
%33 = add nsw <2 x i64> %32, %31
store <2 x i64> %33, ptr %arrayidx52.8, align 16, !tbaa !14
%arrayidx42.10 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 10
%arrayidx47.10 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 10
%arrayidx52.10 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 10
%34 = load <2 x i64>, ptr %arrayidx42.10, align 16, !tbaa !14
%35 = load <2 x i64>, ptr %arrayidx47.10, align 16, !tbaa !14
%36 = add nsw <2 x i64> %35, %34
store <2 x i64> %36, ptr %arrayidx52.10, align 16, !tbaa !14
%arrayidx47.12 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 12
%37 = load i64, ptr %arrayidx47.12, align 16, !tbaa !14
%add48.12 = add nsw i64 %37, %15
%arrayidx52.12 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 12
store i64 %add48.12, ptr %arrayidx52.12, align 16, !tbaa !14
%arrayidx42.13 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 13
%arrayidx47.13 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 13
%arrayidx52.13 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 13
%38 = load <2 x i64>, ptr %arrayidx42.13, align 8, !tbaa !14
%39 = load <2 x i64>, ptr %arrayidx47.13, align 8, !tbaa !14
%40 = add nsw <2 x i64> %39, %38
store <2 x i64> %40, ptr %arrayidx52.13, align 8, !tbaa !14
%arrayidx42.15 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 15
%arrayidx47.15 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 15
%arrayidx52.15 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 15
%41 = load <2 x i64>, ptr %arrayidx42.15, align 8, !tbaa !14
%42 = load <2 x i64>, ptr %arrayidx47.15, align 8, !tbaa !14
%43 = add nsw <2 x i64> %42, %41
store <2 x i64> %43, ptr %arrayidx52.15, align 8, !tbaa !14
%arrayidx42.17 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 17
%arrayidx47.17 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 17
%arrayidx52.17 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 17
%44 = load <2 x i64>, ptr %arrayidx42.17, align 8, !tbaa !14
%45 = load <2 x i64>, ptr %arrayidx47.17, align 8, !tbaa !14
%46 = add nsw <2 x i64> %45, %44
store <2 x i64> %46, ptr %arrayidx52.17, align 8, !tbaa !14
%arrayidx42.19 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 19
%arrayidx47.19 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 19
%arrayidx52.19 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 19
%47 = load <2 x i64>, ptr %arrayidx42.19, align 8, !tbaa !14
%48 = load <2 x i64>, ptr %arrayidx47.19, align 8, !tbaa !14
%49 = add nsw <2 x i64> %48, %47
store <2 x i64> %49, ptr %arrayidx52.19, align 8, !tbaa !14
%arrayidx42.21 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 21
%arrayidx47.21 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 21
%arrayidx52.21 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 21
%50 = load <2 x i64>, ptr %arrayidx42.21, align 8, !tbaa !14
%51 = load <2 x i64>, ptr %arrayidx47.21, align 8, !tbaa !14
%52 = add nsw <2 x i64> %51, %50
store <2 x i64> %52, ptr %arrayidx52.21, align 8, !tbaa !14
%arrayidx42.23 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 23
%arrayidx47.23 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 23
%arrayidx52.23 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 23
%53 = load <2 x i64>, ptr %arrayidx42.23, align 8, !tbaa !14
%54 = load <2 x i64>, ptr %arrayidx47.23, align 8, !tbaa !14
%55 = add nsw <2 x i64> %54, %53
store <2 x i64> %55, ptr %arrayidx52.23, align 8, !tbaa !14
%arrayidx42.25 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %idxprom22145, i64 25
%56 = load i64, ptr %arrayidx42.25, align 8, !tbaa !14
%arrayidx47.25 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %17, i64 25
%57 = load i64, ptr %arrayidx47.25, align 8, !tbaa !14
%add48.25 = add nsw i64 %57, %56
%arrayidx52.25 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv162, i64 25
store i64 %add48.25, ptr %arrayidx52.25, align 8, !tbaa !14
%indvars.iv.next163 = add nuw i64 %indvars.iv162, 1
%58 = load i64, ptr %arrayidx33, align 8, !tbaa !14
%cmp24 = icmp slt i64 %58, %r
br i1 %cmp24, label %while.body, label %for.cond58.preheader.loopexit, !llvm.loop !18
for.cond86.preheader: ; preds = %for.inc84
%cmp88149 = icmp sgt i64 %r.addr.1, 0
br i1 %cmp88149, label %for.body90.preheader, label %for.end101
for.body90.preheader: ; preds = %for.cond86.preheader
%xtraiter205 = and i64 %r.addr.1, 1
%59 = icmp eq i64 %r.addr.1, 1
br i1 %59, label %for.end101.loopexit.unr-lcssa, label %for.body90.preheader.new
for.body90.preheader.new: ; preds = %for.body90.preheader
%unroll_iter207 = and i64 %r.addr.1, -2
br label %for.body90
for.body61: ; preds = %for.cond58.preheader, %for.inc84
%60 = phi i64 [ %.promoted200, %for.cond58.preheader ], [ %113, %for.inc84 ]
%61 = phi i64 [ %.promoted199, %for.cond58.preheader ], [ %114, %for.inc84 ]
%62 = phi i64 [ %.promoted198, %for.cond58.preheader ], [ %115, %for.inc84 ]
%63 = phi i64 [ %.promoted197, %for.cond58.preheader ], [ %116, %for.inc84 ]
%64 = phi i64 [ %.promoted196, %for.cond58.preheader ], [ %117, %for.inc84 ]
%65 = phi i64 [ %.promoted195, %for.cond58.preheader ], [ %118, %for.inc84 ]
%66 = phi i64 [ %.promoted194, %for.cond58.preheader ], [ %119, %for.inc84 ]
%67 = phi i64 [ %.promoted193, %for.cond58.preheader ], [ %120, %for.inc84 ]
%68 = phi i64 [ %.promoted192, %for.cond58.preheader ], [ %121, %for.inc84 ]
%69 = phi i64 [ %.promoted191, %for.cond58.preheader ], [ %122, %for.inc84 ]
%70 = phi i64 [ %.promoted190, %for.cond58.preheader ], [ %123, %for.inc84 ]
%71 = phi i64 [ %.promoted189, %for.cond58.preheader ], [ %124, %for.inc84 ]
%72 = phi i64 [ %.promoted188, %for.cond58.preheader ], [ %125, %for.inc84 ]
%73 = phi i64 [ %.promoted187, %for.cond58.preheader ], [ %126, %for.inc84 ]
%74 = phi i64 [ %.promoted186, %for.cond58.preheader ], [ %127, %for.inc84 ]
%75 = phi i64 [ %.promoted185, %for.cond58.preheader ], [ %128, %for.inc84 ]
%76 = phi i64 [ %.promoted184, %for.cond58.preheader ], [ %129, %for.inc84 ]
%77 = phi i64 [ %.promoted183, %for.cond58.preheader ], [ %130, %for.inc84 ]
%78 = phi i64 [ %.promoted182, %for.cond58.preheader ], [ %131, %for.inc84 ]
%79 = phi i64 [ %.promoted181, %for.cond58.preheader ], [ %132, %for.inc84 ]
%80 = phi i64 [ %.promoted180, %for.cond58.preheader ], [ %133, %for.inc84 ]
%81 = phi i64 [ %.promoted179, %for.cond58.preheader ], [ %134, %for.inc84 ]
%82 = phi i64 [ %.promoted178, %for.cond58.preheader ], [ %135, %for.inc84 ]
%83 = phi i64 [ %.promoted177, %for.cond58.preheader ], [ %136, %for.inc84 ]
%84 = phi i64 [ %.promoted, %for.cond58.preheader ], [ %137, %for.inc84 ]
%85 = phi i64 [ %ans.promoted, %for.cond58.preheader ], [ %138, %for.inc84 ]
%indvars.iv170 = phi i64 [ %sub21.lcssa, %for.cond58.preheader ], [ %indvars.iv.next171, %for.inc84 ]
%r.addr.0147 = phi i64 [ %r, %for.cond58.preheader ], [ %r.addr.1, %for.inc84 ]
%arrayidx63 = getelementptr inbounds [100 x i64], ptr @solve.len, i64 0, i64 %indvars.iv170
%86 = load i64, ptr %arrayidx63, align 8, !tbaa !14
%cmp64.not = icmp slt i64 %r.addr.0147, %86
br i1 %cmp64.not, label %for.inc84, label %for.body69.preheader
for.body69.preheader: ; preds = %for.body61
%arrayidx73 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 0
%87 = load i64, ptr %arrayidx73, align 16, !tbaa !14
%mul = mul nsw i64 %87, %conv74
%add77 = add nsw i64 %85, %mul
store i64 %add77, ptr @ans, align 16, !tbaa !14
%arrayidx73.1 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 1
%88 = load i64, ptr %arrayidx73.1, align 8, !tbaa !14
%mul.1 = mul nsw i64 %88, %conv74
%add77.1 = add nsw i64 %84, %mul.1
store i64 %add77.1, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 1), align 8, !tbaa !14
%arrayidx73.2 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 2
%89 = load i64, ptr %arrayidx73.2, align 16, !tbaa !14
%mul.2 = mul nsw i64 %89, %conv74
%add77.2 = add nsw i64 %83, %mul.2
store i64 %add77.2, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 2), align 16, !tbaa !14
%arrayidx73.3 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 3
%90 = load i64, ptr %arrayidx73.3, align 8, !tbaa !14
%mul.3 = mul nsw i64 %90, %conv74
%add77.3 = add nsw i64 %82, %mul.3
store i64 %add77.3, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 3), align 8, !tbaa !14
%arrayidx73.4 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 4
%91 = load i64, ptr %arrayidx73.4, align 16, !tbaa !14
%mul.4 = mul nsw i64 %91, %conv74
%add77.4 = add nsw i64 %81, %mul.4
store i64 %add77.4, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 4), align 16, !tbaa !14
%arrayidx73.5 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 5
%92 = load i64, ptr %arrayidx73.5, align 8, !tbaa !14
%mul.5 = mul nsw i64 %92, %conv74
%add77.5 = add nsw i64 %80, %mul.5
store i64 %add77.5, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 5), align 8, !tbaa !14
%arrayidx73.6 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 6
%93 = load i64, ptr %arrayidx73.6, align 16, !tbaa !14
%mul.6 = mul nsw i64 %93, %conv74
%add77.6 = add nsw i64 %79, %mul.6
store i64 %add77.6, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 6), align 16, !tbaa !14
%arrayidx73.7 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 7
%94 = load i64, ptr %arrayidx73.7, align 8, !tbaa !14
%mul.7 = mul nsw i64 %94, %conv74
%add77.7 = add nsw i64 %78, %mul.7
store i64 %add77.7, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 7), align 8, !tbaa !14
%arrayidx73.8 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 8
%95 = load i64, ptr %arrayidx73.8, align 16, !tbaa !14
%mul.8 = mul nsw i64 %95, %conv74
%add77.8 = add nsw i64 %77, %mul.8
store i64 %add77.8, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 8), align 16, !tbaa !14
%arrayidx73.9 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 9
%96 = load i64, ptr %arrayidx73.9, align 8, !tbaa !14
%mul.9 = mul nsw i64 %96, %conv74
%add77.9 = add nsw i64 %76, %mul.9
store i64 %add77.9, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 9), align 8, !tbaa !14
%arrayidx73.10 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 10
%97 = load i64, ptr %arrayidx73.10, align 16, !tbaa !14
%mul.10 = mul nsw i64 %97, %conv74
%add77.10 = add nsw i64 %75, %mul.10
store i64 %add77.10, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 10), align 16, !tbaa !14
%arrayidx73.11 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 11
%98 = load i64, ptr %arrayidx73.11, align 8, !tbaa !14
%mul.11 = mul nsw i64 %98, %conv74
%add77.11 = add nsw i64 %74, %mul.11
store i64 %add77.11, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 11), align 8, !tbaa !14
%arrayidx73.12 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 12
%99 = load i64, ptr %arrayidx73.12, align 16, !tbaa !14
%mul.12 = mul nsw i64 %99, %conv74
%add77.12 = add nsw i64 %73, %mul.12
store i64 %add77.12, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 12), align 16, !tbaa !14
%arrayidx73.13 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 13
%100 = load i64, ptr %arrayidx73.13, align 8, !tbaa !14
%mul.13 = mul nsw i64 %100, %conv74
%add77.13 = add nsw i64 %72, %mul.13
store i64 %add77.13, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 13), align 8, !tbaa !14
%arrayidx73.14 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 14
%101 = load i64, ptr %arrayidx73.14, align 16, !tbaa !14
%mul.14 = mul nsw i64 %101, %conv74
%add77.14 = add nsw i64 %71, %mul.14
store i64 %add77.14, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 14), align 16, !tbaa !14
%arrayidx73.15 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 15
%102 = load i64, ptr %arrayidx73.15, align 8, !tbaa !14
%mul.15 = mul nsw i64 %102, %conv74
%add77.15 = add nsw i64 %70, %mul.15
store i64 %add77.15, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 15), align 8, !tbaa !14
%arrayidx73.16 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 16
%103 = load i64, ptr %arrayidx73.16, align 16, !tbaa !14
%mul.16 = mul nsw i64 %103, %conv74
%add77.16 = add nsw i64 %69, %mul.16
store i64 %add77.16, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 16), align 16, !tbaa !14
%arrayidx73.17 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 17
%104 = load i64, ptr %arrayidx73.17, align 8, !tbaa !14
%mul.17 = mul nsw i64 %104, %conv74
%add77.17 = add nsw i64 %68, %mul.17
store i64 %add77.17, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 17), align 8, !tbaa !14
%arrayidx73.18 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 18
%105 = load i64, ptr %arrayidx73.18, align 16, !tbaa !14
%mul.18 = mul nsw i64 %105, %conv74
%add77.18 = add nsw i64 %67, %mul.18
store i64 %add77.18, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 18), align 16, !tbaa !14
%arrayidx73.19 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 19
%106 = load i64, ptr %arrayidx73.19, align 8, !tbaa !14
%mul.19 = mul nsw i64 %106, %conv74
%add77.19 = add nsw i64 %66, %mul.19
store i64 %add77.19, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 19), align 8, !tbaa !14
%arrayidx73.20 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 20
%107 = load i64, ptr %arrayidx73.20, align 16, !tbaa !14
%mul.20 = mul nsw i64 %107, %conv74
%add77.20 = add nsw i64 %65, %mul.20
store i64 %add77.20, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 20), align 16, !tbaa !14
%arrayidx73.21 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 21
%108 = load i64, ptr %arrayidx73.21, align 8, !tbaa !14
%mul.21 = mul nsw i64 %108, %conv74
%add77.21 = add nsw i64 %64, %mul.21
store i64 %add77.21, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 21), align 8, !tbaa !14
%arrayidx73.22 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 22
%109 = load i64, ptr %arrayidx73.22, align 16, !tbaa !14
%mul.22 = mul nsw i64 %109, %conv74
%add77.22 = add nsw i64 %63, %mul.22
store i64 %add77.22, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 22), align 16, !tbaa !14
%arrayidx73.23 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 23
%110 = load i64, ptr %arrayidx73.23, align 8, !tbaa !14
%mul.23 = mul nsw i64 %110, %conv74
%add77.23 = add nsw i64 %62, %mul.23
store i64 %add77.23, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 23), align 8, !tbaa !14
%arrayidx73.24 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 24
%111 = load i64, ptr %arrayidx73.24, align 16, !tbaa !14
%mul.24 = mul nsw i64 %111, %conv74
%add77.24 = add nsw i64 %61, %mul.24
store i64 %add77.24, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 24), align 16, !tbaa !14
%arrayidx73.25 = getelementptr inbounds [100 x [26 x i64]], ptr @solve.cnt, i64 0, i64 %indvars.iv170, i64 25
%112 = load i64, ptr %arrayidx73.25, align 8, !tbaa !14
%mul.25 = mul nsw i64 %112, %conv74
%add77.25 = add nsw i64 %60, %mul.25
store i64 %add77.25, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 25), align 8, !tbaa !14
%sub83 = sub nsw i64 %r.addr.0147, %86
br label %for.inc84
for.inc84: ; preds = %for.body61, %for.body69.preheader
%113 = phi i64 [ %add77.25, %for.body69.preheader ], [ %60, %for.body61 ]
%114 = phi i64 [ %add77.24, %for.body69.preheader ], [ %61, %for.body61 ]
%115 = phi i64 [ %add77.23, %for.body69.preheader ], [ %62, %for.body61 ]
%116 = phi i64 [ %add77.22, %for.body69.preheader ], [ %63, %for.body61 ]
%117 = phi i64 [ %add77.21, %for.body69.preheader ], [ %64, %for.body61 ]
%118 = phi i64 [ %add77.20, %for.body69.preheader ], [ %65, %for.body61 ]
%119 = phi i64 [ %add77.19, %for.body69.preheader ], [ %66, %for.body61 ]
%120 = phi i64 [ %add77.18, %for.body69.preheader ], [ %67, %for.body61 ]
%121 = phi i64 [ %add77.17, %for.body69.preheader ], [ %68, %for.body61 ]
%122 = phi i64 [ %add77.16, %for.body69.preheader ], [ %69, %for.body61 ]
%123 = phi i64 [ %add77.15, %for.body69.preheader ], [ %70, %for.body61 ]
%124 = phi i64 [ %add77.14, %for.body69.preheader ], [ %71, %for.body61 ]
%125 = phi i64 [ %add77.13, %for.body69.preheader ], [ %72, %for.body61 ]
%126 = phi i64 [ %add77.12, %for.body69.preheader ], [ %73, %for.body61 ]
%127 = phi i64 [ %add77.11, %for.body69.preheader ], [ %74, %for.body61 ]
%128 = phi i64 [ %add77.10, %for.body69.preheader ], [ %75, %for.body61 ]
%129 = phi i64 [ %add77.9, %for.body69.preheader ], [ %76, %for.body61 ]
%130 = phi i64 [ %add77.8, %for.body69.preheader ], [ %77, %for.body61 ]
%131 = phi i64 [ %add77.7, %for.body69.preheader ], [ %78, %for.body61 ]
%132 = phi i64 [ %add77.6, %for.body69.preheader ], [ %79, %for.body61 ]
%133 = phi i64 [ %add77.5, %for.body69.preheader ], [ %80, %for.body61 ]
%134 = phi i64 [ %add77.4, %for.body69.preheader ], [ %81, %for.body61 ]
%135 = phi i64 [ %add77.3, %for.body69.preheader ], [ %82, %for.body61 ]
%136 = phi i64 [ %add77.2, %for.body69.preheader ], [ %83, %for.body61 ]
%137 = phi i64 [ %add77.1, %for.body69.preheader ], [ %84, %for.body61 ]
%138 = phi i64 [ %add77, %for.body69.preheader ], [ %85, %for.body61 ]
%r.addr.1 = phi i64 [ %sub83, %for.body69.preheader ], [ %r.addr.0147, %for.body61 ]
%indvars.iv.next171 = add nsw i64 %indvars.iv170, -1
%cmp59 = icmp sgt i64 %indvars.iv170, 0
br i1 %cmp59, label %for.body61, label %for.cond86.preheader, !llvm.loop !19
for.body90: ; preds = %for.body90, %for.body90.preheader.new
%indvars.iv173 = phi i64 [ 0, %for.body90.preheader.new ], [ %indvars.iv.next174.1, %for.body90 ]
%niter208 = phi i64 [ 0, %for.body90.preheader.new ], [ %niter208.next.1, %for.body90 ]
%arrayidx93 = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv173
%139 = load i8, ptr %arrayidx93, align 1, !tbaa !9
%conv94 = sext i8 %139 to i64
%sub95 = add nsw i64 %conv94, -97
%arrayidx97 = getelementptr inbounds [26 x i64], ptr @ans, i64 0, i64 %sub95
%140 = load i64, ptr %arrayidx97, align 8, !tbaa !14
%add98 = add nsw i64 %140, %conv74
store i64 %add98, ptr %arrayidx97, align 8, !tbaa !14
%indvars.iv.next174 = or i64 %indvars.iv173, 1
%arrayidx93.1 = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv.next174
%141 = load i8, ptr %arrayidx93.1, align 1, !tbaa !9
%conv94.1 = sext i8 %141 to i64
%sub95.1 = add nsw i64 %conv94.1, -97
%arrayidx97.1 = getelementptr inbounds [26 x i64], ptr @ans, i64 0, i64 %sub95.1
%142 = load i64, ptr %arrayidx97.1, align 8, !tbaa !14
%add98.1 = add nsw i64 %142, %conv74
store i64 %add98.1, ptr %arrayidx97.1, align 8, !tbaa !14
%indvars.iv.next174.1 = add nuw nsw i64 %indvars.iv173, 2
%niter208.next.1 = add i64 %niter208, 2
%niter208.ncmp.1 = icmp eq i64 %niter208.next.1, %unroll_iter207
br i1 %niter208.ncmp.1, label %for.end101.loopexit.unr-lcssa, label %for.body90, !llvm.loop !20
for.end101.loopexit.unr-lcssa: ; preds = %for.body90, %for.body90.preheader
%indvars.iv173.unr = phi i64 [ 0, %for.body90.preheader ], [ %indvars.iv.next174.1, %for.body90 ]
%lcmp.mod206.not = icmp eq i64 %xtraiter205, 0
br i1 %lcmp.mod206.not, label %for.end101, label %for.body90.epil
for.body90.epil: ; preds = %for.end101.loopexit.unr-lcssa
%arrayidx93.epil = getelementptr inbounds i8, ptr %cc, i64 %indvars.iv173.unr
%143 = load i8, ptr %arrayidx93.epil, align 1, !tbaa !9
%conv94.epil = sext i8 %143 to i64
%sub95.epil = add nsw i64 %conv94.epil, -97
%arrayidx97.epil = getelementptr inbounds [26 x i64], ptr @ans, i64 0, i64 %sub95.epil
%144 = load i64, ptr %arrayidx97.epil, align 8, !tbaa !14
%add98.epil = add nsw i64 %144, %conv74
store i64 %add98.epil, ptr %arrayidx97.epil, align 8, !tbaa !14
br label %for.end101
for.end101: ; preds = %for.body90.epil, %for.end101.loopexit.unr-lcssa, %for.cond86.preheader
ret void
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%l = alloca i64, align 8
%r = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @main.cc, ptr noundef nonnull %l, ptr noundef nonnull %r)
%call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @main.cc) #10
%div11 = lshr i64 %call1, 1
%conv = trunc i64 %div11 to i32
%0 = load i64, ptr %l, align 8, !tbaa !14
%dec = add nsw i64 %0, -1
store i64 %dec, ptr %l, align 8, !tbaa !14
%cmp64.i = icmp sgt i32 %conv, 1
br i1 %cmp64.i, label %for.body.preheader.i, label %period.exit
for.body.preheader.i: ; preds = %entry
%1 = and i64 %div11, 4294967295
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv74.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next75.i, %for.inc.i ]
%r.067.i = phi i32 [ 0, %for.body.preheader.i ], [ %r.2.i, %for.inc.i ]
%l.066.i = phi i32 [ 0, %for.body.preheader.i ], [ %l.1.i, %for.inc.i ]
%indvars77.i = trunc i64 %indvars.iv74.i to i32
%2 = sext i32 %l.066.i to i64
%3 = sub nsw i64 %indvars.iv74.i, %2
%arrayidx.i = getelementptr inbounds [200000 x i32], ptr @period.zz, i64 0, i64 %3
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%sub1.i = sub nsw i32 %r.067.i, %indvars77.i
%cmp2.i = icmp slt i32 %4, %sub1.i
br i1 %cmp2.i, label %for.inc.i, label %if.else.i
if.else.i: ; preds = %for.body.i
%cond.i.i = call i32 @llvm.smax.i32(i32 %r.067.i, i32 %indvars77.i)
%cmp861.i = icmp slt i32 %cond.i.i, %conv
br i1 %cmp861.i, label %land.rhs.preheader.i, label %while.end.i
land.rhs.preheader.i: ; preds = %if.else.i
%5 = zext i32 %cond.i.i to i64
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%indvars.iv.i = phi i64 [ %5, %land.rhs.preheader.i ], [ %indvars.iv.next.i, %while.body.i ]
%arrayidx10.i = getelementptr inbounds i8, ptr @main.cc, i64 %indvars.iv.i
%6 = load i8, ptr %arrayidx10.i, align 1, !tbaa !9
%7 = sub nsw i64 %indvars.iv.i, %indvars.iv74.i
%arrayidx13.i = getelementptr inbounds i8, ptr @main.cc, i64 %7
%8 = load i8, ptr %arrayidx13.i, align 1, !tbaa !9
%cmp15.i = icmp eq i8 %6, %8
br i1 %cmp15.i, label %while.body.i, label %while.end.loopexit.split.loop.exit84.i
while.body.i: ; preds = %land.rhs.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%cmp8.i = icmp ult i64 %indvars.iv.next.i, %1
br i1 %cmp8.i, label %land.rhs.i, label %while.end.i, !llvm.loop !10
while.end.loopexit.split.loop.exit84.i: ; preds = %land.rhs.i
%9 = trunc i64 %indvars.iv.i to i32
br label %while.end.i
while.end.i: ; preds = %while.body.i, %while.end.loopexit.split.loop.exit84.i, %if.else.i
%r.1.lcssa.i = phi i32 [ %cond.i.i, %if.else.i ], [ %9, %while.end.loopexit.split.loop.exit84.i ], [ %conv, %while.body.i ]
%sub17.i = sub nsw i32 %r.1.lcssa.i, %indvars77.i
br label %for.inc.i
for.inc.i: ; preds = %while.end.i, %for.body.i
%.sink.i = phi i32 [ %sub17.i, %while.end.i ], [ %4, %for.body.i ]
%l.1.i = phi i32 [ %indvars77.i, %while.end.i ], [ %l.066.i, %for.body.i ]
%r.2.i = phi i32 [ %r.1.lcssa.i, %while.end.i ], [ %r.067.i, %for.body.i ]
%arrayidx7.i = getelementptr inbounds [200000 x i32], ptr @period.zz, i64 0, i64 %indvars.iv74.i
store i32 %.sink.i, ptr %arrayidx7.i, align 4, !tbaa !5
%indvars.iv.next75.i = add nuw nsw i64 %indvars.iv74.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next75.i, %1
br i1 %exitcond.not.i, label %for.body24.i, label %for.body.i, !llvm.loop !12
for.body24.i: ; preds = %for.inc.i, %for.inc32.i
%indvars.iv78.i = phi i64 [ %indvars.iv.next79.i, %for.inc32.i ], [ 1, %for.inc.i ]
%arrayidx26.i = getelementptr inbounds [200000 x i32], ptr @period.zz, i64 0, i64 %indvars.iv78.i
%10 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%11 = trunc i64 %indvars.iv78.i to i32
%12 = sub i32 %conv, %11
%cmp28.i = icmp eq i32 %10, %12
br i1 %cmp28.i, label %period.exit, label %for.inc32.i
for.inc32.i: ; preds = %for.body24.i
%indvars.iv.next79.i = add nuw nsw i64 %indvars.iv78.i, 1
%exitcond83.not.i = icmp eq i64 %indvars.iv.next79.i, %1
br i1 %exitcond83.not.i, label %period.exit, label %for.body24.i, !llvm.loop !13
period.exit: ; preds = %for.body24.i, %for.inc32.i, %entry
%i.1.lcssa.i = phi i32 [ 1, %entry ], [ %11, %for.body24.i ], [ %conv, %for.inc32.i ]
%13 = load i64, ptr %r, align 8, !tbaa !14
call void @solve(ptr noundef nonnull @main.cc, i32 noundef %conv, i32 noundef %i.1.lcssa.i, i64 noundef %13, i32 noundef 1)
%14 = load i64, ptr %l, align 8, !tbaa !14
call void @solve(ptr noundef nonnull @main.cc, i32 noundef %conv, i32 noundef %i.1.lcssa.i, i64 noundef %14, i32 noundef -1)
%15 = load i64, ptr @ans, align 16, !tbaa !14
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %15)
%16 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 1), align 8, !tbaa !14
%call4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %16)
%17 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 2), align 16, !tbaa !14
%call4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %17)
%18 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 3), align 8, !tbaa !14
%call4.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %18)
%19 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 4), align 16, !tbaa !14
%call4.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %19)
%20 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 5), align 8, !tbaa !14
%call4.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %20)
%21 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 6), align 16, !tbaa !14
%call4.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %21)
%22 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 7), align 8, !tbaa !14
%call4.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %22)
%23 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 8), align 16, !tbaa !14
%call4.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %23)
%24 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 9), align 8, !tbaa !14
%call4.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %24)
%25 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 10), align 16, !tbaa !14
%call4.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %25)
%26 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 11), align 8, !tbaa !14
%call4.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %26)
%27 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 12), align 16, !tbaa !14
%call4.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %27)
%28 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 13), align 8, !tbaa !14
%call4.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %28)
%29 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 14), align 16, !tbaa !14
%call4.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %29)
%30 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 15), align 8, !tbaa !14
%call4.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %30)
%31 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 16), align 16, !tbaa !14
%call4.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %31)
%32 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 17), align 8, !tbaa !14
%call4.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %32)
%33 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 18), align 16, !tbaa !14
%call4.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %33)
%34 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 19), align 8, !tbaa !14
%call4.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %34)
%35 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 20), align 16, !tbaa !14
%call4.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %35)
%36 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 21), align 8, !tbaa !14
%call4.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %36)
%37 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 22), align 16, !tbaa !14
%call4.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %37)
%38 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 23), align 8, !tbaa !14
%call4.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %38)
%39 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 24), align 16, !tbaa !14
%call4.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %39)
%40 = load i64, ptr getelementptr inbounds ([26 x i64], ptr @ans, i64 0, i64 25), align 8, !tbaa !14
%call4.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %40)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nofree nounwind }
attributes #9 = { nounwind }
attributes #10 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
|
#include <stdio.h>
int main(void)
{
int l, r, ans = 2018;
scanf("%d %d", &l, &r);
if (r - l + 1 >= 2019){
printf("%d", 0);
return 0;
}else{
for (int i = l; i < r; i++){
for (int j = i + 1; j <= r; j++){
if ((i % 2019) * (j % 2019) % 2019 < ans)
ans = (i % 2019) * (j % 2019) % 2019;
}
}
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231894/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231894/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%1 = load i32, ptr %l, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%cmp = icmp sgt i32 %sub, 2017
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp234 = icmp slt i32 %1, %0
br i1 %cmp234, label %for.body7.lr.ph.preheader, label %for.cond.cleanup
for.body7.lr.ph.preheader: ; preds = %for.cond.preheader
%2 = add i32 %1, 1
br label %for.body7.lr.ph
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
br label %cleanup
for.cond.loopexit: ; preds = %for.body7, %middle.block
%spec.select.lcssa = phi i32 [ %15, %middle.block ], [ %spec.select, %for.body7 ]
%exitcond.not = icmp eq i32 %add3, %0
%indvar.next = add i32 %indvar, 1
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body7.lr.ph, !llvm.loop !9
for.cond.cleanup: ; preds = %for.cond.loopexit, %for.cond.preheader
%ans.0.lcssa = phi i32 [ 2018, %for.cond.preheader ], [ %spec.select.lcssa, %for.cond.loopexit ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
br label %cleanup
for.body7.lr.ph: ; preds = %for.body7.lr.ph.preheader, %for.cond.loopexit
%indvar = phi i32 [ 0, %for.body7.lr.ph.preheader ], [ %indvar.next, %for.cond.loopexit ]
%i.036 = phi i32 [ %1, %for.body7.lr.ph.preheader ], [ %add3, %for.cond.loopexit ]
%ans.035 = phi i32 [ 2018, %for.body7.lr.ph.preheader ], [ %spec.select.lcssa, %for.cond.loopexit ]
%3 = add i32 %2, %indvar
%smax = call i32 @llvm.smax.i32(i32 %0, i32 %3)
%4 = add i32 %1, %indvar
%5 = sub i32 %smax, %4
%add3 = add nsw i32 %i.036, 1
%rem = srem i32 %i.036, 2019
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph
vector.ph: ; preds = %for.body7.lr.ph
%n.vec = and i32 %5, -8
%ind.end = add i32 %add3, %n.vec
%.splatinsert = insertelement <4 x i32> poison, i32 %add3, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %ans.035, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %rem, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %12, %vector.body ]
%vec.phi39 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %13, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%6 = srem <4 x i32> %vec.ind, <i32 2019, i32 2019, i32 2019, i32 2019>
%7 = srem <4 x i32> %step.add, <i32 2019, i32 2019, i32 2019, i32 2019>
%8 = mul nsw <4 x i32> %6, %broadcast.splat
%9 = mul nsw <4 x i32> %7, %broadcast.splat
%10 = srem <4 x i32> %8, <i32 2019, i32 2019, i32 2019, i32 2019>
%11 = srem <4 x i32> %9, <i32 2019, i32 2019, i32 2019, i32 2019>
%12 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %10, <4 x i32> %vec.phi)
%13 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %11, <4 x i32> %vec.phi39)
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%14 = icmp eq i32 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %12, <4 x i32> %13)
%15 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i32 %5, %n.vec
br i1 %cmp.n, label %for.cond.loopexit, label %for.body7.preheader
for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block
%j.033.ph = phi i32 [ %add3, %for.body7.lr.ph ], [ %ind.end, %middle.block ]
%ans.132.ph = phi i32 [ %ans.035, %for.body7.lr.ph ], [ %15, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.body7
%j.033 = phi i32 [ %inc, %for.body7 ], [ %j.033.ph, %for.body7.preheader ]
%ans.132 = phi i32 [ %spec.select, %for.body7 ], [ %ans.132.ph, %for.body7.preheader ]
%rem8 = srem i32 %j.033, 2019
%mul = mul nsw i32 %rem8, %rem
%rem9 = srem i32 %mul, 2019
%spec.select = call i32 @llvm.smin.i32(i32 %rem9, i32 %ans.132)
%inc = add nsw i32 %j.033, 1
%cmp5.not.not = icmp slt i32 %j.033, %0
br i1 %cmp5.not.not, label %for.body7, label %for.cond.loopexit, !llvm.loop !14
cleanup: ; preds = %for.cond.cleanup, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include<stdio.h>
int main(void){
long int l,r,i,j,temp,flag;
flag=1;
temp=2018;
scanf("%ld%ld",&l,&r);
if (r-l < 2019){
for(i=l; i<r; i++){
for(j=l+1; j<=r; j++){
if( i*j % 2019 < temp )
temp = i*j % 2019;
}
}
printf("%ld\n",temp);
}
if( r-l >= 2019){
for(i=l; i<r; i++){
for(j=l+1; j<=r; j++){
if( i*j % 2019 == 0){
temp=0,flag=0;
break;
}
else if( i*j % 2019 < temp )
temp = i*j % 2019;
}
if(flag==0)
break;
}
printf("%ld\n",temp);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231937/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231937/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i64, align 8
%r = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%0 = load i64, ptr %r, align 8, !tbaa !5
%1 = load i64, ptr %l, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%cmp = icmp slt i64 %sub, 2019
br i1 %cmp, label %for.cond.preheader, label %for.cond17.preheader
for.cond.preheader: ; preds = %entry
%cmp174 = icmp slt i64 %1, %0
br i1 %cmp174, label %for.cond2.preheader.us.preheader, label %if.end13
for.cond2.preheader.us.preheader: ; preds = %for.cond.preheader
%.neg = add i64 %1, 1
%xtraiter = and i64 %sub, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%j.0.us.prol = add nsw i64 %1, 1
%2 = icmp eq i64 %0, %.neg
br label %for.cond2.preheader.us
for.cond2.preheader.us: ; preds = %for.cond2.preheader.us.preheader, %for.cond2.for.inc9_crit_edge.us
%temp.076.us = phi i64 [ %spec.select.us.lcssa, %for.cond2.for.inc9_crit_edge.us ], [ 2018, %for.cond2.preheader.us.preheader ]
%i.075.us = phi i64 [ %inc10.us, %for.cond2.for.inc9_crit_edge.us ], [ %1, %for.cond2.preheader.us.preheader ]
br i1 %lcmp.mod.not, label %for.body4.us.prol.loopexit, label %for.body4.us.prol
for.body4.us.prol: ; preds = %for.cond2.preheader.us
%mul.us.prol = mul nsw i64 %j.0.us.prol, %i.075.us
%rem.us.prol = srem i64 %mul.us.prol, 2019
%spec.select.us.prol = call i64 @llvm.smin.i64(i64 %rem.us.prol, i64 %temp.076.us)
br label %for.body4.us.prol.loopexit
for.body4.us.prol.loopexit: ; preds = %for.body4.us.prol, %for.cond2.preheader.us
%spec.select.us.lcssa.unr = phi i64 [ undef, %for.cond2.preheader.us ], [ %spec.select.us.prol, %for.body4.us.prol ]
%temp.173.us.unr = phi i64 [ %temp.076.us, %for.cond2.preheader.us ], [ %spec.select.us.prol, %for.body4.us.prol ]
%j.0.in72.us.unr = phi i64 [ %1, %for.cond2.preheader.us ], [ %j.0.us.prol, %for.body4.us.prol ]
br i1 %2, label %for.cond2.for.inc9_crit_edge.us, label %for.body4.us
for.body4.us: ; preds = %for.body4.us.prol.loopexit, %for.body4.us
%temp.173.us = phi i64 [ %spec.select.us.1, %for.body4.us ], [ %temp.173.us.unr, %for.body4.us.prol.loopexit ]
%j.0.in72.us = phi i64 [ %j.0.us.1, %for.body4.us ], [ %j.0.in72.us.unr, %for.body4.us.prol.loopexit ]
%j.0.us = add nsw i64 %j.0.in72.us, 1
%mul.us = mul nsw i64 %j.0.us, %i.075.us
%rem.us = srem i64 %mul.us, 2019
%spec.select.us = call i64 @llvm.smin.i64(i64 %rem.us, i64 %temp.173.us)
%j.0.us.1 = add nsw i64 %j.0.in72.us, 2
%mul.us.1 = mul nsw i64 %j.0.us.1, %i.075.us
%rem.us.1 = srem i64 %mul.us.1, 2019
%spec.select.us.1 = call i64 @llvm.smin.i64(i64 %rem.us.1, i64 %spec.select.us)
%exitcond.not.1 = icmp eq i64 %j.0.us.1, %0
br i1 %exitcond.not.1, label %for.cond2.for.inc9_crit_edge.us, label %for.body4.us, !llvm.loop !9
for.cond2.for.inc9_crit_edge.us: ; preds = %for.body4.us, %for.body4.us.prol.loopexit
%spec.select.us.lcssa = phi i64 [ %spec.select.us.lcssa.unr, %for.body4.us.prol.loopexit ], [ %spec.select.us.1, %for.body4.us ]
%inc10.us = add nsw i64 %i.075.us, 1
%exitcond89.not = icmp eq i64 %inc10.us, %0
br i1 %exitcond89.not, label %if.end13, label %for.cond2.preheader.us, !llvm.loop !11
if.end13: ; preds = %for.cond2.for.inc9_crit_edge.us, %for.cond.preheader
%temp.0.lcssa = phi i64 [ 2018, %for.cond.preheader ], [ %spec.select.us.lcssa, %for.cond2.for.inc9_crit_edge.us ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %temp.0.lcssa)
%.pre = load i64, ptr %r, align 8, !tbaa !5
%.pre92 = load i64, ptr %l, align 8, !tbaa !5
%.pre93 = sub nsw i64 %.pre, %.pre92
%3 = icmp sgt i64 %.pre93, 2018
br i1 %3, label %for.cond17.preheader, label %if.end46
for.cond17.preheader: ; preds = %entry, %if.end13
%temp.396 = phi i64 [ %temp.0.lcssa, %if.end13 ], [ 2018, %entry ]
%4 = phi i64 [ %.pre, %if.end13 ], [ %0, %entry ]
%5 = phi i64 [ %.pre92, %if.end13 ], [ %1, %entry ]
%cmp1882 = icmp slt i64 %5, %4
br i1 %cmp1882, label %for.cond21.preheader.us, label %for.end44
for.cond21.preheader.us: ; preds = %for.cond17.preheader, %for.cond21.for.inc42_crit_edge.us
%temp.484.us = phi i64 [ %spec.select66.us, %for.cond21.for.inc42_crit_edge.us ], [ %temp.396, %for.cond17.preheader ]
%i.183.us = phi i64 [ %inc43.us, %for.cond21.for.inc42_crit_edge.us ], [ %5, %for.cond17.preheader ]
br label %for.body23.us
for.body23.us: ; preds = %for.cond21.preheader.us, %if.else.us
%j.181.us.in = phi i64 [ %5, %for.cond21.preheader.us ], [ %j.181.us, %if.else.us ]
%temp.580.us = phi i64 [ %temp.484.us, %for.cond21.preheader.us ], [ %spec.select66.us, %if.else.us ]
%j.181.us = add nsw i64 %j.181.us.in, 1
%mul24.us = mul nsw i64 %j.181.us, %i.183.us
%rem25.us = srem i64 %mul24.us, 2019
%cmp26.us = icmp eq i64 %rem25.us, 0
br i1 %cmp26.us, label %for.end44, label %if.else.us
if.else.us: ; preds = %for.body23.us
%spec.select66.us = call i64 @llvm.smin.i64(i64 %rem25.us, i64 %temp.580.us)
%exitcond90.not = icmp eq i64 %j.181.us, %4
br i1 %exitcond90.not, label %for.cond21.for.inc42_crit_edge.us, label %for.body23.us, !llvm.loop !12
for.cond21.for.inc42_crit_edge.us: ; preds = %if.else.us
%inc43.us = add i64 %i.183.us, 1
%exitcond91.not = icmp eq i64 %inc43.us, %4
br i1 %exitcond91.not, label %for.end44, label %for.cond21.preheader.us, !llvm.loop !13
for.end44: ; preds = %for.cond21.for.inc42_crit_edge.us, %for.body23.us, %for.cond17.preheader
%temp.8 = phi i64 [ %temp.396, %for.cond17.preheader ], [ 0, %for.body23.us ], [ %spec.select66.us, %for.cond21.for.inc42_crit_edge.us ]
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %temp.8)
br label %if.end46
if.end46: ; preds = %for.end44, %if.end13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
|
#include <stdio.h>
#define ll long long int
int main(void) {
ll l, r;
int k, a = 2020;
scanf("%lld%lld", &l, &r);
if((r - l) >= 2019) {
a = 0;
printf("%d\n", a);
return 0;
}
for(ll i = l; i < r; i++) {
for(ll j = i+1; j <= r; j++) {
if(i < j) {
k = (i * j) % 2019;
if(a > k) a = k;
}
}
}
printf("%d\n", a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231980/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231980/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i64, align 8
%r = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%0 = load i64, ptr %r, align 8, !tbaa !5
%1 = load i64, ptr %l, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%cmp = icmp sgt i64 %sub, 2018
br i1 %cmp, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp234 = icmp slt i64 %1, %0
br i1 %cmp234, label %for.body6.preheader, label %cleanup
for.cond.loopexit: ; preds = %for.inc
%exitcond.not = icmp eq i64 %add, %0
br i1 %exitcond.not, label %cleanup, label %for.body6.preheader, !llvm.loop !9
for.body6.preheader: ; preds = %for.cond.preheader, %for.cond.loopexit
%i.036 = phi i64 [ %add, %for.cond.loopexit ], [ %1, %for.cond.preheader ]
%a.035 = phi i32 [ %a.2, %for.cond.loopexit ], [ 2020, %for.cond.preheader ]
%add = add nsw i64 %i.036, 1
br label %for.body6
for.body6: ; preds = %for.body6.preheader, %for.inc
%j.033 = phi i64 [ %inc, %for.inc ], [ %add, %for.body6.preheader ]
%a.132 = phi i32 [ %a.2, %for.inc ], [ %a.035, %for.body6.preheader ]
%cmp7 = icmp slt i64 %i.036, %j.033
br i1 %cmp7, label %if.then8, label %for.inc
if.then8: ; preds = %for.body6
%mul = mul nsw i64 %j.033, %i.036
%rem = srem i64 %mul, 2019
%conv = trunc i64 %rem to i32
%spec.select = call i32 @llvm.smin.i32(i32 %a.132, i32 %conv)
br label %for.inc
for.inc: ; preds = %if.then8, %for.body6
%a.2 = phi i32 [ %a.132, %for.body6 ], [ %spec.select, %if.then8 ]
%inc = add nsw i64 %j.033, 1
%cmp4.not.not = icmp slt i64 %j.033, %0
br i1 %cmp4.not.not, label %for.body6, label %for.cond.loopexit, !llvm.loop !11
cleanup: ; preds = %for.cond.loopexit, %for.cond.preheader, %entry
%a.0.lcssa.sink = phi i32 [ 0, %entry ], [ 2020, %for.cond.preheader ], [ %a.2, %for.cond.loopexit ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void) {
long L, R;
scanf("%ld%ld", &L, &R);
int l, r;
int ls, rs;
int i, j;
l = L % 2019;
r = R % 2019;
ls = L / 2019;
rs = R / 2019;
int min = 2019;
if (rs - ls >= 1) {
printf("0");
}
else {
for (i = l;i < r;i++) {
for (j = i + 1;j <= r;j++) {
if (min > (i * j) % 2019) {
min = (i * j) % 2019;
}
}
}
printf("%d", min);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232022/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232022/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.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:
%L = alloca i64, align 8
%R = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %L) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %R) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %R)
%0 = load i64, ptr %L, align 8, !tbaa !5
%1 = load i64, ptr %R, align 8, !tbaa !5
%rem1 = srem i64 %1, 2019
%conv2 = trunc i64 %rem1 to i32
%div.neg = sdiv i64 %0, -2019
%conv3.neg = trunc i64 %div.neg to i32
%div4 = sdiv i64 %1, 2019
%conv5 = trunc i64 %div4 to i32
%sub = add i32 %conv5, %conv3.neg
%cmp = icmp sgt i32 %sub, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 48)
br label %if.end24
if.else: ; preds = %entry
%rem = srem i64 %0, 2019
%conv = trunc i64 %rem to i32
%cmp837 = icmp slt i32 %conv, %conv2
br i1 %cmp837, label %for.body13.preheader.preheader, label %for.end22
for.body13.preheader.preheader: ; preds = %if.else
%2 = add nsw i32 %conv, 1
br label %for.body13.preheader
for.cond.loopexit: ; preds = %for.body13, %middle.block
%spec.select.lcssa = phi i32 [ %13, %middle.block ], [ %spec.select, %for.body13 ]
%exitcond.not = icmp eq i32 %add, %conv2
%indvar.next = add i32 %indvar, 1
br i1 %exitcond.not, label %for.end22, label %for.body13.preheader, !llvm.loop !9
for.body13.preheader: ; preds = %for.body13.preheader.preheader, %for.cond.loopexit
%indvar = phi i32 [ 0, %for.body13.preheader.preheader ], [ %indvar.next, %for.cond.loopexit ]
%min.039 = phi i32 [ 2019, %for.body13.preheader.preheader ], [ %spec.select.lcssa, %for.cond.loopexit ]
%i.038 = phi i32 [ %conv, %for.body13.preheader.preheader ], [ %add, %for.cond.loopexit ]
%3 = add i32 %2, %indvar
%smax = call i32 @llvm.smax.i32(i32 %3, i32 %conv2)
%4 = add i32 %indvar, %conv
%5 = sub i32 %smax, %4
%add = add nsw i32 %i.038, 1
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body13.preheader43, label %vector.ph
vector.ph: ; preds = %for.body13.preheader
%n.vec = and i32 %5, -8
%ind.end = add i32 %add, %n.vec
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %min.039, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%.splatinsert = insertelement <4 x i32> poison, i32 %add, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %i.038, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %10, %vector.body ]
%vec.phi41 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %11, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%6 = mul nsw <4 x i32> %vec.ind, %broadcast.splat
%7 = mul nsw <4 x i32> %step.add, %broadcast.splat
%8 = srem <4 x i32> %6, <i32 2019, i32 2019, i32 2019, i32 2019>
%9 = srem <4 x i32> %7, <i32 2019, i32 2019, i32 2019, i32 2019>
%10 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %8)
%11 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi41, <4 x i32> %9)
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%12 = icmp eq i32 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %10, <4 x i32> %11)
%13 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i32 %5, %n.vec
br i1 %cmp.n, label %for.cond.loopexit, label %for.body13.preheader43
for.body13.preheader43: ; preds = %for.body13.preheader, %middle.block
%min.136.ph = phi i32 [ %min.039, %for.body13.preheader ], [ %13, %middle.block ]
%j.035.ph = phi i32 [ %add, %for.body13.preheader ], [ %ind.end, %middle.block ]
br label %for.body13
for.body13: ; preds = %for.body13.preheader43, %for.body13
%min.136 = phi i32 [ %spec.select, %for.body13 ], [ %min.136.ph, %for.body13.preheader43 ]
%j.035 = phi i32 [ %inc, %for.body13 ], [ %j.035.ph, %for.body13.preheader43 ]
%mul = mul nsw i32 %j.035, %i.038
%rem14 = srem i32 %mul, 2019
%spec.select = call i32 @llvm.smin.i32(i32 %min.136, i32 %rem14)
%inc = add nsw i32 %j.035, 1
%cmp11.not.not = icmp slt i32 %j.035, %conv2
br i1 %cmp11.not.not, label %for.body13, label %for.cond.loopexit, !llvm.loop !14
for.end22: ; preds = %for.cond.loopexit, %if.else
%min.0.lcssa = phi i32 [ 2019, %if.else ], [ %spec.select.lcssa, %for.cond.loopexit ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.0.lcssa)
br label %if.end24
if.end24: ; preds = %for.end22, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %R) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %L) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
int main(void){
int N,r=0,g=0,b=0,i,j;
long res=0;
char S[5000];
scanf("%d%s",&N,S);
for(i=0;i<N;i++){
if(S[i]=='R') r++;
if(S[i]=='G') g++;
if(S[i]=='B') b++;
}
res=r*g;
res*=b;
for(i=0;i<N-2;i++){
for(j=i+1;j<N-1;j++){
int k=2*j-i;
if(S[i]!=S[j]&&S[i]!=S[k]&&S[j]!=S[k]&&k<N){
res--;
}
}
}
printf("%ld",res);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232066/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232066/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%S = alloca [5000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 5000, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %S)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp95 = icmp sgt i32 %0, 0
br i1 %cmp95, label %for.body.preheader, label %for.end69
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader137, 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 ], [ %7, %vector.body ]
%vec.phi127 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi128 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%vec.phi129 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
%vec.phi130 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi131 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%1 = getelementptr inbounds [5000 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.load132 = load <4 x i8>, ptr %2, align 4, !tbaa !9
%3 = icmp eq <4 x i8> %wide.load, <i8 82, i8 82, i8 82, i8 82>
%4 = icmp eq <4 x i8> %wide.load132, <i8 82, i8 82, i8 82, i8 82>
%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.phi127, %6
%9 = icmp eq <4 x i8> %wide.load, <i8 71, i8 71, i8 71, i8 71>
%10 = icmp eq <4 x i8> %wide.load132, <i8 71, i8 71, i8 71, i8 71>
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi130, %11
%14 = add <4 x i32> %vec.phi131, %12
%15 = icmp eq <4 x i8> %wide.load, <i8 66, i8 66, i8 66, i8 66>
%16 = icmp eq <4 x i8> %wide.load132, <i8 66, i8 66, i8 66, i8 66>
%17 = zext <4 x i1> %15 to <4 x i32>
%18 = zext <4 x i1> %16 to <4 x i32>
%19 = add <4 x i32> %vec.phi128, %17
%20 = add <4 x i32> %vec.phi129, %18
%index.next = add nuw i64 %index, 8
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx135 = add <4 x i32> %14, %13
%22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx135)
%bin.rdx133 = add <4 x i32> %20, %19
%23 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx133)
%bin.rdx = add <4 x i32> %8, %7
%24 = 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.end, label %for.body.preheader137
for.body.preheader137: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%r.099.ph = phi i32 [ 0, %for.body.preheader ], [ %24, %middle.block ]
%b.097.ph = phi i32 [ 0, %for.body.preheader ], [ %23, %middle.block ]
%g.096.ph = phi i32 [ 0, %for.body.preheader ], [ %22, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader137, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader137 ]
%r.099 = phi i32 [ %spec.select, %for.body ], [ %r.099.ph, %for.body.preheader137 ]
%b.097 = phi i32 [ %b.1, %for.body ], [ %b.097.ph, %for.body.preheader137 ]
%g.096 = phi i32 [ %g.1, %for.body ], [ %g.096.ph, %for.body.preheader137 ]
%arrayidx = getelementptr inbounds [5000 x i8], ptr %S, i64 0, i64 %indvars.iv
%25 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp1 = icmp eq i8 %25, 82
%inc = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %r.099, %inc
%cmp6 = icmp eq i8 %25, 71
%inc9 = zext i1 %cmp6 to i32
%g.1 = add nuw nsw i32 %g.096, %inc9
%cmp14 = icmp eq i8 %25, 66
%inc17 = zext i1 %cmp14 to i32
%b.1 = add nuw nsw i32 %b.097, %inc17
%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 !14
for.end: ; preds = %for.body, %middle.block
%spec.select.lcssa = phi i32 [ %24, %middle.block ], [ %spec.select, %for.body ]
%g.1.lcssa = phi i32 [ %22, %middle.block ], [ %g.1, %for.body ]
%b.1.lcssa = phi i32 [ %23, %middle.block ], [ %b.1, %for.body ]
%26 = mul nsw i32 %spec.select.lcssa, %g.1.lcssa
%27 = zext i32 %26 to i64
%28 = zext i32 %b.1.lcssa to i64
%29 = mul nuw nsw i64 %27, %28
%cmp24107 = icmp sgt i32 %0, 2
br i1 %cmp24107, label %for.body26.lr.ph, label %for.end69
for.body26.lr.ph: ; preds = %for.end
%sub = add nsw i32 %0, -2
%sub28 = add nsw i32 %0, -1
%30 = zext i32 %sub28 to i64
%wide.trip.count123 = zext i32 %sub to i64
%wide.trip.count118 = zext i32 %sub28 to i64
br label %for.body26
for.cond23.loopexit: ; preds = %if.end63, %for.body26
%res.1.lcssa = phi i64 [ %res.0109, %for.body26 ], [ %res.2, %if.end63 ]
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%exitcond124.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count123
br i1 %exitcond124.not, label %for.end69, label %for.body26, !llvm.loop !15
for.body26: ; preds = %for.body26.lr.ph, %for.cond23.loopexit
%indvars.iv120 = phi i64 [ 0, %for.body26.lr.ph ], [ %indvars.iv.next121, %for.cond23.loopexit ]
%indvars.iv112 = phi i64 [ 1, %for.body26.lr.ph ], [ %indvars.iv.next113, %for.cond23.loopexit ]
%res.0109 = phi i64 [ %29, %for.body26.lr.ph ], [ %res.1.lcssa, %for.cond23.loopexit ]
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%cmp29103 = icmp ult i64 %indvars.iv.next121, %30
br i1 %cmp29103, label %for.body31.lr.ph, label %for.cond23.loopexit
for.body31.lr.ph: ; preds = %for.body26
%arrayidx35 = getelementptr inbounds [5000 x i8], ptr %S, i64 0, i64 %indvars.iv120
%31 = load i8, ptr %arrayidx35, align 1, !tbaa !9
%32 = trunc i64 %indvars.iv120 to i32
br label %for.body31
for.body31: ; preds = %for.body31.lr.ph, %if.end63
%indvars.iv114 = phi i64 [ %indvars.iv112, %for.body31.lr.ph ], [ %indvars.iv.next115, %if.end63 ]
%res.1105 = phi i64 [ %res.0109, %for.body31.lr.ph ], [ %res.2, %if.end63 ]
%arrayidx38 = getelementptr inbounds [5000 x i8], ptr %S, i64 0, i64 %indvars.iv114
%33 = load i8, ptr %arrayidx38, align 1, !tbaa !9
%cmp40.not = icmp eq i8 %31, %33
br i1 %cmp40.not, label %if.end63, label %land.lhs.true
land.lhs.true: ; preds = %for.body31
%indvars.iv114.tr = trunc i64 %indvars.iv114 to i32
%34 = shl i32 %indvars.iv114.tr, 1
%sub33 = sub nsw i32 %34, %32
%idxprom45 = sext i32 %sub33 to i64
%arrayidx46 = getelementptr inbounds [5000 x i8], ptr %S, i64 0, i64 %idxprom45
%35 = load i8, ptr %arrayidx46, align 1, !tbaa !9
%cmp48.not = icmp ne i8 %31, %35
%cmp57.not = icmp ne i8 %33, %35
%or.cond.not94 = and i1 %cmp48.not, %cmp57.not
%cmp60 = icmp slt i32 %sub33, %0
%or.cond92 = and i1 %cmp60, %or.cond.not94
%dec = sext i1 %or.cond92 to i64
%spec.select93 = add nsw i64 %res.1105, %dec
br label %if.end63
if.end63: ; preds = %land.lhs.true, %for.body31
%res.2 = phi i64 [ %res.1105, %for.body31 ], [ %spec.select93, %land.lhs.true ]
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%exitcond119.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count118
br i1 %exitcond119.not, label %for.cond23.loopexit, label %for.body31, !llvm.loop !16
for.end69: ; preds = %for.cond23.loopexit, %entry, %for.end
%res.0.lcssa = phi i64 [ %29, %for.end ], [ 0, %entry ], [ %res.1.lcssa, %for.cond23.loopexit ]
%call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %res.0.lcssa)
call void @llvm.lifetime.end.p0(i64 5000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree 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 = !{!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, !13, !12}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t
#define STR_MAX 4000
#define BUF_SIZE (STR_MAX+10)
// size: specify sizeof(str)
int get_str(char *str, int size) {
if(!fgets(str, size, stdin)) return -1;
return 0;
}
int get_int(void) {
int num;
#ifdef BUF_SIZE
char line[BUF_SIZE];
if(!fgets(line, BUF_SIZE, stdin)) return 0;
sscanf(line, "%d", &num);
#else
#error
#endif
return num;
}
enum {
ENUM_RED,
ENUM_GREEN,
ENUM_BLUE,
ENUM_ALL
};
int table[256] = {
['R'] = 1<<ENUM_RED,
['G'] = 1<<ENUM_GREEN,
['B'] = 1<<ENUM_BLUE,
};
#define ALL_TYPE ((1<<ENUM_ALL) - 1)
int main(void) {
int len = get_int(); // length
char str[BUF_SIZE];
get_str(str, BUF_SIZE);
char type[BUF_SIZE] = {0};
int i;
for(i = 0; i < len; i++) {
type[i] = table[str[i]];
}
static uint64_t dp[STR_MAX+1][1<<ENUM_ALL] = {0};
dp[0][0] = 1;
int pat;
for(i = 1; i <= len; i++) {
int tp = type[i-1];
for(pat = 0; pat < (1<<ENUM_ALL); pat++) {
dp[i][pat] = dp[i-1][pat];
if(!(tp & pat)) { continue; }
int prev_tp = pat & (~(tp));
dp[i][pat] += dp[i-1][prev_tp];
#ifdef DEBUG
printf("[%d]: dp[%d][%d -> %d] = %llu\n",tp, i,prev_tp, pat, dp[i][pat]);
#endif
}
}
uint64_t exclude = 0;
int dist;
for(dist = 1; dist < len; dist++) {
for(i = 0; i < len; i++) {
if(i + 2*dist >= len) break;
if((type[i] | type[i+dist] | type[i+dist*2]) == ALL_TYPE) exclude++;
}
}
#ifdef DEBUG
printf("%llu %llu\n", dp[len][ALL_TYPE], exclude);
#endif
printf("%llu\n", dp[len][ALL_TYPE]-exclude);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232109/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232109/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@table = dso_local local_unnamed_addr global <{ [83 x i32], [173 x i32] }> <{ [83 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 4, i32 0, i32 0, i32 0, i32 0, i32 2, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1], [173 x i32] zeroinitializer }>, align 16
@main.dp = internal unnamed_addr global [4001 x [8 x i64]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @get_str(ptr noundef %str, i32 noundef %size) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @fgets(ptr noundef %str, i32 noundef %size, ptr noundef %0)
%tobool.not = icmp eq ptr %call, null
%. = sext i1 %tobool.not to i32
ret i32 %.
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @get_int() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%line = alloca [4010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5
call void @llvm.lifetime.start.p0(i64 4010, ptr nonnull %line) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 4010, ptr noundef %0)
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %cleanup, label %if.end
if.end: ; preds = %entry
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %num) #5
%1 = load i32, ptr %num, align 4, !tbaa !9
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %1, %if.end ], [ 0, %entry ]
call void @llvm.lifetime.end.p0(i64 4010, ptr nonnull %line) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num.i = alloca i32, align 4
%line.i = alloca [4010 x i8], align 16
%str = alloca [4010 x i8], align 16
%type = alloca [4010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #5
call void @llvm.lifetime.start.p0(i64 4010, ptr nonnull %line.i) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call ptr @fgets(ptr noundef nonnull %line.i, i32 noundef 4010, ptr noundef %0)
%tobool.not.i = icmp eq ptr %call.i, null
br i1 %tobool.not.i, label %get_int.exit, label %if.end.i
if.end.i: ; preds = %entry
%call2.i = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line.i, ptr noundef nonnull @.str, ptr noundef nonnull %num.i) #5
%1 = load i32, ptr %num.i, align 4, !tbaa !9
br label %get_int.exit
get_int.exit: ; preds = %entry, %if.end.i
%retval.0.i = phi i32 [ %1, %if.end.i ], [ 0, %entry ]
call void @llvm.lifetime.end.p0(i64 4010, ptr nonnull %line.i) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #5
call void @llvm.lifetime.start.p0(i64 4010, ptr nonnull %str) #5
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i119 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 4010, ptr noundef %2)
call void @llvm.lifetime.start.p0(i64 4010, ptr nonnull %type) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4010) %type, i8 0, i64 4010, i1 false)
%cmp121 = icmp sgt i32 %retval.0.i, 0
br i1 %cmp121, label %for.body.preheader, label %for.end.thread
for.end.thread: ; preds = %get_int.exit
store i64 1, ptr @main.dp, align 16, !tbaa !11
br label %for.end78
for.body.preheader: ; preds = %get_int.exit
%wide.trip.count = zext i32 %retval.0.i to i64
%xtraiter = and i64 %wide.trip.count, 3
%3 = icmp ult i32 %retval.0.i, 4
br i1 %3, label %for.end.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%arrayidx = getelementptr inbounds [4010 x i8], ptr %str, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx, align 4, !tbaa !13
%idxprom2 = sext i8 %4 to i64
%arrayidx3 = getelementptr inbounds [256 x i32], ptr @table, i64 0, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !9
%conv = trunc i32 %5 to i8
%arrayidx5 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %indvars.iv
store i8 %conv, ptr %arrayidx5, align 4, !tbaa !13
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [4010 x i8], ptr %str, i64 0, i64 %indvars.iv.next
%6 = load i8, ptr %arrayidx.1, align 1, !tbaa !13
%idxprom2.1 = sext i8 %6 to i64
%arrayidx3.1 = getelementptr inbounds [256 x i32], ptr @table, i64 0, i64 %idxprom2.1
%7 = load i32, ptr %arrayidx3.1, align 4, !tbaa !9
%conv.1 = trunc i32 %7 to i8
%arrayidx5.1 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %indvars.iv.next
store i8 %conv.1, ptr %arrayidx5.1, align 1, !tbaa !13
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [4010 x i8], ptr %str, i64 0, i64 %indvars.iv.next.1
%8 = load i8, ptr %arrayidx.2, align 2, !tbaa !13
%idxprom2.2 = sext i8 %8 to i64
%arrayidx3.2 = getelementptr inbounds [256 x i32], ptr @table, i64 0, i64 %idxprom2.2
%9 = load i32, ptr %arrayidx3.2, align 4, !tbaa !9
%conv.2 = trunc i32 %9 to i8
%arrayidx5.2 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %indvars.iv.next.1
store i8 %conv.2, ptr %arrayidx5.2, align 2, !tbaa !13
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [4010 x i8], ptr %str, i64 0, i64 %indvars.iv.next.2
%10 = load i8, ptr %arrayidx.3, align 1, !tbaa !13
%idxprom2.3 = sext i8 %10 to i64
%arrayidx3.3 = getelementptr inbounds [256 x i32], ptr @table, i64 0, i64 %idxprom2.3
%11 = load i32, ptr %arrayidx3.3, align 4, !tbaa !9
%conv.3 = trunc i32 %11 to i8
%arrayidx5.3 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %indvars.iv.next.2
store i8 %conv.3, ptr %arrayidx5.3, align 1, !tbaa !13
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.unr-lcssa, label %for.body, !llvm.loop !14
for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %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.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.unr-lcssa ]
%arrayidx.epil = getelementptr inbounds [4010 x i8], ptr %str, i64 0, i64 %indvars.iv.epil
%12 = load i8, ptr %arrayidx.epil, align 1, !tbaa !13
%idxprom2.epil = sext i8 %12 to i64
%arrayidx3.epil = getelementptr inbounds [256 x i32], ptr @table, i64 0, i64 %idxprom2.epil
%13 = load i32, ptr %arrayidx3.epil, align 4, !tbaa !9
%conv.epil = trunc i32 %13 to i8
%arrayidx5.epil = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %indvars.iv.epil
store i8 %conv.epil, ptr %arrayidx5.epil, align 1, !tbaa !13
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !16
for.end: ; preds = %for.body.epil, %for.end.unr-lcssa
store i64 1, ptr @main.dp, align 16, !tbaa !11
%cmp7.not124 = icmp slt i32 %retval.0.i, 1
br i1 %cmp7.not124, label %for.end78, label %for.body9.preheader
for.body9.preheader: ; preds = %for.end
%14 = add nuw i32 %retval.0.i, 1
%wide.trip.count144 = zext i32 %14 to i64
br label %for.inc36
for.cond42.preheader: ; preds = %for.inc36.7
%cmp43130 = icmp sgt i32 %retval.0.i, 1
br i1 %cmp43130, label %for.cond46.preheader.us.preheader, label %for.end78
for.cond46.preheader.us.preheader: ; preds = %for.cond42.preheader
%15 = zext i32 %retval.0.i to i64
%wide.trip.count155 = zext i32 %retval.0.i to i64
%16 = add nsw i64 %wide.trip.count, -2
br label %for.cond46.preheader.us
for.cond46.preheader.us: ; preds = %for.cond46.preheader.us.preheader, %for.inc76.us
%indvar = phi i64 [ 0, %for.cond46.preheader.us.preheader ], [ %indvar.next, %for.inc76.us ]
%indvars.iv151 = phi i64 [ 1, %for.cond46.preheader.us.preheader ], [ %indvars.iv.next152, %for.inc76.us ]
%exclude.0131.us = phi i64 [ 0, %for.cond46.preheader.us.preheader ], [ %exclude.1128.us.lcssa, %for.inc76.us ]
%17 = shl i64 %indvar, 1
%18 = sub i64 %16, %17
%19 = shl nuw nsw i64 %indvars.iv151, 1
%cmp51.not.us160 = icmp ult i64 %19, %15
br i1 %cmp51.not.us160, label %if.end54.us.lr.ph, label %for.inc76.us
if.end54.us.lr.ph: ; preds = %for.cond46.preheader.us
%min.iters.check = icmp ult i64 %18, 4
br i1 %min.iters.check, label %if.end54.us.preheader, label %vector.ph
vector.ph: ; preds = %if.end54.us.lr.ph
%n.vec = and i64 %18, -4
%ind.end = add i64 %19, %n.vec
%20 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %exclude.0131.us, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %20, %vector.ph ], [ %36, %vector.body ]
%vec.phi164 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %37, %vector.body ]
%offset.idx = add i64 %19, %index
%21 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %index
%wide.load = load <2 x i8>, ptr %21, align 4, !tbaa !13
%22 = getelementptr inbounds i8, ptr %21, i64 2
%wide.load165 = load <2 x i8>, ptr %22, align 2, !tbaa !13
%23 = add nuw nsw i64 %index, %indvars.iv151
%24 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %23
%wide.load166 = load <2 x i8>, ptr %24, align 1, !tbaa !13
%25 = getelementptr inbounds i8, ptr %24, i64 2
%wide.load167 = load <2 x i8>, ptr %25, align 1, !tbaa !13
%26 = or <2 x i8> %wide.load166, %wide.load
%27 = or <2 x i8> %wide.load167, %wide.load165
%28 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %offset.idx
%wide.load168 = load <2 x i8>, ptr %28, align 2, !tbaa !13
%29 = getelementptr inbounds i8, ptr %28, i64 2
%wide.load169 = load <2 x i8>, ptr %29, align 2, !tbaa !13
%30 = or <2 x i8> %26, %wide.load168
%31 = or <2 x i8> %27, %wide.load169
%32 = icmp eq <2 x i8> %30, <i8 7, i8 7>
%33 = icmp eq <2 x i8> %31, <i8 7, i8 7>
%34 = zext <2 x i1> %32 to <2 x i64>
%35 = zext <2 x i1> %33 to <2 x i64>
%36 = add <2 x i64> %vec.phi, %34
%37 = add <2 x i64> %vec.phi164, %35
%index.next = add nuw i64 %index, 4
%38 = icmp eq i64 %index.next, %n.vec
br i1 %38, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %37, %36
%39 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %18, %n.vec
br i1 %cmp.n, label %for.inc76.us, label %if.end54.us.preheader
if.end54.us.preheader: ; preds = %if.end54.us.lr.ph, %middle.block
%.ph = phi i64 [ %19, %if.end54.us.lr.ph ], [ %ind.end, %middle.block ]
%exclude.1128.us162.ph = phi i64 [ %exclude.0131.us, %if.end54.us.lr.ph ], [ %39, %middle.block ]
%indvars.iv146161.ph = phi i64 [ 0, %if.end54.us.lr.ph ], [ %n.vec, %middle.block ]
br label %if.end54.us
for.inc76.us: ; preds = %if.end54.us, %middle.block, %for.cond46.preheader.us
%exclude.1128.us.lcssa = phi i64 [ %exclude.0131.us, %for.cond46.preheader.us ], [ %39, %middle.block ], [ %spec.select.us, %if.end54.us ]
%indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
%exitcond156.not = icmp eq i64 %indvars.iv.next152, %wide.trip.count155
%indvar.next = add i64 %indvar, 1
br i1 %exitcond156.not, label %for.end78, label %for.cond46.preheader.us, !llvm.loop !21
if.end54.us: ; preds = %if.end54.us.preheader, %if.end54.us
%40 = phi i64 [ %45, %if.end54.us ], [ %.ph, %if.end54.us.preheader ]
%exclude.1128.us162 = phi i64 [ %spec.select.us, %if.end54.us ], [ %exclude.1128.us162.ph, %if.end54.us.preheader ]
%indvars.iv146161 = phi i64 [ %indvars.iv.next147, %if.end54.us ], [ %indvars.iv146161.ph, %if.end54.us.preheader ]
%arrayidx56.us = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %indvars.iv146161
%41 = load i8, ptr %arrayidx56.us, align 1, !tbaa !13
%42 = add nuw nsw i64 %indvars.iv146161, %indvars.iv151
%arrayidx60.us = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %42
%43 = load i8, ptr %arrayidx60.us, align 1, !tbaa !13
%or117.us = or i8 %43, %41
%arrayidx65.us = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %40
%44 = load i8, ptr %arrayidx65.us, align 1, !tbaa !13
%or67118.us = or i8 %or117.us, %44
%cmp68.us = icmp eq i8 %or67118.us, 7
%inc71.us = zext i1 %cmp68.us to i64
%spec.select.us = add i64 %exclude.1128.us162, %inc71.us
%indvars.iv.next147 = add nuw nsw i64 %indvars.iv146161, 1
%45 = add nuw nsw i64 %indvars.iv.next147, %19
%cmp51.not.us = icmp ult i64 %45, %15
br i1 %cmp51.not.us, label %if.end54.us, label %for.inc76.us, !llvm.loop !22
for.inc36: ; preds = %for.inc36.7, %for.body9.preheader
%indvars.iv140 = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next141, %for.inc36.7 ]
%46 = add nsw i64 %indvars.iv140, -1
%arrayidx11 = getelementptr inbounds [4010 x i8], ptr %type, i64 0, i64 %46
%47 = load i8, ptr %arrayidx11, align 1, !tbaa !13
%conv12157 = zext i8 %47 to i32
%not = xor i32 %conv12157, -1
%arrayidx25 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 0
store i64 1, ptr %arrayidx25, align 16, !tbaa !11
%arrayidx21.1 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 1
%48 = load i64, ptr %arrayidx21.1, align 8, !tbaa !11
%arrayidx25.1 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 1
store i64 %48, ptr %arrayidx25.1, align 8, !tbaa !11
%and.1 = and i32 %conv12157, 1
%tobool.not.1 = icmp eq i32 %and.1, 0
br i1 %tobool.not.1, label %for.inc36.1, label %if.end.1
if.end.1: ; preds = %for.inc36
%and26.1 = and i32 %not, 1
%idxprom30.1 = zext i32 %and26.1 to i64
%arrayidx31.1 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 %idxprom30.1
%49 = load i64, ptr %arrayidx31.1, align 8, !tbaa !11
%add.1 = add i64 %49, %48
store i64 %add.1, ptr %arrayidx25.1, align 8, !tbaa !11
br label %for.inc36.1
for.inc36.1: ; preds = %if.end.1, %for.inc36
%arrayidx21.2 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 2
%50 = load i64, ptr %arrayidx21.2, align 16, !tbaa !11
%arrayidx25.2 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 2
store i64 %50, ptr %arrayidx25.2, align 16, !tbaa !11
%and.2 = and i32 %conv12157, 2
%tobool.not.2 = icmp eq i32 %and.2, 0
br i1 %tobool.not.2, label %for.inc36.2, label %if.end.2
if.end.2: ; preds = %for.inc36.1
%and26.2 = and i32 %not, 2
%idxprom30.2 = zext i32 %and26.2 to i64
%arrayidx31.2 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 %idxprom30.2
%51 = load i64, ptr %arrayidx31.2, align 16, !tbaa !11
%add.2 = add i64 %51, %50
store i64 %add.2, ptr %arrayidx25.2, align 16, !tbaa !11
br label %for.inc36.2
for.inc36.2: ; preds = %if.end.2, %for.inc36.1
%arrayidx21.3 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 3
%52 = load i64, ptr %arrayidx21.3, align 8, !tbaa !11
%arrayidx25.3 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 3
store i64 %52, ptr %arrayidx25.3, align 8, !tbaa !11
%and.3 = and i32 %conv12157, 3
%tobool.not.3 = icmp eq i32 %and.3, 0
br i1 %tobool.not.3, label %for.inc36.3, label %if.end.3
if.end.3: ; preds = %for.inc36.2
%and26.3 = and i32 %not, 3
%idxprom30.3 = zext i32 %and26.3 to i64
%arrayidx31.3 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 %idxprom30.3
%53 = load i64, ptr %arrayidx31.3, align 8, !tbaa !11
%add.3 = add i64 %53, %52
store i64 %add.3, ptr %arrayidx25.3, align 8, !tbaa !11
br label %for.inc36.3
for.inc36.3: ; preds = %if.end.3, %for.inc36.2
%arrayidx21.4 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 4
%54 = load i64, ptr %arrayidx21.4, align 16, !tbaa !11
%arrayidx25.4 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 4
store i64 %54, ptr %arrayidx25.4, align 16, !tbaa !11
%and.4 = and i32 %conv12157, 4
%tobool.not.4 = icmp eq i32 %and.4, 0
br i1 %tobool.not.4, label %for.inc36.4, label %if.end.4
if.end.4: ; preds = %for.inc36.3
%and26.4 = and i32 %not, 4
%idxprom30.4 = zext i32 %and26.4 to i64
%arrayidx31.4 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 %idxprom30.4
%55 = load i64, ptr %arrayidx31.4, align 16, !tbaa !11
%add.4 = add i64 %55, %54
store i64 %add.4, ptr %arrayidx25.4, align 16, !tbaa !11
br label %for.inc36.4
for.inc36.4: ; preds = %if.end.4, %for.inc36.3
%arrayidx21.5 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 5
%56 = load i64, ptr %arrayidx21.5, align 8, !tbaa !11
%arrayidx25.5 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 5
store i64 %56, ptr %arrayidx25.5, align 8, !tbaa !11
%and.5 = and i32 %conv12157, 5
%tobool.not.5 = icmp eq i32 %and.5, 0
br i1 %tobool.not.5, label %for.inc36.5, label %if.end.5
if.end.5: ; preds = %for.inc36.4
%and26.5 = and i32 %not, 5
%idxprom30.5 = zext i32 %and26.5 to i64
%arrayidx31.5 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 %idxprom30.5
%57 = load i64, ptr %arrayidx31.5, align 8, !tbaa !11
%add.5 = add i64 %57, %56
store i64 %add.5, ptr %arrayidx25.5, align 8, !tbaa !11
br label %for.inc36.5
for.inc36.5: ; preds = %if.end.5, %for.inc36.4
%arrayidx21.6 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 6
%58 = load i64, ptr %arrayidx21.6, align 16, !tbaa !11
%arrayidx25.6 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 6
store i64 %58, ptr %arrayidx25.6, align 16, !tbaa !11
%and.6 = and i32 %conv12157, 6
%tobool.not.6 = icmp eq i32 %and.6, 0
br i1 %tobool.not.6, label %for.inc36.6, label %if.end.6
if.end.6: ; preds = %for.inc36.5
%and26.6 = and i32 %not, 6
%idxprom30.6 = zext i32 %and26.6 to i64
%arrayidx31.6 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 %idxprom30.6
%59 = load i64, ptr %arrayidx31.6, align 16, !tbaa !11
%add.6 = add i64 %59, %58
store i64 %add.6, ptr %arrayidx25.6, align 16, !tbaa !11
br label %for.inc36.6
for.inc36.6: ; preds = %if.end.6, %for.inc36.5
%arrayidx21.7 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 7
%60 = load i64, ptr %arrayidx21.7, align 8, !tbaa !11
%arrayidx25.7 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %indvars.iv140, i64 7
store i64 %60, ptr %arrayidx25.7, align 8, !tbaa !11
%and.7 = and i32 %conv12157, 7
%tobool.not.7 = icmp eq i32 %and.7, 0
br i1 %tobool.not.7, label %for.inc36.7, label %if.end.7
if.end.7: ; preds = %for.inc36.6
%and26.7 = and i32 %not, 7
%idxprom30.7 = zext i32 %and26.7 to i64
%arrayidx31.7 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %46, i64 %idxprom30.7
%61 = load i64, ptr %arrayidx31.7, align 8, !tbaa !11
%add.7 = add i64 %61, %60
store i64 %add.7, ptr %arrayidx25.7, align 8, !tbaa !11
br label %for.inc36.7
for.inc36.7: ; preds = %if.end.7, %for.inc36.6
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%exitcond145.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count144
br i1 %exitcond145.not, label %for.cond42.preheader, label %for.inc36, !llvm.loop !23
for.end78: ; preds = %for.inc76.us, %for.end, %for.end.thread, %for.cond42.preheader
%exclude.0.lcssa = phi i64 [ 0, %for.cond42.preheader ], [ 0, %for.end.thread ], [ 0, %for.end ], [ %exclude.1128.us.lcssa, %for.inc76.us ]
%idxprom79 = sext i32 %retval.0.i to i64
%arrayidx81 = getelementptr inbounds [4001 x [8 x i64]], ptr @main.dp, i64 0, i64 %idxprom79, i64 7
%62 = load i64, ptr %arrayidx81, align 8, !tbaa !11
%sub82 = sub i64 %62, %exclude.0.lcssa
%call83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub82)
call void @llvm.lifetime.end.p0(i64 4010, ptr nonnull %type) #5
call void @llvm.lifetime.end.p0(i64 4010, ptr nonnull %str) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !20, !19}
!23 = distinct !{!23, !15}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define min(a,b) (a<b?a:b)
#define max(a,b) (a>b?a:b)
int main()
{
int tn,n;
scanf("%d",&tn);
while(tn--){
scanf("%d",&n);
if(360%(180-n)==0)printf("YES\n");
else printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23216/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23216/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%tn = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tn) #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 %tn)
%0 = load i32, ptr %tn, align 4, !tbaa !5
%dec5 = add nsw i32 %0, -1
store i32 %dec5, ptr %tn, align 4, !tbaa !5
%tobool.not6 = icmp eq i32 %0, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 180, %1
%rem = srem i32 360, %sub
%cmp = icmp eq i32 %rem, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%2 = load i32, ptr %tn, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %tn, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tn) #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 <string.h>
int main(void) {
char s[100001];
scanf("%s", s);
long length = strlen(s);
long left = 0;
long right = length-1;
long insert = 0;
while (left < right) {
if (s[left] == s[right]) {
left++;
right--;
} else if (s[left] == 'x') {
left++;
insert++;
} else if (s[right] == 'x') {
right--;
insert++;
} else {
printf("-1\n");
return 0;
}
}
printf("%ld\n", insert);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232202/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232202/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = 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:
%s = alloca [100001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp42 = icmp sgt i64 %call2, 1
br i1 %cmp42, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %entry
%sub = add nsw i64 %call2, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end25
%insert.045 = phi i64 [ %insert.1, %if.end25 ], [ 0, %while.body.preheader ]
%right.044 = phi i64 [ %right.1, %if.end25 ], [ %sub, %while.body.preheader ]
%left.043 = phi i64 [ %left.1, %if.end25 ], [ 0, %while.body.preheader ]
%arrayidx = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %left.043
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx3 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %right.044
%1 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%cmp5 = icmp eq i8 %0, %1
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %while.body
%inc = add nsw i64 %left.043, 1
%dec = add nsw i64 %right.044, -1
br label %if.end25
if.else: ; preds = %while.body
%cmp9 = icmp eq i8 %0, 120
br i1 %cmp9, label %if.then11, label %if.else14
if.then11: ; preds = %if.else
%inc12 = add nsw i64 %left.043, 1
%inc13 = add nsw i64 %insert.045, 1
br label %if.end25
if.else14: ; preds = %if.else
%cmp17 = icmp eq i8 %1, 120
br i1 %cmp17, label %if.then19, label %if.else22
if.then19: ; preds = %if.else14
%dec20 = add nsw i64 %right.044, -1
%inc21 = add nsw i64 %insert.045, 1
br label %if.end25
if.else22: ; preds = %if.else14
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
if.end25: ; preds = %if.then11, %if.then19, %if.then
%left.1 = phi i64 [ %inc, %if.then ], [ %inc12, %if.then11 ], [ %left.043, %if.then19 ]
%right.1 = phi i64 [ %dec, %if.then ], [ %right.044, %if.then11 ], [ %dec20, %if.then19 ]
%insert.1 = phi i64 [ %insert.045, %if.then ], [ %inc13, %if.then11 ], [ %inc21, %if.then19 ]
%cmp = icmp slt i64 %left.1, %right.1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !8
while.end: ; preds = %if.end25, %entry
%insert.0.lcssa = phi i64 [ 0, %entry ], [ %insert.1, %if.end25 ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %insert.0.lcssa)
br label %cleanup
cleanup: ; preds = %while.end, %if.else22
call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 100
int main(void){
int n,m,i,j,z,A[N],B[N],C[1000],tmp,max=0,min=40,cnt=0;
char s[N],str[N],*line;
for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
line=strtok(str," ,");
sscanf(line,"%d",&m);
line=strtok(NULL," ,");
sscanf(line,"%d",&n);
if(m==0 && n==0)
break;
A[m]=n;
B[m]=n;
if(m>max)
max=m;
if(min>m)
min=m;
cnt++;
}
for(i=min;i<=max;i++){
for(j=max;j>i;j--){
if(B[j] > B[j-1]){
tmp = B[j-1];
B[j-1] = B[j];
B[j] = tmp;
}
}
}
j=0; B[cnt+1]=40;
for(i=min;i<=cnt;i++){
if(B[i]!=B[i+1])
C[B[i]]=j++;
else
C[B[i]]=j;
}
for( ;fgets(s,sizeof(str),stdin)!=NULL; ){
sscanf(s,"%d",&z);
printf("%d\n",C[A[z]]+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232253/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232253/source.c"
target datalayout = "e-m:e-p270: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" ,\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
%m = alloca i32, align 4
%z = alloca i32, align 4
%A = alloca [100 x i32], align 16
%B = alloca [100 x i32], align 16
%C = alloca [1000 x i32], align 16
%s = alloca [100 x i8], align 16
%str = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %C) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call110 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %0)
%cmp.not111 = icmp eq ptr %call110, null
br i1 %cmp.not111, label %for.cond68.preheader, label %for.body
for.body: ; preds = %entry, %if.end
%cnt.0114 = phi i32 [ %inc, %if.end ], [ 0, %entry ]
%min.0113 = phi i32 [ %min.1, %if.end ], [ 40, %entry ]
%max.0112 = phi i32 [ %spec.select, %if.end ], [ 0, %entry ]
%call2 = call ptr @strtok(ptr noundef nonnull %str, ptr noundef nonnull @.str) #5
%call3 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call2, ptr noundef nonnull @.str.1, ptr noundef nonnull %m) #5
%call4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #5
%call5 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %call4, ptr noundef nonnull @.str.1, ptr noundef nonnull %n) #5
%1 = load i32, ptr %m, align 4, !tbaa !9
%cmp6 = icmp eq i32 %1, 0
%2 = load i32, ptr %n, align 4
%cmp7 = icmp eq i32 %2, 0
%or.cond = select i1 %cmp6, i1 %cmp7, i1 false
br i1 %or.cond, label %for.end, label %if.end
if.end: ; preds = %for.body
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom
store i32 %2, ptr %arrayidx, align 4, !tbaa !9
%arrayidx9 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %idxprom
store i32 %2, ptr %arrayidx9, align 4, !tbaa !9
%spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.0112)
%min.1 = call i32 @llvm.smin.i32(i32 %min.0113, i32 %1)
%inc = add nuw nsw i32 %cnt.0114, 1
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %3)
%cmp.not = icmp eq ptr %call, null
br i1 %cmp.not, label %for.cond19.preheader.preheader, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body
%cmp17.not122 = icmp sgt i32 %min.0113, %max.0112
br i1 %cmp17.not122, label %for.end42, label %for.cond19.preheader.preheader
for.cond19.preheader.preheader: ; preds = %if.end, %for.end
%cnt.0.lcssa152 = phi i32 [ %cnt.0114, %for.end ], [ %inc, %if.end ]
%min.0.lcssa151 = phi i32 [ %min.0113, %for.end ], [ %min.1, %if.end ]
%max.0.lcssa150 = phi i32 [ %max.0112, %for.end ], [ %spec.select, %if.end ]
%4 = zext i32 %max.0.lcssa150 to i64
%5 = sext i32 %min.0.lcssa151 to i64
%6 = add nuw i32 %max.0.lcssa150, 1
%arrayidx23.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %4
br label %for.cond19.preheader
for.cond19.preheader: ; preds = %for.cond19.preheader.preheader, %for.inc40
%indvars.iv130 = phi i64 [ %5, %for.cond19.preheader.preheader ], [ %indvars.iv.next131, %for.inc40 ]
%cmp20120 = icmp slt i64 %indvars.iv130, %4
br i1 %cmp20120, label %for.body21.preheader, label %for.inc40
for.body21.preheader: ; preds = %for.cond19.preheader
%.pre = load i32, ptr %arrayidx23.phi.trans.insert, align 4, !tbaa !9
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.inc
%7 = phi i32 [ %.pre, %for.body21.preheader ], [ %9, %for.inc ]
%indvars.iv = phi i64 [ %4, %for.body21.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx25 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv.next
%8 = load i32, ptr %arrayidx25, align 4, !tbaa !9
%cmp26 = icmp sgt i32 %7, %8
br i1 %cmp26, label %if.then27, label %for.inc
if.then27: ; preds = %for.body21
%arrayidx23 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv
store i32 %7, ptr %arrayidx25, align 4, !tbaa !9
store i32 %8, ptr %arrayidx23, align 4, !tbaa !9
br label %for.inc
for.inc: ; preds = %for.body21, %if.then27
%9 = phi i32 [ %8, %for.body21 ], [ %7, %if.then27 ]
%cmp20 = icmp sgt i64 %indvars.iv.next, %indvars.iv130
br i1 %cmp20, label %for.body21, label %for.inc40, !llvm.loop !13
for.inc40: ; preds = %for.inc, %for.cond19.preheader
%indvars.iv.next131 = add nsw i64 %indvars.iv130, 1
%lftr.wideiv = trunc i64 %indvars.iv.next131 to i32
%exitcond.not = icmp eq i32 %6, %lftr.wideiv
br i1 %exitcond.not, label %for.end42, label %for.cond19.preheader, !llvm.loop !14
for.end42: ; preds = %for.inc40, %for.end
%cnt.0.lcssa144 = phi i32 [ %cnt.0114, %for.end ], [ %cnt.0.lcssa152, %for.inc40 ]
%min.0.lcssa143 = phi i32 [ %min.0113, %for.end ], [ %min.0.lcssa151, %for.inc40 ]
%add = add i32 %cnt.0.lcssa144, 1
%idxprom43 = zext i32 %add to i64
%arrayidx44 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %idxprom43
store i32 40, ptr %arrayidx44, align 4, !tbaa !9
%cmp46.not124 = icmp sgt i32 %min.0.lcssa143, %cnt.0.lcssa144
br i1 %cmp46.not124, label %for.cond68.preheader, label %for.body47.preheader
for.body47.preheader: ; preds = %for.end42
%10 = sext i32 %min.0.lcssa143 to i64
%arrayidx49.phi.trans.insert = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %10
%.pre138 = load i32, ptr %arrayidx49.phi.trans.insert, align 4, !tbaa !9
%11 = add i32 %cnt.0.lcssa144, 1
%12 = sub i32 %11, %min.0.lcssa143
%xtraiter = and i32 %12, 1
%13 = icmp eq i32 %cnt.0.lcssa144, %min.0.lcssa143
br i1 %13, label %for.cond68.preheader.loopexit.unr-lcssa, label %for.body47.preheader.new
for.body47.preheader.new: ; preds = %for.body47.preheader
%unroll_iter = and i32 %12, -2
br label %for.body47
for.cond68.preheader.loopexit.unr-lcssa: ; preds = %for.body47, %for.body47.preheader
%.unr = phi i32 [ %.pre138, %for.body47.preheader ], [ %17, %for.body47 ]
%j.1125.unr = phi i32 [ 0, %for.body47.preheader ], [ %j.2.1, %for.body47 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond68.preheader, label %for.body47.epil
for.body47.epil: ; preds = %for.cond68.preheader.loopexit.unr-lcssa
%idxprom58.epil = sext i32 %.unr to i64
%arrayidx59.epil = getelementptr inbounds [1000 x i32], ptr %C, i64 0, i64 %idxprom58.epil
store i32 %j.1125.unr, ptr %arrayidx59.epil, align 4, !tbaa !9
br label %for.cond68.preheader
for.cond68.preheader: ; preds = %for.body47.epil, %for.cond68.preheader.loopexit.unr-lcssa, %entry, %for.end42
%14 = load ptr, ptr @stdin, align 8, !tbaa !5
%call70127 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 100, ptr noundef %14)
%cmp71.not128 = icmp eq ptr %call70127, null
br i1 %cmp71.not128, label %for.end81, label %for.body72
for.body47: ; preds = %for.body47, %for.body47.preheader.new
%15 = phi i32 [ %.pre138, %for.body47.preheader.new ], [ %17, %for.body47 ]
%indvars.iv133 = phi i64 [ %10, %for.body47.preheader.new ], [ %indvars.iv.next134.1, %for.body47 ]
%j.1125 = phi i32 [ 0, %for.body47.preheader.new ], [ %j.2.1, %for.body47 ]
%niter = phi i32 [ 0, %for.body47.preheader.new ], [ %niter.next.1, %for.body47 ]
%indvars.iv.next134 = add nsw i64 %indvars.iv133, 1
%arrayidx52 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv.next134
%16 = load i32, ptr %arrayidx52, align 4, !tbaa !9
%cmp53.not = icmp ne i32 %15, %16
%inc55 = zext i1 %cmp53.not to i32
%j.2 = add nuw nsw i32 %j.1125, %inc55
%idxprom58 = sext i32 %15 to i64
%arrayidx59 = getelementptr inbounds [1000 x i32], ptr %C, i64 0, i64 %idxprom58
store i32 %j.1125, ptr %arrayidx59, align 4, !tbaa !9
%indvars.iv.next134.1 = add nsw i64 %indvars.iv133, 2
%arrayidx52.1 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv.next134.1
%17 = load i32, ptr %arrayidx52.1, align 4, !tbaa !9
%cmp53.not.1 = icmp ne i32 %16, %17
%inc55.1 = zext i1 %cmp53.not.1 to i32
%j.2.1 = add nuw nsw i32 %j.2, %inc55.1
%idxprom58.1 = sext i32 %16 to i64
%arrayidx59.1 = getelementptr inbounds [1000 x i32], ptr %C, i64 0, i64 %idxprom58.1
store i32 %j.2, ptr %arrayidx59.1, align 4, !tbaa !9
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond68.preheader.loopexit.unr-lcssa, label %for.body47, !llvm.loop !15
for.body72: ; preds = %for.cond68.preheader, %for.body72
%call74 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %s, ptr noundef nonnull @.str.1, ptr noundef nonnull %z) #5
%18 = load i32, ptr %z, align 4, !tbaa !9
%idxprom75 = sext i32 %18 to i64
%arrayidx76 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom75
%19 = load i32, ptr %arrayidx76, align 4, !tbaa !9
%idxprom77 = sext i32 %19 to i64
%arrayidx78 = getelementptr inbounds [1000 x i32], ptr %C, i64 0, i64 %idxprom77
%20 = load i32, ptr %arrayidx78, align 4, !tbaa !9
%add79 = add nsw i32 %20, 1
%call80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add79)
%21 = load ptr, ptr @stdin, align 8, !tbaa !5
%call70 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 100, ptr noundef %21)
%cmp71.not = icmp eq ptr %call70, null
br i1 %cmp71.not, label %for.end81, label %for.body72, !llvm.loop !16
for.end81: ; preds = %for.body72, %for.cond68.preheader
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #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 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 @__isoc99_sscanf(ptr nocapture noundef readonly, 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) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
|
#include <stdio.h>
#define Mod 1000000007
int main()
{
int i, N, x[100001];
scanf("%d", &N);
for (i = 1, x[0] = -1; i <= N; i++) {
scanf("%d", &(x[i]));
if (x[i] > x[i-1] + 2) x[i] = x[i-1] + 2;
}
int k;
long long ans = 1;
for (i = 1; i < N && x[i] == x[i-1] + 2; i++);
for (k = 0; k < N; k++) {
ans = ans * (i - k) % Mod;
if (i < N) {
for (x[i] = x[i-1], i++; i < N && x[i] >= x[i-1] + 2; i++) x[i] = x[i-1] + 2;
}
}
printf("%lld\n", ans);
fflush(stdout);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232310/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232310/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%x = alloca [100001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
store i32 -1, ptr %x, align 16, !tbaa !5
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not93 = icmp slt i32 %0, 1
br i1 %cmp.not93, label %for.end66, label %for.body
for.cond14.preheader: ; preds = %for.inc
%cmp1595 = icmp sgt i32 %4, 1
br i1 %cmp1595, label %land.rhs.preheader, label %for.end26
land.rhs.preheader: ; preds = %for.cond14.preheader
%wide.trip.count = zext i32 %4 to i64
%.pre = load i32, ptr %x, align 16, !tbaa !5
br label %land.rhs
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%arrayidx1 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1)
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%2 = add nsw i64 %indvars.iv, -1
%arrayidx6 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %2
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %3, 2
%cmp7 = icmp sgt i32 %1, %add
br i1 %cmp7, label %if.then, label %for.inc
if.then: ; preds = %for.body
store i32 %add, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%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.not.not = icmp slt i64 %indvars.iv, %5
br i1 %cmp.not.not, label %for.body, label %for.cond14.preheader, !llvm.loop !9
land.rhs: ; preds = %land.rhs.preheader, %for.inc24
%6 = phi i32 [ %.pre, %land.rhs.preheader ], [ %7, %for.inc24 ]
%indvars.iv113 = phi i64 [ 1, %land.rhs.preheader ], [ %indvars.iv.next114, %for.inc24 ]
%arrayidx17 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %indvars.iv113
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%add21 = add nsw i32 %6, 2
%cmp22 = icmp eq i32 %7, %add21
br i1 %cmp22, label %for.inc24, label %for.end26.loopexit.split.loop.exit127
for.inc24: ; preds = %land.rhs
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%exitcond.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count
br i1 %exitcond.not, label %for.end26, label %land.rhs, !llvm.loop !11
for.end26.loopexit.split.loop.exit127: ; preds = %land.rhs
%8 = trunc i64 %indvars.iv113 to i32
br label %for.end26
for.end26: ; preds = %for.inc24, %for.end26.loopexit.split.loop.exit127, %for.cond14.preheader
%i.1.lcssa = phi i32 [ 1, %for.cond14.preheader ], [ %8, %for.end26.loopexit.split.loop.exit127 ], [ %4, %for.inc24 ]
%cmp28105 = icmp sgt i32 %4, 0
br i1 %cmp28105, label %for.body29.preheader, label %for.end66
for.body29.preheader: ; preds = %for.end26
%9 = zext i32 %4 to i64
br label %for.body29
for.body29: ; preds = %for.body29.preheader, %for.inc64
%ans.0108 = phi i64 [ %rem, %for.inc64 ], [ 1, %for.body29.preheader ]
%k.0107 = phi i32 [ %inc65, %for.inc64 ], [ 0, %for.body29.preheader ]
%i.2106 = phi i32 [ %i.4, %for.inc64 ], [ %i.1.lcssa, %for.body29.preheader ]
%sub30 = sub nsw i32 %i.2106, %k.0107
%conv = sext i32 %sub30 to i64
%mul = mul nsw i64 %ans.0108, %conv
%rem = srem i64 %mul, 1000000007
%cmp31 = icmp slt i32 %i.2106, %4
br i1 %cmp31, label %if.then33, label %for.inc64
if.then33: ; preds = %for.body29
%sub34 = add nsw i32 %i.2106, -1
%idxprom35 = sext i32 %sub34 to i64
%arrayidx36 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %idxprom35
%10 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%idxprom37 = sext i32 %i.2106 to i64
%arrayidx38 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %idxprom37
store i32 %10, ptr %arrayidx38, align 4, !tbaa !5
%i.399 = add nsw i32 %i.2106, 1
%cmp41100 = icmp slt i32 %i.399, %4
br i1 %cmp41100, label %land.rhs43.preheader, label %for.inc64
land.rhs43.preheader: ; preds = %if.then33
%11 = add nsw i64 %idxprom37, 1
br label %land.rhs43
land.rhs43: ; preds = %land.rhs43.preheader, %for.body53
%indvars.iv117 = phi i64 [ %11, %land.rhs43.preheader ], [ %indvars.iv.next118, %for.body53 ]
%i.3.in101 = phi i32 [ %i.2106, %land.rhs43.preheader ], [ %14, %for.body53 ]
%arrayidx45 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %indvars.iv117
%12 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%idxprom47 = sext i32 %i.3.in101 to i64
%arrayidx48 = getelementptr inbounds [100001 x i32], ptr %x, i64 0, i64 %idxprom47
%13 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%add49 = add nsw i32 %13, 2
%cmp50.not = icmp slt i32 %12, %add49
%14 = trunc i64 %indvars.iv117 to i32
br i1 %cmp50.not, label %for.inc64, label %for.body53
for.body53: ; preds = %land.rhs43
store i32 %add49, ptr %arrayidx45, align 4, !tbaa !5
%indvars.iv.next118 = add nsw i64 %indvars.iv117, 1
%cmp41 = icmp slt i64 %indvars.iv.next118, %9
br i1 %cmp41, label %land.rhs43, label %for.inc64, !llvm.loop !12
for.inc64: ; preds = %land.rhs43, %for.body53, %if.then33, %for.body29
%i.4 = phi i32 [ %i.2106, %for.body29 ], [ %i.399, %if.then33 ], [ %14, %land.rhs43 ], [ %4, %for.body53 ]
%inc65 = add nuw nsw i32 %k.0107, 1
%exitcond120.not = icmp eq i32 %inc65, %4
br i1 %exitcond120.not, label %for.end66, label %for.body29, !llvm.loop !13
for.end66: ; preds = %for.inc64, %entry, %for.end26
%ans.0.lcssa = phi i64 [ 1, %for.end26 ], [ 1, %entry ], [ %rem, %for.inc64 ]
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
%15 = load ptr, ptr @stdout, align 8, !tbaa !14
%call68 = call i32 @fflush(ptr noundef %15)
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %x) #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: nofree nounwind
declare noundef i32 @fflush(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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
|
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
void showDanish (void);
int main(int argc, char const *argv[])
{
//initialise
int t = 0;
int k = 0;
scanf("%d %d\n", &k, &t);
int A[t];
for(int i = 0; i<t; i++){
scanf("%d", &A[i]);
}
int max = A[0];
for (int c = 1; c < t; c++) {
if (A[c] > max){
max = A[c];
}
}
int diff = 0;
int min = 0;
if(k%2 != 0){ //odd
if(max < (k+1)/2){
printf("0\n");
return 0;
}
diff = max - (k+1)/2;
min = 2*diff;
} else {
if(max < (k/2 + 1)){
printf("0\n");
return 0;
}
diff = max - k/2;
min = 2*diff-1;
}
printf("%d\n", min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232354/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232354/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"0\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:
%t = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
store i32 0, ptr %t, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
store i32 0, ptr %k, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %t, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %3, 0
br i1 %cmp51, label %for.body, label %for.cond.cleanup5
for.cond.cleanup: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%cmp453 = icmp sgt i32 %11, 1
br i1 %cmp453, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %11 to i64
%4 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %11, 9
br i1 %min.iters.check, label %for.body6.preheader66, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %4, -8
%ind.end = or i64 %n.vec, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %7, %vector.body ]
%vec.phi64 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %8, %vector.body ]
%offset.idx = or i64 %index, 1
%5 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load65 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
%8 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load65, <4 x i32> %vec.phi64)
%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
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %7, <4 x i32> %8)
%10 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.cond.cleanup5, label %for.body6.preheader66
for.body6.preheader66: ; preds = %for.body6.preheader, %middle.block
%indvars.iv59.ph = phi i64 [ 1, %for.body6.preheader ], [ %ind.end, %middle.block ]
%max.054.ph = phi i32 [ %.pre, %for.body6.preheader ], [ %10, %middle.block ]
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds 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 %t, 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.cond.cleanup, !llvm.loop !13
for.cond.cleanup5: ; preds = %for.body6, %middle.block, %entry, %for.cond.cleanup
%max.0.lcssa = phi i32 [ %.pre, %for.cond.cleanup ], [ undef, %entry ], [ %10, %middle.block ], [ %spec.select, %for.body6 ]
%13 = load i32, ptr %k, align 4, !tbaa !5
%14 = and i32 %13, 1
%cmp15.not = icmp eq i32 %14, 0
br i1 %cmp15.not, label %if.else, label %if.then16
for.body6: ; preds = %for.body6.preheader66, %for.body6
%indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.body6 ], [ %indvars.iv59.ph, %for.body6.preheader66 ]
%max.054 = phi i32 [ %spec.select, %for.body6 ], [ %max.054.ph, %for.body6.preheader66 ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59
%15 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %15, i32 %max.054)
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !14
if.then16: ; preds = %for.cond.cleanup5
%add = add nsw i32 %13, 1
%div = sdiv i32 %add, 2
%cmp17 = icmp slt i32 %max.0.lcssa, %div
br i1 %cmp17, label %if.then18, label %if.end20
if.then18: ; preds = %if.then16
%puts50 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup
if.end20: ; preds = %if.then16
%sub = sub nsw i32 %max.0.lcssa, %div
%mul = shl nsw i32 %sub, 1
br label %if.end33
if.else: ; preds = %for.cond.cleanup5
%div23 = sdiv i32 %13, 2
%cmp25.not = icmp sgt i32 %max.0.lcssa, %div23
br i1 %cmp25.not, label %if.end28, label %if.then26
if.then26: ; preds = %if.else
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %cleanup
if.end28: ; preds = %if.else
%sub30 = sub nsw i32 %max.0.lcssa, %div23
%mul31 = shl nsw i32 %sub30, 1
%sub32 = add nsw i32 %mul31, -1
br label %if.end33
if.end33: ; preds = %if.end28, %if.end20
%min.0 = phi i32 [ %mul, %if.end20 ], [ %sub32, %if.end28 ]
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %min.0)
br label %cleanup
cleanup: ; preds = %if.end33, %if.then26, %if.then18
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007
typedef long long int lli;
int main(void) {
int n, q;
scanf("%d %d", &n, &q);
char s[MAX];
scanf("%s", s);
int dp[MAX]; // dp[i]: 先頭からi文字目までのAC数
dp[0] = 0;
rep(i, 1, n) {
if ( s[i - 1] == 'A' && s[i] == 'C' ) {
dp[i] += dp[i - 1] + 1;
} else {
dp[i] = dp[i - 1];
}
}
int l, r;
rep(i, 0, q) {
scanf("%d %d", &l, &r);
int ans = dp[r - 1] - dp[l - 1];
printf("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232398/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232398/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !9
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !10
%1 = load ptr, ptr %b, align 8, !tbaa !10
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #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 #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%s = alloca [100001 x i8], align 16
%dp = alloca [100001 x i32], align 16
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q)
call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #7
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %dp) #7
store i32 0, ptr %dp, align 16, !tbaa !5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp47 = icmp sgt i32 %0, 1
br i1 %cmp47, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #7
%1 = load i32, ptr %q, align 4, !tbaa !5
%cmp2349 = icmp sgt i32 %1, 0
br i1 %cmp2349, label %for.body26, label %for.cond.cleanup25
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%2 = add nsw i64 %indvars.iv, -1
%arrayidx2 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %2
%3 = load i8, ptr %arrayidx2, align 1, !tbaa !9
%cmp3 = icmp eq i8 %3, 65
br i1 %cmp3, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %for.body
%arrayidx6 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp8 = icmp eq i8 %4, 67
br i1 %cmp8, label %if.then, label %if.else
if.then: ; preds = %land.lhs.true
%arrayidx12 = getelementptr inbounds [100001 x i32], ptr %dp, i64 0, i64 %2
%5 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%add = add nsw i32 %5, 1
%arrayidx14 = getelementptr inbounds [100001 x i32], ptr %dp, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%add15 = add nsw i32 %add, %6
store i32 %add15, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %land.lhs.true, %for.body
%arrayidx18 = getelementptr inbounds [100001 x i32], ptr %dp, i64 0, i64 %2
%7 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%arrayidx20 = getelementptr inbounds [100001 x i32], ptr %dp, i64 0, i64 %indvars.iv
store i32 %7, ptr %arrayidx20, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12
for.cond.cleanup25: ; preds = %for.body26, %for.cond.cleanup
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %dp) #7
call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
for.body26: ; preds = %for.cond.cleanup, %for.body26
%i21.050 = phi i32 [ %inc37, %for.body26 ], [ 0, %for.cond.cleanup ]
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%8 = load i32, ptr %r, align 4, !tbaa !5
%sub28 = add nsw i32 %8, -1
%idxprom29 = sext i32 %sub28 to i64
%arrayidx30 = getelementptr inbounds [100001 x i32], ptr %dp, i64 0, i64 %idxprom29
%9 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%10 = load i32, ptr %l, align 4, !tbaa !5
%sub31 = add nsw i32 %10, -1
%idxprom32 = sext i32 %sub31 to i64
%arrayidx33 = getelementptr inbounds [100001 x i32], ptr %dp, i64 0, i64 %idxprom32
%11 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%sub34 = sub nsw i32 %9, %11
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub34)
%inc37 = add nuw nsw i32 %i21.050, 1
%12 = load i32, ptr %q, align 4, !tbaa !5
%cmp23 = icmp slt i32 %inc37, %12
br i1 %cmp23, label %for.body26, label %for.cond.cleanup25, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
|
#include <stdio.h>
#include <string.h>
int main(int argc, char const *argv[]) {
int n, q, k=0;
scanf("%d %d\n", &n, &q);
char str[n+1];
scanf("%s\n", str);
int mem[n];
mem[0] = 0;
for (int i = 1; i < n; i++) {
if(str[i] == 'C' && str[i-1] == 'A') k++;
mem[i] = k;
}
for (int i = 0; i < q; i++) {
int l, r;
scanf("%d %d\n", &l, &r);
// debug
// printf("debug: %d %d\n", mem[l-1], mem[r-1]);
printf("%d\n", mem[r-1]-mem[l-1]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232440/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232440/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%s\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%l = alloca i32, align 4
%r = 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 %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla2 = alloca i32, i64 %4, align 16
store i32 0, ptr %vla2, align 16, !tbaa !5
%cmp38 = icmp sgt i32 %3, 1
br i1 %cmp38, label %for.body.preheader, label %for.cond15.preheader
for.body.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %vla, i64 -1
%5 = add nsw i64 %4, -1
%xtraiter = and i64 %5, 1
%6 = icmp eq i32 %3, 2
br i1 %6, label %for.cond15.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %5, -2
br label %for.body
for.cond15.preheader.loopexit.unr-lcssa: ; preds = %if.end.1, %for.body.preheader
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %if.end.1 ]
%k.039.unr = phi i32 [ 0, %for.body.preheader ], [ %k.1.1, %if.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond15.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond15.preheader.loopexit.unr-lcssa
%arrayidx3.epil = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.unr
%7 = load i8, ptr %arrayidx3.epil, align 1, !tbaa !9
%cmp4.epil = icmp eq i8 %7, 67
br i1 %cmp4.epil, label %land.lhs.true.epil, label %if.end.epil
land.lhs.true.epil: ; preds = %for.body.epil
%gep.epil = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.unr
%8 = load i8, ptr %gep.epil, align 1, !tbaa !9
%cmp9.epil = icmp eq i8 %8, 65
%inc.epil = zext i1 %cmp9.epil to i32
%spec.select.epil = add nsw i32 %k.039.unr, %inc.epil
br label %if.end.epil
if.end.epil: ; preds = %land.lhs.true.epil, %for.body.epil
%k.1.epil = phi i32 [ %k.039.unr, %for.body.epil ], [ %spec.select.epil, %land.lhs.true.epil ]
%arrayidx12.epil = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.unr
store i32 %k.1.epil, ptr %arrayidx12.epil, align 4, !tbaa !5
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %if.end.epil, %for.cond15.preheader.loopexit.unr-lcssa, %entry
%9 = load i32, ptr %q, align 4, !tbaa !5
%cmp1641 = icmp sgt i32 %9, 0
br i1 %cmp1641, label %for.body19, label %for.cond.cleanup18
for.body: ; preds = %if.end.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %if.end.1 ]
%k.039 = phi i32 [ 0, %for.body.preheader.new ], [ %k.1.1, %if.end.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %if.end.1 ]
%arrayidx3 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%10 = load i8, ptr %arrayidx3, align 1, !tbaa !9
%cmp4 = icmp eq i8 %10, 67
br i1 %cmp4, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.body
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
%11 = load i8, ptr %gep, align 1, !tbaa !9
%cmp9 = icmp eq i8 %11, 65
%inc = zext i1 %cmp9 to i32
%spec.select = add nsw i32 %k.039, %inc
br label %if.end
if.end: ; preds = %land.lhs.true, %for.body
%k.1 = phi i32 [ %k.039, %for.body ], [ %spec.select, %land.lhs.true ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv
store i32 %k.1, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx3.1 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.next
%12 = load i8, ptr %arrayidx3.1, align 1, !tbaa !9
%cmp4.1 = icmp eq i8 %12, 67
br i1 %cmp4.1, label %land.lhs.true.1, label %if.end.1
land.lhs.true.1: ; preds = %if.end
%gep.1 = getelementptr i8, ptr %vla, i64 %indvars.iv
%13 = load i8, ptr %gep.1, align 1, !tbaa !9
%cmp9.1 = icmp eq i8 %13, 65
%inc.1 = zext i1 %cmp9.1 to i32
%spec.select.1 = add nsw i32 %k.1, %inc.1
br label %if.end.1
if.end.1: ; preds = %land.lhs.true.1, %if.end
%k.1.1 = phi i32 [ %k.1, %if.end ], [ %spec.select.1, %land.lhs.true.1 ]
%arrayidx12.1 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next
store i32 %k.1.1, ptr %arrayidx12.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond15.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !10
for.cond.cleanup18: ; preds = %for.body19, %for.cond15.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body19: ; preds = %for.cond15.preheader, %for.body19
%i14.042 = phi i32 [ %inc30, %for.body19 ], [ 0, %for.cond15.preheader ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%14 = load i32, ptr %r, align 4, !tbaa !5
%sub21 = add nsw i32 %14, -1
%idxprom22 = sext i32 %sub21 to i64
%arrayidx23 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom22
%15 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%16 = load i32, ptr %l, align 4, !tbaa !5
%sub24 = add nsw i32 %16, -1
%idxprom25 = sext i32 %sub24 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom25
%17 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%sub27 = sub nsw i32 %15, %17
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub27)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
%inc30 = add nuw nsw i32 %i14.042, 1
%18 = load i32, ptr %q, align 4, !tbaa !5
%cmp16 = icmp slt i32 %inc30, %18
br i1 %cmp16, label %for.body19, label %for.cond.cleanup18, !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 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main(void) {
int n, q;
char s[100001];
scanf("%d%d%s", &n, &q, s);
int c[100001] = {0};
for (int i = 1; i < n; i++) {
c[i] = c[i-1];
if (s[i-1] == 'A' && s[i] == 'C') c[i]++;
}
while (q--) {
int l, r;
scanf("%d%d", &l, &r);
l--; r--;
printf("%d\n", c[r]-c[l]);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232484/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232484/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\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
%q = alloca i32, align 4
%s = alloca [100001 x i8], align 16
%c = alloca [100001 x i32], align 16
%l = alloca i32, align 4
%r = 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 %q) #4
call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q, ptr noundef nonnull %s)
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %c) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %c, i8 0, i64 400004, i1 false)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 1
br i1 %cmp31, label %for.body.preheader, label %while.cond.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
while.cond.preheader: ; preds = %for.inc, %entry
%1 = load i32, ptr %q, align 4, !tbaa !5
%dec33 = add nsw i32 %1, -1
store i32 %dec33, ptr %q, align 4, !tbaa !5
%tobool.not34 = icmp eq i32 %1, 0
br i1 %tobool.not34, label %while.end, label %while.body
for.body: ; preds = %for.body.preheader, %for.inc
%2 = phi i32 [ 0, %for.body.preheader ], [ %6, %for.inc ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%3 = add nsw i64 %indvars.iv, -1
%arrayidx2 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %indvars.iv
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %3
%4 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp6 = icmp eq i8 %4, 65
br i1 %cmp6, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%arrayidx9 = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx9, align 1, !tbaa !9
%cmp11 = icmp eq i8 %5, 67
br i1 %cmp11, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %if.then
%6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %inc, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.cond.preheader, label %for.body, !llvm.loop !10
while.body: ; preds = %while.cond.preheader, %while.body
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r)
%7 = load i32, ptr %l, align 4, !tbaa !5
%dec17 = add nsw i32 %7, -1
store i32 %dec17, ptr %l, align 4, !tbaa !5
%8 = load i32, ptr %r, align 4, !tbaa !5
%dec18 = add nsw i32 %8, -1
store i32 %dec18, ptr %r, align 4, !tbaa !5
%idxprom19 = sext i32 %dec18 to i64
%arrayidx20 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %idxprom19
%9 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%idxprom21 = sext i32 %dec17 to i64
%arrayidx22 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %idxprom21
%10 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%sub23 = sub nsw i32 %9, %10
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub23)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
%11 = load i32, ptr %q, align 4, !tbaa !5
%dec = add nsw i32 %11, -1
store i32 %dec, ptr %q, align 4, !tbaa !5
%tobool.not = icmp eq i32 %11, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %while.body, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
int i, j;
int n, q;
scanf("%d %d", &n, &q);
char *str = malloc(sizeof(char)*n + 2);
scanf("%s", str);
int l, r;
int *map = calloc(n, sizeof(int));
int *ans = malloc(sizeof(int) * q);
if(str[0] == 'A' && str[1] == 'C'){
map[0] = 0;
map[1] = 1;
} else {
map[0] = 0;
map[1] = 0;
}
for(i=1; i<n-1; i++){
if(str[i] == 'A' && str[i+1] == 'C'){
map[i+1] = map[i] + 1;
} else {
map[i+1] = map[i];
}
}
for(i=0; i<q; i++){
scanf("%d %d", &l, &r);
ans[i] = map[r-1] - map[l-1];
}
for(i=0; i<q; i++){
printf("%d\n", ans[i]);
}
free(str);
free(map);
free(ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232527/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232527/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%l = alloca i32, align 4
%r = 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 %q) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%add = add nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %add) #7
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %call1)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
%1 = load i32, ptr %n, align 4, !tbaa !5
%conv3 = sext i32 %1 to i64
%call4 = call noalias ptr @calloc(i64 noundef %conv3, i64 noundef 4) #8
%2 = load i32, ptr %q, align 4, !tbaa !5
%conv5 = sext i32 %2 to i64
%mul6 = shl nsw i64 %conv5, 2
%call7 = call noalias ptr @malloc(i64 noundef %mul6) #7
%3 = load i8, ptr %call1, align 1, !tbaa !9
%cmp = icmp eq i8 %3, 65
br i1 %cmp, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %entry
%arrayidx10 = getelementptr inbounds i8, ptr %call1, i64 1
%4 = load i8, ptr %arrayidx10, align 1, !tbaa !9
%cmp12 = icmp eq i8 %4, 67
br i1 %cmp12, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true
%arrayidx15 = getelementptr inbounds i32, ptr %call4, i64 1
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %entry, %land.lhs.true, %if.then
%cmp18102 = icmp sgt i32 %1, 2
br i1 %cmp18102, label %for.body.preheader, label %for.cond45.preheader
for.body.preheader: ; preds = %if.end
%sub = add nsw i32 %1, -1
%wide.trip.count = zext i32 %sub to i64
br label %for.body
for.cond45.preheader: ; preds = %for.inc, %if.end
%cmp46105 = icmp sgt i32 %2, 0
br i1 %cmp46105, label %for.body48, label %for.end71
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %6, %for.inc ]
%arrayidx20 = getelementptr inbounds i8, ptr %call1, i64 %indvars.iv
%5 = load i8, ptr %arrayidx20, align 1, !tbaa !9
%cmp22 = icmp eq i8 %5, 65
%6 = add nuw nsw i64 %indvars.iv, 1
br i1 %cmp22, label %land.lhs.true24, label %if.else38
land.lhs.true24: ; preds = %for.body
%arrayidx27 = getelementptr inbounds i8, ptr %call1, i64 %6
%7 = load i8, ptr %arrayidx27, align 1, !tbaa !9
%cmp29 = icmp eq i8 %7, 67
br i1 %cmp29, label %if.then31, label %if.else38
if.then31: ; preds = %land.lhs.true24
%arrayidx33 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv
%8 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%add34 = add nsw i32 %8, 1
br label %for.inc
if.else38: ; preds = %for.body, %land.lhs.true24
%arrayidx40 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv
%9 = load i32, ptr %arrayidx40, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then31, %if.else38
%add34.sink = phi i32 [ %add34, %if.then31 ], [ %9, %if.else38 ]
%arrayidx37 = getelementptr inbounds i32, ptr %call4, i64 %6
store i32 %add34.sink, ptr %arrayidx37, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %6, %wide.trip.count
br i1 %exitcond.not, label %for.cond45.preheader, label %for.body, !llvm.loop !10
for.cond62.preheader: ; preds = %for.body48
%10 = icmp sgt i32 %15, 0
br i1 %10, label %for.body65, label %for.end71
for.body48: ; preds = %for.cond45.preheader, %for.body48
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.body48 ], [ 0, %for.cond45.preheader ]
%call49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%11 = load i32, ptr %r, align 4, !tbaa !5
%sub50 = add nsw i32 %11, -1
%idxprom51 = sext i32 %sub50 to i64
%arrayidx52 = getelementptr inbounds i32, ptr %call4, i64 %idxprom51
%12 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%13 = load i32, ptr %l, align 4, !tbaa !5
%sub53 = add nsw i32 %13, -1
%idxprom54 = sext i32 %sub53 to i64
%arrayidx55 = getelementptr inbounds i32, ptr %call4, i64 %idxprom54
%14 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%sub56 = sub nsw i32 %12, %14
%arrayidx58 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv112
store i32 %sub56, ptr %arrayidx58, align 4, !tbaa !5
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%15 = load i32, ptr %q, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp46 = icmp slt i64 %indvars.iv.next113, %16
br i1 %cmp46, label %for.body48, label %for.cond62.preheader, !llvm.loop !12
for.body65: ; preds = %for.cond62.preheader, %for.body65
%indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.body65 ], [ 0, %for.cond62.preheader ]
%arrayidx67 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv115
%17 = load i32, ptr %arrayidx67, align 4, !tbaa !5
%call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%18 = load i32, ptr %q, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp63 = icmp slt i64 %indvars.iv.next116, %19
br i1 %cmp63, label %for.body65, label %for.end71, !llvm.loop !13
for.end71: ; preds = %for.body65, %for.cond45.preheader, %for.cond62.preheader
call void @free(ptr noundef %call1) #6
call void @free(ptr noundef %call4) #6
call void @free(ptr noundef %call7) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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
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 nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
/*
AOJ 1165
Pablo Squareson's Headache
2015.4.29
*/
#include<stdio.h>
struct block
{
int x, y;
};
int width = 1, height = 1;
void calc_width_height(int n)
{
int i, target_block, direction, max_x = 0, max_y = 0, min_x = 0, min_y = 0;
struct block block_array[200];
block_array[0].x = 0;
block_array[0].y = 0;
for(i = 1; i < n; i++)
{
scanf("%d %d", &target_block, &direction);
switch(direction)
{
case 0:
block_array[i].x = block_array[target_block].x - 1;
block_array[i].y = block_array[target_block].y;
break;
case 1:
block_array[i].x = block_array[target_block].x;
block_array[i].y = block_array[target_block].y - 1;
break;
case 2:
block_array[i].x = block_array[target_block].x + 1;
block_array[i].y = block_array[target_block].y;
break;
case 3:
block_array[i].x = block_array[target_block].x;
block_array[i].y = block_array[target_block].y + 1;
break;
}
}
for(i = 0; i < n; i++)
{
if(max_x < block_array[i].x)
{
max_x = block_array[i].x;
}
if(max_y < block_array[i].y)
{
max_y = block_array[i].y;
}
if(min_x > block_array[i].x)
{
min_x = block_array[i].x;
}
if(min_y > block_array[i].y)
{
min_y = block_array[i].y;
}
}
/* for(i = 0; i < n; i++) */
/* { */
/* printf("[%d]: x = %d, y = %d\n", i, block_array[i].x, block_array[i].y); */
/* } */
width += max_x - min_x;
height += max_y - min_y;
return ;
}
int main(void)
{
int n;
while(1)
{
scanf("%d", &n);
if(n == 0)
{
break;
}
width = 1;
height = 1;
calc_width_height(n);
printf("%d %d\n", width, height);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232570/source.c"
target datalayout = "e-m:e-p270: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.block = type { i32, i32 }
@width = dso_local local_unnamed_addr global i32 1, align 4
@height = dso_local local_unnamed_addr global i32 1, 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"%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @calc_width_height(i32 noundef %n) local_unnamed_addr #0 {
entry:
%target_block = alloca i32, align 4
%direction = alloca i32, align 4
%block_array = alloca [200 x %struct.block], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %target_block) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %direction) #4
call void @llvm.lifetime.start.p0(i64 1600, ptr nonnull %block_array) #4
store i32 0, ptr %block_array, align 16, !tbaa !5
%y = getelementptr inbounds %struct.block, ptr %block_array, i64 0, i32 1
store i32 0, ptr %y, align 4, !tbaa !10
%cmp125 = icmp sgt i32 %n, 1
br i1 %cmp125, label %for.body.preheader, label %for.cond54.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond54.preheader: ; preds = %for.inc, %entry
%cmp55127 = icmp sgt i32 %n, 0
br i1 %cmp55127, label %for.body56.preheader, label %for.end93
for.body56.preheader: ; preds = %for.cond54.preheader
%wide.trip.count140 = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body56.preheader159, label %vector.ph
vector.ph: ; preds = %for.body56.preheader
%n.vec = and i64 %wide.trip.count140, 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 ], [ %9, %vector.body ]
%vec.phi142 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi143 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi144 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi145 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi146 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi147 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi148 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%0 = or i64 %index, 4
%1 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %index
%2 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %0
%wide.vec = load <8 x i32>, ptr %1, align 16, !tbaa !11
%wide.vec149 = load <8 x i32>, ptr %2, align 16, !tbaa !11
%strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec150 = shufflevector <8 x i32> %wide.vec149, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec151 = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%strided.vec152 = shufflevector <8 x i32> %wide.vec149, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%3 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi147, <4 x i32> %strided.vec)
%4 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi148, <4 x i32> %strided.vec150)
%5 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi145, <4 x i32> %strided.vec151)
%6 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi146, <4 x i32> %strided.vec152)
%7 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi143, <4 x i32> %strided.vec)
%8 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi144, <4 x i32> %strided.vec150)
%9 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %strided.vec151)
%10 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi142, <4 x i32> %strided.vec152)
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%rdx.minmax157 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %3, <4 x i32> %4)
%12 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax157)
%rdx.minmax155 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %5, <4 x i32> %6)
%13 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax155)
%rdx.minmax153 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %7, <4 x i32> %8)
%14 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax153)
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %9, <4 x i32> %10)
%15 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count140
br i1 %cmp.n, label %for.end93.loopexit, label %for.body56.preheader159
for.body56.preheader159: ; preds = %for.body56.preheader, %middle.block
%indvars.iv137.ph = phi i64 [ 0, %for.body56.preheader ], [ %n.vec, %middle.block ]
%min_y.0132.ph = phi i32 [ 0, %for.body56.preheader ], [ %15, %middle.block ]
%min_x.0131.ph = phi i32 [ 0, %for.body56.preheader ], [ %14, %middle.block ]
%max_y.0130.ph = phi i32 [ 0, %for.body56.preheader ], [ %13, %middle.block ]
%max_x.0129.ph = phi i32 [ 0, %for.body56.preheader ], [ %12, %middle.block ]
br label %for.body56
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %target_block, ptr noundef nonnull %direction)
%16 = load i32, ptr %direction, align 4, !tbaa !11
switch i32 %16, label %for.inc [
i32 0, label %sw.bb
i32 1, label %sw.bb13
i32 2, label %sw.bb27
i32 3, label %sw.bb40
]
sw.bb: ; preds = %for.body
%17 = load i32, ptr %target_block, align 4, !tbaa !11
%idxprom = sext i32 %17 to i64
%arrayidx2 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom
%18 = load i32, ptr %arrayidx2, align 8, !tbaa !5
%sub = add nsw i32 %18, -1
%arrayidx5 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %indvars.iv
store i32 %sub, ptr %arrayidx5, align 8, !tbaa !5
%y9 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom, i32 1
%19 = load i32, ptr %y9, align 4, !tbaa !10
br label %for.inc.sink.split
sw.bb13: ; preds = %for.body
%20 = load i32, ptr %target_block, align 4, !tbaa !11
%idxprom14 = sext i32 %20 to i64
%arrayidx15 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom14
%21 = load i32, ptr %arrayidx15, align 8, !tbaa !5
%arrayidx18 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %indvars.iv
store i32 %21, ptr %arrayidx18, align 8, !tbaa !5
%y22 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom14, i32 1
%22 = load i32, ptr %y22, align 4, !tbaa !10
%sub23 = add nsw i32 %22, -1
br label %for.inc.sink.split
sw.bb27: ; preds = %for.body
%23 = load i32, ptr %target_block, align 4, !tbaa !11
%idxprom28 = sext i32 %23 to i64
%arrayidx29 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom28
%24 = load i32, ptr %arrayidx29, align 8, !tbaa !5
%add = add nsw i32 %24, 1
%arrayidx32 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %indvars.iv
store i32 %add, ptr %arrayidx32, align 8, !tbaa !5
%y36 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom28, i32 1
%25 = load i32, ptr %y36, align 4, !tbaa !10
br label %for.inc.sink.split
sw.bb40: ; preds = %for.body
%26 = load i32, ptr %target_block, align 4, !tbaa !11
%idxprom41 = sext i32 %26 to i64
%arrayidx42 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom41
%27 = load i32, ptr %arrayidx42, align 8, !tbaa !5
%arrayidx45 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %indvars.iv
store i32 %27, ptr %arrayidx45, align 8, !tbaa !5
%y49 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %idxprom41, i32 1
%28 = load i32, ptr %y49, align 4, !tbaa !10
%add50 = add nsw i32 %28, 1
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %sw.bb40, %sw.bb27, %sw.bb13, %sw.bb
%.sink = phi i32 [ %19, %sw.bb ], [ %sub23, %sw.bb13 ], [ %25, %sw.bb27 ], [ %add50, %sw.bb40 ]
%y12 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %indvars.iv, i32 1
store i32 %.sink, ptr %y12, align 4, !tbaa !10
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %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 %for.cond54.preheader, label %for.body, !llvm.loop !16
for.body56: ; preds = %for.body56.preheader159, %for.body56
%indvars.iv137 = phi i64 [ %indvars.iv.next138, %for.body56 ], [ %indvars.iv137.ph, %for.body56.preheader159 ]
%min_y.0132 = phi i32 [ %min_y.1, %for.body56 ], [ %min_y.0132.ph, %for.body56.preheader159 ]
%min_x.0131 = phi i32 [ %min_x.1, %for.body56 ], [ %min_x.0131.ph, %for.body56.preheader159 ]
%max_y.0130 = phi i32 [ %max_y.1, %for.body56 ], [ %max_y.0130.ph, %for.body56.preheader159 ]
%max_x.0129 = phi i32 [ %spec.select, %for.body56 ], [ %max_x.0129.ph, %for.body56.preheader159 ]
%arrayidx58 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %indvars.iv137
%29 = load i32, ptr %arrayidx58, align 8, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %max_x.0129, i32 %29)
%y66 = getelementptr inbounds [200 x %struct.block], ptr %block_array, i64 0, i64 %indvars.iv137, i32 1
%30 = load i32, ptr %y66, align 4, !tbaa !10
%max_y.1 = call i32 @llvm.smax.i32(i32 %max_y.0130, i32 %30)
%min_x.1 = call i32 @llvm.smin.i32(i32 %min_x.0131, i32 %29)
%min_y.1 = call i32 @llvm.smin.i32(i32 %min_y.0132, i32 %30)
%indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
%exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count140
br i1 %exitcond141.not, label %for.end93.loopexit, label %for.body56, !llvm.loop !17
for.end93.loopexit: ; preds = %for.body56, %middle.block
%spec.select.lcssa = phi i32 [ %12, %middle.block ], [ %spec.select, %for.body56 ]
%max_y.1.lcssa = phi i32 [ %13, %middle.block ], [ %max_y.1, %for.body56 ]
%min_x.1.lcssa = phi i32 [ %14, %middle.block ], [ %min_x.1, %for.body56 ]
%min_y.1.lcssa = phi i32 [ %15, %middle.block ], [ %min_y.1, %for.body56 ]
%31 = sub i32 %spec.select.lcssa, %min_x.1.lcssa
%32 = sub i32 %max_y.1.lcssa, %min_y.1.lcssa
br label %for.end93
for.end93: ; preds = %for.end93.loopexit, %for.cond54.preheader
%sub94 = phi i32 [ 0, %for.cond54.preheader ], [ %31, %for.end93.loopexit ]
%sub96 = phi i32 [ 0, %for.cond54.preheader ], [ %32, %for.end93.loopexit ]
%33 = load i32, ptr @width, align 4, !tbaa !11
%add95 = add nsw i32 %sub94, %33
store i32 %add95, ptr @width, align 4, !tbaa !11
%34 = load i32, ptr @height, align 4, !tbaa !11
%add97 = add nsw i32 %sub96, %34
store i32 %add97, ptr @height, align 4, !tbaa !11
call void @llvm.lifetime.end.p0(i64 1600, ptr nonnull %block_array) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %direction) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %target_block) #4
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !11
%cmp3 = icmp eq i32 %0, 0
br i1 %cmp3, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%1 = phi i32 [ %4, %if.end ], [ %0, %entry ]
store i32 1, ptr @width, align 4, !tbaa !11
store i32 1, ptr @height, align 4, !tbaa !11
call void @calc_width_height(i32 noundef %1)
%2 = load i32, ptr @width, align 4, !tbaa !11
%3 = load i32, ptr @height, align 4, !tbaa !11
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2, i32 noundef %3)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !11
%cmp = icmp eq i32 %4, 0
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"block", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13, !14, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13, !15, !14}
|
#include <stdio.h>
#include <stdlib.h>
int check(int *x, int *y, int t) {
int i;
for (i = 0; i < t; i++) {
if(x[i] == x[t]) return 1;
if(y[i] == y[t]) return 1;
if(x[i]+y[i] == x[t]+y[t]) return 1;
if(x[i]-y[i] == x[t]-y[t]) return 1;
}
return 0;
}
void search(int *x, int *y, int *t) {
while(*t < 8) {
if(y[*t] == 7) {
x[*t]++;
y[*t] = 0;
}
else {
y[*t]++;
}
if(x[*t] > 7) {
x[*t] = 0;
y[*t] = -1;
(*t)--;
}
else if(check(x,y,*t) == 0) {
(*t)++;
}
}
}
void print_board(int *x, int *y) {
int i,j,t;
for (i = 0; i < 8; i++) {
for (t = 0; i != x[t]; t++);
for (j = 0; j < 8; j++) {
if(j == y[t]) printf("Q");
else printf(".");
}
printf("\n");
}
}
int main()
{
int i,t,k,*x,*y;
x = (int*)malloc(sizeof(int) * 8);
y = (int*)malloc(sizeof(int) * 8);
for (i = 0; i < 8; i++) {
x[i] = 0;
y[i] = -1;
}
t = 0;
scanf("%d",&k);
for(i = 0; i < k; i++) {
scanf("%d %d",x+i,y+i);
t++;
}
search(x,y,&t);
print_board(x,y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232628/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232628/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @check(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %t) local_unnamed_addr #0 {
entry:
%cmp61 = icmp sgt i32 %t, 0
br i1 %cmp61, label %for.body.lr.ph, label %cleanup
for.body.lr.ph: ; preds = %entry
%idxprom1 = zext i32 %t to i64
%arrayidx2 = getelementptr inbounds i32, ptr %x, i64 %idxprom1
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds i32, ptr %y, i64 %idxprom1
%wide.trip.count = zext i32 %t to i64
br label %for.body
for.cond: ; preds = %if.end22
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9
for.body: ; preds = %for.body.lr.ph, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp3 = icmp eq i32 %1, %0
br i1 %cmp3, label %cleanup, label %if.end
if.end: ; preds = %for.body
%arrayidx5 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv
%2 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp eq i32 %2, %3
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end
%add = add nsw i32 %2, %1
%add19 = add nsw i32 %3, %0
%cmp20 = icmp eq i32 %add, %add19
br i1 %cmp20, label %cleanup, label %if.end22
if.end22: ; preds = %if.end10
%sub = sub nsw i32 %1, %2
%sub31 = sub nsw i32 %0, %3
%cmp32 = icmp eq i32 %sub, %sub31
br i1 %cmp32, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %if.end, %if.end10, %if.end22, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %if.end22 ], [ 1, %if.end10 ], [ 1, %if.end ], [ 1, %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: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @search(ptr nocapture noundef %x, ptr nocapture noundef %y, ptr nocapture noundef %t) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp43 = icmp slt i32 %0, 8
br i1 %cmp43, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end22
%1 = phi i32 [ %13, %if.end22 ], [ %0, %entry ]
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds i32, ptr %y, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %2, 7
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%arrayidx3 = getelementptr inbounds i32, ptr %x, i64 %idxprom
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr %arrayidx3, align 4, !tbaa !5
%4 = load i32, ptr %t, align 4, !tbaa !5
%idxprom4 = sext i32 %4 to i64
%arrayidx5 = getelementptr inbounds i32, ptr %y, i64 %idxprom4
store i32 0, ptr %arrayidx5, align 4, !tbaa !5
br label %if.end
if.else: ; preds = %while.body
%inc8 = add nsw i32 %2, 1
store i32 %inc8, ptr %arrayidx, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then
%5 = load i32, ptr %t, align 4, !tbaa !5
%idxprom9 = sext i32 %5 to i64
%arrayidx10 = getelementptr inbounds i32, ptr %x, i64 %idxprom9
%6 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %6, 7
br i1 %cmp11, label %if.then12, label %if.else17
if.then12: ; preds = %if.end
store i32 0, ptr %arrayidx10, align 4, !tbaa !5
%7 = load i32, ptr %t, align 4, !tbaa !5
%idxprom15 = sext i32 %7 to i64
%arrayidx16 = getelementptr inbounds i32, ptr %y, i64 %idxprom15
store i32 -1, ptr %arrayidx16, align 4, !tbaa !5
%8 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %8, -1
br label %if.end22.sink.split
if.else17: ; preds = %if.end
%cmp61.i = icmp sgt i32 %5, 0
br i1 %cmp61.i, label %for.body.lr.ph.i, label %if.then19
for.body.lr.ph.i: ; preds = %if.else17
%idxprom1.i = zext i32 %5 to i64
%arrayidx2.i = getelementptr inbounds i32, ptr %x, i64 %idxprom1.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%arrayidx7.i = getelementptr inbounds i32, ptr %y, i64 %idxprom1.i
br label %for.body.i
for.cond.i: ; preds = %if.end22.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom1.i
br i1 %exitcond.not.i, label %if.then19, label %for.body.i, !llvm.loop !9
for.body.i: ; preds = %for.cond.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.cond.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.i
%10 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp3.i = icmp eq i32 %10, %9
br i1 %cmp3.i, label %if.end22, label %if.end.i
if.end.i: ; preds = %for.body.i
%arrayidx5.i = getelementptr inbounds i32, ptr %y, i64 %indvars.iv.i
%11 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%cmp8.i = icmp eq i32 %11, %12
br i1 %cmp8.i, label %if.end22, label %if.end10.i
if.end10.i: ; preds = %if.end.i
%add.i = add nsw i32 %11, %10
%add19.i = add nsw i32 %12, %9
%cmp20.i = icmp eq i32 %add.i, %add19.i
br i1 %cmp20.i, label %if.end22, label %if.end22.i
if.end22.i: ; preds = %if.end10.i
%sub.i = sub nsw i32 %10, %11
%sub31.i = sub nsw i32 %9, %12
%cmp32.i = icmp eq i32 %sub.i, %sub31.i
br i1 %cmp32.i, label %if.end22, label %for.cond.i
if.then19: ; preds = %for.cond.i, %if.else17
%inc20 = add nsw i32 %5, 1
br label %if.end22.sink.split
if.end22.sink.split: ; preds = %if.then12, %if.then19
%inc20.sink = phi i32 [ %inc20, %if.then19 ], [ %dec, %if.then12 ]
store i32 %inc20.sink, ptr %t, align 4, !tbaa !5
br label %if.end22
if.end22: ; preds = %for.body.i, %if.end.i, %if.end10.i, %if.end22.i, %if.end22.sink.split
%13 = phi i32 [ %inc20.sink, %if.end22.sink.split ], [ %5, %if.end22.i ], [ %5, %if.end10.i ], [ %5, %if.end.i ], [ %5, %for.body.i ]
%cmp = icmp slt i32 %13, 8
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %if.end22, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print_board(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) local_unnamed_addr #3 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond4.preheader
%i.027 = phi i32 [ 0, %entry ], [ %inc16, %for.cond4.preheader ]
br label %for.cond1
for.cond1: ; preds = %for.cond1, %for.cond1.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1 ], [ 0, %for.cond1.preheader ]
%arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp2.not = icmp eq i32 %i.027, %0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp2.not, label %for.cond4.preheader, label %for.cond1, !llvm.loop !12
for.cond4.preheader: ; preds = %for.cond1
%arrayidx8 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %1, 0
%. = select i1 %cmp9, i32 81, i32 46
%putchar25 = tail call i32 @putchar(i32 %.)
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.1 = icmp eq i32 %2, 1
%.sink29 = select i1 %cmp9.1, i32 81, i32 46
%putchar25.1 = tail call i32 @putchar(i32 %.sink29)
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.2 = icmp eq i32 %3, 2
%.sink30 = select i1 %cmp9.2, i32 81, i32 46
%putchar25.2 = tail call i32 @putchar(i32 %.sink30)
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.3 = icmp eq i32 %4, 3
%.sink31 = select i1 %cmp9.3, i32 81, i32 46
%putchar25.3 = tail call i32 @putchar(i32 %.sink31)
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.4 = icmp eq i32 %5, 4
%.sink32 = select i1 %cmp9.4, i32 81, i32 46
%putchar25.4 = tail call i32 @putchar(i32 %.sink32)
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.5 = icmp eq i32 %6, 5
%.sink33 = select i1 %cmp9.5, i32 81, i32 46
%putchar25.5 = tail call i32 @putchar(i32 %.sink33)
%7 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.6 = icmp eq i32 %7, 6
%.sink34 = select i1 %cmp9.6, i32 81, i32 46
%putchar25.6 = tail call i32 @putchar(i32 %.sink34)
%8 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.7 = icmp eq i32 %8, 7
%.sink35 = select i1 %cmp9.7, i32 81, i32 46
%putchar25.7 = tail call i32 @putchar(i32 %.sink35)
%putchar = tail call i32 @putchar(i32 10)
%inc16 = add nuw nsw i32 %i.027, 1
%exitcond.not = icmp eq i32 %inc16, 8
br i1 %exitcond.not, label %for.end17, label %for.cond1.preheader, !llvm.loop !13
for.end17: ; preds = %for.cond4.preheader
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #9
%calloc = tail call dereferenceable_or_null(32) ptr @calloc(i64 1, i64 32)
%call1 = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %call1, i8 -1, i64 32, i1 false), !tbaa !5
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp634 = icmp sgt i32 %0, 0
br i1 %cmp634, label %for.body7, label %while.body.i.preheader
for.body7: ; preds = %entry, %for.body7
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %calloc, i64 %indvars.iv
%add.ptr9 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef %add.ptr, ptr noundef %add.ptr9)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %k, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp6 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp6, label %for.body7, label %for.end14, !llvm.loop !14
for.end14: ; preds = %for.body7
%indvars39 = trunc i64 %indvars.iv.next to i32
%cmp43.i = icmp ult i32 %indvars39, 8
br i1 %cmp43.i, label %while.body.i.preheader, label %search.exit
while.body.i.preheader: ; preds = %entry, %for.end14
%.ph = phi i32 [ 0, %entry ], [ %indvars39, %for.end14 ]
br label %while.body.i
while.body.i: ; preds = %while.body.i.preheader, %if.end22.i
%3 = phi i32 [ %t.2, %if.end22.i ], [ %.ph, %while.body.i.preheader ]
%idxprom.i = sext i32 %3 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %4, 7
br i1 %cmp1.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %while.body.i
%arrayidx3.i = getelementptr inbounds i32, ptr %calloc, i64 %idxprom.i
%5 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%inc.i = add nsw i32 %5, 1
store i32 %inc.i, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 0, ptr %arrayidx.i, align 4, !tbaa !5
br label %if.end.i
if.else.i: ; preds = %while.body.i
%inc8.i = add nsw i32 %4, 1
store i32 %inc8.i, ptr %arrayidx.i, align 4, !tbaa !5
%arrayidx10.i.phi.trans.insert = getelementptr inbounds i32, ptr %calloc, i64 %idxprom.i
%.pre = load i32, ptr %arrayidx10.i.phi.trans.insert, align 4, !tbaa !5
br label %if.end.i
if.end.i: ; preds = %if.else.i, %if.then.i
%6 = phi i32 [ %.pre, %if.else.i ], [ %inc.i, %if.then.i ]
%cmp11.i = icmp sgt i32 %6, 7
br i1 %cmp11.i, label %if.then12.i, label %if.else17.i
if.then12.i: ; preds = %if.end.i
%arrayidx10.i = getelementptr inbounds i32, ptr %calloc, i64 %idxprom.i
store i32 0, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 -1, ptr %arrayidx.i, align 4, !tbaa !5
%dec.i = add nsw i32 %3, -1
br label %if.end22.i
if.else17.i: ; preds = %if.end.i
%cmp61.i.i = icmp sgt i32 %3, 0
br i1 %cmp61.i.i, label %for.body.lr.ph.i.i, label %if.then19.i
for.body.lr.ph.i.i: ; preds = %if.else17.i
%idxprom1.i.i = zext i32 %3 to i64
%arrayidx2.i.i = getelementptr inbounds i32, ptr %calloc, i64 %idxprom1.i.i
%7 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%arrayidx7.i.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom1.i.i
br label %for.body.i.i
for.cond.i.i: ; preds = %if.end22.i.i
%indvars.iv.next.i.i = add nuw nsw i64 %indvars.iv.i.i, 1
%exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %idxprom1.i.i
br i1 %exitcond.not.i.i, label %if.then19.i, label %for.body.i.i, !llvm.loop !9
for.body.i.i: ; preds = %for.cond.i.i, %for.body.lr.ph.i.i
%indvars.iv.i.i = phi i64 [ 0, %for.body.lr.ph.i.i ], [ %indvars.iv.next.i.i, %for.cond.i.i ]
%arrayidx.i.i = getelementptr inbounds i32, ptr %calloc, i64 %indvars.iv.i.i
%8 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5
%cmp3.i.i = icmp eq i32 %8, %7
br i1 %cmp3.i.i, label %if.end22.i, label %if.end.i.i
if.end.i.i: ; preds = %for.body.i.i
%arrayidx5.i.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i.i
%9 = load i32, ptr %arrayidx5.i.i, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx7.i.i, align 4, !tbaa !5
%cmp8.i.i = icmp eq i32 %9, %10
br i1 %cmp8.i.i, label %if.end22.i, label %if.end10.i.i
if.end10.i.i: ; preds = %if.end.i.i
%add.i.i = add nsw i32 %9, %8
%add19.i.i = add nsw i32 %10, %7
%cmp20.i.i = icmp eq i32 %add.i.i, %add19.i.i
br i1 %cmp20.i.i, label %if.end22.i, label %if.end22.i.i
if.end22.i.i: ; preds = %if.end10.i.i
%sub.i.i = sub nsw i32 %8, %9
%sub31.i.i = sub nsw i32 %7, %10
%cmp32.i.i = icmp eq i32 %sub.i.i, %sub31.i.i
br i1 %cmp32.i.i, label %if.end22.i, label %for.cond.i.i
if.then19.i: ; preds = %for.cond.i.i, %if.else17.i
%inc20.i = add nsw i32 %3, 1
br label %if.end22.i
if.end22.i: ; preds = %if.end22.i.i, %if.end10.i.i, %if.end.i.i, %for.body.i.i, %if.then12.i, %if.then19.i
%t.2 = phi i32 [ %inc20.i, %if.then19.i ], [ %dec.i, %if.then12.i ], [ %3, %for.body.i.i ], [ %3, %if.end.i.i ], [ %3, %if.end10.i.i ], [ %3, %if.end22.i.i ]
%cmp.i = icmp slt i32 %t.2, 8
br i1 %cmp.i, label %while.body.i, label %search.exit, !llvm.loop !11
search.exit: ; preds = %if.end22.i, %for.end14
call void @print_board(ptr noundef %calloc, ptr noundef %call1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #9
ret i32 0
}
; 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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #8
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 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<stdlib.h>
#define N 8
#define NOT_FREE 1
#define FREE 0
void putQueen(int);
void printBoard(void);
int M[N][N],row[N],col[N],dneg[2*N-1],dpos[2*N-1];
int main(){
int k,i,j,r,c;
scanf("%d",&k);
for(i=0; i<N; i++){ //
col[i] = row[i] = dneg[i] = dpos[i] = FREE; //
for(j=0; j<N; j++){ //
M[i][j] = 0; //
} //
} //
for(j=N; j<(N*2-1); j++){ //
dneg[j] = dpos[j] = FREE; //
} //
for(i=0; i<k; i++){
scanf("%d%d",&r,&c);
M[r][c] = 1;
}
putQueen(0);
return 0;
}
void putQueen(int i){
int j;
if(i == N){
printBoard();
return;
}
for(j=0; j<N; j++){
if(col[j] == NOT_FREE || dpos[i+j] == NOT_FREE || dneg[i-j+N-1] == NOT_FREE) continue;
row[i] = j;
col[j] = dpos[i+j] = dneg[i-j+N-1] = NOT_FREE;
putQueen(i+1);
row[i] = col[j] = dpos[i+j] = dneg[i-j+N-1] = FREE;
}
}
void printBoard(void){
int i,j;
for(i=0; i<N; i++){
for(j=0; j<N; j++){
if(M[i][j] && row[i] != j) return;
}
}
for(i=0; i<N; i++){
for(j=0; j<N; j++){
printf((row[i] == j ? "Q" : "."));
if(j == N-1) printf("\n");
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232671/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232671/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@M = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"Q\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c".\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%r = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @dpos, i8 0, i64 32, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @dneg, i8 0, i64 32, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 0, i64 32, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 0, i64 32, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @M, i8 0, i64 256, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(28) getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 8), i8 0, i64 28, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(28) getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 8), i8 0, i64 28, i1 false), !tbaa !5
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp2855 = icmp sgt i32 %0, 0
br i1 %cmp2855, label %for.body29, label %for.end37
for.body29: ; preds = %entry, %for.body29
%i.156 = phi i32 [ %inc36, %for.body29 ], [ 0, %entry ]
%call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %c)
%1 = load i32, ptr %r, align 4, !tbaa !5
%idxprom31 = sext i32 %1 to i64
%2 = load i32, ptr %c, align 4, !tbaa !5
%idxprom33 = sext i32 %2 to i64
%arrayidx34 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %idxprom31, i64 %idxprom33
store i32 1, ptr %arrayidx34, align 4, !tbaa !5
%inc36 = add nuw nsw i32 %i.156, 1
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp28 = icmp slt i32 %inc36, %3
br i1 %cmp28, label %for.body29, label %for.end37, !llvm.loop !9
for.end37: ; preds = %for.body29, %entry
call void @putQueen(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @putQueen(i32 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %i, 7
%idxprom14 = sext i32 %i to i64
%arrayidx15 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom14
%add26 = add nsw i32 %i, 1
%0 = load i32, ptr @col, align 16, !tbaa !5
%cmp2 = icmp eq i32 %0, 1
br i1 %cmp2, label %for.inc, label %lor.lhs.false
if.then: ; preds = %entry
tail call void @printBoard()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom14
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, 1
br i1 %cmp5, label %for.inc, label %lor.lhs.false6
lor.lhs.false6: ; preds = %lor.lhs.false
%idxprom9 = sext i32 %sub to i64
%arrayidx10 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp eq i32 %2, 1
br i1 %cmp11, label %for.inc, label %if.end13
if.end13: ; preds = %lor.lhs.false6
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr @col, align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10, align 4, !tbaa !5
store i32 0, ptr %arrayidx4, align 4, !tbaa !5
store i32 0, ptr @col, align 16, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, 1
br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom14, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %5, 1
br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1
lor.lhs.false6.1: ; preds = %lor.lhs.false.1
%sub8.1 = add i32 %i, 6
%idxprom9.1 = sext i32 %sub8.1 to i64
%arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.1
%6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %6, 1
br i1 %cmp11.1, label %for.inc.1, label %if.end13.1
if.end13.1: ; preds = %lor.lhs.false6.1
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
%cmp2.2 = icmp eq i32 %7, 1
br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom14, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %9, 1
br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2
lor.lhs.false6.2: ; preds = %lor.lhs.false.2
%sub8.2 = add i32 %i, 5
%idxprom9.2 = sext i32 %sub8.2 to i64
%arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.2
%10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%cmp11.2 = icmp eq i32 %10, 1
br i1 %cmp11.2, label %for.inc.2, label %if.end13.2
if.end13.2: ; preds = %lor.lhs.false6.2
store i32 2, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %11, 1
br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom14, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %13, 1
br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3
lor.lhs.false6.3: ; preds = %lor.lhs.false.3
%sub8.3 = add i32 %i, 4
%idxprom9.3 = sext i32 %sub8.3 to i64
%arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.3
%14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%cmp11.3 = icmp eq i32 %14, 1
br i1 %cmp11.3, label %for.inc.3, label %if.end13.3
if.end13.3: ; preds = %lor.lhs.false6.3
store i32 3, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
%cmp2.4 = icmp eq i32 %15, 1
br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom14, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %17, 1
br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4
lor.lhs.false6.4: ; preds = %lor.lhs.false.4
%sub8.4 = add i32 %i, 3
%idxprom9.4 = sext i32 %sub8.4 to i64
%arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.4
%18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5
%cmp11.4 = icmp eq i32 %18, 1
br i1 %cmp11.4, label %for.inc.4, label %if.end13.4
if.end13.4: ; preds = %lor.lhs.false6.4
store i32 4, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
%cmp2.5 = icmp eq i32 %19, 1
br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom14, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %21, 1
br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5
lor.lhs.false6.5: ; preds = %lor.lhs.false.5
%sub8.5 = add i32 %i, 2
%idxprom9.5 = sext i32 %sub8.5 to i64
%arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.5
%22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5
%cmp11.5 = icmp eq i32 %22, 1
br i1 %cmp11.5, label %for.inc.5, label %if.end13.5
if.end13.5: ; preds = %lor.lhs.false6.5
store i32 5, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
%cmp2.6 = icmp eq i32 %23, 1
br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom14, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %25, 1
br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6
lor.lhs.false6.6: ; preds = %lor.lhs.false.6
%sub8.6 = add i32 %i, 1
%idxprom9.6 = sext i32 %sub8.6 to i64
%arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.6
%26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5
%cmp11.6 = icmp eq i32 %26, 1
br i1 %cmp11.6, label %for.inc.6, label %if.end13.6
if.end13.6: ; preds = %lor.lhs.false6.6
store i32 6, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
%cmp2.7 = icmp eq i32 %27, 1
br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom14, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %29, 1
br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7
lor.lhs.false6.7: ; preds = %lor.lhs.false.7
%arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom14
%30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5
%cmp11.7 = icmp eq i32 %30, 1
br i1 %cmp11.7, label %common.ret, label %if.end13.7
common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7
ret void
if.end13.7: ; preds = %lor.lhs.false6.7
store i32 7, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @printBoard() local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx7 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 0
%0 = load i32, ptr %arrayidx5, align 16, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not = icmp eq i32 %1, 0
br i1 %cmp8.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %land.lhs.true
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %2, 0
br i1 %tobool.not.1, label %for.inc.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.1 = icmp eq i32 %3, 1
br i1 %cmp8.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %land.lhs.true.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 2
%4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %4, 0
br i1 %tobool.not.2, label %for.inc.2, label %land.lhs.true.2
land.lhs.true.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.2 = icmp eq i32 %5, 2
br i1 %cmp8.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %land.lhs.true.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 3
%6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %6, 0
br i1 %tobool.not.3, label %for.inc.3, label %land.lhs.true.3
land.lhs.true.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.3 = icmp eq i32 %7, 3
br i1 %cmp8.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %land.lhs.true.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 4
%8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5
%tobool.not.4 = icmp eq i32 %8, 0
br i1 %tobool.not.4, label %for.inc.4, label %land.lhs.true.4
land.lhs.true.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.4 = icmp eq i32 %9, 4
br i1 %cmp8.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %land.lhs.true.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 5
%10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%tobool.not.5 = icmp eq i32 %10, 0
br i1 %tobool.not.5, label %for.inc.5, label %land.lhs.true.5
land.lhs.true.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.5 = icmp eq i32 %11, 5
br i1 %cmp8.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %land.lhs.true.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 6
%12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5
%tobool.not.6 = icmp eq i32 %12, 0
br i1 %tobool.not.6, label %for.inc.6, label %land.lhs.true.6
land.lhs.true.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.6 = icmp eq i32 %13, 6
br i1 %cmp8.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %land.lhs.true.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @M, i64 0, i64 %indvars.iv, i64 7
%14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%tobool.not.7 = icmp eq i32 %14, 0
br i1 %tobool.not.7, label %for.inc.7, label %land.lhs.true.7
land.lhs.true.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.7 = icmp eq i32 %15, 7
br i1 %cmp8.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %land.lhs.true.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.inc25.7, label %for.cond1.preheader, !llvm.loop !11
for.inc25.7: ; preds = %for.inc.7, %for.inc25.7
%indvars.iv54 = phi i64 [ %indvars.iv.next55, %for.inc25.7 ], [ 0, %for.inc.7 ]
%arrayidx19 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv54
%16 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp eq i32 %16, 0
%cond = select i1 %cmp20, ptr @.str.2, ptr @.str.3
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
%.pre = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20.1 = icmp eq i32 %.pre, 1
%cond.1 = select i1 %cmp20.1, ptr @.str.2, ptr @.str.3
%call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond.1)
%.pre58 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20.2 = icmp eq i32 %.pre58, 2
%cond.2 = select i1 %cmp20.2, ptr @.str.2, ptr @.str.3
%call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond.2)
%.pre59 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20.3 = icmp eq i32 %.pre59, 3
%cond.3 = select i1 %cmp20.3, ptr @.str.2, ptr @.str.3
%call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond.3)
%.pre60 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20.4 = icmp eq i32 %.pre60, 4
%cond.4 = select i1 %cmp20.4, ptr @.str.2, ptr @.str.3
%call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond.4)
%.pre61 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20.5 = icmp eq i32 %.pre61, 5
%cond.5 = select i1 %cmp20.5, ptr @.str.2, ptr @.str.3
%call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond.5)
%.pre62 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20.6 = icmp eq i32 %.pre62, 6
%cond.6 = select i1 %cmp20.6, ptr @.str.2, ptr @.str.3
%call.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond.6)
%.pre63 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20.7 = icmp eq i32 %.pre63, 7
%cond.7 = select i1 %cmp20.7, ptr @.str.2, ptr @.str.3
%call.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond.7)
%putchar.7 = tail call i32 @putchar(i32 10)
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond57.not = icmp eq i64 %indvars.iv.next55, 8
br i1 %exitcond57.not, label %cleanup, label %for.inc25.7, !llvm.loop !12
cleanup: ; preds = %land.lhs.true, %land.lhs.true.1, %land.lhs.true.2, %land.lhs.true.3, %land.lhs.true.4, %land.lhs.true.5, %land.lhs.true.6, %land.lhs.true.7, %for.inc25.7
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define N 8
#define FREE 0
#define NOT_FREE 1
void putQueen(int);
void PrintBoard(void);
int Queen[N][N];
int dpos[2*N-1];
int dneg[2*N-1];
int row[N];
int col[N];
int main(){
int i;
int n;
int q_row;
int q_col;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%d",&q_row,&q_col);
Queen[q_row][q_col] = NOT_FREE;
}
putQueen(0);
return 0;
}
void putQueen(int i){
int j;
if(i==N){
PrintBoard();
return;
}
for(j=0;j<N;j++){
if(col[j]==NOT_FREE || dpos[i+j]==NOT_FREE || dneg[i-j+N-1]==NOT_FREE) continue;
row[i] = j;
col[j] = dpos[i+j] = dneg[i-j+N-1] = NOT_FREE;
putQueen(i+1);
col[j] = dpos[i+j] = dneg[i-j+N-1] = FREE;
}
}
void PrintBoard(void){
int i;
int j;
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(Queen[i][j]==NOT_FREE){
if(row[i]!=j) return;
}
}
}
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(row[i]==j){
printf("Q");
}
else{
printf(".");
}
}
printf("\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232721/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232721/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@Queen = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q_row = alloca i32, align 4
%q_col = 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 %q_row) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q_col) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q_row, ptr noundef nonnull %q_col)
%1 = load i32, ptr %q_row, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%2 = load i32, ptr %q_col, align 4, !tbaa !5
%idxprom2 = sext i32 %2 to i64
%arrayidx3 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %idxprom, i64 %idxprom2
store i32 1, ptr %arrayidx3, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.06, 1
%3 = load i32, ptr %n, 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
call void @putQueen(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q_col) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q_row) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @putQueen(i32 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %i, 7
%idxprom14 = sext i32 %i to i64
%arrayidx15 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom14
%add26 = add nsw i32 %i, 1
%0 = load i32, ptr @col, align 16, !tbaa !5
%cmp2 = icmp eq i32 %0, 1
br i1 %cmp2, label %for.inc, label %lor.lhs.false
if.then: ; preds = %entry
tail call void @PrintBoard()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom14
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, 1
br i1 %cmp5, label %for.inc, label %lor.lhs.false6
lor.lhs.false6: ; preds = %lor.lhs.false
%idxprom9 = sext i32 %sub to i64
%arrayidx10 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp eq i32 %2, 1
br i1 %cmp11, label %for.inc, label %if.end13
if.end13: ; preds = %lor.lhs.false6
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr @col, align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10, align 4, !tbaa !5
store i32 0, ptr %arrayidx4, align 4, !tbaa !5
store i32 0, ptr @col, align 16, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, 1
br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom14, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %5, 1
br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1
lor.lhs.false6.1: ; preds = %lor.lhs.false.1
%sub8.1 = add i32 %i, 6
%idxprom9.1 = sext i32 %sub8.1 to i64
%arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.1
%6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %6, 1
br i1 %cmp11.1, label %for.inc.1, label %if.end13.1
if.end13.1: ; preds = %lor.lhs.false6.1
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
%cmp2.2 = icmp eq i32 %7, 1
br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom14, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %9, 1
br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2
lor.lhs.false6.2: ; preds = %lor.lhs.false.2
%sub8.2 = add i32 %i, 5
%idxprom9.2 = sext i32 %sub8.2 to i64
%arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.2
%10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%cmp11.2 = icmp eq i32 %10, 1
br i1 %cmp11.2, label %for.inc.2, label %if.end13.2
if.end13.2: ; preds = %lor.lhs.false6.2
store i32 2, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %11, 1
br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom14, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %13, 1
br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3
lor.lhs.false6.3: ; preds = %lor.lhs.false.3
%sub8.3 = add i32 %i, 4
%idxprom9.3 = sext i32 %sub8.3 to i64
%arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.3
%14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%cmp11.3 = icmp eq i32 %14, 1
br i1 %cmp11.3, label %for.inc.3, label %if.end13.3
if.end13.3: ; preds = %lor.lhs.false6.3
store i32 3, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
%cmp2.4 = icmp eq i32 %15, 1
br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom14, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %17, 1
br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4
lor.lhs.false6.4: ; preds = %lor.lhs.false.4
%sub8.4 = add i32 %i, 3
%idxprom9.4 = sext i32 %sub8.4 to i64
%arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.4
%18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5
%cmp11.4 = icmp eq i32 %18, 1
br i1 %cmp11.4, label %for.inc.4, label %if.end13.4
if.end13.4: ; preds = %lor.lhs.false6.4
store i32 4, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
%cmp2.5 = icmp eq i32 %19, 1
br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom14, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %21, 1
br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5
lor.lhs.false6.5: ; preds = %lor.lhs.false.5
%sub8.5 = add i32 %i, 2
%idxprom9.5 = sext i32 %sub8.5 to i64
%arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.5
%22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5
%cmp11.5 = icmp eq i32 %22, 1
br i1 %cmp11.5, label %for.inc.5, label %if.end13.5
if.end13.5: ; preds = %lor.lhs.false6.5
store i32 5, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
%cmp2.6 = icmp eq i32 %23, 1
br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom14, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %25, 1
br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6
lor.lhs.false6.6: ; preds = %lor.lhs.false.6
%sub8.6 = add i32 %i, 1
%idxprom9.6 = sext i32 %sub8.6 to i64
%arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.6
%26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5
%cmp11.6 = icmp eq i32 %26, 1
br i1 %cmp11.6, label %for.inc.6, label %if.end13.6
if.end13.6: ; preds = %lor.lhs.false6.6
store i32 6, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
%cmp2.7 = icmp eq i32 %27, 1
br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom14, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %29, 1
br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7
lor.lhs.false6.7: ; preds = %lor.lhs.false.7
%arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom14
%30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5
%cmp11.7 = icmp eq i32 %30, 1
br i1 %cmp11.7, label %common.ret, label %if.end13.7
common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7
ret void
if.end13.7: ; preds = %lor.lhs.false6.7
store i32 7, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @PrintBoard() local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx8 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 0
%0 = load i32, ptr %arrayidx5, align 16, !tbaa !5
%cmp6 = icmp eq i32 %0, 1
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp eq i32 %1, 0
br i1 %cmp9.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp eq i32 %2, 1
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.1 = icmp eq i32 %3, 1
br i1 %cmp9.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 2
%4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%cmp6.2 = icmp eq i32 %4, 1
br i1 %cmp6.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.2 = icmp eq i32 %5, 2
br i1 %cmp9.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 3
%6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%cmp6.3 = icmp eq i32 %6, 1
br i1 %cmp6.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.3 = icmp eq i32 %7, 3
br i1 %cmp9.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 4
%8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5
%cmp6.4 = icmp eq i32 %8, 1
br i1 %cmp6.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.4 = icmp eq i32 %9, 4
br i1 %cmp9.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 5
%10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%cmp6.5 = icmp eq i32 %10, 1
br i1 %cmp6.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.5 = icmp eq i32 %11, 5
br i1 %cmp9.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 6
%12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5
%cmp6.6 = icmp eq i32 %12, 1
br i1 %cmp6.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.6 = icmp eq i32 %13, 6
br i1 %cmp9.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @Queen, i64 0, i64 %indvars.iv, i64 7
%14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%cmp6.7 = icmp eq i32 %14, 1
br i1 %cmp6.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.7 = icmp eq i32 %15, 7
br i1 %cmp9.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %if.then.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond18.preheader, label %for.cond1.preheader, !llvm.loop !11
for.cond18.preheader: ; preds = %for.inc.7, %for.cond18.preheader
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.cond18.preheader ], [ 0, %for.inc.7 ]
%arrayidx22 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv58
%16 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp eq i32 %16, 0
%. = select i1 %cmp23, i32 81, i32 46
%putchar48 = tail call i32 @putchar(i32 %.)
%17 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.1 = icmp eq i32 %17, 1
%.sink63 = select i1 %cmp23.1, i32 81, i32 46
%putchar48.1 = tail call i32 @putchar(i32 %.sink63)
%18 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.2 = icmp eq i32 %18, 2
%.sink64 = select i1 %cmp23.2, i32 81, i32 46
%putchar48.2 = tail call i32 @putchar(i32 %.sink64)
%19 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.3 = icmp eq i32 %19, 3
%.sink65 = select i1 %cmp23.3, i32 81, i32 46
%putchar48.3 = tail call i32 @putchar(i32 %.sink65)
%20 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.4 = icmp eq i32 %20, 4
%.sink66 = select i1 %cmp23.4, i32 81, i32 46
%putchar48.4 = tail call i32 @putchar(i32 %.sink66)
%21 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.5 = icmp eq i32 %21, 5
%.sink67 = select i1 %cmp23.5, i32 81, i32 46
%putchar48.5 = tail call i32 @putchar(i32 %.sink67)
%22 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.6 = icmp eq i32 %22, 6
%.sink68 = select i1 %cmp23.6, i32 81, i32 46
%putchar48.6 = tail call i32 @putchar(i32 %.sink68)
%23 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.7 = icmp eq i32 %23, 7
%.sink69 = select i1 %cmp23.7, i32 81, i32 46
%putchar48.7 = tail call i32 @putchar(i32 %.sink69)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond61.not = icmp eq i64 %indvars.iv.next59, 8
br i1 %exitcond61.not, label %cleanup, label %for.cond18.preheader, !llvm.loop !12
cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond18.preheader
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<string.h>
int a[8],b[8],c[16],d[16];
int e[8][8];
void dfs(int num)
{
if(num==8)
{
for(int i=0; i<8; i++)
{
for(int j=0; j<8; j++)
{
if (e[i][j])
{
if(a[i]!=j)
return;
}
}
}
for(int i=0; i<8; i++)
{
for(int j=0; j<8; j++)
{
if(a[i]==j)
printf("Q");
else printf(".");
}
printf("\n");
}
return;
}
for(int j=0; j<8; j++)
{
if(b[j]==1||c[num+j]==1||d[num-j+7]==1)
continue;
a[num]=j;
b[j]=c[num+j]=d[num-j+7]=1;
dfs(num+1);
a[num]=b[j]=c[num+j]=d[num-j+7]=0;
}
}
int main()
{
int n,m,t;
while(~ scanf("%d",&t))
{
memset(a,0,sizeof(a));
memset(b,0,sizeof(b));
memset(c,0,sizeof(c));
memset(d,0,sizeof(d));
memset(e,0,sizeof(e));
for(int i=0; i<t; i++)
{
scanf("%d %d",&n,&m);
e[n][m]=1;
}
dfs(0);}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232772/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232772/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@e = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [16 x i32] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [16 x i32] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @dfs(i32 noundef %num) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %num, 8
br i1 %cmp, label %for.cond2.preheader, label %for.cond46.preheader
for.cond46.preheader: ; preds = %entry
%sub = add i32 %num, 7
%idxprom63 = sext i32 %num to i64
%arrayidx64 = getelementptr inbounds [8 x i32], ptr @a, i64 0, i64 %idxprom63
%add74 = add nsw i32 %num, 1
%0 = load i32, ptr @b, align 16, !tbaa !5
%cmp52 = icmp eq i32 %0, 1
br i1 %cmp52, label %for.inc86, label %lor.lhs.false
for.cond2.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc.7 ], [ 0, %entry ]
%arrayidx10 = getelementptr inbounds [8 x i32], ptr @a, i64 0, i64 %indvars.iv
%arrayidx7 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 0
%1 = load i32, ptr %arrayidx7, align 16, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %for.inc, label %if.then8
if.then8: ; preds = %for.cond2.preheader
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not = icmp eq i32 %2, 0
br i1 %cmp11.not, label %for.inc, label %common.ret
for.inc: ; preds = %for.cond2.preheader, %if.then8
%arrayidx7.1 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 1
%3 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %3, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.then8.1
if.then8.1: ; preds = %for.inc
%4 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not.1 = icmp eq i32 %4, 1
br i1 %cmp11.not.1, label %for.inc.1, label %common.ret
for.inc.1: ; preds = %if.then8.1, %for.inc
%arrayidx7.2 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 2
%5 = load i32, ptr %arrayidx7.2, align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %5, 0
br i1 %tobool.not.2, label %for.inc.2, label %if.then8.2
if.then8.2: ; preds = %for.inc.1
%6 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not.2 = icmp eq i32 %6, 2
br i1 %cmp11.not.2, label %for.inc.2, label %common.ret
for.inc.2: ; preds = %if.then8.2, %for.inc.1
%arrayidx7.3 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 3
%7 = load i32, ptr %arrayidx7.3, align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %7, 0
br i1 %tobool.not.3, label %for.inc.3, label %if.then8.3
if.then8.3: ; preds = %for.inc.2
%8 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not.3 = icmp eq i32 %8, 3
br i1 %cmp11.not.3, label %for.inc.3, label %common.ret
for.inc.3: ; preds = %if.then8.3, %for.inc.2
%arrayidx7.4 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 4
%9 = load i32, ptr %arrayidx7.4, align 16, !tbaa !5
%tobool.not.4 = icmp eq i32 %9, 0
br i1 %tobool.not.4, label %for.inc.4, label %if.then8.4
if.then8.4: ; preds = %for.inc.3
%10 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not.4 = icmp eq i32 %10, 4
br i1 %cmp11.not.4, label %for.inc.4, label %common.ret
for.inc.4: ; preds = %if.then8.4, %for.inc.3
%arrayidx7.5 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 5
%11 = load i32, ptr %arrayidx7.5, align 4, !tbaa !5
%tobool.not.5 = icmp eq i32 %11, 0
br i1 %tobool.not.5, label %for.inc.5, label %if.then8.5
if.then8.5: ; preds = %for.inc.4
%12 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not.5 = icmp eq i32 %12, 5
br i1 %cmp11.not.5, label %for.inc.5, label %common.ret
for.inc.5: ; preds = %if.then8.5, %for.inc.4
%arrayidx7.6 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 6
%13 = load i32, ptr %arrayidx7.6, align 8, !tbaa !5
%tobool.not.6 = icmp eq i32 %13, 0
br i1 %tobool.not.6, label %for.inc.6, label %if.then8.6
if.then8.6: ; preds = %for.inc.5
%14 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not.6 = icmp eq i32 %14, 6
br i1 %cmp11.not.6, label %for.inc.6, label %common.ret
for.inc.6: ; preds = %if.then8.6, %for.inc.5
%arrayidx7.7 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %indvars.iv, i64 7
%15 = load i32, ptr %arrayidx7.7, align 4, !tbaa !5
%tobool.not.7 = icmp eq i32 %15, 0
br i1 %tobool.not.7, label %for.inc.7, label %if.then8.7
if.then8.7: ; preds = %for.inc.6
%16 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not.7 = icmp eq i32 %16, 7
br i1 %cmp11.not.7, label %for.inc.7, label %common.ret
for.inc.7: ; preds = %if.then8.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond25.preheader, label %for.cond2.preheader, !llvm.loop !9
for.cond25.preheader: ; preds = %for.inc.7, %for.cond25.preheader
%indvars.iv141 = phi i64 [ %indvars.iv.next142, %for.cond25.preheader ], [ 0, %for.inc.7 ]
%arrayidx30 = getelementptr inbounds [8 x i32], ptr @a, i64 0, i64 %indvars.iv141
%17 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31 = icmp eq i32 %17, 0
%. = select i1 %cmp31, i32 81, i32 46
%putchar122 = tail call i32 @putchar(i32 %.)
%18 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.1 = icmp eq i32 %18, 1
%.sink146 = select i1 %cmp31.1, i32 81, i32 46
%putchar122.1 = tail call i32 @putchar(i32 %.sink146)
%19 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.2 = icmp eq i32 %19, 2
%.sink147 = select i1 %cmp31.2, i32 81, i32 46
%putchar122.2 = tail call i32 @putchar(i32 %.sink147)
%20 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.3 = icmp eq i32 %20, 3
%.sink148 = select i1 %cmp31.3, i32 81, i32 46
%putchar122.3 = tail call i32 @putchar(i32 %.sink148)
%21 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.4 = icmp eq i32 %21, 4
%.sink149 = select i1 %cmp31.4, i32 81, i32 46
%putchar122.4 = tail call i32 @putchar(i32 %.sink149)
%22 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.5 = icmp eq i32 %22, 5
%.sink150 = select i1 %cmp31.5, i32 81, i32 46
%putchar122.5 = tail call i32 @putchar(i32 %.sink150)
%23 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.6 = icmp eq i32 %23, 6
%.sink151 = select i1 %cmp31.6, i32 81, i32 46
%putchar122.6 = tail call i32 @putchar(i32 %.sink151)
%24 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31.7 = icmp eq i32 %24, 7
%.sink152 = select i1 %cmp31.7, i32 81, i32 46
%putchar122.7 = tail call i32 @putchar(i32 %.sink152)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
%exitcond144.not = icmp eq i64 %indvars.iv.next142, 8
br i1 %exitcond144.not, label %common.ret, label %for.cond25.preheader, !llvm.loop !11
lor.lhs.false: ; preds = %for.cond46.preheader
%arrayidx54 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %idxprom63
%25 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%cmp55 = icmp eq i32 %25, 1
br i1 %cmp55, label %for.inc86, label %lor.lhs.false56
lor.lhs.false56: ; preds = %lor.lhs.false
%idxprom58 = sext i32 %sub to i64
%arrayidx59 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom58
%26 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%cmp60 = icmp eq i32 %26, 1
br i1 %cmp60, label %for.inc86, label %if.end62
if.end62: ; preds = %lor.lhs.false56
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59, align 4, !tbaa !5
store i32 1, ptr %arrayidx54, align 4, !tbaa !5
store i32 1, ptr @b, align 16, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59, align 4, !tbaa !5
store i32 0, ptr %arrayidx54, align 4, !tbaa !5
store i32 0, ptr @b, align 16, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %for.inc86
for.inc86: ; preds = %for.cond46.preheader, %lor.lhs.false, %lor.lhs.false56, %if.end62
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
%cmp52.1 = icmp eq i32 %27, 1
br i1 %cmp52.1, label %for.inc86.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc86
%28 = add nsw i64 %idxprom63, 1
%arrayidx54.1 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %28
%29 = load i32, ptr %arrayidx54.1, align 4, !tbaa !5
%cmp55.1 = icmp eq i32 %29, 1
br i1 %cmp55.1, label %for.inc86.1, label %lor.lhs.false56.1
lor.lhs.false56.1: ; preds = %lor.lhs.false.1
%add57.1 = add i32 %num, 6
%idxprom58.1 = sext i32 %add57.1 to i64
%arrayidx59.1 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom58.1
%30 = load i32, ptr %arrayidx59.1, align 4, !tbaa !5
%cmp60.1 = icmp eq i32 %30, 1
br i1 %cmp60.1, label %for.inc86.1, label %if.end62.1
if.end62.1: ; preds = %lor.lhs.false56.1
store i32 1, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx54.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59.1, align 4, !tbaa !5
store i32 0, ptr %arrayidx54.1, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %for.inc86.1
for.inc86.1: ; preds = %if.end62.1, %lor.lhs.false56.1, %lor.lhs.false.1, %for.inc86
%31 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
%cmp52.2 = icmp eq i32 %31, 1
br i1 %cmp52.2, label %for.inc86.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc86.1
%32 = add nsw i64 %idxprom63, 2
%arrayidx54.2 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %32
%33 = load i32, ptr %arrayidx54.2, align 4, !tbaa !5
%cmp55.2 = icmp eq i32 %33, 1
br i1 %cmp55.2, label %for.inc86.2, label %lor.lhs.false56.2
lor.lhs.false56.2: ; preds = %lor.lhs.false.2
%add57.2 = add i32 %num, 5
%idxprom58.2 = sext i32 %add57.2 to i64
%arrayidx59.2 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom58.2
%34 = load i32, ptr %arrayidx59.2, align 4, !tbaa !5
%cmp60.2 = icmp eq i32 %34, 1
br i1 %cmp60.2, label %for.inc86.2, label %if.end62.2
if.end62.2: ; preds = %lor.lhs.false56.2
store i32 2, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx54.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59.2, align 4, !tbaa !5
store i32 0, ptr %arrayidx54.2, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %for.inc86.2
for.inc86.2: ; preds = %if.end62.2, %lor.lhs.false56.2, %lor.lhs.false.2, %for.inc86.1
%35 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
%cmp52.3 = icmp eq i32 %35, 1
br i1 %cmp52.3, label %for.inc86.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc86.2
%36 = add nsw i64 %idxprom63, 3
%arrayidx54.3 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %36
%37 = load i32, ptr %arrayidx54.3, align 4, !tbaa !5
%cmp55.3 = icmp eq i32 %37, 1
br i1 %cmp55.3, label %for.inc86.3, label %lor.lhs.false56.3
lor.lhs.false56.3: ; preds = %lor.lhs.false.3
%add57.3 = add i32 %num, 4
%idxprom58.3 = sext i32 %add57.3 to i64
%arrayidx59.3 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom58.3
%38 = load i32, ptr %arrayidx59.3, align 4, !tbaa !5
%cmp60.3 = icmp eq i32 %38, 1
br i1 %cmp60.3, label %for.inc86.3, label %if.end62.3
if.end62.3: ; preds = %lor.lhs.false56.3
store i32 3, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx54.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59.3, align 4, !tbaa !5
store i32 0, ptr %arrayidx54.3, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %for.inc86.3
for.inc86.3: ; preds = %if.end62.3, %lor.lhs.false56.3, %lor.lhs.false.3, %for.inc86.2
%39 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
%cmp52.4 = icmp eq i32 %39, 1
br i1 %cmp52.4, label %for.inc86.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc86.3
%40 = add nsw i64 %idxprom63, 4
%arrayidx54.4 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %40
%41 = load i32, ptr %arrayidx54.4, align 4, !tbaa !5
%cmp55.4 = icmp eq i32 %41, 1
br i1 %cmp55.4, label %for.inc86.4, label %lor.lhs.false56.4
lor.lhs.false56.4: ; preds = %lor.lhs.false.4
%add57.4 = add i32 %num, 3
%idxprom58.4 = sext i32 %add57.4 to i64
%arrayidx59.4 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom58.4
%42 = load i32, ptr %arrayidx59.4, align 4, !tbaa !5
%cmp60.4 = icmp eq i32 %42, 1
br i1 %cmp60.4, label %for.inc86.4, label %if.end62.4
if.end62.4: ; preds = %lor.lhs.false56.4
store i32 4, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx54.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59.4, align 4, !tbaa !5
store i32 0, ptr %arrayidx54.4, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %for.inc86.4
for.inc86.4: ; preds = %if.end62.4, %lor.lhs.false56.4, %lor.lhs.false.4, %for.inc86.3
%43 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
%cmp52.5 = icmp eq i32 %43, 1
br i1 %cmp52.5, label %for.inc86.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc86.4
%44 = add nsw i64 %idxprom63, 5
%arrayidx54.5 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %44
%45 = load i32, ptr %arrayidx54.5, align 4, !tbaa !5
%cmp55.5 = icmp eq i32 %45, 1
br i1 %cmp55.5, label %for.inc86.5, label %lor.lhs.false56.5
lor.lhs.false56.5: ; preds = %lor.lhs.false.5
%add57.5 = add i32 %num, 2
%idxprom58.5 = sext i32 %add57.5 to i64
%arrayidx59.5 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom58.5
%46 = load i32, ptr %arrayidx59.5, align 4, !tbaa !5
%cmp60.5 = icmp eq i32 %46, 1
br i1 %cmp60.5, label %for.inc86.5, label %if.end62.5
if.end62.5: ; preds = %lor.lhs.false56.5
store i32 5, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx54.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59.5, align 4, !tbaa !5
store i32 0, ptr %arrayidx54.5, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %for.inc86.5
for.inc86.5: ; preds = %if.end62.5, %lor.lhs.false56.5, %lor.lhs.false.5, %for.inc86.4
%47 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
%cmp52.6 = icmp eq i32 %47, 1
br i1 %cmp52.6, label %for.inc86.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc86.5
%48 = add nsw i64 %idxprom63, 6
%arrayidx54.6 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %48
%49 = load i32, ptr %arrayidx54.6, align 4, !tbaa !5
%cmp55.6 = icmp eq i32 %49, 1
br i1 %cmp55.6, label %for.inc86.6, label %lor.lhs.false56.6
lor.lhs.false56.6: ; preds = %lor.lhs.false.6
%add57.6 = add i32 %num, 1
%idxprom58.6 = sext i32 %add57.6 to i64
%arrayidx59.6 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom58.6
%50 = load i32, ptr %arrayidx59.6, align 4, !tbaa !5
%cmp60.6 = icmp eq i32 %50, 1
br i1 %cmp60.6, label %for.inc86.6, label %if.end62.6
if.end62.6: ; preds = %lor.lhs.false56.6
store i32 6, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx54.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59.6, align 4, !tbaa !5
store i32 0, ptr %arrayidx54.6, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %for.inc86.6
for.inc86.6: ; preds = %if.end62.6, %lor.lhs.false56.6, %lor.lhs.false.6, %for.inc86.5
%51 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 7), align 4, !tbaa !5
%cmp52.7 = icmp eq i32 %51, 1
br i1 %cmp52.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc86.6
%52 = add nsw i64 %idxprom63, 7
%arrayidx54.7 = getelementptr inbounds [16 x i32], ptr @c, i64 0, i64 %52
%53 = load i32, ptr %arrayidx54.7, align 4, !tbaa !5
%cmp55.7 = icmp eq i32 %53, 1
br i1 %cmp55.7, label %common.ret, label %lor.lhs.false56.7
lor.lhs.false56.7: ; preds = %lor.lhs.false.7
%arrayidx59.7 = getelementptr inbounds [16 x i32], ptr @d, i64 0, i64 %idxprom63
%54 = load i32, ptr %arrayidx59.7, align 4, !tbaa !5
%cmp60.7 = icmp eq i32 %54, 1
br i1 %cmp60.7, label %common.ret, label %if.end62.7
common.ret: ; preds = %lor.lhs.false56.7, %lor.lhs.false.7, %for.inc86.6, %for.cond25.preheader, %if.then8.7, %if.then8.6, %if.then8.5, %if.then8.4, %if.then8.3, %if.then8.2, %if.then8.1, %if.then8, %if.end62.7
ret void
if.end62.7: ; preds = %lor.lhs.false56.7
store i32 7, ptr %arrayidx64, align 4, !tbaa !5
store i32 1, ptr %arrayidx59.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx54.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 7), align 4, !tbaa !5
tail call void @dfs(i32 noundef %add74)
store i32 0, ptr %arrayidx59.7, align 4, !tbaa !5
store i32 0, ptr %arrayidx54.7, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @b, i64 0, i64 7), align 4, !tbaa !5
store i32 0, ptr %arrayidx64, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %t)
%tobool.not8 = icmp eq i32 %call7, -1
br i1 %tobool.not8, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @a, i8 0, i64 32, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @b, i8 0, i64 32, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @c, i8 0, i64 64, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @d, i8 0, i64 64, i1 false)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @e, i8 0, i64 256, i1 false)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %while.body
call void @dfs(i32 noundef 0)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %t)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
for.body: ; preds = %while.body, %for.body
%i.06 = phi i32 [ %inc, %for.body ], [ 0, %while.body ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %n, ptr noundef nonnull %m)
%1 = load i32, ptr %n, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%2 = load i32, ptr %m, align 4, !tbaa !5
%idxprom2 = sext i32 %2 to i64
%arrayidx3 = getelementptr inbounds [8 x [8 x i32]], ptr @e, i64 0, i64 %idxprom, i64 %idxprom2
store i32 1, ptr %arrayidx3, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.06, 1
%3 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
while.end: ; preds = %for.cond.cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#include<string.h>
#define N 8
#define FREE -1
#define NOT_FREE 1
int X[N][N],row[N],col[N],dpos[2*N-1],dneg[2*N-1];
void initialize(){
int i,j;
for(i=0;i<N;i++){
row[i] = FREE;
col[i] = FREE;
for(j=0;j<N;j++){
X[i][j]=0;
}
}
for(j=0;j<2*N-1;i++){
dpos[j]=FREE;
dneg[j]=FREE;
}
}
void printBoard(){
int i,j;
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(X[i][j]){
if(row[i]!=j) return;
}
}
}
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(row[i]==j) {
printf("Q");
}
else {
printf(".");
}
}
printf("\n");
}
return;
}
void recursive(int i){
int j;
if(i==N){
printBoard();
return;
}
for(j=0;j<N;j++){
if(col[j] == NOT_FREE ||
dpos[i+j] == NOT_FREE ||
dneg[i-j + N-1] == NOT_FREE ) {
continue;
}
row[i]=j; col[j] = dpos[i+j] = dneg[i-j + N-1] = NOT_FREE;
recursive(i+1);
row[i] = col[j] = dpos[i+j] = dneg[i-j + N-1] = FREE;
}
}
int main(){
int i,j,x,y,n;
//initialize();
for(i=0;i<N;i++){
row[i] = FREE;
col[i] = FREE;
for(j=0;j<N;j++){
X[i][j]=0;
}
}
for(j=0;j<2*N-1;j++){
dpos[j]=FREE;
dneg[j]=FREE;
}
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d%d",&x,&y);
X[x][y]=1;
}
recursive(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232815/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232815/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@X = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) uwtable
define dso_local void @initialize() local_unnamed_addr #0 {
entry:
unreachable
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @printBoard() local_unnamed_addr #2 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx7 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 0
%0 = load i32, ptr %arrayidx5, align 16, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %for.inc, label %if.then
if.then: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not = icmp eq i32 %1, 0
br i1 %cmp8.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %2, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.1 = icmp eq i32 %3, 1
br i1 %cmp8.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 2
%4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %4, 0
br i1 %tobool.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.2 = icmp eq i32 %5, 2
br i1 %cmp8.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 3
%6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %6, 0
br i1 %tobool.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.3 = icmp eq i32 %7, 3
br i1 %cmp8.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 4
%8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5
%tobool.not.4 = icmp eq i32 %8, 0
br i1 %tobool.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.4 = icmp eq i32 %9, 4
br i1 %cmp8.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 5
%10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%tobool.not.5 = icmp eq i32 %10, 0
br i1 %tobool.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.5 = icmp eq i32 %11, 5
br i1 %cmp8.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 6
%12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5
%tobool.not.6 = icmp eq i32 %12, 0
br i1 %tobool.not.6, label %for.inc.6, label %if.then.6
if.then.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.6 = icmp eq i32 %13, 6
br i1 %cmp8.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %indvars.iv, i64 7
%14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%tobool.not.7 = icmp eq i32 %14, 0
br i1 %tobool.not.7, label %for.inc.7, label %if.then.7
if.then.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.7 = icmp eq i32 %15, 7
br i1 %cmp8.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %if.then.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond17.preheader, label %for.cond1.preheader, !llvm.loop !9
for.cond17.preheader: ; preds = %for.inc.7, %for.cond17.preheader
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.cond17.preheader ], [ 0, %for.inc.7 ]
%arrayidx21 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv57
%16 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp eq i32 %16, 0
%. = select i1 %cmp22, i32 81, i32 46
%putchar47 = tail call i32 @putchar(i32 %.)
%17 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.1 = icmp eq i32 %17, 1
%.sink62 = select i1 %cmp22.1, i32 81, i32 46
%putchar47.1 = tail call i32 @putchar(i32 %.sink62)
%18 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.2 = icmp eq i32 %18, 2
%.sink63 = select i1 %cmp22.2, i32 81, i32 46
%putchar47.2 = tail call i32 @putchar(i32 %.sink63)
%19 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.3 = icmp eq i32 %19, 3
%.sink64 = select i1 %cmp22.3, i32 81, i32 46
%putchar47.3 = tail call i32 @putchar(i32 %.sink64)
%20 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.4 = icmp eq i32 %20, 4
%.sink65 = select i1 %cmp22.4, i32 81, i32 46
%putchar47.4 = tail call i32 @putchar(i32 %.sink65)
%21 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.5 = icmp eq i32 %21, 5
%.sink66 = select i1 %cmp22.5, i32 81, i32 46
%putchar47.5 = tail call i32 @putchar(i32 %.sink66)
%22 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.6 = icmp eq i32 %22, 6
%.sink67 = select i1 %cmp22.6, i32 81, i32 46
%putchar47.6 = tail call i32 @putchar(i32 %.sink67)
%23 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.7 = icmp eq i32 %23, 7
%.sink68 = select i1 %cmp22.7, i32 81, i32 46
%putchar47.7 = tail call i32 @putchar(i32 %.sink68)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%exitcond60.not = icmp eq i64 %indvars.iv.next58, 8
br i1 %exitcond60.not, label %cleanup, label %for.cond17.preheader, !llvm.loop !11
cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond17.preheader
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @recursive(i32 noundef %i) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %i, 7
%idxprom14 = sext i32 %i to i64
%arrayidx15 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom14
%add26 = add nsw i32 %i, 1
%0 = load i32, ptr @col, align 16, !tbaa !5
%cmp2 = icmp eq i32 %0, 1
br i1 %cmp2, label %for.inc, label %lor.lhs.false
if.then: ; preds = %entry
tail call void @printBoard()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom14
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, 1
br i1 %cmp5, label %for.inc, label %lor.lhs.false6
lor.lhs.false6: ; preds = %lor.lhs.false
%idxprom9 = sext i32 %sub to i64
%arrayidx10 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp eq i32 %2, 1
br i1 %cmp11, label %for.inc, label %if.end13
if.end13: ; preds = %lor.lhs.false6
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr @col, align 16, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4, align 4, !tbaa !5
store i32 -1, ptr @col, align 16, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, 1
br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom14, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %5, 1
br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1
lor.lhs.false6.1: ; preds = %lor.lhs.false.1
%sub8.1 = add i32 %i, 6
%idxprom9.1 = sext i32 %sub8.1 to i64
%arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.1
%6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %6, 1
br i1 %cmp11.1, label %for.inc.1, label %if.end13.1
if.end13.1: ; preds = %lor.lhs.false6.1
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
%cmp2.2 = icmp eq i32 %7, 1
br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom14, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %9, 1
br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2
lor.lhs.false6.2: ; preds = %lor.lhs.false.2
%sub8.2 = add i32 %i, 5
%idxprom9.2 = sext i32 %sub8.2 to i64
%arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.2
%10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%cmp11.2 = icmp eq i32 %10, 1
br i1 %cmp11.2, label %for.inc.2, label %if.end13.2
if.end13.2: ; preds = %lor.lhs.false6.2
store i32 2, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %11, 1
br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom14, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %13, 1
br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3
lor.lhs.false6.3: ; preds = %lor.lhs.false.3
%sub8.3 = add i32 %i, 4
%idxprom9.3 = sext i32 %sub8.3 to i64
%arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.3
%14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%cmp11.3 = icmp eq i32 %14, 1
br i1 %cmp11.3, label %for.inc.3, label %if.end13.3
if.end13.3: ; preds = %lor.lhs.false6.3
store i32 3, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
%cmp2.4 = icmp eq i32 %15, 1
br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom14, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %17, 1
br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4
lor.lhs.false6.4: ; preds = %lor.lhs.false.4
%sub8.4 = add i32 %i, 3
%idxprom9.4 = sext i32 %sub8.4 to i64
%arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.4
%18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5
%cmp11.4 = icmp eq i32 %18, 1
br i1 %cmp11.4, label %for.inc.4, label %if.end13.4
if.end13.4: ; preds = %lor.lhs.false6.4
store i32 4, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
%cmp2.5 = icmp eq i32 %19, 1
br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom14, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %21, 1
br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5
lor.lhs.false6.5: ; preds = %lor.lhs.false.5
%sub8.5 = add i32 %i, 2
%idxprom9.5 = sext i32 %sub8.5 to i64
%arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.5
%22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5
%cmp11.5 = icmp eq i32 %22, 1
br i1 %cmp11.5, label %for.inc.5, label %if.end13.5
if.end13.5: ; preds = %lor.lhs.false6.5
store i32 5, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
%cmp2.6 = icmp eq i32 %23, 1
br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom14, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %25, 1
br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6
lor.lhs.false6.6: ; preds = %lor.lhs.false.6
%sub8.6 = add i32 %i, 1
%idxprom9.6 = sext i32 %sub8.6 to i64
%arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom9.6
%26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5
%cmp11.6 = icmp eq i32 %26, 1
br i1 %cmp11.6, label %for.inc.6, label %if.end13.6
if.end13.6: ; preds = %lor.lhs.false6.6
store i32 6, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
%cmp2.7 = icmp eq i32 %27, 1
br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom14, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %29, 1
br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7
lor.lhs.false6.7: ; preds = %lor.lhs.false.7
%arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom14
%30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5
%cmp11.7 = icmp eq i32 %30, 1
br i1 %cmp11.7, label %common.ret, label %if.end13.7
common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7
ret void
if.end13.7: ; preds = %lor.lhs.false6.7
store i32 7, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @X, i8 0, i64 256, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 -1, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 -1, i64 60, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp2449 = icmp sgt i32 %0, 0
br i1 %cmp2449, label %for.body25, label %for.end33
for.body25: ; preds = %entry, %for.body25
%i.150 = phi i32 [ %inc32, %for.body25 ], [ 0, %entry ]
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i32, ptr %x, align 4, !tbaa !5
%idxprom27 = sext i32 %1 to i64
%2 = load i32, ptr %y, align 4, !tbaa !5
%idxprom29 = sext i32 %2 to i64
%arrayidx30 = getelementptr inbounds [8 x [8 x i32]], ptr @X, i64 0, i64 %idxprom27, i64 %idxprom29
store i32 1, ptr %arrayidx30, align 4, !tbaa !5
%inc32 = add nuw nsw i32 %i.150, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp24 = icmp slt i32 %inc32, %3
br i1 %cmp24, label %for.body25, label %for.end33, !llvm.loop !12
for.end33: ; preds = %for.body25, %entry
call void @recursive(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { mustprogress nofree norecurse noreturn nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define N 8
int C[N], dpos[2*N-1], dneg[2*N-1], r[N], B[N][N]; // 0:FREE 1:NOTFREE
void init(void){
for(int i = 0; i < N; i++){
C[i] = 0;
r[i] = 0;
for(int j = 0; j < N; j++){
B[i][j] = 0;
}
}
for(int i = 0; i < 2*N-1; i++){
dpos[i] = 0;
dneg[i] = 0;
}
}
void printB(){
int i, j;
for(i = 0; i < N; i++){
for(j = 0; j < N; j++){
if(B[i][j] == 1){
if(r[i] != j) return;
}
}
}
for(i = 0; i < N; i++){
for(j = 0; j < N; j++){
if(r[i] == j) printf("Q");
else printf(".");
}
printf("\n");
}
}
void putQueen(int p){
int i;
if(p == N){
printB();
return ;
}
for(i = 0; i < N; i++){
if(C[i] == 1 || dpos[p+i] == 1) continue;
if(dneg[p-i+N-1] == 1) continue;
r[p] = i;
C[i] = dpos[p+i] = dneg[p-i+N-1] = 1;
putQueen(p+1);
r[p] = C[i] = dpos[p+i] = dneg[p-i+N-1] = 0;
}
}
int main(){
int nm, i, p, q, j;
init();
scanf("%d", &nm);
for(i = 0; i < nm; i++){
scanf("%d%d", &p, &q);
B[p][q] = 1;
}
putQueen(0);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232859/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232859/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@C = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@r = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@B = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init() local_unnamed_addr #0 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @C, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @r, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @B, i8 0, i64 256, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 0, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 0, i64 60, i1 false), !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @printB() local_unnamed_addr #2 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx8 = getelementptr inbounds [8 x i32], ptr @r, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 0
%0 = load i32, ptr %arrayidx5, align 16, !tbaa !5
%cmp6 = icmp eq i32 %0, 1
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp eq i32 %1, 0
br i1 %cmp9.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp eq i32 %2, 1
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.1 = icmp eq i32 %3, 1
br i1 %cmp9.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 2
%4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%cmp6.2 = icmp eq i32 %4, 1
br i1 %cmp6.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.2 = icmp eq i32 %5, 2
br i1 %cmp9.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 3
%6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%cmp6.3 = icmp eq i32 %6, 1
br i1 %cmp6.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.3 = icmp eq i32 %7, 3
br i1 %cmp9.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 4
%8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5
%cmp6.4 = icmp eq i32 %8, 1
br i1 %cmp6.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.4 = icmp eq i32 %9, 4
br i1 %cmp9.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 5
%10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%cmp6.5 = icmp eq i32 %10, 1
br i1 %cmp6.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.5 = icmp eq i32 %11, 5
br i1 %cmp9.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 6
%12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5
%cmp6.6 = icmp eq i32 %12, 1
br i1 %cmp6.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.6 = icmp eq i32 %13, 6
br i1 %cmp9.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %indvars.iv, i64 7
%14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%cmp6.7 = icmp eq i32 %14, 1
br i1 %cmp6.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.7 = icmp eq i32 %15, 7
br i1 %cmp9.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %if.then.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond18.preheader, label %for.cond1.preheader, !llvm.loop !9
for.cond18.preheader: ; preds = %for.inc.7, %for.cond18.preheader
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.cond18.preheader ], [ 0, %for.inc.7 ]
%arrayidx22 = getelementptr inbounds [8 x i32], ptr @r, i64 0, i64 %indvars.iv58
%16 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp eq i32 %16, 0
%. = select i1 %cmp23, i32 81, i32 46
%putchar48 = tail call i32 @putchar(i32 %.)
%17 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.1 = icmp eq i32 %17, 1
%.sink63 = select i1 %cmp23.1, i32 81, i32 46
%putchar48.1 = tail call i32 @putchar(i32 %.sink63)
%18 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.2 = icmp eq i32 %18, 2
%.sink64 = select i1 %cmp23.2, i32 81, i32 46
%putchar48.2 = tail call i32 @putchar(i32 %.sink64)
%19 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.3 = icmp eq i32 %19, 3
%.sink65 = select i1 %cmp23.3, i32 81, i32 46
%putchar48.3 = tail call i32 @putchar(i32 %.sink65)
%20 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.4 = icmp eq i32 %20, 4
%.sink66 = select i1 %cmp23.4, i32 81, i32 46
%putchar48.4 = tail call i32 @putchar(i32 %.sink66)
%21 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.5 = icmp eq i32 %21, 5
%.sink67 = select i1 %cmp23.5, i32 81, i32 46
%putchar48.5 = tail call i32 @putchar(i32 %.sink67)
%22 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.6 = icmp eq i32 %22, 6
%.sink68 = select i1 %cmp23.6, i32 81, i32 46
%putchar48.6 = tail call i32 @putchar(i32 %.sink68)
%23 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.7 = icmp eq i32 %23, 7
%.sink69 = select i1 %cmp23.7, i32 81, i32 46
%putchar48.7 = tail call i32 @putchar(i32 %.sink69)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond61.not = icmp eq i64 %indvars.iv.next59, 8
br i1 %exitcond61.not, label %cleanup, label %for.cond18.preheader, !llvm.loop !11
cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond18.preheader
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @putQueen(i32 noundef %p) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i32 %p, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %p, 7
%idxprom15 = sext i32 %p to i64
%arrayidx16 = getelementptr inbounds [8 x i32], ptr @r, i64 0, i64 %idxprom15
%add27 = add nsw i32 %p, 1
%0 = load i32, ptr @C, align 16, !tbaa !5
%cmp2 = icmp eq i32 %0, 1
br i1 %cmp2, label %for.inc, label %lor.lhs.false
if.then: ; preds = %entry
tail call void @printB()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom15
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, 1
br i1 %cmp5, label %for.inc, label %if.end7
if.end7: ; preds = %lor.lhs.false
%idxprom10 = sext i32 %sub to i64
%arrayidx11 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom10
%2 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp eq i32 %2, 1
br i1 %cmp12, label %for.inc, label %if.end14
if.end14: ; preds = %if.end7
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11, align 4, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr @C, align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11, align 4, !tbaa !5
store i32 0, ptr %arrayidx4, align 4, !tbaa !5
store i32 0, ptr @C, align 16, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end7, %for.cond.preheader, %lor.lhs.false, %if.end14
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, 1
br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom15, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %5, 1
br i1 %cmp5.1, label %for.inc.1, label %if.end7.1
if.end7.1: ; preds = %lor.lhs.false.1
%sub9.1 = add i32 %p, 6
%idxprom10.1 = sext i32 %sub9.1 to i64
%arrayidx11.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom10.1
%6 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%cmp12.1 = icmp eq i32 %6, 1
br i1 %cmp12.1, label %for.inc.1, label %if.end14.1
if.end14.1: ; preds = %if.end7.1
store i32 1, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11.1, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end14.1, %if.end7.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
%cmp2.2 = icmp eq i32 %7, 1
br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom15, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %9, 1
br i1 %cmp5.2, label %for.inc.2, label %if.end7.2
if.end7.2: ; preds = %lor.lhs.false.2
%sub9.2 = add i32 %p, 5
%idxprom10.2 = sext i32 %sub9.2 to i64
%arrayidx11.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom10.2
%10 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5
%cmp12.2 = icmp eq i32 %10, 1
br i1 %cmp12.2, label %for.inc.2, label %if.end14.2
if.end14.2: ; preds = %if.end7.2
store i32 2, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11.2, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end14.2, %if.end7.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %11, 1
br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom15, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %13, 1
br i1 %cmp5.3, label %for.inc.3, label %if.end7.3
if.end7.3: ; preds = %lor.lhs.false.3
%sub9.3 = add i32 %p, 4
%idxprom10.3 = sext i32 %sub9.3 to i64
%arrayidx11.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom10.3
%14 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%cmp12.3 = icmp eq i32 %14, 1
br i1 %cmp12.3, label %for.inc.3, label %if.end14.3
if.end14.3: ; preds = %if.end7.3
store i32 3, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11.3, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end14.3, %if.end7.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
%cmp2.4 = icmp eq i32 %15, 1
br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom15, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %17, 1
br i1 %cmp5.4, label %for.inc.4, label %if.end7.4
if.end7.4: ; preds = %lor.lhs.false.4
%sub9.4 = add i32 %p, 3
%idxprom10.4 = sext i32 %sub9.4 to i64
%arrayidx11.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom10.4
%18 = load i32, ptr %arrayidx11.4, align 4, !tbaa !5
%cmp12.4 = icmp eq i32 %18, 1
br i1 %cmp12.4, label %for.inc.4, label %if.end14.4
if.end14.4: ; preds = %if.end7.4
store i32 4, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11.4, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end14.4, %if.end7.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
%cmp2.5 = icmp eq i32 %19, 1
br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom15, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %21, 1
br i1 %cmp5.5, label %for.inc.5, label %if.end7.5
if.end7.5: ; preds = %lor.lhs.false.5
%sub9.5 = add i32 %p, 2
%idxprom10.5 = sext i32 %sub9.5 to i64
%arrayidx11.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom10.5
%22 = load i32, ptr %arrayidx11.5, align 4, !tbaa !5
%cmp12.5 = icmp eq i32 %22, 1
br i1 %cmp12.5, label %for.inc.5, label %if.end14.5
if.end14.5: ; preds = %if.end7.5
store i32 5, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11.5, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end14.5, %if.end7.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 6), align 8, !tbaa !5
%cmp2.6 = icmp eq i32 %23, 1
br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom15, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %25, 1
br i1 %cmp5.6, label %for.inc.6, label %if.end7.6
if.end7.6: ; preds = %lor.lhs.false.6
%sub9.6 = add i32 %p, 1
%idxprom10.6 = sext i32 %sub9.6 to i64
%arrayidx11.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom10.6
%26 = load i32, ptr %arrayidx11.6, align 4, !tbaa !5
%cmp12.6 = icmp eq i32 %26, 1
br i1 %cmp12.6, label %for.inc.6, label %if.end14.6
if.end14.6: ; preds = %if.end7.6
store i32 6, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 6), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11.6, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 6), align 8, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end14.6, %if.end7.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 7), align 4, !tbaa !5
%cmp2.7 = icmp eq i32 %27, 1
br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom15, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %29, 1
br i1 %cmp5.7, label %common.ret, label %if.end7.7
if.end7.7: ; preds = %lor.lhs.false.7
%arrayidx11.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom15
%30 = load i32, ptr %arrayidx11.7, align 4, !tbaa !5
%cmp12.7 = icmp eq i32 %30, 1
br i1 %cmp12.7, label %common.ret, label %if.end14.7
common.ret: ; preds = %if.then, %if.end7.7, %lor.lhs.false.7, %for.inc.6, %if.end14.7
ret void
if.end14.7: ; preds = %if.end7.7
store i32 7, ptr %arrayidx16, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 7), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add27)
store i32 0, ptr %arrayidx11.7, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @C, i64 0, i64 7), align 4, !tbaa !5
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%nm = alloca i32, align 4
%p = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nm) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @C, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @r, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @B, i8 0, i64 256, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 0, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 0, i64 60, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %nm)
%0 = load i32, ptr %nm, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %p, ptr noundef nonnull %q)
%1 = load i32, ptr %p, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%2 = load i32, ptr %q, align 4, !tbaa !5
%idxprom2 = sext i32 %2 to i64
%arrayidx3 = getelementptr inbounds [8 x [8 x i32]], ptr @B, i64 0, i64 %idxprom, i64 %idxprom2
store i32 1, ptr %arrayidx3, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.06, 1
%3 = load i32, ptr %nm, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body, %entry
call void @putQueen(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nm) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define N 8
#define FR -1
#define NFR 1
int m[N][N], r[N], c[N], dp[2*N-1], dn[2*N-1];
void print()
{
int i, j;
for (i = 0; i < N; i++)
for ( j = 0; j < N; j++)
if (m[i][j] == NFR)
if (r[i] != j)
return;
for (i = 0; i < N; i++){
for (j = 0; j < N; j++){
if (r[i] == j)
printf("Q");
else
printf(".");
}
printf("\n");
}
}
void recursive(int i)
{
int j;
if (i == N){
print();
return;
}
for (j = 0; j < N; j++){
if (c[j] != FR || dp[i+j] != FR || dn[i-j+N-1] != FR)
continue;
r[i] = j;
c[j] = dp[i+j] = dn[i-j+N-1] = NFR;
recursive(i+1);
r[i] = c[j] = dp[i+j] = dn[i-j+N-1] = FR;
}
}
int main()
{
int k, row, col, i, j;
for (i = 0; i < N; i++)
r[i] = c[i] = FR;
for (i = 0; i < 2*N-1; i++)
dp[i] = dn[i] = FR;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
m[i][j] = FR;
scanf("%d",&k);
for (i = 0; i < k; i++){
scanf("%d%d",&row,&col);
m[row][col] = NFR;
}
recursive(0);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232901/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232901/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@m = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@r = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@dp = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dn = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @print() local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx8 = getelementptr inbounds [8 x i32], ptr @r, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 0
%0 = load i32, ptr %arrayidx5, align 16, !tbaa !5
%cmp6 = icmp eq i32 %0, 1
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp eq i32 %1, 0
br i1 %cmp9.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp eq i32 %2, 1
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.1 = icmp eq i32 %3, 1
br i1 %cmp9.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 2
%4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%cmp6.2 = icmp eq i32 %4, 1
br i1 %cmp6.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.2 = icmp eq i32 %5, 2
br i1 %cmp9.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 3
%6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%cmp6.3 = icmp eq i32 %6, 1
br i1 %cmp6.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.3 = icmp eq i32 %7, 3
br i1 %cmp9.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 4
%8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5
%cmp6.4 = icmp eq i32 %8, 1
br i1 %cmp6.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.4 = icmp eq i32 %9, 4
br i1 %cmp9.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 5
%10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%cmp6.5 = icmp eq i32 %10, 1
br i1 %cmp6.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.5 = icmp eq i32 %11, 5
br i1 %cmp9.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 6
%12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5
%cmp6.6 = icmp eq i32 %12, 1
br i1 %cmp6.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.6 = icmp eq i32 %13, 6
br i1 %cmp9.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 7
%14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%cmp6.7 = icmp eq i32 %14, 1
br i1 %cmp6.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.7 = icmp eq i32 %15, 7
br i1 %cmp9.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %if.then.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond18.preheader, label %for.cond1.preheader, !llvm.loop !9
for.cond18.preheader: ; preds = %for.inc.7, %for.cond18.preheader
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.cond18.preheader ], [ 0, %for.inc.7 ]
%arrayidx22 = getelementptr inbounds [8 x i32], ptr @r, i64 0, i64 %indvars.iv58
%16 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp eq i32 %16, 0
%. = select i1 %cmp23, i32 81, i32 46
%putchar48 = tail call i32 @putchar(i32 %.)
%17 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.1 = icmp eq i32 %17, 1
%.sink63 = select i1 %cmp23.1, i32 81, i32 46
%putchar48.1 = tail call i32 @putchar(i32 %.sink63)
%18 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.2 = icmp eq i32 %18, 2
%.sink64 = select i1 %cmp23.2, i32 81, i32 46
%putchar48.2 = tail call i32 @putchar(i32 %.sink64)
%19 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.3 = icmp eq i32 %19, 3
%.sink65 = select i1 %cmp23.3, i32 81, i32 46
%putchar48.3 = tail call i32 @putchar(i32 %.sink65)
%20 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.4 = icmp eq i32 %20, 4
%.sink66 = select i1 %cmp23.4, i32 81, i32 46
%putchar48.4 = tail call i32 @putchar(i32 %.sink66)
%21 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.5 = icmp eq i32 %21, 5
%.sink67 = select i1 %cmp23.5, i32 81, i32 46
%putchar48.5 = tail call i32 @putchar(i32 %.sink67)
%22 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.6 = icmp eq i32 %22, 6
%.sink68 = select i1 %cmp23.6, i32 81, i32 46
%putchar48.6 = tail call i32 @putchar(i32 %.sink68)
%23 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.7 = icmp eq i32 %23, 7
%.sink69 = select i1 %cmp23.7, i32 81, i32 46
%putchar48.7 = tail call i32 @putchar(i32 %.sink69)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond61.not = icmp eq i64 %indvars.iv.next59, 8
br i1 %exitcond61.not, label %cleanup, label %for.cond18.preheader, !llvm.loop !11
cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond18.preheader
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @recursive(i32 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %i, 7
%idxprom14 = sext i32 %i to i64
%arrayidx15 = getelementptr inbounds [8 x i32], ptr @r, i64 0, i64 %idxprom14
%add26 = add nsw i32 %i, 1
%0 = load i32, ptr @c, align 16, !tbaa !5
%cmp2.not = icmp eq i32 %0, -1
br i1 %cmp2.not, label %lor.lhs.false, label %for.inc
if.then: ; preds = %entry
tail call void @print()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %idxprom14
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5.not = icmp eq i32 %1, -1
br i1 %cmp5.not, label %lor.lhs.false6, label %for.inc
lor.lhs.false6: ; preds = %lor.lhs.false
%idxprom9 = sext i32 %sub to i64
%arrayidx10 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom9
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not = icmp eq i32 %2, -1
br i1 %cmp11.not, label %if.end13, label %for.inc
if.end13: ; preds = %lor.lhs.false6
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr @c, align 16, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4, align 4, !tbaa !5
store i32 -1, ptr @c, align 16, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
%cmp2.not.1 = icmp eq i32 %3, -1
br i1 %cmp2.not.1, label %lor.lhs.false.1, label %for.inc.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom14, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.not.1 = icmp eq i32 %5, -1
br i1 %cmp5.not.1, label %lor.lhs.false6.1, label %for.inc.1
lor.lhs.false6.1: ; preds = %lor.lhs.false.1
%sub8.1 = add i32 %i, 6
%idxprom9.1 = sext i32 %sub8.1 to i64
%arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom9.1
%6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.not.1 = icmp eq i32 %6, -1
br i1 %cmp11.not.1, label %if.end13.1, label %for.inc.1
if.end13.1: ; preds = %lor.lhs.false6.1
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
%cmp2.not.2 = icmp eq i32 %7, -1
br i1 %cmp2.not.2, label %lor.lhs.false.2, label %for.inc.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom14, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.not.2 = icmp eq i32 %9, -1
br i1 %cmp5.not.2, label %lor.lhs.false6.2, label %for.inc.2
lor.lhs.false6.2: ; preds = %lor.lhs.false.2
%sub8.2 = add i32 %i, 5
%idxprom9.2 = sext i32 %sub8.2 to i64
%arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom9.2
%10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%cmp11.not.2 = icmp eq i32 %10, -1
br i1 %cmp11.not.2, label %if.end13.2, label %for.inc.2
if.end13.2: ; preds = %lor.lhs.false6.2
store i32 2, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 3), align 4, !tbaa !5
%cmp2.not.3 = icmp eq i32 %11, -1
br i1 %cmp2.not.3, label %lor.lhs.false.3, label %for.inc.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom14, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.not.3 = icmp eq i32 %13, -1
br i1 %cmp5.not.3, label %lor.lhs.false6.3, label %for.inc.3
lor.lhs.false6.3: ; preds = %lor.lhs.false.3
%sub8.3 = add i32 %i, 4
%idxprom9.3 = sext i32 %sub8.3 to i64
%arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom9.3
%14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%cmp11.not.3 = icmp eq i32 %14, -1
br i1 %cmp11.not.3, label %if.end13.3, label %for.inc.3
if.end13.3: ; preds = %lor.lhs.false6.3
store i32 3, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 3), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 3), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 4), align 16, !tbaa !5
%cmp2.not.4 = icmp eq i32 %15, -1
br i1 %cmp2.not.4, label %lor.lhs.false.4, label %for.inc.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom14, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.not.4 = icmp eq i32 %17, -1
br i1 %cmp5.not.4, label %lor.lhs.false6.4, label %for.inc.4
lor.lhs.false6.4: ; preds = %lor.lhs.false.4
%sub8.4 = add i32 %i, 3
%idxprom9.4 = sext i32 %sub8.4 to i64
%arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom9.4
%18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5
%cmp11.not.4 = icmp eq i32 %18, -1
br i1 %cmp11.not.4, label %if.end13.4, label %for.inc.4
if.end13.4: ; preds = %lor.lhs.false6.4
store i32 4, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 4), align 16, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 4), align 16, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 5), align 4, !tbaa !5
%cmp2.not.5 = icmp eq i32 %19, -1
br i1 %cmp2.not.5, label %lor.lhs.false.5, label %for.inc.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom14, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.not.5 = icmp eq i32 %21, -1
br i1 %cmp5.not.5, label %lor.lhs.false6.5, label %for.inc.5
lor.lhs.false6.5: ; preds = %lor.lhs.false.5
%sub8.5 = add i32 %i, 2
%idxprom9.5 = sext i32 %sub8.5 to i64
%arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom9.5
%22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5
%cmp11.not.5 = icmp eq i32 %22, -1
br i1 %cmp11.not.5, label %if.end13.5, label %for.inc.5
if.end13.5: ; preds = %lor.lhs.false6.5
store i32 5, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 5), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 5), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 6), align 8, !tbaa !5
%cmp2.not.6 = icmp eq i32 %23, -1
br i1 %cmp2.not.6, label %lor.lhs.false.6, label %for.inc.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom14, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.not.6 = icmp eq i32 %25, -1
br i1 %cmp5.not.6, label %lor.lhs.false6.6, label %for.inc.6
lor.lhs.false6.6: ; preds = %lor.lhs.false.6
%sub8.6 = add i32 %i, 1
%idxprom9.6 = sext i32 %sub8.6 to i64
%arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom9.6
%26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5
%cmp11.not.6 = icmp eq i32 %26, -1
br i1 %cmp11.not.6, label %if.end13.6, label %for.inc.6
if.end13.6: ; preds = %lor.lhs.false6.6
store i32 6, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 6), align 8, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 6), align 8, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 7), align 4, !tbaa !5
%cmp2.not.7 = icmp eq i32 %27, -1
br i1 %cmp2.not.7, label %lor.lhs.false.7, label %common.ret
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom14, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dp, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.not.7 = icmp eq i32 %29, -1
br i1 %cmp5.not.7, label %lor.lhs.false6.7, label %common.ret
lor.lhs.false6.7: ; preds = %lor.lhs.false.7
%arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @dn, i64 0, i64 %idxprom14
%30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5
%cmp11.not.7 = icmp eq i32 %30, -1
br i1 %cmp11.not.7, label %if.end13.7, label %common.ret
common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7
ret void
if.end13.7: ; preds = %lor.lhs.false6.7
store i32 7, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 7), align 4, !tbaa !5
tail call void @recursive(i32 noundef %add26)
store i32 -1, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @c, i64 0, i64 7), align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%row = alloca i32, align 4
%col = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %row) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %col) #5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @c, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @r, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dn, i8 -1, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dp, i8 -1, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @m, i8 -1, i64 256, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp3058 = icmp sgt i32 %0, 0
br i1 %cmp3058, label %for.body31, label %for.end39
for.body31: ; preds = %entry, %for.body31
%i.359 = phi i32 [ %inc38, %for.body31 ], [ 0, %entry ]
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %row, ptr noundef nonnull %col)
%1 = load i32, ptr %row, align 4, !tbaa !5
%idxprom33 = sext i32 %1 to i64
%2 = load i32, ptr %col, align 4, !tbaa !5
%idxprom35 = sext i32 %2 to i64
%arrayidx36 = getelementptr inbounds [8 x [8 x i32]], ptr @m, i64 0, i64 %idxprom33, i64 %idxprom35
store i32 1, ptr %arrayidx36, align 4, !tbaa !5
%inc38 = add nuw nsw i32 %i.359, 1
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp30 = icmp slt i32 %inc38, %3
br i1 %cmp30, label %for.body31, label %for.end39, !llvm.loop !12
for.end39: ; preds = %for.body31, %entry
call void @recursive(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %col) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %row) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int board[8] = { -20, -20, -20, -20, -20, -20, -20, -20 };
int check[8];
int flag;
int count;
void output(int box[]) {
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
if (j == box[i])
printf("Q");
else
printf(".");
}
printf("\n");
}
}
void eight_queens(int c, int box[]) {
if (c == 8) {
output(box);
}
else if (check[c] == 1){
eight_queens(c + 1, box);
if (check[c + 1] == 0)
box[c + 1] = -20;
}
else {
int flag;
for (int i = 0; i < 8; i++) {
flag = 0;
for (int j = 0; j < 8; j++) {
if (i == box[j] || i == box[j] - c + j || i == box[j] + c - j)
flag = 1;
}
if (flag == 0) {
box[c] = i;
eight_queens(c + 1, box);
}
if (check[c + 1] == 0)
box[c + 1] = -20;
}
}
}
int main(void) {
int n, r, c;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
if(i < n)break;
}
for (int i = 0; i < n; i++) {
scanf("%d%d", &r, &c);
board[r] = c;
check[r] = 1;
}
eight_queens(0, board);
//printf("Fin\n");
//while(1) {}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_232945/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_232945/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@board = dso_local global [8 x i32] [i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20, i32 -20], align 16
@check = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@flag = dso_local local_unnamed_addr global i32 0, align 4
@count = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree nounwind uwtable
define dso_local void @output(ptr nocapture noundef readonly %box) local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond1.preheader ]
%arrayidx = getelementptr inbounds i32, ptr %box, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5 = icmp eq i32 %0, 0
%. = select i1 %cmp5, i32 81, i32 46
%putchar16 = tail call i32 @putchar(i32 %.)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %1, 1
%.sink20 = select i1 %cmp5.1, i32 81, i32 46
%putchar16.1 = tail call i32 @putchar(i32 %.sink20)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %2, 2
%.sink21 = select i1 %cmp5.2, i32 81, i32 46
%putchar16.2 = tail call i32 @putchar(i32 %.sink21)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %3, 3
%.sink22 = select i1 %cmp5.3, i32 81, i32 46
%putchar16.3 = tail call i32 @putchar(i32 %.sink22)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %4, 4
%.sink23 = select i1 %cmp5.4, i32 81, i32 46
%putchar16.4 = tail call i32 @putchar(i32 %.sink23)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %5, 5
%.sink24 = select i1 %cmp5.5, i32 81, i32 46
%putchar16.5 = tail call i32 @putchar(i32 %.sink24)
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %6, 6
%.sink25 = select i1 %cmp5.6, i32 81, i32 46
%putchar16.6 = tail call i32 @putchar(i32 %.sink25)
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %7, 7
%.sink26 = select i1 %cmp5.7, i32 81, i32 46
%putchar16.7 = tail call i32 @putchar(i32 %.sink26)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !9
for.cond.cleanup: ; preds = %for.cond1.preheader
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @eight_queens(i32 noundef %c, ptr noundef %box) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %c, 8
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
tail call void @output(ptr noundef %box)
br label %if.end51
if.else: ; preds = %entry
%idxprom = sext i32 %c to i64
%arrayidx = getelementptr inbounds [8 x i32], ptr @check, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 1
br i1 %cmp1, label %if.then2, label %for.cond.preheader
for.cond.preheader: ; preds = %if.else
%arrayidx35 = getelementptr inbounds i32, ptr %box, i64 %idxprom
%add36 = add nsw i32 %c, 1
%idxprom39 = sext i32 %add36 to i64
%arrayidx40 = getelementptr inbounds [8 x i32], ptr @check, i64 0, i64 %idxprom39
%arrayidx45 = getelementptr inbounds i32, ptr %box, i64 %idxprom39
%arrayidx18.1 = getelementptr inbounds i32, ptr %box, i64 1
%add27.1 = add i32 %c, -1
%arrayidx18.2 = getelementptr inbounds i32, ptr %box, i64 2
%add27.2 = add i32 %c, -2
%arrayidx18.3 = getelementptr inbounds i32, ptr %box, i64 3
%add27.3 = add i32 %c, -3
%arrayidx18.4 = getelementptr inbounds i32, ptr %box, i64 4
%add27.4 = add i32 %c, -4
%arrayidx18.5 = getelementptr inbounds i32, ptr %box, i64 5
%add27.5 = add i32 %c, -5
%arrayidx18.6 = getelementptr inbounds i32, ptr %box, i64 6
%add27.6 = add i32 %c, -6
%arrayidx18.7 = getelementptr inbounds i32, ptr %box, i64 7
%add27.7 = add i32 %c, -7
br label %for.cond13.preheader
if.then2: ; preds = %if.else
%add = add nsw i32 %c, 1
tail call void @eight_queens(i32 noundef %add, ptr noundef %box)
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds [8 x i32], ptr @check, i64 0, i64 %idxprom4
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %1, 0
br i1 %cmp6, label %if.then7, label %if.end51
if.then7: ; preds = %if.then2
%arrayidx10 = getelementptr inbounds i32, ptr %box, i64 %idxprom4
store i32 -20, ptr %arrayidx10, align 4, !tbaa !5
br label %if.end51
for.cond13.preheader: ; preds = %for.cond.preheader, %for.inc47
%i.084 = phi i32 [ 0, %for.cond.preheader ], [ %inc48, %for.inc47 ]
%2 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5
%cmp19.1 = icmp eq i32 %i.084, %2
br i1 %cmp19.1, label %if.then30.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.cond13.preheader
%3 = load i32, ptr %box, align 4, !tbaa !5
%cmp19 = icmp eq i32 %i.084, %3
%add22 = sub i32 %3, %c
%cmp23 = icmp eq i32 %i.084, %add22
%or.cond = or i1 %cmp19, %cmp23
%sub28 = add i32 %3, %c
%cmp29 = icmp eq i32 %i.084, %sub28
%or.cond94 = or i1 %or.cond, %cmp29
%flag.1 = zext i1 %or.cond94 to i32
%reass.sub = sub i32 %2, %c
%add22.1 = add i32 %reass.sub, 1
%cmp23.1 = icmp eq i32 %i.084, %add22.1
%sub28.1 = add i32 %add27.1, %2
%cmp29.1 = icmp eq i32 %i.084, %sub28.1
%or.cond95 = or i1 %cmp23.1, %cmp29.1
br i1 %or.cond95, label %if.then30.1, label %for.inc.1
if.then30.1: ; preds = %lor.lhs.false.1, %for.cond13.preheader
br label %for.inc.1
for.inc.1: ; preds = %lor.lhs.false.1, %if.then30.1
%flag.1.1 = phi i32 [ 1, %if.then30.1 ], [ %flag.1, %lor.lhs.false.1 ]
%4 = load i32, ptr %arrayidx18.2, align 4, !tbaa !5
%cmp19.2 = icmp eq i32 %i.084, %4
br i1 %cmp19.2, label %if.then30.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%reass.sub86 = sub i32 %4, %c
%add22.2 = add i32 %reass.sub86, 2
%cmp23.2 = icmp eq i32 %i.084, %add22.2
%sub28.2 = add i32 %add27.2, %4
%cmp29.2 = icmp eq i32 %i.084, %sub28.2
%or.cond96 = or i1 %cmp23.2, %cmp29.2
br i1 %or.cond96, label %if.then30.2, label %for.inc.2
if.then30.2: ; preds = %lor.lhs.false.2, %for.inc.1
br label %for.inc.2
for.inc.2: ; preds = %lor.lhs.false.2, %if.then30.2
%flag.1.2 = phi i32 [ 1, %if.then30.2 ], [ %flag.1.1, %lor.lhs.false.2 ]
%5 = load i32, ptr %arrayidx18.3, align 4, !tbaa !5
%cmp19.3 = icmp eq i32 %i.084, %5
br i1 %cmp19.3, label %if.then30.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%reass.sub87 = sub i32 %5, %c
%add22.3 = add i32 %reass.sub87, 3
%cmp23.3 = icmp eq i32 %i.084, %add22.3
%sub28.3 = add i32 %add27.3, %5
%cmp29.3 = icmp eq i32 %i.084, %sub28.3
%or.cond97 = or i1 %cmp23.3, %cmp29.3
br i1 %or.cond97, label %if.then30.3, label %for.inc.3
if.then30.3: ; preds = %lor.lhs.false.3, %for.inc.2
br label %for.inc.3
for.inc.3: ; preds = %lor.lhs.false.3, %if.then30.3
%flag.1.3 = phi i32 [ 1, %if.then30.3 ], [ %flag.1.2, %lor.lhs.false.3 ]
%6 = load i32, ptr %arrayidx18.4, align 4, !tbaa !5
%cmp19.4 = icmp eq i32 %i.084, %6
br i1 %cmp19.4, label %if.then30.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%reass.sub88 = sub i32 %6, %c
%add22.4 = add i32 %reass.sub88, 4
%cmp23.4 = icmp eq i32 %i.084, %add22.4
%sub28.4 = add i32 %add27.4, %6
%cmp29.4 = icmp eq i32 %i.084, %sub28.4
%or.cond98 = or i1 %cmp23.4, %cmp29.4
br i1 %or.cond98, label %if.then30.4, label %for.inc.4
if.then30.4: ; preds = %lor.lhs.false.4, %for.inc.3
br label %for.inc.4
for.inc.4: ; preds = %lor.lhs.false.4, %if.then30.4
%flag.1.4 = phi i32 [ 1, %if.then30.4 ], [ %flag.1.3, %lor.lhs.false.4 ]
%7 = load i32, ptr %arrayidx18.5, align 4, !tbaa !5
%cmp19.5 = icmp eq i32 %i.084, %7
br i1 %cmp19.5, label %if.then30.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%reass.sub89 = sub i32 %7, %c
%add22.5 = add i32 %reass.sub89, 5
%cmp23.5 = icmp eq i32 %i.084, %add22.5
%sub28.5 = add i32 %add27.5, %7
%cmp29.5 = icmp eq i32 %i.084, %sub28.5
%or.cond99 = or i1 %cmp23.5, %cmp29.5
br i1 %or.cond99, label %if.then30.5, label %for.inc.5
if.then30.5: ; preds = %lor.lhs.false.5, %for.inc.4
br label %for.inc.5
for.inc.5: ; preds = %lor.lhs.false.5, %if.then30.5
%flag.1.5 = phi i32 [ 1, %if.then30.5 ], [ %flag.1.4, %lor.lhs.false.5 ]
%8 = load i32, ptr %arrayidx18.6, align 4, !tbaa !5
%cmp19.6 = icmp eq i32 %i.084, %8
br i1 %cmp19.6, label %if.then30.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%reass.sub90 = sub i32 %8, %c
%add22.6 = add i32 %reass.sub90, 6
%cmp23.6 = icmp eq i32 %i.084, %add22.6
%sub28.6 = add i32 %add27.6, %8
%cmp29.6 = icmp eq i32 %i.084, %sub28.6
%or.cond100 = or i1 %cmp23.6, %cmp29.6
br i1 %or.cond100, label %if.then30.6, label %for.inc.6
if.then30.6: ; preds = %lor.lhs.false.6, %for.inc.5
br label %for.inc.6
for.inc.6: ; preds = %lor.lhs.false.6, %if.then30.6
%flag.1.6 = phi i32 [ 1, %if.then30.6 ], [ %flag.1.5, %lor.lhs.false.6 ]
%9 = load i32, ptr %arrayidx18.7, align 4, !tbaa !5
%cmp19.7 = icmp eq i32 %i.084, %9
br i1 %cmp19.7, label %if.end37, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%reass.sub91 = sub i32 %9, %c
%add22.7 = add i32 %reass.sub91, 7
%cmp23.7 = icmp ne i32 %i.084, %add22.7
%sub28.7 = add i32 %add27.7, %9
%cmp29.7 = icmp ne i32 %i.084, %sub28.7
%or.cond101.not103 = and i1 %cmp23.7, %cmp29.7
%cmp32 = icmp eq i32 %flag.1.6, 0
%or.cond102 = select i1 %or.cond101.not103, i1 %cmp32, i1 false
br i1 %or.cond102, label %if.then33, label %if.end37
if.then33: ; preds = %lor.lhs.false.7
store i32 %i.084, ptr %arrayidx35, align 4, !tbaa !5
tail call void @eight_queens(i32 noundef %add36, ptr noundef nonnull %box)
br label %if.end37
if.end37: ; preds = %lor.lhs.false.7, %for.inc.6, %if.then33
%10 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%cmp41 = icmp eq i32 %10, 0
br i1 %cmp41, label %if.then42, label %for.inc47
if.then42: ; preds = %if.end37
store i32 -20, ptr %arrayidx45, align 4, !tbaa !5
br label %for.inc47
for.inc47: ; preds = %if.end37, %if.then42
%inc48 = add nuw nsw i32 %i.084, 1
%exitcond.not = icmp eq i32 %inc48, 8
br i1 %exitcond.not, label %if.end51, label %for.cond13.preheader, !llvm.loop !11
if.end51: ; preds = %for.inc47, %if.then7, %if.then2, %if.then
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%r = alloca i32, align 4
%c = 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 %r) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %0, 0
br i1 %cmp420, label %for.body6, label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %for.body6, %entry
call void @eight_queens(i32 noundef 0, ptr noundef nonnull @board)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body6: ; preds = %entry, %for.body6
%i2.021 = phi i32 [ %inc11, %for.body6 ], [ 0, %entry ]
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %r, ptr noundef nonnull %c)
%1 = load i32, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %r, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%arrayidx = getelementptr inbounds [8 x i32], ptr @board, i64 0, i64 %idxprom
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx9 = getelementptr inbounds [8 x i32], ptr @check, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx9, align 4, !tbaa !5
%inc11 = add nuw nsw i32 %i2.021, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc11, %3
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !12
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdbool.h>
#define N 8
#define NFR -1
#define FR 1
int row[N], col[N], dpos[2*N-1], dneg[2*N-1];
bool S[N][N];
void initialize(){
int i;
for(i = 0; i < N; i++){
row[i] = FR;
col[i] = FR;
}
for(i = 0; i < 2*N-1; i++){
dpos[i] = FR;
dneg[i] = FR;
}
}
void print(){
int i, j;
for(i = 0; i < N; i++){
for(j = 0; j < N; j++){
if(S[i][j]){
if(row[i] != j) return;
}
}
}
for(i = 0; i < N; i++){
for(j = 0; j < N; j++){
if(row[i] != j)
printf(".");
else printf("Q");
}
printf("\n");
}
}
void Qeen(int i){
int j;
if(i == N){
print();
return;
}
for(j = 0; j < N; j++){
//{i, j }がクイーンの攻撃範囲にあるか調査する
if(col[j] == NFR || dpos[i+j] == NFR || dneg[i-j+(N-1)] == NFR) continue;
//{i, j}がクイーンの攻撃範囲に入っていなければクイーンの配置をする
row[i] = j;
col[j] = NFR;
dpos[i+j] = NFR;
dneg[i-j+(N-1)] = NFR;
Qeen(i+1);
row[i] = FR;
col[j] = FR;
dpos[i+j] = FR;
dneg[i-j+(N-1)] = FR;
}
}
int main(){
int i, j, k, r, c;
initialize();
for(i = 0; i < N; i++){
for(j = 0; j < N; j++){
S[i][j] = false;
}
}
scanf("%d", &k);
for(i = 0; i < k; i++){
scanf("%d%d", &r, &c);
S[r][c] = true;
}
Qeen(0);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233009/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233009/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@S = dso_local local_unnamed_addr global [8 x [8 x i8]] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @initialize() local_unnamed_addr #0 {
entry:
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @row, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @col, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([8 x i32], ptr @row, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @dpos, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @dneg, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 8), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 8), align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 12), align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 12), align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 13), align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 13), align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 14), align 8, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 14), align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @print() local_unnamed_addr #2 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx7 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 0
%0 = load i8, ptr %arrayidx5, align 8, !tbaa !9, !range !11, !noundef !12
%tobool.not = icmp eq i8 %0, 0
br i1 %tobool.not, label %for.inc, label %if.then
if.then: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not = icmp eq i32 %1, 0
br i1 %cmp8.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 1
%2 = load i8, ptr %arrayidx5.1, align 1, !tbaa !9, !range !11, !noundef !12
%tobool.not.1 = icmp eq i8 %2, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.1 = icmp eq i32 %3, 1
br i1 %cmp8.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 2
%4 = load i8, ptr %arrayidx5.2, align 2, !tbaa !9, !range !11, !noundef !12
%tobool.not.2 = icmp eq i8 %4, 0
br i1 %tobool.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.2 = icmp eq i32 %5, 2
br i1 %cmp8.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 3
%6 = load i8, ptr %arrayidx5.3, align 1, !tbaa !9, !range !11, !noundef !12
%tobool.not.3 = icmp eq i8 %6, 0
br i1 %tobool.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.3 = icmp eq i32 %7, 3
br i1 %cmp8.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 4
%8 = load i8, ptr %arrayidx5.4, align 4, !tbaa !9, !range !11, !noundef !12
%tobool.not.4 = icmp eq i8 %8, 0
br i1 %tobool.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.4 = icmp eq i32 %9, 4
br i1 %cmp8.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 5
%10 = load i8, ptr %arrayidx5.5, align 1, !tbaa !9, !range !11, !noundef !12
%tobool.not.5 = icmp eq i8 %10, 0
br i1 %tobool.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.5 = icmp eq i32 %11, 5
br i1 %cmp8.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 6
%12 = load i8, ptr %arrayidx5.6, align 2, !tbaa !9, !range !11, !noundef !12
%tobool.not.6 = icmp eq i8 %12, 0
br i1 %tobool.not.6, label %for.inc.6, label %if.then.6
if.then.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.6 = icmp eq i32 %13, 6
br i1 %cmp8.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %indvars.iv, i64 7
%14 = load i8, ptr %arrayidx5.7, align 1, !tbaa !9, !range !11, !noundef !12
%tobool.not.7 = icmp eq i8 %14, 0
br i1 %tobool.not.7, label %for.inc.7, label %if.then.7
if.then.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.7 = icmp eq i32 %15, 7
br i1 %cmp8.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %if.then.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond17.preheader, label %for.cond1.preheader, !llvm.loop !13
for.cond17.preheader: ; preds = %for.inc.7, %for.cond17.preheader
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.cond17.preheader ], [ 0, %for.inc.7 ]
%arrayidx21 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv57
%16 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not = icmp eq i32 %16, 0
%. = select i1 %cmp22.not, i32 81, i32 46
%putchar47 = tail call i32 @putchar(i32 %.)
%17 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not.1 = icmp eq i32 %17, 1
%.sink62 = select i1 %cmp22.not.1, i32 81, i32 46
%putchar46.1 = tail call i32 @putchar(i32 %.sink62)
%18 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not.2 = icmp eq i32 %18, 2
%.sink63 = select i1 %cmp22.not.2, i32 81, i32 46
%putchar46.2 = tail call i32 @putchar(i32 %.sink63)
%19 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not.3 = icmp eq i32 %19, 3
%.sink64 = select i1 %cmp22.not.3, i32 81, i32 46
%putchar46.3 = tail call i32 @putchar(i32 %.sink64)
%20 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not.4 = icmp eq i32 %20, 4
%.sink65 = select i1 %cmp22.not.4, i32 81, i32 46
%putchar46.4 = tail call i32 @putchar(i32 %.sink65)
%21 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not.5 = icmp eq i32 %21, 5
%.sink66 = select i1 %cmp22.not.5, i32 81, i32 46
%putchar46.5 = tail call i32 @putchar(i32 %.sink66)
%22 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not.6 = icmp eq i32 %22, 6
%.sink67 = select i1 %cmp22.not.6, i32 81, i32 46
%putchar46.6 = tail call i32 @putchar(i32 %.sink67)
%23 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.not.7 = icmp eq i32 %23, 7
%.sink68 = select i1 %cmp22.not.7, i32 81, i32 46
%putchar46.7 = tail call i32 @putchar(i32 %.sink68)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%exitcond60.not = icmp eq i64 %indvars.iv.next58, 8
br i1 %exitcond60.not, label %cleanup, label %for.cond17.preheader, !llvm.loop !15
cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond17.preheader
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @Qeen(i32 noundef %i) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %i, 7
%idxprom13 = sext i32 %i to i64
%arrayidx14 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom13
%add24 = add nsw i32 %i, 1
%0 = load i32, ptr @col, align 16, !tbaa !5
%cmp2 = icmp eq i32 %0, -1
br i1 %cmp2, label %for.inc, label %lor.lhs.false
if.then: ; preds = %entry
tail call void @print()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom13
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, -1
br i1 %cmp5, label %for.inc, label %lor.lhs.false6
lor.lhs.false6: ; preds = %lor.lhs.false
%idxprom8 = sext i32 %sub to i64
%arrayidx9 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8
%2 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %2, -1
br i1 %cmp10, label %for.inc, label %if.end12
if.end12: ; preds = %lor.lhs.false6
store i32 0, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr @col, align 16, !tbaa !5
store i32 -1, ptr %arrayidx4, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr @col, align 16, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr %arrayidx9, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end12
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, -1
br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom13, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %5, -1
br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1
lor.lhs.false6.1: ; preds = %lor.lhs.false.1
%add7.1 = add i32 %i, 6
%idxprom8.1 = sext i32 %add7.1 to i64
%arrayidx9.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.1
%6 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%cmp10.1 = icmp eq i32 %6, -1
br i1 %cmp10.1, label %for.inc.1, label %if.end12.1
if.end12.1: ; preds = %lor.lhs.false6.1
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9.1, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end12.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
%cmp2.2 = icmp eq i32 %7, -1
br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom13, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %9, -1
br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2
lor.lhs.false6.2: ; preds = %lor.lhs.false.2
%add7.2 = add i32 %i, 5
%idxprom8.2 = sext i32 %add7.2 to i64
%arrayidx9.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.2
%10 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5
%cmp10.2 = icmp eq i32 %10, -1
br i1 %cmp10.2, label %for.inc.2, label %if.end12.2
if.end12.2: ; preds = %lor.lhs.false6.2
store i32 2, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
store i32 -1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9.2, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end12.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %11, -1
br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom13, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %13, -1
br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3
lor.lhs.false6.3: ; preds = %lor.lhs.false.3
%add7.3 = add i32 %i, 4
%idxprom8.3 = sext i32 %add7.3 to i64
%arrayidx9.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.3
%14 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5
%cmp10.3 = icmp eq i32 %14, -1
br i1 %cmp10.3, label %for.inc.3, label %if.end12.3
if.end12.3: ; preds = %lor.lhs.false6.3
store i32 3, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9.3, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.3, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end12.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
%cmp2.4 = icmp eq i32 %15, -1
br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom13, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %17, -1
br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4
lor.lhs.false6.4: ; preds = %lor.lhs.false.4
%add7.4 = add i32 %i, 3
%idxprom8.4 = sext i32 %add7.4 to i64
%arrayidx9.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.4
%18 = load i32, ptr %arrayidx9.4, align 4, !tbaa !5
%cmp10.4 = icmp eq i32 %18, -1
br i1 %cmp10.4, label %for.inc.4, label %if.end12.4
if.end12.4: ; preds = %lor.lhs.false6.4
store i32 4, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
store i32 -1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9.4, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.4, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end12.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
%cmp2.5 = icmp eq i32 %19, -1
br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom13, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %21, -1
br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5
lor.lhs.false6.5: ; preds = %lor.lhs.false.5
%add7.5 = add i32 %i, 2
%idxprom8.5 = sext i32 %add7.5 to i64
%arrayidx9.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.5
%22 = load i32, ptr %arrayidx9.5, align 4, !tbaa !5
%cmp10.5 = icmp eq i32 %22, -1
br i1 %cmp10.5, label %for.inc.5, label %if.end12.5
if.end12.5: ; preds = %lor.lhs.false6.5
store i32 5, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9.5, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.5, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end12.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
%cmp2.6 = icmp eq i32 %23, -1
br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom13, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %25, -1
br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6
lor.lhs.false6.6: ; preds = %lor.lhs.false.6
%add7.6 = add i32 %i, 1
%idxprom8.6 = sext i32 %add7.6 to i64
%arrayidx9.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.6
%26 = load i32, ptr %arrayidx9.6, align 4, !tbaa !5
%cmp10.6 = icmp eq i32 %26, -1
br i1 %cmp10.6, label %for.inc.6, label %if.end12.6
if.end12.6: ; preds = %lor.lhs.false6.6
store i32 6, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
store i32 -1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9.6, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.6, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end12.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
%cmp2.7 = icmp eq i32 %27, -1
br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom13, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %29, -1
br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7
lor.lhs.false6.7: ; preds = %lor.lhs.false.7
%arrayidx9.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom13
%30 = load i32, ptr %arrayidx9.7, align 4, !tbaa !5
%cmp10.7 = icmp eq i32 %30, -1
br i1 %cmp10.7, label %common.ret, label %if.end12.7
common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end12.7
ret void
if.end12.7: ; preds = %lor.lhs.false6.7
store i32 7, ptr %arrayidx14, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 -1, ptr %arrayidx9.7, align 4, !tbaa !5
tail call void @Qeen(i32 noundef %add24)
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.7, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%k = alloca i32, align 4
%r = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @row, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @col, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([8 x i32], ptr @row, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @dpos, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr @dneg, align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 8), align 16, !tbaa !5
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 8), align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 12), align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 12), align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 13), align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 13), align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dpos, i64 0, i64 14), align 8, !tbaa !5
store i32 1, ptr getelementptr inbounds ([15 x i32], ptr @dneg, i64 0, i64 14), align 8, !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) @S, i8 0, i64 64, i1 false), !tbaa !9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp1028 = icmp sgt i32 %0, 0
br i1 %cmp1028, label %for.body11, label %for.end19
for.body11: ; preds = %entry, %for.body11
%i.129 = phi i32 [ %inc18, %for.body11 ], [ 0, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %r, ptr noundef nonnull %c)
%1 = load i32, ptr %r, align 4, !tbaa !5
%idxprom13 = sext i32 %1 to i64
%2 = load i32, ptr %c, align 4, !tbaa !5
%idxprom15 = sext i32 %2 to i64
%arrayidx16 = getelementptr inbounds [8 x [8 x i8]], ptr @S, i64 0, i64 %idxprom13, i64 %idxprom15
store i8 1, ptr %arrayidx16, align 1, !tbaa !9
%inc18 = add nuw nsw i32 %i.129, 1
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc18, %3
br i1 %cmp10, label %for.body11, label %for.end19, !llvm.loop !16
for.end19: ; preds = %for.body11, %entry
call void @Qeen(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
|
#include<stdio.h>
#include<stdlib.h>
#define FREE -1
#define NOT_FREE 1
#define TRUE 1
#define FALSE 0
int matrix[8][8];
int col[8],row[8],dpos[15],dneg[15];
void putQueen(int i);
void printBoard();
void initialize()
{
int i;
for(i=0;i<8;i++)
{
col[i]=FREE;
row[i]=FREE;
}
for(i=0;i<15;i++)
{
dpos[i]=FREE;
dneg[i]=FREE;
}
}
void printBoard()
{
int i,j;
for(i=0;i<8;i++)
{
for(j=0;j<8;j++)
{
if(matrix[i][j])
{
if(row[i]!=j)
return;
}
}
}
for(i=0;i<8;i++)
{
for(j=0;j<8;j++)
{
if(row[i]==j)
{
printf("Q");
}
else printf(".");
}
printf("\n");
}
}
void putQueen(int i)
{
int j;
if(i==8)
{
printBoard();
return;
}
for(j=0;j<8;j++)
{
if(col[j]==NOT_FREE || dpos[i+j]==NOT_FREE || dneg[i-j+7]==NOT_FREE)
continue;
row[i]=j;
col[j]=dpos[i+j]=dneg[i-j+7]=NOT_FREE;
putQueen(i+1);
row[i]=col[j]=dpos[i+j]=dneg[i-j+7]=FREE;
}
}
int main()
{
int i,j,n,r,c;
initialize();
for(i=0;i<8;i++)
for(j=0;j<8;j++)
matrix[i][j]=FALSE;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&r,&c);
matrix[r][c]=TRUE;
}
putQueen(0);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233067/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233067/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dneg = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@matrix = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @initialize() local_unnamed_addr #0 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 -1, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 -1, i64 60, i1 false), !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @printBoard() local_unnamed_addr #2 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx7 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 0
%0 = load i32, ptr %arrayidx5, align 16, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %for.inc, label %if.then
if.then: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not = icmp eq i32 %1, 0
br i1 %cmp8.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %2, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.1 = icmp eq i32 %3, 1
br i1 %cmp8.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 2
%4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %4, 0
br i1 %tobool.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.2 = icmp eq i32 %5, 2
br i1 %cmp8.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 3
%6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %6, 0
br i1 %tobool.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.3 = icmp eq i32 %7, 3
br i1 %cmp8.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 4
%8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5
%tobool.not.4 = icmp eq i32 %8, 0
br i1 %tobool.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.4 = icmp eq i32 %9, 4
br i1 %cmp8.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 5
%10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%tobool.not.5 = icmp eq i32 %10, 0
br i1 %tobool.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.5 = icmp eq i32 %11, 5
br i1 %cmp8.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 6
%12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5
%tobool.not.6 = icmp eq i32 %12, 0
br i1 %tobool.not.6, label %for.inc.6, label %if.then.6
if.then.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.6 = icmp eq i32 %13, 6
br i1 %cmp8.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %indvars.iv, i64 7
%14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%tobool.not.7 = icmp eq i32 %14, 0
br i1 %tobool.not.7, label %for.inc.7, label %if.then.7
if.then.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8.not.7 = icmp eq i32 %15, 7
br i1 %cmp8.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %if.then.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond17.preheader, label %for.cond1.preheader, !llvm.loop !9
for.cond17.preheader: ; preds = %for.inc.7, %for.cond17.preheader
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.cond17.preheader ], [ 0, %for.inc.7 ]
%arrayidx21 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv57
%16 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp eq i32 %16, 0
%. = select i1 %cmp22, i32 81, i32 46
%putchar47 = tail call i32 @putchar(i32 %.)
%17 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.1 = icmp eq i32 %17, 1
%.sink62 = select i1 %cmp22.1, i32 81, i32 46
%putchar47.1 = tail call i32 @putchar(i32 %.sink62)
%18 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.2 = icmp eq i32 %18, 2
%.sink63 = select i1 %cmp22.2, i32 81, i32 46
%putchar47.2 = tail call i32 @putchar(i32 %.sink63)
%19 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.3 = icmp eq i32 %19, 3
%.sink64 = select i1 %cmp22.3, i32 81, i32 46
%putchar47.3 = tail call i32 @putchar(i32 %.sink64)
%20 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.4 = icmp eq i32 %20, 4
%.sink65 = select i1 %cmp22.4, i32 81, i32 46
%putchar47.4 = tail call i32 @putchar(i32 %.sink65)
%21 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.5 = icmp eq i32 %21, 5
%.sink66 = select i1 %cmp22.5, i32 81, i32 46
%putchar47.5 = tail call i32 @putchar(i32 %.sink66)
%22 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.6 = icmp eq i32 %22, 6
%.sink67 = select i1 %cmp22.6, i32 81, i32 46
%putchar47.6 = tail call i32 @putchar(i32 %.sink67)
%23 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22.7 = icmp eq i32 %23, 7
%.sink68 = select i1 %cmp22.7, i32 81, i32 46
%putchar47.7 = tail call i32 @putchar(i32 %.sink68)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%exitcond60.not = icmp eq i64 %indvars.iv.next58, 8
br i1 %exitcond60.not, label %cleanup, label %for.cond17.preheader, !llvm.loop !11
cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond17.preheader
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @putQueen(i32 noundef %i) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %i, 7
%idxprom13 = sext i32 %i to i64
%arrayidx14 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom13
%add24 = add nsw i32 %i, 1
%0 = load i32, ptr @col, align 16, !tbaa !5
%cmp2 = icmp eq i32 %0, 1
br i1 %cmp2, label %for.inc, label %lor.lhs.false
if.then: ; preds = %entry
tail call void @printBoard()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom13
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, 1
br i1 %cmp5, label %for.inc, label %lor.lhs.false6
lor.lhs.false6: ; preds = %lor.lhs.false
%idxprom8 = sext i32 %sub to i64
%arrayidx9 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8
%2 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %2, 1
br i1 %cmp10, label %for.inc, label %if.end12
if.end12: ; preds = %lor.lhs.false6
store i32 0, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9, align 4, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr @col, align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4, align 4, !tbaa !5
store i32 -1, ptr @col, align 16, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end12
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, 1
br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom13, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %5, 1
br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1
lor.lhs.false6.1: ; preds = %lor.lhs.false.1
%add7.1 = add i32 %i, 6
%idxprom8.1 = sext i32 %add7.1 to i64
%arrayidx9.1 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.1
%6 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%cmp10.1 = icmp eq i32 %6, 1
br i1 %cmp10.1, label %for.inc.1, label %if.end12.1
if.end12.1: ; preds = %lor.lhs.false6.1
store i32 1, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9.1, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end12.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
%cmp2.2 = icmp eq i32 %7, 1
br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom13, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %9, 1
br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2
lor.lhs.false6.2: ; preds = %lor.lhs.false.2
%add7.2 = add i32 %i, 5
%idxprom8.2 = sext i32 %add7.2 to i64
%arrayidx9.2 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.2
%10 = load i32, ptr %arrayidx9.2, align 4, !tbaa !5
%cmp10.2 = icmp eq i32 %10, 1
br i1 %cmp10.2, label %for.inc.2, label %if.end12.2
if.end12.2: ; preds = %lor.lhs.false6.2
store i32 2, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9.2, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end12.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %11, 1
br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom13, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %13, 1
br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3
lor.lhs.false6.3: ; preds = %lor.lhs.false.3
%add7.3 = add i32 %i, 4
%idxprom8.3 = sext i32 %add7.3 to i64
%arrayidx9.3 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.3
%14 = load i32, ptr %arrayidx9.3, align 4, !tbaa !5
%cmp10.3 = icmp eq i32 %14, 1
br i1 %cmp10.3, label %for.inc.3, label %if.end12.3
if.end12.3: ; preds = %lor.lhs.false6.3
store i32 3, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9.3, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end12.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
%cmp2.4 = icmp eq i32 %15, 1
br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom13, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %17, 1
br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4
lor.lhs.false6.4: ; preds = %lor.lhs.false.4
%add7.4 = add i32 %i, 3
%idxprom8.4 = sext i32 %add7.4 to i64
%arrayidx9.4 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.4
%18 = load i32, ptr %arrayidx9.4, align 4, !tbaa !5
%cmp10.4 = icmp eq i32 %18, 1
br i1 %cmp10.4, label %for.inc.4, label %if.end12.4
if.end12.4: ; preds = %lor.lhs.false6.4
store i32 4, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9.4, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end12.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
%cmp2.5 = icmp eq i32 %19, 1
br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom13, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %21, 1
br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5
lor.lhs.false6.5: ; preds = %lor.lhs.false.5
%add7.5 = add i32 %i, 2
%idxprom8.5 = sext i32 %add7.5 to i64
%arrayidx9.5 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.5
%22 = load i32, ptr %arrayidx9.5, align 4, !tbaa !5
%cmp10.5 = icmp eq i32 %22, 1
br i1 %cmp10.5, label %for.inc.5, label %if.end12.5
if.end12.5: ; preds = %lor.lhs.false6.5
store i32 5, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9.5, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end12.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
%cmp2.6 = icmp eq i32 %23, 1
br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom13, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %25, 1
br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6
lor.lhs.false6.6: ; preds = %lor.lhs.false.6
%add7.6 = add i32 %i, 1
%idxprom8.6 = sext i32 %add7.6 to i64
%arrayidx9.6 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom8.6
%26 = load i32, ptr %arrayidx9.6, align 4, !tbaa !5
%cmp10.6 = icmp eq i32 %26, 1
br i1 %cmp10.6, label %for.inc.6, label %if.end12.6
if.end12.6: ; preds = %lor.lhs.false6.6
store i32 6, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9.6, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end12.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
%cmp2.7 = icmp eq i32 %27, 1
br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom13, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %29, 1
br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7
lor.lhs.false6.7: ; preds = %lor.lhs.false.7
%arrayidx9.7 = getelementptr inbounds [15 x i32], ptr @dneg, i64 0, i64 %idxprom13
%30 = load i32, ptr %arrayidx9.7, align 4, !tbaa !5
%cmp10.7 = icmp eq i32 %30, 1
br i1 %cmp10.7, label %common.ret, label %if.end12.7
common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end12.7
ret void
if.end12.7: ; preds = %lor.lhs.false6.7
store i32 7, ptr %arrayidx14, align 4, !tbaa !5
store i32 1, ptr %arrayidx9.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add24)
store i32 -1, ptr %arrayidx9.7, align 4, !tbaa !5
store i32 -1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 -1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
store i32 -1, ptr %arrayidx14, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%r = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 -1, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 -1, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dneg, i8 -1, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @matrix, i8 0, i64 256, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1028 = icmp sgt i32 %0, 0
br i1 %cmp1028, label %for.body11, label %for.end19
for.body11: ; preds = %entry, %for.body11
%i.129 = phi i32 [ %inc18, %for.body11 ], [ 0, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %r, ptr noundef nonnull %c)
%1 = load i32, ptr %r, align 4, !tbaa !5
%idxprom13 = sext i32 %1 to i64
%2 = load i32, ptr %c, align 4, !tbaa !5
%idxprom15 = sext i32 %2 to i64
%arrayidx16 = getelementptr inbounds [8 x [8 x i32]], ptr @matrix, i64 0, i64 %idxprom13, i64 %idxprom15
store i32 1, ptr %arrayidx16, align 4, !tbaa !5
%inc18 = add nuw nsw i32 %i.129, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc18, %3
br i1 %cmp10, label %for.body11, label %for.end19, !llvm.loop !12
for.end19: ; preds = %for.body11, %entry
call void @putQueen(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#define N 8
#define FREE 0
#define NOT_FREE 1
void putQueen(int);
void initialization(void);
void print(void);
int row[N],col[N],dpos[2*N-1],deng[2*N-1];
int judge[N][N];
int main(){
int i,j,k,r,c;
initialization();
for(i=0;i<N;i++){
for(j=0;j<N;j++){
judge[i][j] = 0;
}
}
scanf("%d",&k);
for(i=0;i<k;i++){
scanf("%d%d",&r,&c);
judge[r][c] = 1;
}
putQueen(0);
return 0;
}
void initialization(){
int i;
for(i=0;i<N;i++){
row[i] = col[i] = FREE;
}
for(i=0;i<2*N-1;i++){
dpos[i] = deng[i] = FREE;
}
}
void print(){
int i,j;
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(judge[i][j] == 1){
if(row[i] != j){
return;
}
}
}
}
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(row[i] == j){
printf("Q");
}
else{
printf(".");
}
}
printf("\n");
}
}
void putQueen(int i){
int j;
if(i == N){
print();
return;
}
for(j=0;j<N;j++){
if(col[j] == NOT_FREE ||
dpos[i+j] == NOT_FREE || deng[i-j+N-1] == NOT_FREE){
continue;
}
row[i] = j;
col[j] = dpos[i+j] = deng[i-j+N-1] = NOT_FREE;
putQueen(i+1);
col[j] = dpos[i+j] = deng[i-j+N-1] = FREE;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233124/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233124/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@judge = dso_local local_unnamed_addr global [8 x [8 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@col = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@row = dso_local local_unnamed_addr global [8 x i32] zeroinitializer, align 16
@deng = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
@dpos = dso_local local_unnamed_addr global [15 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%r = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @deng, i8 0, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 0, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) @judge, i8 0, i64 256, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp1028 = icmp sgt i32 %0, 0
br i1 %cmp1028, label %for.body11, label %for.end19
for.body11: ; preds = %entry, %for.body11
%i.129 = phi i32 [ %inc18, %for.body11 ], [ 0, %entry ]
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %c)
%1 = load i32, ptr %r, align 4, !tbaa !5
%idxprom13 = sext i32 %1 to i64
%2 = load i32, ptr %c, align 4, !tbaa !5
%idxprom15 = sext i32 %2 to i64
%arrayidx16 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %idxprom13, i64 %idxprom15
store i32 1, ptr %arrayidx16, align 4, !tbaa !5
%inc18 = add nuw nsw i32 %i.129, 1
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc18, %3
br i1 %cmp10, label %for.body11, label %for.end19, !llvm.loop !9
for.end19: ; preds = %for.body11, %entry
call void @putQueen(i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @initialization() local_unnamed_addr #2 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @col, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) @row, i8 0, i64 32, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @deng, i8 0, i64 60, i1 false), !tbaa !5
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) @dpos, i8 0, i64 60, i1 false), !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @putQueen(i32 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%sub = add i32 %i, 7
%idxprom14 = sext i32 %i to i64
%arrayidx15 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %idxprom14
%add26 = add nsw i32 %i, 1
%0 = load i32, ptr @col, align 16, !tbaa !5
%cmp2 = icmp eq i32 %0, 1
br i1 %cmp2, label %for.inc, label %lor.lhs.false
if.then: ; preds = %entry
tail call void @print()
br label %common.ret
lor.lhs.false: ; preds = %for.cond.preheader
%arrayidx4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %idxprom14
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, 1
br i1 %cmp5, label %for.inc, label %lor.lhs.false6
lor.lhs.false6: ; preds = %lor.lhs.false
%idxprom9 = sext i32 %sub to i64
%arrayidx10 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom9
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp eq i32 %2, 1
br i1 %cmp11, label %for.inc, label %if.end13
if.end13: ; preds = %lor.lhs.false6
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
store i32 1, ptr %arrayidx4, align 4, !tbaa !5
store i32 1, ptr @col, align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10, align 4, !tbaa !5
store i32 0, ptr %arrayidx4, align 4, !tbaa !5
store i32 0, ptr @col, align 16, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %lor.lhs.false, %lor.lhs.false6, %if.end13
%3 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, 1
br i1 %cmp2.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %for.inc
%4 = add nsw i64 %idxprom14, 1
%arrayidx4.1 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %4
%5 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %5, 1
br i1 %cmp5.1, label %for.inc.1, label %lor.lhs.false6.1
lor.lhs.false6.1: ; preds = %lor.lhs.false.1
%sub8.1 = add i32 %i, 6
%idxprom9.1 = sext i32 %sub8.1 to i64
%arrayidx10.1 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom9.1
%6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %6, 1
br i1 %cmp11.1, label %for.inc.1, label %if.end13.1
if.end13.1: ; preds = %lor.lhs.false6.1
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.1, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.1, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 1), align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end13.1, %lor.lhs.false6.1, %lor.lhs.false.1, %for.inc
%7 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
%cmp2.2 = icmp eq i32 %7, 1
br i1 %cmp2.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %for.inc.1
%8 = add nsw i64 %idxprom14, 2
%arrayidx4.2 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %8
%9 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %9, 1
br i1 %cmp5.2, label %for.inc.2, label %lor.lhs.false6.2
lor.lhs.false6.2: ; preds = %lor.lhs.false.2
%sub8.2 = add i32 %i, 5
%idxprom9.2 = sext i32 %sub8.2 to i64
%arrayidx10.2 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom9.2
%10 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%cmp11.2 = icmp eq i32 %10, 1
br i1 %cmp11.2, label %for.inc.2, label %if.end13.2
if.end13.2: ; preds = %lor.lhs.false6.2
store i32 2, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.2, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.2, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 2), align 8, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end13.2, %lor.lhs.false6.2, %lor.lhs.false.2, %for.inc.1
%11 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %11, 1
br i1 %cmp2.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %for.inc.2
%12 = add nsw i64 %idxprom14, 3
%arrayidx4.3 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %12
%13 = load i32, ptr %arrayidx4.3, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %13, 1
br i1 %cmp5.3, label %for.inc.3, label %lor.lhs.false6.3
lor.lhs.false6.3: ; preds = %lor.lhs.false.3
%sub8.3 = add i32 %i, 4
%idxprom9.3 = sext i32 %sub8.3 to i64
%arrayidx10.3 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom9.3
%14 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%cmp11.3 = icmp eq i32 %14, 1
br i1 %cmp11.3, label %for.inc.3, label %if.end13.3
if.end13.3: ; preds = %lor.lhs.false6.3
store i32 3, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.3, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.3, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 3), align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end13.3, %lor.lhs.false6.3, %lor.lhs.false.3, %for.inc.2
%15 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
%cmp2.4 = icmp eq i32 %15, 1
br i1 %cmp2.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %for.inc.3
%16 = add nsw i64 %idxprom14, 4
%arrayidx4.4 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %16
%17 = load i32, ptr %arrayidx4.4, align 4, !tbaa !5
%cmp5.4 = icmp eq i32 %17, 1
br i1 %cmp5.4, label %for.inc.4, label %lor.lhs.false6.4
lor.lhs.false6.4: ; preds = %lor.lhs.false.4
%sub8.4 = add i32 %i, 3
%idxprom9.4 = sext i32 %sub8.4 to i64
%arrayidx10.4 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom9.4
%18 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5
%cmp11.4 = icmp eq i32 %18, 1
br i1 %cmp11.4, label %for.inc.4, label %if.end13.4
if.end13.4: ; preds = %lor.lhs.false6.4
store i32 4, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.4, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.4, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 4), align 16, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end13.4, %lor.lhs.false6.4, %lor.lhs.false.4, %for.inc.3
%19 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
%cmp2.5 = icmp eq i32 %19, 1
br i1 %cmp2.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %for.inc.4
%20 = add nsw i64 %idxprom14, 5
%arrayidx4.5 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %20
%21 = load i32, ptr %arrayidx4.5, align 4, !tbaa !5
%cmp5.5 = icmp eq i32 %21, 1
br i1 %cmp5.5, label %for.inc.5, label %lor.lhs.false6.5
lor.lhs.false6.5: ; preds = %lor.lhs.false.5
%sub8.5 = add i32 %i, 2
%idxprom9.5 = sext i32 %sub8.5 to i64
%arrayidx10.5 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom9.5
%22 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5
%cmp11.5 = icmp eq i32 %22, 1
br i1 %cmp11.5, label %for.inc.5, label %if.end13.5
if.end13.5: ; preds = %lor.lhs.false6.5
store i32 5, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.5, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.5, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 5), align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end13.5, %lor.lhs.false6.5, %lor.lhs.false.5, %for.inc.4
%23 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
%cmp2.6 = icmp eq i32 %23, 1
br i1 %cmp2.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %for.inc.5
%24 = add nsw i64 %idxprom14, 6
%arrayidx4.6 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %24
%25 = load i32, ptr %arrayidx4.6, align 4, !tbaa !5
%cmp5.6 = icmp eq i32 %25, 1
br i1 %cmp5.6, label %for.inc.6, label %lor.lhs.false6.6
lor.lhs.false6.6: ; preds = %lor.lhs.false.6
%sub8.6 = add i32 %i, 1
%idxprom9.6 = sext i32 %sub8.6 to i64
%arrayidx10.6 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom9.6
%26 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5
%cmp11.6 = icmp eq i32 %26, 1
br i1 %cmp11.6, label %for.inc.6, label %if.end13.6
if.end13.6: ; preds = %lor.lhs.false6.6
store i32 6, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.6, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.6, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 6), align 8, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end13.6, %lor.lhs.false6.6, %lor.lhs.false.6, %for.inc.5
%27 = load i32, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
%cmp2.7 = icmp eq i32 %27, 1
br i1 %cmp2.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %for.inc.6
%28 = add nsw i64 %idxprom14, 7
%arrayidx4.7 = getelementptr inbounds [15 x i32], ptr @dpos, i64 0, i64 %28
%29 = load i32, ptr %arrayidx4.7, align 4, !tbaa !5
%cmp5.7 = icmp eq i32 %29, 1
br i1 %cmp5.7, label %common.ret, label %lor.lhs.false6.7
lor.lhs.false6.7: ; preds = %lor.lhs.false.7
%arrayidx10.7 = getelementptr inbounds [15 x i32], ptr @deng, i64 0, i64 %idxprom14
%30 = load i32, ptr %arrayidx10.7, align 4, !tbaa !5
%cmp11.7 = icmp eq i32 %30, 1
br i1 %cmp11.7, label %common.ret, label %if.end13.7
common.ret: ; preds = %if.then, %lor.lhs.false6.7, %lor.lhs.false.7, %for.inc.6, %if.end13.7
ret void
if.end13.7: ; preds = %lor.lhs.false6.7
store i32 7, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 1, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
tail call void @putQueen(i32 noundef %add26)
store i32 0, ptr %arrayidx10.7, align 4, !tbaa !5
store i32 0, ptr %arrayidx4.7, align 4, !tbaa !5
store i32 0, ptr getelementptr inbounds ([8 x i32], ptr @col, i64 0, i64 7), align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @print() local_unnamed_addr #0 {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc.7
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc.7 ]
%arrayidx8 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 0
%0 = load i32, ptr %arrayidx5, align 16, !tbaa !5
%cmp6 = icmp eq i32 %0, 1
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.cond1.preheader
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp eq i32 %1, 0
br i1 %cmp9.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.cond1.preheader, %if.then
%arrayidx5.1 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 1
%2 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp eq i32 %2, 1
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.1 = icmp eq i32 %3, 1
br i1 %cmp9.not.1, label %for.inc.1, label %cleanup
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx5.2 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 2
%4 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%cmp6.2 = icmp eq i32 %4, 1
br i1 %cmp6.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.2 = icmp eq i32 %5, 2
br i1 %cmp9.not.2, label %for.inc.2, label %cleanup
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx5.3 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 3
%6 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%cmp6.3 = icmp eq i32 %6, 1
br i1 %cmp6.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%7 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.3 = icmp eq i32 %7, 3
br i1 %cmp9.not.3, label %for.inc.3, label %cleanup
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx5.4 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 4
%8 = load i32, ptr %arrayidx5.4, align 16, !tbaa !5
%cmp6.4 = icmp eq i32 %8, 1
br i1 %cmp6.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.4 = icmp eq i32 %9, 4
br i1 %cmp9.not.4, label %for.inc.4, label %cleanup
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx5.5 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 5
%10 = load i32, ptr %arrayidx5.5, align 4, !tbaa !5
%cmp6.5 = icmp eq i32 %10, 1
br i1 %cmp6.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
%11 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.5 = icmp eq i32 %11, 5
br i1 %cmp9.not.5, label %for.inc.5, label %cleanup
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx5.6 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 6
%12 = load i32, ptr %arrayidx5.6, align 8, !tbaa !5
%cmp6.6 = icmp eq i32 %12, 1
br i1 %cmp6.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
%13 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.6 = icmp eq i32 %13, 6
br i1 %cmp9.not.6, label %for.inc.6, label %cleanup
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx5.7 = getelementptr inbounds [8 x [8 x i32]], ptr @judge, i64 0, i64 %indvars.iv, i64 7
%14 = load i32, ptr %arrayidx5.7, align 4, !tbaa !5
%cmp6.7 = icmp eq i32 %14, 1
br i1 %cmp6.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
%15 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not.7 = icmp eq i32 %15, 7
br i1 %cmp9.not.7, label %for.inc.7, label %cleanup
for.inc.7: ; preds = %if.then.7, %for.inc.6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.cond18.preheader, label %for.cond1.preheader, !llvm.loop !11
for.cond18.preheader: ; preds = %for.inc.7, %for.cond18.preheader
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.cond18.preheader ], [ 0, %for.inc.7 ]
%arrayidx22 = getelementptr inbounds [8 x i32], ptr @row, i64 0, i64 %indvars.iv58
%16 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp eq i32 %16, 0
%. = select i1 %cmp23, i32 81, i32 46
%putchar48 = tail call i32 @putchar(i32 %.)
%17 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.1 = icmp eq i32 %17, 1
%.sink63 = select i1 %cmp23.1, i32 81, i32 46
%putchar48.1 = tail call i32 @putchar(i32 %.sink63)
%18 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.2 = icmp eq i32 %18, 2
%.sink64 = select i1 %cmp23.2, i32 81, i32 46
%putchar48.2 = tail call i32 @putchar(i32 %.sink64)
%19 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.3 = icmp eq i32 %19, 3
%.sink65 = select i1 %cmp23.3, i32 81, i32 46
%putchar48.3 = tail call i32 @putchar(i32 %.sink65)
%20 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.4 = icmp eq i32 %20, 4
%.sink66 = select i1 %cmp23.4, i32 81, i32 46
%putchar48.4 = tail call i32 @putchar(i32 %.sink66)
%21 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.5 = icmp eq i32 %21, 5
%.sink67 = select i1 %cmp23.5, i32 81, i32 46
%putchar48.5 = tail call i32 @putchar(i32 %.sink67)
%22 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.6 = icmp eq i32 %22, 6
%.sink68 = select i1 %cmp23.6, i32 81, i32 46
%putchar48.6 = tail call i32 @putchar(i32 %.sink68)
%23 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23.7 = icmp eq i32 %23, 7
%.sink69 = select i1 %cmp23.7, i32 81, i32 46
%putchar48.7 = tail call i32 @putchar(i32 %.sink69)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond61.not = icmp eq i64 %indvars.iv.next59, 8
br i1 %exitcond61.not, label %cleanup, label %for.cond18.preheader, !llvm.loop !12
cleanup: ; preds = %if.then, %if.then.1, %if.then.2, %if.then.3, %if.then.4, %if.then.5, %if.then.6, %if.then.7, %for.cond18.preheader
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#define N 8
void putq(int i,int row[],int col[],int dpos[],int dneg[]);
void printQ(int row[]);
char A[N][N];
int memo[N]={10};
int main()
{
int k,i,j,r,c;
int col[N]={10},dpos[15]={10},dneg[15]={10},row[N]={10};
scanf("%d",&k);
for(i=0;i<k;i++){
scanf("%d",&r);
scanf("%d",&c);
row[r]=c;
memo[r]=r;
col[c]=dpos[r+c]=dneg[r-c+N-1]=-1;
}
putq(0,row,col,dpos,dneg);
return 0;
}
void putq(int i,int row[],int col[],int dpos[],int dneg[])
{
int j=-1;
if(i==N){
printQ(row);
return ;
}
if(memo[i]==i)putq(i+1,row,col,dpos,dneg);
for(j=0;j<N;j++){
if(memo[i]==i)break;
if(col[j]==-1 || dpos[i+j]==-1 || dneg[i-j+N-1]==-1)continue;
row[i]=j;
col[j]=dpos[i+j]=dneg[i-j+N-1]=-1;
putq(i+1,row,col,dpos,dneg);
col[j]=dpos[i+j]=dneg[i-j+N-1]=1;
}
}
void printQ(int row[])
{
int i,j,k;
for(i=0;i<N;i++)A[i][row[i]]='Q';
for(i=0;i<N;i++){
for(j=0;j<N;j++){
if(A[i][j]=='Q')printf("Q");
else printf(".");
}
printf("\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233168/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233168/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@memo = dso_local local_unnamed_addr global [8 x i32] [i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], align 16
@__const.main.row = private unnamed_addr constant [8 x i32] [i32 10, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@A = dso_local local_unnamed_addr global [8 x [8 x i8]] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%r = alloca i32, align 4
%c = alloca i32, align 4
%col = alloca [8 x i32], align 16
%dpos = alloca [15 x i32], align 16
%dneg = alloca [15 x i32], align 16
%row = alloca [8 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %col) #6
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %col, ptr noundef nonnull align 16 dereferenceable(32) @__const.main.row, i64 32, i1 false)
call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %dpos) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) %dpos, i8 0, i64 60, i1 false)
store i32 10, ptr %dpos, align 16
call void @llvm.lifetime.start.p0(i64 60, ptr nonnull %dneg) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(60) %dneg, i8 0, i64 60, i1 false)
store i32 10, ptr %dneg, align 16
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %row) #6
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %row, ptr noundef nonnull align 16 dereferenceable(32) @__const.main.row, i64 32, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.018 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%1 = load i32, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %r, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%arrayidx = getelementptr inbounds [8 x i32], ptr %row, i64 0, i64 %idxprom
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx4 = getelementptr inbounds [8 x i32], ptr @memo, i64 0, i64 %idxprom
store i32 %2, ptr %arrayidx4, align 4, !tbaa !5
%reass.sub = sub i32 %2, %1
%sub5 = add i32 %reass.sub, 7
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [15 x i32], ptr %dneg, i64 0, i64 %idxprom6
store i32 -1, ptr %arrayidx7, align 4, !tbaa !5
%add8 = add nsw i32 %2, %1
%idxprom9 = sext i32 %add8 to i64
%arrayidx10 = getelementptr inbounds [15 x i32], ptr %dpos, i64 0, i64 %idxprom9
store i32 -1, ptr %arrayidx10, align 4, !tbaa !5
%idxprom11 = sext i32 %1 to i64
%arrayidx12 = getelementptr inbounds [8 x i32], ptr %col, i64 0, i64 %idxprom11
store i32 -1, ptr %arrayidx12, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.018, 1
%3 = load i32, ptr %k, 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
call void @putq(i32 noundef 0, ptr noundef nonnull %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %row) #6
call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %dneg) #6
call void @llvm.lifetime.end.p0(i64 60, ptr nonnull %dpos) #6
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %col) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @putq(i32 noundef %i, ptr noundef %row, ptr noundef %col, ptr noundef %dpos, ptr noundef %dneg) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %i, 8
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
tail call void @printQ(ptr noundef %row)
br label %common.ret
if.end: ; preds = %entry
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [8 x i32], ptr @memo, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %i
%add = add nsw i32 %i, 1
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef %col, ptr noundef %dpos, ptr noundef %dneg)
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.end, %if.then2
%1 = phi i32 [ %.pre, %if.then2 ], [ %0, %if.end ]
%sub = add i32 %i, 7
%arrayidx26 = getelementptr inbounds i32, ptr %row, i64 %idxprom
%cmp7 = icmp eq i32 %1, %i
br i1 %cmp7, label %common.ret, label %if.end9
if.end9: ; preds = %if.end3
%2 = load i32, ptr %col, align 4, !tbaa !5
%cmp12 = icmp eq i32 %2, -1
br i1 %cmp12, label %for.inc, label %lor.lhs.false
lor.lhs.false: ; preds = %if.end9
%arrayidx15 = getelementptr inbounds i32, ptr %dpos, i64 %idxprom
%3 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp eq i32 %3, -1
br i1 %cmp16, label %for.inc, label %lor.lhs.false17
lor.lhs.false17: ; preds = %lor.lhs.false
%idxprom20 = sext i32 %sub to i64
%arrayidx21 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20
%4 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp eq i32 %4, -1
br i1 %cmp22, label %for.inc, label %if.end24
if.end24: ; preds = %lor.lhs.false17
store i32 0, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15, align 4, !tbaa !5
store i32 -1, ptr %col, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
store i32 1, ptr %arrayidx15, align 4, !tbaa !5
store i32 1, ptr %col, align 4, !tbaa !5
%.pre90 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end9, %lor.lhs.false, %lor.lhs.false17, %if.end24
%5 = phi i32 [ %1, %if.end9 ], [ %1, %lor.lhs.false ], [ %1, %lor.lhs.false17 ], [ %.pre90, %if.end24 ]
%cmp7.1 = icmp eq i32 %5, %i
br i1 %cmp7.1, label %common.ret, label %if.end9.1
if.end9.1: ; preds = %for.inc
%arrayidx11.1 = getelementptr inbounds i32, ptr %col, i64 1
%6 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%cmp12.1 = icmp eq i32 %6, -1
br i1 %cmp12.1, label %for.inc.1, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %if.end9.1
%7 = getelementptr i32, ptr %dpos, i64 %idxprom
%arrayidx15.1 = getelementptr i32, ptr %7, i64 1
%8 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%cmp16.1 = icmp eq i32 %8, -1
br i1 %cmp16.1, label %for.inc.1, label %lor.lhs.false17.1
lor.lhs.false17.1: ; preds = %lor.lhs.false.1
%sub19.1 = add i32 %i, 6
%idxprom20.1 = sext i32 %sub19.1 to i64
%arrayidx21.1 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.1
%9 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%cmp22.1 = icmp eq i32 %9, -1
br i1 %cmp22.1, label %for.inc.1, label %if.end24.1
if.end24.1: ; preds = %lor.lhs.false17.1
store i32 1, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21.1, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15.1, align 4, !tbaa !5
store i32 -1, ptr %arrayidx11.1, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx15.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.1, align 4, !tbaa !5
%.pre91 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end24.1, %lor.lhs.false17.1, %lor.lhs.false.1, %if.end9.1
%10 = phi i32 [ %.pre91, %if.end24.1 ], [ %5, %lor.lhs.false17.1 ], [ %5, %lor.lhs.false.1 ], [ %5, %if.end9.1 ]
%cmp7.2 = icmp eq i32 %10, %i
br i1 %cmp7.2, label %common.ret, label %if.end9.2
if.end9.2: ; preds = %for.inc.1
%arrayidx11.2 = getelementptr inbounds i32, ptr %col, i64 2
%11 = load i32, ptr %arrayidx11.2, align 4, !tbaa !5
%cmp12.2 = icmp eq i32 %11, -1
br i1 %cmp12.2, label %for.inc.2, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %if.end9.2
%12 = getelementptr i32, ptr %dpos, i64 %idxprom
%arrayidx15.2 = getelementptr i32, ptr %12, i64 2
%13 = load i32, ptr %arrayidx15.2, align 4, !tbaa !5
%cmp16.2 = icmp eq i32 %13, -1
br i1 %cmp16.2, label %for.inc.2, label %lor.lhs.false17.2
lor.lhs.false17.2: ; preds = %lor.lhs.false.2
%sub19.2 = add i32 %i, 5
%idxprom20.2 = sext i32 %sub19.2 to i64
%arrayidx21.2 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.2
%14 = load i32, ptr %arrayidx21.2, align 4, !tbaa !5
%cmp22.2 = icmp eq i32 %14, -1
br i1 %cmp22.2, label %for.inc.2, label %if.end24.2
if.end24.2: ; preds = %lor.lhs.false17.2
store i32 2, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21.2, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15.2, align 4, !tbaa !5
store i32 -1, ptr %arrayidx11.2, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx15.2, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.2, align 4, !tbaa !5
%.pre92 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end24.2, %lor.lhs.false17.2, %lor.lhs.false.2, %if.end9.2
%15 = phi i32 [ %.pre92, %if.end24.2 ], [ %10, %lor.lhs.false17.2 ], [ %10, %lor.lhs.false.2 ], [ %10, %if.end9.2 ]
%cmp7.3 = icmp eq i32 %15, %i
br i1 %cmp7.3, label %common.ret, label %if.end9.3
if.end9.3: ; preds = %for.inc.2
%arrayidx11.3 = getelementptr inbounds i32, ptr %col, i64 3
%16 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%cmp12.3 = icmp eq i32 %16, -1
br i1 %cmp12.3, label %for.inc.3, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %if.end9.3
%17 = getelementptr i32, ptr %dpos, i64 %idxprom
%arrayidx15.3 = getelementptr i32, ptr %17, i64 3
%18 = load i32, ptr %arrayidx15.3, align 4, !tbaa !5
%cmp16.3 = icmp eq i32 %18, -1
br i1 %cmp16.3, label %for.inc.3, label %lor.lhs.false17.3
lor.lhs.false17.3: ; preds = %lor.lhs.false.3
%sub19.3 = add i32 %i, 4
%idxprom20.3 = sext i32 %sub19.3 to i64
%arrayidx21.3 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.3
%19 = load i32, ptr %arrayidx21.3, align 4, !tbaa !5
%cmp22.3 = icmp eq i32 %19, -1
br i1 %cmp22.3, label %for.inc.3, label %if.end24.3
if.end24.3: ; preds = %lor.lhs.false17.3
store i32 3, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21.3, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15.3, align 4, !tbaa !5
store i32 -1, ptr %arrayidx11.3, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx15.3, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.3, align 4, !tbaa !5
%.pre93 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.end24.3, %lor.lhs.false17.3, %lor.lhs.false.3, %if.end9.3
%20 = phi i32 [ %.pre93, %if.end24.3 ], [ %15, %lor.lhs.false17.3 ], [ %15, %lor.lhs.false.3 ], [ %15, %if.end9.3 ]
%cmp7.4 = icmp eq i32 %20, %i
br i1 %cmp7.4, label %common.ret, label %if.end9.4
if.end9.4: ; preds = %for.inc.3
%arrayidx11.4 = getelementptr inbounds i32, ptr %col, i64 4
%21 = load i32, ptr %arrayidx11.4, align 4, !tbaa !5
%cmp12.4 = icmp eq i32 %21, -1
br i1 %cmp12.4, label %for.inc.4, label %lor.lhs.false.4
lor.lhs.false.4: ; preds = %if.end9.4
%22 = getelementptr i32, ptr %dpos, i64 %idxprom
%arrayidx15.4 = getelementptr i32, ptr %22, i64 4
%23 = load i32, ptr %arrayidx15.4, align 4, !tbaa !5
%cmp16.4 = icmp eq i32 %23, -1
br i1 %cmp16.4, label %for.inc.4, label %lor.lhs.false17.4
lor.lhs.false17.4: ; preds = %lor.lhs.false.4
%sub19.4 = add i32 %i, 3
%idxprom20.4 = sext i32 %sub19.4 to i64
%arrayidx21.4 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.4
%24 = load i32, ptr %arrayidx21.4, align 4, !tbaa !5
%cmp22.4 = icmp eq i32 %24, -1
br i1 %cmp22.4, label %for.inc.4, label %if.end24.4
if.end24.4: ; preds = %lor.lhs.false17.4
store i32 4, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21.4, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15.4, align 4, !tbaa !5
store i32 -1, ptr %arrayidx11.4, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx15.4, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.4, align 4, !tbaa !5
%.pre94 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.end24.4, %lor.lhs.false17.4, %lor.lhs.false.4, %if.end9.4
%25 = phi i32 [ %.pre94, %if.end24.4 ], [ %20, %lor.lhs.false17.4 ], [ %20, %lor.lhs.false.4 ], [ %20, %if.end9.4 ]
%cmp7.5 = icmp eq i32 %25, %i
br i1 %cmp7.5, label %common.ret, label %if.end9.5
if.end9.5: ; preds = %for.inc.4
%arrayidx11.5 = getelementptr inbounds i32, ptr %col, i64 5
%26 = load i32, ptr %arrayidx11.5, align 4, !tbaa !5
%cmp12.5 = icmp eq i32 %26, -1
br i1 %cmp12.5, label %for.inc.5, label %lor.lhs.false.5
lor.lhs.false.5: ; preds = %if.end9.5
%27 = getelementptr i32, ptr %dpos, i64 %idxprom
%arrayidx15.5 = getelementptr i32, ptr %27, i64 5
%28 = load i32, ptr %arrayidx15.5, align 4, !tbaa !5
%cmp16.5 = icmp eq i32 %28, -1
br i1 %cmp16.5, label %for.inc.5, label %lor.lhs.false17.5
lor.lhs.false17.5: ; preds = %lor.lhs.false.5
%sub19.5 = add i32 %i, 2
%idxprom20.5 = sext i32 %sub19.5 to i64
%arrayidx21.5 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.5
%29 = load i32, ptr %arrayidx21.5, align 4, !tbaa !5
%cmp22.5 = icmp eq i32 %29, -1
br i1 %cmp22.5, label %for.inc.5, label %if.end24.5
if.end24.5: ; preds = %lor.lhs.false17.5
store i32 5, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21.5, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15.5, align 4, !tbaa !5
store i32 -1, ptr %arrayidx11.5, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx15.5, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.5, align 4, !tbaa !5
%.pre95 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.end24.5, %lor.lhs.false17.5, %lor.lhs.false.5, %if.end9.5
%30 = phi i32 [ %.pre95, %if.end24.5 ], [ %25, %lor.lhs.false17.5 ], [ %25, %lor.lhs.false.5 ], [ %25, %if.end9.5 ]
%cmp7.6 = icmp eq i32 %30, %i
br i1 %cmp7.6, label %common.ret, label %if.end9.6
if.end9.6: ; preds = %for.inc.5
%arrayidx11.6 = getelementptr inbounds i32, ptr %col, i64 6
%31 = load i32, ptr %arrayidx11.6, align 4, !tbaa !5
%cmp12.6 = icmp eq i32 %31, -1
br i1 %cmp12.6, label %for.inc.6, label %lor.lhs.false.6
lor.lhs.false.6: ; preds = %if.end9.6
%32 = getelementptr i32, ptr %dpos, i64 %idxprom
%arrayidx15.6 = getelementptr i32, ptr %32, i64 6
%33 = load i32, ptr %arrayidx15.6, align 4, !tbaa !5
%cmp16.6 = icmp eq i32 %33, -1
br i1 %cmp16.6, label %for.inc.6, label %lor.lhs.false17.6
lor.lhs.false17.6: ; preds = %lor.lhs.false.6
%sub19.6 = add i32 %i, 1
%idxprom20.6 = sext i32 %sub19.6 to i64
%arrayidx21.6 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom20.6
%34 = load i32, ptr %arrayidx21.6, align 4, !tbaa !5
%cmp22.6 = icmp eq i32 %34, -1
br i1 %cmp22.6, label %for.inc.6, label %if.end24.6
if.end24.6: ; preds = %lor.lhs.false17.6
store i32 6, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21.6, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15.6, align 4, !tbaa !5
store i32 -1, ptr %arrayidx11.6, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx15.6, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.6, align 4, !tbaa !5
%.pre96 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.end24.6, %lor.lhs.false17.6, %lor.lhs.false.6, %if.end9.6
%35 = phi i32 [ %.pre96, %if.end24.6 ], [ %30, %lor.lhs.false17.6 ], [ %30, %lor.lhs.false.6 ], [ %30, %if.end9.6 ]
%cmp7.7 = icmp eq i32 %35, %i
br i1 %cmp7.7, label %common.ret, label %if.end9.7
if.end9.7: ; preds = %for.inc.6
%arrayidx11.7 = getelementptr inbounds i32, ptr %col, i64 7
%36 = load i32, ptr %arrayidx11.7, align 4, !tbaa !5
%cmp12.7 = icmp eq i32 %36, -1
br i1 %cmp12.7, label %common.ret, label %lor.lhs.false.7
lor.lhs.false.7: ; preds = %if.end9.7
%37 = getelementptr i32, ptr %dpos, i64 %idxprom
%arrayidx15.7 = getelementptr i32, ptr %37, i64 7
%38 = load i32, ptr %arrayidx15.7, align 4, !tbaa !5
%cmp16.7 = icmp eq i32 %38, -1
br i1 %cmp16.7, label %common.ret, label %lor.lhs.false17.7
lor.lhs.false17.7: ; preds = %lor.lhs.false.7
%arrayidx21.7 = getelementptr inbounds i32, ptr %dneg, i64 %idxprom
%39 = load i32, ptr %arrayidx21.7, align 4, !tbaa !5
%cmp22.7 = icmp eq i32 %39, -1
br i1 %cmp22.7, label %common.ret, label %if.end24.7
common.ret: ; preds = %if.then, %if.end9.7, %lor.lhs.false.7, %lor.lhs.false17.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %if.end3, %if.end24.7
ret void
if.end24.7: ; preds = %lor.lhs.false17.7
store i32 7, ptr %arrayidx26, align 4, !tbaa !5
store i32 -1, ptr %arrayidx21.7, align 4, !tbaa !5
store i32 -1, ptr %arrayidx15.7, align 4, !tbaa !5
store i32 -1, ptr %arrayidx11.7, align 4, !tbaa !5
tail call void @putq(i32 noundef %add, ptr noundef %row, ptr noundef nonnull %col, ptr noundef nonnull %dpos, ptr noundef nonnull %dneg)
store i32 1, ptr %arrayidx21.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx15.7, align 4, !tbaa !5
store i32 1, ptr %arrayidx11.7, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @printQ(ptr nocapture noundef readonly %row) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %row, align 4, !tbaa !5
%idxprom3 = sext i32 %0 to i64
%arrayidx4 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 0, i64 %idxprom3
store i8 81, ptr %arrayidx4, align 1, !tbaa !11
%arrayidx2.1 = getelementptr inbounds i32, ptr %row, i64 1
%1 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%idxprom3.1 = sext i32 %1 to i64
%arrayidx4.1 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 1, i64 %idxprom3.1
store i8 81, ptr %arrayidx4.1, align 1, !tbaa !11
%arrayidx2.2 = getelementptr inbounds i32, ptr %row, i64 2
%2 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%idxprom3.2 = sext i32 %2 to i64
%arrayidx4.2 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 2, i64 %idxprom3.2
store i8 81, ptr %arrayidx4.2, align 1, !tbaa !11
%arrayidx2.3 = getelementptr inbounds i32, ptr %row, i64 3
%3 = load i32, ptr %arrayidx2.3, align 4, !tbaa !5
%idxprom3.3 = sext i32 %3 to i64
%arrayidx4.3 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 3, i64 %idxprom3.3
store i8 81, ptr %arrayidx4.3, align 1, !tbaa !11
%arrayidx2.4 = getelementptr inbounds i32, ptr %row, i64 4
%4 = load i32, ptr %arrayidx2.4, align 4, !tbaa !5
%idxprom3.4 = sext i32 %4 to i64
%arrayidx4.4 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 4, i64 %idxprom3.4
store i8 81, ptr %arrayidx4.4, align 1, !tbaa !11
%arrayidx2.5 = getelementptr inbounds i32, ptr %row, i64 5
%5 = load i32, ptr %arrayidx2.5, align 4, !tbaa !5
%idxprom3.5 = sext i32 %5 to i64
%arrayidx4.5 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 5, i64 %idxprom3.5
store i8 81, ptr %arrayidx4.5, align 1, !tbaa !11
%arrayidx2.6 = getelementptr inbounds i32, ptr %row, i64 6
%6 = load i32, ptr %arrayidx2.6, align 4, !tbaa !5
%idxprom3.6 = sext i32 %6 to i64
%arrayidx4.6 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 6, i64 %idxprom3.6
store i8 81, ptr %arrayidx4.6, align 1, !tbaa !11
%arrayidx2.7 = getelementptr inbounds i32, ptr %row, i64 7
%7 = load i32, ptr %arrayidx2.7, align 4, !tbaa !5
%idxprom3.7 = sext i32 %7 to i64
%arrayidx4.7 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 7, i64 %idxprom3.7
store i8 81, ptr %arrayidx4.7, align 1, !tbaa !11
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %entry, %for.cond8.preheader
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond8.preheader ]
%arrayidx14 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 0
%8 = load i8, ptr %arrayidx14, align 8, !tbaa !11
%cmp15 = icmp eq i8 %8, 81
%. = select i1 %cmp15, i32 81, i32 46
%putchar34 = tail call i32 @putchar(i32 %.)
%arrayidx14.1 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 1
%9 = load i8, ptr %arrayidx14.1, align 1, !tbaa !11
%cmp15.1 = icmp eq i8 %9, 81
%.sink41 = select i1 %cmp15.1, i32 81, i32 46
%putchar34.1 = tail call i32 @putchar(i32 %.sink41)
%arrayidx14.2 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 2
%10 = load i8, ptr %arrayidx14.2, align 2, !tbaa !11
%cmp15.2 = icmp eq i8 %10, 81
%.sink42 = select i1 %cmp15.2, i32 81, i32 46
%putchar34.2 = tail call i32 @putchar(i32 %.sink42)
%arrayidx14.3 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 3
%11 = load i8, ptr %arrayidx14.3, align 1, !tbaa !11
%cmp15.3 = icmp eq i8 %11, 81
%.sink43 = select i1 %cmp15.3, i32 81, i32 46
%putchar34.3 = tail call i32 @putchar(i32 %.sink43)
%arrayidx14.4 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 4
%12 = load i8, ptr %arrayidx14.4, align 4, !tbaa !11
%cmp15.4 = icmp eq i8 %12, 81
%.sink44 = select i1 %cmp15.4, i32 81, i32 46
%putchar34.4 = tail call i32 @putchar(i32 %.sink44)
%arrayidx14.5 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 5
%13 = load i8, ptr %arrayidx14.5, align 1, !tbaa !11
%cmp15.5 = icmp eq i8 %13, 81
%.sink45 = select i1 %cmp15.5, i32 81, i32 46
%putchar34.5 = tail call i32 @putchar(i32 %.sink45)
%arrayidx14.6 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 6
%14 = load i8, ptr %arrayidx14.6, align 2, !tbaa !11
%cmp15.6 = icmp eq i8 %14, 81
%.sink46 = select i1 %cmp15.6, i32 81, i32 46
%putchar34.6 = tail call i32 @putchar(i32 %.sink46)
%arrayidx14.7 = getelementptr inbounds [8 x [8 x i8]], ptr @A, i64 0, i64 %indvars.iv, i64 7
%15 = load i8, ptr %arrayidx14.7, align 1, !tbaa !11
%cmp15.7 = icmp eq i8 %15, 81
%.sink47 = select i1 %cmp15.7, i32 81, i32 46
%putchar34.7 = tail call i32 @putchar(i32 %.sink47)
%putchar = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 8
br i1 %exitcond.not, label %for.end24, label %for.cond8.preheader, !llvm.loop !12
for.end24: ; preds = %for.cond8.preheader
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void){
int i,w,cnt,n,h[101],sa[5];
while(scanf("%d",&n),n!=0){
for(i=cnt=w=0;i<=n;i++)scanf("%d",&h[i]);
sa[0]=h[1]-h[0];
sa[1]=h[i-1]-h[i-2];
sa[2]=h[(i-1)/2]-h[(i-1)/2-1];
sa[3]=h[(i-1)/2+1]-h[(i-1)/2];
if(sa[0]==sa[1] || sa[1]==sa[2] || sa[1]==sa[3])sa[4]=sa[1];
if(sa[0]==sa[2] || sa[0]==sa[3])sa[4]=sa[0];
for(i=1;i<=n;i++){
if(h[i]-h[i-1]!=sa[4]){
cnt++;
if(cnt>1)w=h[i-1];
if(h[i+1]-h[i]==sa[4])w=h[i-1];
if(i==n && w<1)w=h[i];
}
}
printf("%d\n",w);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233210/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233210/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%h = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %h) #3
%call142 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not143 = icmp eq i32 %0, 0
br i1 %cmp.not143, label %while.end, label %for.cond.preheader.lr.ph
for.cond.preheader.lr.ph: ; preds = %entry
%arrayidx3 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 1
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %for.end98
%1 = phi i32 [ %0, %for.cond.preheader.lr.ph ], [ %19, %for.end98 ]
%sa.sroa.18.0144 = phi i32 [ undef, %for.cond.preheader.lr.ph ], [ %sa.sroa.18.2, %for.end98 ]
%cmp1.not134 = icmp slt i32 %1, 0
br i1 %cmp1.not134, label %for.end, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp1.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp1.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%4 = trunc i64 %indvars.iv.next to i32
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.cond.preheader
%i.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %4, %for.end.loopexit ]
%.lcssa = phi i32 [ %1, %for.cond.preheader ], [ %2, %for.end.loopexit ]
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%6 = load i32, ptr %h, align 16, !tbaa !5
%sub = sub nsw i32 %5, %6
%sub6 = add nsw i32 %i.0.lcssa, -1
%idxprom7 = sext i32 %sub6 to i64
%arrayidx8 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %idxprom7
%7 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%sub9 = add nsw i32 %i.0.lcssa, -2
%idxprom10 = sext i32 %sub9 to i64
%arrayidx11 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %idxprom10
%8 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%sub12 = sub nsw i32 %7, %8
%div = sdiv i32 %sub6, 2
%idxprom15 = sext i32 %div to i64
%arrayidx16 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %idxprom15
%9 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%sub19 = add nsw i32 %div, -1
%idxprom20 = sext i32 %sub19 to i64
%arrayidx21 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %idxprom20
%10 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%sub22 = sub nsw i32 %9, %10
%add = add nsw i32 %div, 1
%idxprom26 = sext i32 %add to i64
%arrayidx27 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %idxprom26
%11 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%sub32 = sub nsw i32 %11, %9
%cmp36 = icmp eq i32 %sub, %sub12
%cmp39 = icmp eq i32 %sub12, %sub22
%or.cond129 = select i1 %cmp36, i1 true, i1 %cmp39
%cmp43 = icmp eq i32 %sub12, %sub32
%or.cond130 = select i1 %or.cond129, i1 true, i1 %cmp43
%sa.sroa.18.1 = select i1 %or.cond130, i32 %sub12, i32 %sa.sroa.18.0144
%cmp48 = icmp eq i32 %sub, %sub22
%cmp52 = icmp eq i32 %sub, %sub32
%or.cond131 = select i1 %cmp48, i1 true, i1 %cmp52
%sa.sroa.18.2 = select i1 %or.cond131, i32 %sub, i32 %sa.sroa.18.1
%cmp58.not137 = icmp slt i32 %.lcssa, 1
br i1 %cmp58.not137, label %for.end98, label %for.body59.preheader
for.body59.preheader: ; preds = %for.end
%12 = zext i32 %.lcssa to i64
%13 = add nuw i32 %.lcssa, 1
%wide.trip.count = zext i32 %13 to i64
br label %for.body59
for.body59: ; preds = %for.body59.preheader, %for.inc96
%14 = phi i32 [ %6, %for.body59.preheader ], [ %15, %for.inc96 ]
%indvars.iv147 = phi i64 [ 1, %for.body59.preheader ], [ %indvars.iv.next148.pre-phi, %for.inc96 ]
%w.0139 = phi i32 [ 0, %for.body59.preheader ], [ %w.3, %for.inc96 ]
%cnt.0138 = phi i32 [ 0, %for.body59.preheader ], [ %cnt.1, %for.inc96 ]
%arrayidx61 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %indvars.iv147
%15 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%sub65 = sub nsw i32 %15, %14
%cmp67.not = icmp eq i32 %sub65, %sa.sroa.18.2
br i1 %cmp67.not, label %for.body59.for.inc96_crit_edge, label %if.then68
for.body59.for.inc96_crit_edge: ; preds = %for.body59
%.pre = add nuw nsw i64 %indvars.iv147, 1
br label %for.inc96
if.then68: ; preds = %for.body59
%inc69 = add nsw i32 %cnt.0138, 1
%cmp70 = icmp sgt i32 %cnt.0138, 0
%16 = add nuw nsw i64 %indvars.iv147, 1
%idxprom77 = and i64 %16, 4294967295
%arrayidx78 = getelementptr inbounds [101 x i32], ptr %h, i64 0, i64 %idxprom77
%17 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%sub81 = sub nsw i32 %17, %15
%cmp83 = icmp eq i32 %sub81, %sa.sroa.18.2
%18 = select i1 %cmp83, i1 true, i1 %cmp70
%spec.select132 = select i1 %18, i32 %14, i32 %w.0139
%cmp89 = icmp eq i64 %indvars.iv147, %12
%cmp90 = icmp slt i32 %spec.select132, 1
%or.cond = select i1 %cmp89, i1 %cmp90, i1 false
%spec.select133 = select i1 %or.cond, i32 %15, i32 %spec.select132
br label %for.inc96
for.inc96: ; preds = %for.body59.for.inc96_crit_edge, %if.then68
%indvars.iv.next148.pre-phi = phi i64 [ %.pre, %for.body59.for.inc96_crit_edge ], [ %16, %if.then68 ]
%cnt.1 = phi i32 [ %cnt.0138, %for.body59.for.inc96_crit_edge ], [ %inc69, %if.then68 ]
%w.3 = phi i32 [ %w.0139, %for.body59.for.inc96_crit_edge ], [ %spec.select133, %if.then68 ]
%exitcond.not = icmp eq i64 %indvars.iv.next148.pre-phi, %wide.trip.count
br i1 %exitcond.not, label %for.end98, label %for.body59, !llvm.loop !11
for.end98: ; preds = %for.inc96, %for.end
%w.0.lcssa = phi i32 [ 0, %for.end ], [ %w.3, %for.inc96 ]
%call99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %w.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%19 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %19, 0
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12
while.end: ; preds = %for.end98, %entry
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main()
{
int A,B,C,D,t,z;
scanf("%d",&A);
scanf("%d",&B);
scanf("%d",&C);
scanf("%d",&D);
if(A<B){
t=A;
}
else{
t=B;
}
if(C<D){
z=t+C;
}
else{
z=t+D;
}
printf("%d\n",z);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233261/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233261/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%. = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %D, align 4, !tbaa !5
%.pn = call i32 @llvm.smin.i32(i32 %2, i32 %3)
%z.0 = add nsw i32 %.pn, %.
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %z.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a,b,c,d,n,m;
while(~scanf("%d %d %d %d",&a,&b,&c,&d))
{
if(a<b)
{
n=a;
}
else
{
n=b;
}
if(c<d)
{
m=c;
}
else
{
m=d;
}
printf("%d\n",n+m);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233319/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call9 = 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)
%tobool.not10 = icmp eq i32 %call9, -1
br i1 %tobool.not10, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%. = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%m.0 = call i32 @llvm.smin.i32(i32 %2, i32 %3)
%add = add nsw i32 %m.0, %.
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%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)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,c,d,result;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a<=b){
if(c<=d){
result=a+c;
}
else result=a+d;
}
else if(c<=d){
result=b+c;
}else result=b+d;
printf("%d",result);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = 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 = 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)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%cmp5.not = icmp sgt i32 %2, %3
br i1 %cmp.not, label %if.else4, label %if.then
if.then: ; preds = %entry
br i1 %cmp5.not, label %if.else, label %if.then2
if.then2: ; preds = %if.then
%add = add nsw i32 %2, %0
br label %if.end11
if.else: ; preds = %if.then
%add3 = add nsw i32 %3, %0
br label %if.end11
if.else4: ; preds = %entry
br i1 %cmp5.not, label %if.else8, label %if.then6
if.then6: ; preds = %if.else4
%add7 = add nsw i32 %2, %1
br label %if.end11
if.else8: ; preds = %if.else4
%add9 = add nsw i32 %3, %1
br label %if.end11
if.end11: ; preds = %if.then6, %if.else8, %if.then2, %if.else
%result.0 = phi i32 [ %add, %if.then2 ], [ %add3, %if.else ], [ %add7, %if.then6 ], [ %add9, %if.else8 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.0)
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 A, B, C, D;
int min1, min2;
scanf("%d%d%d%d",&A,&B,&C,&D);
min1 = A;
if(B < min1) min1 = B;
min2 = C;
if(D < min2) min2 = D;
printf("%d\n", min1 + min2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233412/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233412/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
%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)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %1, i32 %0)
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %D, align 4, !tbaa !5
%min2.0 = call i32 @llvm.smin.i32(i32 %3, i32 %2)
%add = add nsw i32 %min2.0, %spec.select
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define MIN(x,y) x<y?x:y
int sum(int a,int b,int c,int d){
int sum = MIN(a,b);
sum += MIN(c,d);
return sum;
}
int main(void){
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
printf("%d\n",sum(a,b,c,d));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233463/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233463/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sum(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%cond5 = tail call i32 @llvm.smin.i32(i32 %c, i32 %d)
%add = add nsw i32 %cond5, %cond
ret i32 %add
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
%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)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%cond.i = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%cond5.i = call i32 @llvm.smin.i32(i32 %2, i32 %3)
%add.i = add nsw i32 %cond5.i, %cond.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int A,B,C,D;
scanf("%d",&A);
scanf("%d",&B);
scanf("%d",&C);
scanf("%d",&D);
int E,F,G;
if(A > B){
E = B;
}else{
E = A;
}
if(C > D){
F = D;
}else{
F = C;
}
G = E + F;
printf("%d",G);
return EXIT_SUCCESS;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233506/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233506/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%. = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %D, align 4, !tbaa !5
%F.0 = call i32 @llvm.smin.i32(i32 %2, i32 %3)
%add = add nsw i32 %F.0, %.
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#define INIT_CAP 10
#define INF 1000000000
#define min(a, b) (((a) < (b)) ? (a) : (b))
const int di[4] = {-1, 0, 1, 0};
const int dj[4] = {0, 1, 0, -1};
typedef struct {
int to, w;
} Edge;
typedef struct {
Edge *elem;
int cap, size;
} VecEdge;
typedef struct {
int num, d;
} PNumDis;
VecEdge adj[30 * 30 * 4];
PNumDis heap[30 * 30 * 4 * 4];
int hsize;
int d[30 * 30 * 4];
int w, h;
int field[30][30];
void init(int n) {
while (n--)
adj[n] = (VecEdge){malloc(sizeof(Edge) * INIT_CAP), INIT_CAP, 0};
}
inline void add(int from, int to, int w) {
if (adj[from].size == adj[from].cap) {
adj[from].cap <<= 1;
adj[from].elem = realloc(adj[from].elem, sizeof(Edge) * adj[from].cap);
}
adj[from].elem[adj[from].size++] = (Edge){to, w};
}
inline void insert(int num, int d) {
int i;
for (i = hsize++; i > 0 && d < heap[i - 1 >> 1].d; i = i - 1 >> 1)
heap[i] = heap[i - 1 >> 1];
heap[i] = (PNumDis){num, d};
}
inline int calcNextIdx(int i) {
return i * 2 + 1 + (i * 2 + 2 < hsize && heap[i * 2 + 1].d > heap[i * 2 + 2].d);
}
inline PNumDis delete(void) {
int i;
int nextIdx;
const PNumDis root = heap[0], last = heap[--hsize];
for (i = 0; i * 2 + 1 < hsize && last.d > heap[nextIdx = calcNextIdx(i)].d; i = nextIdx)
heap[i] = heap[nextIdx];
heap[i] = last;
return root;
}
void dijkstra(int n, int s) {
int i;
for (i = 0; i < n; i++)
d[i] = INF;
d[s] = 0;
insert(s, 0);
while (hsize > 0) {
const PNumDis fromP = delete();
if (fromP.d > d[fromP.num])
continue;
for (i = 0; i < adj[fromP.num].size; i++) {
const Edge e = adj[fromP.num].elem[i];
if (fromP.d + e.w < d[e.to]) {
d[e.to] = fromP.d + e.w;
insert(e.to, d[e.to]);
}
}
}
}
int main(void) {
int i, j, k, l;
while (scanf("%d %d", &w, &h), w) {
int c[4];
for (i = 0; i < h; i++)
for (j = 0; j < w; j++)
scanf("%d", field[i] + j);
for (i = 0; i < 4; i++)
scanf("%d", c + i);
init(h * w * 4);
for (i = 0; i < h; i++)
for (j = 0; j < w; j++)
for (k = 0; k < 4; k++)
for (l = 0; l < 4; l++) {
int nd = k + l & 3;
int ni = i + di[nd], nj = j + dj[nd];
if (ni >= 0 && ni < h && nj >= 0 && nj < w)
add(i * w * 4 + j * 4 + k, ni * w * 4 + nj * 4 + nd, l == field[i][j] ? 0 : c[l]);
}
dijkstra(h * w * 4, 1);
printf("%d\n", min(d[(h - 1) * w * 4 + (w - 1) * 4 + 1], d[(h - 1) * w * 4 + (w - 1) * 4 + 2]));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233593/source.c"
target datalayout = "e-m:e-p270: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.VecEdge = type { ptr, i32, i32 }
%struct.PNumDis = type { i32, i32 }
%struct.Edge = type { i32, i32 }
@di = dso_local local_unnamed_addr constant [4 x i32] [i32 -1, i32 0, i32 1, i32 0], align 16
@dj = dso_local local_unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@adj = dso_local local_unnamed_addr global [3600 x %struct.VecEdge] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [3600 x i32] zeroinitializer, align 16
@hsize = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@w = dso_local global i32 0, align 4
@h = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@field = dso_local global [30 x [30 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@heap = dso_local local_unnamed_addr global [14400 x %struct.PNumDis] zeroinitializer, align 16
; Function Attrs: nofree nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable
define dso_local void @init(i32 noundef %n) local_unnamed_addr #0 {
entry:
%tobool.not2 = icmp eq i32 %n, 0
br i1 %tobool.not2, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%0 = sext i32 %n 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 ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv.next
%call = tail call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #8
store ptr %call, ptr %arrayidx, align 16, !tbaa.struct !5
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8
store i32 10, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !12
%.compoundliteral.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 12
store i32 0, ptr %.compoundliteral.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !13
%1 = and i64 %indvars.iv.next, 4294967295
%tobool.not = icmp eq i64 %1, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @dijkstra(i32 noundef %n, i32 noundef %s) local_unnamed_addr #2 {
entry:
%cmp75 = icmp sgt i32 %n, 0
br i1 %cmp75, 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, 8
br i1 %min.iters.check, label %for.body.preheader100, 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 ]
%0 = getelementptr inbounds [3600 x i32], ptr @d, i64 0, i64 %index
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %0, align 16, !tbaa !10
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %1, align 16, !tbaa !10
%index.next = add nuw i64 %index, 8
%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, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader100
for.body.preheader100: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader100, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader100 ]
%arrayidx = getelementptr inbounds [3600 x i32], ptr @d, i64 0, i64 %indvars.iv
store i32 1000000000, ptr %arrayidx, align 4, !tbaa !10
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !19
for.end: ; preds = %for.body, %middle.block, %entry
%idxprom1 = sext i32 %s to i64
%arrayidx2 = getelementptr inbounds [3600 x i32], ptr @d, i64 0, i64 %idxprom1
store i32 0, ptr %arrayidx2, align 4, !tbaa !10
%3 = load i32, ptr @hsize, align 4, !tbaa !10
%inc.i = add nsw i32 %3, 1
store i32 %inc.i, ptr @hsize, align 4, !tbaa !10
%cmp21.i = icmp sgt i32 %3, 0
br i1 %cmp21.i, label %land.rhs.i, label %insert.exit
land.rhs.i: ; preds = %for.end, %for.body.i
%i.022.i = phi i32 [ %shr.i, %for.body.i ], [ %3, %for.end ]
%sub.i = add nsw i32 %i.022.i, -1
%shr.i = lshr i32 %sub.i, 1
%idxprom.i = zext i32 %shr.i to i64
%d1.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i, i32 1
%4 = load i32, ptr %d1.i, align 4, !tbaa !20
%cmp2.i = icmp sgt i32 %4, 0
br i1 %cmp2.i, label %for.body.i, label %insert.exit
for.body.i: ; preds = %land.rhs.i
%arrayidx.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i
%idxprom3.i = zext i32 %i.022.i to i64
%arrayidx4.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom3.i
%5 = load i64, ptr %arrayidx.i, align 8
store i64 %5, ptr %arrayidx4.i, align 8
%cmp.not.i = icmp ult i32 %sub.i, 2
br i1 %cmp.not.i, label %insert.exit, label %land.rhs.i, !llvm.loop !22
insert.exit: ; preds = %land.rhs.i, %for.body.i, %for.end
%i.0.lcssa.i = phi i32 [ %3, %for.end ], [ %i.022.i, %land.rhs.i ], [ %shr.i, %for.body.i ]
%idxprom11.i = sext i32 %i.0.lcssa.i to i64
%arrayidx12.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom11.i
store i32 %s, ptr %arrayidx12.i, align 8, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx12.i, i64 4
store i32 0, ptr %.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i, align 4, !tbaa.struct !13
%cmp386 = icmp sgt i32 %3, -1
br i1 %cmp386, label %while.body, label %while.end
while.body: ; preds = %insert.exit, %cleanup
%hsize.promoted8387 = phi i32 [ %hsize.promoted84, %cleanup ], [ %inc.i, %insert.exit ]
%retval.sroa.0.0.copyload.i = load i64, ptr @heap, align 16, !tbaa.struct !12
%dec.i = add nsw i32 %hsize.promoted8387, -1
store i32 %dec.i, ptr @hsize, align 4, !tbaa !10
%idxprom.i51 = zext i32 %dec.i to i64
%arrayidx.i52 = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i51
%last.sroa.0.0.copyload.i = load i32, ptr %arrayidx.i52, align 8, !tbaa.struct !12
%last.sroa.4.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i52, i64 4
%last.sroa.4.0.copyload.i = load i32, ptr %last.sroa.4.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !13
%cmp17.i = icmp ugt i32 %hsize.promoted8387, 2
br i1 %cmp17.i, label %land.rhs.i54, label %delete.exit
land.rhs.i54: ; preds = %while.body, %for.body.i55
%add20.i = phi i32 [ %add.i, %for.body.i55 ], [ 1, %while.body ]
%mul19.i = phi i32 [ %mul.i, %for.body.i55 ], [ 0, %while.body ]
%i.018.i = phi i32 [ %add11.i.i, %for.body.i55 ], [ 0, %while.body ]
%add2.i.i = add nsw i32 %mul19.i, 2
%cmp.i.i = icmp slt i32 %add2.i.i, %dec.i
br i1 %cmp.i.i, label %land.rhs.i.i, label %calcNextIdx.exit.i
land.rhs.i.i: ; preds = %land.rhs.i54
%idxprom.i.i = sext i32 %add20.i to i64
%d.i.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i.i, i32 1
%6 = load i32, ptr %d.i.i, align 4, !tbaa !20
%idxprom7.i.i = sext i32 %add2.i.i to i64
%d9.i.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom7.i.i, i32 1
%7 = load i32, ptr %d9.i.i, align 4, !tbaa !20
%cmp10.i.i = icmp sgt i32 %6, %7
%8 = zext i1 %cmp10.i.i to i32
br label %calcNextIdx.exit.i
calcNextIdx.exit.i: ; preds = %land.rhs.i.i, %land.rhs.i54
%land.ext.i.i = phi i32 [ 0, %land.rhs.i54 ], [ %8, %land.rhs.i.i ]
%add11.i.i = add nsw i32 %land.ext.i.i, %add20.i
%idxprom1.i = sext i32 %add11.i.i to i64
%d3.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom1.i, i32 1
%9 = load i32, ptr %d3.i, align 4, !tbaa !20
%cmp4.i = icmp sgt i32 %last.sroa.4.0.copyload.i, %9
br i1 %cmp4.i, label %for.body.i55, label %calcNextIdx.exit.i.for.end.loopexit.i_crit_edge
calcNextIdx.exit.i.for.end.loopexit.i_crit_edge: ; preds = %calcNextIdx.exit.i
%.pre = sext i32 %i.018.i to i64
br label %delete.exit
for.body.i55: ; preds = %calcNextIdx.exit.i
%arrayidx2.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom1.i
%idxprom5.i = sext i32 %i.018.i to i64
%arrayidx6.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom5.i
%10 = load i64, ptr %arrayidx2.i, align 8
store i64 %10, ptr %arrayidx6.i, align 8
%mul.i = shl nsw i32 %add11.i.i, 1
%add.i = or i32 %mul.i, 1
%cmp.i = icmp slt i32 %add.i, %dec.i
br i1 %cmp.i, label %land.rhs.i54, label %delete.exit, !llvm.loop !23
delete.exit: ; preds = %for.body.i55, %calcNextIdx.exit.i.for.end.loopexit.i_crit_edge, %while.body
%i.0.lcssa.i53 = phi i64 [ 0, %while.body ], [ %.pre, %calcNextIdx.exit.i.for.end.loopexit.i_crit_edge ], [ %idxprom1.i, %for.body.i55 ]
%arrayidx10.i = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %i.0.lcssa.i53
store i32 %last.sroa.0.0.copyload.i, ptr %arrayidx10.i, align 8, !tbaa.struct !12
%last.sroa.4.0.arrayidx10.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx10.i, i64 4
store i32 %last.sroa.4.0.copyload.i, ptr %last.sroa.4.0.arrayidx10.sroa_idx.i, align 4, !tbaa.struct !13
%fromP.sroa.6.0.extract.shift = lshr i64 %retval.sroa.0.0.copyload.i, 32
%fromP.sroa.6.0.extract.trunc = trunc i64 %fromP.sroa.6.0.extract.shift to i32
%sext = shl i64 %retval.sroa.0.0.copyload.i, 32
%idxprom4 = ashr exact i64 %sext, 32
%arrayidx5 = getelementptr inbounds [3600 x i32], ptr @d, i64 0, i64 %idxprom4
%11 = load i32, ptr %arrayidx5, align 4, !tbaa !10
%cmp6 = icmp slt i32 %11, %fromP.sroa.6.0.extract.trunc
br i1 %cmp6, label %cleanup, label %for.cond7.preheader, !llvm.loop !24
for.cond7.preheader: ; preds = %delete.exit
%size = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom4, i32 2
%12 = load i32, ptr %size, align 4, !tbaa !25
%cmp1179 = icmp sgt i32 %12, 0
br i1 %cmp1179, label %for.body12.lr.ph, label %cleanup
for.body12.lr.ph: ; preds = %for.cond7.preheader
%arrayidx10 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom4
%13 = load ptr, ptr %arrayidx10, align 16, !tbaa !27
%wide.trip.count92 = zext i32 %12 to i64
br label %for.body12
for.body12: ; preds = %for.body12.lr.ph, %if.end33
%indvars.iv89 = phi i64 [ 0, %for.body12.lr.ph ], [ %indvars.iv.next90, %if.end33 ]
%inc.i567880 = phi i32 [ %dec.i, %for.body12.lr.ph ], [ %inc.i5677, %if.end33 ]
%arrayidx17 = getelementptr inbounds %struct.Edge, ptr %13, i64 %indvars.iv89
%e.sroa.0.0.copyload = load i32, ptr %arrayidx17, align 4, !tbaa.struct !12
%e.sroa.7.0.arrayidx17.sroa_idx = getelementptr inbounds i8, ptr %arrayidx17, i64 4
%e.sroa.7.0.copyload = load i32, ptr %e.sroa.7.0.arrayidx17.sroa_idx, align 4, !tbaa.struct !13
%add = add nsw i32 %e.sroa.7.0.copyload, %fromP.sroa.6.0.extract.trunc
%idxprom19 = sext i32 %e.sroa.0.0.copyload to i64
%arrayidx20 = getelementptr inbounds [3600 x i32], ptr @d, i64 0, i64 %idxprom19
%14 = load i32, ptr %arrayidx20, align 4, !tbaa !10
%cmp21 = icmp slt i32 %add, %14
br i1 %cmp21, label %if.then22, label %if.end33
if.then22: ; preds = %for.body12
store i32 %add, ptr %arrayidx20, align 4, !tbaa !10
%inc.i56 = add nsw i32 %inc.i567880, 1
store i32 %inc.i56, ptr @hsize, align 4, !tbaa !10
%cmp21.i57 = icmp sgt i32 %inc.i567880, 0
br i1 %cmp21.i57, label %land.rhs.i62, label %insert.exit74
land.rhs.i62: ; preds = %if.then22, %for.body.i69
%i.022.i63 = phi i32 [ %shr.i65, %for.body.i69 ], [ %inc.i567880, %if.then22 ]
%sub.i64 = add nsw i32 %i.022.i63, -1
%shr.i65 = lshr i32 %sub.i64, 1
%idxprom.i66 = zext i32 %shr.i65 to i64
%d1.i67 = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i66, i32 1
%15 = load i32, ptr %d1.i67, align 4, !tbaa !20
%cmp2.i68 = icmp sgt i32 %15, %add
br i1 %cmp2.i68, label %for.body.i69, label %insert.exit74
for.body.i69: ; preds = %land.rhs.i62
%arrayidx.i70 = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom.i66
%idxprom3.i71 = zext i32 %i.022.i63 to i64
%arrayidx4.i72 = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom3.i71
%16 = load i64, ptr %arrayidx.i70, align 8
store i64 %16, ptr %arrayidx4.i72, align 8
%cmp.not.i73 = icmp ult i32 %sub.i64, 2
br i1 %cmp.not.i73, label %insert.exit74, label %land.rhs.i62, !llvm.loop !22
insert.exit74: ; preds = %land.rhs.i62, %for.body.i69, %if.then22
%i.0.lcssa.i58 = phi i32 [ %inc.i567880, %if.then22 ], [ %i.022.i63, %land.rhs.i62 ], [ %shr.i65, %for.body.i69 ]
%idxprom11.i59 = sext i32 %i.0.lcssa.i58 to i64
%arrayidx12.i60 = getelementptr inbounds [14400 x %struct.PNumDis], ptr @heap, i64 0, i64 %idxprom11.i59
store i32 %e.sroa.0.0.copyload, ptr %arrayidx12.i60, align 8, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i61 = getelementptr inbounds i8, ptr %arrayidx12.i60, i64 4
store i32 %add, ptr %.compoundliteral.sroa.2.0.arrayidx12.sroa_idx.i61, align 4, !tbaa.struct !13
br label %if.end33
if.end33: ; preds = %insert.exit74, %for.body12
%inc.i5677 = phi i32 [ %inc.i56, %insert.exit74 ], [ %inc.i567880, %for.body12 ]
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92
br i1 %exitcond93.not, label %cleanup, label %for.body12, !llvm.loop !28
cleanup: ; preds = %if.end33, %for.cond7.preheader, %delete.exit
%hsize.promoted84 = phi i32 [ %dec.i, %delete.exit ], [ %dec.i, %for.cond7.preheader ], [ %inc.i5677, %if.end33 ]
%cmp3 = icmp sgt i32 %hsize.promoted84, 0
br i1 %cmp3, label %while.body, label %while.end
while.end: ; preds = %cleanup, %insert.exit
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%c = alloca [4 x i32], align 16
%call164 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @w, ptr noundef nonnull @h)
%0 = load i32, ptr @w, align 4, !tbaa !10
%tobool.not165 = icmp eq i32 %0, 0
br i1 %tobool.not165, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%add.ptr13.1 = getelementptr inbounds i32, ptr %c, i64 1
%add.ptr13.2 = getelementptr inbounds i32, ptr %c, i64 2
%add.ptr13.3 = getelementptr inbounds i32, ptr %c, i64 3
br label %while.body
while.body: ; preds = %while.body.preheader, %for.end71
%1 = phi i32 [ %0, %while.body.preheader ], [ %82, %for.end71 ]
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %c) #9
%2 = load i32, ptr @h, align 4, !tbaa !10
%cmp154 = icmp sgt i32 %2, 0
%3 = icmp sgt i32 %1, 0
%or.cond195 = and i1 %cmp154, %3
br i1 %or.cond195, label %for.cond1.preheader, label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.inc5, %while.body
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%call14.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr13.1)
%call14.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr13.2)
%call14.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr13.3)
%4 = load i32, ptr @h, align 4, !tbaa !10
%5 = load i32, ptr @w, align 4, !tbaa !10
%mul = mul nsw i32 %5, %4
%tobool.not2.i = icmp eq i32 %mul, 0
br i1 %tobool.not2.i, label %init.exit, label %while.body.preheader.i
for.cond1.preheader: ; preds = %while.body, %for.inc5
%6 = phi i32 [ %10, %for.inc5 ], [ %2, %while.body ]
%7 = phi i32 [ %11, %for.inc5 ], [ %1, %while.body ]
%indvars.iv170 = phi i64 [ %indvars.iv.next171, %for.inc5 ], [ 0, %while.body ]
%cmp2152 = icmp sgt i32 %7, 0
br i1 %cmp2152, label %for.body3.lr.ph, label %for.inc5
for.body3.lr.ph: ; preds = %for.cond1.preheader
%arrayidx = getelementptr inbounds [30 x [30 x i32]], ptr @field, i64 0, i64 %indvars.iv170
br label %for.body3
for.body3: ; preds = %for.body3.lr.ph, %for.body3
%indvars.iv = phi i64 [ 0, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ]
%add.ptr = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
%call4 = 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
%8 = load i32, ptr @w, align 4, !tbaa !10
%9 = sext i32 %8 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp2, label %for.body3, label %for.inc5.loopexit, !llvm.loop !29
for.inc5.loopexit: ; preds = %for.body3
%.pre = load i32, ptr @h, align 4, !tbaa !10
br label %for.inc5
for.inc5: ; preds = %for.inc5.loopexit, %for.cond1.preheader
%10 = phi i32 [ %.pre, %for.inc5.loopexit ], [ %6, %for.cond1.preheader ]
%11 = phi i32 [ %8, %for.inc5.loopexit ], [ %7, %for.cond1.preheader ]
%indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
%12 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next171, %12
br i1 %cmp, label %for.cond1.preheader, label %for.cond8.preheader, !llvm.loop !30
while.body.preheader.i: ; preds = %for.cond8.preheader
%mul18 = shl nsw i32 %mul, 2
%13 = sext i32 %mul18 to i64
br label %while.body.i
while.body.i: ; preds = %while.body.i, %while.body.preheader.i
%indvars.iv.i = phi i64 [ %13, %while.body.preheader.i ], [ %indvars.iv.next.i, %while.body.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%arrayidx.i = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %indvars.iv.next.i
%call.i = call noalias dereferenceable_or_null(80) ptr @malloc(i64 noundef 80) #8
store ptr %call.i, ptr %arrayidx.i, align 16, !tbaa.struct !5
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 8
store i32 10, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx.i, align 8, !tbaa.struct !12
%.compoundliteral.sroa.3.0.arrayidx.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx.i, i64 12
store i32 0, ptr %.compoundliteral.sroa.3.0.arrayidx.sroa_idx.i, align 4, !tbaa.struct !13
%14 = and i64 %indvars.iv.next.i, 4294967295
%tobool.not.i = icmp eq i64 %14, 0
br i1 %tobool.not.i, label %init.exit, label %while.body.i, !llvm.loop !14
init.exit: ; preds = %while.body.i, %for.cond8.preheader
%cmp20162 = icmp sgt i32 %4, 0
%15 = icmp sgt i32 %5, 0
%or.cond196 = and i1 %cmp20162, %15
br i1 %or.cond196, label %for.cond22.preheader, label %for.end71
for.cond22.preheader: ; preds = %init.exit, %for.inc69
%16 = phi i32 [ %72, %for.inc69 ], [ %4, %init.exit ]
%17 = phi i32 [ %73, %for.inc69 ], [ %5, %init.exit ]
%indvars.iv187 = phi i64 [ %indvars.iv.next188, %for.inc69 ], [ 0, %init.exit ]
%cmp23160 = icmp sgt i32 %17, 0
br i1 %cmp23160, label %for.cond25.preheader.lr.ph, label %for.inc69
for.cond25.preheader.lr.ph: ; preds = %for.cond22.preheader
%18 = trunc i64 %indvars.iv187 to i32
br label %for.cond25.preheader
for.cond25.preheader: ; preds = %for.cond25.preheader.lr.ph, %for.inc66
%indvars.iv184 = phi i64 [ 0, %for.cond25.preheader.lr.ph ], [ %indvars.iv.next185, %for.inc66 ]
%arrayidx56 = getelementptr inbounds [30 x [30 x i32]], ptr @field, i64 0, i64 %indvars.iv187, i64 %indvars.iv184
%19 = trunc i64 %indvars.iv184 to i32
br label %for.cond28.preheader
for.cond28.preheader: ; preds = %for.cond25.preheader, %if.end.3
%indvars.iv180 = phi i64 [ 0, %for.cond25.preheader ], [ %31, %if.end.3 ]
%arrayidx32 = getelementptr inbounds [4 x i32], ptr @di, i64 0, i64 %indvars.iv180
%20 = load i32, ptr %arrayidx32, align 4, !tbaa !10
%add33 = add nsw i32 %20, %18
%arrayidx35 = getelementptr inbounds [4 x i32], ptr @dj, i64 0, i64 %indvars.iv180
%21 = load i32, ptr %arrayidx35, align 4, !tbaa !10
%add36 = add nsw i32 %21, %19
%cmp37 = icmp sgt i32 %add33, -1
br i1 %cmp37, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.cond28.preheader
%22 = load i32, ptr @h, align 4, !tbaa !10
%cmp38 = icmp slt i32 %add33, %22
%cmp40 = icmp sgt i32 %add36, -1
%or.cond = select i1 %cmp38, i1 %cmp40, i1 false
br i1 %or.cond, label %land.lhs.true41, label %if.end
land.lhs.true41: ; preds = %land.lhs.true
%23 = load i32, ptr @w, align 4, !tbaa !10
%cmp42 = icmp slt i32 %add36, %23
br i1 %cmp42, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true41
%mul43 = mul nsw i32 %23, %18
%mul44148 = add i32 %mul43, %19
%add46 = shl i32 %mul44148, 2
%24 = trunc i64 %indvars.iv180 to i32
%add47 = add nsw i32 %add46, %24
%mul48 = mul nsw i32 %23, %add33
%mul49149 = add i32 %mul48, %add36
%add51 = shl i32 %mul49149, 2
%add52 = or i32 %add51, %24
%25 = load i32, ptr %arrayidx56, align 4, !tbaa !10
%cmp57 = icmp eq i32 %25, 0
%26 = load i32, ptr %c, align 16
%spec.select = select i1 %cmp57, i32 0, i32 %26
%idxprom.i = sext i32 %add47 to i64
%arrayidx.i150 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i
%size.i = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i, i32 2
%27 = load i32, ptr %size.i, align 4, !tbaa !25
%cap.i = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i, i32 1
%28 = load i32, ptr %cap.i, align 8, !tbaa !32
%cmp.i = icmp eq i32 %27, %28
%.pre.i = load ptr, ptr %arrayidx.i150, align 16, !tbaa !27
br i1 %cmp.i, label %if.then.i, label %add.exit
if.then.i: ; preds = %if.then
%shl.i = shl i32 %27, 1
store i32 %shl.i, ptr %cap.i, align 8, !tbaa !32
%conv.i = sext i32 %shl.i to i64
%mul.i = shl nsw i64 %conv.i, 3
%call.i151 = call ptr @realloc(ptr noundef %.pre.i, i64 noundef %mul.i) #10
store ptr %call.i151, ptr %arrayidx.i150, align 16, !tbaa !27
%.pre31.i = load i32, ptr %size.i, align 4, !tbaa !25
br label %add.exit
add.exit: ; preds = %if.then, %if.then.i
%29 = phi i32 [ %.pre31.i, %if.then.i ], [ %27, %if.then ]
%30 = phi ptr [ %call.i151, %if.then.i ], [ %.pre.i, %if.then ]
%inc.i = add nsw i32 %29, 1
store i32 %inc.i, ptr %size.i, align 4, !tbaa !25
%idxprom20.i = sext i32 %29 to i64
%arrayidx21.i = getelementptr inbounds %struct.Edge, ptr %30, i64 %idxprom20.i
store i32 %add52, ptr %arrayidx21.i, align 4, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i = getelementptr inbounds i8, ptr %arrayidx21.i, i64 4
store i32 %spec.select, ptr %.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i, align 4, !tbaa.struct !13
br label %if.end
if.end: ; preds = %add.exit, %land.lhs.true41, %land.lhs.true, %for.cond28.preheader
%31 = add nuw nsw i64 %indvars.iv180, 1
%32 = trunc i64 %31 to i32
%and.1 = and i32 %32, 3
%idxprom31.1 = and i64 %31, 3
%arrayidx32.1 = getelementptr inbounds [4 x i32], ptr @di, i64 0, i64 %idxprom31.1
%33 = load i32, ptr %arrayidx32.1, align 4, !tbaa !10
%add33.1 = add nsw i32 %33, %18
%arrayidx35.1 = getelementptr inbounds [4 x i32], ptr @dj, i64 0, i64 %idxprom31.1
%34 = load i32, ptr %arrayidx35.1, align 4, !tbaa !10
%add36.1 = add nsw i32 %34, %19
%cmp37.1 = icmp sgt i32 %add33.1, -1
br i1 %cmp37.1, label %land.lhs.true.1, label %if.end.1
land.lhs.true.1: ; preds = %if.end
%35 = load i32, ptr @h, align 4, !tbaa !10
%cmp38.1 = icmp slt i32 %add33.1, %35
%cmp40.1 = icmp sgt i32 %add36.1, -1
%or.cond.1 = select i1 %cmp38.1, i1 %cmp40.1, i1 false
br i1 %or.cond.1, label %land.lhs.true41.1, label %if.end.1
land.lhs.true41.1: ; preds = %land.lhs.true.1
%36 = load i32, ptr @w, align 4, !tbaa !10
%cmp42.1 = icmp slt i32 %add36.1, %36
br i1 %cmp42.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %land.lhs.true41.1
%mul43.1 = mul nsw i32 %36, %18
%mul44148.1 = add i32 %mul43.1, %19
%add46.1 = shl i32 %mul44148.1, 2
%37 = trunc i64 %indvars.iv180 to i32
%add47.1 = add nsw i32 %add46.1, %37
%mul48.1 = mul nsw i32 %36, %add33.1
%mul49149.1 = add i32 %mul48.1, %add36.1
%add51.1 = shl i32 %mul49149.1, 2
%add52.1 = or i32 %add51.1, %and.1
%38 = load i32, ptr %arrayidx56, align 4, !tbaa !10
%cmp57.1 = icmp eq i32 %38, 1
%39 = load i32, ptr %add.ptr13.1, align 4
%spec.select197 = select i1 %cmp57.1, i32 0, i32 %39
%idxprom.i.1 = sext i32 %add47.1 to i64
%arrayidx.i150.1 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.1
%size.i.1 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.1, i32 2
%40 = load i32, ptr %size.i.1, align 4, !tbaa !25
%cap.i.1 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.1, i32 1
%41 = load i32, ptr %cap.i.1, align 8, !tbaa !32
%cmp.i.1 = icmp eq i32 %40, %41
%.pre.i.1 = load ptr, ptr %arrayidx.i150.1, align 16, !tbaa !27
br i1 %cmp.i.1, label %if.then.i.1, label %add.exit.1
if.then.i.1: ; preds = %if.then.1
%shl.i.1 = shl i32 %40, 1
store i32 %shl.i.1, ptr %cap.i.1, align 8, !tbaa !32
%conv.i.1 = sext i32 %shl.i.1 to i64
%mul.i.1 = shl nsw i64 %conv.i.1, 3
%call.i151.1 = call ptr @realloc(ptr noundef %.pre.i.1, i64 noundef %mul.i.1) #10
store ptr %call.i151.1, ptr %arrayidx.i150.1, align 16, !tbaa !27
%.pre31.i.1 = load i32, ptr %size.i.1, align 4, !tbaa !25
br label %add.exit.1
add.exit.1: ; preds = %if.then.i.1, %if.then.1
%42 = phi i32 [ %.pre31.i.1, %if.then.i.1 ], [ %40, %if.then.1 ]
%43 = phi ptr [ %call.i151.1, %if.then.i.1 ], [ %.pre.i.1, %if.then.1 ]
%inc.i.1 = add nsw i32 %42, 1
store i32 %inc.i.1, ptr %size.i.1, align 4, !tbaa !25
%idxprom20.i.1 = sext i32 %42 to i64
%arrayidx21.i.1 = getelementptr inbounds %struct.Edge, ptr %43, i64 %idxprom20.i.1
store i32 %add52.1, ptr %arrayidx21.i.1, align 4, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i.1 = getelementptr inbounds i8, ptr %arrayidx21.i.1, i64 4
store i32 %spec.select197, ptr %.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i.1, align 4, !tbaa.struct !13
br label %if.end.1
if.end.1: ; preds = %add.exit.1, %land.lhs.true41.1, %land.lhs.true.1, %if.end
%44 = trunc i64 %indvars.iv180 to i32
%45 = add i32 %44, 2
%and.2 = and i32 %45, 3
%idxprom31.2 = zext i32 %and.2 to i64
%arrayidx32.2 = getelementptr inbounds [4 x i32], ptr @di, i64 0, i64 %idxprom31.2
%46 = load i32, ptr %arrayidx32.2, align 4, !tbaa !10
%add33.2 = add nsw i32 %46, %18
%arrayidx35.2 = getelementptr inbounds [4 x i32], ptr @dj, i64 0, i64 %idxprom31.2
%47 = load i32, ptr %arrayidx35.2, align 4, !tbaa !10
%add36.2 = add nsw i32 %47, %19
%cmp37.2 = icmp sgt i32 %add33.2, -1
br i1 %cmp37.2, label %land.lhs.true.2, label %if.end.2
land.lhs.true.2: ; preds = %if.end.1
%48 = load i32, ptr @h, align 4, !tbaa !10
%cmp38.2 = icmp slt i32 %add33.2, %48
%cmp40.2 = icmp sgt i32 %add36.2, -1
%or.cond.2 = select i1 %cmp38.2, i1 %cmp40.2, i1 false
br i1 %or.cond.2, label %land.lhs.true41.2, label %if.end.2
land.lhs.true41.2: ; preds = %land.lhs.true.2
%49 = load i32, ptr @w, align 4, !tbaa !10
%cmp42.2 = icmp slt i32 %add36.2, %49
br i1 %cmp42.2, label %if.then.2, label %if.end.2
if.then.2: ; preds = %land.lhs.true41.2
%mul43.2 = mul nsw i32 %49, %18
%mul44148.2 = add i32 %mul43.2, %19
%add46.2 = shl i32 %mul44148.2, 2
%50 = trunc i64 %indvars.iv180 to i32
%add47.2 = add nsw i32 %add46.2, %50
%mul48.2 = mul nsw i32 %49, %add33.2
%mul49149.2 = add i32 %mul48.2, %add36.2
%add51.2 = shl i32 %mul49149.2, 2
%add52.2 = or i32 %add51.2, %and.2
%51 = load i32, ptr %arrayidx56, align 4, !tbaa !10
%cmp57.2 = icmp eq i32 %51, 2
%52 = load i32, ptr %add.ptr13.2, align 8
%spec.select198 = select i1 %cmp57.2, i32 0, i32 %52
%idxprom.i.2 = sext i32 %add47.2 to i64
%arrayidx.i150.2 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.2
%size.i.2 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.2, i32 2
%53 = load i32, ptr %size.i.2, align 4, !tbaa !25
%cap.i.2 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.2, i32 1
%54 = load i32, ptr %cap.i.2, align 8, !tbaa !32
%cmp.i.2 = icmp eq i32 %53, %54
%.pre.i.2 = load ptr, ptr %arrayidx.i150.2, align 16, !tbaa !27
br i1 %cmp.i.2, label %if.then.i.2, label %add.exit.2
if.then.i.2: ; preds = %if.then.2
%shl.i.2 = shl i32 %53, 1
store i32 %shl.i.2, ptr %cap.i.2, align 8, !tbaa !32
%conv.i.2 = sext i32 %shl.i.2 to i64
%mul.i.2 = shl nsw i64 %conv.i.2, 3
%call.i151.2 = call ptr @realloc(ptr noundef %.pre.i.2, i64 noundef %mul.i.2) #10
store ptr %call.i151.2, ptr %arrayidx.i150.2, align 16, !tbaa !27
%.pre31.i.2 = load i32, ptr %size.i.2, align 4, !tbaa !25
br label %add.exit.2
add.exit.2: ; preds = %if.then.i.2, %if.then.2
%55 = phi i32 [ %.pre31.i.2, %if.then.i.2 ], [ %53, %if.then.2 ]
%56 = phi ptr [ %call.i151.2, %if.then.i.2 ], [ %.pre.i.2, %if.then.2 ]
%inc.i.2 = add nsw i32 %55, 1
store i32 %inc.i.2, ptr %size.i.2, align 4, !tbaa !25
%idxprom20.i.2 = sext i32 %55 to i64
%arrayidx21.i.2 = getelementptr inbounds %struct.Edge, ptr %56, i64 %idxprom20.i.2
store i32 %add52.2, ptr %arrayidx21.i.2, align 4, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i.2 = getelementptr inbounds i8, ptr %arrayidx21.i.2, i64 4
store i32 %spec.select198, ptr %.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i.2, align 4, !tbaa.struct !13
br label %if.end.2
if.end.2: ; preds = %add.exit.2, %land.lhs.true41.2, %land.lhs.true.2, %if.end.1
%57 = trunc i64 %indvars.iv180 to i32
%58 = add i32 %57, 3
%and.3 = and i32 %58, 3
%idxprom31.3 = zext i32 %and.3 to i64
%arrayidx32.3 = getelementptr inbounds [4 x i32], ptr @di, i64 0, i64 %idxprom31.3
%59 = load i32, ptr %arrayidx32.3, align 4, !tbaa !10
%add33.3 = add nsw i32 %59, %18
%arrayidx35.3 = getelementptr inbounds [4 x i32], ptr @dj, i64 0, i64 %idxprom31.3
%60 = load i32, ptr %arrayidx35.3, align 4, !tbaa !10
%add36.3 = add nsw i32 %60, %19
%cmp37.3 = icmp sgt i32 %add33.3, -1
br i1 %cmp37.3, label %land.lhs.true.3, label %if.end.3
land.lhs.true.3: ; preds = %if.end.2
%61 = load i32, ptr @h, align 4, !tbaa !10
%cmp38.3 = icmp slt i32 %add33.3, %61
%cmp40.3 = icmp sgt i32 %add36.3, -1
%or.cond.3 = select i1 %cmp38.3, i1 %cmp40.3, i1 false
br i1 %or.cond.3, label %land.lhs.true41.3, label %if.end.3
land.lhs.true41.3: ; preds = %land.lhs.true.3
%62 = load i32, ptr @w, align 4, !tbaa !10
%cmp42.3 = icmp slt i32 %add36.3, %62
br i1 %cmp42.3, label %if.then.3, label %if.end.3
if.then.3: ; preds = %land.lhs.true41.3
%mul43.3 = mul nsw i32 %62, %18
%mul44148.3 = add i32 %mul43.3, %19
%add46.3 = shl i32 %mul44148.3, 2
%63 = trunc i64 %indvars.iv180 to i32
%add47.3 = add nsw i32 %add46.3, %63
%mul48.3 = mul nsw i32 %62, %add33.3
%mul49149.3 = add i32 %mul48.3, %add36.3
%add51.3 = shl i32 %mul49149.3, 2
%add52.3 = or i32 %add51.3, %and.3
%64 = load i32, ptr %arrayidx56, align 4, !tbaa !10
%cmp57.3 = icmp eq i32 %64, 3
%65 = load i32, ptr %add.ptr13.3, align 4
%spec.select199 = select i1 %cmp57.3, i32 0, i32 %65
%idxprom.i.3 = sext i32 %add47.3 to i64
%arrayidx.i150.3 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.3
%size.i.3 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.3, i32 2
%66 = load i32, ptr %size.i.3, align 4, !tbaa !25
%cap.i.3 = getelementptr inbounds [3600 x %struct.VecEdge], ptr @adj, i64 0, i64 %idxprom.i.3, i32 1
%67 = load i32, ptr %cap.i.3, align 8, !tbaa !32
%cmp.i.3 = icmp eq i32 %66, %67
%.pre.i.3 = load ptr, ptr %arrayidx.i150.3, align 16, !tbaa !27
br i1 %cmp.i.3, label %if.then.i.3, label %add.exit.3
if.then.i.3: ; preds = %if.then.3
%shl.i.3 = shl i32 %66, 1
store i32 %shl.i.3, ptr %cap.i.3, align 8, !tbaa !32
%conv.i.3 = sext i32 %shl.i.3 to i64
%mul.i.3 = shl nsw i64 %conv.i.3, 3
%call.i151.3 = call ptr @realloc(ptr noundef %.pre.i.3, i64 noundef %mul.i.3) #10
store ptr %call.i151.3, ptr %arrayidx.i150.3, align 16, !tbaa !27
%.pre31.i.3 = load i32, ptr %size.i.3, align 4, !tbaa !25
br label %add.exit.3
add.exit.3: ; preds = %if.then.i.3, %if.then.3
%68 = phi i32 [ %.pre31.i.3, %if.then.i.3 ], [ %66, %if.then.3 ]
%69 = phi ptr [ %call.i151.3, %if.then.i.3 ], [ %.pre.i.3, %if.then.3 ]
%inc.i.3 = add nsw i32 %68, 1
store i32 %inc.i.3, ptr %size.i.3, align 4, !tbaa !25
%idxprom20.i.3 = sext i32 %68 to i64
%arrayidx21.i.3 = getelementptr inbounds %struct.Edge, ptr %69, i64 %idxprom20.i.3
store i32 %add52.3, ptr %arrayidx21.i.3, align 4, !tbaa.struct !12
%.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i.3 = getelementptr inbounds i8, ptr %arrayidx21.i.3, i64 4
store i32 %spec.select199, ptr %.compoundliteral.sroa.2.0.arrayidx21.sroa_idx.i.3, align 4, !tbaa.struct !13
br label %if.end.3
if.end.3: ; preds = %add.exit.3, %land.lhs.true41.3, %land.lhs.true.3, %if.end.2
%exitcond.not = icmp eq i64 %31, 4
br i1 %exitcond.not, label %for.inc66, label %for.cond28.preheader, !llvm.loop !33
for.inc66: ; preds = %if.end.3
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%70 = load i32, ptr @w, align 4, !tbaa !10
%71 = sext i32 %70 to i64
%cmp23 = icmp slt i64 %indvars.iv.next185, %71
br i1 %cmp23, label %for.cond25.preheader, label %for.inc69.loopexit, !llvm.loop !34
for.inc69.loopexit: ; preds = %for.inc66
%.pre190 = load i32, ptr @h, align 4, !tbaa !10
br label %for.inc69
for.inc69: ; preds = %for.inc69.loopexit, %for.cond22.preheader
%72 = phi i32 [ %.pre190, %for.inc69.loopexit ], [ %16, %for.cond22.preheader ]
%73 = phi i32 [ %70, %for.inc69.loopexit ], [ %17, %for.cond22.preheader ]
%indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
%74 = sext i32 %72 to i64
%cmp20 = icmp slt i64 %indvars.iv.next188, %74
br i1 %cmp20, label %for.cond22.preheader, label %for.end71, !llvm.loop !35
for.end71: ; preds = %for.inc69, %init.exit
%75 = phi i32 [ %5, %init.exit ], [ %73, %for.inc69 ]
%.lcssa = phi i32 [ %4, %init.exit ], [ %72, %for.inc69 ]
%mul72 = shl i32 %.lcssa, 2
%mul73 = mul i32 %mul72, %75
call void @dijkstra(i32 noundef %mul73, i32 noundef 1)
%76 = load i32, ptr @h, align 4, !tbaa !10
%77 = load i32, ptr @w, align 4, !tbaa !10
%78 = shl i32 %76, 2
%79 = mul i32 %78, %77
%add79 = add i32 %79, -3
%idxprom80 = sext i32 %add79 to i64
%arrayidx81 = getelementptr inbounds [3600 x i32], ptr @d, i64 0, i64 %idxprom80
%80 = load i32, ptr %arrayidx81, align 4, !tbaa !10
%add88 = add i32 %79, -2
%idxprom89 = sext i32 %add88 to i64
%arrayidx90 = getelementptr inbounds [3600 x i32], ptr @d, i64 0, i64 %idxprom89
%81 = load i32, ptr %arrayidx90, align 8, !tbaa !10
%. = call i32 @llvm.smin.i32(i32 %80, i32 %81)
%call114 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %c) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @w, ptr noundef nonnull @h)
%82 = load i32, ptr @w, align 4, !tbaa !10
%tobool.not = icmp eq i32 %82, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !36
while.end: ; preds = %for.end71, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 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 nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { nofree norecurse 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{i64 0, i64 8, !6, i64 8, i64 4, !10, i64 12, i64 4, !10}
!6 = !{!7, !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{i64 0, i64 4, !10, i64 4, i64 4, !10}
!13 = !{i64 0, i64 4, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !15, !18, !17}
!20 = !{!21, !11, i64 4}
!21 = !{!"", !11, i64 0, !11, i64 4}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = !{!26, !11, i64 12}
!26 = !{!"", !7, i64 0, !11, i64 8, !11, i64 12}
!27 = !{!26, !7, i64 0}
!28 = distinct !{!28, !15}
!29 = distinct !{!29, !15}
!30 = distinct !{!30, !15, !31}
!31 = !{!"llvm.loop.unswitch.partial.disable"}
!32 = !{!26, !11, i64 8}
!33 = distinct !{!33, !15}
!34 = distinct !{!34, !15}
!35 = distinct !{!35, !15, !31}
!36 = distinct !{!36, !15}
|
#define THRUK for(j=0;j<K;j++)
#include<stdio.h>
int main(){
int N, K, S[100], i, j, tmp, f;
while(1){
f = 0;
for(i=0;i<100;i++) S[i] = 0;
scanf("%d %d", &N, &K);
if(N==0 && K==0)return 0;
THRUK scanf("%d", &(S[j]));
for(i=0;i<N;i++) THRUK {
scanf("%d", &tmp);
S[j] -= tmp;
}
THRUK if(S[j]<0){f++;break;}
printf(f ? "No\n" : "Yes\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"Yes\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
%S = alloca [100 x i32], align 16
%tmp = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %S, i8 0, i64 400, i1 false), !tbaa !5
%call78 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp179 = icmp eq i32 %0, 0
%1 = load i32, ptr %K, align 4
%cmp280 = icmp eq i32 %1, 0
%or.cond81 = select i1 %cmp179, i1 %cmp280, i1 false
br i1 %or.cond81, label %if.then, label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry, %for.end38
%2 = phi i32 [ %20, %for.end38 ], [ %1, %entry ]
%3 = phi i32 [ %19, %for.end38 ], [ %0, %entry ]
%cmp454 = icmp sgt i32 %2, 0
br i1 %cmp454, label %for.body5, label %for.cond12.preheader
if.then: ; preds = %for.end38, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
for.cond12.preheader.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond12.preheader
for.cond12.preheader: ; preds = %for.cond12.preheader.loopexit, %for.cond3.preheader
%4 = phi i32 [ %7, %for.cond12.preheader.loopexit ], [ %2, %for.cond3.preheader ]
%5 = phi i32 [ %.pre, %for.cond12.preheader.loopexit ], [ %3, %for.cond3.preheader ]
%cmp1358 = icmp sgt i32 %5, 0
br i1 %cmp1358, label %for.cond15.preheader.lr.ph, label %for.cond27.preheader
for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader
%6 = icmp sgt i32 %4, 0
br i1 %6, label %for.cond15.preheader, label %for.end38
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [100 x i32], ptr %S, i64 0, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %K, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp4, label %for.body5, label %for.cond12.preheader.loopexit, !llvm.loop !9
for.cond27.preheader: ; preds = %for.inc24, %for.cond12.preheader
%9 = phi i32 [ %4, %for.cond12.preheader ], [ %17, %for.inc24 ]
%cmp28.not60 = icmp sgt i32 %9, 0
br i1 %cmp28.not60, label %for.body29.preheader, label %for.end38
for.body29.preheader: ; preds = %for.cond27.preheader
%wide.trip.count = zext i32 %9 to i64
br label %for.body29
for.cond15.preheader: ; preds = %for.cond15.preheader.lr.ph, %for.inc24
%10 = phi i32 [ %16, %for.inc24 ], [ %5, %for.cond15.preheader.lr.ph ]
%11 = phi i32 [ %17, %for.inc24 ], [ %4, %for.cond15.preheader.lr.ph ]
%i.159 = phi i32 [ %inc25, %for.inc24 ], [ 0, %for.cond15.preheader.lr.ph ]
%cmp1656 = icmp sgt i32 %11, 0
br i1 %cmp1656, label %for.body17, label %for.inc24
for.body17: ; preds = %for.cond15.preheader, %for.body17
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.body17 ], [ 0, %for.cond15.preheader ]
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tmp)
%12 = load i32, ptr %tmp, align 4, !tbaa !5
%arrayidx20 = getelementptr inbounds [100 x i32], ptr %S, i64 0, i64 %indvars.iv66
%13 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%sub = sub nsw i32 %13, %12
store i32 %sub, ptr %arrayidx20, align 4, !tbaa !5
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%14 = load i32, ptr %K, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp16 = icmp slt i64 %indvars.iv.next67, %15
br i1 %cmp16, label %for.body17, label %for.inc24.loopexit, !llvm.loop !11
for.inc24.loopexit: ; preds = %for.body17
%.pre72 = load i32, ptr %N, align 4, !tbaa !5
br label %for.inc24
for.inc24: ; preds = %for.inc24.loopexit, %for.cond15.preheader
%16 = phi i32 [ %.pre72, %for.inc24.loopexit ], [ %10, %for.cond15.preheader ]
%17 = phi i32 [ %14, %for.inc24.loopexit ], [ %11, %for.cond15.preheader ]
%inc25 = add nuw nsw i32 %i.159, 1
%cmp13 = icmp slt i32 %inc25, %16
br i1 %cmp13, label %for.cond15.preheader, label %for.cond27.preheader, !llvm.loop !12
for.cond27: ; preds = %for.body29
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
br i1 %exitcond.not, label %for.end38, label %for.body29, !llvm.loop !14
for.body29: ; preds = %for.body29.preheader, %for.cond27
%indvars.iv69 = phi i64 [ 0, %for.body29.preheader ], [ %indvars.iv.next70, %for.cond27 ]
%arrayidx31 = getelementptr inbounds [100 x i32], ptr %S, i64 0, i64 %indvars.iv69
%18 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp slt i32 %18, 0
br i1 %cmp32, label %for.end38, label %for.cond27
for.end38: ; preds = %for.cond27, %for.body29, %for.cond15.preheader.lr.ph, %for.cond27.preheader
%cond = phi ptr [ @.str.3, %for.cond27.preheader ], [ @.str.3, %for.cond15.preheader.lr.ph ], [ @.str.2, %for.body29 ], [ @.str.3, %for.cond27 ]
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %S, i8 0, i64 400, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%19 = load i32, ptr %N, align 4, !tbaa !5
%cmp1 = icmp eq i32 %19, 0
%20 = load i32, ptr %K, align 4
%cmp2 = icmp eq i32 %20, 0
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %or.cond, label %if.then, label %for.cond3.preheader
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <string.h>
int main(int argc, const char * argv[]) {
int n;
char u[256][11];
int m;
char t[11];
int i,j,judge=1;
scanf("%d",&n);
for (i =0; i < n; i++) {
scanf("%s",u[i]);
}
scanf("%d",&m);
int openclose=0;
for (i=0; i<m; i++) {
scanf("%s",t);
for (j=0; j<n; j++) {
judge = strcmp(u[j],t);
if (judge == 0){
break;
}
}
if (judge == 0) {
if (openclose == 0) {
printf("Opened by %s\n",t);
openclose++;
} else {
printf("Closed by %s\n",t);
openclose--;
}
} else if (judge != 0) {
printf("Unknown %s\n",t);
}
judge = -1;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233687/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233687/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [14 x i8] c"Opened by %s\0A\00", align 1
@.str.3 = private unnamed_addr constant [14 x i8] c"Closed by %s\0A\00", align 1
@.str.4 = private unnamed_addr constant [12 x i8] c"Unknown %s\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
%u = alloca [256 x [11 x i8]], align 16
%m = alloca i32, align 4
%t = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 2816, ptr nonnull %u) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [256 x [11 x i8]], ptr %u, 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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp454 = icmp sgt i32 %3, 0
br i1 %cmp454, label %for.body5, label %for.end39
for.body5: ; preds = %for.end, %if.end36
%openclose.056 = phi i32 [ %openclose.1, %if.end36 ], [ 0, %for.end ]
%i.155 = phi i32 [ %inc38, %if.end36 ], [ 0, %for.end ]
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp952 = icmp sgt i32 %4, 0
br i1 %cmp952, label %for.body10.preheader, label %if.end36
for.body10.preheader: ; preds = %for.body5
%wide.trip.count = zext i32 %4 to i64
br label %for.body10
for.cond8: ; preds = %for.body10
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
br i1 %exitcond.not, label %if.end36, label %for.body10, !llvm.loop !11
for.body10: ; preds = %for.body10.preheader, %for.cond8
%indvars.iv58 = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next59, %for.cond8 ]
%arrayidx12 = getelementptr inbounds [256 x [11 x i8]], ptr %u, i64 0, i64 %indvars.iv58
%call15 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx12, ptr noundef nonnull dereferenceable(1) %t) #5
%cmp16 = icmp eq i32 %call15, 0
br i1 %cmp16, label %if.then21, label %for.cond8
if.then21: ; preds = %for.body10
%cmp22 = icmp eq i32 %openclose.056, 0
%.str.2..str.3 = select i1 %cmp22, ptr @.str.2, ptr @.str.3
%. = zext i1 %cmp22 to i32
br label %if.end36
if.end36: ; preds = %for.cond8, %for.body5, %if.then21
%.str.4.sink = phi ptr [ %.str.2..str.3, %if.then21 ], [ @.str.4, %for.body5 ], [ @.str.4, %for.cond8 ]
%openclose.1 = phi i32 [ %., %if.then21 ], [ %openclose.056, %for.body5 ], [ %openclose.056, %for.cond8 ]
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4.sink, ptr noundef nonnull %t)
%inc38 = add nuw nsw i32 %i.155, 1
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc38, %5
br i1 %cmp4, label %for.body5, label %for.end39, !llvm.loop !12
for.end39: ; preds = %if.end36, %for.end
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 2816, ptr nonnull %u) #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 nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(){
char S[5];
int c=0;
char A[2][6]={"Good","Bad"};
scanf("%s",S);
for(int i=0;i<3;i++)
if(S[i]==S[i+1]) c=1;
printf("%s\n",A[c]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233737/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233737/source.c"
target datalayout = "e-m:e-p270: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.A = private unnamed_addr constant [2 x [6 x i8]] [[6 x i8] c"Good\00\00", [6 x i8] c"Bad\00\00\00"], align 1
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 1, !tbaa !5
%arrayidx2 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp4 = icmp eq i8 %0, %1
%arrayidx2.1 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 2
%2 = load i8, ptr %arrayidx2.1, align 1, !tbaa !5
%cmp4.1 = icmp eq i8 %1, %2
%arrayidx2.2 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 3
%3 = load i8, ptr %arrayidx2.2, align 1, !tbaa !5
%cmp4.2 = icmp eq i8 %2, %3
%4 = select i1 %cmp4.2, i1 true, i1 %cmp4.1
%narrow16 = select i1 %4, i1 true, i1 %cmp4
%idxprom6 = zext i1 %narrow16 to i64
%arrayidx7 = getelementptr inbounds [2 x [6 x i8]], ptr @__const.main.A, i64 0, i64 %idxprom6
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx7)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(){
char a[7];
scanf("%s",a);
if(a[0]==a[1] || a[1]==a[2] || a[2]==a[3]){
printf("Bad\n");
}
else{
printf("Good\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Good\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Bad\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [7 x i8], align 1
call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [7 x i8], ptr %a, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%arrayidx6 = getelementptr inbounds [7 x i8], ptr %a, i64 0, i64 2
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8 = icmp eq i8 %1, %2
%arrayidx13 = getelementptr inbounds [7 x i8], ptr %a, i64 0, i64 3
%3 = load i8, ptr %arrayidx13, align 1
%cmp15 = icmp eq i8 %2, %3
%or.cond = select i1 %cmp8, i1 true, i1 %cmp15
%spec.select = select i1 %or.cond, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ %spec.select, %lor.lhs.false ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#define MAX(X, Y) (((X) > (Y))? (X) : (Y))
#define MIN(X, Y) (((X) < (Y))? (X) : (Y))
int compare_int(const void *a, const void *b){
return *(long int*)b - *(long int*)a; // 大きい順
}
int compare_int_small(const void *a, const void *b){
return *(long int*)a - *(long int*)b; // 小さい順
}
// 公約数
long int gcd(long int a, long int b){
if(b == 0){
return a;
}else{
return gcd(b, a % b);
}
}
// 最小公倍数 = a * b / 最大公約数
// 公倍数
long int lcm(long int a, long int b){
return a * b / gcd(a, b);
}
// 5min
int main(void){
char s[5];
scanf("%s", s);
if(s[0] == s[1] || s[1] == s[2] || s[2] == s[3]){
printf("Bad\n");
}else{
printf("Good\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Good\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Bad\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%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 @compare_int_small(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
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%cmp4 = icmp eq i64 %b, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i64 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %if.else ]
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 #1 {
entry:
%cmp4.i = icmp eq i64 %b, 0
br i1 %cmp4.i, label %gcd.exit, label %if.else.i
if.else.i: ; preds = %entry, %if.else.i
%b.tr6.i = phi i64 [ %rem.i, %if.else.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %if.else.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i64 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %if.else.i
gcd.exit: ; preds = %if.else.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %if.else.i ]
%mul = mul nsw i64 %b, %a
%div = sdiv i64 %mul, %a.tr.lcssa.i
ret i64 %div
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%s = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !9
%arrayidx1 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !9
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%arrayidx6 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp8 = icmp eq i8 %1, %2
%arrayidx13 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx13, align 1
%cmp15 = icmp eq i8 %2, %3
%or.cond = select i1 %cmp8, i1 true, i1 %cmp15
%spec.select = select i1 %or.cond, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ %spec.select, %lor.lhs.false ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #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) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(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 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
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}
|
#include<stdio.h>
#include<string.h>
int main()
{
char S[4];
scanf("%s",S);
if((S[0]!=S[1] && S[1]!=S[2]) && S[2]!=S[3] )
{
printf("Good\n");
}
else
printf("Bad\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233874/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233874/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Bad\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Good\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, %1
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%arrayidx6 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 2
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8.not = icmp eq i8 %1, %2
%arrayidx13 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 3
%3 = load i8, ptr %arrayidx13, align 1
%cmp15.not = icmp eq i8 %2, %3
%or.cond = select i1 %cmp8.not, i1 true, i1 %cmp15.not
br i1 %or.cond, label %if.else, label %if.end
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
// Your code here!
char s[5];
scanf("%s",s);
if(s[0]==s[1]||s[1]==s[2]||s[2]==s[3]){
printf("Bad");
}else{
printf("Good");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233917/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233917/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Bad\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Good\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%arrayidx6 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8 = icmp eq i8 %1, %2
%arrayidx13 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx13, align 1
%cmp15 = icmp eq i8 %2, %3
%or.cond = select i1 %cmp8, i1 true, i1 %cmp15
%spec.select = select i1 %or.cond, ptr @.str.1, ptr @.str.2
br label %if.end
if.end: ; preds = %lor.lhs.false, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int S;
scanf("%d",&S);
if(S/1000==(S/100)%10){
printf("Bad\n");
}
else if((S/100)%10==(S/10)%10){
printf("Bad\n");
}
else if((S/10)%10==S%10){
printf("Bad\n");
}
else{
printf("Good\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_233968/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_233968/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Good\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"Bad\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) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 1000
%div1 = sdiv i32 %0, 100
%rem = srem i32 %div1, 10
%cmp = icmp eq i32 %div, %rem
br i1 %cmp, label %if.end20, label %if.else
if.else: ; preds = %entry
%div5 = sdiv i32 %0, 10
%rem13 = srem i32 %0, 10
%rem6 = srem i32 %div5, 10
%cmp7 = icmp eq i32 %rem, %rem6
br i1 %cmp7, label %if.end20, label %if.else10
if.else10: ; preds = %if.else
%cmp14 = icmp eq i32 %rem6, %rem13
%str.3.str = select i1 %cmp14, ptr @str.5, ptr @str
br label %if.end20
if.end20: ; preds = %if.else10, %if.else, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %if.else ], [ %str.3.str, %if.else10 ]
%puts22 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main()
{
char ch[1000];
int i,j,k,l;
scanf("%s",ch);
scanf("%d",&k);
int n=strlen(ch);
if(n%k!=0)
printf("NO\n");
else
{
i=0;
j=0;
k=n/k;
char ch2[k/2+1];
int temp=0;
while(ch[j]!='\0')
{
for(l=0;ch[j]&&l<k/2;j++,l++)
ch2[l]=ch[j];
ch2[l]='\0';
if(k%2!=0)
j++;
for(l=l-1;l>=0&&ch[j];l--,j++)
{
if(ch2[l]!=ch[j])
{
temp=1;
break;
}
}
if(temp==1)
break;
}
if(temp!=1)
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23401/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23401/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.5 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ch = alloca [1000 x i8], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %ch) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %ch) #8
%conv = trunc i64 %call3 to i32
%0 = load i32, ptr %k, align 4, !tbaa !5
%rem = srem i32 %conv, %0
%div = sdiv i32 %conv, %0
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%puts80 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end62
if.else: ; preds = %entry
store i32 %div, ptr %k, align 4, !tbaa !5
%div6 = sdiv i32 %div, 2
%add = add nsw i32 %div6, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%3 = load i8, ptr %ch, align 16, !tbaa !9
%cmp8.not.not96 = icmp eq i8 %3, 0
br i1 %cmp8.not.not96, label %if.end61, label %for.cond.preheader.lr.ph
for.cond.preheader.lr.ph: ; preds = %if.else
%4 = load i32, ptr %k, align 4
%div13 = sdiv i32 %4, 2
%5 = and i32 %4, 1
%smax = call i32 @llvm.smax.i32(i32 %div13, i32 0)
%wide.trip.count = zext i32 %smax to i64
%idxprom21 = zext i32 %smax to i64
%arrayidx22 = getelementptr inbounds i8, ptr %vla, i64 %idxprom21
%cmp2991.not = icmp slt i32 %4, 2
br label %land.rhs.preheader
while.cond.critedge.loopexit.split.loop.exit116: ; preds = %land.rhs31
%6 = trunc i64 %indvars.iv102 to i32
br label %while.cond.critedge
while.cond.critedge: ; preds = %for.inc48, %while.cond.critedge.loopexit.split.loop.exit116, %for.end
%j.3.lcssa = phi i32 [ %spec.select, %for.end ], [ %6, %while.cond.critedge.loopexit.split.loop.exit116 ], [ %13, %for.inc48 ]
%idxprom = sext i32 %j.3.lcssa to i64
%arrayidx = getelementptr inbounds [1000 x i8], ptr %ch, i64 0, i64 %idxprom
%7 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp8.not.not = icmp eq i8 %7, 0
br i1 %cmp8.not.not, label %if.end61, label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.cond.critedge, %for.cond.preheader.lr.ph
%8 = phi i8 [ %3, %for.cond.preheader.lr.ph ], [ %7, %while.cond.critedge ]
%j.097 = phi i32 [ 0, %for.cond.preheader.lr.ph ], [ %j.3.lcssa, %while.cond.critedge ]
%idxprom1082 = sext i32 %j.097 to i64
%9 = add i32 %smax, %j.097
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %for.body
%indvars.iv98 = phi i64 [ 0, %land.rhs.preheader ], [ %indvars.iv.next99, %for.body ]
%indvars.iv = phi i64 [ %idxprom1082, %land.rhs.preheader ], [ %indvars.iv.next, %for.body ]
%10 = phi i8 [ %8, %land.rhs.preheader ], [ %11, %for.body ]
%j.186 = phi i32 [ %j.097, %land.rhs.preheader ], [ %inc, %for.body ]
%l.085 = phi i32 [ 0, %land.rhs.preheader ], [ %inc20, %for.body ]
%exitcond.not = icmp eq i64 %indvars.iv98, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body
for.body: ; preds = %land.rhs
%arrayidx19 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv98
store i8 %10, ptr %arrayidx19, align 1, !tbaa !9
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%inc = add nsw i32 %j.186, 1
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%inc20 = add nuw nsw i32 %l.085, 1
%arrayidx11 = getelementptr inbounds [1000 x i8], ptr %ch, i64 0, i64 %indvars.iv.next
%11 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%tobool.not = icmp eq i8 %11, 0
br i1 %tobool.not, label %for.end.thread, label %land.rhs, !llvm.loop !10
for.end.thread: ; preds = %for.body
%idxprom21109 = zext i32 %inc20 to i64
%arrayidx22110 = getelementptr inbounds i8, ptr %vla, i64 %idxprom21109
store i8 0, ptr %arrayidx22110, align 1, !tbaa !9
%spec.select111 = add i32 %5, %inc
br label %land.rhs31.preheader
for.end: ; preds = %land.rhs
store i8 0, ptr %arrayidx22, align 1, !tbaa !9
%spec.select = add i32 %5, %9
br i1 %cmp2991.not, label %while.cond.critedge, label %land.rhs31.preheader
land.rhs31.preheader: ; preds = %for.end.thread, %for.end
%spec.select115 = phi i32 [ %spec.select111, %for.end.thread ], [ %spec.select, %for.end ]
%idxprom21114 = phi i64 [ %idxprom21109, %for.end.thread ], [ %idxprom21, %for.end ]
%l.0.lcssa.ph113 = phi i32 [ %inc20, %for.end.thread ], [ %smax, %for.end ]
%12 = sext i32 %spec.select115 to i64
%13 = add i32 %spec.select115, %l.0.lcssa.ph113
br label %land.rhs31
land.rhs31: ; preds = %land.rhs31.preheader, %for.inc48
%indvars.iv102 = phi i64 [ %12, %land.rhs31.preheader ], [ %indvars.iv.next103, %for.inc48 ]
%indvars.iv100 = phi i64 [ %idxprom21114, %land.rhs31.preheader ], [ %indvars.iv.next101, %for.inc48 ]
%indvars.iv.next101 = add nsw i64 %indvars.iv100, -1
%arrayidx33 = getelementptr inbounds [1000 x i8], ptr %ch, i64 0, i64 %indvars.iv102
%14 = load i8, ptr %arrayidx33, align 1, !tbaa !9
%tobool35.not = icmp eq i8 %14, 0
br i1 %tobool35.not, label %while.cond.critedge.loopexit.split.loop.exit116, label %for.body37
for.body37: ; preds = %land.rhs31
%arrayidx39 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv.next101
%15 = load i8, ptr %arrayidx39, align 1, !tbaa !9
%cmp44.not = icmp eq i8 %15, %14
br i1 %cmp44.not, label %for.inc48, label %if.end61, !llvm.loop !12
for.inc48: ; preds = %for.body37
%indvars.iv.next103 = add nsw i64 %indvars.iv102, 1
%cmp29 = icmp ugt i64 %indvars.iv100, 1
br i1 %cmp29, label %land.rhs31, label %while.cond.critedge, !llvm.loop !13
if.end61: ; preds = %while.cond.critedge, %for.body37, %if.else
%str.sink = phi ptr [ @str.4, %if.else ], [ @str.5, %for.body37 ], [ @str.4, %while.cond.critedge ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.stackrestore.p0(ptr %2)
br label %if.end62
if.end62: ; preds = %if.end61, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %ch) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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) #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
int main(void)
{
char str[4];
int i;
int flag=0;
for(i=0;i<4;i++){
scanf("%s", &str[i]);
if(i>=1){
if(str[i-1]==str[i])
flag = 1;
}
}
if(flag == 1)
printf("Bad\n");
else printf("Good\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234053/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234053/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Good\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Bad\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.inc.3:
%str = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%arrayidx.1 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%0 = load i8, ptr %str, align 1, !tbaa !5
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp7.1 = icmp eq i8 %0, %1
%arrayidx.2 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%3 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%cmp7.2 = icmp eq i8 %2, %3
%arrayidx.3 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%4 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%5 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%cmp7.3 = icmp eq i8 %4, %5
%6 = select i1 %cmp7.3, i1 true, i1 %cmp7.2
%narrow27 = select i1 %6, i1 true, i1 %cmp7.1
%str.3.str = select i1 %narrow27, 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 %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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
char s[5], tmp;
scanf("%s", s);
tmp = s[0];
for(int i=1; i<4; i++){
if(tmp == s[i]){
printf("Bad\n");
break;
}
else {
if(i == 3)printf("Good\n");
else tmp = s[i];
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234103/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234103/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Good\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Bad\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%cmp3 = icmp eq i8 %0, %1
br i1 %cmp3, label %cleanup, label %for.inc
for.inc: ; preds = %entry
%arrayidx1.1.phi.trans.insert = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2
%.pre = load i8, ptr %arrayidx1.1.phi.trans.insert, align 1, !tbaa !5
%cmp3.1 = icmp eq i8 %1, %.pre
%arrayidx1.2.phi.trans.insert = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 3
%.pre23 = load i8, ptr %arrayidx1.2.phi.trans.insert, align 1
%cmp3.2 = icmp eq i8 %.pre, %.pre23
%or.cond = select i1 %cmp3.1, i1 true, i1 %cmp3.2
%spec.select = select i1 %or.cond, ptr @str.3, ptr @str
br label %cleanup
cleanup: ; preds = %for.inc, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ %spec.select, %for.inc ]
%puts.2 = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>//random,NULL
#include <string.h>
#include <time.h>
#include <unistd.h>//sleep()
#include <math.h>
#include <stdbool.h>
#define rep(i,n) for(int i=0; i<((int)n); i++)
#define REP(i,n) for(int i=0; i<=((int)n); i++)
#define srep(i,a,n) for(int i=a; i<((int)n); i++)
#define SREP(i,a,n) for(int i=a; i<=((int)n); i++)
#define rrep(i,n) for(int i=n-1; i>=0; i--)
#define RREP(i,n) for(int i=n; i>=0; i--)
#define INF 1000000000
const int mod = INF+7;
int main(){
char buf[1024];
char *s=(char *)malloc(sizeof(char)*4);
fgets(buf,sizeof(buf),stdin);
sscanf(buf, "%s", s);
if(s[0]==s[1] || s[1]==s[2] || s[2]==s[3]){
printf("Bad\n");
}
else{
printf("Good\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234154/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234154/source.c"
target datalayout = "e-m:e-p270: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
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Good\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Bad\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%buf = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %buf) #5
%call = tail call noalias dereferenceable_or_null(4) ptr @malloc(i64 noundef 4) #6
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call1 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 1024, ptr noundef %0)
%call3 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef %call) #5
%1 = load i8, ptr %call, align 1, !tbaa !9
%arrayidx4 = getelementptr inbounds i8, ptr %call, i64 1
%2 = load i8, ptr %arrayidx4, align 1, !tbaa !9
%cmp = icmp eq i8 %1, %2
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%arrayidx9 = getelementptr inbounds i8, ptr %call, i64 2
%3 = load i8, ptr %arrayidx9, align 1, !tbaa !9
%cmp11 = icmp eq i8 %2, %3
br i1 %cmp11, label %if.end, label %lor.lhs.false13
lor.lhs.false13: ; preds = %lor.lhs.false
%arrayidx16 = getelementptr inbounds i8, ptr %call, i64 3
%4 = load i8, ptr %arrayidx16, align 1, !tbaa !9
%cmp18 = icmp eq i8 %3, %4
%spec.select = select i1 %cmp18, ptr @str.3, ptr @str
br label %if.end
if.end: ; preds = %lor.lhs.false13, %entry, %lor.lhs.false
%str.sink = phi ptr [ @str.3, %lor.lhs.false ], [ @str.3, %entry ], [ %spec.select, %lor.lhs.false13 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %buf) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_ON 1 // 汎用フラグ - ON
#define D_OFF 0 // 汎用フラグ - OFF
#define D_MASS_MAX 52 // 最大マス数
#define D_MOD 1000000007 // 剰余
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpT, *szpFpA;
#endif
// 実行メイン
int
fMain(
int piTNo // <I> テスト番号 1~
)
{
int i;
char lc1Buf[1024], lc1Out[1024];
// テストファイルオープン
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
szpFpT = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#endif
// マス数取得
int liMCnt;
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
sscanf(lc1Buf, "%d", &liMCnt);
// マス内容取得
char lc1Mass[D_MASS_MAX + 5];
#ifdef D_TEST
fgets(lc1Mass, sizeof(lc1Mass), szpFpT);
#else
fgets(lc1Mass, sizeof(lc1Mass), stdin);
#endif
// 1文字目
long long llPCnt;
int liNo, liX;
if (lc1Mass[0] == lc1Mass[1]) { // 次と一致(横)
llPCnt = 6; // パターン数
liNo = 2; // 開始位置
liX = D_ON; // 横
}
else { // 次と不一致(縦)
llPCnt = 3; // パターン数
liNo = 1; // 開始位置
liX = D_OFF; // 縦
}
// 2文字目以降
for (i = liNo; i < liMCnt; i++) {
if (lc1Mass[i] == lc1Mass[i + 1]) { // 次と一致(横)
if (liX == D_ON) { // 前回横
llPCnt = llPCnt * 3 % D_MOD; // パターン数
}
else { // 前回縦
llPCnt = llPCnt * 2 % D_MOD; // パターン数
}
liX = D_ON; // 横
i++; // 1つ次へ
}
else { // 次と不一致(縦)
if (liX == D_OFF) { // 前回縦
llPCnt = llPCnt * 2 % D_MOD; // パターン数
}
liX = D_OFF; // 縦
}
}
// 結果セット
sprintf(lc1Out, "%lld\n", llPCnt);
// 結果表示
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, lc1Out)) {
siRes = -1;
}
#else
printf("%s", lc1Out);
#endif
// テストファイルクローズ
#ifdef D_TEST
fclose(szpFpT);
fclose(szpFpA);
#endif
// テスト結果
#ifdef D_TEST
if (siRes == 0) {
printf("OK %d\n", piTNo);
}
else {
printf("NG %d\n", piTNo);
}
#endif
return 0;
}
int
main()
{
#ifdef D_TEST
int i;
for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
fMain(i);
}
#else
fMain(0);
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234198/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234198/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fMain(i32 %piTNo) local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
%lc1Out = alloca [1024 x i8], align 16
%liMCnt = alloca i32, align 4
%lc1Mass = alloca [57 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #3
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liMCnt) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull %liMCnt) #3
call void @llvm.lifetime.start.p0(i64 57, ptr nonnull %lc1Mass) #3
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call4 = call ptr @fgets(ptr noundef nonnull %lc1Mass, i32 noundef 57, ptr noundef %1)
%2 = load i8, ptr %lc1Mass, align 16, !tbaa !9
%arrayidx5 = getelementptr inbounds [57 x i8], ptr %lc1Mass, i64 0, i64 1
%3 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp = icmp eq i8 %2, %3
%. = select i1 %cmp, i64 6, i64 3
%.46 = select i1 %cmp, i32 2, i32 1
%4 = load i32, ptr %liMCnt, align 4, !tbaa !10
%cmp848 = icmp slt i32 %.46, %4
br i1 %cmp848, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%.47 = zext i1 %cmp to i32
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%liX.151 = phi i32 [ %liX.2, %for.inc ], [ %.47, %for.body.preheader ]
%llPCnt.150 = phi i64 [ %llPCnt.4, %for.inc ], [ %., %for.body.preheader ]
%i.049 = phi i32 [ %inc33.pre-phi, %for.inc ], [ %.46, %for.body.preheader ]
%idxprom = sext i32 %i.049 to i64
%arrayidx10 = getelementptr inbounds [57 x i8], ptr %lc1Mass, i64 0, i64 %idxprom
%5 = load i8, ptr %arrayidx10, align 1, !tbaa !9
%add = add nsw i32 %i.049, 1
%idxprom12 = sext i32 %add to i64
%arrayidx13 = getelementptr inbounds [57 x i8], ptr %lc1Mass, i64 0, i64 %idxprom12
%6 = load i8, ptr %arrayidx13, align 1, !tbaa !9
%cmp15 = icmp eq i8 %5, %6
br i1 %cmp15, label %if.then17, label %if.else25
if.then17: ; preds = %for.body
%cmp18 = icmp eq i32 %liX.151, 1
%mul = mul nsw i64 %llPCnt.150, 3
%mul22 = shl nsw i64 %llPCnt.150, 1
%llPCnt.2.in = select i1 %cmp18, i64 %mul, i64 %mul22
%llPCnt.2 = srem i64 %llPCnt.2.in, 1000000007
%.pre = add nsw i32 %i.049, 2
br label %for.inc
if.else25: ; preds = %for.body
%cmp26 = icmp eq i32 %liX.151, 0
br i1 %cmp26, label %if.then28, label %for.inc
if.then28: ; preds = %if.else25
%mul29 = shl nsw i64 %llPCnt.150, 1
%rem30 = srem i64 %mul29, 1000000007
br label %for.inc
for.inc: ; preds = %if.else25, %if.then28, %if.then17
%inc33.pre-phi = phi i32 [ %add, %if.else25 ], [ %add, %if.then28 ], [ %.pre, %if.then17 ]
%llPCnt.4 = phi i64 [ %llPCnt.150, %if.else25 ], [ %rem30, %if.then28 ], [ %llPCnt.2, %if.then17 ]
%liX.2 = phi i32 [ 0, %if.else25 ], [ 0, %if.then28 ], [ 1, %if.then17 ]
%cmp8 = icmp slt i32 %inc33.pre-phi, %4
br i1 %cmp8, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.inc, %entry
%llPCnt.1.lcssa = phi i64 [ %., %entry ], [ %llPCnt.4, %for.inc ]
%call35 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Out, ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %llPCnt.1.lcssa) #3
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %lc1Out)
call void @llvm.lifetime.end.p0(i64 57, ptr nonnull %lc1Mass) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liMCnt) #3
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #3
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 @fMain(i32 poison)
ret i32 0
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int num = 1, X, ans = 0;
scanf("%d", &X);
while (ans < X) {
ans += num;
num++;
}
printf("%d\n", num - 1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234248/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234248/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i32, ptr %X, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%ans.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%num.06 = phi i32 [ %inc, %while.body ], [ 1, %entry ]
%add = add nuw nsw i32 %ans.07, %num.06
%inc = add nuw nsw i32 %num.06, 1
%cmp = icmp slt i32 %add, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%num.0.lcssa = phi i32 [ 0, %entry ], [ %num.06, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #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 <stdbool.h>
int main(){
int a[3],b[3];
int c[4]={0,0,0,0};
bool flag=true;
for(int i = 0;i<3;i++){
scanf("%d %d",&a[i],&b[i]);
}
for(int i = 0;i<3;i++){
switch(a[i]%4){
case 0:
c[3]++;
break;
case 1:
c[0]++;
break;
case 2:
c[1]++;
break;
case 3:
c[2]++;
break;
}
switch(b[i]%4){
case 0:
c[3]++;
break;
case 1:
c[0]++;
break;
case 2:
c[1]++;
break;
case 3:
c[2]++;
break;
}
}
//ab check
if(a[0]==a[1]&&b[0]==b[1]){
flag=false;
}else if(a[0]==a[2]&&b[0]==b[2]){
flag=false;
}else if(a[1]==a[2]&&b[1]==b[2]){
flag=false;
}
if(a[0]==b[1]&&b[0]==a[1]){
flag=false;
}else if(a[0]==b[2]&&b[0]==a[2]){
flag=false;
}else if(a[1]==b[2]&&b[1]==a[2]){
flag=false;
}
//c check
for(int i=0;i<4;i++){
if(c[i]>2){
flag=false;
}
if(c[i]==0){
flag=false;
}
}
if(flag){
printf("YES\n");
}else{
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234291/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234291/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@switch.table.main = private unnamed_addr constant [4 x i32] [i32 1, i32 0, i32 0, i32 0], align 4
@switch.table.main.4 = private unnamed_addr constant [4 x i32] [i32 0, i32 0, i32 1, i32 0], align 4
@switch.table.main.5 = private unnamed_addr constant [4 x i32] [i32 0, i32 0, i32 0, i32 1], align 4
@switch.table.main.6 = private unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 0, i32 0], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [3 x i32], align 4
%b = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%arrayidx2.1 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx2.1)
%arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
%arrayidx2.2 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx2.2)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 4
%1 = icmp ult i32 %rem, 4
br i1 %1, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%switch.gep = getelementptr inbounds [4 x i32], ptr @switch.table.main, i64 0, i64 %2
%switch.load = load i32, ptr %switch.gep, align 4
%3 = sext i32 %rem to i64
%switch.gep152 = getelementptr inbounds [4 x i32], ptr @switch.table.main.4, i64 0, i64 %3
%switch.load153 = load i32, ptr %switch.gep152, align 4
%4 = sext i32 %rem to i64
%switch.gep154 = getelementptr inbounds [4 x i32], ptr @switch.table.main.5, i64 0, i64 %4
%switch.load155 = load i32, ptr %switch.gep154, align 4
%5 = sext i32 %rem to i64
%switch.gep156 = getelementptr inbounds [4 x i32], ptr @switch.table.main.6, i64 0, i64 %5
%switch.load157 = load i32, ptr %switch.gep156, align 4
br label %sw.epilog
sw.epilog: ; preds = %switch.lookup, %entry
%inc11138 = phi i32 [ 0, %entry ], [ %switch.load, %switch.lookup ]
%inc17135 = phi i32 [ 0, %entry ], [ %switch.load153, %switch.lookup ]
%inc20132 = phi i32 [ 0, %entry ], [ %switch.load155, %switch.lookup ]
%6 = phi i32 [ 0, %entry ], [ %switch.load157, %switch.lookup ]
%7 = load i32, ptr %b, align 4
%rem23 = srem i32 %7, 4
switch i32 %rem23, label %for.inc37 [
i32 0, label %sw.bb24
i32 1, label %sw.bb27
i32 2, label %sw.bb30
i32 3, label %sw.bb33
]
sw.bb24: ; preds = %sw.epilog
%inc26 = add nuw nsw i32 %inc11138, 1
br label %for.inc37
sw.bb27: ; preds = %sw.epilog
%inc29 = add nuw nsw i32 %6, 1
br label %for.inc37
sw.bb30: ; preds = %sw.epilog
%inc32 = add nuw nsw i32 %inc17135, 1
br label %for.inc37
sw.bb33: ; preds = %sw.epilog
%inc35 = add nuw nsw i32 %inc20132, 1
br label %for.inc37
for.inc37: ; preds = %sw.bb24, %sw.bb27, %sw.bb30, %sw.bb33, %sw.epilog
%inc11137 = phi i32 [ %inc26, %sw.bb24 ], [ %inc11138, %sw.bb27 ], [ %inc11138, %sw.bb30 ], [ %inc11138, %sw.bb33 ], [ %inc11138, %sw.epilog ]
%inc17134 = phi i32 [ %inc17135, %sw.bb24 ], [ %inc17135, %sw.bb27 ], [ %inc32, %sw.bb30 ], [ %inc17135, %sw.bb33 ], [ %inc17135, %sw.epilog ]
%inc20131 = phi i32 [ %inc20132, %sw.bb24 ], [ %inc20132, %sw.bb27 ], [ %inc20132, %sw.bb30 ], [ %inc35, %sw.bb33 ], [ %inc20132, %sw.epilog ]
%8 = phi i32 [ %6, %sw.bb24 ], [ %inc29, %sw.bb27 ], [ %6, %sw.bb30 ], [ %6, %sw.bb33 ], [ %6, %sw.epilog ]
%9 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%rem.1 = srem i32 %9, 4
switch i32 %rem.1, label %sw.epilog.1 [
i32 0, label %sw.bb.1
i32 1, label %sw.bb12.1
i32 2, label %sw.bb15.1
i32 3, label %sw.bb18.1
]
sw.bb18.1: ; preds = %for.inc37
%inc20.1 = add nuw nsw i32 %inc20131, 1
br label %sw.epilog.1
sw.bb15.1: ; preds = %for.inc37
%inc17.1 = add nuw nsw i32 %inc17134, 1
br label %sw.epilog.1
sw.bb12.1: ; preds = %for.inc37
%inc14.1 = add nuw nsw i32 %8, 1
br label %sw.epilog.1
sw.bb.1: ; preds = %for.inc37
%inc11.1 = add nuw nsw i32 %inc11137, 1
br label %sw.epilog.1
sw.epilog.1: ; preds = %sw.bb.1, %sw.bb12.1, %sw.bb15.1, %sw.bb18.1, %for.inc37
%inc11138.1 = phi i32 [ %inc11137, %for.inc37 ], [ %inc11137, %sw.bb18.1 ], [ %inc11137, %sw.bb15.1 ], [ %inc11137, %sw.bb12.1 ], [ %inc11.1, %sw.bb.1 ]
%inc17135.1 = phi i32 [ %inc17134, %for.inc37 ], [ %inc17134, %sw.bb18.1 ], [ %inc17.1, %sw.bb15.1 ], [ %inc17134, %sw.bb12.1 ], [ %inc17134, %sw.bb.1 ]
%inc20132.1 = phi i32 [ %inc20131, %for.inc37 ], [ %inc20.1, %sw.bb18.1 ], [ %inc20131, %sw.bb15.1 ], [ %inc20131, %sw.bb12.1 ], [ %inc20131, %sw.bb.1 ]
%10 = phi i32 [ %8, %for.inc37 ], [ %8, %sw.bb18.1 ], [ %8, %sw.bb15.1 ], [ %inc14.1, %sw.bb12.1 ], [ %8, %sw.bb.1 ]
%11 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%rem23.1 = srem i32 %11, 4
switch i32 %rem23.1, label %for.inc37.1 [
i32 0, label %sw.bb24.1
i32 1, label %sw.bb27.1
i32 2, label %sw.bb30.1
i32 3, label %sw.bb33.1
]
sw.bb33.1: ; preds = %sw.epilog.1
%inc35.1 = add nuw nsw i32 %inc20132.1, 1
br label %for.inc37.1
sw.bb30.1: ; preds = %sw.epilog.1
%inc32.1 = add nuw nsw i32 %inc17135.1, 1
br label %for.inc37.1
sw.bb27.1: ; preds = %sw.epilog.1
%inc29.1 = add nuw nsw i32 %10, 1
br label %for.inc37.1
sw.bb24.1: ; preds = %sw.epilog.1
%inc26.1 = add nuw nsw i32 %inc11138.1, 1
br label %for.inc37.1
for.inc37.1: ; preds = %sw.bb24.1, %sw.bb27.1, %sw.bb30.1, %sw.bb33.1, %sw.epilog.1
%inc11137.1 = phi i32 [ %inc26.1, %sw.bb24.1 ], [ %inc11138.1, %sw.bb27.1 ], [ %inc11138.1, %sw.bb30.1 ], [ %inc11138.1, %sw.bb33.1 ], [ %inc11138.1, %sw.epilog.1 ]
%inc17134.1 = phi i32 [ %inc17135.1, %sw.bb24.1 ], [ %inc17135.1, %sw.bb27.1 ], [ %inc32.1, %sw.bb30.1 ], [ %inc17135.1, %sw.bb33.1 ], [ %inc17135.1, %sw.epilog.1 ]
%inc20131.1 = phi i32 [ %inc20132.1, %sw.bb24.1 ], [ %inc20132.1, %sw.bb27.1 ], [ %inc20132.1, %sw.bb30.1 ], [ %inc35.1, %sw.bb33.1 ], [ %inc20132.1, %sw.epilog.1 ]
%12 = phi i32 [ %10, %sw.bb24.1 ], [ %inc29.1, %sw.bb27.1 ], [ %10, %sw.bb30.1 ], [ %10, %sw.bb33.1 ], [ %10, %sw.epilog.1 ]
%13 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%rem.2 = srem i32 %13, 4
switch i32 %rem.2, label %sw.epilog.2 [
i32 0, label %sw.bb.2
i32 1, label %sw.bb12.2
i32 2, label %sw.bb15.2
i32 3, label %sw.bb18.2
]
sw.bb18.2: ; preds = %for.inc37.1
%inc20.2 = add nuw nsw i32 %inc20131.1, 1
br label %sw.epilog.2
sw.bb15.2: ; preds = %for.inc37.1
%inc17.2 = add nuw nsw i32 %inc17134.1, 1
br label %sw.epilog.2
sw.bb12.2: ; preds = %for.inc37.1
%inc14.2 = add nuw nsw i32 %12, 1
br label %sw.epilog.2
sw.bb.2: ; preds = %for.inc37.1
%inc11.2 = add nuw nsw i32 %inc11137.1, 1
br label %sw.epilog.2
sw.epilog.2: ; preds = %sw.bb.2, %sw.bb12.2, %sw.bb15.2, %sw.bb18.2, %for.inc37.1
%inc11138.2 = phi i32 [ %inc11137.1, %for.inc37.1 ], [ %inc11137.1, %sw.bb18.2 ], [ %inc11137.1, %sw.bb15.2 ], [ %inc11137.1, %sw.bb12.2 ], [ %inc11.2, %sw.bb.2 ]
%inc17135.2 = phi i32 [ %inc17134.1, %for.inc37.1 ], [ %inc17134.1, %sw.bb18.2 ], [ %inc17.2, %sw.bb15.2 ], [ %inc17134.1, %sw.bb12.2 ], [ %inc17134.1, %sw.bb.2 ]
%inc20132.2 = phi i32 [ %inc20131.1, %for.inc37.1 ], [ %inc20.2, %sw.bb18.2 ], [ %inc20131.1, %sw.bb15.2 ], [ %inc20131.1, %sw.bb12.2 ], [ %inc20131.1, %sw.bb.2 ]
%14 = phi i32 [ %12, %for.inc37.1 ], [ %12, %sw.bb18.2 ], [ %12, %sw.bb15.2 ], [ %inc14.2, %sw.bb12.2 ], [ %12, %sw.bb.2 ]
%15 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%rem23.2 = srem i32 %15, 4
switch i32 %rem23.2, label %for.inc37.2 [
i32 0, label %sw.bb24.2
i32 1, label %sw.bb27.2
i32 2, label %sw.bb30.2
i32 3, label %sw.bb33.2
]
sw.bb33.2: ; preds = %sw.epilog.2
%inc35.2 = add nuw nsw i32 %inc20132.2, 1
br label %for.inc37.2
sw.bb30.2: ; preds = %sw.epilog.2
%inc32.2 = add nuw nsw i32 %inc17135.2, 1
br label %for.inc37.2
sw.bb27.2: ; preds = %sw.epilog.2
%inc29.2 = add nuw nsw i32 %14, 1
br label %for.inc37.2
sw.bb24.2: ; preds = %sw.epilog.2
%inc26.2 = add nuw nsw i32 %inc11138.2, 1
br label %for.inc37.2
for.inc37.2: ; preds = %sw.bb24.2, %sw.bb27.2, %sw.bb30.2, %sw.bb33.2, %sw.epilog.2
%inc11137.2 = phi i32 [ %inc26.2, %sw.bb24.2 ], [ %inc11138.2, %sw.bb27.2 ], [ %inc11138.2, %sw.bb30.2 ], [ %inc11138.2, %sw.bb33.2 ], [ %inc11138.2, %sw.epilog.2 ]
%inc17134.2 = phi i32 [ %inc17135.2, %sw.bb24.2 ], [ %inc17135.2, %sw.bb27.2 ], [ %inc32.2, %sw.bb30.2 ], [ %inc17135.2, %sw.bb33.2 ], [ %inc17135.2, %sw.epilog.2 ]
%inc20131.2 = phi i32 [ %inc20132.2, %sw.bb24.2 ], [ %inc20132.2, %sw.bb27.2 ], [ %inc20132.2, %sw.bb30.2 ], [ %inc35.2, %sw.bb33.2 ], [ %inc20132.2, %sw.epilog.2 ]
%16 = phi i32 [ %14, %sw.bb24.2 ], [ %inc29.2, %sw.bb27.2 ], [ %14, %sw.bb30.2 ], [ %14, %sw.bb33.2 ], [ %14, %sw.epilog.2 ]
%cmp42 = icmp eq i32 %0, %9
%cmp45 = icmp eq i32 %7, %11
%or.cond149 = and i1 %cmp42, %cmp45
br i1 %or.cond149, label %if.end64, label %if.else
if.else: ; preds = %for.inc37.2
%cmp48 = icmp eq i32 %0, %13
%cmp52 = icmp eq i32 %7, %15
%or.cond150 = and i1 %cmp48, %cmp52
br i1 %or.cond150, label %if.end64, label %if.else54
if.else54: ; preds = %if.else
%cmp57 = icmp eq i32 %9, %13
br i1 %cmp57, label %land.lhs.true58, label %if.end64
land.lhs.true58: ; preds = %if.else54
%cmp61 = icmp ne i32 %11, %15
%spec.select = zext i1 %cmp61 to i8
br label %if.end64
if.end64: ; preds = %if.else, %for.inc37.2, %land.lhs.true58, %if.else54
%flag.0 = phi i8 [ 1, %if.else54 ], [ %spec.select, %land.lhs.true58 ], [ 0, %for.inc37.2 ], [ 0, %if.else ]
%cmp67 = icmp eq i32 %0, %11
%cmp71 = icmp eq i32 %7, %9
%or.cond = and i1 %cmp67, %cmp71
br i1 %or.cond, label %if.end93, label %if.else73
if.else73: ; preds = %if.end64
%cmp76 = icmp eq i32 %0, %15
%cmp80 = icmp eq i32 %7, %13
%or.cond151 = and i1 %cmp76, %cmp80
br i1 %or.cond151, label %if.end93, label %if.else82
if.else82: ; preds = %if.else73
%cmp85 = icmp eq i32 %9, %15
br i1 %cmp85, label %land.lhs.true86, label %if.end93
land.lhs.true86: ; preds = %if.else82
%cmp89 = icmp eq i32 %11, %13
%spec.select127 = select i1 %cmp89, i8 0, i8 %flag.0
br label %if.end93
if.end93: ; preds = %if.else73, %if.end64, %land.lhs.true86, %if.else82
%flag.1 = phi i8 [ %flag.0, %if.else82 ], [ %spec.select127, %land.lhs.true86 ], [ 0, %if.end64 ], [ 0, %if.else73 ]
%17 = add i32 %16, -3
%18 = icmp ult i32 %17, -2
%19 = add i32 %inc17134.2, -3
%20 = icmp ult i32 %19, -2
%21 = add i32 %inc20131.2, -3
%22 = icmp ult i32 %21, -2
%23 = add i32 %inc11137.2, -3
%24 = icmp ult i32 %23, -2
%25 = select i1 %24, i1 true, i1 %22
%26 = select i1 %25, i1 true, i1 %20
%27 = select i1 %26, i1 true, i1 %18
%tobool.not148 = icmp eq i8 %flag.1, 0
%tobool.not = or i1 %27, %tobool.not148
%str.str.3 = select i1 %tobool.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,i,c[5];
for (i=1;i<=4;i++) c[i]=0;
for (i=0;i<3;i++) {
scanf("%d %d",&a,&b);
c[a]++;c[b]++;
}
if (c[1]==0 || c[2]==0 || c[3]==0 || c[4]==0) puts("NO");
else if (c[1]==3 || c[2]==3 || c[3]==3 || c[4]==3) puts("NO");
else puts("YES");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234334/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234334/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"NO\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca [5 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 20, ptr nonnull %c) #4
%scevgep = getelementptr inbounds i8, ptr %c, i64 4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %scevgep, i8 0, i64 16, i1 false), !tbaa !5
%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
%idxprom4 = sext i32 %0 to i64
%arrayidx5 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 %idxprom4
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%inc6 = add nsw i32 %1, 1
store i32 %inc6, ptr %arrayidx5, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%idxprom7 = sext i32 %2 to i64
%arrayidx8 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 %idxprom7
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%inc9 = add nsw i32 %3, 1
store i32 %inc9, ptr %arrayidx8, align 4, !tbaa !5
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%4 = load i32, ptr %a, align 4, !tbaa !5
%idxprom4.1 = sext i32 %4 to i64
%arrayidx5.1 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 %idxprom4.1
%5 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%inc6.1 = add nsw i32 %5, 1
store i32 %inc6.1, ptr %arrayidx5.1, align 4, !tbaa !5
%6 = load i32, ptr %b, align 4, !tbaa !5
%idxprom7.1 = sext i32 %6 to i64
%arrayidx8.1 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 %idxprom7.1
%7 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%inc9.1 = add nsw i32 %7, 1
store i32 %inc9.1, ptr %arrayidx8.1, align 4, !tbaa !5
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%8 = load i32, ptr %a, align 4, !tbaa !5
%idxprom4.2 = sext i32 %8 to i64
%arrayidx5.2 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 %idxprom4.2
%9 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5
%inc6.2 = add nsw i32 %9, 1
store i32 %inc6.2, ptr %arrayidx5.2, align 4, !tbaa !5
%10 = load i32, ptr %b, align 4, !tbaa !5
%idxprom7.2 = sext i32 %10 to i64
%arrayidx8.2 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 %idxprom7.2
%11 = load i32, ptr %arrayidx8.2, align 4, !tbaa !5
%inc9.2 = add nsw i32 %11, 1
store i32 %inc9.2, ptr %arrayidx8.2, align 4, !tbaa !5
%12 = load i32, ptr %scevgep, align 4, !tbaa !5
%cmp14 = icmp eq i32 %12, 0
%arrayidx15 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 2
%13 = load i32, ptr %arrayidx15, align 8
%cmp16 = icmp eq i32 %13, 0
%or.cond = select i1 %cmp14, i1 true, i1 %cmp16
%arrayidx18 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 3
%14 = load i32, ptr %arrayidx18, align 4
%cmp19 = icmp eq i32 %14, 0
%or.cond40 = select i1 %or.cond, i1 true, i1 %cmp19
%arrayidx21 = getelementptr inbounds [5 x i32], ptr %c, i64 0, i64 4
%15 = load i32, ptr %arrayidx21, align 16
%cmp22 = icmp eq i32 %15, 0
%or.cond41 = select i1 %or.cond40, i1 true, i1 %cmp22
br i1 %or.cond41, label %if.end39, label %if.else
if.else: ; preds = %entry
%cmp25 = icmp eq i32 %12, 3
%cmp28 = icmp eq i32 %13, 3
%or.cond42 = select i1 %cmp25, i1 true, i1 %cmp28
%cmp31 = icmp eq i32 %14, 3
%or.cond43 = select i1 %or.cond42, i1 true, i1 %cmp31
%cmp34 = icmp eq i32 %15, 3
%or.cond44 = select i1 %or.cond43, i1 true, i1 %cmp34
%.str.1..str.2 = select i1 %or.cond44, ptr @.str.1, ptr @.str.2
br label %if.end39
if.end39: ; preds = %if.else, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ %.str.1..str.2, %if.else ]
%call36 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: 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"}
|
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
typedef int32_t i32;
typedef int64_t i64;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define ALLOC(size,type) ((type*)calloc((size),sizeof(type)))
i64 calc (i32 n, i32 *a, i32 *b) {
i32 x[3], y[3];
i32 len = 0;
for (i32 i = 0; i < 3; ++i) {
if (b[i] > a[i]) {
x[len] = a[i];
y[len++] = b[i];
}
}
if (len == 0) return n;
if (len == 1) {
return n % x[0] + (i64) n / x[0] * y[0];
}
if (len == 2) {
i64 res = n % x[0] + (i64) n / x[0] * y[0];
for (i32 i = 1; x[1] * i <= n; ++i) {
i64 m = n - i * x[1];
res = MAX(res, m % x[0] + (i64) m / x[0] * y[0] + (i64) i * y[1]);
}
return res;
}
i64 *dp = ALLOC (n + 1, i64);
for (i32 i = 0; i <= n; ++i) {
dp[i] = i;
}
for (i32 i = 0; i < 3; ++i) {
for (i32 j = x[i]; j <= n; ++j) {
dp[j] = MAX(dp[j], y[i] + dp[j - x[i]]);
}
}
return dp[n];
}
void run (void) {
i32 n;
scanf ("%" SCNi32, &n);
i32 *a = ALLOC (6, i32);
for (i32 i = 0; i < 6; ++i) {
scanf ("%" SCNi32, a + i);
}
n = calc (n, a, a + 3);
i64 ans = calc (n, a + 3, a);
printf ("%" PRIi64 "\n", ans);
}
int main (void) {
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234378/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234378/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%i\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%li\0A\00", align 1
; Function Attrs: nofree nounwind memory(readwrite, argmem: read) uwtable
define dso_local i64 @calc(i32 noundef %n, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%x = alloca [3 x i32], align 4
%y = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %y) #6
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %0, %1
br i1 %cmp3, label %if.then, label %for.inc
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %entry, %if.then
%len.1 = phi i32 [ 1, %if.then ], [ 0, %entry ]
%arrayidx.1 = getelementptr inbounds i32, ptr %b, i64 1
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%arrayidx2.1 = getelementptr inbounds i32, ptr %a, i64 1
%3 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%cmp3.1 = icmp sgt i32 %2, %3
br i1 %cmp3.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%idxprom6.1 = zext i32 %len.1 to i64
%arrayidx7.1 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 %idxprom6.1
store i32 %3, ptr %arrayidx7.1, align 4, !tbaa !5
%inc.1 = add nuw nsw i32 %len.1, 1
%arrayidx11.1 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 %idxprom6.1
store i32 %2, ptr %arrayidx11.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%len.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %len.1, %for.inc ]
%arrayidx.2 = getelementptr inbounds i32, ptr %b, i64 2
%4 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%arrayidx2.2 = getelementptr inbounds i32, ptr %a, i64 2
%5 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%cmp3.2 = icmp sgt i32 %4, %5
br i1 %cmp3.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%idxprom6.2 = zext i32 %len.1.1 to i64
%arrayidx7.2 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 %idxprom6.2
store i32 %5, ptr %arrayidx7.2, align 4, !tbaa !5
%inc.2 = add nuw nsw i32 %len.1.1, 1
%arrayidx11.2 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 %idxprom6.2
store i32 %4, ptr %arrayidx11.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%len.1.2 = phi i32 [ %inc.2, %if.then.2 ], [ %len.1.1, %for.inc.1 ]
switch i32 %len.1.2, label %if.end87 [
i32 0, label %if.then14
i32 1, label %if.then18
i32 2, label %if.then29
]
if.then14: ; preds = %for.inc.2
%conv = sext i32 %n to i64
br label %cleanup
if.then18: ; preds = %for.inc.2
%6 = load i32, ptr %x, align 4, !tbaa !5
%rem = srem i32 %n, %6
%conv20 = sext i32 %rem to i64
%conv21 = sext i32 %n to i64
%conv23 = sext i32 %6 to i64
%div = sdiv i64 %conv21, %conv23
%7 = load i32, ptr %y, align 4, !tbaa !5
%conv25 = sext i32 %7 to i64
%mul = mul nsw i64 %div, %conv25
%add = add nsw i64 %mul, %conv20
br label %cleanup
if.then29: ; preds = %for.inc.2
%8 = load i32, ptr %x, align 4, !tbaa !5
%rem31 = srem i32 %n, %8
%conv32 = sext i32 %rem31 to i64
%conv33 = sext i32 %n to i64
%conv35 = sext i32 %8 to i64
%div36 = sdiv i64 %conv33, %conv35
%9 = load i32, ptr %y, align 4, !tbaa !5
%conv38 = sext i32 %9 to i64
%mul39 = mul nsw i64 %div36, %conv38
%add40 = add nsw i64 %mul39, %conv32
%arrayidx43 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 1
%10 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%cmp45.not209 = icmp sgt i32 %10, %n
br i1 %cmp45.not209, label %cleanup, label %for.body48.lr.ph
for.body48.lr.ph: ; preds = %if.then29
%arrayidx63 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 1
%11 = load i32, ptr %arrayidx63, align 4, !tbaa !5
%conv64 = sext i32 %11 to i64
%12 = sext i32 %10 to i64
br label %for.body48
for.body48: ; preds = %for.body48.lr.ph, %for.body48
%indvars.iv = phi i64 [ 1, %for.body48.lr.ph ], [ %indvars.iv.next, %for.body48 ]
%mul44212 = phi i32 [ %10, %for.body48.lr.ph ], [ %14, %for.body48 ]
%res.0210 = phi i64 [ %add40, %for.body48.lr.ph ], [ %res.0.add66, %for.body48 ]
%sub = sub nsw i32 %n, %mul44212
%conv51 = sext i32 %sub to i64
%rem54 = srem i64 %conv51, %conv35
%div57 = sdiv i64 %conv51, %conv35
%mul60 = mul nsw i64 %div57, %conv38
%add61 = add nsw i64 %mul60, %rem54
%mul65 = mul nsw i64 %indvars.iv, %conv64
%add66 = add nsw i64 %add61, %mul65
%res.0.add66 = tail call i64 @llvm.smax.i64(i64 %res.0210, i64 %add66)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = mul nsw i64 %indvars.iv.next, %12
%cmp45.not = icmp sgt i64 %13, %conv33
%14 = trunc i64 %13 to i32
br i1 %cmp45.not, label %cleanup, label %for.body48, !llvm.loop !9
if.end87: ; preds = %for.inc.2
%add88 = add i32 %n, 1
%conv89 = sext i32 %add88 to i64
%call = tail call noalias ptr @calloc(i64 noundef %conv89, i64 noundef 8) #7
%cmp92.not213 = icmp slt i32 %n, 0
br i1 %cmp92.not213, label %for.cond103.preheader, label %for.body95.preheader
for.body95.preheader: ; preds = %if.end87
%wide.trip.count = zext i32 %add88 to i64
%min.iters.check = icmp ult i32 %add88, 4
br i1 %min.iters.check, label %for.body95.preheader302, label %vector.ph
vector.ph: ; preds = %for.body95.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.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>
%15 = getelementptr inbounds i64, ptr %call, i64 %index
store <2 x i64> %vec.ind, ptr %15, align 8, !tbaa !11
%16 = getelementptr inbounds i64, ptr %15, i64 2
store <2 x i64> %step.add, ptr %16, align 8, !tbaa !11
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond103.preheader, label %for.body95.preheader302
for.body95.preheader302: ; preds = %for.body95.preheader, %middle.block
%indvars.iv221.ph = phi i64 [ 0, %for.body95.preheader ], [ %n.vec, %middle.block ]
br label %for.body95
for.cond103.preheader: ; preds = %for.body95, %middle.block, %if.end87
%18 = load i32, ptr %x, align 4, !tbaa !5
%cmp111.not215 = icmp sgt i32 %18, %n
br i1 %cmp111.not215, label %for.cond.cleanup113, label %for.body114.lr.ph
for.body95: ; preds = %for.body95.preheader302, %for.body95
%indvars.iv221 = phi i64 [ %indvars.iv.next222, %for.body95 ], [ %indvars.iv221.ph, %for.body95.preheader302 ]
%arrayidx98 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv221
store i64 %indvars.iv221, ptr %arrayidx98, align 8, !tbaa !11
%indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
%exitcond.not = icmp eq i64 %indvars.iv.next222, %wide.trip.count
br i1 %exitcond.not, label %for.cond103.preheader, label %for.body95, !llvm.loop !16
for.body114.lr.ph: ; preds = %for.cond103.preheader
%19 = load i32, ptr %y, align 4, !tbaa !5
%conv119 = sext i32 %19 to i64
%20 = sext i32 %18 to i64
%21 = sub i32 %n, %18
%22 = zext i32 %21 to i64
%23 = add nuw nsw i64 %22, 1
%min.iters.check238 = icmp ult i32 %21, 11
br i1 %min.iters.check238, label %for.body114.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body114.lr.ph
%24 = shl nsw i64 %20, 3
%scevgep = getelementptr i8, ptr %call, i64 %24
%25 = sub i32 %n, %18
%26 = zext i32 %25 to i64
%27 = shl nuw nsw i64 %26, 3
%28 = getelementptr i8, ptr %call, i64 %24
%29 = getelementptr i8, ptr %28, i64 %27
%scevgep234 = getelementptr i8, ptr %29, i64 8
%30 = getelementptr i8, ptr %call, i64 %27
%scevgep235 = getelementptr i8, ptr %30, i64 8
%bound0 = icmp ult ptr %scevgep, %scevgep235
%bound1 = icmp ult ptr %call, %scevgep234
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body114.preheader, label %vector.ph239
vector.ph239: ; preds = %vector.memcheck
%n.vec241 = and i64 %23, 8589934588
%ind.end = add nsw i64 %n.vec241, %20
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %conv119, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
%invariant.gep = getelementptr i64, ptr %call, i64 %20
br label %vector.body244
vector.body244: ; preds = %vector.body244, %vector.ph239
%index245 = phi i64 [ 0, %vector.ph239 ], [ %index.next249, %vector.body244 ]
%gep = getelementptr i64, ptr %invariant.gep, i64 %index245
%wide.load = load <2 x i64>, ptr %gep, align 8, !tbaa !11, !alias.scope !17, !noalias !20
%31 = getelementptr inbounds i64, ptr %gep, i64 2
%wide.load246 = load <2 x i64>, ptr %31, align 8, !tbaa !11, !alias.scope !17, !noalias !20
%32 = getelementptr inbounds i64, ptr %call, i64 %index245
%wide.load247 = load <2 x i64>, ptr %32, align 8, !tbaa !11, !alias.scope !20
%33 = getelementptr inbounds i64, ptr %32, i64 2
%wide.load248 = load <2 x i64>, ptr %33, align 8, !tbaa !11, !alias.scope !20
%34 = add nsw <2 x i64> %wide.load247, %broadcast.splat
%35 = add nsw <2 x i64> %wide.load248, %broadcast.splat
%36 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load, <2 x i64> %34)
%37 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load246, <2 x i64> %35)
store <2 x i64> %36, ptr %gep, align 8, !tbaa !11, !alias.scope !17, !noalias !20
store <2 x i64> %37, ptr %31, align 8, !tbaa !11, !alias.scope !17, !noalias !20
%index.next249 = add nuw i64 %index245, 4
%38 = icmp eq i64 %index.next249, %n.vec241
br i1 %38, label %middle.block236, label %vector.body244, !llvm.loop !22
middle.block236: ; preds = %vector.body244
%cmp.n243 = icmp eq i64 %23, %n.vec241
br i1 %cmp.n243, label %for.cond.cleanup113, label %for.body114.preheader
for.body114.preheader: ; preds = %vector.memcheck, %for.body114.lr.ph, %middle.block236
%indvars.iv224.ph = phi i64 [ %20, %vector.memcheck ], [ %20, %for.body114.lr.ph ], [ %ind.end, %middle.block236 ]
%39 = add i32 %n, 1
%40 = trunc i64 %indvars.iv224.ph to i32
%41 = sub i32 %39, %40
%xtraiter = and i32 %41, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body114.prol.loopexit, label %for.body114.prol
for.body114.prol: ; preds = %for.body114.preheader
%arrayidx116.prol = getelementptr inbounds i64, ptr %call, i64 %indvars.iv224.ph
%42 = load i64, ptr %arrayidx116.prol, align 8, !tbaa !11
%43 = sub nsw i64 %indvars.iv224.ph, %20
%arrayidx124.prol = getelementptr inbounds i64, ptr %call, i64 %43
%44 = load i64, ptr %arrayidx124.prol, align 8, !tbaa !11
%add125.prol = add nsw i64 %44, %conv119
%.add125.prol = tail call i64 @llvm.smax.i64(i64 %42, i64 %add125.prol)
store i64 %.add125.prol, ptr %arrayidx116.prol, align 8, !tbaa !11
%indvars.iv.next225.prol = add nsw i64 %indvars.iv224.ph, 1
br label %for.body114.prol.loopexit
for.body114.prol.loopexit: ; preds = %for.body114.prol, %for.body114.preheader
%indvars.iv224.unr = phi i64 [ %indvars.iv224.ph, %for.body114.preheader ], [ %indvars.iv.next225.prol, %for.body114.prol ]
%45 = icmp eq i32 %40, %n
br i1 %45, label %for.cond.cleanup113, label %for.body114
for.cond.cleanup113: ; preds = %for.body114.prol.loopexit, %for.body114, %middle.block236, %for.cond103.preheader
%arrayidx109.1 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 1
%46 = load i32, ptr %arrayidx109.1, align 4, !tbaa !5
%cmp111.not215.1 = icmp sgt i32 %46, %n
br i1 %cmp111.not215.1, label %for.cond.cleanup113.1, label %for.body114.lr.ph.1
for.body114.lr.ph.1: ; preds = %for.cond.cleanup113
%arrayidx118.1 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 1
%47 = load i32, ptr %arrayidx118.1, align 4, !tbaa !5
%conv119.1 = sext i32 %47 to i64
%48 = sext i32 %46 to i64
%49 = sub i32 %n, %46
%50 = zext i32 %49 to i64
%51 = add nuw nsw i64 %50, 1
%min.iters.check259 = icmp ult i32 %49, 11
br i1 %min.iters.check259, label %for.body114.1.preheader, label %vector.memcheck250
vector.memcheck250: ; preds = %for.body114.lr.ph.1
%52 = shl nsw i64 %48, 3
%scevgep251 = getelementptr i8, ptr %call, i64 %52
%53 = sub i32 %n, %46
%54 = zext i32 %53 to i64
%55 = shl nuw nsw i64 %54, 3
%56 = getelementptr i8, ptr %call, i64 %52
%57 = getelementptr i8, ptr %56, i64 %55
%scevgep252 = getelementptr i8, ptr %57, i64 8
%58 = getelementptr i8, ptr %call, i64 %55
%scevgep253 = getelementptr i8, ptr %58, i64 8
%bound0254 = icmp ult ptr %scevgep251, %scevgep253
%bound1255 = icmp ult ptr %call, %scevgep252
%found.conflict256 = and i1 %bound0254, %bound1255
br i1 %found.conflict256, label %for.body114.1.preheader, label %vector.ph260
vector.ph260: ; preds = %vector.memcheck250
%n.vec262 = and i64 %51, 8589934588
%ind.end263 = add nsw i64 %n.vec262, %48
%broadcast.splatinsert273 = insertelement <2 x i64> poison, i64 %conv119.1, i64 0
%broadcast.splat274 = shufflevector <2 x i64> %broadcast.splatinsert273, <2 x i64> poison, <2 x i32> zeroinitializer
%invariant.gep315 = getelementptr i64, ptr %call, i64 %48
br label %vector.body266
vector.body266: ; preds = %vector.body266, %vector.ph260
%index267 = phi i64 [ 0, %vector.ph260 ], [ %index.next275, %vector.body266 ]
%gep316 = getelementptr i64, ptr %invariant.gep315, i64 %index267
%wide.load269 = load <2 x i64>, ptr %gep316, align 8, !tbaa !11, !alias.scope !23, !noalias !26
%59 = getelementptr inbounds i64, ptr %gep316, i64 2
%wide.load270 = load <2 x i64>, ptr %59, align 8, !tbaa !11, !alias.scope !23, !noalias !26
%60 = getelementptr inbounds i64, ptr %call, i64 %index267
%wide.load271 = load <2 x i64>, ptr %60, align 8, !tbaa !11, !alias.scope !26
%61 = getelementptr inbounds i64, ptr %60, i64 2
%wide.load272 = load <2 x i64>, ptr %61, align 8, !tbaa !11, !alias.scope !26
%62 = add nsw <2 x i64> %wide.load271, %broadcast.splat274
%63 = add nsw <2 x i64> %wide.load272, %broadcast.splat274
%64 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load269, <2 x i64> %62)
%65 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load270, <2 x i64> %63)
store <2 x i64> %64, ptr %gep316, align 8, !tbaa !11, !alias.scope !23, !noalias !26
store <2 x i64> %65, ptr %59, align 8, !tbaa !11, !alias.scope !23, !noalias !26
%index.next275 = add nuw i64 %index267, 4
%66 = icmp eq i64 %index.next275, %n.vec262
br i1 %66, label %middle.block257, label %vector.body266, !llvm.loop !28
middle.block257: ; preds = %vector.body266
%cmp.n265 = icmp eq i64 %51, %n.vec262
br i1 %cmp.n265, label %for.cond.cleanup113.1, label %for.body114.1.preheader
for.body114.1.preheader: ; preds = %vector.memcheck250, %for.body114.lr.ph.1, %middle.block257
%indvars.iv224.1.ph = phi i64 [ %48, %vector.memcheck250 ], [ %48, %for.body114.lr.ph.1 ], [ %ind.end263, %middle.block257 ]
%67 = add i32 %n, 1
%68 = trunc i64 %indvars.iv224.1.ph to i32
%69 = sub i32 %67, %68
%xtraiter311 = and i32 %69, 1
%lcmp.mod312.not = icmp eq i32 %xtraiter311, 0
br i1 %lcmp.mod312.not, label %for.body114.1.prol.loopexit, label %for.body114.1.prol
for.body114.1.prol: ; preds = %for.body114.1.preheader
%arrayidx116.1.prol = getelementptr inbounds i64, ptr %call, i64 %indvars.iv224.1.ph
%70 = load i64, ptr %arrayidx116.1.prol, align 8, !tbaa !11
%71 = sub nsw i64 %indvars.iv224.1.ph, %48
%arrayidx124.1.prol = getelementptr inbounds i64, ptr %call, i64 %71
%72 = load i64, ptr %arrayidx124.1.prol, align 8, !tbaa !11
%add125.1.prol = add nsw i64 %72, %conv119.1
%.add125.1.prol = tail call i64 @llvm.smax.i64(i64 %70, i64 %add125.1.prol)
store i64 %.add125.1.prol, ptr %arrayidx116.1.prol, align 8, !tbaa !11
%indvars.iv.next225.1.prol = add nsw i64 %indvars.iv224.1.ph, 1
br label %for.body114.1.prol.loopexit
for.body114.1.prol.loopexit: ; preds = %for.body114.1.prol, %for.body114.1.preheader
%indvars.iv224.1.unr = phi i64 [ %indvars.iv224.1.ph, %for.body114.1.preheader ], [ %indvars.iv.next225.1.prol, %for.body114.1.prol ]
%73 = icmp eq i32 %68, %n
br i1 %73, label %for.cond.cleanup113.1, label %for.body114.1
for.body114.1: ; preds = %for.body114.1.prol.loopexit, %for.body114.1
%indvars.iv224.1 = phi i64 [ %indvars.iv.next225.1.1, %for.body114.1 ], [ %indvars.iv224.1.unr, %for.body114.1.prol.loopexit ]
%arrayidx116.1 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv224.1
%74 = load i64, ptr %arrayidx116.1, align 8, !tbaa !11
%75 = sub nsw i64 %indvars.iv224.1, %48
%arrayidx124.1 = getelementptr inbounds i64, ptr %call, i64 %75
%76 = load i64, ptr %arrayidx124.1, align 8, !tbaa !11
%add125.1 = add nsw i64 %76, %conv119.1
%.add125.1 = tail call i64 @llvm.smax.i64(i64 %74, i64 %add125.1)
store i64 %.add125.1, ptr %arrayidx116.1, align 8, !tbaa !11
%indvars.iv.next225.1 = add nsw i64 %indvars.iv224.1, 1
%arrayidx116.1.1 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv.next225.1
%77 = load i64, ptr %arrayidx116.1.1, align 8, !tbaa !11
%78 = sub nsw i64 %indvars.iv.next225.1, %48
%arrayidx124.1.1 = getelementptr inbounds i64, ptr %call, i64 %78
%79 = load i64, ptr %arrayidx124.1.1, align 8, !tbaa !11
%add125.1.1 = add nsw i64 %79, %conv119.1
%.add125.1.1 = tail call i64 @llvm.smax.i64(i64 %77, i64 %add125.1.1)
store i64 %.add125.1.1, ptr %arrayidx116.1.1, align 8, !tbaa !11
%indvars.iv.next225.1.1 = add nsw i64 %indvars.iv224.1, 2
%lftr.wideiv.1.1 = trunc i64 %indvars.iv.next225.1.1 to i32
%exitcond228.1.not.1 = icmp eq i32 %add88, %lftr.wideiv.1.1
br i1 %exitcond228.1.not.1, label %for.cond.cleanup113.1, label %for.body114.1, !llvm.loop !29
for.cond.cleanup113.1: ; preds = %for.body114.1.prol.loopexit, %for.body114.1, %middle.block257, %for.cond.cleanup113
%arrayidx109.2 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 2
%80 = load i32, ptr %arrayidx109.2, align 4, !tbaa !5
%cmp111.not215.2 = icmp sgt i32 %80, %n
br i1 %cmp111.not215.2, label %for.cond.cleanup113.2, label %for.body114.lr.ph.2
for.body114.lr.ph.2: ; preds = %for.cond.cleanup113.1
%arrayidx118.2 = getelementptr inbounds [3 x i32], ptr %y, i64 0, i64 2
%81 = load i32, ptr %arrayidx118.2, align 4, !tbaa !5
%conv119.2 = sext i32 %81 to i64
%82 = sext i32 %80 to i64
%83 = sub i32 %n, %80
%84 = zext i32 %83 to i64
%85 = add nuw nsw i64 %84, 1
%min.iters.check285 = icmp ult i32 %83, 11
br i1 %min.iters.check285, label %for.body114.2.preheader, label %vector.memcheck276
vector.memcheck276: ; preds = %for.body114.lr.ph.2
%86 = shl nsw i64 %82, 3
%scevgep277 = getelementptr i8, ptr %call, i64 %86
%87 = sub i32 %n, %80
%88 = zext i32 %87 to i64
%89 = shl nuw nsw i64 %88, 3
%90 = getelementptr i8, ptr %call, i64 %86
%91 = getelementptr i8, ptr %90, i64 %89
%scevgep278 = getelementptr i8, ptr %91, i64 8
%92 = getelementptr i8, ptr %call, i64 %89
%scevgep279 = getelementptr i8, ptr %92, i64 8
%bound0280 = icmp ult ptr %scevgep277, %scevgep279
%bound1281 = icmp ult ptr %call, %scevgep278
%found.conflict282 = and i1 %bound0280, %bound1281
br i1 %found.conflict282, label %for.body114.2.preheader, label %vector.ph286
vector.ph286: ; preds = %vector.memcheck276
%n.vec288 = and i64 %85, 8589934588
%ind.end289 = add nsw i64 %n.vec288, %82
%broadcast.splatinsert299 = insertelement <2 x i64> poison, i64 %conv119.2, i64 0
%broadcast.splat300 = shufflevector <2 x i64> %broadcast.splatinsert299, <2 x i64> poison, <2 x i32> zeroinitializer
%invariant.gep317 = getelementptr i64, ptr %call, i64 %82
br label %vector.body292
vector.body292: ; preds = %vector.body292, %vector.ph286
%index293 = phi i64 [ 0, %vector.ph286 ], [ %index.next301, %vector.body292 ]
%gep318 = getelementptr i64, ptr %invariant.gep317, i64 %index293
%wide.load295 = load <2 x i64>, ptr %gep318, align 8, !tbaa !11, !alias.scope !30, !noalias !33
%93 = getelementptr inbounds i64, ptr %gep318, i64 2
%wide.load296 = load <2 x i64>, ptr %93, align 8, !tbaa !11, !alias.scope !30, !noalias !33
%94 = getelementptr inbounds i64, ptr %call, i64 %index293
%wide.load297 = load <2 x i64>, ptr %94, align 8, !tbaa !11, !alias.scope !33
%95 = getelementptr inbounds i64, ptr %94, i64 2
%wide.load298 = load <2 x i64>, ptr %95, align 8, !tbaa !11, !alias.scope !33
%96 = add nsw <2 x i64> %wide.load297, %broadcast.splat300
%97 = add nsw <2 x i64> %wide.load298, %broadcast.splat300
%98 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load295, <2 x i64> %96)
%99 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load296, <2 x i64> %97)
store <2 x i64> %98, ptr %gep318, align 8, !tbaa !11, !alias.scope !30, !noalias !33
store <2 x i64> %99, ptr %93, align 8, !tbaa !11, !alias.scope !30, !noalias !33
%index.next301 = add nuw i64 %index293, 4
%100 = icmp eq i64 %index.next301, %n.vec288
br i1 %100, label %middle.block283, label %vector.body292, !llvm.loop !35
middle.block283: ; preds = %vector.body292
%cmp.n291 = icmp eq i64 %85, %n.vec288
br i1 %cmp.n291, label %for.cond.cleanup113.2, label %for.body114.2.preheader
for.body114.2.preheader: ; preds = %vector.memcheck276, %for.body114.lr.ph.2, %middle.block283
%indvars.iv224.2.ph = phi i64 [ %82, %vector.memcheck276 ], [ %82, %for.body114.lr.ph.2 ], [ %ind.end289, %middle.block283 ]
%101 = add i32 %n, 1
%102 = trunc i64 %indvars.iv224.2.ph to i32
%103 = sub i32 %101, %102
%xtraiter313 = and i32 %103, 1
%lcmp.mod314.not = icmp eq i32 %xtraiter313, 0
br i1 %lcmp.mod314.not, label %for.body114.2.prol.loopexit, label %for.body114.2.prol
for.body114.2.prol: ; preds = %for.body114.2.preheader
%arrayidx116.2.prol = getelementptr inbounds i64, ptr %call, i64 %indvars.iv224.2.ph
%104 = load i64, ptr %arrayidx116.2.prol, align 8, !tbaa !11
%105 = sub nsw i64 %indvars.iv224.2.ph, %82
%arrayidx124.2.prol = getelementptr inbounds i64, ptr %call, i64 %105
%106 = load i64, ptr %arrayidx124.2.prol, align 8, !tbaa !11
%add125.2.prol = add nsw i64 %106, %conv119.2
%.add125.2.prol = tail call i64 @llvm.smax.i64(i64 %104, i64 %add125.2.prol)
store i64 %.add125.2.prol, ptr %arrayidx116.2.prol, align 8, !tbaa !11
%indvars.iv.next225.2.prol = add nsw i64 %indvars.iv224.2.ph, 1
br label %for.body114.2.prol.loopexit
for.body114.2.prol.loopexit: ; preds = %for.body114.2.prol, %for.body114.2.preheader
%indvars.iv224.2.unr = phi i64 [ %indvars.iv224.2.ph, %for.body114.2.preheader ], [ %indvars.iv.next225.2.prol, %for.body114.2.prol ]
%107 = icmp eq i32 %102, %n
br i1 %107, label %for.cond.cleanup113.2, label %for.body114.2
for.body114.2: ; preds = %for.body114.2.prol.loopexit, %for.body114.2
%indvars.iv224.2 = phi i64 [ %indvars.iv.next225.2.1, %for.body114.2 ], [ %indvars.iv224.2.unr, %for.body114.2.prol.loopexit ]
%arrayidx116.2 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv224.2
%108 = load i64, ptr %arrayidx116.2, align 8, !tbaa !11
%109 = sub nsw i64 %indvars.iv224.2, %82
%arrayidx124.2 = getelementptr inbounds i64, ptr %call, i64 %109
%110 = load i64, ptr %arrayidx124.2, align 8, !tbaa !11
%add125.2 = add nsw i64 %110, %conv119.2
%.add125.2 = tail call i64 @llvm.smax.i64(i64 %108, i64 %add125.2)
store i64 %.add125.2, ptr %arrayidx116.2, align 8, !tbaa !11
%indvars.iv.next225.2 = add nsw i64 %indvars.iv224.2, 1
%arrayidx116.2.1 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv.next225.2
%111 = load i64, ptr %arrayidx116.2.1, align 8, !tbaa !11
%112 = sub nsw i64 %indvars.iv.next225.2, %82
%arrayidx124.2.1 = getelementptr inbounds i64, ptr %call, i64 %112
%113 = load i64, ptr %arrayidx124.2.1, align 8, !tbaa !11
%add125.2.1 = add nsw i64 %113, %conv119.2
%.add125.2.1 = tail call i64 @llvm.smax.i64(i64 %111, i64 %add125.2.1)
store i64 %.add125.2.1, ptr %arrayidx116.2.1, align 8, !tbaa !11
%indvars.iv.next225.2.1 = add nsw i64 %indvars.iv224.2, 2
%lftr.wideiv.2.1 = trunc i64 %indvars.iv.next225.2.1 to i32
%exitcond228.2.not.1 = icmp eq i32 %add88, %lftr.wideiv.2.1
br i1 %exitcond228.2.not.1, label %for.cond.cleanup113.2, label %for.body114.2, !llvm.loop !36
for.cond.cleanup113.2: ; preds = %for.body114.2.prol.loopexit, %for.body114.2, %middle.block283, %for.cond.cleanup113.1
%idxprom151 = sext i32 %n to i64
%arrayidx152 = getelementptr inbounds i64, ptr %call, i64 %idxprom151
%114 = load i64, ptr %arrayidx152, align 8, !tbaa !11
br label %cleanup
for.body114: ; preds = %for.body114.prol.loopexit, %for.body114
%indvars.iv224 = phi i64 [ %indvars.iv.next225.1308, %for.body114 ], [ %indvars.iv224.unr, %for.body114.prol.loopexit ]
%arrayidx116 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv224
%115 = load i64, ptr %arrayidx116, align 8, !tbaa !11
%116 = sub nsw i64 %indvars.iv224, %20
%arrayidx124 = getelementptr inbounds i64, ptr %call, i64 %116
%117 = load i64, ptr %arrayidx124, align 8, !tbaa !11
%add125 = add nsw i64 %117, %conv119
%.add125 = tail call i64 @llvm.smax.i64(i64 %115, i64 %add125)
store i64 %.add125, ptr %arrayidx116, align 8, !tbaa !11
%indvars.iv.next225 = add nsw i64 %indvars.iv224, 1
%arrayidx116.1304 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv.next225
%118 = load i64, ptr %arrayidx116.1304, align 8, !tbaa !11
%119 = sub nsw i64 %indvars.iv.next225, %20
%arrayidx124.1305 = getelementptr inbounds i64, ptr %call, i64 %119
%120 = load i64, ptr %arrayidx124.1305, align 8, !tbaa !11
%add125.1306 = add nsw i64 %120, %conv119
%.add125.1307 = tail call i64 @llvm.smax.i64(i64 %118, i64 %add125.1306)
store i64 %.add125.1307, ptr %arrayidx116.1304, align 8, !tbaa !11
%indvars.iv.next225.1308 = add nsw i64 %indvars.iv224, 2
%lftr.wideiv.1309 = trunc i64 %indvars.iv.next225.1308 to i32
%exitcond228.not.1 = icmp eq i32 %add88, %lftr.wideiv.1309
br i1 %exitcond228.not.1, label %for.cond.cleanup113, label %for.body114, !llvm.loop !37
cleanup: ; preds = %for.body48, %if.then29, %for.cond.cleanup113.2, %if.then18, %if.then14
%retval.0 = phi i64 [ %conv, %if.then14 ], [ %add, %if.then18 ], [ %114, %for.cond.cleanup113.2 ], [ %add40, %if.then29 ], [ %res.0.add66, %for.body48 ]
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %x) #6
ret i64 %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 nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @run() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call noalias dereferenceable_or_null(24) ptr @calloc(i64 noundef 6, i64 noundef 4) #7
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %call1)
%add.ptr.1 = getelementptr inbounds i32, ptr %call1, i64 1
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1)
%add.ptr.2 = getelementptr inbounds i32, ptr %call1, i64 2
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.2)
%add.ptr.3 = getelementptr inbounds i32, ptr %call1, i64 3
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.3)
%add.ptr.4 = getelementptr inbounds i32, ptr %call1, i64 4
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.4)
%add.ptr.5 = getelementptr inbounds i32, ptr %call1, i64 5
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.5)
%0 = load i32, ptr %n, align 4, !tbaa !5
%call4 = call i64 @calc(i32 noundef %0, ptr noundef %call1, ptr noundef nonnull %add.ptr.3)
%conv = trunc i64 %call4 to i32
store i32 %conv, ptr %n, align 4, !tbaa !5
%call6 = call i64 @calc(i32 noundef %conv, ptr noundef nonnull %add.ptr.3, ptr noundef %call1)
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret void
}
; 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 uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
tail call void @run()
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #5
attributes #0 = { nofree nounwind memory(readwrite, 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 allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!21}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !10, !14, !15}
!23 = !{!24}
!24 = distinct !{!24, !25}
!25 = distinct !{!25, !"LVerDomain"}
!26 = !{!27}
!27 = distinct !{!27, !25}
!28 = distinct !{!28, !10, !14, !15}
!29 = distinct !{!29, !10, !14}
!30 = !{!31}
!31 = distinct !{!31, !32}
!32 = distinct !{!32, !"LVerDomain"}
!33 = !{!34}
!34 = distinct !{!34, !32}
!35 = distinct !{!35, !10, !14, !15}
!36 = distinct !{!36, !10, !14}
!37 = distinct !{!37, !10, !14}
|
#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;
}
}
static void sha1(const char* str, uint64_t len, uint32_t* hash) {
if (len == 0) {
len = (uint64_t)strlen(str);
}
uint32_t h[5] = { 0x67452301 ,0xEFCDAB89 ,0x98BADCFE ,0x10325476 ,0xC3D2E1F0 };
uint32_t w[80];
for (uint64_t i = 0; i < 16; i++) {
w[i] = 0;
}
for (uint64_t i = 0; i < len; i++) {
w[i / 4] |= (uint32_t)(str[i]) << ((i % 4) * 8);
}
w[15] = (uint32_t)len * 8;
for (uint64_t i = 16; i < 80; i++) {
const uint32_t v = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16];
w[i] = (v << 1) | (v >> 31);
}
uint32_t a = h[0];
uint32_t b = h[1];
uint32_t c = h[2];
uint32_t d = h[3];
uint32_t e = h[4];
for (uint64_t i = 0; i < 80; i++) {
uint32_t f = 0;
uint32_t k = 0;
if (i < 20) {
f = (a & b) | (~b & d);
k = 0x5A827999;
}
else if (i < 40) {
f = b ^ c ^ d;
k = 0x6ED9EBA1;
}
else if (i < 60) {
f = (b & c) | (b & d) | (c & d);
k = 0x8F1BBCDC;
}
else {
f = b ^ c ^ d;
k = 0xCA62C1D6;
}
const uint32_t t = ((a << 5) | (a >> 27)) + f + e + k + w[i];
e = d;
d = c;
c = (b << 30) | (b >> 2);
b = a;
a = t;
}
h[0] = h[0] + a;
h[1] = h[1] + b;
h[2] = h[2] + c;
h[3] = h[3] + d;
h[4] = h[4] + e;
hash[4] = h[0];
hash[3] = h[1];
hash[2] = h[2];
hash[1] = h[3];
hash[0] = h[4];
}
#define MOD_VAL (UINT64_C(998244353))
typedef struct {
uint64_t strListSize;
char str[10][11];
} HMap;
static HMap hMap[1000000];
typedef struct {
uint64_t L;
uint64_t R;
} SecSet;
static SecSet ss[10];
static int compare_f(const void* a, const void* b) {
const SecSet* aP = (SecSet*)a;
const SecSet* bP = (SecSet*)b;
return aP->L < bP->L ? -1 : 1;
}
static uint64_t sSum[200000];
int main(void) {
uint64_t N, K;
scanf("%"PRIu64"%"PRIu64, &N, &K);
for (uint64_t i = 0; i < K; i++) {
scanf("%"PRIu64"%"PRIu64, &ss[i].L, &ss[i].R);
}
qsort(ss, (size_t)K, sizeof(SecSet), compare_f);
sSum[0] = 1;
uint64_t r = 0;
for (uint64_t i = 1; i < N; i++) {
r = 0;
for (uint64_t k = 0; k < K; k++) {
if (ss[k].L <= i) {
if (ss[k].R < i) {
r = (r + sSum[i - ss[k].L] + MOD_VAL - sSum[i - ss[k].R - 1]) % MOD_VAL;
}
else {
r = (r + sSum[i - ss[k].L]) % MOD_VAL;
}
}
}
sSum[i] = (sSum[i - 1] + r) % MOD_VAL;
//printf("%"PRIu64"\n", sSum[i]);
}
printf("%"PRIu64, r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234420/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234420/source.c"
target datalayout = "e-m:e-p270: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.SecSet = type { i64, i64 }
@.str = private unnamed_addr constant [7 x i8] c"%lu%lu\00", align 1
@ss = internal global [10 x %struct.SecSet] zeroinitializer, align 16
@sSum = internal unnamed_addr global [200000 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:
%N = alloca i64, align 8
%K = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i64, ptr %K, align 8, !tbaa !5
%cmp70.not = icmp eq i64 %0, 0
br i1 %cmp70.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i64 [ 0, %entry ], [ %13, %for.body ]
call void @qsort(ptr noundef nonnull @ss, i64 noundef %.lcssa, i64 noundef 16, ptr noundef nonnull @compare_f) #5
store i64 1, ptr @sSum, align 16, !tbaa !5
%1 = load i64, ptr %N, align 8, !tbaa !5
%cmp576 = icmp ugt i64 %1, 1
br i1 %cmp576, label %for.cond8.preheader.lr.ph, label %for.cond.cleanup6
for.cond8.preheader.lr.ph: ; preds = %for.cond.cleanup
%2 = load i64, ptr %K, align 8, !tbaa !5
%cmp972.not = icmp eq i64 %2, 0
br i1 %cmp972.not, label %for.cond8.preheader.preheader, label %for.cond8.preheader.us
for.cond8.preheader.preheader: ; preds = %for.cond8.preheader.lr.ph
%3 = add i64 %1, -1
%min.iters.check = icmp ult i64 %1, 5
br i1 %min.iters.check, label %for.cond8.preheader.preheader87, label %vector.ph
vector.ph: ; preds = %for.cond8.preheader.preheader
%n.vec = and i64 %3, -4
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = or i64 %index, 1
%4 = getelementptr inbounds [200000 x i64], ptr @sSum, i64 0, i64 %offset.idx
store <2 x i64> <i64 1, i64 1>, ptr %4, align 8, !tbaa !5
%5 = getelementptr inbounds i64, ptr %4, i64 2
store <2 x i64> <i64 1, i64 1>, ptr %5, align 8, !tbaa !5
%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 !12
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %3, %n.vec
br i1 %cmp.n, label %for.cond.cleanup6, label %for.cond8.preheader.preheader87
for.cond8.preheader.preheader87: ; preds = %for.cond8.preheader.preheader, %middle.block
%i3.077.ph = phi i64 [ 1, %for.cond8.preheader.preheader ], [ %ind.end, %middle.block ]
br label %for.cond8.preheader
for.cond8.preheader.us: ; preds = %for.cond8.preheader.lr.ph, %for.cond8.for.cond.cleanup10_crit_edge.us
%7 = phi i64 [ %rem42.us, %for.cond8.for.cond.cleanup10_crit_edge.us ], [ 1, %for.cond8.preheader.lr.ph ]
%i3.077.us = phi i64 [ %inc45.us, %for.cond8.for.cond.cleanup10_crit_edge.us ], [ 1, %for.cond8.preheader.lr.ph ]
br label %for.body11.us
for.body11.us: ; preds = %for.cond8.preheader.us, %for.inc36.us
%k.074.us = phi i64 [ 0, %for.cond8.preheader.us ], [ %inc37.us, %for.inc36.us ]
%r.173.us = phi i64 [ 0, %for.cond8.preheader.us ], [ %r.2.us, %for.inc36.us ]
%arrayidx12.us = getelementptr inbounds [10 x %struct.SecSet], ptr @ss, i64 0, i64 %k.074.us
%8 = load i64, ptr %arrayidx12.us, align 16, !tbaa !16
%cmp14.not.us = icmp ugt i64 %8, %i3.077.us
br i1 %cmp14.not.us, label %for.inc36.us, label %if.then.us
if.then.us: ; preds = %for.body11.us
%R16.us = getelementptr inbounds [10 x %struct.SecSet], ptr @ss, i64 0, i64 %k.074.us, i32 1
%9 = load i64, ptr %R16.us, align 8, !tbaa !18
%cmp17.us = icmp ult i64 %9, %i3.077.us
%sub.us = sub i64 %i3.077.us, %8
%arrayidx21.us = getelementptr inbounds [200000 x i64], ptr @sSum, i64 0, i64 %sub.us
%10 = load i64, ptr %arrayidx21.us, align 8, !tbaa !5
br i1 %cmp17.us, label %if.then18.us, label %if.else.us
if.else.us: ; preds = %if.then.us
%add33.us = add i64 %10, %r.173.us
%rem34.us = urem i64 %add33.us, 998244353
br label %for.inc36.us
if.then18.us: ; preds = %if.then.us
%11 = xor i64 %9, -1
%sub26.us = add i64 %i3.077.us, %11
%arrayidx27.us = getelementptr inbounds [200000 x i64], ptr @sSum, i64 0, i64 %sub26.us
%12 = load i64, ptr %arrayidx27.us, align 8, !tbaa !5
%add.us = add nuw nsw i64 %r.173.us, 998244353
%add22.us = add i64 %add.us, %10
%sub28.us = sub i64 %add22.us, %12
%rem.us = urem i64 %sub28.us, 998244353
br label %for.inc36.us
for.inc36.us: ; preds = %if.then18.us, %if.else.us, %for.body11.us
%r.2.us = phi i64 [ %rem.us, %if.then18.us ], [ %rem34.us, %if.else.us ], [ %r.173.us, %for.body11.us ]
%inc37.us = add nuw i64 %k.074.us, 1
%exitcond.not = icmp eq i64 %inc37.us, %2
br i1 %exitcond.not, label %for.cond8.for.cond.cleanup10_crit_edge.us, label %for.body11.us, !llvm.loop !19
for.cond8.for.cond.cleanup10_crit_edge.us: ; preds = %for.inc36.us
%add41.us = add nuw nsw i64 %7, %r.2.us
%rem42.us = urem i64 %add41.us, 998244353
%arrayidx43.us = getelementptr inbounds [200000 x i64], ptr @sSum, i64 0, i64 %i3.077.us
store i64 %rem42.us, ptr %arrayidx43.us, align 8, !tbaa !5
%inc45.us = add nuw i64 %i3.077.us, 1
%exitcond81.not = icmp eq i64 %inc45.us, %1
br i1 %exitcond81.not, label %for.cond.cleanup6, label %for.cond8.preheader.us, !llvm.loop !20
for.body: ; preds = %entry, %for.body
%i.071 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10 x %struct.SecSet], ptr @ss, i64 0, i64 %i.071
%R = getelementptr inbounds [10 x %struct.SecSet], ptr @ss, i64 0, i64 %i.071, i32 1
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %R)
%inc = add nuw i64 %i.071, 1
%13 = load i64, ptr %K, align 8, !tbaa !5
%cmp = icmp ult i64 %inc, %13
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !21
for.cond8.preheader: ; preds = %for.cond8.preheader.preheader87, %for.cond8.preheader
%i3.077 = phi i64 [ %inc45, %for.cond8.preheader ], [ %i3.077.ph, %for.cond8.preheader.preheader87 ]
%arrayidx43 = getelementptr inbounds [200000 x i64], ptr @sSum, i64 0, i64 %i3.077
store i64 1, ptr %arrayidx43, align 8, !tbaa !5
%inc45 = add nuw i64 %i3.077, 1
%exitcond82.not = icmp eq i64 %inc45, %1
br i1 %exitcond82.not, label %for.cond.cleanup6, label %for.cond8.preheader, !llvm.loop !22
for.cond.cleanup6: ; preds = %for.cond8.for.cond.cleanup10_crit_edge.us, %for.cond8.preheader, %middle.block, %for.cond.cleanup
%r.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ 0, %middle.block ], [ 0, %for.cond8.preheader ], [ %r.2.us, %for.cond8.for.cond.cleanup10_crit_edge.us ]
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %r.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define internal i32 @compare_f(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !16
%1 = load i64, ptr %b, align 8, !tbaa !16
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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, !15}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = !{!17, !6, i64 0}
!17 = !{!"", !6, i64 0, !6, i64 8}
!18 = !{!17, !6, i64 8}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13, !15, !14}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)
#define in(a) scanf("%lld", &(a))
#define in2(a,b) scanf("%lld %lld",&(a),&(b))
#define in3(a,b,c) scanf("%lld %lld %lld",&(a),&(b),&(c))
#define ind(a) scanf("%lf", &(a))
#define ins(a) scanf("%s", (a))
#define inc(a) scanf("%c", &(a))
#define put(a) printf("%lld\n", (a))
#define putd(a) printf("%.15f\n", (a))
// puts(a) printf("%s\n", a) 文字はこっち
//your code here!
int main(void){
char X[200100];
ins(X);
//後ろからなめる
//Sが表れかつ左にTが存在すれば-2
ll ans=strlen(X), T=0, N=strlen(X);
rep(i, N){
if(X[N-1-i]=='T') T++;
else if(T){
T--;
ans -= 2;
}
}
put(ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234471/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234471/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @powll(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
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 ]
%r.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
%r.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.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 %r.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 !5
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%r.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 %r.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 !7
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%X = alloca [200100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 200100, ptr nonnull %X) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %X) #6
%cmp19 = icmp sgt i64 %call2, 0
br i1 %cmp19, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %call2, 1
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %call2, -2
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa.loopexit: ; preds = %for.inc.1
%1 = sub nuw i64 -3, %i.022
%2 = icmp eq i64 %T.1.1, 0
br label %for.cond.cleanup.loopexit.unr-lcssa
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.cond.cleanup.loopexit.unr-lcssa.loopexit, %for.body.preheader
%ans.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %ans.1.1, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ]
%i.022.unr = phi i64 [ -1, %for.body.preheader ], [ %1, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ]
%ans.021.unr = phi i64 [ %call2, %for.body.preheader ], [ %ans.1.1, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ]
%T.020.unr = phi i1 [ true, %for.body.preheader ], [ %2, %for.cond.cleanup.loopexit.unr-lcssa.loopexit ]
%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
%sub5.epil = add i64 %call2, %i.022.unr
%arrayidx.epil = getelementptr inbounds [200100 x i8], ptr %X, i64 0, i64 %sub5.epil
%3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%cmp6.epil = icmp eq i8 %3, 84
br i1 %cmp6.epil, label %for.cond.cleanup, label %if.else.epil
if.else.epil: ; preds = %for.body.epil
%sub9.epil = add nsw i64 %ans.021.unr, -2
%spec.select = select i1 %T.020.unr, i64 %ans.021.unr, i64 %sub9.epil
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.else.epil, %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%ans.0.lcssa = phi i64 [ %call2, %entry ], [ %ans.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %spec.select, %if.else.epil ], [ %ans.021.unr, %for.body.epil ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 200100, ptr nonnull %X) #5
ret i32 0
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%i.022 = phi i64 [ 0, %for.body.preheader.new ], [ %inc11.1, %for.inc.1 ]
%ans.021 = phi i64 [ %call2, %for.body.preheader.new ], [ %ans.1.1, %for.inc.1 ]
%T.020 = phi i64 [ 0, %for.body.preheader.new ], [ %T.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%4 = xor i64 %i.022, -1
%sub5 = add i64 %call2, %4
%arrayidx = getelementptr inbounds [200100 x i8], ptr %X, i64 0, i64 %sub5
%5 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp6 = icmp eq i8 %5, 84
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i64 %T.020, 1
br label %for.inc
if.else: ; preds = %for.body
%tobool.not = icmp eq i64 %T.020, 0
br i1 %tobool.not, label %for.inc, label %if.then8
if.then8: ; preds = %if.else
%dec = add nsw i64 %T.020, -1
%sub9 = add nsw i64 %ans.021, -2
br label %for.inc
for.inc: ; preds = %if.then, %if.then8, %if.else
%T.1 = phi i64 [ %inc, %if.then ], [ %dec, %if.then8 ], [ 0, %if.else ]
%ans.1 = phi i64 [ %ans.021, %if.then ], [ %sub9, %if.then8 ], [ %ans.021, %if.else ]
%6 = xor i64 %i.022, -2
%sub5.1 = add i64 %call2, %6
%arrayidx.1 = getelementptr inbounds [200100 x i8], ptr %X, i64 0, i64 %sub5.1
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp6.1 = icmp eq i8 %7, 84
br i1 %cmp6.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc
%tobool.not.1 = icmp eq i64 %T.1, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.then8.1
if.then8.1: ; preds = %if.else.1
%dec.1 = add nsw i64 %T.1, -1
%sub9.1 = add nsw i64 %ans.1, -2
br label %for.inc.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i64 %T.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.then8.1, %if.else.1
%T.1.1 = phi i64 [ %inc.1, %if.then.1 ], [ %dec.1, %if.then8.1 ], [ 0, %if.else.1 ]
%ans.1.1 = phi i64 [ %ans.1, %if.then.1 ], [ %sub9.1, %if.then8.1 ], [ %ans.1, %if.else.1 ]
%inc11.1 = add nuw nsw i64 %i.022, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !12
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.unroll.disable"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.mustprogress"}
!9 = !{!10, !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = distinct !{!12, !8}
|
#if 0
cat <<EOF >mistaken-paste
#endif
// thx Ebi-chan!
#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 20000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1048576
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <functional>
#include <array>
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;
using std::string;
using std::get;
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> l, pair<T, U> r) {
return pair<T, U>(l.first + r.first, l.second + r.second);
}
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950
#endif
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
typedef struct {
double a;
double b;
} hwreal;
sll n, m;
sll h, w;
sll k;
sll q;
sll va, vb, vc, vd, ve, vf;
ull ua, ub, uc, ud, ue, uf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
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;
}
double dmin (double x, double y) {
return (x < y) ? x : y;
}
double dmax (double x, double y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
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;
}
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#define BEGCMP(NAME) int32_t NAME (const void *left, const void *right)
#define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right
#define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1
// 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;
// }
BEGCMP(pullcomp){
DEFLR(ull);
CMPRET(l, r);
return 0;
}
BEGCMP(prevcomp){
DEFLR(sll);
CMPRET(r, l);
return 0;
}
BEGCMP(psllcomp){
DEFLR(sll);
CMPRET(l, r);
return 0;
}
BEGCMP(pcharcomp){
DEFLR(char);
CMPRET(l, r);
return 0;
}
BEGCMP(pdoublecomp){
DEFLR(double);
CMPRET(l, r);
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
BEGCMP(phwllABcomp){
DEFLR(hwll);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwllREVcomp){
DEFLR(hwll);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
return 0;
}
BEGCMP(ptriplecomp){
DEFLR(hwllc);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleREVcomp){
DEFLR(hwllc);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleCABcomp){
DEFLR(hwllc);
CMPRET(l.c, r.c);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwrealcomp){
DEFLR(hwreal);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
int32_t pquadcomp (const void *left, const void *right) {
linell l = *(linell*)left;
linell r = *(linell*)right;
sll ac = phwllABcomp(&(l.a), &(r.a));
if (ac) return ac;
sll bc = phwllABcomp(&(l.b), &(r.b));
if (bc) return bc;
return 0;
}
int32_t pfracomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
CMPRET(l.a * r.b, l.b * r.a);
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
void sw (sll *l, sll *r) {
if (*l == *r) return;
sll t = *l;
*l = *r;
*r = t;
}
ull frac[N_MAX * 3], invf[N_MAX * 3];
ull ncr (sll n, sll r, ull m) {
if (n < 0 || r < 0 || n < r) return 0;
return frac[n] * (invf[r] * invf[n - r] % m) % m;
}
sll a[N_MAX + 5];
// ull a[N_MAX + 5];
// sll a[3001][3001];
sll b[N_MAX + 5];
// ull b[N_MAX + 5];
// sll b[3001][3001];
sll c[N_MAX + 5];
sll d[N_MAX + 5];
sll e[N_MAX * 4];
char s[N_MAX + 1];
// char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
char u[N_MAX + 1];
hwll xy[N_MAX + 5];
hwllc tup[N_MAX + 5];
sll table[3005][3005];
ull gin[N_MAX];
// here we go
typedef struct {
double a;
ull b;
} p;
p stack[N_MAX];
double vt;
ull beg = 0, end = 0;
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
sll *dpcell;
printf("%lld\n", a[0]);
stack[end++] = (p){(double)a[0], b[0]};
sum = k;
vt = (double)a[0] * (double)b[0];
for (i = 1; i < n; i++) {
while (sum > k - b[i]) {
if (sum - stack[beg].b <= k - b[i]) {
sll sub = sum - (k - b[i]);
vt -= stack[beg].a * (double)sub;
sum -= sub;
stack[beg].b -= sub;
} else {
vt -= stack[beg].a * (double)stack[beg].b;
sum -= stack[beg].b;
beg++;
}
}
// printf("[%lld %lld)\n", beg, end);
// for (j = beg; j < end; j++) {
// printf("%.15lf * %lld\n", stack[j].a, stack[j].b);
// }
// printf("sum: %.15lf\n", vt);
printf("%.15lf\n", (vt + (double)a[i] * (double)b[i]) / (double)k);
vt += (double)a[i] * (double)b[i];
sum += b[i];
stack[end] = (p){(double)a[i], b[i]};
end++;
while (end - beg >= 2 && stack[end - 2].a > stack[end - 1].a) {
stack[end - 2] = (p){
(stack[end - 2].a * stack[end - 2].b + stack[end - 1].a * stack[end - 1].b)
/ ((stack[end - 2].b) + (stack[end - 1].b)),
((stack[end - 2].b) + (stack[end - 1].b))
};
end--;
}
}
// printf("%lld\n", result);
// printf("%.15f\n", dresult);
// 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 (int argc, char *argv[]) {
int32_t i, j;
n = 4;
m = 0;
// scanf("%llu", &m);
// scanf("%llu%llu", &h, &w);
scanf("%llu", &n, &m);
scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%llu", &q);
// scanf("%lld%lld", &va, &vb, &vc, &vd);
// va--;
// vb--;
// scanf("%llu%llu%llu%llu", &ua, &ub, &uc, &ud, &ue);
// scanf("%s", s);
// scanf("%s", t);
// scanf("%s", u);
// scanf("%llu", &k);
// scanf("%lld", &m);
// for (i = 0; i < n; i++) {
// // scanf("%lld", &a[i]);
// scanf("%lld", &d[i]);
// }
// scanf("%llu", &q);
for (i = 0; i < n; i++) {
// scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c);
// scanf("%lld", &c[i]);
scanf("%lld", &a[i]);
scanf("%lld", &b[i]);
// scanf("%lld", &c[i]);
// scanf("%lld", &d[i]);
// a[i]--;
// b[i]--;
// c[i]--;
// d[i]--;
// xy[i].a--;
// xy[i].b--;
// tup[i].a--;
// tup[i].b--;
}
// scanf("%llu", &m);
// scanf("%llu", &q);
// for (i = 0; i < m; i++) {
// scanf("%lld%lld", &xy[i].a, &xy[i].b);
// xy[i].a--;
// xy[i].b--;
// // scanf("%lld%lld", &a[i], &b[i]);
// // scanf("%lld", &b[i]);
// // a[i]--;
// // b[i]--;
// // scanf("%lld", &c[i]);
// // scanf("%lld", &d[i]);
// // scanf("%lld", &e[i]);
// // c[i]--;
// // d[i]--;
// }
// for (i = 0; i < q; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &c[i]);
// // xy[i].a--;
// // xy[i].b--;
// }
// for (i = 0; i < h; i++) {
// for (j = 0; j < w; j++) {
// scanf("%lld", &table[i][j]);
// // table[i][j]--;
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", s[i]);
// }
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234521/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234521/source.c"
target datalayout = "e-m:e-p270: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.p = type { double, i64 }
%struct.hwll = type { i64, i64 }
%struct.hwllc = type { i64, i64, i64 }
@frac = dso_local local_unnamed_addr global [3145728 x i64] zeroinitializer, align 16
@invf = dso_local local_unnamed_addr global [3145728 x i64] zeroinitializer, align 16
@beg = dso_local local_unnamed_addr global i64 0, align 8
@end = dso_local local_unnamed_addr global i64 0, align 8
@.str = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@a = dso_local global [1048581 x i64] zeroinitializer, align 16
@stack = dso_local local_unnamed_addr global [1048576 x %struct.p] zeroinitializer, align 16
@b = dso_local global [1048581 x i64] zeroinitializer, align 16
@k = dso_local global i64 0, align 8
@vt = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@n = dso_local global i64 0, align 8
@.str.1 = private unnamed_addr constant [8 x i8] c"%.15lf\0A\00", align 1
@m = dso_local global i64 0, align 8
@.str.4 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@.str.5 = 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
@q = dso_local local_unnamed_addr global i64 0, align 8
@va = dso_local local_unnamed_addr global i64 0, align 8
@vb = dso_local local_unnamed_addr global i64 0, align 8
@vc = dso_local local_unnamed_addr global i64 0, align 8
@vd = dso_local local_unnamed_addr global i64 0, align 8
@ve = dso_local local_unnamed_addr global i64 0, align 8
@vf = dso_local local_unnamed_addr global i64 0, align 8
@ua = dso_local local_unnamed_addr global i64 0, align 8
@ub = dso_local local_unnamed_addr global i64 0, align 8
@uc = dso_local local_unnamed_addr global i64 0, align 8
@ud = dso_local local_unnamed_addr global i64 0, align 8
@ue = dso_local local_unnamed_addr global i64 0, align 8
@uf = 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
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@c = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16
@d = dso_local local_unnamed_addr global [1048581 x i64] zeroinitializer, align 16
@e = dso_local local_unnamed_addr global [4194304 x i64] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16
@u = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16
@xy = dso_local local_unnamed_addr global [1048581 x %struct.hwll] zeroinitializer, align 16
@tup = dso_local local_unnamed_addr global [1048581 x %struct.hwllc] zeroinitializer, align 16
@table = dso_local local_unnamed_addr global [3005 x [3005 x i64]] zeroinitializer, align 16
@gin = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16
; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmin(double noundef %x, double noundef %y) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %x, %y
%cond = select i1 %cmp, double %x, double %y
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %x, double noundef %y) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %x, %y
%cond = select i1 %cmp, double %x, double %y
ret double %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 {
entry:
%cmp4 = icmp eq i64 %y, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%y.tr6 = phi i64 [ %rem, %if.else ], [ %y, %entry ]
%x.tr5 = phi i64 [ %y.tr6, %if.else ], [ %x, %entry ]
%rem = urem i64 %x.tr5, %y.tr6
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%x.tr.lcssa = phi i64 [ %x, %entry ], [ %y.tr6, %if.else ]
ret i64 %x.tr.lcssa
}
; 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 #2 {
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 #2 {
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 #1 {
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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #2 {
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 !7
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 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 #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%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 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %1, %0
%cmp1 = icmp sgt i64 %1, %0
%. = 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 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt 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 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !12
%1 = load i8, ptr %right, align 1, !tbaa !12
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 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 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load double, ptr %left, align 8, !tbaa !13
%1 = load double, ptr %right, align 8, !tbaa !13
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp ogt double %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !15
%1 = load ptr, ptr %right, align 8, !tbaa !15
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #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 #5
; 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 #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%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 !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%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 !18
%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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%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 !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%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 !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%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 !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%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 !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%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
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%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 !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%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 !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleCABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%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 !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%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 !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwrealcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load double, ptr %left, align 8, !tbaa.struct !20
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load double, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21
%r.sroa.0.0.copyload = load double, ptr %right, align 8, !tbaa.struct !20
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load double, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21
%cmp = fcmp olt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = fcmp ogt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = fcmp olt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = fcmp ogt double %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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !22
%l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19
%l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17
%l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24
%l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !22
%r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19
%r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17
%r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24
%r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18
%cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp.i, label %cleanup10, label %if.end.i
if.end.i: ; preds = %entry
%cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4.i, label %cleanup10, label %if.end6.i
if.end6.i: ; preds = %if.end.i
%cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit
phwllABcomp.exit: ; preds = %if.end6.i
%cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp13.i.not, label %cleanup10, label %if.end
if.end: ; preds = %phwllABcomp.exit
%cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp.i21, label %cleanup10, label %if.end.i22
if.end.i22: ; preds = %if.end
%cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24
if.end6.i24: ; preds = %if.end.i22
%cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26
if.end10.i26: ; preds = %if.end6.i24
%cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
%..i28 = zext i1 %cmp13.i27 to i32
br label %cleanup10
cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit
%retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pfracomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%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 !17
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%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 !17
%mul = mul nsw i64 %r.sroa.5.0.copyload, %l.sroa.0.0.copyload
%mul3 = mul nsw i64 %r.sroa.0.0.copyload, %l.sroa.5.0.copyload
%cmp = icmp slt i64 %mul, %mul3
%cmp10 = icmp sgt i64 %mul, %mul3
%. = zext i1 %cmp10 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #1 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #1 {
entry:
%cmp.not = icmp sgt i64 %left, %x
%cmp1.not = icmp sgt i64 %x, %right
%or.cond = or i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %lor.rhs, label %lor.end
lor.rhs: ; preds = %entry
%cmp2 = icmp sge i64 %left, %x
%cmp3 = icmp sge i64 %x, %right
%0 = and i1 %cmp2, %cmp3
br label %lor.end
lor.end: ; preds = %entry, %lor.rhs
%1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ]
ret i1 %1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @sw(ptr nocapture noundef %l, ptr nocapture noundef %r) local_unnamed_addr #6 {
entry:
%0 = load i64, ptr %l, align 8, !tbaa !8
%1 = load i64, ptr %r, align 8, !tbaa !8
%cmp = icmp eq i64 %0, %1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
store i64 %1, ptr %l, align 8, !tbaa !8
store i64 %0, ptr %r, align 8, !tbaa !8
br label %return
return: ; preds = %entry, %if.end
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @ncr(i64 noundef %n, i64 noundef %r, i64 noundef %m) local_unnamed_addr #7 {
entry:
%0 = or i64 %r, %n
%or.cond.not = icmp slt i64 %0, 0
%cmp3 = icmp slt i64 %n, %r
%or.cond = or i1 %cmp3, %or.cond.not
br i1 %or.cond, label %return, label %if.end
if.end: ; preds = %entry
%arrayidx = getelementptr inbounds [3145728 x i64], ptr @frac, i64 0, i64 %n
%1 = load i64, ptr %arrayidx, align 8, !tbaa !8
%arrayidx4 = getelementptr inbounds [3145728 x i64], ptr @invf, i64 0, i64 %r
%2 = load i64, ptr %arrayidx4, align 8, !tbaa !8
%sub = sub nsw i64 %n, %r
%arrayidx5 = getelementptr inbounds [3145728 x i64], ptr @invf, i64 0, i64 %sub
%3 = load i64, ptr %arrayidx5, align 8, !tbaa !8
%mul = mul i64 %3, %2
%rem = urem i64 %mul, %m
%mul6 = mul i64 %rem, %1
%rem7 = urem i64 %mul6, %m
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i64 [ %rem7, %if.end ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #8 {
entry:
%0 = load i64, ptr @a, align 16, !tbaa !8
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %0)
%1 = load i64, ptr @end, align 8, !tbaa !8
%inc = add i64 %1, 1
store i64 %inc, ptr @end, align 8, !tbaa !8
%arrayidx = getelementptr inbounds [1048576 x %struct.p], ptr @stack, i64 0, i64 %1
%2 = load i64, ptr @a, align 16, !tbaa !8
%conv = sitofp i64 %2 to double
%3 = load i64, ptr @b, align 16, !tbaa !8
store double %conv, ptr %arrayidx, align 16, !tbaa.struct !23
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8
store i64 %3, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !18
%4 = load i64, ptr @k, align 8, !tbaa !8
%conv2 = sitofp i64 %3 to double
%mul = fmul double %conv, %conv2
store double %mul, ptr @vt, align 8, !tbaa !13
%5 = load i64, ptr @n, align 8, !tbaa !8
%cmp154 = icmp sgt i64 %5, 1
br i1 %cmp154, label %while.cond.preheader.preheader, label %for.end
while.cond.preheader.preheader: ; preds = %entry
%beg.promoted.pre = load i64, ptr @beg, align 8, !tbaa !8
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.preheader, %for.inc
%vt.promoted = phi double [ %20, %for.inc ], [ %mul, %while.cond.preheader.preheader ]
%beg.promoted = phi i64 [ %22, %for.inc ], [ %beg.promoted.pre, %while.cond.preheader.preheader ]
%i.0156 = phi i64 [ %inc109, %for.inc ], [ 1, %while.cond.preheader.preheader ]
%sum.0155 = phi i64 [ %add, %for.inc ], [ %4, %while.cond.preheader.preheader ]
%6 = load i64, ptr @k, align 8, !tbaa !8
%arrayidx4 = getelementptr inbounds [1048581 x i64], ptr @b, i64 0, i64 %i.0156
%7 = load i64, ptr %arrayidx4, align 8, !tbaa !8
%sub = sub nsw i64 %6, %7
%cmp5143 = icmp sgt i64 %sum.0155, %sub
br i1 %cmp5143, label %while.body, label %while.end
while.body: ; preds = %while.cond.preheader, %if.end
%sum.1145 = phi i64 [ %sub9, %if.end ], [ %sum.0155, %while.cond.preheader ]
%inc36142144 = phi i64 [ %inc36, %if.end ], [ %beg.promoted, %while.cond.preheader ]
%8 = phi double [ %13, %if.end ], [ %vt.promoted, %while.cond.preheader ]
%arrayidx7 = getelementptr inbounds [1048576 x %struct.p], ptr @stack, i64 0, i64 %inc36142144
%b8 = getelementptr inbounds [1048576 x %struct.p], ptr @stack, i64 0, i64 %inc36142144, i32 1
%9 = load i64, ptr %b8, align 8, !tbaa !24
%sub9 = sub i64 %sum.1145, %9
%cmp12.not = icmp ugt i64 %sub9, %sub
br i1 %cmp12.not, label %if.end, label %if.end.thread
if.end.thread: ; preds = %while.body
%sub17 = sub nsw i64 %sum.1145, %sub
%10 = load double, ptr %arrayidx7, align 16, !tbaa !26
%conv20 = sitofp i64 %sub17 to double
%neg = fneg double %10
%11 = tail call double @llvm.fmuladd.f64(double %neg, double %conv20, double %8)
%sub25 = sub i64 %9, %sub17
store i64 %sub25, ptr %b8, align 8, !tbaa !24
store double %11, ptr @vt, align 8
br label %while.end
if.end: ; preds = %while.body
%12 = load double, ptr %arrayidx7, align 16, !tbaa !26
%conv30 = uitofp i64 %9 to double
%neg32 = fneg double %12
%13 = tail call double @llvm.fmuladd.f64(double %neg32, double %conv30, double %8)
%inc36 = add i64 %inc36142144, 1
store i64 %inc36, ptr @beg, align 8, !tbaa !8
store double %13, ptr @vt, align 8
%cmp5 = icmp sgt i64 %sub9, %sub
br i1 %cmp5, label %while.body, label %while.end, !llvm.loop !27
while.end: ; preds = %if.end, %if.end.thread, %while.cond.preheader
%14 = phi double [ %vt.promoted, %while.cond.preheader ], [ %11, %if.end.thread ], [ %13, %if.end ]
%sum.1.lcssa = phi i64 [ %sum.0155, %while.cond.preheader ], [ %sub, %if.end.thread ], [ %sub9, %if.end ]
%arrayidx37 = getelementptr inbounds [1048581 x i64], ptr @a, i64 0, i64 %i.0156
%15 = load i64, ptr %arrayidx37, align 8, !tbaa !8
%conv38 = sitofp i64 %15 to double
%conv40 = sitofp i64 %7 to double
%16 = tail call double @llvm.fmuladd.f64(double %conv38, double %conv40, double %14)
%conv42 = sitofp i64 %6 to double
%div = fdiv double %16, %conv42
%call43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div)
%17 = load i64, ptr %arrayidx37, align 8, !tbaa !8
%conv45 = sitofp i64 %17 to double
%18 = load i64, ptr %arrayidx4, align 8, !tbaa !8
%conv47 = sitofp i64 %18 to double
%19 = load double, ptr @vt, align 8, !tbaa !13
%20 = tail call double @llvm.fmuladd.f64(double %conv45, double %conv47, double %19)
store double %20, ptr @vt, align 8, !tbaa !13
%add = add nsw i64 %18, %sum.1.lcssa
%21 = load i64, ptr @end, align 8, !tbaa !8
%arrayidx50 = getelementptr inbounds [1048576 x %struct.p], ptr @stack, i64 0, i64 %21
store double %conv45, ptr %arrayidx50, align 16, !tbaa.struct !23
%.compoundliteral51.sroa.2.0.arrayidx50.sroa_idx = getelementptr inbounds i8, ptr %arrayidx50, i64 8
store i64 %18, ptr %.compoundliteral51.sroa.2.0.arrayidx50.sroa_idx, align 8, !tbaa.struct !18
%inc57 = add i64 %21, 1
%22 = load i64, ptr @beg, align 8, !tbaa !8
%sub59149 = sub i64 %inc57, %22
%cmp60150 = icmp ugt i64 %sub59149, 1
br i1 %cmp60150, label %land.rhs, label %for.inc
land.rhs: ; preds = %while.end, %while.body70
%23 = phi double [ %div99, %while.body70 ], [ %conv45, %while.end ]
%storemerge151 = phi i64 [ %sub65, %while.body70 ], [ %inc57, %while.end ]
%sub62 = add i64 %storemerge151, -2
%arrayidx63 = getelementptr inbounds [1048576 x %struct.p], ptr @stack, i64 0, i64 %sub62
%24 = load double, ptr %arrayidx63, align 16, !tbaa !26
%cmp68 = fcmp ogt double %24, %23
br i1 %cmp68, label %while.body70, label %for.inc
while.body70: ; preds = %land.rhs
%sub65 = add i64 %storemerge151, -1
%b80 = getelementptr inbounds [1048576 x %struct.p], ptr @stack, i64 0, i64 %sub62, i32 1
%25 = load i64, ptr %b80, align 8, !tbaa !24
%conv81 = uitofp i64 %25 to double
%b88 = getelementptr inbounds [1048576 x %struct.p], ptr @stack, i64 0, i64 %sub65, i32 1
%26 = load i64, ptr %b88, align 8, !tbaa !24
%conv89 = uitofp i64 %26 to double
%mul90 = fmul double %23, %conv89
%27 = tail call double @llvm.fmuladd.f64(double %24, double %conv81, double %mul90)
%add97 = add i64 %26, %25
%conv98 = uitofp i64 %add97 to double
%div99 = fdiv double %27, %conv98
store double %div99, ptr %arrayidx63, align 16, !tbaa.struct !23
store i64 %add97, ptr %b80, align 8, !tbaa.struct !18
%sub59 = sub i64 %sub65, %22
%cmp60 = icmp ugt i64 %sub59, 1
br i1 %cmp60, label %land.rhs, label %for.inc, !llvm.loop !28
for.inc: ; preds = %while.body70, %land.rhs, %while.end
%storemerge.lcssa = phi i64 [ %inc57, %while.end ], [ %storemerge151, %land.rhs ], [ %sub65, %while.body70 ]
store i64 %storemerge.lcssa, ptr @end, align 8, !tbaa !8
%inc109 = add nuw nsw i64 %i.0156, 1
%28 = load i64, ptr @n, align 8, !tbaa !8
%cmp = icmp slt i64 %inc109, %28
br i1 %cmp, label %while.cond.preheader, label %for.end, !llvm.loop !29
for.end: ; preds = %for.inc, %entry
ret i64 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #10
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #8 {
entry:
store i64 4, ptr @n, align 8, !tbaa !8
store i64 0, ptr @m, align 8, !tbaa !8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @n, ptr noundef nonnull @m)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull @k, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !8
%cmp11 = icmp sgt i64 %0, 0
br i1 %cmp11, 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 [1048581 x i64], ptr @a, i64 0, i64 %indvars.iv
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx)
%arrayidx5 = getelementptr inbounds [1048581 x i64], ptr @b, i64 0, i64 %indvars.iv
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i64, ptr @n, align 8, !tbaa !8
%cmp = icmp sgt i64 %1, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !30
for.end: ; preds = %for.body, %entry
%call7 = tail call i64 @solve()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.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.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 speculatable willreturn memory(none) }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8}
!18 = !{i64 0, i64 8, !8}
!19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8}
!20 = !{i64 0, i64 8, !13, i64 8, i64 8, !13}
!21 = !{i64 0, i64 8, !13}
!22 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8}
!23 = !{i64 0, i64 8, !13, i64 8, i64 8, !8}
!24 = !{!25, !9, i64 8}
!25 = !{!"", !14, i64 0, !9, i64 8}
!26 = !{!25, !14, i64 0}
!27 = distinct !{!27, !6}
!28 = distinct !{!28, !6}
!29 = distinct !{!29, !6}
!30 = distinct !{!30, !6}
|
#include<stdio.h>
#include<stdbool.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
const int INF = 100000000;
int main(){
int n, m, x, a[13][13], c[13];
scanf("%d%d%d",&n,&m,&x);
rep(i,n) {
scanf("%d",&c[i]);
rep(j,m) scanf("%d",&a[i][j]);
}
int ans = INF;
rep(s,1<<n) {
int cost = 0;
int d[13] = {0};
rep(i,n) {
if (s>>i&1) {//ビット演算子を用いて二進数的に事象を調べ上げる
cost += c[i];
rep(j,m) {
d[j] += a[i][j];
}
}
}//各事象のコストの和と理解度の和を求める
//printf("%d\n",cost);
bool ok = true;
rep(j,m) {
//printf("%d\n",d[j]);
if (d[j] < x) {
ok = false;
break;
}
}//調べたものが条件を満たしているかを判定する
if((ok) && (cost < ans)) ans = cost;
//もし最安値を更新したらansに代入
}
if (ans == INF) printf("%d",-1);
else printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234565/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234565/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@INF = dso_local local_unnamed_addr constant i32 100000000, align 4
@.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
%m = alloca i32, align 4
%x = alloca i32, align 4
%a = alloca [13 x [13 x i32]], align 16
%c = alloca [13 x i32], align 16
%d = alloca [13 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 676, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %x)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp97 = icmp sgt i32 %0, 0
br i1 %cmp97, label %for.body, label %for.body17.lr.ph.thread
for.body17.lr.ph.thread: ; preds = %entry
%shl224 = shl nuw nsw i32 1, %0
%1 = load i32, ptr %m, align 4
%.fr231 = freeze i32 %1
%cmp45.not105232 = icmp sgt i32 %.fr231, 0
%2 = load i32, ptr %x, align 4
br i1 %cmp45.not105232, label %for.body17.us128.preheader, label %if.else
for.cond14.preheader: ; preds = %for.cond.cleanup4
%shl = shl nuw i32 1, %37
%cmp15107.not = icmp eq i32 %37, 31
br i1 %cmp15107.not, label %if.then65, label %for.body17.lr.ph
for.body17.lr.ph: ; preds = %for.cond14.preheader
%cmp20101 = icmp sgt i32 %37, 0
%3 = load i32, ptr %m, align 4
%.fr = freeze i32 %3
%cmp45.not105 = icmp sgt i32 %.fr, 0
%4 = load i32, ptr %x, align 4
br i1 %cmp20101, label %for.body17.lr.ph.split.us, label %for.body17.lr.ph.split
for.body17.lr.ph.split.us: ; preds = %for.body17.lr.ph
%cmp2799 = icmp sgt i32 %.fr, 0
%smax221 = call i32 @llvm.smax.i32(i32 %shl, i32 1)
%wide.trip.count214 = zext i32 %37 to i64
br i1 %cmp2799, label %for.body17.us.us.preheader, label %for.body17.us.preheader
for.body17.us.preheader: ; preds = %for.body17.lr.ph.split.us
%xtraiter255 = and i64 %wide.trip.count214, 1
%5 = icmp eq i32 %37, 1
%unroll_iter258 = and i64 %wide.trip.count214, 4294967294
%lcmp.mod256.not = icmp eq i64 %xtraiter255, 0
br label %for.body17.us
for.body17.us.us.preheader: ; preds = %for.body17.lr.ph.split.us
%wide.trip.count209 = zext i32 %.fr to i64
%wide.trip.count219 = zext i32 %.fr to i64
%min.iters.check = icmp ult i32 %.fr, 8
%n.vec = and i64 %wide.trip.count209, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count209
br label %for.body17.us.us
for.body17.us.us: ; preds = %for.body17.us.us.preheader, %if.end59.us.us
%s.0109.us.us = phi i32 [ %inc61.us.us, %if.end59.us.us ], [ 0, %for.body17.us.us.preheader ]
%ans.0108.us.us = phi i32 [ %ans.1.us.us, %if.end59.us.us ], [ 100000000, %for.body17.us.us.preheader ]
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %d) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %d, i8 0, i64 52, i1 false)
br label %for.body22.us.us.us
for.cond44.us.us: ; preds = %for.body47.us.us
%indvars.iv.next217 = add nuw nsw i64 %indvars.iv216, 1
%exitcond220.not = icmp eq i64 %indvars.iv.next217, %wide.trip.count219
br i1 %exitcond220.not, label %land.lhs.true.critedge.us.us, label %for.body47.us.us, !llvm.loop !9
land.lhs.true.critedge.us.us: ; preds = %for.cond44.us.us, %for.cond19.for.cond44.preheader_crit_edge.split.us.us.us
%spec.select.us.us = call i32 @llvm.smin.i32(i32 %cost.1.us.us.us, i32 %ans.0108.us.us)
br label %if.end59.us.us
for.body47.us.us: ; preds = %for.cond19.for.cond44.preheader_crit_edge.split.us.us.us, %for.cond44.us.us
%indvars.iv216 = phi i64 [ %indvars.iv.next217, %for.cond44.us.us ], [ 0, %for.cond19.for.cond44.preheader_crit_edge.split.us.us.us ]
%arrayidx49.us.us = getelementptr inbounds [13 x i32], ptr %d, i64 0, i64 %indvars.iv216
%6 = load i32, ptr %arrayidx49.us.us, align 4, !tbaa !5
%cmp50.us.us = icmp slt i32 %6, %4
br i1 %cmp50.us.us, label %if.end59.us.us, label %for.cond44.us.us
if.end59.us.us: ; preds = %for.body47.us.us, %land.lhs.true.critedge.us.us
%ans.1.us.us = phi i32 [ %spec.select.us.us, %land.lhs.true.critedge.us.us ], [ %ans.0108.us.us, %for.body47.us.us ]
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %d) #5
%inc61.us.us = add nuw nsw i32 %s.0109.us.us, 1
%exitcond222.not = icmp eq i32 %inc61.us.us, %smax221
br i1 %exitcond222.not, label %for.cond.cleanup16, label %for.body17.us.us, !llvm.loop !11
for.body22.us.us.us: ; preds = %for.inc40.us.us.us, %for.body17.us.us
%indvars.iv211 = phi i64 [ %indvars.iv.next212, %for.inc40.us.us.us ], [ 0, %for.body17.us.us ]
%cost.0102.us.us.us = phi i32 [ %cost.1.us.us.us, %for.inc40.us.us.us ], [ 0, %for.body17.us.us ]
%7 = trunc i64 %indvars.iv211 to i32
%8 = shl nuw i32 1, %7
%9 = and i32 %8, %s.0109.us.us
%tobool.not.us.us.us = icmp eq i32 %9, 0
br i1 %tobool.not.us.us.us, label %for.inc40.us.us.us, label %if.then.us.us.us
if.then.us.us.us: ; preds = %for.body22.us.us.us
%arrayidx24.us.us.us = getelementptr inbounds [13 x i32], ptr %c, i64 0, i64 %indvars.iv211
%10 = load i32, ptr %arrayidx24.us.us.us, align 4, !tbaa !5
br i1 %min.iters.check, label %for.body29.us.us.us.preheader, label %vector.body
vector.body: ; preds = %if.then.us.us.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %if.then.us.us.us ]
%11 = getelementptr inbounds [13 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv211, i64 %index
%wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5
%12 = getelementptr inbounds i32, ptr %11, i64 4
%wide.load249 = load <4 x i32>, ptr %12, align 4, !tbaa !5
%13 = getelementptr inbounds [13 x i32], ptr %d, i64 0, i64 %index
%wide.load250 = load <4 x i32>, ptr %13, align 16, !tbaa !5
%14 = getelementptr inbounds i32, ptr %13, i64 4
%wide.load251 = load <4 x i32>, ptr %14, align 16, !tbaa !5
%15 = add nsw <4 x i32> %wide.load250, %wide.load
%16 = add nsw <4 x i32> %wide.load251, %wide.load249
store <4 x i32> %15, ptr %13, align 16, !tbaa !5
store <4 x i32> %16, ptr %14, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.inc40.us.us.us.loopexit, label %for.body29.us.us.us.preheader
for.body29.us.us.us.preheader: ; preds = %if.then.us.us.us, %middle.block
%indvars.iv206.ph = phi i64 [ 0, %if.then.us.us.us ], [ %n.vec, %middle.block ]
br label %for.body29.us.us.us
for.body29.us.us.us: ; preds = %for.body29.us.us.us.preheader, %for.body29.us.us.us
%indvars.iv206 = phi i64 [ %indvars.iv.next207, %for.body29.us.us.us ], [ %indvars.iv206.ph, %for.body29.us.us.us.preheader ]
%arrayidx33.us.us.us = getelementptr inbounds [13 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv211, i64 %indvars.iv206
%18 = load i32, ptr %arrayidx33.us.us.us, align 4, !tbaa !5
%arrayidx35.us.us.us = getelementptr inbounds [13 x i32], ptr %d, i64 0, i64 %indvars.iv206
%19 = load i32, ptr %arrayidx35.us.us.us, align 4, !tbaa !5
%add36.us.us.us = add nsw i32 %19, %18
store i32 %add36.us.us.us, ptr %arrayidx35.us.us.us, align 4, !tbaa !5
%indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1
%exitcond210.not = icmp eq i64 %indvars.iv.next207, %wide.trip.count209
br i1 %exitcond210.not, label %for.inc40.us.us.us.loopexit, label %for.body29.us.us.us, !llvm.loop !15
for.inc40.us.us.us.loopexit: ; preds = %for.body29.us.us.us, %middle.block
%add.us.us.us = add nsw i32 %10, %cost.0102.us.us.us
br label %for.inc40.us.us.us
for.inc40.us.us.us: ; preds = %for.inc40.us.us.us.loopexit, %for.body22.us.us.us
%cost.1.us.us.us = phi i32 [ %cost.0102.us.us.us, %for.body22.us.us.us ], [ %add.us.us.us, %for.inc40.us.us.us.loopexit ]
%indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
%exitcond215.not = icmp eq i64 %indvars.iv.next212, %wide.trip.count214
br i1 %exitcond215.not, label %for.cond19.for.cond44.preheader_crit_edge.split.us.us.us, label %for.body22.us.us.us, !llvm.loop !16
for.cond19.for.cond44.preheader_crit_edge.split.us.us.us: ; preds = %for.inc40.us.us.us
br i1 %cmp45.not105, label %for.body47.us.us, label %land.lhs.true.critedge.us.us
for.body17.us: ; preds = %for.body17.us.preheader, %for.cond19.for.cond44.preheader_crit_edge.split.us124
%s.0109.us = phi i32 [ %inc61.us, %for.cond19.for.cond44.preheader_crit_edge.split.us124 ], [ 0, %for.body17.us.preheader ]
%ans.0108.us = phi i32 [ %spec.select.us, %for.cond19.for.cond44.preheader_crit_edge.split.us124 ], [ 100000000, %for.body17.us.preheader ]
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %d) #5
br i1 %5, label %for.cond19.for.cond44.preheader_crit_edge.split.us124.unr-lcssa, label %for.body22.us112
for.body22.us112: ; preds = %for.body17.us, %for.inc40.us120.1
%indvars.iv187 = phi i64 [ %indvars.iv.next188.1, %for.inc40.us120.1 ], [ 0, %for.body17.us ]
%cost.0102.us114 = phi i32 [ %cost.1.us121.1, %for.inc40.us120.1 ], [ 0, %for.body17.us ]
%niter259 = phi i64 [ %niter259.next.1, %for.inc40.us120.1 ], [ 0, %for.body17.us ]
%20 = trunc i64 %indvars.iv187 to i32
%21 = shl nuw i32 1, %20
%22 = and i32 %21, %s.0109.us
%tobool.not.us115 = icmp eq i32 %22, 0
br i1 %tobool.not.us115, label %for.inc40.us120, label %if.then.us116
if.then.us116: ; preds = %for.body22.us112
%arrayidx24.us118 = getelementptr inbounds [13 x i32], ptr %c, i64 0, i64 %indvars.iv187
%23 = load i32, ptr %arrayidx24.us118, align 8, !tbaa !5
%add.us119 = add nsw i32 %23, %cost.0102.us114
br label %for.inc40.us120
for.inc40.us120: ; preds = %if.then.us116, %for.body22.us112
%cost.1.us121 = phi i32 [ %cost.0102.us114, %for.body22.us112 ], [ %add.us119, %if.then.us116 ]
%indvars.iv.next188 = or i64 %indvars.iv187, 1
%24 = trunc i64 %indvars.iv.next188 to i32
%25 = shl nuw i32 1, %24
%26 = and i32 %25, %s.0109.us
%tobool.not.us115.1 = icmp eq i32 %26, 0
br i1 %tobool.not.us115.1, label %for.inc40.us120.1, label %if.then.us116.1
if.then.us116.1: ; preds = %for.inc40.us120
%arrayidx24.us118.1 = getelementptr inbounds [13 x i32], ptr %c, i64 0, i64 %indvars.iv.next188
%27 = load i32, ptr %arrayidx24.us118.1, align 4, !tbaa !5
%add.us119.1 = add nsw i32 %27, %cost.1.us121
br label %for.inc40.us120.1
for.inc40.us120.1: ; preds = %if.then.us116.1, %for.inc40.us120
%cost.1.us121.1 = phi i32 [ %cost.1.us121, %for.inc40.us120 ], [ %add.us119.1, %if.then.us116.1 ]
%indvars.iv.next188.1 = add nuw nsw i64 %indvars.iv187, 2
%niter259.next.1 = add i64 %niter259, 2
%niter259.ncmp.1 = icmp eq i64 %niter259.next.1, %unroll_iter258
br i1 %niter259.ncmp.1, label %for.cond19.for.cond44.preheader_crit_edge.split.us124.unr-lcssa, label %for.body22.us112, !llvm.loop !16
for.cond19.for.cond44.preheader_crit_edge.split.us124.unr-lcssa: ; preds = %for.inc40.us120.1, %for.body17.us
%cost.1.us121.lcssa.ph = phi i32 [ undef, %for.body17.us ], [ %cost.1.us121.1, %for.inc40.us120.1 ]
%indvars.iv187.unr = phi i64 [ 0, %for.body17.us ], [ %indvars.iv.next188.1, %for.inc40.us120.1 ]
%cost.0102.us114.unr = phi i32 [ 0, %for.body17.us ], [ %cost.1.us121.1, %for.inc40.us120.1 ]
br i1 %lcmp.mod256.not, label %for.cond19.for.cond44.preheader_crit_edge.split.us124, label %for.body22.us112.epil
for.body22.us112.epil: ; preds = %for.cond19.for.cond44.preheader_crit_edge.split.us124.unr-lcssa
%28 = trunc i64 %indvars.iv187.unr to i32
%29 = shl nuw i32 1, %28
%30 = and i32 %29, %s.0109.us
%tobool.not.us115.epil = icmp eq i32 %30, 0
br i1 %tobool.not.us115.epil, label %for.cond19.for.cond44.preheader_crit_edge.split.us124, label %if.then.us116.epil
if.then.us116.epil: ; preds = %for.body22.us112.epil
%arrayidx24.us118.epil = getelementptr inbounds [13 x i32], ptr %c, i64 0, i64 %indvars.iv187.unr
%31 = load i32, ptr %arrayidx24.us118.epil, align 4, !tbaa !5
%add.us119.epil = add nsw i32 %31, %cost.0102.us114.unr
br label %for.cond19.for.cond44.preheader_crit_edge.split.us124
for.cond19.for.cond44.preheader_crit_edge.split.us124: ; preds = %for.body22.us112.epil, %if.then.us116.epil, %for.cond19.for.cond44.preheader_crit_edge.split.us124.unr-lcssa
%cost.1.us121.lcssa = phi i32 [ %cost.1.us121.lcssa.ph, %for.cond19.for.cond44.preheader_crit_edge.split.us124.unr-lcssa ], [ %cost.0102.us114.unr, %for.body22.us112.epil ], [ %add.us119.epil, %if.then.us116.epil ]
%spec.select.us = call i32 @llvm.smin.i32(i32 %cost.1.us121.lcssa, i32 %ans.0108.us)
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %d) #5
%inc61.us = add nuw nsw i32 %s.0109.us, 1
%exitcond193.not = icmp eq i32 %inc61.us, %smax221
br i1 %exitcond193.not, label %for.cond.cleanup16, label %for.body17.us, !llvm.loop !11
for.body17.lr.ph.split: ; preds = %for.body17.lr.ph
br i1 %cmp45.not105, label %for.body17.us128.preheader, label %if.else
for.body17.us128.preheader: ; preds = %for.body17.lr.ph.thread, %for.body17.lr.ph.split
%shl227233238 = phi i32 [ %shl224, %for.body17.lr.ph.thread ], [ %shl, %for.body17.lr.ph.split ]
%.fr234236 = phi i32 [ %.fr231, %for.body17.lr.ph.thread ], [ %.fr, %for.body17.lr.ph.split ]
%32 = phi i32 [ %2, %for.body17.lr.ph.thread ], [ %4, %for.body17.lr.ph.split ]
%smax185 = call i32 @llvm.smax.i32(i32 %shl227233238, i32 1)
%wide.trip.count = zext i32 %.fr234236 to i64
%xtraiter = and i32 %smax185, 1
%33 = icmp slt i32 %shl227233238, 2
br i1 %33, label %for.cond.cleanup16.loopexit253.unr-lcssa, label %for.body17.us128.preheader.new
for.body17.us128.preheader.new: ; preds = %for.body17.us128.preheader
%unroll_iter = and i32 %smax185, 2147483646
br label %for.body17.us128
for.body17.us128: ; preds = %if.end59.us141.1, %for.body17.us128.preheader.new
%ans.0108.us130 = phi i32 [ 100000000, %for.body17.us128.preheader.new ], [ %ans.1.us142.1, %if.end59.us141.1 ]
%niter = phi i32 [ 0, %for.body17.us128.preheader.new ], [ %niter.next.1, %if.end59.us141.1 ]
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %d) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %d, i8 0, i64 52, i1 false)
br label %for.body47.us135
for.cond44.us131: ; preds = %for.body47.us135
%indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
%exitcond184.not = icmp eq i64 %indvars.iv.next182, %wide.trip.count
br i1 %exitcond184.not, label %if.end59.us141, label %for.body47.us135, !llvm.loop !9
for.body47.us135: ; preds = %for.body17.us128, %for.cond44.us131
%indvars.iv181 = phi i64 [ 0, %for.body17.us128 ], [ %indvars.iv.next182, %for.cond44.us131 ]
%arrayidx49.us138 = getelementptr inbounds [13 x i32], ptr %d, i64 0, i64 %indvars.iv181
%34 = load i32, ptr %arrayidx49.us138, align 4, !tbaa !5
%cmp50.us139 = icmp slt i32 %34, %32
br i1 %cmp50.us139, label %if.end59.us141, label %for.cond44.us131
if.end59.us141: ; preds = %for.cond44.us131, %for.body47.us135
%ans.1.us142 = phi i32 [ %ans.0108.us130, %for.body47.us135 ], [ 0, %for.cond44.us131 ]
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %d) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %d, i8 0, i64 52, i1 false)
br label %for.body47.us135.1
for.body47.us135.1: ; preds = %for.cond44.us131.1, %if.end59.us141
%indvars.iv181.1 = phi i64 [ 0, %if.end59.us141 ], [ %indvars.iv.next182.1, %for.cond44.us131.1 ]
%arrayidx49.us138.1 = getelementptr inbounds [13 x i32], ptr %d, i64 0, i64 %indvars.iv181.1
%35 = load i32, ptr %arrayidx49.us138.1, align 4, !tbaa !5
%cmp50.us139.1 = icmp slt i32 %35, %32
br i1 %cmp50.us139.1, label %if.end59.us141.1, label %for.cond44.us131.1
for.cond44.us131.1: ; preds = %for.body47.us135.1
%indvars.iv.next182.1 = add nuw nsw i64 %indvars.iv181.1, 1
%exitcond184.not.1 = icmp eq i64 %indvars.iv.next182.1, %wide.trip.count
br i1 %exitcond184.not.1, label %if.end59.us141.1, label %for.body47.us135.1, !llvm.loop !9
if.end59.us141.1: ; preds = %for.cond44.us131.1, %for.body47.us135.1
%ans.1.us142.1 = phi i32 [ %ans.1.us142, %for.body47.us135.1 ], [ 0, %for.cond44.us131.1 ]
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %d) #5
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup16.loopexit253.unr-lcssa, label %for.body17.us128, !llvm.loop !11
for.body: ; preds = %entry, %for.cond.cleanup4
%indvars.iv178 = phi i64 [ %indvars.iv.next179, %for.cond.cleanup4 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [13 x i32], ptr %c, i64 0, i64 %indvars.iv178
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%36 = load i32, ptr %m, align 4, !tbaa !5
%cmp395 = icmp sgt i32 %36, 0
br i1 %cmp395, label %for.body5, label %for.cond.cleanup4
for.cond.cleanup4: ; preds = %for.body5, %for.body
%indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
%37 = load i32, ptr %n, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp = icmp slt i64 %indvars.iv.next179, %38
br i1 %cmp, label %for.body, label %for.cond14.preheader, !llvm.loop !17
for.body5: ; preds = %for.body, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ]
%arrayidx9 = getelementptr inbounds [13 x [13 x i32]], ptr %a, i64 0, i64 %indvars.iv178, i64 %indvars.iv
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%39 = load i32, ptr %m, align 4, !tbaa !5
%40 = sext i32 %39 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %40
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !18
for.cond.cleanup16.loopexit253.unr-lcssa: ; preds = %if.end59.us141.1, %for.body17.us128.preheader
%ans.1.us142.lcssa.ph = phi i32 [ undef, %for.body17.us128.preheader ], [ %ans.1.us142.1, %if.end59.us141.1 ]
%ans.0108.us130.unr = phi i32 [ 100000000, %for.body17.us128.preheader ], [ %ans.1.us142.1, %if.end59.us141.1 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup16, label %for.body17.us128.epil
for.body17.us128.epil: ; preds = %for.cond.cleanup16.loopexit253.unr-lcssa
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %d) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %d, i8 0, i64 52, i1 false)
br label %for.body47.us135.epil
for.body47.us135.epil: ; preds = %for.cond44.us131.epil, %for.body17.us128.epil
%indvars.iv181.epil = phi i64 [ 0, %for.body17.us128.epil ], [ %indvars.iv.next182.epil, %for.cond44.us131.epil ]
%arrayidx49.us138.epil = getelementptr inbounds [13 x i32], ptr %d, i64 0, i64 %indvars.iv181.epil
%41 = load i32, ptr %arrayidx49.us138.epil, align 4, !tbaa !5
%cmp50.us139.epil = icmp slt i32 %41, %32
br i1 %cmp50.us139.epil, label %if.end59.us141.epil, label %for.cond44.us131.epil
for.cond44.us131.epil: ; preds = %for.body47.us135.epil
%indvars.iv.next182.epil = add nuw nsw i64 %indvars.iv181.epil, 1
%exitcond184.not.epil = icmp eq i64 %indvars.iv.next182.epil, %wide.trip.count
br i1 %exitcond184.not.epil, label %if.end59.us141.epil, label %for.body47.us135.epil, !llvm.loop !9
if.end59.us141.epil: ; preds = %for.cond44.us131.epil, %for.body47.us135.epil
%ans.1.us142.epil = phi i32 [ %ans.0108.us130.unr, %for.body47.us135.epil ], [ 0, %for.cond44.us131.epil ]
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %d) #5
br label %for.cond.cleanup16
for.cond.cleanup16: ; preds = %if.end59.us141.epil, %for.cond.cleanup16.loopexit253.unr-lcssa, %for.cond19.for.cond44.preheader_crit_edge.split.us124, %if.end59.us.us
%ans.0.lcssa = phi i32 [ %ans.1.us.us, %if.end59.us.us ], [ %spec.select.us, %for.cond19.for.cond44.preheader_crit_edge.split.us124 ], [ %ans.1.us142.lcssa.ph, %for.cond.cleanup16.loopexit253.unr-lcssa ], [ %ans.1.us142.epil, %if.end59.us141.epil ]
%cmp64 = icmp eq i32 %ans.0.lcssa, 100000000
br i1 %cmp64, label %if.then65, label %if.else
if.then65: ; preds = %for.cond14.preheader, %for.cond.cleanup16
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef -1)
br label %if.end68
if.else: ; preds = %for.body17.lr.ph.thread, %for.body17.lr.ph.split, %for.cond.cleanup16
%ans.0.lcssa244 = phi i32 [ %ans.0.lcssa, %for.cond.cleanup16 ], [ 0, %for.body17.lr.ph.split ], [ 0, %for.body17.lr.ph.thread ]
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa244)
br label %if.end68
if.end68: ; preds = %if.else, %if.then65
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 676, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10, !14, !13}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define SIZE 100
#define rep(i, N) for (i = 0; i < N; i++) //制御変数iを用いてN回転
#define array(N, t) ((t)*)calloc(N, sizeof(t)) //t型N要素の配列を動的確保後0クリア(freeを忘れずに)
#define zero(a); {int iter; rep(iter, sizeof(a)/sizeof((a)[0])) (a)[iter]=0;} //1次元配列aのゼロ初期化?
typedef long long ll;
void printa_int(int *a, int size); //int型の1次元配列aを出力(for debug)
int N, M, X;
int A[12][13];
int Prog[12];
int money(int idx) {
int i, min = -1, flag = 1;
rep(i, M) {
Prog[i] += A[idx][i + 1];
if (Prog[i] < X) flag = 0;
}
if (flag) {
rep(i, M) {
Prog[i] -= A[idx][i + 1];
}
return A[idx][0];
}
for (i = idx + 1; i < N; i++) {
int temp = money(i);
if (temp == -1) continue;
if (min == -1 || min > temp)
min = temp;
}
rep(i, M) {
Prog[i] -= A[idx][i + 1];
}
if (min != -1) min += A[idx][0];
return min;
}
int main() {
int i, j, min = -1;
scanf("%d %d %d", &N, &M, &X);
rep(i, N) {
scanf("%d", &A[i][0]);
rep(j, M) {
scanf("%d", &A[i][j + 1]);
}
}
rep(i, N) {
int temp = money(i);
if (temp == -1) continue;
if (min == -1 || min > temp)
min = temp;
}
printf("%d\n", min);
return 0;
}
void printa_int(int *a, int size) {
int i;
for (i = 0; i < size; i++)
printf("%d, ", a[i]);
printf("\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234608/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234608/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@M = dso_local global i32 0, align 4
@A = dso_local global [12 x [13 x i32]] zeroinitializer, align 16
@Prog = dso_local local_unnamed_addr global [12 x i32] zeroinitializer, align 16
@X = dso_local global i32 0, align 4
@N = dso_local global i32 0, align 4
@.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
@.str.3 = private unnamed_addr constant [5 x i8] c"%d, \00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @money(i32 noundef %idx) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @M, align 4, !tbaa !5
%cmp91 = icmp sgt i32 %0, 0
br i1 %cmp91, label %for.body.lr.ph, label %for.cond10.preheader.for.end22_crit_edge
for.body.lr.ph: ; preds = %entry
%idxprom = sext i32 %idx to i64
%1 = load i32, ptr @X, align 4, !tbaa !5
%wide.trip.count = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %for.body.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %11, %vector.body ]
%vec.phi117 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %12, %vector.body ]
%2 = or i64 %index, 1
%3 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom, i64 %2
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load118 = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr inbounds [12 x i32], ptr @Prog, i64 0, i64 %index
%wide.load119 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load120 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = add nsw <4 x i32> %wide.load119, %wide.load
%8 = add nsw <4 x i32> %wide.load120, %wide.load118
store <4 x i32> %7, ptr %5, align 16, !tbaa !5
store <4 x i32> %8, ptr %6, align 16, !tbaa !5
%9 = icmp slt <4 x i32> %7, %broadcast.splat
%10 = icmp slt <4 x i32> %8, %broadcast.splat
%11 = select <4 x i1> %9, <4 x i32> zeroinitializer, <4 x i32> %vec.phi
%12 = select <4 x i1> %10, <4 x i32> zeroinitializer, <4 x i32> %vec.phi117
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.select.cmp.not = icmp ne <4 x i32> %11, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp121153 = icmp ne <4 x i32> %12, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp121 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp121153
%14 = bitcast <4 x i1> %rdx.select.cmp121 to i4
%.not = icmp eq i4 %14, 0
%rdx.select122 = zext i1 %.not to i32
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.body.lr.ph, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ]
%flag.093.ph = phi i32 [ 1, %for.body.lr.ph ], [ %rdx.select122, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ]
%flag.093 = phi i32 [ %spec.select, %for.body ], [ %flag.093.ph, %for.body.preheader ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom, i64 %indvars.iv.next
%15 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx4 = getelementptr inbounds [12 x i32], ptr @Prog, i64 0, i64 %indvars.iv
%16 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%add5 = add nsw i32 %16, %15
store i32 %add5, ptr %arrayidx4, align 4, !tbaa !5
%cmp8 = icmp slt i32 %add5, %1
%spec.select = select i1 %cmp8, i32 0, i32 %flag.093
%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
%spec.select.lcssa = phi i32 [ %rdx.select122, %middle.block ], [ %spec.select, %for.body ]
%17 = icmp eq i32 %spec.select.lcssa, 0
br i1 %17, label %for.cond28.preheader, label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.end
br i1 %cmp91, label %for.body12.lr.ph, label %for.cond10.preheader.for.end22_crit_edge
for.cond10.preheader.for.end22_crit_edge: ; preds = %entry, %for.cond10.preheader
%.pre115 = sext i32 %idx to i64
br label %for.end22
for.body12.lr.ph: ; preds = %for.cond10.preheader
%idxprom13 = sext i32 %idx to i64
%wide.trip.count108 = zext i32 %0 to i64
%min.iters.check125 = icmp ult i32 %0, 8
br i1 %min.iters.check125, label %for.body12.preheader, label %vector.ph126
vector.ph126: ; preds = %for.body12.lr.ph
%n.vec128 = and i64 %wide.trip.count, 4294967288
br label %vector.body131
vector.body131: ; preds = %vector.body131, %vector.ph126
%index132 = phi i64 [ 0, %vector.ph126 ], [ %index.next137, %vector.body131 ]
%18 = or i64 %index132, 1
%19 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom13, i64 %18
%wide.load133 = load <4 x i32>, ptr %19, align 4, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
%wide.load134 = load <4 x i32>, ptr %20, align 4, !tbaa !5
%21 = getelementptr inbounds [12 x i32], ptr @Prog, i64 0, i64 %index132
%wide.load135 = load <4 x i32>, ptr %21, align 16, !tbaa !5
%22 = getelementptr inbounds i32, ptr %21, i64 4
%wide.load136 = load <4 x i32>, ptr %22, align 16, !tbaa !5
%23 = sub nsw <4 x i32> %wide.load135, %wide.load133
%24 = sub nsw <4 x i32> %wide.load136, %wide.load134
store <4 x i32> %23, ptr %21, align 16, !tbaa !5
store <4 x i32> %24, ptr %22, align 16, !tbaa !5
%index.next137 = add nuw i64 %index132, 8
%25 = icmp eq i64 %index.next137, %n.vec128
br i1 %25, label %middle.block123, label %vector.body131, !llvm.loop !14
middle.block123: ; preds = %vector.body131
%cmp.n130 = icmp eq i64 %n.vec128, %wide.trip.count
br i1 %cmp.n130, label %for.end22, label %for.body12.preheader
for.body12.preheader: ; preds = %for.body12.lr.ph, %middle.block123
%indvars.iv105.ph = phi i64 [ 0, %for.body12.lr.ph ], [ %n.vec128, %middle.block123 ]
br label %for.body12
for.cond28.preheader: ; preds = %for.end
%i.297 = add nsw i32 %idx, 1
%26 = load i32, ptr @N, align 4, !tbaa !5
%cmp2998 = icmp slt i32 %i.297, %26
br i1 %cmp2998, label %for.body30, label %for.cond41.preheader
for.body12: ; preds = %for.body12.preheader, %for.body12
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body12 ], [ %indvars.iv105.ph, %for.body12.preheader ]
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%arrayidx17 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom13, i64 %indvars.iv.next106
%27 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds [12 x i32], ptr @Prog, i64 0, i64 %indvars.iv105
%28 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%sub = sub nsw i32 %28, %27
store i32 %sub, ptr %arrayidx19, align 4, !tbaa !5
%exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108
br i1 %exitcond109.not, label %for.end22, label %for.body12, !llvm.loop !15
for.end22: ; preds = %for.body12, %middle.block123, %for.cond10.preheader.for.end22_crit_edge
%idxprom23.pre-phi = phi i64 [ %.pre115, %for.cond10.preheader.for.end22_crit_edge ], [ %idxprom13, %middle.block123 ], [ %idxprom13, %for.body12 ]
%arrayidx24 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom23.pre-phi
%29 = load i32, ptr %arrayidx24, align 4, !tbaa !5
br label %cleanup62
for.cond41.preheader.loopexit: ; preds = %for.body30
%.pre = load i32, ptr @M, align 4, !tbaa !5
br label %for.cond41.preheader
for.cond41.preheader: ; preds = %for.cond41.preheader.loopexit, %for.cond28.preheader
%30 = phi i32 [ %0, %for.cond28.preheader ], [ %.pre, %for.cond41.preheader.loopexit ]
%min.0.lcssa = phi i32 [ -1, %for.cond28.preheader ], [ %min.2, %for.cond41.preheader.loopexit ]
%cmp42102 = icmp sgt i32 %30, 0
br i1 %cmp42102, label %for.body43.lr.ph, label %for.end54
for.body43.lr.ph: ; preds = %for.cond41.preheader
%idxprom44 = sext i32 %idx to i64
%wide.trip.count113 = zext i32 %30 to i64
%min.iters.check140 = icmp ult i32 %30, 8
br i1 %min.iters.check140, label %for.body43.preheader, label %vector.ph141
vector.ph141: ; preds = %for.body43.lr.ph
%n.vec143 = and i64 %wide.trip.count113, 4294967288
br label %vector.body146
vector.body146: ; preds = %vector.body146, %vector.ph141
%index147 = phi i64 [ 0, %vector.ph141 ], [ %index.next152, %vector.body146 ]
%31 = or i64 %index147, 1
%32 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom44, i64 %31
%wide.load148 = load <4 x i32>, ptr %32, align 4, !tbaa !5
%33 = getelementptr inbounds i32, ptr %32, i64 4
%wide.load149 = load <4 x i32>, ptr %33, align 4, !tbaa !5
%34 = getelementptr inbounds [12 x i32], ptr @Prog, i64 0, i64 %index147
%wide.load150 = load <4 x i32>, ptr %34, align 16, !tbaa !5
%35 = getelementptr inbounds i32, ptr %34, i64 4
%wide.load151 = load <4 x i32>, ptr %35, align 16, !tbaa !5
%36 = sub nsw <4 x i32> %wide.load150, %wide.load148
%37 = sub nsw <4 x i32> %wide.load151, %wide.load149
store <4 x i32> %36, ptr %34, align 16, !tbaa !5
store <4 x i32> %37, ptr %35, align 16, !tbaa !5
%index.next152 = add nuw i64 %index147, 8
%38 = icmp eq i64 %index.next152, %n.vec143
br i1 %38, label %middle.block138, label %vector.body146, !llvm.loop !16
middle.block138: ; preds = %vector.body146
%cmp.n145 = icmp eq i64 %n.vec143, %wide.trip.count113
br i1 %cmp.n145, label %for.end54, label %for.body43.preheader
for.body43.preheader: ; preds = %for.body43.lr.ph, %middle.block138
%indvars.iv110.ph = phi i64 [ 0, %for.body43.lr.ph ], [ %n.vec143, %middle.block138 ]
br label %for.body43
for.body30: ; preds = %for.cond28.preheader, %for.body30
%i.2100 = phi i32 [ %i.2, %for.body30 ], [ %i.297, %for.cond28.preheader ]
%min.099 = phi i32 [ %min.2, %for.body30 ], [ -1, %for.cond28.preheader ]
%call = tail call i32 @money(i32 noundef %i.2100)
%cmp31 = icmp eq i32 %call, -1
%cmp34 = icmp eq i32 %min.099, -1
%cmp35 = icmp sgt i32 %min.099, %call
%or.cond = or i1 %cmp34, %cmp35
%min.1 = select i1 %or.cond, i32 %call, i32 %min.099
%min.2 = select i1 %cmp31, i32 %min.099, i32 %min.1
%i.2 = add nsw i32 %i.2100, 1
%39 = load i32, ptr @N, align 4, !tbaa !5
%cmp29 = icmp slt i32 %i.2, %39
br i1 %cmp29, label %for.body30, label %for.cond41.preheader.loopexit, !llvm.loop !17
for.body43: ; preds = %for.body43.preheader, %for.body43
%indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.body43 ], [ %indvars.iv110.ph, %for.body43.preheader ]
%indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
%arrayidx48 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom44, i64 %indvars.iv.next111
%40 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%arrayidx50 = getelementptr inbounds [12 x i32], ptr @Prog, i64 0, i64 %indvars.iv110
%41 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%sub51 = sub nsw i32 %41, %40
store i32 %sub51, ptr %arrayidx50, align 4, !tbaa !5
%exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count113
br i1 %exitcond114.not, label %for.end54, label %for.body43, !llvm.loop !18
for.end54: ; preds = %for.body43, %middle.block138, %for.cond41.preheader
%cmp55.not = icmp eq i32 %min.0.lcssa, -1
br i1 %cmp55.not, label %cleanup62, label %if.then56
if.then56: ; preds = %for.end54
%idxprom57 = sext i32 %idx to i64
%arrayidx58 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %idxprom57
%42 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%add60 = add nsw i32 %42, %min.0.lcssa
br label %cleanup62
cleanup62: ; preds = %for.end54, %if.then56, %for.end22
%retval.0 = phi i32 [ %29, %for.end22 ], [ %add60, %if.then56 ], [ -1, %for.end54 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @M, ptr noundef nonnull @X)
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp44 = icmp sgt i32 %0, 0
br i1 %cmp44, label %for.body, label %for.end25
for.cond14.preheader: ; preds = %for.inc11
%1 = icmp sgt i32 %5, 0
br i1 %1, label %for.body16, label %for.end25
for.body: ; preds = %entry, %for.inc11
%indvars.iv50 = phi i64 [ %indvars.iv.next51, %for.inc11 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %indvars.iv50
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr @M, align 4, !tbaa !5
%cmp442 = icmp sgt i32 %2, 0
br i1 %cmp442, label %for.body5, label %for.inc11
for.body5: ; preds = %for.body, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx9 = getelementptr inbounds [12 x [13 x i32]], ptr @A, i64 0, i64 %indvars.iv50, i64 %indvars.iv.next
%call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9)
%3 = load i32, ptr @M, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp4, label %for.body5, label %for.inc11, !llvm.loop !19
for.inc11: ; preds = %for.body5, %for.body
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%5 = load i32, ptr @N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next51, %6
br i1 %cmp, label %for.body, label %for.cond14.preheader, !llvm.loop !20
for.body16: ; preds = %for.cond14.preheader, %for.body16
%min.048 = phi i32 [ %min.2, %for.body16 ], [ -1, %for.cond14.preheader ]
%i.147 = phi i32 [ %inc24, %for.body16 ], [ 0, %for.cond14.preheader ]
%call17 = tail call i32 @money(i32 noundef %i.147)
%cmp18 = icmp eq i32 %call17, -1
%cmp19 = icmp eq i32 %min.048, -1
%cmp20 = icmp sgt i32 %min.048, %call17
%or.cond = or i1 %cmp19, %cmp20
%min.1 = select i1 %or.cond, i32 %call17, i32 %min.048
%min.2 = select i1 %cmp18, i32 %min.048, i32 %min.1
%inc24 = add nuw nsw i32 %i.147, 1
%7 = load i32, ptr @N, align 4, !tbaa !5
%cmp15 = icmp slt i32 %inc24, %7
br i1 %cmp15, label %for.body16, label %for.end25, !llvm.loop !21
for.end25: ; preds = %for.body16, %entry, %for.cond14.preheader
%min.0.lcssa = phi i32 [ -1, %for.cond14.preheader ], [ -1, %entry ], [ %min.2, %for.body16 ]
%call26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.0.lcssa)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @printa_int(ptr nocapture noundef readonly %a, i32 noundef %size) local_unnamed_addr #1 {
entry:
%cmp4 = icmp sgt i32 %size, 0
br i1 %cmp4, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %size to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !22
for.end: ; preds = %for.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10, !11, !12}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !12, !11}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define Rep(i,a,n)for(int i=(int)(a);i<(int)(n);i++)
#define rep(i,n)Rep(i,0,n)
int des(const void* a, const void* b) { return *(int*)b - *(int*)a;}
int main(){
int n,a[100009]={0},md=1e9;
scanf("%d",&n);
rep(i,n)scanf("%d",a+i);
qsort(a,n,sizeof(int),des);
if(n==2)md=a[1];
else rep(i,n)if(a[0]/2>a[i]){md=(a[i-1]-a[0]/2<=a[0]/2-a[i]?a[i-1]:a[i]);break;}
printf("%d %d",a[0],md);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234666/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234666/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%a = alloca [100009 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 400036, ptr nonnull %a) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400036) %a, i8 0, i64 400036, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre62 = sext i32 %0 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre62, %entry.for.cond.cleanup_crit_edge ], [ %3, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @des) #6
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp eq i32 %1, 2
br i1 %cmp3, label %if.then, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.cond.cleanup
%cmp752 = icmp sgt i32 %1, 0
%.pre61 = load i32, ptr %a, align 16, !tbaa !5
br i1 %cmp752, label %for.body10.lr.ph, label %if.end36
for.body10.lr.ph: ; preds = %for.cond6.preheader
%div = sdiv i32 %.pre61, 2
%wide.trip.count = zext i32 %1 to i64
br label %for.body10
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, 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.cond.cleanup, !llvm.loop !9
if.then: ; preds = %for.cond.cleanup
%arrayidx = getelementptr inbounds [100009 x i32], ptr %a, i64 0, i64 1
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%.pre = load i32, ptr %a, align 16, !tbaa !5
br label %if.end36
for.body10: ; preds = %for.body10.lr.ph, %for.inc33
%indvars.iv58 = phi i64 [ 0, %for.body10.lr.ph ], [ %indvars.iv.next59, %for.inc33 ]
%arrayidx12 = getelementptr inbounds [100009 x i32], ptr %a, i64 0, i64 %indvars.iv58
%5 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %div, %5
br i1 %cmp13, label %if.then15, label %for.inc33
if.then15: ; preds = %for.body10
%sub = shl i64 %indvars.iv58, 32
%sext = add i64 %sub, -4294967296
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds [100009 x i32], ptr %a, i64 0, i64 %idxprom16
%6 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%sub20 = sub nsw i32 %6, %div
%sub25 = sub nsw i32 %div, %5
%cmp26.not = icmp sgt i32 %sub20, %sub25
%. = select i1 %cmp26.not, i32 %5, i32 %6
br label %if.end36
for.inc33: ; preds = %for.body10
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count
br i1 %exitcond.not, label %if.end36, label %for.body10, !llvm.loop !11
if.end36: ; preds = %for.inc33, %for.cond6.preheader, %if.then15, %if.then
%7 = phi i32 [ %.pre, %if.then ], [ %.pre61, %if.then15 ], [ %.pre61, %for.cond6.preheader ], [ %.pre61, %for.inc33 ]
%md.1 = phi i32 [ %4, %if.then ], [ %., %if.then15 ], [ 1000000000, %for.cond6.preheader ], [ 1000000000, %for.inc33 ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %md.1)
call void @llvm.lifetime.end.p0(i64 400036, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree "no-trapping-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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#define N_MAX 100000
int main(void)
{
int i, j;
int Max = 0;
int N = 0;
scanf("%d", &N);
int list[N_MAX] = {0};
int save[N_MAX] = {0};
for (j = 0; j < N_MAX; j++){
list[j] = 2147483647;
save[j] = 2147483647;
}
for (i = 0; i < N; i++){
scanf("%d", &list[i]);
save[i] = list[i];
}
for (i = 0; i < N; i++){
if (list[i] > Max){
Max = list[i];
}
}
int Left = 0;
int Right = Max;
int Mid = 0;
for (i = 0; i < N; i++){
if (list[i] <= Max / 2){
if (list[i] > Left){
Left = list[i];
}
}else{
if (list[i] < Right){
Right = list[i];
}
}
}
if (Max/2 - Left < Right - Max/2){
Mid = Left;
}else if (Max/2 - Left > Right - Max/2){
Mid = Right;
}else if (Max % 2 == 0){
Mid = Left;
}else{
Mid = Right;
}
printf("%d %d\n", Max, Mid);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234709/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234709/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%list = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
store i32 0, ptr %N, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %list) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %list, i8 0, i64 400000, i1 false)
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.4, %vector.body ]
%0 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %index
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %0, align 16, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %1, align 16, !tbaa !5
%index.next = add nuw nsw i64 %index, 8
%2 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %index.next
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %3, align 16, !tbaa !5
%index.next.1 = add nuw nsw i64 %index, 16
%4 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %index.next.1
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %5, align 16, !tbaa !5
%index.next.2 = add nuw nsw i64 %index, 24
%6 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %index.next.2
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %7, align 16, !tbaa !5
%index.next.3 = add nuw nsw i64 %index, 32
%8 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %index.next.3
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %9, align 16, !tbaa !5
%index.next.4 = add nuw nsw i64 %index, 40
%10 = icmp eq i64 %index.next.4, 100000
br i1 %10, label %for.cond3.preheader, label %vector.body, !llvm.loop !9
for.cond3.preheader: ; preds = %vector.body
%11 = load i32, ptr %N, align 4, !tbaa !5
%cmp4112 = icmp sgt i32 %11, 0
br i1 %cmp4112, label %for.body5, label %for.cond27.preheader.for.end51_crit_edge
for.cond16.preheader: ; preds = %for.body5
%cmp17114 = icmp sgt i32 %18, 0
br i1 %cmp17114, label %for.body18.preheader, label %for.cond27.preheader.for.end51_crit_edge
for.body18.preheader: ; preds = %for.cond16.preheader
%wide.trip.count = zext i32 %18 to i64
%min.iters.check = icmp ult i32 %18, 8
br i1 %min.iters.check, label %for.body18.preheader156, label %vector.ph149
vector.ph149: ; preds = %for.body18.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body151
vector.body151: ; preds = %vector.body151, %vector.ph149
%index152 = phi i64 [ 0, %vector.ph149 ], [ %index.next155, %vector.body151 ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph149 ], [ %14, %vector.body151 ]
%vec.phi153 = phi <4 x i32> [ zeroinitializer, %vector.ph149 ], [ %15, %vector.body151 ]
%12 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %index152
%wide.load = load <4 x i32>, ptr %12, align 16, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
%wide.load154 = load <4 x i32>, ptr %13, align 16, !tbaa !5
%14 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
%15 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load154, <4 x i32> %vec.phi153)
%index.next155 = add nuw i64 %index152, 8
%16 = icmp eq i64 %index.next155, %n.vec
br i1 %16, label %middle.block147, label %vector.body151, !llvm.loop !13
middle.block147: ; preds = %vector.body151
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %14, <4 x i32> %15)
%17 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond27.preheader, label %for.body18.preheader156
for.body18.preheader156: ; preds = %for.body18.preheader, %middle.block147
%indvars.iv129.ph = phi i64 [ 0, %for.body18.preheader ], [ %n.vec, %middle.block147 ]
%Max.0116.ph = phi i32 [ 0, %for.body18.preheader ], [ %17, %middle.block147 ]
br label %for.body18
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %indvars.iv126
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%18 = load i32, ptr %N, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp4 = icmp slt i64 %indvars.iv.next127, %19
br i1 %cmp4, label %for.body5, label %for.cond16.preheader, !llvm.loop !14
for.cond27.preheader: ; preds = %for.body18, %middle.block147
%spec.select.lcssa = phi i32 [ %17, %middle.block147 ], [ %spec.select, %for.body18 ]
br i1 %cmp17114, label %for.body29.lr.ph, label %for.cond27.preheader.for.end51_crit_edge
for.cond27.preheader.for.end51_crit_edge: ; preds = %for.cond3.preheader, %for.cond16.preheader, %for.cond27.preheader
%Max.0.lcssa146 = phi i32 [ %spec.select.lcssa, %for.cond27.preheader ], [ 0, %for.cond16.preheader ], [ 0, %for.cond3.preheader ]
%.pre = lshr i32 %Max.0.lcssa146, 1
br label %for.end51
for.body29.lr.ph: ; preds = %for.cond27.preheader
%div108 = lshr i32 %spec.select.lcssa, 1
%xtraiter = and i64 %wide.trip.count, 1
%20 = icmp eq i32 %18, 1
br i1 %20, label %for.end51.loopexit.unr-lcssa, label %for.body29.lr.ph.new
for.body29.lr.ph.new: ; preds = %for.body29.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body29
for.body18: ; preds = %for.body18.preheader156, %for.body18
%indvars.iv129 = phi i64 [ %indvars.iv.next130, %for.body18 ], [ %indvars.iv129.ph, %for.body18.preheader156 ]
%Max.0116 = phi i32 [ %spec.select, %for.body18 ], [ %Max.0116.ph, %for.body18.preheader156 ]
%arrayidx20 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %indvars.iv129
%21 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %21, i32 %Max.0116)
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%exitcond132.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count
br i1 %exitcond132.not, label %for.cond27.preheader, label %for.body18, !llvm.loop !15
for.body29: ; preds = %for.body29, %for.body29.lr.ph.new
%indvars.iv133 = phi i64 [ 0, %for.body29.lr.ph.new ], [ %indvars.iv.next134.1, %for.body29 ]
%Right.0121 = phi i32 [ %spec.select.lcssa, %for.body29.lr.ph.new ], [ %Right.1.1, %for.body29 ]
%Left.0120 = phi i32 [ 0, %for.body29.lr.ph.new ], [ %Left.1.1, %for.body29 ]
%niter = phi i64 [ 0, %for.body29.lr.ph.new ], [ %niter.next.1, %for.body29 ]
%arrayidx31 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %indvars.iv133
%22 = load i32, ptr %arrayidx31, align 8, !tbaa !5
%cmp32.not = icmp sgt i32 %22, %div108
%spec.select109 = call i32 @llvm.smax.i32(i32 %22, i32 %Left.0120)
%spec.select110 = call i32 @llvm.smin.i32(i32 %22, i32 %Right.0121)
%Left.1 = select i1 %cmp32.not, i32 %Left.0120, i32 %spec.select109
%Right.1 = select i1 %cmp32.not, i32 %spec.select110, i32 %Right.0121
%indvars.iv.next134 = or i64 %indvars.iv133, 1
%arrayidx31.1 = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %indvars.iv.next134
%23 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5
%cmp32.not.1 = icmp sgt i32 %23, %div108
%spec.select109.1 = call i32 @llvm.smax.i32(i32 %23, i32 %Left.1)
%spec.select110.1 = call i32 @llvm.smin.i32(i32 %23, i32 %Right.1)
%Left.1.1 = select i1 %cmp32.not.1, i32 %Left.1, i32 %spec.select109.1
%Right.1.1 = select i1 %cmp32.not.1, i32 %spec.select110.1, i32 %Right.1
%indvars.iv.next134.1 = add nuw nsw i64 %indvars.iv133, 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.end51.loopexit.unr-lcssa, label %for.body29, !llvm.loop !16
for.end51.loopexit.unr-lcssa: ; preds = %for.body29, %for.body29.lr.ph
%Left.1.lcssa.ph = phi i32 [ undef, %for.body29.lr.ph ], [ %Left.1.1, %for.body29 ]
%Right.1.lcssa.ph = phi i32 [ undef, %for.body29.lr.ph ], [ %Right.1.1, %for.body29 ]
%indvars.iv133.unr = phi i64 [ 0, %for.body29.lr.ph ], [ %indvars.iv.next134.1, %for.body29 ]
%Right.0121.unr = phi i32 [ %spec.select.lcssa, %for.body29.lr.ph ], [ %Right.1.1, %for.body29 ]
%Left.0120.unr = phi i32 [ 0, %for.body29.lr.ph ], [ %Left.1.1, %for.body29 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end51, label %for.body29.epil
for.body29.epil: ; preds = %for.end51.loopexit.unr-lcssa
%arrayidx31.epil = getelementptr inbounds [100000 x i32], ptr %list, i64 0, i64 %indvars.iv133.unr
%24 = load i32, ptr %arrayidx31.epil, align 4, !tbaa !5
%cmp32.not.epil = icmp sgt i32 %24, %div108
%spec.select109.epil = call i32 @llvm.smax.i32(i32 %24, i32 %Left.0120.unr)
%spec.select110.epil = call i32 @llvm.smin.i32(i32 %24, i32 %Right.0121.unr)
%Left.1.epil = select i1 %cmp32.not.epil, i32 %Left.0120.unr, i32 %spec.select109.epil
%Right.1.epil = select i1 %cmp32.not.epil, i32 %spec.select110.epil, i32 %Right.0121.unr
br label %for.end51
for.end51: ; preds = %for.body29.epil, %for.end51.loopexit.unr-lcssa, %for.cond27.preheader.for.end51_crit_edge
%Max.0.lcssa145 = phi i32 [ %Max.0.lcssa146, %for.cond27.preheader.for.end51_crit_edge ], [ %spec.select.lcssa, %for.end51.loopexit.unr-lcssa ], [ %spec.select.lcssa, %for.body29.epil ]
%div52107.pre-phi = phi i32 [ %.pre, %for.cond27.preheader.for.end51_crit_edge ], [ %div108, %for.end51.loopexit.unr-lcssa ], [ %div108, %for.body29.epil ]
%Left.0.lcssa = phi i32 [ 0, %for.cond27.preheader.for.end51_crit_edge ], [ %Left.1.lcssa.ph, %for.end51.loopexit.unr-lcssa ], [ %Left.1.epil, %for.body29.epil ]
%Right.0.lcssa = phi i32 [ %Max.0.lcssa146, %for.cond27.preheader.for.end51_crit_edge ], [ %Right.1.lcssa.ph, %for.end51.loopexit.unr-lcssa ], [ %Right.1.epil, %for.body29.epil ]
%sub = sub nsw i32 %div52107.pre-phi, %Left.0.lcssa
%sub54 = sub nsw i32 %Right.0.lcssa, %div52107.pre-phi
%cmp55 = icmp slt i32 %sub, %sub54
br i1 %cmp55, label %if.end70, label %if.else57
if.else57: ; preds = %for.end51
%cmp62 = icmp sgt i32 %sub, %sub54
br i1 %cmp62, label %if.end70, label %if.else64
if.else64: ; preds = %if.else57
%rem = and i32 %Max.0.lcssa145, 1
%cmp65 = icmp eq i32 %rem, 0
%Left.0.Right.0 = select i1 %cmp65, i32 %Left.0.lcssa, i32 %Right.0.lcssa
br label %if.end70
if.end70: ; preds = %if.else64, %if.else57, %for.end51
%Mid.0 = phi i32 [ %Left.0.lcssa, %for.end51 ], [ %Right.0.lcssa, %if.else57 ], [ %Left.0.Right.0, %if.else64 ]
%call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %Max.0.lcssa145, i32 noundef %Mid.0)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %list) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
int main(void){
long long int i, ii, k, d, mon,n,tmp, kab, a[200001];
long long int max;
scanf("%lld", &n);
for (i = 0; i < n; i++)
scanf("%lld", a + i);
mon = 1000 % a[0];
kab = 1000/a[0];
max = 1000;
for (d = 1; d < n; d++)
{
if (a[d] < a[d - 1])
{
mon = max % a[d];
kab = max / a[d];
}
else if (a[d] > a[d - 1])
max = mon + kab * a[d];
}
printf("%lld", max);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234752/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234752/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%a = alloca [200001 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp37 = icmp sgt i64 %0, 0
br i1 %cmp37, label %for.body, label %for.end22
for.body: ; preds = %entry, %for.body
%i.038 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i64, ptr %a, i64 %i.038
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%inc = add nuw nsw i64 %i.038, 1
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%cmp439 = icmp sgt i64 %1, 1
br i1 %cmp439, label %for.body5.preheader, label %for.end22
for.body5.preheader: ; preds = %for.end
%.pre = load i64, ptr %a, align 16, !tbaa !5
%div = sdiv i64 1000, %.pre
%rem = srem i64 1000, %.pre
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.inc20
%2 = phi i64 [ %3, %for.inc20 ], [ %.pre, %for.body5.preheader ]
%max.043 = phi i64 [ %max.1, %for.inc20 ], [ 1000, %for.body5.preheader ]
%kab.042 = phi i64 [ %kab.1, %for.inc20 ], [ %div, %for.body5.preheader ]
%mon.041 = phi i64 [ %mon.1, %for.inc20 ], [ %rem, %for.body5.preheader ]
%d.040 = phi i64 [ %inc21, %for.inc20 ], [ 1, %for.body5.preheader ]
%arrayidx6 = getelementptr inbounds [200001 x i64], ptr %a, i64 0, i64 %d.040
%3 = load i64, ptr %arrayidx6, align 8, !tbaa !5
%cmp8 = icmp slt i64 %3, %2
br i1 %cmp8, label %if.then, label %if.else
if.then: ; preds = %for.body5
%rem10 = srem i64 %max.043, %3
%div12 = sdiv i64 %max.043, %3
br label %for.inc20
if.else: ; preds = %for.body5
%cmp16 = icmp sgt i64 %3, %2
br i1 %cmp16, label %if.then17, label %for.inc20
if.then17: ; preds = %if.else
%mul = mul nsw i64 %3, %kab.042
%add = add nsw i64 %mul, %mon.041
br label %for.inc20
for.inc20: ; preds = %if.then, %if.then17, %if.else
%mon.1 = phi i64 [ %rem10, %if.then ], [ %mon.041, %if.then17 ], [ %mon.041, %if.else ]
%kab.1 = phi i64 [ %div12, %if.then ], [ %kab.042, %if.then17 ], [ %kab.042, %if.else ]
%max.1 = phi i64 [ %max.043, %if.then ], [ %add, %if.then17 ], [ %max.043, %if.else ]
%inc21 = add nuw nsw i64 %d.040, 1
%exitcond.not = icmp eq i64 %inc21, %1
br i1 %exitcond.not, label %for.end22, label %for.body5, !llvm.loop !11
for.end22: ; preds = %for.inc20, %entry, %for.end
%max.0.lcssa = phi i64 [ 1000, %for.end ], [ 1000, %entry ], [ %max.1, %for.inc20 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %max.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
typedef struct directedGraph{
int *vertex;
int *next;
int *start;
int v,e;
int pointer;
} graph;
graph* newGraph(const int v,const int e){
graph *g=(graph *)malloc(sizeof(graph));
g->vertex=(int *)calloc(e,sizeof(int));
g->next=(int *)calloc(e,sizeof(int));
g->start=(int *)calloc(v,sizeof(int));
for(int i=0;i<v;i++) g->start[i]=-1;
g->v=v;
g->e=e;
g->pointer=0;
return g;
}
void freeGraph(graph *g){
free(g->vertex);
free(g->next);
free(g->start);
free(g);
return;
}
void addEdge(graph *g,const int from,const int to){
const int p=g->pointer;
g->vertex[p]=to;
g->next[p]=g->start[from];
g->start[from]=p;
g->pointer++;
return;
}
typedef long long int int64;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
void run(void){
int n;
scanf("%d",&n);
int *a=(int *)calloc(n,sizeof(int));
int i;
for(i=0;i<n;i++) scanf("%d",a+i);
graph *g=newGraph(n+1,2*n);
for(i=1;i<n;i++){
int v,u;
scanf("%d%d",&v,&u);
v--;u--;
addEdge(g,v,u);
addEdge(g,u,v);
}
int *q=(int *)calloc(n,sizeof(int));
int *parent=(int *)calloc(n,sizeof(int));
int front=0,last=0;
q[last++]=0;
while(last<n){
int v=q[front++];
for(int p=g->start[v];p!=-1;p=g->next[p]){
int u=g->vertex[p];
if(u==parent[v]) continue;
parent[u]=v;
q[last++]=u;
}
}
int *dp=(int *)calloc(n+1,sizeof(int));
for(i=n-1;i>=0;i--){
int v=q[i];
int max=0;
int64 sum=0;
int d=0;
for(int p=g->start[v];p!=-1;p=g->next[p]){
int u=g->vertex[p];
if(u==parent[v]) continue;
d++;
sum+=dp[u];
max=MAX(dp[u],max);
}
if(d==0){
dp[v]=a[v];
continue;
}
if(d==1){
if(sum!=a[v]){
puts("NO");
return;
}
dp[v]=sum;
continue;
}
if(2*a[v]<sum || a[v]>sum){
puts("NO");
return;
}
int t=2*a[v]-sum;
int l=(sum-t)/2;
if(l>MIN(sum/2,sum-max)){
puts("NO");
return;
}
dp[v]=t;
}
int d=0;
for(i=1;i<n;i++) if(parent[i]==0) d++;
if(d==1 || dp[0]==0){
puts("YES");
} else {
puts("NO");
}
}
int main(void){
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234796/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234796/source.c"
target datalayout = "e-m:e-p270: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.directedGraph = type { ptr, ptr, ptr, i32, i32, i32 }
@.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 [3 x i8] c"NO\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @newGraph(i32 noundef %v, i32 noundef %e) local_unnamed_addr #0 {
entry:
%call = tail call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #11
%conv = sext i32 %e to i64
%call1 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #12
store ptr %call1, ptr %call, align 8, !tbaa !5
%call3 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #12
%next = getelementptr inbounds %struct.directedGraph, ptr %call, i64 0, i32 1
store ptr %call3, ptr %next, align 8, !tbaa !11
%conv4 = sext i32 %v to i64
%call5 = tail call noalias ptr @calloc(i64 noundef %conv4, i64 noundef 4) #12
%start = getelementptr inbounds %struct.directedGraph, ptr %call, i64 0, i32 2
store ptr %call5, ptr %start, align 8, !tbaa !12
%cmp23 = icmp sgt i32 %v, 0
br i1 %cmp23, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%0 = zext i32 %v to i64
%1 = shl nuw nsw i64 %0, 2
tail call void @llvm.memset.p0.i64(ptr align 4 %call5, i8 -1, i64 %1, i1 false), !tbaa !13
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
%v8 = getelementptr inbounds %struct.directedGraph, ptr %call, i64 0, i32 3
store i32 %v, ptr %v8, align 8, !tbaa !14
%e9 = getelementptr inbounds %struct.directedGraph, ptr %call, i64 0, i32 4
store i32 %e, ptr %e9, align 4, !tbaa !15
%pointer = getelementptr inbounds %struct.directedGraph, ptr %call, i64 0, i32 5
store i32 0, ptr %pointer, align 8, !tbaa !16
ret ptr %call
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, 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: mustprogress nounwind willreturn uwtable
define dso_local void @freeGraph(ptr nocapture noundef %g) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %g, align 8, !tbaa !5
tail call void @free(ptr noundef %0) #13
%next = getelementptr inbounds %struct.directedGraph, ptr %g, i64 0, i32 1
%1 = load ptr, ptr %next, align 8, !tbaa !11
tail call void @free(ptr noundef %1) #13
%start = getelementptr inbounds %struct.directedGraph, ptr %g, i64 0, i32 2
%2 = load ptr, ptr %start, align 8, !tbaa !12
tail call void @free(ptr noundef %2) #13
tail call void @free(ptr noundef %g) #13
ret void
}
; 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 nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @addEdge(ptr nocapture noundef %g, i32 noundef %from, i32 noundef %to) local_unnamed_addr #6 {
entry:
%pointer = getelementptr inbounds %struct.directedGraph, ptr %g, i64 0, i32 5
%0 = load i32, ptr %pointer, align 8, !tbaa !16
%1 = load ptr, ptr %g, align 8, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds i32, ptr %1, i64 %idxprom
store i32 %to, ptr %arrayidx, align 4, !tbaa !13
%start = getelementptr inbounds %struct.directedGraph, ptr %g, i64 0, i32 2
%2 = load ptr, ptr %start, align 8, !tbaa !12
%idxprom1 = sext i32 %from to i64
%arrayidx2 = getelementptr inbounds i32, ptr %2, i64 %idxprom1
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !13
%next = getelementptr inbounds %struct.directedGraph, ptr %g, i64 0, i32 1
%4 = load ptr, ptr %next, align 8, !tbaa !11
%arrayidx4 = getelementptr inbounds i32, ptr %4, i64 %idxprom
store i32 %3, ptr %arrayidx4, align 4, !tbaa !13
store i32 %0, ptr %arrayidx2, align 4, !tbaa !13
%5 = load i32, ptr %pointer, align 8, !tbaa !16
%inc = add nsw i32 %5, 1
store i32 %inc, ptr %pointer, align 8, !tbaa !16
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @run() local_unnamed_addr #7 {
entry:
%n = alloca i32, align 4
%v = alloca i32, align 4
%u = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !13
%conv = sext i32 %0 to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #12
%cmp302 = icmp sgt i32 %0, 0
br i1 %cmp302, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !13
%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 !17
for.end: ; preds = %for.body, %entry
%3 = phi i32 [ %0, %entry ], [ %1, %for.body ]
%add = add nsw i32 %3, 1
%mul = shl nsw i32 %3, 1
%conv.i = sext i32 %mul to i64
%call1.i = call noalias ptr @calloc(i64 noundef %conv.i, i64 noundef 4) #12
%call3.i = call noalias ptr @calloc(i64 noundef %conv.i, i64 noundef 4) #12
%conv4.i = sext i32 %add to i64
%call5.i = call noalias ptr @calloc(i64 noundef %conv4.i, i64 noundef 4) #12
%cmp23.i = icmp sgt i32 %3, -1
br i1 %cmp23.i, label %newGraph.exit, label %for.end13
newGraph.exit: ; preds = %for.end
%4 = zext i32 %add to i64
%5 = shl nuw nsw i64 %4, 2
call void @llvm.memset.p0.i64(ptr align 4 %call5.i, i8 -1, i64 %5, i1 false), !tbaa !13
%cmp6304 = icmp ugt i32 %3, 1
br i1 %cmp6304, label %for.body8, label %for.end13
for.body8: ; preds = %newGraph.exit, %for.body8
%6 = phi i32 [ %inc.i299, %for.body8 ], [ 0, %newGraph.exit ]
%i.1305 = phi i32 [ %inc12, %for.body8 ], [ 1, %newGraph.exit ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #13
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %u)
%7 = load i32, ptr %v, align 4, !tbaa !13
%dec = add nsw i32 %7, -1
%8 = load i32, ptr %u, align 4, !tbaa !13
%dec10 = add nsw i32 %8, -1
%idxprom.i = zext i32 %6 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %call1.i, i64 %idxprom.i
store i32 %dec10, ptr %arrayidx.i, align 4, !tbaa !13
%idxprom1.i = sext i32 %dec to i64
%arrayidx2.i = getelementptr inbounds i32, ptr %call5.i, i64 %idxprom1.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !13
%arrayidx4.i = getelementptr inbounds i32, ptr %call3.i, i64 %idxprom.i
store i32 %9, ptr %arrayidx4.i, align 4, !tbaa !13
store i32 %6, ptr %arrayidx2.i, align 4, !tbaa !13
%inc.i = or i32 %6, 1
%idxprom.i292 = zext i32 %inc.i to i64
%arrayidx.i293 = getelementptr inbounds i32, ptr %call1.i, i64 %idxprom.i292
store i32 %dec, ptr %arrayidx.i293, align 4, !tbaa !13
%idxprom1.i295 = sext i32 %dec10 to i64
%arrayidx2.i296 = getelementptr inbounds i32, ptr %call5.i, i64 %idxprom1.i295
%10 = load i32, ptr %arrayidx2.i296, align 4, !tbaa !13
%arrayidx4.i298 = getelementptr inbounds i32, ptr %call3.i, i64 %idxprom.i292
store i32 %10, ptr %arrayidx4.i298, align 4, !tbaa !13
store i32 %inc.i, ptr %arrayidx2.i296, align 4, !tbaa !13
%inc.i299 = add nuw nsw i32 %6, 2
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #13
%inc12 = add nuw nsw i32 %i.1305, 1
%11 = load i32, ptr %n, align 4, !tbaa !13
%cmp6 = icmp slt i32 %inc12, %11
br i1 %cmp6, label %for.body8, label %for.end13, !llvm.loop !19
for.end13: ; preds = %for.body8, %for.end, %newGraph.exit
%12 = phi i32 [ %3, %newGraph.exit ], [ %3, %for.end ], [ %11, %for.body8 ]
%conv14 = sext i32 %12 to i64
%call15 = call noalias ptr @calloc(i64 noundef %conv14, i64 noundef 4) #12
%call17 = call noalias ptr @calloc(i64 noundef %conv14, i64 noundef 4) #12
%cmp19312 = icmp sgt i32 %12, 1
br i1 %cmp19312, label %while.body, label %while.end
while.cond.loopexit: ; preds = %cleanup, %while.body
%last.1.lcssa = phi i32 [ %last.0313, %while.body ], [ %last.2, %cleanup ]
%cmp19 = icmp slt i32 %last.1.lcssa, %12
br i1 %cmp19, label %while.body, label %while.end, !llvm.loop !20
while.body: ; preds = %for.end13, %while.cond.loopexit
%indvars.iv334 = phi i64 [ %indvars.iv.next335, %while.cond.loopexit ], [ 0, %for.end13 ]
%last.0313 = phi i32 [ %last.1.lcssa, %while.cond.loopexit ], [ 1, %for.end13 ]
%indvars.iv.next335 = add nuw i64 %indvars.iv334, 1
%arrayidx24 = getelementptr inbounds i32, ptr %call15, i64 %indvars.iv334
%13 = load i32, ptr %arrayidx24, align 4, !tbaa !13
%idxprom25 = sext i32 %13 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %call5.i, i64 %idxprom25
%p.0307 = load i32, ptr %arrayidx26, align 4, !tbaa !13
%cmp28.not308 = icmp eq i32 %p.0307, -1
br i1 %cmp28.not308, label %while.cond.loopexit, label %for.body30.lr.ph
for.body30.lr.ph: ; preds = %while.body
%arrayidx35 = getelementptr inbounds i32, ptr %call17, i64 %idxprom25
br label %for.body30
for.body30: ; preds = %for.body30.lr.ph, %cleanup
%p.0310 = phi i32 [ %p.0307, %for.body30.lr.ph ], [ %p.0, %cleanup ]
%last.1309 = phi i32 [ %last.0313, %for.body30.lr.ph ], [ %last.2, %cleanup ]
%idxprom32 = sext i32 %p.0310 to i64
%arrayidx33 = getelementptr inbounds i32, ptr %call1.i, i64 %idxprom32
%14 = load i32, ptr %arrayidx33, align 4, !tbaa !13
%15 = load i32, ptr %arrayidx35, align 4, !tbaa !13
%cmp36 = icmp eq i32 %14, %15
br i1 %cmp36, label %cleanup, label %if.end
if.end: ; preds = %for.body30
%idxprom38 = sext i32 %14 to i64
%arrayidx39 = getelementptr inbounds i32, ptr %call17, i64 %idxprom38
store i32 %13, ptr %arrayidx39, align 4, !tbaa !13
%inc40 = add nsw i32 %last.1309, 1
%idxprom41 = sext i32 %last.1309 to i64
%arrayidx42 = getelementptr inbounds i32, ptr %call15, i64 %idxprom41
store i32 %14, ptr %arrayidx42, align 4, !tbaa !13
br label %cleanup
cleanup: ; preds = %for.body30, %if.end
%last.2 = phi i32 [ %inc40, %if.end ], [ %last.1309, %for.body30 ]
%arrayidx45 = getelementptr inbounds i32, ptr %call3.i, i64 %idxprom32
%p.0 = load i32, ptr %arrayidx45, align 4, !tbaa !13
%cmp28.not = icmp eq i32 %p.0, -1
br i1 %cmp28.not, label %while.cond.loopexit, label %for.body30, !llvm.loop !21
while.end: ; preds = %while.cond.loopexit, %for.end13
%add48 = add nsw i32 %12, 1
%conv49 = sext i32 %add48 to i64
%call50 = call noalias ptr @calloc(i64 noundef %conv49, i64 noundef 4) #12
%cmp52325 = icmp sgt i32 %12, 0
br i1 %cmp52325, label %for.body54.preheader, label %lor.lhs.false191
for.body54.preheader: ; preds = %while.end
%16 = zext i32 %12 to i64
br label %for.body54
for.cond175.preheader: ; preds = %for.inc171
br i1 %cmp19312, label %for.body178.preheader, label %lor.lhs.false191
for.body178.preheader: ; preds = %for.cond175.preheader
%wide.trip.count = zext i32 %12 to i64
%17 = add nsw i64 %16, -1
%min.iters.check = icmp ult i32 %12, 9
br i1 %min.iters.check, label %for.body178.preheader354, label %vector.ph
vector.ph: ; preds = %for.body178.preheader
%n.vec = and i64 %17, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
%vec.phi352 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%offset.idx = or i64 %index, 1
%18 = getelementptr inbounds i32, ptr %call17, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %18, align 4, !tbaa !13
%19 = getelementptr inbounds i32, ptr %18, i64 4
%wide.load353 = load <4 x i32>, ptr %19, align 4, !tbaa !13
%20 = icmp eq <4 x i32> %wide.load, zeroinitializer
%21 = icmp eq <4 x i32> %wide.load353, zeroinitializer
%22 = zext <4 x i1> %20 to <4 x i32>
%23 = zext <4 x i1> %21 to <4 x i32>
%24 = add <4 x i32> %vec.phi, %22
%25 = add <4 x i32> %vec.phi352, %23
%index.next = add nuw i64 %index, 8
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %25, %24
%27 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %17, %n.vec
br i1 %cmp.n, label %for.end188, label %for.body178.preheader354
for.body178.preheader354: ; preds = %for.body178.preheader, %middle.block
%indvars.iv340.ph = phi i64 [ 1, %for.body178.preheader ], [ %ind.end, %middle.block ]
%d174.0329.ph = phi i32 [ 0, %for.body178.preheader ], [ %27, %middle.block ]
br label %for.body178
for.body54: ; preds = %for.body54.preheader, %for.inc171
%indvars.iv337 = phi i64 [ %16, %for.body54.preheader ], [ %indvars.iv.next338, %for.inc171 ]
%indvars.iv.next338 = add nsw i64 %indvars.iv337, -1
%idxprom56 = and i64 %indvars.iv.next338, 4294967295
%arrayidx57 = getelementptr inbounds i32, ptr %call15, i64 %idxprom56
%28 = load i32, ptr %arrayidx57, align 4, !tbaa !13
%idxprom60 = sext i32 %28 to i64
%arrayidx61 = getelementptr inbounds i32, ptr %call5.i, i64 %idxprom60
%p58.0315 = load i32, ptr %arrayidx61, align 4, !tbaa !13
%cmp63.not316 = icmp eq i32 %p58.0315, -1
br i1 %cmp63.not316, label %if.then99, label %for.body66.lr.ph
for.body66.lr.ph: ; preds = %for.body54
%arrayidx72 = getelementptr inbounds i32, ptr %call17, i64 %idxprom60
%29 = load i32, ptr %arrayidx72, align 4, !tbaa !13
br label %for.body66
for.cond.cleanup65: ; preds = %cleanup88
switch i32 %d.1, label %if.end119 [
i32 0, label %if.then99
i32 1, label %if.then107
]
for.body66: ; preds = %for.body66.lr.ph, %cleanup88
%p58.0320 = phi i32 [ %p58.0315, %for.body66.lr.ph ], [ %p58.0, %cleanup88 ]
%d.0319 = phi i32 [ 0, %for.body66.lr.ph ], [ %d.1, %cleanup88 ]
%sum.0318 = phi i64 [ 0, %for.body66.lr.ph ], [ %sum.1, %cleanup88 ]
%max.0317 = phi i32 [ 0, %for.body66.lr.ph ], [ %max.1, %cleanup88 ]
%idxprom69 = sext i32 %p58.0320 to i64
%arrayidx70 = getelementptr inbounds i32, ptr %call1.i, i64 %idxprom69
%30 = load i32, ptr %arrayidx70, align 4, !tbaa !13
%cmp73 = icmp eq i32 %30, %29
br i1 %cmp73, label %cleanup88, label %if.end76
if.end76: ; preds = %for.body66
%inc77 = add nsw i32 %d.0319, 1
%idxprom78 = sext i32 %30 to i64
%arrayidx79 = getelementptr inbounds i32, ptr %call50, i64 %idxprom78
%31 = load i32, ptr %arrayidx79, align 4, !tbaa !13
%conv80 = sext i32 %31 to i64
%add81 = add nsw i64 %sum.0318, %conv80
%.max.0 = call i32 @llvm.smax.i32(i32 %31, i32 %max.0317)
br label %cleanup88
cleanup88: ; preds = %for.body66, %if.end76
%max.1 = phi i32 [ %.max.0, %if.end76 ], [ %max.0317, %for.body66 ]
%sum.1 = phi i64 [ %add81, %if.end76 ], [ %sum.0318, %for.body66 ]
%d.1 = phi i32 [ %inc77, %if.end76 ], [ %d.0319, %for.body66 ]
%arrayidx94 = getelementptr inbounds i32, ptr %call3.i, i64 %idxprom69
%p58.0 = load i32, ptr %arrayidx94, align 4, !tbaa !13
%cmp63.not = icmp eq i32 %p58.0, -1
br i1 %cmp63.not, label %for.cond.cleanup65, label %for.body66, !llvm.loop !25
if.then99: ; preds = %for.body54, %for.cond.cleanup65
%arrayidx101 = getelementptr inbounds i32, ptr %call1, i64 %idxprom60
%32 = load i32, ptr %arrayidx101, align 4, !tbaa !13
br label %for.inc171
if.then107: ; preds = %for.cond.cleanup65
%arrayidx109 = getelementptr inbounds i32, ptr %call1, i64 %idxprom60
%33 = load i32, ptr %arrayidx109, align 4, !tbaa !13
%conv110 = sext i32 %33 to i64
%cmp111.not = icmp eq i64 %sum.1, %conv110
br i1 %cmp111.not, label %if.end115, label %cleanup199
if.end115: ; preds = %if.then107
%conv116 = trunc i64 %sum.1 to i32
br label %for.inc171
if.end119: ; preds = %for.cond.cleanup65
%arrayidx121 = getelementptr inbounds i32, ptr %call1, i64 %idxprom60
%34 = load i32, ptr %arrayidx121, align 4, !tbaa !13
%mul122 = shl nsw i32 %34, 1
%conv123 = sext i32 %mul122 to i64
%cmp124 = icmp sgt i64 %sum.1, %conv123
%conv128 = sext i32 %34 to i64
%cmp129 = icmp slt i64 %sum.1, %conv128
%or.cond = or i1 %cmp129, %cmp124
br i1 %or.cond, label %cleanup199, label %if.end133
if.end133: ; preds = %if.end119
%35 = trunc i64 %sum.1 to i32
%conv139 = sub i32 %mul122, %35
%conv140 = sext i32 %conv139 to i64
%sub141 = sub nsw i64 %sum.1, %conv140
%div = sdiv i64 %sub141, 2
%sext = shl i64 %div, 32
%conv143 = ashr exact i64 %sext, 32
%div144 = sdiv i64 %sum.1, 2
%conv145 = zext i32 %max.1 to i64
%sub146 = sub nsw i64 %sum.1, %conv145
%div144.sub146 = call i64 @llvm.smin.i64(i64 %div144, i64 %sub146)
%cmp156 = icmp sgt i64 %conv143, %div144.sub146
br i1 %cmp156, label %cleanup199, label %for.inc171
for.inc171: ; preds = %if.end133, %if.then99, %if.end115
%.sink = phi i32 [ %32, %if.then99 ], [ %conv116, %if.end115 ], [ %conv139, %if.end133 ]
%arrayidx103 = getelementptr inbounds i32, ptr %call50, i64 %idxprom60
store i32 %.sink, ptr %arrayidx103, align 4, !tbaa !13
%cmp52 = icmp sgt i64 %indvars.iv337, 1
br i1 %cmp52, label %for.body54, label %for.cond175.preheader, !llvm.loop !26
for.body178: ; preds = %for.body178.preheader354, %for.body178
%indvars.iv340 = phi i64 [ %indvars.iv.next341, %for.body178 ], [ %indvars.iv340.ph, %for.body178.preheader354 ]
%d174.0329 = phi i32 [ %spec.select, %for.body178 ], [ %d174.0329.ph, %for.body178.preheader354 ]
%arrayidx180 = getelementptr inbounds i32, ptr %call17, i64 %indvars.iv340
%36 = load i32, ptr %arrayidx180, align 4, !tbaa !13
%cmp181 = icmp eq i32 %36, 0
%inc184 = zext i1 %cmp181 to i32
%spec.select = add nuw nsw i32 %d174.0329, %inc184
%indvars.iv.next341 = add nuw nsw i64 %indvars.iv340, 1
%exitcond.not = icmp eq i64 %indvars.iv.next341, %wide.trip.count
br i1 %exitcond.not, label %for.end188, label %for.body178, !llvm.loop !27
for.end188: ; preds = %for.body178, %middle.block
%spec.select.lcssa = phi i32 [ %27, %middle.block ], [ %spec.select, %for.body178 ]
%37 = icmp eq i32 %spec.select.lcssa, 1
br i1 %37, label %cleanup199, label %lor.lhs.false191
lor.lhs.false191: ; preds = %while.end, %for.cond175.preheader, %for.end188
%38 = load i32, ptr %call50, align 4, !tbaa !13
%cmp193 = icmp eq i32 %38, 0
%spec.select350 = select i1 %cmp193, ptr @.str.3, ptr @.str.2
br label %cleanup199
cleanup199: ; preds = %if.end133, %if.end119, %if.then107, %lor.lhs.false191, %for.end188
%.str.2.sink = phi ptr [ @.str.3, %for.end188 ], [ %spec.select350, %lor.lhs.false191 ], [ @.str.2, %if.then107 ], [ @.str.2, %if.end119 ], [ @.str.2, %if.end133 ]
%call159 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #13
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
tail call void @run()
ret i32 0
}
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #10
attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { nounwind allocsize(0,1) }
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, !7, i64 0}
!6 = !{!"directedGraph", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !7, i64 16}
!13 = !{!10, !10, i64 0}
!14 = !{!6, !10, i64 24}
!15 = !{!6, !10, i64 28}
!16 = !{!6, !10, i64 32}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18, !24, !23}
|
#include<stdio.h>
#include<math.h>
int main(){
long long n,m,i,j,ans=1;
scanf("%lld %lld",&n,&m);
if(n==1){
printf("%lld\n",m);
return 0;
}
for(i=2;i*i<=m;i++){
for(j=0;m&&m%i==0;j++)m/=i;
//printf("%lld\n",j);
ans*=pow(i,j/n);
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234839/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234839/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp eq i64 %0, 1
%1 = load i64, ptr %m, align 8, !tbaa !5
br i1 %cmp, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp2.not30 = icmp slt i64 %1, 4
br i1 %cmp2.not30, label %cleanup, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%2 = phi i64 [ %5, %for.end ], [ %1, %for.cond.preheader ]
%ans.032 = phi i64 [ %conv11, %for.end ], [ 1, %for.cond.preheader ]
%i.031 = phi i64 [ %inc13, %for.end ], [ 2, %for.cond.preheader ]
%tobool.not27 = icmp eq i64 %2, 0
br i1 %tobool.not27, label %for.end, label %land.rhs
land.rhs: ; preds = %for.cond3.preheader, %for.body5
%j.028 = phi i64 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%3 = phi i64 [ %div, %for.body5 ], [ %2, %for.cond3.preheader ]
%rem = srem i64 %3, %i.031
%div = sdiv i64 %3, %i.031
%cmp4 = icmp eq i64 %rem, 0
br i1 %cmp4, label %for.body5, label %for.end
for.body5: ; preds = %land.rhs
store i64 %div, ptr %m, align 8, !tbaa !5
%inc = add nuw nsw i64 %j.028, 1
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %for.end, label %land.rhs, !llvm.loop !9
for.end: ; preds = %land.rhs, %for.body5, %for.cond3.preheader
%j.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ %inc, %for.body5 ], [ %j.028, %land.rhs ]
%conv = sitofp i64 %i.031 to double
%4 = load i64, ptr %n, align 8, !tbaa !5
%div6 = sdiv i64 %j.0.lcssa, %4
%conv7 = sitofp i64 %div6 to double
%call8 = call double @pow(double noundef %conv, double noundef %conv7) #4
%conv9 = sitofp i64 %ans.032 to double
%mul10 = fmul double %call8, %conv9
%conv11 = fptosi double %mul10 to i64
%inc13 = add nuw nsw i64 %i.031, 1
%mul = mul nsw i64 %inc13, %inc13
%5 = load i64, ptr %m, align 8, !tbaa !5
%cmp2.not = icmp sgt i64 %mul, %5
br i1 %cmp2.not, label %cleanup, label %for.cond3.preheader, !llvm.loop !11
cleanup: ; preds = %for.end, %for.cond.preheader, %entry
%ans.0.lcssa.sink = phi i64 [ %1, %entry ], [ 1, %for.cond.preheader ], [ %conv11, %for.end ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa.sink)
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 nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void)
{
int n;
scanf("%d",&n);
if(n==1)
puts("1.0");
else if(n/2==0)
puts("0.5");
else{
double m;
double x=0;
int i;
for(i=1; i<=n; i++){
if(i%2==1)
x++;
}
m=x/n;
printf("%lf",m);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234882/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234882/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"1.0\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"0.5\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end13
if.else: ; preds = %entry
%.off = add i32 %0, 1
%cmp2 = icmp ult i32 %.off, 3
br i1 %cmp2, label %if.then3, label %for.cond.preheader
for.cond.preheader: ; preds = %if.else
%cmp6.not18 = icmp slt i32 %0, 1
br i1 %cmp6.not18, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%xtraiter = and i32 %0, 1
%1 = icmp eq i32 %0, 1
br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %0, -2
br label %for.body
if.then3: ; preds = %if.else
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end13
for.body: ; preds = %for.body, %for.body.preheader.new
%i.020 = phi i32 [ 1, %for.body.preheader.new ], [ %inc9.1, %for.body ]
%x.019 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %inc, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%inc = fadd double %x.019, 1.000000e+00
%inc9.1 = add nuw i32 %i.020, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa.loopexit: ; preds = %for.body
%2 = and i32 %i.020, 1
%3 = icmp eq i32 %2, 0
br label %for.end.loopexit.unr-lcssa
for.end.loopexit.unr-lcssa: ; preds = %for.end.loopexit.unr-lcssa.loopexit, %for.body.preheader
%x.1.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %inc, %for.end.loopexit.unr-lcssa.loopexit ]
%i.020.unr = phi i1 [ false, %for.body.preheader ], [ %3, %for.end.loopexit.unr-lcssa.loopexit ]
%x.019.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %inc, %for.end.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
%inc.epil = fadd double %x.019.unr, 1.000000e+00
%x.1.epil = select i1 %i.020.unr, double %x.019.unr, double %inc.epil
%x.1.lcssa = select i1 %lcmp.mod.not, double %x.1.lcssa.ph, double %x.1.epil
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.cond.preheader
%x.0.lcssa = phi double [ 0.000000e+00, %for.cond.preheader ], [ %x.1.lcssa, %for.end.loopexit.unr-lcssa ]
%conv = sitofp i32 %0 to double
%div10 = fdiv double %x.0.lcssa, %conv
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %div10)
br label %if.end13
if.end13: ; preds = %if.then3, %for.end, %if.then
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: 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;
float p;
scanf("%d",&N);
if(N%2==0)printf("%f",0.5000000000);
else printf("%f",(float)(N+1)/(2*N));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_234983/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_234983/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %if.end, label %if.else
if.else: ; preds = %entry
%add = add nsw i32 %0, 1
%conv = sitofp i32 %add to float
%mul = shl nsw i32 %0, 1
%conv2 = sitofp i32 %mul to float
%div = fdiv float %conv, %conv2
%conv3 = fpext float %div to double
br label %if.end
if.end: ; preds = %entry, %if.else
%conv3.sink = phi double [ %conv3, %if.else ], [ 5.000000e-01, %entry ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main ( )
{
int n,i,odd=0;
float p;
scanf ("%d",&n);
for (i=1; i<=n; i++)
{
if (i%2!=0)
odd++;
}
p=odd/(float)n;
printf ("%f\n",p);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235025/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235025/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\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
%cmp.not9 = icmp slt i32 %0, 1
br i1 %cmp.not9, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %0, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi14 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%2 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%3 = add <4 x i32> %1, %vec.phi
%4 = add <4 x i32> %2, %vec.phi14
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%5 = icmp eq i32 %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 i32 %0, %n.vec
br i1 %cmp.n, label %for.end.loopexit, label %for.body.preheader15
for.body.preheader15: ; preds = %for.body.preheader, %middle.block
%i.011.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%odd.010.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader15, %for.body
%i.011 = phi i32 [ %inc2, %for.body ], [ %i.011.ph, %for.body.preheader15 ]
%odd.010 = phi i32 [ %spec.select, %for.body ], [ %odd.010.ph, %for.body.preheader15 ]
%rem = and i32 %i.011, 1
%spec.select = add i32 %rem, %odd.010
%inc2 = add nuw i32 %i.011, 1
%exitcond.not = icmp eq i32 %i.011, %0
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !13
for.end.loopexit: ; preds = %for.body, %middle.block
%spec.select.lcssa = phi i32 [ %6, %middle.block ], [ %spec.select, %for.body ]
%7 = sitofp i32 %spec.select.lcssa to float
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%odd.0.lcssa = phi float [ 0.000000e+00, %entry ], [ %7, %for.end.loopexit ]
%conv3 = sitofp i32 %0 to float
%div = fdiv float %odd.0.lcssa, %conv3
%conv4 = fpext float %div to double
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include<stdio.h>
int a,i;
float j=0;
float n;
int main(void)
{scanf("%d",&a);
for(i=0;i<=a;i++){
if(i%2==1){
j++;
}
}
n=j/a;
printf("%f",n);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235069/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235069/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@j = dso_local local_unnamed_addr global float 0.000000e+00, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@a = dso_local global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@n = dso_local local_unnamed_addr global float 0.000000e+00, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%f\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 @a)
%0 = load i32, ptr @a, align 4, !tbaa !5
%j.promoted = load float, ptr @j, align 4, !tbaa !9
%cmp.not8 = icmp slt i32 %0, 0
br i1 %cmp.not8, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%2 = add i32 %0, 1
%xtraiter = and i32 %2, 1
%3 = icmp eq i32 %0, 0
br i1 %3, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %2, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%inc79 = phi float [ %j.promoted, %for.body.preheader.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%inc.1 = fadd float %inc79, 1.000000e+00
store float %inc.1, ptr @j, align 4, !tbaa !9
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !11
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%inc6.lcssa.ph = phi float [ undef, %for.body.preheader ], [ %inc.1, %for.body ]
%inc79.unr = phi float [ %j.promoted, %for.body.preheader ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
%inc6.lcssa = select i1 %lcmp.mod.not, float %inc6.lcssa.ph, float %inc79.unr
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %entry
%4 = phi float [ %j.promoted, %entry ], [ %inc6.lcssa, %for.end.loopexit.unr-lcssa ]
%storemerge.lcssa = phi i32 [ 0, %entry ], [ %1, %for.end.loopexit.unr-lcssa ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
%conv = sitofp i32 %0 to float
%div = fdiv float %4, %conv
store float %div, ptr @n, align 4, !tbaa !9
%conv3 = fpext float %div to double
%call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv3)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
double n;
int eve = 0;
int odd = 0;
double t = 0;
scanf("%lf", &n);
if (n < 0 || n > 100) {
puts("error");
return 0;
}
for (int k = 1; k <= n; k++) {
if (k%2 == 1) {
odd++;
} else {
eve++;
}
}
t = odd/n;
printf("%.10f\n", t);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235119/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235119/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"error\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load double, ptr %n, align 8
%cmp = fcmp olt double %0, 0.000000e+00
%cmp1 = fcmp ogt double %0, 1.000000e+02
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp319 = fcmp ult double %0, 1.000000e+00
br i1 %cmp319, label %for.cond.cleanup, label %for.body
if.then: ; preds = %entry
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = sitofp i32 %odd.1 to double
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %for.cond.preheader
%odd.0.lcssa = phi double [ 0.000000e+00, %for.cond.preheader ], [ %1, %for.cond.cleanup.loopexit ]
%div = fdiv double %odd.0.lcssa, %0
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div)
br label %cleanup
for.body: ; preds = %for.cond.preheader, %for.body
%k.021 = phi i32 [ %inc10, %for.body ], [ 1, %for.cond.preheader ]
%odd.020 = phi i32 [ %odd.1, %for.body ], [ 0, %for.cond.preheader ]
%rem = and i32 %k.021, 1
%odd.1 = add i32 %rem, %odd.020
%inc10 = add nuw nsw i32 %k.021, 1
%conv = sitofp i32 %inc10 to double
%cmp3 = fcmp ult double %0, %conv
br i1 %cmp3, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !5
cleanup: ; preds = %for.cond.cleanup, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
double p=(double)((n+1)/2)/n;
printf("%.101f\n",p);
return 0;}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235162/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235162/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%.101f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%div = sdiv i32 %add, 2
%conv = sitofp i32 %div to double
%conv1 = sitofp i32 %0 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,y;
scanf("%d",&a);
if(a%2==0){
y=a/2;
}
else {
y=(a-1)/2;
y++;
}
printf("%lf\n",(double)y/a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235205/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235205/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %0, 2
br label %if.end
if.else: ; preds = %entry
%sub = add nsw i32 %0, -1
%div1 = sdiv i32 %sub, 2
%inc = add nsw i32 %div1, 1
br label %if.end
if.end: ; preds = %if.else, %if.then
%y.0 = phi i32 [ %div, %if.then ], [ %inc, %if.else ]
%conv = sitofp i32 %y.0 to double
%conv2 = sitofp i32 %0 to double
%div3 = fdiv double %conv, %conv2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div3)
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){
// Your code here!
int n;
float ans;
scanf("%d",&n);
if(n%2==0){
ans = 0.5;
printf("%f",ans);
}else{
ans = (float)(n+1)/(2*n);
printf("%f",ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235249/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235249/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %if.end, label %if.else
if.else: ; preds = %entry
%add = add nsw i32 %0, 1
%conv2 = sitofp i32 %add to float
%mul = shl nsw i32 %0, 1
%conv3 = sitofp i32 %mul to float
%div = fdiv float %conv2, %conv3
%conv4 = fpext float %div to double
br label %if.end
if.end: ; preds = %entry, %if.else
%conv4.sink = phi double [ %conv4, %if.else ], [ 5.000000e-01, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(void){
double inputN = 0;
double result = 0;
scanf("%lf\n",&inputN);
for(int i = 1;i <= inputN;i++){
if(i % 2 == 1){
result++;
}
}
printf("%lf\n",result/inputN);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235292/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235292/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%inputN = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %inputN) #3
store double 0.000000e+00, ptr %inputN, align 8, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %inputN)
%0 = load double, ptr %inputN, align 8, !tbaa !5
%cmp9 = fcmp ult double %0, 1.000000e+00
br i1 %cmp9, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%result.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %result.1, %for.body ]
%div = fdiv double %result.0.lcssa, %0
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %inputN) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.011 = phi i32 [ %inc4, %for.body ], [ 1, %entry ]
%result.010 = phi double [ %result.1, %for.body ], [ 0.000000e+00, %entry ]
%rem = and i32 %i.011, 1
%cmp2.not = icmp eq i32 %rem, 0
%inc = fadd double %result.010, 1.000000e+00
%result.1 = select i1 %cmp2.not, double %result.010, double %inc
%inc4 = add nuw nsw i32 %i.011, 1
%conv = sitofp i32 %inc4 to double
%cmp = fcmp ult double %0, %conv
br i1 %cmp, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int gcd(int a, int b) {
int r;
while (b > 0) {
r = a % b;
a = b;
b = r;
}
return a;
}
int main(void) {
char str[32];
int zero_left, zero_right, one_left, one_right;
int phase = 0;
int i;
int bunsi, bunbo, g;
if (scanf("%s", str) != 1) return 1;
zero_left = one_left = 1;
zero_right = one_right = 0;
for (i = 0; str[i] != '\0'; i++) {
if (str[i] == '.') {
phase = 1;
} else if (str[i] == '(') {
phase = 2;
} else if (str[i] == ')') {
phase = 3;
} else {
switch (phase) {
case 0:
zero_right = zero_right * 10 + (str[i] - '0');
one_right = one_right * 10 + (str[i] - '0');
break;
case 1:
zero_right = zero_right * 10 + (str[i] - '0');
one_right = one_right * 10 + (str[i] - '0');
zero_left *= 10;
one_left *= 10;
break;
case 2:
one_right = one_right * 10 + (str[i] - '0');
one_left *= 10;
break;
case 3:
break;
}
}
}
if (phase >= 2) {
bunsi = one_right - zero_right;
bunbo = one_left - zero_left;
} else {
bunsi = zero_right;
bunbo = zero_left;
}
g = gcd(bunsi, bunbo);
printf("%d/%d\n", bunsi / g, bunbo / g);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d/%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp sgt i32 %b, 0
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%cmp = icmp sgt i32 %rem, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%str = alloca [32 x i8], align 16
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %for.cond, label %cleanup
for.cond: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%zero_left.0 = phi i32 [ %zero_left.1, %for.inc ], [ 1, %entry ]
%zero_right.0 = phi i32 [ %zero_right.1, %for.inc ], [ 0, %entry ]
%one_left.0 = phi i32 [ %one_left.1, %for.inc ], [ 1, %entry ]
%one_right.0 = phi i32 [ %one_right.1, %for.inc ], [ 0, %entry ]
%phase.0 = phi i32 [ %phase.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [32 x i8], ptr %str, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%conv = sext i8 %0 to i32
switch i8 %0, label %if.else22 [
i8 0, label %for.end
i8 46, label %for.inc
i8 40, label %if.then14
i8 41, label %if.then21
]
if.then14: ; preds = %for.cond
br label %for.inc
if.then21: ; preds = %for.cond
br label %for.inc
if.else22: ; preds = %for.cond
switch i32 %phase.0, label %for.inc [
i32 0, label %sw.bb
i32 1, label %sw.bb32
i32 2, label %sw.bb47
]
sw.bb: ; preds = %if.else22
%mul = mul nsw i32 %zero_right.0, 10
%sub = add nsw i32 %conv, -48
%add = add nsw i32 %sub, %mul
%mul26 = mul nsw i32 %one_right.0, 10
%add31 = add nsw i32 %sub, %mul26
br label %for.inc
sw.bb32: ; preds = %if.else22
%mul33 = mul nsw i32 %zero_right.0, 10
%sub37 = add nsw i32 %conv, -48
%add38 = add nsw i32 %sub37, %mul33
%mul39 = mul nsw i32 %one_right.0, 10
%add44 = add nsw i32 %sub37, %mul39
%mul45 = mul nsw i32 %zero_left.0, 10
%mul46 = mul nsw i32 %one_left.0, 10
br label %for.inc
sw.bb47: ; preds = %if.else22
%mul48 = mul nsw i32 %one_right.0, 10
%sub52 = add i32 %mul48, -48
%add53 = add i32 %sub52, %conv
%mul54 = mul nsw i32 %one_left.0, 10
br label %for.inc
for.inc: ; preds = %for.cond, %if.then21, %if.else22, %sw.bb47, %sw.bb32, %sw.bb, %if.then14
%zero_left.1 = phi i32 [ %zero_left.0, %if.then14 ], [ %zero_left.0, %if.then21 ], [ %zero_left.0, %if.else22 ], [ %zero_left.0, %sw.bb47 ], [ %mul45, %sw.bb32 ], [ %zero_left.0, %sw.bb ], [ %zero_left.0, %for.cond ]
%zero_right.1 = phi i32 [ %zero_right.0, %if.then14 ], [ %zero_right.0, %if.then21 ], [ %zero_right.0, %if.else22 ], [ %zero_right.0, %sw.bb47 ], [ %add38, %sw.bb32 ], [ %add, %sw.bb ], [ %zero_right.0, %for.cond ]
%one_left.1 = phi i32 [ %one_left.0, %if.then14 ], [ %one_left.0, %if.then21 ], [ %one_left.0, %if.else22 ], [ %mul54, %sw.bb47 ], [ %mul46, %sw.bb32 ], [ %one_left.0, %sw.bb ], [ %one_left.0, %for.cond ]
%one_right.1 = phi i32 [ %one_right.0, %if.then14 ], [ %one_right.0, %if.then21 ], [ %one_right.0, %if.else22 ], [ %add53, %sw.bb47 ], [ %add44, %sw.bb32 ], [ %add31, %sw.bb ], [ %one_right.0, %for.cond ]
%phase.1 = phi i32 [ 2, %if.then14 ], [ 3, %if.then21 ], [ %phase.0, %if.else22 ], [ 2, %sw.bb47 ], [ 1, %sw.bb32 ], [ 0, %sw.bb ], [ 1, %for.cond ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !10
for.end: ; preds = %for.cond
%cmp58 = icmp sgt i32 %phase.0, 1
%sub61 = sub nsw i32 %one_right.0, %zero_right.0
%sub62 = sub nsw i32 %one_left.0, %zero_left.0
%bunsi.0 = select i1 %cmp58, i32 %sub61, i32 %zero_right.0
%bunbo.0 = select i1 %cmp58, i32 %sub62, i32 %zero_left.0
%cmp4.i = icmp sgt i32 %bunbo.0, 0
br i1 %cmp4.i, label %while.body.i, label %gcd.exit
while.body.i: ; preds = %for.end, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %bunsi.0, %for.end ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %bunbo.0, %for.end ]
%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 %gcd.exit, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %for.end
%a.addr.0.lcssa.i = phi i32 [ %bunsi.0, %for.end ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %bunsi.0, %a.addr.0.lcssa.i
%div66 = sdiv i32 %bunbo.0, %a.addr.0.lcssa.i
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div66)
br label %cleanup
cleanup: ; preds = %entry, %gcd.exit
%retval.0 = phi i32 [ 0, %gcd.exit ], [ 1, %entry ]
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %str) #4
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !6}
|
#include <stdio.h>
int main()
{
int i, n, q, left, right;
long cnt, sum, x;
scanf("%d %d", &n, &q);
long a[n];
for (i=0; i<n; i++) scanf("%ld", &a[i]);
for (i=0; i<q; i++) {
scanf("%ld", &x);
cnt = sum = 0;
for (left=0, right=0; left<n; cnt+=right-left++) {
for (; right<n && sum+a[right]<=x; sum += a[right++]);
sum -= a[left];
}
printf("%ld\n", cnt);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235386/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235386/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp44 = icmp sgt i32 %3, 0
br i1 %cmp44, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%4 = load i32, ptr %q, align 4, !tbaa !5
%cmp358 = icmp sgt i32 %4, 0
br i1 %cmp358, label %for.body4, label %for.end31
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.end27
%i.159 = phi i32 [ %inc30, %for.end27 ], [ 0, %for.cond2.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp752 = icmp sgt i32 %7, 0
br i1 %cmp752, label %for.cond9.preheader.lr.ph, label %for.end27
for.cond9.preheader.lr.ph: ; preds = %for.body4
%8 = load i64, ptr %x, align 8
%9 = zext i32 %7 to i64
%wide.trip.count = zext i32 %7 to i64
br label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.cond9.preheader.lr.ph, %for.end20
%indvars.iv64 = phi i64 [ 0, %for.cond9.preheader.lr.ph ], [ %indvars.iv.next65, %for.end20 ]
%sum.056 = phi i64 [ 0, %for.cond9.preheader.lr.ph ], [ %sub, %for.end20 ]
%cnt.055 = phi i64 [ 0, %for.cond9.preheader.lr.ph ], [ %add26, %for.end20 ]
%right.054 = phi i32 [ 0, %for.cond9.preheader.lr.ph ], [ %right.1.lcssa, %for.end20 ]
%cmp1046 = icmp slt i32 %right.054, %7
br i1 %cmp1046, label %land.rhs.preheader, label %for.end20
land.rhs.preheader: ; preds = %for.cond9.preheader
%10 = sext i32 %right.054 to i64
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %for.inc15
%indvars.iv61 = phi i64 [ %10, %land.rhs.preheader ], [ %indvars.iv.next62, %for.inc15 ]
%sum.148 = phi i64 [ %sum.056, %land.rhs.preheader ], [ %add, %for.inc15 ]
%arrayidx12 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv61
%11 = load i64, ptr %arrayidx12, align 8, !tbaa !11
%add = add nsw i64 %11, %sum.148
%cmp13.not = icmp sgt i64 %add, %8
br i1 %cmp13.not, label %for.end20.loopexit.split.loop.exit68, label %for.inc15
for.inc15: ; preds = %land.rhs
%indvars.iv.next62 = add nsw i64 %indvars.iv61, 1
%exitcond.not = icmp eq i64 %indvars.iv.next62, %9
br i1 %exitcond.not, label %for.end20, label %land.rhs, !llvm.loop !13
for.end20.loopexit.split.loop.exit68: ; preds = %land.rhs
%12 = trunc i64 %indvars.iv61 to i32
br label %for.end20
for.end20: ; preds = %for.inc15, %for.end20.loopexit.split.loop.exit68, %for.cond9.preheader
%right.1.lcssa = phi i32 [ %right.054, %for.cond9.preheader ], [ %12, %for.end20.loopexit.split.loop.exit68 ], [ %7, %for.inc15 ]
%sum.1.lcssa = phi i64 [ %sum.056, %for.cond9.preheader ], [ %sum.148, %for.end20.loopexit.split.loop.exit68 ], [ %add, %for.inc15 ]
%arrayidx22 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv64
%13 = load i64, ptr %arrayidx22, align 8, !tbaa !11
%sub = sub nsw i64 %sum.1.lcssa, %13
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%14 = trunc i64 %indvars.iv64 to i32
%sub25 = sub nsw i32 %right.1.lcssa, %14
%conv = sext i32 %sub25 to i64
%add26 = add nsw i64 %cnt.055, %conv
%exitcond67.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count
br i1 %exitcond67.not, label %for.end27, label %for.cond9.preheader, !llvm.loop !14
for.end27: ; preds = %for.end20, %for.body4
%cnt.0.lcssa = phi i64 [ 0, %for.body4 ], [ %add26, %for.end20 ]
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %cnt.0.lcssa)
%inc30 = add nuw nsw i32 %i.159, 1
%15 = load i32, ptr %q, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc30, %15
br i1 %cmp3, label %for.body4, label %for.end31, !llvm.loop !15
for.end31: ; preds = %for.end27, %for.cond2.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @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 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int max;
void mo(int, int, int);
int d[100][100];
int main()
{
int i, i2;
int n, m;
while (1){
scanf("%d %d", &m, &n);
if (m == 0 && n == 0)break;
for (i = 0; i < n + 2; i++){
d[i][0] = 0;
d[i][m + 1];
}
max = 0;
for (i = 1; i <= m; i++){
d[0][i] = 0;
d[n + 1][i] = 0;
for (i2 = 1; i2 <= n; i2++){
scanf("%d", &d[i][i2]);
}
}
for (i = 1; i <= m; i++){
for (i2 = 1; i2 <= n; i2++){
if (d[i][i2] == 1)mo(i, i2, 0);
}
}
printf("%d\n", max);
}
return 0;
}
void mo(int x, int y, int c){
d[x][y] = 0;
c++;
if (d[x][y + 1] == 1)mo(x, y + 1, c);
if (d[x][y - 1] == 1)mo(x, y - 1, c);
if (d[x - 1][y] == 1)mo(x - 1, y, c);
if (d[x + 1][y] == 1)mo(x + 1, y, c);
d[x][y] = 1;
if (c > max)max = c;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@d = dso_local global [100 x [100 x i32]] zeroinitializer, align 16
@max = dso_local local_unnamed_addr global i32 0, align 4
@.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
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call81 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp82 = icmp eq i32 %0, 0
%1 = load i32, ptr %n, align 4
%cmp183 = icmp eq i32 %1, 0
%or.cond84 = select i1 %cmp82, i1 %cmp183, i1 false
br i1 %or.cond84, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end51
%2 = phi i32 [ %46, %for.end51 ], [ %0, %entry ]
%3 = phi i32 [ %47, %for.end51 ], [ %1, %entry ]
%cmp271 = icmp sgt i32 %3, -2
br i1 %cmp271, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%4 = add i32 %3, 2
%wide.trip.count = zext i32 %4 to i64
%5 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i64 %5, 3
br i1 %6, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%arrayidx = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %indvars.iv
store i32 0, ptr %arrayidx, align 16, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %indvars.iv.next
store i32 0, ptr %arrayidx.1, align 16, !tbaa !5
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %indvars.iv.next.1
store i32 0, ptr %arrayidx.2, align 16, !tbaa !5
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %indvars.iv.next.2
store i32 0, ptr %arrayidx.3, align 16, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%arrayidx.epil = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %indvars.iv.epil
store i32 0, ptr %arrayidx.epil, align 16, !tbaa !5
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %for.cond.preheader
store i32 0, ptr @max, align 4, !tbaa !5
%cmp10.not75 = icmp slt i32 %2, 1
br i1 %cmp10.not75, label %for.end51, label %for.body11.lr.ph
for.body11.lr.ph: ; preds = %for.end
%7 = icmp slt i32 %3, 1
br i1 %7, label %for.body11.lr.ph.split.us, label %for.body11
for.body11.lr.ph.split.us: ; preds = %for.body11.lr.ph
%add14.us = add nsw i32 %3, 1
%idxprom15.us = sext i32 %add14.us to i64
%8 = add i32 %2, 1
%wide.trip.count97 = zext i32 %8 to i64
%9 = add nsw i64 %wide.trip.count97, -1
%min.iters.check = icmp ult i32 %2, 16
br i1 %min.iters.check, label %for.body11.us.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body11.lr.ph.split.us
%10 = mul nsw i64 %idxprom15.us, 400
%11 = add i64 %10, add (i64 ptrtoint (ptr @d to i64), i64 4)
%12 = sub i64 %11, add (i64 ptrtoint (ptr @d to i64), i64 4)
%diff.check = icmp ult i64 %12, 32
br i1 %diff.check, label %for.body11.us.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %9, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = or i64 %index, 1
%13 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %offset.idx
store <4 x i32> zeroinitializer, ptr %13, align 4, !tbaa !5
%14 = getelementptr inbounds i32, ptr %13, i64 4
store <4 x i32> zeroinitializer, ptr %14, align 4, !tbaa !5
%15 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom15.us, i64 %offset.idx
store <4 x i32> zeroinitializer, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
store <4 x i32> zeroinitializer, ptr %16, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %9, %n.vec
br i1 %cmp.n, label %for.cond33.preheader, label %for.body11.us.preheader
for.body11.us.preheader: ; preds = %vector.memcheck, %for.body11.lr.ph.split.us, %middle.block
%indvars.iv94.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %for.body11.lr.ph.split.us ], [ %ind.end, %middle.block ]
%18 = and i64 %wide.trip.count97, 1
%lcmp.mod122.not.not = icmp eq i64 %18, 0
br i1 %lcmp.mod122.not.not, label %for.body11.us.prol, label %for.body11.us.prol.loopexit
for.body11.us.prol: ; preds = %for.body11.us.preheader
%arrayidx13.us.prol = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv94.ph
store i32 0, ptr %arrayidx13.us.prol, align 4, !tbaa !5
%arrayidx18.us.prol = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom15.us, i64 %indvars.iv94.ph
store i32 0, ptr %arrayidx18.us.prol, align 4, !tbaa !5
%indvars.iv.next95.prol = add nuw nsw i64 %indvars.iv94.ph, 1
br label %for.body11.us.prol.loopexit
for.body11.us.prol.loopexit: ; preds = %for.body11.us.prol, %for.body11.us.preheader
%indvars.iv94.unr = phi i64 [ %indvars.iv94.ph, %for.body11.us.preheader ], [ %indvars.iv.next95.prol, %for.body11.us.prol ]
%19 = sub nsw i64 0, %wide.trip.count97
%20 = xor i64 %indvars.iv94.ph, %19
%21 = icmp eq i64 %20, -1
br i1 %21, label %for.cond33.preheader, label %for.body11.us
for.body11.us: ; preds = %for.body11.us.prol.loopexit, %for.body11.us
%indvars.iv94 = phi i64 [ %indvars.iv.next95.1, %for.body11.us ], [ %indvars.iv94.unr, %for.body11.us.prol.loopexit ]
%arrayidx13.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv94
store i32 0, ptr %arrayidx13.us, align 4, !tbaa !5
%arrayidx18.us = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom15.us, i64 %indvars.iv94
store i32 0, ptr %arrayidx18.us, align 4, !tbaa !5
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%arrayidx13.us.1 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv.next95
store i32 0, ptr %arrayidx13.us.1, align 4, !tbaa !5
%arrayidx18.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom15.us, i64 %indvars.iv.next95
store i32 0, ptr %arrayidx18.us.1, align 4, !tbaa !5
%indvars.iv.next95.1 = add nuw nsw i64 %indvars.iv94, 2
%exitcond98.not.1 = icmp eq i64 %indvars.iv.next95.1, %wide.trip.count97
br i1 %exitcond98.not.1, label %for.cond33.preheader, label %for.body11.us, !llvm.loop !16
for.cond33.preheader: ; preds = %for.inc30, %for.body11.us.prol.loopexit, %for.body11.us, %middle.block
%22 = phi i32 [ %3, %middle.block ], [ %3, %for.body11.us ], [ %3, %for.body11.us.prol.loopexit ], [ %30, %for.inc30 ]
%23 = phi i32 [ %2, %middle.block ], [ %2, %for.body11.us ], [ %2, %for.body11.us.prol.loopexit ], [ %29, %for.inc30 ]
%cmp34.not79 = icmp slt i32 %23, 1
%24 = icmp slt i32 %22, 1
%or.cond112 = or i1 %cmp34.not79, %24
br i1 %or.cond112, label %for.end51, label %for.cond36.preheader
for.body11: ; preds = %for.body11.lr.ph, %for.inc30
%25 = phi i32 [ %29, %for.inc30 ], [ %2, %for.body11.lr.ph ]
%26 = phi i32 [ %30, %for.inc30 ], [ %3, %for.body11.lr.ph ]
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.inc30 ], [ 1, %for.body11.lr.ph ]
%arrayidx13 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv91
store i32 0, ptr %arrayidx13, align 4, !tbaa !5
%add14 = add nsw i32 %26, 1
%idxprom15 = sext i32 %add14 to i64
%arrayidx18 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom15, i64 %indvars.iv91
store i32 0, ptr %arrayidx18, align 4, !tbaa !5
%cmp20.not73 = icmp slt i32 %26, 1
br i1 %cmp20.not73, label %for.inc30, label %for.body21
for.body21: ; preds = %for.body11, %for.body21
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.body21 ], [ 1, %for.body11 ]
%arrayidx25 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %indvars.iv91, i64 %indvars.iv88
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25)
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%27 = load i32, ptr %n, align 4, !tbaa !5
%28 = sext i32 %27 to i64
%cmp20.not.not = icmp slt i64 %indvars.iv88, %28
br i1 %cmp20.not.not, label %for.body21, label %for.inc30.loopexit, !llvm.loop !17
for.inc30.loopexit: ; preds = %for.body21
%.pre = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc30
for.inc30: ; preds = %for.inc30.loopexit, %for.body11
%29 = phi i32 [ %.pre, %for.inc30.loopexit ], [ %25, %for.body11 ]
%30 = phi i32 [ %27, %for.inc30.loopexit ], [ %26, %for.body11 ]
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%31 = sext i32 %29 to i64
%cmp10.not.not = icmp slt i64 %indvars.iv91, %31
br i1 %cmp10.not.not, label %for.body11, label %for.cond33.preheader, !llvm.loop !18
for.cond36.preheader: ; preds = %for.cond33.preheader, %for.inc49
%32 = phi i32 [ %41, %for.inc49 ], [ %23, %for.cond33.preheader ]
%33 = phi i32 [ %42, %for.inc49 ], [ %22, %for.cond33.preheader ]
%34 = phi i32 [ %43, %for.inc49 ], [ %22, %for.cond33.preheader ]
%indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.inc49 ], [ 1, %for.cond33.preheader ]
%cmp37.not77 = icmp slt i32 %34, 1
br i1 %cmp37.not77, label %for.inc49, label %for.body38.lr.ph
for.body38.lr.ph: ; preds = %for.cond36.preheader
%35 = trunc i64 %indvars.iv102 to i32
br label %for.body38
for.body38: ; preds = %for.body38.lr.ph, %for.inc46
%36 = phi i32 [ %33, %for.body38.lr.ph ], [ %39, %for.inc46 ]
%indvars.iv99 = phi i64 [ 1, %for.body38.lr.ph ], [ %indvars.iv.next100, %for.inc46 ]
%arrayidx42 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %indvars.iv102, i64 %indvars.iv99
%37 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%cmp43 = icmp eq i32 %37, 1
br i1 %cmp43, label %if.then44, label %for.inc46
if.then44: ; preds = %for.body38
%38 = trunc i64 %indvars.iv99 to i32
call void @mo(i32 noundef %35, i32 noundef %38, i32 noundef 0)
%.pre105 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc46
for.inc46: ; preds = %for.body38, %if.then44
%39 = phi i32 [ %36, %for.body38 ], [ %.pre105, %if.then44 ]
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%40 = sext i32 %39 to i64
%cmp37.not.not = icmp slt i64 %indvars.iv99, %40
br i1 %cmp37.not.not, label %for.body38, label %for.inc49.loopexit, !llvm.loop !20
for.inc49.loopexit: ; preds = %for.inc46
%.pre106 = load i32, ptr %m, align 4, !tbaa !5
br label %for.inc49
for.inc49: ; preds = %for.inc49.loopexit, %for.cond36.preheader
%41 = phi i32 [ %.pre106, %for.inc49.loopexit ], [ %32, %for.cond36.preheader ]
%42 = phi i32 [ %39, %for.inc49.loopexit ], [ %33, %for.cond36.preheader ]
%43 = phi i32 [ %39, %for.inc49.loopexit ], [ %34, %for.cond36.preheader ]
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%44 = sext i32 %41 to i64
%cmp34.not.not = icmp slt i64 %indvars.iv102, %44
br i1 %cmp34.not.not, label %for.cond36.preheader, label %for.end51, !llvm.loop !21
for.end51: ; preds = %for.inc49, %for.end, %for.cond33.preheader
%45 = load i32, ptr @max, align 4, !tbaa !5
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %45)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%46 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp eq i32 %46, 0
%47 = load i32, ptr %n, align 4
%cmp1 = icmp eq i32 %47, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end51, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @mo(i32 noundef %x, i32 noundef %y, i32 noundef %c) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %x to i64
%idxprom1 = sext i32 %y to i64
%arrayidx2 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom, i64 %idxprom1
store i32 0, ptr %arrayidx2, align 4, !tbaa !5
%inc = add nsw i32 %c, 1
%add = add nsw i32 %y, 1
%idxprom5 = sext i32 %add to i64
%arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom, i64 %idxprom5
%0 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
tail call void @mo(i32 noundef %x, i32 noundef %add, i32 noundef %inc)
br label %if.end
if.end: ; preds = %if.then, %entry
%sub = add nsw i32 %y, -1
%idxprom10 = sext i32 %sub to i64
%arrayidx11 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom, i64 %idxprom10
%1 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp eq i32 %1, 1
br i1 %cmp12, label %if.then13, label %if.end15
if.then13: ; preds = %if.end
tail call void @mo(i32 noundef %x, i32 noundef %sub, i32 noundef %inc)
br label %if.end15
if.end15: ; preds = %if.then13, %if.end
%sub16 = add nsw i32 %x, -1
%idxprom17 = sext i32 %sub16 to i64
%arrayidx20 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom17, i64 %idxprom1
%2 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%cmp21 = icmp eq i32 %2, 1
br i1 %cmp21, label %if.then22, label %if.end24
if.then22: ; preds = %if.end15
tail call void @mo(i32 noundef %sub16, i32 noundef %y, i32 noundef %inc)
br label %if.end24
if.end24: ; preds = %if.then22, %if.end15
%add25 = add nsw i32 %x, 1
%idxprom26 = sext i32 %add25 to i64
%arrayidx29 = getelementptr inbounds [100 x [100 x i32]], ptr @d, i64 0, i64 %idxprom26, i64 %idxprom1
%3 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp eq i32 %3, 1
br i1 %cmp30, label %if.then31, label %if.end33
if.then31: ; preds = %if.end24
tail call void @mo(i32 noundef %add25, i32 noundef %y, i32 noundef %inc)
br label %if.end33
if.end33: ; preds = %if.then31, %if.end24
store i32 1, ptr %arrayidx2, align 4, !tbaa !5
%4 = load i32, ptr @max, align 4, !tbaa !5
%cmp38.not = icmp sgt i32 %4, %c
br i1 %cmp38.not, label %if.end40, label %if.then39
if.then39: ; preds = %if.end33
store i32 %inc, ptr @max, align 4, !tbaa !5
br label %if.end40
if.end40: ; preds = %if.then39, %if.end33
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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !19}
|
#include <stdio.h>
int main(void)
{
int N=0;
long int max=0,sum=0;
long int array[200000];
scanf("%d",&N);
for(int i=0;i<N;i++){
scanf("%ld",&array[i]);
if(max<array[i]){
max=array[i];
//printf("a");
} else {
sum+=max-array[i];
//printf("b");
}
}
printf("%ld",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%array = alloca [200000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
store i32 0, ptr %N, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %array) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %sum.1, %for.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %array) #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 ]
%sum.019 = phi i64 [ %sum.1, %for.body ], [ 0, %entry ]
%max.018 = phi i64 [ %max.1, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x i64], ptr %array, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i64, ptr %arrayidx, align 8, !tbaa !9
%cmp4 = icmp slt i64 %max.018, %1
%sub = sub nsw i64 %max.018, %1
%max.1 = call i64 @llvm.smax.i64(i64 %max.018, i64 %1)
%add = select i1 %cmp4, i64 0, i64 %sub
%sum.1 = add nsw i64 %add, %sum.019
%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.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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
int max(int x,int y){
if(x>y)return x;
else return y;
}
int sort(int *a,int *b){
return *b-*a;
}
int main(void){
int n;
scanf("%d",&n);
int a[n],b[n];
for(int i=0;i<n;i++){
scanf("%lld",&a[i]);
b[i]=a[i];
}
int h=0;
long long ans=0;
for(int i=0;i<n;i++){
h=max(h,a[i]);
ans+=h-a[i];
}
printf("%lld",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235515/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235515/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%x.y = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
ret i32 %x.y
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #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
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %3, 0
br i1 %cmp30, label %for.body, label %for.cond.cleanup10
for.cond8.preheader: ; preds = %for.body
%cmp932 = icmp sgt i32 %5, 0
br i1 %cmp932, label %for.body11.preheader, label %for.cond.cleanup10
for.body11.preheader: ; preds = %for.cond8.preheader
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %5, 1
br i1 %4, label %for.cond.cleanup10.loopexit.unr-lcssa, label %for.body11.preheader.new
for.body11.preheader.new: ; preds = %for.body11.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body11
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
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond8.preheader, !llvm.loop !9
for.cond.cleanup10.loopexit.unr-lcssa: ; preds = %for.body11, %for.body11.preheader
%add.lcssa.ph = phi i64 [ undef, %for.body11.preheader ], [ %add.1, %for.body11 ]
%indvars.iv39.unr = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next40.1, %for.body11 ]
%ans.034.unr = phi i64 [ 0, %for.body11.preheader ], [ %add.1, %for.body11 ]
%h.033.unr = phi i32 [ 0, %for.body11.preheader ], [ %x.y.i.1, %for.body11 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup10, label %for.body11.epil
for.body11.epil: ; preds = %for.cond.cleanup10.loopexit.unr-lcssa
%arrayidx13.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv39.unr
%7 = load i32, ptr %arrayidx13.epil, align 4, !tbaa !5
%x.y.i.epil = call i32 @llvm.smax.i32(i32 %h.033.unr, i32 %7)
%sub.epil = sub nsw i32 %x.y.i.epil, %7
%conv.epil = sext i32 %sub.epil to i64
%add.epil = add nsw i64 %ans.034.unr, %conv.epil
br label %for.cond.cleanup10
for.cond.cleanup10: ; preds = %for.body11.epil, %for.cond.cleanup10.loopexit.unr-lcssa, %entry, %for.cond8.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond8.preheader ], [ 0, %entry ], [ %add.lcssa.ph, %for.cond.cleanup10.loopexit.unr-lcssa ], [ %add.epil, %for.body11.epil ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
for.body11: ; preds = %for.body11, %for.body11.preheader.new
%indvars.iv39 = phi i64 [ 0, %for.body11.preheader.new ], [ %indvars.iv.next40.1, %for.body11 ]
%ans.034 = phi i64 [ 0, %for.body11.preheader.new ], [ %add.1, %for.body11 ]
%h.033 = phi i32 [ 0, %for.body11.preheader.new ], [ %x.y.i.1, %for.body11 ]
%niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.body11 ]
%arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv39
%8 = load i32, ptr %arrayidx13, align 8, !tbaa !5
%x.y.i = call i32 @llvm.smax.i32(i32 %h.033, i32 %8)
%sub = sub nsw i32 %x.y.i, %8
%conv = sext i32 %sub to i64
%add = add nsw i64 %ans.034, %conv
%indvars.iv.next40 = or i64 %indvars.iv39, 1
%arrayidx13.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next40
%9 = load i32, ptr %arrayidx13.1, align 4, !tbaa !5
%x.y.i.1 = call i32 @llvm.smax.i32(i32 %x.y.i, i32 %9)
%sub.1 = sub nsw i32 %x.y.i.1, %9
%conv.1 = sext i32 %sub.1 to i64
%add.1 = add nsw i64 %add, %conv.1
%indvars.iv.next40.1 = add nuw nsw i64 %indvars.iv39, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup10.loopexit.unr-lcssa, label %for.body11, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define ll long long int
int main(){
ll N;
ll s = 0;
scanf("%lld",&N);
ll A[N];
scanf("%lld",A);
for(int i = 1;i < N;i++){
scanf("%lld",A+i);
if(A[i] < A[i-1]){
s += A[i-1] - A[i];
A[i] = A[i-1];
}
}
printf("%lld\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235559/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235559/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vla)
%2 = load i64, ptr %N, align 8, !tbaa !5
%cmp30 = icmp sgt i64 %2, 1
br i1 %cmp30, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%invariant.gep = getelementptr i64, ptr %vla, i64 -1
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
%s.0.lcssa = phi i64 [ 0, %entry ], [ %s.1, %for.inc ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %s.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
ret i32 0
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%s.031 = phi i64 [ 0, %for.body.preheader ], [ %s.1, %for.inc ]
%add.ptr = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%3 = load i64, ptr %add.ptr, align 8, !tbaa !5
%gep = getelementptr i64, ptr %invariant.gep, i64 %indvars.iv
%4 = load i64, ptr %gep, align 8, !tbaa !5
%cmp6 = icmp slt i64 %3, %4
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body
%sub13 = sub i64 %s.031, %3
%add = add i64 %sub13, %4
store i64 %4, ptr %add.ptr, align 8, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%s.1 = phi i64 [ %add, %if.then ], [ %s.031, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp sgt i64 %5, %indvars.iv.next
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 = !{!"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>
long long int max(long long int a, long long int b){
if(a>b) return a;
else return b;
}
int main(void){
int i, N, count;
long long int sum, A[200001];
char S[4], prev;
scanf("%d", &N);
// printf("%d\n", N);
for(i=0; i<N; i++){
scanf("%lld", &A[i]);
// printf("%d\n", A[i]);
}
sum=0;
for(i=1; i<N; i++){
sum+=max(0, A[i-1]-A[i]);
A[i]=max(A[i-1], A[i]);
// printf("%d %d\n", sum, A[i]);
}
printf("%lld", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235601/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235601/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%A = alloca [200001 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %for.end21
for.cond2.preheader: ; preds = %for.body
%cmp336 = icmp sgt i32 %3, 1
br i1 %cmp336, label %for.body4.preheader, label %for.end21
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %3 to i64
%.pre = load i64, ptr %A, align 16, !tbaa !9
%1 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %1, 1
%2 = icmp eq i32 %3, 2
br i1 %2, label %for.end21.loopexit.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i64 %1, -2
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200001 x i64], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !11
for.body4: ; preds = %for.body4, %for.body4.preheader.new
%5 = phi i64 [ %.pre, %for.body4.preheader.new ], [ %a.b.i33.1, %for.body4 ]
%indvars.iv42 = phi i64 [ 1, %for.body4.preheader.new ], [ %indvars.iv.next43.1, %for.body4 ]
%sum.037 = phi i64 [ 0, %for.body4.preheader.new ], [ %add.1, %for.body4 ]
%niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.body4 ]
%arrayidx8 = getelementptr inbounds [200001 x i64], ptr %A, i64 0, i64 %indvars.iv42
%6 = load i64, ptr %arrayidx8, align 8, !tbaa !9
%sub9 = sub nsw i64 %5, %6
%a.b.i = call i64 @llvm.smax.i64(i64 %sub9, i64 0)
%add = add nuw nsw i64 %a.b.i, %sum.037
%a.b.i33 = call i64 @llvm.smax.i64(i64 %5, i64 %6)
store i64 %a.b.i33, ptr %arrayidx8, align 8, !tbaa !9
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%arrayidx8.1 = getelementptr inbounds [200001 x i64], ptr %A, i64 0, i64 %indvars.iv.next43
%7 = load i64, ptr %arrayidx8.1, align 8, !tbaa !9
%sub9.1 = sub nsw i64 %a.b.i33, %7
%a.b.i.1 = call i64 @llvm.smax.i64(i64 %sub9.1, i64 0)
%add.1 = add nuw nsw i64 %a.b.i.1, %add
%a.b.i33.1 = call i64 @llvm.smax.i64(i64 %a.b.i33, i64 %7)
store i64 %a.b.i33.1, ptr %arrayidx8.1, align 8, !tbaa !9
%indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 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.end21.loopexit.unr-lcssa, label %for.body4, !llvm.loop !13
for.end21.loopexit.unr-lcssa: ; preds = %for.body4, %for.body4.preheader
%add.lcssa.ph = phi i64 [ undef, %for.body4.preheader ], [ %add.1, %for.body4 ]
%.unr = phi i64 [ %.pre, %for.body4.preheader ], [ %a.b.i33.1, %for.body4 ]
%indvars.iv42.unr = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next43.1, %for.body4 ]
%sum.037.unr = phi i64 [ 0, %for.body4.preheader ], [ %add.1, %for.body4 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end21, label %for.body4.epil
for.body4.epil: ; preds = %for.end21.loopexit.unr-lcssa
%arrayidx8.epil = getelementptr inbounds [200001 x i64], ptr %A, i64 0, i64 %indvars.iv42.unr
%8 = load i64, ptr %arrayidx8.epil, align 8, !tbaa !9
%sub9.epil = sub nsw i64 %.unr, %8
%a.b.i.epil = call i64 @llvm.smax.i64(i64 %sub9.epil, i64 0)
%add.epil = add nuw nsw i64 %a.b.i.epil, %sum.037.unr
%a.b.i33.epil = call i64 @llvm.smax.i64(i64 %.unr, i64 %8)
store i64 %a.b.i33.epil, ptr %arrayidx8.epil, align 8, !tbaa !9
br label %for.end21
for.end21: ; preds = %for.body4.epil, %for.end21.loopexit.unr-lcssa, %entry, %for.cond2.preheader
%sum.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %add.lcssa.ph, %for.end21.loopexit.unr-lcssa ], [ %add.epil, %for.body4.epil ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
#include<string.h>
#include<math.h>
#include <stdlib.h>
#include<ctype.h>
typedef long long LL;
#define rep(i,n) for(LL i=0; i<(LL)(n); i++)
//qsort
int compare_int(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
}
//比較
int max(int a, int b){
if (a>b) return a;
else return b;
}
int min(int a,int b) {
if(a>b) return b;
else return a;
}
//main関数
int main() {
LL N;
scanf("%lld",&N);
LL AA[N];
LL ans = 0;
rep(i,N){
scanf("%lld",&AA[i]);
if(AA[i] < AA[i-1] && i != 0){
ans += AA[i-1] - AA[i];
AA[i] = AA[i-1];
}
}
printf("%lld",ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235645/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235645/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
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 #1 {
entry:
%b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %b.a
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !9
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %N, align 8, !tbaa !9
%cmp25 = icmp sgt i64 %2, 0
br i1 %cmp25, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.1, %for.inc ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #7
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.027 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
%ans.026 = phi i64 [ %ans.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.027
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i64, ptr %arrayidx, align 8, !tbaa !9
%arrayidx3 = getelementptr i64, ptr %arrayidx, i64 -1
%4 = load i64, ptr %arrayidx3, align 8, !tbaa !9
%cmp4 = icmp slt i64 %3, %4
%cmp5 = icmp ne i64 %i.027, 0
%or.cond = and i1 %cmp5, %cmp4
br i1 %or.cond, label %if.then, label %for.inc
if.then: ; preds = %for.body
%sub9 = sub i64 %ans.026, %3
%add = add i64 %sub9, %4
store i64 %4, ptr %arrayidx, align 8, !tbaa !9
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%ans.1 = phi i64 [ %add, %if.then ], [ %ans.026, %for.body ]
%inc = add nuw nsw i64 %i.027, 1
%5 = load i64, ptr %N, align 8, !tbaa !9
%cmp = icmp slt i64 %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) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_MASS_MAX 200005 // 最大マス数
#define D_MASS_NONE '.' // マス - なし
// 内部変数
static FILE *szpFpI; // 入力
static int siA, siB, siC, siD; // 位置
static char sc1Mass[D_MASS_MAX]; // マス
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpA;
static int siTNo;
#endif
// 1行出力
int
fOutLine(
char *pcpLine // <I> 1行
)
{
char lc1Buf[1024];
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, pcpLine)) {
siRes = -1;
}
#else
printf("%s", pcpLine);
#endif
return 0;
}
// 移動チェック
int
fChkMove(
int piSNo // <I> 開始位置
, int piENo // <I> 終了位置
)
{
int i;
// 移動
int liMax = 0;
int liLen = 0;
for (i = piSNo; i <= piENo; i++) {
if (sc1Mass[i] == D_MASS_NONE) {
liLen++;
if (liMax < liLen) {
liMax = liLen;
}
}
else if (sc1Mass[i + 1] == D_MASS_NONE) {
liLen = 0;
}
else {
return -1;
}
}
return liMax;
}
// Bの妨げチェック
int
fChkB(
)
{
// D > C
if (siD > siC) {
return 0;
}
// Bの前後
if (sc1Mass[siB - 1] == D_MASS_NONE) {
if (sc1Mass[siB + 1] == D_MASS_NONE) {
return 0;
}
}
// Dの前後
if (sc1Mass[siD - 1] == D_MASS_NONE) {
if (sc1Mass[siD + 1] == D_MASS_NONE) {
return 0;
}
}
return -1;
}
// 実行メイン
int
fMain(
)
{
int liRet, liWork;
char lc1Buf[1024];
// 位置 - 取得
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d%d%d%d%d", &liWork, &siA, &siB, &siC, &siD);
siA--;
siB--;
siC--;
siD--;
// マス - 取得
fgets(sc1Mass, sizeof(sc1Mass), szpFpI);
// B -> D
liRet = fChkMove(siB, siD);
if (liRet < 0) {
return -1;
}
// Bの妨げチェック
if (liRet < 3) {
liRet = fChkB();
if (liRet != 0) {
return -1;
}
}
// A -> C
liRet = fChkMove(siA, siC);
if (liRet < 0) {
return -1;
}
return 0;
}
// 1回実行
int
fOne(
)
{
int liRet;
char lc1Buf[1024];
// 入力 - セット
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
szpFpI = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#else
szpFpI = stdin;
#endif
// 実行メイン
liRet = fMain();
// 1行出力
if (liRet == 0) {
sprintf(lc1Buf, "Yes\n");
}
else {
sprintf(lc1Buf, "No\n");
}
fOutLine(lc1Buf);
// 残データ有無
#ifdef D_TEST
lc1Buf[0] = '\0';
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, "")) {
siRes = -1;
}
#endif
// テストファイルクローズ
#ifdef D_TEST
fclose(szpFpI);
fclose(szpFpA);
#endif
// テスト結果
#ifdef D_TEST
if (siRes == 0) {
printf("OK %d\n", siTNo);
}
else {
printf("NG %d\n", siTNo);
}
#endif
return 0;
}
// プログラム開始
int
main()
{
#ifdef D_TEST
int i;
for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
siTNo = i;
fOne();
}
#else
fOne();
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235696/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235696/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@sc1Mass = internal global [200005 x i8] zeroinitializer, align 16
@siD = internal global i32 0, align 4
@siC = internal global i32 0, align 4
@siB = internal global i32 0, align 4
@szpFpI = internal unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1
@siA = internal global i32 0, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [5 x i8] c"Yes\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOutLine(ptr noundef %pcpLine) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %pcpLine)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fChkMove(i32 noundef %piSNo, i32 noundef %piENo) local_unnamed_addr #3 {
entry:
%cmp.not24 = icmp sgt i32 %piSNo, %piENo
br i1 %cmp.not24, label %cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %piSNo to i64
%1 = add i32 %piENo, 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.pre-phi, %for.inc ]
%liLen.027 = phi i32 [ 0, %for.body.preheader ], [ %liLen.1, %for.inc ]
%liMax.026 = phi i32 [ 0, %for.body.preheader ], [ %liMax.1, %for.inc ]
%arrayidx = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp1 = icmp eq i8 %2, 46
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %liLen.027, 1
%cmp3.not = icmp sgt i32 %liMax.026, %liLen.027
%spec.select = select i1 %cmp3.not, i32 %liMax.026, i32 %inc
%.pre = add nsw i64 %indvars.iv, 1
br label %for.inc
if.else: ; preds = %for.body
%3 = add nsw i64 %indvars.iv, 1
%arrayidx7 = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %3
%4 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%cmp9 = icmp eq i8 %4, 46
br i1 %cmp9, label %for.inc, label %cleanup
for.inc: ; preds = %if.then, %if.else
%indvars.iv.next.pre-phi = phi i64 [ %.pre, %if.then ], [ %3, %if.else ]
%liMax.1 = phi i32 [ %spec.select, %if.then ], [ %liMax.026, %if.else ]
%liLen.1 = phi i32 [ %inc, %if.then ], [ 0, %if.else ]
%lftr.wideiv = trunc i64 %indvars.iv.next.pre-phi to i32
%exitcond.not = icmp eq i32 %1, %lftr.wideiv
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !8
cleanup: ; preds = %if.else, %for.inc, %entry
%retval.0 = phi i32 [ 0, %entry ], [ %liMax.1, %for.inc ], [ -1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fChkB() local_unnamed_addr #4 {
entry:
%0 = load i32, ptr @siD, align 4, !tbaa !10
%1 = load i32, ptr @siC, align 4, !tbaa !10
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%2 = load i32, ptr @siB, align 4, !tbaa !10
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom
%3 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp1 = icmp eq i8 %3, 46
br i1 %cmp1, label %if.then3, label %if.end11
if.then3: ; preds = %if.end
%add = add nsw i32 %2, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom4
%4 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%cmp7 = icmp eq i8 %4, 46
br i1 %cmp7, label %return, label %if.end11
if.end11: ; preds = %if.then3, %if.end
%sub12 = add nsw i32 %0, -1
%idxprom13 = sext i32 %sub12 to i64
%arrayidx14 = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom13
%5 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%cmp16 = icmp eq i8 %5, 46
br i1 %cmp16, label %if.then18, label %if.end27
if.then18: ; preds = %if.end11
%add19 = add nsw i32 %0, 1
%idxprom20 = sext i32 %add19 to i64
%arrayidx21 = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom20
%6 = load i8, ptr %arrayidx21, align 1, !tbaa !5
%cmp23 = icmp eq i8 %6, 46
br i1 %cmp23, label %return, label %if.end27
if.end27: ; preds = %if.then18, %if.end11
br label %return
return: ; preds = %if.then18, %if.then3, %entry, %if.end27
%retval.0 = phi i32 [ -1, %if.end27 ], [ 0, %entry ], [ 0, %if.then3 ], [ 0, %if.then18 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fMain() local_unnamed_addr #0 {
entry:
%liWork = alloca i32, align 4
%lc1Buf = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liWork) #6
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #6
%0 = load ptr, ptr @szpFpI, align 8, !tbaa !12
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %liWork, ptr noundef nonnull @siA, ptr noundef nonnull @siB, ptr noundef nonnull @siC, ptr noundef nonnull @siD) #6
%1 = load i32, ptr @siA, align 4, !tbaa !10
%dec = add nsw i32 %1, -1
store i32 %dec, ptr @siA, align 4, !tbaa !10
%2 = load i32, ptr @siB, align 4, !tbaa !10
%dec3 = add nsw i32 %2, -1
store i32 %dec3, ptr @siB, align 4, !tbaa !10
%3 = load i32, ptr @siC, align 4, !tbaa !10
%dec4 = add nsw i32 %3, -1
store i32 %dec4, ptr @siC, align 4, !tbaa !10
%4 = load i32, ptr @siD, align 4, !tbaa !10
%dec5 = add nsw i32 %4, -1
store i32 %dec5, ptr @siD, align 4, !tbaa !10
%5 = load ptr, ptr @szpFpI, align 8, !tbaa !12
%call6 = call ptr @fgets(ptr noundef nonnull @sc1Mass, i32 noundef 200005, ptr noundef %5)
%6 = load i32, ptr @siB, align 4, !tbaa !10
%7 = load i32, ptr @siD, align 4, !tbaa !10
%cmp.not24.i = icmp sgt i32 %6, %7
br i1 %cmp.not24.i, label %if.then9, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%8 = sext i32 %6 to i64
%9 = add i32 %7, 1
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %8, %for.body.preheader.i ], [ %indvars.iv.next.pre-phi.i, %for.inc.i ]
%liLen.027.i = phi i32 [ 0, %for.body.preheader.i ], [ %liLen.1.i, %for.inc.i ]
%liMax.026.i = phi i32 [ 0, %for.body.preheader.i ], [ %liMax.1.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %indvars.iv.i
%10 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%cmp1.i = icmp eq i8 %10, 46
br i1 %cmp1.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %liLen.027.i, 1
%cmp3.not.i = icmp sgt i32 %liMax.026.i, %liLen.027.i
%spec.select.i = select i1 %cmp3.not.i, i32 %liMax.026.i, i32 %inc.i
%.pre.i = add nsw i64 %indvars.iv.i, 1
br label %for.inc.i
if.else.i: ; preds = %for.body.i
%11 = add nsw i64 %indvars.iv.i, 1
%arrayidx7.i = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %11
%12 = load i8, ptr %arrayidx7.i, align 1, !tbaa !5
%cmp9.i = icmp eq i8 %12, 46
br i1 %cmp9.i, label %for.inc.i, label %cleanup
for.inc.i: ; preds = %if.else.i, %if.then.i
%indvars.iv.next.pre-phi.i = phi i64 [ %.pre.i, %if.then.i ], [ %11, %if.else.i ]
%liMax.1.i = phi i32 [ %spec.select.i, %if.then.i ], [ %liMax.026.i, %if.else.i ]
%liLen.1.i = phi i32 [ %inc.i, %if.then.i ], [ 0, %if.else.i ]
%lftr.wideiv.i = trunc i64 %indvars.iv.next.pre-phi.i to i32
%exitcond.not.i = icmp eq i32 %9, %lftr.wideiv.i
br i1 %exitcond.not.i, label %fChkMove.exit, label %for.body.i, !llvm.loop !8
fChkMove.exit: ; preds = %for.inc.i
%cmp = icmp slt i32 %liMax.1.i, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %fChkMove.exit
%cmp8 = icmp ugt i32 %liMax.1.i, 2
%13 = load i32, ptr @siC, align 4
%cmp.i = icmp sgt i32 %7, %13
%or.cond = select i1 %cmp8, i1 true, i1 %cmp.i
br i1 %or.cond, label %if.end14, label %if.end.i
if.then9: ; preds = %entry
%.old = load i32, ptr @siC, align 4, !tbaa !10
%cmp.i.old = icmp sgt i32 %7, %.old
br i1 %cmp.i.old, label %if.end14, label %if.end.i
if.end.i: ; preds = %if.end, %if.then9
%14 = phi i32 [ %13, %if.end ], [ %.old, %if.then9 ]
%sub.i = add nsw i32 %6, -1
%idxprom.i = sext i32 %sub.i to i64
%arrayidx.i24 = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom.i
%15 = load i8, ptr %arrayidx.i24, align 1, !tbaa !5
%cmp1.i25 = icmp eq i8 %15, 46
br i1 %cmp1.i25, label %if.then3.i, label %if.end11.i
if.then3.i: ; preds = %if.end.i
%add.i = add nsw i32 %6, 1
%idxprom4.i = sext i32 %add.i to i64
%arrayidx5.i = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom4.i
%16 = load i8, ptr %arrayidx5.i, align 1, !tbaa !5
%cmp7.i = icmp eq i8 %16, 46
br i1 %cmp7.i, label %if.end14, label %if.end11.i
if.end11.i: ; preds = %if.then3.i, %if.end.i
%sub12.i = add nsw i32 %7, -1
%idxprom13.i = sext i32 %sub12.i to i64
%arrayidx14.i = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom13.i
%17 = load i8, ptr %arrayidx14.i, align 1, !tbaa !5
%cmp16.i = icmp eq i8 %17, 46
br i1 %cmp16.i, label %if.then18.i, label %cleanup
if.then18.i: ; preds = %if.end11.i
%add19.i = add nsw i32 %7, 1
%idxprom20.i = sext i32 %add19.i to i64
%arrayidx21.i = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %idxprom20.i
%18 = load i8, ptr %arrayidx21.i, align 1, !tbaa !5
%cmp23.i = icmp eq i8 %18, 46
br i1 %cmp23.i, label %if.end14, label %cleanup
if.end14: ; preds = %if.then18.i, %if.then3.i, %if.then9, %if.end
%19 = phi i32 [ %14, %if.then18.i ], [ %14, %if.then3.i ], [ %.old, %if.then9 ], [ %13, %if.end ]
%20 = load i32, ptr @siA, align 4, !tbaa !10
%cmp.not24.i27 = icmp sgt i32 %20, %19
br i1 %cmp.not24.i27, label %cleanup, label %for.body.preheader.i28
for.body.preheader.i28: ; preds = %if.end14
%21 = sext i32 %20 to i64
%22 = add i32 %19, 1
br label %for.body.i29
for.body.i29: ; preds = %for.inc.i39, %for.body.preheader.i28
%indvars.iv.i30 = phi i64 [ %21, %for.body.preheader.i28 ], [ %indvars.iv.next.pre-phi.i40, %for.inc.i39 ]
%liLen.027.i31 = phi i32 [ 0, %for.body.preheader.i28 ], [ %liLen.1.i42, %for.inc.i39 ]
%liMax.026.i32 = phi i32 [ 0, %for.body.preheader.i28 ], [ %liMax.1.i41.fr, %for.inc.i39 ]
%arrayidx.i33 = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %indvars.iv.i30
%23 = load i8, ptr %arrayidx.i33, align 1, !tbaa !5
%cmp1.i34 = icmp eq i8 %23, 46
br i1 %cmp1.i34, label %if.then.i45, label %if.else.i35
if.then.i45: ; preds = %for.body.i29
%inc.i46 = add nsw i32 %liLen.027.i31, 1
%cmp3.not.i47 = icmp sgt i32 %liMax.026.i32, %liLen.027.i31
%spec.select.i48 = select i1 %cmp3.not.i47, i32 %liMax.026.i32, i32 %inc.i46
%.pre.i49 = add nsw i64 %indvars.iv.i30, 1
br label %for.inc.i39
if.else.i35: ; preds = %for.body.i29
%24 = add nsw i64 %indvars.iv.i30, 1
%arrayidx7.i36 = getelementptr inbounds [200005 x i8], ptr @sc1Mass, i64 0, i64 %24
%25 = load i8, ptr %arrayidx7.i36, align 1, !tbaa !5
%cmp9.i37 = icmp eq i8 %25, 46
br i1 %cmp9.i37, label %for.inc.i39, label %fChkMove.exit50.thread
for.inc.i39: ; preds = %if.else.i35, %if.then.i45
%indvars.iv.next.pre-phi.i40 = phi i64 [ %.pre.i49, %if.then.i45 ], [ %24, %if.else.i35 ]
%liMax.1.i41 = phi i32 [ %spec.select.i48, %if.then.i45 ], [ %liMax.026.i32, %if.else.i35 ]
%liLen.1.i42 = phi i32 [ %inc.i46, %if.then.i45 ], [ 0, %if.else.i35 ]
%liMax.1.i41.fr = freeze i32 %liMax.1.i41
%lftr.wideiv.i43 = trunc i64 %indvars.iv.next.pre-phi.i40 to i32
%exitcond.not.i44 = icmp eq i32 %22, %lftr.wideiv.i43
br i1 %exitcond.not.i44, label %fChkMove.exit50, label %for.body.i29, !llvm.loop !8
fChkMove.exit50: ; preds = %for.inc.i39
%cmp16 = icmp slt i32 %liMax.1.i41.fr, 0
br i1 %cmp16, label %fChkMove.exit50.thread, label %cleanup
fChkMove.exit50.thread: ; preds = %if.else.i35, %fChkMove.exit50
br label %cleanup
cleanup: ; preds = %if.else.i, %if.end14, %fChkMove.exit50.thread, %fChkMove.exit50, %if.then18.i, %if.end11.i, %fChkMove.exit
%retval.0 = phi i32 [ -1, %fChkMove.exit ], [ -1, %if.end11.i ], [ -1, %if.then18.i ], [ -1, %fChkMove.exit50.thread ], [ 0, %fChkMove.exit50 ], [ 0, %if.end14 ], [ -1, %if.else.i ]
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liWork) #6
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOne() local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #6
%0 = load ptr, ptr @stdin, align 8, !tbaa !12
store ptr %0, ptr @szpFpI, align 8, !tbaa !12
%call = tail call i32 @fMain(), !range !14
%cmp = icmp eq i32 %call, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(5) %lc1Buf, ptr noundef nonnull align 1 dereferenceable(5) @.str.2, i64 5, i1 false)
br label %if.end
if.else: ; preds = %entry
store i32 683854, ptr %lc1Buf, align 16
br label %if.end
if.end: ; preds = %if.else, %if.then
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #6
ret i32 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%lc1Buf.i = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf.i) #6
%0 = load ptr, ptr @stdin, align 8, !tbaa !12
store ptr %0, ptr @szpFpI, align 8, !tbaa !12
%call.i = tail call i32 @fMain(), !range !14
%cmp.i = icmp eq i32 %call.i, 0
br i1 %cmp.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %entry
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(5) %lc1Buf.i, ptr noundef nonnull align 1 dereferenceable(5) @.str.2, i64 5, i1 false)
br label %fOne.exit
if.else.i: ; preds = %entry
store i32 683854, ptr %lc1Buf.i, align 16
br label %fOne.exit
fOne.exit: ; preds = %if.then.i, %if.else.i
%call.i.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf.i)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf.i) #6
ret i32 0
}
; 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) #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 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 nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{i32 -1, i32 1}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d",&n);
char s[n];
scanf("%s",s);
int a=0;
for(int i=0;i<50;i++){
if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
a++;
}
printf("%d",a);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235782/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235782/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; 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 i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%invariant.gep = getelementptr i8, ptr %vla, i64 2
br label %for.body
for.cond.cleanup: ; preds = %for.inc.1
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %a.1.1)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %for.inc.1, %entry
%indvars.iv = phi i64 [ 0, %entry ], [ %8, %for.inc.1 ]
%a.023 = phi i32 [ 0, %entry ], [ %a.1.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%3 = load i8, ptr %arrayidx, align 2, !tbaa !9
%cmp2 = icmp eq i8 %3, 65
%4 = or i64 %indvars.iv, 1
br i1 %cmp2, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%arrayidx5 = getelementptr inbounds i8, ptr %vla, i64 %4
%5 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp7 = icmp eq i8 %5, 66
br i1 %cmp7, label %land.lhs.true9, label %for.inc
land.lhs.true9: ; preds = %land.lhs.true
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
%6 = load i8, ptr %gep, align 2, !tbaa !9
%cmp14 = icmp eq i8 %6, 67
%inc = zext i1 %cmp14 to i32
%spec.select = add nsw i32 %a.023, %inc
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true9, %land.lhs.true
%a.1 = phi i32 [ %spec.select, %land.lhs.true9 ], [ %a.023, %land.lhs.true ], [ %a.023, %for.body ]
%arrayidx.1 = getelementptr inbounds i8, ptr %vla, i64 %4
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp2.1 = icmp eq i8 %7, 65
%8 = add nuw nsw i64 %indvars.iv, 2
br i1 %cmp2.1, label %land.lhs.true.1, label %for.inc.1
land.lhs.true.1: ; preds = %for.inc
%arrayidx5.1 = getelementptr inbounds i8, ptr %vla, i64 %8
%9 = load i8, ptr %arrayidx5.1, align 2, !tbaa !9
%cmp7.1 = icmp eq i8 %9, 66
br i1 %cmp7.1, label %land.lhs.true9.1, label %for.inc.1
land.lhs.true9.1: ; preds = %land.lhs.true.1
%gep.1 = getelementptr i8, ptr %invariant.gep, i64 %4
%10 = load i8, ptr %gep.1, align 1, !tbaa !9
%cmp14.1 = icmp eq i8 %10, 67
%inc.1 = zext i1 %cmp14.1 to i32
%spec.select.1 = add nsw i32 %a.1, %inc.1
br label %for.inc.1
for.inc.1: ; preds = %land.lhs.true9.1, %land.lhs.true.1, %for.inc
%a.1.1 = phi i32 [ %spec.select.1, %land.lhs.true9.1 ], [ %a.1, %land.lhs.true.1 ], [ %a.1, %for.inc ]
%exitcond.not.1 = icmp eq i64 %8, 50
br i1 %exitcond.not.1, label %for.cond.cleanup, label %for.body, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int N;
char S[50];
int count=0;
int i;
scanf("%d",&N);
scanf(" %c",&S[0]);
for(i=1;i<N;i++){
scanf("%c",&S[i]);
}
for(i=0;i<=N-3;i++){
if(S[i]=='A'&&S[i+1]=='B'&&S[i+2]=='C'){
count++;
}
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235825/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235825/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%S = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %S) #3
%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 %S)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %0, 1
br i1 %cmp36, label %for.body, label %for.end26
for.cond4.preheader: ; preds = %for.body
%cmp5.not38 = icmp slt i32 %3, 3
br i1 %cmp5.not38, label %for.end26, label %for.body6.preheader
for.body6.preheader: ; preds = %for.cond4.preheader
%1 = add i32 %3, -2
%wide.trip.count = zext i32 %1 to i64
%xtraiter = and i64 %wide.trip.count, 1
%2 = icmp eq i32 %1, 1
br i1 %2, label %for.end26.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx2 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.inc24.1, %for.body6.preheader.new
%indvars.iv44 = phi i64 [ 0, %for.body6.preheader.new ], [ %11, %for.inc24.1 ]
%count.039 = phi i32 [ 0, %for.body6.preheader.new ], [ %count.1.1, %for.inc24.1 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.inc24.1 ]
%arrayidx8 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv44
%5 = load i8, ptr %arrayidx8, align 2, !tbaa !11
%cmp9 = icmp eq i8 %5, 65
%6 = or i64 %indvars.iv44, 1
br i1 %cmp9, label %land.lhs.true, label %for.inc24
land.lhs.true: ; preds = %for.body6
%arrayidx12 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %6
%7 = load i8, ptr %arrayidx12, align 1, !tbaa !11
%cmp14 = icmp eq i8 %7, 66
br i1 %cmp14, label %land.lhs.true16, label %for.inc24
land.lhs.true16: ; preds = %land.lhs.true
%8 = add nuw nsw i64 %indvars.iv44, 2
%arrayidx19 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %8
%9 = load i8, ptr %arrayidx19, align 2, !tbaa !11
%cmp21 = icmp eq i8 %9, 67
%inc23 = zext i1 %cmp21 to i32
%spec.select = add nsw i32 %count.039, %inc23
br label %for.inc24
for.inc24: ; preds = %for.body6, %land.lhs.true16, %land.lhs.true
%count.1 = phi i32 [ %spec.select, %land.lhs.true16 ], [ %count.039, %land.lhs.true ], [ %count.039, %for.body6 ]
%arrayidx8.1 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %6
%10 = load i8, ptr %arrayidx8.1, align 1, !tbaa !11
%cmp9.1 = icmp eq i8 %10, 65
%11 = add nuw nsw i64 %indvars.iv44, 2
br i1 %cmp9.1, label %land.lhs.true.1, label %for.inc24.1
land.lhs.true.1: ; preds = %for.inc24
%arrayidx12.1 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %11
%12 = load i8, ptr %arrayidx12.1, align 2, !tbaa !11
%cmp14.1 = icmp eq i8 %12, 66
br i1 %cmp14.1, label %land.lhs.true16.1, label %for.inc24.1
land.lhs.true16.1: ; preds = %land.lhs.true.1
%13 = add nuw nsw i64 %indvars.iv44, 3
%arrayidx19.1 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %13
%14 = load i8, ptr %arrayidx19.1, align 1, !tbaa !11
%cmp21.1 = icmp eq i8 %14, 67
%inc23.1 = zext i1 %cmp21.1 to i32
%spec.select.1 = add nsw i32 %count.1, %inc23.1
br label %for.inc24.1
for.inc24.1: ; preds = %land.lhs.true16.1, %land.lhs.true.1, %for.inc24
%count.1.1 = phi i32 [ %spec.select.1, %land.lhs.true16.1 ], [ %count.1, %land.lhs.true.1 ], [ %count.1, %for.inc24 ]
%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.end26.loopexit.unr-lcssa, label %for.body6, !llvm.loop !12
for.end26.loopexit.unr-lcssa: ; preds = %for.inc24.1, %for.body6.preheader
%count.1.lcssa.ph = phi i32 [ undef, %for.body6.preheader ], [ %count.1.1, %for.inc24.1 ]
%indvars.iv44.unr = phi i64 [ 0, %for.body6.preheader ], [ %11, %for.inc24.1 ]
%count.039.unr = phi i32 [ 0, %for.body6.preheader ], [ %count.1.1, %for.inc24.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end26, label %for.body6.epil
for.body6.epil: ; preds = %for.end26.loopexit.unr-lcssa
%arrayidx8.epil = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv44.unr
%15 = load i8, ptr %arrayidx8.epil, align 1, !tbaa !11
%cmp9.epil = icmp eq i8 %15, 65
br i1 %cmp9.epil, label %land.lhs.true.epil, label %for.end26
land.lhs.true.epil: ; preds = %for.body6.epil
%16 = add nuw nsw i64 %indvars.iv44.unr, 1
%arrayidx12.epil = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %16
%17 = load i8, ptr %arrayidx12.epil, align 1, !tbaa !11
%cmp14.epil = icmp eq i8 %17, 66
br i1 %cmp14.epil, label %land.lhs.true16.epil, label %for.end26
land.lhs.true16.epil: ; preds = %land.lhs.true.epil
%18 = add nuw nsw i64 %indvars.iv44.unr, 2
%arrayidx19.epil = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %18
%19 = load i8, ptr %arrayidx19.epil, align 1, !tbaa !11
%cmp21.epil = icmp eq i8 %19, 67
%inc23.epil = zext i1 %cmp21.epil to i32
%spec.select.epil = add nsw i32 %count.039.unr, %inc23.epil
br label %for.end26
for.end26: ; preds = %for.end26.loopexit.unr-lcssa, %land.lhs.true16.epil, %land.lhs.true.epil, %for.body6.epil, %entry, %for.cond4.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %count.1.lcssa.ph, %for.end26.loopexit.unr-lcssa ], [ %spec.select.epil, %land.lhs.true16.epil ], [ %count.039.unr, %land.lhs.true.epil ], [ %count.039.unr, %for.body6.epil ]
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 50, 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: 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(){
int l,i,cnt=0;
scanf("%d",&l);
char str[l];
scanf("%s",str);
for(i=0;i<l;i++){
if(str[i]=='A'){
if(str[i+1]=='B'&&str[i+2]=='C'){
cnt++;
i+=2;
}
}
}
printf("%d",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235869/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235869/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%0 = load i32, ptr %l, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%3 = load i32, ptr %l, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %3, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.029 = phi i32 [ %inc18, %for.inc ], [ 0, %entry ]
%cnt.028 = phi i32 [ %cnt.1, %for.inc ], [ 0, %entry ]
%idxprom = sext i32 %i.029 to i64
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %idxprom
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp2 = icmp eq i8 %4, 65
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
%add = add nsw i32 %i.029, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds i8, ptr %vla, i64 %idxprom4
%5 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp7 = icmp eq i8 %5, 66
br i1 %cmp7, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %if.then
%add9 = add nsw i32 %i.029, 2
%idxprom10 = sext i32 %add9 to i64
%arrayidx11 = getelementptr inbounds i8, ptr %vla, i64 %idxprom10
%6 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%cmp13 = icmp eq i8 %6, 67
%inc = zext i1 %cmp13 to i32
%spec.select = add nsw i32 %cnt.028, %inc
%spec.select26 = select i1 %cmp13, i32 %add9, i32 %i.029
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body, %if.then
%cnt.1 = phi i32 [ %cnt.028, %if.then ], [ %cnt.028, %for.body ], [ %spec.select, %land.lhs.true ]
%i.1 = phi i32 [ %i.029, %if.then ], [ %i.029, %for.body ], [ %spec.select26, %land.lhs.true ]
%inc18 = add nsw i32 %i.1, 1
%cmp = icmp slt i32 %inc18, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.inc, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %for.inc ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cnt.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n;
int i;
char a[50];
int cnt=0;
scanf("%d%s",&n,a);
for(i=0;i<n-2;i++)
if(a[i]=='A')
if(a[i+1]=='B')
if(a[i+2]=='C')
cnt++;
printf("%d",cnt);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235919/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235919/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %a) #3
%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
%cmp25 = icmp sgt i32 %0, 2
br i1 %cmp25, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add i32 %0, -2
%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.end.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.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %8, %for.inc.1 ]
%cnt.027 = phi i32 [ 0, %for.body.preheader.new ], [ %cnt.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 2, !tbaa !9
%cmp1 = icmp eq i8 %2, 65
%3 = or i64 %indvars.iv, 1
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx4 = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %3
%4 = load i8, ptr %arrayidx4, align 1, !tbaa !9
%cmp6 = icmp eq i8 %4, 66
br i1 %cmp6, label %if.then8, label %for.inc
if.then8: ; preds = %if.then
%5 = add nuw nsw i64 %indvars.iv, 2
%arrayidx11 = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %5
%6 = load i8, ptr %arrayidx11, align 2, !tbaa !9
%cmp13 = icmp eq i8 %6, 67
%inc = zext i1 %cmp13 to i32
%spec.select = add nsw i32 %cnt.027, %inc
br label %for.inc
for.inc: ; preds = %for.body, %if.then8, %if.then
%cnt.1 = phi i32 [ %spec.select, %if.then8 ], [ %cnt.027, %if.then ], [ %cnt.027, %for.body ]
%arrayidx.1 = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %3
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp1.1 = icmp eq i8 %7, 65
%8 = add nuw nsw i64 %indvars.iv, 2
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%arrayidx4.1 = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %8
%9 = load i8, ptr %arrayidx4.1, align 2, !tbaa !9
%cmp6.1 = icmp eq i8 %9, 66
br i1 %cmp6.1, label %if.then8.1, label %for.inc.1
if.then8.1: ; preds = %if.then.1
%10 = add nuw nsw i64 %indvars.iv, 3
%arrayidx11.1 = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %10
%11 = load i8, ptr %arrayidx11.1, align 1, !tbaa !9
%cmp13.1 = icmp eq i8 %11, 67
%inc.1 = zext i1 %cmp13.1 to i32
%spec.select.1 = add nsw i32 %cnt.1, %inc.1
br label %for.inc.1
for.inc.1: ; preds = %if.then8.1, %if.then.1, %for.inc
%cnt.1.1 = phi i32 [ %spec.select.1, %if.then8.1 ], [ %cnt.1, %if.then.1 ], [ %cnt.1, %for.inc ]
%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 !10
for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%cnt.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %8, %for.inc.1 ]
%cnt.027.unr = phi i32 [ 0, %for.body.preheader ], [ %cnt.1.1, %for.inc.1 ]
%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 [50 x i8], ptr %a, i64 0, i64 %indvars.iv.unr
%12 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%cmp1.epil = icmp eq i8 %12, 65
br i1 %cmp1.epil, label %if.then.epil, label %for.end
if.then.epil: ; preds = %for.body.epil
%13 = add nuw nsw i64 %indvars.iv.unr, 1
%arrayidx4.epil = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %13
%14 = load i8, ptr %arrayidx4.epil, align 1, !tbaa !9
%cmp6.epil = icmp eq i8 %14, 66
br i1 %cmp6.epil, label %if.then8.epil, label %for.end
if.then8.epil: ; preds = %if.then.epil
%15 = add nuw nsw i64 %indvars.iv.unr, 2
%arrayidx11.epil = getelementptr inbounds [50 x i8], ptr %a, i64 0, i64 %15
%16 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !9
%cmp13.epil = icmp eq i8 %16, 67
%inc.epil = zext i1 %cmp13.epil to i32
%spec.select.epil = add nsw i32 %cnt.027.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then8.epil, %if.then.epil, %for.body.epil, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %if.then8.epil ], [ %cnt.027.unr, %if.then.epil ], [ %cnt.027.unr, %for.body.epil ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 50, 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>
int main(void) {
/* code */
int i,n;
int ans = 0;
scanf("%d", &n);
char s[n+1];
scanf("%s\n",s);
for (i = 0; i < n-2; i++) {
if(s[i] == 'A'){
if(s[i+1] == 'B' && s[i+2] =='C'){
ans++;
}
}
/* code */
}
printf("%d\n",ans );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_235962/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_235962/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %3, 2
br i1 %cmp25, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add i32 %3, -2
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i8, ptr %vla, i64 2
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %sub, 1
br i1 %4, label %for.end.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.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %10, %for.inc.1 ]
%ans.026 = phi i32 [ 0, %for.body.preheader.new ], [ %ans.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%5 = load i8, ptr %arrayidx, align 2, !tbaa !9
%cmp2 = icmp eq i8 %5, 65
%6 = or i64 %indvars.iv, 1
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx6 = getelementptr inbounds i8, ptr %vla, i64 %6
%7 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp8 = icmp eq i8 %7, 66
br i1 %cmp8, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %if.then
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv
%8 = load i8, ptr %gep, align 2, !tbaa !9
%cmp14 = icmp eq i8 %8, 67
%inc = zext i1 %cmp14 to i32
%spec.select = add nsw i32 %ans.026, %inc
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %if.then
%ans.1 = phi i32 [ %spec.select, %land.lhs.true ], [ %ans.026, %if.then ], [ %ans.026, %for.body ]
%arrayidx.1 = getelementptr inbounds i8, ptr %vla, i64 %6
%9 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp2.1 = icmp eq i8 %9, 65
%10 = add nuw nsw i64 %indvars.iv, 2
br i1 %cmp2.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%arrayidx6.1 = getelementptr inbounds i8, ptr %vla, i64 %10
%11 = load i8, ptr %arrayidx6.1, align 2, !tbaa !9
%cmp8.1 = icmp eq i8 %11, 66
br i1 %cmp8.1, label %land.lhs.true.1, label %for.inc.1
land.lhs.true.1: ; preds = %if.then.1
%gep.1 = getelementptr i8, ptr %invariant.gep, i64 %6
%12 = load i8, ptr %gep.1, align 1, !tbaa !9
%cmp14.1 = icmp eq i8 %12, 67
%inc.1 = zext i1 %cmp14.1 to i32
%spec.select.1 = add nsw i32 %ans.1, %inc.1
br label %for.inc.1
for.inc.1: ; preds = %land.lhs.true.1, %if.then.1, %for.inc
%ans.1.1 = phi i32 [ %spec.select.1, %land.lhs.true.1 ], [ %ans.1, %if.then.1 ], [ %ans.1, %for.inc ]
%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 !10
for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%ans.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %ans.1.1, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %10, %for.inc.1 ]
%ans.026.unr = phi i32 [ 0, %for.body.preheader ], [ %ans.1.1, %for.inc.1 ]
%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 i8, ptr %vla, i64 %indvars.iv.unr
%13 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%cmp2.epil = icmp eq i8 %13, 65
br i1 %cmp2.epil, label %if.then.epil, label %for.end
if.then.epil: ; preds = %for.body.epil
%14 = getelementptr i8, ptr %vla, i64 %indvars.iv.unr
%arrayidx6.epil = getelementptr i8, ptr %14, i64 1
%15 = load i8, ptr %arrayidx6.epil, align 1, !tbaa !9
%cmp8.epil = icmp eq i8 %15, 66
br i1 %cmp8.epil, label %land.lhs.true.epil, label %for.end
land.lhs.true.epil: ; preds = %if.then.epil
%gep.epil = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.unr
%16 = load i8, ptr %gep.epil, align 1, !tbaa !9
%cmp14.epil = icmp eq i8 %16, 67
%inc.epil = zext i1 %cmp14.epil to i32
%spec.select.epil = add nsw i32 %ans.026.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.end.loopexit.unr-lcssa, %land.lhs.true.epil, %if.then.epil, %for.body.epil, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %land.lhs.true.epil ], [ %ans.026.unr, %if.then.epil ], [ %ans.026.unr, %for.body.epil ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int n,i,k,count;
char c;
scanf("%d",&n);
getchar();
k=count=0;
for(i=0;i<n;i++){
c=getchar();
if(c=='A'&&k==0)
k++;
else if(c=='B'&&k==1)
k++;
else if(c=='C'&&k==2)
k++;
else if(c=='A'&&k==1)
k=1;
else
k=0;
if(k==3){
count++;
k=0;
}
}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236004/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236004/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call i32 @getc(ptr noundef %0)
%1 = load i32, ptr %n, align 4, !tbaa !9
%cmp69 = icmp sgt i32 %1, 0
br i1 %cmp69, label %for.body, label %for.end
for.body: ; preds = %entry, %for.cond
%i.072 = phi i32 [ %inc42, %for.cond ], [ 0, %entry ]
%count.071 = phi i32 [ %5, %for.cond ], [ 0, %entry ]
%k.070 = phi i32 [ %4, %for.cond ], [ 0, %entry ]
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i60 = call i32 @getc(ptr noundef %2)
%sext = shl i32 %call.i60, 24
%cmp4 = icmp eq i32 %sext, 1090519040
%cmp6 = icmp eq i32 %k.070, 0
%or.cond = and i1 %cmp6, %cmp4
br i1 %or.cond, label %for.cond, label %if.else
if.else: ; preds = %for.body
%cmp9 = icmp eq i32 %sext, 1107296256
%cmp12 = icmp eq i32 %k.070, 1
%or.cond44 = and i1 %cmp12, %cmp9
br i1 %or.cond44, label %for.cond, label %if.else16
if.else16: ; preds = %if.else
%cmp18 = icmp eq i32 %sext, 1124073472
%cmp21 = icmp eq i32 %k.070, 2
%or.cond45 = and i1 %cmp21, %cmp18
br i1 %or.cond45, label %3, label %if.else25
if.else25: ; preds = %if.else16
%or.cond46 = and i1 %cmp12, %cmp4
%. = zext i1 %or.cond46 to i32
br label %for.cond
3: ; preds = %if.else16
%inc40 = add nsw i32 %count.071, 1
br label %for.cond
for.cond: ; preds = %if.else25, %if.else, %for.body, %3
%4 = phi i32 [ 0, %3 ], [ %., %if.else25 ], [ 2, %if.else ], [ 1, %for.body ]
%5 = phi i32 [ %inc40, %3 ], [ %count.071, %if.else25 ], [ %count.071, %if.else ], [ %count.071, %for.body ]
%inc42 = add nuw nsw i32 %i.072, 1
%6 = load i32, ptr %n, align 4, !tbaa !9
%cmp = icmp slt i32 %inc42, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.cond, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %5, %for.cond ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa)
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
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
char str[100];
int n,i,j,x,y;
if(scanf("%d", &n)== 1);
scanf("%s",str);
j=0;
for(i=0;str[i];i++) {
if(str[i]=='A') {
x = i + 1;
if(str[x]=='B'){
y = x + 1;
if(str[y]=='C'){
j++;
}
}
}
}
printf("%d",j);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236048/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236048/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [100 x i8], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str)
br label %for.cond.outer
for.cond.outer: ; preds = %if.then12, %entry
%indvars.iv.ph = phi i64 [ %1, %if.then12 ], [ 0, %entry ]
%j.0.ph = phi i32 [ %spec.select, %if.then12 ], [ 0, %entry ]
br label %for.cond
for.cond: ; preds = %for.cond.backedge, %for.cond.outer
%indvars.iv = phi i64 [ %indvars.iv.ph, %for.cond.outer ], [ %indvars.iv.be, %for.cond.backedge ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %for.cond.for.inc_crit_edge [
i8 0, label %for.end
i8 65, label %if.then6
]
for.cond.for.inc_crit_edge: ; preds = %for.cond
%.pre = add nuw i64 %indvars.iv, 1
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.cond.for.inc_crit_edge, %if.then6
%indvars.iv.be = phi i64 [ %.pre, %for.cond.for.inc_crit_edge ], [ %1, %if.then6 ]
br label %for.cond, !llvm.loop !8
if.then6: ; preds = %for.cond
%1 = add nuw i64 %indvars.iv, 1
%arrayidx8 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %1
%2 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10 = icmp eq i8 %2, 66
br i1 %cmp10, label %if.then12, label %for.cond.backedge
if.then12: ; preds = %if.then6
%3 = add nuw nsw i64 %indvars.iv, 2
%arrayidx15 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %3
%4 = load i8, ptr %arrayidx15, align 1, !tbaa !5
%cmp17 = icmp eq i8 %4, 67
%inc = zext i1 %cmp17 to i32
%spec.select = add nuw nsw i32 %j.0.ph, %inc
br label %for.cond.outer, !llvm.loop !8
for.end: ; preds = %for.cond
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %j.0.ph)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
// Your code here!
int n,x,y,z;
int count = 0;
char s[256] = {};
scanf("%d",&n);
scanf("%s",s);
for (int i = 0; i < n - 2; i++){
if (s[i] == 'A'){
if (s[i + 1] == 'B'){
if (s[i + 2] == 'C'){
count++;
i = i + 2;
}
}
}
}
printf("%d",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236099/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236099/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [256 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %s) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %s, i8 0, i64 256, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %0, -2
%cmp29 = icmp sgt i32 %0, 2
br i1 %cmp29, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1, %for.inc ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.031 = phi i32 [ %inc20, %for.inc ], [ 0, %entry ]
%count.030 = phi i32 [ %count.1, %for.inc ], [ 0, %entry ]
%idxprom = sext i32 %i.031 to i64
%arrayidx = getelementptr inbounds [256 x i8], ptr %s, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp2 = icmp eq i8 %1, 65
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
%add = add nsw i32 %i.031, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds [256 x i8], ptr %s, i64 0, i64 %idxprom4
%2 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp7 = icmp eq i8 %2, 66
br i1 %cmp7, label %if.then9, label %for.inc
if.then9: ; preds = %if.then
%add10 = add nsw i32 %i.031, 2
%idxprom11 = sext i32 %add10 to i64
%arrayidx12 = getelementptr inbounds [256 x i8], ptr %s, i64 0, i64 %idxprom11
%3 = load i8, ptr %arrayidx12, align 1, !tbaa !9
%cmp14 = icmp eq i8 %3, 67
%inc = zext i1 %cmp14 to i32
%spec.select = add nsw i32 %count.030, %inc
%spec.select28 = select i1 %cmp14, i32 %add10, i32 %i.031
br label %for.inc
for.inc: ; preds = %if.then9, %for.body, %if.then
%count.1 = phi i32 [ %count.030, %if.then ], [ %count.030, %for.body ], [ %spec.select, %if.then9 ]
%i.1 = phi i32 [ %i.031, %if.then ], [ %i.031, %for.body ], [ %spec.select28, %if.then9 ]
%inc20 = add nsw i32 %i.1, 1
%cmp = icmp slt i32 %inc20, %sub
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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,b,f,r,v,count[4][3][10]={0},i,j,k,l,m;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d%d%d",&b,&f,&r,&v);
count[b-1][f-1][r-1]+=v;
}
for(j=0;j<4;j++)
{
for(k=0;k<3;k++)
{
for(l=0;l<10;l++)
{
if(l<=9)
{
printf(" ");
}
printf("%d",count[j][k][l]);
}
printf("\n");
}
if(j<3)
{
for(m=0;m<20;m++)
{
printf("#");
}
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236141/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236141/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%b = alloca i32, align 4
%f = alloca i32, align 4
%r = alloca i32, align 4
%v = alloca i32, align 4
%count = alloca [4 x [3 x [10 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 %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %count) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %count, i8 0, i64 480, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp60 = icmp sgt i32 %0, 0
br i1 %cmp60, label %for.body, label %for.cond11.preheader.preheader
for.body: ; preds = %entry, %for.body
%i.061 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v)
%1 = load i32, ptr %v, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%3 = load i32, ptr %f, align 4, !tbaa !5
%sub2 = add nsw i32 %3, -1
%idxprom3 = sext i32 %sub2 to i64
%4 = load i32, ptr %r, align 4, !tbaa !5
%sub5 = add nsw i32 %4, -1
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %5, %1
store i32 %add, ptr %arrayidx7, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.061, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.cond11.preheader.preheader, !llvm.loop !9
for.cond11.preheader.preheader: ; preds = %for.body, %entry
br label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.inc44
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc44 ], [ 0, %for.cond11.preheader.preheader ]
%putchar59 = call i32 @putchar(i32 32)
%arrayidx24 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 0
%7 = load i32, ptr %arrayidx24, align 8, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%putchar59.1 = call i32 @putchar(i32 32)
%arrayidx24.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 1
%8 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5
%call25.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%putchar59.2 = call i32 @putchar(i32 32)
%arrayidx24.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 2
%9 = load i32, ptr %arrayidx24.2, align 8, !tbaa !5
%call25.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9)
%putchar59.3 = call i32 @putchar(i32 32)
%arrayidx24.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 3
%10 = load i32, ptr %arrayidx24.3, align 4, !tbaa !5
%call25.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%putchar59.4 = call i32 @putchar(i32 32)
%arrayidx24.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 4
%11 = load i32, ptr %arrayidx24.4, align 8, !tbaa !5
%call25.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
%putchar59.5 = call i32 @putchar(i32 32)
%arrayidx24.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 5
%12 = load i32, ptr %arrayidx24.5, align 4, !tbaa !5
%call25.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
%putchar59.6 = call i32 @putchar(i32 32)
%arrayidx24.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 6
%13 = load i32, ptr %arrayidx24.6, align 8, !tbaa !5
%call25.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar59.7 = call i32 @putchar(i32 32)
%arrayidx24.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 7
%14 = load i32, ptr %arrayidx24.7, align 4, !tbaa !5
%call25.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
%putchar59.8 = call i32 @putchar(i32 32)
%arrayidx24.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 8
%15 = load i32, ptr %arrayidx24.8, align 8, !tbaa !5
%call25.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar59.9 = call i32 @putchar(i32 32)
%arrayidx24.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 9
%16 = load i32, ptr %arrayidx24.9, align 4, !tbaa !5
%call25.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
%putchar58 = call i32 @putchar(i32 10)
%putchar59.168 = call i32 @putchar(i32 32)
%arrayidx24.169 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 0
%17 = load i32, ptr %arrayidx24.169, align 8, !tbaa !5
%call25.170 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
%putchar59.1.1 = call i32 @putchar(i32 32)
%arrayidx24.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 1
%18 = load i32, ptr %arrayidx24.1.1, align 4, !tbaa !5
%call25.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18)
%putchar59.2.1 = call i32 @putchar(i32 32)
%arrayidx24.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 2
%19 = load i32, ptr %arrayidx24.2.1, align 8, !tbaa !5
%call25.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19)
%putchar59.3.1 = call i32 @putchar(i32 32)
%arrayidx24.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 3
%20 = load i32, ptr %arrayidx24.3.1, align 4, !tbaa !5
%call25.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20)
%putchar59.4.1 = call i32 @putchar(i32 32)
%arrayidx24.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 4
%21 = load i32, ptr %arrayidx24.4.1, align 8, !tbaa !5
%call25.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21)
%putchar59.5.1 = call i32 @putchar(i32 32)
%arrayidx24.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 5
%22 = load i32, ptr %arrayidx24.5.1, align 4, !tbaa !5
%call25.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22)
%putchar59.6.1 = call i32 @putchar(i32 32)
%arrayidx24.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 6
%23 = load i32, ptr %arrayidx24.6.1, align 8, !tbaa !5
%call25.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %23)
%putchar59.7.1 = call i32 @putchar(i32 32)
%arrayidx24.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 7
%24 = load i32, ptr %arrayidx24.7.1, align 4, !tbaa !5
%call25.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %24)
%putchar59.8.1 = call i32 @putchar(i32 32)
%arrayidx24.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 8
%25 = load i32, ptr %arrayidx24.8.1, align 8, !tbaa !5
%call25.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %25)
%putchar59.9.1 = call i32 @putchar(i32 32)
%arrayidx24.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 9
%26 = load i32, ptr %arrayidx24.9.1, align 4, !tbaa !5
%call25.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %26)
%putchar58.1 = call i32 @putchar(i32 10)
%putchar59.271 = call i32 @putchar(i32 32)
%arrayidx24.272 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 0
%27 = load i32, ptr %arrayidx24.272, align 8, !tbaa !5
%call25.273 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %27)
%putchar59.1.2 = call i32 @putchar(i32 32)
%arrayidx24.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 1
%28 = load i32, ptr %arrayidx24.1.2, align 4, !tbaa !5
%call25.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28)
%putchar59.2.2 = call i32 @putchar(i32 32)
%arrayidx24.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 2
%29 = load i32, ptr %arrayidx24.2.2, align 8, !tbaa !5
%call25.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %29)
%putchar59.3.2 = call i32 @putchar(i32 32)
%arrayidx24.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 3
%30 = load i32, ptr %arrayidx24.3.2, align 4, !tbaa !5
%call25.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %30)
%putchar59.4.2 = call i32 @putchar(i32 32)
%arrayidx24.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 4
%31 = load i32, ptr %arrayidx24.4.2, align 8, !tbaa !5
%call25.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %31)
%putchar59.5.2 = call i32 @putchar(i32 32)
%arrayidx24.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 5
%32 = load i32, ptr %arrayidx24.5.2, align 4, !tbaa !5
%call25.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %32)
%putchar59.6.2 = call i32 @putchar(i32 32)
%arrayidx24.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 6
%33 = load i32, ptr %arrayidx24.6.2, align 8, !tbaa !5
%call25.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %33)
%putchar59.7.2 = call i32 @putchar(i32 32)
%arrayidx24.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 7
%34 = load i32, ptr %arrayidx24.7.2, align 4, !tbaa !5
%call25.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %34)
%putchar59.8.2 = call i32 @putchar(i32 32)
%arrayidx24.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 8
%35 = load i32, ptr %arrayidx24.8.2, align 8, !tbaa !5
%call25.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %35)
%putchar59.9.2 = call i32 @putchar(i32 32)
%arrayidx24.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 9
%36 = load i32, ptr %arrayidx24.9.2, align 4, !tbaa !5
%call25.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %36)
%putchar58.2 = call i32 @putchar(i32 10)
%cmp33 = icmp ult i64 %indvars.iv, 3
br i1 %cmp33, label %for.body37.preheader, label %for.inc44
for.body37.preheader: ; preds = %for.cond11.preheader
%putchar57 = call i32 @putchar(i32 35)
%putchar57.1 = call i32 @putchar(i32 35)
%putchar57.2 = call i32 @putchar(i32 35)
%putchar57.3 = call i32 @putchar(i32 35)
%putchar57.4 = call i32 @putchar(i32 35)
%putchar57.5 = call i32 @putchar(i32 35)
%putchar57.6 = call i32 @putchar(i32 35)
%putchar57.7 = call i32 @putchar(i32 35)
%putchar57.8 = call i32 @putchar(i32 35)
%putchar57.9 = call i32 @putchar(i32 35)
%putchar57.10 = call i32 @putchar(i32 35)
%putchar57.11 = call i32 @putchar(i32 35)
%putchar57.12 = call i32 @putchar(i32 35)
%putchar57.13 = call i32 @putchar(i32 35)
%putchar57.14 = call i32 @putchar(i32 35)
%putchar57.15 = call i32 @putchar(i32 35)
%putchar57.16 = call i32 @putchar(i32 35)
%putchar57.17 = call i32 @putchar(i32 35)
%putchar57.18 = call i32 @putchar(i32 35)
%putchar57.19 = call i32 @putchar(i32 35)
%putchar = call i32 @putchar(i32 10)
br label %for.inc44
for.inc44: ; preds = %for.cond11.preheader, %for.body37.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.end46, label %for.cond11.preheader, !llvm.loop !11
for.end46: ; preds = %for.inc44
call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %count) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#define B 4
#define F 3
#define R 10
int main(void){
int A[B][F][R], i, j, k, n, b, f, r, v;
for(i = 0; i < B; i++){
for(j = 0; j < F; j++){
for(k = 0; k < R; k++){
A[i][j][k] = 0;
}
}
}
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d %d %d %d", &b, &f, &r, &v);
A[b - 1][f - 1][r - 1] += v;
}
for(i = 0; i < B; i++){
for(j = 0; j < F; j++){
for(k = 0; k < R; k++){
printf(" %d", A[i][j][k]);
}
printf("\n");
}
if(i != B - 1){
printf("####################\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236185/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236185/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [21 x i8] c"####################\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [4 x [3 x [10 x i32]]], align 16
%n = alloca i32, align 4
%b = alloca i32, align 4
%f = alloca i32, align 4
%r = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %A, i8 0, i64 480, 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
%cmp1881 = icmp sgt i32 %0, 0
br i1 %cmp1881, label %for.body19, label %for.cond35.preheader.preheader
for.body19: ; preds = %entry, %for.body19
%i.182 = phi i32 [ %inc30, %for.body19 ], [ 0, %entry ]
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v)
%1 = load i32, ptr %v, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom21 = sext i32 %sub to i64
%3 = load i32, ptr %f, align 4, !tbaa !5
%sub23 = add nsw i32 %3, -1
%idxprom24 = sext i32 %sub23 to i64
%4 = load i32, ptr %r, align 4, !tbaa !5
%sub26 = add nsw i32 %4, -1
%idxprom27 = sext i32 %sub26 to i64
%arrayidx28 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %idxprom21, i64 %idxprom24, i64 %idxprom27
%5 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add = add nsw i32 %5, %1
store i32 %add, ptr %arrayidx28, align 4, !tbaa !5
%inc30 = add nuw nsw i32 %i.182, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp slt i32 %inc30, %6
br i1 %cmp18, label %for.body19, label %for.cond35.preheader.preheader, !llvm.loop !9
for.cond35.preheader.preheader: ; preds = %for.body19, %entry
br label %for.cond35.preheader
for.cond35.preheader: ; preds = %for.cond35.preheader.preheader, %for.inc57
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc57 ], [ 0, %for.cond35.preheader.preheader ]
%arrayidx46 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 0
%7 = load i32, ptr %arrayidx46, align 8, !tbaa !5
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%arrayidx46.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 1
%8 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5
%call47.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%arrayidx46.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 2
%9 = load i32, ptr %arrayidx46.2, align 8, !tbaa !5
%call47.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%arrayidx46.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 3
%10 = load i32, ptr %arrayidx46.3, align 4, !tbaa !5
%call47.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%arrayidx46.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 4
%11 = load i32, ptr %arrayidx46.4, align 8, !tbaa !5
%call47.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%arrayidx46.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 5
%12 = load i32, ptr %arrayidx46.5, align 4, !tbaa !5
%call47.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%arrayidx46.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 6
%13 = load i32, ptr %arrayidx46.6, align 8, !tbaa !5
%call47.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%arrayidx46.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 7
%14 = load i32, ptr %arrayidx46.7, align 4, !tbaa !5
%call47.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%arrayidx46.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 8
%15 = load i32, ptr %arrayidx46.8, align 8, !tbaa !5
%call47.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%arrayidx46.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 0, i64 9
%16 = load i32, ptr %arrayidx46.9, align 4, !tbaa !5
%call47.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%putchar = call i32 @putchar(i32 10)
%arrayidx46.194 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 0
%17 = load i32, ptr %arrayidx46.194, align 8, !tbaa !5
%call47.195 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%arrayidx46.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 1
%18 = load i32, ptr %arrayidx46.1.1, align 4, !tbaa !5
%call47.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%arrayidx46.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 2
%19 = load i32, ptr %arrayidx46.2.1, align 8, !tbaa !5
%call47.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19)
%arrayidx46.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 3
%20 = load i32, ptr %arrayidx46.3.1, align 4, !tbaa !5
%call47.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%arrayidx46.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 4
%21 = load i32, ptr %arrayidx46.4.1, align 8, !tbaa !5
%call47.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%arrayidx46.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 5
%22 = load i32, ptr %arrayidx46.5.1, align 4, !tbaa !5
%call47.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
%arrayidx46.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 6
%23 = load i32, ptr %arrayidx46.6.1, align 8, !tbaa !5
%call47.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
%arrayidx46.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 7
%24 = load i32, ptr %arrayidx46.7.1, align 4, !tbaa !5
%call47.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
%arrayidx46.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 8
%25 = load i32, ptr %arrayidx46.8.1, align 8, !tbaa !5
%call47.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25)
%arrayidx46.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 1, i64 9
%26 = load i32, ptr %arrayidx46.9.1, align 4, !tbaa !5
%call47.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26)
%putchar.1 = call i32 @putchar(i32 10)
%arrayidx46.296 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 0
%27 = load i32, ptr %arrayidx46.296, align 8, !tbaa !5
%call47.297 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%arrayidx46.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 1
%28 = load i32, ptr %arrayidx46.1.2, align 4, !tbaa !5
%call47.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28)
%arrayidx46.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 2
%29 = load i32, ptr %arrayidx46.2.2, align 8, !tbaa !5
%call47.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29)
%arrayidx46.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 3
%30 = load i32, ptr %arrayidx46.3.2, align 4, !tbaa !5
%call47.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30)
%arrayidx46.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 4
%31 = load i32, ptr %arrayidx46.4.2, align 8, !tbaa !5
%call47.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31)
%arrayidx46.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 5
%32 = load i32, ptr %arrayidx46.5.2, align 4, !tbaa !5
%call47.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32)
%arrayidx46.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 6
%33 = load i32, ptr %arrayidx46.6.2, align 8, !tbaa !5
%call47.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33)
%arrayidx46.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 7
%34 = load i32, ptr %arrayidx46.7.2, align 4, !tbaa !5
%call47.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34)
%arrayidx46.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 8
%35 = load i32, ptr %arrayidx46.8.2, align 8, !tbaa !5
%call47.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
%arrayidx46.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %A, i64 0, i64 %indvars.iv, i64 2, i64 9
%36 = load i32, ptr %arrayidx46.9.2, align 4, !tbaa !5
%call47.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36)
%putchar.2 = call i32 @putchar(i32 10)
%cmp55.not = icmp eq i64 %indvars.iv, 3
br i1 %cmp55.not, label %for.end59, label %for.inc57
for.inc57: ; preds = %for.cond35.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.cond35.preheader
for.end59: ; preds = %for.cond35.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int a1[3][10],a2[3][10],a3[3][10],a4[3][10],n,b,f,r,v,i,j,k;
for(i=0;i<3;i++)for(j=0;j<10;j++){
a1[i][j]=0;
a2[i][j]=0;
a3[i][j]=0;
a4[i][j]=0;
}
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d %d %d",&b,&f,&r,&v);
if(b==1) a1[f-1][r-1]+=v;
else if(b==2) a2[f-1][r-1]+=v;
else if(b==3) a3[f-1][r-1]+=v;
else if(b==4) a4[f-1][r-1]+=v;
}
for(k=0;k<4;k++){
for(i=0;i<3;i++){
for(j=0;j<10;j++){
if(k==0) printf(" %d",a1[i][j]);
else if(k==1) printf(" %d",a2[i][j]);
else if(k==2) printf(" %d",a3[i][j]);
else if(k==3) printf(" %d",a4[i][j]);
}
printf("\n");
}
if(k!=(4-1)){
for(j=0;j<20;j++) printf("#");
printf("\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236235/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236235/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a1 = alloca [3 x [10 x i32]], align 16
%a1.sroa.gep360 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 9
%a1.sroa.gep355 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 8
%a1.sroa.gep350 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 7
%a1.sroa.gep345 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 6
%a1.sroa.gep340 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 5
%a1.sroa.gep335 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 4
%a1.sroa.gep330 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 3
%a1.sroa.gep325 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 2
%a1.sroa.gep320 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 1
%a1.sroa.gep315 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 2, i64 0
%a1.sroa.gep311 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 9
%a1.sroa.gep306 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 8
%a1.sroa.gep301 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 7
%a1.sroa.gep296 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 6
%a1.sroa.gep291 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 5
%a1.sroa.gep286 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 4
%a1.sroa.gep281 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 3
%a1.sroa.gep276 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 2
%a1.sroa.gep271 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 1
%a1.sroa.gep266 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 1, i64 0
%a1.sroa.gep262 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 9
%a1.sroa.gep257 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 8
%a1.sroa.gep252 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 7
%a1.sroa.gep247 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 6
%a1.sroa.gep242 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 5
%a1.sroa.gep237 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 4
%a1.sroa.gep232 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 3
%a1.sroa.gep227 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 2
%a1.sroa.gep = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 0, i64 1
%a2 = alloca [3 x [10 x i32]], align 16
%a2.sroa.gep359 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 9
%a2.sroa.gep354 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 8
%a2.sroa.gep349 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 7
%a2.sroa.gep344 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 6
%a2.sroa.gep339 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 5
%a2.sroa.gep334 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 4
%a2.sroa.gep329 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 3
%a2.sroa.gep324 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 2
%a2.sroa.gep319 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 1
%a2.sroa.gep314 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 2, i64 0
%a2.sroa.gep310 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 9
%a2.sroa.gep305 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 8
%a2.sroa.gep300 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 7
%a2.sroa.gep295 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 6
%a2.sroa.gep290 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 5
%a2.sroa.gep285 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 4
%a2.sroa.gep280 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 3
%a2.sroa.gep275 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 2
%a2.sroa.gep270 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 1
%a2.sroa.gep265 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 1, i64 0
%a2.sroa.gep261 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 9
%a2.sroa.gep256 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 8
%a2.sroa.gep251 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 7
%a2.sroa.gep246 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 6
%a2.sroa.gep241 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 5
%a2.sroa.gep236 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 4
%a2.sroa.gep231 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 3
%a2.sroa.gep226 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 2
%a2.sroa.gep = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 0, i64 1
%a3 = alloca [3 x [10 x i32]], align 16
%a3.sroa.gep358 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 9
%a3.sroa.gep353 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 8
%a3.sroa.gep348 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 7
%a3.sroa.gep343 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 6
%a3.sroa.gep338 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 5
%a3.sroa.gep333 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 4
%a3.sroa.gep328 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 3
%a3.sroa.gep323 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 2
%a3.sroa.gep318 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 1
%a3.sroa.gep313 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 2, i64 0
%a3.sroa.gep309 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 9
%a3.sroa.gep304 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 8
%a3.sroa.gep299 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 7
%a3.sroa.gep294 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 6
%a3.sroa.gep289 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 5
%a3.sroa.gep284 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 4
%a3.sroa.gep279 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 3
%a3.sroa.gep274 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 2
%a3.sroa.gep269 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 1
%a3.sroa.gep264 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 1, i64 0
%a3.sroa.gep260 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 9
%a3.sroa.gep255 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 8
%a3.sroa.gep250 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 7
%a3.sroa.gep245 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 6
%a3.sroa.gep240 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 5
%a3.sroa.gep235 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 4
%a3.sroa.gep230 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 3
%a3.sroa.gep225 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 2
%a3.sroa.gep = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 0, i64 1
%a4 = alloca [3 x [10 x i32]], align 16
%a4.sroa.gep361 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 9
%a4.sroa.gep356 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 8
%a4.sroa.gep351 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 7
%a4.sroa.gep346 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 6
%a4.sroa.gep341 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 5
%a4.sroa.gep336 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 4
%a4.sroa.gep331 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 3
%a4.sroa.gep326 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 2
%a4.sroa.gep321 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 1
%a4.sroa.gep316 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 2, i64 0
%a4.sroa.gep312 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 9
%a4.sroa.gep307 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 8
%a4.sroa.gep302 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 7
%a4.sroa.gep297 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 6
%a4.sroa.gep292 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 5
%a4.sroa.gep287 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 4
%a4.sroa.gep282 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 3
%a4.sroa.gep277 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 2
%a4.sroa.gep272 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 1
%a4.sroa.gep267 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 1, i64 0
%a4.sroa.gep263 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 9
%a4.sroa.gep258 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 8
%a4.sroa.gep253 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 7
%a4.sroa.gep248 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 6
%a4.sroa.gep243 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 5
%a4.sroa.gep238 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 4
%a4.sroa.gep233 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 3
%a4.sroa.gep228 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 2
%a4.sroa.gep = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 0, i64 1
%n = alloca i32, align 4
%b = alloca i32, align 4
%f = alloca i32, align 4
%r = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a1) #5
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a2) #5
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a3) #5
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a4) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %a1, i8 0, i64 120, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %a2, i8 0, i64 120, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %a3, i8 0, i64 120, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %a4, i8 0, i64 120, 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
%cmp22167 = icmp sgt i32 %0, 0
br i1 %cmp22167, label %for.body23, label %for.cond69.preheader.preheader
for.body23: ; preds = %entry, %for.inc63
%i.1168 = phi i32 [ %inc64, %for.inc63 ], [ 0, %entry ]
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v)
%1 = load i32, ptr %b, align 4, !tbaa !5
switch i32 %1, label %for.inc63 [
i32 1, label %if.then
i32 2, label %if.then32
i32 3, label %if.then42
i32 4, label %if.then52
]
if.then: ; preds = %for.body23
%2 = load i32, ptr %f, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom26 = sext i32 %sub to i64
%3 = load i32, ptr %r, align 4, !tbaa !5
%sub28 = add nsw i32 %3, -1
%idxprom29 = sext i32 %sub28 to i64
%arrayidx30 = getelementptr inbounds [3 x [10 x i32]], ptr %a1, i64 0, i64 %idxprom26, i64 %idxprom29
br label %for.inc63.sink.split
if.then32: ; preds = %for.body23
%4 = load i32, ptr %f, align 4, !tbaa !5
%sub33 = add nsw i32 %4, -1
%idxprom34 = sext i32 %sub33 to i64
%5 = load i32, ptr %r, align 4, !tbaa !5
%sub36 = add nsw i32 %5, -1
%idxprom37 = sext i32 %sub36 to i64
%arrayidx38 = getelementptr inbounds [3 x [10 x i32]], ptr %a2, i64 0, i64 %idxprom34, i64 %idxprom37
br label %for.inc63.sink.split
if.then42: ; preds = %for.body23
%6 = load i32, ptr %f, align 4, !tbaa !5
%sub43 = add nsw i32 %6, -1
%idxprom44 = sext i32 %sub43 to i64
%7 = load i32, ptr %r, align 4, !tbaa !5
%sub46 = add nsw i32 %7, -1
%idxprom47 = sext i32 %sub46 to i64
%arrayidx48 = getelementptr inbounds [3 x [10 x i32]], ptr %a3, i64 0, i64 %idxprom44, i64 %idxprom47
br label %for.inc63.sink.split
if.then52: ; preds = %for.body23
%8 = load i32, ptr %f, align 4, !tbaa !5
%sub53 = add nsw i32 %8, -1
%idxprom54 = sext i32 %sub53 to i64
%9 = load i32, ptr %r, align 4, !tbaa !5
%sub56 = add nsw i32 %9, -1
%idxprom57 = sext i32 %sub56 to i64
%arrayidx58 = getelementptr inbounds [3 x [10 x i32]], ptr %a4, i64 0, i64 %idxprom54, i64 %idxprom57
br label %for.inc63.sink.split
for.inc63.sink.split: ; preds = %if.then32, %if.then52, %if.then42, %if.then
%arrayidx30.sink210 = phi ptr [ %arrayidx30, %if.then ], [ %arrayidx48, %if.then42 ], [ %arrayidx58, %if.then52 ], [ %arrayidx38, %if.then32 ]
%.sink209 = load i32, ptr %v, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx30.sink210, align 4, !tbaa !5
%add = add nsw i32 %10, %.sink209
store i32 %add, ptr %arrayidx30.sink210, align 4, !tbaa !5
br label %for.inc63
for.inc63: ; preds = %for.inc63.sink.split, %for.body23
%inc64 = add nuw nsw i32 %i.1168, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp slt i32 %inc64, %11
br i1 %cmp22, label %for.body23, label %for.cond69.preheader.preheader, !llvm.loop !9
for.cond69.preheader.preheader: ; preds = %for.inc63, %entry
br label %for.cond69.preheader
for.cond69.preheader: ; preds = %for.cond69.preheader.preheader, %for.inc128
%k.0190 = phi i32 [ %inc129, %for.inc128 ], [ 0, %for.cond69.preheader.preheader ]
switch i32 %k.0190, label %for.end112 [
i32 0, label %for.body74.us.preheader
i32 1, label %for.body74.us171.preheader
i32 2, label %for.body74.us177.preheader
i32 3, label %for.end112.sink.split
]
for.body74.us177.preheader: ; preds = %for.cond69.preheader
br label %for.end112.sink.split
for.body74.us171.preheader: ; preds = %for.cond69.preheader
br label %for.end112.sink.split
for.body74.us.preheader: ; preds = %for.cond69.preheader
br label %for.end112.sink.split
for.end112.sink.split: ; preds = %for.cond69.preheader, %for.body74.us.preheader, %for.body74.us171.preheader, %for.body74.us177.preheader
%a4.sink219 = phi ptr [ %a3, %for.body74.us177.preheader ], [ %a2, %for.body74.us171.preheader ], [ %a1, %for.body74.us.preheader ], [ %a4, %for.cond69.preheader ]
%a4.sink219.sroa.phi = phi ptr [ %a3.sroa.gep, %for.body74.us177.preheader ], [ %a2.sroa.gep, %for.body74.us171.preheader ], [ %a1.sroa.gep, %for.body74.us.preheader ], [ %a4.sroa.gep, %for.cond69.preheader ]
%a4.sink219.sroa.phi224 = phi ptr [ %a3.sroa.gep225, %for.body74.us177.preheader ], [ %a2.sroa.gep226, %for.body74.us171.preheader ], [ %a1.sroa.gep227, %for.body74.us.preheader ], [ %a4.sroa.gep228, %for.cond69.preheader ]
%a4.sink219.sroa.phi229 = phi ptr [ %a3.sroa.gep230, %for.body74.us177.preheader ], [ %a2.sroa.gep231, %for.body74.us171.preheader ], [ %a1.sroa.gep232, %for.body74.us.preheader ], [ %a4.sroa.gep233, %for.cond69.preheader ]
%a4.sink219.sroa.phi234 = phi ptr [ %a3.sroa.gep235, %for.body74.us177.preheader ], [ %a2.sroa.gep236, %for.body74.us171.preheader ], [ %a1.sroa.gep237, %for.body74.us.preheader ], [ %a4.sroa.gep238, %for.cond69.preheader ]
%a4.sink219.sroa.phi239 = phi ptr [ %a3.sroa.gep240, %for.body74.us177.preheader ], [ %a2.sroa.gep241, %for.body74.us171.preheader ], [ %a1.sroa.gep242, %for.body74.us.preheader ], [ %a4.sroa.gep243, %for.cond69.preheader ]
%a4.sink219.sroa.phi244 = phi ptr [ %a3.sroa.gep245, %for.body74.us177.preheader ], [ %a2.sroa.gep246, %for.body74.us171.preheader ], [ %a1.sroa.gep247, %for.body74.us.preheader ], [ %a4.sroa.gep248, %for.cond69.preheader ]
%a4.sink219.sroa.phi249 = phi ptr [ %a3.sroa.gep250, %for.body74.us177.preheader ], [ %a2.sroa.gep251, %for.body74.us171.preheader ], [ %a1.sroa.gep252, %for.body74.us.preheader ], [ %a4.sroa.gep253, %for.cond69.preheader ]
%a4.sink219.sroa.phi254 = phi ptr [ %a3.sroa.gep255, %for.body74.us177.preheader ], [ %a2.sroa.gep256, %for.body74.us171.preheader ], [ %a1.sroa.gep257, %for.body74.us.preheader ], [ %a4.sroa.gep258, %for.cond69.preheader ]
%a4.sink219.sroa.phi259 = phi ptr [ %a3.sroa.gep260, %for.body74.us177.preheader ], [ %a2.sroa.gep261, %for.body74.us171.preheader ], [ %a1.sroa.gep262, %for.body74.us.preheader ], [ %a4.sroa.gep263, %for.cond69.preheader ]
%12 = load i32, ptr %a4.sink219, align 16, !tbaa !5
%call105.us = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%13 = load i32, ptr %a4.sink219.sroa.phi, align 4, !tbaa !5
%call105.us.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%14 = load i32, ptr %a4.sink219.sroa.phi224, align 8, !tbaa !5
%call105.us.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%15 = load i32, ptr %a4.sink219.sroa.phi229, align 4, !tbaa !5
%call105.us.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%16 = load i32, ptr %a4.sink219.sroa.phi234, align 8, !tbaa !5
%call105.us.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%17 = load i32, ptr %a4.sink219.sroa.phi239, align 4, !tbaa !5
%call105.us.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%18 = load i32, ptr %a4.sink219.sroa.phi244, align 8, !tbaa !5
%call105.us.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%19 = load i32, ptr %a4.sink219.sroa.phi249, align 4, !tbaa !5
%call105.us.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19)
%20 = load i32, ptr %a4.sink219.sroa.phi254, align 8, !tbaa !5
%call105.us.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%21 = load i32, ptr %a4.sink219.sroa.phi259, align 4, !tbaa !5
%call105.us.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
br label %for.end112
for.end112: ; preds = %for.end112.sink.split, %for.cond69.preheader
%putchar164 = call i32 @putchar(i32 10)
switch i32 %k.0190, label %for.end112.1 [
i32 0, label %for.body74.us.preheader.1
i32 1, label %for.body74.us171.preheader.1
i32 2, label %for.body74.us177.preheader.1
i32 3, label %for.end112.sink.split.1
]
for.body74.us177.preheader.1: ; preds = %for.end112
br label %for.end112.sink.split.1
for.body74.us171.preheader.1: ; preds = %for.end112
br label %for.end112.sink.split.1
for.body74.us.preheader.1: ; preds = %for.end112
br label %for.end112.sink.split.1
for.end112.sink.split.1: ; preds = %for.body74.us.preheader.1, %for.body74.us171.preheader.1, %for.body74.us177.preheader.1, %for.end112
%a4.sink219.1.sroa.phi = phi ptr [ %a3.sroa.gep264, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep265, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep266, %for.body74.us.preheader.1 ], [ %a4.sroa.gep267, %for.end112 ]
%a4.sink219.1.sroa.phi268 = phi ptr [ %a3.sroa.gep269, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep270, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep271, %for.body74.us.preheader.1 ], [ %a4.sroa.gep272, %for.end112 ]
%a4.sink219.1.sroa.phi273 = phi ptr [ %a3.sroa.gep274, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep275, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep276, %for.body74.us.preheader.1 ], [ %a4.sroa.gep277, %for.end112 ]
%a4.sink219.1.sroa.phi278 = phi ptr [ %a3.sroa.gep279, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep280, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep281, %for.body74.us.preheader.1 ], [ %a4.sroa.gep282, %for.end112 ]
%a4.sink219.1.sroa.phi283 = phi ptr [ %a3.sroa.gep284, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep285, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep286, %for.body74.us.preheader.1 ], [ %a4.sroa.gep287, %for.end112 ]
%a4.sink219.1.sroa.phi288 = phi ptr [ %a3.sroa.gep289, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep290, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep291, %for.body74.us.preheader.1 ], [ %a4.sroa.gep292, %for.end112 ]
%a4.sink219.1.sroa.phi293 = phi ptr [ %a3.sroa.gep294, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep295, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep296, %for.body74.us.preheader.1 ], [ %a4.sroa.gep297, %for.end112 ]
%a4.sink219.1.sroa.phi298 = phi ptr [ %a3.sroa.gep299, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep300, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep301, %for.body74.us.preheader.1 ], [ %a4.sroa.gep302, %for.end112 ]
%a4.sink219.1.sroa.phi303 = phi ptr [ %a3.sroa.gep304, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep305, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep306, %for.body74.us.preheader.1 ], [ %a4.sroa.gep307, %for.end112 ]
%a4.sink219.1.sroa.phi308 = phi ptr [ %a3.sroa.gep309, %for.body74.us177.preheader.1 ], [ %a2.sroa.gep310, %for.body74.us171.preheader.1 ], [ %a1.sroa.gep311, %for.body74.us.preheader.1 ], [ %a4.sroa.gep312, %for.end112 ]
%22 = load i32, ptr %a4.sink219.1.sroa.phi, align 8, !tbaa !5
%call105.us.1221 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
%23 = load i32, ptr %a4.sink219.1.sroa.phi268, align 4, !tbaa !5
%call105.us.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
%24 = load i32, ptr %a4.sink219.1.sroa.phi273, align 8, !tbaa !5
%call105.us.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
%25 = load i32, ptr %a4.sink219.1.sroa.phi278, align 4, !tbaa !5
%call105.us.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25)
%26 = load i32, ptr %a4.sink219.1.sroa.phi283, align 8, !tbaa !5
%call105.us.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26)
%27 = load i32, ptr %a4.sink219.1.sroa.phi288, align 4, !tbaa !5
%call105.us.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%28 = load i32, ptr %a4.sink219.1.sroa.phi293, align 8, !tbaa !5
%call105.us.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28)
%29 = load i32, ptr %a4.sink219.1.sroa.phi298, align 4, !tbaa !5
%call105.us.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29)
%30 = load i32, ptr %a4.sink219.1.sroa.phi303, align 8, !tbaa !5
%call105.us.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30)
%31 = load i32, ptr %a4.sink219.1.sroa.phi308, align 4, !tbaa !5
%call105.us.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31)
br label %for.end112.1
for.end112.1: ; preds = %for.end112.sink.split.1, %for.end112
%putchar164.1 = call i32 @putchar(i32 10)
switch i32 %k.0190, label %for.end112.2 [
i32 0, label %for.body74.us.preheader.2
i32 1, label %for.body74.us171.preheader.2
i32 2, label %for.body74.us177.preheader.2
i32 3, label %for.end112.sink.split.2
]
for.body74.us177.preheader.2: ; preds = %for.end112.1
br label %for.end112.sink.split.2
for.body74.us171.preheader.2: ; preds = %for.end112.1
br label %for.end112.sink.split.2
for.body74.us.preheader.2: ; preds = %for.end112.1
br label %for.end112.sink.split.2
for.end112.sink.split.2: ; preds = %for.body74.us.preheader.2, %for.body74.us171.preheader.2, %for.body74.us177.preheader.2, %for.end112.1
%a4.sink219.2.sroa.phi = phi ptr [ %a3.sroa.gep313, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep314, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep315, %for.body74.us.preheader.2 ], [ %a4.sroa.gep316, %for.end112.1 ]
%a4.sink219.2.sroa.phi317 = phi ptr [ %a3.sroa.gep318, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep319, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep320, %for.body74.us.preheader.2 ], [ %a4.sroa.gep321, %for.end112.1 ]
%a4.sink219.2.sroa.phi322 = phi ptr [ %a3.sroa.gep323, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep324, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep325, %for.body74.us.preheader.2 ], [ %a4.sroa.gep326, %for.end112.1 ]
%a4.sink219.2.sroa.phi327 = phi ptr [ %a3.sroa.gep328, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep329, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep330, %for.body74.us.preheader.2 ], [ %a4.sroa.gep331, %for.end112.1 ]
%a4.sink219.2.sroa.phi332 = phi ptr [ %a3.sroa.gep333, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep334, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep335, %for.body74.us.preheader.2 ], [ %a4.sroa.gep336, %for.end112.1 ]
%a4.sink219.2.sroa.phi337 = phi ptr [ %a3.sroa.gep338, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep339, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep340, %for.body74.us.preheader.2 ], [ %a4.sroa.gep341, %for.end112.1 ]
%a4.sink219.2.sroa.phi342 = phi ptr [ %a3.sroa.gep343, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep344, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep345, %for.body74.us.preheader.2 ], [ %a4.sroa.gep346, %for.end112.1 ]
%a4.sink219.2.sroa.phi347 = phi ptr [ %a3.sroa.gep348, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep349, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep350, %for.body74.us.preheader.2 ], [ %a4.sroa.gep351, %for.end112.1 ]
%a4.sink219.2.sroa.phi352 = phi ptr [ %a3.sroa.gep353, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep354, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep355, %for.body74.us.preheader.2 ], [ %a4.sroa.gep356, %for.end112.1 ]
%a4.sink219.2.sroa.phi357 = phi ptr [ %a3.sroa.gep358, %for.body74.us177.preheader.2 ], [ %a2.sroa.gep359, %for.body74.us171.preheader.2 ], [ %a1.sroa.gep360, %for.body74.us.preheader.2 ], [ %a4.sroa.gep361, %for.end112.1 ]
%32 = load i32, ptr %a4.sink219.2.sroa.phi, align 8, !tbaa !5
%call105.us.2223 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32)
%33 = load i32, ptr %a4.sink219.2.sroa.phi317, align 4, !tbaa !5
%call105.us.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33)
%34 = load i32, ptr %a4.sink219.2.sroa.phi322, align 8, !tbaa !5
%call105.us.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34)
%35 = load i32, ptr %a4.sink219.2.sroa.phi327, align 4, !tbaa !5
%call105.us.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
%36 = load i32, ptr %a4.sink219.2.sroa.phi332, align 8, !tbaa !5
%call105.us.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36)
%37 = load i32, ptr %a4.sink219.2.sroa.phi337, align 4, !tbaa !5
%call105.us.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %37)
%38 = load i32, ptr %a4.sink219.2.sroa.phi342, align 8, !tbaa !5
%call105.us.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %38)
%39 = load i32, ptr %a4.sink219.2.sroa.phi347, align 4, !tbaa !5
%call105.us.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %39)
%40 = load i32, ptr %a4.sink219.2.sroa.phi352, align 8, !tbaa !5
%call105.us.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %40)
%41 = load i32, ptr %a4.sink219.2.sroa.phi357, align 4, !tbaa !5
%call105.us.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %41)
br label %for.end112.2
for.end112.2: ; preds = %for.end112.sink.split.2, %for.end112.1
%putchar164.2 = call i32 @putchar(i32 10)
%cmp117.not = icmp eq i32 %k.0190, 3
br i1 %cmp117.not, label %for.end130, label %for.inc128
for.inc128: ; preds = %for.end112.2
%putchar163 = call i32 @putchar(i32 35)
%putchar163.1 = call i32 @putchar(i32 35)
%putchar163.2 = call i32 @putchar(i32 35)
%putchar163.3 = call i32 @putchar(i32 35)
%putchar163.4 = call i32 @putchar(i32 35)
%putchar163.5 = call i32 @putchar(i32 35)
%putchar163.6 = call i32 @putchar(i32 35)
%putchar163.7 = call i32 @putchar(i32 35)
%putchar163.8 = call i32 @putchar(i32 35)
%putchar163.9 = call i32 @putchar(i32 35)
%putchar163.10 = call i32 @putchar(i32 35)
%putchar163.11 = call i32 @putchar(i32 35)
%putchar163.12 = call i32 @putchar(i32 35)
%putchar163.13 = call i32 @putchar(i32 35)
%putchar163.14 = call i32 @putchar(i32 35)
%putchar163.15 = call i32 @putchar(i32 35)
%putchar163.16 = call i32 @putchar(i32 35)
%putchar163.17 = call i32 @putchar(i32 35)
%putchar163.18 = call i32 @putchar(i32 35)
%putchar163.19 = call i32 @putchar(i32 35)
%putchar = call i32 @putchar(i32 10)
%inc129 = add nuw nsw i32 %k.0190, 1
br label %for.cond69.preheader
for.end130: ; preds = %for.end112.2
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a4) #5
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a3) #5
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a2) #5
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a1) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int i,num,a,b,c,d,j,k;
int mat1[222][333]={0};
int mat2[222][333]={0};
int mat3[222][333]={0};
int mat4[222][333]={0};
scanf("%d",&num);
for(i=0;i<num;i++){
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a==1)
mat1[b-1][c-1]+=d;
if(a==2)
mat2[b-1][c-1]+=d;
if(a==3)
mat3[b-1][c-1]+=d;
if(a==4)
mat4[b-1][c-1]+=d;
}
for(j=0;j<3;j++){
for(k=0;k<10;k++){
printf("%2d",mat1[j][k]);
}
printf("\n");
}
printf("####################\n");
for(j=0;j<3;j++){
for(k=0;k<10;k++){
printf("%2d",mat2[j][k]);
}
printf("\n");
}
printf("####################\n");
for(j=0;j<3;j++){
for(k=0;k<10;k++){
printf("%2d",mat3[j][k]);
}
printf("\n");
}
printf("####################\n");
for(j=0;j<3;j++){
for(k=0;k<10;k++){
printf("%2d",mat4[j][k]);
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236279/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236279/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%2d\00", align 1
@str.6 = private unnamed_addr constant [21 x i8] c"####################\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%mat1 = alloca [222 x [333 x i32]], align 16
%mat2 = alloca [222 x [333 x i32]], align 16
%mat3 = alloca [222 x [333 x i32]], align 16
%mat4 = alloca [222 x [333 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 295704, ptr nonnull %mat1) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(295704) %mat1, i8 0, i64 295704, i1 false)
call void @llvm.lifetime.start.p0(i64 295704, ptr nonnull %mat2) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(295704) %mat2, i8 0, i64 295704, i1 false)
call void @llvm.lifetime.start.p0(i64 295704, ptr nonnull %mat3) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(295704) %mat3, i8 0, i64 295704, i1 false)
call void @llvm.lifetime.start.p0(i64 295704, ptr nonnull %mat4) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(295704) %mat4, i8 0, i64 295704, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp142 = icmp sgt i32 %0, 0
br i1 %cmp142, label %for.body, label %for.cond36.preheader
for.cond36.preheader.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %mat1, align 16, !tbaa !5
%arrayidx45.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 1
%.pre176 = load i32, ptr %arrayidx45.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 2
%.pre177 = load i32, ptr %arrayidx45.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.3.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 3
%.pre178 = load i32, ptr %arrayidx45.3.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.4.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 4
%.pre179 = load i32, ptr %arrayidx45.4.phi.trans.insert, align 16, !tbaa !5
%arrayidx45.5.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 5
%.pre180 = load i32, ptr %arrayidx45.5.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.6.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 6
%.pre181 = load i32, ptr %arrayidx45.6.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.7.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 7
%.pre182 = load i32, ptr %arrayidx45.7.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.8.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 8
%.pre183 = load i32, ptr %arrayidx45.8.phi.trans.insert, align 16, !tbaa !5
%arrayidx45.9.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 0, i64 9
%.pre184 = load i32, ptr %arrayidx45.9.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.1154.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 0
%.pre185 = load i32, ptr %arrayidx45.1154.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.1.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 1
%.pre186 = load i32, ptr %arrayidx45.1.1.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.2.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 2
%.pre187 = load i32, ptr %arrayidx45.2.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.3.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 3
%.pre188 = load i32, ptr %arrayidx45.3.1.phi.trans.insert, align 16, !tbaa !5
%arrayidx45.4.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 4
%.pre189 = load i32, ptr %arrayidx45.4.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.5.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 5
%.pre190 = load i32, ptr %arrayidx45.5.1.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.6.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 6
%.pre191 = load i32, ptr %arrayidx45.6.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.7.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 7
%.pre192 = load i32, ptr %arrayidx45.7.1.phi.trans.insert, align 16, !tbaa !5
%arrayidx45.8.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 8
%.pre193 = load i32, ptr %arrayidx45.8.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.9.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 1, i64 9
%.pre194 = load i32, ptr %arrayidx45.9.1.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.2156.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 0
%.pre195 = load i32, ptr %arrayidx45.2156.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.1.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 1
%.pre196 = load i32, ptr %arrayidx45.1.2.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.2.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 2
%.pre197 = load i32, ptr %arrayidx45.2.2.phi.trans.insert, align 16, !tbaa !5
%arrayidx45.3.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 3
%.pre198 = load i32, ptr %arrayidx45.3.2.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.4.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 4
%.pre199 = load i32, ptr %arrayidx45.4.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.5.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 5
%.pre200 = load i32, ptr %arrayidx45.5.2.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.6.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 6
%.pre201 = load i32, ptr %arrayidx45.6.2.phi.trans.insert, align 16, !tbaa !5
%arrayidx45.7.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 7
%.pre202 = load i32, ptr %arrayidx45.7.2.phi.trans.insert, align 4, !tbaa !5
%arrayidx45.8.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 8
%.pre203 = load i32, ptr %arrayidx45.8.2.phi.trans.insert, align 8, !tbaa !5
%arrayidx45.9.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 2, i64 9
%.pre204 = load i32, ptr %arrayidx45.9.2.phi.trans.insert, align 4, !tbaa !5
%.pre205 = load i32, ptr %mat2, align 16, !tbaa !5
%arrayidx64.1.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 1
%.pre206 = load i32, ptr %arrayidx64.1.phi.trans.insert, align 4, !tbaa !5
%arrayidx64.2.phi.trans.insert = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 2
%.pre207 = load i32, ptr %arrayidx64.2.phi.trans.insert, align 8, !tbaa !5
br label %for.cond36.preheader
for.cond36.preheader: ; preds = %for.cond36.preheader.loopexit, %entry
%1 = phi i32 [ %.pre207, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%2 = phi i32 [ %.pre206, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%3 = phi i32 [ %.pre205, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%4 = phi i32 [ %.pre204, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%5 = phi i32 [ %.pre203, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%6 = phi i32 [ %.pre202, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%7 = phi i32 [ %.pre201, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%8 = phi i32 [ %.pre200, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%9 = phi i32 [ %.pre199, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%10 = phi i32 [ %.pre198, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%11 = phi i32 [ %.pre197, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%12 = phi i32 [ %.pre196, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%13 = phi i32 [ %.pre195, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%14 = phi i32 [ %.pre194, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%15 = phi i32 [ %.pre193, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%16 = phi i32 [ %.pre192, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%17 = phi i32 [ %.pre191, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%18 = phi i32 [ %.pre190, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%19 = phi i32 [ %.pre189, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%20 = phi i32 [ %.pre188, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%21 = phi i32 [ %.pre187, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%22 = phi i32 [ %.pre186, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%23 = phi i32 [ %.pre185, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%24 = phi i32 [ %.pre184, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%25 = phi i32 [ %.pre183, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%26 = phi i32 [ %.pre182, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%27 = phi i32 [ %.pre181, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%28 = phi i32 [ %.pre180, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%29 = phi i32 [ %.pre179, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%30 = phi i32 [ %.pre178, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%31 = phi i32 [ %.pre177, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%32 = phi i32 [ %.pre176, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%33 = phi i32 [ %.pre, %for.cond36.preheader.loopexit ], [ 0, %entry ]
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33)
%call46.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32)
%call46.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31)
%call46.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30)
%call46.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29)
%call46.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28)
%call46.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%call46.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26)
%call46.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25)
%call46.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
%putchar138 = call i32 @putchar(i32 10)
%call46.1155 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
%call46.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
%call46.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%call46.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%call46.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19)
%call46.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%call46.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%call46.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%call46.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%call46.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%putchar138.1 = call i32 @putchar(i32 10)
%call46.2157 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%call46.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%call46.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%call46.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%call46.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%call46.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%call46.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%call46.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6)
%call46.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5)
%call46.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4)
%putchar138.2 = call i32 @putchar(i32 10)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3)
%call65.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2)
%call65.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1)
%arrayidx64.3 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 3
%34 = load i32, ptr %arrayidx64.3, align 4, !tbaa !5
%call65.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34)
%arrayidx64.4 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 4
%35 = load i32, ptr %arrayidx64.4, align 16, !tbaa !5
%call65.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
%arrayidx64.5 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 5
%36 = load i32, ptr %arrayidx64.5, align 4, !tbaa !5
%call65.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36)
%arrayidx64.6 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 6
%37 = load i32, ptr %arrayidx64.6, align 8, !tbaa !5
%call65.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %37)
%arrayidx64.7 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 7
%38 = load i32, ptr %arrayidx64.7, align 4, !tbaa !5
%call65.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %38)
%arrayidx64.8 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 8
%39 = load i32, ptr %arrayidx64.8, align 16, !tbaa !5
%call65.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %39)
%arrayidx64.9 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 0, i64 9
%40 = load i32, ptr %arrayidx64.9, align 4, !tbaa !5
%call65.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %40)
%putchar137 = call i32 @putchar(i32 10)
%arrayidx64.1160 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 0
%41 = load i32, ptr %arrayidx64.1160, align 4, !tbaa !5
%call65.1161 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %41)
%arrayidx64.1.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 1
%42 = load i32, ptr %arrayidx64.1.1, align 8, !tbaa !5
%call65.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %42)
%arrayidx64.2.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 2
%43 = load i32, ptr %arrayidx64.2.1, align 4, !tbaa !5
%call65.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %43)
%arrayidx64.3.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 3
%44 = load i32, ptr %arrayidx64.3.1, align 16, !tbaa !5
%call65.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %44)
%arrayidx64.4.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 4
%45 = load i32, ptr %arrayidx64.4.1, align 4, !tbaa !5
%call65.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %45)
%arrayidx64.5.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 5
%46 = load i32, ptr %arrayidx64.5.1, align 8, !tbaa !5
%call65.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %46)
%arrayidx64.6.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 6
%47 = load i32, ptr %arrayidx64.6.1, align 4, !tbaa !5
%call65.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %47)
%arrayidx64.7.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 7
%48 = load i32, ptr %arrayidx64.7.1, align 16, !tbaa !5
%call65.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %48)
%arrayidx64.8.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 8
%49 = load i32, ptr %arrayidx64.8.1, align 4, !tbaa !5
%call65.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %49)
%arrayidx64.9.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 1, i64 9
%50 = load i32, ptr %arrayidx64.9.1, align 8, !tbaa !5
%call65.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %50)
%putchar137.1 = call i32 @putchar(i32 10)
%arrayidx64.2162 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 0
%51 = load i32, ptr %arrayidx64.2162, align 8, !tbaa !5
%call65.2163 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %51)
%arrayidx64.1.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 1
%52 = load i32, ptr %arrayidx64.1.2, align 4, !tbaa !5
%call65.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %52)
%arrayidx64.2.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 2
%53 = load i32, ptr %arrayidx64.2.2, align 16, !tbaa !5
%call65.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %53)
%arrayidx64.3.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 3
%54 = load i32, ptr %arrayidx64.3.2, align 4, !tbaa !5
%call65.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %54)
%arrayidx64.4.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 4
%55 = load i32, ptr %arrayidx64.4.2, align 8, !tbaa !5
%call65.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %55)
%arrayidx64.5.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 5
%56 = load i32, ptr %arrayidx64.5.2, align 4, !tbaa !5
%call65.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %56)
%arrayidx64.6.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 6
%57 = load i32, ptr %arrayidx64.6.2, align 16, !tbaa !5
%call65.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %57)
%arrayidx64.7.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 7
%58 = load i32, ptr %arrayidx64.7.2, align 4, !tbaa !5
%call65.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %58)
%arrayidx64.8.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 8
%59 = load i32, ptr %arrayidx64.8.2, align 8, !tbaa !5
%call65.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %59)
%arrayidx64.9.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 2, i64 9
%60 = load i32, ptr %arrayidx64.9.2, align 4, !tbaa !5
%call65.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %60)
%putchar137.2 = call i32 @putchar(i32 10)
%puts134 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
%61 = load i32, ptr %mat3, align 16, !tbaa !5
%call84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %61)
%arrayidx83.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 1
%62 = load i32, ptr %arrayidx83.1, align 4, !tbaa !5
%call84.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %62)
%arrayidx83.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 2
%63 = load i32, ptr %arrayidx83.2, align 8, !tbaa !5
%call84.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %63)
%arrayidx83.3 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 3
%64 = load i32, ptr %arrayidx83.3, align 4, !tbaa !5
%call84.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %64)
%arrayidx83.4 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 4
%65 = load i32, ptr %arrayidx83.4, align 16, !tbaa !5
%call84.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %65)
%arrayidx83.5 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 5
%66 = load i32, ptr %arrayidx83.5, align 4, !tbaa !5
%call84.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %66)
%arrayidx83.6 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 6
%67 = load i32, ptr %arrayidx83.6, align 8, !tbaa !5
%call84.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %67)
%arrayidx83.7 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 7
%68 = load i32, ptr %arrayidx83.7, align 4, !tbaa !5
%call84.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %68)
%arrayidx83.8 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 8
%69 = load i32, ptr %arrayidx83.8, align 16, !tbaa !5
%call84.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %69)
%arrayidx83.9 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 0, i64 9
%70 = load i32, ptr %arrayidx83.9, align 4, !tbaa !5
%call84.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %70)
%putchar136 = call i32 @putchar(i32 10)
%arrayidx83.1166 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 0
%71 = load i32, ptr %arrayidx83.1166, align 4, !tbaa !5
%call84.1167 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %71)
%arrayidx83.1.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 1
%72 = load i32, ptr %arrayidx83.1.1, align 8, !tbaa !5
%call84.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %72)
%arrayidx83.2.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 2
%73 = load i32, ptr %arrayidx83.2.1, align 4, !tbaa !5
%call84.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %73)
%arrayidx83.3.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 3
%74 = load i32, ptr %arrayidx83.3.1, align 16, !tbaa !5
%call84.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %74)
%arrayidx83.4.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 4
%75 = load i32, ptr %arrayidx83.4.1, align 4, !tbaa !5
%call84.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %75)
%arrayidx83.5.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 5
%76 = load i32, ptr %arrayidx83.5.1, align 8, !tbaa !5
%call84.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %76)
%arrayidx83.6.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 6
%77 = load i32, ptr %arrayidx83.6.1, align 4, !tbaa !5
%call84.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %77)
%arrayidx83.7.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 7
%78 = load i32, ptr %arrayidx83.7.1, align 16, !tbaa !5
%call84.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %78)
%arrayidx83.8.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 8
%79 = load i32, ptr %arrayidx83.8.1, align 4, !tbaa !5
%call84.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %79)
%arrayidx83.9.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 1, i64 9
%80 = load i32, ptr %arrayidx83.9.1, align 8, !tbaa !5
%call84.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %80)
%putchar136.1 = call i32 @putchar(i32 10)
%arrayidx83.2168 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 0
%81 = load i32, ptr %arrayidx83.2168, align 8, !tbaa !5
%call84.2169 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %81)
%arrayidx83.1.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 1
%82 = load i32, ptr %arrayidx83.1.2, align 4, !tbaa !5
%call84.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %82)
%arrayidx83.2.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 2
%83 = load i32, ptr %arrayidx83.2.2, align 16, !tbaa !5
%call84.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %83)
%arrayidx83.3.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 3
%84 = load i32, ptr %arrayidx83.3.2, align 4, !tbaa !5
%call84.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %84)
%arrayidx83.4.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 4
%85 = load i32, ptr %arrayidx83.4.2, align 8, !tbaa !5
%call84.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %85)
%arrayidx83.5.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 5
%86 = load i32, ptr %arrayidx83.5.2, align 4, !tbaa !5
%call84.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %86)
%arrayidx83.6.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 6
%87 = load i32, ptr %arrayidx83.6.2, align 16, !tbaa !5
%call84.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %87)
%arrayidx83.7.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 7
%88 = load i32, ptr %arrayidx83.7.2, align 4, !tbaa !5
%call84.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %88)
%arrayidx83.8.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 8
%89 = load i32, ptr %arrayidx83.8.2, align 8, !tbaa !5
%call84.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %89)
%arrayidx83.9.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 2, i64 9
%90 = load i32, ptr %arrayidx83.9.2, align 4, !tbaa !5
%call84.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %90)
%putchar136.2 = call i32 @putchar(i32 10)
%puts135 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
%91 = load i32, ptr %mat4, align 16, !tbaa !5
%call103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %91)
%arrayidx102.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 1
%92 = load i32, ptr %arrayidx102.1, align 4, !tbaa !5
%call103.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %92)
%arrayidx102.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 2
%93 = load i32, ptr %arrayidx102.2, align 8, !tbaa !5
%call103.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %93)
%arrayidx102.3 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 3
%94 = load i32, ptr %arrayidx102.3, align 4, !tbaa !5
%call103.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %94)
%arrayidx102.4 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 4
%95 = load i32, ptr %arrayidx102.4, align 16, !tbaa !5
%call103.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %95)
%arrayidx102.5 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 5
%96 = load i32, ptr %arrayidx102.5, align 4, !tbaa !5
%call103.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %96)
%arrayidx102.6 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 6
%97 = load i32, ptr %arrayidx102.6, align 8, !tbaa !5
%call103.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %97)
%arrayidx102.7 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 7
%98 = load i32, ptr %arrayidx102.7, align 4, !tbaa !5
%call103.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %98)
%arrayidx102.8 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 8
%99 = load i32, ptr %arrayidx102.8, align 16, !tbaa !5
%call103.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %99)
%arrayidx102.9 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 0, i64 9
%100 = load i32, ptr %arrayidx102.9, align 4, !tbaa !5
%call103.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %100)
%putchar = call i32 @putchar(i32 10)
%arrayidx102.1172 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 0
%101 = load i32, ptr %arrayidx102.1172, align 4, !tbaa !5
%call103.1173 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %101)
%arrayidx102.1.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 1
%102 = load i32, ptr %arrayidx102.1.1, align 8, !tbaa !5
%call103.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %102)
%arrayidx102.2.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 2
%103 = load i32, ptr %arrayidx102.2.1, align 4, !tbaa !5
%call103.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %103)
%arrayidx102.3.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 3
%104 = load i32, ptr %arrayidx102.3.1, align 16, !tbaa !5
%call103.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %104)
%arrayidx102.4.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 4
%105 = load i32, ptr %arrayidx102.4.1, align 4, !tbaa !5
%call103.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %105)
%arrayidx102.5.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 5
%106 = load i32, ptr %arrayidx102.5.1, align 8, !tbaa !5
%call103.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %106)
%arrayidx102.6.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 6
%107 = load i32, ptr %arrayidx102.6.1, align 4, !tbaa !5
%call103.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %107)
%arrayidx102.7.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 7
%108 = load i32, ptr %arrayidx102.7.1, align 16, !tbaa !5
%call103.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %108)
%arrayidx102.8.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 8
%109 = load i32, ptr %arrayidx102.8.1, align 4, !tbaa !5
%call103.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %109)
%arrayidx102.9.1 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 1, i64 9
%110 = load i32, ptr %arrayidx102.9.1, align 8, !tbaa !5
%call103.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %110)
%putchar.1 = call i32 @putchar(i32 10)
%arrayidx102.2174 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 0
%111 = load i32, ptr %arrayidx102.2174, align 8, !tbaa !5
%call103.2175 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %111)
%arrayidx102.1.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 1
%112 = load i32, ptr %arrayidx102.1.2, align 4, !tbaa !5
%call103.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %112)
%arrayidx102.2.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 2
%113 = load i32, ptr %arrayidx102.2.2, align 16, !tbaa !5
%call103.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %113)
%arrayidx102.3.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 3
%114 = load i32, ptr %arrayidx102.3.2, align 4, !tbaa !5
%call103.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %114)
%arrayidx102.4.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 4
%115 = load i32, ptr %arrayidx102.4.2, align 8, !tbaa !5
%call103.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %115)
%arrayidx102.5.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 5
%116 = load i32, ptr %arrayidx102.5.2, align 4, !tbaa !5
%call103.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %116)
%arrayidx102.6.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 6
%117 = load i32, ptr %arrayidx102.6.2, align 16, !tbaa !5
%call103.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %117)
%arrayidx102.7.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 7
%118 = load i32, ptr %arrayidx102.7.2, align 4, !tbaa !5
%call103.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %118)
%arrayidx102.8.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 8
%119 = load i32, ptr %arrayidx102.8.2, align 8, !tbaa !5
%call103.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %119)
%arrayidx102.9.2 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 2, i64 9
%120 = load i32, ptr %arrayidx102.9.2, align 4, !tbaa !5
%call103.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %120)
%putchar.2 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 295704, ptr nonnull %mat4) #5
call void @llvm.lifetime.end.p0(i64 295704, ptr nonnull %mat3) #5
call void @llvm.lifetime.end.p0(i64 295704, ptr nonnull %mat2) #5
call void @llvm.lifetime.end.p0(i64 295704, ptr nonnull %mat1) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.0143 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%121 = load i32, ptr %a, align 4, !tbaa !5
switch i32 %121, label %for.inc [
i32 1, label %if.end.thread
i32 2, label %if.then7
i32 3, label %if.then17
i32 4, label %if.then27
]
if.end.thread: ; preds = %for.body
%122 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %122, -1
%idxprom = sext i32 %sub to i64
%123 = load i32, ptr %c, align 4, !tbaa !5
%sub3 = add nsw i32 %123, -1
%idxprom4 = sext i32 %sub3 to i64
%arrayidx5 = getelementptr inbounds [222 x [333 x i32]], ptr %mat1, i64 0, i64 %idxprom, i64 %idxprom4
br label %for.inc.sink.split
if.then7: ; preds = %for.body
%124 = load i32, ptr %b, align 4, !tbaa !5
%sub8 = add nsw i32 %124, -1
%idxprom9 = sext i32 %sub8 to i64
%125 = load i32, ptr %c, align 4, !tbaa !5
%sub11 = add nsw i32 %125, -1
%idxprom12 = sext i32 %sub11 to i64
%arrayidx13 = getelementptr inbounds [222 x [333 x i32]], ptr %mat2, i64 0, i64 %idxprom9, i64 %idxprom12
br label %for.inc.sink.split
if.then17: ; preds = %for.body
%126 = load i32, ptr %b, align 4, !tbaa !5
%sub18 = add nsw i32 %126, -1
%idxprom19 = sext i32 %sub18 to i64
%127 = load i32, ptr %c, align 4, !tbaa !5
%sub21 = add nsw i32 %127, -1
%idxprom22 = sext i32 %sub21 to i64
%arrayidx23 = getelementptr inbounds [222 x [333 x i32]], ptr %mat3, i64 0, i64 %idxprom19, i64 %idxprom22
br label %for.inc.sink.split
if.then27: ; preds = %for.body
%128 = load i32, ptr %b, align 4, !tbaa !5
%sub28 = add nsw i32 %128, -1
%idxprom29 = sext i32 %sub28 to i64
%129 = load i32, ptr %c, align 4, !tbaa !5
%sub31 = add nsw i32 %129, -1
%idxprom32 = sext i32 %sub31 to i64
%arrayidx33 = getelementptr inbounds [222 x [333 x i32]], ptr %mat4, i64 0, i64 %idxprom29, i64 %idxprom32
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then27, %if.then17, %if.end.thread, %if.then7
%arrayidx13.sink209 = phi ptr [ %arrayidx13, %if.then7 ], [ %arrayidx5, %if.end.thread ], [ %arrayidx23, %if.then17 ], [ %arrayidx33, %if.then27 ]
%.sink208 = load i32, ptr %d, align 4, !tbaa !5
%130 = load i32, ptr %arrayidx13.sink209, align 4, !tbaa !5
%add14 = add nsw i32 %130, %.sink208
store i32 %add14, ptr %arrayidx13.sink209, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc = add nuw nsw i32 %i.0143, 1
%131 = load i32, ptr %num, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %131
br i1 %cmp, label %for.body, label %for.cond36.preheader.loopexit, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#define BRANCH 4
#define FLOOR 3
#define ROOM 10
int main(void)
{
int b; /*branch*/
int f; /*floor*/
int r; /*room*/
int v; /*resident*/
int ninzuu[BRANCH][FLOOR][ROOM] = {0};
int n;
int i, j, k;
/******************input*****************/
scanf("\n%d",&n);
for(i=0; i<n; i++) {
scanf("\n%d %d %d %d",&b, &f, &r, &v);
ninzuu[b-1][f-1][r-1]=ninzuu[b-1][f-1][r-1] + v;
}
/*****************output*****************/
for(i=0; i<BRANCH; i++){
for(j=0; j<FLOOR; j++){
for(k=0; k<ROOM; k++){
printf(" %d",ninzuu[i][j][k]);
}
printf("\n");
}
if(i==BRANCH-1){break;}
else {printf("####################\n");}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"\0A%d\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"\0A%d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [21 x i8] c"####################\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i32, align 4
%f = alloca i32, align 4
%r = alloca i32, align 4
%v = alloca i32, align 4
%ninzuu = alloca [4 x [3 x [10 x i32]]], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %ninzuu) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %ninzuu, i8 0, i64 480, i1 false)
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
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.body, label %for.cond20.preheader.preheader
for.body: ; preds = %entry, %for.body
%i.055 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v)
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%idxprom = sext i32 %sub to i64
%2 = load i32, ptr %f, align 4, !tbaa !5
%sub2 = add nsw i32 %2, -1
%idxprom3 = sext i32 %sub2 to i64
%3 = load i32, ptr %r, align 4, !tbaa !5
%sub5 = add nsw i32 %3, -1
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%5 = load i32, ptr %v, align 4, !tbaa !5
%add = add nsw i32 %5, %4
store i32 %add, ptr %arrayidx7, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.055, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.cond20.preheader.preheader, !llvm.loop !9
for.cond20.preheader.preheader: ; preds = %for.body, %entry
br label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.cond20.preheader.preheader, %if.else
%indvars.iv = phi i64 [ %indvars.iv.next, %if.else ], [ 0, %for.cond20.preheader.preheader ]
%arrayidx31 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 0
%7 = load i32, ptr %arrayidx31, align 8, !tbaa !5
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%arrayidx31.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 1
%8 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5
%call32.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%arrayidx31.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 2
%9 = load i32, ptr %arrayidx31.2, align 8, !tbaa !5
%call32.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%arrayidx31.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 3
%10 = load i32, ptr %arrayidx31.3, align 4, !tbaa !5
%call32.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%arrayidx31.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 4
%11 = load i32, ptr %arrayidx31.4, align 8, !tbaa !5
%call32.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%arrayidx31.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 5
%12 = load i32, ptr %arrayidx31.5, align 4, !tbaa !5
%call32.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%arrayidx31.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 6
%13 = load i32, ptr %arrayidx31.6, align 8, !tbaa !5
%call32.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%arrayidx31.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 7
%14 = load i32, ptr %arrayidx31.7, align 4, !tbaa !5
%call32.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%arrayidx31.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 8
%15 = load i32, ptr %arrayidx31.8, align 8, !tbaa !5
%call32.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%arrayidx31.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 0, i64 9
%16 = load i32, ptr %arrayidx31.9, align 4, !tbaa !5
%call32.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%putchar = call i32 @putchar(i32 10)
%arrayidx31.161 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 0
%17 = load i32, ptr %arrayidx31.161, align 8, !tbaa !5
%call32.162 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%arrayidx31.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 1
%18 = load i32, ptr %arrayidx31.1.1, align 4, !tbaa !5
%call32.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%arrayidx31.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 2
%19 = load i32, ptr %arrayidx31.2.1, align 8, !tbaa !5
%call32.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19)
%arrayidx31.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 3
%20 = load i32, ptr %arrayidx31.3.1, align 4, !tbaa !5
%call32.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%arrayidx31.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 4
%21 = load i32, ptr %arrayidx31.4.1, align 8, !tbaa !5
%call32.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%arrayidx31.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 5
%22 = load i32, ptr %arrayidx31.5.1, align 4, !tbaa !5
%call32.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
%arrayidx31.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 6
%23 = load i32, ptr %arrayidx31.6.1, align 8, !tbaa !5
%call32.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
%arrayidx31.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 7
%24 = load i32, ptr %arrayidx31.7.1, align 4, !tbaa !5
%call32.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
%arrayidx31.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 8
%25 = load i32, ptr %arrayidx31.8.1, align 8, !tbaa !5
%call32.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25)
%arrayidx31.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 1, i64 9
%26 = load i32, ptr %arrayidx31.9.1, align 4, !tbaa !5
%call32.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26)
%putchar.1 = call i32 @putchar(i32 10)
%arrayidx31.263 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 0
%27 = load i32, ptr %arrayidx31.263, align 8, !tbaa !5
%call32.264 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%arrayidx31.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 1
%28 = load i32, ptr %arrayidx31.1.2, align 4, !tbaa !5
%call32.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28)
%arrayidx31.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 2
%29 = load i32, ptr %arrayidx31.2.2, align 8, !tbaa !5
%call32.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29)
%arrayidx31.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 3
%30 = load i32, ptr %arrayidx31.3.2, align 4, !tbaa !5
%call32.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30)
%arrayidx31.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 4
%31 = load i32, ptr %arrayidx31.4.2, align 8, !tbaa !5
%call32.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31)
%arrayidx31.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 5
%32 = load i32, ptr %arrayidx31.5.2, align 4, !tbaa !5
%call32.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32)
%arrayidx31.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 6
%33 = load i32, ptr %arrayidx31.6.2, align 8, !tbaa !5
%call32.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33)
%arrayidx31.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 7
%34 = load i32, ptr %arrayidx31.7.2, align 4, !tbaa !5
%call32.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34)
%arrayidx31.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 8
%35 = load i32, ptr %arrayidx31.8.2, align 8, !tbaa !5
%call32.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
%arrayidx31.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %ninzuu, i64 0, i64 %indvars.iv, i64 2, i64 9
%36 = load i32, ptr %arrayidx31.9.2, align 4, !tbaa !5
%call32.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36)
%putchar.2 = call i32 @putchar(i32 10)
%cmp40 = icmp eq i64 %indvars.iv, 3
br i1 %cmp40, label %for.end44, label %if.else
if.else: ; preds = %for.cond20.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.cond20.preheader
for.end44: ; preds = %for.cond20.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %ninzuu) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n,i,x,y,z;
int b,f,r,v; //b?£?f??????r???????????¨?±????v????????????
int count[4][3][10]={0};
scanf("%d\n",&n);
for( i=0 ; i<n ; i++){
scanf("%d%d%d%d",&b,&f,&r,&v);
count[b-1][f-1][r-1]=count[b-1][f-1][r-1]+v;
}
for( x=0 ; x<4 ; x++){
for( y=0 ; y<3 ; y++){
for( z=0 ; z<10 ; z++){
printf(" %d",count[x][y][z]);
if(z==9){
printf("\n");
}
}
}if(x!=3){
printf("####################\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236365/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236365/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [21 x i8] c"####################\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%b = alloca i32, align 4
%f = alloca i32, align 4
%r = alloca i32, align 4
%v = alloca i32, align 4
%count = alloca [4 x [3 x [10 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 %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 480, ptr nonnull %count) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(480) %count, i8 0, i64 480, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp57 = icmp sgt i32 %0, 0
br i1 %cmp57, label %for.body, label %for.inc35.9.2.preheader
for.body: ; preds = %entry, %for.body
%i.058 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %f, ptr noundef nonnull %r, ptr noundef nonnull %v)
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%idxprom = sext i32 %sub to i64
%2 = load i32, ptr %f, align 4, !tbaa !5
%sub2 = add nsw i32 %2, -1
%idxprom3 = sext i32 %sub2 to i64
%3 = load i32, ptr %r, align 4, !tbaa !5
%sub5 = add nsw i32 %3, -1
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %idxprom, i64 %idxprom3, i64 %idxprom6
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%5 = load i32, ptr %v, align 4, !tbaa !5
%add = add nsw i32 %5, %4
store i32 %add, ptr %arrayidx7, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.058, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.inc35.9.2.preheader, !llvm.loop !9
for.inc35.9.2.preheader: ; preds = %for.body, %entry
br label %for.inc35.9.2
for.inc35.9.2: ; preds = %for.inc35.9.2.preheader, %for.inc45
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc45 ], [ 0, %for.inc35.9.2.preheader ]
%arrayidx31 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 0
%7 = load i32, ptr %arrayidx31, align 8, !tbaa !5
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%arrayidx31.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 1
%8 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5
%call32.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%arrayidx31.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 2
%9 = load i32, ptr %arrayidx31.2, align 8, !tbaa !5
%call32.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%arrayidx31.3 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 3
%10 = load i32, ptr %arrayidx31.3, align 4, !tbaa !5
%call32.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%arrayidx31.4 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 4
%11 = load i32, ptr %arrayidx31.4, align 8, !tbaa !5
%call32.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%arrayidx31.5 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 5
%12 = load i32, ptr %arrayidx31.5, align 4, !tbaa !5
%call32.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%arrayidx31.6 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 6
%13 = load i32, ptr %arrayidx31.6, align 8, !tbaa !5
%call32.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%arrayidx31.7 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 7
%14 = load i32, ptr %arrayidx31.7, align 4, !tbaa !5
%call32.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%arrayidx31.8 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 8
%15 = load i32, ptr %arrayidx31.8, align 8, !tbaa !5
%call32.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%arrayidx31.9 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 0, i64 9
%16 = load i32, ptr %arrayidx31.9, align 4, !tbaa !5
%call32.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%putchar.9 = call i32 @putchar(i32 10)
%arrayidx31.164 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 0
%17 = load i32, ptr %arrayidx31.164, align 8, !tbaa !5
%call32.165 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%arrayidx31.1.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 1
%18 = load i32, ptr %arrayidx31.1.1, align 4, !tbaa !5
%call32.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%arrayidx31.2.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 2
%19 = load i32, ptr %arrayidx31.2.1, align 8, !tbaa !5
%call32.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19)
%arrayidx31.3.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 3
%20 = load i32, ptr %arrayidx31.3.1, align 4, !tbaa !5
%call32.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%arrayidx31.4.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 4
%21 = load i32, ptr %arrayidx31.4.1, align 8, !tbaa !5
%call32.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%arrayidx31.5.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 5
%22 = load i32, ptr %arrayidx31.5.1, align 4, !tbaa !5
%call32.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
%arrayidx31.6.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 6
%23 = load i32, ptr %arrayidx31.6.1, align 8, !tbaa !5
%call32.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
%arrayidx31.7.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 7
%24 = load i32, ptr %arrayidx31.7.1, align 4, !tbaa !5
%call32.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
%arrayidx31.8.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 8
%25 = load i32, ptr %arrayidx31.8.1, align 8, !tbaa !5
%call32.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25)
%arrayidx31.9.1 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 1, i64 9
%26 = load i32, ptr %arrayidx31.9.1, align 4, !tbaa !5
%call32.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26)
%putchar.9.1 = call i32 @putchar(i32 10)
%arrayidx31.269 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 0
%27 = load i32, ptr %arrayidx31.269, align 8, !tbaa !5
%call32.270 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%arrayidx31.1.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 1
%28 = load i32, ptr %arrayidx31.1.2, align 4, !tbaa !5
%call32.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28)
%arrayidx31.2.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 2
%29 = load i32, ptr %arrayidx31.2.2, align 8, !tbaa !5
%call32.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29)
%arrayidx31.3.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 3
%30 = load i32, ptr %arrayidx31.3.2, align 4, !tbaa !5
%call32.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30)
%arrayidx31.4.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 4
%31 = load i32, ptr %arrayidx31.4.2, align 8, !tbaa !5
%call32.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31)
%arrayidx31.5.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 5
%32 = load i32, ptr %arrayidx31.5.2, align 4, !tbaa !5
%call32.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32)
%arrayidx31.6.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 6
%33 = load i32, ptr %arrayidx31.6.2, align 8, !tbaa !5
%call32.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33)
%arrayidx31.7.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 7
%34 = load i32, ptr %arrayidx31.7.2, align 4, !tbaa !5
%call32.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34)
%arrayidx31.8.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 8
%35 = load i32, ptr %arrayidx31.8.2, align 8, !tbaa !5
%call32.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
%arrayidx31.9.2 = getelementptr inbounds [4 x [3 x [10 x i32]]], ptr %count, i64 0, i64 %indvars.iv, i64 2, i64 9
%36 = load i32, ptr %arrayidx31.9.2, align 4, !tbaa !5
%call32.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36)
%putchar.9.2 = call i32 @putchar(i32 10)
%cmp41.not = icmp eq i64 %indvars.iv, 3
br i1 %cmp41.not, label %for.end47, label %for.inc45
for.inc45: ; preds = %for.inc35.9.2
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %for.inc35.9.2
for.end47: ; preds = %for.inc35.9.2
call void @llvm.lifetime.end.p0(i64 480, ptr nonnull %count) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int a=0,b=0,c=0,d,x,w,v,y,count[10][10][10];
while(c != 4){
while(b != 3){
while(a != 10){
count[b][a][c]=0;
a++;
}
a=0;
b++;
}
b=0;
c++;
}
a=0; b=0; c=0;
scanf("%d",&d);
while(a != d){
scanf("%d %d %d %d",&v,&w,&x,&y);
count[w-1][x-1][v-1] += y;
a++;
}
a=0;
while(c != 4){
while(b != 3){
while(a != 10){
printf(" %d",count[b][a][c]);
a++;
}
printf("\n");
a=0;
b++;
}
b=0;
c++;
if(c!=4)
printf("####################\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_236415/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_236415/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [21 x i8] c"####################\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%x = alloca i32, align 4
%w = alloca i32, align 4
%v = alloca i32, align 4
%y = alloca i32, align 4
%count = alloca [10 x [10 x [10 x i32]]], align 16
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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %count) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %count, i8 0, i64 16, i1 false), !tbaa !5
%scevgep = getelementptr inbounds i8, ptr %count, i64 40
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep, i8 0, i64 16, i1 false), !tbaa !5
%scevgep84 = getelementptr inbounds i8, ptr %count, i64 80
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep84, i8 0, i64 16, i1 false), !tbaa !5
%scevgep85 = getelementptr inbounds i8, ptr %count, i64 120
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep85, i8 0, i64 16, i1 false), !tbaa !5
%scevgep86 = getelementptr inbounds i8, ptr %count, i64 160
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep86, i8 0, i64 16, i1 false), !tbaa !5
%scevgep87 = getelementptr inbounds i8, ptr %count, i64 200
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep87, i8 0, i64 16, i1 false), !tbaa !5
%scevgep88 = getelementptr inbounds i8, ptr %count, i64 240
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep88, i8 0, i64 16, i1 false), !tbaa !5
%scevgep89 = getelementptr inbounds i8, ptr %count, i64 280
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep89, i8 0, i64 16, i1 false), !tbaa !5
%scevgep90 = getelementptr inbounds i8, ptr %count, i64 320
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep90, i8 0, i64 16, i1 false), !tbaa !5
%scevgep91 = getelementptr inbounds i8, ptr %count, i64 360
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep91, i8 0, i64 16, i1 false), !tbaa !5
%scevgep92 = getelementptr inbounds i8, ptr %count, i64 400
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep92, i8 0, i64 16, i1 false), !tbaa !5
%scevgep93 = getelementptr inbounds i8, ptr %count, i64 440
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep93, i8 0, i64 16, i1 false), !tbaa !5
%scevgep94 = getelementptr inbounds i8, ptr %count, i64 480
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep94, i8 0, i64 16, i1 false), !tbaa !5
%scevgep95 = getelementptr inbounds i8, ptr %count, i64 520
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep95, i8 0, i64 16, i1 false), !tbaa !5
%scevgep96 = getelementptr inbounds i8, ptr %count, i64 560
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep96, i8 0, i64 16, i1 false), !tbaa !5
%scevgep97 = getelementptr inbounds i8, ptr %count, i64 600
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep97, i8 0, i64 16, i1 false), !tbaa !5
%scevgep98 = getelementptr inbounds i8, ptr %count, i64 640
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep98, i8 0, i64 16, i1 false), !tbaa !5
%scevgep99 = getelementptr inbounds i8, ptr %count, i64 680
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep99, i8 0, i64 16, i1 false), !tbaa !5
%scevgep100 = getelementptr inbounds i8, ptr %count, i64 720
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep100, i8 0, i64 16, i1 false), !tbaa !5
%scevgep101 = getelementptr inbounds i8, ptr %count, i64 760
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep101, i8 0, i64 16, i1 false), !tbaa !5
%scevgep102 = getelementptr inbounds i8, ptr %count, i64 800
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep102, i8 0, i64 16, i1 false), !tbaa !5
%scevgep103 = getelementptr inbounds i8, ptr %count, i64 840
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep103, i8 0, i64 16, i1 false), !tbaa !5
%scevgep104 = getelementptr inbounds i8, ptr %count, i64 880
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep104, i8 0, i64 16, i1 false), !tbaa !5
%scevgep105 = getelementptr inbounds i8, ptr %count, i64 920
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep105, i8 0, i64 16, i1 false), !tbaa !5
%scevgep106 = getelementptr inbounds i8, ptr %count, i64 960
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep106, i8 0, i64 16, i1 false), !tbaa !5
%scevgep107 = getelementptr inbounds i8, ptr %count, i64 1000
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep107, i8 0, i64 16, i1 false), !tbaa !5
%scevgep108 = getelementptr inbounds i8, ptr %count, i64 1040
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep108, i8 0, i64 16, i1 false), !tbaa !5
%scevgep109 = getelementptr inbounds i8, ptr %count, i64 1080
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep109, i8 0, i64 16, i1 false), !tbaa !5
%scevgep110 = getelementptr inbounds i8, ptr %count, i64 1120
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %scevgep110, i8 0, i64 16, i1 false), !tbaa !5
%scevgep111 = getelementptr inbounds i8, ptr %count, i64 1160
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %scevgep111, i8 0, i64 16, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
%cmp16.not75 = icmp eq i32 %0, 0
br i1 %cmp16.not75, label %while.cond32.preheader.preheader, label %while.body17
while.body17: ; preds = %entry, %while.body17
%a.376 = phi i32 [ %inc27, %while.body17 ], [ 0, %entry ]
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v, ptr noundef nonnull %w, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i32, ptr %y, align 4, !tbaa !5
%2 = load i32, ptr %w, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom19 = sext i32 %sub to i64
%3 = load i32, ptr %x, align 4, !tbaa !5
%sub21 = add nsw i32 %3, -1
%idxprom22 = sext i32 %sub21 to i64
%4 = load i32, ptr %v, align 4, !tbaa !5
%sub24 = add nsw i32 %4, -1
%idxprom25 = sext i32 %sub24 to i64
%arrayidx26 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 %idxprom19, i64 %idxprom22, i64 %idxprom25
%5 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%add = add nsw i32 %5, %1
store i32 %add, ptr %arrayidx26, align 4, !tbaa !5
%inc27 = add nuw nsw i32 %a.376, 1
%6 = load i32, ptr %d, align 4, !tbaa !5
%cmp16.not = icmp eq i32 %inc27, %6
br i1 %cmp16.not, label %while.cond32.preheader.preheader, label %while.body17, !llvm.loop !9
while.cond32.preheader.preheader: ; preds = %while.body17, %entry
br label %while.cond32.preheader
while.cond32.preheader: ; preds = %while.cond32.preheader.preheader, %if.then
%indvars.iv = phi i64 [ %indvars.iv.next, %if.then ], [ 0, %while.cond32.preheader.preheader ]
%arrayidx43 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%arrayidx43.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 1, i64 %indvars.iv
%8 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5
%call44.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%arrayidx43.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 2, i64 %indvars.iv
%9 = load i32, ptr %arrayidx43.2, align 4, !tbaa !5
%call44.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%arrayidx43.3 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 3, i64 %indvars.iv
%10 = load i32, ptr %arrayidx43.3, align 4, !tbaa !5
%call44.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%arrayidx43.4 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 4, i64 %indvars.iv
%11 = load i32, ptr %arrayidx43.4, align 4, !tbaa !5
%call44.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%arrayidx43.5 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 5, i64 %indvars.iv
%12 = load i32, ptr %arrayidx43.5, align 4, !tbaa !5
%call44.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%arrayidx43.6 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 6, i64 %indvars.iv
%13 = load i32, ptr %arrayidx43.6, align 4, !tbaa !5
%call44.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%arrayidx43.7 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 7, i64 %indvars.iv
%14 = load i32, ptr %arrayidx43.7, align 4, !tbaa !5
%call44.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%arrayidx43.8 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 8, i64 %indvars.iv
%15 = load i32, ptr %arrayidx43.8, align 4, !tbaa !5
%call44.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%arrayidx43.9 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 0, i64 9, i64 %indvars.iv
%16 = load i32, ptr %arrayidx43.9, align 4, !tbaa !5
%call44.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%putchar = call i32 @putchar(i32 10)
%arrayidx43.1115 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 0, i64 %indvars.iv
%17 = load i32, ptr %arrayidx43.1115, align 4, !tbaa !5
%call44.1116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%arrayidx43.1.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 1, i64 %indvars.iv
%18 = load i32, ptr %arrayidx43.1.1, align 4, !tbaa !5
%call44.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%arrayidx43.2.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 2, i64 %indvars.iv
%19 = load i32, ptr %arrayidx43.2.1, align 4, !tbaa !5
%call44.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19)
%arrayidx43.3.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 3, i64 %indvars.iv
%20 = load i32, ptr %arrayidx43.3.1, align 4, !tbaa !5
%call44.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%arrayidx43.4.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 4, i64 %indvars.iv
%21 = load i32, ptr %arrayidx43.4.1, align 4, !tbaa !5
%call44.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%arrayidx43.5.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 5, i64 %indvars.iv
%22 = load i32, ptr %arrayidx43.5.1, align 4, !tbaa !5
%call44.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
%arrayidx43.6.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 6, i64 %indvars.iv
%23 = load i32, ptr %arrayidx43.6.1, align 4, !tbaa !5
%call44.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
%arrayidx43.7.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 7, i64 %indvars.iv
%24 = load i32, ptr %arrayidx43.7.1, align 4, !tbaa !5
%call44.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
%arrayidx43.8.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 8, i64 %indvars.iv
%25 = load i32, ptr %arrayidx43.8.1, align 4, !tbaa !5
%call44.8.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25)
%arrayidx43.9.1 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 1, i64 9, i64 %indvars.iv
%26 = load i32, ptr %arrayidx43.9.1, align 4, !tbaa !5
%call44.9.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %26)
%putchar.1 = call i32 @putchar(i32 10)
%arrayidx43.2117 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 0, i64 %indvars.iv
%27 = load i32, ptr %arrayidx43.2117, align 4, !tbaa !5
%call44.2118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%arrayidx43.1.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 1, i64 %indvars.iv
%28 = load i32, ptr %arrayidx43.1.2, align 4, !tbaa !5
%call44.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %28)
%arrayidx43.2.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 2, i64 %indvars.iv
%29 = load i32, ptr %arrayidx43.2.2, align 4, !tbaa !5
%call44.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29)
%arrayidx43.3.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 3, i64 %indvars.iv
%30 = load i32, ptr %arrayidx43.3.2, align 4, !tbaa !5
%call44.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %30)
%arrayidx43.4.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 4, i64 %indvars.iv
%31 = load i32, ptr %arrayidx43.4.2, align 4, !tbaa !5
%call44.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %31)
%arrayidx43.5.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 5, i64 %indvars.iv
%32 = load i32, ptr %arrayidx43.5.2, align 4, !tbaa !5
%call44.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %32)
%arrayidx43.6.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 6, i64 %indvars.iv
%33 = load i32, ptr %arrayidx43.6.2, align 4, !tbaa !5
%call44.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %33)
%arrayidx43.7.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 7, i64 %indvars.iv
%34 = load i32, ptr %arrayidx43.7.2, align 4, !tbaa !5
%call44.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %34)
%arrayidx43.8.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 8, i64 %indvars.iv
%35 = load i32, ptr %arrayidx43.8.2, align 4, !tbaa !5
%call44.8.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %35)
%arrayidx43.9.2 = getelementptr inbounds [10 x [10 x [10 x i32]]], ptr %count, i64 0, i64 2, i64 9, i64 %indvars.iv
%36 = load i32, ptr %arrayidx43.9.2, align 4, !tbaa !5
%call44.9.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %36)
%putchar.2 = call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cond = icmp eq i64 %indvars.iv.next, 4
br i1 %cond, label %while.end53, label %if.then
if.then: ; preds = %while.cond32.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %while.cond32.preheader
while.end53: ; preds = %while.cond32.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %count) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.