Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
#include<string.h>
int main(){
char s[101];
int n, i, m;
scanf("%s",s);
n = 0;
while (s[n]!= '\0'){
n++;
}
m=n;
n=(n-1)/2;
for(i=0; i<m; i++){
if(s[i]!=s[m-1-i]){
printf("No\n");
return 0;
}
}
for(i=0; i<n; i++){
if(s[i]!=s[n-1-i]){
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186433/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186433/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv64 = phi i32 [ %indvars.iv.next65, %while.cond ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next65 = add nuw i32 %indvars.iv64, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%sub = add nsw i32 %1, -1
%div = sdiv i32 %sub, 2
%cmp255.not = icmp eq i32 %1, 0
br i1 %cmp255.not, label %cleanup, label %for.body.preheader
for.body.preheader: ; preds = %while.end
%2 = sext i32 %sub to i64
%wide.trip.count = zext i32 %indvars.iv64 to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count
br i1 %exitcond.not, label %for.cond16.preheader, label %for.body, !llvm.loop !10
for.cond16.preheader: ; preds = %for.cond
%cmp1757 = icmp ugt i32 %1, 2
br i1 %cmp1757, label %for.body19.preheader, label %cleanup
for.body19.preheader: ; preds = %for.cond16.preheader
%smax = call i32 @llvm.smax.i32(i32 %div, i32 1)
%wide.trip.count69 = zext i32 %smax to i64
br label %for.body19
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv60 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next61, %for.cond ]
%arrayidx5 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv60
%3 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%4 = sub nsw i64 %2, %indvars.iv60
%arrayidx10 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %4
%5 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%cmp12.not = icmp eq i8 %3, %5
br i1 %cmp12.not, label %for.cond, label %cleanup
for.cond16: ; preds = %for.body19
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond70.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count69
br i1 %exitcond70.not, label %cleanup, label %for.body19, !llvm.loop !11
for.body19: ; preds = %for.body19.preheader, %for.cond16
%indvars.iv66 = phi i64 [ 0, %for.body19.preheader ], [ %indvars.iv.next67, %for.cond16 ]
%arrayidx21 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv66
%6 = load i8, ptr %arrayidx21, align 1, !tbaa !5
%7 = trunc i64 %indvars.iv66 to i32
%8 = xor i32 %7, -1
%sub24 = add i32 %div, %8
%idxprom25 = sext i32 %sub24 to i64
%arrayidx26 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %idxprom25
%9 = load i8, ptr %arrayidx26, align 1, !tbaa !5
%cmp28.not = icmp eq i8 %6, %9
br i1 %cmp28.not, label %for.cond16, label %cleanup
cleanup: ; preds = %for.body, %for.cond16, %for.body19, %for.cond16.preheader, %while.end
%str.sink = phi ptr [ @str, %while.end ], [ @str, %for.cond16.preheader ], [ @str.4, %for.body19 ], [ @str, %for.cond16 ], [ @str.4, %for.body ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
|
#include <stdio.h>
int main(){
int x;
int y;
while(1){
scanf("%d %d", &x, &y);
if(x==0&& y ==0){
break;
}
if(x < y){
printf("%d %d\n", x,y);
}else{
printf("%d %d\n", y,x);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186477/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186477/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %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
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp10 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp111 = icmp eq i32 %1, 0
%or.cond12 = select i1 %cmp10, i1 %cmp111, i1 false
br i1 %or.cond12, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end6
%2 = phi i32 [ %5, %if.end6 ], [ %1, %entry ]
%3 = phi i32 [ %4, %if.end6 ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.else
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
br label %if.end6
if.else: ; preds = %if.end
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %3)
br label %if.end6
if.end6: ; preds = %if.else, %if.then3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end6, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
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"}
|
#include<stdio.h>
int main(void)
{
int x, y;
int i;
int dummy;
for(i = 0;;i++){
scanf("%d",&x);
scanf("%d",&y);
if(x == 0 && y == 0)
{
break;
}
if(x > y)
{
dummy = x;
x = y;
y = dummy;
printf("%d %d\n",x ,y);
}
else
{
printf("%d %d\n",x ,y);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186527/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186527/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call111 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp12 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp213 = icmp eq i32 %1, 0
%or.cond14 = select i1 %cmp12, i1 %cmp213, i1 false
br i1 %or.cond14, label %for.end, label %if.end
if.end: ; preds = %entry, %for.inc
%2 = phi i32 [ %5, %for.inc ], [ %1, %entry ]
%3 = phi i32 [ %4, %for.inc ], [ %0, %entry ]
%cmp3 = icmp sgt i32 %3, %2
br i1 %cmp3, label %if.then4, label %if.else
if.then4: ; preds = %if.end
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %3, ptr %y, align 4, !tbaa !5
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %3)
br label %for.inc
if.else: ; preds = %if.end
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
br label %for.inc
for.inc: ; preds = %if.then4, %if.else
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %y, align 4
%cmp2 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp2, i1 false
br i1 %or.cond, label %for.end, label %if.end
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
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"}
|
#include <stdio.h>
int main() {
while (1) {
int a, b;
scanf("%d %d", &a, &b);
if ((a==0)&&(b==0)) break;
else if (a < b) printf("%d %d\n", a, b);
else printf("%d %d\n", b, a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call13 = 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
%cmp14 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp115 = icmp eq i32 %1, 0
%or.cond16 = select i1 %cmp14, i1 %cmp115, i1 false
br i1 %or.cond16, label %while.end, label %if.else
if.else: ; preds = %entry, %cleanup
%2 = phi i32 [ %5, %cleanup ], [ %1, %entry ]
%3 = phi i32 [ %4, %cleanup ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.else5
if.then3: ; preds = %if.else
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %2)
br label %cleanup
if.else5: ; preds = %if.else
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %3)
br label %cleanup
cleanup: ; preds = %if.else5, %if.then3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%4 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.else
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int x, y, tmp;
while(1)
{
scanf("%d %d", &x, &y);
if(x == 0 && y == 0)
break;
if(x > y)
{
tmp = x;
x = y;
y = tmp;
}
printf("%d %d\n", x, y);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186613/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186613/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %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
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp8 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp19 = icmp eq i32 %1, 0
%or.cond10 = select i1 %cmp8, i1 %cmp19, i1 false
br i1 %or.cond10, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end4
%2 = phi i32 [ %7, %if.end4 ], [ %1, %entry ]
%3 = phi i32 [ %6, %if.end4 ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end4
if.then3: ; preds = %if.end
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %3, ptr %y, align 4, !tbaa !5
br label %if.end4
if.end4: ; preds = %if.then3, %if.end
%4 = phi i32 [ %3, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %2, %if.then3 ], [ %3, %if.end ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%6 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end4, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
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"}
|
#include <stdio.h>
int main(void)
{
int x, y;
while (scanf("%d %d", &x, &y)){
if (x == 0 && y == 0){
break;
}
if (x < y){
printf("%d %d\n", x, y);
}
else {
printf("%d %d\n", y, x);
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186679/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186679/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %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
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%tobool.not10 = icmp eq i32 %call9, 0
br i1 %tobool.not10, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end6
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
if.end: ; preds = %while.body
%cmp2 = icmp slt i32 %0, %1
br i1 %cmp2, label %if.then3, label %if.else
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1)
br label %if.end6
if.else: ; preds = %if.end
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0)
br label %if.end6
if.end6: ; preds = %if.else, %if.then3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end6, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
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>
int main(void){
int x,y,t;
while(1){
t=0;
scanf("%d %d",&x,&y);
if(x==0&&y==0){
break;
}
if(x>y){
t=x;
x=y;
y=t;
}
printf("%d %d\n",x,y);
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186729/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186729/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %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
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp8 = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp19 = icmp eq i32 %1, 0
%or.cond10 = select i1 %cmp8, i1 %cmp19, i1 false
br i1 %or.cond10, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end4
%2 = phi i32 [ %7, %if.end4 ], [ %1, %entry ]
%3 = phi i32 [ %6, %if.end4 ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end4
if.then3: ; preds = %if.end
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %3, ptr %y, align 4, !tbaa !5
br label %if.end4
if.end4: ; preds = %if.then3, %if.end
%4 = phi i32 [ %3, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %2, %if.then3 ], [ %3, %if.end ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%6 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %y, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end4, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
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"}
|
#include <stdio.h>
int main(){
int x,y,temp;
while(1){
scanf("%d %d",&x,&y);
if((x==0)&(y==0)) break;
if(y<x){
printf("%d %d\n",y,x);
}else{
printf("%d %d\n",x,y);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186794/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186794/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %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
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%2 = or i32 %1, %0
%and1113 = icmp eq i32 %2, 0
br i1 %and1113, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end8
%3 = phi i32 [ %6, %if.end8 ], [ %1, %entry ]
%4 = phi i32 [ %5, %if.end8 ], [ %0, %entry ]
%cmp3 = icmp slt i32 %3, %4
br i1 %cmp3, label %if.then5, label %if.else
if.then5: ; preds = %if.end
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %4)
br label %if.end8
if.else: ; preds = %if.end
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %3)
br label %if.end8
if.end8: ; preds = %if.else, %if.then5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%5 = load i32, ptr %x, align 4, !tbaa !5
%6 = load i32, ptr %y, align 4, !tbaa !5
%7 = or i32 %6, %5
%and11 = icmp eq i32 %7, 0
br i1 %and11, label %while.end, label %if.end
while.end: ; preds = %if.end8, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
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"}
|
#include <stdio.h>
int main(void)
{
int a[10000];
int n=0;
while(1){
scanf("%d %d",&a[n],&a[n+1]);
if(a[n]==0&&a[n+1]==0)break;
n+=2;
}
int b=0;
while(b<n)
{
if(a[b]<a[b+1])
{
printf("%d %d\n",a[b],a[b+1]);
}
else
{
printf("%d %d\n",a[b+1],a[b]);
}
b+=2;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186844/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186844/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3
br label %while.cond
while.cond: ; preds = %if.end, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%0 = or i64 %indvars.iv, 1
%arrayidx2 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %0
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx, align 8, !tbaa !5
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %while.cond
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp8 = icmp eq i32 %2, 0
br i1 %cmp8, label %while.cond10.preheader, label %if.end
while.cond10.preheader: ; preds = %land.lhs.true
%3 = and i64 %indvars.iv, 4294967294
%cmp1149.not = icmp eq i64 %3, 0
br i1 %cmp1149.not, label %while.end34, label %while.body12.preheader
while.body12.preheader: ; preds = %while.cond10.preheader
%4 = and i64 %indvars.iv, 4294967294
br label %while.body12
if.end: ; preds = %land.lhs.true, %while.cond
%indvars.iv.next = add nuw i64 %indvars.iv, 2
br label %while.cond
while.body12: ; preds = %while.body12.preheader, %if.end32
%indvars.iv53 = phi i64 [ 0, %while.body12.preheader ], [ %indvars.iv.next54, %if.end32 ]
%arrayidx14 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv53
%5 = load i32, ptr %arrayidx14, align 8, !tbaa !5
%6 = or i64 %indvars.iv53, 1
%arrayidx17 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %6
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp slt i32 %5, %7
br i1 %cmp18, label %if.then19, label %if.else
if.then19: ; preds = %while.body12
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %7)
br label %if.end32
if.else: ; preds = %while.body12
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %5)
br label %if.end32
if.end32: ; preds = %if.else, %if.then19
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 2
%cmp11 = icmp ult i64 %indvars.iv.next54, %4
br i1 %cmp11, label %while.body12, label %while.end34, !llvm.loop !9
while.end34: ; preds = %if.end32, %while.cond10.preheader
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
typedef struct data{
int x;
int y;
struct data *next;
}DATA;
void inputXY(DATA *p);
void soatXY(DATA *p);
void printXY(DATA *p);
int main(void)
{
DATA *p;
p = (DATA*)malloc(sizeof(DATA));
inputXY(p);
soatXY(p);
printXY(p);
return 0;
}
void inputXY(DATA *p)
{
scanf("%d %d", &p->x, &p->y);
if(p->x != 0 || p->y != 0){
p->next = (DATA*)malloc(sizeof(DATA));
inputXY(p->next);
}
}
void soatXY(DATA *p)
{
int tmp;
if(p->x > p->y){
tmp = p->x;
p->x = p->y;
p->y = tmp;
}
if(p->next->x != 0 || p->next->y != 0) soatXY(p->next);
}
void printXY(DATA *p){
printf("%d %d\n", p->x, p->y);
if(p->next->x != 0 || p->next->y != 0) printXY(p->next);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186901/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186901/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.data = type { i32, i32, ptr }
@.str = private unnamed_addr constant [6 x i8] c"%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:
%call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
br label %tailrecurse.i
tailrecurse.i: ; preds = %if.then.i, %entry
%p.tr.i = phi ptr [ %call, %entry ], [ %call4.i, %if.then.i ]
%y.i = getelementptr inbounds %struct.data, ptr %p.tr.i, i64 0, i32 1
%call.i = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %p.tr.i, ptr noundef nonnull %y.i)
%0 = load i32, ptr %p.tr.i, align 8, !tbaa !5
%cmp.not.i = icmp eq i32 %0, 0
br i1 %cmp.not.i, label %lor.lhs.false.i, label %if.then.i
lor.lhs.false.i: ; preds = %tailrecurse.i
%1 = load i32, ptr %y.i, align 4, !tbaa !11
%cmp3.not.i = icmp eq i32 %1, 0
br i1 %cmp3.not.i, label %inputXY.exit, label %if.then.i
if.then.i: ; preds = %lor.lhs.false.i, %tailrecurse.i
%call4.i = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
%next.i = getelementptr inbounds %struct.data, ptr %p.tr.i, i64 0, i32 2
store ptr %call4.i, ptr %next.i, align 8, !tbaa !12
br label %tailrecurse.i
inputXY.exit: ; preds = %lor.lhs.false.i
%.pre.i = load i32, ptr %call, align 8, !tbaa !5
br label %tailrecurse.i3
tailrecurse.i3: ; preds = %tailrecurse.i3.backedge, %inputXY.exit
%2 = phi i32 [ %.pre.i, %inputXY.exit ], [ %5, %tailrecurse.i3.backedge ]
%p.tr.i4 = phi ptr [ %call, %inputXY.exit ], [ %4, %tailrecurse.i3.backedge ]
%y.i5 = getelementptr inbounds %struct.data, ptr %p.tr.i4, i64 0, i32 1
%3 = load i32, ptr %y.i5, align 4, !tbaa !11
%cmp.i = icmp sgt i32 %2, %3
br i1 %cmp.i, label %if.then.i8, label %if.end.i
if.then.i8: ; preds = %tailrecurse.i3
store i32 %3, ptr %p.tr.i4, align 8, !tbaa !5
store i32 %2, ptr %y.i5, align 4, !tbaa !11
br label %if.end.i
if.end.i: ; preds = %if.then.i8, %tailrecurse.i3
%next.i6 = getelementptr inbounds %struct.data, ptr %p.tr.i4, i64 0, i32 2
%4 = load ptr, ptr %next.i6, align 8, !tbaa !12
%5 = load i32, ptr %4, align 8, !tbaa !5
%cmp6.not.i = icmp eq i32 %5, 0
br i1 %cmp6.not.i, label %lor.lhs.false.i7, label %tailrecurse.i3.backedge
lor.lhs.false.i7: ; preds = %if.end.i
%y8.i = getelementptr inbounds %struct.data, ptr %4, i64 0, i32 1
%6 = load i32, ptr %y8.i, align 4, !tbaa !11
%cmp9.not.i = icmp eq i32 %6, 0
br i1 %cmp9.not.i, label %soatXY.exit, label %tailrecurse.i3.backedge
tailrecurse.i3.backedge: ; preds = %lor.lhs.false.i7, %if.end.i
br label %tailrecurse.i3
soatXY.exit: ; preds = %lor.lhs.false.i7
%.pre.i9 = load i32, ptr %call, align 8, !tbaa !5
br label %tailrecurse.i10
tailrecurse.i10: ; preds = %tailrecurse.i10.backedge, %soatXY.exit
%7 = phi i32 [ %.pre.i9, %soatXY.exit ], [ %10, %tailrecurse.i10.backedge ]
%p.tr.i11 = phi ptr [ %call, %soatXY.exit ], [ %9, %tailrecurse.i10.backedge ]
%y.i12 = getelementptr inbounds %struct.data, ptr %p.tr.i11, i64 0, i32 1
%8 = load i32, ptr %y.i12, align 4, !tbaa !11
%call.i13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %8)
%next.i14 = getelementptr inbounds %struct.data, ptr %p.tr.i11, i64 0, i32 2
%9 = load ptr, ptr %next.i14, align 8, !tbaa !12
%10 = load i32, ptr %9, align 8, !tbaa !5
%cmp.not.i15 = icmp eq i32 %10, 0
br i1 %cmp.not.i15, label %lor.lhs.false.i17, label %tailrecurse.i10.backedge
lor.lhs.false.i17: ; preds = %tailrecurse.i10
%y3.i = getelementptr inbounds %struct.data, ptr %9, i64 0, i32 1
%11 = load i32, ptr %y3.i, align 4, !tbaa !11
%cmp4.not.i = icmp eq i32 %11, 0
br i1 %cmp4.not.i, label %printXY.exit, label %tailrecurse.i10.backedge
tailrecurse.i10.backedge: ; preds = %lor.lhs.false.i17, %tailrecurse.i10
br label %tailrecurse.i10
printXY.exit: ; preds = %lor.lhs.false.i17
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 #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @inputXY(ptr noundef %p) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.then, %entry
%p.tr = phi ptr [ %p, %entry ], [ %call4, %if.then ]
%y = getelementptr inbounds %struct.data, ptr %p.tr, i64 0, i32 1
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %p.tr, ptr noundef nonnull %y)
%0 = load i32, ptr %p.tr, align 8, !tbaa !5
%cmp.not = icmp eq i32 %0, 0
br i1 %cmp.not, label %lor.lhs.false, label %if.then
lor.lhs.false: ; preds = %tailrecurse
%1 = load i32, ptr %y, align 4, !tbaa !11
%cmp3.not = icmp eq i32 %1, 0
br i1 %cmp3.not, label %if.end, label %if.then
if.then: ; preds = %lor.lhs.false, %tailrecurse
%call4 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #4
%next = getelementptr inbounds %struct.data, ptr %p.tr, i64 0, i32 2
store ptr %call4, ptr %next, align 8, !tbaa !12
br label %tailrecurse
if.end: ; preds = %lor.lhs.false
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @soatXY(ptr nocapture noundef %p) local_unnamed_addr #2 {
entry:
%.pre = load i32, ptr %p, align 8, !tbaa !5
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%0 = phi i32 [ %.pre, %entry ], [ %3, %tailrecurse.backedge ]
%p.tr = phi ptr [ %p, %entry ], [ %2, %tailrecurse.backedge ]
%y = getelementptr inbounds %struct.data, ptr %p.tr, i64 0, i32 1
%1 = load i32, ptr %y, align 4, !tbaa !11
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %tailrecurse
store i32 %1, ptr %p.tr, align 8, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !11
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%next = getelementptr inbounds %struct.data, ptr %p.tr, i64 0, i32 2
%2 = load ptr, ptr %next, align 8, !tbaa !12
%3 = load i32, ptr %2, align 8, !tbaa !5
%cmp6.not = icmp eq i32 %3, 0
br i1 %cmp6.not, label %lor.lhs.false, label %tailrecurse.backedge
lor.lhs.false: ; preds = %if.end
%y8 = getelementptr inbounds %struct.data, ptr %2, i64 0, i32 1
%4 = load i32, ptr %y8, align 4, !tbaa !11
%cmp9.not = icmp eq i32 %4, 0
br i1 %cmp9.not, label %if.end12, label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %lor.lhs.false, %if.end
br label %tailrecurse
if.end12: ; preds = %lor.lhs.false
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printXY(ptr nocapture noundef readonly %p) local_unnamed_addr #0 {
entry:
%.pre = load i32, ptr %p, align 8, !tbaa !5
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%0 = phi i32 [ %.pre, %entry ], [ %3, %tailrecurse.backedge ]
%p.tr = phi ptr [ %p, %entry ], [ %2, %tailrecurse.backedge ]
%y = getelementptr inbounds %struct.data, ptr %p.tr, i64 0, i32 1
%1 = load i32, ptr %y, align 4, !tbaa !11
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1)
%next = getelementptr inbounds %struct.data, ptr %p.tr, i64 0, i32 2
%2 = load ptr, ptr %next, align 8, !tbaa !12
%3 = load i32, ptr %2, align 8, !tbaa !5
%cmp.not = icmp eq i32 %3, 0
br i1 %cmp.not, label %lor.lhs.false, label %tailrecurse.backedge
lor.lhs.false: ; preds = %tailrecurse
%y3 = getelementptr inbounds %struct.data, ptr %2, i64 0, i32 1
%4 = load i32, ptr %y3, align 4, !tbaa !11
%cmp4.not = icmp eq i32 %4, 0
br i1 %cmp4.not, label %if.end, label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %lor.lhs.false, %tailrecurse
br label %tailrecurse
if.end: ; preds = %lor.lhs.false
ret void
}
; 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "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, 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 = { 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, !7, i64 0}
!6 = !{!"data", !7, i64 0, !7, i64 4, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 8}
|
#include <stdio.h>
int main(int argc, char const *argv[]) {
int N;
scanf("%d", &N);
long long int mod = 1000000007;
//printf("%d\n", mod);
long long int sum = 1;
for (int i = 0; i < N; i++) {
sum = ((long long int)sum * (i + 1)) % mod;
//printf("%d回目\n", i);
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186945/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186945/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) 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
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count, 3
%1 = icmp ult i32 %0, 4
br i1 %1, label %for.cond.cleanup.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.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%sum.06.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%sum.06.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %sum.06.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%mul.epil = mul nsw i64 %sum.06.epil, %indvars.iv.next.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%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 !9
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%sum.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%sum.06 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%indvars.iv.next = or i64 %indvars.iv, 1
%mul = mul nsw i64 %sum.06, %indvars.iv.next
%rem = srem i64 %mul, 1000000007
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%mul.1 = mul nsw i64 %rem, %indvars.iv.next.1
%rem.1 = srem i64 %mul.1, 1000000007
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%mul.2 = mul nsw i64 %rem.1, %indvars.iv.next.2
%rem.2 = srem i64 %mul.2, 1000000007
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%mul.3 = mul nsw i64 %rem.2, %indvars.iv.next.3
%rem.3 = srem i64 %mul.3, 1000000007
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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.unroll.disable"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
long n,r=1;
for(scanf("%ld",&n);n;n--)r=(r*n)%(int)(1e9+7);
printf("%d",r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_186989/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_186989/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [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 i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%.pr = load i64, ptr %n, align 8, !tbaa !5
%tobool.not3 = icmp eq i64 %.pr, 0
br i1 %tobool.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %.pr, 3
%0 = icmp ult i64 %.pr, 4
br i1 %0, label %for.cond.for.end_crit_edge.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %.pr, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.04 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%1 = phi i64 [ %.pr, %for.body.preheader.new ], [ %dec.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %r.04, %1
%rem = srem i64 %mul, 1000000007
%dec = add nsw i64 %1, -1
%mul.1 = mul nsw i64 %rem, %dec
%rem.1 = srem i64 %mul.1, 1000000007
%dec.1 = add nsw i64 %1, -2
%mul.2 = mul nsw i64 %rem.1, %dec.1
%rem.2 = srem i64 %mul.2, 1000000007
%dec.2 = add nsw i64 %1, -3
%mul.3 = mul nsw i64 %rem.2, %dec.2
%rem.3 = srem i64 %mul.3, 1000000007
%dec.3 = add nsw i64 %1, -4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.for.end_crit_edge.unr-lcssa, label %for.body, !llvm.loop !9
for.cond.for.end_crit_edge.unr-lcssa: ; preds = %for.body, %for.body.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%r.04.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%.unr = phi i64 [ %.pr, %for.body.preheader ], [ %dec.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.for.end_crit_edge, label %for.body.epil
for.body.epil: ; preds = %for.cond.for.end_crit_edge.unr-lcssa, %for.body.epil
%r.04.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %r.04.unr, %for.cond.for.end_crit_edge.unr-lcssa ]
%2 = phi i64 [ %dec.epil, %for.body.epil ], [ %.unr, %for.cond.for.end_crit_edge.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.for.end_crit_edge.unr-lcssa ]
%mul.epil = mul nsw i64 %r.04.epil, %2
%rem.epil = srem i64 %mul.epil, 1000000007
%dec.epil = add nsw i64 %2, -1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.for.end_crit_edge, label %for.body.epil, !llvm.loop !11
for.cond.for.end_crit_edge: ; preds = %for.body.epil, %for.cond.for.end_crit_edge.unr-lcssa
%rem.lcssa = phi i64 [ %rem.lcssa.ph, %for.cond.for.end_crit_edge.unr-lcssa ], [ %rem.epil, %for.body.epil ]
store i64 0, ptr %n, align 8, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %entry
%r.0.lcssa = phi i64 [ %rem.lcssa, %for.cond.for.end_crit_edge ], [ 1, %entry ]
%call1 = 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 %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", !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"}
|
#include<stdio.h>
long long int ans;
int N, i;
int MOD = 1000000007;
int main(){
scanf("%d\n", &N);
ans=1;
for(i=2; i<=N; ++i){
ans *= i;
ans %= MOD;
}
printf("%lld\n", ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187030/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187030/source.c"
target datalayout = "e-m:e-p270: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 global i32 1000000007, align 4
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@N = dso_local global i32 0, align 4
@ans = dso_local local_unnamed_addr global i64 0, align 8
@i = dso_local local_unnamed_addr global i32 0, align 4
@.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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
store i64 1, ptr @ans, align 8, !tbaa !5
%0 = load i32, ptr @N, align 4, !tbaa !9
%cmp.not4 = icmp slt i32 %0, 2
br i1 %cmp.not4, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr @MOD, align 4, !tbaa !9
%conv1 = sext i32 %1 to i64
%2 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %2 to i64
%3 = add nsw i64 %wide.trip.count, -2
%4 = add nsw i64 %wide.trip.count, -3
%xtraiter = and i64 %3, 3
%5 = icmp ult i64 %4, 3
br i1 %5, label %for.cond.for.end_crit_edge.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %3, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 2, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.body ]
%rem35 = phi i64 [ 1, %for.body.lr.ph.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %rem35, %indvars.iv
%rem = srem i64 %mul, %conv1
%indvars.iv.next = or i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, %conv1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nsw i64 %rem.1, %indvars.iv.next.1
%rem.2 = srem i64 %mul.2, %conv1
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nsw i64 %rem.2, %indvars.iv.next.2
%rem.3 = srem i64 %mul.3, %conv1
%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.cond.for.end_crit_edge.unr-lcssa, label %for.body, !llvm.loop !11
for.cond.for.end_crit_edge.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%rem.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.body ]
%rem35.unr = phi i64 [ 1, %for.body.lr.ph ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.for.end_crit_edge, label %for.body.epil
for.body.epil: ; preds = %for.cond.for.end_crit_edge.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond.for.end_crit_edge.unr-lcssa ]
%rem35.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %rem35.unr, %for.cond.for.end_crit_edge.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.for.end_crit_edge.unr-lcssa ]
%mul.epil = mul nsw i64 %rem35.epil, %indvars.iv.epil
%rem.epil = srem i64 %mul.epil, %conv1
%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.cond.for.end_crit_edge, label %for.body.epil, !llvm.loop !13
for.cond.for.end_crit_edge: ; preds = %for.body.epil, %for.cond.for.end_crit_edge.unr-lcssa
%rem.lcssa = phi i64 [ %rem.lcssa.ph, %for.cond.for.end_crit_edge.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%6 = add i32 %0, 1
store i64 %rem.lcssa, ptr @ans, align 8, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %entry
%7 = phi i64 [ %rem.lcssa, %for.cond.for.end_crit_edge ], [ 1, %entry ]
%storemerge.lcssa = phi i32 [ %6, %for.cond.for.end_crit_edge ], [ 2, %entry ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !9
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %7)
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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main (void) {
int n,i;
long long int power = 1;
scanf("%d", &n);
for(i=1;i <= n;i++) {
power = (power*i)%1000000007;
}
printf("%d\n",power);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187074/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187074/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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.not5 = icmp slt i32 %0, 1
br i1 %cmp.not5, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%3 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %2, 3
%4 = icmp ult i64 %3, 3
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 %2, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%power.07 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %power.07, %indvars.iv
%rem = srem i64 %mul, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nsw i64 %rem.1, %indvars.iv.next.1
%rem.2 = srem i64 %mul.2, 1000000007
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nsw i64 %rem.2, %indvars.iv.next.2
%rem.3 = srem i64 %mul.3, 1000000007
%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
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%power.07.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.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 ]
%power.07.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %power.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %power.07.epil, %indvars.iv.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%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, %entry
%power.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %power.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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
long long int n,i,power=1;
scanf("%lld",&n);
for(i=1;i<=n;i++){
power=power*i;
power=power%(10*10*10*10*10*10*10*10*10+7);
}
printf("%lld\n",power);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187117/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187117/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not6 = icmp slt i64 %0, 1
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %0, 3
%1 = icmp ult i64 %0, 4
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 %0, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%power.08 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%i.07 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nsw i64 %power.08, %i.07
%rem = srem i64 %mul, 1000000007
%inc = add nuw nsw i64 %i.07, 1
%mul.1 = mul nsw i64 %rem, %inc
%rem.1 = srem i64 %mul.1, 1000000007
%inc.1 = add nuw nsw i64 %i.07, 2
%mul.2 = mul nsw i64 %rem.1, %inc.1
%rem.2 = srem i64 %mul.2, 1000000007
%inc.2 = add nuw i64 %i.07, 3
%mul.3 = mul nsw i64 %rem.2, %inc.2
%rem.3 = srem i64 %mul.3, 1000000007
%inc.3 = add nuw i64 %i.07, 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
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%power.08.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.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
%power.08.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %power.08.unr, %for.end.loopexit.unr-lcssa ]
%i.07.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %power.08.epil, %i.07.epil
%rem.epil = srem i64 %mul.epil, 1000000007
%inc.epil = add nuw i64 %i.07.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, %entry
%power.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %power.0.lcssa)
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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
int main (void){
int n;
scanf("%d",&n);
unsigned long long int power=1;
int loop1;
for(loop1=1;loop1<=n;loop1++){
power*=loop1;
power%=1000000007;
}
printf("%llu\n",power);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187160/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187160/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%llu\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
%cmp.not6 = icmp slt i32 %0, 1
br i1 %cmp.not6, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%3 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %2, 3
%4 = icmp ult i64 %3, 3
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 %2, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%power.07 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%mul = mul nuw nsw i64 %power.07, %indvars.iv
%rem = urem i64 %mul, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nuw nsw i64 %rem, %indvars.iv.next
%rem.1 = urem i64 %mul.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%mul.2 = mul nuw nsw i64 %rem.1, %indvars.iv.next.1
%rem.2 = urem i64 %mul.2, 1000000007
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%mul.3 = mul nuw nsw i64 %rem.2, %indvars.iv.next.2
%rem.3 = urem i64 %mul.3, 1000000007
%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
%rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%power.07.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.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 ]
%power.07.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %power.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nuw nsw i64 %power.07.epil, %indvars.iv.epil
%rem.epil = urem i64 %mul.epil, 1000000007
%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, %entry
%power.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %power.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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define sl(x) scanf("%ld", &x)
#define ss(x) scanf("%s", x)
#define pl(x) printf("%ld\n", x)
#define pd(x) printf("%lf\n", x)
#define ps(x) printf("%s\n", x)
#define INF 1000000000000000000
#define MOD 1000000007
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
int main() {
long N, K, S;
long i, j;
long ans = 0;
sl(N); sl(K); sl(S);
if(N == K) {
for(i=0;i<N;i++) {
if(i < N-1) printf("%ld ", S);
else printf("%ld\n", S);
}
} else if(S == 1) {
for(i=0;i<K;i++) {
printf("1 ");
}
for(i=K;i<N;i++) {
if(i < N-1) printf("1000000000 ");
else printf("1000000000\n");
}
} else {
for(i=0;i<K+1;i++) {
if(i%2 == 0) printf("%ld ", S-1);
else printf("1 ");
}
if(S == 1000000000) {
for(i=K+1;i<N;i++) {
if(i < N-1) printf("500000001 ");
else printf("500000001\n");
}
} else {
for(i=K+1;i<N;i++) {
if(i < N-1) printf("1000000000 ");
else printf("1000000000\n");
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187225/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187225/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld \00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"1 \00", align 1
@.str.4 = private unnamed_addr constant [12 x i8] c"1000000000 \00", align 1
@.str.6 = private unnamed_addr constant [11 x i8] c"500000001 \00", align 1
@str.8 = private unnamed_addr constant [10 x i8] c"500000001\00", align 1
@str.9 = private unnamed_addr constant [11 x i8] c"1000000000\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%K = alloca i64, align 8
%S = 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 %K) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i64, ptr %N, align 8, !tbaa !5
%1 = load i64, ptr %K, align 8, !tbaa !5
%cmp = icmp eq i64 %0, %1
br i1 %cmp, label %for.cond.preheader, label %if.else8
for.cond.preheader: ; preds = %entry
%cmp3116 = icmp sgt i64 %0, 0
br i1 %cmp3116, label %for.body, label %if.end78
for.body: ; preds = %for.cond.preheader, %for.body
%2 = phi i64 [ %4, %for.body ], [ %0, %for.cond.preheader ]
%i.0117 = phi i64 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%sub = add nsw i64 %2, -1
%cmp4 = icmp slt i64 %i.0117, %sub
%3 = load i64, ptr %S, align 8, !tbaa !5
%.str.1..str.2 = select i1 %cmp4, ptr @.str.1, ptr @.str.2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i64 noundef %3)
%inc = add nuw nsw i64 %i.0117, 1
%4 = load i64, ptr %N, align 8, !tbaa !5
%cmp3 = icmp slt i64 %inc, %4
br i1 %cmp3, label %for.body, label %if.end78, !llvm.loop !9
if.else8: ; preds = %entry
%5 = load i64, ptr %S, align 8, !tbaa !5
%cmp9 = icmp eq i64 %5, 1
br i1 %cmp9, label %for.cond11.preheader, label %for.cond32.preheader
for.cond32.preheader: ; preds = %if.else8
%cmp33.not105 = icmp slt i64 %1, 0
br i1 %cmp33.not105, label %for.end44, label %for.body34
for.cond11.preheader: ; preds = %if.else8
%cmp12111 = icmp sgt i64 %1, 0
br i1 %cmp12111, label %for.body13, label %for.cond18.preheader
for.cond18.preheader.loopexit: ; preds = %for.body13
%.pre123 = load i64, ptr %N, align 8, !tbaa !5
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.cond18.preheader.loopexit, %for.cond11.preheader
%6 = phi i64 [ %0, %for.cond11.preheader ], [ %.pre123, %for.cond18.preheader.loopexit ]
%.lcssa = phi i64 [ %1, %for.cond11.preheader ], [ %7, %for.cond18.preheader.loopexit ]
%cmp19114 = icmp slt i64 %.lcssa, %6
br i1 %cmp19114, label %for.body20, label %if.end78
for.body13: ; preds = %for.cond11.preheader, %for.body13
%i.1112 = phi i64 [ %inc16, %for.body13 ], [ 0, %for.cond11.preheader ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
%inc16 = add nuw nsw i64 %i.1112, 1
%7 = load i64, ptr %K, align 8, !tbaa !5
%cmp12 = icmp slt i64 %inc16, %7
br i1 %cmp12, label %for.body13, label %for.cond18.preheader.loopexit, !llvm.loop !11
for.body20: ; preds = %for.cond18.preheader, %for.inc28
%8 = phi i64 [ %9, %for.inc28 ], [ %6, %for.cond18.preheader ]
%i.2115 = phi i64 [ %inc29, %for.inc28 ], [ %.lcssa, %for.cond18.preheader ]
%sub21 = add nsw i64 %8, -1
%cmp22 = icmp slt i64 %i.2115, %sub21
br i1 %cmp22, label %if.then23, label %if.else25
if.then23: ; preds = %for.body20
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %for.inc28
if.else25: ; preds = %for.body20
%puts100 = call i32 @puts(ptr nonnull dereferenceable(1) @str.9)
br label %for.inc28
for.inc28: ; preds = %if.then23, %if.else25
%inc29 = add nsw i64 %i.2115, 1
%9 = load i64, ptr %N, align 8, !tbaa !5
%cmp19 = icmp slt i64 %inc29, %9
br i1 %cmp19, label %for.body20, label %if.end78, !llvm.loop !12
for.body34: ; preds = %for.cond32.preheader, %for.inc42
%i.3106 = phi i64 [ %inc43, %for.inc42 ], [ 0, %for.cond32.preheader ]
%rem = and i64 %i.3106, 1
%cmp35 = icmp eq i64 %rem, 0
br i1 %cmp35, label %if.then36, label %if.else39
if.then36: ; preds = %for.body34
%10 = load i64, ptr %S, align 8, !tbaa !5
%sub37 = add nsw i64 %10, -1
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub37)
br label %for.inc42
if.else39: ; preds = %for.body34
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %for.inc42
for.inc42: ; preds = %if.then36, %if.else39
%inc43 = add nuw nsw i64 %i.3106, 1
%11 = load i64, ptr %K, align 8, !tbaa !5
%cmp33.not.not = icmp slt i64 %i.3106, %11
br i1 %cmp33.not.not, label %for.body34, label %for.end44.loopexit, !llvm.loop !13
for.end44.loopexit: ; preds = %for.inc42
%.pre = load i64, ptr %S, align 8, !tbaa !5
br label %for.end44
for.end44: ; preds = %for.end44.loopexit, %for.cond32.preheader
%12 = phi i64 [ %5, %for.cond32.preheader ], [ %.pre, %for.end44.loopexit ]
%.lcssa104 = phi i64 [ %1, %for.cond32.preheader ], [ %11, %for.end44.loopexit ]
%add = add nsw i64 %.lcssa104, 1
%cmp45 = icmp eq i64 %12, 1000000000
%13 = load i64, ptr %N, align 8, !tbaa !5
%cmp49109 = icmp slt i64 %add, %13
br i1 %cmp45, label %for.cond48.preheader, label %for.cond63.preheader
for.cond63.preheader: ; preds = %for.end44
br i1 %cmp49109, label %for.body65, label %if.end78
for.cond48.preheader: ; preds = %for.end44
br i1 %cmp49109, label %for.body50, label %if.end78
for.body50: ; preds = %for.cond48.preheader, %for.inc58
%14 = phi i64 [ %15, %for.inc58 ], [ %13, %for.cond48.preheader ]
%i.4110 = phi i64 [ %inc59, %for.inc58 ], [ %add, %for.cond48.preheader ]
%sub51 = add nsw i64 %14, -1
%cmp52 = icmp slt i64 %i.4110, %sub51
br i1 %cmp52, label %if.then53, label %if.else55
if.then53: ; preds = %for.body50
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
br label %for.inc58
if.else55: ; preds = %for.body50
%puts99 = call i32 @puts(ptr nonnull dereferenceable(1) @str.8)
br label %for.inc58
for.inc58: ; preds = %if.then53, %if.else55
%inc59 = add nsw i64 %i.4110, 1
%15 = load i64, ptr %N, align 8, !tbaa !5
%cmp49 = icmp slt i64 %inc59, %15
br i1 %cmp49, label %for.body50, label %if.end78, !llvm.loop !14
for.body65: ; preds = %for.cond63.preheader, %for.inc73
%16 = phi i64 [ %17, %for.inc73 ], [ %13, %for.cond63.preheader ]
%i.5108 = phi i64 [ %inc74, %for.inc73 ], [ %add, %for.cond63.preheader ]
%sub66 = add nsw i64 %16, -1
%cmp67 = icmp slt i64 %i.5108, %sub66
br i1 %cmp67, label %if.then68, label %if.else70
if.then68: ; preds = %for.body65
%call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %for.inc73
if.else70: ; preds = %for.body65
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.9)
br label %for.inc73
for.inc73: ; preds = %if.then68, %if.else70
%inc74 = add nsw i64 %i.5108, 1
%17 = load i64, ptr %N, align 8, !tbaa !5
%cmp64 = icmp slt i64 %inc74, %17
br i1 %cmp64, label %for.body65, label %if.end78, !llvm.loop !15
if.end78: ; preds = %for.inc73, %for.inc58, %for.inc28, %for.body, %for.cond63.preheader, %for.cond48.preheader, %for.cond18.preheader, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void)
{
double r;
double men, syuu;
scanf("%lf", &r);
men = r * r * 3.141592653589;
syuu = 2 * r * 3.141592653589;
printf("%lf %lf\n", men, syuu);
return (0);
}
//3.141592653589 | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187269/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187269/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB5444261E
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(void)
{
double r;
scanf("%lf",&r);
printf("%f %f\n",(double)r*r*M_PI,(double)2*r*M_PI);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187311/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187311/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442D18
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442D18
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
double a,x,y;
double pi=3.14159265358979;
scanf("%lf",&a);
x=pi*a*a;
y=2*pi*a;
printf("%lf %lf\n",x,y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187355/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load double, ptr %a, align 8, !tbaa !5
%mul = fmul double %0, 0x400921FB54442D11
%mul1 = fmul double %0, %mul
%mul3 = fmul double %0, 0x401921FB54442D11
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(void){
double r;
scanf("%lf",&r);
printf("%8.6f %8.6f",M_PI*r*r,2*M_PI*r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%8.6f %8.6f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, 0x400921FB54442D18
%mul1 = fmul double %0, %mul
%mul2 = fmul double %0, 0x401921FB54442D18
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main (int argc, char *argv[]) {
char buffer[256];
int numOfInput = 0;
double r = 0;
fgets(buffer, sizeof(buffer), stdin);
numOfInput = sscanf(buffer, "%lf", &r);
if(numOfInput == 1) {
printf("%f %f\n", M_PI*r*r, 2*M_PI*r );
return 0;
} else {
return 1;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187456/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187456/source.c"
target datalayout = "e-m:e-p270: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 [4 x i8] c"%lf\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%f %f\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:
%buffer = alloca [256 x i8], align 16
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %buffer) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
store double 0.000000e+00, ptr %r, align 8, !tbaa !5
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call = call ptr @fgets(ptr noundef nonnull %buffer, i32 noundef 256, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buffer, ptr noundef nonnull @.str, ptr noundef nonnull %r) #3
%cmp = icmp eq i32 %call2, 1
br i1 %cmp, label %if.then, label %cleanup
if.then: ; preds = %entry
%1 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %1, 0x400921FB54442D18
%mul3 = fmul double %1, %mul
%mul4 = fmul double %1, 0x401921FB54442D18
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3, double noundef %mul4)
br label %cleanup
cleanup: ; preds = %entry, %if.then
%retval.0 = phi i32 [ 0, %if.then ], [ 1, %entry ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %buffer) #3
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
|
#include <stdio.h>
#include <math.h>
int main()
{
int n,i,k,l,m;
scanf("%d",&n);
int p[n+5];
for(i=0;i<n;i++)
scanf("%d",&p[i]);
for(i=0;i<n-1;i++)
{
k=i+1;
for(l=0;l<n-1;l++)
{
m=l+1;
if(((p[i]>p[l]&&p[i]<p[m])||(p[i]>p[m]&&p[i]<p[l]))&&((p[k]>p[l]&&p[k]>p[m])||(p[k]<p[l]&&p[k]<p[m])))
{
printf("yes");
i=1000000;
break;
}
else if(((p[k]>p[l]&&p[k]<p[m])||(p[k]>p[m]&&p[k]<p[l]))&&((p[i]>p[l]&&p[i]>p[m])||(p[i]<p[l]&&p[i]<p[m])))
{
printf("yes");
i=1000000;
break;
}
}
}
if(i==(n-1))
printf("no");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1875/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1875/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"no\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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, 5
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp164 = icmp sgt i32 %3, 0
br i1 %cmp164, label %for.body, label %for.cond2.preheader.thread
for.cond2.preheader.thread: ; preds = %entry
%sub168183 = add nsw i32 %3, -1
br label %for.end112
for.cond2.preheader: ; preds = %for.body
%sub168 = add nsw i32 %4, -1
%cmp3169 = icmp sgt i32 %4, 1
br i1 %cmp3169, label %for.body4, label %for.end112
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc110
%sub171 = phi i32 [ %sub, %for.inc110 ], [ %sub168, %for.cond2.preheader ]
%i.1170 = phi i32 [ %inc111, %for.inc110 ], [ 0, %for.cond2.preheader ]
%cmp8166 = icmp sgt i32 %sub171, 0
br i1 %cmp8166, label %for.body9.lr.ph, label %for.inc110
for.body9.lr.ph: ; preds = %for.body4
%add5 = add nsw i32 %i.1170, 1
%idxprom11 = sext i32 %i.1170 to i64
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %idxprom11
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%idxprom33 = sext i32 %add5 to i64
%arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %idxprom33
%wide.trip.count = zext i32 %sub171 to i64
br label %for.body9
for.body9: ; preds = %for.body9.lr.ph, %for.inc107
%indvars.iv175 = phi i64 [ 0, %for.body9.lr.ph ], [ %indvars.iv.next176, %for.inc107 ]
%indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
%arrayidx14 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv175
%7 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %6, %7
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next176
%8 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br i1 %cmp15, label %land.lhs.true, label %for.body9.lor.lhs.false_crit_edge
for.body9.lor.lhs.false_crit_edge: ; preds = %for.body9
%.pre180.pre = load i32, ptr %arrayidx34, align 4, !tbaa !5
br label %lor.lhs.false
land.lhs.true: ; preds = %for.body9
%cmp20 = icmp slt i32 %6, %8
%.pre180.pre181 = load i32, ptr %arrayidx34, align 4, !tbaa !5
br i1 %cmp20, label %land.lhs.true32, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body9.lor.lhs.false_crit_edge, %land.lhs.true
%.pre180 = phi i32 [ %.pre180.pre, %for.body9.lor.lhs.false_crit_edge ], [ %.pre180.pre181, %land.lhs.true ]
%cmp25 = icmp sgt i32 %6, %8
%cmp31 = icmp slt i32 %6, %7
%or.cond = and i1 %cmp31, %cmp25
br i1 %or.cond, label %land.lhs.true32, label %if.else
land.lhs.true32: ; preds = %land.lhs.true, %lor.lhs.false
%9 = phi i32 [ %.pre180, %lor.lhs.false ], [ %.pre180.pre181, %land.lhs.true ]
%cmp37 = icmp sgt i32 %9, %7
%cmp43 = icmp sgt i32 %9, %8
%or.cond186 = select i1 %cmp37, i1 %cmp43, i1 false
br i1 %or.cond186, label %for.inc110.sink.split, label %lor.lhs.false44
lor.lhs.false44: ; preds = %land.lhs.true32
%cmp49 = icmp slt i32 %9, %7
%cmp55 = icmp slt i32 %9, %8
%or.cond187 = select i1 %cmp49, i1 %cmp55, i1 false
br i1 %or.cond187, label %for.inc110.sink.split, label %if.else
if.else: ; preds = %lor.lhs.false, %lor.lhs.false44
%10 = phi i32 [ %9, %lor.lhs.false44 ], [ %.pre180, %lor.lhs.false ]
%cmp61 = icmp sgt i32 %10, %7
%cmp67 = icmp slt i32 %10, %8
%or.cond188 = select i1 %cmp61, i1 %cmp67, i1 false
br i1 %or.cond188, label %land.lhs.true80, label %lor.lhs.false68
lor.lhs.false68: ; preds = %if.else
%cmp73 = icmp sgt i32 %10, %8
%cmp79 = icmp slt i32 %10, %7
%or.cond163 = and i1 %cmp79, %cmp73
br i1 %or.cond163, label %land.lhs.true80, label %for.inc107
land.lhs.true80: ; preds = %if.else, %lor.lhs.false68
%cmp91 = icmp sgt i32 %6, %8
%or.cond189 = select i1 %cmp15, i1 %cmp91, i1 false
br i1 %or.cond189, label %for.inc110.sink.split, label %lor.lhs.false92
lor.lhs.false92: ; preds = %land.lhs.true80
%cmp97 = icmp slt i32 %6, %7
%cmp103 = icmp slt i32 %6, %8
%or.cond190 = select i1 %cmp97, i1 %cmp103, i1 false
br i1 %or.cond190, label %for.inc110.sink.split, label %for.inc107
for.inc107: ; preds = %lor.lhs.false92, %lor.lhs.false68
%exitcond.not = icmp eq i64 %indvars.iv.next176, %wide.trip.count
br i1 %exitcond.not, label %for.inc110, label %for.body9, !llvm.loop !11
for.inc110.sink.split: ; preds = %land.lhs.true80, %lor.lhs.false92, %land.lhs.true32, %lor.lhs.false44
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %for.inc110
for.inc110: ; preds = %for.inc107, %for.inc110.sink.split, %for.body4
%i.2 = phi i32 [ %i.1170, %for.body4 ], [ 1000000, %for.inc110.sink.split ], [ %i.1170, %for.inc107 ]
%inc111 = add nsw i32 %i.2, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %11, -1
%cmp3 = icmp slt i32 %inc111, %sub
br i1 %cmp3, label %for.body4, label %for.end112, !llvm.loop !12
for.end112: ; preds = %for.inc110, %for.cond2.preheader.thread, %for.cond2.preheader
%i.1.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %for.cond2.preheader.thread ], [ %inc111, %for.inc110 ]
%sub.lcssa = phi i32 [ %sub168, %for.cond2.preheader ], [ %sub168183, %for.cond2.preheader.thread ], [ %sub, %for.inc110 ]
%cmp114 = icmp eq i32 %i.1.lcssa, %sub.lcssa
br i1 %cmp114, label %if.then115, label %if.end117
if.then115: ; preds = %for.end112
%call116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end117
if.end117: ; preds = %if.then115, %for.end112
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define pi 3.141592653589
int main(){
double r;
scanf("%lf",&r);
printf("%f %f\n",pi*r*r,2*pi*r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187564/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187564/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, 0x400921FB5444261E
%mul1 = fmul double %0, %mul
%mul2 = fmul double %0, 0x401921FB5444261E
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(void){
double r,s,l;
scanf("%lf",&r);
s = M_PI * r * r;
l = 2 * M_PI * r;
printf("%f %f",s,l);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187614/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187614/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f %f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, 0x400921FB54442D18
%mul1 = fmul double %0, %mul
%mul2 = fmul double %0, 0x401921FB54442D18
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
double r,a,b,c;
scanf("%lf",&r);
a = 3.141592653589;
b = r*r*a;
c = 2*a*r;
printf("%lf %lf\n",b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187658/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187658/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%lf %lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB5444261E
%mul3 = fmul double %0, 0x401921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部変数
static FILE *szpFpI; // 入力
// 内部変数 - テスト用
#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;
}
// 実行メイン
long long
fMain(
)
{
int i;
char lc1Buf[1024];
// 金額 - 取得
int li1Val[4];
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d%d%d%d", &li1Val[0], &li1Val[1], &li1Val[2], &li1Val[3]);
// 金額 - 調整
int liVal;
for (i = 1; i < 4; i++) {
liVal = li1Val[i - 1] * 2;
if (li1Val[i] > liVal) {
li1Val[i] = liVal;
}
}
// 必要量 - 取得
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d", &liVal);
// 必要金額 - 取得
long long llVal = (liVal % 2) * li1Val[2];
llVal += (long long)(liVal / 2) * (long long)li1Val[3];
return llVal;
}
// 1回実行
int
fOne(
)
{
long long llRet;
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
// 実行メイン
llRet = fMain();
// 1行出力
sprintf(lc1Buf, "%lld\n", llRet);
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_187700/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187700/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@szpFpI = internal unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\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 nounwind uwtable
define dso_local i64 @fMain() local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
%li1Val = alloca [4 x i32], align 16
%liVal = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #3
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %li1Val) #3
%0 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0)
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %li1Val, i64 0, i64 1
%arrayidx3 = getelementptr inbounds [4 x i32], ptr %li1Val, i64 0, i64 2
%arrayidx4 = getelementptr inbounds [4 x i32], ptr %li1Val, i64 0, i64 3
%call5 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %li1Val, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %liVal) #3
%1 = load i32, ptr %li1Val, align 16, !tbaa !9
%mul = shl nsw i32 %1, 1
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !9
%cmp9 = icmp sgt i32 %2, %mul
br i1 %cmp9, label %if.then, label %for.inc
if.then: ; preds = %entry
store i32 %mul, ptr %arrayidx2, align 4, !tbaa !9
br label %for.inc
for.inc: ; preds = %entry, %if.then
%3 = phi i32 [ %2, %entry ], [ %mul, %if.then ]
%mul.1 = shl nsw i32 %3, 1
%4 = load i32, ptr %arrayidx3, align 8, !tbaa !9
%cmp9.1 = icmp sgt i32 %4, %mul.1
br i1 %cmp9.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 %mul.1, ptr %arrayidx3, align 8, !tbaa !9
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%5 = phi i32 [ %mul.1, %if.then.1 ], [ %4, %for.inc ]
%mul.2 = shl nsw i32 %5, 1
%6 = load i32, ptr %arrayidx4, align 4, !tbaa !9
%cmp9.2 = icmp sgt i32 %6, %mul.2
br i1 %cmp9.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i32 %mul.2, ptr %arrayidx4, align 4, !tbaa !9
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
store i32 %mul.2, ptr %liVal, align 4, !tbaa !9
%7 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call13 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %7)
%call15 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.2, ptr noundef nonnull %liVal) #3
%8 = load i32, ptr %liVal, align 4, !tbaa !9
%rem = srem i32 %8, 2
%9 = load i32, ptr %arrayidx3, align 8, !tbaa !9
%mul17 = mul nsw i32 %rem, %9
%conv = sext i32 %mul17 to i64
%div = sdiv i32 %8, 2
%conv18 = sext i32 %div to i64
%10 = load i32, ptr %arrayidx4, align 4, !tbaa !9
%conv20 = sext i32 %10 to i64
%mul21 = mul nsw i64 %conv20, %conv18
%add = add nsw i64 %mul21, %conv
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %liVal) #3
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %li1Val) #3
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #3
ret i64 %add
}
; 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) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call = tail call i64 @fMain(), !range !11
%call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %call) #3
%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) #3
ret i32 0
}
; 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 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) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call.i = tail call i64 @fMain(), !range !11
%call1.i = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf.i, ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %call.i) #3
%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) #3
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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{i64 -2305843010287435776, i64 2305843011361177600}
|
#include <stdio.h>
static double q, h, s, d, n;
double f(double cost, double size) {
return cost / size;
}
int main(void) {
long sum = 0;
scanf("%lf%lf%lf%lf%lf", &q, &h, &s, &d, &n);
if (f(s, 1) <= f(d, 2))
d = 2 * (long)s;
if (f(h, 0.5) <= f(s, 1))
s = 2 * (long)h;
if (f(h, 0.5) <= f(d, 2))
d = 4 * (long)h;
if (f(q, 0.25) <= f(h, 0.5))
h = 2 * (long)q;
if (f(q, 0.25) <= f(s, 1))
s = 4 * (long)q;
if (f(q, 0.25) <= f(d, 2))
d = 8 * (long)q;
while (n >= 2) {
sum += (long)d;
n -= 2;
}
while (n >= 1) {
sum += (long)s;
n -= 1;
}
while (n >= 0.5) {
sum += (long)h;
n -= 0.5;
}
while (n >= 0.25) {
sum += (long)q;
n -= 0.25;
}
printf("%ld\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187744/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187744/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%lf%lf%lf%lf%lf\00", align 1
@q = internal global double 0.000000e+00, align 8
@h = internal global double 0.000000e+00, align 8
@s = internal global double 0.000000e+00, align 8
@d = internal global double 0.000000e+00, align 8
@n = internal global double 0.000000e+00, align 8
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @f(double noundef %cost, double noundef %size) local_unnamed_addr #0 {
entry:
%div = fdiv double %cost, %size
ret double %div
}
; 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 @q, ptr noundef nonnull @h, ptr noundef nonnull @s, ptr noundef nonnull @d, ptr noundef nonnull @n)
%0 = load double, ptr @s, align 8, !tbaa !5
%1 = load double, ptr @d, align 8, !tbaa !5
%div.i = fmul double %1, 5.000000e-01
%cmp = fcmp ugt double %0, %div.i
br i1 %cmp, label %if.end, label %if.then
if.then: ; preds = %entry
%conv = fptosi double %0 to i64
%mul = shl nsw i64 %conv, 1
%conv3 = sitofp i64 %mul to double
store double %conv3, ptr @d, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi double [ %conv3, %if.then ], [ %1, %entry ]
%3 = load double, ptr @h, align 8, !tbaa !5
%div.i84 = fmul double %3, 2.000000e+00
%cmp6 = fcmp ugt double %div.i84, %0
br i1 %cmp6, label %if.end12, label %if.then8
if.then8: ; preds = %if.end
%conv9 = fptosi double %3 to i64
%mul10 = shl nsw i64 %conv9, 1
%conv11 = sitofp i64 %mul10 to double
store double %conv11, ptr @s, align 8, !tbaa !5
br label %if.end12
if.end12: ; preds = %if.then8, %if.end
%4 = phi double [ %conv11, %if.then8 ], [ %0, %if.end ]
%div.i86 = fmul double %2, 5.000000e-01
%cmp15 = fcmp ugt double %div.i84, %div.i86
br i1 %cmp15, label %if.end21, label %if.then17
if.then17: ; preds = %if.end12
%conv18 = fptosi double %3 to i64
%mul19 = shl nsw i64 %conv18, 2
%conv20 = sitofp i64 %mul19 to double
store double %conv20, ptr @d, align 8, !tbaa !5
br label %if.end21
if.end21: ; preds = %if.then17, %if.end12
%5 = phi double [ %conv20, %if.then17 ], [ %2, %if.end12 ]
%6 = load double, ptr @q, align 8, !tbaa !5
%div.i87 = fmul double %6, 4.000000e+00
%cmp24 = fcmp ugt double %div.i87, %div.i84
br i1 %cmp24, label %if.end30, label %if.then26
if.then26: ; preds = %if.end21
%conv27 = fptosi double %6 to i64
%mul28 = shl nsw i64 %conv27, 1
%conv29 = sitofp i64 %mul28 to double
store double %conv29, ptr @h, align 8, !tbaa !5
br label %if.end30
if.end30: ; preds = %if.then26, %if.end21
%7 = phi double [ %conv29, %if.then26 ], [ %3, %if.end21 ]
%cmp33 = fcmp ugt double %div.i87, %4
br i1 %cmp33, label %if.end39, label %if.then35
if.then35: ; preds = %if.end30
%conv36 = fptosi double %6 to i64
%mul37 = shl nsw i64 %conv36, 2
%conv38 = sitofp i64 %mul37 to double
store double %conv38, ptr @s, align 8, !tbaa !5
br label %if.end39
if.end39: ; preds = %if.then35, %if.end30
%8 = phi double [ %conv38, %if.then35 ], [ %4, %if.end30 ]
%div.i91 = fmul double %5, 5.000000e-01
%cmp42 = fcmp ugt double %div.i87, %div.i91
br i1 %cmp42, label %if.end48, label %if.then44
if.then44: ; preds = %if.end39
%conv45 = fptosi double %6 to i64
%mul46 = shl nsw i64 %conv45, 3
%conv47 = sitofp i64 %mul46 to double
store double %conv47, ptr @d, align 8, !tbaa !5
br label %if.end48
if.end48: ; preds = %if.then44, %if.end39
%9 = phi double [ %conv47, %if.then44 ], [ %5, %if.end39 ]
%.pr = load double, ptr @n, align 8, !tbaa !5
%cmp4995 = fcmp ult double %.pr, 2.000000e+00
br i1 %cmp4995, label %while.cond52thread-pre-split, label %while.body.lr.ph
while.body.lr.ph: ; preds = %if.end48
%conv51 = fptosi double %9 to i64
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%sum.096 = phi i64 [ 0, %while.body.lr.ph ], [ %add, %while.body ]
%10 = phi double [ %.pr, %while.body.lr.ph ], [ %sub, %while.body ]
%add = add nsw i64 %sum.096, %conv51
%sub = fadd double %10, -2.000000e+00
%cmp49 = fcmp ult double %sub, 2.000000e+00
br i1 %cmp49, label %while.cond.while.cond52thread-pre-split_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.cond52thread-pre-split_crit_edge: ; preds = %while.body
store double %sub, ptr @n, align 8, !tbaa !5
br label %while.cond52thread-pre-split
while.cond52thread-pre-split: ; preds = %while.cond.while.cond52thread-pre-split_crit_edge, %if.end48
%.pr92 = phi double [ %sub, %while.cond.while.cond52thread-pre-split_crit_edge ], [ %.pr, %if.end48 ]
%sum.0.lcssa = phi i64 [ %add, %while.cond.while.cond52thread-pre-split_crit_edge ], [ 0, %if.end48 ]
%cmp5397 = fcmp ult double %.pr92, 1.000000e+00
br i1 %cmp5397, label %while.cond60thread-pre-split, label %while.body55.lr.ph
while.body55.lr.ph: ; preds = %while.cond52thread-pre-split
%conv56 = fptosi double %8 to i64
br label %while.body55
while.body55: ; preds = %while.body55.lr.ph, %while.body55
%sum.198 = phi i64 [ %sum.0.lcssa, %while.body55.lr.ph ], [ %add57, %while.body55 ]
%11 = phi double [ %.pr92, %while.body55.lr.ph ], [ %sub58, %while.body55 ]
%add57 = add nsw i64 %sum.198, %conv56
%sub58 = fadd double %11, -1.000000e+00
%cmp53 = fcmp ult double %sub58, 1.000000e+00
br i1 %cmp53, label %while.cond52.while.cond60thread-pre-split_crit_edge, label %while.body55, !llvm.loop !11
while.cond52.while.cond60thread-pre-split_crit_edge: ; preds = %while.body55
store double %sub58, ptr @n, align 8, !tbaa !5
br label %while.cond60thread-pre-split
while.cond60thread-pre-split: ; preds = %while.cond52.while.cond60thread-pre-split_crit_edge, %while.cond52thread-pre-split
%.pr93 = phi double [ %sub58, %while.cond52.while.cond60thread-pre-split_crit_edge ], [ %.pr92, %while.cond52thread-pre-split ]
%sum.1.lcssa = phi i64 [ %add57, %while.cond52.while.cond60thread-pre-split_crit_edge ], [ %sum.0.lcssa, %while.cond52thread-pre-split ]
%cmp61100 = fcmp ult double %.pr93, 5.000000e-01
br i1 %cmp61100, label %while.cond68thread-pre-split, label %while.body63.lr.ph
while.body63.lr.ph: ; preds = %while.cond60thread-pre-split
%conv64 = fptosi double %7 to i64
br label %while.body63
while.body63: ; preds = %while.body63.lr.ph, %while.body63
%sum.2101 = phi i64 [ %sum.1.lcssa, %while.body63.lr.ph ], [ %add65, %while.body63 ]
%12 = phi double [ %.pr93, %while.body63.lr.ph ], [ %sub66, %while.body63 ]
%add65 = add nsw i64 %sum.2101, %conv64
%sub66 = fadd double %12, -5.000000e-01
%cmp61 = fcmp ult double %sub66, 5.000000e-01
br i1 %cmp61, label %while.cond60.while.cond68thread-pre-split_crit_edge, label %while.body63, !llvm.loop !12
while.cond60.while.cond68thread-pre-split_crit_edge: ; preds = %while.body63
store double %sub66, ptr @n, align 8, !tbaa !5
br label %while.cond68thread-pre-split
while.cond68thread-pre-split: ; preds = %while.cond60.while.cond68thread-pre-split_crit_edge, %while.cond60thread-pre-split
%.pr94 = phi double [ %sub66, %while.cond60.while.cond68thread-pre-split_crit_edge ], [ %.pr93, %while.cond60thread-pre-split ]
%sum.2.lcssa = phi i64 [ %add65, %while.cond60.while.cond68thread-pre-split_crit_edge ], [ %sum.1.lcssa, %while.cond60thread-pre-split ]
%cmp69103 = fcmp ult double %.pr94, 2.500000e-01
br i1 %cmp69103, label %while.end75, label %while.body71.lr.ph
while.body71.lr.ph: ; preds = %while.cond68thread-pre-split
%conv72 = fptosi double %6 to i64
br label %while.body71
while.body71: ; preds = %while.body71.lr.ph, %while.body71
%sum.3104 = phi i64 [ %sum.2.lcssa, %while.body71.lr.ph ], [ %add73, %while.body71 ]
%13 = phi double [ %.pr94, %while.body71.lr.ph ], [ %sub74, %while.body71 ]
%add73 = add nsw i64 %sum.3104, %conv72
%sub74 = fadd double %13, -2.500000e-01
%cmp69 = fcmp ult double %sub74, 2.500000e-01
br i1 %cmp69, label %while.cond68.while.end75_crit_edge, label %while.body71, !llvm.loop !13
while.cond68.while.end75_crit_edge: ; preds = %while.body71
store double %sub74, ptr @n, align 8, !tbaa !5
br label %while.end75
while.end75: ; preds = %while.cond68.while.end75_crit_edge, %while.cond68thread-pre-split
%sum.3.lcssa = phi i64 [ %add73, %while.cond68.while.end75_crit_edge ], [ %sum.2.lcssa, %while.cond68thread-pre-split ]
%call76 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.3.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
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void)
{
long int n,a[100000],s=0,i;
scanf("%ld",&n);
for(i=1;i<=n;i++)
scanf("%ld",&a[i]);
i=1;
while(s<=n){
s++;
if(a[i]==2)
break;
i=a[i];
}
if(s>n)
s=-1;
printf("%ld\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187788/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187788/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [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 i64, align 8
%a = alloca [100000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not18 = icmp slt i64 %0, 1
br i1 %cmp.not18, label %while.cond.preheader, label %for.body
while.cond.preheader: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %0, %entry ], [ %2, %for.body ]
%smax = call i64 @llvm.smax.i64(i64 %.lcssa, i64 -1)
%1 = add i64 %smax, 1
br label %while.cond
for.body: ; preds = %entry, %for.body
%i.019 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %i.019
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.019, 1
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.019, %2
br i1 %cmp.not.not, label %for.body, label %while.cond.preheader, !llvm.loop !9
while.cond: ; preds = %while.cond.preheader, %while.body
%s.0 = phi i64 [ %inc3, %while.body ], [ 0, %while.cond.preheader ]
%i.1 = phi i64 [ %3, %while.body ], [ 1, %while.cond.preheader ]
%exitcond = icmp eq i64 %s.0, %1
br i1 %exitcond, label %while.end, label %while.body
while.body: ; preds = %while.cond
%inc3 = add nuw i64 %s.0, 1
%arrayidx4 = getelementptr inbounds [100000 x i64], ptr %a, i64 0, i64 %i.1
%3 = load i64, ptr %arrayidx4, align 8, !tbaa !5
%cmp5 = icmp eq i64 %3, 2
br i1 %cmp5, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.body, %while.cond
%s.1 = phi i64 [ %inc3, %while.body ], [ %1, %while.cond ]
%cmp7 = icmp sgt i64 %s.1, %.lcssa
%spec.store.select = select i1 %cmp7, i64 -1, i64 %s.1
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.store.select)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 = !{!"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 a[100005],n,x,flag=0,cnt=0;
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
x=1;
cnt=0;
for(int i=1;i<=n;i++)
{
if(a[x]==2)
{
flag=1;
cnt++;
break;
}
cnt++;
x=a[x];
}
if(flag==1)
printf("%d",cnt);
else
printf("-1");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187830/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187830/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@flag = dso_local local_unnamed_addr global i32 0, align 4
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@a = dso_local global [100005 x i32] zeroinitializer, align 16
@x = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = 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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not26 = icmp slt i32 %0, 1
br i1 %cmp.not26, label %for.cond.cleanup.thread, label %for.body
for.cond.cleanup.thread: ; preds = %entry
store i32 1, ptr @x, align 4, !tbaa !5
store i32 0, ptr @cnt, align 4, !tbaa !5
br label %cleanup
for.cond.cleanup: ; preds = %for.body
store i32 1, ptr @x, align 4, !tbaa !5
store i32 0, ptr @cnt, align 4, !tbaa !5
%cmp4.not29 = icmp slt i32 %1, 1
br i1 %cmp4.not29, label %cleanup, label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.body6: ; preds = %for.cond.cleanup, %if.end
%3 = phi i32 [ %5, %if.end ], [ 1, %for.cond.cleanup ]
%4 = phi i32 [ %inc11, %if.end ], [ 0, %for.cond.cleanup ]
%idxprom7 = sext i32 %3 to i64
%arrayidx8 = getelementptr inbounds [100005 x i32], ptr @a, i64 0, i64 %idxprom7
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %5, 2
br i1 %cmp9, label %cleanup.thread, label %if.end
cleanup.thread: ; preds = %for.body6
store i32 1, ptr @flag, align 4, !tbaa !5
%inc10 = add nuw nsw i32 %4, 1
store i32 %inc10, ptr @cnt, align 4, !tbaa !5
br label %if.then18
if.end: ; preds = %for.body6
%inc11 = add nuw nsw i32 %4, 1
store i32 %inc11, ptr @cnt, align 4, !tbaa !5
store i32 %5, ptr @x, align 4, !tbaa !5
%exitcond.not = icmp eq i32 %inc11, %1
br i1 %exitcond.not, label %cleanup, label %for.body6, !llvm.loop !11
cleanup: ; preds = %if.end, %for.cond.cleanup.thread, %for.cond.cleanup
%6 = phi i32 [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ %1, %if.end ]
%.pr = load i32, ptr @flag, align 4, !tbaa !5
%cmp17 = icmp eq i32 %.pr, 1
br i1 %cmp17, label %if.then18, label %if.else
if.then18: ; preds = %cleanup.thread, %cleanup
%7 = phi i32 [ %inc10, %cleanup.thread ], [ %6, %cleanup ]
%call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
br label %if.end21
if.else: ; preds = %cleanup
%call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end21
if.end21: ; preds = %if.else, %if.then18
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main()
{ int n,a[100001];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}int cnt=0,i=0;
while (cnt<=n){
if(a[i]==2){
printf("%d",cnt+1);
return 0;
}
else i=a[i]-1;
cnt++;
}
printf("-1");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187881/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187881/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\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 [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 %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %while.cond.preheader
while.cond.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
%cmp3.not23 = icmp slt i32 %.lcssa, 0
br i1 %cmp3.not23, label %while.end, label %while.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %while.cond.preheader, !llvm.loop !9
while.body: ; preds = %while.cond.preheader, %if.else
%i2.025 = phi i32 [ %sub, %if.else ], [ 0, %while.cond.preheader ]
%cnt.024 = phi i32 [ %inc10, %if.else ], [ 0, %while.cond.preheader ]
%idxprom4 = sext i32 %i2.025 to i64
%arrayidx5 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %3, 2
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %while.body
%add = add nuw nsw i32 %cnt.024, 1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %cleanup
if.else: ; preds = %while.body
%sub = add nsw i32 %3, -1
%inc10 = add nuw i32 %cnt.024, 1
%exitcond.not = icmp eq i32 %cnt.024, %.lcssa
br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %if.else, %while.cond.preheader
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
cleanup: ; preds = %while.end, %if.then
call void @llvm.lifetime.end.p0(i64 400004, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int n,i;
scanf("%d",&n);
int a[n];
for(i = 0; i < n; i++){
scanf("%d",&a[i]);
}
int cnt = 0;
int v[n];
v[0] = a[0];
for(i = 1; i < n; i++){
v[i] = a[v[i-1]-1];
}
for(i = 0; i < n; i++){
cnt++;
if(v[i] == 2){
printf("%d",i+1); break;
}
}
if(cnt == n) printf("-1");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187946/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187946/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp46 = icmp sgt i32 %3, 0
br i1 %cmp46, label %for.body, label %for.end28
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%6 = zext i32 %4 to i64
%vla2 = alloca i32, i64 %6, align 16
store i32 %.pre, ptr %vla2, align 16, !tbaa !5
%cmp648 = icmp sgt i32 %4, 1
br i1 %cmp648, label %for.body7.preheader, label %for.cond18.preheader
for.body7.preheader: ; preds = %for.end
%7 = add nsw i64 %6, -1
%8 = add nsw i64 %6, -2
%xtraiter = and i64 %7, 3
%9 = icmp ult i64 %8, 3
br i1 %9, label %for.cond18.preheader.loopexit.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = and i64 %7, -4
%invariant.gep = getelementptr i32, ptr %vla2, i64 1
%invariant.gep89 = getelementptr i32, ptr %vla2, i64 2
%invariant.gep91 = getelementptr i32, ptr %vla2, i64 3
br label %for.body7
for.cond18.preheader.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.preheader
%.unr = phi i32 [ %.pre, %for.body7.preheader ], [ %16, %for.body7 ]
%indvars.iv58.unr = phi i64 [ 1, %for.body7.preheader ], [ %indvars.iv.next59.3, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond18.preheader, label %for.body7.epil
for.body7.epil: ; preds = %for.cond18.preheader.loopexit.unr-lcssa, %for.body7.epil
%10 = phi i32 [ %11, %for.body7.epil ], [ %.unr, %for.cond18.preheader.loopexit.unr-lcssa ]
%indvars.iv58.epil = phi i64 [ %indvars.iv.next59.epil, %for.body7.epil ], [ %indvars.iv58.unr, %for.cond18.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body7.epil ], [ 0, %for.cond18.preheader.loopexit.unr-lcssa ]
%sub10.epil = add nsw i32 %10, -1
%idxprom11.epil = sext i32 %sub10.epil to i64
%arrayidx12.epil = getelementptr inbounds i32, ptr %vla, i64 %idxprom11.epil
%11 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5
%arrayidx14.epil = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv58.epil
store i32 %11, ptr %arrayidx14.epil, align 4, !tbaa !5
%indvars.iv.next59.epil = add nuw nsw i64 %indvars.iv58.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.cond18.preheader, label %for.body7.epil, !llvm.loop !11
for.cond18.preheader: ; preds = %for.cond18.preheader.loopexit.unr-lcssa, %for.body7.epil, %for.end
%cmp1950 = icmp sgt i32 %4, 0
br i1 %cmp1950, label %for.body20, label %for.end28
for.body7: ; preds = %for.body7, %for.body7.preheader.new
%12 = phi i32 [ %.pre, %for.body7.preheader.new ], [ %16, %for.body7 ]
%indvars.iv58 = phi i64 [ 1, %for.body7.preheader.new ], [ %indvars.iv.next59.3, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.3, %for.body7 ]
%sub10 = add nsw i32 %12, -1
%idxprom11 = sext i32 %sub10 to i64
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %idxprom11
%13 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv58
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
%sub10.1 = add nsw i32 %13, -1
%idxprom11.1 = sext i32 %sub10.1 to i64
%arrayidx12.1 = getelementptr inbounds i32, ptr %vla, i64 %idxprom11.1
%14 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv58
store i32 %14, ptr %gep, align 4, !tbaa !5
%sub10.2 = add nsw i32 %14, -1
%idxprom11.2 = sext i32 %sub10.2 to i64
%arrayidx12.2 = getelementptr inbounds i32, ptr %vla, i64 %idxprom11.2
%15 = load i32, ptr %arrayidx12.2, align 4, !tbaa !5
%gep90 = getelementptr i32, ptr %invariant.gep89, i64 %indvars.iv58
store i32 %15, ptr %gep90, align 4, !tbaa !5
%sub10.3 = add nsw i32 %15, -1
%idxprom11.3 = sext i32 %sub10.3 to i64
%arrayidx12.3 = getelementptr inbounds i32, ptr %vla, i64 %idxprom11.3
%16 = load i32, ptr %arrayidx12.3, align 4, !tbaa !5
%gep92 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv58
store i32 %16, ptr %gep92, align 4, !tbaa !5
%indvars.iv.next59.3 = add nuw nsw i64 %indvars.iv58, 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.cond18.preheader.loopexit.unr-lcssa, label %for.body7, !llvm.loop !13
for.body20: ; preds = %for.cond18.preheader, %for.inc26
%indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.inc26 ], [ 0, %for.cond18.preheader ]
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%arrayidx23 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv62
%17 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp eq i32 %17, 2
br i1 %cmp24, label %if.then, label %for.inc26
if.then: ; preds = %for.body20
%indvars = trunc i64 %indvars.iv.next63 to i32
%18 = trunc i64 %indvars.iv62 to i32
%add = add nuw nsw i32 %18, 1
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
%.pre69 = load i32, ptr %n, align 4, !tbaa !5
br label %for.end28
for.inc26: ; preds = %for.body20
%exitcond68.not = icmp eq i64 %indvars.iv.next63, %6
br i1 %exitcond68.not, label %if.then30, label %for.body20, !llvm.loop !14
for.end28: ; preds = %entry, %for.cond18.preheader, %if.then
%19 = phi i32 [ %.pre69, %if.then ], [ %4, %for.cond18.preheader ], [ %3, %entry ]
%cnt.1 = phi i32 [ %indvars, %if.then ], [ 0, %for.cond18.preheader ], [ 0, %entry ]
%cmp29 = icmp eq i32 %cnt.1, %19
br i1 %cmp29, label %if.then30, label %if.end32
if.then30: ; preds = %for.inc26, %for.end28
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end32
if.end32: ; preds = %if.then30, %for.end28
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
void bomb(int fieldi[8][8], int x, int y);
void printmapi(int fieldi[8][8]){
int i, j;
for(i = 0;i < 8;i++){
for(j = 0;j < 8;j++){
// printf("%c", fieldi[i][j] + '0');
}
// printf("\n");
}
}
int main(void){
int n, i, j, k, x, y;
char field[8][8];
int fieldi[8][8];
scanf(" %d", &n);
for(i = 0;i < n;i++){
for(j = 0;j < 8;j++){
for(k = 0;k < 8;k++){
scanf(" %c", &field[k][j]);
//printf("%c\n", field[j][k]);
}
}
//printmap(field);
scanf(" %d", &x);
scanf(" %d", &y);
for(j = 0;j < 8;j++){
for(k = 0;k < 8;k++){
fieldi[j][k] = field[j][k] - '0';
}
}
bomb(fieldi, x - 1, y - 1);
printf("Data %d:\n", i + 1);
for(j = 0;j < 8;j++){
for(k = 0;k < 8;k++){
printf("%d", fieldi[k][j]);
}
printf("\n");
}
}
return 0;
}
void bomb(int fieldi[8][8], int a, int b){
int i;
// printf("%d %d\n", a, b);
printmapi(fieldi);
fieldi[a][b] = 0;
for(i = -3;i <= 3;i++){
if(a + i >= 0 && a + i < 8){
if(fieldi[a + i][b] == 1){
bomb(fieldi, a + i, b);
}
}
}
for(i = -3;i <= 3;i++){
if(b + i >= 0 && b + i < 8){
if(fieldi[a][b + i] == 1){
bomb(fieldi, a, b + i);
}
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_187997/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_187997/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"Data %d:\0A\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @printmapi(ptr nocapture noundef readnone %fieldi) local_unnamed_addr #0 {
entry:
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%field = alloca [8 x [8 x i8]], align 16
%fieldi = alloca [8 x [8 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
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 64, ptr nonnull %field) #6
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %fieldi) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp87 = icmp sgt i32 %0, 0
br i1 %cmp87, label %for.cond1.preheader.preheader, label %for.end60
for.cond1.preheader.preheader: ; preds = %entry
%arrayidx49.7127 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 7
%arrayidx8.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 0
%arrayidx8.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 0
%arrayidx8.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 0
%arrayidx8.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 0
%arrayidx8.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 0
%arrayidx8.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 0
%arrayidx8.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 0
%arrayidx8.191 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 1
%arrayidx8.1.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 1
%arrayidx8.2.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 1
%arrayidx8.3.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 1
%arrayidx8.4.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 1
%arrayidx8.5.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 1
%arrayidx8.6.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 1
%arrayidx8.7.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 1
%arrayidx8.293 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 2
%arrayidx8.1.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 2
%arrayidx8.2.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 2
%arrayidx8.3.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 2
%arrayidx8.4.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 2
%arrayidx8.5.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 2
%arrayidx8.6.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 2
%arrayidx8.7.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 2
%arrayidx8.395 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 3
%arrayidx8.1.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 3
%arrayidx8.2.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 3
%arrayidx8.3.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 3
%arrayidx8.4.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 3
%arrayidx8.5.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 3
%arrayidx8.6.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 3
%arrayidx8.7.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 3
%arrayidx8.497 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 4
%arrayidx8.1.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 4
%arrayidx8.2.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 4
%arrayidx8.3.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 4
%arrayidx8.4.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 4
%arrayidx8.5.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 4
%arrayidx8.6.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 4
%arrayidx8.7.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 4
%arrayidx8.599 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 5
%arrayidx8.1.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 5
%arrayidx8.2.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 5
%arrayidx8.3.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 5
%arrayidx8.4.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 5
%arrayidx8.5.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 5
%arrayidx8.6.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 5
%arrayidx8.7.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 5
%arrayidx8.6101 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 6
%arrayidx8.1.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 6
%arrayidx8.2.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 6
%arrayidx8.3.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 6
%arrayidx8.4.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 6
%arrayidx8.5.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 6
%arrayidx8.6.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 6
%arrayidx8.7.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 6
%arrayidx8.7103 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 7
%arrayidx8.1.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 7
%arrayidx8.2.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 7
%arrayidx8.3.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 7
%arrayidx8.4.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 7
%arrayidx8.5.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 7
%arrayidx8.6.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 7
%arrayidx8.7.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 7
%arrayidx49.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 0
%arrayidx49.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 0
%arrayidx49.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 0
%arrayidx49.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 0
%arrayidx49.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 0
%arrayidx49.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 0
%arrayidx49.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 0
%arrayidx49.1115 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 1
%arrayidx49.1.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 1
%arrayidx49.2.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 1
%arrayidx49.3.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 1
%arrayidx49.4.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 1
%arrayidx49.5.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 1
%arrayidx49.6.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 1
%arrayidx49.7.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 1
%arrayidx49.2117 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 2
%arrayidx49.1.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 2
%arrayidx49.2.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 2
%arrayidx49.3.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 2
%arrayidx49.4.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 2
%arrayidx49.5.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 2
%arrayidx49.6.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 2
%arrayidx49.7.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 2
%arrayidx49.3119 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 3
%arrayidx49.1.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 3
%arrayidx49.2.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 3
%arrayidx49.3.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 3
%arrayidx49.4.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 3
%arrayidx49.5.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 3
%arrayidx49.6.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 3
%arrayidx49.7.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 3
%arrayidx49.4121 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 4
%arrayidx49.1.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 4
%arrayidx49.2.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 4
%arrayidx49.3.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 4
%arrayidx49.4.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 4
%arrayidx49.5.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 4
%arrayidx49.6.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 4
%arrayidx49.7.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 4
%arrayidx49.5123 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 5
%arrayidx49.1.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 5
%arrayidx49.2.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 5
%arrayidx49.3.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 5
%arrayidx49.4.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 5
%arrayidx49.5.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 5
%arrayidx49.6.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 5
%arrayidx49.7.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 5
%arrayidx49.6125 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 6
%arrayidx49.1.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 6
%arrayidx49.2.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 6
%arrayidx49.3.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 6
%arrayidx49.4.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 6
%arrayidx49.5.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 6
%arrayidx49.6.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 6
%arrayidx49.7.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 6
%arrayidx49.1.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 7
%arrayidx49.2.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 7
%arrayidx49.3.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 7
%arrayidx49.4.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 7
%arrayidx49.5.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 7
%arrayidx49.6.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 7
%arrayidx49.7.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 7
%arrayidx24.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 0, i64 4
%arrayidx28.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 0, i64 4
%arrayidx24.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 0
%arrayidx28.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 0
%arrayidx24.4.1 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 1, i64 4
%arrayidx28.4.1 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 1, i64 4
%arrayidx24.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 0
%arrayidx28.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 0
%arrayidx24.4.2 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 2, i64 4
%arrayidx28.4.2 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 2, i64 4
%arrayidx24.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 0
%arrayidx28.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 0
%arrayidx24.4.3 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 3, i64 4
%arrayidx28.4.3 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 3, i64 4
%arrayidx24.4129 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 0
%arrayidx28.4130 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 0
%arrayidx24.4.4 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 4, i64 4
%arrayidx28.4.4 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 4, i64 4
%arrayidx24.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 0
%arrayidx28.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 0
%arrayidx24.4.5 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 5, i64 4
%arrayidx28.4.5 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 5, i64 4
%arrayidx24.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 0
%arrayidx28.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 0
%arrayidx24.4.6 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 6, i64 4
%arrayidx28.4.6 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 6, i64 4
%arrayidx24.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 0
%arrayidx28.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 0
%arrayidx24.4.7 = getelementptr inbounds [8 x [8 x i8]], ptr %field, i64 0, i64 7, i64 4
%arrayidx28.4.7 = getelementptr inbounds [8 x [8 x i32]], ptr %fieldi, i64 0, i64 7, i64 4
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond1.preheader
%i.088 = phi i32 [ %add, %for.cond1.preheader ], [ 0, %for.cond1.preheader.preheader ]
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %field)
%call9.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1)
%call9.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2)
%call9.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3)
%call9.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4)
%call9.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5)
%call9.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6)
%call9.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7)
%call9.192 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.191)
%call9.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1.1)
%call9.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2.1)
%call9.3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3.1)
%call9.4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4.1)
%call9.5.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5.1)
%call9.6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6.1)
%call9.7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7.1)
%call9.294 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.293)
%call9.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1.2)
%call9.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2.2)
%call9.3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3.2)
%call9.4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4.2)
%call9.5.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5.2)
%call9.6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6.2)
%call9.7.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7.2)
%call9.396 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.395)
%call9.1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1.3)
%call9.2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2.3)
%call9.3.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3.3)
%call9.4.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4.3)
%call9.5.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5.3)
%call9.6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6.3)
%call9.7.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7.3)
%call9.498 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.497)
%call9.1.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1.4)
%call9.2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2.4)
%call9.3.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3.4)
%call9.4.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4.4)
%call9.5.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5.4)
%call9.6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6.4)
%call9.7.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7.4)
%call9.5100 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.599)
%call9.1.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1.5)
%call9.2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2.5)
%call9.3.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3.5)
%call9.4.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4.5)
%call9.5.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5.5)
%call9.6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6.5)
%call9.7.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7.5)
%call9.6102 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6101)
%call9.1.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1.6)
%call9.2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2.6)
%call9.3.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3.6)
%call9.4.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4.6)
%call9.5.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5.6)
%call9.6.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6.6)
%call9.7.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7.6)
%call9.7104 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7103)
%call9.1.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.1.7)
%call9.2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.2.7)
%call9.3.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.3.7)
%call9.4.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.4.7)
%call9.5.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.5.7)
%call9.6.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.6.7)
%call9.7.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8.7.7)
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%1 = load <4 x i8>, ptr %field, align 16, !tbaa !9
%2 = sext <4 x i8> %1 to <4 x i32>
%3 = add nsw <4 x i32> %2, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %3, ptr %fieldi, align 16, !tbaa !5
%4 = load <4 x i8>, ptr %arrayidx24.4, align 4, !tbaa !9
%5 = sext <4 x i8> %4 to <4 x i32>
%6 = add nsw <4 x i32> %5, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %6, ptr %arrayidx28.4, align 16, !tbaa !5
%7 = load <4 x i8>, ptr %arrayidx24.1, align 8, !tbaa !9
%8 = sext <4 x i8> %7 to <4 x i32>
%9 = add nsw <4 x i32> %8, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %9, ptr %arrayidx28.1, align 16, !tbaa !5
%10 = load <4 x i8>, ptr %arrayidx24.4.1, align 4, !tbaa !9
%11 = sext <4 x i8> %10 to <4 x i32>
%12 = add nsw <4 x i32> %11, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %12, ptr %arrayidx28.4.1, align 16, !tbaa !5
%13 = load <4 x i8>, ptr %arrayidx24.2, align 16, !tbaa !9
%14 = sext <4 x i8> %13 to <4 x i32>
%15 = add nsw <4 x i32> %14, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %15, ptr %arrayidx28.2, align 16, !tbaa !5
%16 = load <4 x i8>, ptr %arrayidx24.4.2, align 4, !tbaa !9
%17 = sext <4 x i8> %16 to <4 x i32>
%18 = add nsw <4 x i32> %17, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %18, ptr %arrayidx28.4.2, align 16, !tbaa !5
%19 = load <4 x i8>, ptr %arrayidx24.3, align 8, !tbaa !9
%20 = sext <4 x i8> %19 to <4 x i32>
%21 = add nsw <4 x i32> %20, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %21, ptr %arrayidx28.3, align 16, !tbaa !5
%22 = load <4 x i8>, ptr %arrayidx24.4.3, align 4, !tbaa !9
%23 = sext <4 x i8> %22 to <4 x i32>
%24 = add nsw <4 x i32> %23, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %24, ptr %arrayidx28.4.3, align 16, !tbaa !5
%25 = load <4 x i8>, ptr %arrayidx24.4129, align 16, !tbaa !9
%26 = sext <4 x i8> %25 to <4 x i32>
%27 = add nsw <4 x i32> %26, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %27, ptr %arrayidx28.4130, align 16, !tbaa !5
%28 = load <4 x i8>, ptr %arrayidx24.4.4, align 4, !tbaa !9
%29 = sext <4 x i8> %28 to <4 x i32>
%30 = add nsw <4 x i32> %29, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %30, ptr %arrayidx28.4.4, align 16, !tbaa !5
%31 = load <4 x i8>, ptr %arrayidx24.5, align 8, !tbaa !9
%32 = sext <4 x i8> %31 to <4 x i32>
%33 = add nsw <4 x i32> %32, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %33, ptr %arrayidx28.5, align 16, !tbaa !5
%34 = load <4 x i8>, ptr %arrayidx24.4.5, align 4, !tbaa !9
%35 = sext <4 x i8> %34 to <4 x i32>
%36 = add nsw <4 x i32> %35, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %36, ptr %arrayidx28.4.5, align 16, !tbaa !5
%37 = load <4 x i8>, ptr %arrayidx24.6, align 16, !tbaa !9
%38 = sext <4 x i8> %37 to <4 x i32>
%39 = add nsw <4 x i32> %38, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %39, ptr %arrayidx28.6, align 16, !tbaa !5
%40 = load <4 x i8>, ptr %arrayidx24.4.6, align 4, !tbaa !9
%41 = sext <4 x i8> %40 to <4 x i32>
%42 = add nsw <4 x i32> %41, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %42, ptr %arrayidx28.4.6, align 16, !tbaa !5
%43 = load <4 x i8>, ptr %arrayidx24.7, align 8, !tbaa !9
%44 = sext <4 x i8> %43 to <4 x i32>
%45 = add nsw <4 x i32> %44, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %45, ptr %arrayidx28.7, align 16, !tbaa !5
%46 = load <4 x i8>, ptr %arrayidx24.4.7, align 4, !tbaa !9
%47 = sext <4 x i8> %46 to <4 x i32>
%48 = add nsw <4 x i32> %47, <i32 -48, i32 -48, i32 -48, i32 -48>
store <4 x i32> %48, ptr %arrayidx28.4.7, align 16, !tbaa !5
%49 = load i32, ptr %x, align 4, !tbaa !5
%sub35 = add nsw i32 %49, -1
%50 = load i32, ptr %y, align 4, !tbaa !5
%sub36 = add nsw i32 %50, -1
call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %sub35, i32 noundef %sub36)
%add = add nuw nsw i32 %i.088, 1
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
%51 = load i32, ptr %fieldi, align 16, !tbaa !5
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %51)
%52 = load i32, ptr %arrayidx49.1, align 16, !tbaa !5
%call50.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %52)
%53 = load i32, ptr %arrayidx49.2, align 16, !tbaa !5
%call50.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %53)
%54 = load i32, ptr %arrayidx49.3, align 16, !tbaa !5
%call50.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %54)
%55 = load i32, ptr %arrayidx49.4, align 16, !tbaa !5
%call50.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %55)
%56 = load i32, ptr %arrayidx49.5, align 16, !tbaa !5
%call50.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %56)
%57 = load i32, ptr %arrayidx49.6, align 16, !tbaa !5
%call50.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %57)
%58 = load i32, ptr %arrayidx49.7, align 16, !tbaa !5
%call50.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %58)
%putchar = call i32 @putchar(i32 10)
%59 = load i32, ptr %arrayidx49.1115, align 4, !tbaa !5
%call50.1116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %59)
%60 = load i32, ptr %arrayidx49.1.1, align 4, !tbaa !5
%call50.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %60)
%61 = load i32, ptr %arrayidx49.2.1, align 4, !tbaa !5
%call50.2.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %61)
%62 = load i32, ptr %arrayidx49.3.1, align 4, !tbaa !5
%call50.3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %62)
%63 = load i32, ptr %arrayidx49.4.1, align 4, !tbaa !5
%call50.4.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %63)
%64 = load i32, ptr %arrayidx49.5.1, align 4, !tbaa !5
%call50.5.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %64)
%65 = load i32, ptr %arrayidx49.6.1, align 4, !tbaa !5
%call50.6.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %65)
%66 = load i32, ptr %arrayidx49.7.1, align 4, !tbaa !5
%call50.7.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %66)
%putchar.1 = call i32 @putchar(i32 10)
%67 = load i32, ptr %arrayidx49.2117, align 8, !tbaa !5
%call50.2118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %67)
%68 = load i32, ptr %arrayidx49.1.2, align 8, !tbaa !5
%call50.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %68)
%69 = load i32, ptr %arrayidx49.2.2, align 8, !tbaa !5
%call50.2.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %69)
%70 = load i32, ptr %arrayidx49.3.2, align 8, !tbaa !5
%call50.3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %70)
%71 = load i32, ptr %arrayidx49.4.2, align 8, !tbaa !5
%call50.4.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %71)
%72 = load i32, ptr %arrayidx49.5.2, align 8, !tbaa !5
%call50.5.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %72)
%73 = load i32, ptr %arrayidx49.6.2, align 8, !tbaa !5
%call50.6.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %73)
%74 = load i32, ptr %arrayidx49.7.2, align 8, !tbaa !5
%call50.7.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %74)
%putchar.2 = call i32 @putchar(i32 10)
%75 = load i32, ptr %arrayidx49.3119, align 4, !tbaa !5
%call50.3120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %75)
%76 = load i32, ptr %arrayidx49.1.3, align 4, !tbaa !5
%call50.1.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %76)
%77 = load i32, ptr %arrayidx49.2.3, align 4, !tbaa !5
%call50.2.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %77)
%78 = load i32, ptr %arrayidx49.3.3, align 4, !tbaa !5
%call50.3.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %78)
%79 = load i32, ptr %arrayidx49.4.3, align 4, !tbaa !5
%call50.4.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %79)
%80 = load i32, ptr %arrayidx49.5.3, align 4, !tbaa !5
%call50.5.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %80)
%81 = load i32, ptr %arrayidx49.6.3, align 4, !tbaa !5
%call50.6.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %81)
%82 = load i32, ptr %arrayidx49.7.3, align 4, !tbaa !5
%call50.7.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %82)
%putchar.3 = call i32 @putchar(i32 10)
%83 = load i32, ptr %arrayidx49.4121, align 16, !tbaa !5
%call50.4122 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %83)
%84 = load i32, ptr %arrayidx49.1.4, align 16, !tbaa !5
%call50.1.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %84)
%85 = load i32, ptr %arrayidx49.2.4, align 16, !tbaa !5
%call50.2.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %85)
%86 = load i32, ptr %arrayidx49.3.4, align 16, !tbaa !5
%call50.3.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %86)
%87 = load i32, ptr %arrayidx49.4.4, align 16, !tbaa !5
%call50.4.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %87)
%88 = load i32, ptr %arrayidx49.5.4, align 16, !tbaa !5
%call50.5.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %88)
%89 = load i32, ptr %arrayidx49.6.4, align 16, !tbaa !5
%call50.6.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %89)
%90 = load i32, ptr %arrayidx49.7.4, align 16, !tbaa !5
%call50.7.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %90)
%putchar.4 = call i32 @putchar(i32 10)
%91 = load i32, ptr %arrayidx49.5123, align 4, !tbaa !5
%call50.5124 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %91)
%92 = load i32, ptr %arrayidx49.1.5, align 4, !tbaa !5
%call50.1.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %92)
%93 = load i32, ptr %arrayidx49.2.5, align 4, !tbaa !5
%call50.2.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %93)
%94 = load i32, ptr %arrayidx49.3.5, align 4, !tbaa !5
%call50.3.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %94)
%95 = load i32, ptr %arrayidx49.4.5, align 4, !tbaa !5
%call50.4.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %95)
%96 = load i32, ptr %arrayidx49.5.5, align 4, !tbaa !5
%call50.5.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %96)
%97 = load i32, ptr %arrayidx49.6.5, align 4, !tbaa !5
%call50.6.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %97)
%98 = load i32, ptr %arrayidx49.7.5, align 4, !tbaa !5
%call50.7.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %98)
%putchar.5 = call i32 @putchar(i32 10)
%99 = load i32, ptr %arrayidx49.6125, align 8, !tbaa !5
%call50.6126 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %99)
%100 = load i32, ptr %arrayidx49.1.6, align 8, !tbaa !5
%call50.1.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %100)
%101 = load i32, ptr %arrayidx49.2.6, align 8, !tbaa !5
%call50.2.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %101)
%102 = load i32, ptr %arrayidx49.3.6, align 8, !tbaa !5
%call50.3.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %102)
%103 = load i32, ptr %arrayidx49.4.6, align 8, !tbaa !5
%call50.4.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %103)
%104 = load i32, ptr %arrayidx49.5.6, align 8, !tbaa !5
%call50.5.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %104)
%105 = load i32, ptr %arrayidx49.6.6, align 8, !tbaa !5
%call50.6.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %105)
%106 = load i32, ptr %arrayidx49.7.6, align 8, !tbaa !5
%call50.7.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %106)
%putchar.6 = call i32 @putchar(i32 10)
%107 = load i32, ptr %arrayidx49.7127, align 4, !tbaa !5
%call50.7128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %107)
%108 = load i32, ptr %arrayidx49.1.7, align 4, !tbaa !5
%call50.1.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %108)
%109 = load i32, ptr %arrayidx49.2.7, align 4, !tbaa !5
%call50.2.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %109)
%110 = load i32, ptr %arrayidx49.3.7, align 4, !tbaa !5
%call50.3.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %110)
%111 = load i32, ptr %arrayidx49.4.7, align 4, !tbaa !5
%call50.4.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %111)
%112 = load i32, ptr %arrayidx49.5.7, align 4, !tbaa !5
%call50.5.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %112)
%113 = load i32, ptr %arrayidx49.6.7, align 4, !tbaa !5
%call50.6.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %113)
%114 = load i32, ptr %arrayidx49.7.7, align 4, !tbaa !5
%call50.7.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %114)
%putchar.7 = call i32 @putchar(i32 10)
%115 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %add, %115
br i1 %cmp, label %for.cond1.preheader, label %for.end60, !llvm.loop !10
for.end60: ; preds = %for.cond1.preheader, %entry
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %fieldi) #6
call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %field) #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
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 nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @bomb(ptr noundef %fieldi, i32 noundef %a, i32 noundef %b) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.then23.6, %entry
%b.tr = phi i32 [ %b, %entry ], [ %add18.6, %if.then23.6 ]
%idxprom = sext i32 %a to i64
%idxprom1 = sext i32 %b.tr to i64
%arrayidx2 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom1
store i32 0, ptr %arrayidx2, align 4, !tbaa !5
%add = add nsw i32 %a, -3
%or.cond = icmp ult i32 %add, 8
br i1 %or.cond, label %if.then, label %for.inc
if.then: ; preds = %tailrecurse
%idxprom7 = zext i32 %add to i64
%arrayidx10 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom7, i64 %idxprom1
%0 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp eq i32 %0, 1
br i1 %cmp11, label %if.then12, label %for.inc
if.then12: ; preds = %if.then
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %add, i32 noundef %b.tr)
br label %for.inc
for.inc: ; preds = %tailrecurse, %if.then12, %if.then
%add.1 = add nsw i32 %a, -2
%or.cond.1 = icmp ult i32 %add.1, 8
br i1 %or.cond.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%idxprom7.1 = zext i32 %add.1 to i64
%arrayidx10.1 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom7.1, i64 %idxprom1
%1 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %1, 1
br i1 %cmp11.1, label %if.then12.1, label %for.inc.1
if.then12.1: ; preds = %if.then.1
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %add.1, i32 noundef %b.tr)
br label %for.inc.1
for.inc.1: ; preds = %if.then12.1, %if.then.1, %for.inc
%add.2 = add nsw i32 %a, -1
%or.cond.2 = icmp ult i32 %add.2, 8
br i1 %or.cond.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%idxprom7.2 = zext i32 %add.2 to i64
%arrayidx10.2 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom7.2, i64 %idxprom1
%2 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%cmp11.2 = icmp eq i32 %2, 1
br i1 %cmp11.2, label %if.then12.2, label %for.inc.2
if.then12.2: ; preds = %if.then.2
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %add.2, i32 noundef %b.tr)
br label %for.inc.2
for.inc.2: ; preds = %if.then12.2, %if.then.2, %for.inc.1
%or.cond.3 = icmp ult i32 %a, 8
br i1 %or.cond.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%idxprom7.3 = zext i32 %a to i64
%arrayidx10.3 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom7.3, i64 %idxprom1
%3 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%cmp11.3 = icmp eq i32 %3, 1
br i1 %cmp11.3, label %if.then12.3, label %for.inc.3
if.then12.3: ; preds = %if.then.3
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %a, i32 noundef %b.tr)
br label %for.inc.3
for.inc.3: ; preds = %if.then12.3, %if.then.3, %for.inc.2
%add.4 = add nsw i32 %a, 1
%or.cond.4 = icmp ult i32 %add.4, 8
br i1 %or.cond.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
%idxprom7.4 = zext i32 %add.4 to i64
%arrayidx10.4 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom7.4, i64 %idxprom1
%4 = load i32, ptr %arrayidx10.4, align 4, !tbaa !5
%cmp11.4 = icmp eq i32 %4, 1
br i1 %cmp11.4, label %if.then12.4, label %for.inc.4
if.then12.4: ; preds = %if.then.4
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %add.4, i32 noundef %b.tr)
br label %for.inc.4
for.inc.4: ; preds = %if.then12.4, %if.then.4, %for.inc.3
%add.5 = add nsw i32 %a, 2
%or.cond.5 = icmp ult i32 %add.5, 8
br i1 %or.cond.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
%idxprom7.5 = zext i32 %add.5 to i64
%arrayidx10.5 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom7.5, i64 %idxprom1
%5 = load i32, ptr %arrayidx10.5, align 4, !tbaa !5
%cmp11.5 = icmp eq i32 %5, 1
br i1 %cmp11.5, label %if.then12.5, label %for.inc.5
if.then12.5: ; preds = %if.then.5
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %add.5, i32 noundef %b.tr)
br label %for.inc.5
for.inc.5: ; preds = %if.then12.5, %if.then.5, %for.inc.4
%add.6 = add nsw i32 %a, 3
%or.cond.6 = icmp ult i32 %add.6, 8
br i1 %or.cond.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
%idxprom7.6 = zext i32 %add.6 to i64
%arrayidx10.6 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom7.6, i64 %idxprom1
%6 = load i32, ptr %arrayidx10.6, align 4, !tbaa !5
%cmp11.6 = icmp eq i32 %6, 1
br i1 %cmp11.6, label %if.then12.6, label %for.inc.6
if.then12.6: ; preds = %if.then.6
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %add.6, i32 noundef %b.tr)
br label %for.inc.6
for.inc.6: ; preds = %if.then12.6, %if.then.6, %for.inc.5
%add18 = add nsw i32 %b.tr, -3
%or.cond65 = icmp ult i32 %add18, 8
br i1 %or.cond65, label %if.then23, label %for.inc34
if.then23: ; preds = %for.inc.6
%idxprom27 = zext i32 %add18 to i64
%arrayidx28 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom27
%7 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%cmp29 = icmp eq i32 %7, 1
br i1 %cmp29, label %if.then30, label %for.inc34
if.then30: ; preds = %if.then23
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %a, i32 noundef %add18)
br label %for.inc34
for.inc34: ; preds = %for.inc.6, %if.then30, %if.then23
%add18.1 = add nsw i32 %b.tr, -2
%or.cond65.1 = icmp ult i32 %add18.1, 8
br i1 %or.cond65.1, label %if.then23.1, label %for.inc34.1
if.then23.1: ; preds = %for.inc34
%idxprom27.1 = zext i32 %add18.1 to i64
%arrayidx28.1 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom27.1
%8 = load i32, ptr %arrayidx28.1, align 4, !tbaa !5
%cmp29.1 = icmp eq i32 %8, 1
br i1 %cmp29.1, label %if.then30.1, label %for.inc34.1
if.then30.1: ; preds = %if.then23.1
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %a, i32 noundef %add18.1)
br label %for.inc34.1
for.inc34.1: ; preds = %if.then30.1, %if.then23.1, %for.inc34
%add18.2 = add nsw i32 %b.tr, -1
%or.cond65.2 = icmp ult i32 %add18.2, 8
br i1 %or.cond65.2, label %if.then23.2, label %for.inc34.2
if.then23.2: ; preds = %for.inc34.1
%idxprom27.2 = zext i32 %add18.2 to i64
%arrayidx28.2 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom27.2
%9 = load i32, ptr %arrayidx28.2, align 4, !tbaa !5
%cmp29.2 = icmp eq i32 %9, 1
br i1 %cmp29.2, label %if.then30.2, label %for.inc34.2
if.then30.2: ; preds = %if.then23.2
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %a, i32 noundef %add18.2)
br label %for.inc34.2
for.inc34.2: ; preds = %if.then30.2, %if.then23.2, %for.inc34.1
%or.cond65.3 = icmp ult i32 %b.tr, 8
br i1 %or.cond65.3, label %if.then23.3, label %for.inc34.3
if.then23.3: ; preds = %for.inc34.2
%idxprom27.3 = zext i32 %b.tr to i64
%arrayidx28.3 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom27.3
%10 = load i32, ptr %arrayidx28.3, align 4, !tbaa !5
%cmp29.3 = icmp eq i32 %10, 1
br i1 %cmp29.3, label %if.then30.3, label %for.inc34.3
if.then30.3: ; preds = %if.then23.3
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %a, i32 noundef %b.tr)
br label %for.inc34.3
for.inc34.3: ; preds = %if.then30.3, %if.then23.3, %for.inc34.2
%add18.4 = add nsw i32 %b.tr, 1
%or.cond65.4 = icmp ult i32 %add18.4, 8
br i1 %or.cond65.4, label %if.then23.4, label %for.inc34.4
if.then23.4: ; preds = %for.inc34.3
%idxprom27.4 = zext i32 %add18.4 to i64
%arrayidx28.4 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom27.4
%11 = load i32, ptr %arrayidx28.4, align 4, !tbaa !5
%cmp29.4 = icmp eq i32 %11, 1
br i1 %cmp29.4, label %if.then30.4, label %for.inc34.4
if.then30.4: ; preds = %if.then23.4
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %a, i32 noundef %add18.4)
br label %for.inc34.4
for.inc34.4: ; preds = %if.then30.4, %if.then23.4, %for.inc34.3
%add18.5 = add nsw i32 %b.tr, 2
%or.cond65.5 = icmp ult i32 %add18.5, 8
br i1 %or.cond65.5, label %if.then23.5, label %for.inc34.5
if.then23.5: ; preds = %for.inc34.4
%idxprom27.5 = zext i32 %add18.5 to i64
%arrayidx28.5 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom27.5
%12 = load i32, ptr %arrayidx28.5, align 4, !tbaa !5
%cmp29.5 = icmp eq i32 %12, 1
br i1 %cmp29.5, label %if.then30.5, label %for.inc34.5
if.then30.5: ; preds = %if.then23.5
tail call void @bomb(ptr noundef nonnull %fieldi, i32 noundef %a, i32 noundef %add18.5)
br label %for.inc34.5
for.inc34.5: ; preds = %if.then30.5, %if.then23.5, %for.inc34.4
%add18.6 = add nsw i32 %b.tr, 3
%or.cond65.6 = icmp ult i32 %add18.6, 8
br i1 %or.cond65.6, label %if.then23.6, label %for.inc34.6
if.then23.6: ; preds = %for.inc34.5
%idxprom27.6 = zext i32 %add18.6 to i64
%arrayidx28.6 = getelementptr inbounds [8 x i32], ptr %fieldi, i64 %idxprom, i64 %idxprom27.6
%13 = load i32, ptr %arrayidx28.6, align 4, !tbaa !5
%cmp29.6 = icmp eq i32 %13, 1
br i1 %cmp29.6, label %tailrecurse, label %for.inc34.6
for.inc34.6: ; preds = %if.then23.6, %for.inc34.5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
char xy[10][10];
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
void mapmv(int x,int y){
int i,j;
xy[x][y]='0';
for(i=0;i<4;i++){
for(j=1;j<=3;j++){
if(!(x+dx[i]*j>7 || x+dx[i]*j<0 || y+dy[i]*j>7 || y+dy[i]*j<0)){
if(xy[x+dx[i]*j][y+dy[i]*j]=='1'){
mapmv(x+dx[i]*j,y+dy[i]*j);
}
xy[x+dx[i]*j][y+dy[i]*j]='0';
}
else break;
}
}
}
int main(void)
{
int n,i,j,l;
int x,y;
scanf("%d",&n);
for(i=0;i<n;i++){
for(j=0;j<8;j++){
scanf("%s",xy[j]);
}
scanf("%d %d",&x,&y);
mapmv(y-1,x-1);
printf("Data %d:\n",i+1);
for(j=0;j<8;j++){
printf("%s\n",xy[j]);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188060/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188060/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dx = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16
@dy = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@xy = dso_local global [10 x [10 x i8]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.3 = private unnamed_addr constant [10 x i8] c"Data %d:\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @mapmv(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %x to i64
%idxprom1 = sext i32 %y to i64
%arrayidx2 = getelementptr inbounds [10 x [10 x i8]], ptr @xy, i64 0, i64 %idxprom, i64 %idxprom1
store i8 48, ptr %arrayidx2, align 1, !tbaa !5
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry, %for.inc62
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc62 ]
%arrayidx7 = getelementptr inbounds [4 x i32], ptr @dx, i64 0, i64 %indvars.iv
%arrayidx16 = getelementptr inbounds [4 x i32], ptr @dy, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx7, align 4, !tbaa !8
%add = add nsw i32 %0, %x
%or.cond = icmp ugt i32 %add, 7
br i1 %or.cond, label %for.inc62, label %lor.lhs.false14
lor.lhs.false14: ; preds = %for.cond3.preheader
%1 = load i32, ptr %arrayidx16, align 4, !tbaa !8
%add18 = add nsw i32 %1, %y
%or.cond97 = icmp ugt i32 %add18, 7
br i1 %or.cond97, label %for.inc62, label %if.then
if.then: ; preds = %lor.lhs.false14
%idxprom30 = zext i32 %add to i64
%idxprom36 = zext i32 %add18 to i64
%arrayidx37 = getelementptr inbounds [10 x [10 x i8]], ptr @xy, i64 0, i64 %idxprom30, i64 %idxprom36
%2 = load i8, ptr %arrayidx37, align 1, !tbaa !5
%cmp38 = icmp eq i8 %2, 49
br i1 %cmp38, label %if.then40, label %if.end
if.then40: ; preds = %if.then
tail call void @mapmv(i32 noundef %add, i32 noundef %add18)
%.pre = load i32, ptr %arrayidx7, align 4, !tbaa !8
%.pre101 = load i32, ptr %arrayidx16, align 4, !tbaa !8
%.pre106 = add nsw i32 %.pre, %x
%.pre107 = add nsw i32 %.pre101, %y
br label %if.end
if.end: ; preds = %if.then40, %if.then
%add58.pre-phi = phi i32 [ %.pre107, %if.then40 ], [ %add18, %if.then ]
%add52.pre-phi = phi i32 [ %.pre106, %if.then40 ], [ %add, %if.then ]
%3 = phi i32 [ %.pre101, %if.then40 ], [ %1, %if.then ]
%4 = phi i32 [ %.pre, %if.then40 ], [ %0, %if.then ]
%idxprom53 = sext i32 %add52.pre-phi to i64
%idxprom59 = sext i32 %add58.pre-phi to i64
%arrayidx60 = getelementptr inbounds [10 x [10 x i8]], ptr @xy, i64 0, i64 %idxprom53, i64 %idxprom59
store i8 48, ptr %arrayidx60, align 1, !tbaa !5
%mul.1 = shl nsw i32 %4, 1
%add.1 = add nsw i32 %mul.1, %x
%or.cond.1 = icmp ugt i32 %add.1, 7
br i1 %or.cond.1, label %for.inc62, label %lor.lhs.false14.1
lor.lhs.false14.1: ; preds = %if.end
%mul17.1 = shl nsw i32 %3, 1
%add18.1 = add nsw i32 %mul17.1, %y
%or.cond97.1 = icmp ugt i32 %add18.1, 7
br i1 %or.cond97.1, label %for.inc62, label %if.then.1
if.then.1: ; preds = %lor.lhs.false14.1
%idxprom30.1 = zext i32 %add.1 to i64
%idxprom36.1 = zext i32 %add18.1 to i64
%arrayidx37.1 = getelementptr inbounds [10 x [10 x i8]], ptr @xy, i64 0, i64 %idxprom30.1, i64 %idxprom36.1
%5 = load i8, ptr %arrayidx37.1, align 1, !tbaa !5
%cmp38.1 = icmp eq i8 %5, 49
br i1 %cmp38.1, label %if.then40.1, label %if.end.1
if.then40.1: ; preds = %if.then.1
tail call void @mapmv(i32 noundef %add.1, i32 noundef %add18.1)
%.pre102 = load i32, ptr %arrayidx7, align 4, !tbaa !8
%.pre103 = load i32, ptr %arrayidx16, align 4, !tbaa !8
%.pre108 = shl nsw i32 %.pre102, 1
%.pre109 = add nsw i32 %.pre108, %x
%.pre110 = shl nsw i32 %.pre103, 1
%.pre111 = add nsw i32 %.pre110, %y
br label %if.end.1
if.end.1: ; preds = %if.then40.1, %if.then.1
%add58.1.pre-phi = phi i32 [ %.pre111, %if.then40.1 ], [ %add18.1, %if.then.1 ]
%add52.1.pre-phi = phi i32 [ %.pre109, %if.then40.1 ], [ %add.1, %if.then.1 ]
%6 = phi i32 [ %.pre103, %if.then40.1 ], [ %3, %if.then.1 ]
%7 = phi i32 [ %.pre102, %if.then40.1 ], [ %4, %if.then.1 ]
%idxprom53.1 = sext i32 %add52.1.pre-phi to i64
%idxprom59.1 = sext i32 %add58.1.pre-phi to i64
%arrayidx60.1 = getelementptr inbounds [10 x [10 x i8]], ptr @xy, i64 0, i64 %idxprom53.1, i64 %idxprom59.1
store i8 48, ptr %arrayidx60.1, align 1, !tbaa !5
%mul.2 = mul nsw i32 %7, 3
%add.2 = add nsw i32 %mul.2, %x
%or.cond.2 = icmp ugt i32 %add.2, 7
br i1 %or.cond.2, label %for.inc62, label %lor.lhs.false14.2
lor.lhs.false14.2: ; preds = %if.end.1
%mul17.2 = mul nsw i32 %6, 3
%add18.2 = add nsw i32 %mul17.2, %y
%or.cond97.2 = icmp ugt i32 %add18.2, 7
br i1 %or.cond97.2, label %for.inc62, label %if.then.2
if.then.2: ; preds = %lor.lhs.false14.2
%idxprom30.2 = zext i32 %add.2 to i64
%idxprom36.2 = zext i32 %add18.2 to i64
%arrayidx37.2 = getelementptr inbounds [10 x [10 x i8]], ptr @xy, i64 0, i64 %idxprom30.2, i64 %idxprom36.2
%8 = load i8, ptr %arrayidx37.2, align 1, !tbaa !5
%cmp38.2 = icmp eq i8 %8, 49
br i1 %cmp38.2, label %if.then40.2, label %if.end.2
if.then40.2: ; preds = %if.then.2
tail call void @mapmv(i32 noundef %add.2, i32 noundef %add18.2)
%.pre104 = load i32, ptr %arrayidx7, align 4, !tbaa !8
%.pre105 = load i32, ptr %arrayidx16, align 4, !tbaa !8
%.pre112 = mul nsw i32 %.pre104, 3
%.pre113 = add nsw i32 %.pre112, %x
%.pre114 = mul nsw i32 %.pre105, 3
%.pre115 = add nsw i32 %.pre114, %y
br label %if.end.2
if.end.2: ; preds = %if.then40.2, %if.then.2
%add58.2.pre-phi = phi i32 [ %.pre115, %if.then40.2 ], [ %add18.2, %if.then.2 ]
%add52.2.pre-phi = phi i32 [ %.pre113, %if.then40.2 ], [ %add.2, %if.then.2 ]
%idxprom53.2 = sext i32 %add52.2.pre-phi to i64
%idxprom59.2 = sext i32 %add58.2.pre-phi to i64
%arrayidx60.2 = getelementptr inbounds [10 x [10 x i8]], ptr @xy, i64 0, i64 %idxprom53.2, i64 %idxprom59.2
store i8 48, ptr %arrayidx60.2, align 1, !tbaa !5
br label %for.inc62
for.inc62: ; preds = %if.end.2, %lor.lhs.false14.2, %if.end.1, %lor.lhs.false14.1, %if.end, %lor.lhs.false14, %for.cond3.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.end64, label %for.cond3.preheader, !llvm.loop !10
for.end64: ; preds = %for.inc62
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !8
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.cond1.preheader, label %for.end20
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%i.031 = phi i32 [ %add, %for.cond1.preheader ], [ 0, %entry ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @xy)
%call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 1))
%call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 2))
%call4.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 3))
%call4.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 4))
%call4.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 5))
%call4.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 6))
%call4.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 7))
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i32, ptr %y, align 4, !tbaa !8
%sub = add nsw i32 %1, -1
%2 = load i32, ptr %x, align 4, !tbaa !8
%sub6 = add nsw i32 %2, -1
call void @mapmv(i32 noundef %sub, i32 noundef %sub6)
%add = add nuw nsw i32 %i.031, 1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @xy)
%puts.1 = call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 1))
%puts.2 = call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 2))
%puts.3 = call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 3))
%puts.4 = call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 4))
%puts.5 = call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 5))
%puts.6 = call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 6))
%puts.7 = call i32 @puts(ptr nonnull dereferenceable(1) getelementptr inbounds ([10 x [10 x i8]], ptr @xy, i64 0, i64 7))
%3 = load i32, ptr %n, align 4, !tbaa !8
%cmp = icmp slt i32 %add, %3
br i1 %cmp, label %for.cond1.preheader, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.cond1.preheader, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
char s[100005];
scanf("%s", s);
int i, j;
char ans[4][100005];
ans[0][0] = ans[1][0] = 'S';
ans[2][0] = ans[3][0] = 'W';
ans[0][1] = ans[2][1] = 'S';
ans[1][1] = ans[3][1] = 'W';
for (i = 1; i < n - 1; i++)
{
for (j = 0; j < 4; j++)
{
if (ans[j][i - 1] == 'S' && ans[j][i] == 'S' && s[i] == 'o')ans[j][i + 1] = 'S';
if (ans[j][i - 1] == 'S' && ans[j][i] == 'S' && s[i] == 'x')ans[j][i + 1] = 'W';
if (ans[j][i - 1] == 'S' && ans[j][i] == 'W' && s[i] == 'o')ans[j][i + 1] = 'W';
if (ans[j][i - 1] == 'S' && ans[j][i] == 'W' && s[i] == 'x')ans[j][i + 1] = 'S';
if (ans[j][i - 1] == 'W' && ans[j][i] == 'S' && s[i] == 'o')ans[j][i + 1] = 'W';
if (ans[j][i - 1] == 'W' && ans[j][i] == 'S' && s[i] == 'x')ans[j][i + 1] = 'S';
if (ans[j][i - 1] == 'W' && ans[j][i] == 'W' && s[i] == 'o')ans[j][i + 1] = 'S';
if (ans[j][i - 1] == 'W' && ans[j][i] == 'W' && s[i] == 'x')ans[j][i + 1] = 'W';
}
}
for (i = 0; i < 4; i++)
{
if (ans[i][0] == 'S' && ans[i][1] == 'S' && ans[i][n - 1] == 'S' && s[0] == 'x')continue;
if (ans[i][0] == 'S' && ans[i][1] == 'S' && ans[i][n - 1] == 'W' && s[0] == 'o')continue;
if (ans[i][0] == 'S' && ans[i][1] == 'W' && ans[i][n - 1] == 'S' && s[0] == 'o')continue;
if (ans[i][0] == 'S' && ans[i][1] == 'W' && ans[i][n - 1] == 'W' && s[0] == 'x')continue;
if (ans[i][0] == 'W' && ans[i][1] == 'S' && ans[i][n - 1] == 'S' && s[0] == 'o')continue;
if (ans[i][0] == 'W' && ans[i][1] == 'S' && ans[i][n - 1] == 'W' && s[0] == 'x')continue;
if (ans[i][0] == 'W' && ans[i][1] == 'W' && ans[i][n - 1] == 'S' && s[0] == 'x')continue;
if (ans[i][0] == 'W' && ans[i][1] == 'W' && ans[i][n - 1] == 'W' && s[0] == 'o')continue;
if (ans[i][n - 1] == 'S' && ans[i][n - 2] == 'S' && ans[i][0] == 'S' && s[n - 1] == 'x')continue;
if (ans[i][n - 1] == 'S' && ans[i][n - 2] == 'S' && ans[i][0] == 'W' && s[n - 1] == 'o')continue;
if (ans[i][n - 1] == 'S' && ans[i][n - 2] == 'W' && ans[i][0] == 'S' && s[n - 1] == 'o')continue;
if (ans[i][n - 1] == 'S' && ans[i][n - 2] == 'W' && ans[i][0] == 'W' && s[n - 1] == 'x')continue;
if (ans[i][n - 1] == 'W' && ans[i][n - 2] == 'S' && ans[i][0] == 'S' && s[n - 1] == 'o')continue;
if (ans[i][n - 1] == 'W' && ans[i][n - 2] == 'S' && ans[i][0] == 'W' && s[n - 1] == 'x')continue;
if (ans[i][n - 1] == 'W' && ans[i][n - 2] == 'W' && ans[i][0] == 'S' && s[n - 1] == 'x')continue;
if (ans[i][n - 1] == 'W' && ans[i][n - 2] == 'W' && ans[i][0] == 'W' && s[n - 1] == 'o')continue;
ans[i][n] = '\0';
printf("%s\n", ans[i]);
return 0;
}
printf("-1\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188110/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188110/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [100005 x i8], align 16
%ans = alloca [4 x [100005 x i8]], align 16
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)
call void @llvm.lifetime.start.p0(i64 100005, ptr nonnull %s) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %ans) #4
%arrayidx = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1
store i8 83, ptr %arrayidx, align 1, !tbaa !5
store i8 83, ptr %ans, align 16, !tbaa !5
%arrayidx5 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3
store i8 87, ptr %arrayidx5, align 1, !tbaa !5
%arrayidx7 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2
store i8 87, ptr %arrayidx7, align 2, !tbaa !5
%arrayidx10 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2, i64 1
store i8 83, ptr %arrayidx10, align 1, !tbaa !5
%arrayidx12 = getelementptr inbounds [100005 x i8], ptr %ans, i64 0, i64 1
store i8 83, ptr %arrayidx12, align 1, !tbaa !5
%arrayidx14 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3, i64 1
store i8 87, ptr %arrayidx14, align 16, !tbaa !5
%arrayidx16 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1, i64 1
store i8 87, ptr %arrayidx16, align 2, !tbaa !5
%0 = load i32, ptr %n, align 4, !tbaa !8
%sub = add i32 %0, -1
%cmp933 = icmp sgt i32 %0, 2
br i1 %cmp933, label %for.cond17.preheader.preheader, label %for.cond249.preheader
for.cond17.preheader.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sub to i64
br label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.cond17.preheader.preheader, %for.inc.3
%indvars.iv940 = phi i64 [ 1, %for.cond17.preheader.preheader ], [ %indvars.iv.next941, %for.inc.3 ]
%1 = add nsw i64 %indvars.iv940, -1
%arrayidx35 = getelementptr inbounds [100005 x i8], ptr %s, i64 0, i64 %indvars.iv940
%indvars.iv.next941 = add nuw nsw i64 %indvars.iv940, 1
%arrayidx23 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 0, i64 %1
%2 = load i8, ptr %arrayidx23, align 1, !tbaa !5
switch i8 %2, label %for.inc [
i8 83, label %land.lhs.true
i8 87, label %land.lhs.true138
]
for.cond249.preheader: ; preds = %for.inc.3, %entry
%idxprom270 = sext i32 %sub to i64
%3 = load i8, ptr %s, align 16
%cmp278 = icmp eq i8 %3, 120
%cmp307 = icmp eq i8 %3, 111
%sub628 = add nsw i32 %0, -2
%idxprom629 = sext i32 %sub628 to i64
%arrayidx644 = getelementptr inbounds [100005 x i8], ptr %s, i64 0, i64 %idxprom270
br label %for.body252
land.lhs.true: ; preds = %for.cond17.preheader
%arrayidx29 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 0, i64 %indvars.iv940
%4 = load i8, ptr %arrayidx29, align 1, !tbaa !5
switch i8 %4, label %for.inc [
i8 83, label %land.lhs.true33
i8 87, label %land.lhs.true88
]
land.lhs.true33: ; preds = %land.lhs.true
%5 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %5, label %for.inc [
i8 111, label %for.inc.sink.split
i8 120, label %if.then65
]
if.then65: ; preds = %land.lhs.true33
br label %for.inc.sink.split
land.lhs.true88: ; preds = %land.lhs.true
%6 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %6, label %for.inc [
i8 111, label %for.inc.sink.split
i8 120, label %if.then123
]
if.then123: ; preds = %land.lhs.true88
br label %for.inc.sink.split
land.lhs.true138: ; preds = %for.cond17.preheader
%arrayidx142 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 0, i64 %indvars.iv940
%7 = load i8, ptr %arrayidx142, align 1, !tbaa !5
%cmp144 = icmp eq i8 %7, 83
br i1 %cmp144, label %land.lhs.true146, label %land.lhs.true167
land.lhs.true146: ; preds = %land.lhs.true138
%8 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp150 = icmp eq i8 %8, 111
br i1 %cmp150, label %if.then152, label %land.lhs.true167
if.then152: ; preds = %land.lhs.true146
%arrayidx157 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 0, i64 %indvars.iv.next941
store i8 87, ptr %arrayidx157, align 1, !tbaa !5
br label %land.lhs.true167
land.lhs.true167: ; preds = %if.then152, %land.lhs.true146, %land.lhs.true138
%arrayidx171 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 0, i64 %indvars.iv940
%9 = load i8, ptr %arrayidx171, align 1, !tbaa !5
switch i8 %9, label %for.inc [
i8 83, label %land.lhs.true175
i8 87, label %land.lhs.true204
]
land.lhs.true175: ; preds = %land.lhs.true167
%10 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp179 = icmp eq i8 %10, 120
br i1 %cmp179, label %for.inc.sink.split, label %for.inc
land.lhs.true204: ; preds = %land.lhs.true167
%11 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %11, label %for.inc [
i8 111, label %for.inc.sink.split
i8 120, label %if.then239
]
if.then239: ; preds = %land.lhs.true204
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %land.lhs.true204, %land.lhs.true175, %land.lhs.true88, %land.lhs.true33, %if.then239, %if.then123, %if.then65
%.sink = phi i8 [ 87, %if.then65 ], [ 83, %if.then123 ], [ 87, %if.then239 ], [ 83, %land.lhs.true33 ], [ 87, %land.lhs.true88 ], [ 83, %land.lhs.true175 ], [ 83, %land.lhs.true204 ]
%arrayidx215 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 0, i64 %indvars.iv.next941
store i8 %.sink, ptr %arrayidx215, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %land.lhs.true204, %land.lhs.true167, %for.cond17.preheader, %land.lhs.true88, %land.lhs.true, %land.lhs.true33, %land.lhs.true175
%arrayidx23.1 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1, i64 %1
%12 = load i8, ptr %arrayidx23.1, align 1, !tbaa !5
switch i8 %12, label %for.inc.1 [
i8 83, label %land.lhs.true.1
i8 87, label %land.lhs.true138.1
]
land.lhs.true138.1: ; preds = %for.inc
%arrayidx142.1 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1, i64 %indvars.iv940
%13 = load i8, ptr %arrayidx142.1, align 1, !tbaa !5
%cmp144.1 = icmp eq i8 %13, 83
br i1 %cmp144.1, label %land.lhs.true146.1, label %land.lhs.true167.1
land.lhs.true146.1: ; preds = %land.lhs.true138.1
%14 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp150.1 = icmp eq i8 %14, 111
br i1 %cmp150.1, label %if.then152.1, label %land.lhs.true167.1
if.then152.1: ; preds = %land.lhs.true146.1
%arrayidx157.1 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1, i64 %indvars.iv.next941
store i8 87, ptr %arrayidx157.1, align 1, !tbaa !5
br label %land.lhs.true167.1
land.lhs.true167.1: ; preds = %if.then152.1, %land.lhs.true146.1, %land.lhs.true138.1
%arrayidx171.1 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1, i64 %indvars.iv940
%15 = load i8, ptr %arrayidx171.1, align 1, !tbaa !5
switch i8 %15, label %for.inc.1 [
i8 83, label %land.lhs.true175.1
i8 87, label %land.lhs.true204.1
]
land.lhs.true204.1: ; preds = %land.lhs.true167.1
%16 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %16, label %for.inc.1 [
i8 111, label %for.inc.sink.split.1
i8 120, label %if.then239.1
]
if.then239.1: ; preds = %land.lhs.true204.1
br label %for.inc.sink.split.1
land.lhs.true175.1: ; preds = %land.lhs.true167.1
%17 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp179.1 = icmp eq i8 %17, 120
br i1 %cmp179.1, label %for.inc.sink.split.1, label %for.inc.1
land.lhs.true.1: ; preds = %for.inc
%arrayidx29.1 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1, i64 %indvars.iv940
%18 = load i8, ptr %arrayidx29.1, align 1, !tbaa !5
switch i8 %18, label %for.inc.1 [
i8 83, label %land.lhs.true33.1
i8 87, label %land.lhs.true88.1
]
land.lhs.true88.1: ; preds = %land.lhs.true.1
%19 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %19, label %for.inc.1 [
i8 111, label %for.inc.sink.split.1
i8 120, label %if.then123.1
]
if.then123.1: ; preds = %land.lhs.true88.1
br label %for.inc.sink.split.1
land.lhs.true33.1: ; preds = %land.lhs.true.1
%20 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %20, label %for.inc.1 [
i8 111, label %for.inc.sink.split.1
i8 120, label %if.then65.1
]
if.then65.1: ; preds = %land.lhs.true33.1
br label %for.inc.sink.split.1
for.inc.sink.split.1: ; preds = %if.then65.1, %land.lhs.true33.1, %if.then123.1, %land.lhs.true88.1, %land.lhs.true175.1, %if.then239.1, %land.lhs.true204.1
%.sink.1 = phi i8 [ 87, %if.then65.1 ], [ 83, %if.then123.1 ], [ 87, %if.then239.1 ], [ 83, %land.lhs.true33.1 ], [ 87, %land.lhs.true88.1 ], [ 83, %land.lhs.true175.1 ], [ 83, %land.lhs.true204.1 ]
%arrayidx215.1 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 1, i64 %indvars.iv.next941
store i8 %.sink.1, ptr %arrayidx215.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %for.inc.sink.split.1, %land.lhs.true33.1, %land.lhs.true88.1, %land.lhs.true.1, %land.lhs.true175.1, %land.lhs.true204.1, %land.lhs.true167.1, %for.inc
%arrayidx23.2 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2, i64 %1
%21 = load i8, ptr %arrayidx23.2, align 1, !tbaa !5
switch i8 %21, label %for.inc.2 [
i8 83, label %land.lhs.true.2
i8 87, label %land.lhs.true138.2
]
land.lhs.true138.2: ; preds = %for.inc.1
%arrayidx142.2 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2, i64 %indvars.iv940
%22 = load i8, ptr %arrayidx142.2, align 1, !tbaa !5
%cmp144.2 = icmp eq i8 %22, 83
br i1 %cmp144.2, label %land.lhs.true146.2, label %land.lhs.true167.2
land.lhs.true146.2: ; preds = %land.lhs.true138.2
%23 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp150.2 = icmp eq i8 %23, 111
br i1 %cmp150.2, label %if.then152.2, label %land.lhs.true167.2
if.then152.2: ; preds = %land.lhs.true146.2
%arrayidx157.2 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2, i64 %indvars.iv.next941
store i8 87, ptr %arrayidx157.2, align 1, !tbaa !5
br label %land.lhs.true167.2
land.lhs.true167.2: ; preds = %if.then152.2, %land.lhs.true146.2, %land.lhs.true138.2
%arrayidx171.2 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2, i64 %indvars.iv940
%24 = load i8, ptr %arrayidx171.2, align 1, !tbaa !5
switch i8 %24, label %for.inc.2 [
i8 83, label %land.lhs.true175.2
i8 87, label %land.lhs.true204.2
]
land.lhs.true204.2: ; preds = %land.lhs.true167.2
%25 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %25, label %for.inc.2 [
i8 111, label %for.inc.sink.split.2
i8 120, label %if.then239.2
]
if.then239.2: ; preds = %land.lhs.true204.2
br label %for.inc.sink.split.2
land.lhs.true175.2: ; preds = %land.lhs.true167.2
%26 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp179.2 = icmp eq i8 %26, 120
br i1 %cmp179.2, label %for.inc.sink.split.2, label %for.inc.2
land.lhs.true.2: ; preds = %for.inc.1
%arrayidx29.2 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2, i64 %indvars.iv940
%27 = load i8, ptr %arrayidx29.2, align 1, !tbaa !5
switch i8 %27, label %for.inc.2 [
i8 83, label %land.lhs.true33.2
i8 87, label %land.lhs.true88.2
]
land.lhs.true88.2: ; preds = %land.lhs.true.2
%28 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %28, label %for.inc.2 [
i8 111, label %for.inc.sink.split.2
i8 120, label %if.then123.2
]
if.then123.2: ; preds = %land.lhs.true88.2
br label %for.inc.sink.split.2
land.lhs.true33.2: ; preds = %land.lhs.true.2
%29 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %29, label %for.inc.2 [
i8 111, label %for.inc.sink.split.2
i8 120, label %if.then65.2
]
if.then65.2: ; preds = %land.lhs.true33.2
br label %for.inc.sink.split.2
for.inc.sink.split.2: ; preds = %if.then65.2, %land.lhs.true33.2, %if.then123.2, %land.lhs.true88.2, %land.lhs.true175.2, %if.then239.2, %land.lhs.true204.2
%.sink.2 = phi i8 [ 87, %if.then65.2 ], [ 83, %if.then123.2 ], [ 87, %if.then239.2 ], [ 83, %land.lhs.true33.2 ], [ 87, %land.lhs.true88.2 ], [ 83, %land.lhs.true175.2 ], [ 83, %land.lhs.true204.2 ]
%arrayidx215.2 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 2, i64 %indvars.iv.next941
store i8 %.sink.2, ptr %arrayidx215.2, align 1, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %for.inc.sink.split.2, %land.lhs.true33.2, %land.lhs.true88.2, %land.lhs.true.2, %land.lhs.true175.2, %land.lhs.true204.2, %land.lhs.true167.2, %for.inc.1
%arrayidx23.3 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3, i64 %1
%30 = load i8, ptr %arrayidx23.3, align 1, !tbaa !5
switch i8 %30, label %for.inc.3 [
i8 83, label %land.lhs.true.3
i8 87, label %land.lhs.true138.3
]
land.lhs.true138.3: ; preds = %for.inc.2
%arrayidx142.3 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3, i64 %indvars.iv940
%31 = load i8, ptr %arrayidx142.3, align 1, !tbaa !5
%cmp144.3 = icmp eq i8 %31, 83
br i1 %cmp144.3, label %land.lhs.true146.3, label %land.lhs.true167.3
land.lhs.true146.3: ; preds = %land.lhs.true138.3
%32 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp150.3 = icmp eq i8 %32, 111
br i1 %cmp150.3, label %if.then152.3, label %land.lhs.true167.3
if.then152.3: ; preds = %land.lhs.true146.3
%arrayidx157.3 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3, i64 %indvars.iv.next941
store i8 87, ptr %arrayidx157.3, align 1, !tbaa !5
br label %land.lhs.true167.3
land.lhs.true167.3: ; preds = %if.then152.3, %land.lhs.true146.3, %land.lhs.true138.3
%arrayidx171.3 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3, i64 %indvars.iv940
%33 = load i8, ptr %arrayidx171.3, align 1, !tbaa !5
switch i8 %33, label %for.inc.3 [
i8 83, label %land.lhs.true175.3
i8 87, label %land.lhs.true204.3
]
land.lhs.true204.3: ; preds = %land.lhs.true167.3
%34 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %34, label %for.inc.3 [
i8 111, label %for.inc.sink.split.3
i8 120, label %if.then239.3
]
if.then239.3: ; preds = %land.lhs.true204.3
br label %for.inc.sink.split.3
land.lhs.true175.3: ; preds = %land.lhs.true167.3
%35 = load i8, ptr %arrayidx35, align 1, !tbaa !5
%cmp179.3 = icmp eq i8 %35, 120
br i1 %cmp179.3, label %for.inc.sink.split.3, label %for.inc.3
land.lhs.true.3: ; preds = %for.inc.2
%arrayidx29.3 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3, i64 %indvars.iv940
%36 = load i8, ptr %arrayidx29.3, align 1, !tbaa !5
switch i8 %36, label %for.inc.3 [
i8 83, label %land.lhs.true33.3
i8 87, label %land.lhs.true88.3
]
land.lhs.true88.3: ; preds = %land.lhs.true.3
%37 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %37, label %for.inc.3 [
i8 111, label %for.inc.sink.split.3
i8 120, label %if.then123.3
]
if.then123.3: ; preds = %land.lhs.true88.3
br label %for.inc.sink.split.3
land.lhs.true33.3: ; preds = %land.lhs.true.3
%38 = load i8, ptr %arrayidx35, align 1, !tbaa !5
switch i8 %38, label %for.inc.3 [
i8 111, label %for.inc.sink.split.3
i8 120, label %if.then65.3
]
if.then65.3: ; preds = %land.lhs.true33.3
br label %for.inc.sink.split.3
for.inc.sink.split.3: ; preds = %if.then65.3, %land.lhs.true33.3, %if.then123.3, %land.lhs.true88.3, %land.lhs.true175.3, %if.then239.3, %land.lhs.true204.3
%.sink.3 = phi i8 [ 87, %if.then65.3 ], [ 83, %if.then123.3 ], [ 87, %if.then239.3 ], [ 83, %land.lhs.true33.3 ], [ 87, %land.lhs.true88.3 ], [ 83, %land.lhs.true175.3 ], [ 83, %land.lhs.true204.3 ]
%arrayidx215.3 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 3, i64 %indvars.iv.next941
store i8 %.sink.3, ptr %arrayidx215.3, align 1, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %for.inc.sink.split.3, %land.lhs.true33.3, %land.lhs.true88.3, %land.lhs.true.3, %land.lhs.true175.3, %land.lhs.true204.3, %land.lhs.true167.3, %for.inc.2
%exitcond944.not = icmp eq i64 %indvars.iv.next941, %wide.trip.count
br i1 %exitcond944.not, label %for.cond249.preheader, label %for.cond17.preheader, !llvm.loop !10
for.body252: ; preds = %for.cond249.preheader, %for.inc757
%indvars.iv945 = phi i64 [ 0, %for.cond249.preheader ], [ %indvars.iv.next946, %for.inc757 ]
%arrayidx254 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945
%39 = load i8, ptr %arrayidx254, align 1, !tbaa !5
%cmp257 = icmp ne i8 %39, 83
br i1 %cmp257, label %if.end368, label %land.lhs.true259
land.lhs.true259: ; preds = %for.body252
%arrayidx262 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 1
%40 = load i8, ptr %arrayidx262, align 1, !tbaa !5
switch i8 %40, label %if.end484 [
i8 83, label %land.lhs.true266
i8 87, label %land.lhs.true324
]
land.lhs.true266: ; preds = %land.lhs.true259
%arrayidx271 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%41 = load i8, ptr %arrayidx271, align 1, !tbaa !5
%cmp273 = icmp eq i8 %41, 83
%or.cond = select i1 %cmp273, i1 %cmp278, i1 false
br i1 %or.cond, label %for.inc757, label %land.lhs.true295
land.lhs.true295: ; preds = %land.lhs.true266
%arrayidx300 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%42 = load i8, ptr %arrayidx300, align 1, !tbaa !5
%cmp302 = icmp eq i8 %42, 87
%or.cond765 = select i1 %cmp302, i1 %cmp307, i1 false
br i1 %or.cond765, label %for.inc757, label %if.end484
land.lhs.true324: ; preds = %land.lhs.true259
%arrayidx329 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%43 = load i8, ptr %arrayidx329, align 1, !tbaa !5
%cmp331 = icmp eq i8 %43, 83
%or.cond766 = select i1 %cmp331, i1 %cmp307, i1 false
br i1 %or.cond766, label %for.inc757, label %land.lhs.true353
land.lhs.true353: ; preds = %land.lhs.true324
%arrayidx358 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%44 = load i8, ptr %arrayidx358, align 1, !tbaa !5
%cmp360 = icmp eq i8 %44, 87
%or.cond767 = select i1 %cmp360, i1 %cmp278, i1 false
br i1 %or.cond767, label %for.inc757, label %if.end484
if.end368: ; preds = %for.body252
%cmp373 = icmp eq i8 %39, 87
br i1 %cmp373, label %land.lhs.true375, label %if.end484
land.lhs.true375: ; preds = %if.end368
%arrayidx378 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 1
%45 = load i8, ptr %arrayidx378, align 1, !tbaa !5
switch i8 %45, label %if.end484 [
i8 83, label %land.lhs.true382
i8 87, label %land.lhs.true440
]
land.lhs.true382: ; preds = %land.lhs.true375
%arrayidx387 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%46 = load i8, ptr %arrayidx387, align 1, !tbaa !5
%cmp389 = icmp eq i8 %46, 83
%or.cond768 = select i1 %cmp389, i1 %cmp307, i1 false
br i1 %or.cond768, label %for.inc757, label %land.lhs.true411
land.lhs.true411: ; preds = %land.lhs.true382
%arrayidx416 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%47 = load i8, ptr %arrayidx416, align 1, !tbaa !5
%cmp418 = icmp eq i8 %47, 87
%or.cond769 = select i1 %cmp418, i1 %cmp278, i1 false
br i1 %or.cond769, label %for.inc757, label %if.end484
land.lhs.true440: ; preds = %land.lhs.true375
%arrayidx445 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%48 = load i8, ptr %arrayidx445, align 1, !tbaa !5
%cmp447 = icmp eq i8 %48, 83
%or.cond770 = select i1 %cmp447, i1 %cmp278, i1 false
br i1 %or.cond770, label %for.inc757, label %land.lhs.true469
land.lhs.true469: ; preds = %land.lhs.true440
%arrayidx474 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%49 = load i8, ptr %arrayidx474, align 1, !tbaa !5
%cmp476 = icmp eq i8 %49, 87
%or.cond771 = select i1 %cmp476, i1 %cmp307, i1 false
br i1 %or.cond771, label %for.inc757, label %if.end484
if.end484: ; preds = %land.lhs.true375, %land.lhs.true259, %land.lhs.true411, %land.lhs.true295, %if.end368, %land.lhs.true353, %land.lhs.true469
%cmp373894896901903 = phi i1 [ false, %land.lhs.true469 ], [ true, %land.lhs.true353 ], [ true, %if.end368 ], [ true, %land.lhs.true295 ], [ false, %land.lhs.true411 ], [ true, %land.lhs.true259 ], [ false, %land.lhs.true375 ]
%arrayidx489 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom270
%50 = load i8, ptr %arrayidx489, align 1, !tbaa !5
switch i8 %50, label %if.end748 [
i8 83, label %land.lhs.true493
i8 87, label %land.lhs.true625
]
land.lhs.true493: ; preds = %if.end484
%arrayidx498 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom629
%51 = load i8, ptr %arrayidx498, align 1, !tbaa !5
%cmp500 = icmp ne i8 %51, 83
%brmerge = or i1 %cmp257, %cmp500
br i1 %brmerge, label %land.lhs.true526, label %land.lhs.true509
land.lhs.true509: ; preds = %land.lhs.true493
%52 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp514 = icmp eq i8 %52, 120
br i1 %cmp514, label %for.inc757, label %land.lhs.true526
land.lhs.true526: ; preds = %land.lhs.true493, %land.lhs.true509
%brmerge919 = or i1 %cmp373894896901903, %cmp500
br i1 %brmerge919, label %land.lhs.true559, label %land.lhs.true542
land.lhs.true542: ; preds = %land.lhs.true526
%53 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp547 = icmp eq i8 %53, 111
br i1 %cmp547, label %for.inc757, label %land.lhs.true592
land.lhs.true559: ; preds = %land.lhs.true526
%cmp566 = icmp ne i8 %51, 87
%brmerge921 = or i1 %cmp257, %cmp566
br i1 %brmerge921, label %land.lhs.true592, label %land.lhs.true575
land.lhs.true575: ; preds = %land.lhs.true559
%54 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp580 = icmp eq i8 %54, 111
br i1 %cmp580, label %for.inc757, label %land.lhs.true592
land.lhs.true592: ; preds = %land.lhs.true542, %land.lhs.true559, %land.lhs.true575
%cmp566979 = phi i1 [ %cmp566, %land.lhs.true559 ], [ %cmp566, %land.lhs.true575 ], [ true, %land.lhs.true542 ]
%brmerge923 = or i1 %cmp373894896901903, %cmp566979
br i1 %brmerge923, label %if.end748, label %land.lhs.true608
land.lhs.true608: ; preds = %land.lhs.true592
%55 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp613 = icmp eq i8 %55, 120
br i1 %cmp613, label %for.inc757, label %if.end748
land.lhs.true625: ; preds = %if.end484
%arrayidx630 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom629
%56 = load i8, ptr %arrayidx630, align 1, !tbaa !5
%cmp632 = icmp ne i8 %56, 83
%brmerge925 = or i1 %cmp257, %cmp632
br i1 %brmerge925, label %land.lhs.true658, label %land.lhs.true641
land.lhs.true641: ; preds = %land.lhs.true625
%57 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp646 = icmp eq i8 %57, 111
br i1 %cmp646, label %for.inc757, label %land.lhs.true658
land.lhs.true658: ; preds = %land.lhs.true625, %land.lhs.true641
%brmerge927 = or i1 %cmp373894896901903, %cmp632
br i1 %brmerge927, label %land.lhs.true691, label %land.lhs.true674
land.lhs.true674: ; preds = %land.lhs.true658
%58 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp679 = icmp eq i8 %58, 120
br i1 %cmp679, label %for.inc757, label %land.lhs.true724
land.lhs.true691: ; preds = %land.lhs.true658
%cmp698 = icmp ne i8 %56, 87
%brmerge929 = or i1 %cmp257, %cmp698
br i1 %brmerge929, label %land.lhs.true724, label %land.lhs.true707
land.lhs.true707: ; preds = %land.lhs.true691
%59 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp712 = icmp eq i8 %59, 120
br i1 %cmp712, label %for.inc757, label %land.lhs.true724
land.lhs.true724: ; preds = %land.lhs.true674, %land.lhs.true691, %land.lhs.true707
%cmp698982 = phi i1 [ %cmp698, %land.lhs.true691 ], [ %cmp698, %land.lhs.true707 ], [ true, %land.lhs.true674 ]
%brmerge931 = or i1 %cmp373894896901903, %cmp698982
br i1 %brmerge931, label %if.end748, label %land.lhs.true740
land.lhs.true740: ; preds = %land.lhs.true724
%60 = load i8, ptr %arrayidx644, align 1, !tbaa !5
%cmp745 = icmp eq i8 %60, 111
br i1 %cmp745, label %for.inc757, label %if.end748
if.end748: ; preds = %land.lhs.true724, %if.end484, %land.lhs.true592, %land.lhs.true608, %land.lhs.true740
%idxprom751 = sext i32 %0 to i64
%arrayidx752 = getelementptr inbounds [4 x [100005 x i8]], ptr %ans, i64 0, i64 %indvars.iv945, i64 %idxprom751
store i8 0, ptr %arrayidx752, align 1, !tbaa !5
br label %cleanup
for.inc757: ; preds = %land.lhs.true740, %land.lhs.true707, %land.lhs.true674, %land.lhs.true641, %land.lhs.true608, %land.lhs.true575, %land.lhs.true542, %land.lhs.true509, %land.lhs.true469, %land.lhs.true440, %land.lhs.true411, %land.lhs.true382, %land.lhs.true353, %land.lhs.true324, %land.lhs.true295, %land.lhs.true266
%indvars.iv.next946 = add nuw nsw i64 %indvars.iv945, 1
%exitcond948.not = icmp eq i64 %indvars.iv.next946, 4
br i1 %exitcond948.not, label %cleanup, label %for.body252, !llvm.loop !12
cleanup: ; preds = %for.inc757, %if.end748
%str.sink = phi ptr [ %arrayidx254, %if.end748 ], [ @str, %for.inc757 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %ans) #4
call void @llvm.lifetime.end.p0(i64 100005, 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 @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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(void)
{
int n, t, c[1000], m[1000], x=0, i;
scanf("%d%d",&n,&t);
for(i=0;i<n;i++){
scanf("%d%d",&c[i],&m[i]);
if((m[i]<=t)&&((x==0)||(x>c[i])))
x=c[i];
}
if(x!=0)
printf("%d\n",x);
else
printf("TLE\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188154/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188154/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca i32, align 4
%c = alloca [1000 x i32], align 16
%m = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %if.else
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%x.028 = phi i32 [ %x.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1000 x i32], ptr %m, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %1, %2
br i1 %cmp6.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%cmp7 = icmp eq i32 %x.028, 0
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %x.028, %.pre
%or.cond = select i1 %cmp7, i1 true, i1 %cmp10
%spec.select = select i1 %or.cond, i32 %.pre, i32 %x.028
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body
%x.1 = phi i32 [ %x.028, %for.body ], [ %spec.select, %land.lhs.true ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc
%cmp13.not = icmp eq i32 %x.1, 0
br i1 %cmp13.not, label %if.else, label %if.then14
if.then14: ; preds = %for.end
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.1)
br label %if.end17
if.else: ; preds = %entry, %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end17
if.end17: ; preds = %if.else, %if.then14
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,c=1001;
scanf("%d %d",&a,&b);
for(int i=0; i<a; i++){
int d,e;
scanf("%d %d",&d,&e);
if(c>d&&b>=e){
c=d;
}
}
if(c<=1000){printf("%d",c);}else{printf("TLE");}
return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188198/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188198/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TLE\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
%d = alloca i32, align 4
%e = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = 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
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %if.else
for.cond.cleanup: ; preds = %for.body
%cmp4 = icmp slt i32 %c.1, 1001
br i1 %cmp4, label %if.then5, label %if.else
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%c.013 = phi i32 [ %c.1, %for.body ], [ 1001, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d, ptr noundef nonnull %e)
%1 = load i32, ptr %d, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %c.013, %1
%2 = load i32, ptr %b, align 4
%3 = load i32, ptr %e, align 4
%cmp3.not = icmp slt i32 %2, %3
%spec.select = select i1 %cmp3.not, i32 %c.013, i32 %1
%c.1 = select i1 %cmp2, i32 %spec.select, i32 %c.013
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
%inc = add nuw nsw i32 %i.014, 1
%4 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then5: ; preds = %for.cond.cleanup
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.1)
br label %if.end8
if.else: ; preds = %entry, %for.cond.cleanup
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end8
if.end8: ; preds = %if.else, %if.then5
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int n,t,c[1001],m[1001],min=1001,i;
scanf("%d %d",&n,&t);
for(i=0;i<n;i++)
{
scanf("%d %d",&c[i],&m[i]);
if(m[i]>t) c[i]=1002;
if(c[i]<min) min=c[i];
}
if(min!=1001) printf("%d",min);
else printf("TLE");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188240/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca i32, align 4
%c = alloca [1001 x i32], align 16
%m = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.body, label %if.else
for.body: ; preds = %entry, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%min.031 = phi i32 [ %spec.select, %if.end ], [ 1001, %entry ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %c, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1001 x i32], ptr %m, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %1, %2
br i1 %cmp6, label %if.then, label %for.body.if.end_crit_edge
for.body.if.end_crit_edge: ; preds = %for.body
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %if.end
if.then: ; preds = %for.body
store i32 1002, ptr %arrayidx, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %for.body.if.end_crit_edge, %if.then
%3 = phi i32 [ %.pre, %for.body.if.end_crit_edge ], [ 1002, %if.then ]
%spec.select = call i32 @llvm.smin.i32(i32 %3, i32 %min.031)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end
%cmp16.not = icmp eq i32 %spec.select, 1001
br i1 %cmp16.not, label %if.else, label %if.then17
if.then17: ; preds = %for.end
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
br label %if.end20
if.else: ; preds = %entry, %for.end
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end20
if.end20: ; preds = %if.else, %if.then17
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main () {
int N;
int T;
int minc = 1001;
scanf ("%d %d", &N ,&T);
for (int i=0; i<N; i++) {
int tmpc, tmpt;
scanf ("%d %d", &tmpc, &tmpt);
if (tmpt<=T && tmpc < minc)
minc = tmpc;
}
if (minc == 1001) {
printf ("TLE\n");
} else {
printf ("%d\n", minc);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188291/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188291/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%T = alloca i32, align 4
%tmpc = alloca i32, align 4
%tmpt = 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 %T) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %if.then5
for.cond.cleanup: ; preds = %for.body
%cmp4 = icmp eq i32 %minc.1, 1001
br i1 %cmp4, label %if.then5, label %if.else
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%minc.013 = phi i32 [ %minc.1, %for.body ], [ 1001, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmpc) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmpt) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmpc, ptr noundef nonnull %tmpt)
%1 = load i32, ptr %tmpt, align 4, !tbaa !5
%2 = load i32, ptr %T, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %1, %2
%3 = load i32, ptr %tmpc, align 4
%spec.select = call i32 @llvm.smin.i32(i32 %3, i32 %minc.013)
%minc.1 = select i1 %cmp2.not, i32 %minc.013, i32 %spec.select
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmpt) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmpc) #5
%inc = add nuw nsw i32 %i.014, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.then5: ; preds = %entry, %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end8
if.else: ; preds = %for.cond.cleanup
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %minc.1)
br label %if.end8
if.end8: ; preds = %if.else, %if.then5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
// Your code here!
int n,time;
scanf("%d %d",&n,&time);
int i,j,c[n+1],t[n+1];
for(i=0; i<n; ++i) scanf("%d %d",&c[i],&t[i]);
int emp;
for(i=0; i<n;++i){
for(j=0; j<n;++j){
if(c[i] < c[j]){
emp = t[i];
t[i] = t[j];
t[j] = emp;
emp = c[i];
c[i] = c[j];
c[j] = emp;
}
}
}
//for(i=0; i<n;++i) printf("%d %d\n",c[i],t[i]);
for(i=0; i<n; ++i){
if(t[i] <= time){
printf("%d",c[i]);
break;
}
else if(i == n-1) printf("TLE");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188334/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188334/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%time = 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 %time) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %time)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%add1 = add nsw i32 %3, 1
%4 = zext i32 %add1 to i64
%vla2 = alloca i32, i64 %4, align 16
%cmp79 = icmp sgt i32 %3, 0
br i1 %cmp79, label %for.body, label %for.end56
for.cond6.preheader: ; preds = %for.body
%cmp783 = icmp sgt i32 %9, 0
br i1 %cmp783, label %for.cond9.preheader.us.preheader, label %for.end56
for.cond9.preheader.us.preheader: ; preds = %for.cond6.preheader
%wide.trip.count96 = zext i32 %9 to i64
br label %for.cond9.preheader.us
for.cond9.preheader.us: ; preds = %for.cond9.preheader.us.preheader, %for.cond9.for.inc36_crit_edge.us
%indvars.iv93 = phi i64 [ 0, %for.cond9.preheader.us.preheader ], [ %indvars.iv.next94, %for.cond9.for.inc36_crit_edge.us ]
%arrayidx13.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv93
%arrayidx18.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv93
br label %for.body11.us
for.body11.us: ; preds = %for.cond9.preheader.us, %for.inc33.us
%indvars.iv90 = phi i64 [ 0, %for.cond9.preheader.us ], [ %indvars.iv.next91, %for.inc33.us ]
%5 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%arrayidx15.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90
%6 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5
%cmp16.us = icmp slt i32 %5, %6
br i1 %cmp16.us, label %if.then.us, label %for.inc33.us
if.then.us: ; preds = %for.body11.us
%7 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5
%arrayidx20.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv90
%8 = load i32, ptr %arrayidx20.us, align 4, !tbaa !5
store i32 %8, ptr %arrayidx18.us, align 4, !tbaa !5
store i32 %7, ptr %arrayidx20.us, align 4, !tbaa !5
store i32 %6, ptr %arrayidx13.us, align 4, !tbaa !5
store i32 %5, ptr %arrayidx15.us, align 4, !tbaa !5
br label %for.inc33.us
for.inc33.us: ; preds = %if.then.us, %for.body11.us
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%exitcond.not = icmp eq i64 %indvars.iv.next91, %wide.trip.count96
br i1 %exitcond.not, label %for.cond9.for.inc36_crit_edge.us, label %for.body11.us, !llvm.loop !9
for.cond9.for.inc36_crit_edge.us: ; preds = %for.inc33.us
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
br i1 %exitcond97.not, label %for.cond39.preheader, label %for.cond9.preheader.us, !llvm.loop !11
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
%arrayidx4 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !12
for.cond39.preheader: ; preds = %for.cond9.for.inc36_crit_edge.us
br i1 %cmp783, label %for.body41, label %for.end56
for.body41: ; preds = %for.cond39.preheader, %for.inc54
%11 = phi i32 [ %16, %for.inc54 ], [ %9, %for.cond39.preheader ]
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc54 ], [ 0, %for.cond39.preheader ]
%arrayidx43 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv98
%12 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%13 = load i32, ptr %time, align 4, !tbaa !5
%cmp44.not = icmp sgt i32 %12, %13
br i1 %cmp44.not, label %if.else, label %if.then45
if.then45: ; preds = %for.body41
%arrayidx47 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv98
%14 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
br label %for.end56
if.else: ; preds = %for.body41
%sub = add nsw i32 %11, -1
%15 = zext i32 %sub to i64
%cmp49 = icmp eq i64 %indvars.iv98, %15
br i1 %cmp49, label %if.then50, label %for.inc54
if.then50: ; preds = %if.else
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc54
for.inc54: ; preds = %if.then50, %if.else
%16 = phi i32 [ %.pre, %if.then50 ], [ %11, %if.else ]
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%17 = sext i32 %16 to i64
%cmp40 = icmp slt i64 %indvars.iv.next99, %17
br i1 %cmp40, label %for.body41, label %for.end56, !llvm.loop !13
for.end56: ; preds = %for.inc54, %entry, %for.cond6.preheader, %for.cond39.preheader, %if.then45
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %time) #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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void){
int i,n,tl,c[101],t[101],mc,ni;
mc=-1;
ni=0;
scanf("%d %d",&n,&tl);
for(i=0;i<n;i++){
scanf("%d %d",&c[i],&t[i]);
if(t[i]<=tl){
if(mc==-1){
mc=c[i];
ni=i;
}
else if(c[i]<mc){
mc=c[i];
ni=i;
}
}
}
if(mc==-1)
printf("TLE");
else
printf("%d",mc);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188385/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188385/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"TLE\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%tl = alloca i32, align 4
%c = alloca [101 x i32], align 16
%t = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tl) #4
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %tl)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %if.then20
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%mc.039 = phi i32 [ %mc.1, %for.inc ], [ -1, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %c, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [101 x i32], ptr %t, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr %tl, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %1, %2
br i1 %cmp6.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%cmp7 = icmp eq i32 %mc.039, -1
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
br i1 %cmp7, label %for.inc, label %if.else
if.else: ; preds = %if.then
%spec.select = call i32 @llvm.smin.i32(i32 %3, i32 %mc.039)
br label %for.inc
for.inc: ; preds = %if.then, %if.else, %for.body
%mc.1 = phi i32 [ %mc.039, %for.body ], [ %spec.select, %if.else ], [ %3, %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 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc
%cmp19 = icmp eq i32 %mc.1, -1
br i1 %cmp19, label %if.then20, label %if.else22
if.then20: ; preds = %entry, %for.end
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end24
if.else22: ; preds = %for.end
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mc.1)
br label %if.end24
if.end24: ; preds = %if.else22, %if.then20
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tl) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
int i,N,T,c[1000],t[1000],min;
scanf("%d%d",&N,&T);
for(i=0;i<N;i++)scanf("%d%d",&c[i],&t[i]);
for(i=0;i<N;i++){
min=i;
if(t[i]<=T)break;
}
if(i==N){
printf("TLE\n");
return 0;
}
for(;i<N;i++)
if(c[min]>c[i]&&t[i]<=T)min=i;
printf("%d\n",c[min]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188428/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188428/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%T = alloca i32, align 4
%c = alloca [1000 x i32], align 16
%t = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body, label %for.end12
for.cond4.preheader: ; preds = %for.body
%cmp557 = icmp sgt i32 %2, 0
br i1 %cmp557, label %for.body6.lr.ph, label %for.end12
for.body6.lr.ph: ; preds = %for.cond4.preheader
%1 = load i32, ptr %T, align 4, !tbaa !5
%wide.trip.count = zext i32 %2 to i64
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%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.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.body6.lr.ph, %for.inc10
%indvars.iv69 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next70, %for.inc10 ]
%arrayidx8 = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv69
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp sgt i32 %4, %1
br i1 %cmp9.not, label %for.inc10, label %for.end12.loopexit
for.inc10: ; preds = %for.body6
%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 %if.then14, label %for.body6, !llvm.loop !11
for.end12.loopexit: ; preds = %for.body6
%5 = trunc i64 %indvars.iv69 to i32
br label %for.end12
for.end12: ; preds = %for.end12.loopexit, %entry, %for.cond4.preheader
%.lcssa77 = phi i32 [ %2, %for.cond4.preheader ], [ %0, %entry ], [ %2, %for.end12.loopexit ]
%i.1.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %5, %for.end12.loopexit ]
%min.1 = phi i32 [ undef, %for.cond4.preheader ], [ undef, %entry ], [ %5, %for.end12.loopexit ]
%cmp13 = icmp eq i32 %i.1.lcssa, %.lcssa77
br i1 %cmp13, label %if.then14, label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.end12
%cmp1863 = icmp slt i32 %i.1.lcssa, %.lcssa77
br i1 %cmp1863, label %for.body19.lr.ph, label %for.end32
for.body19.lr.ph: ; preds = %for.cond17.preheader
%6 = load i32, ptr %T, align 4
%7 = zext i32 %i.1.lcssa to i64
%8 = sub i32 %.lcssa77, %i.1.lcssa
%.neg = add i32 %i.1.lcssa, 1
%xtraiter = and i32 %8, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body19.prol.loopexit, label %for.body19.prol
for.body19.prol: ; preds = %for.body19.lr.ph
%idxprom20.prol = sext i32 %min.1 to i64
%arrayidx21.prol = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %idxprom20.prol
%9 = load i32, ptr %arrayidx21.prol, align 4, !tbaa !5
%arrayidx23.prol = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %7
%10 = load i32, ptr %arrayidx23.prol, align 4, !tbaa !5
%cmp24.prol = icmp sgt i32 %9, %10
br i1 %cmp24.prol, label %land.lhs.true.prol, label %for.inc30.prol
land.lhs.true.prol: ; preds = %for.body19.prol
%arrayidx26.prol = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %7
%11 = load i32, ptr %arrayidx26.prol, align 4, !tbaa !5
%cmp27.not.prol = icmp sgt i32 %11, %6
%spec.select.prol = select i1 %cmp27.not.prol, i32 %min.1, i32 %i.1.lcssa
br label %for.inc30.prol
for.inc30.prol: ; preds = %land.lhs.true.prol, %for.body19.prol
%min.3.prol = phi i32 [ %min.1, %for.body19.prol ], [ %spec.select.prol, %land.lhs.true.prol ]
%indvars.iv.next73.prol = add nuw nsw i64 %7, 1
br label %for.body19.prol.loopexit
for.body19.prol.loopexit: ; preds = %for.inc30.prol, %for.body19.lr.ph
%indvars.iv72.unr = phi i64 [ %7, %for.body19.lr.ph ], [ %indvars.iv.next73.prol, %for.inc30.prol ]
%min.265.unr = phi i32 [ %min.1, %for.body19.lr.ph ], [ %min.3.prol, %for.inc30.prol ]
%min.3.lcssa.unr = phi i32 [ undef, %for.body19.lr.ph ], [ %min.3.prol, %for.inc30.prol ]
%12 = icmp eq i32 %.lcssa77, %.neg
br i1 %12, label %for.end32, label %for.body19
if.then14: ; preds = %for.inc10, %for.end12
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
for.body19: ; preds = %for.body19.prol.loopexit, %for.inc30.1
%indvars.iv72 = phi i64 [ %indvars.iv.next73.1, %for.inc30.1 ], [ %indvars.iv72.unr, %for.body19.prol.loopexit ]
%min.265 = phi i32 [ %min.3.1, %for.inc30.1 ], [ %min.265.unr, %for.body19.prol.loopexit ]
%idxprom20 = sext i32 %min.265 to i64
%arrayidx21 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %idxprom20
%13 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%arrayidx23 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %indvars.iv72
%14 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %13, %14
br i1 %cmp24, label %land.lhs.true, label %for.inc30
land.lhs.true: ; preds = %for.body19
%arrayidx26 = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv72
%15 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp sgt i32 %15, %6
%16 = trunc i64 %indvars.iv72 to i32
%spec.select = select i1 %cmp27.not, i32 %min.265, i32 %16
br label %for.inc30
for.inc30: ; preds = %land.lhs.true, %for.body19
%min.3 = phi i32 [ %min.265, %for.body19 ], [ %spec.select, %land.lhs.true ]
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%idxprom20.1 = sext i32 %min.3 to i64
%arrayidx21.1 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %idxprom20.1
%17 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%arrayidx23.1 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %indvars.iv.next73
%18 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%cmp24.1 = icmp sgt i32 %17, %18
br i1 %cmp24.1, label %land.lhs.true.1, label %for.inc30.1
land.lhs.true.1: ; preds = %for.inc30
%arrayidx26.1 = getelementptr inbounds [1000 x i32], ptr %t, i64 0, i64 %indvars.iv.next73
%19 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5
%cmp27.not.1 = icmp sgt i32 %19, %6
%20 = trunc i64 %indvars.iv.next73 to i32
%spec.select.1 = select i1 %cmp27.not.1, i32 %min.3, i32 %20
br label %for.inc30.1
for.inc30.1: ; preds = %land.lhs.true.1, %for.inc30
%min.3.1 = phi i32 [ %min.3, %for.inc30 ], [ %spec.select.1, %land.lhs.true.1 ]
%indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 2
%21 = trunc i64 %indvars.iv.next73.1 to i32
%cmp18.1 = icmp sgt i32 %.lcssa77, %21
br i1 %cmp18.1, label %for.body19, label %for.end32, !llvm.loop !12
for.end32: ; preds = %for.body19.prol.loopexit, %for.inc30.1, %for.cond17.preheader
%min.2.lcssa = phi i32 [ %min.1, %for.cond17.preheader ], [ %min.3.lcssa.unr, %for.body19.prol.loopexit ], [ %min.3.1, %for.inc30.1 ]
%idxprom33 = sext i32 %min.2.lcssa to i64
%arrayidx34 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %idxprom33
%22 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %22)
br label %cleanup
cleanup: ; preds = %for.end32, %if.then14
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int x_go_max[17][100000];//2^17日>10^5日あれば,端の町から端の町まで移動できる
int a[100000], b[100000];
int main(void){
int n, i, j;
scanf("%d", &n);
int x[100000];
for(i = 0; i < n; i++){
scanf("%d", &x[i]);
}
int l;
scanf("%d", &l);
int q;
scanf("%d", &q);
for(i = 0; i < q; i++){
scanf("%d%d", &a[i], &b[i]);
a[i]--;
b[i]--;
}
for(i = 0; i < n; i++){
//2分探索で,最大どこからどこまで移動できるかを計算
if(x[n-1] - x[i] <= l){
x_go_max[0][i] = n-1;
continue;
}
int left = i+1;
int right = n;
while(right - left > 1){
int mid = (right - left)/2 + left;
if(x[mid] - x[i] <= l){
left = mid;
}else{
right = mid;
}
}
x_go_max[0][i] = left;
}
for(i = 1; i < 17; i++){
for(j = 0; j < n; j++){
x_go_max[i][j] = x_go_max[i-1][x_go_max[i-1][j]];
}
}
for(i = 0; i < q; i++){
int ans = 0;
int c = a[i] > b[i] ? b[i] : a[i];
int d = a[i] > b[i] ? a[i] : b[i];
//cからd(c < d)に移動することを考える
for(j = 16; j >= 0; j--){
if(x_go_max[j][c] < d){//(1 << j)日で移動できない場合
c = x_go_max[j][c];
ans += 1 << j;
}
}
printf("%d\n", ans+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188514/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188514/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@a = dso_local global [100000 x i32] zeroinitializer, align 16
@b = dso_local global [100000 x i32] zeroinitializer, align 16
@x_go_max = dso_local local_unnamed_addr global [17 x [100000 x i32]] zeroinitializer, align 16
@.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
%x = alloca [100000 x i32], align 16
%l = alloca i32, align 4
%q = 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)
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %x) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp175 = icmp sgt i32 %0, 0
br i1 %cmp175, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp5177 = icmp sgt i32 %3, 0
br i1 %cmp5177, label %for.body6, label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.body6, %for.end
%4 = phi i32 [ %3, %for.end ], [ %10, %for.body6 ]
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp21184 = icmp sgt i32 %5, 0
br i1 %cmp21184, label %for.body22.lr.ph, label %for.cond75.preheader
for.body22.lr.ph: ; preds = %for.cond20.preheader
%sub = add nsw i32 %5, -1
%idxprom23 = zext i32 %sub to i64
%arrayidx24 = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %idxprom23
%6 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%7 = load i32, ptr %l, align 4, !tbaa !5
%wide.trip.count = zext i32 %5 to i64
br label %for.body22
for.body6: ; preds = %for.end, %for.body6
%indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv197
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr @b, i64 0, i64 %indvars.iv197
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx10)
%8 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%dec = add nsw i32 %8, -1
store i32 %dec, ptr %arrayidx8, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%dec16 = add nsw i32 %9, -1
store i32 %dec16, ptr %arrayidx10, align 4, !tbaa !5
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp5 = icmp slt i64 %indvars.iv.next198, %11
br i1 %cmp5, label %for.body6, label %for.cond20.preheader, !llvm.loop !11
for.cond49.preheader: ; preds = %for.inc46
br i1 %cmp21184, label %for.cond52.preheader.us.preheader, label %for.cond75.preheader
for.cond52.preheader.us.preheader: ; preds = %for.cond49.preheader
%12 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%13 = icmp eq i64 %12, 0
br i1 %13, label %for.body54.us.1.preheader.unr-lcssa, label %for.cond52.preheader.us.preheader.new
for.cond52.preheader.us.preheader.new: ; preds = %for.cond52.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body54.us
for.body54.us: ; preds = %for.body54.us, %for.cond52.preheader.us.preheader.new
%indvars.iv204 = phi i64 [ 0, %for.cond52.preheader.us.preheader.new ], [ %indvars.iv.next205.1225, %for.body54.us ]
%niter = phi i64 [ 0, %for.cond52.preheader.us.preheader.new ], [ %niter.next.1, %for.body54.us ]
%arrayidx62.us = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 0, i64 %indvars.iv204
%14 = load i32, ptr %arrayidx62.us, align 8, !tbaa !5
%idxprom63.us = sext i32 %14 to i64
%arrayidx64.us = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 0, i64 %idxprom63.us
%15 = load i32, ptr %arrayidx64.us, align 4, !tbaa !5
%arrayidx68.us = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %indvars.iv204
store i32 %15, ptr %arrayidx68.us, align 8, !tbaa !5
%indvars.iv.next205 = or i64 %indvars.iv204, 1
%arrayidx62.us.1221 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 0, i64 %indvars.iv.next205
%16 = load i32, ptr %arrayidx62.us.1221, align 4, !tbaa !5
%idxprom63.us.1222 = sext i32 %16 to i64
%arrayidx64.us.1223 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 0, i64 %idxprom63.us.1222
%17 = load i32, ptr %arrayidx64.us.1223, align 4, !tbaa !5
%arrayidx68.us.1224 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %indvars.iv.next205
store i32 %17, ptr %arrayidx68.us.1224, align 4, !tbaa !5
%indvars.iv.next205.1225 = add nuw nsw i64 %indvars.iv204, 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.body54.us.1.preheader.unr-lcssa, label %for.body54.us, !llvm.loop !12
for.body54.us.1.preheader.unr-lcssa: ; preds = %for.body54.us, %for.cond52.preheader.us.preheader
%indvars.iv204.unr = phi i64 [ 0, %for.cond52.preheader.us.preheader ], [ %indvars.iv.next205.1225, %for.body54.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body54.us.1.preheader, label %for.body54.us.epil
for.body54.us.epil: ; preds = %for.body54.us.1.preheader.unr-lcssa
%arrayidx62.us.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 0, i64 %indvars.iv204.unr
%18 = load i32, ptr %arrayidx62.us.epil, align 4, !tbaa !5
%idxprom63.us.epil = sext i32 %18 to i64
%arrayidx64.us.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 0, i64 %idxprom63.us.epil
%19 = load i32, ptr %arrayidx64.us.epil, align 4, !tbaa !5
%arrayidx68.us.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %indvars.iv204.unr
store i32 %19, ptr %arrayidx68.us.epil, align 4, !tbaa !5
br label %for.body54.us.1.preheader
for.body54.us.1.preheader: ; preds = %for.body54.us.1.preheader.unr-lcssa, %for.body54.us.epil
%xtraiter227 = and i64 %wide.trip.count, 1
%20 = icmp eq i64 %12, 0
br i1 %20, label %for.body54.us.2.preheader.unr-lcssa, label %for.body54.us.1.preheader.new
for.body54.us.1.preheader.new: ; preds = %for.body54.us.1.preheader
%unroll_iter229 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.1
for.body54.us.1: ; preds = %for.body54.us.1, %for.body54.us.1.preheader.new
%indvars.iv204.1 = phi i64 [ 0, %for.body54.us.1.preheader.new ], [ %indvars.iv.next205.1.1, %for.body54.us.1 ]
%niter230 = phi i64 [ 0, %for.body54.us.1.preheader.new ], [ %niter230.next.1, %for.body54.us.1 ]
%arrayidx62.us.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %indvars.iv204.1
%21 = load i32, ptr %arrayidx62.us.1, align 8, !tbaa !5
%idxprom63.us.1 = sext i32 %21 to i64
%arrayidx64.us.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %idxprom63.us.1
%22 = load i32, ptr %arrayidx64.us.1, align 4, !tbaa !5
%arrayidx68.us.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %indvars.iv204.1
store i32 %22, ptr %arrayidx68.us.1, align 8, !tbaa !5
%indvars.iv.next205.1 = or i64 %indvars.iv204.1, 1
%arrayidx62.us.1.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %indvars.iv.next205.1
%23 = load i32, ptr %arrayidx62.us.1.1, align 4, !tbaa !5
%idxprom63.us.1.1 = sext i32 %23 to i64
%arrayidx64.us.1.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %idxprom63.us.1.1
%24 = load i32, ptr %arrayidx64.us.1.1, align 4, !tbaa !5
%arrayidx68.us.1.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %indvars.iv.next205.1
store i32 %24, ptr %arrayidx68.us.1.1, align 4, !tbaa !5
%indvars.iv.next205.1.1 = add nuw nsw i64 %indvars.iv204.1, 2
%niter230.next.1 = add i64 %niter230, 2
%niter230.ncmp.1 = icmp eq i64 %niter230.next.1, %unroll_iter229
br i1 %niter230.ncmp.1, label %for.body54.us.2.preheader.unr-lcssa, label %for.body54.us.1, !llvm.loop !12
for.body54.us.2.preheader.unr-lcssa: ; preds = %for.body54.us.1, %for.body54.us.1.preheader
%indvars.iv204.1.unr = phi i64 [ 0, %for.body54.us.1.preheader ], [ %indvars.iv.next205.1.1, %for.body54.us.1 ]
%lcmp.mod228.not = icmp eq i64 %xtraiter227, 0
br i1 %lcmp.mod228.not, label %for.body54.us.2.preheader, label %for.body54.us.1.epil
for.body54.us.1.epil: ; preds = %for.body54.us.2.preheader.unr-lcssa
%arrayidx62.us.1.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %indvars.iv204.1.unr
%25 = load i32, ptr %arrayidx62.us.1.epil, align 4, !tbaa !5
%idxprom63.us.1.epil = sext i32 %25 to i64
%arrayidx64.us.1.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %idxprom63.us.1.epil
%26 = load i32, ptr %arrayidx64.us.1.epil, align 4, !tbaa !5
%arrayidx68.us.1.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %indvars.iv204.1.unr
store i32 %26, ptr %arrayidx68.us.1.epil, align 4, !tbaa !5
br label %for.body54.us.2.preheader
for.body54.us.2.preheader: ; preds = %for.body54.us.2.preheader.unr-lcssa, %for.body54.us.1.epil
%xtraiter231 = and i64 %wide.trip.count, 1
%27 = icmp eq i64 %12, 0
br i1 %27, label %for.body54.us.3.preheader.unr-lcssa, label %for.body54.us.2.preheader.new
for.body54.us.2.preheader.new: ; preds = %for.body54.us.2.preheader
%unroll_iter233 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.2
for.body54.us.2: ; preds = %for.body54.us.2, %for.body54.us.2.preheader.new
%indvars.iv204.2 = phi i64 [ 0, %for.body54.us.2.preheader.new ], [ %indvars.iv.next205.2.1, %for.body54.us.2 ]
%niter234 = phi i64 [ 0, %for.body54.us.2.preheader.new ], [ %niter234.next.1, %for.body54.us.2 ]
%arrayidx62.us.2 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %indvars.iv204.2
%28 = load i32, ptr %arrayidx62.us.2, align 8, !tbaa !5
%idxprom63.us.2 = sext i32 %28 to i64
%arrayidx64.us.2 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %idxprom63.us.2
%29 = load i32, ptr %arrayidx64.us.2, align 4, !tbaa !5
%arrayidx68.us.2 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %indvars.iv204.2
store i32 %29, ptr %arrayidx68.us.2, align 8, !tbaa !5
%indvars.iv.next205.2 = or i64 %indvars.iv204.2, 1
%arrayidx62.us.2.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %indvars.iv.next205.2
%30 = load i32, ptr %arrayidx62.us.2.1, align 4, !tbaa !5
%idxprom63.us.2.1 = sext i32 %30 to i64
%arrayidx64.us.2.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %idxprom63.us.2.1
%31 = load i32, ptr %arrayidx64.us.2.1, align 4, !tbaa !5
%arrayidx68.us.2.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %indvars.iv.next205.2
store i32 %31, ptr %arrayidx68.us.2.1, align 4, !tbaa !5
%indvars.iv.next205.2.1 = add nuw nsw i64 %indvars.iv204.2, 2
%niter234.next.1 = add i64 %niter234, 2
%niter234.ncmp.1 = icmp eq i64 %niter234.next.1, %unroll_iter233
br i1 %niter234.ncmp.1, label %for.body54.us.3.preheader.unr-lcssa, label %for.body54.us.2, !llvm.loop !12
for.body54.us.3.preheader.unr-lcssa: ; preds = %for.body54.us.2, %for.body54.us.2.preheader
%indvars.iv204.2.unr = phi i64 [ 0, %for.body54.us.2.preheader ], [ %indvars.iv.next205.2.1, %for.body54.us.2 ]
%lcmp.mod232.not = icmp eq i64 %xtraiter231, 0
br i1 %lcmp.mod232.not, label %for.body54.us.3.preheader, label %for.body54.us.2.epil
for.body54.us.2.epil: ; preds = %for.body54.us.3.preheader.unr-lcssa
%arrayidx62.us.2.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %indvars.iv204.2.unr
%32 = load i32, ptr %arrayidx62.us.2.epil, align 4, !tbaa !5
%idxprom63.us.2.epil = sext i32 %32 to i64
%arrayidx64.us.2.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %idxprom63.us.2.epil
%33 = load i32, ptr %arrayidx64.us.2.epil, align 4, !tbaa !5
%arrayidx68.us.2.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %indvars.iv204.2.unr
store i32 %33, ptr %arrayidx68.us.2.epil, align 4, !tbaa !5
br label %for.body54.us.3.preheader
for.body54.us.3.preheader: ; preds = %for.body54.us.3.preheader.unr-lcssa, %for.body54.us.2.epil
%xtraiter235 = and i64 %wide.trip.count, 1
%34 = icmp eq i64 %12, 0
br i1 %34, label %for.body54.us.4.preheader.unr-lcssa, label %for.body54.us.3.preheader.new
for.body54.us.3.preheader.new: ; preds = %for.body54.us.3.preheader
%unroll_iter237 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.3
for.body54.us.3: ; preds = %for.body54.us.3, %for.body54.us.3.preheader.new
%indvars.iv204.3 = phi i64 [ 0, %for.body54.us.3.preheader.new ], [ %indvars.iv.next205.3.1, %for.body54.us.3 ]
%niter238 = phi i64 [ 0, %for.body54.us.3.preheader.new ], [ %niter238.next.1, %for.body54.us.3 ]
%arrayidx62.us.3 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %indvars.iv204.3
%35 = load i32, ptr %arrayidx62.us.3, align 8, !tbaa !5
%idxprom63.us.3 = sext i32 %35 to i64
%arrayidx64.us.3 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %idxprom63.us.3
%36 = load i32, ptr %arrayidx64.us.3, align 4, !tbaa !5
%arrayidx68.us.3 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %indvars.iv204.3
store i32 %36, ptr %arrayidx68.us.3, align 8, !tbaa !5
%indvars.iv.next205.3 = or i64 %indvars.iv204.3, 1
%arrayidx62.us.3.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %indvars.iv.next205.3
%37 = load i32, ptr %arrayidx62.us.3.1, align 4, !tbaa !5
%idxprom63.us.3.1 = sext i32 %37 to i64
%arrayidx64.us.3.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %idxprom63.us.3.1
%38 = load i32, ptr %arrayidx64.us.3.1, align 4, !tbaa !5
%arrayidx68.us.3.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %indvars.iv.next205.3
store i32 %38, ptr %arrayidx68.us.3.1, align 4, !tbaa !5
%indvars.iv.next205.3.1 = add nuw nsw i64 %indvars.iv204.3, 2
%niter238.next.1 = add i64 %niter238, 2
%niter238.ncmp.1 = icmp eq i64 %niter238.next.1, %unroll_iter237
br i1 %niter238.ncmp.1, label %for.body54.us.4.preheader.unr-lcssa, label %for.body54.us.3, !llvm.loop !12
for.body54.us.4.preheader.unr-lcssa: ; preds = %for.body54.us.3, %for.body54.us.3.preheader
%indvars.iv204.3.unr = phi i64 [ 0, %for.body54.us.3.preheader ], [ %indvars.iv.next205.3.1, %for.body54.us.3 ]
%lcmp.mod236.not = icmp eq i64 %xtraiter235, 0
br i1 %lcmp.mod236.not, label %for.body54.us.4.preheader, label %for.body54.us.3.epil
for.body54.us.3.epil: ; preds = %for.body54.us.4.preheader.unr-lcssa
%arrayidx62.us.3.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %indvars.iv204.3.unr
%39 = load i32, ptr %arrayidx62.us.3.epil, align 4, !tbaa !5
%idxprom63.us.3.epil = sext i32 %39 to i64
%arrayidx64.us.3.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %idxprom63.us.3.epil
%40 = load i32, ptr %arrayidx64.us.3.epil, align 4, !tbaa !5
%arrayidx68.us.3.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %indvars.iv204.3.unr
store i32 %40, ptr %arrayidx68.us.3.epil, align 4, !tbaa !5
br label %for.body54.us.4.preheader
for.body54.us.4.preheader: ; preds = %for.body54.us.4.preheader.unr-lcssa, %for.body54.us.3.epil
%xtraiter239 = and i64 %wide.trip.count, 1
%41 = icmp eq i64 %12, 0
br i1 %41, label %for.body54.us.5.preheader.unr-lcssa, label %for.body54.us.4.preheader.new
for.body54.us.4.preheader.new: ; preds = %for.body54.us.4.preheader
%unroll_iter241 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.4
for.body54.us.4: ; preds = %for.body54.us.4, %for.body54.us.4.preheader.new
%indvars.iv204.4 = phi i64 [ 0, %for.body54.us.4.preheader.new ], [ %indvars.iv.next205.4.1, %for.body54.us.4 ]
%niter242 = phi i64 [ 0, %for.body54.us.4.preheader.new ], [ %niter242.next.1, %for.body54.us.4 ]
%arrayidx62.us.4 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %indvars.iv204.4
%42 = load i32, ptr %arrayidx62.us.4, align 8, !tbaa !5
%idxprom63.us.4 = sext i32 %42 to i64
%arrayidx64.us.4 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %idxprom63.us.4
%43 = load i32, ptr %arrayidx64.us.4, align 4, !tbaa !5
%arrayidx68.us.4 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %indvars.iv204.4
store i32 %43, ptr %arrayidx68.us.4, align 8, !tbaa !5
%indvars.iv.next205.4 = or i64 %indvars.iv204.4, 1
%arrayidx62.us.4.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %indvars.iv.next205.4
%44 = load i32, ptr %arrayidx62.us.4.1, align 4, !tbaa !5
%idxprom63.us.4.1 = sext i32 %44 to i64
%arrayidx64.us.4.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %idxprom63.us.4.1
%45 = load i32, ptr %arrayidx64.us.4.1, align 4, !tbaa !5
%arrayidx68.us.4.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %indvars.iv.next205.4
store i32 %45, ptr %arrayidx68.us.4.1, align 4, !tbaa !5
%indvars.iv.next205.4.1 = add nuw nsw i64 %indvars.iv204.4, 2
%niter242.next.1 = add i64 %niter242, 2
%niter242.ncmp.1 = icmp eq i64 %niter242.next.1, %unroll_iter241
br i1 %niter242.ncmp.1, label %for.body54.us.5.preheader.unr-lcssa, label %for.body54.us.4, !llvm.loop !12
for.body54.us.5.preheader.unr-lcssa: ; preds = %for.body54.us.4, %for.body54.us.4.preheader
%indvars.iv204.4.unr = phi i64 [ 0, %for.body54.us.4.preheader ], [ %indvars.iv.next205.4.1, %for.body54.us.4 ]
%lcmp.mod240.not = icmp eq i64 %xtraiter239, 0
br i1 %lcmp.mod240.not, label %for.body54.us.5.preheader, label %for.body54.us.4.epil
for.body54.us.4.epil: ; preds = %for.body54.us.5.preheader.unr-lcssa
%arrayidx62.us.4.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %indvars.iv204.4.unr
%46 = load i32, ptr %arrayidx62.us.4.epil, align 4, !tbaa !5
%idxprom63.us.4.epil = sext i32 %46 to i64
%arrayidx64.us.4.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %idxprom63.us.4.epil
%47 = load i32, ptr %arrayidx64.us.4.epil, align 4, !tbaa !5
%arrayidx68.us.4.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %indvars.iv204.4.unr
store i32 %47, ptr %arrayidx68.us.4.epil, align 4, !tbaa !5
br label %for.body54.us.5.preheader
for.body54.us.5.preheader: ; preds = %for.body54.us.5.preheader.unr-lcssa, %for.body54.us.4.epil
%xtraiter243 = and i64 %wide.trip.count, 1
%48 = icmp eq i64 %12, 0
br i1 %48, label %for.body54.us.6.preheader.unr-lcssa, label %for.body54.us.5.preheader.new
for.body54.us.5.preheader.new: ; preds = %for.body54.us.5.preheader
%unroll_iter245 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.5
for.body54.us.5: ; preds = %for.body54.us.5, %for.body54.us.5.preheader.new
%indvars.iv204.5 = phi i64 [ 0, %for.body54.us.5.preheader.new ], [ %indvars.iv.next205.5.1, %for.body54.us.5 ]
%niter246 = phi i64 [ 0, %for.body54.us.5.preheader.new ], [ %niter246.next.1, %for.body54.us.5 ]
%arrayidx62.us.5 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %indvars.iv204.5
%49 = load i32, ptr %arrayidx62.us.5, align 8, !tbaa !5
%idxprom63.us.5 = sext i32 %49 to i64
%arrayidx64.us.5 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %idxprom63.us.5
%50 = load i32, ptr %arrayidx64.us.5, align 4, !tbaa !5
%arrayidx68.us.5 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %indvars.iv204.5
store i32 %50, ptr %arrayidx68.us.5, align 8, !tbaa !5
%indvars.iv.next205.5 = or i64 %indvars.iv204.5, 1
%arrayidx62.us.5.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %indvars.iv.next205.5
%51 = load i32, ptr %arrayidx62.us.5.1, align 4, !tbaa !5
%idxprom63.us.5.1 = sext i32 %51 to i64
%arrayidx64.us.5.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %idxprom63.us.5.1
%52 = load i32, ptr %arrayidx64.us.5.1, align 4, !tbaa !5
%arrayidx68.us.5.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %indvars.iv.next205.5
store i32 %52, ptr %arrayidx68.us.5.1, align 4, !tbaa !5
%indvars.iv.next205.5.1 = add nuw nsw i64 %indvars.iv204.5, 2
%niter246.next.1 = add i64 %niter246, 2
%niter246.ncmp.1 = icmp eq i64 %niter246.next.1, %unroll_iter245
br i1 %niter246.ncmp.1, label %for.body54.us.6.preheader.unr-lcssa, label %for.body54.us.5, !llvm.loop !12
for.body54.us.6.preheader.unr-lcssa: ; preds = %for.body54.us.5, %for.body54.us.5.preheader
%indvars.iv204.5.unr = phi i64 [ 0, %for.body54.us.5.preheader ], [ %indvars.iv.next205.5.1, %for.body54.us.5 ]
%lcmp.mod244.not = icmp eq i64 %xtraiter243, 0
br i1 %lcmp.mod244.not, label %for.body54.us.6.preheader, label %for.body54.us.5.epil
for.body54.us.5.epil: ; preds = %for.body54.us.6.preheader.unr-lcssa
%arrayidx62.us.5.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %indvars.iv204.5.unr
%53 = load i32, ptr %arrayidx62.us.5.epil, align 4, !tbaa !5
%idxprom63.us.5.epil = sext i32 %53 to i64
%arrayidx64.us.5.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %idxprom63.us.5.epil
%54 = load i32, ptr %arrayidx64.us.5.epil, align 4, !tbaa !5
%arrayidx68.us.5.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %indvars.iv204.5.unr
store i32 %54, ptr %arrayidx68.us.5.epil, align 4, !tbaa !5
br label %for.body54.us.6.preheader
for.body54.us.6.preheader: ; preds = %for.body54.us.6.preheader.unr-lcssa, %for.body54.us.5.epil
%xtraiter247 = and i64 %wide.trip.count, 1
%55 = icmp eq i64 %12, 0
br i1 %55, label %for.body54.us.7.preheader.unr-lcssa, label %for.body54.us.6.preheader.new
for.body54.us.6.preheader.new: ; preds = %for.body54.us.6.preheader
%unroll_iter249 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.6
for.body54.us.6: ; preds = %for.body54.us.6, %for.body54.us.6.preheader.new
%indvars.iv204.6 = phi i64 [ 0, %for.body54.us.6.preheader.new ], [ %indvars.iv.next205.6.1, %for.body54.us.6 ]
%niter250 = phi i64 [ 0, %for.body54.us.6.preheader.new ], [ %niter250.next.1, %for.body54.us.6 ]
%arrayidx62.us.6 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %indvars.iv204.6
%56 = load i32, ptr %arrayidx62.us.6, align 8, !tbaa !5
%idxprom63.us.6 = sext i32 %56 to i64
%arrayidx64.us.6 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %idxprom63.us.6
%57 = load i32, ptr %arrayidx64.us.6, align 4, !tbaa !5
%arrayidx68.us.6 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %indvars.iv204.6
store i32 %57, ptr %arrayidx68.us.6, align 8, !tbaa !5
%indvars.iv.next205.6 = or i64 %indvars.iv204.6, 1
%arrayidx62.us.6.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %indvars.iv.next205.6
%58 = load i32, ptr %arrayidx62.us.6.1, align 4, !tbaa !5
%idxprom63.us.6.1 = sext i32 %58 to i64
%arrayidx64.us.6.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %idxprom63.us.6.1
%59 = load i32, ptr %arrayidx64.us.6.1, align 4, !tbaa !5
%arrayidx68.us.6.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %indvars.iv.next205.6
store i32 %59, ptr %arrayidx68.us.6.1, align 4, !tbaa !5
%indvars.iv.next205.6.1 = add nuw nsw i64 %indvars.iv204.6, 2
%niter250.next.1 = add i64 %niter250, 2
%niter250.ncmp.1 = icmp eq i64 %niter250.next.1, %unroll_iter249
br i1 %niter250.ncmp.1, label %for.body54.us.7.preheader.unr-lcssa, label %for.body54.us.6, !llvm.loop !12
for.body54.us.7.preheader.unr-lcssa: ; preds = %for.body54.us.6, %for.body54.us.6.preheader
%indvars.iv204.6.unr = phi i64 [ 0, %for.body54.us.6.preheader ], [ %indvars.iv.next205.6.1, %for.body54.us.6 ]
%lcmp.mod248.not = icmp eq i64 %xtraiter247, 0
br i1 %lcmp.mod248.not, label %for.body54.us.7.preheader, label %for.body54.us.6.epil
for.body54.us.6.epil: ; preds = %for.body54.us.7.preheader.unr-lcssa
%arrayidx62.us.6.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %indvars.iv204.6.unr
%60 = load i32, ptr %arrayidx62.us.6.epil, align 4, !tbaa !5
%idxprom63.us.6.epil = sext i32 %60 to i64
%arrayidx64.us.6.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %idxprom63.us.6.epil
%61 = load i32, ptr %arrayidx64.us.6.epil, align 4, !tbaa !5
%arrayidx68.us.6.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %indvars.iv204.6.unr
store i32 %61, ptr %arrayidx68.us.6.epil, align 4, !tbaa !5
br label %for.body54.us.7.preheader
for.body54.us.7.preheader: ; preds = %for.body54.us.7.preheader.unr-lcssa, %for.body54.us.6.epil
%xtraiter251 = and i64 %wide.trip.count, 1
%62 = icmp eq i64 %12, 0
br i1 %62, label %for.body54.us.8.preheader.unr-lcssa, label %for.body54.us.7.preheader.new
for.body54.us.7.preheader.new: ; preds = %for.body54.us.7.preheader
%unroll_iter253 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.7
for.body54.us.7: ; preds = %for.body54.us.7, %for.body54.us.7.preheader.new
%indvars.iv204.7 = phi i64 [ 0, %for.body54.us.7.preheader.new ], [ %indvars.iv.next205.7.1, %for.body54.us.7 ]
%niter254 = phi i64 [ 0, %for.body54.us.7.preheader.new ], [ %niter254.next.1, %for.body54.us.7 ]
%arrayidx62.us.7 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %indvars.iv204.7
%63 = load i32, ptr %arrayidx62.us.7, align 8, !tbaa !5
%idxprom63.us.7 = sext i32 %63 to i64
%arrayidx64.us.7 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %idxprom63.us.7
%64 = load i32, ptr %arrayidx64.us.7, align 4, !tbaa !5
%arrayidx68.us.7 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %indvars.iv204.7
store i32 %64, ptr %arrayidx68.us.7, align 8, !tbaa !5
%indvars.iv.next205.7 = or i64 %indvars.iv204.7, 1
%arrayidx62.us.7.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %indvars.iv.next205.7
%65 = load i32, ptr %arrayidx62.us.7.1, align 4, !tbaa !5
%idxprom63.us.7.1 = sext i32 %65 to i64
%arrayidx64.us.7.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %idxprom63.us.7.1
%66 = load i32, ptr %arrayidx64.us.7.1, align 4, !tbaa !5
%arrayidx68.us.7.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %indvars.iv.next205.7
store i32 %66, ptr %arrayidx68.us.7.1, align 4, !tbaa !5
%indvars.iv.next205.7.1 = add nuw nsw i64 %indvars.iv204.7, 2
%niter254.next.1 = add i64 %niter254, 2
%niter254.ncmp.1 = icmp eq i64 %niter254.next.1, %unroll_iter253
br i1 %niter254.ncmp.1, label %for.body54.us.8.preheader.unr-lcssa, label %for.body54.us.7, !llvm.loop !12
for.body54.us.8.preheader.unr-lcssa: ; preds = %for.body54.us.7, %for.body54.us.7.preheader
%indvars.iv204.7.unr = phi i64 [ 0, %for.body54.us.7.preheader ], [ %indvars.iv.next205.7.1, %for.body54.us.7 ]
%lcmp.mod252.not = icmp eq i64 %xtraiter251, 0
br i1 %lcmp.mod252.not, label %for.body54.us.8.preheader, label %for.body54.us.7.epil
for.body54.us.7.epil: ; preds = %for.body54.us.8.preheader.unr-lcssa
%arrayidx62.us.7.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %indvars.iv204.7.unr
%67 = load i32, ptr %arrayidx62.us.7.epil, align 4, !tbaa !5
%idxprom63.us.7.epil = sext i32 %67 to i64
%arrayidx64.us.7.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %idxprom63.us.7.epil
%68 = load i32, ptr %arrayidx64.us.7.epil, align 4, !tbaa !5
%arrayidx68.us.7.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %indvars.iv204.7.unr
store i32 %68, ptr %arrayidx68.us.7.epil, align 4, !tbaa !5
br label %for.body54.us.8.preheader
for.body54.us.8.preheader: ; preds = %for.body54.us.8.preheader.unr-lcssa, %for.body54.us.7.epil
%xtraiter255 = and i64 %wide.trip.count, 1
%69 = icmp eq i64 %12, 0
br i1 %69, label %for.body54.us.9.preheader.unr-lcssa, label %for.body54.us.8.preheader.new
for.body54.us.8.preheader.new: ; preds = %for.body54.us.8.preheader
%unroll_iter257 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.8
for.body54.us.8: ; preds = %for.body54.us.8, %for.body54.us.8.preheader.new
%indvars.iv204.8 = phi i64 [ 0, %for.body54.us.8.preheader.new ], [ %indvars.iv.next205.8.1, %for.body54.us.8 ]
%niter258 = phi i64 [ 0, %for.body54.us.8.preheader.new ], [ %niter258.next.1, %for.body54.us.8 ]
%arrayidx62.us.8 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %indvars.iv204.8
%70 = load i32, ptr %arrayidx62.us.8, align 8, !tbaa !5
%idxprom63.us.8 = sext i32 %70 to i64
%arrayidx64.us.8 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %idxprom63.us.8
%71 = load i32, ptr %arrayidx64.us.8, align 4, !tbaa !5
%arrayidx68.us.8 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %indvars.iv204.8
store i32 %71, ptr %arrayidx68.us.8, align 8, !tbaa !5
%indvars.iv.next205.8 = or i64 %indvars.iv204.8, 1
%arrayidx62.us.8.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %indvars.iv.next205.8
%72 = load i32, ptr %arrayidx62.us.8.1, align 4, !tbaa !5
%idxprom63.us.8.1 = sext i32 %72 to i64
%arrayidx64.us.8.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %idxprom63.us.8.1
%73 = load i32, ptr %arrayidx64.us.8.1, align 4, !tbaa !5
%arrayidx68.us.8.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %indvars.iv.next205.8
store i32 %73, ptr %arrayidx68.us.8.1, align 4, !tbaa !5
%indvars.iv.next205.8.1 = add nuw nsw i64 %indvars.iv204.8, 2
%niter258.next.1 = add i64 %niter258, 2
%niter258.ncmp.1 = icmp eq i64 %niter258.next.1, %unroll_iter257
br i1 %niter258.ncmp.1, label %for.body54.us.9.preheader.unr-lcssa, label %for.body54.us.8, !llvm.loop !12
for.body54.us.9.preheader.unr-lcssa: ; preds = %for.body54.us.8, %for.body54.us.8.preheader
%indvars.iv204.8.unr = phi i64 [ 0, %for.body54.us.8.preheader ], [ %indvars.iv.next205.8.1, %for.body54.us.8 ]
%lcmp.mod256.not = icmp eq i64 %xtraiter255, 0
br i1 %lcmp.mod256.not, label %for.body54.us.9.preheader, label %for.body54.us.8.epil
for.body54.us.8.epil: ; preds = %for.body54.us.9.preheader.unr-lcssa
%arrayidx62.us.8.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %indvars.iv204.8.unr
%74 = load i32, ptr %arrayidx62.us.8.epil, align 4, !tbaa !5
%idxprom63.us.8.epil = sext i32 %74 to i64
%arrayidx64.us.8.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %idxprom63.us.8.epil
%75 = load i32, ptr %arrayidx64.us.8.epil, align 4, !tbaa !5
%arrayidx68.us.8.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %indvars.iv204.8.unr
store i32 %75, ptr %arrayidx68.us.8.epil, align 4, !tbaa !5
br label %for.body54.us.9.preheader
for.body54.us.9.preheader: ; preds = %for.body54.us.9.preheader.unr-lcssa, %for.body54.us.8.epil
%xtraiter259 = and i64 %wide.trip.count, 1
%76 = icmp eq i64 %12, 0
br i1 %76, label %for.body54.us.10.preheader.unr-lcssa, label %for.body54.us.9.preheader.new
for.body54.us.9.preheader.new: ; preds = %for.body54.us.9.preheader
%unroll_iter261 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.9
for.body54.us.9: ; preds = %for.body54.us.9, %for.body54.us.9.preheader.new
%indvars.iv204.9 = phi i64 [ 0, %for.body54.us.9.preheader.new ], [ %indvars.iv.next205.9.1, %for.body54.us.9 ]
%niter262 = phi i64 [ 0, %for.body54.us.9.preheader.new ], [ %niter262.next.1, %for.body54.us.9 ]
%arrayidx62.us.9 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %indvars.iv204.9
%77 = load i32, ptr %arrayidx62.us.9, align 8, !tbaa !5
%idxprom63.us.9 = sext i32 %77 to i64
%arrayidx64.us.9 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %idxprom63.us.9
%78 = load i32, ptr %arrayidx64.us.9, align 4, !tbaa !5
%arrayidx68.us.9 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %indvars.iv204.9
store i32 %78, ptr %arrayidx68.us.9, align 8, !tbaa !5
%indvars.iv.next205.9 = or i64 %indvars.iv204.9, 1
%arrayidx62.us.9.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %indvars.iv.next205.9
%79 = load i32, ptr %arrayidx62.us.9.1, align 4, !tbaa !5
%idxprom63.us.9.1 = sext i32 %79 to i64
%arrayidx64.us.9.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %idxprom63.us.9.1
%80 = load i32, ptr %arrayidx64.us.9.1, align 4, !tbaa !5
%arrayidx68.us.9.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %indvars.iv.next205.9
store i32 %80, ptr %arrayidx68.us.9.1, align 4, !tbaa !5
%indvars.iv.next205.9.1 = add nuw nsw i64 %indvars.iv204.9, 2
%niter262.next.1 = add i64 %niter262, 2
%niter262.ncmp.1 = icmp eq i64 %niter262.next.1, %unroll_iter261
br i1 %niter262.ncmp.1, label %for.body54.us.10.preheader.unr-lcssa, label %for.body54.us.9, !llvm.loop !12
for.body54.us.10.preheader.unr-lcssa: ; preds = %for.body54.us.9, %for.body54.us.9.preheader
%indvars.iv204.9.unr = phi i64 [ 0, %for.body54.us.9.preheader ], [ %indvars.iv.next205.9.1, %for.body54.us.9 ]
%lcmp.mod260.not = icmp eq i64 %xtraiter259, 0
br i1 %lcmp.mod260.not, label %for.body54.us.10.preheader, label %for.body54.us.9.epil
for.body54.us.9.epil: ; preds = %for.body54.us.10.preheader.unr-lcssa
%arrayidx62.us.9.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %indvars.iv204.9.unr
%81 = load i32, ptr %arrayidx62.us.9.epil, align 4, !tbaa !5
%idxprom63.us.9.epil = sext i32 %81 to i64
%arrayidx64.us.9.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %idxprom63.us.9.epil
%82 = load i32, ptr %arrayidx64.us.9.epil, align 4, !tbaa !5
%arrayidx68.us.9.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %indvars.iv204.9.unr
store i32 %82, ptr %arrayidx68.us.9.epil, align 4, !tbaa !5
br label %for.body54.us.10.preheader
for.body54.us.10.preheader: ; preds = %for.body54.us.10.preheader.unr-lcssa, %for.body54.us.9.epil
%xtraiter263 = and i64 %wide.trip.count, 1
%83 = icmp eq i64 %12, 0
br i1 %83, label %for.body54.us.11.preheader.unr-lcssa, label %for.body54.us.10.preheader.new
for.body54.us.10.preheader.new: ; preds = %for.body54.us.10.preheader
%unroll_iter265 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.10
for.body54.us.10: ; preds = %for.body54.us.10, %for.body54.us.10.preheader.new
%indvars.iv204.10 = phi i64 [ 0, %for.body54.us.10.preheader.new ], [ %indvars.iv.next205.10.1, %for.body54.us.10 ]
%niter266 = phi i64 [ 0, %for.body54.us.10.preheader.new ], [ %niter266.next.1, %for.body54.us.10 ]
%arrayidx62.us.10 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %indvars.iv204.10
%84 = load i32, ptr %arrayidx62.us.10, align 8, !tbaa !5
%idxprom63.us.10 = sext i32 %84 to i64
%arrayidx64.us.10 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %idxprom63.us.10
%85 = load i32, ptr %arrayidx64.us.10, align 4, !tbaa !5
%arrayidx68.us.10 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %indvars.iv204.10
store i32 %85, ptr %arrayidx68.us.10, align 8, !tbaa !5
%indvars.iv.next205.10 = or i64 %indvars.iv204.10, 1
%arrayidx62.us.10.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %indvars.iv.next205.10
%86 = load i32, ptr %arrayidx62.us.10.1, align 4, !tbaa !5
%idxprom63.us.10.1 = sext i32 %86 to i64
%arrayidx64.us.10.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %idxprom63.us.10.1
%87 = load i32, ptr %arrayidx64.us.10.1, align 4, !tbaa !5
%arrayidx68.us.10.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %indvars.iv.next205.10
store i32 %87, ptr %arrayidx68.us.10.1, align 4, !tbaa !5
%indvars.iv.next205.10.1 = add nuw nsw i64 %indvars.iv204.10, 2
%niter266.next.1 = add i64 %niter266, 2
%niter266.ncmp.1 = icmp eq i64 %niter266.next.1, %unroll_iter265
br i1 %niter266.ncmp.1, label %for.body54.us.11.preheader.unr-lcssa, label %for.body54.us.10, !llvm.loop !12
for.body54.us.11.preheader.unr-lcssa: ; preds = %for.body54.us.10, %for.body54.us.10.preheader
%indvars.iv204.10.unr = phi i64 [ 0, %for.body54.us.10.preheader ], [ %indvars.iv.next205.10.1, %for.body54.us.10 ]
%lcmp.mod264.not = icmp eq i64 %xtraiter263, 0
br i1 %lcmp.mod264.not, label %for.body54.us.11.preheader, label %for.body54.us.10.epil
for.body54.us.10.epil: ; preds = %for.body54.us.11.preheader.unr-lcssa
%arrayidx62.us.10.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %indvars.iv204.10.unr
%88 = load i32, ptr %arrayidx62.us.10.epil, align 4, !tbaa !5
%idxprom63.us.10.epil = sext i32 %88 to i64
%arrayidx64.us.10.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %idxprom63.us.10.epil
%89 = load i32, ptr %arrayidx64.us.10.epil, align 4, !tbaa !5
%arrayidx68.us.10.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %indvars.iv204.10.unr
store i32 %89, ptr %arrayidx68.us.10.epil, align 4, !tbaa !5
br label %for.body54.us.11.preheader
for.body54.us.11.preheader: ; preds = %for.body54.us.11.preheader.unr-lcssa, %for.body54.us.10.epil
%xtraiter267 = and i64 %wide.trip.count, 1
%90 = icmp eq i64 %12, 0
br i1 %90, label %for.body54.us.12.preheader.unr-lcssa, label %for.body54.us.11.preheader.new
for.body54.us.11.preheader.new: ; preds = %for.body54.us.11.preheader
%unroll_iter269 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.11
for.body54.us.11: ; preds = %for.body54.us.11, %for.body54.us.11.preheader.new
%indvars.iv204.11 = phi i64 [ 0, %for.body54.us.11.preheader.new ], [ %indvars.iv.next205.11.1, %for.body54.us.11 ]
%niter270 = phi i64 [ 0, %for.body54.us.11.preheader.new ], [ %niter270.next.1, %for.body54.us.11 ]
%arrayidx62.us.11 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %indvars.iv204.11
%91 = load i32, ptr %arrayidx62.us.11, align 8, !tbaa !5
%idxprom63.us.11 = sext i32 %91 to i64
%arrayidx64.us.11 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %idxprom63.us.11
%92 = load i32, ptr %arrayidx64.us.11, align 4, !tbaa !5
%arrayidx68.us.11 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %indvars.iv204.11
store i32 %92, ptr %arrayidx68.us.11, align 8, !tbaa !5
%indvars.iv.next205.11 = or i64 %indvars.iv204.11, 1
%arrayidx62.us.11.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %indvars.iv.next205.11
%93 = load i32, ptr %arrayidx62.us.11.1, align 4, !tbaa !5
%idxprom63.us.11.1 = sext i32 %93 to i64
%arrayidx64.us.11.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %idxprom63.us.11.1
%94 = load i32, ptr %arrayidx64.us.11.1, align 4, !tbaa !5
%arrayidx68.us.11.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %indvars.iv.next205.11
store i32 %94, ptr %arrayidx68.us.11.1, align 4, !tbaa !5
%indvars.iv.next205.11.1 = add nuw nsw i64 %indvars.iv204.11, 2
%niter270.next.1 = add i64 %niter270, 2
%niter270.ncmp.1 = icmp eq i64 %niter270.next.1, %unroll_iter269
br i1 %niter270.ncmp.1, label %for.body54.us.12.preheader.unr-lcssa, label %for.body54.us.11, !llvm.loop !12
for.body54.us.12.preheader.unr-lcssa: ; preds = %for.body54.us.11, %for.body54.us.11.preheader
%indvars.iv204.11.unr = phi i64 [ 0, %for.body54.us.11.preheader ], [ %indvars.iv.next205.11.1, %for.body54.us.11 ]
%lcmp.mod268.not = icmp eq i64 %xtraiter267, 0
br i1 %lcmp.mod268.not, label %for.body54.us.12.preheader, label %for.body54.us.11.epil
for.body54.us.11.epil: ; preds = %for.body54.us.12.preheader.unr-lcssa
%arrayidx62.us.11.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %indvars.iv204.11.unr
%95 = load i32, ptr %arrayidx62.us.11.epil, align 4, !tbaa !5
%idxprom63.us.11.epil = sext i32 %95 to i64
%arrayidx64.us.11.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %idxprom63.us.11.epil
%96 = load i32, ptr %arrayidx64.us.11.epil, align 4, !tbaa !5
%arrayidx68.us.11.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %indvars.iv204.11.unr
store i32 %96, ptr %arrayidx68.us.11.epil, align 4, !tbaa !5
br label %for.body54.us.12.preheader
for.body54.us.12.preheader: ; preds = %for.body54.us.12.preheader.unr-lcssa, %for.body54.us.11.epil
%xtraiter271 = and i64 %wide.trip.count, 1
%97 = icmp eq i64 %12, 0
br i1 %97, label %for.body54.us.13.preheader.unr-lcssa, label %for.body54.us.12.preheader.new
for.body54.us.12.preheader.new: ; preds = %for.body54.us.12.preheader
%unroll_iter273 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.12
for.body54.us.12: ; preds = %for.body54.us.12, %for.body54.us.12.preheader.new
%indvars.iv204.12 = phi i64 [ 0, %for.body54.us.12.preheader.new ], [ %indvars.iv.next205.12.1, %for.body54.us.12 ]
%niter274 = phi i64 [ 0, %for.body54.us.12.preheader.new ], [ %niter274.next.1, %for.body54.us.12 ]
%arrayidx62.us.12 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %indvars.iv204.12
%98 = load i32, ptr %arrayidx62.us.12, align 8, !tbaa !5
%idxprom63.us.12 = sext i32 %98 to i64
%arrayidx64.us.12 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %idxprom63.us.12
%99 = load i32, ptr %arrayidx64.us.12, align 4, !tbaa !5
%arrayidx68.us.12 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %indvars.iv204.12
store i32 %99, ptr %arrayidx68.us.12, align 8, !tbaa !5
%indvars.iv.next205.12 = or i64 %indvars.iv204.12, 1
%arrayidx62.us.12.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %indvars.iv.next205.12
%100 = load i32, ptr %arrayidx62.us.12.1, align 4, !tbaa !5
%idxprom63.us.12.1 = sext i32 %100 to i64
%arrayidx64.us.12.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %idxprom63.us.12.1
%101 = load i32, ptr %arrayidx64.us.12.1, align 4, !tbaa !5
%arrayidx68.us.12.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %indvars.iv.next205.12
store i32 %101, ptr %arrayidx68.us.12.1, align 4, !tbaa !5
%indvars.iv.next205.12.1 = add nuw nsw i64 %indvars.iv204.12, 2
%niter274.next.1 = add i64 %niter274, 2
%niter274.ncmp.1 = icmp eq i64 %niter274.next.1, %unroll_iter273
br i1 %niter274.ncmp.1, label %for.body54.us.13.preheader.unr-lcssa, label %for.body54.us.12, !llvm.loop !12
for.body54.us.13.preheader.unr-lcssa: ; preds = %for.body54.us.12, %for.body54.us.12.preheader
%indvars.iv204.12.unr = phi i64 [ 0, %for.body54.us.12.preheader ], [ %indvars.iv.next205.12.1, %for.body54.us.12 ]
%lcmp.mod272.not = icmp eq i64 %xtraiter271, 0
br i1 %lcmp.mod272.not, label %for.body54.us.13.preheader, label %for.body54.us.12.epil
for.body54.us.12.epil: ; preds = %for.body54.us.13.preheader.unr-lcssa
%arrayidx62.us.12.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %indvars.iv204.12.unr
%102 = load i32, ptr %arrayidx62.us.12.epil, align 4, !tbaa !5
%idxprom63.us.12.epil = sext i32 %102 to i64
%arrayidx64.us.12.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %idxprom63.us.12.epil
%103 = load i32, ptr %arrayidx64.us.12.epil, align 4, !tbaa !5
%arrayidx68.us.12.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %indvars.iv204.12.unr
store i32 %103, ptr %arrayidx68.us.12.epil, align 4, !tbaa !5
br label %for.body54.us.13.preheader
for.body54.us.13.preheader: ; preds = %for.body54.us.13.preheader.unr-lcssa, %for.body54.us.12.epil
%xtraiter275 = and i64 %wide.trip.count, 1
%104 = icmp eq i64 %12, 0
br i1 %104, label %for.body54.us.14.preheader.unr-lcssa, label %for.body54.us.13.preheader.new
for.body54.us.13.preheader.new: ; preds = %for.body54.us.13.preheader
%unroll_iter277 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.13
for.body54.us.13: ; preds = %for.body54.us.13, %for.body54.us.13.preheader.new
%indvars.iv204.13 = phi i64 [ 0, %for.body54.us.13.preheader.new ], [ %indvars.iv.next205.13.1, %for.body54.us.13 ]
%niter278 = phi i64 [ 0, %for.body54.us.13.preheader.new ], [ %niter278.next.1, %for.body54.us.13 ]
%arrayidx62.us.13 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %indvars.iv204.13
%105 = load i32, ptr %arrayidx62.us.13, align 8, !tbaa !5
%idxprom63.us.13 = sext i32 %105 to i64
%arrayidx64.us.13 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %idxprom63.us.13
%106 = load i32, ptr %arrayidx64.us.13, align 4, !tbaa !5
%arrayidx68.us.13 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %indvars.iv204.13
store i32 %106, ptr %arrayidx68.us.13, align 8, !tbaa !5
%indvars.iv.next205.13 = or i64 %indvars.iv204.13, 1
%arrayidx62.us.13.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %indvars.iv.next205.13
%107 = load i32, ptr %arrayidx62.us.13.1, align 4, !tbaa !5
%idxprom63.us.13.1 = sext i32 %107 to i64
%arrayidx64.us.13.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %idxprom63.us.13.1
%108 = load i32, ptr %arrayidx64.us.13.1, align 4, !tbaa !5
%arrayidx68.us.13.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %indvars.iv.next205.13
store i32 %108, ptr %arrayidx68.us.13.1, align 4, !tbaa !5
%indvars.iv.next205.13.1 = add nuw nsw i64 %indvars.iv204.13, 2
%niter278.next.1 = add i64 %niter278, 2
%niter278.ncmp.1 = icmp eq i64 %niter278.next.1, %unroll_iter277
br i1 %niter278.ncmp.1, label %for.body54.us.14.preheader.unr-lcssa, label %for.body54.us.13, !llvm.loop !12
for.body54.us.14.preheader.unr-lcssa: ; preds = %for.body54.us.13, %for.body54.us.13.preheader
%indvars.iv204.13.unr = phi i64 [ 0, %for.body54.us.13.preheader ], [ %indvars.iv.next205.13.1, %for.body54.us.13 ]
%lcmp.mod276.not = icmp eq i64 %xtraiter275, 0
br i1 %lcmp.mod276.not, label %for.body54.us.14.preheader, label %for.body54.us.13.epil
for.body54.us.13.epil: ; preds = %for.body54.us.14.preheader.unr-lcssa
%arrayidx62.us.13.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %indvars.iv204.13.unr
%109 = load i32, ptr %arrayidx62.us.13.epil, align 4, !tbaa !5
%idxprom63.us.13.epil = sext i32 %109 to i64
%arrayidx64.us.13.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %idxprom63.us.13.epil
%110 = load i32, ptr %arrayidx64.us.13.epil, align 4, !tbaa !5
%arrayidx68.us.13.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %indvars.iv204.13.unr
store i32 %110, ptr %arrayidx68.us.13.epil, align 4, !tbaa !5
br label %for.body54.us.14.preheader
for.body54.us.14.preheader: ; preds = %for.body54.us.14.preheader.unr-lcssa, %for.body54.us.13.epil
%xtraiter279 = and i64 %wide.trip.count, 1
%111 = icmp eq i64 %12, 0
br i1 %111, label %for.body54.us.15.preheader.unr-lcssa, label %for.body54.us.14.preheader.new
for.body54.us.14.preheader.new: ; preds = %for.body54.us.14.preheader
%unroll_iter281 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.14
for.body54.us.14: ; preds = %for.body54.us.14, %for.body54.us.14.preheader.new
%indvars.iv204.14 = phi i64 [ 0, %for.body54.us.14.preheader.new ], [ %indvars.iv.next205.14.1, %for.body54.us.14 ]
%niter282 = phi i64 [ 0, %for.body54.us.14.preheader.new ], [ %niter282.next.1, %for.body54.us.14 ]
%arrayidx62.us.14 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %indvars.iv204.14
%112 = load i32, ptr %arrayidx62.us.14, align 8, !tbaa !5
%idxprom63.us.14 = sext i32 %112 to i64
%arrayidx64.us.14 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %idxprom63.us.14
%113 = load i32, ptr %arrayidx64.us.14, align 4, !tbaa !5
%arrayidx68.us.14 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %indvars.iv204.14
store i32 %113, ptr %arrayidx68.us.14, align 8, !tbaa !5
%indvars.iv.next205.14 = or i64 %indvars.iv204.14, 1
%arrayidx62.us.14.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %indvars.iv.next205.14
%114 = load i32, ptr %arrayidx62.us.14.1, align 4, !tbaa !5
%idxprom63.us.14.1 = sext i32 %114 to i64
%arrayidx64.us.14.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %idxprom63.us.14.1
%115 = load i32, ptr %arrayidx64.us.14.1, align 4, !tbaa !5
%arrayidx68.us.14.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %indvars.iv.next205.14
store i32 %115, ptr %arrayidx68.us.14.1, align 4, !tbaa !5
%indvars.iv.next205.14.1 = add nuw nsw i64 %indvars.iv204.14, 2
%niter282.next.1 = add i64 %niter282, 2
%niter282.ncmp.1 = icmp eq i64 %niter282.next.1, %unroll_iter281
br i1 %niter282.ncmp.1, label %for.body54.us.15.preheader.unr-lcssa, label %for.body54.us.14, !llvm.loop !12
for.body54.us.15.preheader.unr-lcssa: ; preds = %for.body54.us.14, %for.body54.us.14.preheader
%indvars.iv204.14.unr = phi i64 [ 0, %for.body54.us.14.preheader ], [ %indvars.iv.next205.14.1, %for.body54.us.14 ]
%lcmp.mod280.not = icmp eq i64 %xtraiter279, 0
br i1 %lcmp.mod280.not, label %for.body54.us.15.preheader, label %for.body54.us.14.epil
for.body54.us.14.epil: ; preds = %for.body54.us.15.preheader.unr-lcssa
%arrayidx62.us.14.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %indvars.iv204.14.unr
%116 = load i32, ptr %arrayidx62.us.14.epil, align 4, !tbaa !5
%idxprom63.us.14.epil = sext i32 %116 to i64
%arrayidx64.us.14.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %idxprom63.us.14.epil
%117 = load i32, ptr %arrayidx64.us.14.epil, align 4, !tbaa !5
%arrayidx68.us.14.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %indvars.iv204.14.unr
store i32 %117, ptr %arrayidx68.us.14.epil, align 4, !tbaa !5
br label %for.body54.us.15.preheader
for.body54.us.15.preheader: ; preds = %for.body54.us.15.preheader.unr-lcssa, %for.body54.us.14.epil
%xtraiter283 = and i64 %wide.trip.count, 1
%118 = icmp eq i64 %12, 0
br i1 %118, label %for.cond75.preheader.loopexit.unr-lcssa, label %for.body54.us.15.preheader.new
for.body54.us.15.preheader.new: ; preds = %for.body54.us.15.preheader
%unroll_iter285 = and i64 %wide.trip.count, 4294967294
br label %for.body54.us.15
for.body54.us.15: ; preds = %for.body54.us.15, %for.body54.us.15.preheader.new
%indvars.iv204.15 = phi i64 [ 0, %for.body54.us.15.preheader.new ], [ %indvars.iv.next205.15.1, %for.body54.us.15 ]
%niter286 = phi i64 [ 0, %for.body54.us.15.preheader.new ], [ %niter286.next.1, %for.body54.us.15 ]
%arrayidx62.us.15 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %indvars.iv204.15
%119 = load i32, ptr %arrayidx62.us.15, align 8, !tbaa !5
%idxprom63.us.15 = sext i32 %119 to i64
%arrayidx64.us.15 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %idxprom63.us.15
%120 = load i32, ptr %arrayidx64.us.15, align 4, !tbaa !5
%arrayidx68.us.15 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 16, i64 %indvars.iv204.15
store i32 %120, ptr %arrayidx68.us.15, align 8, !tbaa !5
%indvars.iv.next205.15 = or i64 %indvars.iv204.15, 1
%arrayidx62.us.15.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %indvars.iv.next205.15
%121 = load i32, ptr %arrayidx62.us.15.1, align 4, !tbaa !5
%idxprom63.us.15.1 = sext i32 %121 to i64
%arrayidx64.us.15.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %idxprom63.us.15.1
%122 = load i32, ptr %arrayidx64.us.15.1, align 4, !tbaa !5
%arrayidx68.us.15.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 16, i64 %indvars.iv.next205.15
store i32 %122, ptr %arrayidx68.us.15.1, align 4, !tbaa !5
%indvars.iv.next205.15.1 = add nuw nsw i64 %indvars.iv204.15, 2
%niter286.next.1 = add i64 %niter286, 2
%niter286.ncmp.1 = icmp eq i64 %niter286.next.1, %unroll_iter285
br i1 %niter286.ncmp.1, label %for.cond75.preheader.loopexit.unr-lcssa, label %for.body54.us.15, !llvm.loop !12
for.body22: ; preds = %for.body22.lr.ph, %for.inc46
%indvars.iv200 = phi i64 [ 0, %for.body22.lr.ph ], [ %indvars.iv.next201.pre-phi, %for.inc46 ]
%arrayidx26 = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %indvars.iv200
%123 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%sub27 = sub nsw i32 %6, %123
%cmp28.not = icmp sgt i32 %sub27, %7
br i1 %cmp28.not, label %if.end, label %if.then
if.then: ; preds = %for.body22
%arrayidx31 = getelementptr inbounds [100000 x i32], ptr @x_go_max, i64 0, i64 %indvars.iv200
store i32 %sub, ptr %arrayidx31, align 4, !tbaa !5
%.pre = add nuw nsw i64 %indvars.iv200, 1
br label %for.inc46
if.end: ; preds = %for.body22
%124 = add nuw nsw i64 %indvars.iv200, 1
%125 = trunc i64 %124 to i32
%sub32179 = sub nsw i32 %5, %125
%cmp33180 = icmp sgt i32 %sub32179, 1
br i1 %cmp33180, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%sub32183 = phi i32 [ %sub32, %while.body ], [ %sub32179, %if.end ]
%right.0182 = phi i32 [ %add35.right.0, %while.body ], [ %5, %if.end ]
%left.0181 = phi i32 [ %left.0.add35, %while.body ], [ %125, %if.end ]
%div174 = lshr i32 %sub32183, 1
%add35 = add nsw i32 %div174, %left.0181
%idxprom36 = sext i32 %add35 to i64
%arrayidx37 = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %idxprom36
%126 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%sub40 = sub nsw i32 %126, %123
%cmp41.not = icmp sgt i32 %sub40, %7
%left.0.add35 = select i1 %cmp41.not, i32 %left.0181, i32 %add35
%add35.right.0 = select i1 %cmp41.not, i32 %add35, i32 %right.0182
%sub32 = sub nsw i32 %add35.right.0, %left.0.add35
%cmp33 = icmp sgt i32 %sub32, 1
br i1 %cmp33, label %while.body, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body, %if.end
%left.0.lcssa = phi i32 [ %125, %if.end ], [ %left.0.add35, %while.body ]
%arrayidx45 = getelementptr inbounds [100000 x i32], ptr @x_go_max, i64 0, i64 %indvars.iv200
store i32 %left.0.lcssa, ptr %arrayidx45, align 4, !tbaa !5
br label %for.inc46
for.inc46: ; preds = %while.end, %if.then
%indvars.iv.next201.pre-phi = phi i64 [ %124, %while.end ], [ %.pre, %if.then ]
%exitcond.not = icmp eq i64 %indvars.iv.next201.pre-phi, %wide.trip.count
br i1 %exitcond.not, label %for.cond49.preheader, label %for.body22, !llvm.loop !14
for.cond75.preheader.loopexit.unr-lcssa: ; preds = %for.body54.us.15, %for.body54.us.15.preheader
%indvars.iv204.15.unr = phi i64 [ 0, %for.body54.us.15.preheader ], [ %indvars.iv.next205.15.1, %for.body54.us.15 ]
%lcmp.mod284.not = icmp eq i64 %xtraiter283, 0
br i1 %lcmp.mod284.not, label %for.cond75.preheader, label %for.body54.us.15.epil
for.body54.us.15.epil: ; preds = %for.cond75.preheader.loopexit.unr-lcssa
%arrayidx62.us.15.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %indvars.iv204.15.unr
%127 = load i32, ptr %arrayidx62.us.15.epil, align 4, !tbaa !5
%idxprom63.us.15.epil = sext i32 %127 to i64
%arrayidx64.us.15.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %idxprom63.us.15.epil
%128 = load i32, ptr %arrayidx64.us.15.epil, align 4, !tbaa !5
%arrayidx68.us.15.epil = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 16, i64 %indvars.iv204.15.unr
store i32 %128, ptr %arrayidx68.us.15.epil, align 4, !tbaa !5
br label %for.cond75.preheader
for.cond75.preheader: ; preds = %for.body54.us.15.epil, %for.cond75.preheader.loopexit.unr-lcssa, %for.cond20.preheader, %for.cond49.preheader
%cmp76193 = icmp sgt i32 %4, 0
br i1 %cmp76193, label %for.body77, label %for.end122
for.body77: ; preds = %for.cond75.preheader, %for.body77
%indvars.iv217 = phi i64 [ %indvars.iv.next218, %for.body77 ], [ 0, %for.cond75.preheader ]
%arrayidx79 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv217
%129 = load i32, ptr %arrayidx79, align 4, !tbaa !5
%arrayidx81 = getelementptr inbounds [100000 x i32], ptr @b, i64 0, i64 %indvars.iv217
%130 = load i32, ptr %arrayidx81, align 4, !tbaa !5
%. = call i32 @llvm.smin.i32(i32 %129, i32 %130)
%cond99 = call i32 @llvm.smax.i32(i32 %129, i32 %130)
%idxprom105 = sext i32 %. to i64
%arrayidx106 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 16, i64 %idxprom105
%131 = load i32, ptr %arrayidx106, align 4, !tbaa !5
%cmp107 = icmp slt i32 %131, %cond99
%add113 = select i1 %cmp107, i32 65536, i32 0
%c.1 = select i1 %cmp107, i32 %131, i32 %.
%idxprom105.1 = sext i32 %c.1 to i64
%arrayidx106.1 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 15, i64 %idxprom105.1
%132 = load i32, ptr %arrayidx106.1, align 4, !tbaa !5
%cmp107.1 = icmp slt i32 %132, %cond99
%add113.1 = select i1 %cmp107.1, i32 32768, i32 0
%ans.1.1 = or i32 %add113.1, %add113
%c.1.1 = select i1 %cmp107.1, i32 %132, i32 %c.1
%idxprom105.2 = sext i32 %c.1.1 to i64
%arrayidx106.2 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 14, i64 %idxprom105.2
%133 = load i32, ptr %arrayidx106.2, align 4, !tbaa !5
%cmp107.2 = icmp slt i32 %133, %cond99
%add113.2 = select i1 %cmp107.2, i32 16384, i32 0
%ans.1.2 = or i32 %add113.2, %ans.1.1
%c.1.2 = select i1 %cmp107.2, i32 %133, i32 %c.1.1
%idxprom105.3 = sext i32 %c.1.2 to i64
%arrayidx106.3 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 13, i64 %idxprom105.3
%134 = load i32, ptr %arrayidx106.3, align 4, !tbaa !5
%cmp107.3 = icmp slt i32 %134, %cond99
%add113.3 = select i1 %cmp107.3, i32 8192, i32 0
%ans.1.3 = or i32 %add113.3, %ans.1.2
%c.1.3 = select i1 %cmp107.3, i32 %134, i32 %c.1.2
%idxprom105.4 = sext i32 %c.1.3 to i64
%arrayidx106.4 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 12, i64 %idxprom105.4
%135 = load i32, ptr %arrayidx106.4, align 4, !tbaa !5
%cmp107.4 = icmp slt i32 %135, %cond99
%add113.4 = select i1 %cmp107.4, i32 4096, i32 0
%ans.1.4 = or i32 %add113.4, %ans.1.3
%c.1.4 = select i1 %cmp107.4, i32 %135, i32 %c.1.3
%idxprom105.5 = sext i32 %c.1.4 to i64
%arrayidx106.5 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 11, i64 %idxprom105.5
%136 = load i32, ptr %arrayidx106.5, align 4, !tbaa !5
%cmp107.5 = icmp slt i32 %136, %cond99
%add113.5 = select i1 %cmp107.5, i32 2048, i32 0
%ans.1.5 = or i32 %add113.5, %ans.1.4
%c.1.5 = select i1 %cmp107.5, i32 %136, i32 %c.1.4
%idxprom105.6 = sext i32 %c.1.5 to i64
%arrayidx106.6 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 10, i64 %idxprom105.6
%137 = load i32, ptr %arrayidx106.6, align 4, !tbaa !5
%cmp107.6 = icmp slt i32 %137, %cond99
%add113.6 = select i1 %cmp107.6, i32 1024, i32 0
%ans.1.6 = or i32 %add113.6, %ans.1.5
%c.1.6 = select i1 %cmp107.6, i32 %137, i32 %c.1.5
%idxprom105.7 = sext i32 %c.1.6 to i64
%arrayidx106.7 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 9, i64 %idxprom105.7
%138 = load i32, ptr %arrayidx106.7, align 4, !tbaa !5
%cmp107.7 = icmp slt i32 %138, %cond99
%add113.7 = select i1 %cmp107.7, i32 512, i32 0
%ans.1.7 = add nuw nsw i32 %add113.7, %ans.1.6
%c.1.7 = select i1 %cmp107.7, i32 %138, i32 %c.1.6
%idxprom105.8 = sext i32 %c.1.7 to i64
%arrayidx106.8 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 8, i64 %idxprom105.8
%139 = load i32, ptr %arrayidx106.8, align 4, !tbaa !5
%cmp107.8 = icmp slt i32 %139, %cond99
%add113.8 = select i1 %cmp107.8, i32 256, i32 0
%ans.1.8 = add nuw nsw i32 %add113.8, %ans.1.7
%c.1.8 = select i1 %cmp107.8, i32 %139, i32 %c.1.7
%idxprom105.9 = sext i32 %c.1.8 to i64
%arrayidx106.9 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 7, i64 %idxprom105.9
%140 = load i32, ptr %arrayidx106.9, align 4, !tbaa !5
%cmp107.9 = icmp slt i32 %140, %cond99
%add113.9 = select i1 %cmp107.9, i32 128, i32 0
%ans.1.9 = add nuw nsw i32 %add113.9, %ans.1.8
%c.1.9 = select i1 %cmp107.9, i32 %140, i32 %c.1.8
%idxprom105.10 = sext i32 %c.1.9 to i64
%arrayidx106.10 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 6, i64 %idxprom105.10
%141 = load i32, ptr %arrayidx106.10, align 4, !tbaa !5
%cmp107.10 = icmp slt i32 %141, %cond99
%add113.10 = select i1 %cmp107.10, i32 64, i32 0
%ans.1.10 = add nuw nsw i32 %add113.10, %ans.1.9
%c.1.10 = select i1 %cmp107.10, i32 %141, i32 %c.1.9
%idxprom105.11 = sext i32 %c.1.10 to i64
%arrayidx106.11 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 5, i64 %idxprom105.11
%142 = load i32, ptr %arrayidx106.11, align 4, !tbaa !5
%cmp107.11 = icmp slt i32 %142, %cond99
%add113.11 = select i1 %cmp107.11, i32 32, i32 0
%ans.1.11 = add nuw nsw i32 %add113.11, %ans.1.10
%c.1.11 = select i1 %cmp107.11, i32 %142, i32 %c.1.10
%idxprom105.12 = sext i32 %c.1.11 to i64
%arrayidx106.12 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 4, i64 %idxprom105.12
%143 = load i32, ptr %arrayidx106.12, align 4, !tbaa !5
%cmp107.12 = icmp slt i32 %143, %cond99
%add113.12 = select i1 %cmp107.12, i32 16, i32 0
%ans.1.12 = add nuw nsw i32 %add113.12, %ans.1.11
%c.1.12 = select i1 %cmp107.12, i32 %143, i32 %c.1.11
%idxprom105.13 = sext i32 %c.1.12 to i64
%arrayidx106.13 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 3, i64 %idxprom105.13
%144 = load i32, ptr %arrayidx106.13, align 4, !tbaa !5
%cmp107.13 = icmp slt i32 %144, %cond99
%add113.13 = select i1 %cmp107.13, i32 8, i32 0
%ans.1.13 = add nuw nsw i32 %add113.13, %ans.1.12
%c.1.13 = select i1 %cmp107.13, i32 %144, i32 %c.1.12
%idxprom105.14 = sext i32 %c.1.13 to i64
%arrayidx106.14 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 2, i64 %idxprom105.14
%145 = load i32, ptr %arrayidx106.14, align 4, !tbaa !5
%cmp107.14 = icmp slt i32 %145, %cond99
%add113.14 = select i1 %cmp107.14, i32 4, i32 0
%ans.1.14 = add nuw nsw i32 %add113.14, %ans.1.13
%c.1.14 = select i1 %cmp107.14, i32 %145, i32 %c.1.13
%idxprom105.15 = sext i32 %c.1.14 to i64
%arrayidx106.15 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 1, i64 %idxprom105.15
%146 = load i32, ptr %arrayidx106.15, align 4, !tbaa !5
%cmp107.15 = icmp slt i32 %146, %cond99
%add113.15 = select i1 %cmp107.15, i32 2, i32 0
%ans.1.15 = add nuw nsw i32 %add113.15, %ans.1.14
%c.1.15 = select i1 %cmp107.15, i32 %146, i32 %c.1.14
%idxprom105.16 = sext i32 %c.1.15 to i64
%arrayidx106.16 = getelementptr inbounds [17 x [100000 x i32]], ptr @x_go_max, i64 0, i64 0, i64 %idxprom105.16
%147 = load i32, ptr %arrayidx106.16, align 4, !tbaa !5
%cmp107.16 = icmp slt i32 %147, %cond99
%add113.16 = zext i1 %cmp107.16 to i32
%ans.1.16 = add nuw nsw i32 %ans.1.15, %add113.16
%add118 = add nuw nsw i32 %ans.1.16, 1
%call119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add118)
%indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1
%148 = load i32, ptr %q, align 4, !tbaa !5
%149 = sext i32 %148 to i64
%cmp76 = icmp slt i64 %indvars.iv.next218, %149
br i1 %cmp76, label %for.body77, label %for.end122, !llvm.loop !15
for.end122: ; preds = %for.body77, %for.cond75.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void){
int a, b, h;
scanf("%d%d%d", &a, &b, &h);
printf("%d", (a + b) * h / 2);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188572/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188572/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; 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
%h = 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 %h) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,h,x;
scanf("%d %d %d", &a, &b ,&h);
x = ((a+b)*h)/2 ;
printf("%d\n",x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188622/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188622/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%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
%h = 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 %h) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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;
scanf("%d %d %d",&a,&b,&c);
d=(a+b)*c/2;
printf("%d",d);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188666/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188666/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a, b, h;
scanf("%d%d%d", &a, &b, &h);
printf("%d",(a+b)*h/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188709/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188709/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; 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
%h = 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 %h) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, char const *argv[]) {
int a,b,h;
scanf("%d",&a );//上底
scanf("%d",&b );//下低
scanf("%d",&h );//高さ
printf("%d\n", (a+b) * h / 2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188752/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188752/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%h = 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 %h) #3
%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 %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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,h;
scanf("%d %d %d",&a,&b,&h);
printf("%d\n",(a+b)*h/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188802/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188802/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%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
%h = 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 %h) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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>
#include <stdlib.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d\n",((a+b)*c)/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188853/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188853/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 i,h,a,b,k,l,m,N,K,j,v,g,flag,sum;
scanf("%d%d%d",&a,&b,&h);
sum=(a+b)*(h/2);
printf("%d",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188903/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188903/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%div = sdiv i32 %2, 2
%mul = mul nsw i32 %div, %add
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(void){
int a,b,h;
scanf("%d%d%d",&a,&b,&h);
printf("%d\n",(a+b)*h/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188954/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188954/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%h = 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 %h) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %h)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %h, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #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 jou,ka,takasa,men;
scanf("%d %d %d",&jou,&ka,&takasa);
men=(jou+ka)*takasa/2;
printf("%d\n",men);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_188998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_188998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%jou = alloca i32, align 4
%ka = alloca i32, align 4
%takasa = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %jou) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ka) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %takasa) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %jou, ptr noundef nonnull %ka, ptr noundef nonnull %takasa)
%0 = load i32, ptr %jou, align 4, !tbaa !5
%1 = load i32, ptr %ka, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %takasa, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%div = sdiv i32 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %takasa) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ka) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %jou) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#define PUZZLE_SIZE 3
#define DIRECTION_SIZE 4
#define RESOLVED_PUZZLE_KEY 123456780
#define DEFAULT_QUEUE_SIZE 16
typedef enum { UP, DOWN, RIGHT, LEFT } direction_t;
typedef struct { int row, col; } cell_t;
typedef struct { int cnt, size, key, **p; cell_t zero; } state_t;
typedef struct { int head, tail, size, max; state_t **arr; } queue_t;
typedef struct Node { int bf, x; struct Node *p, *l, *r; } node_t;
static queue_t *new_queue(int);
static void free_queue(queue_t *);
static void enqueue(queue_t *, state_t *);
static state_t *dequeue(queue_t *);
static node_t *new_node(int);
static void free_node(node_t *);
static void insert_node(node_t *, node_t *);
static node_t *find_node(node_t *, int);
static node_t *rotate_left(node_t *);
static node_t *rotate_right(node_t *);
static node_t *rebalance(node_t *);
static state_t *new_state(int);
static state_t *copy_state(const state_t *);
static void free_state(state_t *);
static int advance_state(state_t *, direction_t);
static void update_state_key(state_t *);
static queue_t *new_queue(int size) {
queue_t *q;
int i;
q = (queue_t *) malloc(sizeof(queue_t));
q->head = q->tail = q->size = 0;
q->max = size;
q->arr = (state_t **) malloc(sizeof(state_t *) * q->max);
for (i = 0; i < q->max; ++i) q->arr[i] = NULL;
return q;
}
static void free_queue(queue_t *q) {
while (q->head < q->tail) {
free_state(q->arr[q->head]);
q->head = (q->head + 1) % q->max;
}
free(q->arr);
free(q);
}
static void enqueue(queue_t *q, state_t *s) {
int i, range, expanded;
q->size++;
if (q->size == q->max) {
range = q->max - q->head;
expanded = q->max;
q->max *= 2;
q->arr = (state_t **) realloc(q->arr, sizeof(state_t *) * q->max);
if (q->head > q->tail) {
for (i = q->max - 1; i >= q->tail; --i) q->arr[i] = (i >= q->max - range) ? q->arr[i - expanded] : NULL;
q->head = q->max - range;
}
}
q->arr[q->tail] = s;
q->tail = (q->tail + 1) % q->max;
}
static state_t *dequeue(queue_t *q) {
state_t *s;
if (q->size == 0) return NULL;
s = q->arr[q->head];
q->arr[q->head] = NULL;
q->head = (q->head + 1) % q->max;
q->size--;
return s;
}
static node_t *new_node(int x) {
node_t *n;
n = (node_t *) malloc(sizeof(node_t));
n->p = n->l = n->r = NULL;
n->x = x;
n->bf = 1;
return n;
}
static void free_node(node_t *n) {
if (n == NULL) return;
free_node(n->l);
free_node(n->r);
free(n);
}
static void insert_node(node_t *r, node_t *n) {
if (n->x < r->x) {
if (r->l == NULL) {
r->l = n;
n->p = r;
} else {
insert_node(r->l, n);
}
} else if (n->x > r->x) {
if (r->r == NULL) {
r->r = n;
n->p = r;
} else {
insert_node(r->r, n);
}
}
}
static node_t *find_node(node_t *n, int x) {
node_t *ret;
if (n == NULL) {
ret = NULL;
} else if (x == n->x) {
ret = n;
} else if (x < n->x) {
ret = find_node(n->l, x);
} else if (x > n->x) {
ret = find_node(n->r, x);
} else {
ret = NULL;
}
return ret;
}
static node_t *rotate_left(node_t *n) {
node_t *p, *r;
if (n == NULL) return n;
p = n->p;
r = n->r;
if (p != NULL) {
if (p->x > r->x) {
p->l = r;
} else {
p->r = r;
}
}
n->p = r;
n->r = r->l;
n->bf = r->bf - 1;
r->p = p;
r->l = n;
return r;
}
static node_t *rotate_right(node_t *n) {
node_t *p, *l;
if (n == NULL) return n;
p = n->p;
l = n->l;
if (p != NULL) {
if (p->x > l->x) {
p->l = l;
} else {
p->r = l;
}
}
n->p = l;
n->l = l->r;
n->bf = l->bf - 1;
l->p = p;
l->r = n;
return l;
}
static node_t *rebalance(node_t *n) {
int l, r;
if (n == NULL) return n;
l = n->l == NULL ? 0 : n->l->bf;
r = n->r == NULL ? 0 : n->r->bf;
n->bf = (l > r ? l : r) + 1;
if ((l - r < 0 ? (l - r) * -1 : l - r) > 1) {
if (l < r) {
n = rotate_left(n);
} else {
n = rotate_right(n);
}
}
return n->p ? rebalance(n->p) : n;
}
static state_t *new_state(int size) {
state_t *s;
int i;
s = (state_t *) malloc(sizeof(state_t));
s->size = size;
s->cnt = s->zero.row = s->zero.col = s->key = 0;
s->p = (int **) malloc(sizeof(int *) * s->size);
for (i = 0; i < s->size; ++i) s->p[i] = (int *) malloc(sizeof(int) * s->size);
return s;
}
static state_t *copy_state(const state_t *src) {
state_t *dest;
int i, j;
dest = new_state(src->size);
dest->cnt = src->cnt;
dest->zero = src->zero;
dest->key = src->key;
for (i = 0; i < dest->size; ++i) {
for (j = 0; j < dest->size; ++j) dest->p[i][j] = src->p[i][j];
}
return dest;
}
static void free_state(state_t *s) {
int i;
for (i = 0; i < s->size; ++i) free(s->p[i]);
free(s->p);
free(s);
}
static int advance_state(state_t *s, direction_t d) {
switch (d) {
case UP:
if (s->zero.row + 1 == s->size) return 1;
s->p[s->zero.row][s->zero.col] = s->p[s->zero.row + 1][s->zero.col];
s->zero.row++;
break;
case DOWN:
if (s->zero.row - 1 < 0) return 1;
s->p[s->zero.row][s->zero.col] = s->p[s->zero.row - 1][s->zero.col];
s->zero.row--;
break;
case RIGHT:
if (s->zero.col - 1 < 0) return 1;
s->p[s->zero.row][s->zero.col] = s->p[s->zero.row][s->zero.col - 1];
s->zero.col--;
break;
case LEFT:
if (s->zero.col + 1 == s->size) return 1;
s->p[s->zero.row][s->zero.col] = s->p[s->zero.row][s->zero.col + 1];
s->zero.col++;
break;
}
s->p[s->zero.row][s->zero.col] = 0;
update_state_key(s);
s->cnt++;
return 0;
}
static void update_state_key(state_t *s) {
int i, j, d;
for (i = 0, d = 1; i < (s->size * s->size - 1); ++i, d *= 10) {}
for (i = s->key = 0; i < s->size; ++i) {
for (j = 0; j < s->size; ++j, d /= 10) {
s->key += s->p[i][j] * d;
}
}
}
static int eight_puzzle(const state_t *s) {
direction_t d[DIRECTION_SIZE] = {UP, DOWN, RIGHT, LEFT};
state_t *s1, *s2;
node_t *root, *node;
queue_t *q;
int cnt, fail, i;
cnt = -1;
q = new_queue(DEFAULT_QUEUE_SIZE);
s1 = copy_state(s);
enqueue(q, s1);
root = new_node(s1->key);
// BFS
while (q->size > 0) {
s1 = dequeue(q);
if (s1 == NULL) break; // unsolvable or bug
if (s1->key == RESOLVED_PUZZLE_KEY) {
cnt = s1->cnt;
free_state(s1);
break;
}
for (i = 0; i < DIRECTION_SIZE; ++i) {
s2 = copy_state(s1);
fail = advance_state(s2, d[i]);
node = find_node(root, s2->key);
if (fail || node) {
free_state(s2);
continue;
}
enqueue(q, s2);
node = new_node(s2->key);
insert_node(root, node);
root = rebalance(root);
}
free_state(s1);
}
free_queue(q);
free_node(root);
return cnt;
}
int main(int argc, char **argv) {
state_t *s;
int i, j;
for (i = 0, s = new_state(PUZZLE_SIZE); i < s->size; ++i) {
for (j = 0; j < s->size; ++j) {
scanf("%d", &s->p[i][j]);
if (s->p[i][j] == 0) {
s->zero.row = i;
s->zero.col = j;
}
}
}
update_state_key(s);
printf("%d\n", eight_puzzle(s));
free_state(s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189090/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189090/source.c"
target datalayout = "e-m:e-p270: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.state_t = type { i32, i32, i32, ptr, %struct.cell_t }
%struct.cell_t = type { i32, i32 }
%struct.queue_t = type { i32, i32, i32, i32, ptr }
%struct.Node = type { i32, i32, ptr, ptr, ptr }
@.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
@__const.eight_puzzle.d = private unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 2, i32 3], align 16
; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%call.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%size1.i = getelementptr inbounds %struct.state_t, ptr %call.i, i64 0, i32 1
store i32 3, ptr %size1.i, align 4, !tbaa !5
%key.i = getelementptr inbounds %struct.state_t, ptr %call.i, i64 0, i32 2
store i32 0, ptr %key.i, align 8, !tbaa !12
%zero.i = getelementptr inbounds %struct.state_t, ptr %call.i, i64 0, i32 4
%col.i = getelementptr inbounds %struct.state_t, ptr %call.i, i64 0, i32 4, i32 1
store i32 0, ptr %col.i, align 4, !tbaa !13
store i32 0, ptr %zero.i, align 8, !tbaa !14
store i32 0, ptr %call.i, align 8, !tbaa !15
%call4.i = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #8
%p.i = getelementptr inbounds %struct.state_t, ptr %call.i, i64 0, i32 3
store ptr %call4.i, ptr %p.i, align 8, !tbaa !16
%call10.i = tail call noalias dereferenceable_or_null(12) ptr @malloc(i64 noundef 12) #8
store ptr %call10.i, ptr %call4.i, align 8, !tbaa !17
%call10.i.1 = tail call noalias dereferenceable_or_null(12) ptr @malloc(i64 noundef 12) #8
%arrayidx.i.1 = getelementptr inbounds ptr, ptr %call4.i, i64 1
store ptr %call10.i.1, ptr %arrayidx.i.1, align 8, !tbaa !17
%call10.i.2 = tail call noalias dereferenceable_or_null(12) ptr @malloc(i64 noundef 12) #8
%arrayidx.i.2 = getelementptr inbounds ptr, ptr %call4.i, i64 2
store ptr %call10.i.2, ptr %arrayidx.i.2, align 8, !tbaa !17
%call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %call10.i)
%0 = load ptr, ptr %call4.i, align 8, !tbaa !17
%1 = load i32, ptr %0, align 4, !tbaa !18
%cmp13 = icmp eq i32 %1, 0
br i1 %cmp13, label %if.then, label %for.inc
if.then: ; preds = %entry
store i32 0, ptr %zero.i, align 8, !tbaa !14
store i32 0, ptr %col.i, align 4, !tbaa !13
br label %for.inc
for.inc: ; preds = %entry, %if.then
%arrayidx6.1 = getelementptr inbounds i32, ptr %0, i64 1
%call7.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1)
%2 = load ptr, ptr %call4.i, align 8, !tbaa !17
%arrayidx12.1 = getelementptr inbounds i32, ptr %2, i64 1
%3 = load i32, ptr %arrayidx12.1, align 4, !tbaa !18
%cmp13.1 = icmp eq i32 %3, 0
br i1 %cmp13.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 0, ptr %zero.i, align 8, !tbaa !14
store i32 1, ptr %col.i, align 4, !tbaa !13
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx6.2 = getelementptr inbounds i32, ptr %2, i64 2
%call7.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2)
%4 = load ptr, ptr %call4.i, align 8, !tbaa !17
%arrayidx12.2 = getelementptr inbounds i32, ptr %4, i64 2
%5 = load i32, ptr %arrayidx12.2, align 4, !tbaa !18
%cmp13.2 = icmp eq i32 %5, 0
br i1 %cmp13.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i32 0, ptr %zero.i, align 8, !tbaa !14
store i32 2, ptr %col.i, align 4, !tbaa !13
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%6 = load ptr, ptr %arrayidx.i.1, align 8, !tbaa !17
%call7.1105 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %6)
%7 = load ptr, ptr %arrayidx.i.1, align 8, !tbaa !17
%8 = load i32, ptr %7, align 4, !tbaa !18
%cmp13.1106 = icmp eq i32 %8, 0
br i1 %cmp13.1106, label %if.then.1107, label %for.inc.1108
if.then.1107: ; preds = %for.inc.2
store i32 1, ptr %zero.i, align 8, !tbaa !14
store i32 0, ptr %col.i, align 4, !tbaa !13
br label %for.inc.1108
for.inc.1108: ; preds = %if.then.1107, %for.inc.2
%arrayidx6.1.1 = getelementptr inbounds i32, ptr %7, i64 1
%call7.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.1)
%9 = load ptr, ptr %arrayidx.i.1, align 8, !tbaa !17
%arrayidx12.1.1 = getelementptr inbounds i32, ptr %9, i64 1
%10 = load i32, ptr %arrayidx12.1.1, align 4, !tbaa !18
%cmp13.1.1 = icmp eq i32 %10, 0
br i1 %cmp13.1.1, label %if.then.1.1, label %for.inc.1.1
if.then.1.1: ; preds = %for.inc.1108
store i32 1, ptr %zero.i, align 8, !tbaa !14
store i32 1, ptr %col.i, align 4, !tbaa !13
br label %for.inc.1.1
for.inc.1.1: ; preds = %if.then.1.1, %for.inc.1108
%arrayidx6.2.1 = getelementptr inbounds i32, ptr %9, i64 2
%call7.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.1)
%11 = load ptr, ptr %arrayidx.i.1, align 8, !tbaa !17
%arrayidx12.2.1 = getelementptr inbounds i32, ptr %11, i64 2
%12 = load i32, ptr %arrayidx12.2.1, align 4, !tbaa !18
%cmp13.2.1 = icmp eq i32 %12, 0
br i1 %cmp13.2.1, label %if.then.2.1, label %for.inc.2.1
if.then.2.1: ; preds = %for.inc.1.1
store i32 1, ptr %zero.i, align 8, !tbaa !14
store i32 2, ptr %col.i, align 4, !tbaa !13
br label %for.inc.2.1
for.inc.2.1: ; preds = %if.then.2.1, %for.inc.1.1
%13 = load ptr, ptr %arrayidx.i.2, align 8, !tbaa !17
%call7.2109 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %13)
%14 = load ptr, ptr %arrayidx.i.2, align 8, !tbaa !17
%15 = load i32, ptr %14, align 4, !tbaa !18
%cmp13.2110 = icmp eq i32 %15, 0
br i1 %cmp13.2110, label %if.then.2111, label %for.inc.2112
if.then.2111: ; preds = %for.inc.2.1
store i32 2, ptr %zero.i, align 8, !tbaa !14
store i32 0, ptr %col.i, align 4, !tbaa !13
br label %for.inc.2112
for.inc.2112: ; preds = %if.then.2111, %for.inc.2.1
%arrayidx6.1.2 = getelementptr inbounds i32, ptr %14, i64 1
%call7.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.2)
%16 = load ptr, ptr %arrayidx.i.2, align 8, !tbaa !17
%arrayidx12.1.2 = getelementptr inbounds i32, ptr %16, i64 1
%17 = load i32, ptr %arrayidx12.1.2, align 4, !tbaa !18
%cmp13.1.2 = icmp eq i32 %17, 0
br i1 %cmp13.1.2, label %if.then.1.2, label %for.inc.1.2
if.then.1.2: ; preds = %for.inc.2112
store i32 2, ptr %zero.i, align 8, !tbaa !14
store i32 1, ptr %col.i, align 4, !tbaa !13
br label %for.inc.1.2
for.inc.1.2: ; preds = %if.then.1.2, %for.inc.2112
%arrayidx6.2.2 = getelementptr inbounds i32, ptr %16, i64 2
%call7.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.2)
%18 = load ptr, ptr %arrayidx.i.2, align 8, !tbaa !17
%arrayidx12.2.2 = getelementptr inbounds i32, ptr %18, i64 2
%19 = load i32, ptr %arrayidx12.2.2, align 4, !tbaa !18
%cmp13.2.2 = icmp eq i32 %19, 0
br i1 %cmp13.2.2, label %if.then.2.2, label %for.inc.2.2
if.then.2.2: ; preds = %for.inc.1.2
store i32 2, ptr %zero.i, align 8, !tbaa !14
store i32 2, ptr %col.i, align 4, !tbaa !13
br label %for.inc.2.2
for.inc.2.2: ; preds = %if.then.2.2, %for.inc.1.2
%20 = load ptr, ptr %call4.i, align 8, !tbaa !17
%21 = load i32, ptr %20, align 4, !tbaa !18
%mul13.us.i = mul nsw i32 %21, 100000000
%arrayidx12.us.i.1 = getelementptr inbounds i32, ptr %20, i64 1
%22 = load i32, ptr %arrayidx12.us.i.1, align 4, !tbaa !18
%mul13.us.i.1 = mul nsw i32 %22, 10000000
%add.us.i.1 = add nsw i32 %mul13.us.i.1, %mul13.us.i
%arrayidx12.us.i.2 = getelementptr inbounds i32, ptr %20, i64 2
%23 = load i32, ptr %arrayidx12.us.i.2, align 4, !tbaa !18
%mul13.us.i.2 = mul nsw i32 %23, 1000000
%add.us.i.2 = add nsw i32 %mul13.us.i.2, %add.us.i.1
%24 = load ptr, ptr %arrayidx.i.1, align 8, !tbaa !17
%25 = load i32, ptr %24, align 4, !tbaa !18
%mul13.us.i.1113 = mul nsw i32 %25, 100000
%add.us.i.1114 = add nsw i32 %mul13.us.i.1113, %add.us.i.2
%arrayidx12.us.i.1.1 = getelementptr inbounds i32, ptr %24, i64 1
%26 = load i32, ptr %arrayidx12.us.i.1.1, align 4, !tbaa !18
%mul13.us.i.1.1 = mul nsw i32 %26, 10000
%add.us.i.1.1 = add nsw i32 %mul13.us.i.1.1, %add.us.i.1114
%arrayidx12.us.i.2.1 = getelementptr inbounds i32, ptr %24, i64 2
%27 = load i32, ptr %arrayidx12.us.i.2.1, align 4, !tbaa !18
%mul13.us.i.2.1 = mul nsw i32 %27, 1000
%add.us.i.2.1 = add nsw i32 %mul13.us.i.2.1, %add.us.i.1.1
%28 = load i32, ptr %18, align 4, !tbaa !18
%mul13.us.i.2116 = mul nsw i32 %28, 100
%add.us.i.2117 = add nsw i32 %mul13.us.i.2116, %add.us.i.2.1
%arrayidx12.us.i.1.2 = getelementptr inbounds i32, ptr %18, i64 1
%29 = load i32, ptr %arrayidx12.us.i.1.2, align 4, !tbaa !18
%mul13.us.i.1.2 = mul nsw i32 %29, 10
%add.us.i.1.2 = add nsw i32 %mul13.us.i.1.2, %add.us.i.2117
%add.us.i.2.2 = add nsw i32 %19, %add.us.i.1.2
store i32 %add.us.i.2.2, ptr %key.i, align 8, !tbaa !12
%call.i.i = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #8
%size1.i.i = getelementptr inbounds %struct.queue_t, ptr %call.i.i, i64 0, i32 2
%max.i.i = getelementptr inbounds %struct.queue_t, ptr %call.i.i, i64 0, i32 3
%calloc.i.i = tail call dereferenceable_or_null(128) ptr @calloc(i64 1, i64 128)
%arr.i.i = getelementptr inbounds %struct.queue_t, ptr %call.i.i, i64 0, i32 4
store ptr %calloc.i.i, ptr %arr.i.i, align 8, !tbaa !19
%call.i.i.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%size1.i.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i.i, i64 0, i32 1
store i32 3, ptr %size1.i.i.i, align 4, !tbaa !5
%key.i.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i.i, i64 0, i32 2
%call4.i.i.i = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #8
%p.i.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i.i, i64 0, i32 3
store ptr %call4.i.i.i, ptr %p.i.i.i, align 8, !tbaa !16
%call10.i.i.i = tail call noalias dereferenceable_or_null(12) ptr @malloc(i64 noundef 12) #8
store ptr %call10.i.i.i, ptr %call4.i.i.i, align 8, !tbaa !17
%call10.i.i.i.1 = tail call noalias dereferenceable_or_null(12) ptr @malloc(i64 noundef 12) #8
%arrayidx.i.i.i.1 = getelementptr inbounds ptr, ptr %call4.i.i.i, i64 1
store ptr %call10.i.i.i.1, ptr %arrayidx.i.i.i.1, align 8, !tbaa !17
%call10.i.i.i.2 = tail call noalias dereferenceable_or_null(12) ptr @malloc(i64 noundef 12) #8
%arrayidx.i.i.i.2 = getelementptr inbounds ptr, ptr %call4.i.i.i, i64 2
store ptr %call10.i.i.i.2, ptr %arrayidx.i.i.i.2, align 8, !tbaa !17
%zero.i.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i.i, i64 0, i32 4
store i32 0, ptr %call.i.i.i, align 8, !tbaa !15
%30 = load i64, ptr %zero.i, align 8
store i64 %30, ptr %zero.i.i.i, align 8
store i32 %add.us.i.2.2, ptr %key.i.i.i, align 8, !tbaa !12
%31 = load i32, ptr %20, align 4, !tbaa !18
store i32 %31, ptr %call10.i.i.i, align 4, !tbaa !18
%32 = load i32, ptr %arrayidx12.us.i.1, align 4, !tbaa !18
%arrayidx15.us.i.i.1 = getelementptr inbounds i32, ptr %call10.i.i.i, i64 1
store i32 %32, ptr %arrayidx15.us.i.i.1, align 4, !tbaa !18
%33 = load i32, ptr %arrayidx12.us.i.2, align 4, !tbaa !18
%arrayidx15.us.i.i.2 = getelementptr inbounds i32, ptr %call10.i.i.i, i64 2
store i32 %33, ptr %arrayidx15.us.i.i.2, align 4, !tbaa !18
%34 = load i32, ptr %24, align 4, !tbaa !18
store i32 %34, ptr %call10.i.i.i.1, align 4, !tbaa !18
%35 = load i32, ptr %arrayidx12.us.i.1.1, align 4, !tbaa !18
%arrayidx15.us.i.i.1.1 = getelementptr inbounds i32, ptr %call10.i.i.i.1, i64 1
store i32 %35, ptr %arrayidx15.us.i.i.1.1, align 4, !tbaa !18
%36 = load i32, ptr %arrayidx12.us.i.2.1, align 4, !tbaa !18
%arrayidx15.us.i.i.2.1 = getelementptr inbounds i32, ptr %call10.i.i.i.1, i64 2
store i32 %36, ptr %arrayidx15.us.i.i.2.1, align 4, !tbaa !18
%37 = load i32, ptr %18, align 4, !tbaa !18
store i32 %37, ptr %call10.i.i.i.2, align 4, !tbaa !18
%38 = load i32, ptr %arrayidx12.us.i.1.2, align 4, !tbaa !18
%arrayidx15.us.i.i.1.2 = getelementptr inbounds i32, ptr %call10.i.i.i.2, i64 1
store i32 %38, ptr %arrayidx15.us.i.i.1.2, align 4, !tbaa !18
%39 = load i32, ptr %arrayidx12.2.2, align 4, !tbaa !18
%arrayidx15.us.i.i.2.2 = getelementptr inbounds i32, ptr %call10.i.i.i.2, i64 2
store i32 %39, ptr %arrayidx15.us.i.i.2.2, align 4, !tbaa !18
%tail.i.i = getelementptr inbounds %struct.queue_t, ptr %call.i.i, i64 0, i32 1
store ptr %call.i.i.i, ptr %calloc.i.i, align 8, !tbaa !17
store <4 x i32> <i32 0, i32 1, i32 1, i32 16>, ptr %call.i.i, align 8, !tbaa !18
%call.i49.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%p.i50.i = getelementptr inbounds %struct.Node, ptr %call.i49.i, i64 0, i32 2
%x1.i.i = getelementptr inbounds %struct.Node, ptr %call.i49.i, i64 0, i32 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %p.i50.i, i8 0, i64 24, i1 false)
store i32 %add.us.i.2.2, ptr %x1.i.i, align 4, !tbaa !21
store i32 1, ptr %call.i49.i, align 8, !tbaa !23
br label %dequeue.exit.i
dequeue.exit.i: ; preds = %free_state.exit215.i, %for.inc.2.2
%.pre71.i148281.i = phi i32 [ 1, %for.inc.2.2 ], [ %.pre71.i148283.i, %free_state.exit215.i ]
%40 = phi i32 [ 16, %for.inc.2.2 ], [ %165, %free_state.exit215.i ]
%sub18.i167255.i = phi i32 [ 0, %for.inc.2.2 ], [ %sub18.i167253.i, %free_state.exit215.i ]
%root.0248.i = phi ptr [ %call.i49.i, %for.inc.2.2 ], [ %root.2.i, %free_state.exit215.i ]
%41 = phi i32 [ 1, %for.inc.2.2 ], [ %166, %free_state.exit215.i ]
%42 = load ptr, ptr %arr.i.i, align 8, !tbaa !19
%idxprom.i.i = sext i32 %sub18.i167255.i to i64
%arrayidx.i54.i = getelementptr inbounds ptr, ptr %42, i64 %idxprom.i.i
%43 = load ptr, ptr %arrayidx.i54.i, align 8, !tbaa !17
store ptr null, ptr %arrayidx.i54.i, align 8, !tbaa !17
%add.i55.i = add nsw i32 %sub18.i167255.i, 1
%rem.i57.i = srem i32 %add.i55.i, %40
%dec.i.i = add nsw i32 %41, -1
%cmp4.i = icmp eq ptr %43, null
br i1 %cmp4.i, label %dequeue.exit.while.end.loopexit_crit_edge.i, label %if.end.i
if.end.i: ; preds = %dequeue.exit.i
%key5.i = getelementptr inbounds %struct.state_t, ptr %43, i64 0, i32 2
%44 = load i32, ptr %key5.i, align 8, !tbaa !12
%cmp6.i = icmp eq i32 %44, 123456780
br i1 %cmp6.i, label %if.then7.i, label %for.cond.preheader.i
for.cond.preheader.i: ; preds = %if.end.i
%size.i67.i = getelementptr inbounds %struct.state_t, ptr %43, i64 0, i32 1
%zero245.i78.i = getelementptr inbounds %struct.state_t, ptr %43, i64 0, i32 4
%p.i93.i = getelementptr inbounds %struct.state_t, ptr %43, i64 0, i32 3
br label %for.body.i41
if.then7.i: ; preds = %if.end.i
store i32 %rem.i57.i, ptr %call.i.i, align 8, !tbaa !24
store i32 %40, ptr %max.i.i, align 4, !tbaa !25
store i32 %dec.i.i, ptr %size1.i.i, align 8, !tbaa !26
%45 = load i32, ptr %43, align 8, !tbaa !15
%size.i58.i = getelementptr inbounds %struct.state_t, ptr %43, i64 0, i32 1
%46 = load i32, ptr %size.i58.i, align 4, !tbaa !5
%cmp7.i.i = icmp sgt i32 %46, 0
br i1 %cmp7.i.i, label %for.body.lr.ph.i60.i, label %free_state.exit.i
for.body.lr.ph.i60.i: ; preds = %if.then7.i
%p.i61.i = getelementptr inbounds %struct.state_t, ptr %43, i64 0, i32 3
br label %for.body.i62.i
for.body.i62.i: ; preds = %for.body.i62.i, %for.body.lr.ph.i60.i
%indvars.iv.i63.i = phi i64 [ 0, %for.body.lr.ph.i60.i ], [ %indvars.iv.next.i65.i, %for.body.i62.i ]
%47 = load ptr, ptr %p.i61.i, align 8, !tbaa !16
%arrayidx.i64.i = getelementptr inbounds ptr, ptr %47, i64 %indvars.iv.i63.i
%48 = load ptr, ptr %arrayidx.i64.i, align 8, !tbaa !17
tail call void @free(ptr noundef %48) #9
%indvars.iv.next.i65.i = add nuw nsw i64 %indvars.iv.i63.i, 1
%49 = load i32, ptr %size.i58.i, align 4, !tbaa !5
%50 = sext i32 %49 to i64
%cmp.i66.i = icmp slt i64 %indvars.iv.next.i65.i, %50
br i1 %cmp.i66.i, label %for.body.i62.i, label %free_state.exit.i, !llvm.loop !27
free_state.exit.i: ; preds = %for.body.i62.i, %if.then7.i
%p1.i.i = getelementptr inbounds %struct.state_t, ptr %43, i64 0, i32 3
%51 = load ptr, ptr %p1.i.i, align 8, !tbaa !16
tail call void @free(ptr noundef %51) #9
tail call void @free(ptr noundef nonnull %43) #9
br label %while.end.i
for.body.i41: ; preds = %for.inc.i44, %for.cond.preheader.i
%52 = phi i32 [ %.pre71.i148281.i, %for.cond.preheader.i ], [ %.pre71.i148283.i, %for.inc.i44 ]
%indvars.iv.i42 = phi i64 [ 0, %for.cond.preheader.i ], [ %indvars.iv.next.i45, %for.inc.i44 ]
%53 = phi i32 [ %40, %for.cond.preheader.i ], [ %165, %for.inc.i44 ]
%sub18.i167252.i = phi i32 [ %rem.i57.i, %for.cond.preheader.i ], [ %sub18.i167253.i, %for.inc.i44 ]
%54 = phi i32 [ %dec.i.i, %for.cond.preheader.i ], [ %166, %for.inc.i44 ]
%root.1243.i = phi ptr [ %root.0248.i, %for.cond.preheader.i ], [ %root.2.i, %for.inc.i44 ]
%55 = load i32, ptr %size.i67.i, align 4, !tbaa !5
%call.i.i68.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%size1.i.i69.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 1
store i32 %55, ptr %size1.i.i69.i, align 4, !tbaa !5
%key.i.i70.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 2
%zero.i.i71.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 4
%conv.i.i72.i = sext i32 %55 to i64
%mul.i.i73.i = shl nsw i64 %conv.i.i72.i, 3
%call4.i.i74.i = tail call noalias ptr @malloc(i64 noundef %mul.i.i73.i) #8
%p.i.i75.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 3
store ptr %call4.i.i74.i, ptr %p.i.i75.i, align 8, !tbaa !16
%cmp24.i.i76.i = icmp sgt i32 %55, 0
br i1 %cmp24.i.i76.i, label %for.body.lr.ph.i.i80.i, label %new_state.exit.thread.i77.i
new_state.exit.thread.i77.i: ; preds = %for.body.i41
%56 = load i32, ptr %43, align 8, !tbaa !15
store i32 %56, ptr %call.i.i68.i, align 8, !tbaa !15
%57 = load i64, ptr %zero245.i78.i, align 8
store i64 %57, ptr %zero.i.i71.i, align 8
%58 = load i32, ptr %key5.i, align 8, !tbaa !12
store i32 %58, ptr %key.i.i70.i, align 8, !tbaa !12
br label %copy_state.exit108.i
for.body.lr.ph.i.i80.i: ; preds = %for.body.i41
%mul9.i.i81.i = shl nsw i64 %conv.i.i72.i, 2
%wide.trip.count.i.i82.i = zext i32 %55 to i64
br label %for.body.i.i83.i
for.body.i.i83.i: ; preds = %for.body.i.i83.i, %for.body.lr.ph.i.i80.i
%indvars.iv.i.i84.i = phi i64 [ 0, %for.body.lr.ph.i.i80.i ], [ %indvars.iv.next.i.i87.i, %for.body.i.i83.i ]
%call10.i.i85.i = tail call noalias ptr @malloc(i64 noundef %mul9.i.i81.i) #8
%arrayidx.i.i86.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %indvars.iv.i.i84.i
store ptr %call10.i.i85.i, ptr %arrayidx.i.i86.i, align 8, !tbaa !17
%indvars.iv.next.i.i87.i = add nuw nsw i64 %indvars.iv.i.i84.i, 1
%exitcond.not.i.i88.i = icmp eq i64 %indvars.iv.next.i.i87.i, %wide.trip.count.i.i82.i
br i1 %exitcond.not.i.i88.i, label %for.cond5.preheader.lr.ph.i92.i, label %for.body.i.i83.i, !llvm.loop !29
for.cond5.preheader.lr.ph.i92.i: ; preds = %for.body.i.i83.i
%59 = load i32, ptr %43, align 8, !tbaa !15
store i32 %59, ptr %call.i.i68.i, align 8, !tbaa !15
%60 = load i64, ptr %zero245.i78.i, align 8
store i64 %60, ptr %zero.i.i71.i, align 8
%61 = load i32, ptr %key5.i, align 8, !tbaa !12
store i32 %61, ptr %key.i.i70.i, align 8, !tbaa !12
%62 = load ptr, ptr %p.i93.i, align 8, !tbaa !16
%min.iters.check166 = icmp ult i32 %55, 8
%n.vec169 = and i64 %wide.trip.count.i.i82.i, 4294967288
%cmp.n171 = icmp eq i64 %n.vec169, %wide.trip.count.i.i82.i
%xtraiter = and i64 %wide.trip.count.i.i82.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond5.preheader.us.i95.i
for.cond5.preheader.us.i95.i: ; preds = %for.cond5.for.inc16_crit_edge.us.i105.i, %for.cond5.preheader.lr.ph.i92.i
%indvars.iv40.i96.i = phi i64 [ %indvars.iv.next41.i106.i, %for.cond5.for.inc16_crit_edge.us.i105.i ], [ 0, %for.cond5.preheader.lr.ph.i92.i ]
%arrayidx.us.i97.i = getelementptr inbounds ptr, ptr %62, i64 %indvars.iv40.i96.i
%63 = load ptr, ptr %arrayidx.us.i97.i, align 8, !tbaa !17
%arrayidx13.us.i98.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %indvars.iv40.i96.i
%64 = load ptr, ptr %arrayidx13.us.i98.i, align 8, !tbaa !17
%65 = ptrtoint ptr %64 to i64
%66 = ptrtoint ptr %63 to i64
%67 = sub i64 %65, %66
%diff.check = icmp ult i64 %67, 32
%or.cond = select i1 %min.iters.check166, i1 true, i1 %diff.check
br i1 %or.cond, label %for.body8.us.i99.i.preheader, label %vector.body172
vector.body172: ; preds = %for.cond5.preheader.us.i95.i, %vector.body172
%index173 = phi i64 [ %index.next175, %vector.body172 ], [ 0, %for.cond5.preheader.us.i95.i ]
%68 = getelementptr inbounds i32, ptr %63, i64 %index173
%wide.load = load <4 x i32>, ptr %68, align 4, !tbaa !18
%69 = getelementptr inbounds i32, ptr %68, i64 4
%wide.load174 = load <4 x i32>, ptr %69, align 4, !tbaa !18
%70 = getelementptr inbounds i32, ptr %64, i64 %index173
store <4 x i32> %wide.load, ptr %70, align 4, !tbaa !18
%71 = getelementptr inbounds i32, ptr %70, i64 4
store <4 x i32> %wide.load174, ptr %71, align 4, !tbaa !18
%index.next175 = add nuw i64 %index173, 8
%72 = icmp eq i64 %index.next175, %n.vec169
br i1 %72, label %middle.block164, label %vector.body172, !llvm.loop !30
middle.block164: ; preds = %vector.body172
br i1 %cmp.n171, label %for.cond5.for.inc16_crit_edge.us.i105.i, label %for.body8.us.i99.i.preheader
for.body8.us.i99.i.preheader: ; preds = %for.cond5.preheader.us.i95.i, %middle.block164
%indvars.iv.i100.i.ph = phi i64 [ 0, %for.cond5.preheader.us.i95.i ], [ %n.vec169, %middle.block164 ]
%73 = xor i64 %indvars.iv.i100.i.ph, -1
%74 = add nsw i64 %73, %wide.trip.count.i.i82.i
br i1 %lcmp.mod.not, label %for.body8.us.i99.i.prol.loopexit, label %for.body8.us.i99.i.prol
for.body8.us.i99.i.prol: ; preds = %for.body8.us.i99.i.preheader, %for.body8.us.i99.i.prol
%indvars.iv.i100.i.prol = phi i64 [ %indvars.iv.next.i103.i.prol, %for.body8.us.i99.i.prol ], [ %indvars.iv.i100.i.ph, %for.body8.us.i99.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body8.us.i99.i.prol ], [ 0, %for.body8.us.i99.i.preheader ]
%arrayidx10.us.i101.i.prol = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.i100.i.prol
%75 = load i32, ptr %arrayidx10.us.i101.i.prol, align 4, !tbaa !18
%arrayidx15.us.i102.i.prol = getelementptr inbounds i32, ptr %64, i64 %indvars.iv.i100.i.prol
store i32 %75, ptr %arrayidx15.us.i102.i.prol, align 4, !tbaa !18
%indvars.iv.next.i103.i.prol = add nuw nsw i64 %indvars.iv.i100.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body8.us.i99.i.prol.loopexit, label %for.body8.us.i99.i.prol, !llvm.loop !33
for.body8.us.i99.i.prol.loopexit: ; preds = %for.body8.us.i99.i.prol, %for.body8.us.i99.i.preheader
%indvars.iv.i100.i.unr = phi i64 [ %indvars.iv.i100.i.ph, %for.body8.us.i99.i.preheader ], [ %indvars.iv.next.i103.i.prol, %for.body8.us.i99.i.prol ]
%76 = icmp ult i64 %74, 3
br i1 %76, label %for.cond5.for.inc16_crit_edge.us.i105.i, label %for.body8.us.i99.i
for.body8.us.i99.i: ; preds = %for.body8.us.i99.i.prol.loopexit, %for.body8.us.i99.i
%indvars.iv.i100.i = phi i64 [ %indvars.iv.next.i103.i.3, %for.body8.us.i99.i ], [ %indvars.iv.i100.i.unr, %for.body8.us.i99.i.prol.loopexit ]
%arrayidx10.us.i101.i = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.i100.i
%77 = load i32, ptr %arrayidx10.us.i101.i, align 4, !tbaa !18
%arrayidx15.us.i102.i = getelementptr inbounds i32, ptr %64, i64 %indvars.iv.i100.i
store i32 %77, ptr %arrayidx15.us.i102.i, align 4, !tbaa !18
%indvars.iv.next.i103.i = add nuw nsw i64 %indvars.iv.i100.i, 1
%arrayidx10.us.i101.i.1 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next.i103.i
%78 = load i32, ptr %arrayidx10.us.i101.i.1, align 4, !tbaa !18
%arrayidx15.us.i102.i.1 = getelementptr inbounds i32, ptr %64, i64 %indvars.iv.next.i103.i
store i32 %78, ptr %arrayidx15.us.i102.i.1, align 4, !tbaa !18
%indvars.iv.next.i103.i.1 = add nuw nsw i64 %indvars.iv.i100.i, 2
%arrayidx10.us.i101.i.2 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next.i103.i.1
%79 = load i32, ptr %arrayidx10.us.i101.i.2, align 4, !tbaa !18
%arrayidx15.us.i102.i.2 = getelementptr inbounds i32, ptr %64, i64 %indvars.iv.next.i103.i.1
store i32 %79, ptr %arrayidx15.us.i102.i.2, align 4, !tbaa !18
%indvars.iv.next.i103.i.2 = add nuw nsw i64 %indvars.iv.i100.i, 3
%arrayidx10.us.i101.i.3 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next.i103.i.2
%80 = load i32, ptr %arrayidx10.us.i101.i.3, align 4, !tbaa !18
%arrayidx15.us.i102.i.3 = getelementptr inbounds i32, ptr %64, i64 %indvars.iv.next.i103.i.2
store i32 %80, ptr %arrayidx15.us.i102.i.3, align 4, !tbaa !18
%indvars.iv.next.i103.i.3 = add nuw nsw i64 %indvars.iv.i100.i, 4
%exitcond.not.i104.i.3 = icmp eq i64 %indvars.iv.next.i103.i.3, %wide.trip.count.i.i82.i
br i1 %exitcond.not.i104.i.3, label %for.cond5.for.inc16_crit_edge.us.i105.i, label %for.body8.us.i99.i, !llvm.loop !35
for.cond5.for.inc16_crit_edge.us.i105.i: ; preds = %for.body8.us.i99.i.prol.loopexit, %for.body8.us.i99.i, %middle.block164
%indvars.iv.next41.i106.i = add nuw nsw i64 %indvars.iv40.i96.i, 1
%exitcond44.not.i107.i = icmp eq i64 %indvars.iv.next41.i106.i, %wide.trip.count.i.i82.i
br i1 %exitcond44.not.i107.i, label %copy_state.exit108.i, label %for.cond5.preheader.us.i95.i, !llvm.loop !36
copy_state.exit108.i: ; preds = %for.cond5.for.inc16_crit_edge.us.i105.i, %new_state.exit.thread.i77.i
%arrayidx.i43 = getelementptr inbounds [4 x i32], ptr @__const.eight_puzzle.d, i64 0, i64 %indvars.iv.i42
%81 = load i32, ptr %arrayidx.i43, align 4, !tbaa !37
switch i32 %81, label %sw.epilog.i.i [
i32 0, label %sw.bb.i.i
i32 1, label %sw.bb18.i.i
i32 2, label %sw.bb45.i.i
i32 3, label %sw.bb74.i.i
]
sw.bb.i.i: ; preds = %copy_state.exit108.i
%82 = load i32, ptr %zero.i.i71.i, align 8, !tbaa !14
%add.i118.i = add nsw i32 %82, 1
%83 = load i32, ptr %size1.i.i69.i, align 4, !tbaa !5
%cmp.i120.i = icmp eq i32 %add.i118.i, %83
br i1 %cmp.i120.i, label %advance_state.exit.i, label %if.end.i121.i
if.end.i121.i: ; preds = %sw.bb.i.i
%idxprom.i123.i = sext i32 %add.i118.i to i64
%arrayidx.i124.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %idxprom.i123.i
%84 = load ptr, ptr %arrayidx.i124.i, align 8, !tbaa !17
%col.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 4, i32 1
%85 = load i32, ptr %col.i.i, align 4, !tbaa !13
%idxprom5.i.i = sext i32 %85 to i64
%arrayidx6.i.i = getelementptr inbounds i32, ptr %84, i64 %idxprom5.i.i
%86 = load i32, ptr %arrayidx6.i.i, align 4, !tbaa !18
%idxprom10.i.i = sext i32 %82 to i64
%arrayidx11.i.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %idxprom10.i.i
%87 = load ptr, ptr %arrayidx11.i.i, align 8, !tbaa !17
%arrayidx15.i.i = getelementptr inbounds i32, ptr %87, i64 %idxprom5.i.i
store i32 %86, ptr %arrayidx15.i.i, align 4, !tbaa !18
%88 = load i32, ptr %zero.i.i71.i, align 8, !tbaa !14
%inc.i125.i = add nsw i32 %88, 1
store i32 %inc.i125.i, ptr %zero.i.i71.i, align 8, !tbaa !14
br label %sw.epilog.i.i
sw.bb18.i.i: ; preds = %copy_state.exit108.i
%89 = load i32, ptr %zero.i.i71.i, align 8, !tbaa !14
%cmp21.i.i = icmp slt i32 %89, 1
br i1 %cmp21.i.i, label %advance_state.exit.i, label %if.end23.i.i
if.end23.i.i: ; preds = %sw.bb18.i.i
%sub.i.i = add nsw i32 %89, -1
%idxprom28.i.i = zext i32 %sub.i.i to i64
%arrayidx29.i.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %idxprom28.i.i
%90 = load ptr, ptr %arrayidx29.i.i, align 8, !tbaa !17
%col31.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 4, i32 1
%91 = load i32, ptr %col31.i.i, align 4, !tbaa !13
%idxprom32.i115.i = sext i32 %91 to i64
%arrayidx33.i116.i = getelementptr inbounds i32, ptr %90, i64 %idxprom32.i115.i
%92 = load i32, ptr %arrayidx33.i116.i, align 4, !tbaa !18
%idxprom37.i.i = zext i32 %89 to i64
%arrayidx38.i.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %idxprom37.i.i
%93 = load ptr, ptr %arrayidx38.i.i, align 8, !tbaa !17
%arrayidx42.i.i = getelementptr inbounds i32, ptr %93, i64 %idxprom32.i115.i
store i32 %92, ptr %arrayidx42.i.i, align 4, !tbaa !18
%94 = load i32, ptr %zero.i.i71.i, align 8, !tbaa !14
%dec.i117.i = add nsw i32 %94, -1
store i32 %dec.i117.i, ptr %zero.i.i71.i, align 8, !tbaa !14
br label %sw.epilog.i.i
sw.bb45.i.i: ; preds = %copy_state.exit108.i
%col47.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 4, i32 1
%95 = load i32, ptr %col47.i.i, align 4, !tbaa !13
%cmp49.i.i = icmp slt i32 %95, 1
br i1 %cmp49.i.i, label %advance_state.exit.i, label %if.end51.i.i
if.end51.i.i: ; preds = %sw.bb45.i.i
%sub48.i.i = add nsw i32 %95, -1
%96 = load i32, ptr %zero.i.i71.i, align 8, !tbaa !14
%idxprom55.i.i = sext i32 %96 to i64
%arrayidx56.i.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %idxprom55.i.i
%97 = load ptr, ptr %arrayidx56.i.i, align 8, !tbaa !17
%idxprom60.i.i = zext i32 %sub48.i.i to i64
%arrayidx61.i.i = getelementptr inbounds i32, ptr %97, i64 %idxprom60.i.i
%98 = load i32, ptr %arrayidx61.i.i, align 4, !tbaa !18
%idxprom69.i.i = zext i32 %95 to i64
%arrayidx70.i.i = getelementptr inbounds i32, ptr %97, i64 %idxprom69.i.i
store i32 %98, ptr %arrayidx70.i.i, align 4, !tbaa !18
%99 = load i32, ptr %col47.i.i, align 4, !tbaa !13
%dec73.i.i = add nsw i32 %99, -1
store i32 %dec73.i.i, ptr %col47.i.i, align 4, !tbaa !13
br label %sw.epilog.i.i
sw.bb74.i.i: ; preds = %copy_state.exit108.i
%col76.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 4, i32 1
%100 = load i32, ptr %col76.i.i, align 4, !tbaa !13
%add77.i.i = add nsw i32 %100, 1
%101 = load i32, ptr %size1.i.i69.i, align 4, !tbaa !5
%cmp79.i.i = icmp eq i32 %add77.i.i, %101
br i1 %cmp79.i.i, label %advance_state.exit.i, label %if.end81.i.i
if.end81.i.i: ; preds = %sw.bb74.i.i
%102 = load i32, ptr %zero.i.i71.i, align 8, !tbaa !14
%idxprom85.i.i = sext i32 %102 to i64
%arrayidx86.i.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %idxprom85.i.i
%103 = load ptr, ptr %arrayidx86.i.i, align 8, !tbaa !17
%idxprom90.i.i = sext i32 %add77.i.i to i64
%arrayidx91.i.i = getelementptr inbounds i32, ptr %103, i64 %idxprom90.i.i
%104 = load i32, ptr %arrayidx91.i.i, align 4, !tbaa !18
%idxprom99.i.i = sext i32 %100 to i64
%arrayidx100.i.i = getelementptr inbounds i32, ptr %103, i64 %idxprom99.i.i
store i32 %104, ptr %arrayidx100.i.i, align 4, !tbaa !18
%105 = load i32, ptr %col76.i.i, align 4, !tbaa !13
%inc103.i.i = add nsw i32 %105, 1
store i32 %inc103.i.i, ptr %col76.i.i, align 4, !tbaa !13
br label %sw.epilog.i.i
sw.epilog.i.i: ; preds = %if.end81.i.i, %if.end51.i.i, %if.end23.i.i, %if.end.i121.i, %copy_state.exit108.i
%106 = load i32, ptr %zero.i.i71.i, align 8, !tbaa !14
%idxprom107.i.i = sext i32 %106 to i64
%arrayidx108.i.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %idxprom107.i.i
%107 = load ptr, ptr %arrayidx108.i.i, align 8, !tbaa !17
%col110.i.i = getelementptr inbounds %struct.state_t, ptr %call.i.i68.i, i64 0, i32 4, i32 1
%108 = load i32, ptr %col110.i.i, align 4, !tbaa !13
%idxprom111.i.i = sext i32 %108 to i64
%arrayidx112.i.i = getelementptr inbounds i32, ptr %107, i64 %idxprom111.i.i
store i32 0, ptr %arrayidx112.i.i, align 4, !tbaa !18
%109 = load i32, ptr %size1.i.i69.i, align 4, !tbaa !5
%mul.i.i109.i = mul nsw i32 %109, %109
%cmp35.i.i.i = icmp ugt i32 %mul.i.i109.i, 1
br i1 %cmp35.i.i.i, label %for.inc.preheader.i.i.i, label %for.end.i.i.i
for.inc.preheader.i.i.i: ; preds = %sw.epilog.i.i
%110 = tail call i32 @llvm.smax.i32(i32 %mul.i.i109.i, i32 2)
%111 = add nsw i32 %110, -2
%112 = add nsw i32 %110, -1
%min.iters.check = icmp ult i32 %110, 9
br i1 %min.iters.check, label %for.inc.i.i.i.preheader, label %vector.ph
vector.ph: ; preds = %for.inc.preheader.i.i.i
%n.vec = and i32 %112, -8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %113, %vector.body ]
%vec.phi163 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %114, %vector.body ]
%113 = mul <4 x i32> %vec.phi, <i32 10, i32 10, i32 10, i32 10>
%114 = mul <4 x i32> %vec.phi163, <i32 10, i32 10, i32 10, i32 10>
%index.next = add nuw i32 %index, 8
%115 = icmp eq i32 %index.next, %n.vec
br i1 %115, label %middle.block, label %vector.body, !llvm.loop !38
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %114, %113
%116 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %112, %n.vec
br i1 %cmp.n, label %for.end.i.i.i, label %for.inc.i.i.i.preheader
for.inc.i.i.i.preheader: ; preds = %for.inc.preheader.i.i.i, %middle.block
%d.037.i.i.i.ph = phi i32 [ 1, %for.inc.preheader.i.i.i ], [ %116, %middle.block ]
%i.036.i.i.i.ph = phi i32 [ 0, %for.inc.preheader.i.i.i ], [ %n.vec, %middle.block ]
br label %for.inc.i.i.i
for.inc.i.i.i: ; preds = %for.inc.i.i.i.preheader, %for.inc.i.i.i
%d.037.i.i.i = phi i32 [ %mul2.i.i.i, %for.inc.i.i.i ], [ %d.037.i.i.i.ph, %for.inc.i.i.i.preheader ]
%i.036.i.i.i = phi i32 [ %inc.i.i.i, %for.inc.i.i.i ], [ %i.036.i.i.i.ph, %for.inc.i.i.i.preheader ]
%inc.i.i.i = add nuw nsw i32 %i.036.i.i.i, 1
%mul2.i.i.i = mul nsw i32 %d.037.i.i.i, 10
%exitcond.not.i.i114.i = icmp eq i32 %i.036.i.i.i, %111
br i1 %exitcond.not.i.i114.i, label %for.end.i.i.i, label %for.inc.i.i.i, !llvm.loop !39
for.end.i.i.i: ; preds = %for.inc.i.i.i, %middle.block, %sw.epilog.i.i
%d.0.lcssa.i.i.i = phi i32 [ 1, %sw.epilog.i.i ], [ %116, %middle.block ], [ %mul2.i.i.i, %for.inc.i.i.i ]
store i32 0, ptr %key.i.i70.i, align 8, !tbaa !12
%cmp543.i.i.i = icmp sgt i32 %109, 0
br i1 %cmp543.i.i.i, label %for.cond7.preheader.lr.ph.i.i.i, label %update_state_key.exit.i.i
for.cond7.preheader.lr.ph.i.i.i: ; preds = %for.end.i.i.i
%wide.trip.count52.i.i.i = zext i32 %109 to i64
%xtraiter201 = and i64 %wide.trip.count52.i.i.i, 1
%117 = icmp eq i32 %109, 1
%unroll_iter = and i64 %wide.trip.count52.i.i.i, 4294967294
%lcmp.mod202.not = icmp eq i64 %xtraiter201, 0
br label %for.cond7.preheader.us.i.i.i
for.cond7.preheader.us.i.i.i: ; preds = %for.cond7.for.inc18_crit_edge.us.i.i.i, %for.cond7.preheader.lr.ph.i.i.i
%indvars.iv49.i.i.i = phi i64 [ %indvars.iv.next50.i.i.i, %for.cond7.for.inc18_crit_edge.us.i.i.i ], [ 0, %for.cond7.preheader.lr.ph.i.i.i ]
%key.promoted.us46.i.i.i = phi i32 [ %add.us.i.i.i.lcssa, %for.cond7.for.inc18_crit_edge.us.i.i.i ], [ 0, %for.cond7.preheader.lr.ph.i.i.i ]
%d.145.us.i.i.i = phi i32 [ %div.us.i.i.i.lcssa, %for.cond7.for.inc18_crit_edge.us.i.i.i ], [ %d.0.lcssa.i.i.i, %for.cond7.preheader.lr.ph.i.i.i ]
%arrayidx.us.i.i.i = getelementptr inbounds ptr, ptr %call4.i.i74.i, i64 %indvars.iv49.i.i.i
%118 = load ptr, ptr %arrayidx.us.i.i.i, align 8, !tbaa !17
br i1 %117, label %for.cond7.for.inc18_crit_edge.us.i.i.i.unr-lcssa, label %for.body10.us.i.i.i
for.body10.us.i.i.i: ; preds = %for.cond7.preheader.us.i.i.i, %for.body10.us.i.i.i
%indvars.iv.i.i112.i = phi i64 [ %indvars.iv.next.i.i113.i.1, %for.body10.us.i.i.i ], [ 0, %for.cond7.preheader.us.i.i.i ]
%119 = phi i32 [ %add.us.i.i.i.1, %for.body10.us.i.i.i ], [ %key.promoted.us46.i.i.i, %for.cond7.preheader.us.i.i.i ]
%d.241.us.i.i.i = phi i32 [ %div.us.i.i.i.1, %for.body10.us.i.i.i ], [ %d.145.us.i.i.i, %for.cond7.preheader.us.i.i.i ]
%niter = phi i64 [ %niter.next.1, %for.body10.us.i.i.i ], [ 0, %for.cond7.preheader.us.i.i.i ]
%arrayidx12.us.i.i.i = getelementptr inbounds i32, ptr %118, i64 %indvars.iv.i.i112.i
%120 = load i32, ptr %arrayidx12.us.i.i.i, align 4, !tbaa !18
%mul13.us.i.i.i = mul nsw i32 %120, %d.241.us.i.i.i
%add.us.i.i.i = add nsw i32 %mul13.us.i.i.i, %119
store i32 %add.us.i.i.i, ptr %key.i.i70.i, align 8, !tbaa !12
%indvars.iv.next.i.i113.i = or i64 %indvars.iv.i.i112.i, 1
%div.us.i.i.i = sdiv i32 %d.241.us.i.i.i, 10
%arrayidx12.us.i.i.i.1 = getelementptr inbounds i32, ptr %118, i64 %indvars.iv.next.i.i113.i
%121 = load i32, ptr %arrayidx12.us.i.i.i.1, align 4, !tbaa !18
%mul13.us.i.i.i.1 = mul nsw i32 %121, %div.us.i.i.i
%add.us.i.i.i.1 = add nsw i32 %mul13.us.i.i.i.1, %add.us.i.i.i
store i32 %add.us.i.i.i.1, ptr %key.i.i70.i, align 8, !tbaa !12
%indvars.iv.next.i.i113.i.1 = add nuw nsw i64 %indvars.iv.i.i112.i, 2
%div.us.i.i.i.1 = sdiv i32 %d.241.us.i.i.i, 100
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond7.for.inc18_crit_edge.us.i.i.i.unr-lcssa, label %for.body10.us.i.i.i, !llvm.loop !40
for.cond7.for.inc18_crit_edge.us.i.i.i.unr-lcssa: ; preds = %for.body10.us.i.i.i, %for.cond7.preheader.us.i.i.i
%add.us.i.i.i.lcssa.ph = phi i32 [ undef, %for.cond7.preheader.us.i.i.i ], [ %add.us.i.i.i.1, %for.body10.us.i.i.i ]
%div.us.i.i.i.lcssa.ph = phi i32 [ undef, %for.cond7.preheader.us.i.i.i ], [ %div.us.i.i.i.1, %for.body10.us.i.i.i ]
%indvars.iv.i.i112.i.unr = phi i64 [ 0, %for.cond7.preheader.us.i.i.i ], [ %indvars.iv.next.i.i113.i.1, %for.body10.us.i.i.i ]
%.unr = phi i32 [ %key.promoted.us46.i.i.i, %for.cond7.preheader.us.i.i.i ], [ %add.us.i.i.i.1, %for.body10.us.i.i.i ]
%d.241.us.i.i.i.unr = phi i32 [ %d.145.us.i.i.i, %for.cond7.preheader.us.i.i.i ], [ %div.us.i.i.i.1, %for.body10.us.i.i.i ]
br i1 %lcmp.mod202.not, label %for.cond7.for.inc18_crit_edge.us.i.i.i, label %for.body10.us.i.i.i.epil
for.body10.us.i.i.i.epil: ; preds = %for.cond7.for.inc18_crit_edge.us.i.i.i.unr-lcssa
%arrayidx12.us.i.i.i.epil = getelementptr inbounds i32, ptr %118, i64 %indvars.iv.i.i112.i.unr
%122 = load i32, ptr %arrayidx12.us.i.i.i.epil, align 4, !tbaa !18
%mul13.us.i.i.i.epil = mul nsw i32 %122, %d.241.us.i.i.i.unr
%add.us.i.i.i.epil = add nsw i32 %mul13.us.i.i.i.epil, %.unr
store i32 %add.us.i.i.i.epil, ptr %key.i.i70.i, align 8, !tbaa !12
%div.us.i.i.i.epil = sdiv i32 %d.241.us.i.i.i.unr, 10
br label %for.cond7.for.inc18_crit_edge.us.i.i.i
for.cond7.for.inc18_crit_edge.us.i.i.i: ; preds = %for.cond7.for.inc18_crit_edge.us.i.i.i.unr-lcssa, %for.body10.us.i.i.i.epil
%add.us.i.i.i.lcssa = phi i32 [ %add.us.i.i.i.lcssa.ph, %for.cond7.for.inc18_crit_edge.us.i.i.i.unr-lcssa ], [ %add.us.i.i.i.epil, %for.body10.us.i.i.i.epil ]
%div.us.i.i.i.lcssa = phi i32 [ %div.us.i.i.i.lcssa.ph, %for.cond7.for.inc18_crit_edge.us.i.i.i.unr-lcssa ], [ %div.us.i.i.i.epil, %for.body10.us.i.i.i.epil ]
%indvars.iv.next50.i.i.i = add nuw nsw i64 %indvars.iv49.i.i.i, 1
%exitcond53.not.i.i.i = icmp eq i64 %indvars.iv.next50.i.i.i, %wide.trip.count52.i.i.i
br i1 %exitcond53.not.i.i.i, label %update_state_key.exit.i.i, label %for.cond7.preheader.us.i.i.i, !llvm.loop !41
update_state_key.exit.i.i: ; preds = %for.cond7.for.inc18_crit_edge.us.i.i.i, %for.end.i.i.i
%123 = load i32, ptr %call.i.i68.i, align 8, !tbaa !15
%inc113.i.i = add nsw i32 %123, 1
store i32 %inc113.i.i, ptr %call.i.i68.i, align 8, !tbaa !15
br label %advance_state.exit.i
advance_state.exit.i: ; preds = %update_state_key.exit.i.i, %sw.bb74.i.i, %sw.bb45.i.i, %sw.bb18.i.i, %sw.bb.i.i
%tobool.i = phi i1 [ false, %update_state_key.exit.i.i ], [ true, %sw.bb.i.i ], [ true, %sw.bb18.i.i ], [ true, %sw.bb45.i.i ], [ true, %sw.bb74.i.i ]
%124 = load i32, ptr %key.i.i70.i, align 8, !tbaa !12
%cmp27.i.i = icmp eq ptr %root.1243.i, null
br i1 %cmp27.i.i, label %find_node.exit.i, label %if.else.i.i
if.else.i.i: ; preds = %advance_state.exit.i, %tailrecurse.backedge.i.i
%n.tr28.i.i = phi ptr [ %n.tr.be.i.i, %tailrecurse.backedge.i.i ], [ %root.1243.i, %advance_state.exit.i ]
%x1.i127.i = getelementptr inbounds %struct.Node, ptr %n.tr28.i.i, i64 0, i32 1
%125 = load i32, ptr %x1.i127.i, align 4, !tbaa !21
%cmp2.i.i = icmp eq i32 %125, %124
br i1 %cmp2.i.i, label %if.then16.i, label %if.else4.i.i
if.else4.i.i: ; preds = %if.else.i.i
%cmp6.i.i = icmp sgt i32 %125, %124
br i1 %cmp6.i.i, label %if.then7.i.i, label %if.else8.i.i
if.then7.i.i: ; preds = %if.else4.i.i
%l.i.i = getelementptr inbounds %struct.Node, ptr %n.tr28.i.i, i64 0, i32 3
br label %tailrecurse.backedge.i.i
tailrecurse.backedge.i.i: ; preds = %if.then11.i128.i, %if.then7.i.i
%n.tr.be.in.i.i = phi ptr [ %l.i.i, %if.then7.i.i ], [ %r.i.i, %if.then11.i128.i ]
%n.tr.be.i.i = load ptr, ptr %n.tr.be.in.i.i, align 8, !tbaa !17
%cmp.i129.i = icmp eq ptr %n.tr.be.i.i, null
br i1 %cmp.i129.i, label %find_node.exit.i, label %if.else.i.i
if.else8.i.i: ; preds = %if.else4.i.i
%cmp10.i.i = icmp slt i32 %125, %124
br i1 %cmp10.i.i, label %if.then11.i128.i, label %find_node.exit.i
if.then11.i128.i: ; preds = %if.else8.i.i
%r.i.i = getelementptr inbounds %struct.Node, ptr %n.tr28.i.i, i64 0, i32 4
br label %tailrecurse.backedge.i.i
find_node.exit.i: ; preds = %if.else8.i.i, %tailrecurse.backedge.i.i, %advance_state.exit.i
br i1 %tobool.i, label %if.then16.i, label %if.end17.i
if.then16.i: ; preds = %if.else.i.i, %find_node.exit.i
%126 = load i32, ptr %size1.i.i69.i, align 4, !tbaa !5
%cmp7.i131.i = icmp sgt i32 %126, 0
br i1 %cmp7.i131.i, label %for.body.i136.i, label %free_state.exit141.i
for.body.i136.i: ; preds = %if.then16.i, %for.body.i136.i
%indvars.iv.i137.i = phi i64 [ %indvars.iv.next.i139.i, %for.body.i136.i ], [ 0, %if.then16.i ]
%127 = load ptr, ptr %p.i.i75.i, align 8, !tbaa !16
%arrayidx.i138.i = getelementptr inbounds ptr, ptr %127, i64 %indvars.iv.i137.i
%128 = load ptr, ptr %arrayidx.i138.i, align 8, !tbaa !17
tail call void @free(ptr noundef %128) #9
%indvars.iv.next.i139.i = add nuw nsw i64 %indvars.iv.i137.i, 1
%129 = load i32, ptr %size1.i.i69.i, align 4, !tbaa !5
%130 = sext i32 %129 to i64
%cmp.i140.i = icmp slt i64 %indvars.iv.next.i139.i, %130
br i1 %cmp.i140.i, label %for.body.i136.i, label %free_state.exit141.loopexit.i, !llvm.loop !27
free_state.exit141.loopexit.i: ; preds = %for.body.i136.i
%.pre285.i = load ptr, ptr %p.i.i75.i, align 8, !tbaa !16
br label %free_state.exit141.i
free_state.exit141.i: ; preds = %free_state.exit141.loopexit.i, %if.then16.i
%131 = phi ptr [ %.pre285.i, %free_state.exit141.loopexit.i ], [ %call4.i.i74.i, %if.then16.i ]
tail call void @free(ptr noundef %131) #9
tail call void @free(ptr noundef nonnull %call.i.i68.i) #9
br label %for.inc.i44
if.end17.i: ; preds = %find_node.exit.i
%inc.i143.i = add nsw i32 %54, 1
%cmp.i145.i = icmp eq i32 %inc.i143.i, %53
br i1 %cmp.i145.i, label %if.then.i155.i, label %entry.if.end29_crit_edge.i146.i
entry.if.end29_crit_edge.i146.i: ; preds = %if.end17.i
%.pre284.i = load ptr, ptr %arr.i.i, align 8, !tbaa !19
br label %enqueue.exit181.i
if.then.i155.i: ; preds = %if.end17.i
%mul.i156.i = shl nsw i32 %53, 1
%132 = load ptr, ptr %arr.i.i, align 8, !tbaa !19
%conv.i158.i = sext i32 %mul.i156.i to i64
%mul6.i159.i = shl nsw i64 %conv.i158.i, 3
%call.i160.i = tail call ptr @realloc(ptr noundef %132, i64 noundef %mul6.i159.i) #10
store ptr %call.i160.i, ptr %arr.i.i, align 8, !tbaa !19
%cmp9.i162.i = icmp sgt i32 %sub18.i167252.i, %52
br i1 %cmp9.i162.i, label %if.then11.i164.i, label %enqueue.exit181.i
if.then11.i164.i: ; preds = %if.then.i155.i
%sub.neg.i165.i = sub i32 %sub18.i167252.i, %53
%cmp15.not.not66.i166.i = icmp sgt i32 %mul.i156.i, %52
%sub18.i167.i = add i32 %sub.neg.i165.i, %mul.i156.i
br i1 %cmp15.not.not66.i166.i, label %for.body.lr.ph.i169.i, label %enqueue.exit181.i
for.body.lr.ph.i169.i: ; preds = %if.then11.i164.i
%133 = sext i32 %sub18.i167.i to i64
%134 = sext i32 %52 to i64
%135 = sext i32 %53 to i64
%xtraiter205 = and i64 %134, 1
%lcmp.mod206.not = icmp eq i64 %xtraiter205, 0
br i1 %lcmp.mod206.not, label %for.body.i170.i.prol.loopexit, label %for.body.i170.i.prol
for.body.i170.i.prol: ; preds = %for.body.lr.ph.i169.i
%indvars.iv.next.i172.i.prol = add nsw i64 %conv.i158.i, -1
%cmp19.not.not.i173.i.prol = icmp sgt i32 %mul.i156.i, %sub18.i167.i
br i1 %cmp19.not.not.i173.i.prol, label %cond.true.i179.i.prol, label %cond.end.i175.i.prol
cond.true.i179.i.prol: ; preds = %for.body.i170.i.prol
%136 = sub nsw i64 %indvars.iv.next.i172.i.prol, %135
%arrayidx.i180.i.prol = getelementptr inbounds ptr, ptr %call.i160.i, i64 %136
%137 = load ptr, ptr %arrayidx.i180.i.prol, align 8, !tbaa !17
br label %cond.end.i175.i.prol
cond.end.i175.i.prol: ; preds = %cond.true.i179.i.prol, %for.body.i170.i.prol
%cond.i176.i.prol = phi ptr [ %137, %cond.true.i179.i.prol ], [ null, %for.body.i170.i.prol ]
%arrayidx25.i177.i.prol = getelementptr inbounds ptr, ptr %call.i160.i, i64 %indvars.iv.next.i172.i.prol
store ptr %cond.i176.i.prol, ptr %arrayidx25.i177.i.prol, align 8, !tbaa !17
br label %for.body.i170.i.prol.loopexit
for.body.i170.i.prol.loopexit: ; preds = %cond.end.i175.i.prol, %for.body.lr.ph.i169.i
%indvars.iv.i171.i.unr = phi i64 [ %conv.i158.i, %for.body.lr.ph.i169.i ], [ %indvars.iv.next.i172.i.prol, %cond.end.i175.i.prol ]
%138 = sub nsw i64 0, %conv.i158.i
%139 = xor i64 %134, %138
%140 = icmp eq i64 %139, -1
br i1 %140, label %enqueue.exit181.i, label %for.body.i170.i
for.body.i170.i: ; preds = %for.body.i170.i.prol.loopexit, %cond.end.i175.i.1
%indvars.iv.i171.i = phi i64 [ %indvars.iv.next.i172.i.1, %cond.end.i175.i.1 ], [ %indvars.iv.i171.i.unr, %for.body.i170.i.prol.loopexit ]
%indvars.iv.next.i172.i = add nsw i64 %indvars.iv.i171.i, -1
%cmp19.not.not.i173.i = icmp sgt i64 %indvars.iv.i171.i, %133
br i1 %cmp19.not.not.i173.i, label %cond.true.i179.i, label %cond.end.i175.i
cond.true.i179.i: ; preds = %for.body.i170.i
%141 = sub nsw i64 %indvars.iv.next.i172.i, %135
%arrayidx.i180.i = getelementptr inbounds ptr, ptr %call.i160.i, i64 %141
%142 = load ptr, ptr %arrayidx.i180.i, align 8, !tbaa !17
br label %cond.end.i175.i
cond.end.i175.i: ; preds = %cond.true.i179.i, %for.body.i170.i
%cond.i176.i = phi ptr [ %142, %cond.true.i179.i ], [ null, %for.body.i170.i ]
%arrayidx25.i177.i = getelementptr inbounds ptr, ptr %call.i160.i, i64 %indvars.iv.next.i172.i
store ptr %cond.i176.i, ptr %arrayidx25.i177.i, align 8, !tbaa !17
%indvars.iv.next.i172.i.1 = add nsw i64 %indvars.iv.i171.i, -2
%cmp19.not.not.i173.i.1 = icmp sgt i64 %indvars.iv.next.i172.i, %133
br i1 %cmp19.not.not.i173.i.1, label %cond.true.i179.i.1, label %cond.end.i175.i.1
cond.true.i179.i.1: ; preds = %cond.end.i175.i
%143 = sub nsw i64 %indvars.iv.next.i172.i.1, %135
%arrayidx.i180.i.1 = getelementptr inbounds ptr, ptr %call.i160.i, i64 %143
%144 = load ptr, ptr %arrayidx.i180.i.1, align 8, !tbaa !17
br label %cond.end.i175.i.1
cond.end.i175.i.1: ; preds = %cond.true.i179.i.1, %cond.end.i175.i
%cond.i176.i.1 = phi ptr [ %144, %cond.true.i179.i.1 ], [ null, %cond.end.i175.i ]
%arrayidx25.i177.i.1 = getelementptr inbounds ptr, ptr %call.i160.i, i64 %indvars.iv.next.i172.i.1
store ptr %cond.i176.i.1, ptr %arrayidx25.i177.i.1, align 8, !tbaa !17
%cmp15.not.not.i178.i.1 = icmp sgt i64 %indvars.iv.next.i172.i.1, %134
br i1 %cmp15.not.not.i178.i.1, label %for.body.i170.i, label %enqueue.exit181.i, !llvm.loop !42
enqueue.exit181.i: ; preds = %for.body.i170.i.prol.loopexit, %cond.end.i175.i.1, %if.then11.i164.i, %if.then.i155.i, %entry.if.end29_crit_edge.i146.i
%145 = phi ptr [ %.pre284.i, %entry.if.end29_crit_edge.i146.i ], [ %call.i160.i, %if.then.i155.i ], [ %call.i160.i, %if.then11.i164.i ], [ %call.i160.i, %cond.end.i175.i.1 ], [ %call.i160.i, %for.body.i170.i.prol.loopexit ]
%146 = phi i32 [ %53, %entry.if.end29_crit_edge.i146.i ], [ %mul.i156.i, %if.then.i155.i ], [ %mul.i156.i, %if.then11.i164.i ], [ %mul.i156.i, %cond.end.i175.i.1 ], [ %mul.i156.i, %for.body.i170.i.prol.loopexit ]
%sub18.i167254.i = phi i32 [ %sub18.i167252.i, %entry.if.end29_crit_edge.i146.i ], [ %sub18.i167252.i, %if.then.i155.i ], [ %sub18.i167.i, %if.then11.i164.i ], [ %sub18.i167.i, %cond.end.i175.i.1 ], [ %sub18.i167.i, %for.body.i170.i.prol.loopexit ]
%idxprom32.i151.i = sext i32 %52 to i64
%arrayidx33.i152.i = getelementptr inbounds ptr, ptr %145, i64 %idxprom32.i151.i
store ptr %call.i.i68.i, ptr %arrayidx33.i152.i, align 8, !tbaa !17
%add.i153.i = add nsw i32 %52, 1
%rem.i154.i = srem i32 %add.i153.i, %146
store i32 %rem.i154.i, ptr %tail.i.i, align 4, !tbaa !43
%147 = load i32, ptr %key.i.i70.i, align 8, !tbaa !12
%call.i182.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%p.i183.i = getelementptr inbounds %struct.Node, ptr %call.i182.i, i64 0, i32 2
%x1.i184.i = getelementptr inbounds %struct.Node, ptr %call.i182.i, i64 0, i32 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %p.i183.i, i8 0, i64 24, i1 false)
store i32 %147, ptr %x1.i184.i, align 4, !tbaa !21
store i32 1, ptr %call.i182.i, align 8, !tbaa !23
br label %tailrecurse.i.i
tailrecurse.i.i: ; preds = %tailrecurse.i.i.backedge, %enqueue.exit181.i
%r.tr.i.i = phi ptr [ %root.1243.i, %enqueue.exit181.i ], [ %r.tr.i.i.be, %tailrecurse.i.i.backedge ]
%x1.i185.i = getelementptr inbounds %struct.Node, ptr %r.tr.i.i, i64 0, i32 1
%148 = load i32, ptr %x1.i185.i, align 4, !tbaa !21
%cmp.i186.i = icmp slt i32 %147, %148
br i1 %cmp.i186.i, label %if.then.i189.i, label %if.else6.i.i
if.then.i189.i: ; preds = %tailrecurse.i.i
%l.i190.i = getelementptr inbounds %struct.Node, ptr %r.tr.i.i, i64 0, i32 3
%149 = load ptr, ptr %l.i190.i, align 8, !tbaa !44
%cmp2.i191.i = icmp eq ptr %149, null
br i1 %cmp2.i191.i, label %if.end20.sink.split.i.i.split.loop.exit, label %tailrecurse.i.i.backedge
if.else6.i.i: ; preds = %tailrecurse.i.i
%cmp9.i187.i = icmp sgt i32 %147, %148
br i1 %cmp9.i187.i, label %if.then10.i.i, label %tailrecurse.i192.i.preheader
if.then10.i.i: ; preds = %if.else6.i.i
%r11.i.i = getelementptr inbounds %struct.Node, ptr %r.tr.i.i, i64 0, i32 4
%150 = load ptr, ptr %r11.i.i, align 8, !tbaa !45
%cmp12.i.i = icmp eq ptr %150, null
br i1 %cmp12.i.i, label %if.end20.sink.split.i.i.split.loop.exit138, label %tailrecurse.i.i.backedge
tailrecurse.i.i.backedge: ; preds = %if.then10.i.i, %if.then.i189.i
%r.tr.i.i.be = phi ptr [ %149, %if.then.i189.i ], [ %150, %if.then10.i.i ]
br label %tailrecurse.i.i
if.end20.sink.split.i.i.split.loop.exit: ; preds = %if.then.i189.i
%l.i190.i.le = getelementptr inbounds %struct.Node, ptr %r.tr.i.i, i64 0, i32 3
br label %if.end20.sink.split.i.i
if.end20.sink.split.i.i.split.loop.exit138: ; preds = %if.then10.i.i
%r11.i.i.le = getelementptr inbounds %struct.Node, ptr %r.tr.i.i, i64 0, i32 4
br label %if.end20.sink.split.i.i
if.end20.sink.split.i.i: ; preds = %if.end20.sink.split.i.i.split.loop.exit138, %if.end20.sink.split.i.i.split.loop.exit
%r11.le.sink.i.i = phi ptr [ %l.i190.i.le, %if.end20.sink.split.i.i.split.loop.exit ], [ %r11.i.i.le, %if.end20.sink.split.i.i.split.loop.exit138 ]
store ptr %call.i182.i, ptr %r11.le.sink.i.i, align 8, !tbaa !17
store ptr %r.tr.i.i, ptr %p.i183.i, align 8, !tbaa !46
br label %tailrecurse.i192.i.preheader
tailrecurse.i192.i.preheader: ; preds = %if.else6.i.i, %if.end20.sink.split.i.i
br label %tailrecurse.i192.i
tailrecurse.i192.i: ; preds = %tailrecurse.i192.i.preheader, %if.end31.i.i
%n.tr.i.i = phi ptr [ %164, %if.end31.i.i ], [ %root.1243.i, %tailrecurse.i192.i.preheader ]
%cmp.i193.i = icmp eq ptr %n.tr.i.i, null
br i1 %cmp.i193.i, label %for.inc.i44, label %if.end.i194.i
if.end.i194.i: ; preds = %tailrecurse.i192.i
%l1.i.i = getelementptr inbounds %struct.Node, ptr %n.tr.i.i, i64 0, i32 3
%151 = load ptr, ptr %l1.i.i, align 8, !tbaa !44
%cmp2.i195.i = icmp eq ptr %151, null
br i1 %cmp2.i195.i, label %cond.end.i196.i, label %cond.false.i.i
cond.false.i.i: ; preds = %if.end.i194.i
%152 = load i32, ptr %151, align 8, !tbaa !23
br label %cond.end.i196.i
cond.end.i196.i: ; preds = %cond.false.i.i, %if.end.i194.i
%cond.i197.i = phi i32 [ %152, %cond.false.i.i ], [ 0, %if.end.i194.i ]
%r4.i.i = getelementptr inbounds %struct.Node, ptr %n.tr.i.i, i64 0, i32 4
%153 = load ptr, ptr %r4.i.i, align 8, !tbaa !45
%cmp5.i.i = icmp eq ptr %153, null
br i1 %cmp5.i.i, label %cond.end10.i.i, label %cond.false7.i.i
cond.false7.i.i: ; preds = %cond.end.i196.i
%154 = load i32, ptr %153, align 8, !tbaa !23
br label %cond.end10.i.i
cond.end10.i.i: ; preds = %cond.false7.i.i, %cond.end.i196.i
%cond11.i.i = phi i32 [ %154, %cond.false7.i.i ], [ 0, %cond.end.i196.i ]
%cond16.i.i = tail call i32 @llvm.smax.i32(i32 %cond.i197.i, i32 %cond11.i.i)
%add.i198.i = add nsw i32 %cond16.i.i, 1
store i32 %add.i198.i, ptr %n.tr.i.i, align 8, !tbaa !23
%sub.i199.i = sub nsw i32 %cond.i197.i, %cond11.i.i
%cond24.i.i = tail call i32 @llvm.abs.i32(i32 %sub.i199.i, i1 true)
%cmp25.i.i = icmp ugt i32 %cond24.i.i, 1
br i1 %cmp25.i.i, label %if.then26.i.i, label %cond.end10.if.end31_crit_edge.i.i
cond.end10.if.end31_crit_edge.i.i: ; preds = %cond.end10.i.i
%p.phi.trans.insert.i.i = getelementptr inbounds %struct.Node, ptr %n.tr.i.i, i64 0, i32 2
%.pre.i200.i = load ptr, ptr %p.phi.trans.insert.i.i, align 8, !tbaa !46
br label %if.end31.i.i
if.then26.i.i: ; preds = %cond.end10.i.i
%cmp27.i202.i = icmp slt i32 %cond.i197.i, %cond11.i.i
%p1.i.i.i = getelementptr inbounds %struct.Node, ptr %n.tr.i.i, i64 0, i32 2
%155 = load ptr, ptr %p1.i.i.i, align 8, !tbaa !46
%cmp3.not.i.i.i = icmp eq ptr %155, null
br i1 %cmp27.i202.i, label %if.then28.i.i, label %if.else.i203.i
if.then28.i.i: ; preds = %if.then26.i.i
br i1 %cmp3.not.i.i.i, label %rotate_left.exit.i.i, label %if.then4.i.i.i
if.then4.i.i.i: ; preds = %if.then28.i.i
%x.i.i.i = getelementptr inbounds %struct.Node, ptr %155, i64 0, i32 1
%156 = load i32, ptr %x.i.i.i, align 4, !tbaa !21
%x5.i.i.i = getelementptr inbounds %struct.Node, ptr %153, i64 0, i32 1
%157 = load i32, ptr %x5.i.i.i, align 4, !tbaa !21
%cmp6.i.i.i = icmp sgt i32 %156, %157
%l.i.i.i = getelementptr inbounds %struct.Node, ptr %155, i64 0, i32 3
%r8.i.i.i = getelementptr inbounds %struct.Node, ptr %155, i64 0, i32 4
%l.sink.i.i.i = select i1 %cmp6.i.i.i, ptr %l.i.i.i, ptr %r8.i.i.i
store ptr %153, ptr %l.sink.i.i.i, align 8, !tbaa !17
br label %rotate_left.exit.i.i
rotate_left.exit.i.i: ; preds = %if.then4.i.i.i, %if.then28.i.i
store ptr %153, ptr %p1.i.i.i, align 8, !tbaa !46
%l12.i.i.i = getelementptr inbounds %struct.Node, ptr %153, i64 0, i32 3
%158 = load ptr, ptr %l12.i.i.i, align 8, !tbaa !44
store ptr %158, ptr %r4.i.i, align 8, !tbaa !45
%159 = load i32, ptr %153, align 8, !tbaa !23
%sub.i.i.i = add nsw i32 %159, -1
store i32 %sub.i.i.i, ptr %n.tr.i.i, align 8, !tbaa !23
%p15.i.i.i = getelementptr inbounds %struct.Node, ptr %153, i64 0, i32 2
store ptr %155, ptr %p15.i.i.i, align 8, !tbaa !46
store ptr %n.tr.i.i, ptr %l12.i.i.i, align 8, !tbaa !44
br label %if.end31.i.i
if.else.i203.i: ; preds = %if.then26.i.i
br i1 %cmp3.not.i.i.i, label %rotate_right.exit.i.i, label %if.then4.i64.i.i
if.then4.i64.i.i: ; preds = %if.else.i203.i
%x.i65.i.i = getelementptr inbounds %struct.Node, ptr %155, i64 0, i32 1
%160 = load i32, ptr %x.i65.i.i, align 4, !tbaa !21
%x5.i66.i.i = getelementptr inbounds %struct.Node, ptr %151, i64 0, i32 1
%161 = load i32, ptr %x5.i66.i.i, align 4, !tbaa !21
%cmp6.i67.i.i = icmp sgt i32 %160, %161
%l8.i.i.i = getelementptr inbounds %struct.Node, ptr %155, i64 0, i32 3
%r.i.i.i = getelementptr inbounds %struct.Node, ptr %155, i64 0, i32 4
%l8.sink.i.i.i = select i1 %cmp6.i67.i.i, ptr %l8.i.i.i, ptr %r.i.i.i
store ptr %151, ptr %l8.sink.i.i.i, align 8, !tbaa !17
br label %rotate_right.exit.i.i
rotate_right.exit.i.i: ; preds = %if.then4.i64.i.i, %if.else.i203.i
store ptr %151, ptr %p1.i.i.i, align 8, !tbaa !46
%r12.i.i.i = getelementptr inbounds %struct.Node, ptr %151, i64 0, i32 4
%162 = load ptr, ptr %r12.i.i.i, align 8, !tbaa !45
store ptr %162, ptr %l1.i.i, align 8, !tbaa !44
%163 = load i32, ptr %151, align 8, !tbaa !23
%sub.i68.i.i = add nsw i32 %163, -1
store i32 %sub.i68.i.i, ptr %n.tr.i.i, align 8, !tbaa !23
%p15.i69.i.i = getelementptr inbounds %struct.Node, ptr %151, i64 0, i32 2
store ptr %155, ptr %p15.i69.i.i, align 8, !tbaa !46
store ptr %n.tr.i.i, ptr %r12.i.i.i, align 8, !tbaa !45
br label %if.end31.i.i
if.end31.i.i: ; preds = %rotate_right.exit.i.i, %rotate_left.exit.i.i, %cond.end10.if.end31_crit_edge.i.i
%164 = phi ptr [ %155, %rotate_left.exit.i.i ], [ %155, %rotate_right.exit.i.i ], [ %.pre.i200.i, %cond.end10.if.end31_crit_edge.i.i ]
%n.addr.0.i.i = phi ptr [ %153, %rotate_left.exit.i.i ], [ %151, %rotate_right.exit.i.i ], [ %n.tr.i.i, %cond.end10.if.end31_crit_edge.i.i ]
%tobool.not.i.i = icmp eq ptr %164, null
br i1 %tobool.not.i.i, label %for.inc.i44, label %tailrecurse.i192.i
for.inc.i44: ; preds = %if.end31.i.i, %tailrecurse.i192.i, %free_state.exit141.i
%.pre71.i148283.i = phi i32 [ %52, %free_state.exit141.i ], [ %rem.i154.i, %tailrecurse.i192.i ], [ %rem.i154.i, %if.end31.i.i ]
%165 = phi i32 [ %53, %free_state.exit141.i ], [ %146, %tailrecurse.i192.i ], [ %146, %if.end31.i.i ]
%sub18.i167253.i = phi i32 [ %sub18.i167252.i, %free_state.exit141.i ], [ %sub18.i167254.i, %tailrecurse.i192.i ], [ %sub18.i167254.i, %if.end31.i.i ]
%166 = phi i32 [ %54, %free_state.exit141.i ], [ %inc.i143.i, %tailrecurse.i192.i ], [ %inc.i143.i, %if.end31.i.i ]
%root.2.i = phi ptr [ %root.1243.i, %free_state.exit141.i ], [ %n.addr.0.i.i, %if.end31.i.i ], [ null, %tailrecurse.i192.i ]
%indvars.iv.next.i45 = add nuw nsw i64 %indvars.iv.i42, 1
%exitcond.not.i46 = icmp eq i64 %indvars.iv.next.i45, 4
br i1 %exitcond.not.i46, label %for.end.i47, label %for.body.i41, !llvm.loop !47
for.end.i47: ; preds = %for.inc.i44
%167 = load i32, ptr %size.i67.i, align 4, !tbaa !5
%cmp7.i205.i = icmp sgt i32 %167, 0
br i1 %cmp7.i205.i, label %for.body.i210.i, label %free_state.exit215.i
for.body.i210.i: ; preds = %for.end.i47, %for.body.i210.i
%indvars.iv.i211.i = phi i64 [ %indvars.iv.next.i213.i, %for.body.i210.i ], [ 0, %for.end.i47 ]
%168 = load ptr, ptr %p.i93.i, align 8, !tbaa !16
%arrayidx.i212.i = getelementptr inbounds ptr, ptr %168, i64 %indvars.iv.i211.i
%169 = load ptr, ptr %arrayidx.i212.i, align 8, !tbaa !17
tail call void @free(ptr noundef %169) #9
%indvars.iv.next.i213.i = add nuw nsw i64 %indvars.iv.i211.i, 1
%170 = load i32, ptr %size.i67.i, align 4, !tbaa !5
%171 = sext i32 %170 to i64
%cmp.i214.i = icmp slt i64 %indvars.iv.next.i213.i, %171
br i1 %cmp.i214.i, label %for.body.i210.i, label %free_state.exit215.i, !llvm.loop !27
free_state.exit215.i: ; preds = %for.body.i210.i, %for.end.i47
%172 = load ptr, ptr %p.i93.i, align 8, !tbaa !16
tail call void @free(ptr noundef %172) #9
tail call void @free(ptr noundef nonnull %43) #9
%cmp.i = icmp sgt i32 %166, 0
br i1 %cmp.i, label %dequeue.exit.i, label %while.cond.while.end.loopexit_crit_edge.i, !llvm.loop !48
while.cond.while.end.loopexit_crit_edge.i: ; preds = %free_state.exit215.i
store i32 %sub18.i167253.i, ptr %call.i.i, align 8, !tbaa !24
store i32 %165, ptr %max.i.i, align 4, !tbaa !25
%.pre286.pre.pre.i = load ptr, ptr %arr.i.i, align 8, !tbaa !19
br label %while.end.loopexit.i
dequeue.exit.while.end.loopexit_crit_edge.i: ; preds = %dequeue.exit.i
store i32 %rem.i57.i, ptr %call.i.i, align 8, !tbaa !24
store i32 %40, ptr %max.i.i, align 4, !tbaa !25
br label %while.end.loopexit.i
while.end.loopexit.i: ; preds = %dequeue.exit.while.end.loopexit_crit_edge.i, %while.cond.while.end.loopexit_crit_edge.i
%.pre286.pre.i = phi ptr [ %.pre286.pre.pre.i, %while.cond.while.end.loopexit_crit_edge.i ], [ %42, %dequeue.exit.while.end.loopexit_crit_edge.i ]
%173 = phi i32 [ %165, %while.cond.while.end.loopexit_crit_edge.i ], [ %40, %dequeue.exit.while.end.loopexit_crit_edge.i ]
%174 = phi i32 [ %.pre71.i148283.i, %while.cond.while.end.loopexit_crit_edge.i ], [ %.pre71.i148281.i, %dequeue.exit.while.end.loopexit_crit_edge.i ]
%175 = phi i32 [ %sub18.i167253.i, %while.cond.while.end.loopexit_crit_edge.i ], [ %rem.i57.i, %dequeue.exit.while.end.loopexit_crit_edge.i ]
%176 = phi i32 [ %166, %while.cond.while.end.loopexit_crit_edge.i ], [ %dec.i.i, %dequeue.exit.while.end.loopexit_crit_edge.i ]
%root.0.lcssa.i = phi ptr [ %root.2.i, %while.cond.while.end.loopexit_crit_edge.i ], [ %root.0248.i, %dequeue.exit.while.end.loopexit_crit_edge.i ]
store i32 %176, ptr %size1.i.i, align 8, !tbaa !26
br label %while.end.i
while.end.i: ; preds = %while.end.loopexit.i, %free_state.exit.i
%.pre286.i = phi ptr [ %42, %free_state.exit.i ], [ %.pre286.pre.i, %while.end.loopexit.i ]
%177 = phi i32 [ %40, %free_state.exit.i ], [ %173, %while.end.loopexit.i ]
%178 = phi i32 [ %.pre71.i148281.i, %free_state.exit.i ], [ %174, %while.end.loopexit.i ]
%call.i.promoted262.i = phi i32 [ %rem.i57.i, %free_state.exit.i ], [ %175, %while.end.loopexit.i ]
%root.0238.i = phi ptr [ %root.0248.i, %free_state.exit.i ], [ %root.0.lcssa.i, %while.end.loopexit.i ]
%cnt.0.i = phi i32 [ %45, %free_state.exit.i ], [ -1, %while.end.loopexit.i ]
%cmp13.i.i = icmp slt i32 %call.i.promoted262.i, %178
br i1 %cmp13.i.i, label %while.body.i.i, label %eight_puzzle.exit
while.body.i.i: ; preds = %while.end.i, %free_state.exit.i.i
%rem.i224263.i = phi i32 [ %rem.i224.i, %free_state.exit.i.i ], [ %call.i.promoted262.i, %while.end.i ]
%idxprom.i219.i = sext i32 %rem.i224263.i to i64
%arrayidx.i220.i = getelementptr inbounds ptr, ptr %.pre286.i, i64 %idxprom.i219.i
%179 = load ptr, ptr %arrayidx.i220.i, align 8, !tbaa !17
%size.i.i221.i = getelementptr inbounds %struct.state_t, ptr %179, i64 0, i32 1
%180 = load i32, ptr %size.i.i221.i, align 4, !tbaa !5
%cmp7.i.i.i = icmp sgt i32 %180, 0
br i1 %cmp7.i.i.i, label %for.body.lr.ph.i.i226.i, label %free_state.exit.i.i
for.body.lr.ph.i.i226.i: ; preds = %while.body.i.i
%p.i.i227.i = getelementptr inbounds %struct.state_t, ptr %179, i64 0, i32 3
br label %for.body.i.i228.i
for.body.i.i228.i: ; preds = %for.body.i.i228.i, %for.body.lr.ph.i.i226.i
%indvars.iv.i.i229.i = phi i64 [ 0, %for.body.lr.ph.i.i226.i ], [ %indvars.iv.next.i.i231.i, %for.body.i.i228.i ]
%181 = load ptr, ptr %p.i.i227.i, align 8, !tbaa !16
%arrayidx.i.i230.i = getelementptr inbounds ptr, ptr %181, i64 %indvars.iv.i.i229.i
%182 = load ptr, ptr %arrayidx.i.i230.i, align 8, !tbaa !17
tail call void @free(ptr noundef %182) #9
%indvars.iv.next.i.i231.i = add nuw nsw i64 %indvars.iv.i.i229.i, 1
%183 = load i32, ptr %size.i.i221.i, align 4, !tbaa !5
%184 = sext i32 %183 to i64
%cmp.i.i.i = icmp slt i64 %indvars.iv.next.i.i231.i, %184
br i1 %cmp.i.i.i, label %for.body.i.i228.i, label %free_state.exit.i.i, !llvm.loop !27
free_state.exit.i.i: ; preds = %for.body.i.i228.i, %while.body.i.i
%p1.i.i222.i = getelementptr inbounds %struct.state_t, ptr %179, i64 0, i32 3
%185 = load ptr, ptr %p1.i.i222.i, align 8, !tbaa !16
tail call void @free(ptr noundef %185) #9
tail call void @free(ptr noundef nonnull %179) #9
%add.i223.i = add nsw i32 %rem.i224263.i, 1
%rem.i224.i = srem i32 %add.i223.i, %177
%cmp.i225.i = icmp slt i32 %rem.i224.i, %178
br i1 %cmp.i225.i, label %while.body.i.i, label %free_queue.exit.loopexit.i, !llvm.loop !49
free_queue.exit.loopexit.i: ; preds = %free_state.exit.i.i
store i32 %rem.i224.i, ptr %call.i.i, align 8, !tbaa !24
br label %eight_puzzle.exit
eight_puzzle.exit: ; preds = %while.end.i, %free_queue.exit.loopexit.i
tail call void @free(ptr noundef %.pre286.i) #9
tail call void @free(ptr noundef nonnull %call.i.i) #9
tail call fastcc void @free_node(ptr noundef %root.0238.i)
%call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.i)
%186 = load i32, ptr %size1.i, align 4, !tbaa !5
%cmp7.i = icmp sgt i32 %186, 0
%.pre = load ptr, ptr %p.i, align 8, !tbaa !16
br i1 %cmp7.i, label %for.body.i51.preheader, label %free_state.exit
for.body.i51.preheader: ; preds = %eight_puzzle.exit
%187 = zext i32 %186 to i64
br label %for.body.i51
for.body.i51: ; preds = %for.body.i51.preheader, %for.body.i51
%indvars.iv.i52 = phi i64 [ %indvars.iv.next.i54, %for.body.i51 ], [ 0, %for.body.i51.preheader ]
%arrayidx.i53 = getelementptr inbounds ptr, ptr %.pre, i64 %indvars.iv.i52
%188 = load ptr, ptr %arrayidx.i53, align 8, !tbaa !17
tail call void @free(ptr noundef %188) #9
%indvars.iv.next.i54 = add nuw nsw i64 %indvars.iv.i52, 1
%exitcond.not = icmp eq i64 %indvars.iv.next.i54, %187
br i1 %exitcond.not, label %free_state.exit, label %for.body.i51, !llvm.loop !27
free_state.exit: ; preds = %for.body.i51, %eight_puzzle.exit
tail call void @free(ptr noundef %.pre) #9
tail call void @free(ptr noundef nonnull %call.i) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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: nounwind uwtable
define internal fastcc void @free_node(ptr noundef %n) unnamed_addr #0 {
entry:
%cmp = icmp eq ptr %n, null
br i1 %cmp, label %common.ret4, label %if.end
common.ret4: ; preds = %entry, %if.end
ret void
if.end: ; preds = %entry
%l = getelementptr inbounds %struct.Node, ptr %n, i64 0, i32 3
%0 = load ptr, ptr %l, align 8, !tbaa !44
tail call fastcc void @free_node(ptr noundef %0)
%r = getelementptr inbounds %struct.Node, ptr %n, i64 0, i32 4
%1 = load ptr, ptr %r, align 8, !tbaa !45
tail call fastcc void @free_node(ptr noundef %1)
tail call void @free(ptr noundef nonnull %n) #9
br label %common.ret4
}
; 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 #3
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #5
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn 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 #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
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 = !{!6, !7, i64 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !11, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"", !7, i64 0, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !7, i64 28}
!14 = !{!6, !7, i64 24}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !10, i64 16}
!17 = !{!10, !10, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !10, i64 16}
!20 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16}
!21 = !{!22, !7, i64 4}
!22 = !{!"Node", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24}
!23 = !{!22, !7, i64 0}
!24 = !{!20, !7, i64 0}
!25 = !{!20, !7, i64 12}
!26 = !{!20, !7, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = distinct !{!30, !28, !31, !32}
!31 = !{!"llvm.loop.isvectorized", i32 1}
!32 = !{!"llvm.loop.unroll.runtime.disable"}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.unroll.disable"}
!35 = distinct !{!35, !28, !31}
!36 = distinct !{!36, !28}
!37 = !{!8, !8, i64 0}
!38 = distinct !{!38, !28, !31, !32}
!39 = distinct !{!39, !28, !32, !31}
!40 = distinct !{!40, !28}
!41 = distinct !{!41, !28}
!42 = distinct !{!42, !28}
!43 = !{!20, !7, i64 4}
!44 = !{!22, !10, i64 16}
!45 = !{!22, !10, i64 24}
!46 = !{!22, !10, i64 8}
!47 = distinct !{!47, !28}
!48 = distinct !{!48, !28}
!49 = distinct !{!49, !28}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define N 3
#define SPACE 9
#define QUEUE_MAX 400000
#define TRUE 1
#define FALSE 0
typedef struct P {
int steps;
int board[N*N];
int space;
} puzzle;
int solve(puzzle);
puzzle queue[QUEUE_MAX];
int q_top = 0;
int q_tail = 0;
puzzle q_pop() {
puzzle result = queue[q_top];
q_top++;
q_top %= QUEUE_MAX;
return result;
}
void q_push(puzzle p) {
queue[q_tail] = p;
q_tail++;
q_tail %= QUEUE_MAX;
}
int q_size(){
if(q_tail >= q_top){
return q_tail - q_top;
}
else {
return q_tail + QUEUE_MAX - q_top;
}
}
struct node {
struct node* nodes[N*N + 1];
};
typedef struct node * NodePointer;
NodePointer makeNode() {
NodePointer node;
node = malloc(sizeof(struct node));
for(int i = 0; i < N*N + 1; i++){
node->nodes[i] = NULL;
}
return node;
}
NodePointer memTree;
int exists(puzzle *p){
NodePointer current = memTree;
for(int i = 0; i < N*N; i++){
// printf("%d, ", p->board[i]);
if(current->nodes[p->board[i]] == NULL){
//printf("DEPTH = %d NOT FOUND\n", i);
return FALSE;
}
current = current->nodes[p->board[i]];
}
//printf("FOUND!!\n");
return TRUE;
}
void addToMem(puzzle *p){
NodePointer current = memTree;
for(int i = 0; i < N*N; i++){
//printf("DEPTH = %d ADDING\n", i);
if(current->nodes[p->board[i]] == NULL){
current->nodes[p->board[i]] = makeNode();
}
current = current->nodes[p->board[i]];
}
}
int main() {
puzzle input;
for(int i = 0; i < N*N ; i++){
scanf("%d", &(input.board[i]));
if(input.board[i] == 0) {
input.board[i] = SPACE;
input.space = i;
}
// printf("%d ", input.board[i]);
}
memTree = makeNode();
input.steps = 0;
//debug
//addToMem(&input);
//exists(&input);
printf("%d\n", solve(input));
return 0;
}
int gameClear(puzzle* p){
for(int i = 0; i < N*N ; i++){
if(p->board[i] != i + 1){
return FALSE;
}
}
return TRUE;
}
//solve by BFS
int solve(puzzle s) {
int result = 0;
int dx[4] = {0,1,0,-1};
int dy[4] = {-1,0,1,0};
char dir[4][6] = {"up", "right", "down", "left"};
//printf("steps %d\n", s.steps);
q_push(s);
addToMem(&s);
while(q_size() > 0){
puzzle u = q_pop();
//printf("steps %d\n", u.steps);
if(gameClear(&u)){
result = u.steps;
break;
}
int col = u.space / N;
int row = u.space % N;
//printf("space (%d, %d)\n", col, row);
for(int i = 0; i < 4; i++){
int tc = col + dy[i];
int tr = row + dx[i];
if(tc < 0 || tr < 0 || tc >= N || tr >= N){
continue;
}
//printf("try to %s\n", dir[i]);
puzzle v = u;
int tmp = v.board[tc*N + tr];
v.board[tc*N + tr] = v.board[u.space];
v.board[u.space] = tmp;
if(!exists(&v)){
v.space = tc*N + tr;
v.steps = u.steps + 1;
q_push(v);
addToMem(&v);
}
}
}
return result;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189133/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189133/source.c"
target datalayout = "e-m:e-p270: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 { i32, [9 x i32], i32 }
@q_top = dso_local local_unnamed_addr global i32 0, align 4
@q_tail = dso_local local_unnamed_addr global i32 0, align 4
@queue = dso_local local_unnamed_addr global [400000 x %struct.P] zeroinitializer, align 16
@memTree = dso_local local_unnamed_addr global ptr null, align 8
@.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
@__const.solve.dx = private unnamed_addr constant [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@__const.solve.dy = private unnamed_addr constant [4 x i32] [i32 -1, i32 0, i32 1, i32 0], align 16
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @q_pop(ptr noalias nocapture writeonly sret(%struct.P) align 4 %agg.result) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @q_top, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [400000 x %struct.P], ptr @queue, i64 0, i64 %idxprom
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) %agg.result, ptr noundef nonnull align 4 dereferenceable(44) %arrayidx, i64 44, i1 false), !tbaa.struct !9
%inc = add nsw i32 %0, 1
%rem = srem i32 %inc, 400000
store i32 %rem, ptr @q_top, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @q_push(ptr nocapture noundef readonly byval(%struct.P) align 8 %p) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @q_tail, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [400000 x %struct.P], ptr @queue, i64 0, i64 %idxprom
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) %arrayidx, ptr noundef nonnull align 8 dereferenceable(44) %p, i64 44, i1 false), !tbaa.struct !9
%inc = add nsw i32 %0, 1
%rem = srem i32 %inc, 400000
store i32 %rem, ptr @q_tail, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @q_size() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @q_tail, align 4, !tbaa !5
%1 = load i32, ptr @q_top, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%add = add nsw i32 %0, 400000
%.pn = select i1 %cmp.not, i32 %add, i32 %0
%retval.0 = sub nsw i32 %.pn, %1
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @makeNode() local_unnamed_addr #3 {
entry:
%calloc = tail call dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
ret ptr %calloc
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @exists(ptr nocapture noundef readonly %p) local_unnamed_addr #5 {
entry:
%0 = load ptr, ptr @memTree, align 8, !tbaa !11
%arrayidx = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 0
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %1 to i64
%arrayidx2 = getelementptr inbounds [10 x ptr], ptr %0, i64 0, i64 %idxprom1
%2 = load ptr, ptr %arrayidx2, align 8, !tbaa !11
%cmp3 = icmp eq ptr %2, null
br i1 %cmp3, label %cleanup, label %for.cond
for.cond: ; preds = %entry
%arrayidx.1 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 1
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%idxprom1.1 = sext i32 %3 to i64
%arrayidx2.1 = getelementptr inbounds [10 x ptr], ptr %2, i64 0, i64 %idxprom1.1
%4 = load ptr, ptr %arrayidx2.1, align 8, !tbaa !11
%cmp3.1 = icmp eq ptr %4, null
br i1 %cmp3.1, label %cleanup, label %for.cond.1
for.cond.1: ; preds = %for.cond
%arrayidx.2 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 2
%5 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%idxprom1.2 = sext i32 %5 to i64
%arrayidx2.2 = getelementptr inbounds [10 x ptr], ptr %4, i64 0, i64 %idxprom1.2
%6 = load ptr, ptr %arrayidx2.2, align 8, !tbaa !11
%cmp3.2 = icmp eq ptr %6, null
br i1 %cmp3.2, label %cleanup, label %for.cond.2
for.cond.2: ; preds = %for.cond.1
%arrayidx.3 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 3
%7 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%idxprom1.3 = sext i32 %7 to i64
%arrayidx2.3 = getelementptr inbounds [10 x ptr], ptr %6, i64 0, i64 %idxprom1.3
%8 = load ptr, ptr %arrayidx2.3, align 8, !tbaa !11
%cmp3.3 = icmp eq ptr %8, null
br i1 %cmp3.3, label %cleanup, label %for.cond.3
for.cond.3: ; preds = %for.cond.2
%arrayidx.4 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 4
%9 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%idxprom1.4 = sext i32 %9 to i64
%arrayidx2.4 = getelementptr inbounds [10 x ptr], ptr %8, i64 0, i64 %idxprom1.4
%10 = load ptr, ptr %arrayidx2.4, align 8, !tbaa !11
%cmp3.4 = icmp eq ptr %10, null
br i1 %cmp3.4, label %cleanup, label %for.cond.4
for.cond.4: ; preds = %for.cond.3
%arrayidx.5 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 5
%11 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%idxprom1.5 = sext i32 %11 to i64
%arrayidx2.5 = getelementptr inbounds [10 x ptr], ptr %10, i64 0, i64 %idxprom1.5
%12 = load ptr, ptr %arrayidx2.5, align 8, !tbaa !11
%cmp3.5 = icmp eq ptr %12, null
br i1 %cmp3.5, label %cleanup, label %for.cond.5
for.cond.5: ; preds = %for.cond.4
%arrayidx.6 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 6
%13 = load i32, ptr %arrayidx.6, align 4, !tbaa !5
%idxprom1.6 = sext i32 %13 to i64
%arrayidx2.6 = getelementptr inbounds [10 x ptr], ptr %12, i64 0, i64 %idxprom1.6
%14 = load ptr, ptr %arrayidx2.6, align 8, !tbaa !11
%cmp3.6 = icmp eq ptr %14, null
br i1 %cmp3.6, label %cleanup, label %for.cond.6
for.cond.6: ; preds = %for.cond.5
%arrayidx.7 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 7
%15 = load i32, ptr %arrayidx.7, align 4, !tbaa !5
%idxprom1.7 = sext i32 %15 to i64
%arrayidx2.7 = getelementptr inbounds [10 x ptr], ptr %14, i64 0, i64 %idxprom1.7
%16 = load ptr, ptr %arrayidx2.7, align 8, !tbaa !11
%cmp3.7 = icmp eq ptr %16, null
br i1 %cmp3.7, label %cleanup, label %for.cond.7
for.cond.7: ; preds = %for.cond.6
%arrayidx.8 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 8
%17 = load i32, ptr %arrayidx.8, align 4, !tbaa !5
%idxprom1.8 = sext i32 %17 to i64
%arrayidx2.8 = getelementptr inbounds [10 x ptr], ptr %16, i64 0, i64 %idxprom1.8
%18 = load ptr, ptr %arrayidx2.8, align 8, !tbaa !11
%cmp3.8 = icmp ne ptr %18, null
%spec.select = zext i1 %cmp3.8 to i32
br label %cleanup
cleanup: ; preds = %for.cond.7, %for.cond.6, %for.cond.5, %for.cond.4, %for.cond.3, %for.cond.2, %for.cond.1, %for.cond, %entry
%cmp.lcssa = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 0, %for.cond.1 ], [ 0, %for.cond.2 ], [ 0, %for.cond.3 ], [ 0, %for.cond.4 ], [ 0, %for.cond.5 ], [ 0, %for.cond.6 ], [ %spec.select, %for.cond.7 ]
ret i32 %cmp.lcssa
}
; Function Attrs: mustprogress nofree nounwind willreturn uwtable
define dso_local void @addToMem(ptr nocapture noundef readonly %p) local_unnamed_addr #6 {
entry:
%current.0 = load ptr, ptr @memTree, align 8, !tbaa !11
%arrayidx = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 0
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %0 to i64
%arrayidx2 = getelementptr inbounds [10 x ptr], ptr %current.0, i64 0, i64 %idxprom1
%1 = load ptr, ptr %arrayidx2, align 8, !tbaa !11
%cmp3 = icmp eq ptr %1, null
br i1 %cmp3, label %if.then, label %if.end
if.then: ; preds = %entry
%calloc.i = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i, ptr %arrayidx2, align 8, !tbaa !11
br label %if.end
if.end: ; preds = %if.then, %entry
%current.0.1 = phi ptr [ %calloc.i, %if.then ], [ %1, %entry ]
%arrayidx.1 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 1
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%idxprom1.1 = sext i32 %2 to i64
%arrayidx2.1 = getelementptr inbounds [10 x ptr], ptr %current.0.1, i64 0, i64 %idxprom1.1
%3 = load ptr, ptr %arrayidx2.1, align 8, !tbaa !11
%cmp3.1 = icmp eq ptr %3, null
br i1 %cmp3.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %if.end
%calloc.i.1 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.1, ptr %arrayidx2.1, align 8, !tbaa !11
br label %if.end.1
if.end.1: ; preds = %if.then.1, %if.end
%current.0.2 = phi ptr [ %calloc.i.1, %if.then.1 ], [ %3, %if.end ]
%arrayidx.2 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 2
%4 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%idxprom1.2 = sext i32 %4 to i64
%arrayidx2.2 = getelementptr inbounds [10 x ptr], ptr %current.0.2, i64 0, i64 %idxprom1.2
%5 = load ptr, ptr %arrayidx2.2, align 8, !tbaa !11
%cmp3.2 = icmp eq ptr %5, null
br i1 %cmp3.2, label %if.then.2, label %if.end.2
if.then.2: ; preds = %if.end.1
%calloc.i.2 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.2, ptr %arrayidx2.2, align 8, !tbaa !11
br label %if.end.2
if.end.2: ; preds = %if.then.2, %if.end.1
%current.0.3 = phi ptr [ %calloc.i.2, %if.then.2 ], [ %5, %if.end.1 ]
%arrayidx.3 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 3
%6 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%idxprom1.3 = sext i32 %6 to i64
%arrayidx2.3 = getelementptr inbounds [10 x ptr], ptr %current.0.3, i64 0, i64 %idxprom1.3
%7 = load ptr, ptr %arrayidx2.3, align 8, !tbaa !11
%cmp3.3 = icmp eq ptr %7, null
br i1 %cmp3.3, label %if.then.3, label %if.end.3
if.then.3: ; preds = %if.end.2
%calloc.i.3 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.3, ptr %arrayidx2.3, align 8, !tbaa !11
br label %if.end.3
if.end.3: ; preds = %if.then.3, %if.end.2
%current.0.4 = phi ptr [ %calloc.i.3, %if.then.3 ], [ %7, %if.end.2 ]
%arrayidx.4 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 4
%8 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%idxprom1.4 = sext i32 %8 to i64
%arrayidx2.4 = getelementptr inbounds [10 x ptr], ptr %current.0.4, i64 0, i64 %idxprom1.4
%9 = load ptr, ptr %arrayidx2.4, align 8, !tbaa !11
%cmp3.4 = icmp eq ptr %9, null
br i1 %cmp3.4, label %if.then.4, label %if.end.4
if.then.4: ; preds = %if.end.3
%calloc.i.4 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.4, ptr %arrayidx2.4, align 8, !tbaa !11
br label %if.end.4
if.end.4: ; preds = %if.then.4, %if.end.3
%current.0.5 = phi ptr [ %calloc.i.4, %if.then.4 ], [ %9, %if.end.3 ]
%arrayidx.5 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 5
%10 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%idxprom1.5 = sext i32 %10 to i64
%arrayidx2.5 = getelementptr inbounds [10 x ptr], ptr %current.0.5, i64 0, i64 %idxprom1.5
%11 = load ptr, ptr %arrayidx2.5, align 8, !tbaa !11
%cmp3.5 = icmp eq ptr %11, null
br i1 %cmp3.5, label %if.then.5, label %if.end.5
if.then.5: ; preds = %if.end.4
%calloc.i.5 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.5, ptr %arrayidx2.5, align 8, !tbaa !11
br label %if.end.5
if.end.5: ; preds = %if.then.5, %if.end.4
%current.0.6 = phi ptr [ %calloc.i.5, %if.then.5 ], [ %11, %if.end.4 ]
%arrayidx.6 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 6
%12 = load i32, ptr %arrayidx.6, align 4, !tbaa !5
%idxprom1.6 = sext i32 %12 to i64
%arrayidx2.6 = getelementptr inbounds [10 x ptr], ptr %current.0.6, i64 0, i64 %idxprom1.6
%13 = load ptr, ptr %arrayidx2.6, align 8, !tbaa !11
%cmp3.6 = icmp eq ptr %13, null
br i1 %cmp3.6, label %if.then.6, label %if.end.6
if.then.6: ; preds = %if.end.5
%calloc.i.6 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.6, ptr %arrayidx2.6, align 8, !tbaa !11
br label %if.end.6
if.end.6: ; preds = %if.then.6, %if.end.5
%current.0.7 = phi ptr [ %calloc.i.6, %if.then.6 ], [ %13, %if.end.5 ]
%arrayidx.7 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 7
%14 = load i32, ptr %arrayidx.7, align 4, !tbaa !5
%idxprom1.7 = sext i32 %14 to i64
%arrayidx2.7 = getelementptr inbounds [10 x ptr], ptr %current.0.7, i64 0, i64 %idxprom1.7
%15 = load ptr, ptr %arrayidx2.7, align 8, !tbaa !11
%cmp3.7 = icmp eq ptr %15, null
br i1 %cmp3.7, label %if.then.7, label %if.end.7
if.then.7: ; preds = %if.end.6
%calloc.i.7 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.7, ptr %arrayidx2.7, align 8, !tbaa !11
br label %if.end.7
if.end.7: ; preds = %if.then.7, %if.end.6
%current.0.8 = phi ptr [ %calloc.i.7, %if.then.7 ], [ %15, %if.end.6 ]
%arrayidx.8 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 8
%16 = load i32, ptr %arrayidx.8, align 4, !tbaa !5
%idxprom1.8 = sext i32 %16 to i64
%arrayidx2.8 = getelementptr inbounds [10 x ptr], ptr %current.0.8, i64 0, i64 %idxprom1.8
%17 = load ptr, ptr %arrayidx2.8, align 8, !tbaa !11
%cmp3.8 = icmp eq ptr %17, null
br i1 %cmp3.8, label %if.then.8, label %if.end.8
if.then.8: ; preds = %if.end.7
%calloc.i.8 = tail call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i.8, ptr %arrayidx2.8, align 8, !tbaa !11
br label %if.end.8
if.end.8: ; preds = %if.then.8, %if.end.7
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%input = alloca %struct.P, align 8
call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %input) #11
%space = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 2
%arrayidx = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 0
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp4 = icmp eq i32 %0, 0
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %entry
store i32 9, ptr %arrayidx, align 4, !tbaa !5
store i32 0, ptr %space, align 8, !tbaa !13
br label %for.inc
for.inc: ; preds = %entry, %if.then
%arrayidx.1 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%1 = load i32, ptr %arrayidx.1, align 8, !tbaa !5
%cmp4.1 = icmp eq i32 %1, 0
br i1 %cmp4.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 9, ptr %arrayidx.1, align 8, !tbaa !5
store i32 1, ptr %space, align 8, !tbaa !13
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%arrayidx.2 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%cmp4.2 = icmp eq i32 %2, 0
br i1 %cmp4.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i32 9, ptr %arrayidx.2, align 4, !tbaa !5
store i32 2, ptr %space, align 8, !tbaa !13
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%arrayidx.3 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%3 = load i32, ptr %arrayidx.3, align 8, !tbaa !5
%cmp4.3 = icmp eq i32 %3, 0
br i1 %cmp4.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
store i32 9, ptr %arrayidx.3, align 8, !tbaa !5
store i32 3, ptr %space, align 8, !tbaa !13
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%arrayidx.4 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%4 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%cmp4.4 = icmp eq i32 %4, 0
br i1 %cmp4.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
store i32 9, ptr %arrayidx.4, align 4, !tbaa !5
store i32 4, ptr %space, align 8, !tbaa !13
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%arrayidx.5 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%5 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
%cmp4.5 = icmp eq i32 %5, 0
br i1 %cmp4.5, label %if.then.5, label %for.inc.5
if.then.5: ; preds = %for.inc.4
store i32 9, ptr %arrayidx.5, align 8, !tbaa !5
store i32 5, ptr %space, align 8, !tbaa !13
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%arrayidx.6 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 6
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6)
%6 = load i32, ptr %arrayidx.6, align 4, !tbaa !5
%cmp4.6 = icmp eq i32 %6, 0
br i1 %cmp4.6, label %if.then.6, label %for.inc.6
if.then.6: ; preds = %for.inc.5
store i32 9, ptr %arrayidx.6, align 4, !tbaa !5
store i32 6, ptr %space, align 8, !tbaa !13
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%arrayidx.7 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 7
%call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.7)
%7 = load i32, ptr %arrayidx.7, align 8, !tbaa !5
%cmp4.7 = icmp eq i32 %7, 0
br i1 %cmp4.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
store i32 9, ptr %arrayidx.7, align 8, !tbaa !5
store i32 7, ptr %space, align 8, !tbaa !13
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%arrayidx.8 = getelementptr inbounds %struct.P, ptr %input, i64 0, i32 1, i64 8
%call.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.8)
%8 = load i32, ptr %arrayidx.8, align 4, !tbaa !5
%cmp4.8 = icmp eq i32 %8, 0
br i1 %cmp4.8, label %if.then.8, label %for.inc.8
if.then.8: ; preds = %for.inc.7
store i32 9, ptr %arrayidx.8, align 4, !tbaa !5
store i32 8, ptr %space, align 8, !tbaa !13
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%calloc.i = call noalias dereferenceable_or_null(80) ptr @calloc(i64 1, i64 80)
store ptr %calloc.i, ptr @memTree, align 8, !tbaa !11
store i32 0, ptr %input, align 8, !tbaa !15
%call9 = call i32 @solve(ptr noundef nonnull byval(%struct.P) align 8 %input)
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call9)
call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %input) #11
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @solve(ptr nocapture noundef readonly byval(%struct.P) align 8 %s) local_unnamed_addr #7 {
entry:
%v = alloca %struct.P, align 8
%0 = load i32, ptr @q_tail, align 4, !tbaa !5
%idxprom.i = sext i32 %0 to i64
%arrayidx.i = getelementptr inbounds [400000 x %struct.P], ptr @queue, i64 0, i64 %idxprom.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) %arrayidx.i, ptr noundef nonnull align 8 dereferenceable(44) %s, i64 44, i1 false)
%inc.i = add nsw i32 %0, 1
%rem.i = srem i32 %inc.i, 400000
store i32 %rem.i, ptr @q_tail, align 4, !tbaa !5
call void @addToMem(ptr noundef nonnull %s)
%1 = load i32, ptr @q_tail, align 4, !tbaa !5
%2 = load i32, ptr @q_top, align 4, !tbaa !5
%cmp.not.i120 = icmp slt i32 %1, %2
%add.i121 = add nsw i32 %1, 400000
%.pn.i122 = select i1 %cmp.not.i120, i32 %add.i121, i32 %1
%cmp123 = icmp sgt i32 %.pn.i122, %2
br i1 %cmp123, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%u.sroa.6.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 4
%u.sroa.7.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 8
%u.sroa.8.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 12
%u.sroa.9.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 16
%u.sroa.10.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 20
%u.sroa.11.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 24
%u.sroa.12.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 28
%u.sroa.13.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 32
%u.sroa.14.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 36
%u.sroa.15.0.v.sroa_idx = getelementptr inbounds i8, ptr %v, i64 40
br label %while.body
while.cond.loopexit: ; preds = %cleanup
%3 = load i32, ptr @q_tail, align 4, !tbaa !5
%4 = load i32, ptr @q_top, align 4, !tbaa !5
%cmp.not.i = icmp slt i32 %3, %4
%add.i = add nsw i32 %3, 400000
%.pn.i = select i1 %cmp.not.i, i32 %add.i, i32 %3
%cmp = icmp sgt i32 %.pn.i, %4
br i1 %cmp, label %while.body, label %while.end
while.body: ; preds = %while.body.lr.ph, %while.cond.loopexit
%5 = phi i32 [ %2, %while.body.lr.ph ], [ %4, %while.cond.loopexit ]
%idxprom.i64 = sext i32 %5 to i64
%arrayidx.i65 = getelementptr inbounds [400000 x %struct.P], ptr @queue, i64 0, i64 %idxprom.i64
%u.sroa.0.0.copyload93 = load i32, ptr %arrayidx.i65, align 4, !tbaa.struct !9
%u.sroa.6.0.arrayidx.i65.sroa_idx = getelementptr inbounds i8, ptr %arrayidx.i65, i64 4
%u.sroa.14.0.arrayidx.i65.sroa_idx = getelementptr inbounds i8, ptr %arrayidx.i65, i64 36
%u.sroa.14.0.copyload102 = load i32, ptr %u.sroa.14.0.arrayidx.i65.sroa_idx, align 4, !tbaa.struct !16
%u.sroa.15.0.arrayidx.i65.sroa_idx = getelementptr inbounds i8, ptr %arrayidx.i65, i64 40
%u.sroa.15.0.copyload103 = load i32, ptr %u.sroa.15.0.arrayidx.i65.sroa_idx, align 4, !tbaa.struct !17
%inc.i66 = add nsw i32 %5, 1
%rem.i67 = srem i32 %inc.i66, 400000
store i32 %rem.i67, ptr @q_top, align 4, !tbaa !5, !noalias !18
%6 = load <8 x i32>, ptr %u.sroa.6.0.arrayidx.i65.sroa_idx, align 4
%.fr = freeze <8 x i32> %6
%7 = icmp ne <8 x i32> %.fr, <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
%cmp1.not.8.i.not = icmp eq i32 %u.sroa.14.0.copyload102, 9
%8 = bitcast <8 x i1> %7 to i8
%9 = icmp eq i8 %8, 0
%op.rdx = select i1 %9, i1 %cmp1.not.8.i.not, i1 false
br i1 %op.rdx, label %while.end, label %if.end, !llvm.loop !21
if.end: ; preds = %while.body
%div = sdiv i32 %u.sroa.15.0.copyload103, 3
%rem = srem i32 %u.sroa.15.0.copyload103, 3
%idxprom20 = sext i32 %u.sroa.15.0.copyload103 to i64
%arrayidx21 = getelementptr inbounds %struct.P, ptr %v, i64 0, i32 1, i64 %idxprom20
%add38 = add nsw i32 %u.sroa.0.0.copyload93, 1
%10 = extractelement <8 x i32> %.fr, i64 0
%11 = extractelement <8 x i32> %.fr, i64 1
%12 = extractelement <8 x i32> %.fr, i64 2
%13 = extractelement <8 x i32> %.fr, i64 3
%14 = extractelement <8 x i32> %.fr, i64 4
%15 = extractelement <8 x i32> %.fr, i64 5
%16 = extractelement <8 x i32> %.fr, i64 6
%17 = extractelement <8 x i32> %.fr, i64 7
br label %for.body
for.body: ; preds = %if.end, %cleanup
%indvars.iv = phi i64 [ 0, %if.end ], [ %indvars.iv.next, %cleanup ]
%arrayidx = getelementptr inbounds [4 x i32], ptr @__const.solve.dy, i64 0, i64 %indvars.iv
%18 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %18, %div
%arrayidx5 = getelementptr inbounds [4 x i32], ptr @__const.solve.dx, i64 0, i64 %indvars.iv
%19 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%add6 = add nsw i32 %19, %rem
%cmp8 = icmp slt i32 %add6, 0
%20 = icmp ugt i32 %add, 2
%or.cond50 = select i1 %20, i1 true, i1 %cmp8
%cmp12 = icmp sgt i32 %add6, 2
%or.cond51 = select i1 %or.cond50, i1 true, i1 %cmp12
br i1 %or.cond51, label %cleanup, label %if.end14
if.end14: ; preds = %for.body
store i32 %u.sroa.0.0.copyload93, ptr %v, align 8, !tbaa.struct !9
store i32 %10, ptr %u.sroa.6.0.v.sroa_idx, align 4, !tbaa.struct !23
store i32 %11, ptr %u.sroa.7.0.v.sroa_idx, align 8, !tbaa.struct !24
store i32 %12, ptr %u.sroa.8.0.v.sroa_idx, align 4, !tbaa.struct !25
store i32 %13, ptr %u.sroa.9.0.v.sroa_idx, align 8, !tbaa.struct !26
store i32 %14, ptr %u.sroa.10.0.v.sroa_idx, align 4, !tbaa.struct !27
store i32 %15, ptr %u.sroa.11.0.v.sroa_idx, align 8, !tbaa.struct !28
store i32 %16, ptr %u.sroa.12.0.v.sroa_idx, align 4, !tbaa.struct !29
store i32 %17, ptr %u.sroa.13.0.v.sroa_idx, align 8, !tbaa.struct !30
store i32 %u.sroa.14.0.copyload102, ptr %u.sroa.14.0.v.sroa_idx, align 4, !tbaa.struct !16
store i32 %u.sroa.15.0.copyload103, ptr %u.sroa.15.0.v.sroa_idx, align 8, !tbaa.struct !17
%mul = mul nuw nsw i32 %add, 3
%add15 = add nuw nsw i32 %mul, %add6
%idxprom16 = zext i32 %add15 to i64
%arrayidx17 = getelementptr inbounds %struct.P, ptr %v, i64 0, i32 1, i64 %idxprom16
%21 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%22 = load i32, ptr %arrayidx21, align 4, !tbaa !5
store i32 %22, ptr %arrayidx17, align 4, !tbaa !5
store i32 %21, ptr %arrayidx21, align 4, !tbaa !5
%23 = load ptr, ptr @memTree, align 8, !tbaa !11
%24 = load i32, ptr %u.sroa.6.0.v.sroa_idx, align 4, !tbaa !5
%idxprom1.i = sext i32 %24 to i64
%arrayidx2.i = getelementptr inbounds [10 x ptr], ptr %23, i64 0, i64 %idxprom1.i
%25 = load ptr, ptr %arrayidx2.i, align 8, !tbaa !11
%cmp3.i = icmp eq ptr %25, null
br i1 %cmp3.i, label %if.then33, label %for.cond.i
for.cond.i: ; preds = %if.end14
%26 = load i32, ptr %u.sroa.7.0.v.sroa_idx, align 8, !tbaa !5
%idxprom1.1.i = sext i32 %26 to i64
%arrayidx2.1.i = getelementptr inbounds [10 x ptr], ptr %25, i64 0, i64 %idxprom1.1.i
%27 = load ptr, ptr %arrayidx2.1.i, align 8, !tbaa !11
%cmp3.1.i = icmp eq ptr %27, null
br i1 %cmp3.1.i, label %if.then33, label %for.cond.1.i71
for.cond.1.i71: ; preds = %for.cond.i
%28 = load i32, ptr %u.sroa.8.0.v.sroa_idx, align 4, !tbaa !5
%idxprom1.2.i = sext i32 %28 to i64
%arrayidx2.2.i = getelementptr inbounds [10 x ptr], ptr %27, i64 0, i64 %idxprom1.2.i
%29 = load ptr, ptr %arrayidx2.2.i, align 8, !tbaa !11
%cmp3.2.i = icmp eq ptr %29, null
br i1 %cmp3.2.i, label %if.then33, label %for.cond.2.i73
for.cond.2.i73: ; preds = %for.cond.1.i71
%30 = load i32, ptr %u.sroa.9.0.v.sroa_idx, align 8, !tbaa !5
%idxprom1.3.i = sext i32 %30 to i64
%arrayidx2.3.i = getelementptr inbounds [10 x ptr], ptr %29, i64 0, i64 %idxprom1.3.i
%31 = load ptr, ptr %arrayidx2.3.i, align 8, !tbaa !11
%cmp3.3.i = icmp eq ptr %31, null
br i1 %cmp3.3.i, label %if.then33, label %for.cond.3.i75
for.cond.3.i75: ; preds = %for.cond.2.i73
%32 = load i32, ptr %u.sroa.10.0.v.sroa_idx, align 4, !tbaa !5
%idxprom1.4.i = sext i32 %32 to i64
%arrayidx2.4.i = getelementptr inbounds [10 x ptr], ptr %31, i64 0, i64 %idxprom1.4.i
%33 = load ptr, ptr %arrayidx2.4.i, align 8, !tbaa !11
%cmp3.4.i = icmp eq ptr %33, null
br i1 %cmp3.4.i, label %if.then33, label %for.cond.4.i77
for.cond.4.i77: ; preds = %for.cond.3.i75
%34 = load i32, ptr %u.sroa.11.0.v.sroa_idx, align 8, !tbaa !5
%idxprom1.5.i = sext i32 %34 to i64
%arrayidx2.5.i = getelementptr inbounds [10 x ptr], ptr %33, i64 0, i64 %idxprom1.5.i
%35 = load ptr, ptr %arrayidx2.5.i, align 8, !tbaa !11
%cmp3.5.i = icmp eq ptr %35, null
br i1 %cmp3.5.i, label %if.then33, label %for.cond.5.i79
for.cond.5.i79: ; preds = %for.cond.4.i77
%36 = load i32, ptr %u.sroa.12.0.v.sroa_idx, align 4, !tbaa !5
%idxprom1.6.i = sext i32 %36 to i64
%arrayidx2.6.i = getelementptr inbounds [10 x ptr], ptr %35, i64 0, i64 %idxprom1.6.i
%37 = load ptr, ptr %arrayidx2.6.i, align 8, !tbaa !11
%cmp3.6.i = icmp eq ptr %37, null
br i1 %cmp3.6.i, label %if.then33, label %for.cond.6.i81
for.cond.6.i81: ; preds = %for.cond.5.i79
%38 = load i32, ptr %u.sroa.13.0.v.sroa_idx, align 8, !tbaa !5
%idxprom1.7.i = sext i32 %38 to i64
%arrayidx2.7.i = getelementptr inbounds [10 x ptr], ptr %37, i64 0, i64 %idxprom1.7.i
%39 = load ptr, ptr %arrayidx2.7.i, align 8, !tbaa !11
%cmp3.7.i = icmp eq ptr %39, null
br i1 %cmp3.7.i, label %if.then33, label %exists.exit
exists.exit: ; preds = %for.cond.6.i81
%40 = load i32, ptr %u.sroa.14.0.v.sroa_idx, align 4, !tbaa !5
%idxprom1.8.i = sext i32 %40 to i64
%arrayidx2.8.i = getelementptr inbounds [10 x ptr], ptr %39, i64 0, i64 %idxprom1.8.i
%41 = load ptr, ptr %arrayidx2.8.i, align 8, !tbaa !11
%cmp3.8.i.not = icmp eq ptr %41, null
br i1 %cmp3.8.i.not, label %if.then33, label %cleanup
if.then33: ; preds = %for.cond.6.i81, %for.cond.5.i79, %for.cond.4.i77, %for.cond.3.i75, %for.cond.2.i73, %for.cond.1.i71, %for.cond.i, %if.end14, %exists.exit
store i32 %add15, ptr %u.sroa.15.0.v.sroa_idx, align 8, !tbaa !13
store i32 %add38, ptr %v, align 8, !tbaa !15
%42 = load i32, ptr @q_tail, align 4, !tbaa !5
%idxprom.i88 = sext i32 %42 to i64
%arrayidx.i89 = getelementptr inbounds [400000 x %struct.P], ptr @queue, i64 0, i64 %idxprom.i88
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(44) %arrayidx.i89, ptr noundef nonnull align 8 dereferenceable(44) %v, i64 44, i1 false)
%inc.i90 = add nsw i32 %42, 1
%rem.i91 = srem i32 %inc.i90, 400000
store i32 %rem.i91, ptr @q_tail, align 4, !tbaa !5
call void @addToMem(ptr noundef nonnull %v)
br label %cleanup
cleanup: ; preds = %exists.exit, %if.then33, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4
br i1 %exitcond.not, label %while.cond.loopexit, label %for.body, !llvm.loop !31
while.end: ; preds = %while.cond.loopexit, %while.body, %entry
%result.2 = phi i32 [ 0, %entry ], [ %u.sroa.0.0.copyload93, %while.body ], [ 0, %while.cond.loopexit ]
ret i32 %result.2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @gameClear(ptr nocapture noundef readonly %p) local_unnamed_addr #9 {
entry:
%arrayidx = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 0
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1.not = icmp eq i32 %0, 1
br i1 %cmp1.not, label %for.cond.1, label %cleanup, !llvm.loop !21
for.cond.1: ; preds = %entry
%arrayidx.1 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 1
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp1.not.1 = icmp eq i32 %1, 2
br i1 %cmp1.not.1, label %for.cond.2, label %cleanup, !llvm.loop !21
for.cond.2: ; preds = %for.cond.1
%arrayidx.2 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 2
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%cmp1.not.2 = icmp eq i32 %2, 3
br i1 %cmp1.not.2, label %for.cond.3, label %cleanup, !llvm.loop !21
for.cond.3: ; preds = %for.cond.2
%arrayidx.3 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 3
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp1.not.3 = icmp eq i32 %3, 4
br i1 %cmp1.not.3, label %for.cond.4, label %cleanup, !llvm.loop !21
for.cond.4: ; preds = %for.cond.3
%arrayidx.4 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 4
%4 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%cmp1.not.4 = icmp eq i32 %4, 5
br i1 %cmp1.not.4, label %for.cond.5, label %cleanup, !llvm.loop !21
for.cond.5: ; preds = %for.cond.4
%arrayidx.5 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 5
%5 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp1.not.5 = icmp eq i32 %5, 6
br i1 %cmp1.not.5, label %for.cond.6, label %cleanup, !llvm.loop !21
for.cond.6: ; preds = %for.cond.5
%arrayidx.6 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 6
%6 = load i32, ptr %arrayidx.6, align 4, !tbaa !5
%cmp1.not.6 = icmp eq i32 %6, 7
br i1 %cmp1.not.6, label %for.cond.7, label %cleanup, !llvm.loop !21
for.cond.7: ; preds = %for.cond.6
%arrayidx.7 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 7
%7 = load i32, ptr %arrayidx.7, align 4, !tbaa !5
%cmp1.not.7 = icmp eq i32 %7, 8
br i1 %cmp1.not.7, label %for.cond.8, label %cleanup, !llvm.loop !21
for.cond.8: ; preds = %for.cond.7
%arrayidx.8 = getelementptr inbounds %struct.P, ptr %p, i64 0, i32 1, i64 8
%8 = load i32, ptr %arrayidx.8, align 4, !tbaa !5
%cmp1.not.8 = icmp eq i32 %8, 9
%spec.select = zext i1 %cmp1.not.8 to i32
br label %cleanup, !llvm.loop !21
cleanup: ; preds = %for.cond.8, %for.cond.7, %for.cond.6, %for.cond.5, %for.cond.4, %for.cond.3, %for.cond.2, %for.cond.1, %entry
%cmp.lcssa = phi i32 [ 0, %entry ], [ 0, %for.cond.1 ], [ 0, %for.cond.2 ], [ 0, %for.cond.3 ], [ 0, %for.cond.4 ], [ 0, %for.cond.5 ], [ 0, %for.cond.6 ], [ 0, %for.cond.7 ], [ %spec.select, %for.cond.8 ]
ret i32 %cmp.lcssa
}
; 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 #10
attributes #0 = { mustprogress nofree 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nofree norecurse nosync 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 #6 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #10 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #11 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i64 0, i64 4, !5, i64 4, i64 36, !10, i64 40, i64 4, !5}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 40}
!14 = !{!"P", !6, i64 0, !7, i64 4, !6, i64 40}
!15 = !{!14, !6, i64 0}
!16 = !{i64 0, i64 4, !10, i64 4, i64 4, !5}
!17 = !{i64 0, i64 4, !5}
!18 = !{!19}
!19 = distinct !{!19, !20, !"q_pop: %agg.result"}
!20 = distinct !{!20, !"q_pop"}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{i64 0, i64 36, !10, i64 36, i64 4, !5}
!24 = !{i64 0, i64 32, !10, i64 32, i64 4, !5}
!25 = !{i64 0, i64 28, !10, i64 28, i64 4, !5}
!26 = !{i64 0, i64 24, !10, i64 24, i64 4, !5}
!27 = !{i64 0, i64 20, !10, i64 20, i64 4, !5}
!28 = !{i64 0, i64 16, !10, i64 16, i64 4, !5}
!29 = !{i64 0, i64 12, !10, i64 12, i64 4, !5}
!30 = !{i64 0, i64 8, !10, i64 8, i64 4, !5}
!31 = distinct !{!31, !22}
|
#include <stdio.h>
int ans[3][3] =
{
{1, 2, 3},
{4, 5, 6},
{7, 8, 0}
};
int dx[] = { 0, 1, 0, -1 };
int dy[] = { -1, 0, 1, 0 };
int match(int f[3][3]) {
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
if (f[i][j] != ans[i][j])
return 0;
}
}
return 1;
}
int dfs(int f[3][3], int x, int y, int v, int d, int l) {
if (match(f))
return d;
if (d > l)
return -1;
for (int i = 0, res; i < 4; ++i) {
int nx = x + dx[i];
int ny = y + dy[i];
if (nx < 0 || nx > 2 || ny < 0 || ny > 2 || (i + 2) % 4 == v)
continue;
f[y][x] = f[ny][nx];
f[ny][nx] = 0;
if ((res = dfs(f, nx, ny, i, d + 1, l)) > 0)
return res;
f[ny][nx] = f[y][x];
f[y][x] = 0;
}
return -1;
}
int main() {
int f[3][3], x, y;
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
scanf("%d", &f[i][j]);
if (f[i][j] == 0) {
y = i;
x = j;
}
}
}
int res;
for (int i = 1; i < 50; ++i) {
if ((res = dfs(f, x, y, -1, 0, i)) >= 0) {
break;
}
}
printf("%d\n", res);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189177/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189177/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@ans = dso_local local_unnamed_addr global [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 5, i32 6], [3 x i32] [i32 7, i32 8, i32 0]], align 16
@dx = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@dy = dso_local local_unnamed_addr global [4 x i32] [i32 -1, i32 0, i32 1, i32 0], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @match(ptr nocapture noundef readonly %f) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %f, align 4, !tbaa !5
%1 = load i32, ptr @ans, align 16, !tbaa !5
%cmp11.not = icmp eq i32 %0, %1
br i1 %cmp11.not, label %for.cond1, label %cleanup14.loopexit
for.cond1: ; preds = %entry
%arrayidx6.1 = getelementptr inbounds [3 x i32], ptr %f, i64 0, i64 1
%2 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 0, i64 1), align 4, !tbaa !5
%cmp11.not.1 = icmp eq i32 %2, %3
br i1 %cmp11.not.1, label %for.cond1.1, label %cleanup14.loopexit
for.cond1.1: ; preds = %for.cond1
%arrayidx6.2 = getelementptr inbounds [3 x i32], ptr %f, i64 0, i64 2
%4 = load i32, ptr %arrayidx6.2, align 4, !tbaa !5
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 0, i64 2), align 8, !tbaa !5
%cmp11.not.2 = icmp eq i32 %4, %5
br i1 %cmp11.not.2, label %for.cond1.2, label %cleanup14.loopexit
for.cond1.2: ; preds = %for.cond1.1
%arrayidx6.134 = getelementptr inbounds [3 x i32], ptr %f, i64 1, i64 0
%6 = load i32, ptr %arrayidx6.134, align 4, !tbaa !5
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 1, i64 0), align 4, !tbaa !5
%cmp11.not.136 = icmp eq i32 %6, %7
br i1 %cmp11.not.136, label %for.cond1.137, label %cleanup14.loopexit
for.cond1.137: ; preds = %for.cond1.2
%arrayidx6.1.1 = getelementptr inbounds [3 x i32], ptr %f, i64 1, i64 1
%8 = load i32, ptr %arrayidx6.1.1, align 4, !tbaa !5
%9 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 1, i64 1), align 16, !tbaa !5
%cmp11.not.1.1 = icmp eq i32 %8, %9
br i1 %cmp11.not.1.1, label %for.cond1.1.1, label %cleanup14.loopexit
for.cond1.1.1: ; preds = %for.cond1.137
%arrayidx6.2.1 = getelementptr inbounds [3 x i32], ptr %f, i64 1, i64 2
%10 = load i32, ptr %arrayidx6.2.1, align 4, !tbaa !5
%11 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 1, i64 2), align 4, !tbaa !5
%cmp11.not.2.1 = icmp eq i32 %10, %11
br i1 %cmp11.not.2.1, label %for.cond1.2.1, label %cleanup14.loopexit
for.cond1.2.1: ; preds = %for.cond1.1.1
%arrayidx6.238 = getelementptr inbounds [3 x i32], ptr %f, i64 2, i64 0
%12 = load i32, ptr %arrayidx6.238, align 4, !tbaa !5
%13 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 2, i64 0), align 8, !tbaa !5
%cmp11.not.240 = icmp eq i32 %12, %13
br i1 %cmp11.not.240, label %for.cond1.241, label %cleanup14.loopexit
for.cond1.241: ; preds = %for.cond1.2.1
%arrayidx6.1.2 = getelementptr inbounds [3 x i32], ptr %f, i64 2, i64 1
%14 = load i32, ptr %arrayidx6.1.2, align 4, !tbaa !5
%15 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 2, i64 1), align 4, !tbaa !5
%cmp11.not.1.2 = icmp eq i32 %14, %15
br i1 %cmp11.not.1.2, label %for.cond1.1.2, label %cleanup14.loopexit
for.cond1.1.2: ; preds = %for.cond1.241
%arrayidx6.2.2 = getelementptr inbounds [3 x i32], ptr %f, i64 2, i64 2
%16 = load i32, ptr %arrayidx6.2.2, align 4, !tbaa !5
%17 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 2, i64 2), align 16, !tbaa !5
%cmp11.not.2.2 = icmp eq i32 %16, %17
br i1 %cmp11.not.2.2, label %cleanup14, label %cleanup14.loopexit
cleanup14.loopexit: ; preds = %for.cond1.1.2, %for.cond1.241, %for.cond1.2.1, %for.cond1.1.1, %for.cond1.137, %for.cond1.2, %for.cond1.1, %for.cond1, %entry
br label %cleanup14
cleanup14: ; preds = %for.cond1.1.2, %cleanup14.loopexit
%cmp27 = phi i32 [ 0, %cleanup14.loopexit ], [ 1, %for.cond1.1.2 ]
ret i32 %cmp27
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(ptr nocapture noundef %f, i32 noundef %x, i32 noundef %y, i32 noundef %v, i32 noundef %d, i32 noundef %l) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %f, align 4, !tbaa !5
%1 = load i32, ptr @ans, align 16, !tbaa !5
%cmp11.not.i = icmp eq i32 %0, %1
br i1 %cmp11.not.i, label %for.cond1.i, label %if.end
for.cond1.i: ; preds = %entry
%arrayidx6.1.i = getelementptr inbounds [3 x i32], ptr %f, i64 0, i64 1
%2 = load i32, ptr %arrayidx6.1.i, align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 0, i64 1), align 4, !tbaa !5
%cmp11.not.1.i = icmp eq i32 %2, %3
br i1 %cmp11.not.1.i, label %for.cond1.1.i, label %if.end
for.cond1.1.i: ; preds = %for.cond1.i
%arrayidx6.2.i = getelementptr inbounds [3 x i32], ptr %f, i64 0, i64 2
%4 = load i32, ptr %arrayidx6.2.i, align 4, !tbaa !5
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 0, i64 2), align 8, !tbaa !5
%cmp11.not.2.i = icmp eq i32 %4, %5
br i1 %cmp11.not.2.i, label %for.cond1.2.i, label %if.end
for.cond1.2.i: ; preds = %for.cond1.1.i
%arrayidx6.134.i = getelementptr inbounds [3 x i32], ptr %f, i64 1, i64 0
%6 = load i32, ptr %arrayidx6.134.i, align 4, !tbaa !5
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 1, i64 0), align 4, !tbaa !5
%cmp11.not.136.i = icmp eq i32 %6, %7
br i1 %cmp11.not.136.i, label %for.cond1.137.i, label %if.end
for.cond1.137.i: ; preds = %for.cond1.2.i
%arrayidx6.1.1.i = getelementptr inbounds [3 x i32], ptr %f, i64 1, i64 1
%8 = load i32, ptr %arrayidx6.1.1.i, align 4, !tbaa !5
%9 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 1, i64 1), align 16, !tbaa !5
%cmp11.not.1.1.i = icmp eq i32 %8, %9
br i1 %cmp11.not.1.1.i, label %for.cond1.1.1.i, label %if.end
for.cond1.1.1.i: ; preds = %for.cond1.137.i
%arrayidx6.2.1.i = getelementptr inbounds [3 x i32], ptr %f, i64 1, i64 2
%10 = load i32, ptr %arrayidx6.2.1.i, align 4, !tbaa !5
%11 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 1, i64 2), align 4, !tbaa !5
%cmp11.not.2.1.i = icmp eq i32 %10, %11
br i1 %cmp11.not.2.1.i, label %for.cond1.2.1.i, label %if.end
for.cond1.2.1.i: ; preds = %for.cond1.1.1.i
%arrayidx6.238.i = getelementptr inbounds [3 x i32], ptr %f, i64 2, i64 0
%12 = load i32, ptr %arrayidx6.238.i, align 4, !tbaa !5
%13 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 2, i64 0), align 8, !tbaa !5
%cmp11.not.240.i = icmp eq i32 %12, %13
br i1 %cmp11.not.240.i, label %for.cond1.241.i, label %if.end
for.cond1.241.i: ; preds = %for.cond1.2.1.i
%arrayidx6.1.2.i = getelementptr inbounds [3 x i32], ptr %f, i64 2, i64 1
%14 = load i32, ptr %arrayidx6.1.2.i, align 4, !tbaa !5
%15 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 2, i64 1), align 4, !tbaa !5
%cmp11.not.1.2.i = icmp eq i32 %14, %15
br i1 %cmp11.not.1.2.i, label %for.cond1.1.2.i, label %if.end
for.cond1.1.2.i: ; preds = %for.cond1.241.i
%arrayidx6.2.2.i = getelementptr inbounds [3 x i32], ptr %f, i64 2, i64 2
%16 = load i32, ptr %arrayidx6.2.2.i, align 4, !tbaa !5
%17 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @ans, i64 0, i64 2, i64 2), align 16, !tbaa !5
%cmp11.not.2.2.i = icmp eq i32 %16, %17
br i1 %cmp11.not.2.2.i, label %return, label %if.end
if.end: ; preds = %entry, %for.cond1.i, %for.cond1.1.i, %for.cond1.2.i, %for.cond1.137.i, %for.cond1.1.1.i, %for.cond1.2.1.i, %for.cond1.241.i, %for.cond1.1.2.i
%cmp = icmp sgt i32 %d, %l
br i1 %cmp, label %return, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end
%idxprom22 = sext i32 %y to i64
%idxprom24 = sext i32 %x to i64
%arrayidx25 = getelementptr inbounds [3 x i32], ptr %f, i64 %idxprom22, i64 %idxprom24
%add30 = add nsw i32 %d, 1
%18 = load i32, ptr @dx, align 16, !tbaa !5
%add = add nsw i32 %18, %x
%19 = load i32, ptr @dy, align 16, !tbaa !5
%add6 = add nsw i32 %19, %y
%or.cond = icmp ugt i32 %add, 2
%cmp10 = icmp slt i32 %add6, 0
%or.cond51 = select i1 %or.cond, i1 true, i1 %cmp10
%cmp12 = icmp sgt i32 %add6, 2
%or.cond52 = select i1 %or.cond51, i1 true, i1 %cmp12
%cmp15 = icmp eq i32 %v, 2
%or.cond93 = or i1 %or.cond52, %cmp15
br i1 %or.cond93, label %for.inc, label %if.end17
if.end17: ; preds = %for.cond.preheader
%idxprom18 = zext i32 %add6 to i64
%idxprom20 = zext i32 %add to i64
%arrayidx21 = getelementptr inbounds [3 x i32], ptr %f, i64 %idxprom18, i64 %idxprom20
%20 = load i32, ptr %arrayidx21, align 4, !tbaa !5
store i32 %20, ptr %arrayidx25, align 4, !tbaa !5
store i32 0, ptr %arrayidx21, align 4, !tbaa !5
%call31 = tail call i32 @dfs(ptr noundef nonnull %f, i32 noundef %add, i32 noundef %add6, i32 noundef 0, i32 noundef %add30, i32 noundef %l)
%cmp32 = icmp sgt i32 %call31, 0
br i1 %cmp32, label %return, label %if.end34
if.end34: ; preds = %if.end17
%21 = load i32, ptr %arrayidx25, align 4, !tbaa !5
store i32 %21, ptr %arrayidx21, align 4, !tbaa !5
store i32 0, ptr %arrayidx25, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end34, %for.cond.preheader
%22 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 1), align 4, !tbaa !5
%add.1 = add nsw i32 %22, %x
%23 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 1), align 4, !tbaa !5
%add6.1 = add nsw i32 %23, %y
%or.cond.1 = icmp ugt i32 %add.1, 2
%cmp10.1 = icmp slt i32 %add6.1, 0
%or.cond51.1 = select i1 %or.cond.1, i1 true, i1 %cmp10.1
%cmp12.1 = icmp sgt i32 %add6.1, 2
%or.cond52.1 = select i1 %or.cond51.1, i1 true, i1 %cmp12.1
%cmp15.1 = icmp eq i32 %v, 3
%or.cond94 = or i1 %or.cond52.1, %cmp15.1
br i1 %or.cond94, label %for.inc.1, label %if.end17.1
if.end17.1: ; preds = %for.inc
%idxprom18.1 = zext i32 %add6.1 to i64
%idxprom20.1 = zext i32 %add.1 to i64
%arrayidx21.1 = getelementptr inbounds [3 x i32], ptr %f, i64 %idxprom18.1, i64 %idxprom20.1
%24 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
store i32 %24, ptr %arrayidx25, align 4, !tbaa !5
store i32 0, ptr %arrayidx21.1, align 4, !tbaa !5
%call31.1 = tail call i32 @dfs(ptr noundef nonnull %f, i32 noundef %add.1, i32 noundef %add6.1, i32 noundef 1, i32 noundef %add30, i32 noundef %l)
%cmp32.1 = icmp sgt i32 %call31.1, 0
br i1 %cmp32.1, label %return, label %if.end34.1
if.end34.1: ; preds = %if.end17.1
%25 = load i32, ptr %arrayidx25, align 4, !tbaa !5
store i32 %25, ptr %arrayidx21.1, align 4, !tbaa !5
store i32 0, ptr %arrayidx25, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end34.1, %for.inc
%26 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 2), align 8, !tbaa !5
%add.2 = add nsw i32 %26, %x
%27 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 2), align 8, !tbaa !5
%add6.2 = add nsw i32 %27, %y
%or.cond.2 = icmp ugt i32 %add.2, 2
%cmp10.2 = icmp slt i32 %add6.2, 0
%or.cond51.2 = select i1 %or.cond.2, i1 true, i1 %cmp10.2
%cmp12.2 = icmp sgt i32 %add6.2, 2
%or.cond52.2 = select i1 %or.cond51.2, i1 true, i1 %cmp12.2
%cmp15.2 = icmp eq i32 %v, 0
%or.cond95 = or i1 %or.cond52.2, %cmp15.2
br i1 %or.cond95, label %for.inc.2, label %if.end17.2
if.end17.2: ; preds = %for.inc.1
%idxprom18.2 = zext i32 %add6.2 to i64
%idxprom20.2 = zext i32 %add.2 to i64
%arrayidx21.2 = getelementptr inbounds [3 x i32], ptr %f, i64 %idxprom18.2, i64 %idxprom20.2
%28 = load i32, ptr %arrayidx21.2, align 4, !tbaa !5
store i32 %28, ptr %arrayidx25, align 4, !tbaa !5
store i32 0, ptr %arrayidx21.2, align 4, !tbaa !5
%call31.2 = tail call i32 @dfs(ptr noundef nonnull %f, i32 noundef %add.2, i32 noundef %add6.2, i32 noundef 2, i32 noundef %add30, i32 noundef %l)
%cmp32.2 = icmp sgt i32 %call31.2, 0
br i1 %cmp32.2, label %return, label %if.end34.2
if.end34.2: ; preds = %if.end17.2
%29 = load i32, ptr %arrayidx25, align 4, !tbaa !5
store i32 %29, ptr %arrayidx21.2, align 4, !tbaa !5
store i32 0, ptr %arrayidx25, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end34.2, %for.inc.1
%30 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dx, i64 0, i64 3), align 4, !tbaa !5
%add.3 = add nsw i32 %30, %x
%31 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dy, i64 0, i64 3), align 4, !tbaa !5
%add6.3 = add nsw i32 %31, %y
%or.cond.3 = icmp ugt i32 %add.3, 2
%cmp10.3 = icmp slt i32 %add6.3, 0
%or.cond51.3 = select i1 %or.cond.3, i1 true, i1 %cmp10.3
%cmp12.3 = icmp sgt i32 %add6.3, 2
%or.cond52.3 = select i1 %or.cond51.3, i1 true, i1 %cmp12.3
%cmp15.3 = icmp eq i32 %v, 1
%or.cond96 = or i1 %or.cond52.3, %cmp15.3
br i1 %or.cond96, label %return, label %if.end17.3
if.end17.3: ; preds = %for.inc.2
%idxprom18.3 = zext i32 %add6.3 to i64
%idxprom20.3 = zext i32 %add.3 to i64
%arrayidx21.3 = getelementptr inbounds [3 x i32], ptr %f, i64 %idxprom18.3, i64 %idxprom20.3
%32 = load i32, ptr %arrayidx21.3, align 4, !tbaa !5
store i32 %32, ptr %arrayidx25, align 4, !tbaa !5
store i32 0, ptr %arrayidx21.3, align 4, !tbaa !5
%call31.3 = tail call i32 @dfs(ptr noundef nonnull %f, i32 noundef %add.3, i32 noundef %add6.3, i32 noundef 3, i32 noundef %add30, i32 noundef %l)
%cmp32.3 = icmp sgt i32 %call31.3, 0
br i1 %cmp32.3, label %return, label %if.end34.3
if.end34.3: ; preds = %if.end17.3
%33 = load i32, ptr %arrayidx25, align 4, !tbaa !5
store i32 %33, ptr %arrayidx21.3, align 4, !tbaa !5
store i32 0, ptr %arrayidx25, align 4, !tbaa !5
br label %return
return: ; preds = %if.end17, %if.end17.1, %if.end17.2, %if.end17.3, %if.end34.3, %for.inc.2, %for.cond1.1.2.i, %if.end
%retval.3 = phi i32 [ -1, %if.end ], [ %d, %for.cond1.1.2.i ], [ %call31, %if.end17 ], [ %call31.1, %if.end17.1 ], [ %call31.2, %if.end17.2 ], [ %call31.3, %if.end17.3 ], [ -1, %if.end34.3 ], [ -1, %for.inc.2 ]
ret i32 %retval.3
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%f = alloca [3 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %f) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %f)
%arrayidx6.1 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1)
%arrayidx6.2 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 0, i64 2
%arrayidx6.152 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 1, i64 0
%arrayidx6.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 1, i64 1
%arrayidx6.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 1, i64 2
%arrayidx6.257 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 2, i64 0
%arrayidx6.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 2, i64 1
%arrayidx6.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %f, i64 0, i64 2, i64 2
%0 = load <4 x i32>, ptr %arrayidx6.1, align 4
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <8 x i32> <i32 0, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2)
%2 = load i32, ptr %arrayidx6.2, align 8, !tbaa !5
%call.153 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.152)
%3 = load i32, ptr %arrayidx6.152, align 4, !tbaa !5
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.1)
%4 = load i32, ptr %arrayidx6.1.1, align 16, !tbaa !5
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.1)
%5 = load i32, ptr %arrayidx6.2.1, align 4, !tbaa !5
%call.258 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.257)
%6 = load i32, ptr %arrayidx6.257, align 8, !tbaa !5
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.2)
%7 = load i32, ptr %arrayidx6.1.2, align 4, !tbaa !5
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.2)
%8 = load i32, ptr %arrayidx6.2.2, align 16, !tbaa !5
%9 = insertelement <8 x i32> %1, i32 %2, i64 1
%10 = insertelement <8 x i32> %9, i32 %3, i64 2
%11 = insertelement <8 x i32> %10, i32 %4, i64 3
%12 = insertelement <8 x i32> %11, i32 %5, i64 4
%13 = insertelement <8 x i32> %12, i32 %6, i64 5
%14 = insertelement <8 x i32> %13, i32 %7, i64 6
%15 = insertelement <8 x i32> %14, i32 %8, i64 7
%16 = icmp eq <8 x i32> %15, zeroinitializer
%17 = extractelement <8 x i1> %16, i64 0
%spec.select.1 = zext i1 %17 to i32
%18 = extractelement <8 x i1> %16, i64 1
%spec.select.2 = select i1 %18, i32 2, i32 %spec.select.1
%19 = extractelement <8 x i1> %16, i64 2
%spec.select.155 = select i1 %19, i32 0, i32 %spec.select.2
%20 = extractelement <8 x i1> %16, i64 3
%spec.select.1.1 = select i1 %20, i32 1, i32 %spec.select.155
%21 = extractelement <8 x i1> %16, i64 4
%spec.select.2.1 = select i1 %21, i32 2, i32 %spec.select.1.1
%22 = select i1 %21, i1 true, i1 %20
%narrow62 = select i1 %22, i1 true, i1 %19
%spec.select42.2.1 = zext i1 %narrow62 to i32
%23 = extractelement <8 x i1> %16, i64 5
%spec.select.260 = select i1 %23, i32 0, i32 %spec.select.2.1
%24 = extractelement <8 x i1> %16, i64 6
%spec.select.1.2 = select i1 %24, i32 1, i32 %spec.select.260
%25 = extractelement <8 x i1> %16, i64 7
%spec.select.2.2 = select i1 %25, i32 2, i32 %spec.select.1.2
%26 = select i1 %25, i1 true, i1 %24
%27 = select i1 %26, i1 true, i1 %23
%spec.select42.2.2 = select i1 %27, i32 2, i32 %spec.select42.2.1
br label %for.body19
for.body19: ; preds = %for.body19, %entry
%i15.049 = phi i32 [ 1, %entry ], [ %inc25, %for.body19 ]
%call20 = call i32 @dfs(ptr noundef nonnull %f, i32 noundef %spec.select.2.2, i32 noundef %spec.select42.2.2, i32 noundef -1, i32 noundef 0, i32 noundef %i15.049)
%cmp21 = icmp sgt i32 %call20, -1
%inc25 = add nuw nsw i32 %i15.049, 1
%exitcond.not = icmp eq i32 %inc25, 50
%or.cond = select i1 %cmp21, i1 true, i1 %exitcond.not
br i1 %or.cond, label %cleanup, label %for.body19, !llvm.loop !9
cleanup: ; preds = %for.body19
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call20)
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %f) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#define MAX 3
int pane[MAX][MAX];
int temp[MAX][MAX];
int d_x[4]={0,1,0,-1};
int d_y[4]={1,0,-1,0};
void empty(int *row,int *col){
int i,j;
for(i=0;i<MAX;i++)
for(j=0;j<MAX;j++)
if(!pane[i][j]){
*row=j;
*col=i;
return;
}
}
void swap(int *a,int *b){
int temp;
temp = *a;*a = *b;*b = temp;
}
int cal(){
int i,e;
int count=0;
for(i=0;i<9;i++){
e=pane[i/3][i%3];
if(e){
e--;
count+=abs(i/3-e/3)+abs(i%3-e%3);
}
}
return count;
}
int dfs(int x,int y,int p,int deep,const int limt){
int i;
int len;
int x_2,y_2;
int emc;
len=cal();
if(len==0) return deep;
if(deep+len>limt) return -1;
for(i=0;i<4;i++){
x_2=x+d_x[i];
y_2=y+d_y[i];
if(~p&&i==(p+2)%4) continue;
if(!(0<=x_2 && x_2<3 && 0<=y_2 && y_2<3)) continue;
swap(&pane[y][x],&pane[y_2][x_2]);
emc=dfs(x_2,y_2,i,deep+1,limt);
if(~emc) return emc;
swap(&pane[y][x],&pane[y_2][x_2]);
}
return -1;
}
int main() {
int i,j;
int h,a,row,col;
for(i=0;i<MAX;i++){
for(j=0;j<MAX;j++)
scanf("%d",&pane[i][j]);
}
empty(&row,&col);
for(h=0;h<100;h++){
for(i=0;i<MAX;i++){
for(j=0;j<MAX;j++)
temp[i][j]=pane[i][j];
}
a=dfs(row,col,-1,0,h);
if(a!=-1){
printf("%d\n",a);
break;
}
for(i=0;i<MAX;i++){
for(j=0;j<MAX;j++)
pane[i][j]=temp[i][j];
}
a=-1;
if(h==99) printf("%d\n\n",a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189234/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189234/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@d_x = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@d_y = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16
@pane = dso_local global [3 x [3 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@temp = dso_local local_unnamed_addr global [3 x [3 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%d\0A\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable
define dso_local void @empty(ptr nocapture noundef writeonly %row, ptr nocapture noundef writeonly %col) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @pane, align 16, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %if.then, label %for.inc
if.then: ; preds = %for.inc.1.2, %for.inc.229, %for.inc.2.1, %for.inc.1.1, %for.inc.126, %for.inc.2, %for.inc.1, %for.inc, %entry
%i.019.lcssa = phi i32 [ 0, %entry ], [ 0, %for.inc ], [ 0, %for.inc.1 ], [ 1, %for.inc.2 ], [ 1, %for.inc.126 ], [ 1, %for.inc.1.1 ], [ 2, %for.inc.2.1 ], [ 2, %for.inc.229 ], [ 2, %for.inc.1.2 ]
%j.018.lcssa.wide = phi i32 [ 0, %entry ], [ 1, %for.inc ], [ 2, %for.inc.1 ], [ 0, %for.inc.2 ], [ 1, %for.inc.126 ], [ 2, %for.inc.1.1 ], [ 0, %for.inc.2.1 ], [ 1, %for.inc.229 ], [ 2, %for.inc.1.2 ]
store i32 %j.018.lcssa.wide, ptr %row, align 4, !tbaa !5
store i32 %i.019.lcssa, ptr %col, align 4, !tbaa !5
br label %cleanup
for.inc: ; preds = %entry
%1 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 1), align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %1, 0
br i1 %tobool.not.1, label %if.then, label %for.inc.1
for.inc.1: ; preds = %for.inc
%2 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 2), align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %2, 0
br i1 %tobool.not.2, label %if.then, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 0), align 4, !tbaa !5
%tobool.not.125 = icmp eq i32 %3, 0
br i1 %tobool.not.125, label %if.then, label %for.inc.126
for.inc.126: ; preds = %for.inc.2
%4 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 1), align 16, !tbaa !5
%tobool.not.1.1 = icmp eq i32 %4, 0
br i1 %tobool.not.1.1, label %if.then, label %for.inc.1.1
for.inc.1.1: ; preds = %for.inc.126
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 2), align 4, !tbaa !5
%tobool.not.2.1 = icmp eq i32 %5, 0
br i1 %tobool.not.2.1, label %if.then, label %for.inc.2.1
for.inc.2.1: ; preds = %for.inc.1.1
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 0), align 8, !tbaa !5
%tobool.not.228 = icmp eq i32 %6, 0
br i1 %tobool.not.228, label %if.then, label %for.inc.229
for.inc.229: ; preds = %for.inc.2.1
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 1), align 4, !tbaa !5
%tobool.not.1.2 = icmp eq i32 %7, 0
br i1 %tobool.not.1.2, label %if.then, label %for.inc.1.2
for.inc.1.2: ; preds = %for.inc.229
%8 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 2), align 16, !tbaa !5
%tobool.not.2.2 = icmp eq i32 %8, 0
br i1 %tobool.not.2.2, label %if.then, label %cleanup
cleanup: ; preds = %for.inc.1.2, %if.then
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #1 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @cal() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @pane, align 16, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %for.inc, label %if.then
if.then: ; preds = %entry
%dec = add nsw i32 %0, -1
%div4.neg = sdiv i32 %dec, -3
%1 = tail call i32 @llvm.abs.i32(i32 %div4.neg, i1 true)
%rem6 = srem i32 %dec, 3
%2 = tail call i32 @llvm.abs.i32(i32 %rem6, i1 true)
%add8 = add nuw nsw i32 %2, %1
br label %for.inc
for.inc: ; preds = %entry, %if.then
%count.1 = phi i32 [ %add8, %if.then ], [ 0, %entry ]
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 1), align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %3, 0
br i1 %tobool.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%dec.1 = add nsw i32 %3, -1
%div4.neg.1 = sdiv i32 %dec.1, -3
%4 = tail call i32 @llvm.abs.i32(i32 %div4.neg.1, i1 true)
%rem6.1 = srem i32 %dec.1, 3
%sub7.1 = sub nsw i32 1, %rem6.1
%5 = tail call i32 @llvm.abs.i32(i32 %sub7.1, i1 true)
%add.1 = add nuw nsw i32 %5, %count.1
%add8.1 = add nuw nsw i32 %add.1, %4
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%count.1.1 = phi i32 [ %add8.1, %if.then.1 ], [ %count.1, %for.inc ]
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 2), align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %6, 0
br i1 %tobool.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%dec.2 = add nsw i32 %6, -1
%div4.neg.2 = sdiv i32 %dec.2, -3
%7 = tail call i32 @llvm.abs.i32(i32 %div4.neg.2, i1 true)
%rem6.2 = srem i32 %dec.2, 3
%reass.sub = sub i32 %count.1.1, %rem6.2
%add.2 = add i32 %reass.sub, 2
%add8.2 = add nuw i32 %add.2, %7
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%count.1.2 = phi i32 [ %add8.2, %if.then.2 ], [ %count.1.1, %for.inc.1 ]
%8 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 0), align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %8, 0
br i1 %tobool.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%dec.3 = add nsw i32 %8, -1
%div4.neg.3 = sdiv i32 %dec.3, -3
%sub.3 = add nsw i32 %div4.neg.3, 1
%9 = tail call i32 @llvm.abs.i32(i32 %sub.3, i1 true)
%rem6.3 = srem i32 %dec.3, 3
%10 = tail call i32 @llvm.abs.i32(i32 %rem6.3, i1 true)
%add.3 = add nuw i32 %10, %count.1.2
%add8.3 = add nuw i32 %add.3, %9
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%count.1.3 = phi i32 [ %add8.3, %if.then.3 ], [ %count.1.2, %for.inc.2 ]
%11 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 1), align 16, !tbaa !5
%tobool.not.4 = icmp eq i32 %11, 0
br i1 %tobool.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%dec.4 = add nsw i32 %11, -1
%div4.neg.4 = sdiv i32 %dec.4, -3
%sub.4 = add nsw i32 %div4.neg.4, 1
%12 = tail call i32 @llvm.abs.i32(i32 %sub.4, i1 true)
%rem6.4 = srem i32 %dec.4, 3
%sub7.4 = sub nsw i32 1, %rem6.4
%13 = tail call i32 @llvm.abs.i32(i32 %sub7.4, i1 true)
%add.4 = add nuw i32 %13, %count.1.3
%add8.4 = add nuw i32 %add.4, %12
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%count.1.4 = phi i32 [ %add8.4, %if.then.4 ], [ %count.1.3, %for.inc.3 ]
%14 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 2), align 4, !tbaa !5
%tobool.not.5 = icmp eq i32 %14, 0
br i1 %tobool.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%dec.5 = add nsw i32 %14, -1
%div4.neg.5 = sdiv i32 %dec.5, -3
%sub.5 = add nsw i32 %div4.neg.5, 1
%15 = tail call i32 @llvm.abs.i32(i32 %sub.5, i1 true)
%rem6.5 = srem i32 %dec.5, 3
%reass.sub22 = sub i32 %count.1.4, %rem6.5
%add.5 = add i32 %reass.sub22, 2
%add8.5 = add i32 %add.5, %15
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%count.1.5 = phi i32 [ %add8.5, %if.then.5 ], [ %count.1.4, %for.inc.4 ]
%16 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 0), align 8, !tbaa !5
%tobool.not.6 = icmp eq i32 %16, 0
br i1 %tobool.not.6, label %for.inc.6, label %if.then.6
if.then.6: ; preds = %for.inc.5
%dec.6 = add nsw i32 %16, -1
%div4.neg.6 = sdiv i32 %dec.6, -3
%sub.6 = add nsw i32 %div4.neg.6, 2
%17 = tail call i32 @llvm.abs.i32(i32 %sub.6, i1 true)
%rem6.6 = srem i32 %dec.6, 3
%18 = tail call i32 @llvm.abs.i32(i32 %rem6.6, i1 true)
%add.6 = add i32 %18, %count.1.5
%add8.6 = add i32 %add.6, %17
br label %for.inc.6
for.inc.6: ; preds = %if.then.6, %for.inc.5
%count.1.6 = phi i32 [ %add8.6, %if.then.6 ], [ %count.1.5, %for.inc.5 ]
%19 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 1), align 4, !tbaa !5
%tobool.not.7 = icmp eq i32 %19, 0
br i1 %tobool.not.7, label %for.inc.7, label %if.then.7
if.then.7: ; preds = %for.inc.6
%dec.7 = add nsw i32 %19, -1
%div4.neg.7 = sdiv i32 %dec.7, -3
%sub.7 = add nsw i32 %div4.neg.7, 2
%20 = tail call i32 @llvm.abs.i32(i32 %sub.7, i1 true)
%rem6.7 = srem i32 %dec.7, 3
%sub7.7 = sub nsw i32 1, %rem6.7
%21 = tail call i32 @llvm.abs.i32(i32 %sub7.7, i1 true)
%add.7 = add i32 %21, %count.1.6
%add8.7 = add i32 %add.7, %20
br label %for.inc.7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%count.1.7 = phi i32 [ %add8.7, %if.then.7 ], [ %count.1.6, %for.inc.6 ]
%22 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 2), align 16, !tbaa !5
%tobool.not.8 = icmp eq i32 %22, 0
br i1 %tobool.not.8, label %for.inc.8, label %if.then.8
if.then.8: ; preds = %for.inc.7
%dec.8 = add nsw i32 %22, -1
%div4.neg.8 = sdiv i32 %dec.8, -3
%sub.8 = add nsw i32 %div4.neg.8, 2
%23 = tail call i32 @llvm.abs.i32(i32 %sub.8, i1 true)
%rem6.8 = srem i32 %dec.8, 3
%reass.sub23 = sub i32 %count.1.7, %rem6.8
%add.8 = add i32 %reass.sub23, 2
%add8.8 = add i32 %add.8, %23
br label %for.inc.8
for.inc.8: ; preds = %if.then.8, %for.inc.7
%count.1.8 = phi i32 [ %add8.8, %if.then.8 ], [ %count.1.7, %for.inc.7 ]
ret i32 %count.1.8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %x, i32 noundef %y, i32 noundef %p, i32 noundef %deep, i32 noundef %limt) local_unnamed_addr #4 {
entry:
%call = tail call i32 @cal()
%cmp = icmp eq i32 %call, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%add = add nsw i32 %call, %deep
%cmp1 = icmp sgt i32 %add, %limt
br i1 %cmp1, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end
%idxprom22 = sext i32 %y to i64
%idxprom24 = sext i32 %x to i64
%arrayidx25 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom22, i64 %idxprom24
%tobool.not = icmp eq i32 %p, -1
%add30 = add nsw i32 %deep, 1
br i1 %tobool.not, label %for.body.us.preheader, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%add9 = add nsw i32 %p, 2
%rem = srem i32 %add9, 4
%0 = load i32, ptr @d_x, align 16, !tbaa !5
%add5 = add nsw i32 %0, %x
%1 = load i32, ptr @d_y, align 16, !tbaa !5
%add8 = add nsw i32 %1, %y
%cmp10 = icmp eq i32 %rem, 0
br i1 %cmp10, label %if.end12.1, label %if.end12
for.body.us.preheader: ; preds = %for.cond.preheader
%2 = load i32, ptr @d_x, align 16, !tbaa !5
%add5.us = add nsw i32 %2, %x
%3 = load i32, ptr @d_y, align 16, !tbaa !5
%add8.us = add nsw i32 %3, %y
%or.cond.us = icmp ult i32 %add5.us, 3
%cmp17.us = icmp sgt i32 %add8.us, -1
%or.cond48.us = select i1 %or.cond.us, i1 %cmp17.us, i1 false
%cmp19.us = icmp slt i32 %add8.us, 3
%or.cond49.us = select i1 %or.cond48.us, i1 %cmp19.us, i1 false
br i1 %or.cond49.us, label %if.end21.us, label %for.inc.us
if.end21.us: ; preds = %for.body.us.preheader
%idxprom26.us = zext i32 %add8.us to i64
%idxprom28.us = zext i32 %add5.us to i64
%arrayidx29.us = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26.us, i64 %idxprom28.us
%4 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5
store i32 %5, ptr %arrayidx25, align 4, !tbaa !5
store i32 %4, ptr %arrayidx29.us, align 4, !tbaa !5
%call31.us = tail call i32 @dfs(i32 noundef %add5.us, i32 noundef %add8.us, i32 noundef 0, i32 noundef %add30, i32 noundef %limt)
%tobool33.not.us = icmp eq i32 %call31.us, -1
br i1 %tobool33.not.us, label %if.end35.us, label %cleanup
if.end35.us: ; preds = %if.end21.us
%6 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5
store i32 %7, ptr %arrayidx25, align 4, !tbaa !5
store i32 %6, ptr %arrayidx29.us, align 4, !tbaa !5
br label %for.inc.us
for.inc.us: ; preds = %if.end35.us, %for.body.us.preheader
%8 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_x, i64 0, i64 1), align 4, !tbaa !5
%add5.us.1 = add nsw i32 %8, %x
%9 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_y, i64 0, i64 1), align 4, !tbaa !5
%add8.us.1 = add nsw i32 %9, %y
%or.cond.us.1 = icmp ult i32 %add5.us.1, 3
%cmp17.us.1 = icmp sgt i32 %add8.us.1, -1
%or.cond48.us.1 = select i1 %or.cond.us.1, i1 %cmp17.us.1, i1 false
%cmp19.us.1 = icmp slt i32 %add8.us.1, 3
%or.cond49.us.1 = select i1 %or.cond48.us.1, i1 %cmp19.us.1, i1 false
br i1 %or.cond49.us.1, label %if.end21.us.1, label %for.inc.us.1
if.end21.us.1: ; preds = %for.inc.us
%idxprom26.us.1 = zext i32 %add8.us.1 to i64
%idxprom28.us.1 = zext i32 %add5.us.1 to i64
%arrayidx29.us.1 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26.us.1, i64 %idxprom28.us.1
%10 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx25, align 4, !tbaa !5
store i32 %10, ptr %arrayidx29.us.1, align 4, !tbaa !5
%call31.us.1 = tail call i32 @dfs(i32 noundef %add5.us.1, i32 noundef %add8.us.1, i32 noundef 1, i32 noundef %add30, i32 noundef %limt)
%tobool33.not.us.1 = icmp eq i32 %call31.us.1, -1
br i1 %tobool33.not.us.1, label %if.end35.us.1, label %cleanup
if.end35.us.1: ; preds = %if.end21.us.1
%12 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%13 = load i32, ptr %arrayidx29.us.1, align 4, !tbaa !5
store i32 %13, ptr %arrayidx25, align 4, !tbaa !5
store i32 %12, ptr %arrayidx29.us.1, align 4, !tbaa !5
br label %for.inc.us.1
for.inc.us.1: ; preds = %if.end35.us.1, %for.inc.us
%14 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_x, i64 0, i64 2), align 8, !tbaa !5
%add5.us.2 = add nsw i32 %14, %x
%15 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_y, i64 0, i64 2), align 8, !tbaa !5
%add8.us.2 = add nsw i32 %15, %y
%or.cond.us.2 = icmp ult i32 %add5.us.2, 3
%cmp17.us.2 = icmp sgt i32 %add8.us.2, -1
%or.cond48.us.2 = select i1 %or.cond.us.2, i1 %cmp17.us.2, i1 false
%cmp19.us.2 = icmp slt i32 %add8.us.2, 3
%or.cond49.us.2 = select i1 %or.cond48.us.2, i1 %cmp19.us.2, i1 false
br i1 %or.cond49.us.2, label %if.end21.us.2, label %for.inc.us.2
if.end21.us.2: ; preds = %for.inc.us.1
%idxprom26.us.2 = zext i32 %add8.us.2 to i64
%idxprom28.us.2 = zext i32 %add5.us.2 to i64
%arrayidx29.us.2 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26.us.2, i64 %idxprom28.us.2
%16 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx29.us.2, align 4, !tbaa !5
store i32 %17, ptr %arrayidx25, align 4, !tbaa !5
store i32 %16, ptr %arrayidx29.us.2, align 4, !tbaa !5
%call31.us.2 = tail call i32 @dfs(i32 noundef %add5.us.2, i32 noundef %add8.us.2, i32 noundef 2, i32 noundef %add30, i32 noundef %limt)
%tobool33.not.us.2 = icmp eq i32 %call31.us.2, -1
br i1 %tobool33.not.us.2, label %if.end35.us.2, label %cleanup
if.end35.us.2: ; preds = %if.end21.us.2
%18 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx29.us.2, align 4, !tbaa !5
store i32 %19, ptr %arrayidx25, align 4, !tbaa !5
store i32 %18, ptr %arrayidx29.us.2, align 4, !tbaa !5
br label %for.inc.us.2
for.inc.us.2: ; preds = %if.end35.us.2, %for.inc.us.1
%20 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_x, i64 0, i64 3), align 4, !tbaa !5
%add5.us.3 = add nsw i32 %20, %x
%21 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_y, i64 0, i64 3), align 4, !tbaa !5
%add8.us.3 = add nsw i32 %21, %y
%or.cond.us.3 = icmp ult i32 %add5.us.3, 3
%cmp17.us.3 = icmp sgt i32 %add8.us.3, -1
%or.cond48.us.3 = select i1 %or.cond.us.3, i1 %cmp17.us.3, i1 false
%cmp19.us.3 = icmp slt i32 %add8.us.3, 3
%or.cond49.us.3 = select i1 %or.cond48.us.3, i1 %cmp19.us.3, i1 false
br i1 %or.cond49.us.3, label %if.end21.us.3, label %cleanup
if.end21.us.3: ; preds = %for.inc.us.2
%idxprom26.us.3 = zext i32 %add8.us.3 to i64
%idxprom28.us.3 = zext i32 %add5.us.3 to i64
%arrayidx29.us.3 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26.us.3, i64 %idxprom28.us.3
%22 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx29.us.3, align 4, !tbaa !5
store i32 %23, ptr %arrayidx25, align 4, !tbaa !5
store i32 %22, ptr %arrayidx29.us.3, align 4, !tbaa !5
%call31.us.3 = tail call i32 @dfs(i32 noundef %add5.us.3, i32 noundef %add8.us.3, i32 noundef 3, i32 noundef %add30, i32 noundef %limt)
%tobool33.not.us.3 = icmp eq i32 %call31.us.3, -1
br i1 %tobool33.not.us.3, label %cleanup.sink.split, label %cleanup
if.end12: ; preds = %for.body.preheader
%or.cond = icmp ult i32 %add5, 3
%cmp17 = icmp sgt i32 %add8, -1
%or.cond48 = select i1 %or.cond, i1 %cmp17, i1 false
%cmp19 = icmp slt i32 %add8, 3
%or.cond49 = select i1 %or.cond48, i1 %cmp19, i1 false
br i1 %or.cond49, label %if.end21, label %for.inc
if.end21: ; preds = %if.end12
%idxprom26 = zext i32 %add8 to i64
%idxprom28 = zext i32 %add5 to i64
%arrayidx29 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26, i64 %idxprom28
%24 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx29, align 4, !tbaa !5
store i32 %25, ptr %arrayidx25, align 4, !tbaa !5
store i32 %24, ptr %arrayidx29, align 4, !tbaa !5
%call31 = tail call i32 @dfs(i32 noundef %add5, i32 noundef %add8, i32 noundef 0, i32 noundef %add30, i32 noundef %limt)
%tobool33.not = icmp eq i32 %call31, -1
br i1 %tobool33.not, label %if.end35, label %cleanup
if.end35: ; preds = %if.end21
%26 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%27 = load i32, ptr %arrayidx29, align 4, !tbaa !5
store i32 %27, ptr %arrayidx25, align 4, !tbaa !5
store i32 %26, ptr %arrayidx29, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end12, %if.end35
%cmp10.1 = icmp eq i32 %rem, 1
br i1 %cmp10.1, label %if.end12.2, label %if.end12.1
if.end12.1: ; preds = %for.body.preheader, %for.inc
%.pn95 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_x, i64 0, i64 1), align 4, !tbaa !5
%add5.181 = add nsw i32 %.pn95, %x
%.pn = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_y, i64 0, i64 1), align 4, !tbaa !5
%add8.182 = add nsw i32 %.pn, %y
%or.cond.1 = icmp ult i32 %add5.181, 3
%cmp17.1 = icmp sgt i32 %add8.182, -1
%or.cond48.1 = select i1 %or.cond.1, i1 %cmp17.1, i1 false
%cmp19.1 = icmp slt i32 %add8.182, 3
%or.cond49.1 = select i1 %or.cond48.1, i1 %cmp19.1, i1 false
br i1 %or.cond49.1, label %if.end21.1, label %for.inc.1
if.end21.1: ; preds = %if.end12.1
%idxprom26.1 = zext i32 %add8.182 to i64
%idxprom28.1 = zext i32 %add5.181 to i64
%arrayidx29.1 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26.1, i64 %idxprom28.1
%28 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%29 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
store i32 %29, ptr %arrayidx25, align 4, !tbaa !5
store i32 %28, ptr %arrayidx29.1, align 4, !tbaa !5
%call31.1 = tail call i32 @dfs(i32 noundef %add5.181, i32 noundef %add8.182, i32 noundef 1, i32 noundef %add30, i32 noundef %limt)
%tobool33.not.1 = icmp eq i32 %call31.1, -1
br i1 %tobool33.not.1, label %if.end35.1, label %cleanup
if.end35.1: ; preds = %if.end21.1
%30 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%31 = load i32, ptr %arrayidx29.1, align 4, !tbaa !5
store i32 %31, ptr %arrayidx25, align 4, !tbaa !5
store i32 %30, ptr %arrayidx29.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.end35.1, %if.end12.1
%cmp10.2 = icmp eq i32 %rem, 2
br i1 %cmp10.2, label %if.end12.3, label %if.end12.2
if.end12.2: ; preds = %for.inc, %for.inc.1
%.pn97 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_x, i64 0, i64 2), align 8, !tbaa !5
%add5.286 = add nsw i32 %.pn97, %x
%.pn96 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_y, i64 0, i64 2), align 8, !tbaa !5
%add8.287 = add nsw i32 %.pn96, %y
%or.cond.2 = icmp ult i32 %add5.286, 3
%cmp17.2 = icmp sgt i32 %add8.287, -1
%or.cond48.2 = select i1 %or.cond.2, i1 %cmp17.2, i1 false
%cmp19.2 = icmp slt i32 %add8.287, 3
%or.cond49.2 = select i1 %or.cond48.2, i1 %cmp19.2, i1 false
br i1 %or.cond49.2, label %if.end21.2, label %for.inc.2
if.end21.2: ; preds = %if.end12.2
%idxprom26.2 = zext i32 %add8.287 to i64
%idxprom28.2 = zext i32 %add5.286 to i64
%arrayidx29.2 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26.2, i64 %idxprom28.2
%32 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%33 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5
store i32 %33, ptr %arrayidx25, align 4, !tbaa !5
store i32 %32, ptr %arrayidx29.2, align 4, !tbaa !5
%call31.2 = tail call i32 @dfs(i32 noundef %add5.286, i32 noundef %add8.287, i32 noundef 2, i32 noundef %add30, i32 noundef %limt)
%tobool33.not.2 = icmp eq i32 %call31.2, -1
br i1 %tobool33.not.2, label %if.end35.2, label %cleanup
if.end35.2: ; preds = %if.end21.2
%34 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%35 = load i32, ptr %arrayidx29.2, align 4, !tbaa !5
store i32 %35, ptr %arrayidx25, align 4, !tbaa !5
store i32 %34, ptr %arrayidx29.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.end35.2, %if.end12.2
%cmp10.3 = icmp eq i32 %rem, 3
br i1 %cmp10.3, label %cleanup, label %if.end12.3
if.end12.3: ; preds = %for.inc.1, %for.inc.2
%.pn99 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_x, i64 0, i64 3), align 4, !tbaa !5
%add5.391 = add nsw i32 %.pn99, %x
%.pn98 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @d_y, i64 0, i64 3), align 4, !tbaa !5
%add8.392 = add nsw i32 %.pn98, %y
%or.cond.3 = icmp ult i32 %add5.391, 3
%cmp17.3 = icmp sgt i32 %add8.392, -1
%or.cond48.3 = select i1 %or.cond.3, i1 %cmp17.3, i1 false
%cmp19.3 = icmp slt i32 %add8.392, 3
%or.cond49.3 = select i1 %or.cond48.3, i1 %cmp19.3, i1 false
br i1 %or.cond49.3, label %if.end21.3, label %cleanup
if.end21.3: ; preds = %if.end12.3
%idxprom26.3 = zext i32 %add8.392 to i64
%idxprom28.3 = zext i32 %add5.391 to i64
%arrayidx29.3 = getelementptr inbounds [3 x [3 x i32]], ptr @pane, i64 0, i64 %idxprom26.3, i64 %idxprom28.3
%36 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%37 = load i32, ptr %arrayidx29.3, align 4, !tbaa !5
store i32 %37, ptr %arrayidx25, align 4, !tbaa !5
store i32 %36, ptr %arrayidx29.3, align 4, !tbaa !5
%call31.3 = tail call i32 @dfs(i32 noundef %add5.391, i32 noundef %add8.392, i32 noundef 3, i32 noundef %add30, i32 noundef %limt)
%tobool33.not.3 = icmp eq i32 %call31.3, -1
br i1 %tobool33.not.3, label %cleanup.sink.split, label %cleanup
cleanup.sink.split: ; preds = %if.end21.3, %if.end21.us.3
%arrayidx29.3.sink94 = phi ptr [ %arrayidx29.us.3, %if.end21.us.3 ], [ %arrayidx29.3, %if.end21.3 ]
%38 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%39 = load i32, ptr %arrayidx29.3.sink94, align 4, !tbaa !5
store i32 %39, ptr %arrayidx25, align 4, !tbaa !5
store i32 %38, ptr %arrayidx29.3.sink94, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %if.end21, %if.end21.1, %if.end21.2, %if.end21.3, %if.end12.3, %for.inc.2, %if.end21.us, %if.end21.us.1, %if.end21.us.2, %if.end21.us.3, %for.inc.us.2, %if.end, %entry
%retval.0 = phi i32 [ %deep, %entry ], [ -1, %if.end ], [ %call31.us, %if.end21.us ], [ %call31.us.1, %if.end21.us.1 ], [ %call31.us.2, %if.end21.us.2 ], [ %call31.us.3, %if.end21.us.3 ], [ -1, %for.inc.us.2 ], [ %call31, %if.end21 ], [ %call31.1, %if.end21.1 ], [ %call31.2, %if.end21.2 ], [ %call31.3, %if.end21.3 ], [ -1, %if.end12.3 ], [ -1, %for.inc.2 ], [ -1, %cleanup.sink.split ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @pane)
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 1))
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 2))
%call.198 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 0))
%call.1.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 1))
%call.2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 2))
%call.2100 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 0))
%call.1.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 1))
%call.2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 2))
%0 = load i32, ptr @pane, align 16, !tbaa !5
%tobool.not.i = icmp eq i32 %0, 0
br i1 %tobool.not.i, label %empty.exit, label %for.inc.i
for.inc.i: ; preds = %entry
%1 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 1), align 4, !tbaa !5
%tobool.not.1.i = icmp eq i32 %1, 0
br i1 %tobool.not.1.i, label %empty.exit, label %for.inc.1.i
for.inc.1.i: ; preds = %for.inc.i
%2 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 0, i64 2), align 8, !tbaa !5
%tobool.not.2.i = icmp eq i32 %2, 0
br i1 %tobool.not.2.i, label %empty.exit, label %for.inc.2.i
for.inc.2.i: ; preds = %for.inc.1.i
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 0), align 4, !tbaa !5
%tobool.not.125.i = icmp eq i32 %3, 0
br i1 %tobool.not.125.i, label %empty.exit, label %for.inc.126.i
for.inc.126.i: ; preds = %for.inc.2.i
%4 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 1), align 16, !tbaa !5
%tobool.not.1.1.i = icmp eq i32 %4, 0
br i1 %tobool.not.1.1.i, label %empty.exit, label %for.inc.1.1.i
for.inc.1.1.i: ; preds = %for.inc.126.i
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 1, i64 2), align 4, !tbaa !5
%tobool.not.2.1.i = icmp eq i32 %5, 0
br i1 %tobool.not.2.1.i, label %empty.exit, label %for.inc.2.1.i
for.inc.2.1.i: ; preds = %for.inc.1.1.i
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 0), align 8, !tbaa !5
%tobool.not.228.i = icmp eq i32 %6, 0
br i1 %tobool.not.228.i, label %empty.exit, label %for.inc.229.i
for.inc.229.i: ; preds = %for.inc.2.1.i
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @pane, i64 0, i64 2, i64 1), align 4, !tbaa !5
%tobool.not.1.2.i = icmp eq i32 %7, 0
%spec.select = select i1 %tobool.not.1.2.i, i32 1, i32 2
br label %empty.exit
empty.exit: ; preds = %for.inc.229.i, %entry, %for.inc.i, %for.inc.1.i, %for.inc.2.i, %for.inc.126.i, %for.inc.1.1.i, %for.inc.2.1.i
%row.0 = phi i32 [ 0, %entry ], [ 1, %for.inc.i ], [ 2, %for.inc.1.i ], [ 0, %for.inc.2.i ], [ 1, %for.inc.126.i ], [ 2, %for.inc.1.1.i ], [ 0, %for.inc.2.1.i ], [ %spec.select, %for.inc.229.i ]
%col.0 = phi i32 [ 0, %entry ], [ 0, %for.inc.i ], [ 0, %for.inc.1.i ], [ 1, %for.inc.2.i ], [ 1, %for.inc.126.i ], [ 1, %for.inc.1.1.i ], [ 2, %for.inc.2.1.i ], [ 2, %for.inc.229.i ]
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @temp, ptr noundef nonnull align 16 dereferenceable(36) @pane, i64 36, i1 false), !tbaa !5
%call32111 = tail call i32 @dfs(i32 noundef %row.0, i32 noundef %col.0, i32 noundef -1, i32 noundef 0, i32 noundef 0)
%cmp33.not112 = icmp eq i32 %call32111, -1
br i1 %cmp33.not112, label %for.cond38.preheader.preheader, label %if.then
for.cond12.preheader: ; preds = %for.cond38.preheader.preheader
%inc60 = add nuw nsw i32 %h.093113, 1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @temp, ptr noundef nonnull align 16 dereferenceable(36) @pane, i64 36, i1 false), !tbaa !5
%call32 = tail call i32 @dfs(i32 noundef %row.0, i32 noundef %col.0, i32 noundef -1, i32 noundef 0, i32 noundef %inc60)
%cmp33.not = icmp eq i32 %call32, -1
br i1 %cmp33.not, label %for.cond38.preheader.preheader, label %if.then
for.cond38.preheader.preheader: ; preds = %empty.exit, %for.cond12.preheader
%h.093113 = phi i32 [ %inc60, %for.cond12.preheader ], [ 0, %empty.exit ]
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) @pane, ptr noundef nonnull align 16 dereferenceable(36) @temp, i64 36, i1 false), !tbaa !5
%cmp55 = icmp eq i32 %h.093113, 99
br i1 %cmp55, label %for.end61.loopexit, label %for.cond12.preheader
if.then: ; preds = %for.cond12.preheader, %empty.exit
%call32.lcssa = phi i32 [ %call32111, %empty.exit ], [ %call32, %for.cond12.preheader ]
%call34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call32.lcssa)
br label %for.end61
for.end61.loopexit: ; preds = %for.cond38.preheader.preheader
%call57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef -1)
br label %for.end61
for.end61: ; preds = %for.end61.loopexit, %if.then
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 #2 = { mustprogress nofree 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 w,n,i,l,r,a[31];
scanf("%d%d",&w,&n);
for(i=0;i<=n;i++)
a[i] = i;
for(i=0;i<n;i++){
scanf("%d,%d",&l,&r);
a[0] = a[l];
a[l] = a[r];
a[r] = a[0];
}
for(i=1;i<=n;i++)
printf("%d\n",a[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189285/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189285/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%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:
%w = alloca i32, align 4
%n = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
%a = alloca [31 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not35 = icmp slt i32 %0, 0
br i1 %cmp.not35, label %for.end26, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %0, 7
br i1 %min.iters.check, label %for.body.preheader48, 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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%2 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> %step.add, ptr %3, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader48
for.body.preheader48: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block
%cmp237 = icmp sgt i32 %0, 0
br i1 %cmp237, label %for.body3, label %for.end26
for.body: ; preds = %for.body.preheader48, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader48 ]
%arrayidx = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %indvars.iv
%5 = trunc i64 %indvars.iv to i32
store i32 %5, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !13
for.cond18.preheader: ; preds = %for.body3
%6 = icmp slt i32 %12, 1
br i1 %6, label %for.end26, label %for.body20
for.body3: ; preds = %for.cond1.preheader, %for.body3
%i.138 = phi i32 [ %inc16, %for.body3 ], [ 0, %for.cond1.preheader ]
%call4 = 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
%idxprom5 = sext i32 %7 to i64
%arrayidx6 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %idxprom5
%8 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %8, ptr %a, align 16, !tbaa !5
%9 = load i32, ptr %r, align 4, !tbaa !5
%idxprom8 = sext i32 %9 to i64
%arrayidx9 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %idxprom8
%10 = load i32, ptr %arrayidx9, align 4, !tbaa !5
store i32 %10, ptr %arrayidx6, align 4, !tbaa !5
%11 = load i32, ptr %a, align 16, !tbaa !5
store i32 %11, ptr %arrayidx9, align 4, !tbaa !5
%inc16 = add nuw nsw i32 %i.138, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc16, %12
br i1 %cmp2, label %for.body3, label %for.cond18.preheader, !llvm.loop !14
for.body20: ; preds = %for.cond18.preheader, %for.body20
%indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body20 ], [ 1, %for.cond18.preheader ]
%arrayidx22 = getelementptr inbounds [31 x i32], ptr %a, i64 0, i64 %indvars.iv42
%13 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp19.not.not = icmp slt i64 %indvars.iv42, %15
br i1 %cmp19.not.not, label %for.body20, label %for.end26, !llvm.loop !15
for.end26: ; preds = %for.body20, %entry, %for.cond1.preheader, %for.cond18.preheader
call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void) {
int change[30][30];
int saki[30];
int i,j,max;
int a,b;
int maxyoko;
int now;
for(i=0;i<30;i++) {
for(j=0;j<30;j++) {
change[i][j]=i;
}
}
scanf("%d",&max);
scanf("%d",&maxyoko);
for(i=0;i<maxyoko;i++) {
scanf("%d,%d",&a,&b);
change[a-1][i]=b-1;
change[b-1][i]=a-1;
}
for(i=0;i<max;i++) {
now=i;
for(j=0;j<maxyoko;j++)now=change[now][j];
saki[now]=i;
}
for(i=0;i<max;i++)printf("%d\n",saki[i]+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%change = alloca [30 x [30 x i32]], align 16
%saki = alloca [30 x i32], align 16
%max = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%maxyoko = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 3600, ptr nonnull %change) #3
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %saki) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %max) #3
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 %maxyoko) #3
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 ]
%arrayidx5 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 0
%0 = trunc i64 %indvars.iv to i32
%1 = insertelement <4 x i32> poison, i32 %0, i64 0
%2 = shufflevector <4 x i32> %1, <4 x i32> poison, <4 x i32> zeroinitializer
store <4 x i32> %2, ptr %arrayidx5, align 8, !tbaa !5
%arrayidx5.4 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 4
store <4 x i32> %2, ptr %arrayidx5.4, align 8, !tbaa !5
%arrayidx5.8 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 8
store <4 x i32> %2, ptr %arrayidx5.8, align 8, !tbaa !5
%arrayidx5.12 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 12
store <4 x i32> %2, ptr %arrayidx5.12, align 8, !tbaa !5
%arrayidx5.16 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 16
store <4 x i32> %2, ptr %arrayidx5.16, align 8, !tbaa !5
%arrayidx5.20 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 20
store <4 x i32> %2, ptr %arrayidx5.20, align 8, !tbaa !5
%arrayidx5.24 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 24
store <4 x i32> %2, ptr %arrayidx5.24, align 8, !tbaa !5
%arrayidx5.28 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 28
store i32 %0, ptr %arrayidx5.28, align 8, !tbaa !5
%arrayidx5.29 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %indvars.iv, i64 29
store i32 %0, ptr %arrayidx5.29, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 30
br i1 %exitcond.not, label %for.end8, label %for.cond1.preheader, !llvm.loop !9
for.end8: ; preds = %for.cond1.preheader
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %max)
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %maxyoko)
%3 = load i32, ptr %maxyoko, align 4, !tbaa !5
%cmp1177 = icmp sgt i32 %3, 0
br i1 %cmp1177, label %for.body12, label %for.cond28.preheader
for.cond28.preheader: ; preds = %for.body12, %for.end8
%.lcssa = phi i32 [ %3, %for.end8 ], [ %16, %for.body12 ]
%4 = load i32, ptr %max, align 4, !tbaa !5
%cmp2983 = icmp sgt i32 %4, 0
br i1 %cmp2983, label %for.cond31.preheader.lr.ph, label %for.end54
for.cond31.preheader.lr.ph: ; preds = %for.cond28.preheader
%cmp3279 = icmp sgt i32 %.lcssa, 0
br i1 %cmp3279, label %for.cond31.preheader.us.preheader, label %for.cond31.preheader.preheader
for.cond31.preheader.preheader: ; preds = %for.cond31.preheader.lr.ph
%wide.trip.count = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.cond31.preheader.preheader116, label %vector.ph
vector.ph: ; preds = %for.cond31.preheader.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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%5 = getelementptr inbounds [30 x i32], ptr %saki, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
store <4 x i32> %step.add, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond46.preheader, label %for.cond31.preheader.preheader116
for.cond31.preheader.preheader116: ; preds = %for.cond31.preheader.preheader, %middle.block
%indvars.iv95.ph = phi i64 [ 0, %for.cond31.preheader.preheader ], [ %n.vec, %middle.block ]
br label %for.cond31.preheader
for.cond31.preheader.us.preheader: ; preds = %for.cond31.preheader.lr.ph
%wide.trip.count102 = zext i32 %.lcssa to i64
%xtraiter = and i64 %wide.trip.count102, 3
%8 = icmp ult i32 %.lcssa, 4
%unroll_iter = and i64 %wide.trip.count102, 4294967292
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond31.preheader.us
for.cond31.preheader.us: ; preds = %for.cond31.preheader.us.preheader, %for.cond31.for.end40_crit_edge.us
%i.284.us = phi i32 [ %inc44.us, %for.cond31.for.end40_crit_edge.us ], [ 0, %for.cond31.preheader.us.preheader ]
br i1 %8, label %for.cond31.for.end40_crit_edge.us.unr-lcssa, label %for.body33.us
for.body33.us: ; preds = %for.cond31.preheader.us, %for.body33.us
%indvars.iv99 = phi i64 [ %indvars.iv.next100.3, %for.body33.us ], [ 0, %for.cond31.preheader.us ]
%now.081.us = phi i32 [ %12, %for.body33.us ], [ %i.284.us, %for.cond31.preheader.us ]
%niter = phi i64 [ %niter.next.3, %for.body33.us ], [ 0, %for.cond31.preheader.us ]
%idxprom34.us = sext i32 %now.081.us to i64
%arrayidx37.us = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %idxprom34.us, i64 %indvars.iv99
%9 = load i32, ptr %arrayidx37.us, align 8, !tbaa !5
%indvars.iv.next100 = or i64 %indvars.iv99, 1
%idxprom34.us.1 = sext i32 %9 to i64
%arrayidx37.us.1 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %idxprom34.us.1, i64 %indvars.iv.next100
%10 = load i32, ptr %arrayidx37.us.1, align 4, !tbaa !5
%indvars.iv.next100.1 = or i64 %indvars.iv99, 2
%idxprom34.us.2 = sext i32 %10 to i64
%arrayidx37.us.2 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %idxprom34.us.2, i64 %indvars.iv.next100.1
%11 = load i32, ptr %arrayidx37.us.2, align 8, !tbaa !5
%indvars.iv.next100.2 = or i64 %indvars.iv99, 3
%idxprom34.us.3 = sext i32 %11 to i64
%arrayidx37.us.3 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %idxprom34.us.3, i64 %indvars.iv.next100.2
%12 = load i32, ptr %arrayidx37.us.3, align 4, !tbaa !5
%indvars.iv.next100.3 = add nuw nsw i64 %indvars.iv99, 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.cond31.for.end40_crit_edge.us.unr-lcssa, label %for.body33.us, !llvm.loop !14
for.cond31.for.end40_crit_edge.us.unr-lcssa: ; preds = %for.body33.us, %for.cond31.preheader.us
%.lcssa115.ph = phi i32 [ undef, %for.cond31.preheader.us ], [ %12, %for.body33.us ]
%indvars.iv99.unr = phi i64 [ 0, %for.cond31.preheader.us ], [ %indvars.iv.next100.3, %for.body33.us ]
%now.081.us.unr = phi i32 [ %i.284.us, %for.cond31.preheader.us ], [ %12, %for.body33.us ]
br i1 %lcmp.mod.not, label %for.cond31.for.end40_crit_edge.us, label %for.body33.us.epil
for.body33.us.epil: ; preds = %for.cond31.for.end40_crit_edge.us.unr-lcssa, %for.body33.us.epil
%indvars.iv99.epil = phi i64 [ %indvars.iv.next100.epil, %for.body33.us.epil ], [ %indvars.iv99.unr, %for.cond31.for.end40_crit_edge.us.unr-lcssa ]
%now.081.us.epil = phi i32 [ %13, %for.body33.us.epil ], [ %now.081.us.unr, %for.cond31.for.end40_crit_edge.us.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body33.us.epil ], [ 0, %for.cond31.for.end40_crit_edge.us.unr-lcssa ]
%idxprom34.us.epil = sext i32 %now.081.us.epil to i64
%arrayidx37.us.epil = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %idxprom34.us.epil, i64 %indvars.iv99.epil
%13 = load i32, ptr %arrayidx37.us.epil, align 4, !tbaa !5
%indvars.iv.next100.epil = add nuw nsw i64 %indvars.iv99.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.cond31.for.end40_crit_edge.us, label %for.body33.us.epil, !llvm.loop !15
for.cond31.for.end40_crit_edge.us: ; preds = %for.body33.us.epil, %for.cond31.for.end40_crit_edge.us.unr-lcssa
%.lcssa115 = phi i32 [ %.lcssa115.ph, %for.cond31.for.end40_crit_edge.us.unr-lcssa ], [ %13, %for.body33.us.epil ]
%idxprom41.us = sext i32 %.lcssa115 to i64
%arrayidx42.us = getelementptr inbounds [30 x i32], ptr %saki, i64 0, i64 %idxprom41.us
store i32 %i.284.us, ptr %arrayidx42.us, align 4, !tbaa !5
%inc44.us = add nuw nsw i32 %i.284.us, 1
%exitcond104.not = icmp eq i32 %inc44.us, %4
br i1 %exitcond104.not, label %for.cond46.preheader, label %for.cond31.preheader.us, !llvm.loop !17
for.body12: ; preds = %for.end8, %for.body12
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.body12 ], [ 0, %for.end8 ]
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%14 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %14, -1
%15 = load i32, ptr %a, align 4, !tbaa !5
%sub14 = add nsw i32 %15, -1
%idxprom15 = sext i32 %sub14 to i64
%arrayidx18 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %idxprom15, i64 %indvars.iv92
store i32 %sub, ptr %arrayidx18, align 4, !tbaa !5
%idxprom21 = sext i32 %sub to i64
%arrayidx24 = getelementptr inbounds [30 x [30 x i32]], ptr %change, i64 0, i64 %idxprom21, i64 %indvars.iv92
store i32 %sub14, ptr %arrayidx24, align 4, !tbaa !5
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%16 = load i32, ptr %maxyoko, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp11 = icmp slt i64 %indvars.iv.next93, %17
br i1 %cmp11, label %for.body12, label %for.cond28.preheader, !llvm.loop !18
for.cond31.preheader: ; preds = %for.cond31.preheader.preheader116, %for.cond31.preheader
%indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.cond31.preheader ], [ %indvars.iv95.ph, %for.cond31.preheader.preheader116 ]
%arrayidx42 = getelementptr inbounds [30 x i32], ptr %saki, i64 0, i64 %indvars.iv95
%18 = trunc i64 %indvars.iv95 to i32
store i32 %18, ptr %arrayidx42, align 4, !tbaa !5
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%exitcond98.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count
br i1 %exitcond98.not, label %for.cond46.preheader, label %for.cond31.preheader, !llvm.loop !19
for.cond46.preheader: ; preds = %for.cond31.preheader, %for.cond31.for.end40_crit_edge.us, %middle.block
br i1 %cmp2983, label %for.body48, label %for.end54
for.body48: ; preds = %for.cond46.preheader, %for.body48
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body48 ], [ 0, %for.cond46.preheader ]
%arrayidx50 = getelementptr inbounds [30 x i32], ptr %saki, i64 0, i64 %indvars.iv105
%19 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%add = add nsw i32 %19, 1
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%20 = load i32, ptr %max, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp47 = icmp slt i64 %indvars.iv.next106, %21
br i1 %cmp47, label %for.body48, label %for.end54, !llvm.loop !20
for.end54: ; preds = %for.body48, %for.cond28.preheader, %for.cond46.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %maxyoko) #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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %max) #3
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %saki) #3
call void @llvm.lifetime.end.p0(i64 3600, ptr nonnull %change) #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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !13, !12}
!20 = distinct !{!20, !10}
|
#include<stdio.h>
typedef struct{
int a;
int b;
} DrawingLots;
int main(){
int w,n,i,j;
int now;
int answer[31];
DrawingLots q[31];
scanf("%d%d",&w,&n);
for(i=0;i<n;i++){
scanf("%d,%d",&q[i].a,&q[i].b);
}
for(i=1;i<=w;i++){
now=i;
for(j=1;j<=n;j++){
if(q[j-1].a==now){
now=q[j-1].b;
}else if(q[j-1].b==now){
now=q[j-1].a;
}
}
answer[now]=i;
}
for(i=1;i<=w;i++) printf("%d\n",answer[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189386/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189386/source.c"
target datalayout = "e-m:e-p270: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.DrawingLots = type { i32, i32 }
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%n = alloca i32, align 4
%answer = alloca [31 x i32], align 16
%q = alloca [31 x %struct.DrawingLots], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %answer) #3
call void @llvm.lifetime.start.p0(i64 248, ptr nonnull %q) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %10, %for.body ]
%1 = load i32, ptr %w, align 4, !tbaa !5
%cmp5.not69 = icmp slt i32 %1, 1
br i1 %cmp5.not69, label %for.end45, label %for.cond7.preheader.lr.ph
for.cond7.preheader.lr.ph: ; preds = %for.cond4.preheader
%cmp8.not65 = icmp slt i32 %.lcssa, 1
br i1 %cmp8.not65, label %for.cond7.preheader.us.preheader, label %for.cond7.preheader.preheader
for.cond7.preheader.preheader: ; preds = %for.cond7.preheader.lr.ph
%2 = zext i32 %.lcssa to i64
%xtraiter = and i64 %2, 1
%3 = icmp eq i32 %.lcssa, 1
%unroll_iter = and i64 %2, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond7.preheader
for.cond7.preheader.us.preheader: ; preds = %for.cond7.preheader.lr.ph
%4 = add nuw i32 %1, 1
%wide.trip.count84 = zext i32 %4 to i64
%5 = add nsw i64 %wide.trip.count84, -1
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.cond7.preheader.us.preheader94, label %vector.ph
vector.ph: ; preds = %for.cond7.preheader.us.preheader
%n.vec = and i64 %5, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%offset.idx = or i64 %index, 1
%6 = getelementptr inbounds [31 x i32], ptr %answer, i64 0, i64 %offset.idx
store <4 x i32> %vec.ind, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %step.add, ptr %7, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %5, %n.vec
br i1 %cmp.n, label %for.cond37.preheader, label %for.cond7.preheader.us.preheader94
for.cond7.preheader.us.preheader94: ; preds = %for.cond7.preheader.us.preheader, %middle.block
%indvars.iv81.ph = phi i64 [ 1, %for.cond7.preheader.us.preheader ], [ %ind.end, %middle.block ]
br label %for.cond7.preheader.us
for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader94, %for.cond7.preheader.us
%indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.cond7.preheader.us ], [ %indvars.iv81.ph, %for.cond7.preheader.us.preheader94 ]
%arrayidx33.us = getelementptr inbounds [31 x i32], ptr %answer, i64 0, i64 %indvars.iv81
%9 = trunc i64 %indvars.iv81 to i32
store i32 %9, ptr %arrayidx33.us, align 4, !tbaa !5
%indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
%exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
br i1 %exitcond85.not, label %for.cond37.preheader, label %for.cond7.preheader.us, !llvm.loop !13
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %indvars.iv
%b = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %b)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !14
for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.cond7.for.end31_crit_edge
%i.170 = phi i32 [ %inc35, %for.cond7.for.end31_crit_edge ], [ 1, %for.cond7.preheader.preheader ]
br i1 %3, label %for.cond7.for.end31_crit_edge.unr-lcssa, label %for.body9
for.cond37.preheader: ; preds = %for.cond7.for.end31_crit_edge, %for.cond7.preheader.us, %middle.block
br i1 %cmp5.not69, label %for.end45, label %for.body39
for.body9: ; preds = %for.cond7.preheader, %for.body9
%indvars.iv76 = phi i64 [ %indvars.iv.next77.1, %for.body9 ], [ 1, %for.cond7.preheader ]
%now.067 = phi i32 [ %now.1.1, %for.body9 ], [ %i.170, %for.cond7.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body9 ], [ 0, %for.cond7.preheader ]
%12 = add nsw i64 %indvars.iv76, -1
%arrayidx11 = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %12
%13 = load i32, ptr %arrayidx11, align 8, !tbaa !15
%cmp13 = icmp eq i32 %13, %now.067
%b17 = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %12, i32 1
%14 = load i32, ptr %b17, align 4, !tbaa !17
%cmp22 = icmp eq i32 %14, %now.067
%spec.select = select i1 %cmp22, i32 %13, i32 %now.067
%now.1 = select i1 %cmp13, i32 %14, i32 %spec.select
%arrayidx11.1 = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %indvars.iv76
%15 = load i32, ptr %arrayidx11.1, align 8, !tbaa !15
%cmp13.1 = icmp eq i32 %15, %now.1
%b17.1 = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %indvars.iv76, i32 1
%16 = load i32, ptr %b17.1, align 4, !tbaa !17
%cmp22.1 = icmp eq i32 %16, %now.1
%spec.select.1 = select i1 %cmp22.1, i32 %15, i32 %now.1
%now.1.1 = select i1 %cmp13.1, i32 %16, i32 %spec.select.1
%indvars.iv.next77.1 = add nuw nsw i64 %indvars.iv76, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond7.for.end31_crit_edge.unr-lcssa, label %for.body9, !llvm.loop !18
for.cond7.for.end31_crit_edge.unr-lcssa: ; preds = %for.body9, %for.cond7.preheader
%now.1.lcssa.ph = phi i32 [ undef, %for.cond7.preheader ], [ %now.1.1, %for.body9 ]
%indvars.iv76.unr = phi i64 [ 1, %for.cond7.preheader ], [ %indvars.iv.next77.1, %for.body9 ]
%now.067.unr = phi i32 [ %i.170, %for.cond7.preheader ], [ %now.1.1, %for.body9 ]
br i1 %lcmp.mod.not, label %for.cond7.for.end31_crit_edge, label %for.body9.epil
for.body9.epil: ; preds = %for.cond7.for.end31_crit_edge.unr-lcssa
%17 = add nsw i64 %indvars.iv76.unr, -1
%arrayidx11.epil = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %17
%18 = load i32, ptr %arrayidx11.epil, align 8, !tbaa !15
%cmp13.epil = icmp eq i32 %18, %now.067.unr
%b17.epil = getelementptr inbounds [31 x %struct.DrawingLots], ptr %q, i64 0, i64 %17, i32 1
%19 = load i32, ptr %b17.epil, align 4, !tbaa !17
%cmp22.epil = icmp eq i32 %19, %now.067.unr
%spec.select.epil = select i1 %cmp22.epil, i32 %18, i32 %now.067.unr
%now.1.epil = select i1 %cmp13.epil, i32 %19, i32 %spec.select.epil
br label %for.cond7.for.end31_crit_edge
for.cond7.for.end31_crit_edge: ; preds = %for.cond7.for.end31_crit_edge.unr-lcssa, %for.body9.epil
%now.1.lcssa = phi i32 [ %now.1.lcssa.ph, %for.cond7.for.end31_crit_edge.unr-lcssa ], [ %now.1.epil, %for.body9.epil ]
%idxprom32 = sext i32 %now.1.lcssa to i64
%arrayidx33 = getelementptr inbounds [31 x i32], ptr %answer, i64 0, i64 %idxprom32
store i32 %i.170, ptr %arrayidx33, align 4, !tbaa !5
%inc35 = add nuw i32 %i.170, 1
%exitcond80.not = icmp eq i32 %i.170, %1
br i1 %exitcond80.not, label %for.cond37.preheader, label %for.cond7.preheader, !llvm.loop !19
for.body39: ; preds = %for.cond37.preheader, %for.body39
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.body39 ], [ 1, %for.cond37.preheader ]
%arrayidx41 = getelementptr inbounds [31 x i32], ptr %answer, i64 0, i64 %indvars.iv86
%20 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%21 = load i32, ptr %w, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp38.not.not = icmp slt i64 %indvars.iv86, %22
br i1 %cmp38.not.not, label %for.body39, label %for.end45, !llvm.loop !20
for.end45: ; preds = %for.body39, %for.cond4.preheader, %for.cond37.preheader
call void @llvm.lifetime.end.p0(i64 248, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %answer) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 0}
!16 = !{!"", !6, i64 0, !6, i64 4}
!17 = !{!16, !6, i64 4}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
int main(void) {
int w;
scanf("%d",&w);
int n;
scanf("%d",&n);
int i,a[30],b[30],j,now;
for(j=0;j<n;j++){
scanf("%d,%d",&a[j],&b[j]);
}
for(i=1;i<=w;i++){
now=i;
for(j=n-1;j>=0;j--){
if(a[j]==now){
now=b[j];
}
else if(b[j]==now){
now=a[j];
}
}
printf("%d\n",now);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [30 x i32], align 16
%b = alloca [30 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %b) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, label %for.body, label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body, %entry
%1 = load i32, ptr %w, align 4, !tbaa !5
%cmp6.not48 = icmp slt i32 %1, 1
br i1 %cmp6.not48, label %for.end28, label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx3 = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%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.cond5.preheader, !llvm.loop !9
for.body7: ; preds = %for.cond5.preheader, %for.end24
%i.049 = phi i32 [ %inc27, %for.end24 ], [ 1, %for.cond5.preheader ]
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp945 = icmp sgt i32 %4, 0
br i1 %cmp945, label %for.body10.preheader, label %for.end24
for.body10.preheader: ; preds = %for.body7
%5 = zext i32 %4 to i64
%xtraiter = and i64 %5, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body10.prol.loopexit, label %for.body10.prol
for.body10.prol: ; preds = %for.body10.preheader
%indvars.iv.next52.prol = add nsw i64 %5, -1
%idxprom11.prol = and i64 %indvars.iv.next52.prol, 4294967295
%arrayidx12.prol = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %idxprom11.prol
%6 = load i32, ptr %arrayidx12.prol, align 4, !tbaa !5
%cmp13.prol = icmp eq i32 %6, %i.049
%arrayidx15.prol = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %idxprom11.prol
%7 = load i32, ptr %arrayidx15.prol, align 4, !tbaa !5
%cmp18.prol = icmp eq i32 %7, %i.049
%spec.select.prol = select i1 %cmp18.prol, i32 %6, i32 %i.049
%now.1.prol = select i1 %cmp13.prol, i32 %7, i32 %spec.select.prol
br label %for.body10.prol.loopexit
for.body10.prol.loopexit: ; preds = %for.body10.prol, %for.body10.preheader
%indvars.iv51.unr = phi i64 [ %5, %for.body10.preheader ], [ %indvars.iv.next52.prol, %for.body10.prol ]
%now.046.unr = phi i32 [ %i.049, %for.body10.preheader ], [ %now.1.prol, %for.body10.prol ]
%now.1.lcssa.unr = phi i32 [ undef, %for.body10.preheader ], [ %now.1.prol, %for.body10.prol ]
%8 = icmp eq i32 %4, 1
br i1 %8, label %for.end24, label %for.body10
for.body10: ; preds = %for.body10.prol.loopexit, %for.body10
%indvars.iv51 = phi i64 [ %indvars.iv.next52.1, %for.body10 ], [ %indvars.iv51.unr, %for.body10.prol.loopexit ]
%now.046 = phi i32 [ %now.1.1, %for.body10 ], [ %now.046.unr, %for.body10.prol.loopexit ]
%indvars.iv.next52 = add nsw i64 %indvars.iv51, -1
%idxprom11 = and i64 %indvars.iv.next52, 4294967295
%arrayidx12 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %idxprom11
%9 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp eq i32 %9, %now.046
%arrayidx15 = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %idxprom11
%10 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp18 = icmp eq i32 %10, %now.046
%spec.select = select i1 %cmp18, i32 %9, i32 %now.046
%now.1 = select i1 %cmp13, i32 %10, i32 %spec.select
%indvars.iv.next52.1 = add nsw i64 %indvars.iv51, -2
%idxprom11.1 = and i64 %indvars.iv.next52.1, 4294967295
%arrayidx12.1 = getelementptr inbounds [30 x i32], ptr %a, i64 0, i64 %idxprom11.1
%11 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5
%cmp13.1 = icmp eq i32 %11, %now.1
%arrayidx15.1 = getelementptr inbounds [30 x i32], ptr %b, i64 0, i64 %idxprom11.1
%12 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%cmp18.1 = icmp eq i32 %12, %now.1
%spec.select.1 = select i1 %cmp18.1, i32 %11, i32 %now.1
%now.1.1 = select i1 %cmp13.1, i32 %12, i32 %spec.select.1
%cmp9.1 = icmp ugt i64 %indvars.iv.next52, 1
br i1 %cmp9.1, label %for.body10, label %for.end24, !llvm.loop !11
for.end24: ; preds = %for.body10.prol.loopexit, %for.body10, %for.body7
%now.0.lcssa = phi i32 [ %i.049, %for.body7 ], [ %now.1.lcssa.unr, %for.body10.prol.loopexit ], [ %now.1.1, %for.body10 ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %now.0.lcssa)
%inc27 = add nuw nsw i32 %i.049, 1
%13 = load i32, ptr %w, align 4, !tbaa !5
%cmp6.not.not = icmp slt i32 %i.049, %13
br i1 %cmp6.not.not, label %for.body7, label %for.end28, !llvm.loop !12
for.end28: ; preds = %for.end24, %for.cond5.preheader
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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>
#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
int main(void){
int x,y,a,b,i,num[30],t;
scanf("%d %d",&y,&x);
rep(i,y)num[i]=i+1;
rep(i,x){
scanf("%d,%d",&a,&b);
t=num[a-1];
num[a-1]=num[b-1];
num[b-1]=t;
}
rep(i,y)printf("%d\n",num[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189500/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189500/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%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:
%x = alloca i32, align 4
%y = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%num = alloca [30 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
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 120, ptr nonnull %num) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y, ptr noundef nonnull %x)
%0 = load i32, ptr %y, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %0, 0
br i1 %cmp36, label %for.body.preheader, label %for.cond1.preheader
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.preheader47, 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.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%1 = getelementptr inbounds [30 x i32], ptr %num, i64 0, i64 %index
%2 = trunc <4 x i64> %vec.ind to <4 x i32>
%3 = add <4 x i32> %2, <i32 1, i32 1, i32 1, i32 1>
%4 = trunc <4 x i64> %vec.ind to <4 x i32>
%5 = add <4 x i32> %4, <i32 5, i32 5, i32 5, i32 5>
store <4 x i32> %3, ptr %1, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> %5, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader47
for.body.preheader47: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block, %entry
%8 = load i32, ptr %x, align 4, !tbaa !5
%cmp238 = icmp sgt i32 %8, 0
br i1 %cmp238, label %for.body3, label %for.cond19.preheader
for.body: ; preds = %for.body.preheader47, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader47 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [30 x i32], ptr %num, i64 0, i64 %indvars.iv
%9 = trunc i64 %indvars.iv.next to i32
store i32 %9, ptr %arrayidx, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !13
for.cond19.preheader.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %y, align 4, !tbaa !5
br label %for.cond19.preheader
for.cond19.preheader: ; preds = %for.cond19.preheader.loopexit, %for.cond1.preheader
%10 = phi i32 [ %.pre, %for.cond19.preheader.loopexit ], [ %0, %for.cond1.preheader ]
%cmp2040 = icmp sgt i32 %10, 0
br i1 %cmp2040, label %for.body21, label %for.end27
for.body3: ; preds = %for.cond1.preheader, %for.body3
%i.139 = phi i32 [ %inc17, %for.body3 ], [ 0, %for.cond1.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%11 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %11, -1
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds [30 x i32], ptr %num, i64 0, i64 %idxprom5
%12 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%13 = load i32, ptr %b, align 4, !tbaa !5
%sub7 = add nsw i32 %13, -1
%idxprom8 = sext i32 %sub7 to i64
%arrayidx9 = getelementptr inbounds [30 x i32], ptr %num, i64 0, i64 %idxprom8
%14 = load i32, ptr %arrayidx9, align 4, !tbaa !5
store i32 %14, ptr %arrayidx6, align 4, !tbaa !5
store i32 %12, ptr %arrayidx9, align 4, !tbaa !5
%inc17 = add nuw nsw i32 %i.139, 1
%15 = load i32, ptr %x, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc17, %15
br i1 %cmp2, label %for.body3, label %for.cond19.preheader.loopexit, !llvm.loop !14
for.body21: ; preds = %for.cond19.preheader, %for.body21
%indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body21 ], [ 0, %for.cond19.preheader ]
%arrayidx23 = getelementptr inbounds [30 x i32], ptr %num, i64 0, i64 %indvars.iv43
%16 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
%17 = load i32, ptr %y, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp20 = icmp slt i64 %indvars.iv.next44, %18
br i1 %cmp20, label %for.body21, label %for.end27, !llvm.loop !15
for.end27: ; preds = %for.body21, %for.cond19.preheader
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %num) #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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#define NLIMIT (30)
#define WLIMIT (30)
int main()
{
int i, n, w, a, b, point[WLIMIT], temp;
scanf("%d", &w);
scanf("%d", &n);
for (i = 0; i < w; ++i) point[i] = i + 1;
for (i = 0; i < n && (scanf("%d,%d", &a, &b) != EOF); ++i){
temp = point[a - 1];
point[a - 1] = point[b - 1];
point[b - 1] = temp;
}
for (i = 0; i < w; ++i) printf("%d\n", point[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189544/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189544/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%w = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%point = alloca [30 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
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 120, ptr nonnull %point) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %w, align 4, !tbaa !5
%cmp38 = icmp sgt i32 %0, 0
br i1 %cmp38, label %for.body.preheader, label %for.cond2.preheader
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.preheader49, 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.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%1 = getelementptr inbounds [30 x i32], ptr %point, i64 0, i64 %index
%2 = trunc <4 x i64> %vec.ind to <4 x i32>
%3 = add <4 x i32> %2, <i32 1, i32 1, i32 1, i32 1>
%4 = trunc <4 x i64> %vec.ind to <4 x i32>
%5 = add <4 x i32> %4, <i32 5, i32 5, i32 5, i32 5>
store <4 x i32> %3, ptr %1, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> %5, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader49
for.body.preheader49: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond2.preheader: ; preds = %for.body, %middle.block, %entry
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp340 = icmp sgt i32 %8, 0
br i1 %cmp340, label %land.rhs, label %for.end20
for.body: ; preds = %for.body.preheader49, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader49 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [30 x i32], ptr %point, i64 0, i64 %indvars.iv
%9 = trunc i64 %indvars.iv.next to i32
store i32 %9, ptr %arrayidx, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !13
land.rhs: ; preds = %for.cond2.preheader, %for.body6
%i.141 = phi i32 [ %inc19, %for.body6 ], [ 0, %for.cond2.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp5.not = icmp eq i32 %call4, -1
br i1 %cmp5.not, label %for.end20.loopexit, label %for.body6
for.body6: ; preds = %land.rhs
%10 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %10, -1
%idxprom7 = sext i32 %sub to i64
%arrayidx8 = getelementptr inbounds [30 x i32], ptr %point, i64 0, i64 %idxprom7
%11 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%12 = load i32, ptr %b, align 4, !tbaa !5
%sub9 = add nsw i32 %12, -1
%idxprom10 = sext i32 %sub9 to i64
%arrayidx11 = getelementptr inbounds [30 x i32], ptr %point, i64 0, i64 %idxprom10
%13 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %13, ptr %arrayidx8, align 4, !tbaa !5
store i32 %11, ptr %arrayidx11, align 4, !tbaa !5
%inc19 = add nuw nsw i32 %i.141, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc19, %14
br i1 %cmp3, label %land.rhs, label %for.end20.loopexit, !llvm.loop !14
for.end20.loopexit: ; preds = %for.body6, %land.rhs
%.pre = load i32, ptr %w, align 4, !tbaa !5
br label %for.end20
for.end20: ; preds = %for.end20.loopexit, %for.cond2.preheader
%15 = phi i32 [ %.pre, %for.end20.loopexit ], [ %0, %for.cond2.preheader ]
%cmp2242 = icmp sgt i32 %15, 0
br i1 %cmp2242, label %for.body23, label %for.end29
for.body23: ; preds = %for.end20, %for.body23
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body23 ], [ 0, %for.end20 ]
%arrayidx25 = getelementptr inbounds [30 x i32], ptr %point, i64 0, i64 %indvars.iv45
%16 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%17 = load i32, ptr %w, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp22 = icmp slt i64 %indvars.iv.next46, %18
br i1 %cmp22, label %for.body23, label %for.end29, !llvm.loop !15
for.end29: ; preds = %for.body23, %for.end20
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %point) #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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(){
int N[30], n, w, copy;
int a, b, i;
scanf("%d", &w);
for( i = 0; i < w; i++){
N[i] = i+1;
}
scanf("%d", &n);
for( i = 0; i < n; i++){
scanf("%d,%d", &a, &b);
copy = N[a-1];
N[a-1] = N[b-1];
N[b-1] = copy;
}
for( i = 0; i < w; i++){
printf("%d\n", N[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189588/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189588/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca [30 x i32], align 16
%n = alloca i32, align 4
%w = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body.preheader, label %for.end
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.preheader48, 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.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%1 = getelementptr inbounds [30 x i32], ptr %N, i64 0, i64 %index
%2 = trunc <4 x i64> %vec.ind to <4 x i32>
%3 = add <4 x i32> %2, <i32 1, i32 1, i32 1, i32 1>
%4 = trunc <4 x i64> %vec.ind to <4 x i32>
%5 = add <4 x i32> %4, <i32 5, i32 5, i32 5, i32 5>
store <4 x i32> %3, ptr %1, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> %5, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
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.preheader48
for.body.preheader48: ; 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.preheader48, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader48 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [30 x i32], ptr %N, i64 0, i64 %indvars.iv
%8 = trunc i64 %indvars.iv.next to i32
store i32 %8, ptr %arrayidx, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp339 = icmp sgt i32 %9, 0
br i1 %cmp339, label %for.body4, label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.body4, %for.end
%10 = load i32, ptr %w, align 4, !tbaa !5
%cmp2141 = icmp sgt i32 %10, 0
br i1 %cmp2141, label %for.body22, label %for.end28
for.body4: ; preds = %for.end, %for.body4
%i.140 = phi i32 [ %inc18, %for.body4 ], [ 0, %for.end ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%11 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %11, -1
%idxprom6 = sext i32 %sub to i64
%arrayidx7 = getelementptr inbounds [30 x i32], ptr %N, i64 0, i64 %idxprom6
%12 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%13 = load i32, ptr %b, align 4, !tbaa !5
%sub8 = add nsw i32 %13, -1
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds [30 x i32], ptr %N, i64 0, i64 %idxprom9
%14 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %14, ptr %arrayidx7, align 4, !tbaa !5
store i32 %12, ptr %arrayidx10, align 4, !tbaa !5
%inc18 = add nuw nsw i32 %i.140, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc18, %15
br i1 %cmp3, label %for.body4, label %for.cond20.preheader, !llvm.loop !14
for.body22: ; preds = %for.cond20.preheader, %for.body22
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body22 ], [ 0, %for.cond20.preheader ]
%arrayidx24 = getelementptr inbounds [30 x i32], ptr %N, i64 0, i64 %indvars.iv44
%16 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%17 = load i32, ptr %w, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp21 = icmp slt i64 %indvars.iv.next45, %18
br i1 %cmp21, label %for.body22, label %for.end28, !llvm.loop !15
for.end28: ; preds = %for.body22, %for.cond20.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 120, 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void){
int w,n,i,a,b,temp;
scanf("%d %d",&w,&n);
int num[w+1];
for(i=1;i<=w;i++) num[i]=i;
for(i=0;i<n;i++){
scanf("%d,%d",&a,&b);
temp=num[a];
num[a]=num[b];
num[b]=temp;
}
for(i=1;i<=w;i++) printf("%d\n",num[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189638/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189638/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%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:
%w = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %n)
%0 = load i32, ptr %w, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp.not33 = icmp slt i32 %3, 1
br i1 %cmp.not33, label %for.cond1.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%4 = add nuw i32 %3, 1
%wide.trip.count = zext i32 %4 to i64
%5 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body.preheader44, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %5, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%offset.idx = or i64 %index, 1
%6 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
store <4 x i32> %vec.ind, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %step.add, ptr %7, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %5, %n.vec
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader44
for.body.preheader44: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block, %entry
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp235 = icmp sgt i32 %9, 0
br i1 %cmp235, label %for.body3, label %for.cond16.preheader
for.body: ; preds = %for.body.preheader44, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader44 ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%10 = trunc i64 %indvars.iv to i32
store i32 %10, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !13
for.cond16.preheader.loopexit: ; preds = %for.body3
%.pre = load i32, ptr %w, align 4, !tbaa !5
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.loopexit, %for.cond1.preheader
%11 = phi i32 [ %.pre, %for.cond16.preheader.loopexit ], [ %3, %for.cond1.preheader ]
%cmp17.not37 = icmp slt i32 %11, 1
br i1 %cmp17.not37, label %for.end24, label %for.body18
for.body3: ; preds = %for.cond1.preheader, %for.body3
%i.136 = phi i32 [ %inc14, %for.body3 ], [ 0, %for.cond1.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%12 = load i32, ptr %a, align 4, !tbaa !5
%idxprom5 = sext i32 %12 to i64
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5
%13 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%14 = load i32, ptr %b, align 4, !tbaa !5
%idxprom7 = sext i32 %14 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %idxprom7
%15 = load i32, ptr %arrayidx8, align 4, !tbaa !5
store i32 %15, ptr %arrayidx6, align 4, !tbaa !5
store i32 %13, ptr %arrayidx8, align 4, !tbaa !5
%inc14 = add nuw nsw i32 %i.136, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc14, %16
br i1 %cmp2, label %for.body3, label %for.cond16.preheader.loopexit, !llvm.loop !14
for.body18: ; preds = %for.cond16.preheader, %for.body18
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body18 ], [ 1, %for.cond16.preheader ]
%arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv40
%17 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%18 = load i32, ptr %w, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp17.not.not = icmp slt i64 %indvars.iv40, %19
br i1 %cmp17.not.not, label %for.body18, label %for.end24, !llvm.loop !15
for.end24: ; preds = %for.body18, %for.cond16.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
// AOJ 2180: Water Tank
// 2017.11.03 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define EPS 1e-7
#define MIN(a,b) ((a)<=(b)?(a):(b))
int n, l, s[86402], t[86402], u[86402];
int check(double *v, double a)
{
int i, x;
double e;
for (e = *v, x = 0, i = 0; i < n; i++) {
e = MIN(l, e + a*(s[i]-x));
x = s[i];
e = MIN(l, e + (t[i]-x)*(a-u[i]));
if (e < 0) { *v = e; return 1; }
x = t[i];
}
*v = MIN(l, e + a*(86400-x));
return 0;
}
int calc(double a)
{
int i;
double v[3];
for (v[0] = l, i = 0; i < 2; i++) {
if (check(v+i, a)) return 0;
v[i+1] = v[i];
}
return fabs(v[0]-v[1]) <= EPS;
}
int main()
{
int i;
double up, low, mid;
while (scanf("%d%d", &n, &l) && n > 0) {
for (i = 0; i < n; i++) scanf("%d%d%d", s+i, t+i, u+i);
low = 0, up = 1e7;
while (fabs(low - up) > EPS) {
mid = (low + up)/2;
if (calc(mid)) up = mid; else low = mid;
}
printf("%.8lf\n", up);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189689/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189689/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n = dso_local global i32 0, align 4
@l = dso_local global i32 0, align 4
@s = dso_local global [86402 x i32] zeroinitializer, align 16
@t = dso_local global [86402 x i32] zeroinitializer, align 16
@u = dso_local global [86402 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%.8lf\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @check(ptr nocapture noundef %v, double noundef %a) local_unnamed_addr #0 {
entry:
%0 = load double, ptr %v, align 8, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !9
%cmp85 = icmp sgt i32 %1, 0
%.pre = load i32, ptr @l, align 4, !tbaa !9
%conv = sitofp i32 %.pre to double
br i1 %cmp85, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%wide.trip.count = zext i32 %1 to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.lr.ph, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.cond ]
%e.088 = phi double [ %0, %for.body.lr.ph ], [ %cond34, %for.cond ]
%x.087 = phi i32 [ 0, %for.body.lr.ph ], [ %4, %for.cond ]
%arrayidx = getelementptr inbounds [86402 x i32], ptr @s, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !9
%sub = sub nsw i32 %2, %x.087
%conv1 = sitofp i32 %sub to double
%3 = tail call double @llvm.fmuladd.f64(double %a, double %conv1, double %e.088)
%cmp2.inv = fcmp oge double %3, %conv
%.conv = select i1 %cmp2.inv, double %conv, double %3
%arrayidx13 = getelementptr inbounds [86402 x i32], ptr @t, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx13, align 4, !tbaa !9
%sub14 = sub nsw i32 %4, %2
%conv15 = sitofp i32 %sub14 to double
%arrayidx17 = getelementptr inbounds [86402 x i32], ptr @u, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx17, align 4, !tbaa !9
%conv18 = sitofp i32 %5 to double
%sub19 = fsub double %a, %conv18
%6 = tail call double @llvm.fmuladd.f64(double %conv15, double %sub19, double %.conv)
%cmp20.inv = fcmp oge double %6, %conv
%cond34 = select i1 %cmp20.inv, double %conv, double %6
%cmp35 = fcmp olt double %cond34, 0.000000e+00
br i1 %cmp35, label %cleanup, label %for.cond
for.end.loopexit: ; preds = %for.cond
%7 = sub nsw i32 86400, %4
%8 = sitofp i32 %7 to double
br label %for.end
for.end: ; preds = %entry, %for.end.loopexit
%x.0.lcssa = phi double [ %8, %for.end.loopexit ], [ 8.640000e+04, %entry ]
%e.0.lcssa = phi double [ %cond34, %for.end.loopexit ], [ %0, %entry ]
%9 = tail call double @llvm.fmuladd.f64(double %a, double %x.0.lcssa, double %e.0.lcssa)
%cmp42.inv = fcmp oge double %9, %conv
%.conv39 = select i1 %cmp42.inv, double %conv, double %9
br label %cleanup
cleanup: ; preds = %for.body, %for.end
%storemerge = phi double [ %.conv39, %for.end ], [ %cond34, %for.body ]
%retval.0 = phi i32 [ 0, %for.end ], [ 1, %for.body ]
store double %storemerge, ptr %v, align 8, !tbaa !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) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @calc(double noundef %a) local_unnamed_addr #3 {
entry:
%v.sroa.0 = alloca double, align 16
%v.sroa.11 = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %v.sroa.0)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %v.sroa.11)
%0 = load i32, ptr @l, align 4, !tbaa !9
%conv = sitofp i32 %0 to double
%1 = load i32, ptr @n, align 4, !tbaa !9
%cmp85.i = icmp sgt i32 %1, 0
%wide.trip.count.i = zext i32 %1 to i64
br i1 %cmp85.i, label %for.body.i.us, label %for.body.preheader
for.body.preheader: ; preds = %entry
%2 = tail call double @llvm.fmuladd.f64(double %a, double 8.640000e+04, double %conv)
%cmp42.inv.i = fcmp oge double %2, %conv
%.conv39.i = select i1 %cmp42.inv.i, double %conv, double %2
%3 = tail call double @llvm.fmuladd.f64(double %a, double 8.640000e+04, double %.conv39.i)
br label %for.end
for.body.i.us: ; preds = %entry, %for.cond.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %for.cond.i.us ], [ 0, %entry ]
%e.088.i.us = phi double [ %cond34.i.us, %for.cond.i.us ], [ %conv, %entry ]
%x.087.i.us = phi i32 [ %6, %for.cond.i.us ], [ 0, %entry ]
%arrayidx.i.us = getelementptr inbounds [86402 x i32], ptr @s, i64 0, i64 %indvars.iv.i.us
%4 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !9
%sub.i.us = sub nsw i32 %4, %x.087.i.us
%conv1.i.us = sitofp i32 %sub.i.us to double
%5 = tail call double @llvm.fmuladd.f64(double %a, double %conv1.i.us, double %e.088.i.us)
%cmp2.inv.i.us = fcmp oge double %5, %conv
%.conv.i.us = select i1 %cmp2.inv.i.us, double %conv, double %5
%arrayidx13.i.us = getelementptr inbounds [86402 x i32], ptr @t, i64 0, i64 %indvars.iv.i.us
%6 = load i32, ptr %arrayidx13.i.us, align 4, !tbaa !9
%sub14.i.us = sub nsw i32 %6, %4
%conv15.i.us = sitofp i32 %sub14.i.us to double
%arrayidx17.i.us = getelementptr inbounds [86402 x i32], ptr @u, i64 0, i64 %indvars.iv.i.us
%7 = load i32, ptr %arrayidx17.i.us, align 4, !tbaa !9
%conv18.i.us = sitofp i32 %7 to double
%sub19.i.us = fsub double %a, %conv18.i.us
%8 = tail call double @llvm.fmuladd.f64(double %conv15.i.us, double %sub19.i.us, double %.conv.i.us)
%cmp20.inv.i.us = fcmp oge double %8, %conv
%cond34.i.us = select i1 %cmp20.inv.i.us, double %conv, double %8
%cmp35.i.us = fcmp olt double %cond34.i.us, 0.000000e+00
br i1 %cmp35.i.us, label %check.exit, label %for.cond.i.us
for.cond.i.us: ; preds = %for.body.i.us
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %for.end.loopexit.i.us, label %for.body.i.us, !llvm.loop !11
for.end.loopexit.i.us: ; preds = %for.cond.i.us
%9 = sub nsw i32 86400, %6
%10 = sitofp i32 %9 to double
%11 = tail call double @llvm.fmuladd.f64(double %a, double %10, double %cond34.i.us)
%cmp42.inv.i.us = fcmp oge double %11, %conv
%.conv39.i.us = select i1 %cmp42.inv.i.us, double %conv, double %11
br label %for.body.i.us.1
for.body.i.us.1: ; preds = %for.cond.i.us.1, %for.end.loopexit.i.us
%indvars.iv.i.us.1 = phi i64 [ 0, %for.end.loopexit.i.us ], [ %indvars.iv.next.i.us.1, %for.cond.i.us.1 ]
%e.088.i.us.1 = phi double [ %.conv39.i.us, %for.end.loopexit.i.us ], [ %cond34.i.us.1, %for.cond.i.us.1 ]
%x.087.i.us.1 = phi i32 [ 0, %for.end.loopexit.i.us ], [ %14, %for.cond.i.us.1 ]
%arrayidx.i.us.1 = getelementptr inbounds [86402 x i32], ptr @s, i64 0, i64 %indvars.iv.i.us.1
%12 = load i32, ptr %arrayidx.i.us.1, align 4, !tbaa !9
%sub.i.us.1 = sub nsw i32 %12, %x.087.i.us.1
%conv1.i.us.1 = sitofp i32 %sub.i.us.1 to double
%13 = tail call double @llvm.fmuladd.f64(double %a, double %conv1.i.us.1, double %e.088.i.us.1)
%cmp2.inv.i.us.1 = fcmp oge double %13, %conv
%.conv.i.us.1 = select i1 %cmp2.inv.i.us.1, double %conv, double %13
%arrayidx13.i.us.1 = getelementptr inbounds [86402 x i32], ptr @t, i64 0, i64 %indvars.iv.i.us.1
%14 = load i32, ptr %arrayidx13.i.us.1, align 4, !tbaa !9
%sub14.i.us.1 = sub nsw i32 %14, %12
%conv15.i.us.1 = sitofp i32 %sub14.i.us.1 to double
%arrayidx17.i.us.1 = getelementptr inbounds [86402 x i32], ptr @u, i64 0, i64 %indvars.iv.i.us.1
%15 = load i32, ptr %arrayidx17.i.us.1, align 4, !tbaa !9
%conv18.i.us.1 = sitofp i32 %15 to double
%sub19.i.us.1 = fsub double %a, %conv18.i.us.1
%16 = tail call double @llvm.fmuladd.f64(double %conv15.i.us.1, double %sub19.i.us.1, double %.conv.i.us.1)
%cmp20.inv.i.us.1 = fcmp oge double %16, %conv
%cond34.i.us.1 = select i1 %cmp20.inv.i.us.1, double %conv, double %16
%cmp35.i.us.1 = fcmp olt double %cond34.i.us.1, 0.000000e+00
br i1 %cmp35.i.us.1, label %check.exit, label %for.cond.i.us.1
for.cond.i.us.1: ; preds = %for.body.i.us.1
%indvars.iv.next.i.us.1 = add nuw nsw i64 %indvars.iv.i.us.1, 1
%exitcond.not.i.us.1 = icmp eq i64 %indvars.iv.next.i.us.1, %wide.trip.count.i
br i1 %exitcond.not.i.us.1, label %for.end.loopexit.i.us.1, label %for.body.i.us.1, !llvm.loop !11
for.end.loopexit.i.us.1: ; preds = %for.cond.i.us.1
%17 = sub nsw i32 86400, %14
%18 = sitofp i32 %17 to double
%19 = tail call double @llvm.fmuladd.f64(double %a, double %18, double %cond34.i.us.1)
br label %for.end
check.exit: ; preds = %for.body.i.us, %for.body.i.us.1
%add.ptr.us.lcssa = phi ptr [ %v.sroa.11, %for.body.i.us.1 ], [ %v.sroa.0, %for.body.i.us ]
%cond34.i.us.lcssa = phi double [ %cond34.i.us.1, %for.body.i.us.1 ], [ %cond34.i.us, %for.body.i.us ]
store double %cond34.i.us.lcssa, ptr %add.ptr.us.lcssa, align 8, !tbaa !5
br label %cleanup
for.end: ; preds = %for.body.preheader, %for.end.loopexit.i.us.1
%.sink46 = phi double [ %3, %for.body.preheader ], [ %19, %for.end.loopexit.i.us.1 ]
%v.sroa.0.0.v.sroa.0.0. = phi double [ %.conv39.i, %for.body.preheader ], [ %.conv39.i.us, %for.end.loopexit.i.us.1 ]
%cmp42.inv.i.1 = fcmp oge double %.sink46, %conv
%.conv39.i.1 = select i1 %cmp42.inv.i.1, double %conv, double %.sink46
%sub = fsub double %v.sroa.0.0.v.sroa.0.0., %.conv39.i.1
%20 = tail call double @llvm.fabs.f64(double %sub)
%cmp7 = fcmp ole double %20, 0x3E7AD7F29ABCAF48
%conv8 = zext i1 %cmp7 to i32
br label %cleanup
cleanup: ; preds = %check.exit, %for.end
%retval.0 = phi i32 [ %conv8, %for.end ], [ 0, %check.exit ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %v.sroa.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %v.sroa.11)
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%v.sroa.0.i = alloca double, align 16
%v.sroa.11.i = alloca double, align 8
%call33 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @l)
%tobool34 = icmp ne i32 %call33, 0
%0 = load i32, ptr @n, align 4
%cmp35 = icmp sgt i32 %0, 0
%1 = select i1 %tobool34, i1 %cmp35, i1 false
br i1 %1, label %for.body, label %while.end13
while.cond7.preheader: ; preds = %for.body
%2 = load i32, ptr @l, align 4, !tbaa !9
%conv.i = sitofp i32 %2 to double
%cmp85.i.i = icmp sgt i32 %.pr, 0
%wide.trip.count.i.i = zext i32 %.pr to i64
br label %while.body9
for.body: ; preds = %entry, %for.body.backedge
%indvars.iv = phi i64 [ %indvars.iv.be, %for.body.backedge ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr @s, i64 %indvars.iv
%add.ptr3 = getelementptr inbounds i32, ptr @t, i64 %indvars.iv
%add.ptr5 = getelementptr inbounds i32, ptr @u, i64 %indvars.iv
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr3, ptr noundef nonnull %add.ptr5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr @n, align 4, !tbaa !9
%3 = sext i32 %.pr to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp1, label %for.body.backedge, label %while.cond7.preheader
for.body.backedge: ; preds = %for.body, %while.end
%indvars.iv.be = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.end ]
br label %for.body, !llvm.loop !13
while.body9: ; preds = %while.cond7.preheader, %calc.exit
%low.032 = phi double [ 0.000000e+00, %while.cond7.preheader ], [ %div.low.0, %calc.exit ]
%up.031 = phi double [ 1.000000e+07, %while.cond7.preheader ], [ %up.0.div, %calc.exit ]
%add = fadd double %up.031, %low.032
%div = fmul double %add, 5.000000e-01
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %v.sroa.0.i)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %v.sroa.11.i)
br i1 %cmp85.i.i, label %for.body.i.us.i, label %for.body.preheader.i
for.body.preheader.i: ; preds = %while.body9
%4 = tail call double @llvm.fmuladd.f64(double %div, double 8.640000e+04, double %conv.i)
%cmp42.inv.i.i = fcmp oge double %4, %conv.i
%.conv39.i.i = select i1 %cmp42.inv.i.i, double %conv.i, double %4
%5 = tail call double @llvm.fmuladd.f64(double %div, double 8.640000e+04, double %.conv39.i.i)
br label %for.end.i
for.body.i.us.i: ; preds = %while.body9, %for.cond.i.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %for.cond.i.us.i ], [ 0, %while.body9 ]
%e.088.i.us.i = phi double [ %cond34.i.us.i, %for.cond.i.us.i ], [ %conv.i, %while.body9 ]
%x.087.i.us.i = phi i32 [ %8, %for.cond.i.us.i ], [ 0, %while.body9 ]
%arrayidx.i.us.i = getelementptr inbounds [86402 x i32], ptr @s, i64 0, i64 %indvars.iv.i.us.i
%6 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !9
%sub.i.us.i = sub nsw i32 %6, %x.087.i.us.i
%conv1.i.us.i = sitofp i32 %sub.i.us.i to double
%7 = tail call double @llvm.fmuladd.f64(double %div, double %conv1.i.us.i, double %e.088.i.us.i)
%cmp2.inv.i.us.i = fcmp oge double %7, %conv.i
%.conv.i.us.i = select i1 %cmp2.inv.i.us.i, double %conv.i, double %7
%arrayidx13.i.us.i = getelementptr inbounds [86402 x i32], ptr @t, i64 0, i64 %indvars.iv.i.us.i
%8 = load i32, ptr %arrayidx13.i.us.i, align 4, !tbaa !9
%sub14.i.us.i = sub nsw i32 %8, %6
%conv15.i.us.i = sitofp i32 %sub14.i.us.i to double
%arrayidx17.i.us.i = getelementptr inbounds [86402 x i32], ptr @u, i64 0, i64 %indvars.iv.i.us.i
%9 = load i32, ptr %arrayidx17.i.us.i, align 4, !tbaa !9
%conv18.i.us.i = sitofp i32 %9 to double
%sub19.i.us.i = fsub double %div, %conv18.i.us.i
%10 = tail call double @llvm.fmuladd.f64(double %conv15.i.us.i, double %sub19.i.us.i, double %.conv.i.us.i)
%cmp20.inv.i.us.i = fcmp oge double %10, %conv.i
%cond34.i.us.i = select i1 %cmp20.inv.i.us.i, double %conv.i, double %10
%cmp35.i.us.i = fcmp olt double %cond34.i.us.i, 0.000000e+00
br i1 %cmp35.i.us.i, label %check.exit.i, label %for.cond.i.us.i
for.cond.i.us.i: ; preds = %for.body.i.us.i
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %for.end.loopexit.i.us.i, label %for.body.i.us.i, !llvm.loop !11
for.end.loopexit.i.us.i: ; preds = %for.cond.i.us.i
%11 = sub nsw i32 86400, %8
%12 = sitofp i32 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %div, double %12, double %cond34.i.us.i)
%cmp42.inv.i.us.i = fcmp oge double %13, %conv.i
%.conv39.i.us.i = select i1 %cmp42.inv.i.us.i, double %conv.i, double %13
br label %for.body.i.us.1.i
for.body.i.us.1.i: ; preds = %for.cond.i.us.1.i, %for.end.loopexit.i.us.i
%indvars.iv.i.us.1.i = phi i64 [ 0, %for.end.loopexit.i.us.i ], [ %indvars.iv.next.i.us.1.i, %for.cond.i.us.1.i ]
%e.088.i.us.1.i = phi double [ %.conv39.i.us.i, %for.end.loopexit.i.us.i ], [ %cond34.i.us.1.i, %for.cond.i.us.1.i ]
%x.087.i.us.1.i = phi i32 [ 0, %for.end.loopexit.i.us.i ], [ %16, %for.cond.i.us.1.i ]
%arrayidx.i.us.1.i = getelementptr inbounds [86402 x i32], ptr @s, i64 0, i64 %indvars.iv.i.us.1.i
%14 = load i32, ptr %arrayidx.i.us.1.i, align 4, !tbaa !9
%sub.i.us.1.i = sub nsw i32 %14, %x.087.i.us.1.i
%conv1.i.us.1.i = sitofp i32 %sub.i.us.1.i to double
%15 = tail call double @llvm.fmuladd.f64(double %div, double %conv1.i.us.1.i, double %e.088.i.us.1.i)
%cmp2.inv.i.us.1.i = fcmp oge double %15, %conv.i
%.conv.i.us.1.i = select i1 %cmp2.inv.i.us.1.i, double %conv.i, double %15
%arrayidx13.i.us.1.i = getelementptr inbounds [86402 x i32], ptr @t, i64 0, i64 %indvars.iv.i.us.1.i
%16 = load i32, ptr %arrayidx13.i.us.1.i, align 4, !tbaa !9
%sub14.i.us.1.i = sub nsw i32 %16, %14
%conv15.i.us.1.i = sitofp i32 %sub14.i.us.1.i to double
%arrayidx17.i.us.1.i = getelementptr inbounds [86402 x i32], ptr @u, i64 0, i64 %indvars.iv.i.us.1.i
%17 = load i32, ptr %arrayidx17.i.us.1.i, align 4, !tbaa !9
%conv18.i.us.1.i = sitofp i32 %17 to double
%sub19.i.us.1.i = fsub double %div, %conv18.i.us.1.i
%18 = tail call double @llvm.fmuladd.f64(double %conv15.i.us.1.i, double %sub19.i.us.1.i, double %.conv.i.us.1.i)
%cmp20.inv.i.us.1.i = fcmp oge double %18, %conv.i
%cond34.i.us.1.i = select i1 %cmp20.inv.i.us.1.i, double %conv.i, double %18
%cmp35.i.us.1.i = fcmp olt double %cond34.i.us.1.i, 0.000000e+00
br i1 %cmp35.i.us.1.i, label %check.exit.i, label %for.cond.i.us.1.i
for.cond.i.us.1.i: ; preds = %for.body.i.us.1.i
%indvars.iv.next.i.us.1.i = add nuw nsw i64 %indvars.iv.i.us.1.i, 1
%exitcond.not.i.us.1.i = icmp eq i64 %indvars.iv.next.i.us.1.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.1.i, label %for.end.loopexit.i.us.1.i, label %for.body.i.us.1.i, !llvm.loop !11
for.end.loopexit.i.us.1.i: ; preds = %for.cond.i.us.1.i
%19 = sub nsw i32 86400, %16
%20 = sitofp i32 %19 to double
%21 = tail call double @llvm.fmuladd.f64(double %div, double %20, double %cond34.i.us.1.i)
br label %for.end.i
check.exit.i: ; preds = %for.body.i.us.i, %for.body.i.us.1.i
%add.ptr.us.lcssa.i = phi ptr [ %v.sroa.11.i, %for.body.i.us.1.i ], [ %v.sroa.0.i, %for.body.i.us.i ]
%cond34.i.us.lcssa.i = phi double [ %cond34.i.us.1.i, %for.body.i.us.1.i ], [ %cond34.i.us.i, %for.body.i.us.i ]
store double %cond34.i.us.lcssa.i, ptr %add.ptr.us.lcssa.i, align 8, !tbaa !5
br label %calc.exit
for.end.i: ; preds = %for.end.loopexit.i.us.1.i, %for.body.preheader.i
%.sink46.i = phi double [ %5, %for.body.preheader.i ], [ %21, %for.end.loopexit.i.us.1.i ]
%v.sroa.0.0.v.sroa.0.0..i = phi double [ %.conv39.i.i, %for.body.preheader.i ], [ %.conv39.i.us.i, %for.end.loopexit.i.us.1.i ]
%cmp42.inv.i.1.i = fcmp oge double %.sink46.i, %conv.i
%.conv39.i.1.i = select i1 %cmp42.inv.i.1.i, double %conv.i, double %.sink46.i
%sub.i = fsub double %v.sroa.0.0.v.sroa.0.0..i, %.conv39.i.1.i
%22 = tail call double @llvm.fabs.f64(double %sub.i)
%cmp7.i = fcmp ole double %22, 0x3E7AD7F29ABCAF48
%conv8.i = zext i1 %cmp7.i to i32
br label %calc.exit
calc.exit: ; preds = %check.exit.i, %for.end.i
%retval.0.i = phi i32 [ %conv8.i, %for.end.i ], [ 0, %check.exit.i ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %v.sroa.0.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %v.sroa.11.i)
%tobool11.not = icmp eq i32 %retval.0.i, 0
%up.0.div = select i1 %tobool11.not, double %up.031, double %div
%div.low.0 = select i1 %tobool11.not, double %div, double %low.032
%sub = fsub double %div.low.0, %up.0.div
%23 = tail call double @llvm.fabs.f64(double %sub)
%cmp8 = fcmp ogt double %23, 0x3E7AD7F29ABCAF48
br i1 %cmp8, label %while.body9, label %while.end, !llvm.loop !14
while.end: ; preds = %calc.exit
%call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %up.0.div)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @l)
%tobool = icmp ne i32 %call, 0
%24 = load i32, ptr @n, align 4
%cmp = icmp sgt i32 %24, 0
%25 = select i1 %tobool, i1 %cmp, i1 false
br i1 %25, label %for.body.backedge, label %while.end13
while.end13: ; preds = %while.end, %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
attributes #0 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = !{!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}
|
#include<stdio.h>
int main(void)
{
int w,h,n,sa1,sa2,x[1000],y[1000],cnt,i,a;
scanf("%d %d %d",&w,&h,&n);
for(i=0;i<n;i++){
scanf("%d",&x[i]);
scanf("%d",&y[i]);
}
for(i=0;i<n-1;i++){
sa1=x[i+1]-x[i];
sa2=y[i+1]-y[i];
if(sa1>0&&sa2>0){
if(sa1<sa2){
cnt+=sa1;
x[i]=x[i]+sa1;
y[i]=y[i]+sa1;
}
else{
cnt=cnt+sa2;
x[i]=x[i]+sa2;
y[i]=y[i]+sa2;
}
}
if(sa1<0&&sa2<0){
sa1=-sa1;
sa2=-sa2;
if(sa1<sa2){
cnt=cnt+sa1;
x[i]=x[i]-sa1;
y[i]=y[i]-sa1;
}
else{
cnt=cnt+sa2;
x[i]=x[i]-sa2;
y[i]=y[i]-sa2;
}
}
sa1=x[i+1]-x[i];
sa2=y[i+1]-y[i];
if(sa1<0){
sa1=-sa1;
}
cnt=cnt+sa1;
if(sa2<0){
sa2=-sa2;
}
cnt=cnt+sa2;
}
printf("%d\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189739/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189739/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
%x = alloca [1000 x i32], align 16
%y = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp171 = icmp sgt i32 %0, 0
br i1 %cmp171, label %for.body, label %for.cond5.preheader
for.cond5.preheader.loopexit: ; preds = %for.body
%.pre.pre = load i32, ptr %x, align 16, !tbaa !5
%.pre182.pre = load i32, ptr %y, align 16, !tbaa !5
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.cond5.preheader.loopexit, %entry
%.pre182 = phi i32 [ undef, %entry ], [ %.pre182.pre, %for.cond5.preheader.loopexit ]
%.pre = phi i32 [ undef, %entry ], [ %.pre.pre, %for.cond5.preheader.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.cond5.preheader.loopexit ]
%sub = add nsw i32 %.lcssa, -1
%cmp6173 = icmp sgt i32 %.lcssa, 1
call void @llvm.assume(i1 %cmp6173)
%wide.trip.count = zext i32 %sub to i64
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%arrayidx3 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx3)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond5.preheader.loopexit, !llvm.loop !9
for.body7: ; preds = %for.cond5.preheader, %if.end78
%3 = phi i32 [ %.pre182, %for.cond5.preheader ], [ %6, %if.end78 ]
%4 = phi i32 [ %.pre, %for.cond5.preheader ], [ %5, %if.end78 ]
%indvars.iv179 = phi i64 [ 0, %for.cond5.preheader ], [ %indvars.iv.next180, %if.end78 ]
%cnt.0174 = phi i32 [ undef, %for.cond5.preheader ], [ %add100, %if.end78 ]
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv.next180
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv179
%sub12 = sub nsw i32 %5, %4
%arrayidx15 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv.next180
%6 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv179
%sub18 = sub nsw i32 %6, %3
%cmp19 = icmp sgt i32 %sub12, 0
%cmp20 = icmp sgt i32 %sub18, 0
%or.cond = select i1 %cmp19, i1 %cmp20, i1 false
br i1 %or.cond, label %if.then, label %if.end45
if.then: ; preds = %for.body7
%cmp21 = icmp ult i32 %sub12, %sub18
br i1 %cmp21, label %if.then22, label %if.else
if.then22: ; preds = %if.then
%add23 = add nsw i32 %sub12, %cnt.0174
store i32 %5, ptr %arrayidx11, align 4, !tbaa !5
%add31 = add nsw i32 %3, %sub12
store i32 %add31, ptr %arrayidx17, align 4, !tbaa !5
br label %if.end78
if.else: ; preds = %if.then
%add34 = add nsw i32 %sub18, %cnt.0174
%add37 = add nsw i32 %sub18, %4
store i32 %add37, ptr %arrayidx11, align 4, !tbaa !5
store i32 %6, ptr %arrayidx17, align 4, !tbaa !5
br label %if.end78
if.end45: ; preds = %for.body7
%cmp46 = icmp slt i32 %sub12, 0
%cmp48 = icmp slt i32 %sub18, 0
%or.cond105 = select i1 %cmp46, i1 %cmp48, i1 false
br i1 %or.cond105, label %if.then49, label %if.end45.if.end78_crit_edge
if.end45.if.end78_crit_edge: ; preds = %if.end45
%.pre183 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%.pre184 = load i32, ptr %arrayidx17, align 4, !tbaa !5
br label %if.end78
if.then49: ; preds = %if.end45
%cmp52 = icmp ult i32 %sub18, %sub12
br i1 %cmp52, label %if.then53, label %if.else65
if.then53: ; preds = %if.then49
%add54 = sub i32 %cnt.0174, %sub12
store i32 %5, ptr %arrayidx11, align 4, !tbaa !5
%sub62 = add nsw i32 %3, %sub12
store i32 %sub62, ptr %arrayidx17, align 4, !tbaa !5
br label %if.end78
if.else65: ; preds = %if.then49
%add66 = sub i32 %cnt.0174, %sub18
%sub69 = add nsw i32 %4, %sub18
store i32 %sub69, ptr %arrayidx11, align 4, !tbaa !5
store i32 %6, ptr %arrayidx17, align 4, !tbaa !5
br label %if.end78
if.end78: ; preds = %if.end45.if.end78_crit_edge, %if.else, %if.then22, %if.then53, %if.else65
%7 = phi i32 [ %sub62, %if.then53 ], [ %6, %if.else65 ], [ %.pre184, %if.end45.if.end78_crit_edge ], [ %6, %if.else ], [ %add31, %if.then22 ]
%8 = phi i32 [ %5, %if.then53 ], [ %sub69, %if.else65 ], [ %.pre183, %if.end45.if.end78_crit_edge ], [ %add37, %if.else ], [ %5, %if.then22 ]
%cnt.2 = phi i32 [ %add54, %if.then53 ], [ %add66, %if.else65 ], [ %cnt.0174, %if.end45.if.end78_crit_edge ], [ %add34, %if.else ], [ %add23, %if.then22 ]
%sub84 = sub nsw i32 %5, %8
%sub90 = sub nsw i32 %6, %7
%spec.select = call i32 @llvm.abs.i32(i32 %sub84, i1 true)
%add95 = add nsw i32 %spec.select, %cnt.2
%sa2.0 = call i32 @llvm.abs.i32(i32 %sub90, i1 true)
%add100 = add nsw i32 %add95, %sa2.0
%exitcond.not = icmp eq i64 %indvars.iv.next180, %wide.trip.count
br i1 %exitcond.not, label %for.end103, label %for.body7, !llvm.loop !11
for.end103: ; preds = %if.end78
%call104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add100)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <limits.h>
int main(void)
{
int n;
scanf("%d",&n);
int min = INT_MAX;
int max = INT_MIN;
int a;
for(int i = 0;i < n;i++)
{
scanf("%d",&a);
if(min > a)
{
min = a;
}
if(max < a)
{
max = a;
}
}
printf("%d\n",(max - min + 1 - n));
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_18979/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_18979/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca 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)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 0
br i1 %cmp14, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = add i32 %max.1, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%min.0.lcssa = phi i32 [ 2147483647, %entry ], [ %spec.select, %for.cond.cleanup.loopexit ]
%max.0.lcssa = phi i32 [ -2147483647, %entry ], [ %1, %for.cond.cleanup.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %4, %for.cond.cleanup.loopexit ]
%2 = add i32 %min.0.lcssa, %.lcssa
%sub6 = sub i32 %max.0.lcssa, %2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.017 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%max.016 = phi i32 [ %max.1, %for.body ], [ -2147483648, %entry ]
%min.015 = phi i32 [ %spec.select, %for.body ], [ 2147483647, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%3 = load i32, ptr %a, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.015, i32 %3)
%max.1 = call i32 @llvm.smax.i32(i32 %max.016, i32 %3)
%inc = add nuw nsw i32 %i.017, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup.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: 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.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
long long power(long long m, long long n)//long long じゃないと数が大きくなった時にあふれる
{
if(n==1)
return m;
else if(n%2==0)
return power(m*m%1000000007, n/2);
else
return power(m*m%1000000007, n/2)*m%1000000007;
}
int main(void)
{
long long m, n;
scanf("%lld %lld\n",&m,&n);
printf("%lld\n",power(m,n));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189832/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189832/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @power(i64 noundef %m, i64 noundef %n) local_unnamed_addr #0 {
entry:
%cmp21 = icmp eq i64 %n, 1
br i1 %cmp21, label %common.ret36, label %if.else
if.else: ; preds = %entry, %if.then2
%n.tr23 = phi i64 [ %div, %if.then2 ], [ %n, %entry ]
%m.tr22 = phi i64 [ %rem3, %if.then2 ], [ %m, %entry ]
%0 = and i64 %n.tr23, 1
%cmp1 = icmp eq i64 %0, 0
%mul = mul nsw i64 %m.tr22, %m.tr22
%rem3 = urem i64 %mul, 1000000007
%div = sdiv i64 %n.tr23, 2
br i1 %cmp1, label %if.then2, label %if.else4
if.then2: ; preds = %if.else
%1 = and i64 %n.tr23, -2
%cmp = icmp eq i64 %1, 2
br i1 %cmp, label %common.ret36, label %if.else
common.ret36: ; preds = %entry, %if.then2, %if.else4
%common.ret36.op = phi i64 [ %rem10, %if.else4 ], [ %m, %entry ], [ %rem3, %if.then2 ]
ret i64 %common.ret36.op
if.else4: ; preds = %if.else
%call8 = tail call i64 @power(i64 noundef %rem3, i64 noundef %div)
%mul9 = mul nsw i64 %call8, %m.tr22
%rem10 = srem i64 %mul9, 1000000007
br label %common.ret36
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%m = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4
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 %m, ptr noundef nonnull %n)
%0 = load i64, ptr %m, align 8, !tbaa !5
%1 = load i64, ptr %n, align 8, !tbaa !5
%call1 = call i64 @power(i64 noundef %0, i64 noundef %1)
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
char arierukamo[256];
} num_t;
num_t create_num(int l,int u) {
num_t ret;
int i;
for(i=0;i<256;i++)ret.arierukamo[i]=(l<=i && i<=u)?1:0;
return ret;
}
typedef int (*p_op)(int,int);
int add(int a,int b){return a+b;}
int sub(int a,int b){return a-b+256;}
int mul(int a,int b){return a*b;}
int waru(int a,int b){return a/b;}
num_t calc_num(const num_t *a,const num_t *b,p_op op) {
num_t ret;
int i,j;
for(i=0;i<256;i++)ret.arierukamo[i]=0;
for(i=0;i<256;i++) {
for(j=0;j<256;j++) {
if(a->arierukamo[i] && b->arierukamo[j]) {
ret.arierukamo[op(i,j)%256]=1;
}
}
}
return ret;
}
int main(void) {
int m,n,i;
char names[100][32];
num_t vars[100];
num_t stack[100];
int stack_pos=0;
int error_flag=0;
if(scanf("%d",&m)!=1)return 1;
for(i=0;i<m;i++) {
int l,u;
if(scanf("%s%d%d",names[i],&l,&u)!=3)return 1;
vars[i]=create_num(l,u);
}
if(scanf("%d",&n)!=1)return 1;
for(i=0;i<n;i++) {
char data[1024];
char* end;
int num;
if(scanf("%s",data)!=1)return 1;
if(error_flag)continue;
num=(int)strtol(data,&end,10);
if(*end=='\0') {
stack[stack_pos++]=create_num(num,num);
} else if(strcmp(data,"+")==0) {
if(stack_pos<2)error_flag=1;
else {
stack_pos--;
stack[stack_pos-1]=calc_num(&stack[stack_pos-1],&stack[stack_pos],add);
}
} else if(strcmp(data,"-")==0) {
if(stack_pos<2)error_flag=1;
else {
stack_pos--;
stack[stack_pos-1]=calc_num(&stack[stack_pos-1],&stack[stack_pos],sub);
}
} else if(strcmp(data,"*")==0) {
if(stack_pos<2)error_flag=1;
else {
stack_pos--;
stack[stack_pos-1]=calc_num(&stack[stack_pos-1],&stack[stack_pos],mul);
}
} else if(strcmp(data,"/")==0) {
if(stack_pos<2 || stack[stack_pos-1].arierukamo[0]!=0)error_flag=1;
else {
stack_pos--;
stack[stack_pos-1]=calc_num(&stack[stack_pos-1],&stack[stack_pos],waru);
}
} else {
int j;
int index=-1;
for(j=0;j<m;j++) {
if(strcmp(data,names[j])==0) {
index=j;
break;
}
}
if(index<0)error_flag=1; else stack[stack_pos++]=vars[j];
}
}
if(stack_pos!=1)error_flag=1;
puts(error_flag?"error":"correct");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189890/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189890/source.c"
target datalayout = "e-m:e-p270: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.num_t = type { [256 x i8] }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%s%d%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"error\00", align 1
@.str.8 = private unnamed_addr constant [8 x i8] c"correct\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local void @create_num(ptr noalias nocapture writeonly sret(%struct.num_t) align 1 %agg.result, i32 noundef %l, i32 noundef %u) local_unnamed_addr #0 {
entry:
%0 = sext i32 %u to i64
%1 = sext i32 %l to i64
%broadcast.splatinsert = insertelement <16 x i64> poison, i64 %1, i64 0
%broadcast.splat = shufflevector <16 x i64> %broadcast.splatinsert, <16 x i64> poison, <16 x i32> zeroinitializer
%broadcast.splatinsert9 = insertelement <16 x i64> poison, i64 %0, i64 0
%broadcast.splat10 = shufflevector <16 x i64> %broadcast.splatinsert9, <16 x i64> poison, <16 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]
%vec.ind = phi <16 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15>, %entry ], [ %vec.ind.next, %vector.body ]
%2 = icmp sge <16 x i64> %vec.ind, %broadcast.splat
%3 = icmp sle <16 x i64> %vec.ind, %broadcast.splat10
%4 = and <16 x i1> %2, %3
%5 = zext <16 x i1> %4 to <16 x i8>
%6 = getelementptr inbounds [256 x i8], ptr %agg.result, i64 0, i64 %index
store <16 x i8> %5, ptr %6, align 1, !tbaa !5
%index.next = add nuw i64 %index, 16
%vec.ind.next = add <16 x i64> %vec.ind, <i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16>
%7 = icmp eq i64 %index.next, 256
br i1 %7, label %for.end, label %vector.body, !llvm.loop !8
for.end: ; preds = %vector.body
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @add(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
ret i32 %add
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sub(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%sub = add i32 %a, 256
%add = sub i32 %sub, %b
ret i32 %add
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @mul(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%mul = mul nsw i32 %b, %a
ret i32 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @waru(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%div = sdiv i32 %a, %b
ret i32 %div
}
; Function Attrs: nounwind uwtable
define dso_local void @calc_num(ptr noalias nocapture writeonly sret(%struct.num_t) align 1 %agg.result, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, ptr nocapture noundef readonly %op) local_unnamed_addr #3 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(256) %agg.result, i8 0, i64 256, i1 false), !tbaa !5
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %entry, %for.inc21
%indvars.iv39 = phi i64 [ 0, %entry ], [ %indvars.iv.next40, %for.inc21 ]
%arrayidx9 = getelementptr inbounds [256 x i8], ptr %a, i64 0, i64 %indvars.iv39
%0 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%1 = icmp eq i8 %0, 0
br i1 %1, label %for.inc21, label %for.body6.preheader
for.body6.preheader: ; preds = %for.cond4.preheader
%2 = trunc i64 %indvars.iv39 to i32
br label %for.body6
for.body6thread-pre-split: ; preds = %for.inc18
%.pr = load i8, ptr %arrayidx9, align 1, !tbaa !5
br label %for.body6
for.body6: ; preds = %for.body6thread-pre-split, %for.body6.preheader
%3 = phi i8 [ %.pr, %for.body6thread-pre-split ], [ 1, %for.body6.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body6thread-pre-split ], [ 0, %for.body6.preheader ]
%tobool.not = icmp eq i8 %3, 0
br i1 %tobool.not, label %for.inc18, label %land.lhs.true
land.lhs.true: ; preds = %for.body6
%arrayidx12 = getelementptr inbounds [256 x i8], ptr %b, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx12, align 1, !tbaa !5
%tobool14.not = icmp eq i8 %4, 0
br i1 %tobool14.not, label %for.inc18, label %if.then
if.then: ; preds = %land.lhs.true
%5 = trunc i64 %indvars.iv to i32
%call = tail call i32 %op(i32 noundef %2, i32 noundef %5) #11
%rem = srem i32 %call, 256
%idxprom16 = sext i32 %rem to i64
%arrayidx17 = getelementptr inbounds [256 x i8], ptr %agg.result, i64 0, i64 %idxprom16
store i8 1, ptr %arrayidx17, align 1, !tbaa !5
br label %for.inc18
for.inc18: ; preds = %for.body6, %land.lhs.true, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 256
br i1 %exitcond.not, label %for.inc21, label %for.body6thread-pre-split, !llvm.loop !12
for.inc21: ; preds = %for.inc18, %for.cond4.preheader
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%exitcond42.not = icmp eq i64 %indvars.iv.next40, 256
br i1 %exitcond42.not, label %for.end23, label %for.cond4.preheader, !llvm.loop !14
for.end23: ; preds = %for.inc21
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%m = alloca i32, align 4
%n = alloca i32, align 4
%names = alloca [100 x [32 x i8]], align 16
%vars = alloca [100 x %struct.num_t], align 16
%stack = alloca [100 x %struct.num_t], align 16
%l = alloca i32, align 4
%u = alloca i32, align 4
%tmp = alloca %struct.num_t, align 1
%data = alloca [1024 x i8], align 16
%end = alloca ptr, align 8
%tmp32 = alloca %struct.num_t, align 1
%tmp44 = alloca %struct.num_t, align 1
%tmp65 = alloca %struct.num_t, align 1
%tmp86 = alloca %struct.num_t, align 1
%tmp114 = alloca %struct.num_t, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #11
call void @llvm.lifetime.start.p0(i64 3200, ptr nonnull %names) #11
call void @llvm.lifetime.start.p0(i64 25600, ptr nonnull %vars) #11
call void @llvm.lifetime.start.p0(i64 25600, ptr nonnull %stack) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %for.cond.preheader.split, label %cleanup167
for.cond.preheader.split: ; preds = %entry
%0 = load i32, ptr %m, align 4, !tbaa !15
%cmp1317 = icmp sgt i32 %0, 0
br i1 %cmp1317, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader.split, %cleanup
%indvars.iv = phi i64 [ %indvars.iv.next, %cleanup ], [ 0, %for.cond.preheader.split ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #11
%arrayidx = getelementptr inbounds [100 x [32 x i8]], ptr %names, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %l, ptr noundef nonnull %u)
%cmp3.not = icmp eq i32 %call2, 3
br i1 %cmp3.not, label %if.end5, label %cleanup.thread
cleanup.thread: ; preds = %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #11
br label %cleanup167
if.end5: ; preds = %for.body
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %tmp) #11
%1 = load i32, ptr %u, align 4, !tbaa !15
%2 = sext i32 %1 to i64
%3 = load i32, ptr %l, align 4, !tbaa !15
%4 = sext i32 %3 to i64
%broadcast.splatinsert = insertelement <16 x i64> poison, i64 %4, i64 0
%broadcast.splat = shufflevector <16 x i64> %broadcast.splatinsert, <16 x i64> poison, <16 x i32> zeroinitializer
%broadcast.splatinsert333 = insertelement <16 x i64> poison, i64 %2, i64 0
%broadcast.splat334 = shufflevector <16 x i64> %broadcast.splatinsert333, <16 x i64> poison, <16 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %if.end5
%index = phi i64 [ 0, %if.end5 ], [ %index.next, %vector.body ]
%vec.ind = phi <16 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15>, %if.end5 ], [ %vec.ind.next, %vector.body ]
%5 = icmp sge <16 x i64> %vec.ind, %broadcast.splat
%6 = icmp sle <16 x i64> %vec.ind, %broadcast.splat334
%7 = and <16 x i1> %5, %6
%8 = zext <16 x i1> %7 to <16 x i8>
%9 = getelementptr inbounds [256 x i8], ptr %tmp, i64 0, i64 %index
store <16 x i8> %8, ptr %9, align 1, !tbaa !5, !alias.scope !17
%index.next = add nuw i64 %index, 16
%vec.ind.next = add <16 x i64> %vec.ind, <i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16>
%10 = icmp eq i64 %index.next, 256
br i1 %10, label %cleanup, label %vector.body, !llvm.loop !20
cleanup: ; preds = %vector.body
%arrayidx7 = getelementptr inbounds [100 x %struct.num_t], ptr %vars, i64 0, i64 %indvars.iv
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %arrayidx7, ptr noundef nonnull align 1 dereferenceable(256) %tmp, i64 256, i1 false), !tbaa.struct !21
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %tmp) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %m, align 4, !tbaa !15
%12 = sext i32 %11 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %cleanup, %for.cond.preheader.split
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp10.not = icmp eq i32 %call9, 1
br i1 %cmp10.not, label %for.cond13.preheader, label %cleanup167
for.cond13.preheader: ; preds = %for.end
%13 = load i32, ptr %n, align 4, !tbaa !15
%cmp14321 = icmp sgt i32 %13, 0
br i1 %cmp14321, label %for.body15, label %for.end160
for.body15: ; preds = %for.cond13.preheader, %for.inc158
%error_flag.0324 = phi i32 [ %error_flag.3.ph, %for.inc158 ], [ 0, %for.cond13.preheader ]
%stack_pos.0323 = phi i32 [ %stack_pos.3.ph, %for.inc158 ], [ 0, %for.cond13.preheader ]
%i.1322 = phi i32 [ %inc159, %for.inc158 ], [ 0, %for.cond13.preheader ]
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %data) #11
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %end) #11
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %data)
%cmp18.not = icmp eq i32 %call17, 1
br i1 %cmp18.not, label %if.end20, label %cleanup153
if.end20: ; preds = %for.body15
%tobool.not = icmp eq i32 %error_flag.0324, 0
br i1 %tobool.not, label %if.end22, label %for.inc158
if.end22: ; preds = %if.end20
%call24 = call i64 @strtol(ptr noundef nonnull %data, ptr noundef nonnull %end, i32 noundef 10) #11
%14 = load ptr, ptr %end, align 8, !tbaa !23
%15 = load i8, ptr %14, align 1, !tbaa !5
%cmp26 = icmp eq i8 %15, 0
br i1 %cmp26, label %if.then28, label %if.else
if.then28: ; preds = %if.end22
%idxprom30 = sext i32 %stack_pos.0323 to i64
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %tmp32) #11
%sext = shl i64 %call24, 32
%16 = ashr exact i64 %sext, 32
%broadcast.splatinsert343 = insertelement <16 x i64> poison, i64 %16, i64 0
%broadcast.splat344 = shufflevector <16 x i64> %broadcast.splatinsert343, <16 x i64> poison, <16 x i32> zeroinitializer
br label %vector.body339
vector.body339: ; preds = %vector.body339, %if.then28
%index340 = phi i64 [ 0, %if.then28 ], [ %index.next345, %vector.body339 ]
%vec.ind341 = phi <16 x i64> [ <i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15>, %if.then28 ], [ %vec.ind.next342, %vector.body339 ]
%17 = icmp eq <16 x i64> %vec.ind341, %broadcast.splat344
%18 = zext <16 x i1> %17 to <16 x i8>
%19 = getelementptr inbounds [256 x i8], ptr %tmp32, i64 0, i64 %index340
store <16 x i8> %18, ptr %19, align 1, !tbaa !5, !alias.scope !25
%index.next345 = add nuw i64 %index340, 16
%vec.ind.next342 = add <16 x i64> %vec.ind341, <i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16, i64 16>
%20 = icmp eq i64 %index.next345, 256
br i1 %20, label %create_num.exit229, label %vector.body339, !llvm.loop !28
create_num.exit229: ; preds = %vector.body339
%inc29 = add nsw i32 %stack_pos.0323, 1
%arrayidx31 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom30
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %arrayidx31, ptr noundef nonnull align 1 dereferenceable(256) %tmp32, i64 256, i1 false), !tbaa.struct !21
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %tmp32) #11
br label %for.inc158
if.else: ; preds = %if.end22
%lhsv = load i16, ptr %data, align 16
switch i16 %lhsv, label %for.cond122.preheader [
i16 43, label %if.then37
i16 45, label %if.then56
i16 42, label %if.then77
i16 47, label %if.then98
]
for.cond122.preheader: ; preds = %if.else
%21 = load i32, ptr %m, align 4, !tbaa !15
%cmp123.not319 = icmp sgt i32 %21, 0
br i1 %cmp123.not319, label %for.body125.preheader, label %for.inc158
for.body125.preheader: ; preds = %for.cond122.preheader
%wide.trip.count = zext i32 %21 to i64
br label %for.body125
if.then37: ; preds = %if.else
%cmp38 = icmp slt i32 %stack_pos.0323, 2
br i1 %cmp38, label %for.inc158, label %if.else41
if.else41: ; preds = %if.then37
%dec = add nsw i32 %stack_pos.0323, -1
%sub = add nsw i32 %stack_pos.0323, -2
%idxprom42 = zext i32 %sub to i64
%arrayidx43 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom42
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %tmp44) #11
%idxprom48 = zext i32 %dec to i64
%arrayidx49 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom48
call void @llvm.experimental.noalias.scope.decl(metadata !29)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(256) %tmp44, i8 0, i64 256, i1 false), !tbaa !5, !alias.scope !29
br label %for.cond4.preheader.i
for.cond4.preheader.i: ; preds = %for.inc21.i, %if.else41
%indvars.iv39.i = phi i64 [ 0, %if.else41 ], [ %indvars.iv.next40.i, %for.inc21.i ]
%arrayidx9.i = getelementptr inbounds [256 x i8], ptr %arrayidx43, i64 0, i64 %indvars.iv39.i
%22 = load i8, ptr %arrayidx9.i, align 1, !tbaa !5, !noalias !29
%23 = icmp eq i8 %22, 0
br i1 %23, label %for.inc21.i, label %for.body6.preheader.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%24 = trunc i64 %indvars.iv39.i to i32
br label %for.body6.i
for.body6.i: ; preds = %for.inc18.i, %for.body6.preheader.i
%indvars.iv.i230 = phi i64 [ 0, %for.body6.preheader.i ], [ %indvars.iv.next.i231, %for.inc18.i ]
%arrayidx12.i = getelementptr inbounds [256 x i8], ptr %arrayidx49, i64 0, i64 %indvars.iv.i230
%25 = load i8, ptr %arrayidx12.i, align 1, !tbaa !5, !noalias !29
%tobool14.not.i = icmp eq i8 %25, 0
br i1 %tobool14.not.i, label %for.inc18.i, label %if.then.i
if.then.i: ; preds = %for.body6.i
%26 = trunc i64 %indvars.iv.i230 to i32
%add.i = add nsw i32 %26, %24
%rem.i = srem i32 %add.i, 256
%idxprom16.i = sext i32 %rem.i to i64
%arrayidx17.i = getelementptr inbounds [256 x i8], ptr %tmp44, i64 0, i64 %idxprom16.i
store i8 1, ptr %arrayidx17.i, align 1, !tbaa !5, !alias.scope !29
br label %for.inc18.i
for.inc18.i: ; preds = %if.then.i, %for.body6.i
%indvars.iv.next.i231 = add nuw nsw i64 %indvars.iv.i230, 1
%exitcond.not.i232 = icmp eq i64 %indvars.iv.next.i231, 256
br i1 %exitcond.not.i232, label %for.inc21.i, label %for.body6.i, !llvm.loop !12
for.inc21.i: ; preds = %for.inc18.i, %for.cond4.preheader.i
%indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1
%exitcond42.not.i = icmp eq i64 %indvars.iv.next40.i, 256
br i1 %exitcond42.not.i, label %calc_num.exit, label %for.cond4.preheader.i, !llvm.loop !14
calc_num.exit: ; preds = %for.inc21.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %arrayidx43, ptr noundef nonnull align 1 dereferenceable(256) %tmp44, i64 256, i1 false), !tbaa.struct !21
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %tmp44) #11
br label %for.inc158
if.then56: ; preds = %if.else
%cmp57 = icmp slt i32 %stack_pos.0323, 2
br i1 %cmp57, label %for.inc158, label %if.else60
if.else60: ; preds = %if.then56
%dec61 = add nsw i32 %stack_pos.0323, -1
%sub62 = add nsw i32 %stack_pos.0323, -2
%idxprom63 = zext i32 %sub62 to i64
%arrayidx64 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom63
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %tmp65) #11
%idxprom69 = zext i32 %dec61 to i64
%arrayidx70 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom69
call void @llvm.experimental.noalias.scope.decl(metadata !32)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(256) %tmp65, i8 0, i64 256, i1 false), !tbaa !5, !alias.scope !32
br label %for.cond4.preheader.i233
for.cond4.preheader.i233: ; preds = %for.inc21.i253, %if.else60
%indvars.iv39.i234 = phi i64 [ 0, %if.else60 ], [ %indvars.iv.next40.i254, %for.inc21.i253 ]
%arrayidx9.i235 = getelementptr inbounds [256 x i8], ptr %arrayidx64, i64 0, i64 %indvars.iv39.i234
%27 = load i8, ptr %arrayidx9.i235, align 1, !tbaa !5, !noalias !32
%28 = icmp eq i8 %27, 0
br i1 %28, label %for.inc21.i253, label %for.body6.preheader.i236
for.body6.preheader.i236: ; preds = %for.cond4.preheader.i233
%29 = trunc i64 %indvars.iv39.i234 to i32
%sub.i = add i32 %29, 256
br label %for.body6.i237
for.body6.i237: ; preds = %for.inc18.i248, %for.body6.preheader.i236
%indvars.iv.i238 = phi i64 [ 0, %for.body6.preheader.i236 ], [ %indvars.iv.next.i249, %for.inc18.i248 ]
%arrayidx12.i241 = getelementptr inbounds [256 x i8], ptr %arrayidx70, i64 0, i64 %indvars.iv.i238
%30 = load i8, ptr %arrayidx12.i241, align 1, !tbaa !5, !noalias !32
%tobool14.not.i242 = icmp eq i8 %30, 0
br i1 %tobool14.not.i242, label %for.inc18.i248, label %if.then.i243
if.then.i243: ; preds = %for.body6.i237
%31 = trunc i64 %indvars.iv.i238 to i32
%add.i305 = sub i32 %sub.i, %31
%rem.i245 = srem i32 %add.i305, 256
%idxprom16.i246 = sext i32 %rem.i245 to i64
%arrayidx17.i247 = getelementptr inbounds [256 x i8], ptr %tmp65, i64 0, i64 %idxprom16.i246
store i8 1, ptr %arrayidx17.i247, align 1, !tbaa !5, !alias.scope !32
br label %for.inc18.i248
for.inc18.i248: ; preds = %if.then.i243, %for.body6.i237
%indvars.iv.next.i249 = add nuw nsw i64 %indvars.iv.i238, 1
%exitcond.not.i250 = icmp eq i64 %indvars.iv.next.i249, 256
br i1 %exitcond.not.i250, label %for.inc21.i253, label %for.body6.i237, !llvm.loop !12
for.inc21.i253: ; preds = %for.inc18.i248, %for.cond4.preheader.i233
%indvars.iv.next40.i254 = add nuw nsw i64 %indvars.iv39.i234, 1
%exitcond42.not.i255 = icmp eq i64 %indvars.iv.next40.i254, 256
br i1 %exitcond42.not.i255, label %calc_num.exit256, label %for.cond4.preheader.i233, !llvm.loop !14
calc_num.exit256: ; preds = %for.inc21.i253
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %arrayidx64, ptr noundef nonnull align 1 dereferenceable(256) %tmp65, i64 256, i1 false), !tbaa.struct !21
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %tmp65) #11
br label %for.inc158
if.then77: ; preds = %if.else
%cmp78 = icmp slt i32 %stack_pos.0323, 2
br i1 %cmp78, label %for.inc158, label %if.else81
if.else81: ; preds = %if.then77
%dec82 = add nsw i32 %stack_pos.0323, -1
%sub83 = add nsw i32 %stack_pos.0323, -2
%idxprom84 = zext i32 %sub83 to i64
%arrayidx85 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom84
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %tmp86) #11
%idxprom90 = zext i32 %dec82 to i64
%arrayidx91 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom90
call void @llvm.experimental.noalias.scope.decl(metadata !35)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(256) %tmp86, i8 0, i64 256, i1 false), !tbaa !5, !alias.scope !35
br label %for.cond4.preheader.i257
for.cond4.preheader.i257: ; preds = %for.inc21.i277, %if.else81
%indvars.iv39.i258 = phi i64 [ 0, %if.else81 ], [ %indvars.iv.next40.i278, %for.inc21.i277 ]
%arrayidx9.i259 = getelementptr inbounds [256 x i8], ptr %arrayidx85, i64 0, i64 %indvars.iv39.i258
%32 = load i8, ptr %arrayidx9.i259, align 1, !tbaa !5, !noalias !35
%33 = icmp eq i8 %32, 0
br i1 %33, label %for.inc21.i277, label %for.body6.preheader.i260
for.body6.preheader.i260: ; preds = %for.cond4.preheader.i257
%34 = trunc i64 %indvars.iv39.i258 to i32
br label %for.body6.i261
for.body6.i261: ; preds = %for.inc18.i272, %for.body6.preheader.i260
%indvars.iv.i262 = phi i64 [ 0, %for.body6.preheader.i260 ], [ %indvars.iv.next.i273, %for.inc18.i272 ]
%arrayidx12.i265 = getelementptr inbounds [256 x i8], ptr %arrayidx91, i64 0, i64 %indvars.iv.i262
%35 = load i8, ptr %arrayidx12.i265, align 1, !tbaa !5, !noalias !35
%tobool14.not.i266 = icmp eq i8 %35, 0
br i1 %tobool14.not.i266, label %for.inc18.i272, label %if.then.i267
if.then.i267: ; preds = %for.body6.i261
%36 = trunc i64 %indvars.iv.i262 to i32
%mul.i = mul nsw i32 %36, %34
%rem.i269 = srem i32 %mul.i, 256
%idxprom16.i270 = sext i32 %rem.i269 to i64
%arrayidx17.i271 = getelementptr inbounds [256 x i8], ptr %tmp86, i64 0, i64 %idxprom16.i270
store i8 1, ptr %arrayidx17.i271, align 1, !tbaa !5, !alias.scope !35
br label %for.inc18.i272
for.inc18.i272: ; preds = %if.then.i267, %for.body6.i261
%indvars.iv.next.i273 = add nuw nsw i64 %indvars.iv.i262, 1
%exitcond.not.i274 = icmp eq i64 %indvars.iv.next.i273, 256
br i1 %exitcond.not.i274, label %for.inc21.i277, label %for.body6.i261, !llvm.loop !12
for.inc21.i277: ; preds = %for.inc18.i272, %for.cond4.preheader.i257
%indvars.iv.next40.i278 = add nuw nsw i64 %indvars.iv39.i258, 1
%exitcond42.not.i279 = icmp eq i64 %indvars.iv.next40.i278, 256
br i1 %exitcond42.not.i279, label %calc_num.exit280, label %for.cond4.preheader.i257, !llvm.loop !14
calc_num.exit280: ; preds = %for.inc21.i277
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %arrayidx85, ptr noundef nonnull align 1 dereferenceable(256) %tmp86, i64 256, i1 false), !tbaa.struct !21
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %tmp86) #11
br label %for.inc158
if.then98: ; preds = %if.else
%cmp99 = icmp slt i32 %stack_pos.0323, 2
br i1 %cmp99, label %for.inc158, label %lor.lhs.false
lor.lhs.false: ; preds = %if.then98
%sub101 = add nsw i32 %stack_pos.0323, -1
%idxprom102 = zext i32 %sub101 to i64
%arrayidx103 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom102
%37 = load i8, ptr %arrayidx103, align 16, !tbaa !5
%cmp106.not = icmp eq i8 %37, 0
br i1 %cmp106.not, label %if.else109, label %for.inc158
if.else109: ; preds = %lor.lhs.false
%sub111 = add nsw i32 %stack_pos.0323, -2
%idxprom112 = zext i32 %sub111 to i64
%arrayidx113 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom112
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %tmp114) #11
call void @llvm.experimental.noalias.scope.decl(metadata !38)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(256) %tmp114, i8 0, i64 256, i1 false), !tbaa !5, !alias.scope !38
br label %for.cond4.preheader.i281
for.cond4.preheader.i281: ; preds = %for.inc21.i301, %if.else109
%indvars.iv39.i282 = phi i64 [ 0, %if.else109 ], [ %indvars.iv.next40.i302, %for.inc21.i301 ]
%arrayidx9.i283 = getelementptr inbounds [256 x i8], ptr %arrayidx113, i64 0, i64 %indvars.iv39.i282
%38 = load i8, ptr %arrayidx9.i283, align 1, !tbaa !5, !noalias !38
%39 = icmp eq i8 %38, 0
br i1 %39, label %for.inc21.i301, label %for.body6.preheader.i284
for.body6.preheader.i284: ; preds = %for.cond4.preheader.i281
%40 = trunc i64 %indvars.iv39.i282 to i32
br label %for.body6.i285
for.body6.i285: ; preds = %for.inc18.i296, %for.body6.preheader.i284
%indvars.iv.i286 = phi i64 [ 0, %for.body6.preheader.i284 ], [ %indvars.iv.next.i297, %for.inc18.i296 ]
%arrayidx12.i289 = getelementptr inbounds [256 x i8], ptr %arrayidx103, i64 0, i64 %indvars.iv.i286
%41 = load i8, ptr %arrayidx12.i289, align 1, !tbaa !5, !noalias !38
%tobool14.not.i290 = icmp eq i8 %41, 0
br i1 %tobool14.not.i290, label %for.inc18.i296, label %if.then.i291
if.then.i291: ; preds = %for.body6.i285
%42 = trunc i64 %indvars.iv.i286 to i32
%div.i = sdiv i32 %40, %42
%rem.i293 = srem i32 %div.i, 256
%idxprom16.i294 = sext i32 %rem.i293 to i64
%arrayidx17.i295 = getelementptr inbounds [256 x i8], ptr %tmp114, i64 0, i64 %idxprom16.i294
store i8 1, ptr %arrayidx17.i295, align 1, !tbaa !5, !alias.scope !38
br label %for.inc18.i296
for.inc18.i296: ; preds = %if.then.i291, %for.body6.i285
%indvars.iv.next.i297 = add nuw nsw i64 %indvars.iv.i286, 1
%exitcond.not.i298 = icmp eq i64 %indvars.iv.next.i297, 256
br i1 %exitcond.not.i298, label %for.inc21.i301, label %for.body6.i285, !llvm.loop !12
for.inc21.i301: ; preds = %for.inc18.i296, %for.cond4.preheader.i281
%indvars.iv.next40.i302 = add nuw nsw i64 %indvars.iv39.i282, 1
%exitcond42.not.i303 = icmp eq i64 %indvars.iv.next40.i302, 256
br i1 %exitcond42.not.i303, label %calc_num.exit304, label %for.cond4.preheader.i281, !llvm.loop !14
calc_num.exit304: ; preds = %for.inc21.i301
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %arrayidx113, ptr noundef nonnull align 1 dereferenceable(256) %tmp114, i64 256, i1 false), !tbaa.struct !21
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %tmp114) #11
br label %for.inc158
for.cond122: ; preds = %for.body125
%indvars.iv.next329 = add nuw nsw i64 %indvars.iv328, 1
%exitcond.not = icmp eq i64 %indvars.iv.next329, %wide.trip.count
br i1 %exitcond.not, label %for.inc158, label %for.body125, !llvm.loop !41
for.body125: ; preds = %for.body125.preheader, %for.cond122
%indvars.iv328 = phi i64 [ 0, %for.body125.preheader ], [ %indvars.iv.next329, %for.cond122 ]
%arrayidx128 = getelementptr inbounds [100 x [32 x i8]], ptr %names, i64 0, i64 %indvars.iv328
%call130 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %data, ptr noundef nonnull dereferenceable(1) %arrayidx128) #12
%cmp131 = icmp eq i32 %call130, 0
br i1 %cmp131, label %if.else141, label %for.cond122
if.else141: ; preds = %for.body125
%inc142 = add nsw i32 %stack_pos.0323, 1
%idxprom143 = sext i32 %stack_pos.0323 to i64
%arrayidx144 = getelementptr inbounds [100 x %struct.num_t], ptr %stack, i64 0, i64 %idxprom143
%arrayidx146 = getelementptr inbounds [100 x %struct.num_t], ptr %vars, i64 0, i64 %indvars.iv328
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %arrayidx144, ptr noundef nonnull align 16 dereferenceable(256) %arrayidx146, i64 256, i1 false), !tbaa.struct !21
br label %for.inc158
cleanup153: ; preds = %for.body15
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %end) #11
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %data) #11
br label %cleanup167
for.inc158: ; preds = %for.cond122, %for.cond122.preheader, %if.end20, %if.else141, %if.then98, %lor.lhs.false, %if.then77, %if.then56, %if.then37, %calc_num.exit, %calc_num.exit280, %calc_num.exit304, %calc_num.exit256, %create_num.exit229
%stack_pos.3.ph = phi i32 [ %inc142, %if.else141 ], [ %stack_pos.0323, %if.then98 ], [ %stack_pos.0323, %lor.lhs.false ], [ %stack_pos.0323, %if.then77 ], [ %stack_pos.0323, %if.then56 ], [ %stack_pos.0323, %if.then37 ], [ %sub101, %calc_num.exit304 ], [ %dec82, %calc_num.exit280 ], [ %dec61, %calc_num.exit256 ], [ %dec, %calc_num.exit ], [ %inc29, %create_num.exit229 ], [ %stack_pos.0323, %if.end20 ], [ %stack_pos.0323, %for.cond122.preheader ], [ %stack_pos.0323, %for.cond122 ]
%43 = phi i1 [ true, %if.else141 ], [ false, %if.then98 ], [ false, %lor.lhs.false ], [ false, %if.then77 ], [ false, %if.then56 ], [ false, %if.then37 ], [ true, %calc_num.exit304 ], [ true, %calc_num.exit280 ], [ true, %calc_num.exit256 ], [ true, %calc_num.exit ], [ true, %create_num.exit229 ], [ false, %if.end20 ], [ false, %for.cond122.preheader ], [ false, %for.cond122 ]
%error_flag.3.ph = phi i32 [ 0, %if.else141 ], [ 1, %if.then98 ], [ 1, %lor.lhs.false ], [ 1, %if.then77 ], [ 1, %if.then56 ], [ 1, %if.then37 ], [ 0, %calc_num.exit304 ], [ 0, %calc_num.exit280 ], [ 0, %calc_num.exit256 ], [ 0, %calc_num.exit ], [ 0, %create_num.exit229 ], [ 1, %if.end20 ], [ 1, %for.cond122.preheader ], [ 1, %for.cond122 ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %end) #11
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %data) #11
%inc159 = add nuw nsw i32 %i.1322, 1
%44 = load i32, ptr %n, align 4, !tbaa !15
%cmp14 = icmp slt i32 %inc159, %44
br i1 %cmp14, label %for.body15, label %for.end160.loopexit, !llvm.loop !42
for.end160.loopexit: ; preds = %for.inc158
%45 = icmp eq i32 %stack_pos.3.ph, 1
%46 = and i1 %45, %43
%47 = select i1 %46, ptr @.str.8, ptr @.str.7
br label %for.end160
for.end160: ; preds = %for.end160.loopexit, %for.cond13.preheader
%tobool165.not = phi ptr [ @.str.7, %for.cond13.preheader ], [ %47, %for.end160.loopexit ]
%call166 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %tobool165.not)
br label %cleanup167
cleanup167: ; preds = %cleanup153, %cleanup.thread, %for.end, %entry, %for.end160
%retval.4 = phi i32 [ 1, %cleanup153 ], [ 0, %for.end160 ], [ 1, %entry ], [ 1, %for.end ], [ 1, %cleanup.thread ]
call void @llvm.lifetime.end.p0(i64 25600, ptr nonnull %stack) #11
call void @llvm.lifetime.end.p0(i64 25600, ptr nonnull %vars) #11
call void @llvm.lifetime.end.p0(i64 3200, ptr nonnull %names) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #11
ret i32 %retval.4
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; 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 willreturn memory(inaccessiblemem: readwrite)
declare void @llvm.experimental.noalias.scope.decl(metadata) #10
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { 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 #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !9}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !6, i64 0}
!17 = !{!18}
!18 = distinct !{!18, !19, !"create_num: %agg.result"}
!19 = distinct !{!19, !"create_num"}
!20 = distinct !{!20, !9, !10, !11}
!21 = !{i64 0, i64 256, !5}
!22 = distinct !{!22, !9}
!23 = !{!24, !24, i64 0}
!24 = !{!"any pointer", !6, i64 0}
!25 = !{!26}
!26 = distinct !{!26, !27, !"create_num: %agg.result"}
!27 = distinct !{!27, !"create_num"}
!28 = distinct !{!28, !9, !10, !11}
!29 = !{!30}
!30 = distinct !{!30, !31, !"calc_num: %agg.result"}
!31 = distinct !{!31, !"calc_num"}
!32 = !{!33}
!33 = distinct !{!33, !34, !"calc_num: %agg.result"}
!34 = distinct !{!34, !"calc_num"}
!35 = !{!36}
!36 = distinct !{!36, !37, !"calc_num: %agg.result"}
!37 = distinct !{!37, !"calc_num"}
!38 = !{!39}
!39 = distinct !{!39, !40, !"calc_num: %agg.result"}
!40 = distinct !{!40, !"calc_num"}
!41 = distinct !{!41, !9}
!42 = distinct !{!42, !9}
|
#include<stdio.h>
int main(void)
{
int a,b,c;
scanf("%d %d",&a,&b);
c=(a+b)/2;
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_189991/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_189991/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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;
scanf("%d %d",&a,&b);
printf("%d\n",(a+b)/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190032/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190032/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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;
scanf("%d%d",&a,&b);
printf("%d\n",(a+b)/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190076/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190076/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#define MAX_N 101000
int isPrime[ MAX_N + 1 ] = { 0, 0, 1 };
void quickSort( int *, int, int );
int median( int, int, int );
void insertionSort( int *, int );
int main( void ) {
int i, j, N, P, cnt, p[ 22 ], sum[ 253 ];
for ( i = 3; i <= MAX_N; i += 2 )
isPrime[ i ] = 1;
for ( i = 3; i * i <= MAX_N; i += 2 )
if ( isPrime[ i ] )
for ( j = i * 2; j <= MAX_N; j += i )
isPrime[ j ] = 0;
for ( ; scanf( "%d %d", &N, &P ), N != -1; printf( "%d\n", sum[ P - 1 ] ) ) {
cnt = 0;
for ( i = N + 1; cnt < 22; i++ )
if ( isPrime[ i ] )
p[ cnt++ ] = i;
cnt = 0;
for ( i = 0; i < 22; i++ )
for ( j = i; j < 22; j++ )
sum[ cnt++ ] = p[ i ] + p[ j ];
quickSort( sum, 0, 179 );
}
return 0;
}
void quickSort( int *data, int l, int r ) {
if ( l < r ) {
int i = l, j = r, pivot = median( data[ i ], data[ ( i + j ) / 2 ], data[ j ] ), tmp;
while ( 1 ) {
for ( ; data[ i ] < pivot; i++ ) ;
for ( ; pivot < data [ j ]; j-- ) ;
if ( i >= j )
break;
tmp = data[ i ];
data[ i ] = data[ j ];
data[ j ] = tmp;
i++;
j--;
}
if ( i - l < 20 )
insertionSort( data + l, i - l );
else
quickSort( data, l, i - 1 );
if ( r - j < 20 )
insertionSort( data + j + 1, r - j );
else
quickSort( data, j + 1, r );
}
}
int median( int x, int y, int z ) {
if ( x < y )
if ( y < z )
return y;
else if ( z < x )
return x;
else
return z;
else if ( z < y )
return y;
else if ( x < z )
return x;
else
return z;
}
void insertionSort( int *data, int n ) {
int i, j, tmp;
for ( i = 1; i < n; i++ ) {
tmp = data[ i ];
for ( j = i; j && data[ j - 1 ] > tmp; j-- )
data[ j ] = data[ j - 1 ];
data[ j ] = tmp;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190119/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190119/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@isPrime = dso_local local_unnamed_addr global <{ i32, i32, i32, [100998 x i32] }> <{ i32 0, i32 0, i32 1, [100998 x i32] zeroinitializer }>, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%P = alloca i32, align 4
%p = alloca [22 x i32], align 16
%sum = alloca [253 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %P) #7
call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %p) #7
call void @llvm.lifetime.start.p0(i64 1012, ptr nonnull %sum) #7
br label %for.body
for.body: ; preds = %for.body, %entry
%indvars.iv = phi i64 [ 3, %entry ], [ %indvars.iv.next.2, %for.body ]
%arrayidx = getelementptr inbounds [101001 x i32], ptr @isPrime, i64 0, i64 %indvars.iv
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
%arrayidx.1 = getelementptr inbounds [101001 x i32], ptr @isPrime, i64 0, i64 %indvars.iv.next
store i32 1, ptr %arrayidx.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 4
%arrayidx.2 = getelementptr inbounds [101001 x i32], ptr @isPrime, i64 0, i64 %indvars.iv.next.1
store i32 1, ptr %arrayidx.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 6
%cmp.2 = icmp ult i64 %indvars.iv, 100995
br i1 %cmp.2, label %for.body, label %for.body3, !llvm.loop !9
for.cond18.preheader: ; preds = %for.inc15
%call93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %P)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp19.not94 = icmp eq i32 %0, -1
br i1 %cmp19.not94, label %for.end59, label %for.cond22.preheader.preheader
for.cond22.preheader.preheader: ; preds = %for.cond18.preheader
%arrayidx44.1121 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 1
%arrayidx48.1123 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 1
%arrayidx44.2125 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 2
%arrayidx44.3129 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 3
%arrayidx44.5137 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 5
%arrayidx48.5139 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 5
%arrayidx44.6141 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 6
%arrayidx44.7145 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 7
%arrayidx44.8149 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 8
%arrayidx44.9153 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 9
%arrayidx48.9155 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 9
%arrayidx44.10157 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 10
%arrayidx44.11161 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 11
%arrayidx44.12165 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 12
%arrayidx44.13169 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 13
%arrayidx48.13171 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 13
%arrayidx44.14173 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 14
%arrayidx44.15177 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 15
%arrayidx44.16181 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 16
%arrayidx44.17185 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 17
%arrayidx48.17187 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 17
%arrayidx44.18189 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 18
%arrayidx44.19193 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 19
%arrayidx44.20197 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 20
%arrayidx44.21201 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 21
%arrayidx48.21203 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 21
%arrayidx48.1.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 23
%arrayidx48.1.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 27
%arrayidx48.1.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 31
%arrayidx48.1.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 35
%arrayidx48.1.17 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 39
%arrayidx48.2 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 43
%arrayidx48.2.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 44
%arrayidx48.2.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 48
%arrayidx48.2.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 52
%arrayidx48.2.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 56
%arrayidx48.2.17 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 60
%arrayidx48.2.19 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 62
%arrayidx48.3 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 63
%arrayidx48.3.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 64
%arrayidx48.3.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 68
%arrayidx48.3.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 72
%arrayidx48.3.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 76
%arrayidx48.3.17 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 80
%arrayidx48.3.18 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 81
%arrayidx48.4 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 82
%arrayidx48.4.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 83
%arrayidx48.4.2 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 84
%arrayidx48.4.6 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 88
%arrayidx48.4.10 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 92
%arrayidx48.4.14 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 96
%arrayidx48.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 100
%arrayidx48.5.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 101
%arrayidx48.5.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 105
%arrayidx48.5.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 109
%arrayidx48.5.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 113
%arrayidx48.6 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 117
%arrayidx48.6.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 118
%arrayidx48.6.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 122
%arrayidx48.6.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 126
%arrayidx48.6.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 130
%arrayidx48.6.15 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 132
%arrayidx48.7 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 133
%arrayidx48.7.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 134
%arrayidx48.7.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 138
%arrayidx48.7.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 142
%arrayidx48.7.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 146
%arrayidx48.7.14 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 147
%arrayidx48.8 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 148
%arrayidx48.8.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 149
%arrayidx48.8.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 153
%arrayidx48.8.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 157
%arrayidx48.8.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 161
%arrayidx48.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 162
%arrayidx48.9.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 163
%arrayidx48.9.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 167
%arrayidx48.9.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 171
%arrayidx48.10 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 175
%arrayidx48.10.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 176
%arrayidx48.10.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 180
%arrayidx48.10.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 184
%arrayidx48.10.10 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 185
%arrayidx48.10.11 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 186
%arrayidx48.11 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 187
%arrayidx48.11.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 188
%arrayidx48.11.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 192
%arrayidx48.11.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 196
%arrayidx48.12 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 198
%arrayidx48.12.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 199
%arrayidx48.12.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 203
%arrayidx48.12.9 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 207
%arrayidx48.13 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 208
%arrayidx48.13.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 209
%arrayidx48.13.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 213
%arrayidx48.13.6 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 214
%arrayidx48.13.7 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 215
%arrayidx48.14 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 217
%arrayidx48.14.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 218
%arrayidx48.14.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 222
%arrayidx48.14.6 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 223
%arrayidx48.15 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 225
%arrayidx48.15.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 226
%arrayidx48.15.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 230
%arrayidx48.16 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 232
%arrayidx48.16.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 233
%arrayidx48.16.5 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 237
%arrayidx48.17 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 238
%arrayidx48.17.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 239
%arrayidx48.17.2 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 240
%arrayidx48.17.3 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 241
%arrayidx48.18 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 243
%arrayidx48.18.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 244
%arrayidx48.18.2 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 245
%arrayidx48.19 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 247
%arrayidx48.19.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 248
%arrayidx48.20 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 250
%arrayidx48.20.1 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 251
%arrayidx48.21 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 252
br label %for.cond22.preheader
for.body3: ; preds = %for.body, %for.inc15
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc15 ], [ 3, %for.body ]
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.inc15 ], [ 6, %for.body ]
%arrayidx5 = getelementptr inbounds [101001 x i32], ptr @isPrime, i64 0, i64 %indvars.iv98
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%tobool.not.not = icmp eq i32 %1, 0
br i1 %tobool.not.not, label %for.inc15, label %for.body9
for.body9: ; preds = %for.body3, %for.body9
%indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body9 ], [ %indvars.iv96, %for.body3 ]
%arrayidx11 = getelementptr inbounds [101001 x i32], ptr @isPrime, i64 0, i64 %indvars.iv100
store i32 0, ptr %arrayidx11, align 4, !tbaa !5
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, %indvars.iv98
%cmp8 = icmp ult i64 %indvars.iv.next101, 101001
br i1 %cmp8, label %for.body9, label %for.inc15, !llvm.loop !11
for.inc15: ; preds = %for.body9, %for.body3
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 2
%indvars = trunc i64 %indvars.iv.next99 to i32
%mul = mul nsw i32 %indvars, %indvars
%cmp2 = icmp ult i32 %mul, 101001
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 4
br i1 %cmp2, label %for.body3, label %for.cond18.preheader, !llvm.loop !12
for.cond22.preheader: ; preds = %for.cond22.preheader.preheader, %for.cond38.preheader.preheader
%2 = phi i32 [ %203, %for.cond38.preheader.preheader ], [ %0, %for.cond22.preheader.preheader ]
%3 = sext i32 %2 to i64
br label %for.body24
for.body24: ; preds = %for.cond22.preheader, %for.inc32
%indvars.iv104 = phi i64 [ %3, %for.cond22.preheader ], [ %indvars.iv.next105, %for.inc32 ]
%cnt.087 = phi i32 [ 0, %for.cond22.preheader ], [ %cnt.1, %for.inc32 ]
%indvars.iv.next105 = add nsw i64 %indvars.iv104, 1
%arrayidx26 = getelementptr inbounds [101001 x i32], ptr @isPrime, i64 0, i64 %indvars.iv.next105
%4 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%tobool27.not = icmp eq i32 %4, 0
br i1 %tobool27.not, label %for.inc32, label %if.then28
if.then28: ; preds = %for.body24
%inc = add nsw i32 %cnt.087, 1
%idxprom29 = sext i32 %cnt.087 to i64
%arrayidx30 = getelementptr inbounds [22 x i32], ptr %p, i64 0, i64 %idxprom29
%5 = trunc i64 %indvars.iv.next105 to i32
store i32 %5, ptr %arrayidx30, align 4, !tbaa !5
br label %for.inc32
for.inc32: ; preds = %for.body24, %if.then28
%cnt.1 = phi i32 [ %inc, %if.then28 ], [ %cnt.087, %for.body24 ]
%cmp23 = icmp slt i32 %cnt.1, 22
br i1 %cmp23, label %for.body24, label %for.cond38.preheader.preheader, !llvm.loop !13
for.cond38.preheader.preheader: ; preds = %for.inc32
%6 = load <4 x i32>, ptr %arrayidx44.1121, align 4, !tbaa !5
%7 = load <4 x i32>, ptr %arrayidx44.5137, align 4, !tbaa !5
%8 = load <4 x i32>, ptr %arrayidx44.9153, align 4, !tbaa !5
%9 = load <4 x i32>, ptr %arrayidx44.13169, align 4, !tbaa !5
%10 = load <4 x i32>, ptr %arrayidx44.17185, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx44.21201, align 4, !tbaa !5
%12 = load <2 x i32>, ptr %p, align 16, !tbaa !5
%13 = extractelement <2 x i32> %12, i64 0
%add45 = shl nsw i32 %13, 1
store i32 %add45, ptr %sum, align 16, !tbaa !5
%14 = shufflevector <2 x i32> %12, <2 x i32> poison, <4 x i32> <i32 poison, i32 1, i32 poison, i32 poison>
%15 = shufflevector <2 x i32> %12, <2 x i32> poison, <4 x i32> zeroinitializer
%16 = add nsw <4 x i32> %6, %15
store <4 x i32> %16, ptr %arrayidx48.1123, align 4, !tbaa !5
%17 = add nsw <4 x i32> %7, %15
store <4 x i32> %17, ptr %arrayidx48.5139, align 4, !tbaa !5
%18 = add nsw <4 x i32> %8, %15
store <4 x i32> %18, ptr %arrayidx48.9155, align 4, !tbaa !5
%19 = add nsw <4 x i32> %9, %15
store <4 x i32> %19, ptr %arrayidx48.13171, align 4, !tbaa !5
%20 = add nsw <4 x i32> %10, %15
store <4 x i32> %20, ptr %arrayidx48.17187, align 4, !tbaa !5
%21 = insertelement <2 x i32> <i32 poison, i32 1>, i32 %11, i64 0
%22 = add nsw <2 x i32> %12, %21
%23 = shl nsw <2 x i32> %12, %21
%24 = shufflevector <2 x i32> %22, <2 x i32> %23, <2 x i32> <i32 0, i32 3>
store <2 x i32> %24, ptr %arrayidx48.21203, align 4, !tbaa !5
%25 = load <4 x i32>, ptr %arrayidx44.2125, align 8, !tbaa !5
%26 = shufflevector <2 x i32> %12, <2 x i32> poison, <4 x i32> <i32 1, i32 poison, i32 poison, i32 poison>
%27 = shufflevector <2 x i32> %12, <2 x i32> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%28 = add nsw <4 x i32> %25, %27
store <4 x i32> %28, ptr %arrayidx48.1.1, align 4, !tbaa !5
%29 = shufflevector <4 x i32> %7, <4 x i32> %8, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%30 = add nsw <4 x i32> %29, %27
store <4 x i32> %30, ptr %arrayidx48.1.5, align 4, !tbaa !5
%31 = shufflevector <4 x i32> %8, <4 x i32> %9, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%32 = add nsw <4 x i32> %31, %27
store <4 x i32> %32, ptr %arrayidx48.1.9, align 4, !tbaa !5
%33 = shufflevector <4 x i32> %9, <4 x i32> %10, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%34 = add nsw <4 x i32> %33, %27
store <4 x i32> %34, ptr %arrayidx48.1.13, align 4, !tbaa !5
%35 = insertelement <4 x i32> %26, i32 %11, i64 1
%36 = shufflevector <4 x i32> %35, <4 x i32> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
%37 = shufflevector <4 x i32> %10, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 poison>
%38 = shufflevector <4 x i32> %37, <4 x i32> %14, <4 x i32> <i32 0, i32 1, i32 2, i32 5>
%39 = add nsw <4 x i32> %36, %38
store <4 x i32> %39, ptr %arrayidx48.1.17, align 4, !tbaa !5
%40 = extractelement <4 x i32> %25, i64 0
%add45.2 = shl nsw i32 %40, 1
store i32 %add45.2, ptr %arrayidx48.2, align 4, !tbaa !5
%41 = shufflevector <4 x i32> %25, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 poison>
%42 = shufflevector <4 x i32> %25, <4 x i32> poison, <4 x i32> zeroinitializer
%43 = load <4 x i32>, ptr %arrayidx44.7145, align 4, !tbaa !5
%44 = add nsw <4 x i32> %43, %42
store <4 x i32> %44, ptr %arrayidx48.2.5, align 16, !tbaa !5
%45 = load <4 x i32>, ptr %arrayidx44.11161, align 4, !tbaa !5
%46 = add nsw <4 x i32> %45, %42
store <4 x i32> %46, ptr %arrayidx48.2.9, align 16, !tbaa !5
%47 = load <4 x i32>, ptr %arrayidx44.15177, align 4, !tbaa !5
%48 = add nsw <4 x i32> %47, %42
store <4 x i32> %48, ptr %arrayidx48.2.13, align 16, !tbaa !5
%49 = load <2 x i32>, ptr %arrayidx44.19193, align 4, !tbaa !5
%50 = shufflevector <4 x i32> %25, <4 x i32> poison, <2 x i32> zeroinitializer
%51 = add nsw <2 x i32> %49, %50
store <2 x i32> %51, ptr %arrayidx48.2.17, align 16, !tbaa !5
%52 = load i32, ptr %arrayidx44.21201, align 4, !tbaa !5
%add45.2.19 = add nsw i32 %52, %40
store i32 %add45.2.19, ptr %arrayidx48.2.19, align 8, !tbaa !5
%53 = load <4 x i32>, ptr %arrayidx44.3129, align 4, !tbaa !5
%54 = shufflevector <4 x i32> %41, <4 x i32> %53, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
%55 = add nsw <4 x i32> %54, %42
store <4 x i32> %55, ptr %arrayidx48.2.1, align 16, !tbaa !5
%56 = extractelement <4 x i32> %53, i64 0
%add45.3 = shl nsw i32 %56, 1
store i32 %add45.3, ptr %arrayidx48.3, align 4, !tbaa !5
%57 = shufflevector <4 x i32> %43, <4 x i32> %53, <2 x i32> <i32 4, i32 0>
%58 = shufflevector <2 x i32> %57, <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 0, i32 0>
%59 = add nsw <4 x i32> %58, %53
%60 = shufflevector <4 x i32> %59, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 0>
store <4 x i32> %60, ptr %arrayidx48.3.1, align 16, !tbaa !5
%61 = shufflevector <4 x i32> %43, <4 x i32> %45, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%62 = shufflevector <4 x i32> %53, <4 x i32> poison, <4 x i32> zeroinitializer
%63 = add nsw <4 x i32> %61, %62
store <4 x i32> %63, ptr %arrayidx48.3.5, align 16, !tbaa !5
%64 = shufflevector <4 x i32> %45, <4 x i32> %47, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%65 = add nsw <4 x i32> %64, %62
store <4 x i32> %65, ptr %arrayidx48.3.9, align 16, !tbaa !5
%66 = shufflevector <4 x i32> %47, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 poison>
%67 = shufflevector <2 x i32> %49, <2 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
%68 = shufflevector <4 x i32> %66, <4 x i32> %67, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
%69 = add nsw <4 x i32> %68, %62
store <4 x i32> %69, ptr %arrayidx48.3.13, align 16, !tbaa !5
%70 = extractelement <2 x i32> %49, i64 1
%add45.3.17 = add nsw i32 %70, %56
store i32 %add45.3.17, ptr %arrayidx48.3.17, align 16, !tbaa !5
%add45.3.18 = add nsw i32 %52, %56
store i32 %add45.3.18, ptr %arrayidx48.3.18, align 4, !tbaa !5
%71 = extractelement <4 x i32> %53, i64 1
%add45.4 = shl nsw i32 %71, 1
store i32 %add45.4, ptr %arrayidx48.4, align 8, !tbaa !5
%72 = extractelement <4 x i32> %53, i64 2
%add45.4.1 = add nsw i32 %72, %71
store i32 %add45.4.1, ptr %arrayidx48.4.1, align 4, !tbaa !5
%73 = load <4 x i32>, ptr %arrayidx44.6141, align 8, !tbaa !5
%74 = shufflevector <4 x i32> %53, <4 x i32> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%75 = add nsw <4 x i32> %73, %74
store <4 x i32> %75, ptr %arrayidx48.4.2, align 16, !tbaa !5
%76 = load <4 x i32>, ptr %arrayidx44.10157, align 8, !tbaa !5
%77 = add nsw <4 x i32> %76, %74
store <4 x i32> %77, ptr %arrayidx48.4.6, align 16, !tbaa !5
%78 = load <4 x i32>, ptr %arrayidx44.14173, align 8, !tbaa !5
%79 = add nsw <4 x i32> %78, %74
store <4 x i32> %79, ptr %arrayidx48.4.10, align 16, !tbaa !5
%80 = load <4 x i32>, ptr %arrayidx44.18189, align 8, !tbaa !5
%81 = add nsw <4 x i32> %80, %74
store <4 x i32> %81, ptr %arrayidx48.4.14, align 16, !tbaa !5
%82 = load i32, ptr %arrayidx44.5137, align 4, !tbaa !5
%add45.5 = shl nsw i32 %82, 1
store i32 %add45.5, ptr %arrayidx48.5, align 16, !tbaa !5
%83 = insertelement <4 x i32> poison, i32 %82, i64 0
%84 = shufflevector <4 x i32> %83, <4 x i32> poison, <4 x i32> zeroinitializer
%85 = add nsw <4 x i32> %73, %84
store <4 x i32> %85, ptr %arrayidx48.5.1, align 4, !tbaa !5
%86 = add nsw <4 x i32> %76, %84
store <4 x i32> %86, ptr %arrayidx48.5.5, align 4, !tbaa !5
%87 = add nsw <4 x i32> %78, %84
store <4 x i32> %87, ptr %arrayidx48.5.9, align 4, !tbaa !5
%88 = add nsw <4 x i32> %80, %84
store <4 x i32> %88, ptr %arrayidx48.5.13, align 4, !tbaa !5
%89 = load i32, ptr %arrayidx44.6141, align 8, !tbaa !5
%add45.6 = shl nsw i32 %89, 1
store i32 %add45.6, ptr %arrayidx48.6, align 4, !tbaa !5
%90 = load <4 x i32>, ptr %arrayidx44.7145, align 4, !tbaa !5
%91 = insertelement <4 x i32> poison, i32 %89, i64 0
%92 = shufflevector <4 x i32> %91, <4 x i32> poison, <4 x i32> zeroinitializer
%93 = add nsw <4 x i32> %90, %92
store <4 x i32> %93, ptr %arrayidx48.6.1, align 8, !tbaa !5
%94 = load <4 x i32>, ptr %arrayidx44.11161, align 4, !tbaa !5
%95 = add nsw <4 x i32> %94, %92
store <4 x i32> %95, ptr %arrayidx48.6.5, align 8, !tbaa !5
%96 = load <4 x i32>, ptr %arrayidx44.15177, align 4, !tbaa !5
%97 = add nsw <4 x i32> %96, %92
store <4 x i32> %97, ptr %arrayidx48.6.9, align 8, !tbaa !5
%98 = load <2 x i32>, ptr %arrayidx44.19193, align 4, !tbaa !5
%99 = insertelement <2 x i32> poison, i32 %89, i64 0
%100 = shufflevector <2 x i32> %99, <2 x i32> poison, <2 x i32> zeroinitializer
%101 = add nsw <2 x i32> %98, %100
store <2 x i32> %101, ptr %arrayidx48.6.13, align 8, !tbaa !5
%102 = load i32, ptr %arrayidx44.21201, align 4, !tbaa !5
%add45.6.15 = add nsw i32 %102, %89
store i32 %add45.6.15, ptr %arrayidx48.6.15, align 16, !tbaa !5
%103 = extractelement <4 x i32> %90, i64 0
%add45.7 = shl nsw i32 %103, 1
store i32 %add45.7, ptr %arrayidx48.7, align 4, !tbaa !5
%104 = shufflevector <4 x i32> %90, <4 x i32> %94, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%105 = shufflevector <4 x i32> %90, <4 x i32> poison, <4 x i32> zeroinitializer
%106 = add nsw <4 x i32> %104, %105
store <4 x i32> %106, ptr %arrayidx48.7.1, align 8, !tbaa !5
%107 = shufflevector <4 x i32> %94, <4 x i32> %96, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%108 = add nsw <4 x i32> %107, %105
store <4 x i32> %108, ptr %arrayidx48.7.5, align 8, !tbaa !5
%109 = shufflevector <4 x i32> %96, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 poison>
%110 = shufflevector <2 x i32> %98, <2 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
%111 = shufflevector <4 x i32> %109, <4 x i32> %110, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
%112 = add nsw <4 x i32> %111, %105
store <4 x i32> %112, ptr %arrayidx48.7.9, align 8, !tbaa !5
%113 = extractelement <2 x i32> %98, i64 1
%add45.7.13 = add nsw i32 %113, %103
store i32 %add45.7.13, ptr %arrayidx48.7.13, align 8, !tbaa !5
%add45.7.14 = add nsw i32 %102, %103
store i32 %add45.7.14, ptr %arrayidx48.7.14, align 4, !tbaa !5
%114 = load i32, ptr %arrayidx44.8149, align 16, !tbaa !5
%add45.8 = shl nsw i32 %114, 1
store i32 %add45.8, ptr %arrayidx48.8, align 16, !tbaa !5
%115 = load <4 x i32>, ptr %arrayidx44.9153, align 4, !tbaa !5
%116 = insertelement <4 x i32> poison, i32 %114, i64 0
%117 = shufflevector <4 x i32> %116, <4 x i32> poison, <4 x i32> zeroinitializer
%118 = add nsw <4 x i32> %115, %117
store <4 x i32> %118, ptr %arrayidx48.8.1, align 4, !tbaa !5
%119 = load <4 x i32>, ptr %arrayidx44.13169, align 4, !tbaa !5
%120 = add nsw <4 x i32> %119, %117
store <4 x i32> %120, ptr %arrayidx48.8.5, align 4, !tbaa !5
%121 = load <4 x i32>, ptr %arrayidx44.17185, align 4, !tbaa !5
%122 = add nsw <4 x i32> %121, %117
store <4 x i32> %122, ptr %arrayidx48.8.9, align 4, !tbaa !5
%123 = load i32, ptr %arrayidx44.21201, align 4, !tbaa !5
%add45.8.13 = add nsw i32 %123, %114
store i32 %add45.8.13, ptr %arrayidx48.8.13, align 4, !tbaa !5
%124 = extractelement <4 x i32> %115, i64 0
%add45.9 = shl nsw i32 %124, 1
store i32 %add45.9, ptr %arrayidx48.9, align 8, !tbaa !5
%125 = extractelement <4 x i32> %115, i64 1
%126 = shufflevector <4 x i32> %115, <4 x i32> %119, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%127 = shufflevector <4 x i32> %115, <4 x i32> poison, <4 x i32> zeroinitializer
%128 = add nsw <4 x i32> %126, %127
store <4 x i32> %128, ptr %arrayidx48.9.1, align 4, !tbaa !5
%129 = shufflevector <4 x i32> %119, <4 x i32> %121, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%130 = add nsw <4 x i32> %129, %127
store <4 x i32> %130, ptr %arrayidx48.9.5, align 4, !tbaa !5
%131 = extractelement <4 x i32> %121, i64 2
%132 = extractelement <4 x i32> %121, i64 3
%133 = shufflevector <4 x i32> %121, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 poison>
%134 = insertelement <4 x i32> %133, i32 %123, i64 3
%135 = add nsw <4 x i32> %134, %127
store <4 x i32> %135, ptr %arrayidx48.9.9, align 4, !tbaa !5
%add45.10 = shl nsw i32 %125, 1
store i32 %add45.10, ptr %arrayidx48.10, align 4, !tbaa !5
%136 = shufflevector <4 x i32> %115, <4 x i32> %119, <4 x i32> <i32 2, i32 3, i32 4, i32 5>
%137 = shufflevector <4 x i32> %115, <4 x i32> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%138 = add nsw <4 x i32> %136, %137
store <4 x i32> %138, ptr %arrayidx48.10.1, align 16, !tbaa !5
%139 = shufflevector <4 x i32> %119, <4 x i32> %121, <4 x i32> <i32 2, i32 3, i32 4, i32 5>
%140 = add nsw <4 x i32> %139, %137
store <4 x i32> %140, ptr %arrayidx48.10.5, align 16, !tbaa !5
%add45.10.9 = add nsw i32 %131, %125
store i32 %add45.10.9, ptr %arrayidx48.10.9, align 16, !tbaa !5
%add45.10.10 = add nsw i32 %132, %125
store i32 %add45.10.10, ptr %arrayidx48.10.10, align 4, !tbaa !5
%add45.10.11 = add nsw i32 %123, %125
store i32 %add45.10.11, ptr %arrayidx48.10.11, align 8, !tbaa !5
%141 = load i32, ptr %arrayidx44.11161, align 4, !tbaa !5
%add45.11 = shl nsw i32 %141, 1
store i32 %add45.11, ptr %arrayidx48.11, align 4, !tbaa !5
%142 = load <4 x i32>, ptr %arrayidx44.12165, align 16, !tbaa !5
%143 = insertelement <4 x i32> poison, i32 %141, i64 0
%144 = shufflevector <4 x i32> %143, <4 x i32> poison, <4 x i32> zeroinitializer
%145 = add nsw <4 x i32> %142, %144
store <4 x i32> %145, ptr %arrayidx48.11.1, align 16, !tbaa !5
%146 = load <4 x i32>, ptr %arrayidx44.16181, align 16, !tbaa !5
%147 = add nsw <4 x i32> %146, %144
store <4 x i32> %147, ptr %arrayidx48.11.5, align 16, !tbaa !5
%148 = load <2 x i32>, ptr %arrayidx44.20197, align 16, !tbaa !5
%149 = insertelement <2 x i32> poison, i32 %141, i64 0
%150 = shufflevector <2 x i32> %149, <2 x i32> poison, <2 x i32> zeroinitializer
%151 = add nsw <2 x i32> %148, %150
store <2 x i32> %151, ptr %arrayidx48.11.9, align 16, !tbaa !5
%152 = extractelement <4 x i32> %142, i64 0
%add45.12 = shl nsw i32 %152, 1
store i32 %add45.12, ptr %arrayidx48.12, align 8, !tbaa !5
%153 = extractelement <4 x i32> %142, i64 1
%154 = extractelement <4 x i32> %142, i64 2
%155 = shufflevector <4 x i32> %142, <4 x i32> %146, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
%156 = shufflevector <4 x i32> %142, <4 x i32> poison, <4 x i32> zeroinitializer
%157 = add nsw <4 x i32> %155, %156
store <4 x i32> %157, ptr %arrayidx48.12.1, align 4, !tbaa !5
%158 = extractelement <4 x i32> %146, i64 2
%159 = extractelement <4 x i32> %146, i64 3
%160 = shufflevector <4 x i32> %146, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 poison>
%161 = shufflevector <2 x i32> %148, <2 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
%162 = shufflevector <4 x i32> %160, <4 x i32> %161, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
%163 = add nsw <4 x i32> %162, %156
store <4 x i32> %163, ptr %arrayidx48.12.5, align 4, !tbaa !5
%164 = extractelement <2 x i32> %148, i64 1
%add45.12.9 = add nsw i32 %164, %152
store i32 %add45.12.9, ptr %arrayidx48.12.9, align 4, !tbaa !5
%add45.13 = shl nsw i32 %153, 1
store i32 %add45.13, ptr %arrayidx48.13, align 16, !tbaa !5
%165 = shufflevector <4 x i32> %142, <4 x i32> %146, <4 x i32> <i32 2, i32 3, i32 4, i32 5>
%166 = shufflevector <4 x i32> %142, <4 x i32> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%167 = add nsw <4 x i32> %165, %166
store <4 x i32> %167, ptr %arrayidx48.13.1, align 4, !tbaa !5
%add45.13.5 = add nsw i32 %158, %153
store i32 %add45.13.5, ptr %arrayidx48.13.5, align 4, !tbaa !5
%add45.13.6 = add nsw i32 %159, %153
store i32 %add45.13.6, ptr %arrayidx48.13.6, align 8, !tbaa !5
%168 = shufflevector <4 x i32> %142, <4 x i32> poison, <2 x i32> <i32 1, i32 1>
%169 = add nsw <2 x i32> %148, %168
store <2 x i32> %169, ptr %arrayidx48.13.7, align 4, !tbaa !5
%add45.14 = shl nsw i32 %154, 1
store i32 %add45.14, ptr %arrayidx48.14, align 4, !tbaa !5
%170 = shufflevector <4 x i32> %142, <4 x i32> %146, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%171 = shufflevector <4 x i32> %142, <4 x i32> poison, <4 x i32> <i32 2, i32 2, i32 2, i32 2>
%172 = add nsw <4 x i32> %170, %171
store <4 x i32> %172, ptr %arrayidx48.14.1, align 8, !tbaa !5
%add45.14.5 = add nsw i32 %159, %154
store i32 %add45.14.5, ptr %arrayidx48.14.5, align 8, !tbaa !5
%173 = shufflevector <4 x i32> %142, <4 x i32> poison, <2 x i32> <i32 2, i32 2>
%174 = add nsw <2 x i32> %148, %173
store <2 x i32> %174, ptr %arrayidx48.14.6, align 4, !tbaa !5
%175 = load i32, ptr %arrayidx44.15177, align 4, !tbaa !5
%add45.15 = shl nsw i32 %175, 1
store i32 %add45.15, ptr %arrayidx48.15, align 4, !tbaa !5
%176 = load <4 x i32>, ptr %arrayidx44.16181, align 16, !tbaa !5
%177 = insertelement <4 x i32> poison, i32 %175, i64 0
%178 = shufflevector <4 x i32> %177, <4 x i32> poison, <4 x i32> zeroinitializer
%179 = add nsw <4 x i32> %176, %178
store <4 x i32> %179, ptr %arrayidx48.15.1, align 8, !tbaa !5
%180 = load <2 x i32>, ptr %arrayidx44.20197, align 16, !tbaa !5
%181 = insertelement <2 x i32> poison, i32 %175, i64 0
%182 = shufflevector <2 x i32> %181, <2 x i32> poison, <2 x i32> zeroinitializer
%183 = add nsw <2 x i32> %180, %182
store <2 x i32> %183, ptr %arrayidx48.15.5, align 8, !tbaa !5
%184 = extractelement <4 x i32> %176, i64 0
%add45.16 = shl nsw i32 %184, 1
store i32 %add45.16, ptr %arrayidx48.16, align 16, !tbaa !5
%185 = extractelement <4 x i32> %176, i64 1
%186 = extractelement <4 x i32> %176, i64 2
%187 = extractelement <4 x i32> %176, i64 3
%188 = shufflevector <4 x i32> %176, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 poison>
%189 = shufflevector <2 x i32> %180, <2 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
%190 = shufflevector <4 x i32> %188, <4 x i32> %189, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
%191 = shufflevector <4 x i32> %176, <4 x i32> poison, <4 x i32> zeroinitializer
%192 = add nsw <4 x i32> %190, %191
store <4 x i32> %192, ptr %arrayidx48.16.1, align 4, !tbaa !5
%193 = extractelement <2 x i32> %180, i64 1
%add45.16.5 = add nsw i32 %193, %184
store i32 %add45.16.5, ptr %arrayidx48.16.5, align 4, !tbaa !5
%add45.17 = shl nsw i32 %185, 1
store i32 %add45.17, ptr %arrayidx48.17, align 8, !tbaa !5
%add45.17.1 = add nsw i32 %186, %185
store i32 %add45.17.1, ptr %arrayidx48.17.1, align 4, !tbaa !5
%add45.17.2 = add nsw i32 %187, %185
store i32 %add45.17.2, ptr %arrayidx48.17.2, align 16, !tbaa !5
%194 = shufflevector <4 x i32> %176, <4 x i32> poison, <2 x i32> <i32 1, i32 1>
%195 = add nsw <2 x i32> %180, %194
store <2 x i32> %195, ptr %arrayidx48.17.3, align 4, !tbaa !5
%add45.18 = shl nsw i32 %186, 1
store i32 %add45.18, ptr %arrayidx48.18, align 4, !tbaa !5
%add45.18.1 = add nsw i32 %187, %186
store i32 %add45.18.1, ptr %arrayidx48.18.1, align 16, !tbaa !5
%196 = shufflevector <4 x i32> %176, <4 x i32> poison, <2 x i32> <i32 2, i32 2>
%197 = add nsw <2 x i32> %180, %196
store <2 x i32> %197, ptr %arrayidx48.18.2, align 4, !tbaa !5
%add45.19 = shl nsw i32 %187, 1
store i32 %add45.19, ptr %arrayidx48.19, align 4, !tbaa !5
%198 = shufflevector <4 x i32> %176, <4 x i32> poison, <2 x i32> <i32 3, i32 3>
%199 = add nsw <2 x i32> %180, %198
store <2 x i32> %199, ptr %arrayidx48.19.1, align 16, !tbaa !5
%200 = extractelement <2 x i32> %180, i64 0
%add45.20 = shl nsw i32 %200, 1
store i32 %add45.20, ptr %arrayidx48.20, align 8, !tbaa !5
%add45.20.1 = add nsw i32 %193, %200
store i32 %add45.20.1, ptr %arrayidx48.20.1, align 4, !tbaa !5
%add45.21 = shl nsw i32 %193, 1
store i32 %add45.21, ptr %arrayidx48.21, align 16, !tbaa !5
call void @quickSort(ptr noundef nonnull %sum, i32 noundef 0, i32 noundef 179)
%201 = load i32, ptr %P, align 4, !tbaa !5
%sub = add nsw i32 %201, -1
%idxprom56 = sext i32 %sub to i64
%arrayidx57 = getelementptr inbounds [253 x i32], ptr %sum, i64 0, i64 %idxprom56
%202 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %202)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %P)
%203 = load i32, ptr %N, align 4, !tbaa !5
%cmp19.not = icmp eq i32 %203, -1
br i1 %cmp19.not, label %for.end59, label %for.cond22.preheader, !llvm.loop !14
for.end59: ; preds = %for.cond38.preheader.preheader, %for.cond18.preheader
call void @llvm.lifetime.end.p0(i64 1012, ptr nonnull %sum) #7
call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %p) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %P) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %data, i32 noundef %l, i32 noundef %r) local_unnamed_addr #3 {
entry:
%cmp109 = icmp slt i32 %l, %r
br i1 %cmp109, label %if.then.lr.ph, label %if.end42
if.then.lr.ph: ; preds = %entry
%idxprom3 = sext i32 %r to i64
%arrayidx4 = getelementptr inbounds i32, ptr %data, i64 %idxprom3
br label %if.then
tailrecurse: ; preds = %if.end31
%add40 = add nsw i32 %8, 1
%cmp = icmp slt i32 %add40, %r
br i1 %cmp, label %if.then, label %if.end42
if.then: ; preds = %if.then.lr.ph, %tailrecurse
%l.tr110 = phi i32 [ %l, %if.then.lr.ph ], [ %add40, %tailrecurse ]
%idxprom = sext i32 %l.tr110 to i64
%arrayidx = getelementptr inbounds i32, ptr %data, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %l.tr110, %r
%div = sdiv i32 %add, 2
%idxprom1 = sext i32 %div to i64
%arrayidx2 = getelementptr inbounds i32, ptr %data, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp.i = icmp slt i32 %0, %1
br i1 %cmp.i, label %if.then.i, label %if.else6.i
if.then.i: ; preds = %if.then
%cmp1.i = icmp slt i32 %1, %2
br i1 %cmp1.i, label %median.exit, label %if.else.i
if.else.i: ; preds = %if.then.i
%x.z.i = tail call i32 @llvm.smax.i32(i32 %2, i32 %0)
br label %median.exit
if.else6.i: ; preds = %if.then
%cmp7.i = icmp slt i32 %2, %1
br i1 %cmp7.i, label %median.exit, label %if.else9.i
if.else9.i: ; preds = %if.else6.i
%x.z26.i = tail call i32 @llvm.smin.i32(i32 %0, i32 %2)
br label %median.exit
median.exit: ; preds = %if.then.i, %if.else.i, %if.else6.i, %if.else9.i
%retval.0.i = phi i32 [ %1, %if.then.i ], [ %x.z.i, %if.else.i ], [ %1, %if.else6.i ], [ %x.z26.i, %if.else9.i ]
br label %while.cond
while.cond: ; preds = %if.end, %median.exit
%j.0 = phi i32 [ %r, %median.exit ], [ %dec26, %if.end ]
%i.0 = phi i32 [ %l.tr110, %median.exit ], [ %inc25, %if.end ]
%3 = sext i32 %i.0 to i64
br label %for.cond
for.cond: ; preds = %for.cond, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ %3, %while.cond ]
%arrayidx6 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp slt i32 %4, %retval.0.i
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp7, label %for.cond, label %for.cond8.preheader, !llvm.loop !15
for.cond8.preheader: ; preds = %for.cond
%arrayidx6.le = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%5 = trunc i64 %indvars.iv to i32
%6 = sext i32 %j.0 to i64
br label %for.cond8
for.cond8: ; preds = %for.cond8, %for.cond8.preheader
%indvars.iv116 = phi i64 [ %indvars.iv.next117, %for.cond8 ], [ %6, %for.cond8.preheader ]
%arrayidx10 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv116
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11 = icmp slt i32 %retval.0.i, %7
%indvars.iv.next117 = add i64 %indvars.iv116, -1
br i1 %cmp11, label %for.cond8, label %for.end14, !llvm.loop !16
for.end14: ; preds = %for.cond8
%arrayidx10.le = getelementptr inbounds i32, ptr %data, i64 %indvars.iv116
%8 = trunc i64 %indvars.iv116 to i32
%cmp15.not = icmp slt i32 %5, %8
br i1 %cmp15.not, label %if.end, label %while.end
if.end: ; preds = %for.end14
store i32 %7, ptr %arrayidx6.le, align 4, !tbaa !5
store i32 %4, ptr %arrayidx10.le, align 4, !tbaa !5
%inc25 = add nsw i32 %5, 1
%dec26 = add nsw i32 %8, -1
br label %while.cond
while.end: ; preds = %for.end14
%sub = sub nsw i32 %5, %l.tr110
%cmp27 = icmp slt i32 %sub, 20
br i1 %cmp27, label %if.then28, label %if.else
if.then28: ; preds = %while.end
%cmp29.i = icmp sgt i32 %sub, 1
br i1 %cmp29.i, label %for.body.preheader.i, label %if.end31
for.body.preheader.i: ; preds = %if.then28
%wide.trip.count.i = zext i32 %sub to i64
br label %for.body.i
for.body.i: ; preds = %for.end.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
br label %land.rhs.i
land.rhs.i: ; preds = %for.body5.i, %for.body.i
%indvars.iv31.i = phi i64 [ %indvars.iv.i, %for.body.i ], [ %indvars.iv.next32.i, %for.body5.i ]
%indvars.iv.next32.i = add nsw i64 %indvars.iv31.i, -1
%arrayidx3.i = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv.next32.i
%10 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %10, %9
br i1 %cmp4.i, label %for.body5.i, label %for.end.i
for.body5.i: ; preds = %land.rhs.i
%arrayidx10.i = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv31.i
store i32 %10, ptr %arrayidx10.i, align 4, !tbaa !5
%11 = icmp eq i64 %indvars.iv.next32.i, 0
br i1 %11, label %for.end.i, label %land.rhs.i, !llvm.loop !17
for.end.i: ; preds = %for.body5.i, %land.rhs.i
%j.0.lcssa.i = phi i64 [ 0, %for.body5.i ], [ %indvars.iv31.i, %land.rhs.i ]
%sext.i = shl i64 %j.0.lcssa.i, 32
%idxprom11.i = ashr exact i64 %sext.i, 32
%arrayidx12.i = getelementptr inbounds i32, ptr %arrayidx, i64 %idxprom11.i
store i32 %9, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %if.end31, label %for.body.i, !llvm.loop !18
if.else: ; preds = %while.end
%sub30 = add nsw i32 %5, -1
tail call void @quickSort(ptr noundef nonnull %data, i32 noundef %l.tr110, i32 noundef %sub30)
br label %if.end31
if.end31: ; preds = %for.end.i, %if.then28, %if.else
%sub32 = sub nsw i32 %r, %8
%cmp33 = icmp slt i32 %sub32, 20
br i1 %cmp33, label %if.then34, label %tailrecurse
if.then34: ; preds = %if.end31
%add.ptr37 = getelementptr inbounds i32, ptr %arrayidx10.le, i64 1
%cmp29.i86 = icmp sgt i32 %sub32, 1
br i1 %cmp29.i86, label %for.body.preheader.i87, label %if.end42
for.body.preheader.i87: ; preds = %if.then34
%wide.trip.count.i88 = zext i32 %sub32 to i64
br label %for.body.i89
for.body.i89: ; preds = %for.end.i97, %for.body.preheader.i87
%indvars.iv.i90 = phi i64 [ 1, %for.body.preheader.i87 ], [ %indvars.iv.next.i102, %for.end.i97 ]
%arrayidx.i91 = getelementptr inbounds i32, ptr %add.ptr37, i64 %indvars.iv.i90
%12 = load i32, ptr %arrayidx.i91, align 4, !tbaa !5
br label %land.rhs.i92
land.rhs.i92: ; preds = %for.body5.i104, %for.body.i89
%indvars.iv31.i93 = phi i64 [ %indvars.iv.i90, %for.body.i89 ], [ %indvars.iv.next32.i94, %for.body5.i104 ]
%arrayidx3.i95 = getelementptr inbounds i32, ptr %arrayidx10.le, i64 %indvars.iv31.i93
%13 = load i32, ptr %arrayidx3.i95, align 4, !tbaa !5
%cmp4.i96 = icmp sgt i32 %13, %12
br i1 %cmp4.i96, label %for.body5.i104, label %for.end.i97
for.body5.i104: ; preds = %land.rhs.i92
%indvars.iv.next32.i94 = add nsw i64 %indvars.iv31.i93, -1
%arrayidx10.i105 = getelementptr inbounds i32, ptr %add.ptr37, i64 %indvars.iv31.i93
store i32 %13, ptr %arrayidx10.i105, align 4, !tbaa !5
%14 = icmp eq i64 %indvars.iv.next32.i94, 0
br i1 %14, label %for.end.i97, label %land.rhs.i92, !llvm.loop !17
for.end.i97: ; preds = %for.body5.i104, %land.rhs.i92
%j.0.lcssa.i98 = phi i64 [ 0, %for.body5.i104 ], [ %indvars.iv31.i93, %land.rhs.i92 ]
%sext.i99 = shl i64 %j.0.lcssa.i98, 32
%idxprom11.i100 = ashr exact i64 %sext.i99, 32
%arrayidx12.i101 = getelementptr inbounds i32, ptr %add.ptr37, i64 %idxprom11.i100
store i32 %12, ptr %arrayidx12.i101, align 4, !tbaa !5
%indvars.iv.next.i102 = add nuw nsw i64 %indvars.iv.i90, 1
%exitcond.not.i103 = icmp eq i64 %indvars.iv.next.i102, %wide.trip.count.i88
br i1 %exitcond.not.i103, label %if.end42, label %for.body.i89, !llvm.loop !18
if.end42: ; preds = %tailrecurse, %for.end.i97, %entry, %if.then34
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @median(i32 noundef %x, i32 noundef %y, i32 noundef %z) local_unnamed_addr #4 {
entry:
%cmp = icmp slt i32 %x, %y
br i1 %cmp, label %if.then, label %if.else6
if.then: ; preds = %entry
%cmp1 = icmp slt i32 %y, %z
br i1 %cmp1, label %return, label %if.else
if.else: ; preds = %if.then
%x.z = tail call i32 @llvm.smax.i32(i32 %z, i32 %x)
br label %return
if.else6: ; preds = %entry
%cmp7 = icmp slt i32 %z, %y
br i1 %cmp7, label %return, label %if.else9
if.else9: ; preds = %if.else6
%x.z26 = tail call i32 @llvm.smin.i32(i32 %x, i32 %z)
br label %return
return: ; preds = %if.else9, %if.else6, %if.else, %if.then
%retval.0 = phi i32 [ %y, %if.then ], [ %x.z, %if.else ], [ %y, %if.else6 ], [ %x.z26, %if.else9 ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @insertionSort(ptr nocapture noundef %data, i32 noundef %n) local_unnamed_addr #5 {
entry:
%cmp29 = icmp sgt i32 %n, 1
br i1 %cmp29, label %for.body.preheader, label %for.end14
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.end
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.end ]
%arrayidx = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body, %for.body5
%indvars.iv31 = phi i64 [ %indvars.iv, %for.body ], [ %indvars.iv.next32, %for.body5 ]
%indvars.iv.next32 = add nsw i64 %indvars.iv31, -1
%arrayidx3 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next32
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %1, %0
br i1 %cmp4, label %for.body5, label %for.end
for.body5: ; preds = %land.rhs
%arrayidx10 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv31
store i32 %1, ptr %arrayidx10, align 4, !tbaa !5
%2 = icmp eq i64 %indvars.iv.next32, 0
br i1 %2, label %for.end, label %land.rhs, !llvm.loop !17
for.end: ; preds = %for.body5, %land.rhs
%j.0.lcssa = phi i64 [ 0, %for.body5 ], [ %indvars.iv31, %land.rhs ]
%sext = shl i64 %j.0.lcssa, 32
%idxprom11 = ashr exact i64 %sext, 32
%arrayidx12 = getelementptr inbounds i32, ptr %data, i64 %idxprom11
store i32 %0, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end14, label %for.body, !llvm.loop !18
for.end14: ; preds = %for.end, %entry
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; 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 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include <stdlib.h>
#include <stdio.h>
int compare(const void *a,const void *b){
return *(int*)b-*(int*)a;
}
int main()
{
int i,k,n,a[200001]={0},tmp;
long ans=0;
scanf("%d%d",&n,&k);
for(i=0;i<n;i++){
scanf("%d",&tmp);
a[tmp]++;
}
qsort(a,200001,sizeof(int),compare);
for(i=k;i<200001;i++){
ans+=a[i];
}
printf("%ld",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190162/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190162/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(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:
%k = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [200001 x i32], align 16
%tmp = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %a) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) %a, i8 0, i64 800004, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%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 [ %inc2, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tmp)
%1 = load i32, ptr %tmp, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%inc2 = add nuw nsw i32 %i.018, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc2, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @qsort(ptr noundef nonnull %a, i64 noundef 200001, i64 noundef 4, ptr noundef nonnull @compare) #7
%4 = load i32, ptr %k, align 4, !tbaa !5
%cmp419 = icmp slt i32 %4, 200001
br i1 %cmp419, label %for.body5.preheader, label %for.end10
for.body5.preheader: ; preds = %for.end
%5 = sext i32 %4 to i64
%6 = add i32 %4, 1
%7 = zext i32 %6 to i64
%8 = sub nsw i64 200002, %7
%min.iters.check = icmp ult i64 %8, 12
br i1 %min.iters.check, label %for.body5.preheader25, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body5.preheader
%9 = add i32 %4, 1
%10 = zext i32 %9 to i64
%11 = sub nsw i64 200001, %10
%12 = trunc i64 %11 to i32
%13 = sub i32 -2, %4
%14 = icmp ult i32 %13, %12
%15 = icmp ugt i64 %11, 4294967295
%16 = or i1 %14, %15
br i1 %16, label %for.body5.preheader25, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %8, -4
%ind.end = add nsw i64 %n.vec, %5
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%vec.phi23 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
%offset.idx = add i64 %index, %5
%17 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %offset.idx
%wide.load = load <2 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr inbounds i32, ptr %17, i64 2
%wide.load24 = load <2 x i32>, ptr %18, align 4, !tbaa !5
%19 = sext <2 x i32> %wide.load to <2 x i64>
%20 = sext <2 x i32> %wide.load24 to <2 x i64>
%21 = add <2 x i64> %vec.phi, %19
%22 = add <2 x i64> %vec.phi23, %20
%index.next = add nuw i64 %index, 4
%23 = icmp eq i64 %index.next, %n.vec
br i1 %23, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %22, %21
%24 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %8, %n.vec
br i1 %cmp.n, label %for.end10, label %for.body5.preheader25
for.body5.preheader25: ; preds = %vector.scevcheck, %for.body5.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %5, %vector.scevcheck ], [ %5, %for.body5.preheader ], [ %ind.end, %middle.block ]
%ans.021.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %for.body5.preheader ], [ %24, %middle.block ]
br label %for.body5
for.body5: ; preds = %for.body5.preheader25, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ %indvars.iv.ph, %for.body5.preheader25 ]
%ans.021 = phi i64 [ %add, %for.body5 ], [ %ans.021.ph, %for.body5.preheader25 ]
%arrayidx7 = getelementptr inbounds [200001 x i32], ptr %a, i64 0, i64 %indvars.iv
%25 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%conv = sext i32 %25 to i64
%add = add nsw i64 %ans.021, %conv
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%26 = and i64 %indvars.iv.next, 4294967295
%exitcond.not = icmp eq i64 %26, 200001
br i1 %exitcond.not, label %for.end10, label %for.body5, !llvm.loop !14
for.end10: ; preds = %for.body5, %middle.block, %for.end
%ans.0.lcssa = phi i64 [ 0, %for.end ], [ %24, %middle.block ], [ %add, %for.body5 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #7
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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) #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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12}
|
#include <stdio.h>
#define ARC(i, a, b) for(int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
int main(){
unsigned n, a, p, ans = 0, cnt = 0;
scanf("%u", &n);
scanf("%u", &p);
RC(i, n - 1){
scanf("%u", &a);
if(a == p) ++cnt;
else{
ans += (cnt + 1) / 2;
cnt = 0;
}
p = a;
}
ans += (cnt + 1) / 2;
printf("%d\n", ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190205/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190205/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%u\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #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, ptr noundef nonnull %p)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18.not = icmp eq i32 %0, 1
br i1 %cmp18.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = add i32 %cnt.1, 1
%2 = lshr i32 %1, 1
%3 = add i32 %2, %ans.1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%add8 = phi i32 [ 0, %entry ], [ %3, %for.cond.cleanup.loopexit ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.021 = phi i32 [ %inc5, %for.body ], [ 0, %entry ]
%cnt.020 = phi i32 [ %cnt.1, %for.body ], [ 0, %entry ]
%ans.019 = phi i32 [ %ans.1, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%4 = load i32, ptr %a, align 4, !tbaa !5
%5 = load i32, ptr %p, align 4, !tbaa !5
%cmp3 = icmp eq i32 %4, %5
%inc = add i32 %cnt.020, 1
%div16 = lshr i32 %inc, 1
%add4 = select i1 %cmp3, i32 0, i32 %div16
%ans.1 = add i32 %add4, %ans.019
%cnt.1 = select i1 %cmp3, i32 %inc, i32 0
store i32 %4, ptr %p, align 4, !tbaa !5
%inc5 = add nuw nsw i32 %i.021, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%sub = add i32 %6, -1
%cmp = icmp ult i32 %inc5, %sub
br i1 %cmp, label %for.body, label %for.cond.cleanup.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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int i, n, a, b = -1, cnt = 0, ans = 0;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &a);
if (b == a) {
cnt++;
} else {
ans += (cnt+1) / 2;
cnt = 0;
}
b = a;
}
ans += (cnt+1) / 2;
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190256/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190256/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 0
br i1 %cmp14, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end
%ans.018 = phi i32 [ %ans.1, %if.end ], [ 0, %entry ]
%cnt.017 = phi i32 [ %cnt.1, %if.end ], [ 0, %entry ]
%b.016 = phi i32 [ %1, %if.end ], [ -1, %entry ]
%i.015 = phi i32 [ %inc4, %if.end ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp eq i32 %b.016, %1
%inc = add nsw i32 %cnt.017, 1
br i1 %cmp2, label %if.end, label %if.else
if.else: ; preds = %for.body
%div = sdiv i32 %inc, 2
%add3 = add nsw i32 %div, %ans.018
br label %if.end
if.end: ; preds = %for.body, %if.else
%cnt.1 = phi i32 [ 0, %if.else ], [ %inc, %for.body ]
%ans.1 = phi i32 [ %add3, %if.else ], [ %ans.018, %for.body ]
%inc4 = add nuw nsw i32 %i.015, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc4, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %if.end
%3 = add nsw i32 %cnt.1, 1
%4 = sdiv i32 %3, 2
%5 = add nsw i32 %4, %ans.1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%add7 = phi i32 [ 0, %entry ], [ %5, %for.end.loopexit ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int numCnt[100001];
int main() {
int n, a, ans = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &a);
if (a > 1e5)
ans++;
else
numCnt[a]++;
}
for (int i = 1; i <= 1e5; i++) {
if (numCnt[i] >= i) {
ans += numCnt[i] - i;
} else {
ans += numCnt[i];
}
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190306/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190306/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@numCnt = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = 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 %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, label %for.body, label %vector.ph
vector.ph: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.1, %for.inc ]
%1 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %ans.0.lcssa, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i64> [ <i64 1, i64 2, i64 3, i64 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %1, %vector.ph ], [ %12, %vector.body ]
%vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.ind47 = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next50, %vector.body ]
%step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%step.add48 = add <4 x i32> %vec.ind47, <i32 4, i32 4, i32 4, i32 4>
%offset.idx = or i64 %index, 1
%2 = getelementptr inbounds [100001 x i32], ptr @numCnt, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load51 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = sext <4 x i32> %wide.load to <4 x i64>
%5 = sext <4 x i32> %wide.load51 to <4 x i64>
%6 = icmp sgt <4 x i64> %vec.ind, %4
%7 = icmp sgt <4 x i64> %step.add, %5
%8 = select <4 x i1> %6, <4 x i32> zeroinitializer, <4 x i32> %vec.ind47
%9 = select <4 x i1> %7, <4 x i32> zeroinitializer, <4 x i32> %step.add48
%10 = add <4 x i32> %wide.load, %vec.phi
%11 = add <4 x i32> %wide.load51, %vec.phi46
%12 = sub <4 x i32> %10, %8
%13 = sub <4 x i32> %11, %9
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%vec.ind.next50 = add <4 x i32> %vec.ind47, <i32 8, i32 8, i32 8, i32 8>
%14 = icmp eq i64 %index.next, 100000
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %13, %12
%15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.041 = phi i32 [ %inc5, %for.inc ], [ 0, %entry ]
%ans.040 = phi i32 [ %ans.1, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%16 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %16, 100000
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %ans.040, 1
br label %for.inc
if.else: ; preds = %for.body
%idxprom = sext i32 %16 to i64
%arrayidx = getelementptr inbounds [100001 x i32], ptr @numCnt, i64 0, i64 %idxprom
%17 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc4 = add nsw i32 %17, 1
store i32 %inc4, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%ans.1 = phi i32 [ %inc, %if.then ], [ %ans.040, %if.else ]
%inc5 = add nuw nsw i32 %i.041, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc5, %18
br i1 %cmp, label %for.body, label %vector.ph, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
int main(void)
{
int x,y,label = 1;
scanf("%d%d",&x,&y);
while(x >=0&&y>=0)
{
if(label){
if(x >= 2&&y>=2)
{
x -= 2;
y -= 2;
}
else if(x == 1&&y >= 12)
{
x -= 1;
y -= 12;
}
else if(x == 0&& y >= 22)
{
y -= 22;
}
else
{
printf("Hanako\n");
break;
}}
else
{
if(y >= 22)
y -= 22;
else if(y >= 12&&x >= 1)
{
y -= 12;
x -= 1;
}
else if(y >= 2&& x >= 2)
{
y -= 2;
x -= 2;
}
else
{
printf("Ciel\n");
break;
}
}
label = !label;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19035/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19035/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Ciel\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"Hanako\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%x.promoted = load i32, ptr %x, align 4
%y.promoted = load i32, ptr %y, align 4
%cmp58 = icmp sgt i32 %x.promoted, -1
%cmp159 = icmp sgt i32 %y.promoted, -1
%0 = select i1 %cmp58, i1 %cmp159, i1 false
br i1 %0, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end45
%label.062 = phi i32 [ %lnot.ext, %if.end45 ], [ 1, %entry ]
%sub395561 = phi i32 [ %sub3954, %if.end45 ], [ %x.promoted, %entry ]
%sub385660 = phi i32 [ %sub3857, %if.end45 ], [ %y.promoted, %entry ]
%tobool.not = icmp eq i32 %label.062, 0
br i1 %tobool.not, label %if.else22, label %if.then
if.then: ; preds = %while.body
%cmp2 = icmp ugt i32 %sub395561, 1
%cmp3 = icmp ugt i32 %sub385660, 1
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %if.then4, label %if.else
if.then4: ; preds = %if.then
%sub = add nsw i32 %sub395561, -2
store i32 %sub, ptr %x, align 4, !tbaa !5
%sub5 = add nsw i32 %sub385660, -2
store i32 %sub5, ptr %y, align 4, !tbaa !5
br label %if.end45
if.else: ; preds = %if.then
%cmp6 = icmp eq i32 %sub395561, 1
%cmp8 = icmp ugt i32 %sub385660, 11
%or.cond47 = select i1 %cmp6, i1 %cmp8, i1 false
br i1 %or.cond47, label %if.then9, label %if.else12
if.then9: ; preds = %if.else
store i32 0, ptr %x, align 4, !tbaa !5
%sub11 = add nsw i32 %sub385660, -12
store i32 %sub11, ptr %y, align 4, !tbaa !5
br label %if.end45
if.else12: ; preds = %if.else
%cmp13 = icmp eq i32 %sub395561, 0
%cmp15 = icmp ugt i32 %sub385660, 21
%or.cond48 = select i1 %cmp13, i1 %cmp15, i1 false
br i1 %or.cond48, label %if.then16, label %while.end.sink.split
if.then16: ; preds = %if.else12
%sub17 = add nsw i32 %sub385660, -22
store i32 %sub17, ptr %y, align 4, !tbaa !5
br label %if.end45
if.else22: ; preds = %while.body
%cmp23 = icmp ugt i32 %sub385660, 21
br i1 %cmp23, label %if.then24, label %if.else26
if.then24: ; preds = %if.else22
%sub25 = add nsw i32 %sub385660, -22
store i32 %sub25, ptr %y, align 4, !tbaa !5
br label %if.end45
if.else26: ; preds = %if.else22
%cmp27 = icmp ugt i32 %sub385660, 11
%cmp29 = icmp ne i32 %sub395561, 0
%or.cond49 = and i1 %cmp29, %cmp27
br i1 %or.cond49, label %if.then30, label %if.else33
if.then30: ; preds = %if.else26
%sub31 = add nsw i32 %sub385660, -12
store i32 %sub31, ptr %y, align 4, !tbaa !5
%sub32 = add nsw i32 %sub395561, -1
store i32 %sub32, ptr %x, align 4, !tbaa !5
br label %if.end45
if.else33: ; preds = %if.else26
%cmp34 = icmp ugt i32 %sub385660, 1
%cmp36 = icmp ugt i32 %sub395561, 1
%or.cond50 = and i1 %cmp36, %cmp34
br i1 %or.cond50, label %if.then37, label %while.end.sink.split
if.then37: ; preds = %if.else33
%sub38 = add nsw i32 %sub385660, -2
store i32 %sub38, ptr %y, align 4, !tbaa !5
%sub39 = add nsw i32 %sub395561, -2
store i32 %sub39, ptr %x, align 4, !tbaa !5
br label %if.end45
if.end45: ; preds = %if.then24, %if.then37, %if.then30, %if.then4, %if.then16, %if.then9
%sub3857 = phi i32 [ %sub25, %if.then24 ], [ %sub38, %if.then37 ], [ %sub31, %if.then30 ], [ %sub5, %if.then4 ], [ %sub17, %if.then16 ], [ %sub11, %if.then9 ]
%sub3954 = phi i32 [ %sub395561, %if.then24 ], [ %sub39, %if.then37 ], [ %sub32, %if.then30 ], [ %sub, %if.then4 ], [ 0, %if.then16 ], [ 0, %if.then9 ]
%lnot.ext = xor i32 %label.062, 1
%cmp = icmp sgt i32 %sub3954, -1
%cmp1 = icmp sgt i32 %sub3857, -1
%1 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %1, label %while.body, label %while.end, !llvm.loop !9
while.end.sink.split: ; preds = %if.else33, %if.else12
%str.sink = phi ptr [ @str.3, %if.else12 ], [ @str, %if.else33 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
br label %while.end
while.end: ; preds = %if.end45, %while.end.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define ll long long
ll M=998244353;
ll fact[300001],ifact[300001];
ll mpow(ll x,ll n){
ll ans=1;
while(n != 0){
if(n&1) ans=ans*x%M;
x=x*x%M;
n=n>>1;
}
return ans;
}
ll combi(ll n,ll x){
if(n==0&&x==0)return 1;
if(n<x||n<0)return 0;
return fact[n]*ifact[n-x]%M*ifact[x]%M;
}
int main(){
ll i,n,a,b,k,j,ans;
scanf("%lld %lld %lld %lld",&n,&a,&b,&k);
fact[0]=1;
ifact[0]=1;
for(i=1;i<=n;i++){
fact[i]=fact[i-1]*(i)%M;
ifact[i]=ifact[i-1]*mpow(i,M-2)%M;
}
for(i=0;i<=n;i++){
ll j=(k-i*a)/b;
if(0<=j&&j<=n&&i*a+j*b==k)ans=(ans+combi(n,i)*combi(n,j))%M;
}
printf("%lld",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190393/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190393/source.c"
target datalayout = "e-m:e-p270: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 i64 998244353, align 8
@fact = dso_local local_unnamed_addr global [300001 x i64] zeroinitializer, align 16
@ifact = dso_local local_unnamed_addr global [300001 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [20 x i8] c"%lld %lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @mpow(i64 noundef %x, i64 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not8 = icmp eq i64 %n, 0
br i1 %cmp.not8, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%0 = load i64, ptr @M, align 8
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%ans.011 = phi i64 [ 1, %while.body.lr.ph ], [ %ans.1, %if.end ]
%n.addr.010 = phi i64 [ %n, %while.body.lr.ph ], [ %shr, %if.end ]
%x.addr.09 = phi i64 [ %x, %while.body.lr.ph ], [ %rem2, %if.end ]
%and = and i64 %n.addr.010, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul nsw i64 %ans.011, %x.addr.09
%rem = srem i64 %mul, %0
br label %if.end
if.end: ; preds = %if.then, %while.body
%ans.1 = phi i64 [ %rem, %if.then ], [ %ans.011, %while.body ]
%mul1 = mul nsw i64 %x.addr.09, %x.addr.09
%rem2 = srem i64 %mul1, %0
%shr = ashr i64 %n.addr.010, 1
%cmp.not = icmp ult i64 %n.addr.010, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %ans.1, %if.end ]
ret i64 %ans.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: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @combi(i64 noundef %n, i64 noundef %x) local_unnamed_addr #2 {
entry:
%0 = or i64 %x, %n
%or.cond = icmp eq i64 %0, 0
br i1 %or.cond, label %return, label %if.end
if.end: ; preds = %entry
%cmp2 = icmp slt i64 %n, %x
%cmp3 = icmp slt i64 %n, 0
%or.cond10 = or i1 %cmp3, %cmp2
br i1 %or.cond10, label %return, label %if.end5
if.end5: ; preds = %if.end
%arrayidx = getelementptr inbounds [300001 x i64], ptr @fact, i64 0, i64 %n
%1 = load i64, ptr %arrayidx, align 8, !tbaa !7
%sub = sub nsw i64 %n, %x
%arrayidx6 = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx6, align 8, !tbaa !7
%mul = mul nsw i64 %2, %1
%3 = load i64, ptr @M, align 8, !tbaa !7
%rem = srem i64 %mul, %3
%arrayidx7 = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %x
%4 = load i64, ptr %arrayidx7, align 8, !tbaa !7
%mul8 = mul nsw i64 %4, %rem
%rem9 = srem i64 %mul8, %3
br label %return
return: ; preds = %if.end, %entry, %if.end5
%retval.0 = phi i64 [ %rem9, %if.end5 ], [ 1, %entry ], [ 0, %if.end ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %k)
store i64 1, ptr @fact, align 16, !tbaa !7
store i64 1, ptr @ifact, align 16, !tbaa !7
%0 = load i64, ptr %n, align 8, !tbaa !7
%cmp.not65 = icmp slt i64 %0, 1
%.pre = load i64, ptr @M, align 8
br i1 %cmp.not65, label %for.cond9.preheader, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%sub4 = add nsw i64 %.pre, -2
%cmp.not8.i = icmp eq i64 %sub4, 0
br i1 %cmp.not8.i, label %for.body.us, label %for.body
for.body.us: ; preds = %for.body.lr.ph, %for.body.us
%1 = phi i64 [ %rem7.us, %for.body.us ], [ 1, %for.body.lr.ph ]
%2 = phi i64 [ %rem.us, %for.body.us ], [ 1, %for.body.lr.ph ]
%i.066.us = phi i64 [ %inc.us, %for.body.us ], [ 1, %for.body.lr.ph ]
%mul.us = mul nsw i64 %2, %i.066.us
%rem.us = srem i64 %mul.us, %.pre
%arrayidx1.us = getelementptr inbounds [300001 x i64], ptr @fact, i64 0, i64 %i.066.us
store i64 %rem.us, ptr %arrayidx1.us, align 8, !tbaa !7
%rem7.us = srem i64 %1, %.pre
%arrayidx8.us = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %i.066.us
store i64 %rem7.us, ptr %arrayidx8.us, align 8, !tbaa !7
%inc.us = add nuw i64 %i.066.us, 1
%exitcond73.not = icmp eq i64 %i.066.us, %0
br i1 %exitcond73.not, label %for.cond9.preheader, label %for.body.us, !llvm.loop !11
for.cond9.preheader: ; preds = %mpow.exit.loopexit, %for.body.us, %entry
%cmp10.not67 = icmp sgt i64 %0, -1
call void @llvm.assume(i1 %cmp10.not67)
%3 = load i64, ptr %k, align 8, !tbaa !7
%4 = load i64, ptr %a, align 8, !tbaa !7
%5 = load i64, ptr %b, align 8, !tbaa !7
%arrayidx.i = getelementptr inbounds [300001 x i64], ptr @fact, i64 0, i64 %0
br label %for.body11
for.body: ; preds = %for.body.lr.ph, %mpow.exit.loopexit
%6 = phi i64 [ %rem7, %mpow.exit.loopexit ], [ 1, %for.body.lr.ph ]
%7 = phi i64 [ %rem, %mpow.exit.loopexit ], [ 1, %for.body.lr.ph ]
%i.066 = phi i64 [ %inc, %mpow.exit.loopexit ], [ 1, %for.body.lr.ph ]
%mul = mul nsw i64 %7, %i.066
%rem = srem i64 %mul, %.pre
%arrayidx1 = getelementptr inbounds [300001 x i64], ptr @fact, i64 0, i64 %i.066
store i64 %rem, ptr %arrayidx1, align 8, !tbaa !7
br label %while.body.i
while.body.i: ; preds = %for.body, %if.end.i
%ans.011.i = phi i64 [ %ans.1.i, %if.end.i ], [ 1, %for.body ]
%n.addr.010.i = phi i64 [ %shr.i, %if.end.i ], [ %sub4, %for.body ]
%x.addr.09.i = phi i64 [ %rem2.i, %if.end.i ], [ %i.066, %for.body ]
%and.i = and i64 %n.addr.010.i, 1
%tobool.not.i = icmp eq i64 %and.i, 0
br i1 %tobool.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul nsw i64 %x.addr.09.i, %ans.011.i
%rem.i = srem i64 %mul.i, %.pre
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%ans.1.i = phi i64 [ %rem.i, %if.then.i ], [ %ans.011.i, %while.body.i ]
%mul1.i = mul nsw i64 %x.addr.09.i, %x.addr.09.i
%rem2.i = srem i64 %mul1.i, %.pre
%shr.i = ashr i64 %n.addr.010.i, 1
%cmp.not.i = icmp ult i64 %n.addr.010.i, 2
br i1 %cmp.not.i, label %mpow.exit.loopexit, label %while.body.i, !llvm.loop !5
mpow.exit.loopexit: ; preds = %if.end.i
%mul6 = mul nsw i64 %ans.1.i, %6
%rem7 = srem i64 %mul6, %.pre
%arrayidx8 = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %i.066
store i64 %rem7, ptr %arrayidx8, align 8, !tbaa !7
%inc = add nuw i64 %i.066, 1
%exitcond.not = icmp eq i64 %i.066, %0
br i1 %exitcond.not, label %for.cond9.preheader, label %for.body, !llvm.loop !11
for.body11: ; preds = %for.cond9.preheader, %if.end
%i.169 = phi i64 [ 0, %for.cond9.preheader ], [ %inc27, %if.end ]
%ans.068 = phi i64 [ undef, %for.cond9.preheader ], [ %ans.1, %if.end ]
%mul13 = mul nsw i64 %4, %i.169
%sub14 = sub nsw i64 %3, %mul13
%div = sdiv i64 %sub14, %5
%or.cond = icmp ugt i64 %div, %0
br i1 %or.cond, label %if.end, label %land.lhs.true17
land.lhs.true17: ; preds = %for.body11
%mul19 = mul nsw i64 %div, %5
%add = add nsw i64 %mul19, %mul13
%cmp20 = icmp eq i64 %add, %3
br i1 %cmp20, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true17
%8 = or i64 %i.169, %0
%or.cond.i = icmp eq i64 %8, 0
br i1 %or.cond.i, label %combi.exit, label %if.end.i46
if.end.i46: ; preds = %if.then
%9 = load i64, ptr %arrayidx.i, align 8, !tbaa !7
%sub.i = sub nsw i64 %0, %i.169
%arrayidx6.i = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %sub.i
%10 = load i64, ptr %arrayidx6.i, align 8, !tbaa !7
%mul.i47 = mul nsw i64 %10, %9
%rem.i48 = srem i64 %mul.i47, %.pre
%arrayidx7.i = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %i.169
%11 = load i64, ptr %arrayidx7.i, align 8, !tbaa !7
%mul8.i = mul nsw i64 %11, %rem.i48
%rem9.i = srem i64 %mul8.i, %.pre
br label %combi.exit
combi.exit: ; preds = %if.then, %if.end.i46
%retval.0.i = phi i64 [ %rem9.i, %if.end.i46 ], [ 1, %if.then ]
%12 = or i64 %div, %0
%or.cond.i49 = icmp eq i64 %12, 0
br i1 %or.cond.i49, label %combi.exit64, label %if.end.i50
if.end.i50: ; preds = %combi.exit
%13 = load i64, ptr %arrayidx.i, align 8, !tbaa !7
%sub.i56 = sub nsw i64 %0, %div
%arrayidx6.i57 = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %sub.i56
%14 = load i64, ptr %arrayidx6.i57, align 8, !tbaa !7
%mul.i58 = mul nsw i64 %14, %13
%rem.i59 = srem i64 %mul.i58, %.pre
%arrayidx7.i60 = getelementptr inbounds [300001 x i64], ptr @ifact, i64 0, i64 %div
%15 = load i64, ptr %arrayidx7.i60, align 8, !tbaa !7
%mul8.i61 = mul nsw i64 %15, %rem.i59
%rem9.i62 = srem i64 %mul8.i61, %.pre
br label %combi.exit64
combi.exit64: ; preds = %combi.exit, %if.end.i50
%retval.0.i63 = phi i64 [ %rem9.i62, %if.end.i50 ], [ 1, %combi.exit ]
%mul23 = mul nsw i64 %retval.0.i63, %retval.0.i
%add24 = add nsw i64 %mul23, %ans.068
%rem25 = srem i64 %add24, %.pre
br label %if.end
if.end: ; preds = %combi.exit64, %land.lhs.true17, %for.body11
%ans.1 = phi i64 [ %rem25, %combi.exit64 ], [ %ans.068, %land.lhs.true17 ], [ %ans.068, %for.body11 ]
%inc27 = add nuw i64 %i.169, 1
%exitcond74.not = icmp eq i64 %i.169, %0
br i1 %exitcond74.not, label %for.end28, label %for.body11, !llvm.loop !12
for.end28: ; preds = %if.end
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 willreturn memory(inaccessiblemem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
|
#include <stdio.h>
int main(){
int A,B;
scanf("%d %d",&A,&B);
if((A+B)%2==0){
printf("%d\n",(A+B)/2);
}else{
printf("IMPOSSIBLE\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190443/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190443/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = and i32 %add, 1
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %add, 2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: 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()
{
long long int a,b,r,d,v,u,l,c=0,t,k,n,i,j;
scanf("%lld%lld",&a,&b);
if((a+b)%2==0){printf("%lld\n",(a+b)/2);}
else{printf("IMPOSSIBLE\n");}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190487/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190487/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%2 = and i64 %add, 1
%cmp = icmp eq i64 %2, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i64 %add, 2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
long a,b;
scanf("%ld %ld", &a, &b);
long sum = a+b;
if (sum%2 != 0) {
printf("IMPOSSIBLE\n");
} else {
printf("%ld\n", sum/2);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190544/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190544/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%2 = and i64 %add, 1
%cmp.not = icmp eq i64 %2, 0
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%div = sdiv i64 %add, 2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
long int a,b,res1,res2,k;
scanf("%ld %ld",&a,&b);
k=(a+b)/2;
res1=abs(a-k);
res2=abs(b-k);
if(res1==res2){
printf("%ld\n",k);
}
else {
printf("IMPOSSIBLE\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190595/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190595/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%div = sdiv i64 %add, 2
%sub = sub nsw i64 %0, %div
%conv = trunc i64 %sub to i32
%2 = call i32 @llvm.abs.i32(i32 %conv, i1 true)
%sub2 = sub nsw i64 %1, %div
%conv3 = trunc i64 %sub2 to i32
%3 = call i32 @llvm.abs.i32(i32 %conv3, i1 true)
%cmp = icmp eq i32 %2, %3
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
long a,b;
scanf("%ld %ld",&a,&b);
if((a +b)%2 ==0)
{
printf("%ld",(a+b)/2);
}
else
{
printf("IMPOSSIBLE");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190638/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190638/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%2 = and i64 %add, 1
%cmp = icmp eq i64 %2, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i64 %add, 2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
long long int a,b,c,des;
scanf("%lld %lld",&a,&b);
if(b>a)
des=b-a;
else
des=a-b;
if(des%2==1)
printf("IMPOSSIBLE\n");
else
{
if(b>a)
c=a+des/2;
else
c=b+des/2;
printf("%d\n",c);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190696/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190696/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%2 = and i64 %sub, 1
%cmp2.not = icmp eq i64 %2, 0
br i1 %cmp2.not, label %if.else5, label %if.then3
if.then3: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end13
if.else5: ; preds = %entry
%sub.sub1 = call i64 @llvm.abs.i64(i64 %sub, i1 true)
%. = call i64 @llvm.smin.i64(i64 %0, i64 %1)
%div920 = lshr i64 %sub.sub1, 1
%add10 = add nsw i64 %div920, %.
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add10)
br label %if.end13
if.end13: ; preds = %if.else5, %if.then3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int A,B;
scanf("%d %d",&A,&B);
if((A-B)%2==0){
printf("%d\n",(A+B)/2);
}
else{
printf("IMPOSSIBLE\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190739/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190739/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = and i32 %sub, 1
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int a,b,k;
scanf("%d%d",&a,&b);
k=(a+b)/2;
if(abs(a-k)==abs(b-k))
printf("%d\n",k);
else
printf("IMPOSSIBLE\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190782/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190782/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #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
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%sub = sub nsw i32 %0, %div
%2 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%sub1 = sub nsw i32 %1, %div
%3 = call i32 @llvm.abs.i32(i32 %sub1, i1 true)
%cmp = icmp eq i32 %2, %3
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int A,B;
int ans = -1;
scanf("%d%d",&A,&B);
ans=A+B;
if(ans%2==0){
ans=ans/2;
printf("%d\n",ans);
}
else
printf("IMPOSSIBLE\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190825/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190825/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = and i32 %add, 1
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %add, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end
if.else: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main()
{
int i;
int A, B;
scanf("%d", &A);
scanf("%d", &B);
for(i=0; i<=1000000000; i++){
if(abs(A-i) == abs(B-i)){
printf("%d", i);
break;
}
if(i==1000000000){
printf("IMPOSSIBLE");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190869/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190869/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%2 = call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = call i32 @llvm.abs.i32(i32 %1, i1 true)
%cmp321 = icmp eq i32 %2, %3
br i1 %cmp321, label %if.then, label %if.end
if.then: ; preds = %for.inc, %for.inc.1, %entry
%i.015.lcssa = phi i32 [ 0, %entry ], [ %inc, %for.inc ], [ %inc.1, %for.inc.1 ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.015.lcssa)
br label %for.end
if.end: ; preds = %entry, %for.inc.1
%i.01522 = phi i32 [ %inc.1, %for.inc.1 ], [ 0, %entry ]
%cmp5 = icmp eq i32 %i.01522, 1000000000
br i1 %cmp5, label %for.end.loopexit, label %for.inc
for.inc: ; preds = %if.end
%inc = or i32 %i.01522, 1
%sub = sub nsw i32 %0, %inc
%4 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%sub2 = sub nsw i32 %1, %inc
%5 = call i32 @llvm.abs.i32(i32 %sub2, i1 true)
%cmp3 = icmp eq i32 %4, %5
br i1 %cmp3, label %if.then, label %for.inc.1
for.inc.1: ; preds = %for.inc
%inc.1 = add nuw nsw i32 %i.01522, 2
%sub.1 = sub nsw i32 %0, %inc.1
%6 = call i32 @llvm.abs.i32(i32 %sub.1, i1 true)
%sub2.1 = sub nsw i32 %1, %inc.1
%7 = call i32 @llvm.abs.i32(i32 %sub2.1, i1 true)
%cmp3.1 = icmp eq i32 %6, %7
br i1 %cmp3.1, label %if.then, label %if.end
for.end.loopexit: ; preds = %if.end
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %for.end
for.end: ; preds = %for.end.loopexit, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree 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 rep( i, n ) for(((i) = 0); ((i) < (n)); ((i)++))
int main(void)
{
long a,b;
scanf("%ld %ld\n", &a, &b);
if((a+b)%2 == 0)
{
printf("%ld\n", labs((a+b)/2));
}
else
{
printf("IMPOSSIBLE");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190911/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190911/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld %ld\0A\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %1, %0
%2 = and i64 %add, 1
%cmp = icmp eq i64 %2, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i64 %add, 2
%3 = call i64 @llvm.abs.i64(i64 %div, i1 true)
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %3)
br label %if.end
if.else: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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"}
|
#include<stdio.h>
int main(void){
int A,B;
scanf("%d%d",&A,&B);
long K;
if((A+B)%2==1){
printf("IMPOSSIBLE");
}else{
K=A+B;
K/=2;
printf("%ld",K);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_190962/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_190962/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"IMPOSSIBLE\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = and i32 %add, -2147483647
%cmp = icmp eq i32 %2, 1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
%3 = sdiv i32 %add, 2
%div = sext i32 %3 to i64
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int n, max_weight,*arr;
int max(int x, int y)
{
return x>y ? x : y;
}
int knapsack()
{
int i,j,mem[max_weight+1];
memset(mem,0,sizeof(mem));
for(i=0; i<=max_weight; i++)
{
for(j=0; j<n; j++)
{
if(i >= arr[n+j]) mem[i] = max(mem[i],mem[i-arr[n+j]]+arr[j]);
}
}
return mem[max_weight];
}
int main()
{
//freopen("input.txt","r",stdin);
scanf("%d %d",&n,&max_weight);
arr = (int*)malloc(sizeof(int)*n*2);
for(int i=0; i<n; i++)
{
scanf("%d %d",&arr[i],&arr[i+n]);
}
printf("%d\n",knapsack());
free(arr);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191004/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191004/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@max_weight = dso_local global i32 0, align 4
@n = dso_local global i32 0, align 4
@arr = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
ret i32 %cond
}
; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @knapsack() local_unnamed_addr #1 {
entry:
%0 = load i32, ptr @max_weight, align 4, !tbaa !5
%add = add i32 %0, 1
%1 = zext i32 %add to i64
%vla = alloca i32, i64 %1, align 16
%2 = shl nuw nsw i64 %1, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 0, i64 %2, i1 false)
%cmp.not36 = icmp slt i32 %0, 0
br i1 %cmp.not36, label %for.end20, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%3 = load i32, ptr @n, align 4, !tbaa !5
%cmp234 = icmp sgt i32 %3, 0
%4 = load ptr, ptr @arr, align 8
br i1 %cmp234, label %for.cond1.preheader.us.preheader, label %for.end20
for.cond1.preheader.us.preheader: ; preds = %for.cond1.preheader.lr.ph
%5 = zext i32 %3 to i64
%wide.trip.count = zext i32 %3 to i64
%invariant.gep = getelementptr i32, ptr %4, i64 %5
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc18_crit_edge.us
%indvars.iv41 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next42, %for.cond1.for.inc18_crit_edge.us ]
%arrayidx7.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv41
%6 = trunc i64 %indvars.iv41 to i32
br label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.inc.us
%indvars.iv = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next, %for.inc.us ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%7 = load i32, ptr %gep, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp5.not.us = icmp slt i64 %indvars.iv41, %8
br i1 %cmp5.not.us, label %for.inc.us, label %if.then.us
if.then.us: ; preds = %for.body3.us
%9 = load i32, ptr %arrayidx7.us, align 4, !tbaa !5
%sub.us = sub nsw i32 %6, %7
%idxprom11.us = sext i32 %sub.us to i64
%arrayidx12.us = getelementptr inbounds i32, ptr %vla, i64 %idxprom11.us
%10 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5
%arrayidx14.us = getelementptr inbounds i32, ptr %4, i64 %indvars.iv
%11 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5
%add15.us = add nsw i32 %11, %10
%cond.i.us = tail call i32 @llvm.smax.i32(i32 %9, i32 %add15.us)
store i32 %cond.i.us, ptr %arrayidx7.us, align 4, !tbaa !5
br label %for.inc.us
for.inc.us: ; preds = %if.then.us, %for.body3.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.for.inc18_crit_edge.us, label %for.body3.us, !llvm.loop !9
for.cond1.for.inc18_crit_edge.us: ; preds = %for.inc.us
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%exitcond45.not = icmp eq i64 %indvars.iv.next42, %1
br i1 %exitcond45.not, label %for.end20, label %for.cond1.preheader.us, !llvm.loop !11
for.end20: ; preds = %for.cond1.for.inc18_crit_edge.us, %for.cond1.preheader.lr.ph, %entry
%idxprom21 = sext i32 %0 to i64
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %idxprom21
%12 = load i32, ptr %arrayidx22, align 4, !tbaa !5
ret i32 %12
}
; 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: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @max_weight)
%0 = load i32, ptr @n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul1 = shl nsw i64 %conv, 3
%call2 = tail call noalias ptr @malloc(i64 noundef %mul1) #8
store ptr %call2, ptr @arr, align 8, !tbaa !12
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%call7 = tail call i32 @knapsack()
%call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call7)
%1 = load ptr, ptr @arr, align 8, !tbaa !12
tail call void @free(ptr noundef %1) #9
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%2 = phi i32 [ %5, %for.body ], [ %0, %entry ]
%3 = load ptr, ptr @arr, align 8, !tbaa !12
%arrayidx = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
%add = add nsw i32 %2, %4
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds i32, ptr %3, i64 %idxprom4
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx, ptr noundef %arrayidx5)
%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.cond.cleanup, !llvm.loop !14
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
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(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 nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-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 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 #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
|
#include <stdio.h> // printf(), scanf()
#include <string.h> // strlen()
#include <stdbool.h>
int
main(int argc, char** argv)
{
char roman[7] = "MDCLXVI";
int arabic[7] = {1000, 500, 100, 50, 10, 5, 1};
char str[101];
int i, j;
while (true)
{
if (scanf("%s", str) == EOF)
break;
int n = 0;
for (i = 0; i < strlen(str); ++i)
{
for (j = 0; j < 7; ++j)
{
if (str[i] == roman[j])
{
n += arabic[j];
if (i >= 1 && j < 7 - 1 && str[i - 1] == roman[j + 1])
n -= arabic[j + 1] * 2;
else if (i >= 1 && j + 2 < 7 && str[i - 1] == roman[j + 2])
n -= arabic[j + 2] * 2;
}
}
}
printf("%d\n", n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191077/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191077/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%str = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str) #4
%call92 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%cmp93 = icmp eq i32 %call92, -1
br i1 %cmp93, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end65
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #5
%cmp388.not = icmp eq i64 %call2, 0
br i1 %cmp388.not, label %for.end65, label %for.body8.us.preheader.peel
for.body8.us.preheader.peel: ; preds = %for.cond.preheader
%0 = load i8, ptr %str, align 16, !tbaa !5
switch i8 %0, label %for.inc63.peel.fold.split [
i8 77, label %for.inc63.peel
i8 68, label %if.then15.us.1.peel
i8 67, label %for.inc.us.2.peel.thread
i8 76, label %if.then15.us.3.peel
i8 88, label %if.then15.us.4.peel
i8 86, label %for.inc.us.5.peel.thread
i8 73, label %if.then15.us.6.peel
]
if.then15.us.1.peel: ; preds = %for.body8.us.preheader.peel
br label %for.inc63.peel
for.inc.us.2.peel.thread: ; preds = %for.body8.us.preheader.peel
br label %for.inc63.peel
if.then15.us.3.peel: ; preds = %for.body8.us.preheader.peel
br label %for.inc63.peel
if.then15.us.4.peel: ; preds = %for.body8.us.preheader.peel
br label %for.inc63.peel
for.inc.us.5.peel.thread: ; preds = %for.body8.us.preheader.peel
br label %for.inc63.peel
if.then15.us.6.peel: ; preds = %for.body8.us.preheader.peel
br label %for.inc63.peel
for.inc63.peel.fold.split: ; preds = %for.body8.us.preheader.peel
br label %for.inc63.peel
for.inc63.peel: ; preds = %for.body8.us.preheader.peel, %for.inc63.peel.fold.split, %if.then15.us.1.peel, %if.then15.us.4.peel, %for.inc.us.2.peel.thread, %if.then15.us.3.peel, %if.then15.us.6.peel, %for.inc.us.5.peel.thread
%n.2.us.6.peel = phi i32 [ 1, %if.then15.us.6.peel ], [ 5, %for.inc.us.5.peel.thread ], [ 50, %if.then15.us.3.peel ], [ 100, %for.inc.us.2.peel.thread ], [ 10, %if.then15.us.4.peel ], [ 500, %if.then15.us.1.peel ], [ 1000, %for.body8.us.preheader.peel ], [ 0, %for.inc63.peel.fold.split ]
%cmp3.peel = icmp ugt i64 %call2, 1
br i1 %cmp3.peel, label %for.cond5.preheader, label %for.end65
for.cond5.preheader: ; preds = %for.inc63.peel, %for.inc63
%conv91 = phi i64 [ %conv, %for.inc63 ], [ 1, %for.inc63.peel ]
%n.090 = phi i32 [ %.us-phi, %for.inc63 ], [ %n.2.us.6.peel, %for.inc63.peel ]
%i.089 = phi i32 [ %inc64, %for.inc63 ], [ 1, %for.inc63.peel ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %conv91
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp18.not = icmp eq i32 %i.089, 0
%sub = add nsw i32 %i.089, -1
%idxprom23 = zext i32 %sub to i64
%arrayidx24 = getelementptr inbounds [101 x i8], ptr %str, i64 0, i64 %idxprom23
%cmp13.us = icmp eq i8 %1, 77
br i1 %cmp18.not, label %for.body8.us.preheader, label %for.body8.preheader
for.body8.preheader: ; preds = %for.cond5.preheader
br i1 %cmp13.us, label %land.lhs.true22, label %for.inc
for.body8.us.preheader: ; preds = %for.cond5.preheader
br i1 %cmp13.us, label %for.inc.us.thread, label %for.inc.us
for.inc.us.thread: ; preds = %for.body8.us.preheader
%add.us = add nsw i32 %n.090, 1000
br label %for.inc63
for.inc.us: ; preds = %for.body8.us.preheader
switch i8 %1, label %for.inc63 [
i8 68, label %if.then15.us.1
i8 67, label %for.inc.us.2.thread
i8 76, label %if.then15.us.3
i8 88, label %if.then15.us.4
i8 86, label %for.inc.us.5.thread
i8 73, label %if.then15.us.6
]
if.then15.us.1: ; preds = %for.inc.us
%add.us.1 = add nsw i32 %n.090, 500
br label %for.inc63
for.inc.us.2.thread: ; preds = %for.inc.us
%add.us.2 = add nsw i32 %n.090, 100
br label %for.inc63
if.then15.us.3: ; preds = %for.inc.us
%add.us.3 = add nsw i32 %n.090, 50
br label %for.inc63
if.then15.us.4: ; preds = %for.inc.us
%add.us.4 = add nsw i32 %n.090, 10
br label %for.inc63
for.inc.us.5.thread: ; preds = %for.inc.us
%add.us.5 = add nsw i32 %n.090, 5
br label %for.inc63
if.then15.us.6: ; preds = %for.inc.us
%add.us.6 = add nsw i32 %n.090, 1
br label %for.inc63
land.lhs.true22: ; preds = %for.body8.preheader
%2 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp30 = icmp eq i8 %2, 68
br i1 %cmp30, label %for.inc63, label %land.lhs.true43
land.lhs.true43: ; preds = %land.lhs.true22
%3 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp52 = icmp eq i8 %3, 67
%spec.select.v = select i1 %cmp52, i32 800, i32 1000
%spec.select = add nsw i32 %n.090, %spec.select.v
br label %for.inc63
for.inc: ; preds = %for.body8.preheader
switch i8 %1, label %for.inc63 [
i8 68, label %land.lhs.true22.1
i8 67, label %land.lhs.true22.2
i8 76, label %land.lhs.true22.3
i8 88, label %land.lhs.true22.4
i8 86, label %land.lhs.true22.5
i8 73, label %if.else.6
]
land.lhs.true22.1: ; preds = %for.inc
%4 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp30.1 = icmp eq i8 %4, 67
br i1 %cmp30.1, label %if.then32.1, label %land.lhs.true43.1
land.lhs.true43.1: ; preds = %land.lhs.true22.1
%5 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp52.1 = icmp eq i8 %5, 76
%spec.select186.v = select i1 %cmp52.1, i32 400, i32 500
%spec.select186 = add nsw i32 %n.090, %spec.select186.v
br label %for.inc63
if.then32.1: ; preds = %land.lhs.true22.1
%sub36.1 = add nsw i32 %n.090, 300
br label %for.inc63
land.lhs.true22.2: ; preds = %for.inc
%6 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp30.2 = icmp eq i8 %6, 76
br i1 %cmp30.2, label %for.inc63, label %land.lhs.true43.2
land.lhs.true43.2: ; preds = %land.lhs.true22.2
%7 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp52.2 = icmp eq i8 %7, 88
%spec.select187.v = select i1 %cmp52.2, i32 80, i32 100
%spec.select187 = add nsw i32 %n.090, %spec.select187.v
br label %for.inc63
land.lhs.true22.3: ; preds = %for.inc
%8 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp30.3 = icmp eq i8 %8, 88
br i1 %cmp30.3, label %if.then32.3, label %land.lhs.true43.3
land.lhs.true43.3: ; preds = %land.lhs.true22.3
%9 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp52.3 = icmp eq i8 %9, 86
%spec.select188.v = select i1 %cmp52.3, i32 40, i32 50
%spec.select188 = add nsw i32 %n.090, %spec.select188.v
br label %for.inc63
if.then32.3: ; preds = %land.lhs.true22.3
%sub36.3 = add nsw i32 %n.090, 30
br label %for.inc63
land.lhs.true22.4: ; preds = %for.inc
%10 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp30.4 = icmp eq i8 %10, 86
br i1 %cmp30.4, label %for.inc63, label %land.lhs.true43.4
land.lhs.true43.4: ; preds = %land.lhs.true22.4
%11 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp52.4 = icmp eq i8 %11, 73
%spec.select189.v = select i1 %cmp52.4, i32 8, i32 10
%spec.select189 = add nsw i32 %n.090, %spec.select189.v
br label %for.inc63
land.lhs.true22.5: ; preds = %for.inc
%12 = load i8, ptr %arrayidx24, align 1, !tbaa !5
%cmp30.5 = icmp eq i8 %12, 73
%spec.select190.v = select i1 %cmp30.5, i32 3, i32 5
%spec.select190 = add nsw i32 %n.090, %spec.select190.v
br label %for.inc63
if.else.6: ; preds = %for.inc
%add.6 = add nsw i32 %n.090, 1
br label %for.inc63
for.inc63: ; preds = %land.lhs.true22.5, %land.lhs.true43.4, %land.lhs.true43.3, %land.lhs.true43.2, %land.lhs.true43.1, %land.lhs.true43, %for.inc, %for.inc.us, %land.lhs.true22, %if.then32.1, %if.then15.us.1, %for.inc.us.thread, %land.lhs.true22.4, %if.then32.3, %land.lhs.true22.2, %if.then15.us.4, %for.inc.us.2.thread, %if.then15.us.3, %if.else.6, %if.then15.us.6, %for.inc.us.5.thread
%.us-phi = phi i32 [ %add.us.6, %if.then15.us.6 ], [ %add.us.5, %for.inc.us.5.thread ], [ %add.6, %if.else.6 ], [ %add.us.3, %if.then15.us.3 ], [ %add.us.2, %for.inc.us.2.thread ], [ %add.us.4, %if.then15.us.4 ], [ %n.090, %land.lhs.true22.2 ], [ %sub36.3, %if.then32.3 ], [ %n.090, %land.lhs.true22.4 ], [ %add.us, %for.inc.us.thread ], [ %add.us.1, %if.then15.us.1 ], [ %sub36.1, %if.then32.1 ], [ %n.090, %land.lhs.true22 ], [ %n.090, %for.inc.us ], [ %spec.select, %land.lhs.true43 ], [ %spec.select186, %land.lhs.true43.1 ], [ %spec.select187, %land.lhs.true43.2 ], [ %spec.select188, %land.lhs.true43.3 ], [ %spec.select189, %land.lhs.true43.4 ], [ %spec.select190, %land.lhs.true22.5 ], [ %n.090, %for.inc ]
%inc64 = add i32 %i.089, 1
%conv = zext i32 %inc64 to i64
%cmp3 = icmp ugt i64 %call2, %conv
br i1 %cmp3, label %for.cond5.preheader, label %for.end65, !llvm.loop !8
for.end65: ; preds = %for.inc63, %for.inc63.peel, %for.cond.preheader
%n.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %n.2.us.6.peel, %for.inc63.peel ], [ %.us-phi, %for.inc63 ]
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%cmp = icmp eq i32 %call, -1
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end65, %entry
call void @llvm.lifetime.end.p0(i64 101, 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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#include <math.h>
int convert(char x){
switch(x){
case 'I':return 1;
case 'V':return 5;
case 'X':return 10;
case 'L':return 50;
case 'C':return 100;
case 'D':return 500;
case 'M':return 1000;
default: return 0;
}
}
int main(void){
char arb[101];
int i,a,b,ans;
while(scanf("%s",arb)!=EOF){
i=0;ans=0;
a=convert(arb[0]);
while(1){
b=convert(arb[i+1]);
if(a<b)ans-=a; else ans+=a;
if(b==0)break; else {a=b;i++;}
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191127/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191127/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @convert(i8 noundef signext %x) local_unnamed_addr #0 {
entry:
%conv = sext i8 %x to i32
switch i32 %conv, label %sw.default [
i32 73, label %return
i32 86, label %sw.bb1
i32 88, label %sw.bb2
i32 76, label %sw.bb3
i32 67, label %sw.bb4
i32 68, label %sw.bb5
i32 77, label %sw.bb6
]
sw.bb1: ; preds = %entry
br label %return
sw.bb2: ; preds = %entry
br label %return
sw.bb3: ; preds = %entry
br label %return
sw.bb4: ; preds = %entry
br label %return
sw.bb5: ; preds = %entry
br label %return
sw.bb6: ; preds = %entry
br label %return
sw.default: ; preds = %entry
br label %return
return: ; preds = %entry, %sw.default, %sw.bb6, %sw.bb5, %sw.bb4, %sw.bb3, %sw.bb2, %sw.bb1
%retval.0 = phi i32 [ 0, %sw.default ], [ 1000, %sw.bb6 ], [ 500, %sw.bb5 ], [ 100, %sw.bb4 ], [ 50, %sw.bb3 ], [ 10, %sw.bb2 ], [ 5, %sw.bb1 ], [ 1, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%arb = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %arb) #4
%call38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arb)
%cmp.not39 = icmp eq i32 %call38, -1
br i1 %cmp.not39, label %while.end13, label %while.body
while.body: ; preds = %entry, %while.end
%0 = load i8, ptr %arb, align 16, !tbaa !5
%conv.i = sext i8 %0 to i32
switch i32 %conv.i, label %sw.default.i [
i32 73, label %while.cond2.preheader
i32 86, label %sw.bb1.i
i32 88, label %sw.bb2.i
i32 76, label %sw.bb3.i
i32 67, label %sw.bb4.i
i32 68, label %sw.bb5.i
i32 77, label %sw.bb6.i
]
sw.bb1.i: ; preds = %while.body
br label %while.cond2.preheader
sw.bb2.i: ; preds = %while.body
br label %while.cond2.preheader
sw.bb3.i: ; preds = %while.body
br label %while.cond2.preheader
sw.bb4.i: ; preds = %while.body
br label %while.cond2.preheader
sw.bb5.i: ; preds = %while.body
br label %while.cond2.preheader
sw.bb6.i: ; preds = %while.body
br label %while.cond2.preheader
sw.default.i: ; preds = %while.body
br label %while.cond2.preheader
while.cond2.preheader: ; preds = %while.body, %sw.bb1.i, %sw.bb2.i, %sw.bb3.i, %sw.bb4.i, %sw.bb5.i, %sw.bb6.i, %sw.default.i
%a.0.ph = phi i32 [ 0, %sw.default.i ], [ 1000, %sw.bb6.i ], [ 500, %sw.bb5.i ], [ 100, %sw.bb4.i ], [ 50, %sw.bb3.i ], [ 10, %sw.bb2.i ], [ 5, %sw.bb1.i ], [ 1, %while.body ]
br label %while.cond2
while.cond2: ; preds = %while.cond2.preheader, %convert.exit30
%indvars.iv = phi i64 [ %indvars.iv.next, %convert.exit30 ], [ 0, %while.cond2.preheader ]
%a.0 = phi i32 [ %retval.0.i23, %convert.exit30 ], [ %a.0.ph, %while.cond2.preheader ]
%ans.0 = phi i32 [ %ans.1, %convert.exit30 ], [ 0, %while.cond2.preheader ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx4 = getelementptr inbounds [101 x i8], ptr %arb, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%conv.i21 = sext i8 %1 to i32
switch i32 %conv.i21, label %while.end [
i32 73, label %convert.exit30
i32 86, label %sw.bb1.i28
i32 88, label %sw.bb2.i27
i32 76, label %sw.bb3.i26
i32 67, label %sw.bb4.i25
i32 68, label %sw.bb5.i24
i32 77, label %sw.bb6.i22
]
sw.bb1.i28: ; preds = %while.cond2
br label %convert.exit30
sw.bb2.i27: ; preds = %while.cond2
br label %convert.exit30
sw.bb3.i26: ; preds = %while.cond2
br label %convert.exit30
sw.bb4.i25: ; preds = %while.cond2
br label %convert.exit30
sw.bb5.i24: ; preds = %while.cond2
br label %convert.exit30
sw.bb6.i22: ; preds = %while.cond2
br label %convert.exit30
convert.exit30: ; preds = %while.cond2, %sw.bb1.i28, %sw.bb2.i27, %sw.bb3.i26, %sw.bb4.i25, %sw.bb5.i24, %sw.bb6.i22
%retval.0.i23 = phi i32 [ 1000, %sw.bb6.i22 ], [ 500, %sw.bb5.i24 ], [ 100, %sw.bb4.i25 ], [ 50, %sw.bb3.i26 ], [ 10, %sw.bb2.i27 ], [ 5, %sw.bb1.i28 ], [ 1, %while.cond2 ]
%cmp6 = icmp ult i32 %a.0, %retval.0.i23
%2 = sub nsw i32 0, %a.0
%ans.1.p = select i1 %cmp6, i32 %2, i32 %a.0
%ans.1 = add i32 %ans.1.p, %ans.0
br label %while.cond2
while.end: ; preds = %while.cond2
%add734 = add nsw i32 %ans.0, %a.0
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add734)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arb)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end13, label %while.body, !llvm.loop !8
while.end13: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %arb) #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) #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
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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)
{
double A[1000],s,m;
int i,N;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%lf",&A[i]);
m=m+1/A[i];
}
s=1/m;
printf("%lf\n",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191178/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191178/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.2 = 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 [1000 x double], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%m.011 = phi double [ %add, %for.body ], [ undef, %entry ]
%arrayidx = getelementptr inbounds [1000 x double], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load double, ptr %arrayidx, align 8, !tbaa !9
%div = fdiv double 1.000000e+00, %1
%add = fadd double %m.011, %div
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%m.0.lcssa = phi double [ undef, %entry ], [ %add, %for.body ]
%div4 = fdiv double 1.000000e+00, %m.0.lcssa
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.end.p0(i64 8000, 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 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
double ans=0.0;
int N, A;
scanf("%d", &N);
for (int a = 0; a < N;a++){
scanf("%d", &A);
ans += (1.0 / (A*1.0));
}
printf("%f", 1.0 / ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191220/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191220/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%ans.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ]
%div2 = fdiv double 1.000000e+00, %ans.0.lcssa
%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 %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%a.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%ans.07 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%1 = load i32, ptr %A, align 4, !tbaa !5
%conv = sitofp i32 %1 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %ans.07, %div
%inc = add nuw nsw i32 %a.08, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int a[10000], N, i;
double sum = 0;
scanf("%d", &N);
for (i = 1; i <= N; i++)
{
scanf("%d", &a[i]);
}
for (i = 1; i <= N; i++)
{
sum = sum + 1.0 / a[i];
}
printf("%lf", 1.0 / sum);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191264/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191264/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [10000 x i32], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not18 = icmp slt i32 %0, 1
br i1 %cmp.not18, label %for.end9, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not20 = icmp slt i32 %5, 1
br i1 %cmp3.not20, label %for.end9, label %for.body4.preheader
for.body4.preheader: ; preds = %for.cond2.preheader
%1 = add nuw i32 %5, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%3 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %2, 3
%4 = icmp ult i64 %3, 3
br i1 %4, label %for.end9.loopexit.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i64 %2, -4
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%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.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4, %for.body4.preheader.new
%indvars.iv26 = phi i64 [ 1, %for.body4.preheader.new ], [ %indvars.iv.next27.3, %for.body4 ]
%sum.022 = phi double [ 0.000000e+00, %for.body4.preheader.new ], [ %add.3, %for.body4 ]
%niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.3, %for.body4 ]
%arrayidx6 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv26
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%conv = sitofp i32 %7 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %sum.022, %div
%indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1
%arrayidx6.1 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next27
%8 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%conv.1 = sitofp i32 %8 to double
%div.1 = fdiv double 1.000000e+00, %conv.1
%add.1 = fadd double %add, %div.1
%indvars.iv.next27.1 = add nuw nsw i64 %indvars.iv26, 2
%arrayidx6.2 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next27.1
%9 = load i32, ptr %arrayidx6.2, align 4, !tbaa !5
%conv.2 = sitofp i32 %9 to double
%div.2 = fdiv double 1.000000e+00, %conv.2
%add.2 = fadd double %add.1, %div.2
%indvars.iv.next27.2 = add nuw nsw i64 %indvars.iv26, 3
%arrayidx6.3 = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv.next27.2
%10 = load i32, ptr %arrayidx6.3, align 4, !tbaa !5
%conv.3 = sitofp i32 %10 to double
%div.3 = fdiv double 1.000000e+00, %conv.3
%add.3 = fadd double %add.2, %div.3
%indvars.iv.next27.3 = add nuw nsw i64 %indvars.iv26, 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.end9.loopexit.unr-lcssa, label %for.body4, !llvm.loop !11
for.end9.loopexit.unr-lcssa: ; preds = %for.body4, %for.body4.preheader
%add.lcssa.ph = phi double [ undef, %for.body4.preheader ], [ %add.3, %for.body4 ]
%indvars.iv26.unr = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next27.3, %for.body4 ]
%sum.022.unr = phi double [ 0.000000e+00, %for.body4.preheader ], [ %add.3, %for.body4 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end9, label %for.body4.epil
for.body4.epil: ; preds = %for.end9.loopexit.unr-lcssa, %for.body4.epil
%indvars.iv26.epil = phi i64 [ %indvars.iv.next27.epil, %for.body4.epil ], [ %indvars.iv26.unr, %for.end9.loopexit.unr-lcssa ]
%sum.022.epil = phi double [ %add.epil, %for.body4.epil ], [ %sum.022.unr, %for.end9.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body4.epil ], [ 0, %for.end9.loopexit.unr-lcssa ]
%arrayidx6.epil = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv26.epil
%11 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5
%conv.epil = sitofp i32 %11 to double
%div.epil = fdiv double 1.000000e+00, %conv.epil
%add.epil = fadd double %sum.022.epil, %div.epil
%indvars.iv.next27.epil = add nuw nsw i64 %indvars.iv26.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.end9, label %for.body4.epil, !llvm.loop !12
for.end9: ; preds = %for.end9.loopexit.unr-lcssa, %for.body4.epil, %entry, %for.cond2.preheader
%sum.0.lcssa = phi double [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end9.loopexit.unr-lcssa ], [ %add.epil, %for.body4.epil ]
%div10 = fdiv double 1.000000e+00, %sum.0.lcssa
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
#define NUM 100
int main(void)
{
int num[NUM];
int N,i;
double sum = 0.0;
scanf("%d",&N);
for(i = 0; i < N; i++){
scanf("%d",&num[i]);
sum += 1.0 / num[i];
}
printf("%f",1.0 / sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191307/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191307/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%num = alloca [100 x i32], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %num) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.012 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %num, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %1 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %sum.012, %div
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ]
%div4 = fdiv double 1.000000e+00, %sum.0.lcssa
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %num) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main(void){
int N,a[101];
scanf("%d",&N);
int i;
for(i=0;i<N-1;i++){
scanf("%d ",&a[i]);
}
scanf("%d",&a[N-1]);
double sum=0;
for(i=0;i<N;i++)sum += 1/(double)a[i];
sum = 1/sum;
printf("%lf\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_191350/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_191350/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %0, 1
br i1 %cmp24, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%sub23 = add nsw i32 %0, -1
%.pre = sext i32 %sub23 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%2 = sext i32 %sub to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%idxprom3.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
%arrayidx4 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %idxprom3.pre-phi
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx4)
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp726 = icmp sgt i32 %3, 0
br i1 %cmp726, label %for.body8.preheader, label %for.end13
for.body8.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 3
%4 = icmp ult i32 %3, 4
br i1 %4, label %for.end13.loopexit.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body8
for.body8: ; preds = %for.body8, %for.body8.preheader.new
%indvars.iv32 = phi i64 [ 0, %for.body8.preheader.new ], [ %indvars.iv.next33.3, %for.body8 ]
%sum.028 = phi double [ 0.000000e+00, %for.body8.preheader.new ], [ %add.3, %for.body8 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.3, %for.body8 ]
%arrayidx10 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv32
%5 = load i32, ptr %arrayidx10, align 16, !tbaa !5
%conv = sitofp i32 %5 to double
%div = fdiv double 1.000000e+00, %conv
%add = fadd double %sum.028, %div
%indvars.iv.next33 = or i64 %indvars.iv32, 1
%arrayidx10.1 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv.next33
%6 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%conv.1 = sitofp i32 %6 to double
%div.1 = fdiv double 1.000000e+00, %conv.1
%add.1 = fadd double %add, %div.1
%indvars.iv.next33.1 = or i64 %indvars.iv32, 2
%arrayidx10.2 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv.next33.1
%7 = load i32, ptr %arrayidx10.2, align 8, !tbaa !5
%conv.2 = sitofp i32 %7 to double
%div.2 = fdiv double 1.000000e+00, %conv.2
%add.2 = fadd double %add.1, %div.2
%indvars.iv.next33.2 = or i64 %indvars.iv32, 3
%arrayidx10.3 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv.next33.2
%8 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%conv.3 = sitofp i32 %8 to double
%div.3 = fdiv double 1.000000e+00, %conv.3
%add.3 = fadd double %add.2, %div.3
%indvars.iv.next33.3 = add nuw nsw i64 %indvars.iv32, 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.end13.loopexit.unr-lcssa, label %for.body8, !llvm.loop !11
for.end13.loopexit.unr-lcssa: ; preds = %for.body8, %for.body8.preheader
%add.lcssa.ph = phi double [ undef, %for.body8.preheader ], [ %add.3, %for.body8 ]
%indvars.iv32.unr = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next33.3, %for.body8 ]
%sum.028.unr = phi double [ 0.000000e+00, %for.body8.preheader ], [ %add.3, %for.body8 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end13, label %for.body8.epil
for.body8.epil: ; preds = %for.end13.loopexit.unr-lcssa, %for.body8.epil
%indvars.iv32.epil = phi i64 [ %indvars.iv.next33.epil, %for.body8.epil ], [ %indvars.iv32.unr, %for.end13.loopexit.unr-lcssa ]
%sum.028.epil = phi double [ %add.epil, %for.body8.epil ], [ %sum.028.unr, %for.end13.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body8.epil ], [ 0, %for.end13.loopexit.unr-lcssa ]
%arrayidx10.epil = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv32.epil
%9 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%conv.epil = sitofp i32 %9 to double
%div.epil = fdiv double 1.000000e+00, %conv.epil
%add.epil = fadd double %sum.028.epil, %div.epil
%indvars.iv.next33.epil = add nuw nsw i64 %indvars.iv32.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.end13, label %for.body8.epil, !llvm.loop !12
for.end13: ; preds = %for.end13.loopexit.unr-lcssa, %for.body8.epil, %for.end
%sum.0.lcssa = phi double [ 0.000000e+00, %for.end ], [ %add.lcssa.ph, %for.end13.loopexit.unr-lcssa ], [ %add.epil, %for.body8.epil ]
%div14 = fdiv double 1.000000e+00, %sum.0.lcssa
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div14)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.