Source_Code
stringlengths 69
484k
| IR_Original
stringlengths 2.05k
17.9M
|
---|---|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n1,n2,n3,s;
scanf("%d%d%d",&n1,&n2,&n3);
s=n1+n2+n3;
if(s>=22){
printf("bust");
}
else{
printf("win");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142844/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142844/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n1 = alloca i32, align 4
%n2 = alloca i32, align 4
%n3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1, ptr noundef nonnull %n2, ptr noundef nonnull %n3)
%0 = load i32, ptr %n1, align 4, !tbaa !5
%1 = load i32, ptr %n2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %n3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n3) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n1) #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[3];
int i,sum;
sum=0;
for(i=0;i<=2;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
if(sum<=21)
puts("win");
else
puts("bust");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142888/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142888/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"win\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add.1 = add nsw i32 %1, %0
%arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%add.2 = add nsw i32 %2, %add.1
%cmp3 = icmp slt i32 %add.2, 22
%.str.1..str.2 = select i1 %cmp3, ptr @.str.1, ptr @.str.2
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c,i,n;
scanf("%d%d%d",&a,&b,&c);
i=a+b+c;
if(i>=22)
{
printf("bust");
}
else
{printf("win");}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142930/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142930/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\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
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int A,B,C;
scanf("%d %d %d",&A,&B,&C);
if(A+B+C >= 22){
printf("bust");
}else{
printf("win");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_142974/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_142974/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\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
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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>
#include<math.h>
int main(void){
int x, y, z;
scanf("%d %d %d", &x, &y, &z);
if ((x + y + z) >= 22)
printf("bust");
else {
printf("win");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143016/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143016/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"bust\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"win\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
%z = 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %z, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #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"}
|
#include <stdio.h>
int main()
{
int n,k;
scanf("%d%d",&n,&k);
int a[100];
int cnt=0;
int b[100];
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
int j;
for(j=0;j<i;j++)
{
if(a[i]==a[j])
{
break;
}
}
if(j==i)
{
b[cnt++]=i;
}
}
if(cnt>=k)
{
printf("YES\n");
for(int i=0;i<k;i++)
{
printf("%d ",b[i]+1);
}
}
else printf("NO");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14306/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14306/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca [100 x i32], align 16
%b = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %b) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end15, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %if.end15 ]
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp19.not = icmp slt i32 %cnt.0.lcssa, %1
br i1 %cmp19.not, label %if.else, label %if.then20
for.body: ; preds = %entry, %if.end15
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %if.end15 ], [ 0, %entry ]
%cnt.051 = phi i32 [ %cnt.1, %if.end15 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv57
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%cmp347.not = icmp eq i64 %indvars.iv57, 0
br i1 %cmp347.not, label %for.end, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.body
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
br label %for.body4
for.body4: ; preds = %for.body4.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next, %for.inc ]
%arrayidx8 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %2, %3
br i1 %cmp9, label %for.end, label %for.inc
for.inc: ; preds = %for.body4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv57
br i1 %exitcond.not, label %for.end, label %for.body4, !llvm.loop !9
for.end: ; preds = %for.inc, %for.body4, %for.body
%j.0.lcssa = phi i64 [ 0, %for.body ], [ %indvars.iv, %for.body4 ], [ %indvars.iv57, %for.inc ]
%4 = and i64 %j.0.lcssa, 4294967295
%cmp10 = icmp eq i64 %4, %indvars.iv57
br i1 %cmp10, label %if.then11, label %if.end15
if.then11: ; preds = %for.end
%inc12 = add nsw i32 %cnt.051, 1
%idxprom13 = sext i32 %cnt.051 to i64
%arrayidx14 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %idxprom13
%5 = trunc i64 %indvars.iv57 to i32
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
br label %if.end15
if.end15: ; preds = %if.then11, %for.end
%cnt.1 = phi i32 [ %inc12, %if.then11 ], [ %cnt.051, %for.end ]
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next58, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
if.then20: ; preds = %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%8 = load i32, ptr %k, align 4, !tbaa !5
%cmp2454 = icmp sgt i32 %8, 0
br i1 %cmp2454, label %for.body26, label %if.end34
for.body26: ; preds = %if.then20, %for.body26
%indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.body26 ], [ 0, %if.then20 ]
%arrayidx28 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv60
%9 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add = add nsw i32 %9, 1
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add)
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%10 = load i32, ptr %k, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp24 = icmp slt i64 %indvars.iv.next61, %11
br i1 %cmp24, label %for.body26, label %if.end34, !llvm.loop !12
if.else: ; preds = %for.cond.cleanup
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %if.end34
if.end34: ; preds = %for.body26, %if.then20, %if.else
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void){
int A1,A2,A3,A4;
scanf("%d %d %d",&A1,&A2,&A3);
A4 = A1+A2+A3;
if(A4>21) printf("bust\n");
else printf("win\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143102/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143102/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"win\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"bust\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A1 = alloca i32, align 4
%A2 = alloca i32, align 4
%A3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A3) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A1, ptr noundef nonnull %A2, ptr noundef nonnull %A3)
%0 = load i32, ptr %A1, align 4, !tbaa !5
%1 = load i32, ptr %A2, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %A3, align 4, !tbaa !5
%add1 = add nsw i32 %add, %2
%cmp = icmp sgt i32 %add1, 21
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A1) #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"}
|
// AOJ 2494 Sliding GCD
// 2018.3.18 bal4u
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100000
#define DMAX 130 // max 126
int t[MAX+1][DMAX+1], w[MAX+1];
int c[MAX+1];
void divisor_tble(int N)
{
int i, k;
for (i = 2; i <= N; i++) {
for (k = i<<1; k <= N; k += i) t[k][w[k]++] = i;
}
}
int main()
{
int N, W, nw, i, j, k, lo, hi, ans;
scanf("%d%d", &N, &W), nw = N-W+1;
if (W == 1) {
putchar('1');
for (k = 2; k <= nw; k++) putchar(' '), putchar('1');
putchar('\n');
return 0;
}
divisor_tble(N);
printf("%d", W);
ans = 0;
for (i = 1; i <= W; i++) {
for (j = 0; j < w[i]; j++) {
if (++c[t[i][j]] == 2) ans++;
}
}
lo = 1, hi = W+1;
for (k = 2; k <= nw; k++) {
for (i = 0; i < w[lo]; i++) {
if (--c[t[lo][i]] == 1) ans--;
}
lo++;
for (i = 0; i < w[hi]; i++) {
if (++c[t[hi][i]] == 2) ans++;
}
hi++;
j = 0; for (i = lo; i <= hi; i++) if (c[i] < 2) j++;
//printf("\nk %d, lo %d, hi %d, ans %d, j %d\n", k, lo, hi, ans, j);
printf(" %d", ans+j);
}
putchar('\n');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143146/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143146/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@t = dso_local local_unnamed_addr global [100001 x [131 x i32]] zeroinitializer, align 16
@w = dso_local local_unnamed_addr global [100001 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 [3 x i8] c"%d\00", align 1
@c = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @divisor_tble(i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp.not21 = icmp slt i32 %N, 2
br i1 %cmp.not21, label %for.end10, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = zext i32 %N to i64
%1 = add nuw i32 %N, 1
%wide.trip.count = zext i32 %1 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc8
%indvars.iv23 = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next24, %for.inc8 ]
%indvars.iv = phi i32 [ 4, %for.body.preheader ], [ %indvars.iv.next, %for.inc8 ]
%indvars28 = trunc i64 %indvars.iv23 to i32
%shl = shl nuw i32 %indvars28, 1
%cmp2.not19 = icmp sgt i32 %shl, %N
br i1 %cmp2.not19, label %for.inc8, label %for.body3.preheader
for.body3.preheader: ; preds = %for.body
%2 = sext i32 %indvars.iv to i64
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv25 = phi i64 [ %2, %for.body3.preheader ], [ %indvars.iv.next26, %for.body3 ]
%arrayidx5 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %indvars.iv25
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr %arrayidx5, align 4, !tbaa !5
%idxprom6 = sext i32 %3 to i64
%arrayidx7 = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv25, i64 %idxprom6
store i32 %indvars28, ptr %arrayidx7, align 4, !tbaa !5
%indvars.iv.next26 = add nsw i64 %indvars.iv25, %indvars.iv23
%cmp2.not = icmp sgt i64 %indvars.iv.next26, %0
br i1 %cmp2.not, label %for.inc8, label %for.body3, !llvm.loop !9
for.inc8: ; preds = %for.body3, %for.body
%indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
%indvars.iv.next = add i32 %indvars.iv, 2
%exitcond.not = icmp eq i64 %indvars.iv.next24, %wide.trip.count
br i1 %exitcond.not, label %for.end10, label %for.body, !llvm.loop !11
for.end10: ; preds = %for.inc8, %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
%W = 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 %W) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %W)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %W, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%cmp = icmp eq i32 %1, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%2 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i = call i32 @putc(i32 noundef 49, ptr noundef %2)
%cmp2.not160 = icmp slt i32 %sub, 1
br i1 %cmp2.not160, label %cleanup, label %for.body
for.body: ; preds = %if.then, %for.body
%k.0161 = phi i32 [ %inc, %for.body ], [ 2, %if.then ]
%3 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i131 = call i32 @putc(i32 noundef 32, ptr noundef %3)
%4 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i132 = call i32 @putc(i32 noundef 49, ptr noundef %4)
%inc = add nuw i32 %k.0161, 1
%exitcond198 = icmp eq i32 %k.0161, %0
br i1 %exitcond198, label %cleanup, label %for.body, !llvm.loop !14
if.end: ; preds = %entry
%cmp.not21.i = icmp slt i32 %0, 2
br i1 %cmp.not21.i, label %divisor_tble.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %if.end
%5 = zext i32 %0 to i64
%6 = add nuw i32 %0, 1
%wide.trip.count.i = zext i32 %6 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc8.i, %for.body.preheader.i
%indvars.iv23.i = phi i64 [ 2, %for.body.preheader.i ], [ %indvars.iv.next24.i, %for.inc8.i ]
%indvars.iv.i = phi i32 [ 4, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc8.i ]
%indvars28.i = trunc i64 %indvars.iv23.i to i32
%shl.i = shl nuw i32 %indvars28.i, 1
%cmp2.not19.i = icmp sgt i32 %shl.i, %0
br i1 %cmp2.not19.i, label %for.inc8.i, label %for.body3.preheader.i
for.body3.preheader.i: ; preds = %for.body.i
%7 = sext i32 %indvars.iv.i to i64
br label %for.body3.i
for.body3.i: ; preds = %for.body3.i, %for.body3.preheader.i
%indvars.iv25.i = phi i64 [ %7, %for.body3.preheader.i ], [ %indvars.iv.next26.i, %for.body3.i ]
%arrayidx5.i = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %indvars.iv25.i
%8 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%inc.i = add nsw i32 %8, 1
store i32 %inc.i, ptr %arrayidx5.i, align 4, !tbaa !5
%idxprom6.i = sext i32 %8 to i64
%arrayidx7.i = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv25.i, i64 %idxprom6.i
store i32 %indvars28.i, ptr %arrayidx7.i, align 4, !tbaa !5
%indvars.iv.next26.i = add nsw i64 %indvars.iv25.i, %indvars.iv23.i
%cmp2.not.i = icmp sgt i64 %indvars.iv.next26.i, %5
br i1 %cmp2.not.i, label %for.inc8.i, label %for.body3.i, !llvm.loop !9
for.inc8.i: ; preds = %for.body3.i, %for.body.i
%indvars.iv.next24.i = add nuw nsw i64 %indvars.iv23.i, 1
%indvars.iv.next.i = add i32 %indvars.iv.i, 2
%exitcond.not.i = icmp eq i64 %indvars.iv.next24.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %divisor_tble.exit, label %for.body.i, !llvm.loop !11
divisor_tble.exit: ; preds = %for.inc8.i, %if.end
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%9 = load i32, ptr %W, align 4, !tbaa !5
%cmp8.not138 = icmp slt i32 %9, 1
br i1 %cmp8.not138, label %for.end29, label %for.cond10.preheader.preheader
for.cond10.preheader.preheader: ; preds = %divisor_tble.exit
%10 = add nuw i32 %9, 1
%wide.trip.count166 = zext i32 %10 to i64
br label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.inc27
%indvars.iv163 = phi i64 [ 1, %for.cond10.preheader.preheader ], [ %indvars.iv.next164, %for.inc27 ]
%ans.0140 = phi i32 [ 0, %for.cond10.preheader.preheader ], [ %ans.1.lcssa, %for.inc27 ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %indvars.iv163
%11 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp11135 = icmp sgt i32 %11, 0
br i1 %cmp11135, label %for.body12.preheader, label %for.inc27
for.body12.preheader: ; preds = %for.cond10.preheader
%wide.trip.count = zext i32 %11 to i64
%xtraiter = and i64 %wide.trip.count, 1
%12 = icmp eq i32 %11, 1
br i1 %12, label %for.inc27.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body12
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%indvars.iv = phi i64 [ 0, %for.body12.preheader.new ], [ %indvars.iv.next.1, %for.body12 ]
%ans.1137 = phi i32 [ %ans.0140, %for.body12.preheader.new ], [ %spec.select.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%arrayidx16 = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv163, i64 %indvars.iv
%13 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%idxprom17 = sext i32 %13 to i64
%arrayidx18 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom17
%14 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%inc19 = add nsw i32 %14, 1
store i32 %inc19, ptr %arrayidx18, align 4, !tbaa !5
%cmp20 = icmp eq i32 %inc19, 2
%inc22 = zext i1 %cmp20 to i32
%spec.select = add nsw i32 %ans.1137, %inc22
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx16.1 = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv163, i64 %indvars.iv.next
%15 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%idxprom17.1 = sext i32 %15 to i64
%arrayidx18.1 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom17.1
%16 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5
%inc19.1 = add nsw i32 %16, 1
store i32 %inc19.1, ptr %arrayidx18.1, align 4, !tbaa !5
%cmp20.1 = icmp eq i32 %inc19.1, 2
%inc22.1 = zext i1 %cmp20.1 to i32
%spec.select.1 = add nsw i32 %spec.select, %inc22.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.inc27.loopexit.unr-lcssa, label %for.body12, !llvm.loop !15
for.inc27.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body12.preheader ], [ %spec.select.1, %for.body12 ]
%indvars.iv.unr = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next.1, %for.body12 ]
%ans.1137.unr = phi i32 [ %ans.0140, %for.body12.preheader ], [ %spec.select.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc27, label %for.body12.epil
for.body12.epil: ; preds = %for.inc27.loopexit.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv163, i64 %indvars.iv.unr
%17 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
%idxprom17.epil = sext i32 %17 to i64
%arrayidx18.epil = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom17.epil
%18 = load i32, ptr %arrayidx18.epil, align 4, !tbaa !5
%inc19.epil = add nsw i32 %18, 1
store i32 %inc19.epil, ptr %arrayidx18.epil, align 4, !tbaa !5
%cmp20.epil = icmp eq i32 %inc19.epil, 2
%inc22.epil = zext i1 %cmp20.epil to i32
%spec.select.epil = add nsw i32 %ans.1137.unr, %inc22.epil
br label %for.inc27
for.inc27: ; preds = %for.body12.epil, %for.inc27.loopexit.unr-lcssa, %for.cond10.preheader
%ans.1.lcssa = phi i32 [ %ans.0140, %for.cond10.preheader ], [ %spec.select.lcssa.ph, %for.inc27.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body12.epil ]
%indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
%exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166
br i1 %exitcond167.not, label %for.end29, label %for.cond10.preheader, !llvm.loop !16
for.end29: ; preds = %for.inc27, %divisor_tble.exit
%ans.0.lcssa = phi i32 [ 0, %divisor_tble.exit ], [ %ans.1.lcssa, %for.inc27 ]
%cmp32.not155 = icmp slt i32 %sub, 1
br i1 %cmp32.not155, label %cleanup, label %for.cond34.preheader.preheader
for.cond34.preheader.preheader: ; preds = %for.end29
%19 = add i32 %9, 3
%20 = sext i32 %9 to i64
%21 = add i32 %0, 1
%22 = sub i32 %21, %1
%wide.trip.count196 = zext i32 %22 to i64
br label %for.cond34.preheader
for.cond34.preheader: ; preds = %for.cond34.preheader.preheader, %for.end84
%indvar = phi i64 [ 0, %for.cond34.preheader.preheader ], [ %indvar.next, %for.end84 ]
%indvars.iv189 = phi i64 [ 1, %for.cond34.preheader.preheader ], [ %indvars.iv.next190, %for.end84 ]
%indvars.iv187 = phi i64 [ %20, %for.cond34.preheader.preheader ], [ %indvars.iv.next188, %for.end84 ]
%indvars.iv183 = phi i32 [ %19, %for.cond34.preheader.preheader ], [ %indvars.iv.next184, %for.end84 ]
%indvars.iv178 = phi i64 [ 2, %for.cond34.preheader.preheader ], [ %indvars.iv.next179, %for.end84 ]
%ans.3159 = phi i32 [ %ans.0.lcssa, %for.cond34.preheader.preheader ], [ %ans.6.lcssa, %for.end84 ]
%23 = zext i32 %indvars.iv183 to i64
%reass.sub = sub i64 %23, %indvar
%24 = add i64 %reass.sub, -2
%indvars.iv.next188 = add nsw i64 %indvars.iv187, 1
%arrayidx36 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %indvars.iv189
%25 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%cmp37143 = icmp sgt i32 %25, 0
br i1 %cmp37143, label %for.body38.preheader, label %for.end51
for.body38.preheader: ; preds = %for.cond34.preheader
%wide.trip.count171 = zext i32 %25 to i64
%xtraiter206 = and i64 %wide.trip.count171, 1
%26 = icmp eq i32 %25, 1
br i1 %26, label %for.end51.loopexit.unr-lcssa, label %for.body38.preheader.new
for.body38.preheader.new: ; preds = %for.body38.preheader
%unroll_iter209 = and i64 %wide.trip.count171, 4294967294
br label %for.body38
for.body38: ; preds = %for.body38, %for.body38.preheader.new
%indvars.iv168 = phi i64 [ 0, %for.body38.preheader.new ], [ %indvars.iv.next169.1, %for.body38 ]
%ans.4145 = phi i32 [ %ans.3159, %for.body38.preheader.new ], [ %spec.select128.1, %for.body38 ]
%niter210 = phi i64 [ 0, %for.body38.preheader.new ], [ %niter210.next.1, %for.body38 ]
%arrayidx42 = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv189, i64 %indvars.iv168
%27 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%idxprom43 = sext i32 %27 to i64
%arrayidx44 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom43
%28 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%dec = add nsw i32 %28, -1
store i32 %dec, ptr %arrayidx44, align 4, !tbaa !5
%cmp45 = icmp eq i32 %dec, 1
%dec47 = sext i1 %cmp45 to i32
%spec.select128 = add nsw i32 %ans.4145, %dec47
%indvars.iv.next169 = or i64 %indvars.iv168, 1
%arrayidx42.1 = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv189, i64 %indvars.iv.next169
%29 = load i32, ptr %arrayidx42.1, align 4, !tbaa !5
%idxprom43.1 = sext i32 %29 to i64
%arrayidx44.1 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom43.1
%30 = load i32, ptr %arrayidx44.1, align 4, !tbaa !5
%dec.1 = add nsw i32 %30, -1
store i32 %dec.1, ptr %arrayidx44.1, align 4, !tbaa !5
%cmp45.1 = icmp eq i32 %dec.1, 1
%dec47.1 = sext i1 %cmp45.1 to i32
%spec.select128.1 = add nsw i32 %spec.select128, %dec47.1
%indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 2
%niter210.next.1 = add i64 %niter210, 2
%niter210.ncmp.1 = icmp eq i64 %niter210.next.1, %unroll_iter209
br i1 %niter210.ncmp.1, label %for.end51.loopexit.unr-lcssa, label %for.body38, !llvm.loop !17
for.end51.loopexit.unr-lcssa: ; preds = %for.body38, %for.body38.preheader
%spec.select128.lcssa.ph = phi i32 [ undef, %for.body38.preheader ], [ %spec.select128.1, %for.body38 ]
%indvars.iv168.unr = phi i64 [ 0, %for.body38.preheader ], [ %indvars.iv.next169.1, %for.body38 ]
%ans.4145.unr = phi i32 [ %ans.3159, %for.body38.preheader ], [ %spec.select128.1, %for.body38 ]
%lcmp.mod207.not = icmp eq i64 %xtraiter206, 0
br i1 %lcmp.mod207.not, label %for.end51, label %for.body38.epil
for.body38.epil: ; preds = %for.end51.loopexit.unr-lcssa
%arrayidx42.epil = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv189, i64 %indvars.iv168.unr
%31 = load i32, ptr %arrayidx42.epil, align 4, !tbaa !5
%idxprom43.epil = sext i32 %31 to i64
%arrayidx44.epil = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom43.epil
%32 = load i32, ptr %arrayidx44.epil, align 4, !tbaa !5
%dec.epil = add nsw i32 %32, -1
store i32 %dec.epil, ptr %arrayidx44.epil, align 4, !tbaa !5
%cmp45.epil = icmp eq i32 %dec.epil, 1
%dec47.epil = sext i1 %cmp45.epil to i32
%spec.select128.epil = add nsw i32 %ans.4145.unr, %dec47.epil
br label %for.end51
for.end51: ; preds = %for.body38.epil, %for.end51.loopexit.unr-lcssa, %for.cond34.preheader
%ans.4.lcssa = phi i32 [ %ans.3159, %for.cond34.preheader ], [ %spec.select128.lcssa.ph, %for.end51.loopexit.unr-lcssa ], [ %spec.select128.epil, %for.body38.epil ]
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%arrayidx55 = getelementptr inbounds [100001 x i32], ptr @w, i64 0, i64 %indvars.iv.next188
%33 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%cmp56147 = icmp sgt i32 %33, 0
br i1 %cmp56147, label %for.body57.preheader, label %for.end71
for.body57.preheader: ; preds = %for.end51
%wide.trip.count176 = zext i32 %33 to i64
%xtraiter211 = and i64 %wide.trip.count176, 1
%34 = icmp eq i32 %33, 1
br i1 %34, label %for.end71.loopexit.unr-lcssa, label %for.body57.preheader.new
for.body57.preheader.new: ; preds = %for.body57.preheader
%unroll_iter214 = and i64 %wide.trip.count176, 4294967294
br label %for.body57
for.body57: ; preds = %for.body57, %for.body57.preheader.new
%indvars.iv173 = phi i64 [ 0, %for.body57.preheader.new ], [ %indvars.iv.next174.1, %for.body57 ]
%ans.6149 = phi i32 [ %ans.4.lcssa, %for.body57.preheader.new ], [ %spec.select129.1, %for.body57 ]
%niter215 = phi i64 [ 0, %for.body57.preheader.new ], [ %niter215.next.1, %for.body57 ]
%arrayidx61 = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv.next188, i64 %indvars.iv173
%35 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%idxprom62 = sext i32 %35 to i64
%arrayidx63 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom62
%36 = load i32, ptr %arrayidx63, align 4, !tbaa !5
%inc64 = add nsw i32 %36, 1
store i32 %inc64, ptr %arrayidx63, align 4, !tbaa !5
%cmp65 = icmp eq i32 %inc64, 2
%inc67 = zext i1 %cmp65 to i32
%spec.select129 = add nsw i32 %ans.6149, %inc67
%indvars.iv.next174 = or i64 %indvars.iv173, 1
%arrayidx61.1 = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv.next188, i64 %indvars.iv.next174
%37 = load i32, ptr %arrayidx61.1, align 4, !tbaa !5
%idxprom62.1 = sext i32 %37 to i64
%arrayidx63.1 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom62.1
%38 = load i32, ptr %arrayidx63.1, align 4, !tbaa !5
%inc64.1 = add nsw i32 %38, 1
store i32 %inc64.1, ptr %arrayidx63.1, align 4, !tbaa !5
%cmp65.1 = icmp eq i32 %inc64.1, 2
%inc67.1 = zext i1 %cmp65.1 to i32
%spec.select129.1 = add nsw i32 %spec.select129, %inc67.1
%indvars.iv.next174.1 = add nuw nsw i64 %indvars.iv173, 2
%niter215.next.1 = add i64 %niter215, 2
%niter215.ncmp.1 = icmp eq i64 %niter215.next.1, %unroll_iter214
br i1 %niter215.ncmp.1, label %for.end71.loopexit.unr-lcssa, label %for.body57, !llvm.loop !18
for.end71.loopexit.unr-lcssa: ; preds = %for.body57, %for.body57.preheader
%spec.select129.lcssa.ph = phi i32 [ undef, %for.body57.preheader ], [ %spec.select129.1, %for.body57 ]
%indvars.iv173.unr = phi i64 [ 0, %for.body57.preheader ], [ %indvars.iv.next174.1, %for.body57 ]
%ans.6149.unr = phi i32 [ %ans.4.lcssa, %for.body57.preheader ], [ %spec.select129.1, %for.body57 ]
%lcmp.mod212.not = icmp eq i64 %xtraiter211, 0
br i1 %lcmp.mod212.not, label %for.end71, label %for.body57.epil
for.body57.epil: ; preds = %for.end71.loopexit.unr-lcssa
%arrayidx61.epil = getelementptr inbounds [100001 x [131 x i32]], ptr @t, i64 0, i64 %indvars.iv.next188, i64 %indvars.iv173.unr
%39 = load i32, ptr %arrayidx61.epil, align 4, !tbaa !5
%idxprom62.epil = sext i32 %39 to i64
%arrayidx63.epil = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %idxprom62.epil
%40 = load i32, ptr %arrayidx63.epil, align 4, !tbaa !5
%inc64.epil = add nsw i32 %40, 1
store i32 %inc64.epil, ptr %arrayidx63.epil, align 4, !tbaa !5
%cmp65.epil = icmp eq i32 %inc64.epil, 2
%inc67.epil = zext i1 %cmp65.epil to i32
%spec.select129.epil = add nsw i32 %ans.6149.unr, %inc67.epil
br label %for.end71
for.end71: ; preds = %for.body57.epil, %for.end71.loopexit.unr-lcssa, %for.end51
%ans.6.lcssa = phi i32 [ %ans.4.lcssa, %for.end51 ], [ %spec.select129.lcssa.ph, %for.end71.loopexit.unr-lcssa ], [ %spec.select129.epil, %for.body57.epil ]
%cmp74.not151 = icmp sgt i64 %indvars.iv189, %indvars.iv.next188
br i1 %cmp74.not151, label %for.end84, label %for.body75.preheader
for.body75.preheader: ; preds = %for.end71
%wide.trip.count185 = zext i32 %indvars.iv183 to i64
%min.iters.check = icmp ult i64 %24, 8
br i1 %min.iters.check, label %for.body75.preheader202, label %vector.ph
vector.ph: ; preds = %for.body75.preheader
%n.vec = and i64 %24, -8
%ind.end = add i64 %indvars.iv178, %n.vec
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %47, %vector.body ]
%vec.phi200 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %48, %vector.body ]
%offset.idx = add i64 %indvars.iv178, %index
%41 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %41, align 4, !tbaa !5
%42 = getelementptr inbounds i32, ptr %41, i64 4
%wide.load201 = load <4 x i32>, ptr %42, align 4, !tbaa !5
%43 = icmp slt <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2>
%44 = icmp slt <4 x i32> %wide.load201, <i32 2, i32 2, i32 2, i32 2>
%45 = zext <4 x i1> %43 to <4 x i32>
%46 = zext <4 x i1> %44 to <4 x i32>
%47 = add <4 x i32> %vec.phi, %45
%48 = add <4 x i32> %vec.phi200, %46
%index.next = add nuw i64 %index, 8
%49 = icmp eq i64 %index.next, %n.vec
br i1 %49, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %48, %47
%50 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %24, %n.vec
br i1 %cmp.n, label %for.end84, label %for.body75.preheader202
for.body75.preheader202: ; preds = %for.body75.preheader, %middle.block
%indvars.iv180.ph = phi i64 [ %indvars.iv178, %for.body75.preheader ], [ %ind.end, %middle.block ]
%j.1153.ph = phi i32 [ 0, %for.body75.preheader ], [ %50, %middle.block ]
br label %for.body75
for.body75: ; preds = %for.body75.preheader202, %for.body75
%indvars.iv180 = phi i64 [ %indvars.iv.next181, %for.body75 ], [ %indvars.iv180.ph, %for.body75.preheader202 ]
%j.1153 = phi i32 [ %spec.select130, %for.body75 ], [ %j.1153.ph, %for.body75.preheader202 ]
%arrayidx77 = getelementptr inbounds [100001 x i32], ptr @c, i64 0, i64 %indvars.iv180
%51 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%cmp78 = icmp slt i32 %51, 2
%inc80 = zext i1 %cmp78 to i32
%spec.select130 = add nuw nsw i32 %j.1153, %inc80
%indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
%exitcond186 = icmp eq i64 %indvars.iv.next181, %wide.trip.count185
br i1 %exitcond186, label %for.end84, label %for.body75, !llvm.loop !22
for.end84: ; preds = %for.body75, %middle.block, %for.end71
%j.1.lcssa = phi i32 [ 0, %for.end71 ], [ %50, %middle.block ], [ %spec.select130, %for.body75 ]
%add85 = add nsw i32 %j.1.lcssa, %ans.6.lcssa
%call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add85)
%indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
%indvars.iv.next184 = add i32 %indvars.iv183, 1
%exitcond197 = icmp eq i64 %indvars.iv.next190, %wide.trip.count196
%indvar.next = add i64 %indvar, 1
br i1 %exitcond197, label %cleanup, label %for.cond34.preheader, !llvm.loop !23
cleanup: ; preds = %for.end84, %for.body, %for.end29, %if.then
%52 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i134 = call i32 @putc(i32 noundef 10, ptr noundef %52)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!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}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !10, !21, !20}
!23 = distinct !{!23, !10}
|
#include<stdio.h>
#include<string.h>
int main(){
int n,i;
scanf("%d",&n);
char s[101][101];
int a[101];
for(i=0;i<n;i++){
scanf("%s",s[i]);
a[i]=strlen(s[i]);
}
/*//for(i=0;i<n;i++){
// printf("%s\n",s[i]);
// printf("len=%d",strlen(s[i]));
//}*/
int pd=1,j,t;
char *st;
for(i=0;i<n;i++){
if(pd==0){
break;
}
for(j=0;j<n;j++){
if(strlen(s[i])>strlen(s[j])){
continue;
}
else{
// t=strlen(s[i]);
//
// strcmp(s[i],)
st=strstr(s[j],s[i]);
if(st==NULL){
pd=0;break;
}
}
}
}
int cnt=110;
if(pd==0){
printf("NO");
}
else{
printf("YES\n");
for(i=0;i<n;i++){
if(cnt>strlen(s[i]))
cnt=strlen(s[i]);
}
// printf("%d",cnt);
cnt=cnt-1;
for(i=0;i<n;){
cnt++;
for(j=0;j<n;j++){
if(a[j]==cnt){
printf("%s\n",s[j]);
i++;
}
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14319/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [101 x [101 x i8]], align 16
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 10201, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp125 = icmp sgt i32 %0, 0
br i1 %cmp125, label %for.body, label %if.else51
for.cond8.preheader: ; preds = %for.body
%cmp9131 = icmp slt i32 %2, 1
br i1 %cmp9131, label %if.else51, label %for.cond14.preheader.us.preheader
for.cond14.preheader.us.preheader: ; preds = %for.cond8.preheader
%1 = zext i32 %2 to i64
%wide.trip.count = zext i32 %2 to i64
br label %for.cond14.preheader.us
for.cond14.preheader.us: ; preds = %for.cond14.preheader.us.preheader, %for.inc44.us
%indvars.iv150 = phi i64 [ 0, %for.cond14.preheader.us.preheader ], [ %indvars.iv.next151, %for.inc44.us ]
%arrayidx19.us = getelementptr inbounds [101 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv150
%call21.us = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx19.us) #6
br label %for.body17.us
for.body17.us: ; preds = %for.cond14.preheader.us, %for.inc41.us
%indvars.iv147 = phi i64 [ 0, %for.cond14.preheader.us ], [ %indvars.iv.next148, %for.inc41.us ]
%arrayidx23.us = getelementptr inbounds [101 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv147
%call25.us = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx23.us) #6
%cmp26.us = icmp ugt i64 %call21.us, %call25.us
br i1 %cmp26.us, label %for.inc41.us, label %if.else.us
if.else.us: ; preds = %for.body17.us
%call35.us = call ptr @strstr(ptr noundef nonnull dereferenceable(1) %arrayidx23.us, ptr noundef nonnull dereferenceable(1) %arrayidx19.us) #6
%cmp36.us = icmp eq ptr %call35.us, null
br i1 %cmp36.us, label %if.then49, label %for.inc41.us
for.inc44.us: ; preds = %for.inc41.us
%indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
%cmp9.us.not = icmp ult i64 %indvars.iv.next151, %1
br i1 %cmp9.us.not, label %for.cond14.preheader.us, label %if.else51, !llvm.loop !9
for.inc41.us: ; preds = %if.else.us, %for.body17.us
%indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
%exitcond.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count
br i1 %exitcond.not, label %for.inc44.us, label %for.body17.us, !llvm.loop !11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx) #6
%conv = trunc i64 %call5 to i32
%arrayidx7 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 %conv, ptr %arrayidx7, align 4, !tbaa !5
%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.cond8.preheader, !llvm.loop !12
if.then49: ; preds = %if.else.us
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end98
if.else51: ; preds = %for.inc44.us, %entry, %for.cond8.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp54134 = icmp sgt i32 %4, 0
br i1 %cmp54134, label %for.body56.preheader, label %if.end98
for.body56.preheader: ; preds = %if.else51
%wide.trip.count156 = zext i32 %4 to i64
br label %for.body56
for.body56: ; preds = %for.body56.preheader, %for.body56
%indvars.iv153 = phi i64 [ 0, %for.body56.preheader ], [ %indvars.iv.next154, %for.body56 ]
%cnt.0136 = phi i32 [ 110, %for.body56.preheader ], [ %spec.select, %for.body56 ]
%conv57 = zext i32 %cnt.0136 to i64
%arrayidx59 = getelementptr inbounds [101 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv153
%call61 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %arrayidx59) #6
%cmp62 = icmp ult i64 %call61, %conv57
%conv69 = trunc i64 %call61 to i32
%spec.select = select i1 %cmp62, i32 %conv69, i32 %cnt.0136
%indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1
%exitcond157.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count156
br i1 %exitcond157.not, label %for.end73, label %for.body56, !llvm.loop !13
for.end73: ; preds = %for.body56
br i1 %cmp54134, label %for.body77.preheader, label %if.end98
for.body77.preheader: ; preds = %for.end73
%5 = add nsw i32 %spec.select, -1
br label %for.body77
for.cond74.loopexit: ; preds = %for.inc94, %for.body77
%6 = phi i32 [ %7, %for.body77 ], [ %11, %for.inc94 ]
%i.4.lcssa = phi i32 [ %i.3143, %for.body77 ], [ %i.5, %for.inc94 ]
%cmp75 = icmp slt i32 %i.4.lcssa, %6
br i1 %cmp75, label %for.body77, label %if.end98, !llvm.loop !14
for.body77: ; preds = %for.body77.preheader, %for.cond74.loopexit
%7 = phi i32 [ %6, %for.cond74.loopexit ], [ %4, %for.body77.preheader ]
%cnt.2144 = phi i32 [ %inc78, %for.cond74.loopexit ], [ %5, %for.body77.preheader ]
%i.3143 = phi i32 [ %i.4.lcssa, %for.cond74.loopexit ], [ 0, %for.body77.preheader ]
%inc78 = add nsw i32 %cnt.2144, 1
%cmp80138 = icmp sgt i32 %7, 0
br i1 %cmp80138, label %for.body82, label %for.cond74.loopexit
for.body82: ; preds = %for.body77, %for.inc94
%8 = phi i32 [ %11, %for.inc94 ], [ %7, %for.body77 ]
%9 = phi i32 [ %12, %for.inc94 ], [ %7, %for.body77 ]
%indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.inc94 ], [ 0, %for.body77 ]
%i.4140 = phi i32 [ %i.5, %for.inc94 ], [ %i.3143, %for.body77 ]
%arrayidx84 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv158
%10 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%cmp85 = icmp eq i32 %10, %inc78
br i1 %cmp85, label %if.then87, label %for.inc94
if.then87: ; preds = %for.body82
%arrayidx89 = getelementptr inbounds [101 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv158
%puts124 = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx89)
%inc92 = add nsw i32 %i.4140, 1
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc94
for.inc94: ; preds = %for.body82, %if.then87
%11 = phi i32 [ %.pre, %if.then87 ], [ %8, %for.body82 ]
%12 = phi i32 [ %.pre, %if.then87 ], [ %9, %for.body82 ]
%i.5 = phi i32 [ %inc92, %if.then87 ], [ %i.4140, %for.body82 ]
%indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
%13 = sext i32 %12 to i64
%cmp80 = icmp slt i64 %indvars.iv.next159, %13
br i1 %cmp80, label %for.body82, label %for.cond74.loopexit, !llvm.loop !16
if.end98: ; preds = %for.cond74.loopexit, %if.else51, %for.end73, %if.then49
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 10201, ptr nonnull %s) #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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <string.h>
char map[60][60], v[60][60], visited[60][60];
int H, W;
int dr[]={-1, 0, 1, 0}, dc[]={0, -1, 0, 1};
int dfs(int r, int c, int k)
{
int i;
char *t=&v[r][c];
*t|=k;
for(i=0;i<4;++i) {
int nr=r+dr[i];
int nc=c+dc[i];
if (nr<0 || nr>=H || nc<0 || nc>=W)
*t|=4;
else if (map[nr][nc]=='B')
*t|=1;
else if (map[nr][nc]=='W')
*t|=2;
}
for(i=0;i<4;++i) {
int nr=r+dr[i];
int nc=c+dc[i];
if (nr<0 || nr>=H || nc<0 || nc>=W || map[nr][nc]!='.' || (*t&v[nr][nc])==*t)
continue;
dfs(nr, nc, *t);
}
}
int main(void)
{
while (scanf("%d%d", &W, &H), W) {
int r, c, b, w;
memset(map, 0, sizeof(map));
memset(v, 0, sizeof(v));
b=w=0;
for(r=0;r<H;++r) scanf("%s", map[r]);
for(r=0;r<H;++r) for(c=0;c<W;++c) {
if (!v[r][c] && map[r][c]=='.') dfs(r, c, 0);
}
for(r=0;r<H;++r) for(c=0;c<W;++c) {
b+=(v[r][c]==1 || v[r][c]==5);
w+=(v[r][c]==2 || v[r][c]==6);
}
printf("%d %d\n", b, w);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143254/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143254/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dr = dso_local local_unnamed_addr global [4 x i32] [i32 -1, i32 0, i32 1, i32 0], align 16
@dc = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 -1, i32 0, i32 1], align 16
@v = dso_local local_unnamed_addr global [60 x [60 x i8]] zeroinitializer, align 16
@H = dso_local global i32 0, align 4
@W = dso_local global i32 0, align 4
@map = dso_local global [60 x [60 x i8]] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@visited = dso_local local_unnamed_addr global [60 x [60 x i8]] zeroinitializer, align 16
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %r, i32 noundef %c, i32 noundef %k) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end90.3, %entry
%r.tr = phi i32 [ %r, %entry ], [ %add55.3, %if.end90.3 ]
%c.tr = phi i32 [ %c, %entry ], [ %add59.3, %if.end90.3 ]
%k.tr = phi i32 [ %k, %entry ], [ %conv80.3, %if.end90.3 ]
%ret.tr = phi i32 [ poison, %entry ], [ %current.ret.tr, %if.end90.3 ]
%ret.known.tr = phi i1 [ false, %entry ], [ true, %if.end90.3 ]
%idxprom = sext i32 %r.tr to i64
%idxprom1 = sext i32 %c.tr to i64
%arrayidx2 = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %idxprom, i64 %idxprom1
%0 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%1 = trunc i32 %k.tr to i8
%conv3 = or i8 %0, %1
store i8 %conv3, ptr %arrayidx2, align 1, !tbaa !5
%2 = load i32, ptr @H, align 4
%3 = load i32, ptr @W, align 4
%4 = load i32, ptr @dr, align 16, !tbaa !8
%add = add nsw i32 %4, %r.tr
%5 = load i32, ptr @dc, align 16, !tbaa !8
%add9 = add nsw i32 %5, %c.tr
%cmp10 = icmp slt i32 %add, 0
br i1 %cmp10, label %if.end47.sink.split, label %lor.lhs.false
lor.lhs.false: ; preds = %tailrecurse
%cmp12 = icmp slt i32 %add, %2
%cmp15 = icmp sgt i32 %add9, -1
%or.cond.not132 = select i1 %cmp12, i1 %cmp15, i1 false
%cmp18.not = icmp slt i32 %add9, %3
%or.cond129 = select i1 %or.cond.not132, i1 %cmp18.not, i1 false
br i1 %or.cond129, label %if.else, label %if.end47.sink.split
if.else: ; preds = %lor.lhs.false
%idxprom23 = zext i32 %add to i64
%idxprom25 = zext i32 %add9 to i64
%arrayidx26 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom23, i64 %idxprom25
%6 = load i8, ptr %arrayidx26, align 1, !tbaa !5
switch i8 %6, label %if.end47 [
i8 66, label %if.end47.sink.split
i8 87, label %if.then42
]
if.then42: ; preds = %if.else
br label %if.end47.sink.split
if.end47.sink.split: ; preds = %if.else, %tailrecurse, %lor.lhs.false, %if.then42
%.sink146 = phi i8 [ 2, %if.then42 ], [ 4, %lor.lhs.false ], [ 4, %tailrecurse ], [ 1, %if.else ]
%7 = or i8 %conv3, %.sink146
store i8 %7, ptr %arrayidx2, align 1, !tbaa !5
br label %if.end47
if.end47: ; preds = %if.end47.sink.split, %if.else
%8 = phi i8 [ %conv3, %if.else ], [ %7, %if.end47.sink.split ]
%9 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dr, i64 0, i64 1), align 4, !tbaa !8
%add.1 = add nsw i32 %9, %r.tr
%10 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dc, i64 0, i64 1), align 4, !tbaa !8
%add9.1 = add nsw i32 %10, %c.tr
%cmp10.1 = icmp slt i32 %add.1, 0
br i1 %cmp10.1, label %if.end47.1.sink.split, label %lor.lhs.false.1
lor.lhs.false.1: ; preds = %if.end47
%cmp12.1 = icmp slt i32 %add.1, %2
%cmp15.1 = icmp sgt i32 %add9.1, -1
%or.cond.not132.1 = select i1 %cmp12.1, i1 %cmp15.1, i1 false
%cmp18.not.1 = icmp slt i32 %add9.1, %3
%or.cond129.1 = select i1 %or.cond.not132.1, i1 %cmp18.not.1, i1 false
br i1 %or.cond129.1, label %if.else.1, label %if.end47.1.sink.split
if.else.1: ; preds = %lor.lhs.false.1
%idxprom23.1 = zext i32 %add.1 to i64
%idxprom25.1 = zext i32 %add9.1 to i64
%arrayidx26.1 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom23.1, i64 %idxprom25.1
%11 = load i8, ptr %arrayidx26.1, align 1, !tbaa !5
switch i8 %11, label %if.end47.1 [
i8 66, label %if.then30.1
i8 87, label %if.end47.1.sink.split
]
if.then30.1: ; preds = %if.else.1
br label %if.end47.1.sink.split
if.end47.1.sink.split: ; preds = %if.end47, %lor.lhs.false.1, %if.else.1, %if.then30.1
%.sink = phi i8 [ 1, %if.then30.1 ], [ 2, %if.else.1 ], [ 4, %lor.lhs.false.1 ], [ 4, %if.end47 ]
%12 = or i8 %8, %.sink
store i8 %12, ptr %arrayidx2, align 1, !tbaa !5
br label %if.end47.1
if.end47.1: ; preds = %if.end47.1.sink.split, %if.else.1
%13 = phi i8 [ %8, %if.else.1 ], [ %12, %if.end47.1.sink.split ]
%14 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dr, i64 0, i64 2), align 8, !tbaa !8
%add.2 = add nsw i32 %14, %r.tr
%15 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dc, i64 0, i64 2), align 8, !tbaa !8
%add9.2 = add nsw i32 %15, %c.tr
%cmp10.2 = icmp slt i32 %add.2, 0
br i1 %cmp10.2, label %if.end47.2.sink.split, label %lor.lhs.false.2
lor.lhs.false.2: ; preds = %if.end47.1
%cmp12.2 = icmp slt i32 %add.2, %2
%cmp15.2 = icmp sgt i32 %add9.2, -1
%or.cond.not132.2 = select i1 %cmp12.2, i1 %cmp15.2, i1 false
%cmp18.not.2 = icmp slt i32 %add9.2, %3
%or.cond129.2 = select i1 %or.cond.not132.2, i1 %cmp18.not.2, i1 false
br i1 %or.cond129.2, label %if.else.2, label %if.end47.2.sink.split
if.else.2: ; preds = %lor.lhs.false.2
%idxprom23.2 = zext i32 %add.2 to i64
%idxprom25.2 = zext i32 %add9.2 to i64
%arrayidx26.2 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom23.2, i64 %idxprom25.2
%16 = load i8, ptr %arrayidx26.2, align 1, !tbaa !5
switch i8 %16, label %if.end47.2 [
i8 66, label %if.then30.2
i8 87, label %if.end47.2.sink.split
]
if.then30.2: ; preds = %if.else.2
br label %if.end47.2.sink.split
if.end47.2.sink.split: ; preds = %if.end47.1, %lor.lhs.false.2, %if.else.2, %if.then30.2
%.sink147 = phi i8 [ 1, %if.then30.2 ], [ 2, %if.else.2 ], [ 4, %lor.lhs.false.2 ], [ 4, %if.end47.1 ]
%17 = or i8 %13, %.sink147
store i8 %17, ptr %arrayidx2, align 1, !tbaa !5
br label %if.end47.2
if.end47.2: ; preds = %if.end47.2.sink.split, %if.else.2
%18 = phi i8 [ %13, %if.else.2 ], [ %17, %if.end47.2.sink.split ]
%19 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dr, i64 0, i64 3), align 4, !tbaa !8
%add.3 = add nsw i32 %19, %r.tr
%20 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dc, i64 0, i64 3), align 4, !tbaa !8
%add9.3 = add nsw i32 %20, %c.tr
%cmp10.3 = icmp slt i32 %add.3, 0
br i1 %cmp10.3, label %if.end47.3.sink.split, label %lor.lhs.false.3
lor.lhs.false.3: ; preds = %if.end47.2
%cmp12.3 = icmp slt i32 %add.3, %2
%cmp15.3 = icmp sgt i32 %add9.3, -1
%or.cond.not132.3 = select i1 %cmp12.3, i1 %cmp15.3, i1 false
%cmp18.not.3 = icmp slt i32 %add9.3, %3
%or.cond129.3 = select i1 %or.cond.not132.3, i1 %cmp18.not.3, i1 false
br i1 %or.cond129.3, label %if.else.3, label %if.end47.3.sink.split
if.else.3: ; preds = %lor.lhs.false.3
%idxprom23.3 = zext i32 %add.3 to i64
%idxprom25.3 = zext i32 %add9.3 to i64
%arrayidx26.3 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom23.3, i64 %idxprom25.3
%21 = load i8, ptr %arrayidx26.3, align 1, !tbaa !5
switch i8 %21, label %if.end47.3 [
i8 66, label %if.then30.3
i8 87, label %if.end47.3.sink.split
]
if.then30.3: ; preds = %if.else.3
br label %if.end47.3.sink.split
if.end47.3.sink.split: ; preds = %if.end47.2, %lor.lhs.false.3, %if.else.3, %if.then30.3
%.sink148 = phi i8 [ 1, %if.then30.3 ], [ 2, %if.else.3 ], [ 4, %lor.lhs.false.3 ], [ 4, %if.end47.2 ]
%22 = or i8 %18, %.sink148
store i8 %22, ptr %arrayidx2, align 1, !tbaa !5
br label %if.end47.3
if.end47.3: ; preds = %if.end47.3.sink.split, %if.else.3
%23 = phi i8 [ %18, %if.else.3 ], [ %22, %if.end47.3.sink.split ]
br i1 %cmp10, label %cleanup, label %lor.lhs.false62
lor.lhs.false62: ; preds = %if.end47.3
%cmp63 = icmp slt i32 %add, %2
%cmp66 = icmp sgt i32 %add9, -1
%or.cond96.not131 = select i1 %cmp63, i1 %cmp66, i1 false
%cmp69.not = icmp slt i32 %add9, %3
%or.cond130 = select i1 %or.cond96.not131, i1 %cmp69.not, i1 false
br i1 %or.cond130, label %lor.lhs.false71, label %cleanup
lor.lhs.false71: ; preds = %lor.lhs.false62
%idxprom72 = zext i32 %add to i64
%idxprom74 = zext i32 %add9 to i64
%arrayidx75 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom72, i64 %idxprom74
%24 = load i8, ptr %arrayidx75, align 1, !tbaa !5
%cmp77.not = icmp eq i8 %24, 46
br i1 %cmp77.not, label %lor.lhs.false79, label %cleanup
lor.lhs.false79: ; preds = %lor.lhs.false71
%arrayidx84 = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %idxprom72, i64 %idxprom74
%25 = load i8, ptr %arrayidx84, align 1, !tbaa !5
%and128 = and i8 %25, %23
%cmp87 = icmp eq i8 %and128, %23
br i1 %cmp87, label %cleanup, label %if.end90
if.end90: ; preds = %lor.lhs.false79
%conv80 = sext i8 %23 to i32
%call = tail call i32 @dfs(i32 noundef %add, i32 noundef %add9, i32 noundef %conv80)
%.pre = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dr, i64 0, i64 1), align 4, !tbaa !8
%.pre137 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dc, i64 0, i64 1), align 4, !tbaa !8
%.pre138 = add nsw i32 %.pre, %r.tr
%.pre139 = add nsw i32 %.pre137, %c.tr
br label %cleanup
cleanup: ; preds = %if.end47.3, %lor.lhs.false62, %lor.lhs.false71, %lor.lhs.false79, %if.end90
%add59.1.pre-phi = phi i32 [ %add9.1, %if.end47.3 ], [ %add9.1, %lor.lhs.false62 ], [ %add9.1, %lor.lhs.false71 ], [ %add9.1, %lor.lhs.false79 ], [ %.pre139, %if.end90 ]
%add55.1.pre-phi = phi i32 [ %add.1, %if.end47.3 ], [ %add.1, %lor.lhs.false62 ], [ %add.1, %lor.lhs.false71 ], [ %add.1, %lor.lhs.false79 ], [ %.pre138, %if.end90 ]
%cmp60.1 = icmp slt i32 %add55.1.pre-phi, 0
br i1 %cmp60.1, label %cleanup.1, label %lor.lhs.false62.1
lor.lhs.false62.1: ; preds = %cleanup
%26 = load i32, ptr @H, align 4, !tbaa !8
%cmp63.1 = icmp slt i32 %add55.1.pre-phi, %26
%cmp66.1 = icmp sgt i32 %add59.1.pre-phi, -1
%or.cond96.not131.1 = select i1 %cmp63.1, i1 %cmp66.1, i1 false
%27 = load i32, ptr @W, align 4
%cmp69.not.1 = icmp slt i32 %add59.1.pre-phi, %27
%or.cond130.1 = select i1 %or.cond96.not131.1, i1 %cmp69.not.1, i1 false
br i1 %or.cond130.1, label %lor.lhs.false71.1, label %cleanup.1
lor.lhs.false71.1: ; preds = %lor.lhs.false62.1
%idxprom72.1 = zext i32 %add55.1.pre-phi to i64
%idxprom74.1 = zext i32 %add59.1.pre-phi to i64
%arrayidx75.1 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom72.1, i64 %idxprom74.1
%28 = load i8, ptr %arrayidx75.1, align 1, !tbaa !5
%cmp77.not.1 = icmp eq i8 %28, 46
br i1 %cmp77.not.1, label %lor.lhs.false79.1, label %cleanup.1
lor.lhs.false79.1: ; preds = %lor.lhs.false71.1
%29 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%arrayidx84.1 = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %idxprom72.1, i64 %idxprom74.1
%30 = load i8, ptr %arrayidx84.1, align 1, !tbaa !5
%and128.1 = and i8 %30, %29
%cmp87.1 = icmp eq i8 %and128.1, %29
br i1 %cmp87.1, label %cleanup.1, label %if.end90.1
if.end90.1: ; preds = %lor.lhs.false79.1
%conv80.1 = sext i8 %29 to i32
%call.1 = tail call i32 @dfs(i32 noundef %add55.1.pre-phi, i32 noundef %add59.1.pre-phi, i32 noundef %conv80.1)
br label %cleanup.1
cleanup.1: ; preds = %if.end90.1, %lor.lhs.false79.1, %lor.lhs.false71.1, %lor.lhs.false62.1, %cleanup
%31 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dr, i64 0, i64 2), align 8, !tbaa !8
%add55.2 = add nsw i32 %31, %r.tr
%32 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dc, i64 0, i64 2), align 8, !tbaa !8
%add59.2 = add nsw i32 %32, %c.tr
%cmp60.2 = icmp slt i32 %add55.2, 0
br i1 %cmp60.2, label %cleanup.2, label %lor.lhs.false62.2
lor.lhs.false62.2: ; preds = %cleanup.1
%33 = load i32, ptr @H, align 4, !tbaa !8
%cmp63.2 = icmp slt i32 %add55.2, %33
%cmp66.2 = icmp sgt i32 %add59.2, -1
%or.cond96.not131.2 = select i1 %cmp63.2, i1 %cmp66.2, i1 false
%34 = load i32, ptr @W, align 4
%cmp69.not.2 = icmp slt i32 %add59.2, %34
%or.cond130.2 = select i1 %or.cond96.not131.2, i1 %cmp69.not.2, i1 false
br i1 %or.cond130.2, label %lor.lhs.false71.2, label %cleanup.2
lor.lhs.false71.2: ; preds = %lor.lhs.false62.2
%idxprom72.2 = zext i32 %add55.2 to i64
%idxprom74.2 = zext i32 %add59.2 to i64
%arrayidx75.2 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom72.2, i64 %idxprom74.2
%35 = load i8, ptr %arrayidx75.2, align 1, !tbaa !5
%cmp77.not.2 = icmp eq i8 %35, 46
br i1 %cmp77.not.2, label %lor.lhs.false79.2, label %cleanup.2
lor.lhs.false79.2: ; preds = %lor.lhs.false71.2
%36 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%arrayidx84.2 = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %idxprom72.2, i64 %idxprom74.2
%37 = load i8, ptr %arrayidx84.2, align 1, !tbaa !5
%and128.2 = and i8 %37, %36
%cmp87.2 = icmp eq i8 %and128.2, %36
br i1 %cmp87.2, label %cleanup.2, label %if.end90.2
if.end90.2: ; preds = %lor.lhs.false79.2
%conv80.2 = sext i8 %36 to i32
%call.2 = tail call i32 @dfs(i32 noundef %add55.2, i32 noundef %add59.2, i32 noundef %conv80.2)
br label %cleanup.2
cleanup.2: ; preds = %if.end90.2, %lor.lhs.false79.2, %lor.lhs.false71.2, %lor.lhs.false62.2, %cleanup.1
%38 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dr, i64 0, i64 3), align 4, !tbaa !8
%add55.3 = add nsw i32 %38, %r.tr
%39 = load i32, ptr getelementptr inbounds ([4 x i32], ptr @dc, i64 0, i64 3), align 4, !tbaa !8
%add59.3 = add nsw i32 %39, %c.tr
%cmp60.3 = icmp slt i32 %add55.3, 0
br i1 %cmp60.3, label %cleanup.3, label %lor.lhs.false62.3
lor.lhs.false62.3: ; preds = %cleanup.2
%40 = load i32, ptr @H, align 4, !tbaa !8
%cmp63.3 = icmp slt i32 %add55.3, %40
%cmp66.3 = icmp sgt i32 %add59.3, -1
%or.cond96.not131.3 = select i1 %cmp63.3, i1 %cmp66.3, i1 false
%41 = load i32, ptr @W, align 4
%cmp69.not.3 = icmp slt i32 %add59.3, %41
%or.cond130.3 = select i1 %or.cond96.not131.3, i1 %cmp69.not.3, i1 false
br i1 %or.cond130.3, label %lor.lhs.false71.3, label %cleanup.3
lor.lhs.false71.3: ; preds = %lor.lhs.false62.3
%idxprom72.3 = zext i32 %add55.3 to i64
%idxprom74.3 = zext i32 %add59.3 to i64
%arrayidx75.3 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %idxprom72.3, i64 %idxprom74.3
%42 = load i8, ptr %arrayidx75.3, align 1, !tbaa !5
%cmp77.not.3 = icmp eq i8 %42, 46
br i1 %cmp77.not.3, label %lor.lhs.false79.3, label %cleanup.3
lor.lhs.false79.3: ; preds = %lor.lhs.false71.3
%43 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%arrayidx84.3 = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %idxprom72.3, i64 %idxprom74.3
%44 = load i8, ptr %arrayidx84.3, align 1, !tbaa !5
%and128.3 = and i8 %44, %43
%cmp87.3 = icmp eq i8 %and128.3, %43
br i1 %cmp87.3, label %cleanup.3, label %if.end90.3
if.end90.3: ; preds = %lor.lhs.false79.3
%conv80.3 = sext i8 %43 to i32
%current.ret.tr = select i1 %ret.known.tr, i32 %ret.tr, i32 undef
br label %tailrecurse
cleanup.3: ; preds = %lor.lhs.false79.3, %lor.lhs.false71.3, %lor.lhs.false62.3, %cleanup.2
%current.ret.tr149 = select i1 %ret.known.tr, i32 %ret.tr, i32 undef
ret i32 %current.ret.tr149
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call118 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @W, ptr noundef nonnull @H)
%0 = load i32, ptr @W, align 4, !tbaa !8
%tobool.not119 = icmp eq i32 %0, 0
br i1 %tobool.not119, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end71
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3600) @map, i8 0, i64 3600, i1 false)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3600) @v, i8 0, i64 3600, i1 false)
%1 = load i32, ptr @H, align 4, !tbaa !8
%cmp98 = icmp sgt i32 %1, 0
br i1 %cmp98, label %for.body, label %for.end71
for.cond2.preheader: ; preds = %for.body
%cmp3102 = icmp sgt i32 %4, 0
%2 = load i32, ptr @W, align 4
%3 = icmp sgt i32 %2, 0
%or.cond = select i1 %cmp3102, i1 %3, i1 false
br i1 %or.cond, label %for.cond5.preheader, label %for.end71
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr @H, align 4, !tbaa !8
%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 !10
for.cond26.preheader: ; preds = %for.inc23
%cmp27110 = icmp sgt i32 %40, 0
br i1 %cmp27110, label %for.cond30.preheader.lr.ph, label %for.end71
for.cond30.preheader.lr.ph: ; preds = %for.cond26.preheader
%.pr = load i32, ptr @W, align 4, !tbaa !8
%cmp31104 = icmp sgt i32 %.pr, 0
br i1 %cmp31104, label %for.cond30.preheader.us.preheader, label %for.end71
for.cond30.preheader.us.preheader: ; preds = %for.cond30.preheader.lr.ph
%wide.trip.count136 = zext i32 %40 to i64
%wide.trip.count = zext i32 %.pr to i64
%min.iters.check = icmp ult i32 %.pr, 8
%n.vec = and i64 %wide.trip.count, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br label %for.cond30.preheader.us
for.cond30.preheader.us: ; preds = %for.cond30.preheader.us.preheader, %for.cond30.for.inc69_crit_edge.us
%indvars.iv133 = phi i64 [ 0, %for.cond30.preheader.us.preheader ], [ %indvars.iv.next134, %for.cond30.for.inc69_crit_edge.us ]
%w.0113.us = phi i32 [ 0, %for.cond30.preheader.us.preheader ], [ %add65.us.lcssa, %for.cond30.for.inc69_crit_edge.us ]
%b.0112.us = phi i32 [ 0, %for.cond30.preheader.us.preheader ], [ %add.us.lcssa, %for.cond30.for.inc69_crit_edge.us ]
br i1 %min.iters.check, label %for.body33.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond30.preheader.us
%6 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %w.0113.us, i64 0
%7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %b.0112.us, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %6, %vector.ph ], [ %22, %vector.body ]
%vec.phi153 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ]
%vec.phi154 = phi <4 x i32> [ %7, %vector.ph ], [ %16, %vector.body ]
%vec.phi155 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%8 = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %indvars.iv133, i64 %index
%wide.load = load <4 x i8>, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i8, ptr %8, i64 4
%wide.load156 = load <4 x i8>, ptr %9, align 4, !tbaa !5
%10 = and <4 x i8> %wide.load, <i8 -5, i8 -5, i8 -5, i8 -5>
%11 = and <4 x i8> %wide.load156, <i8 -5, i8 -5, i8 -5, i8 -5>
%12 = icmp eq <4 x i8> %10, <i8 1, i8 1, i8 1, i8 1>
%13 = icmp eq <4 x i8> %11, <i8 1, i8 1, i8 1, i8 1>
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi154, %14
%17 = add <4 x i32> %vec.phi155, %15
%18 = icmp eq <4 x i8> %10, <i8 2, i8 2, i8 2, i8 2>
%19 = icmp eq <4 x i8> %11, <i8 2, i8 2, i8 2, i8 2>
%20 = zext <4 x i1> %18 to <4 x i32>
%21 = zext <4 x i1> %19 to <4 x i32>
%22 = add <4 x i32> %vec.phi, %20
%23 = add <4 x i32> %vec.phi153, %21
%index.next = add nuw i64 %index, 8
%24 = icmp eq i64 %index.next, %n.vec
br i1 %24, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx157 = add <4 x i32> %17, %16
%25 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx157)
%bin.rdx = add <4 x i32> %23, %22
%26 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond30.for.inc69_crit_edge.us, label %for.body33.us.preheader
for.body33.us.preheader: ; preds = %for.cond30.preheader.us, %middle.block
%indvars.iv130.ph = phi i64 [ 0, %for.cond30.preheader.us ], [ %n.vec, %middle.block ]
%w.1107.us.ph = phi i32 [ %w.0113.us, %for.cond30.preheader.us ], [ %26, %middle.block ]
%b.1106.us.ph = phi i32 [ %b.0112.us, %for.cond30.preheader.us ], [ %25, %middle.block ]
br label %for.body33.us
for.body33.us: ; preds = %for.body33.us.preheader, %for.body33.us
%indvars.iv130 = phi i64 [ %indvars.iv.next131, %for.body33.us ], [ %indvars.iv130.ph, %for.body33.us.preheader ]
%w.1107.us = phi i32 [ %add65.us, %for.body33.us ], [ %w.1107.us.ph, %for.body33.us.preheader ]
%b.1106.us = phi i32 [ %add.us, %for.body33.us ], [ %b.1106.us.ph, %for.body33.us.preheader ]
%arrayidx37.us = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %indvars.iv133, i64 %indvars.iv130
%27 = load i8, ptr %arrayidx37.us, align 1, !tbaa !5
%28 = and i8 %27, -5
%spec.select.us = icmp eq i8 %28, 1
%lor.ext.us = zext i1 %spec.select.us to i32
%add.us = add nsw i32 %b.1106.us, %lor.ext.us
%29 = icmp eq i8 %28, 2
%lor.ext64.us = zext i1 %29 to i32
%add65.us = add nsw i32 %w.1107.us, %lor.ext64.us
%indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
%exitcond.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count
br i1 %exitcond.not, label %for.cond30.for.inc69_crit_edge.us, label %for.body33.us, !llvm.loop !15
for.cond30.for.inc69_crit_edge.us: ; preds = %for.body33.us, %middle.block
%add.us.lcssa = phi i32 [ %25, %middle.block ], [ %add.us, %for.body33.us ]
%add65.us.lcssa = phi i32 [ %26, %middle.block ], [ %add65.us, %for.body33.us ]
%indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
%exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count136
br i1 %exitcond137.not, label %for.end71, label %for.cond30.preheader.us, !llvm.loop !16
for.cond5.preheader: ; preds = %for.cond2.preheader, %for.inc23
%30 = phi i32 [ %40, %for.inc23 ], [ %4, %for.cond2.preheader ]
%31 = phi i32 [ %41, %for.inc23 ], [ %2, %for.cond2.preheader ]
%32 = phi i32 [ %42, %for.inc23 ], [ %2, %for.cond2.preheader ]
%indvars.iv127 = phi i64 [ %indvars.iv.next128, %for.inc23 ], [ 0, %for.cond2.preheader ]
%cmp6100 = icmp sgt i32 %32, 0
br i1 %cmp6100, label %for.body7.lr.ph, label %for.inc23
for.body7.lr.ph: ; preds = %for.cond5.preheader
%33 = trunc i64 %indvars.iv127 to i32
br label %for.body7
for.body7: ; preds = %for.body7.lr.ph, %for.inc20
%34 = phi i32 [ %31, %for.body7.lr.ph ], [ %38, %for.inc20 ]
%indvars.iv124 = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next125, %for.inc20 ]
%arrayidx11 = getelementptr inbounds [60 x [60 x i8]], ptr @v, i64 0, i64 %indvars.iv127, i64 %indvars.iv124
%35 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%tobool12.not = icmp eq i8 %35, 0
br i1 %tobool12.not, label %land.lhs.true, label %for.inc20
land.lhs.true: ; preds = %for.body7
%arrayidx16 = getelementptr inbounds [60 x [60 x i8]], ptr @map, i64 0, i64 %indvars.iv127, i64 %indvars.iv124
%36 = load i8, ptr %arrayidx16, align 1, !tbaa !5
%cmp17 = icmp eq i8 %36, 46
br i1 %cmp17, label %if.then, label %for.inc20
if.then: ; preds = %land.lhs.true
%37 = trunc i64 %indvars.iv124 to i32
%call19 = tail call i32 @dfs(i32 noundef %33, i32 noundef %37, i32 noundef 0)
%.pre = load i32, ptr @W, align 4, !tbaa !8
br label %for.inc20
for.inc20: ; preds = %for.body7, %land.lhs.true, %if.then
%38 = phi i32 [ %34, %for.body7 ], [ %34, %land.lhs.true ], [ %.pre, %if.then ]
%indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
%39 = sext i32 %38 to i64
%cmp6 = icmp slt i64 %indvars.iv.next125, %39
br i1 %cmp6, label %for.body7, label %for.inc23.loopexit, !llvm.loop !17
for.inc23.loopexit: ; preds = %for.inc20
%.pre138 = load i32, ptr @H, align 4, !tbaa !8
br label %for.inc23
for.inc23: ; preds = %for.inc23.loopexit, %for.cond5.preheader
%40 = phi i32 [ %.pre138, %for.inc23.loopexit ], [ %30, %for.cond5.preheader ]
%41 = phi i32 [ %38, %for.inc23.loopexit ], [ %31, %for.cond5.preheader ]
%42 = phi i32 [ %38, %for.inc23.loopexit ], [ %32, %for.cond5.preheader ]
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%43 = sext i32 %40 to i64
%cmp3 = icmp slt i64 %indvars.iv.next128, %43
br i1 %cmp3, label %for.cond5.preheader, label %for.cond26.preheader, !llvm.loop !18
for.end71: ; preds = %for.cond30.for.inc69_crit_edge.us, %while.body, %for.cond2.preheader, %for.cond30.preheader.lr.ph, %for.cond26.preheader
%b.0.lcssa = phi i32 [ 0, %for.cond26.preheader ], [ 0, %for.cond30.preheader.lr.ph ], [ 0, %for.cond2.preheader ], [ 0, %while.body ], [ %add.us.lcssa, %for.cond30.for.inc69_crit_edge.us ]
%w.0.lcssa = phi i32 [ 0, %for.cond26.preheader ], [ 0, %for.cond30.preheader.lr.ph ], [ 0, %for.cond2.preheader ], [ 0, %while.body ], [ %add65.us.lcssa, %for.cond30.for.inc69_crit_edge.us ]
%call72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %b.0.lcssa, i32 noundef %w.0.lcssa)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @W, ptr noundef nonnull @H)
%44 = load i32, ptr @W, align 4, !tbaa !8
%tobool.not = icmp eq i32 %44, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %for.end71, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !11, !14, !13}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11, !19}
!19 = !{!"llvm.loop.unswitch.partial.disable"}
!20 = distinct !{!20, !11}
|
#include <stdio.h>
#include <string.h>
#define put(x, y, z) (abacus[(x)][(y)] = z)
char abacus[8][6];
int main(){
int n, i, j, a, f = 0;
while(scanf("%d", &n) != EOF){
for(i = 0;i < 8;i++) for(j = 0;j < 5;j++) put(i, j, '*');
for(i = 0;i < 5;i++) put(2, i, '=');
for(i = 0;i < 5; i++){
a = n % 10;
n /= 10;
if(a < 5) put(1, 4 - i, ' ');
else if(a >= 5){
put(0, 4 - i, ' ');
a -= 5;
}
put(3 + a, 4 - i, ' ');
}
if(f) puts("");
for(i = 0; i < 8;i++) puts(abacus[i]);
f = 1;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143311/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143311/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@abacus = dso_local global [8 x [6 x i8]] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call76 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not77 = icmp eq i32 %call76, -1
br i1 %cmp.not77, label %while.end, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %entry
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5) @abacus, i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 3, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 4, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 5, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 6, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 7, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 2, i64 0), i8 61, i64 5, i1 false), !tbaa !5
%n.promoted.peel = load i32, ptr %n, align 4, !tbaa !8
%rem.peel = srem i32 %n.promoted.peel, 10
%div.peel = sdiv i32 %n.promoted.peel, 10
%cmp21.peel = icmp slt i32 %rem.peel, 5
br i1 %cmp21.peel, label %if.then.peel, label %if.then25.peel
if.then25.peel: ; preds = %for.cond.preheader.preheader
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 4), align 4, !tbaa !5
%sub29.peel = add nsw i32 %rem.peel, -5
br label %if.end30.peel
if.then.peel: ; preds = %for.cond.preheader.preheader
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 4), align 2, !tbaa !5
br label %if.end30.peel
if.end30.peel: ; preds = %if.then.peel, %if.then25.peel
%a.0.peel = phi i32 [ %rem.peel, %if.then.peel ], [ %sub29.peel, %if.then25.peel ]
%add.peel = add nsw i32 %a.0.peel, 3
%idxprom31.peel = sext i32 %add.peel to i64
%arrayidx35.peel = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.peel, i64 4
store i8 32, ptr %arrayidx35.peel, align 2, !tbaa !5
%rem.1.peel = srem i32 %div.peel, 10
%div.1.peel = sdiv i32 %n.promoted.peel, 100
%cmp21.1.peel = icmp slt i32 %rem.1.peel, 5
br i1 %cmp21.1.peel, label %if.then.1.peel, label %if.then25.1.peel
if.then25.1.peel: ; preds = %if.end30.peel
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 3), align 1, !tbaa !5
%sub29.1.peel = add nsw i32 %rem.1.peel, -5
br label %if.end30.1.peel
if.then.1.peel: ; preds = %if.end30.peel
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 3), align 1, !tbaa !5
br label %if.end30.1.peel
if.end30.1.peel: ; preds = %if.then.1.peel, %if.then25.1.peel
%a.0.1.peel = phi i32 [ %rem.1.peel, %if.then.1.peel ], [ %sub29.1.peel, %if.then25.1.peel ]
%add.1.peel = add nsw i32 %a.0.1.peel, 3
%idxprom31.1.peel = sext i32 %add.1.peel to i64
%arrayidx35.1.peel = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.1.peel, i64 3
store i8 32, ptr %arrayidx35.1.peel, align 1, !tbaa !5
%rem.2.peel = srem i32 %div.1.peel, 10
%div.2.peel = sdiv i32 %n.promoted.peel, 1000
%cmp21.2.peel = icmp slt i32 %rem.2.peel, 5
br i1 %cmp21.2.peel, label %if.then.2.peel, label %if.then25.2.peel
if.then25.2.peel: ; preds = %if.end30.1.peel
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 2), align 2, !tbaa !5
%sub29.2.peel = add nsw i32 %rem.2.peel, -5
br label %if.end30.2.peel
if.then.2.peel: ; preds = %if.end30.1.peel
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 2), align 8, !tbaa !5
br label %if.end30.2.peel
if.end30.2.peel: ; preds = %if.then.2.peel, %if.then25.2.peel
%a.0.2.peel = phi i32 [ %rem.2.peel, %if.then.2.peel ], [ %sub29.2.peel, %if.then25.2.peel ]
%add.2.peel = add nsw i32 %a.0.2.peel, 3
%idxprom31.2.peel = sext i32 %add.2.peel to i64
%arrayidx35.2.peel = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.2.peel, i64 2
store i8 32, ptr %arrayidx35.2.peel, align 2, !tbaa !5
%rem.3.peel = srem i32 %div.2.peel, 10
%div.3.peel = sdiv i32 %n.promoted.peel, 10000
%cmp21.3.peel = icmp slt i32 %rem.3.peel, 5
br i1 %cmp21.3.peel, label %if.then.3.peel, label %if.then25.3.peel
if.then25.3.peel: ; preds = %if.end30.2.peel
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 1), align 1, !tbaa !5
%sub29.3.peel = add nsw i32 %rem.3.peel, -5
br label %if.end30.3.peel
if.then.3.peel: ; preds = %if.end30.2.peel
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 1), align 1, !tbaa !5
br label %if.end30.3.peel
if.end30.3.peel: ; preds = %if.then.3.peel, %if.then25.3.peel
%a.0.3.peel = phi i32 [ %rem.3.peel, %if.then.3.peel ], [ %sub29.3.peel, %if.then25.3.peel ]
%add.3.peel = add nsw i32 %a.0.3.peel, 3
%idxprom31.3.peel = sext i32 %add.3.peel to i64
%arrayidx35.3.peel = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.3.peel, i64 1
store i8 32, ptr %arrayidx35.3.peel, align 1, !tbaa !5
%rem.4.peel = srem i32 %div.3.peel, 10
%div.4.peel = sdiv i32 %n.promoted.peel, 100000
%cmp21.4.peel = icmp slt i32 %rem.4.peel, 5
br i1 %cmp21.4.peel, label %if.then.4.peel, label %if.then25.4.peel
if.then25.4.peel: ; preds = %if.end30.3.peel
store i8 32, ptr @abacus, align 16, !tbaa !5
%sub29.4.peel = add nsw i32 %rem.4.peel, -5
br label %if.end41.peel
if.then.4.peel: ; preds = %if.end30.3.peel
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 0), align 2, !tbaa !5
br label %if.end41.peel
if.end41.peel: ; preds = %if.then25.4.peel, %if.then.4.peel
%a.0.4.peel = phi i32 [ %rem.4.peel, %if.then.4.peel ], [ %sub29.4.peel, %if.then25.4.peel ]
%add.4.peel = add nsw i32 %a.0.4.peel, 3
%idxprom31.4.peel = sext i32 %add.4.peel to i64
%arrayidx35.4.peel = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.4.peel, i64 0
store i8 32, ptr %arrayidx35.4.peel, align 2, !tbaa !5
store i32 %div.4.peel, ptr %n, align 4, !tbaa !8
%call47.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) @abacus)
%call47.1.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1))
%call47.2.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 2))
%call47.3.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 3))
%call47.4.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 4))
%call47.5.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 5))
%call47.6.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 6))
%call47.7.peel = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 7))
%call.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not.peel = icmp eq i32 %call.peel, -1
br i1 %cmp.not.peel, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end41.peel, %if.end41
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5) @abacus, i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 3, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 4, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 5, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 6, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 7, i64 0), i8 42, i64 5, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(5) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 2, i64 0), i8 61, i64 5, i1 false), !tbaa !5
%n.promoted = load i32, ptr %n, align 4, !tbaa !8
%rem = srem i32 %n.promoted, 10
%div = sdiv i32 %n.promoted, 10
%cmp21 = icmp slt i32 %rem, 5
br i1 %cmp21, label %if.then, label %if.then25
if.then: ; preds = %for.cond.preheader
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 4), align 2, !tbaa !5
br label %if.end30
if.then25: ; preds = %for.cond.preheader
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 4), align 4, !tbaa !5
%sub29 = add nsw i32 %rem, -5
br label %if.end30
if.end30: ; preds = %if.then25, %if.then
%a.0 = phi i32 [ %rem, %if.then ], [ %sub29, %if.then25 ]
%add = add nsw i32 %a.0, 3
%idxprom31 = sext i32 %add to i64
%arrayidx35 = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31, i64 4
store i8 32, ptr %arrayidx35, align 2, !tbaa !5
%rem.1 = srem i32 %div, 10
%div.1 = sdiv i32 %n.promoted, 100
%cmp21.1 = icmp slt i32 %rem.1, 5
br i1 %cmp21.1, label %if.then.1, label %if.then25.1
if.then25.1: ; preds = %if.end30
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 3), align 1, !tbaa !5
%sub29.1 = add nsw i32 %rem.1, -5
br label %if.end30.1
if.then.1: ; preds = %if.end30
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 3), align 1, !tbaa !5
br label %if.end30.1
if.end30.1: ; preds = %if.then.1, %if.then25.1
%a.0.1 = phi i32 [ %rem.1, %if.then.1 ], [ %sub29.1, %if.then25.1 ]
%add.1 = add nsw i32 %a.0.1, 3
%idxprom31.1 = sext i32 %add.1 to i64
%arrayidx35.1 = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.1, i64 3
store i8 32, ptr %arrayidx35.1, align 1, !tbaa !5
%rem.2 = srem i32 %div.1, 10
%div.2 = sdiv i32 %n.promoted, 1000
%cmp21.2 = icmp slt i32 %rem.2, 5
br i1 %cmp21.2, label %if.then.2, label %if.then25.2
if.then25.2: ; preds = %if.end30.1
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 2), align 2, !tbaa !5
%sub29.2 = add nsw i32 %rem.2, -5
br label %if.end30.2
if.then.2: ; preds = %if.end30.1
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 2), align 8, !tbaa !5
br label %if.end30.2
if.end30.2: ; preds = %if.then.2, %if.then25.2
%a.0.2 = phi i32 [ %rem.2, %if.then.2 ], [ %sub29.2, %if.then25.2 ]
%add.2 = add nsw i32 %a.0.2, 3
%idxprom31.2 = sext i32 %add.2 to i64
%arrayidx35.2 = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.2, i64 2
store i8 32, ptr %arrayidx35.2, align 2, !tbaa !5
%rem.3 = srem i32 %div.2, 10
%div.3 = sdiv i32 %n.promoted, 10000
%cmp21.3 = icmp slt i32 %rem.3, 5
br i1 %cmp21.3, label %if.then.3, label %if.then25.3
if.then25.3: ; preds = %if.end30.2
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 0, i64 1), align 1, !tbaa !5
%sub29.3 = add nsw i32 %rem.3, -5
br label %if.end30.3
if.then.3: ; preds = %if.end30.2
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 1), align 1, !tbaa !5
br label %if.end30.3
if.end30.3: ; preds = %if.then.3, %if.then25.3
%a.0.3 = phi i32 [ %rem.3, %if.then.3 ], [ %sub29.3, %if.then25.3 ]
%add.3 = add nsw i32 %a.0.3, 3
%idxprom31.3 = sext i32 %add.3 to i64
%arrayidx35.3 = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.3, i64 1
store i8 32, ptr %arrayidx35.3, align 1, !tbaa !5
%rem.4 = srem i32 %div.3, 10
%div.4 = sdiv i32 %n.promoted, 100000
%cmp21.4 = icmp slt i32 %rem.4, 5
br i1 %cmp21.4, label %if.then.4, label %if.then25.4
if.then25.4: ; preds = %if.end30.3
store i8 32, ptr @abacus, align 16, !tbaa !5
%sub29.4 = add nsw i32 %rem.4, -5
br label %if.end41
if.then.4: ; preds = %if.end30.3
store i8 32, ptr getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1, i64 0), align 2, !tbaa !5
br label %if.end41
if.end41: ; preds = %if.then.4, %if.then25.4
%a.0.4 = phi i32 [ %rem.4, %if.then.4 ], [ %sub29.4, %if.then25.4 ]
%add.4 = add nsw i32 %a.0.4, 3
%idxprom31.4 = sext i32 %add.4 to i64
%arrayidx35.4 = getelementptr inbounds [8 x [6 x i8]], ptr @abacus, i64 0, i64 %idxprom31.4, i64 0
store i8 32, ptr %arrayidx35.4, align 2, !tbaa !5
store i32 %div.4, ptr %n, align 4, !tbaa !8
%putchar = call i32 @putchar(i32 10)
%call47 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @abacus)
%call47.1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 1))
%call47.2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 2))
%call47.3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 3))
%call47.4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 4))
%call47.5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 5))
%call47.6 = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 6))
%call47.7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([8 x [6 x i8]], ptr @abacus, i64 0, i64 7))
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !10
while.end: ; preds = %if.end41, %if.end41.peel, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11, !12}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_SIZE_MAX 305 // 最大サイズ
// 内部変数
static FILE *szpFpI; // 入力
static int siW, siH; // 幅・高さ
static char sc2Mass[D_SIZE_MAX][D_SIZE_MAX]; // マス
static int si1SCnt[D_SIZE_MAX]; // イチゴ数
static int si2No[D_SIZE_MAX][D_SIZE_MAX]; // 番号
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpA;
static int siTNo;
#endif
// 1行出力
int
fOutLine(
char *pcpLine // <I> 1行
)
{
char lc1Buf[1024];
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, pcpLine)) {
siRes = -1;
}
#else
printf("%s", pcpLine);
#endif
return 0;
}
// 実行メイン
int
fMain(
)
{
int i, j, k;
char lc1Buf[2048], lc1Buf2[128];
// 幅・高さ - 取得
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d%d", &siH, &siW);
// マス - 取得
for (i = 0; i < siH; i++) {
fgets(sc2Mass[i], sizeof(sc2Mass[0]), szpFpI);
sc2Mass[i][siW] = '#';
// イチゴ数 - セット
for (j = 0; j < siW; j++) {
if (sc2Mass[i][j] == '#') {
si1SCnt[i]++;
}
}
}
si1SCnt[siH] = 1;
// 番号 - セット
int liNo = 1;
int liHSNo = 0;
while (liHSNo < siH) {
int liHENo, liHMNo;
// 範囲 - 行 - 取得
int liSCnt = 0;
for (liHENo = liHSNo; ; liHENo++) {
if (si1SCnt[liHENo] > 0) {
if (liSCnt == 0) {
liSCnt++;
liHMNo = liHENo;
}
else {
liHENo--;
break;
}
}
}
// イチゴ数でループ
int liWSNo = 0;
for (i = 0; i < si1SCnt[liHMNo]; i++) {
int liWENo;
// 範囲 - 列 - 取得
liSCnt = 0;
for (liWENo = liWSNo; ; liWENo++) {
if (sc2Mass[liHMNo][liWENo] == '#') {
if (liSCnt == 0) {
liSCnt++;
}
else {
liWENo--;
break;
}
}
}
// 番号 - セット
for (j = liHSNo; j <= liHENo; j++) {
for (k = liWSNo; k <= liWENo; k++) {
si2No[j][k] = liNo;
}
}
liNo++;
// 次の開始列
liWSNo = liWENo + 1;
}
// 次の開始行
liHSNo = liHENo + 1;
}
// 出力
for (i = 0; i < siH; i++) {
sprintf(lc1Buf, "%d", si2No[i][0]);
for (j = 1; j < siW; j++) {
sprintf(lc1Buf2, " %d", si2No[i][j]);
strcat(lc1Buf, lc1Buf2);
}
strcat(lc1Buf, "\n");
fOutLine(lc1Buf);
}
return 0;
}
// 1回実行
int
fOne(
)
{
int liRet;
char lc1Buf[1024];
// データ - 初期化
memset(si1SCnt, 0, sizeof(si1SCnt)); // イチゴ数
// 入力 - セット
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
szpFpI = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#else
szpFpI = stdin;
#endif
// 実行メイン
liRet = fMain();
// 残データ有無
#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_143355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143355/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%d%d\00", align 1
@siH = internal global i32 0, align 4
@siW = internal global i32 0, align 4
@sc2Mass = internal global [305 x [305 x i8]] zeroinitializer, align 16
@si1SCnt = internal unnamed_addr global [305 x i32] zeroinitializer, align 16
@si2No = internal unnamed_addr global [305 x [305 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @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 i32 @fMain() local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [2048 x i8], align 16
%lc1Buf2 = alloca [128 x i8], align 16
call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %lc1Buf) #6
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %lc1Buf2) #6
%0 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 2048, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull @siH, ptr noundef nonnull @siW) #6
%1 = load i32, ptr @siH, align 4, !tbaa !9
%cmp164 = icmp sgt i32 %1, 0
br i1 %cmp164, label %for.body, label %for.end23.thread
for.end23.thread: ; preds = %entry
%.pre = sext i32 %1 to i64
%arrayidx25228 = getelementptr inbounds [305 x i32], ptr @si1SCnt, i64 0, i64 %.pre
store i32 1, ptr %arrayidx25228, align 4, !tbaa !9
br label %for.end123
for.body: ; preds = %entry, %for.inc21
%indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.inc21 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [305 x [305 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv194
%2 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call4 = call ptr @fgets(ptr noundef nonnull %arrayidx, i32 noundef 305, ptr noundef %2)
%3 = load i32, ptr @siW, align 4, !tbaa !9
%idxprom7 = sext i32 %3 to i64
%arrayidx8 = getelementptr inbounds [305 x [305 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv194, i64 %idxprom7
store i8 35, ptr %arrayidx8, align 1, !tbaa !11
%cmp10162 = icmp sgt i32 %3, 0
br i1 %cmp10162, label %for.body11.lr.ph, label %for.inc21
for.body11.lr.ph: ; preds = %for.body
%arrayidx19 = getelementptr inbounds [305 x i32], ptr @si1SCnt, i64 0, i64 %indvars.iv194
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %3, 1
br i1 %4, label %for.inc21.loopexit.unr-lcssa, label %for.body11.lr.ph.new
for.body11.lr.ph.new: ; preds = %for.body11.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body11
for.body11: ; preds = %for.inc.1, %for.body11.lr.ph.new
%indvars.iv = phi i64 [ 0, %for.body11.lr.ph.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body11.lr.ph.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx15 = getelementptr inbounds [305 x [305 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv194, i64 %indvars.iv
%5 = load i8, ptr %arrayidx15, align 1, !tbaa !11
%cmp16 = icmp eq i8 %5, 35
br i1 %cmp16, label %if.then, label %for.inc
if.then: ; preds = %for.body11
%6 = load i32, ptr %arrayidx19, align 4, !tbaa !9
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx19, align 4, !tbaa !9
br label %for.inc
for.inc: ; preds = %for.body11, %if.then
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx15.1 = getelementptr inbounds [305 x [305 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv194, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx15.1, align 1, !tbaa !11
%cmp16.1 = icmp eq i8 %7, 35
br i1 %cmp16.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%8 = load i32, ptr %arrayidx19, align 4, !tbaa !9
%inc.1 = add nsw i32 %8, 1
store i32 %inc.1, ptr %arrayidx19, align 4, !tbaa !9
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.inc21.loopexit.unr-lcssa, label %for.body11, !llvm.loop !12
for.inc21.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body11.lr.ph
%indvars.iv.unr = phi i64 [ 0, %for.body11.lr.ph ], [ %indvars.iv.next.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc21, label %for.body11.epil
for.body11.epil: ; preds = %for.inc21.loopexit.unr-lcssa
%arrayidx15.epil = getelementptr inbounds [305 x [305 x i8]], ptr @sc2Mass, i64 0, i64 %indvars.iv194, i64 %indvars.iv.unr
%9 = load i8, ptr %arrayidx15.epil, align 1, !tbaa !11
%cmp16.epil = icmp eq i8 %9, 35
br i1 %cmp16.epil, label %if.then.epil, label %for.inc21
if.then.epil: ; preds = %for.body11.epil
%10 = load i32, ptr %arrayidx19, align 4, !tbaa !9
%inc.epil = add nsw i32 %10, 1
store i32 %inc.epil, ptr %arrayidx19, align 4, !tbaa !9
br label %for.inc21
for.inc21: ; preds = %for.inc21.loopexit.unr-lcssa, %if.then.epil, %for.body11.epil, %for.body
%indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
%11 = load i32, ptr @siH, align 4, !tbaa !9
%12 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next195, %12
br i1 %cmp, label %for.body, label %for.end23, !llvm.loop !14
for.end23: ; preds = %for.inc21
%arrayidx25 = getelementptr inbounds [305 x i32], ptr @si1SCnt, i64 0, i64 %12
store i32 1, ptr %arrayidx25, align 4, !tbaa !9
%cmp26182 = icmp sgt i32 %11, 0
br i1 %cmp26182, label %for.cond28.preheader, label %for.end123
while.cond.loopexit: ; preds = %for.cond69.for.end86_crit_edge.us, %for.cond49.preheader.preheader, %for.cond43.preheader
%liNo.1.lcssa = phi i32 [ %liNo.0183, %for.cond43.preheader ], [ %17, %for.cond49.preheader.preheader ], [ %inc87.us, %for.cond69.for.end86_crit_edge.us ]
%cmp26 = icmp sgt i32 %11, %15
br i1 %cmp26, label %for.cond28.preheader, label %for.cond92.preheader, !llvm.loop !15
for.cond28.preheader: ; preds = %for.end23, %while.cond.loopexit
%liHMNo.0185 = phi i32 [ %liHMNo.1, %while.cond.loopexit ], [ undef, %for.end23 ]
%liHSNo.0184 = phi i32 [ %15, %while.cond.loopexit ], [ 0, %for.end23 ]
%liNo.0183 = phi i32 [ %liNo.1.lcssa, %while.cond.loopexit ], [ 1, %for.end23 ]
%13 = sext i32 %liHSNo.0184 to i64
br label %for.cond28
for.cond92.preheader: ; preds = %while.cond.loopexit
br i1 %cmp26182, label %for.body95, label %for.end123
for.cond28: ; preds = %for.cond28.preheader, %for.inc40
%indvars.iv216 = phi i32 [ %liHSNo.0184, %for.cond28.preheader ], [ %indvars.iv.next217, %for.inc40 ]
%indvars.iv197 = phi i64 [ %13, %for.cond28.preheader ], [ %indvars.iv.next198, %for.inc40 ]
%liHMNo.1 = phi i32 [ %liHMNo.0185, %for.cond28.preheader ], [ %liHMNo.2, %for.inc40 ]
%liSCnt.0 = phi i32 [ 0, %for.cond28.preheader ], [ %liSCnt.1, %for.inc40 ]
%arrayidx30 = getelementptr inbounds [305 x i32], ptr @si1SCnt, i64 0, i64 %indvars.iv197
%14 = load i32, ptr %arrayidx30, align 4, !tbaa !9
%cmp31 = icmp sgt i32 %14, 0
br i1 %cmp31, label %if.then33, label %for.inc40
if.then33: ; preds = %for.cond28
%cmp34 = icmp eq i32 %liSCnt.0, 0
%15 = trunc i64 %indvars.iv197 to i32
br i1 %cmp34, label %for.inc40, label %for.cond43.preheader
for.cond43.preheader: ; preds = %if.then33
%idxprom44 = sext i32 %liHMNo.1 to i64
%arrayidx45 = getelementptr inbounds [305 x i32], ptr @si1SCnt, i64 0, i64 %idxprom44
%16 = load i32, ptr %arrayidx45, align 4, !tbaa !9
%cmp46170 = icmp sgt i32 %16, 0
br i1 %cmp46170, label %for.cond49.preheader.lr.ph, label %while.cond.loopexit
for.cond49.preheader.lr.ph: ; preds = %for.cond43.preheader
%cmp70.not.not168 = icmp slt i32 %liHSNo.0184, %15
br i1 %cmp70.not.not168, label %for.cond49.preheader.us.preheader, label %for.cond49.preheader.preheader
for.cond49.preheader.preheader: ; preds = %for.cond49.preheader.lr.ph
%17 = add i32 %liNo.0183, %16
br label %while.cond.loopexit
for.cond49.preheader.us.preheader: ; preds = %for.cond49.preheader.lr.ph
%wide.trip.count218 = sext i32 %indvars.iv216 to i64
br label %for.cond49.preheader.us
for.cond49.preheader.us: ; preds = %for.cond49.preheader.us.preheader, %for.cond69.for.end86_crit_edge.us
%liWSNo.0174.us = phi i32 [ %20, %for.cond69.for.end86_crit_edge.us ], [ 0, %for.cond49.preheader.us.preheader ]
%liNo.1172.us = phi i32 [ %inc87.us, %for.cond69.for.end86_crit_edge.us ], [ %liNo.0183, %for.cond49.preheader.us.preheader ]
%i.1171.us = phi i32 [ %inc89.us, %for.cond69.for.end86_crit_edge.us ], [ 0, %for.cond49.preheader.us.preheader ]
%18 = sext i32 %liWSNo.0174.us to i64
br label %for.cond49.us
for.cond49.us: ; preds = %for.inc66.us, %for.cond49.preheader.us
%indvars.iv209 = phi i32 [ %indvars.iv.next210, %for.inc66.us ], [ %liWSNo.0174.us, %for.cond49.preheader.us ]
%indvars.iv203 = phi i64 [ %indvars.iv.next204, %for.inc66.us ], [ %18, %for.cond49.preheader.us ]
%liSCnt.2.us = phi i32 [ %liSCnt.3.us, %for.inc66.us ], [ 0, %for.cond49.preheader.us ]
%arrayidx53.us = getelementptr inbounds [305 x [305 x i8]], ptr @sc2Mass, i64 0, i64 %idxprom44, i64 %indvars.iv203
%19 = load i8, ptr %arrayidx53.us, align 1, !tbaa !11
%cmp55.us = icmp eq i8 %19, 35
br i1 %cmp55.us, label %if.then57.us, label %for.inc66.us
if.then57.us: ; preds = %for.cond49.us
%cmp58.us = icmp eq i32 %liSCnt.2.us, 0
br i1 %cmp58.us, label %for.inc66.us, label %for.cond69.preheader.us
for.inc66.us: ; preds = %if.then57.us, %for.cond49.us
%liSCnt.3.us = phi i32 [ %liSCnt.2.us, %for.cond49.us ], [ 1, %if.then57.us ]
%indvars.iv.next204 = add i64 %indvars.iv203, 1
%indvars.iv.next210 = add i32 %indvars.iv209, 1
br label %for.cond49.us
for.cond69.preheader.us: ; preds = %if.then57.us
%20 = trunc i64 %indvars.iv203 to i32
%cmp74.not.not166.us = icmp slt i32 %liWSNo.0174.us, %20
br i1 %cmp74.not.not166.us, label %for.cond73.preheader.us.us.preheader, label %for.cond69.for.end86_crit_edge.us
for.cond73.preheader.us.us.preheader: ; preds = %for.cond69.preheader.us
%wide.trip.count211 = sext i32 %indvars.iv209 to i64
%21 = sub nsw i64 %wide.trip.count211, %18
%min.iters.check = icmp ult i64 %21, 8
%n.vec = and i64 %21, -8
%ind.end = add nsw i64 %n.vec, %18
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %liNo.1172.us, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%cmp.n = icmp eq i64 %21, %n.vec
br label %for.cond73.preheader.us.us
for.cond69.for.end86_crit_edge.us: ; preds = %for.cond73.for.inc84_crit_edge.us.us, %for.cond69.preheader.us
%inc87.us = add nsw i32 %liNo.1172.us, 1
%inc89.us = add nuw nsw i32 %i.1171.us, 1
%exitcond220.not = icmp eq i32 %inc89.us, %16
br i1 %exitcond220.not, label %while.cond.loopexit, label %for.cond49.preheader.us, !llvm.loop !16
for.cond73.preheader.us.us: ; preds = %for.cond73.preheader.us.us.preheader, %for.cond73.for.inc84_crit_edge.us.us
%indvars.iv213 = phi i64 [ %13, %for.cond73.preheader.us.us.preheader ], [ %indvars.iv.next214, %for.cond73.for.inc84_crit_edge.us.us ]
br i1 %min.iters.check, label %for.body76.us.us.preheader, label %vector.body
vector.body: ; preds = %for.cond73.preheader.us.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond73.preheader.us.us ]
%offset.idx = add i64 %index, %18
%22 = getelementptr inbounds [305 x [305 x i32]], ptr @si2No, i64 0, i64 %indvars.iv213, i64 %offset.idx
store <4 x i32> %broadcast.splat, ptr %22, align 4, !tbaa !9
%23 = getelementptr inbounds i32, ptr %22, i64 4
store <4 x i32> %broadcast.splat, ptr %23, align 4, !tbaa !9
%index.next = add nuw i64 %index, 8
%24 = icmp eq i64 %index.next, %n.vec
br i1 %24, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond73.for.inc84_crit_edge.us.us, label %for.body76.us.us.preheader
for.body76.us.us.preheader: ; preds = %for.cond73.preheader.us.us, %middle.block
%indvars.iv206.ph = phi i64 [ %18, %for.cond73.preheader.us.us ], [ %ind.end, %middle.block ]
br label %for.body76.us.us
for.body76.us.us: ; preds = %for.body76.us.us.preheader, %for.body76.us.us
%indvars.iv206 = phi i64 [ %indvars.iv.next207, %for.body76.us.us ], [ %indvars.iv206.ph, %for.body76.us.us.preheader ]
%arrayidx80.us.us = getelementptr inbounds [305 x [305 x i32]], ptr @si2No, i64 0, i64 %indvars.iv213, i64 %indvars.iv206
store i32 %liNo.1172.us, ptr %arrayidx80.us.us, align 4, !tbaa !9
%indvars.iv.next207 = add nsw i64 %indvars.iv206, 1
%exitcond212.not = icmp eq i64 %indvars.iv.next207, %wide.trip.count211
br i1 %exitcond212.not, label %for.cond73.for.inc84_crit_edge.us.us, label %for.body76.us.us, !llvm.loop !20
for.cond73.for.inc84_crit_edge.us.us: ; preds = %for.body76.us.us, %middle.block
%indvars.iv.next214 = add nsw i64 %indvars.iv213, 1
%exitcond219.not = icmp eq i64 %indvars.iv.next214, %wide.trip.count218
br i1 %exitcond219.not, label %for.cond69.for.end86_crit_edge.us, label %for.cond73.preheader.us.us, !llvm.loop !21
for.inc40: ; preds = %if.then33, %for.cond28
%liHMNo.2 = phi i32 [ %liHMNo.1, %for.cond28 ], [ %15, %if.then33 ]
%liSCnt.1 = phi i32 [ %liSCnt.0, %for.cond28 ], [ 1, %if.then33 ]
%indvars.iv.next198 = add i64 %indvars.iv197, 1
%indvars.iv.next217 = add i32 %indvars.iv216, 1
br label %for.cond28
for.body95: ; preds = %for.cond92.preheader, %for.end116
%indvars.iv224 = phi i64 [ %indvars.iv.next225, %for.end116 ], [ 0, %for.cond92.preheader ]
%arrayidx98 = getelementptr inbounds [305 x [305 x i32]], ptr @si2No, i64 0, i64 %indvars.iv224
%25 = load i32, ptr %arrayidx98, align 4, !tbaa !9
%call100 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %25) #6
%26 = load i32, ptr @siW, align 4, !tbaa !9
%cmp102186 = icmp sgt i32 %26, 1
br i1 %cmp102186, label %for.body104, label %for.end116
for.body104: ; preds = %for.body95, %for.body104
%indvars.iv221 = phi i64 [ %indvars.iv.next222, %for.body104 ], [ 1, %for.body95 ]
%arrayidx109 = getelementptr inbounds [305 x [305 x i32]], ptr @si2No, i64 0, i64 %indvars.iv224, i64 %indvars.iv221
%27 = load i32, ptr %arrayidx109, align 4, !tbaa !9
%call110 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf2, ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %27) #6
%call113 = call ptr @strcat(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) %lc1Buf2) #6
%indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
%28 = load i32, ptr @siW, align 4, !tbaa !9
%29 = sext i32 %28 to i64
%cmp102 = icmp slt i64 %indvars.iv.next222, %29
br i1 %cmp102, label %for.body104, label %for.end116, !llvm.loop !22
for.end116: ; preds = %for.body104, %for.body95
%strlen = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %lc1Buf)
%endptr = getelementptr inbounds i8, ptr %lc1Buf, i64 %strlen
store i16 10, ptr %endptr, align 1
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf)
%indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1
%30 = load i32, ptr @siH, align 4, !tbaa !9
%31 = sext i32 %30 to i64
%cmp93 = icmp slt i64 %indvars.iv.next225, %31
br i1 %cmp93, label %for.body95, label %for.end123, !llvm.loop !23
for.end123: ; preds = %for.end116, %for.end23, %for.end23.thread, %for.cond92.preheader
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %lc1Buf2) #6
call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %lc1Buf) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOne() local_unnamed_addr #0 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1220) @si1SCnt, i8 0, i64 1220, i1 false)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call = tail call i32 @fMain()
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1220) @si1SCnt, i8 0, i64 1220, i1 false)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call.i = tail call i32 @fMain()
ret i32 0
}
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !13, !19, !18}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
|
#include <stdio.h>
#include <math.h>
#define DBL(a) ((a) * (a))
#define EPS 1e-8
int
main()
{
char buf[256];
double x1, y1, x2, y2, x3, y3, xp, yp;
double s, a, b, c, p1, p2, p3;
double sur[4];
int i;
while (fgets(buf, 256, stdin)) {
sscanf(buf, "%lf%lf%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp);
a = sqrt(DBL(x2 - x3) + DBL(y2 - y3));
b = sqrt(DBL(x3 - x1) + DBL(y3 - y1));
c = sqrt(DBL(x1 - x2) + DBL(y1 - y2));
p1 = sqrt(DBL(xp - x1) + DBL(yp - y1));
p2 = sqrt(DBL(xp - x2) + DBL(yp - y2));
p3 = sqrt(DBL(xp - x3) + DBL(yp - y3));
s = (a + b + c) / 2;
sur[0] = sqrt(s * (s - a) * (s - b) * (s - c));
s = (a + p2 + p3) / 2;
sur[1] = sqrt(s * (s - a) * (s - p2) * (s - p3));
s = (b + p3 + p1) / 2;
sur[2] = sqrt(s * (s - b) * (s - p3) * (s - p1));
s = (c + p1 + p2) / 2;
sur[3] = sqrt(s * (s - c) * (s - p1) * (s - p2));
if (sur[1] + sur[2] + sur[3] - sur[0] < EPS)
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143399/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143399/source.c"
target datalayout = "e-m:e-p270: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 [25 x i8] c"%lf%lf%lf%lf%lf%lf%lf%lf\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%buf = alloca [256 x i8], align 16
%x1 = alloca double, align 8
%y1 = alloca double, align 8
%x2 = alloca double, align 8
%y2 = alloca double, align 8
%x3 = alloca double, align 8
%y3 = alloca double, align 8
%xp = alloca double, align 8
%yp = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %buf) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x3) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y3) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xp) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yp) #7
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call126 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 256, ptr noundef %0)
%tobool.not127 = icmp eq ptr %call126, null
br i1 %tobool.not127, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3, ptr noundef nonnull %xp, ptr noundef nonnull %yp) #7
%1 = load double, ptr %x2, align 8, !tbaa !9
%2 = load double, ptr %x3, align 8, !tbaa !9
%sub = fsub double %1, %2
%3 = load double, ptr %y2, align 8, !tbaa !9
%4 = load double, ptr %y3, align 8, !tbaa !9
%sub4 = fsub double %3, %4
%mul6 = fmul double %sub4, %sub4
%5 = call double @llvm.fmuladd.f64(double %sub, double %sub, double %mul6)
%sqrt125 = call double @llvm.sqrt.f64(double %5)
%6 = load double, ptr %x1, align 8, !tbaa !9
%7 = load double, ptr %y1, align 8, !tbaa !9
%8 = load double, ptr %xp, align 8, !tbaa !9
%9 = load double, ptr %yp, align 8, !tbaa !9
%sub32 = fsub double %8, %2
%sub34 = fsub double %9, %4
%mul36 = fmul double %sub34, %sub34
%10 = call double @llvm.fmuladd.f64(double %sub32, double %sub32, double %mul36)
%sqrt = call double @llvm.sqrt.f64(double %10)
%11 = insertelement <2 x double> poison, double %6, i64 0
%12 = insertelement <2 x double> %11, double %2, i64 1
%13 = insertelement <2 x double> poison, double %1, i64 0
%14 = insertelement <2 x double> %13, double %6, i64 1
%15 = fsub <2 x double> %12, %14
%16 = insertelement <2 x double> poison, double %7, i64 0
%17 = insertelement <2 x double> %16, double %4, i64 1
%18 = insertelement <2 x double> poison, double %3, i64 0
%19 = insertelement <2 x double> %18, double %7, i64 1
%20 = fsub <2 x double> %17, %19
%21 = fmul <2 x double> %20, %20
%22 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %15, <2 x double> %15, <2 x double> %21)
%23 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %22)
%24 = extractelement <2 x double> %23, i64 1
%add = fadd double %sqrt125, %24
%25 = extractelement <2 x double> %23, i64 0
%add38 = fadd double %add, %25
%div = fmul double %add38, 5.000000e-01
%sub39 = fsub double %div, %sqrt125
%mul = fmul double %div, %sub39
%26 = insertelement <2 x double> poison, double %div, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = fsub <2 x double> %27, %23
%29 = extractelement <2 x double> %28, i64 1
%mul41 = fmul double %29, %mul
%30 = extractelement <2 x double> %28, i64 0
%mul43 = fmul double %30, %mul41
%call44 = call double @sqrt(double noundef %mul43) #7
%add56 = fadd double %24, %sqrt
%31 = insertelement <2 x double> poison, double %8, i64 0
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
%33 = fsub <2 x double> %32, %14
%34 = insertelement <2 x double> poison, double %9, i64 0
%35 = shufflevector <2 x double> %34, <2 x double> poison, <2 x i32> zeroinitializer
%36 = fsub <2 x double> %35, %19
%37 = fmul <2 x double> %36, %36
%38 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> %33, <2 x double> %37)
%39 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %38)
%40 = extractelement <2 x double> %39, i64 0
%add45 = fadd double %sqrt125, %40
%add46 = fadd double %add45, %sqrt
%div47 = fmul double %add46, 5.000000e-01
%sub48 = fsub double %div47, %sqrt125
%mul49 = fmul double %div47, %sub48
%sub50 = fsub double %div47, %40
%mul51 = fmul double %sub50, %mul49
%sub52 = fsub double %div47, %sqrt
%mul53 = fmul double %sub52, %mul51
%call54 = call double @sqrt(double noundef %mul53) #7
%41 = extractelement <2 x double> %39, i64 1
%add57 = fadd double %41, %add56
%div58 = fmul double %add57, 5.000000e-01
%sub59 = fsub double %div58, %24
%mul60 = fmul double %div58, %sub59
%sub61 = fsub double %div58, %sqrt
%mul62 = fmul double %sub61, %mul60
%sub63 = fsub double %div58, %41
%mul64 = fmul double %sub63, %mul62
%call65 = call double @sqrt(double noundef %mul64) #7
%add67 = fadd double %25, %41
%add68 = fadd double %add67, %40
%div69 = fmul double %add68, 5.000000e-01
%sub70 = fsub double %div69, %25
%mul71 = fmul double %div69, %sub70
%42 = insertelement <2 x double> poison, double %div69, i64 0
%43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
%44 = fsub <2 x double> %43, %39
%45 = extractelement <2 x double> %44, i64 1
%mul73 = fmul double %45, %mul71
%46 = extractelement <2 x double> %44, i64 0
%mul75 = fmul double %46, %mul73
%call76 = call double @sqrt(double noundef %mul75) #7
%add80 = fadd double %call54, %call65
%add82 = fadd double %add80, %call76
%sub84 = fsub double %add82, %call44
%cmp = fcmp olt double %sub84, 1.000000e-08
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%47 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 256, ptr noundef %47)
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yp) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xp) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y3) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x3) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #7
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %buf) #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 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: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !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>
#include <math.h>
int main()
{
double x[3];
double y[3];
double point[2];
int i;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&point[0],&point[1]) != EOF)
{
double Tsurface;
double Psurface;
x[1] -= x[0];
x[2] -= x[0];
point[0] -= x[0];
y[1] -= y[0];
y[2] -= y[0];
point[1] -= y[0];
Tsurface = 0.5*fabs(x[1]*y[2]-x[2]*y[1]);
Psurface = 0.5*(fabs(x[1]*point[1]-point[0]*y[1])+fabs(x[2]*point[1]-point[0]*y[2]));
x[1] -= point[0];
x[2] -= point[0];
y[1] -= point[1];
y[2] -= point[1];
Psurface += 0.5*fabs(x[1]*y[2]-x[2]*y[1]);
if(Psurface > Tsurface)
{
printf("NO\n");
}
else
{
printf("YES\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143485/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143485/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [32 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [3 x double], align 16
%y = alloca [3 x double], align 16
%point = alloca [2 x double], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %y) #6
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %point) #6
%arrayidx2 = getelementptr inbounds [3 x double], ptr %x, i64 0, i64 1
%arrayidx3 = getelementptr inbounds [3 x double], ptr %y, i64 0, i64 1
%arrayidx4 = getelementptr inbounds [3 x double], ptr %x, i64 0, i64 2
%arrayidx5 = getelementptr inbounds [3 x double], ptr %y, i64 0, i64 2
%arrayidx7 = getelementptr inbounds [2 x double], ptr %point, i64 0, i64 1
%call70 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %point, ptr noundef nonnull %arrayidx7)
%cmp.not71 = icmp eq i32 %call70, -1
br i1 %cmp.not71, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load <2 x double>, ptr %x, align 16
%1 = load double, ptr %y, align 16, !tbaa !5
%2 = load <2 x double>, ptr %point, align 16, !tbaa !5
%3 = insertelement <2 x double> %0, double %1, i64 1
%4 = fsub <2 x double> %2, %3
store <2 x double> %4, ptr %point, align 16, !tbaa !5
%5 = extractelement <2 x double> %4, i64 0
%6 = fneg double %5
%7 = load <2 x double>, ptr %arrayidx2, align 8, !tbaa !5
%8 = shufflevector <2 x double> %0, <2 x double> poison, <2 x i32> zeroinitializer
%9 = fsub <2 x double> %7, %8
%10 = extractelement <2 x double> %9, i64 1
%11 = fneg double %10
%12 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> zeroinitializer
%13 = fsub <2 x double> %9, %12
store <2 x double> %13, ptr %arrayidx2, align 8, !tbaa !5
%14 = load <2 x double>, ptr %arrayidx3, align 8, !tbaa !5
%15 = insertelement <2 x double> poison, double %1, i64 0
%16 = shufflevector <2 x double> %15, <2 x double> poison, <2 x i32> zeroinitializer
%17 = fsub <2 x double> %14, %16
%18 = extractelement <2 x double> %17, i64 0
%neg = fmul double %18, %11
%19 = extractelement <2 x double> %9, i64 0
%20 = extractelement <2 x double> %17, i64 1
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double %neg)
%22 = call double @llvm.fabs.f64(double %21)
%mul = fmul double %22, 5.000000e-01
%23 = insertelement <2 x double> poison, double %6, i64 0
%24 = shufflevector <2 x double> %23, <2 x double> poison, <2 x i32> zeroinitializer
%25 = fmul <2 x double> %17, %24
%26 = shufflevector <2 x double> %4, <2 x double> poison, <2 x i32> <i32 1, i32 1>
%27 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %9, <2 x double> %26, <2 x double> %25)
%28 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %27)
%shift = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%29 = fadd <2 x double> %28, %shift
%add = extractelement <2 x double> %29, i64 0
%mul44 = fmul double %add, 5.000000e-01
%30 = fsub <2 x double> %17, %26
store <2 x double> %30, ptr %arrayidx3, align 8, !tbaa !5
%31 = extractelement <2 x double> %13, i64 1
%32 = fneg double %31
%33 = extractelement <2 x double> %30, i64 0
%neg63 = fmul double %33, %32
%34 = extractelement <2 x double> %13, i64 0
%35 = extractelement <2 x double> %30, i64 1
%36 = call double @llvm.fmuladd.f64(double %34, double %35, double %neg63)
%37 = call double @llvm.fabs.f64(double %36)
%38 = call double @llvm.fmuladd.f64(double %37, double 5.000000e-01, double %mul44)
%cmp65 = fcmp ogt double %38, %mul
%str.3.str = select i1 %cmp65, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %point, ptr noundef nonnull %arrayidx7)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %point) #6
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %x) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fabs.v2f64(<2 x double>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
double x1,x2,x3,y1,y2,y3,xp,yp;
double ab[2],ac[2],ap[2];
double alpha, beta;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &x1,&y1,&x2,&y2,&x3,&y3,&xp,&yp) != EOF){
ab[0] = x2 - x1;
ab[1] = y2 - y1;
ac[0] = x3 - x1;
ac[1] = y3 - y1;
ap[0] = xp - x1;
ap[1] = yp - y1;
alpha = (ap[0]*ac[1]-ac[0]*ap[1])/(ab[0]*ac[1]-ac[0]*ab[1]);
beta = (ap[0]*ab[1]-ab[0]*ap[1])/(ac[0]*ab[1]-ab[0]*ac[1]);
if(alpha+beta<=1 && alpha >= 0 && beta >=0){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143528/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143528/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [32 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca double, align 8
%x2 = alloca double, align 8
%x3 = alloca double, align 8
%y1 = alloca double, align 8
%y2 = alloca double, align 8
%y3 = alloca double, align 8
%xp = alloca double, align 8
%yp = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x3) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y3) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xp) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yp) #5
%call55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3, ptr noundef nonnull %xp, ptr noundef nonnull %yp)
%cmp.not56 = icmp eq i32 %call55, -1
br i1 %cmp.not56, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load double, ptr %x2, align 8, !tbaa !5
%1 = load double, ptr %x1, align 8, !tbaa !5
%sub = fsub double %0, %1
%2 = load double, ptr %y2, align 8, !tbaa !5
%3 = load double, ptr %y1, align 8, !tbaa !5
%sub1 = fsub double %2, %3
%4 = load double, ptr %x3, align 8, !tbaa !5
%5 = load double, ptr %y3, align 8, !tbaa !5
%6 = load double, ptr %xp, align 8, !tbaa !5
%7 = load double, ptr %yp, align 8, !tbaa !5
%8 = fneg double %sub
%9 = insertelement <2 x double> poison, double %6, i64 0
%10 = insertelement <2 x double> %9, double %4, i64 1
%11 = insertelement <2 x double> poison, double %1, i64 0
%12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer
%13 = fsub <2 x double> %10, %12
%14 = insertelement <2 x double> poison, double %7, i64 0
%15 = insertelement <2 x double> %14, double %5, i64 1
%16 = insertelement <2 x double> poison, double %3, i64 0
%17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
%18 = fsub <2 x double> %15, %17
%19 = extractelement <2 x double> %13, i64 1
%20 = fneg double %19
%21 = insertelement <2 x double> %18, double %sub1, i64 1
%22 = insertelement <2 x double> poison, double %20, i64 0
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> zeroinitializer
%24 = fmul <2 x double> %21, %23
%25 = insertelement <2 x double> %13, double %sub, i64 1
%26 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> <i32 1, i32 1>
%27 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> %26, <2 x double> %24)
%28 = insertelement <2 x double> poison, double %8, i64 0
%29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
%30 = fmul <2 x double> %18, %29
%31 = insertelement <2 x double> poison, double %sub1, i64 0
%32 = shufflevector <2 x double> %31, <2 x double> poison, <2 x i32> zeroinitializer
%33 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %32, <2 x double> %30)
%34 = shufflevector <2 x double> %27, <2 x double> %33, <2 x i32> <i32 0, i32 2>
%35 = shufflevector <2 x double> %27, <2 x double> %33, <2 x i32> <i32 1, i32 3>
%36 = fdiv <2 x double> %34, %35
%37 = extractelement <2 x double> %36, i64 0
%38 = extractelement <2 x double> %36, i64 1
%add = fadd double %37, %38
%cmp35 = fcmp ole double %add, 1.000000e+00
%cmp36 = fcmp oge double %37, 0.000000e+00
%or.cond = and i1 %cmp36, %cmp35
%cmp38 = fcmp oge double %38, 0.000000e+00
%or.cond41 = and i1 %cmp38, %or.cond
%str.3.str = select i1 %or.cond41, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3, ptr noundef nonnull %xp, ptr noundef nonnull %yp)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yp) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xp) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y3) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x3) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #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 <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main(void)
{
double x1, y1, x2, y2, x3, y3, xp, yp;
double pa[2], pb[2], pc[2], ab[2], ac[2], bc[2];
double z1, z2, z3;
int i;
while(fscanf(stdin,"%lf %lf %lf %lf %lf %lf %lf %lf", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp) != EOF){
//ベクトルの計算
pa[0] = xp - x1;
//printf("%lf\n", pa[1]);
pa[1] = yp - y1;
//printf("%lf\n", pa[2]);
pb[0] = xp - x2;
//printf("%lf\n", pb[1]);
pb[1] = yp - y2;
//printf("%lf\n", pb[2]);
pc[0] = xp - x3;
//printf("%lf\n", pc[1]);
pc[1] = yp - y3;
//printf("%lf\n", pc[2]);
//外積の計算
//ベクトルaとベクトルbの計算
z1 = pa[0] * pb[1] - pa[1] * pb[0];
//ベクトルaとベクトルbの計算
z2 = pc[0] * pa[1] - pc[1] * pa[0];
//ベクトルbとベクトルcの計算
z3 = pb[0] * pc[1] - pb[1] * pc[0];
//printf("%lf, %lf, %lf\n", z1, z2, z3);
if (z1 > 0.0 && z2 > 0.0 && z3 > 0.0){
printf("YES\n");
}else if (z1 < 0.0 && z2 < 0.0 && z3 < 0.0){
printf("YES\n");
}else {
printf("NO\n");
}
}
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143571/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143571/source.c"
target datalayout = "e-m:e-p270: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 [32 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca double, align 8
%y1 = alloca double, align 8
%x2 = alloca double, align 8
%y2 = alloca double, align 8
%x3 = alloca double, align 8
%y3 = alloca double, align 8
%xp = alloca double, align 8
%yp = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x3) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y3) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xp) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yp) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call57 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3, ptr noundef nonnull %xp, ptr noundef nonnull %yp) #5
%cmp.not58 = icmp eq i32 %call57, -1
br i1 %cmp.not58, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end42
%1 = load double, ptr %xp, align 8, !tbaa !9
%2 = load double, ptr %x1, align 8, !tbaa !9
%sub = fsub double %1, %2
%3 = load double, ptr %yp, align 8, !tbaa !9
%4 = load double, ptr %y1, align 8, !tbaa !9
%sub1 = fsub double %3, %4
%5 = load double, ptr %x2, align 8, !tbaa !9
%sub3 = fsub double %1, %5
%6 = load double, ptr %y2, align 8, !tbaa !9
%sub5 = fsub double %3, %6
%7 = load double, ptr %x3, align 8, !tbaa !9
%sub7 = fsub double %1, %7
%8 = load double, ptr %y3, align 8, !tbaa !9
%sub9 = fsub double %3, %8
%9 = fneg double %sub1
%neg = fmul double %sub3, %9
%10 = call double @llvm.fmuladd.f64(double %sub, double %sub5, double %neg)
%11 = fneg double %sub9
%neg21 = fmul double %sub, %11
%12 = call double @llvm.fmuladd.f64(double %sub7, double %sub1, double %neg21)
%13 = fneg double %sub5
%neg27 = fmul double %sub7, %13
%14 = call double @llvm.fmuladd.f64(double %sub3, double %sub9, double %neg27)
%cmp28 = fcmp ogt double %10, 0.000000e+00
%cmp29 = fcmp ogt double %12, 0.000000e+00
%or.cond = select i1 %cmp28, i1 %cmp29, i1 false
%cmp31 = fcmp ogt double %14, 0.000000e+00
%or.cond43 = select i1 %or.cond, i1 %cmp31, i1 false
br i1 %or.cond43, label %if.end42, label %if.else
if.else: ; preds = %while.body
%cmp33 = fcmp olt double %10, 0.000000e+00
%cmp35 = fcmp olt double %12, 0.000000e+00
%or.cond44 = select i1 %cmp33, i1 %cmp35, i1 false
%cmp37 = fcmp olt double %14, 0.000000e+00
%or.cond45 = select i1 %or.cond44, i1 %cmp37, i1 false
%str.3.str = select i1 %or.cond45, ptr @str.4, ptr @str
br label %if.end42
if.end42: ; preds = %if.else, %while.body
%str.3.sink = phi ptr [ @str.4, %while.body ], [ %str.3.str, %if.else ]
%puts55 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
%15 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %15, ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3, ptr noundef nonnull %xp, ptr noundef nonnull %yp) #5
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %if.end42, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yp) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xp) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y3) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x3) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #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
declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="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 = !{!"any pointer", !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()
{
int n;
scanf("%d", &n);
int i;
int a[100005];
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
int k = 0;
for (i = 0; i < n; i++)
if (a[i] % 2 == 1)
k++;
if (k % 2 == 0)
printf("YES\n");
else
printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143614/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143614/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [100005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %a) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %0, 0
br i1 %cmp25, label %for.body, label %if.end17
for.cond2.preheader: ; preds = %for.body
%cmp327 = icmp sgt i32 %13, 0
br i1 %cmp327, label %for.body4.preheader, label %if.end17
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %13 to i64
%min.iters.check = icmp ult i32 %13, 8
br i1 %min.iters.check, label %for.body4.preheader42, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%vec.phi40 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%1 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load41 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = and <4 x i32> %wide.load, <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647>
%4 = and <4 x i32> %wide.load41, <i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647>
%5 = icmp eq <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%6 = icmp eq <4 x i32> %4, <i32 1, i32 1, i32 1, i32 1>
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = add <4 x i32> %vec.phi, %7
%10 = add <4 x i32> %vec.phi40, %8
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %10, %9
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end11, label %for.body4.preheader42
for.body4.preheader42: ; preds = %for.body4.preheader, %middle.block
%indvars.iv33.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%k.029.ph = phi i32 [ 0, %for.body4.preheader ], [ %12, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100005 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
%13 = load i32, ptr %n, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader42, %for.body4
%indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.body4 ], [ %indvars.iv33.ph, %for.body4.preheader42 ]
%k.029 = phi i32 [ %spec.select, %for.body4 ], [ %k.029.ph, %for.body4.preheader42 ]
%arrayidx6 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv33
%15 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%16 = and i32 %15, -2147483647
%cmp7 = icmp eq i32 %16, 1
%inc8 = zext i1 %cmp7 to i32
%spec.select = add nuw nsw i32 %k.029, %inc8
%indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
%exitcond.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count
br i1 %exitcond.not, label %for.end11, label %for.body4, !llvm.loop !14
for.end11: ; preds = %for.body4, %middle.block
%spec.select.lcssa = phi i32 [ %12, %middle.block ], [ %spec.select, %for.body4 ]
%17 = and i32 %spec.select.lcssa, 1
%18 = icmp eq i32 %17, 0
%spec.select39 = select i1 %18, ptr @str.3, ptr @str
br label %if.end17
if.end17: ; preds = %for.end11, %for.cond2.preheader, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ @str.3, %for.cond2.preheader ], [ %spec.select39, %for.end11 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main(void){
int N;
scanf("%d", &N );
int A;
int k = 0;
int i;
int ans = 1;
int num = 0;
for( i = 0; i < N; i++ ){
scanf("%d", &A);
num++;
if( A % 2 ) k++;
}
if( (k % 2) && num != 1 ) ans = 0;
if( ans )puts("YES");
else{ puts("NO");}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143665/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143665/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = 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)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body, label %if.end13
for.body: ; preds = %entry, %for.body
%num.020 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%k.018 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%inc = add nuw nsw i32 %num.020, 1
%1 = load i32, ptr %A, align 4, !tbaa !5
%2 = and i32 %1, 1
%spec.select = add i32 %2, %k.018
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%4 = and i32 %spec.select, 1
%5 = icmp ne i32 %4, 0
%6 = icmp ne i32 %num.020, 0
%7 = and i1 %5, %6
%spec.select23 = select i1 %7, ptr @.str.2, ptr @.str.1
br label %if.end13
if.end13: ; preds = %for.end, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %spec.select23, %for.end ]
%call12 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int i,l,a,x,b,r,num;
for(i = 0; i <1000; i++){
scanf("%d %d", &a, &b);
if(a == 0 && b == 0) break;
if(a < b){
x = b;
b = a;
a = x;
}
num = 0;
for(l = 0; b != 0; l++){
r = a%b;
a = b;
b = r;
num++;
}
printf("%d %d\n", a, num);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143708/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143708/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
br label %for.body
for.body: ; preds = %entry, %for.end
%i.020 = phi i32 [ 0, %entry ], [ %inc12, %for.end ]
%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
%cmp1 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp2 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %or.cond, label %for.end13, label %if.end
if.end: ; preds = %for.body
%cmp3 = icmp slt i32 %0, %1
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %0, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%a.promoted = phi i32 [ %1, %if.then4 ], [ %0, %if.end ]
%.pr = phi i32 [ %0, %if.then4 ], [ %1, %if.end ]
%cmp7.not18 = icmp eq i32 %.pr, 0
br i1 %cmp7.not18, label %for.end, label %for.body8
for.body8: ; preds = %if.end5, %for.body8
%num.019 = phi i32 [ %inc, %for.body8 ], [ 0, %if.end5 ]
%2 = phi i32 [ %rem, %for.body8 ], [ %.pr, %if.end5 ]
%3 = phi i32 [ %2, %for.body8 ], [ %a.promoted, %if.end5 ]
%rem = srem i32 %3, %2
%inc = add nuw nsw i32 %num.019, 1
%cmp7.not = icmp eq i32 %rem, 0
br i1 %cmp7.not, label %for.cond6.for.end_crit_edge, label %for.body8, !llvm.loop !9
for.cond6.for.end_crit_edge: ; preds = %for.body8
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 0, ptr %b, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond6.for.end_crit_edge, %if.end5
%4 = phi i32 [ %2, %for.cond6.for.end_crit_edge ], [ %a.promoted, %if.end5 ]
%num.0.lcssa = phi i32 [ %inc, %for.cond6.for.end_crit_edge ], [ 0, %if.end5 ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %num.0.lcssa)
%inc12 = add nuw nsw i32 %i.020, 1
%exitcond.not = icmp eq i32 %inc12, 1000
br i1 %exitcond.not, label %for.end13, label %for.body, !llvm.loop !11
for.end13: ; preds = %for.body, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int count = 0;
void init(void)
{
count = 0;
}
int gcd(int x, int y)
{
count++;
return (y ? gcd(y, x % y) : x);
}
int main(void)
{
int x, y;
int res;
while (scanf("%d %d", &x, &y), x){
init();
if (x > y){
res = gcd(x, y);
}
else {
res = gcd(y, x);
}
printf("%d %d\n", res, count - 1);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [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: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init() local_unnamed_addr #0 {
entry:
store i32 0, ptr @count, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #1 {
entry:
%count.promoted = load i32, ptr @count, align 4, !tbaa !5
%inc5 = add nsw i32 %count.promoted, 1
%tobool.not6 = icmp eq i32 %y, 0
br i1 %tobool.not6, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%inc9 = phi i32 [ %inc, %cond.true ], [ %inc5, %entry ]
%y.tr8 = phi i32 [ %rem, %cond.true ], [ %y, %entry ]
%x.tr7 = phi i32 [ %y.tr8, %cond.true ], [ %x, %entry ]
%rem = srem i32 %x.tr7, %y.tr8
%inc = add nsw i32 %inc9, 1
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%inc.lcssa = phi i32 [ %inc5, %entry ], [ %inc, %cond.true ]
%x.tr.lcssa = phi i32 [ %x, %entry ], [ %y.tr8, %cond.true ]
store i32 %inc.lcssa, ptr @count, align 4, !tbaa !5
ret i32 %x.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call20 = 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
%tobool.not21 = icmp eq i32 %0, 0
br i1 %tobool.not21, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%1 = phi i32 [ %3, %if.end ], [ %0, %entry ]
%2 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp sgt i32 %1, %2
br i1 %cmp, label %if.then, label %cond.true.i9
if.then: ; preds = %while.body
%tobool.not6.i = icmp eq i32 %2, 0
br i1 %tobool.not6.i, label %if.end, label %cond.true.i
cond.true.i: ; preds = %if.then, %cond.true.i
%inc9.i = phi i32 [ %inc.i, %cond.true.i ], [ 1, %if.then ]
%y.tr8.i = phi i32 [ %rem.i, %cond.true.i ], [ %2, %if.then ]
%x.tr7.i = phi i32 [ %y.tr8.i, %cond.true.i ], [ %1, %if.then ]
%rem.i = srem i32 %x.tr7.i, %y.tr8.i
%inc.i = add nuw nsw i32 %inc9.i, 1
%tobool.not.i = icmp eq i32 %rem.i, 0
br i1 %tobool.not.i, label %if.end, label %cond.true.i
cond.true.i9: ; preds = %while.body, %cond.true.i9
%inc9.i10 = phi i32 [ %inc.i14, %cond.true.i9 ], [ 1, %while.body ]
%y.tr8.i11 = phi i32 [ %rem.i13, %cond.true.i9 ], [ %1, %while.body ]
%x.tr7.i12 = phi i32 [ %y.tr8.i11, %cond.true.i9 ], [ %2, %while.body ]
%rem.i13 = srem i32 %x.tr7.i12, %y.tr8.i11
%inc.i14 = add nuw nsw i32 %inc9.i10, 1
%tobool.not.i15 = icmp eq i32 %rem.i13, 0
br i1 %tobool.not.i15, label %if.end, label %cond.true.i9
if.end: ; preds = %cond.true.i9, %cond.true.i, %if.then
%storemerge = phi i32 [ 1, %if.then ], [ %inc.i, %cond.true.i ], [ %inc.i14, %cond.true.i9 ]
%res.0 = phi i32 [ %1, %if.then ], [ %y.tr8.i, %cond.true.i ], [ %y.tr8.i11, %cond.true.i9 ]
store i32 %storemerge, ptr @count, align 4, !tbaa !5
%sub = add nsw i32 %storemerge, -1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.0, i32 noundef %sub)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%3 = load i32, ptr %x, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end, %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
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~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;
scanf("%d %d",&a,&b);
if((a+b)%2==0){
printf("%d",(a+b)/2);
}
else{
printf("%d",(a+b)/2+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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, 1
%div = sdiv i32 %add, 2
%add5.sink = add nsw i32 %div, %2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5.sink)
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;
scanf("%d" "%d", &a , &b);
if((a+b)% 2 == 0){
printf("%d",(a+b)/2);
}
else{
printf("%d",(a+b)/2 + 1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143867/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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, 1
%div = sdiv i32 %add, 2
%add5.sink = add nsw i32 %div, %2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add5.sink)
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"}
|
/*Author: Aftab Hossain Shakib*/
#include<stdio.h>
int main()
{
int q,i;
long long int n;
scanf("%d",&q);
while(q--){
scanf("%lld",&n);
long long int a[n+1],sum=0;
for(i=0;i<n;i++){
scanf("%lld",&a[i]);
sum+=a[i];
}
if(sum%n==0){
printf("%lld\n",sum/n);
}
else{
printf("%lld\n",(sum/n)+1);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14391/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14391/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i32, align 4
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #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 %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%dec24 = add nsw i32 %0, -1
store i32 %dec24, ptr %q, align 4, !tbaa !5
%tobool.not25 = icmp eq i32 %0, 0
br i1 %tobool.not25, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !9
%add = add nsw i64 %1, 1
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %add, align 16
%3 = load i64, ptr %n, align 8, !tbaa !9
%cmp19 = icmp sgt i64 %3, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%sum.021 = phi i64 [ %add6, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%4 = load i64, ptr %arrayidx, align 8, !tbaa !9
%add6 = add nsw i64 %4, %sum.021
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i64, ptr %n, align 8, !tbaa !9
%cmp = icmp sgt i64 %5, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %while.body
%sum.0.lcssa = phi i64 [ 0, %while.body ], [ %add6, %for.body ]
%.lcssa = phi i64 [ %3, %while.body ], [ %5, %for.body ]
%rem = srem i64 %sum.0.lcssa, %.lcssa
%cmp7 = icmp ne i64 %rem, 0
%div = sdiv i64 %sum.0.lcssa, %.lcssa
%add11 = zext i1 %cmp7 to i64
%add11.sink = add nsw i64 %div, %add11
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add11.sink)
call void @llvm.stackrestore.p0(ptr %2)
%6 = load i32, ptr %q, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %q, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if((a+b)%2!= 0) printf("%d\n",(a+b)/2+1);
else printf("%d\n",(a+b)/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143953/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143953/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%2 = and i32 %add, 1
%div5 = sdiv i32 %add, 2
%div5.sink = add nsw i32 %div5, %2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div5.sink)
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){
double a,b;
double x;
scanf("%lf %lf",&a,&b);
x=(a+b)/2;
if(x-(int)x>=0.5){
x=(int)x+1;
}
else{
x=x;
}
printf("%.0f\n",x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_143997/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_143997/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%.0f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, 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 double, ptr %a, align 8, !tbaa !5
%1 = load double, ptr %b, align 8, !tbaa !5
%add = fadd double %0, %1
%div = fmul double %add, 5.000000e-01
%conv = fptosi double %div to i32
%conv1 = sitofp i32 %conv to double
%sub = fsub double %div, %conv1
%cmp = fcmp ult double %sub, 5.000000e-01
%add4 = add nsw i32 %conv, 1
%conv5 = sitofp i32 %add4 to double
%x.0 = select i1 %cmp, double %div, double %conv5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %x.0)
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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main()
{
float a,b,x,n;
scanf("%f %f",&a,&b);
x=(a+b)/2;
n=ceil(x);
printf("%.f\n",n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144046/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144046/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f %f\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%.f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca float, align 4
%b = alloca float, 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 float, ptr %a, align 4, !tbaa !5
%1 = load float, ptr %b, align 4, !tbaa !5
%add = fadd float %0, %1
%div = fmul float %add, 5.000000e-01
%2 = call float @llvm.ceil.f32(float %div)
%conv2 = fpext float %2 to double
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.ceil.f32(float) #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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(){
int t, l, r;
scanf("%d", &t);
while(t--){
scanf("%d%d", &l, &r);
if(r < 2 * l)
printf("-1 -1\n");
else
printf("%d %d\n", l, 2 * l);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14409/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14409/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [6 x i8] c"-1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec5 = add nsw i32 %0, -1
store i32 %dec5, ptr %t, align 4, !tbaa !5
%tobool.not6 = icmp eq i32 %0, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r)
%1 = load i32, ptr %r, align 4, !tbaa !5
%2 = load i32, ptr %l, align 4, !tbaa !5
%mul = shl nsw i32 %2, 1
%cmp = icmp slt i32 %1, %mul
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %while.body
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %2, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.else, %if.then
%3 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
long long int t,a=0,b=0,i,j,n,s=0,k;
scanf("%lld",&t);
for(j=0;j<t;j++)
{
scanf("%lld %lld",&n,&k);
if(2*n<=k)
printf("%lld %lld\n",n,2*n);
else
printf("-1 -1\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14414/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14414/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1
@str = private unnamed_addr constant [6 x i8] c"-1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%cmp7 = icmp sgt i64 %0, 0
br i1 %cmp7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%j.08 = phi i64 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %k)
%1 = load i64, ptr %n, align 8, !tbaa !5
%mul = shl nsw i64 %1, 1
%2 = load i64, ptr %k, align 8, !tbaa !5
%cmp2.not = icmp sgt i64 %mul, %2
br i1 %cmp2.not, label %if.else, label %if.then
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %1, i64 noundef %mul)
br label %for.inc
if.else: ; preds = %for.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%inc = add nuw nsw i64 %j.08, 1
%3 = load i64, ptr %t, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
// AOJ 0056: Goldbach's Conjecture
// 2017.10.28 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#define MAX 50000
#define HALF 2761 // prime[2760]=24989, prime[2761]=25013
char table[MAX+1]; // zero: if prime
int sz, prime[5200] = { // prime[46] = 223, max sz = 5132
3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199, 211, 223 };
int ans[MAX+MAX] = {0,0,0,0,1,0};
char buf[10], *p;
int main()
{
int i, j, k;
for (i = 0; i < 47; i++) {
k = prime[i];
for (j = k<<1; j < MAX; j += k) table[j] = 1;
}
for (sz = 0, i = 3; i <= MAX; i += 2) if (!table[i]) prime[sz++] = i;
for (i = 0; i < HALF; i++) for (j = i; j < sz; j++)
ans[prime[i] + prime[j]]++;
while (fgets(p=buf, 10, stdin) && *buf != '0') {
i = 0; while (*p >= '0') i = (i<<3) + (i<<1) + (*p++ & 0xf);
if (i & 1) putchar('1'-table[i-2]);
else printf("%d", ans[i]);
putchar('\n');
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144183/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144183/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@prime = dso_local local_unnamed_addr global <{ [47 x i32], [5153 x i32] }> <{ [47 x i32] [i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29, i32 31, i32 37, i32 41, i32 43, i32 47, i32 53, i32 59, i32 61, i32 67, i32 71, i32 73, i32 79, i32 83, i32 89, i32 97, i32 101, i32 103, i32 107, i32 109, i32 113, i32 127, i32 131, i32 137, i32 139, i32 149, i32 151, i32 157, i32 163, i32 167, i32 173, i32 179, i32 181, i32 191, i32 193, i32 197, i32 199, i32 211, i32 223], [5153 x i32] zeroinitializer }>, align 16
@ans = dso_local local_unnamed_addr global <{ i32, i32, i32, i32, i32, [99995 x i32] }> <{ i32 0, i32 0, i32 0, i32 0, i32 1, [99995 x i32] zeroinitializer }>, align 16
@table = dso_local local_unnamed_addr global [50001 x i8] zeroinitializer, align 16
@sz = dso_local local_unnamed_addr global i32 0, align 4
@buf = dso_local global [10 x i8] zeroinitializer, align 1
@p = dso_local local_unnamed_addr global ptr null, align 8
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
br label %for.body
for.body: ; preds = %entry, %for.inc6
%indvars.iv106 = phi i64 [ 0, %entry ], [ %indvars.iv.next107, %for.inc6 ]
%arrayidx = getelementptr inbounds [5200 x i32], ptr @prime, i64 0, i64 %indvars.iv106
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%shl = shl i32 %0, 1
%cmp288 = icmp slt i32 %shl, 50000
br i1 %cmp288, label %for.body3.preheader, label %for.inc6
for.body3.preheader: ; preds = %for.body
%1 = sext i32 %shl to i64
%2 = sext i32 %0 to i64
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv = phi i64 [ %1, %for.body3.preheader ], [ %indvars.iv.next, %for.body3 ]
%arrayidx5 = getelementptr inbounds [50001 x i8], ptr @table, i64 0, i64 %indvars.iv
store i8 1, ptr %arrayidx5, align 1, !tbaa !9
%indvars.iv.next = add i64 %indvars.iv, %2
%cmp2 = icmp slt i64 %indvars.iv.next, 50000
br i1 %cmp2, label %for.body3, label %for.inc6, !llvm.loop !10
for.inc6: ; preds = %for.body3, %for.body
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%exitcond.not = icmp eq i64 %indvars.iv.next107, 47
br i1 %exitcond.not, label %for.end7, label %for.body, !llvm.loop !12
for.end7: ; preds = %for.inc6
store i32 0, ptr @sz, align 4, !tbaa !5
br label %for.body10
for.cond19.preheader: ; preds = %for.inc16
%3 = sext i32 %6 to i64
%wide.trip.count = zext i32 %6 to i64
br label %for.cond22.preheader
for.body10: ; preds = %for.inc16.1, %for.end7
%indvars.iv109 = phi i64 [ 3, %for.end7 ], [ %indvars.iv.next110.1, %for.inc16.1 ]
%inc139293 = phi i32 [ 0, %for.end7 ], [ %9, %for.inc16.1 ]
%arrayidx12 = getelementptr inbounds [50001 x i8], ptr @table, i64 0, i64 %indvars.iv109
%4 = load i8, ptr %arrayidx12, align 1, !tbaa !9
%tobool.not = icmp eq i8 %4, 0
br i1 %tobool.not, label %if.then, label %for.inc16
if.then: ; preds = %for.body10
%inc13 = add nsw i32 %inc139293, 1
store i32 %inc13, ptr @sz, align 4, !tbaa !5
%idxprom14 = sext i32 %inc139293 to i64
%arrayidx15 = getelementptr inbounds [5200 x i32], ptr @prime, i64 0, i64 %idxprom14
%5 = trunc i64 %indvars.iv109 to i32
store i32 %5, ptr %arrayidx15, align 4, !tbaa !5
br label %for.inc16
for.inc16: ; preds = %for.body10, %if.then
%6 = phi i32 [ %inc139293, %for.body10 ], [ %inc13, %if.then ]
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 2
%cmp9 = icmp ult i64 %indvars.iv109, 49999
br i1 %cmp9, label %for.body10.1, label %for.cond19.preheader, !llvm.loop !13
for.body10.1: ; preds = %for.inc16
%arrayidx12.1 = getelementptr inbounds [50001 x i8], ptr @table, i64 0, i64 %indvars.iv.next110
%7 = load i8, ptr %arrayidx12.1, align 1, !tbaa !9
%tobool.not.1 = icmp eq i8 %7, 0
br i1 %tobool.not.1, label %if.then.1, label %for.inc16.1
if.then.1: ; preds = %for.body10.1
%inc13.1 = add nsw i32 %6, 1
store i32 %inc13.1, ptr @sz, align 4, !tbaa !5
%idxprom14.1 = sext i32 %6 to i64
%arrayidx15.1 = getelementptr inbounds [5200 x i32], ptr @prime, i64 0, i64 %idxprom14.1
%8 = trunc i64 %indvars.iv.next110 to i32
store i32 %8, ptr %arrayidx15.1, align 4, !tbaa !5
br label %for.inc16.1
for.inc16.1: ; preds = %if.then.1, %for.body10.1
%9 = phi i32 [ %6, %for.body10.1 ], [ %inc13.1, %if.then.1 ]
%indvars.iv.next110.1 = add nuw nsw i64 %indvars.iv109, 4
br label %for.body10
for.cond22.preheader: ; preds = %for.cond19.preheader, %for.inc36
%indvars.iv112 = phi i64 [ 0, %for.cond19.preheader ], [ %indvars.iv.next113, %for.inc36 ]
%cmp2395 = icmp slt i64 %indvars.iv112, %3
br i1 %cmp2395, label %for.body24.lr.ph, label %for.inc36
for.body24.lr.ph: ; preds = %for.cond22.preheader
%arrayidx26 = getelementptr inbounds [5200 x i32], ptr @prime, i64 0, i64 %indvars.iv112
%10 = load i32, ptr %arrayidx26, align 4, !tbaa !5
br label %for.body24
while.cond.preheader: ; preds = %for.inc36
store ptr @buf, ptr @p, align 8, !tbaa !14
%11 = load ptr, ptr @stdin, align 8, !tbaa !14
%call102 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 10, ptr noundef %11)
%tobool39103 = icmp ne ptr %call102, null
%12 = load i8, ptr @buf, align 1
%cmp40104 = icmp ne i8 %12, 48
%13 = select i1 %tobool39103, i1 %cmp40104, i1 false
br i1 %13, label %while.cond42.preheader, label %while.end65
for.body24: ; preds = %for.body24.lr.ph, %for.body24
%indvars.iv114 = phi i64 [ %indvars.iv112, %for.body24.lr.ph ], [ %indvars.iv.next115, %for.body24 ]
%arrayidx28 = getelementptr inbounds [5200 x i32], ptr @prime, i64 0, i64 %indvars.iv114
%14 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add29 = add nsw i32 %14, %10
%idxprom30 = sext i32 %add29 to i64
%arrayidx31 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %idxprom30
%15 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%inc32 = add nsw i32 %15, 1
store i32 %inc32, ptr %arrayidx31, align 4, !tbaa !5
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%exitcond117.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count
br i1 %exitcond117.not, label %for.inc36, label %for.body24, !llvm.loop !16
for.inc36: ; preds = %for.body24, %for.cond22.preheader
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%exitcond119.not = icmp eq i64 %indvars.iv.next113, 2761
br i1 %exitcond119.not, label %while.cond.preheader, label %for.cond22.preheader, !llvm.loop !17
while.cond42.preheader: ; preds = %while.cond.preheader, %if.end63
%p.promoted = load ptr, ptr @p, align 8, !tbaa !14
%16 = load i8, ptr %p.promoted, align 1, !tbaa !9
%cmp4499 = icmp sgt i8 %16, 47
br i1 %cmp4499, label %while.body46, label %if.else
while.body46: ; preds = %while.cond42.preheader, %while.body46
%i.3101 = phi i32 [ %add51, %while.body46 ], [ 0, %while.cond42.preheader ]
%incdec.ptr98100 = phi ptr [ %incdec.ptr, %while.body46 ], [ %p.promoted, %while.cond42.preheader ]
%add49 = mul i32 %i.3101, 10
%incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr98100, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !14
%17 = load i8, ptr %incdec.ptr98100, align 1, !tbaa !9
%18 = and i8 %17, 15
%and = zext i8 %18 to i32
%add51 = add nsw i32 %add49, %and
%19 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp44 = icmp sgt i8 %19, 47
br i1 %cmp44, label %while.body46, label %while.end, !llvm.loop !18
while.end: ; preds = %while.body46
%and52 = and i32 %and, 1
%tobool53.not = icmp eq i32 %and52, 0
br i1 %tobool53.not, label %if.else, label %if.then54
if.then54: ; preds = %while.end
%sub = add nsw i32 %add51, -2
%idxprom55 = sext i32 %sub to i64
%arrayidx56 = getelementptr inbounds [50001 x i8], ptr @table, i64 0, i64 %idxprom55
%20 = load i8, ptr %arrayidx56, align 1, !tbaa !9
%conv57 = sext i8 %20 to i32
%sub58 = sub nsw i32 49, %conv57
%21 = load ptr, ptr @stdout, align 8, !tbaa !14
%call.i = tail call i32 @putc(i32 noundef %sub58, ptr noundef %21)
br label %if.end63
if.else: ; preds = %while.cond42.preheader, %while.end
%i.3.lcssa123 = phi i32 [ %add51, %while.end ], [ 0, %while.cond42.preheader ]
%idxprom60 = sext i32 %i.3.lcssa123 to i64
%arrayidx61 = getelementptr inbounds [100000 x i32], ptr @ans, i64 0, i64 %idxprom60
%22 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%call62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22)
br label %if.end63
if.end63: ; preds = %if.else, %if.then54
%23 = load ptr, ptr @stdout, align 8, !tbaa !14
%call.i87 = tail call i32 @putc(i32 noundef 10, ptr noundef %23)
store ptr @buf, ptr @p, align 8, !tbaa !14
%24 = load ptr, ptr @stdin, align 8, !tbaa !14
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 10, ptr noundef %24)
%tobool39 = icmp ne ptr %call, null
%25 = load i8, ptr @buf, align 1
%cmp40 = icmp ne i8 %25, 48
%26 = select i1 %tobool39, i1 %cmp40, i1 false
br i1 %26, label %while.cond42.preheader, label %while.end65, !llvm.loop !19
while.end65: ; preds = %if.end63, %while.cond.preheader
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i,t;
scanf("%d",&i);
for(t=0;t<i;t++)
{
int l,r;
scanf("%d %d",&l,&r);
if(l*2<=r)
printf("%d %d",l,2*l);
else
printf("-1 -1");
if(t!=i-1)
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14427/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14427/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"-1 -1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %0, 0
br i1 %cmp12, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end9
%t.013 = phi i32 [ %inc, %if.end9 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r)
%1 = load i32, ptr %l, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%2 = load i32, ptr %r, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %mul, %2
br i1 %cmp2.not, label %if.else, label %if.then
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %mul)
br label %if.end
if.else: ; preds = %for.body
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
%3 = load i32, ptr %i, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%cmp6.not = icmp eq i32 %t.013, %sub
br i1 %cmp6.not, label %if.end9, label %if.then7
if.then7: ; preds = %if.end
%putchar = call i32 @putchar(i32 10)
%.pre = load i32, ptr %i, align 4, !tbaa !5
br label %if.end9
if.end9: ; preds = %if.then7, %if.end
%4 = phi i32 [ %.pre, %if.then7 ], [ %3, %if.end ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
%inc = add nuw nsw i32 %t.013, 1
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end9, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int i,j;
char str[100];
while(scanf("%s",str) != EOF){
for(i = 0;str[i] != 0;i++){
if(str[i] == '@'){
for(j = 0;j < str[i + 1] - '0';j++) printf("%c",str[i + 2]);
i += 2;
}
else printf("%c",str[i]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144312/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144312/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #4
%call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%cmp.not43 = icmp eq i32 %call42, -1
br i1 %cmp.not43, label %while.end, label %for.cond
for.cond: ; preds = %entry, %for.cond.backedge
%i.0 = phi i32 [ %i.0.be, %for.cond.backedge ], [ 0, %entry ]
%idxprom = sext i32 %i.0 to i64
%arrayidx = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %if.else [
i8 0, label %for.end27
i8 64, label %for.cond8.preheader
]
for.cond8.preheader: ; preds = %for.cond
%add = add nsw i32 %i.0, 1
%idxprom9 = sext i32 %add to i64
%arrayidx10 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %idxprom9
%1 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%cmp1240 = icmp sgt i8 %1, 48
%add15 = add nsw i32 %i.0, 2
br i1 %cmp1240, label %for.body14.lr.ph, label %for.inc25
for.body14.lr.ph: ; preds = %for.cond8.preheader
%idxprom16 = sext i32 %add15 to i64
%arrayidx17 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %idxprom16
br label %for.body14
for.body14: ; preds = %for.body14.lr.ph, %for.body14
%j.041 = phi i32 [ 0, %for.body14.lr.ph ], [ %inc, %for.body14 ]
%2 = load i8, ptr %arrayidx17, align 1, !tbaa !5
%conv18 = sext i8 %2 to i32
%putchar37 = call i32 @putchar(i32 %conv18)
%inc = add nuw nsw i32 %j.041, 1
%3 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%conv11 = sext i8 %3 to i32
%sub = add nsw i32 %conv11, -48
%cmp12 = icmp slt i32 %inc, %sub
br i1 %cmp12, label %for.body14, label %for.inc25, !llvm.loop !8
if.else: ; preds = %for.cond
%conv = sext i8 %0 to i32
%putchar36 = call i32 @putchar(i32 %conv)
br label %for.inc25
for.inc25: ; preds = %for.body14, %for.cond8.preheader, %if.else
%i.1 = phi i32 [ %i.0, %if.else ], [ %add15, %for.cond8.preheader ], [ %add15, %for.body14 ]
%inc26 = add nsw i32 %i.1, 1
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.inc25, %for.end27
%i.0.be = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.end27 ]
br label %for.cond, !llvm.loop !10
for.end27: ; preds = %for.cond
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.backedge
while.end: ; preds = %for.end27, %entry
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
int main()
{
char c;
int n;
while((scanf("%c",&c))!=EOF){
if(c == '@'){
scanf("%c",&c);
n = c - '0';
scanf("%c",&c);
while(n-- > 0){
printf("%c",c);
}
}else{
printf("%c",c);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144370/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144370/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not19 = icmp eq i32 %call18, -1
br i1 %cmp.not19, label %while.end14, label %while.body
while.body: ; preds = %entry, %if.end
%0 = load i8, ptr %c, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 64
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%1 = load i8, ptr %c, align 1, !tbaa !5
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp716 = icmp sgt i8 %1, 48
br i1 %cmp716, label %while.body9.preheader, label %if.end
while.body9.preheader: ; preds = %if.then
%conv4 = zext i8 %1 to i32
%sub = add nsw i32 %conv4, -48
br label %while.body9
while.body9: ; preds = %while.body9.preheader, %while.body9
%n.017 = phi i32 [ %dec, %while.body9 ], [ %sub, %while.body9.preheader ]
%dec = add nsw i32 %n.017, -1
%2 = load i8, ptr %c, align 1, !tbaa !5
%conv10 = sext i8 %2 to i32
%putchar15 = call i32 @putchar(i32 %conv10)
%cmp7 = icmp ugt i32 %n.017, 1
br i1 %cmp7, label %while.body9, label %if.end, !llvm.loop !8
if.else: ; preds = %while.body
%conv = sext i8 %0 to i32
%putchar = call i32 @putchar(i32 %conv)
br label %if.end
if.end: ; preds = %while.body9, %if.then, %if.else
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end14, label %while.body, !llvm.loop !10
while.end14: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)
//union-find
#define UFLIMIT (1<<17)
int unicnt[UFLIMIT+10];//正ならcnt、非正なら根のindex
void ufinit(int n){rep(i,0,n)unicnt[i]=1;}
int root(int x){return unicnt[x]<=0?-(unicnt[x]=-root(-unicnt[x])):x;}
int same(int x,int y){return root(x)==root(y);}
void uni(int x,int y){if((x=root(x))==(y=root(y)))return;if(unicnt[x]<unicnt[y]){int t=x;x=y;y=t;}unicnt[x]+=unicnt[y];unicnt[y]=-x;}
#undef UFLIMIT
ll n,m;
int main(){
scanf("%lld%lld",&n,&m);
ll ans=n;
ufinit(n);
rep(i,0,m){
ll x,y;
scanf("%lld%lld%*lld",&x,&y);
x--,y--;
if(!same(x,y)){
uni(x,y);
ans--;
}
}
printf("%lld",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144464/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144464/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@unicnt = dso_local local_unnamed_addr global [131082 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@n = dso_local global i64 0, align 8
@m = dso_local global i64 0, align 8
@.str.1 = private unnamed_addr constant [14 x i8] c"%lld%lld%*lld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #9
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #9
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @pom(i64 noundef %a, i64 noundef %n, i32 noundef %m) local_unnamed_addr #3 {
entry:
%conv = sext i32 %m to i64
%tobool.not16 = icmp eq i64 %n, 0
br i1 %tobool.not16, label %for.end, label %for.body
for.body: ; preds = %entry, %cond.end
%mul4.pn = phi i64 [ %mul4, %cond.end ], [ %a, %entry ]
%x.018 = phi i64 [ %x.1, %cond.end ], [ 1, %entry ]
%n.addr.017 = phi i64 [ %div, %cond.end ], [ %n, %entry ]
%a.addr.019 = srem i64 %mul4.pn, %conv
%and = and i64 %n.addr.017, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %cond.end, label %cond.true
cond.true: ; preds = %for.body
%mul = mul nsw i64 %a.addr.019, %x.018
%rem3 = srem i64 %mul, %conv
br label %cond.end
cond.end: ; preds = %for.body, %cond.true
%x.1 = phi i64 [ %rem3, %cond.true ], [ %x.018, %for.body ]
%mul4 = mul nsw i64 %a.addr.019, %a.addr.019
%div = sdiv i64 %n.addr.017, 2
%n.addr.017.off = add i64 %n.addr.017, 1
%tobool.not = icmp ult i64 %n.addr.017.off, 3
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %cond.end, %entry
%x.0.lcssa = phi i64 [ 1, %entry ], [ %x.1, %cond.end ]
ret i64 %x.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @ufinit(i32 noundef %n) local_unnamed_addr #5 {
entry:
%conv = sext i32 %n to i64
%cmp4 = icmp sgt i32 %n, 0
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader6, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %conv, -8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %0, align 16, !tbaa !11
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %1, align 16, !tbaa !11
%index.next = add nuw i64 %index, 8
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %conv
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader6
for.body.preheader6: ; preds = %for.body.preheader, %middle.block
%i.05.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
ret void
for.body: ; preds = %for.body.preheader6, %for.body
%i.05 = phi i64 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader6 ]
%arrayidx = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %i.05
store i32 1, ptr %arrayidx, align 4, !tbaa !11
%inc = add nuw nsw i64 %i.05, 1
%exitcond.not = icmp eq i64 %inc, %conv
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !16
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @root(i32 noundef %x) local_unnamed_addr #6 {
entry:
%idxprom = sext i32 %x to i64
%arrayidx = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !11
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %cond.true, label %common.ret10
common.ret10: ; preds = %entry, %cond.true
%common.ret10.op = phi i32 [ %call, %cond.true ], [ %x, %entry ]
ret i32 %common.ret10.op
cond.true: ; preds = %entry
%sub = sub nsw i32 0, %0
%call = tail call i32 @root(i32 noundef %sub)
%sub3 = sub nsw i32 0, %call
store i32 %sub3, ptr %arrayidx, align 4, !tbaa !11
br label %common.ret10
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @same(i32 noundef %x, i32 noundef %y) local_unnamed_addr #7 {
entry:
%call = tail call i32 @root(i32 noundef %x)
%call1 = tail call i32 @root(i32 noundef %y)
%cmp = icmp eq i32 %call, %call1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @uni(i32 noundef %x, i32 noundef %y) local_unnamed_addr #7 {
entry:
%call = tail call i32 @root(i32 noundef %x)
%call1 = tail call i32 @root(i32 noundef %y)
%cmp = icmp eq i32 %call, %call1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%idxprom = sext i32 %call to i64
%arrayidx = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !11
%idxprom2 = sext i32 %call1 to i64
%arrayidx3 = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom2
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !11
%cmp4 = icmp slt i32 %0, %1
%spec.select = select i1 %cmp4, i32 %call, i32 %call1
%spec.select21 = select i1 %cmp4, i32 %call1, i32 %call
%idxprom7 = sext i32 %spec.select to i64
%arrayidx8 = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom7
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !11
%idxprom9 = sext i32 %spec.select21 to i64
%arrayidx10 = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom9
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !11
%add = add nsw i32 %3, %2
store i32 %add, ptr %arrayidx10, align 4, !tbaa !11
%sub = sub nsw i32 0, %spec.select21
store i32 %sub, ptr %arrayidx8, align 4, !tbaa !11
br label %return
return: ; preds = %entry, %if.end
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !5
%conv = trunc i64 %0 to i32
%sext = shl i64 %0, 32
%conv.i = ashr exact i64 %sext, 32
%cmp4.i = icmp sgt i32 %conv, 0
br i1 %cmp4.i, label %for.body.i.preheader, label %ufinit.exit
for.body.i.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %sext, 34359738368
br i1 %min.iters.check, label %for.body.i.preheader22, label %vector.ph
vector.ph: ; preds = %for.body.i.preheader
%n.mod.vf = and i64 %0, 7
%n.vec = sub nsw i64 %conv.i, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%1 = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %1, align 16, !tbaa !11
%2 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %2, align 16, !tbaa !11
%index.next = add nuw i64 %index, 8
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %ufinit.exit, label %for.body.i.preheader22
for.body.i.preheader22: ; preds = %for.body.i.preheader, %middle.block
%i.05.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %n.vec, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader22, %for.body.i
%i.05.i = phi i64 [ %inc.i, %for.body.i ], [ %i.05.i.ph, %for.body.i.preheader22 ]
%arrayidx.i = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %i.05.i
store i32 1, ptr %arrayidx.i, align 4, !tbaa !11
%inc.i = add nuw nsw i64 %i.05.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %conv.i
br i1 %exitcond.not.i, label %ufinit.exit, label %for.body.i, !llvm.loop !18
ufinit.exit: ; preds = %for.body.i, %middle.block, %entry
%4 = load i64, ptr @m, align 8, !tbaa !5
%cmp19 = icmp sgt i64 %4, 0
br i1 %cmp19, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end, %ufinit.exit
%ans.0.lcssa = phi i64 [ %0, %ufinit.exit ], [ %ans.1, %if.end ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
ret i32 0
for.body: ; preds = %ufinit.exit, %if.end
%i.021 = phi i64 [ %inc, %if.end ], [ 0, %ufinit.exit ]
%ans.020 = phi i64 [ %ans.1, %if.end ], [ %0, %ufinit.exit ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #9
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%5 = load i64, ptr %x, align 8, !tbaa !5
%dec = add nsw i64 %5, -1
store i64 %dec, ptr %x, align 8, !tbaa !5
%6 = load i64, ptr %y, align 8, !tbaa !5
%dec3 = add nsw i64 %6, -1
store i64 %dec3, ptr %y, align 8, !tbaa !5
%conv4 = trunc i64 %dec to i32
%conv5 = trunc i64 %dec3 to i32
%call.i = call i32 @root(i32 noundef %conv4)
%call1.i = call i32 @root(i32 noundef %conv5)
%cmp.i.not = icmp eq i32 %call.i, %call1.i
br i1 %cmp.i.not, label %if.end, label %if.then
if.then: ; preds = %for.body
%7 = load i64, ptr %x, align 8, !tbaa !5
%conv7 = trunc i64 %7 to i32
%8 = load i64, ptr %y, align 8, !tbaa !5
%conv8 = trunc i64 %8 to i32
%call.i14 = call i32 @root(i32 noundef %conv7)
%call1.i15 = call i32 @root(i32 noundef %conv8)
%cmp.i16 = icmp eq i32 %call.i14, %call1.i15
br i1 %cmp.i16, label %uni.exit, label %if.end.i
if.end.i: ; preds = %if.then
%idxprom.i = sext i32 %call.i14 to i64
%arrayidx.i17 = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom.i
%9 = load i32, ptr %arrayidx.i17, align 4, !tbaa !11
%idxprom2.i = sext i32 %call1.i15 to i64
%arrayidx3.i = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom2.i
%10 = load i32, ptr %arrayidx3.i, align 4, !tbaa !11
%cmp4.i18 = icmp slt i32 %9, %10
%spec.select.i = select i1 %cmp4.i18, i32 %call.i14, i32 %call1.i15
%spec.select21.i = select i1 %cmp4.i18, i32 %call1.i15, i32 %call.i14
%idxprom7.i = sext i32 %spec.select.i to i64
%arrayidx8.i = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom7.i
%11 = load i32, ptr %arrayidx8.i, align 4, !tbaa !11
%idxprom9.i = sext i32 %spec.select21.i to i64
%arrayidx10.i = getelementptr inbounds [131082 x i32], ptr @unicnt, i64 0, i64 %idxprom9.i
%12 = load i32, ptr %arrayidx10.i, align 4, !tbaa !11
%add.i = add nsw i32 %12, %11
store i32 %add.i, ptr %arrayidx10.i, align 4, !tbaa !11
%sub.i = sub nsw i32 0, %spec.select21.i
store i32 %sub.i, ptr %arrayidx8.i, align 4, !tbaa !11
br label %uni.exit
uni.exit: ; preds = %if.then, %if.end.i
%dec9 = add nsw i64 %ans.020, -1
br label %if.end
if.end: ; preds = %uni.exit, %for.body
%ans.1 = phi i64 [ %ans.020, %for.body ], [ %dec9, %uni.exit ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #9
%inc = add nuw nsw i64 %i.021, 1
%13 = load i64, ptr @m, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %13
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19
}
; 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
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10, !14, !15}
!18 = distinct !{!18, !10, !15, !14}
!19 = distinct !{!19, !10}
|
//set many funcs template
//Ver.20181228
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
#define size 524288
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
void shuffledget(int x[],int n){
srand(time(0));
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
void prarr(int arr[],int n){
int i;
for(i=0;i<n;i++){
if(i){printf(" ");}
printf("%d",arr[i]);
}
printf("\n");
return;
}
typedef struct{
long long val;
long long pod;
long long ch[2];
}sd;
long long gr(long long dep){
if(dep==0){return 0;}
long long r=1;
while(dep%2==0){r*=2;dep/=2;}
return r;
}
int main(void){
long long i,j,n,m,k,a,b,c=1,h,w,r=0,l,t;
sd node[size];
char s[size];
scanf("%lld%lld",&n,&l);
node[0].val=-1;
node[0].pod=0;
node[0].ch[0]=-1;
node[0].ch[1]=-1;
for(i=0;i<n;i++){
scanf("%s",s);
k=strlen(s);
w=0;
for(j=0;j<k;j++){
t=s[j]-'0';
if(node[w].ch[t]!=-1){
w=node[w].ch[t];
continue;
}
node[w].ch[t]=c;
w=c;
node[c].val=t;
node[c].pod=j+1;
node[c].ch[0]=-1;
node[c].ch[1]=-1;
c++;
}
}
for(i=0;i<c;i++){
w=0;
if(node[i].ch[0]==-1){w++;}
if(node[i].ch[1]==-1){w++;}
if(w==1){
r^=gr(l-node[i].pod);
//printf("<%lld %lld>\n",l-node[i].pod,r);
}
}
if(r==0){
printf("Bob\n");
}
else{
printf("Alice\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144594/source.c"
target datalayout = "e-m:e-p270: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.sd = type { i64, i64, [2 x i64] }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16
@dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16
@dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16
@dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16
@.str.3 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [6 x i8] c"Alice\00", align 1
@str.7 = private unnamed_addr constant [4 x i8] c"Bob\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
%cmp.not6.i = icmp slt i32 %b, 1
br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i32 %add, %i.07.i
%mul.i = mul nsw i32 %sub.i, %r.08.i
%div.i = sdiv i32 %mul.i, %i.07.i
%inc.i = add nuw i32 %i.07.i, 1
%sub.i.1 = sub i32 %add, %inc.i
%mul.i.1 = mul nsw i32 %sub.i.1, %div.i
%div.i.1 = sdiv i32 %mul.i.1, %inc.i
%inc.i.1 = add nuw i32 %i.07.i, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7
nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i32 %add, %i.07.i.unr
%mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr
br label %nCr.exit
nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i32 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %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>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i32 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.06, %b
%add = add nsw i32 %rem, %r.07
%div = sdiv i32 %x.addr.06, %b
%tobool.not = icmp eq i32 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i32 %x, 1
%mul = mul nsw i32 %add, %x
%div = sdiv i32 %mul, 2
ret i32 %div
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i64 %a, %b
%sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true)
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !16
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !17
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i64 %b, %a
%cmp.not6.i = icmp slt i64 %b, 1
br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i64 %add, %i.07.i
%mul.i = mul nsw i64 %sub.i, %r.08.i
%div.i = sdiv i64 %mul.i, %i.07.i
%inc.i = add nuw i64 %i.07.i, 1
%sub.i.1 = sub i64 %add, %inc.i
%mul.i.1 = mul nsw i64 %sub.i.1, %div.i
%div.i.1 = sdiv i64 %mul.i.1, %inc.i
%inc.i.1 = add nuw i64 %i.07.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17
llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i64 %add, %i.07.i.unr
%mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr
br label %llnCr.exit
llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i64 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %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
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.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 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.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 !19
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.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 %r.05.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !22
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.05, 10
%add = add nsw i64 %r.06, %rem
%div = sdiv i64 %x.addr.05, 10
%x.addr.05.off = add i64 %x.addr.05, 9
%tobool.not = icmp ult i64 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i64 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.06, %b
%add = add nsw i64 %rem, %r.07
%div = sdiv i64 %x.addr.06, %b
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i64 %x, 1
%mul = mul nsw i64 %add, %x
%div = sdiv i64 %mul, 2
ret i64 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp.i = fcmp ogt double %a, %b
%a.b.i = select i1 %cmp.i, double %a, double %b
%cmp.i4 = fcmp olt double %a, %b
%a.b.i5 = select i1 %cmp.i4, double %a, double %b
%sub = fsub double %a.b.i, %a.b.i5
ret double %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #15
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #15
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp sgt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 {
entry:
%b = alloca [524288 x i32], align 16
%call = tail call i64 @time(ptr noundef null) #16
%conv = trunc i64 %call to i32
tail call void @srand(i32 noundef %conv) #16
call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #16
%cmp44 = icmp sgt i32 %n, 0
br i1 %cmp44, label %for.body.preheader, label %for.end29
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader61, 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>
%0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34
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.preheader61
for.body.preheader61: ; 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
br i1 %cmp44, label %for.body5.preheader, label %for.end29
for.body5.preheader: ; preds = %for.cond2.preheader
%3 = zext i32 %n to i64
br label %for.body5
for.body: ; preds = %for.body.preheader61, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ]
%arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !25
%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.cond2.preheader, label %for.body, !llvm.loop !35
for.cond18.preheader: ; preds = %for.body5
br i1 %cmp44, label %for.body21.preheader, label %for.end29
for.body21.preheader: ; preds = %for.cond18.preheader
%wide.trip.count58 = zext i32 %n to i64
br label %for.body21
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ]
%call6 = tail call i32 @rand() #16
%5 = trunc i64 %indvars.iv51 to i32
%rem = srem i32 %call6, %5
%indvars.iv.next52 = add nsw i64 %indvars.iv51, -1
%idxprom7 = and i64 %indvars.iv.next52, 4294967295
%arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !25
%idxprom9 = sext i32 %rem to i64
%arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !25
store i32 %7, ptr %arrayidx8, align 4, !tbaa !25
store i32 %6, ptr %arrayidx10, align 4, !tbaa !25
%cmp3 = icmp ugt i64 %indvars.iv51, 1
br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !36
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ]
%arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54
%8 = load i32, ptr %arrayidx23, align 4, !tbaa !25
%idxprom24 = sext i32 %8 to i64
%arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24
%call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25)
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58
br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !37
for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader
call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #16
ret void
}
; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 {
entry:
%cmp.not9 = icmp slt i32 %n, 1
br i1 %cmp.not9, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ]
%fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %st.011, %fi.010
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !25
%cmp1 = icmp slt i32 %0, %x
%add2 = add nsw i32 %div, 1
%sub3 = add nsw i32 %div, -1
%fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3
%st.1 = select i1 %cmp1, i32 %add2, i32 %st.011
%cmp.not = icmp sgt i32 %st.1, %fi.1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38
while.end: ; preds = %while.body, %entry
%st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ]
ret i32 %st.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #11 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %arr, align 4, !tbaa !25
%call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar6 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !25
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gr(i64 noundef %dep) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i64 %dep, 0
br i1 %cmp, label %return, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%0 = and i64 %dep, 1
%cmp15 = icmp eq i64 %0, 0
br i1 %cmp15, label %while.body, label %return
while.body: ; preds = %while.cond.preheader, %while.body
%r.07 = phi i64 [ %mul, %while.body ], [ 1, %while.cond.preheader ]
%dep.addr.06 = phi i64 [ %div, %while.body ], [ %dep, %while.cond.preheader ]
%mul = shl nsw i64 %r.07, 1
%div = sdiv i64 %dep.addr.06, 2
%1 = and i64 %div, 1
%cmp1 = icmp eq i64 %1, 0
br i1 %cmp1, label %while.body, label %return, !llvm.loop !41
return: ; preds = %while.body, %while.cond.preheader, %entry
%retval.0 = phi i64 [ 0, %entry ], [ 1, %while.cond.preheader ], [ %mul, %while.body ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #11 {
entry:
%n = alloca i64, align 8
%l = alloca i64, align 8
%node = alloca [524288 x %struct.sd], align 16
%s = alloca [524288 x i8], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #16
call void @llvm.lifetime.start.p0(i64 16777216, ptr nonnull %node) #16
call void @llvm.lifetime.start.p0(i64 524288, ptr nonnull %s) #16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n, ptr noundef nonnull %l)
store i64 -1, ptr %node, align 16, !tbaa !42
%pod = getelementptr inbounds %struct.sd, ptr %node, i64 0, i32 1
store i64 0, ptr %pod, align 8, !tbaa !44
%ch = getelementptr inbounds %struct.sd, ptr %node, i64 0, i32 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %ch, i8 -1, i64 16, i1 false)
%0 = load i64, ptr %n, align 8, !tbaa !29
%cmp108 = icmp sgt i64 %0, 0
br i1 %cmp108, label %for.body, label %for.body43.lr.ph
for.cond40.preheader: ; preds = %for.inc37
%cmp41112 = icmp sgt i64 %c.1.lcssa, 0
br i1 %cmp41112, label %for.body43.lr.ph, label %if.end76
for.body43.lr.ph: ; preds = %entry, %for.cond40.preheader
%c.0.lcssa119 = phi i64 [ %c.1.lcssa, %for.cond40.preheader ], [ 1, %entry ]
%1 = load i64, ptr %l, align 8
br label %for.body43
for.body: ; preds = %entry, %for.inc37
%i.0110 = phi i64 [ %inc38, %for.inc37 ], [ 0, %entry ]
%c.0109 = phi i64 [ %c.1.lcssa, %for.inc37 ], [ 1, %entry ]
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %s)
%call9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #15
%cmp11104 = icmp sgt i64 %call9, 0
br i1 %cmp11104, label %for.body12, label %for.inc37
for.body12: ; preds = %for.body, %for.inc
%w.0107 = phi i64 [ %w.1, %for.inc ], [ 0, %for.body ]
%j.0106 = phi i64 [ %inc36.pre-phi, %for.inc ], [ 0, %for.body ]
%c.1105 = phi i64 [ %c.2, %for.inc ], [ %c.0109, %for.body ]
%arrayidx13 = getelementptr inbounds [524288 x i8], ptr %s, i64 0, i64 %j.0106
%2 = load i8, ptr %arrayidx13, align 1, !tbaa !33
%conv = sext i8 %2 to i64
%sub = add nsw i64 %conv, -48
%arrayidx17 = getelementptr inbounds [524288 x %struct.sd], ptr %node, i64 0, i64 %w.0107, i32 2, i64 %sub
%3 = load i64, ptr %arrayidx17, align 8, !tbaa !29
%cmp18.not = icmp eq i64 %3, -1
br i1 %cmp18.not, label %if.end, label %for.body12.for.inc_crit_edge
for.body12.for.inc_crit_edge: ; preds = %for.body12
%.pre = add nuw nsw i64 %j.0106, 1
br label %for.inc
if.end: ; preds = %for.body12
store i64 %c.1105, ptr %arrayidx17, align 8, !tbaa !29
%arrayidx26 = getelementptr inbounds [524288 x %struct.sd], ptr %node, i64 0, i64 %c.1105
store i64 %sub, ptr %arrayidx26, align 16, !tbaa !42
%add = add nuw nsw i64 %j.0106, 1
%pod29 = getelementptr inbounds [524288 x %struct.sd], ptr %node, i64 0, i64 %c.1105, i32 1
store i64 %add, ptr %pod29, align 8, !tbaa !44
%ch31 = getelementptr inbounds [524288 x %struct.sd], ptr %node, i64 0, i64 %c.1105, i32 2
%inc = add nsw i64 %c.1105, 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %ch31, i8 -1, i64 16, i1 false)
br label %for.inc
for.inc: ; preds = %for.body12.for.inc_crit_edge, %if.end
%inc36.pre-phi = phi i64 [ %.pre, %for.body12.for.inc_crit_edge ], [ %add, %if.end ]
%c.2 = phi i64 [ %c.1105, %for.body12.for.inc_crit_edge ], [ %inc, %if.end ]
%w.1 = phi i64 [ %3, %for.body12.for.inc_crit_edge ], [ %c.1105, %if.end ]
%exitcond.not = icmp eq i64 %inc36.pre-phi, %call9
br i1 %exitcond.not, label %for.inc37, label %for.body12, !llvm.loop !45
for.inc37: ; preds = %for.inc, %for.body
%c.1.lcssa = phi i64 [ %c.0109, %for.body ], [ %c.2, %for.inc ]
%inc38 = add nuw nsw i64 %i.0110, 1
%4 = load i64, ptr %n, align 8, !tbaa !29
%cmp = icmp slt i64 %inc38, %4
br i1 %cmp, label %for.body, label %for.cond40.preheader, !llvm.loop !46
for.body43: ; preds = %for.body43.lr.ph, %for.inc68
%i.1114 = phi i64 [ 0, %for.body43.lr.ph ], [ %inc69, %for.inc68 ]
%r.0113 = phi i64 [ 0, %for.body43.lr.ph ], [ %r.1, %for.inc68 ]
%ch45 = getelementptr inbounds [524288 x %struct.sd], ptr %node, i64 0, i64 %i.1114, i32 2
%5 = load i64, ptr %ch45, align 16, !tbaa !29
%cmp47 = icmp eq i64 %5, -1
%arrayidx54 = getelementptr inbounds [524288 x %struct.sd], ptr %node, i64 0, i64 %i.1114, i32 2, i64 1
%6 = load i64, ptr %arrayidx54, align 8, !tbaa !29
%cmp55 = icmp eq i64 %6, -1
%cmp60 = xor i1 %cmp47, %cmp55
br i1 %cmp60, label %if.then62, label %for.inc68
if.then62: ; preds = %for.body43
%pod64 = getelementptr inbounds [524288 x %struct.sd], ptr %node, i64 0, i64 %i.1114, i32 1
%7 = load i64, ptr %pod64, align 8, !tbaa !44
%sub65 = sub nsw i64 %1, %7
%cmp.i = icmp eq i64 %sub65, 0
br i1 %cmp.i, label %gr.exit, label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %if.then62
%8 = and i64 %sub65, 1
%cmp15.i = icmp eq i64 %8, 0
br i1 %cmp15.i, label %while.body.i, label %gr.exit
while.body.i: ; preds = %while.cond.preheader.i, %while.body.i
%r.07.i = phi i64 [ %mul.i, %while.body.i ], [ 1, %while.cond.preheader.i ]
%dep.addr.06.i = phi i64 [ %div.i, %while.body.i ], [ %sub65, %while.cond.preheader.i ]
%mul.i = shl nsw i64 %r.07.i, 1
%div.i = sdiv i64 %dep.addr.06.i, 2
%9 = and i64 %div.i, 1
%cmp1.i = icmp eq i64 %9, 0
br i1 %cmp1.i, label %while.body.i, label %gr.exit, !llvm.loop !41
gr.exit: ; preds = %while.body.i, %if.then62, %while.cond.preheader.i
%retval.0.i = phi i64 [ 0, %if.then62 ], [ 1, %while.cond.preheader.i ], [ %mul.i, %while.body.i ]
%xor = xor i64 %retval.0.i, %r.0113
br label %for.inc68
for.inc68: ; preds = %for.body43, %gr.exit
%r.1 = phi i64 [ %xor, %gr.exit ], [ %r.0113, %for.body43 ]
%inc69 = add nuw nsw i64 %i.1114, 1
%exitcond116.not = icmp eq i64 %inc69, %c.0.lcssa119
br i1 %exitcond116.not, label %for.end70, label %for.body43, !llvm.loop !47
for.end70: ; preds = %for.inc68
%10 = icmp eq i64 %r.1, 0
%spec.select = select i1 %10, ptr @str.7, ptr @str
br label %if.end76
if.end76: ; preds = %for.end70, %for.cond40.preheader
%str.sink = phi ptr [ @str.7, %for.cond40.preheader ], [ %spec.select, %for.end70 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 524288, ptr nonnull %s) #16
call void @llvm.lifetime.end.p0(i64 16777216, ptr nonnull %node) #16
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #16
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #16
ret i32 0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #13
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #13
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree norecurse nosync nounwind memory(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 #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nofree nounwind }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #15 = { nounwind willreturn memory(read) }
attributes #16 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}
!25 = !{!26, !26, i64 0}
!26 = !{!"int", !27, i64 0}
!27 = !{!"omnipotent char", !28, i64 0}
!28 = !{!"Simple C/C++ TBAA"}
!29 = !{!30, !30, i64 0}
!30 = !{!"long long", !27, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !27, i64 0}
!33 = !{!27, !27, i64 0}
!34 = distinct !{!34, !6, !9, !10}
!35 = distinct !{!35, !6, !10, !9}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6, !40}
!40 = !{!"llvm.loop.peeled.count", i32 1}
!41 = distinct !{!41, !6}
!42 = !{!43, !30, i64 0}
!43 = !{!"", !30, i64 0, !30, i64 8, !27, i64 16}
!44 = !{!43, !30, i64 8}
!45 = distinct !{!45, !6}
!46 = distinct !{!46, !6}
!47 = distinct !{!47, !6}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
ll ans;
int main(){
int a,b,c,x,y;
scanf("%d%d%d%d%d",&a,&b,&c,&x,&y);
if(a+b>=c*2){
ll t=min(x,y);
ans+=2*c*t;
x-=t;
y-=t;
}
if(a>=2*c){
ans+=2*c*x;
y-=min(x,y);
x=0;
}
if(b>=2*c){
ans+=2*c*y;
x-=min(x,y);
y=0;
}
ans+=a*x+b*y;
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d%d%d%d%d\00", align 1
@ans = dso_local local_unnamed_addr global i64 0, align 8
@.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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %x, ptr noundef nonnull %y)
%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 = shl nsw i32 %2, 1
%cmp.not = icmp slt i32 %add, %mul
%.pre.pre.pre = load i32, ptr %x, align 4
%.pre51.pre.pre = load i32, ptr %y, align 4
%.pre52.pre.pre = load i64, ptr @ans, align 8, !tbaa !9
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%cond = call i32 @llvm.smin.i32(i32 %.pre.pre.pre, i32 %.pre51.pre.pre)
%conv = sext i32 %cond to i64
%conv3 = sext i32 %mul to i64
%mul4 = mul nsw i64 %conv, %conv3
%add5 = add nsw i64 %mul4, %.pre52.pre.pre
%sub = sub i32 %.pre.pre.pre, %cond
store i32 %sub, ptr %x, align 4, !tbaa !5
%sub9 = sub i32 %.pre51.pre.pre, %cond
store i32 %sub9, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%.pre52.pre = phi i64 [ %add5, %if.then ], [ %.pre52.pre.pre, %entry ]
%.pre51.pre = phi i32 [ %sub9, %if.then ], [ %.pre51.pre.pre, %entry ]
%.pre.pre = phi i32 [ %sub, %if.then ], [ %.pre.pre.pre, %entry ]
%cmp12.not = icmp slt i32 %0, %mul
br i1 %cmp12.not, label %if.end26, label %if.then14
if.then14: ; preds = %if.end
%mul16 = mul nsw i32 %.pre.pre, %mul
%conv17 = sext i32 %mul16 to i64
%add18 = add nsw i64 %.pre52.pre, %conv17
%cond24 = call i32 @llvm.smin.i32(i32 %.pre.pre, i32 %.pre51.pre)
%sub25 = sub nsw i32 %.pre51.pre, %cond24
store i32 %sub25, ptr %y, align 4, !tbaa !5
store i32 0, ptr %x, align 4, !tbaa !5
br label %if.end26
if.end26: ; preds = %if.then14, %if.end
%.pre52 = phi i64 [ %add18, %if.then14 ], [ %.pre52.pre, %if.end ]
%.pre51 = phi i32 [ %sub25, %if.then14 ], [ %.pre51.pre, %if.end ]
%.pre = phi i32 [ 0, %if.then14 ], [ %.pre.pre, %if.end ]
%cmp28.not = icmp slt i32 %1, %mul
br i1 %cmp28.not, label %if.end42, label %if.then30
if.then30: ; preds = %if.end26
%mul32 = mul nsw i32 %.pre51, %mul
%conv33 = sext i32 %mul32 to i64
%add34 = add nsw i64 %.pre52, %conv33
%cond40 = call i32 @llvm.smin.i32(i32 %.pre, i32 %.pre51)
%sub41 = sub nsw i32 %.pre, %cond40
store i32 %sub41, ptr %x, align 4, !tbaa !5
store i32 0, ptr %y, align 4, !tbaa !5
br label %if.end42
if.end42: ; preds = %if.then30, %if.end26
%3 = phi i64 [ %add34, %if.then30 ], [ %.pre52, %if.end26 ]
%4 = phi i32 [ 0, %if.then30 ], [ %.pre51, %if.end26 ]
%5 = phi i32 [ %sub41, %if.then30 ], [ %.pre, %if.end26 ]
%mul43 = mul nsw i32 %5, %0
%mul44 = mul nsw i32 %4, %1
%add45 = add nsw i32 %mul44, %mul43
%conv46 = sext i32 %add45 to i64
%add47 = add nsw i64 %3, %conv46
store i64 %add47, ptr @ans, align 8, !tbaa !9
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add47)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
|
#include <stdio.h>
#include <string.h>
int main(){
char s[101];
long long k;
scanf("%s",s);
scanf("%lld",&k);
int i=0,l=strlen(s);
while(i<l&&s[i]=='1'){
i++;
}
if(l==1){
printf("%c",s[0]);
return 0;
}
if(i>=k){
printf("1");
return 0;
}
printf("%c",s[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%lld\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
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call3 to i32
%cmp33 = icmp sgt i32 %conv, 0
br i1 %cmp33, label %land.rhs.preheader, label %if.end
land.rhs.preheader: ; preds = %entry
%wide.trip.count = and i64 %call3, 4294967295
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%indvars.iv = phi i64 [ 0, %land.rhs.preheader ], [ %indvars.iv.next, %while.body ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp6 = icmp eq i8 %0, 49
br i1 %cmp6, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.end, label %land.rhs, !llvm.loop !8
while.end: ; preds = %land.rhs, %while.body
%i.0.lcssa.ph = phi i64 [ %indvars.iv, %land.rhs ], [ %call3, %while.body ]
%1 = and i64 %i.0.lcssa.ph, 4294967295
%cmp8 = icmp eq i32 %conv, 1
br i1 %cmp8, label %if.then, label %if.end
if.then: ; preds = %while.end
%2 = load i8, ptr %s, align 16, !tbaa !5
%conv11 = sext i8 %2 to i32
br label %cleanup
if.end: ; preds = %entry, %while.end
%i.0.lcssa39 = phi i64 [ %1, %while.end ], [ 0, %entry ]
%3 = load i64, ptr %k, align 8, !tbaa !10
%cmp14.not = icmp sgt i64 %3, %i.0.lcssa39
br i1 %cmp14.not, label %if.end18, label %cleanup
if.end18: ; preds = %if.end
%arrayidx20 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %i.0.lcssa39
%4 = load i8, ptr %arrayidx20, align 1, !tbaa !5
%conv21 = sext i8 %4 to i32
br label %cleanup
cleanup: ; preds = %if.end, %if.end18, %if.then
%conv21.sink = phi i32 [ %conv21, %if.end18 ], [ %conv11, %if.then ], [ 49, %if.end ]
%putchar = call i32 @putchar(i32 %conv21.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #5
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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !6, i64 0}
|
#include<stdio.h>
int main(void)
{
char S[100];
int i,count=0;
long int K;
scanf("%s",S);
scanf("%ld",&K);
for(i=0;i<K;i++){
if(S[i]!='1'){
printf("%c\n",S[i]);
return 0;
}
}
printf("1\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [100 x i8], align 16
%K = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %K)
%0 = load i64, ptr %K, align 8, !tbaa !5
%cmp17 = icmp sgt i64 %0, 0
br i1 %cmp17, label %for.body, label %for.end
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !11
%cmp4.not = icmp eq i8 %1, 49
br i1 %cmp4.not, label %for.cond, label %if.then
if.then: ; preds = %for.body
%conv3 = sext i8 %1 to i32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv3)
br label %cleanup
for.end: ; preds = %for.cond, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
cleanup: ; preds = %for.end, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 = !{!7, !7, i64 0}
|
#include <stdio.h>
#include <math.h>
const long long gosencho = 5000000000000000;
int main (void)
{
char s[101];
char *p = s;
long long k;
double digit = 0;
scanf("%s", s);
scanf("%lld", &k);
while (*p) {
digit += pow((double)(*p - '0'), (double)gosencho);
if (digit >= k) {
putchar(*p);
puts("");
return 0;
}
++p;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@gosencho = dso_local local_unnamed_addr constant i64 5000000000000000, align 8
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%0 = load i8, ptr %s, align 16, !tbaa !5
%tobool.not19 = icmp eq i8 %0, 0
br i1 %tobool.not19, label %cleanup, label %while.body
while.body: ; preds = %entry, %if.end
%1 = phi i8 [ %6, %if.end ], [ %0, %entry ]
%digit.021 = phi double [ %add, %if.end ], [ 0.000000e+00, %entry ]
%p.020 = phi ptr [ %incdec.ptr, %if.end ], [ %s, %entry ]
%conv = sext i8 %1 to i32
%sub = add nsw i32 %conv, -48
%conv3 = sitofp i32 %sub to double
%call4 = call double @pow(double noundef %conv3, double noundef 5.000000e+15) #4
%add = fadd double %digit.021, %call4
%2 = load i64, ptr %k, align 8, !tbaa !8
%conv5 = sitofp i64 %2 to double
%cmp = fcmp ult double %add, %conv5
br i1 %cmp, label %if.end, label %if.then
if.then: ; preds = %while.body
%3 = load i8, ptr %p.020, align 1, !tbaa !5
%conv7 = sext i8 %3 to i32
%4 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i = call noundef i32 @putc(i32 noundef %conv7, ptr noundef %4)
%5 = load ptr, ptr @stdout, align 8, !tbaa !10
%call.i17 = call noundef i32 @putc(i32 noundef 10, ptr noundef %5)
br label %cleanup
if.end: ; preds = %while.body
%incdec.ptr = getelementptr inbounds i8, ptr %p.020, i64 1
%6 = load i8, ptr %incdec.ptr, align 1, !tbaa !5
%tobool.not = icmp eq i8 %6, 0
br i1 %tobool.not, label %cleanup, label %while.body, !llvm.loop !12
cleanup: ; preds = %if.end, %entry, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n, ncopy;
int sum = 0;
scanf("%d", &n);
ncopy = n;
while (n > 0) {
sum += n % 10;
n /= 10;
}
if (ncopy % sum == 0)
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144839/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144839/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #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 %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%sum.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%1 = phi i32 [ %div, %while.body ], [ %0, %entry ]
%rem = urem i32 %1, 10
%add = add nuw nsw i32 %sum.07, %rem
%div = udiv i32 %1, 10
%cmp.not = icmp ult i32 %1, 10
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%sum.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%rem1 = srem i32 %0, %sum.0.lcssa
%cmp2 = icmp eq i32 %rem1, 0
%.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
char numero[11234];
scanf("%s", numero);
int digitos = 0, numeroint = atoi(numero);
for (int i = 0; i < strlen(numero); i++){
digitos += numero[i] - '0';
}
if (numeroint % digitos == 0)
printf("Yes\n");
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144882/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144882/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%numero = alloca [11234 x i8], align 16
call void @llvm.lifetime.start.p0(i64 11234, ptr nonnull %numero) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %numero)
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %numero, ptr noundef null, i32 noundef 10) #7
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %numero) #8
%cmp15.not = icmp eq i64 %call4, 0
br i1 %cmp15.not, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %call4, 8
br i1 %min.iters.check, label %for.body.preheader22, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %call4, -8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi20 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%0 = getelementptr inbounds [11234 x i8], ptr %numero, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i8, ptr %0, i64 4
%wide.load21 = load <4 x i8>, ptr %1, align 4, !tbaa !5
%2 = sext <4 x i8> %wide.load to <4 x i32>
%3 = sext <4 x i8> %wide.load21 to <4 x i32>
%4 = add <4 x i32> %vec.phi, <i32 -48, i32 -48, i32 -48, i32 -48>
%5 = add <4 x i32> %vec.phi20, <i32 -48, i32 -48, i32 -48, i32 -48>
%6 = add <4 x i32> %4, %2
%7 = add <4 x i32> %5, %3
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %call4, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader22
for.body.preheader22: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%digitos.016.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%digitos.0.lcssa = phi i32 [ 0, %entry ], [ %9, %middle.block ], [ %add, %for.body ]
%conv.i = trunc i64 %call.i to i32
%rem = srem i32 %conv.i, %digitos.0.lcssa
%cmp7 = icmp eq i32 %rem, 0
%str.3.str = select i1 %cmp7, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 11234, ptr nonnull %numero) #7
ret i32 0
for.body: ; preds = %for.body.preheader22, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader22 ]
%digitos.016 = phi i32 [ %add, %for.body ], [ %digitos.016.ph, %for.body.preheader22 ]
%arrayidx = getelementptr inbounds [11234 x i8], ptr %numero, i64 0, i64 %indvars.iv
%10 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv6 = sext i8 %10 to i32
%sub = add i32 %digitos.016, -48
%add = add i32 %sub, %conv6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call4
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !11, !10}
|
#include <stdio.h>
int sum(long long int number_n) {
if(number_n < 10) {
return number_n;
} else {
return (number_n % 10) + sum(number_n / 10);
}
}
int main() {
int sum_number;
long long int number_n;
scanf("%lld", &number_n);
sum_number = sum(number_n);
if(number_n % sum_number == 0) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144925/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144925/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @sum(i64 noundef %number_n) local_unnamed_addr #0 {
entry:
%cmp6 = icmp slt i64 %number_n, 10
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %if.else, %entry
%accumulator.tr.lcssa = phi i32 [ 0, %entry ], [ %conv2, %if.else ]
%number_n.tr.lcssa = phi i64 [ %number_n, %entry ], [ %div, %if.else ]
%conv = trunc i64 %number_n.tr.lcssa to i32
%accumulator.ret.tr = add i32 %accumulator.tr.lcssa, %conv
ret i32 %accumulator.ret.tr
if.else: ; preds = %entry, %if.else
%number_n.tr8 = phi i64 [ %div, %if.else ], [ %number_n, %entry ]
%accumulator.tr7 = phi i32 [ %conv2, %if.else ], [ 0, %entry ]
%rem = urem i64 %number_n.tr8, 10
%div = udiv i64 %number_n.tr8, 10
%0 = trunc i64 %rem to i32
%conv2 = add i32 %accumulator.tr7, %0
%cmp = icmp ult i64 %number_n.tr8, 100
br i1 %cmp, label %if.then, label %if.else
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%number_n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %number_n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number_n)
%0 = load i64, ptr %number_n, align 8, !tbaa !5
%cmp6.i = icmp slt i64 %0, 10
br i1 %cmp6.i, label %sum.exit, label %if.else.i
if.else.i: ; preds = %entry, %if.else.i
%number_n.tr8.i = phi i64 [ %div.i, %if.else.i ], [ %0, %entry ]
%accumulator.tr7.i = phi i32 [ %conv2.i, %if.else.i ], [ 0, %entry ]
%rem.i = urem i64 %number_n.tr8.i, 10
%div.i = udiv i64 %number_n.tr8.i, 10
%1 = trunc i64 %rem.i to i32
%conv2.i = add i32 %accumulator.tr7.i, %1
%cmp.i = icmp ult i64 %number_n.tr8.i, 100
br i1 %cmp.i, label %sum.exit, label %if.else.i
sum.exit: ; preds = %if.else.i, %entry
%accumulator.tr.lcssa.i = phi i32 [ 0, %entry ], [ %conv2.i, %if.else.i ]
%number_n.tr.lcssa.i = phi i64 [ %0, %entry ], [ %div.i, %if.else.i ]
%conv.i = trunc i64 %number_n.tr.lcssa.i to i32
%accumulator.ret.tr.i = add i32 %accumulator.tr.lcssa.i, %conv.i
%conv = sext i32 %accumulator.ret.tr.i to i64
%rem = srem i64 %0, %conv
%cmp = icmp eq i64 %rem, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %number_n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree 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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,count=0;
scanf("%d",&a);
b = a;
while( a > 0){
count = count + a % 10;
a = a / 10;
}
if( b % count == 0 ) printf("Yes\n");
else printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_144976/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_144976/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 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 %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%count.08 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%1 = phi i32 [ %div, %while.body ], [ %0, %entry ]
%rem = urem i32 %1, 10
%add = add nuw nsw i32 %count.08, %rem
%div = udiv i32 %1, 10
%cmp.not = icmp ult i32 %1, 10
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %div, ptr %a, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%count.0.lcssa = phi i32 [ %add, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%rem1 = srem i32 %0, %count.0.lcssa
%cmp2 = icmp eq i32 %rem1, 0
%str.3.str = select i1 %cmp2, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdbool.h>
void harshed_num(int n){
int harsh = n%10;
for(int buf=n;buf>0;buf /= 10)
harsh += (buf/10)%10;
if(n%harsh == 0) printf("Yes");
else printf("No");
}
int main(){
int n;
scanf("%d",&n);
harshed_num(n);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145018/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145018/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @harshed_num(i32 noundef %n) local_unnamed_addr #0 {
entry:
%rem = srem i32 %n, 10
%cmp11 = icmp sgt i32 %n, 0
br i1 %cmp11, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%harsh.0.lcssa = phi i32 [ %rem, %entry ], [ %add, %for.body ]
%rem3 = srem i32 %n, %harsh.0.lcssa
%cmp4 = icmp eq i32 %rem3, 0
%.str..str.1 = select i1 %cmp4, ptr @.str, ptr @.str.1
%call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str..str.1)
ret void
for.body: ; preds = %entry, %for.body
%buf.013 = phi i32 [ %div, %for.body ], [ %n, %entry ]
%harsh.012 = phi i32 [ %add, %for.body ], [ %rem, %entry ]
%div = udiv i32 %buf.013, 10
%rem1 = urem i32 %div, 10
%add = add nsw i32 %rem1, %harsh.012
%cmp.not = icmp ult i32 %buf.013, 10
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !5
}
; 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
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !7
%rem.i = srem i32 %0, 10
%cmp11.i = icmp sgt i32 %0, 0
br i1 %cmp11.i, label %for.body.i, label %harshed_num.exit
for.body.i: ; preds = %entry, %for.body.i
%buf.013.i = phi i32 [ %div.i, %for.body.i ], [ %0, %entry ]
%harsh.012.i = phi i32 [ %add.i, %for.body.i ], [ %rem.i, %entry ]
%div.i = udiv i32 %buf.013.i, 10
%rem1.i = urem i32 %div.i, 10
%add.i = add nsw i32 %rem1.i, %harsh.012.i
%cmp.not.i = icmp ult i32 %buf.013.i, 10
br i1 %cmp.not.i, label %harshed_num.exit, label %for.body.i, !llvm.loop !5
harshed_num.exit: ; preds = %for.body.i, %entry
%harsh.0.lcssa.i = phi i32 [ %rem.i, %entry ], [ %add.i, %for.body.i ]
%rem3.i = srem i32 %0, %harsh.0.lcssa.i
%cmp4.i = icmp eq i32 %rem3.i, 0
%.str..str.1.i = select i1 %cmp4.i, ptr @.str, ptr @.str.1
%call5.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str..str.1.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,m=0,nn;
scanf("%d",&n);
nn=n;
while(nn){
m+=nn%10;
nn/=10;
}
if(n/m*m==n) printf("Yes\n");
else printf("No\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145061/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145061/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%.fr = freeze i32 %0
%tobool.not9 = icmp eq i32 %.fr, 0
br i1 %tobool.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%nn.011 = phi i32 [ %div, %while.body ], [ %.fr, %entry ]
%m.010 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%rem = srem i32 %nn.011, 10
%add = add nsw i32 %rem, %m.010
%div = sdiv i32 %nn.011, 10
%nn.011.off = add i32 %nn.011, 9
%tobool.not = icmp ult i32 %nn.011.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%m.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
%1 = srem i32 %.fr, %m.0.lcssa
%cmp = icmp eq i32 %1, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int score[100][5] = {0};
int total = 0;
int high[100];
int low[100];
int i;
int j = 0;
int testcase;
while(1){
scanf("%d",&testcase);
if(testcase == 0)
break;
for(i=0;i<testcase;i++){
scanf("%d %d %d %d %d",&score[i][0],&score[i][1],&score[i][2],&score[i][3],&score[i][4]);
total = score[i][0]+score[i][1]+score[i][2]+score[i][3]+score[i][4];
if(i == 0){
high[j] = total;
low[j] = total;
}
else{
if(high[j] < total)
high[j] = total;
if(low[j] > total)
low[j] = total;
}
}
j++;
}
for(i=0;i<j;i++)
printf("%d %d\n",high[i],low[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145104/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145104/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [15 x i8] c"%d %d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%score = alloca [100 x [5 x i32]], align 16
%high = alloca [100 x i32], align 16
%low = alloca [100 x i32], align 16
%testcase = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %score) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000) %score, i8 0, i64 2000, i1 false)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %high) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %low) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %testcase) #5
%call98 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %testcase)
%0 = load i32, ptr %testcase, align 4, !tbaa !5
%cmp99 = icmp eq i32 %0, 0
br i1 %cmp99, label %for.end66, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %entry
%arrayidx5.peel = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 0, i64 1
%arrayidx8.peel = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 0, i64 2
%arrayidx11.peel = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 0, i64 3
%arrayidx14.peel = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 0, i64 4
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.end
%1 = phi i32 [ %0, %for.cond.preheader.preheader ], [ %14, %for.end ]
%indvars.iv105 = phi i64 [ 0, %for.cond.preheader.preheader ], [ %indvars.iv.next106, %for.end ]
%cmp196 = icmp sgt i32 %1, 0
br i1 %cmp196, label %for.inc.peel, label %for.end
for.inc.peel: ; preds = %for.cond.preheader
%arrayidx41 = getelementptr inbounds [100 x i32], ptr %high, i64 0, i64 %indvars.iv105
%arrayidx48 = getelementptr inbounds [100 x i32], ptr %low, i64 0, i64 %indvars.iv105
%call15.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %score, ptr noundef nonnull %arrayidx5.peel, ptr noundef nonnull %arrayidx8.peel, ptr noundef nonnull %arrayidx11.peel, ptr noundef nonnull %arrayidx14.peel)
%2 = load <4 x i32>, ptr %score, align 16, !tbaa !5
%3 = load i32, ptr %arrayidx14.peel, align 16, !tbaa !5
%4 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2)
%op.rdx113 = add i32 %4, %3
store i32 %op.rdx113, ptr %arrayidx41, align 4, !tbaa !5
store i32 %op.rdx113, ptr %arrayidx48, align 4, !tbaa !5
%5 = load i32, ptr %testcase, align 4, !tbaa !5
%cmp1.peel = icmp sgt i32 %5, 1
br i1 %cmp1.peel, label %for.inc, label %for.end
for.cond56.preheader: ; preds = %for.end
%6 = and i64 %indvars.iv.next106, 4294967295
%cmp57101.not = icmp eq i64 %6, 0
br i1 %cmp57101.not, label %for.end66, label %for.body58.preheader
for.body58.preheader: ; preds = %for.cond56.preheader
%wide.trip.count = and i64 %indvars.iv.next106, 4294967295
br label %for.body58
for.inc: ; preds = %for.inc.peel, %for.inc
%7 = phi i32 [ %spec.store.select95, %for.inc ], [ %op.rdx113, %for.inc.peel ]
%8 = phi i32 [ %spec.store.select, %for.inc ], [ %op.rdx113, %for.inc.peel ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ]
%arrayidx = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 %indvars.iv
%arrayidx5 = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 %indvars.iv, i64 1
%arrayidx8 = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 %indvars.iv, i64 2
%arrayidx11 = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 %indvars.iv, i64 3
%arrayidx14 = getelementptr inbounds [100 x [5 x i32]], ptr %score, i64 0, i64 %indvars.iv, i64 4
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx11, ptr noundef nonnull %arrayidx14)
%9 = load <4 x i32>, ptr %arrayidx, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %9)
%op.rdx = add i32 %11, %10
%spec.store.select = call i32 @llvm.smax.i32(i32 %8, i32 %op.rdx)
store i32 %spec.store.select, ptr %arrayidx41, align 4
%spec.store.select95 = call i32 @llvm.smin.i32(i32 %7, i32 %op.rdx)
store i32 %spec.store.select95, ptr %arrayidx48, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %testcase, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp1, label %for.inc, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %for.inc.peel, %for.cond.preheader
%indvars.iv.next106 = add nuw i64 %indvars.iv105, 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %testcase)
%14 = load i32, ptr %testcase, align 4, !tbaa !5
%cmp = icmp eq i32 %14, 0
br i1 %cmp, label %for.cond56.preheader, label %for.cond.preheader
for.body58: ; preds = %for.body58.preheader, %for.body58
%indvars.iv108 = phi i64 [ 0, %for.body58.preheader ], [ %indvars.iv.next109, %for.body58 ]
%arrayidx60 = getelementptr inbounds [100 x i32], ptr %high, i64 0, i64 %indvars.iv108
%15 = load i32, ptr %arrayidx60, align 4, !tbaa !5
%arrayidx62 = getelementptr inbounds [100 x i32], ptr %low, i64 0, i64 %indvars.iv108
%16 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15, i32 noundef %16)
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count
br i1 %exitcond.not, label %for.end66, label %for.body58, !llvm.loop !12
for.end66: ; preds = %for.body58, %entry, %for.cond56.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %testcase) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %low) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %high) #5
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %score) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
|
/* ex 7_1
terakura */
#include <stdio.h>
typedef struct point{
int x_elem;
int y_elem;
}point;
//頂点を移動させる関数
point shift_point(point point_p, int x_diff, int y_diff){
point_p.x_elem -= y_diff;
point_p.y_elem += x_diff;
return point_p;
}
int main(void){
int x_diff, y_diff;
point point_a, point_b, point_c, point_d;
scanf("%d %d %d %d", &point_a.x_elem, &point_a.y_elem, &point_b.x_elem, &point_b.y_elem);
//x座標の差とy座標の差を計算
x_diff = point_b.x_elem - point_a.x_elem;
y_diff = point_b.y_elem - point_a.y_elem;
point_c = shift_point(point_b, x_diff, y_diff);
point_d = shift_point(point_a, x_diff, y_diff);
printf("%d %d %d %d\n", point_c.x_elem, point_c.y_elem, point_d.x_elem, point_d.y_elem);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145155/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145155/source.c"
target datalayout = "e-m:e-p270: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.point = type { i32, i32 }
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @shift_point(i64 %point_p.coerce, i32 noundef %x_diff, i32 noundef %y_diff) local_unnamed_addr #0 {
entry:
%point_p.sroa.0.0.extract.trunc = trunc i64 %point_p.coerce to i32
%point_p.sroa.4.0.extract.shift = lshr i64 %point_p.coerce, 32
%point_p.sroa.4.0.extract.trunc = trunc i64 %point_p.sroa.4.0.extract.shift to i32
%sub = sub nsw i32 %point_p.sroa.0.0.extract.trunc, %y_diff
%add = add nsw i32 %point_p.sroa.4.0.extract.trunc, %x_diff
%retval.sroa.2.0.insert.ext = zext i32 %add to i64
%retval.sroa.2.0.insert.shift = shl nuw i64 %retval.sroa.2.0.insert.ext, 32
%retval.sroa.0.0.insert.ext = zext i32 %sub to i64
%retval.sroa.0.0.insert.insert = or i64 %retval.sroa.2.0.insert.shift, %retval.sroa.0.0.insert.ext
ret i64 %retval.sroa.0.0.insert.insert
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%point_a = alloca %struct.point, align 8
%point_b = alloca %struct.point, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %point_a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %point_b) #4
%y_elem = getelementptr inbounds %struct.point, ptr %point_a, i64 0, i32 1
%y_elem2 = getelementptr inbounds %struct.point, ptr %point_b, i64 0, i32 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %point_a, ptr noundef nonnull %y_elem, ptr noundef nonnull %point_b, ptr noundef nonnull %y_elem2)
%0 = load i32, ptr %point_b, align 8, !tbaa !5
%1 = load i32, ptr %point_a, align 8, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %y_elem2, align 4, !tbaa !10
%3 = load i32, ptr %y_elem, align 4, !tbaa !10
%sub7 = sub nsw i32 %2, %3
%4 = load i64, ptr %point_b, align 8
%point_p.sroa.0.0.extract.trunc.i = trunc i64 %4 to i32
%point_p.sroa.4.0.extract.shift.i = lshr i64 %4, 32
%point_p.sroa.4.0.extract.trunc.i = trunc i64 %point_p.sroa.4.0.extract.shift.i to i32
%sub.i = sub nsw i32 %point_p.sroa.0.0.extract.trunc.i, %sub7
%add.i = add nsw i32 %sub, %point_p.sroa.4.0.extract.trunc.i
%5 = load i64, ptr %point_a, align 8
%point_p.sroa.0.0.extract.trunc.i18 = trunc i64 %5 to i32
%point_p.sroa.4.0.extract.shift.i19 = lshr i64 %5, 32
%point_p.sroa.4.0.extract.trunc.i20 = trunc i64 %point_p.sroa.4.0.extract.shift.i19 to i32
%sub.i21 = sub nsw i32 %point_p.sroa.0.0.extract.trunc.i18, %sub7
%add.i22 = add nsw i32 %sub, %point_p.sroa.4.0.extract.trunc.i20
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.i, i32 noundef %add.i, i32 noundef %sub.i21, i32 noundef %add.i22)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %point_b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %point_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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
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, !7, i64 0}
!6 = !{!"point", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
|
/* ex7_1
saitomo*/
#include<stdio.h>
//頂点を表す構造体point を定義
typedef struct point{
int x_elem;
int y_elem;
}point;
//プロトタイプ宣言
point shift_point(point vec1,point vec2);
int main(void){
point vec1,vec2,vec3,vec4;
scanf("%d%d%d%d",&vec1.x_elem,&vec1.y_elem,&vec2.x_elem,&vec2.y_elem);
vec3=shift_point(vec1,vec2);
vec4=shift_point(vec2,vec3);
printf("%d %d %d %d\n",vec3.x_elem,vec3.y_elem,vec4.x_elem,vec4.y_elem);
return 0;
}
//点を移動させる関数を定義
point shift_point(point vec1,point vec2){
point new_vec;
new_vec.x_elem=vec2.x_elem-vec1.x_elem;//とりあえず計算に使う値を代入しておく
new_vec.y_elem=vec2.y_elem-vec1.y_elem;
new_vec.y_elem=new_vec.x_elem+vec2.y_elem;
new_vec.x_elem=vec2.x_elem-(new_vec.y_elem-new_vec.x_elem-vec1.y_elem);
//図を描くことで計算式を求めた
return new_vec;//ポイントとして出力
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145199/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145199/source.c"
target datalayout = "e-m:e-p270: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.point = type { i32, i32 }
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%vec1 = alloca %struct.point, align 8
%vec2 = alloca %struct.point, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %vec1) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %vec2) #4
%y_elem = getelementptr inbounds %struct.point, ptr %vec1, i64 0, i32 1
%y_elem2 = getelementptr inbounds %struct.point, ptr %vec2, i64 0, i32 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vec1, ptr noundef nonnull %y_elem, ptr noundef nonnull %vec2, ptr noundef nonnull %y_elem2)
%0 = load i64, ptr %vec1, align 8
%1 = load i64, ptr %vec2, align 8
%vec1.sroa.2.0.extract.shift.i = lshr i64 %0, 32
%vec2.sroa.3.0.extract.shift.i = lshr i64 %1, 32
%sub.i = sub i64 %1, %0
%add.i = add i64 %sub.i, %vec2.sroa.3.0.extract.shift.i
%sub14.neg.i = add i64 %vec1.sroa.2.0.extract.shift.i, %1
%sub15.i = sub i64 %sub14.neg.i, %vec2.sroa.3.0.extract.shift.i
%vec3.sroa.0.0.extract.trunc = trunc i64 %sub15.i to i32
%vec3.sroa.5.0.extract.trunc = trunc i64 %add.i to i32
%sub.i14 = sub i64 %sub15.i, %1
%add.i15 = add i64 %sub.i14, %add.i
%sub15.i17 = sub i64 %sub14.neg.i, %add.i
%vec4.sroa.0.0.extract.trunc = trunc i64 %sub15.i17 to i32
%vec4.sroa.4.0.extract.trunc = trunc i64 %add.i15 to i32
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %vec3.sroa.0.0.extract.trunc, i32 noundef %vec3.sroa.5.0.extract.trunc, i32 noundef %vec4.sroa.0.0.extract.trunc, i32 noundef %vec4.sroa.4.0.extract.trunc)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %vec2) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %vec1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @shift_point(i64 %vec1.coerce, i64 %vec2.coerce) local_unnamed_addr #3 {
entry:
%vec1.sroa.2.0.extract.shift = lshr i64 %vec1.coerce, 32
%vec2.sroa.3.0.extract.shift = lshr i64 %vec2.coerce, 32
%sub = sub i64 %vec2.coerce, %vec1.coerce
%add = add i64 %sub, %vec2.sroa.3.0.extract.shift
%sub14.neg = add i64 %vec1.sroa.2.0.extract.shift, %vec2.coerce
%sub15 = sub i64 %sub14.neg, %vec2.sroa.3.0.extract.shift
%retval.sroa.5.0.insert.ext = shl i64 %add, 32
%retval.sroa.0.0.insert.ext = and i64 %sub15, 4294967295
%retval.sroa.0.0.insert.insert = or i64 %retval.sroa.0.0.insert.ext, %retval.sroa.5.0.insert.ext
ret i64 %retval.sroa.0.0.insert.insert
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
/* ex7_1
sachiyan */
#include <stdio.h>
#include <stdlib.h>
//構造体宣言
typedef struct point{
int x_elem;
int y_elem;
}point;
//座標yを中心とし、xを-90度回転させるコード
point shift_point(point x, point y){
point z;
//回転させるベクトルを求める
point dif = {(x.x_elem - y.x_elem), (x.y_elem - y.y_elem)};
//回転させるベクトルdifを-90度回転後回転中心の座標を足す
z.x_elem = dif.y_elem + y.x_elem;
z.y_elem = -dif.x_elem + y.y_elem;
return z;
}
int main(void){
int x_1, y_1;
int x_2, y_2;
scanf("%d %d %d %d", &x_1, &y_1, &x_2, &y_2);
//座標1,2を初期化
point coor_1 = {x_1, y_1};
point coor_2 = {x_2, y_2};
//shift_point関数を用いて座標3,4を求める
point coor_3 = shift_point(coor_1, coor_2);
point coor_4 = shift_point(coor_2, coor_3);
//出力
printf("%d %d %d %d\n", coor_3.x_elem, coor_3.y_elem, coor_4.x_elem, coor_4.y_elem);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145249/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145249/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @shift_point(i64 %x.coerce, i64 %y.coerce) local_unnamed_addr #0 {
entry:
%x.sroa.2.0.extract.shift = lshr i64 %x.coerce, 32
%y.sroa.3.0.extract.shift = lshr i64 %y.coerce, 32
%sub.neg = sub i64 %y.coerce, %x.coerce
%sub5 = add i64 %x.sroa.2.0.extract.shift, %y.coerce
%add = sub i64 %sub5, %y.sroa.3.0.extract.shift
%add12 = add i64 %sub.neg, %y.sroa.3.0.extract.shift
%retval.sroa.2.0.insert.ext = shl i64 %add12, 32
%retval.sroa.0.0.insert.ext = and i64 %add, 4294967295
%retval.sroa.0.0.insert.insert = or i64 %retval.sroa.0.0.insert.ext, %retval.sroa.2.0.insert.ext
ret i64 %retval.sroa.0.0.insert.insert
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%x_1 = alloca i32, align 4
%y_1 = alloca i32, align 4
%x_2 = alloca i32, align 4
%y_2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x_1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y_1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x_2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y_2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x_1, ptr noundef nonnull %y_1, ptr noundef nonnull %x_2, ptr noundef nonnull %y_2)
%0 = load i32, ptr %x_1, align 4, !tbaa !5
%1 = load i32, ptr %y_1, align 4, !tbaa !5
%2 = load i32, ptr %x_2, align 4, !tbaa !5
%3 = load i32, ptr %y_2, align 4, !tbaa !5
%coor_1.sroa.4.0.insert.ext = zext i32 %1 to i64
%coor_1.sroa.0.0.insert.ext = zext i32 %0 to i64
%coor_2.sroa.5.0.insert.ext = zext i32 %3 to i64
%coor_2.sroa.0.0.insert.ext = zext i32 %2 to i64
%sub.neg.i = sub nsw i64 %coor_2.sroa.0.0.insert.ext, %coor_1.sroa.0.0.insert.ext
%sub5.i = add nuw nsw i64 %coor_2.sroa.0.0.insert.ext, %coor_1.sroa.4.0.insert.ext
%add.i = sub nsw i64 %sub5.i, %coor_2.sroa.5.0.insert.ext
%add12.i = add nsw i64 %sub.neg.i, %coor_2.sroa.5.0.insert.ext
%coor_3.sroa.0.0.extract.trunc = trunc i64 %add.i to i32
%coor_3.sroa.5.0.extract.trunc = trunc i64 %add12.i to i32
%sub.neg.i20 = sub nsw i64 %add.i, %coor_2.sroa.0.0.insert.ext
%add.i22 = sub nsw i64 %sub5.i, %add12.i
%add12.i23 = add nsw i64 %sub.neg.i20, %add12.i
%coor_4.sroa.0.0.extract.trunc = trunc i64 %add.i22 to i32
%coor_4.sroa.4.0.extract.trunc = trunc i64 %add12.i23 to i32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %coor_3.sroa.0.0.extract.trunc, i32 noundef %coor_3.sroa.5.0.extract.trunc, i32 noundef %coor_4.sroa.0.0.extract.trunc, i32 noundef %coor_4.sroa.4.0.extract.trunc)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y_2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x_2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y_1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x_1) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 x1, y1, x2, y2;
scanf("%lld%lld%lld%lld", &x1, &y1, &x2, &y2);
int slope[] = {y1-y2, x2-x1};
long long int x3, y3, x4, y4;
x3 = x2 + slope[0], y3 = y2 + slope[1], x4 = x1 + slope[0], y4 = y1 + slope[1];
printf("%lld %lld %lld %lld\n", x3, y3, x4, y4);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145292/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145292/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [17 x i8] c"%lld%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [21 x i8] c"%lld %lld %lld %lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca i64, align 8
%y1 = alloca i64, align 8
%x2 = alloca i64, align 8
%y2 = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x1) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y1) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x2) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2)
%0 = load i64, ptr %y1, align 8, !tbaa !5
%1 = load i64, ptr %y2, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%2 = load i64, ptr %x2, align 8, !tbaa !5
%3 = load i64, ptr %x1, align 8, !tbaa !5
%sub1 = sub nsw i64 %2, %3
%sext = shl i64 %sub, 32
%conv3 = ashr exact i64 %sext, 32
%add = add nsw i64 %conv3, %2
%sext16 = shl i64 %sub1, 32
%conv5 = ashr exact i64 %sext16, 32
%add6 = add nsw i64 %conv5, %1
%add9 = add nsw i64 %conv3, %3
%add12 = add nsw i64 %conv5, %0
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add, i64 noundef %add6, i64 noundef %add9, i64 noundef %add12)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y2) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x2) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y1) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x1) #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"}
|
#include<stdio.h>
#include<math.h>
int main() {
int x1, y1, x2, y2, x3, y3, x4, y4;
scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
x3 = x2 - (y2 - y1);
y3 = y2 + (x2 - x1);
x4 = x1 - (y2 - y1);
y4 = y1 + (x2 - x1);
printf("%d %d %d %d\n", x3, y3, x4, y4);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca i32, align 4
%y1 = alloca i32, align 4
%x2 = alloca i32, align 4
%y2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2)
%0 = load i32, ptr %x2, align 4, !tbaa !5
%1 = load i32, ptr %y2, align 4, !tbaa !5
%2 = load i32, ptr %y1, align 4, !tbaa !5
%sub = sub nsw i32 %1, %2
%sub1 = sub nsw i32 %0, %sub
%3 = load i32, ptr %x1, align 4, !tbaa !5
%sub2 = sub nsw i32 %0, %3
%add = add nsw i32 %sub2, %1
%sub4 = sub nsw i32 %3, %sub
%add6 = add nsw i32 %sub2, %2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1, i32 noundef %add, i32 noundef %sub4, i32 noundef %add6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #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[4], y[4];
int i, j, k;
scanf("%d %d %d %d", &x[0], &y[0], &x[1], &y[1]);
x[2] = x[1] - (y[1] - y[0]);
y[2] = y[1] + (x[1] - x[0]);
x[3] = x[2] - (y[2] - y[1]);
y[3] = y[2] + (x[2] - x[1]);
printf("%d %d %d %d\n", x[2], y[2], x[3], y[3]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145379/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145379/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d %d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [4 x i32], align 16
%y = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %y) #3
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %x, i64 0, i64 1
%arrayidx3 = getelementptr inbounds [4 x i32], ptr %y, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%2 = load i32, ptr %y, align 16, !tbaa !5
%sub.neg = sub i32 %2, %1
%sub7 = add i32 %sub.neg, %0
%arrayidx8 = getelementptr inbounds [4 x i32], ptr %x, i64 0, i64 2
store i32 %sub7, ptr %arrayidx8, align 8, !tbaa !5
%3 = load i32, ptr %x, align 16, !tbaa !5
%sub12 = sub nsw i32 %0, %3
%add = add nsw i32 %sub12, %1
%arrayidx13 = getelementptr inbounds [4 x i32], ptr %y, i64 0, i64 2
store i32 %add, ptr %arrayidx13, align 8, !tbaa !5
%sub18 = sub i32 %sub7, %sub12
%arrayidx19 = getelementptr inbounds [4 x i32], ptr %x, i64 0, i64 3
store i32 %sub18, ptr %arrayidx19, align 4, !tbaa !5
%add24 = add i32 %sub12, %2
%arrayidx25 = getelementptr inbounds [4 x i32], ptr %y, i64 0, i64 3
store i32 %add24, ptr %arrayidx25, align 4, !tbaa !5
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub7, i32 noundef %add, i32 noundef %sub18, i32 noundef %add24)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 16, 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 x1, y1, x2, y2;
scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
int x3 = x2-(y2-y1);
int y3 = y2+(x2-x1);
int x4 = x3-(y3-y2);
int y4 = y3+(x3-x2);
printf("%d %d %d %d",x3,y3,x4,y4);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca i32, align 4
%y1 = alloca i32, align 4
%x2 = alloca i32, align 4
%y2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2)
%0 = load i32, ptr %x2, align 4, !tbaa !5
%1 = load i32, ptr %y2, align 4, !tbaa !5
%2 = load i32, ptr %y1, align 4, !tbaa !5
%sub.neg = sub i32 %2, %1
%sub1 = add i32 %sub.neg, %0
%3 = load i32, ptr %x1, align 4, !tbaa !5
%sub2 = sub nsw i32 %0, %3
%add = add nsw i32 %sub2, %1
%sub4 = sub nsw i32 %sub1, %sub2
%add6 = add i32 %sub2, %2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub1, i32 noundef %add, i32 noundef %sub4, i32 noundef %add6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #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 x1, y1, x2, y2, x3, y3, x4, y4;
int change_x, change_y;
scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
x3 = x2 + (y2 - y1) * (-1);
y3 = y2 + (x2 - x1);
x4 = x3 + (x2 - x1) * (-1);
y4 = y3 + (y2 - y1) * (-1);
printf("%d %d %d %d", x3, y3, x4, y4);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca i32, align 4
%y1 = alloca i32, align 4
%x2 = alloca i32, align 4
%y2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2)
%0 = load i32, ptr %x2, align 4, !tbaa !5
%1 = load i32, ptr %y2, align 4, !tbaa !5
%2 = load i32, ptr %y1, align 4, !tbaa !5
%sub.neg = sub nsw i32 %2, %1
%add = add nsw i32 %sub.neg, %0
%3 = load i32, ptr %x1, align 4, !tbaa !5
%sub1 = sub nsw i32 %0, %3
%add2 = add nsw i32 %sub1, %1
%add5 = sub i32 %add, %sub1
%add8 = add i32 %sub1, %2
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add, i32 noundef %add2, i32 noundef %add5, i32 noundef %add8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #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(){
long long int n,a,b;
scanf("%lld%lld%lld",&n,&a,&b);
long long int k=n/(a+b);
if(n%(a+b)<=a){
printf("%lld",k*a+n%(a+b));
return 0;
}
else
{
printf("%lld",k*a+a);
return 0;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145515/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145515/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %2, %1
%div = sdiv i64 %0, %add
%rem = srem i64 %0, %add
%cmp.not = icmp sgt i64 %rem, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%mul = mul nsw i64 %div, %1
%add4 = add nsw i64 %mul, %rem
br label %cleanup
if.else: ; preds = %entry
%mul613 = add i64 %div, 1
%add7 = mul i64 %mul613, %1
br label %cleanup
cleanup: ; preds = %if.else, %if.then
%add7.sink = phi i64 [ %add7, %if.else ], [ %add4, %if.then ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add7.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
typedef long long ll;
int main(void){
ll N, A, B;
ll ans;
ll rem;
scanf("%lld %lld %lld", &N, &A, &B);
ans = (N / (A + B)) * A;
rem = N % (A + B);
ans += ((rem > A) ? A : rem);
printf("%lld", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145559/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145559/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%A = alloca i64, align 8
%B = 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 %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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %N, align 8, !tbaa !5
%1 = load i64, ptr %A, align 8
%2 = load i64, ptr %B, align 8, !tbaa !5
%add = add nsw i64 %2, %1
%div = sdiv i64 %0, %add
%mul = mul nsw i64 %div, %1
%rem2 = srem i64 %0, %add
%cond = call i64 @llvm.smin.i64(i64 %rem2, i64 %1)
%add3 = add nsw i64 %cond, %mul
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, 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.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
#include<math.h>
#define loop(i, l, r) for(i=l; i<r; i++)/*Instead of function, (for).*/
#define rep(i,r) for(i=0; i<r; i++)
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) < (b) ? (a) : (b))
typedef long long int lli;
/*Return Combination ,(nCr)*/
int combi(int n, int r)
{
if(r==0 || r==n) return 1;
else return combi(n-1,r) + combi(n-1,r-1);
}
/*Return gcd(a, b)*/
int gcd(int a, int b){
if(b == 0) return a;
else return gcd(b, a % b);
}
int main(void)
{
lli n, a, b, c, d, ans;
scanf("%lld%lld%lld", &n, &a, &b);
if(a==0) ans = 0;
c= n/(a+b);
d = n%(a+b);
if(0<=d && d<a) ans = c*a+d;
if(a<d && d<a+b) ans = c*a+a;
printf("%lld", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145601/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145601/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @combi(i32 noundef %n, i32 noundef %r) local_unnamed_addr #0 {
entry:
%cmp10 = icmp eq i32 %r, 0
%cmp111 = icmp eq i32 %r, %n
%or.cond12 = or i1 %cmp10, %cmp111
br i1 %or.cond12, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%r.tr15 = phi i32 [ %sub3, %if.else ], [ %r, %entry ]
%n.tr14 = phi i32 [ %sub, %if.else ], [ %n, %entry ]
%accumulator.tr13 = phi i32 [ %add, %if.else ], [ 0, %entry ]
%sub = add nsw i32 %n.tr14, -1
%call = tail call i32 @combi(i32 noundef %sub, i32 noundef %r.tr15)
%sub3 = add nsw i32 %r.tr15, -1
%add = add nsw i32 %call, %accumulator.tr13
%cmp = icmp eq i32 %sub3, 0
%cmp1 = icmp eq i32 %r.tr15, %n.tr14
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return.loopexit, label %if.else
return.loopexit: ; preds = %if.else
%0 = add nsw i32 %add, 1
br label %return
return: ; preds = %return.loopexit, %entry
%accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %0, %return.loopexit ]
ret i32 %accumulator.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i32 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.else ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %n, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %2, %0
%div = sdiv i64 %1, %add
%rem = srem i64 %1, %add
%cmp2 = icmp sgt i64 %rem, -1
%cmp3 = icmp slt i64 %rem, %0
%or.cond = and i1 %cmp2, %cmp3
%mul = mul nsw i64 %div, %0
%add5 = add nsw i64 %mul, %rem
%ans.1 = select i1 %or.cond, i64 %add5, i64 0
%cmp7 = icmp slt i64 %0, %rem
%cmp10 = icmp sgt i64 %add, -1
%or.cond23 = and i1 %cmp10, %cmp7
%mul1222 = add i64 %div, 1
%add13 = mul i64 %mul1222, %0
%ans.2 = select i1 %or.cond23, i64 %add13, i64 %ans.1
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
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 norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 <string.h>
int main(void)
{
long long N, A, B;
long long ret = 0;
long long tmp;
scanf("%ld %ld %ld", &N, &A, &B);
ret += A * (N / (A + B));
tmp = N % (A + B);
if (tmp >= A) {
ret += A;
} else {
ret += tmp;
}
printf("%ld", ret);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145645/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145645/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%ld %ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%A = alloca i64, align 8
%B = 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 %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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %A, align 8, !tbaa !5
%1 = load i64, ptr %N, align 8, !tbaa !5
%2 = load i64, ptr %B, align 8, !tbaa !5
%add = add nsw i64 %2, %0
%rem = srem i64 %1, %add
%rem. = call i64 @llvm.smin.i64(i64 %rem, i64 %0)
%div = sdiv i64 %1, %add
%mul = mul nsw i64 %div, %0
%ret.0 = add nsw i64 %mul, %rem.
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ret.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, 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.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <stdlib.h>
int main(void)
{
unsigned long long n;
unsigned long long a;
unsigned long long b;
scanf("%llu %llu %llu", &n, &a, &b);
unsigned long long res;
res = (n / (a + b)) * a;
res += (n % (a + b) > a ? a : (n % (a + b)));
printf("%llu", res);
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145689/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145689/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%llu %llu %llu\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%llu\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 i64, align 8
%b = 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 %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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%add = add i64 %2, %1
%rem = urem i64 %0, %add
%.rem = call i64 @llvm.umin.i64(i64 %rem, i64 %1)
%div = udiv i64 %0, %add
%mul = mul i64 %div, %1
%add4 = add i64 %mul, %.rem
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add4)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, 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.umin.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 long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long n,a,b;
long sum;
long x,amari;
long ans = 0;
scanf("%ld %ld %ld",&n,&a,&b);
sum = a+b;
if(n == 0 || sum == 0){
printf("0\n");
return 0;
}
x = n/sum;
amari = n % sum;
if(sum >= n){
if(n <= a){
printf("%ld\n",n);
return 0;
}else{
printf("%ld\n",a);
return 0;
}
}else{
ans = a*x;
}
if(amari > a){
ans += a;
}else{
ans += amari;
}
printf("%ld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145731/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145731/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%ld %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 [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %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 %n, 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 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp eq i64 %2, 0
%cmp1 = icmp eq i64 %add, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
if.end: ; preds = %entry
%cmp3.not = icmp slt i64 %add, %2
br i1 %cmp3.not, label %if.else9, label %if.then4
if.then4: ; preds = %if.end
%cmp5.not = icmp sgt i64 %2, %0
br i1 %cmp5.not, label %if.else, label %if.then6
if.then6: ; preds = %if.then4
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %2)
br label %cleanup
if.else: ; preds = %if.then4
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %0)
br label %cleanup
if.else9: ; preds = %if.end
%rem = srem i64 %2, %add
%div = sdiv i64 %2, %add
%mul = mul nsw i64 %div, %0
%.rem = call i64 @llvm.smin.i64(i64 %rem, i64 %0)
%ans.0 = add nsw i64 %mul, %.rem
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0)
br label %cleanup
cleanup: ; preds = %if.else9, %if.else, %if.then6, %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
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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.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", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
long long int n,a,b,set=0,ans=0;
scanf("%lld%lld%lld",&n,&a,&b);
if(n>=a+b){
set=n/(a+b);
}
n=n-(a+b)*set;
if(a>=n){
ans=n+a*set;
printf("%lld",ans);
return 0;
}
else{
ans=a+a*set;
printf("%lld",ans);
return 0;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145775/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145775/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %2, %1
%cmp.not = icmp slt i64 %0, %add
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%div = sdiv i64 %0, %add
br label %if.end
if.end: ; preds = %if.then, %entry
%set.0 = phi i64 [ %div, %if.then ], [ 0, %entry ]
%mul = mul nsw i64 %set.0, %add
%sub = sub nsw i64 %0, %mul
store i64 %sub, ptr %n, align 8, !tbaa !5
%cmp3.not = icmp slt i64 %1, %sub
br i1 %cmp3.not, label %if.else, label %if.then4
if.then4: ; preds = %if.end
%mul5 = mul nsw i64 %set.0, %1
%add6 = add nsw i64 %sub, %mul5
br label %cleanup
if.else: ; preds = %if.end
%mul819 = add i64 %set.0, 1
%add9 = mul i64 %mul819, %1
br label %cleanup
cleanup: ; preds = %if.else, %if.then4
%add9.sink = phi i64 [ %add9, %if.else ], [ %add6, %if.then4 ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add9.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int comp(const void *a, const void *b){
return *(long*)a-*(long*)b;
}
int main(void){
int n, i;
long l[100000][2];
scanf("%d", &n);
for(i=0; i<n; i++){
int a, b;
scanf("%d%d", &a, &b);
l[i][0] = a+b;
l[i][1] = a-b;
}
qsort(l, n, sizeof(long)*2, comp);
int ans=0;
long now=INT_MIN;
for(i=0; i<n; i++){
if(l[i][1]>=now){
now = l[i][0];
ans++;
}
}
printf("%d\n", ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145818/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145818/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%l = alloca [100000 x [2 x i64]], align 16
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %l) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !9
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !9
%2 = load i32, ptr %b, align 4, !tbaa !9
%add = add nsw i32 %2, %1
%conv = sext i32 %add to i64
%arrayidx = getelementptr inbounds [100000 x [2 x i64]], ptr %l, i64 0, i64 %indvars.iv
store i64 %conv, ptr %arrayidx, align 16, !tbaa !5
%sub = sub nsw i32 %1, %2
%conv3 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds [100000 x [2 x i64]], ptr %l, i64 0, i64 %indvars.iv, i64 1
store i64 %conv3, ptr %arrayidx6, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !9
%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 !11
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv7.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %4, %for.body ]
call void @qsort(ptr noundef nonnull %l, i64 noundef %conv7.pre-phi, i64 noundef 16, ptr noundef nonnull @comp) #5
%5 = load i32, ptr %n, align 4, !tbaa !9
%cmp935 = icmp sgt i32 %5, 0
br i1 %cmp935, label %for.body11.preheader, label %for.end23
for.body11.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%6 = icmp eq i32 %5, 1
br i1 %6, label %for.end23.loopexit.unr-lcssa, label %for.body11.preheader.new
for.body11.preheader.new: ; preds = %for.body11.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body11
for.body11: ; preds = %for.inc21.1, %for.body11.preheader.new
%indvars.iv42 = phi i64 [ 0, %for.body11.preheader.new ], [ %indvars.iv.next43.1, %for.inc21.1 ]
%now.038 = phi i64 [ -2147483648, %for.body11.preheader.new ], [ %now.1.1, %for.inc21.1 ]
%ans.037 = phi i32 [ 0, %for.body11.preheader.new ], [ %ans.1.1, %for.inc21.1 ]
%niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.inc21.1 ]
%arrayidx14 = getelementptr inbounds [100000 x [2 x i64]], ptr %l, i64 0, i64 %indvars.iv42, i64 1
%7 = load i64, ptr %arrayidx14, align 8, !tbaa !5
%cmp15.not = icmp slt i64 %7, %now.038
br i1 %cmp15.not, label %for.inc21, label %if.then
if.then: ; preds = %for.body11
%arrayidx13 = getelementptr inbounds [100000 x [2 x i64]], ptr %l, i64 0, i64 %indvars.iv42
%8 = load i64, ptr %arrayidx13, align 16, !tbaa !5
%inc20 = add nsw i32 %ans.037, 1
br label %for.inc21
for.inc21: ; preds = %for.body11, %if.then
%ans.1 = phi i32 [ %inc20, %if.then ], [ %ans.037, %for.body11 ]
%now.1 = phi i64 [ %8, %if.then ], [ %now.038, %for.body11 ]
%indvars.iv.next43 = or i64 %indvars.iv42, 1
%arrayidx14.1 = getelementptr inbounds [100000 x [2 x i64]], ptr %l, i64 0, i64 %indvars.iv.next43, i64 1
%9 = load i64, ptr %arrayidx14.1, align 8, !tbaa !5
%cmp15.not.1 = icmp slt i64 %9, %now.1
br i1 %cmp15.not.1, label %for.inc21.1, label %if.then.1
if.then.1: ; preds = %for.inc21
%arrayidx13.1 = getelementptr inbounds [100000 x [2 x i64]], ptr %l, i64 0, i64 %indvars.iv.next43
%10 = load i64, ptr %arrayidx13.1, align 16, !tbaa !5
%inc20.1 = add nsw i32 %ans.1, 1
br label %for.inc21.1
for.inc21.1: ; preds = %if.then.1, %for.inc21
%ans.1.1 = phi i32 [ %inc20.1, %if.then.1 ], [ %ans.1, %for.inc21 ]
%now.1.1 = phi i64 [ %10, %if.then.1 ], [ %now.1, %for.inc21 ]
%indvars.iv.next43.1 = add nuw nsw i64 %indvars.iv42, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end23.loopexit.unr-lcssa, label %for.body11, !llvm.loop !13
for.end23.loopexit.unr-lcssa: ; preds = %for.inc21.1, %for.body11.preheader
%ans.1.lcssa.ph = phi i32 [ undef, %for.body11.preheader ], [ %ans.1.1, %for.inc21.1 ]
%indvars.iv42.unr = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next43.1, %for.inc21.1 ]
%now.038.unr = phi i64 [ -2147483648, %for.body11.preheader ], [ %now.1.1, %for.inc21.1 ]
%ans.037.unr = phi i32 [ 0, %for.body11.preheader ], [ %ans.1.1, %for.inc21.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23, label %for.body11.epil
for.body11.epil: ; preds = %for.end23.loopexit.unr-lcssa
%arrayidx14.epil = getelementptr inbounds [100000 x [2 x i64]], ptr %l, i64 0, i64 %indvars.iv42.unr, i64 1
%11 = load i64, ptr %arrayidx14.epil, align 8, !tbaa !5
%cmp15.not.epil = icmp slt i64 %11, %now.038.unr
%inc20.epil = add nsw i32 %ans.037.unr, 1
%spec.select = select i1 %cmp15.not.epil, i32 %ans.037.unr, i32 %inc20.epil
br label %for.end23
for.end23: ; preds = %for.body11.epil, %for.end23.loopexit.unr-lcssa, %for.end
%ans.0.lcssa = phi i32 [ 0, %for.end ], [ %ans.1.lcssa.ph, %for.end23.loopexit.unr-lcssa ], [ %spec.select, %for.body11.epil ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %l) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007
typedef long long int lli;
int main(void) {
char s[5];
scanf("%s", s);
int ans = 0;
rep(i, 0, 4) {
if (s[i] == '+') ans++;
else ans--;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145869/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145869/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(argmem: read) uwtable
define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !9
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !10
%1 = load ptr, ptr %b, align 8, !tbaa !10
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #7
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%s = alloca [5 x i8], align 4
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load <4 x i8>, ptr %s, align 4, !tbaa !9
%1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43>
%2 = select <4 x i1> %1, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
%3 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2)
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
|
#include <stdio.h>
int main(void){
char s[100];
int count=0,count2=0;
scanf("%s",s);
if(s[count2]=='+'){count++;}
else {count--;}
count2++;
if(s[count2]=='+'){count++;}
else {count--;}
count2++;
if(s[count2]=='+'){count++;}
else {count--;}
count2++;
if(s[count2]=='+'){count++;}
else {count--;}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145919/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145919/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load <4 x i8>, ptr %s, align 16, !tbaa !5
%1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43>
%2 = extractelement <4 x i1> %1, i64 0
%. = select i1 %2, i32 1, i32 -1
%3 = extractelement <4 x i1> %1, i64 1
%count.1.v = select i1 %3, i32 1, i32 -1
%count.1 = add nsw i32 %count.1.v, %.
%inc20 = or i32 %count.1, 1
%dec22 = add nsw i32 %count.1, -1
%4 = extractelement <4 x i1> %1, i64 2
%count.2 = select i1 %4, i32 %inc20, i32 %dec22
%5 = extractelement <4 x i1> %1, i64 3
%count.3.v = select i1 %5, i32 1, i32 -1
%count.3 = add nsw i32 %count.2, %count.3.v
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.3)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
char s[5];
int i,ans;
ans = 0;
scanf("%s",s);
for (i=0;i<4;i++){
if(s[i] == '+'){
ans +=1;
}else{
ans -=1;
}
}
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_145962/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_145962/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [5 x i8], align 4
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load <4 x i8>, ptr %s, align 4, !tbaa !5
%1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43>
%2 = select <4 x i1> %1, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
%3 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int i,imagine=0;
char S[4];
scanf("%c%c%c%c",&S[0],&S[1],&S[2],&S[3]);
for(i=0;i<4;i++){
if(S[i]=='+') imagine++;
else imagine--;
}
printf("%d",imagine);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146004/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146004/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c%c%c%c\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:
%S = alloca [4 x i8], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
%arrayidx1 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%0 = load <4 x i8>, ptr %S, align 4, !tbaa !5
%1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43>
%2 = select <4 x i1> %1, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>
%3 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %2)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int n = 0;
char a;
char b;
char c;
char d;
scanf("%c%c%c%c", &a, &b, &c, &d);
switch (a)
{
case '+':
n++;
break;
case '-':
n--;
break;
}
switch (b)
{
case '+':
n++;
break;
case '-':
n--;
break;
}
switch (c)
{
case '+':
n++;
break;
case '-':
n--;
break;
}
switch (d)
{
case '+':
n++;
break;
case '-':
n--;
break;
}
printf("%d\n",n);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146048/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146048/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c%c%c%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
%c = alloca i8, align 1
%d = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i8, ptr %a, align 1, !tbaa !5
%switch.selectcmp = icmp eq i8 %0, 45
%switch.select = sext i1 %switch.selectcmp to i32
%switch.selectcmp29 = icmp eq i8 %0, 43
%switch.select30 = select i1 %switch.selectcmp29, i32 1, i32 %switch.select
%1 = load i8, ptr %b, align 1, !tbaa !5
%conv2 = sext i8 %1 to i32
switch i32 %conv2, label %sw.epilog7 [
i32 43, label %sw.bb3
i32 45, label %sw.bb5
]
sw.bb3: ; preds = %entry
%inc4 = add nsw i32 %switch.select30, 1
br label %sw.epilog7
sw.bb5: ; preds = %entry
%dec6 = add nsw i32 %switch.select30, -1
br label %sw.epilog7
sw.epilog7: ; preds = %entry, %sw.bb5, %sw.bb3
%n.1 = phi i32 [ %switch.select30, %entry ], [ %dec6, %sw.bb5 ], [ %inc4, %sw.bb3 ]
%2 = load i8, ptr %c, align 1, !tbaa !5
%conv8 = sext i8 %2 to i32
switch i32 %conv8, label %sw.epilog13 [
i32 43, label %sw.bb9
i32 45, label %sw.bb11
]
sw.bb9: ; preds = %sw.epilog7
%inc10 = add nsw i32 %n.1, 1
br label %sw.epilog13
sw.bb11: ; preds = %sw.epilog7
%dec12 = add nsw i32 %n.1, -1
br label %sw.epilog13
sw.epilog13: ; preds = %sw.epilog7, %sw.bb11, %sw.bb9
%n.2 = phi i32 [ %n.1, %sw.epilog7 ], [ %dec12, %sw.bb11 ], [ %inc10, %sw.bb9 ]
%3 = load i8, ptr %d, align 1, !tbaa !5
%conv14 = sext i8 %3 to i32
switch i32 %conv14, label %sw.epilog19 [
i32 43, label %sw.bb15
i32 45, label %sw.bb17
]
sw.bb15: ; preds = %sw.epilog13
%inc16 = add nsw i32 %n.2, 1
br label %sw.epilog19
sw.bb17: ; preds = %sw.epilog13
%dec18 = add nsw i32 %n.2, -1
br label %sw.epilog19
sw.epilog19: ; preds = %sw.epilog13, %sw.bb17, %sw.bb15
%n.3 = phi i32 [ %n.2, %sw.epilog13 ], [ %dec18, %sw.bb17 ], [ %inc16, %sw.bb15 ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.3)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 1, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int x = 0;
for (int i = 0; i < 4; i++) x += (getchar() == '+' ? +1 : -1);
printf("%d\n", x);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146091/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146091/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%cmp1 = icmp eq i32 %call.i, 43
%cond = select i1 %cmp1, i32 1, i32 -1
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.1 = tail call i32 @getc(ptr noundef %1)
%cmp1.1 = icmp eq i32 %call.i.1, 43
%cond.1 = select i1 %cmp1.1, i32 1, i32 -1
%add.1 = add nsw i32 %cond.1, %cond
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.2 = tail call i32 @getc(ptr noundef %2)
%cmp1.2 = icmp eq i32 %call.i.2, 43
%cond.2 = select i1 %cmp1.2, i32 1, i32 -1
%add.2 = add nsw i32 %cond.2, %add.1
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.3 = tail call i32 @getc(ptr noundef %3)
%cmp1.3 = icmp eq i32 %call.i.3, 43
%cond.3 = select i1 %cmp1.3, i32 1, i32 -1
%add.3 = add nsw i32 %cond.3, %add.2
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add.3)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(void){
int ct = 0;
char a[5] = {'\0'};
int i;
scanf("%s", a);
for( i =0 ; a[i] != '\0'; i++){
if(a[i] == '+'){
ct++;
}else{
ct--;
}
}
printf("%d\n", ct);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146134/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146134/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %a, i8 0, i64 5, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%ct.0 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %if.else [
i8 0, label %for.end
i8 43, label %for.inc
]
if.else: ; preds = %for.cond
br label %for.inc
for.inc: ; preds = %for.cond, %if.else
%.sink = phi i32 [ -1, %if.else ], [ 1, %for.cond ]
%inc = add nsw i32 %ct.0, %.sink
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !8
for.end: ; preds = %for.cond
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ct.0)
call void @llvm.lifetime.end.p0(i64 5, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int i,j,k;
int N=0;
char A[4];
scanf("%s", A);
for(i=0;i<4;i++){
if(A[i]=='-')N--;
if(A[i]=='+')N++;
}
printf("%d", N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146185/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146185/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [4 x i8], align 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 %A)
%0 = load <4 x i8>, ptr %A, align 4, !tbaa !5
%1 = icmp eq <4 x i8> %0, <i8 43, i8 43, i8 43, i8 43>
%2 = icmp eq <4 x i8> %0, <i8 45, i8 45, i8 45, i8 45>
%3 = bitcast <4 x i1> %1 to i4
%4 = call i4 @llvm.ctpop.i4(i4 %3), !range !8
%5 = zext i4 %4 to i32
%6 = bitcast <4 x i1> %2 to i4
%7 = call i4 @llvm.ctpop.i4(i4 %6), !range !8
%8 = zext i4 %7 to i32
%op.rdx = sub nsw i32 %5, %8
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %op.rdx)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{i4 0, i4 5}
|
#include <stdio.h>
int main(void) {
int h,m,s,hh,mm,ss,tsec,tsec3;
while(scanf("%d%d%d",&h,&m,&s) , h != -1){
tsec = h * 3600 + m * 60 + s;
tsec = 7200 - tsec;
tsec3 = tsec * 3;
hh = tsec / 3600;
tsec = tsec - hh * 3600;
mm = tsec / 60;
tsec = tsec - mm * 60;
ss = tsec;
printf("%02d:%02d:%02d\n",hh,mm,ss);
hh = tsec3 / 3600;
tsec3 = tsec3 - hh * 3600;
mm = tsec3 / 60;
tsec3 = tsec3 - mm * 60;
ss = tsec3;
printf("%02d:%02d:%02d\n",hh,mm,ss);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146228/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146228/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [16 x i8] c"%02d:%02d:%02d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%m = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %m, ptr noundef nonnull %s)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp.not35 = icmp eq i32 %0, -1
br i1 %cmp.not35, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%1 = phi i32 [ %4, %while.body ], [ %0, %entry ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%3 = load i32, ptr %s, align 4, !tbaa !5
%mul.neg = mul i32 %1, -3600
%mul1.neg = mul i32 %2, -60
%add.neg = add i32 %mul.neg, 7200
%add2.neg = add i32 %add.neg, %mul1.neg
%sub = sub i32 %add2.neg, %3
%mul3 = mul nsw i32 %sub, 3
%div = sdiv i32 %sub, 3600
%mul4.neg = mul nsw i32 %div, -3600
%sub5 = add i32 %mul4.neg, %sub
%div6 = sdiv i32 %sub5, 60
%mul7.neg = mul nsw i32 %div6, -60
%sub8 = add i32 %mul7.neg, %sub5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div6, i32 noundef %sub8)
%div10 = sdiv i32 %sub, 1200
%mul11.neg = mul i32 %div10, -3600
%sub12 = add i32 %mul11.neg, %mul3
%div13 = sdiv i32 %sub12, 60
%mul14.neg = mul nsw i32 %div13, -60
%sub15 = add i32 %mul14.neg, %sub12
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div10, i32 noundef %div13, i32 noundef %sub15)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %m, ptr noundef nonnull %s)
%4 = load i32, ptr %h, align 4, !tbaa !5
%cmp.not = icmp eq i32 %4, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int n,a[1000],i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
for(size_t t=0;t<a[i];t++)
printf("3 ");
printf("\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14630/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14630/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"3 \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %0, 0
br i1 %cmp25, label %for.body, label %for.end18
for.cond2.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.cond5.preheader, label %for.end18
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond5.preheader: ; preds = %for.cond2.preheader, %for.cond.cleanup
%indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.cond.cleanup ], [ 0, %for.cond2.preheader ]
%arrayidx7 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv33
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp828.not = icmp eq i32 %4, 0
br i1 %cmp828.not, label %for.cond.cleanup, label %for.body10
for.cond.cleanup: ; preds = %for.body10, %for.cond5.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp3 = icmp slt i64 %indvars.iv.next34, %6
br i1 %cmp3, label %for.cond5.preheader, label %for.end18, !llvm.loop !11
for.body10: ; preds = %for.cond5.preheader, %for.body10
%t.029 = phi i64 [ %inc13, %for.body10 ], [ 0, %for.cond5.preheader ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%inc13 = add nuw i64 %t.029, 1
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%conv = sext i32 %7 to i64
%cmp8 = icmp ult i64 %inc13, %conv
br i1 %cmp8, label %for.body10, label %for.cond.cleanup, !llvm.loop !12
for.end18: ; preds = %for.cond.cleanup, %entry, %for.cond2.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void) {
int n;
scanf("%d", &n);
int f[n][10];
for (int i = 0; i < n; i++) {
for (int j = 0; j < 10; j++) {
scanf("%d", &f[i][j]);
}
}
long p[n][11];
for (int i = 0; i < n; i++) {
for (int j = 0; j < 11; j++) {
scanf("%ld", &p[i][j]);
}
}
int bit[10];
bit[0] = 1;
for (int i = 0; i < 10; i++) {
bit[i] = 0;
}
long max = 0;
for (int i = 0; i < n; i++) {
if (f[i][0] == 1) {
max += p[i][1];
} else {
max += p[i][0];
}
}
long profit;
int common;
while (1) {
bit[0]++;
for (int i = 1; i < 10; i++) {
bit[i] += bit[i-1]/2;
bit[i-1] %= 2;
}
if (bit[9] > 1) {
break;
}
profit = 0;
for (int i = 0; i < n; i++) {
common = 0;
for (int j = 0; j < 10; j++) {
if (bit[j] == 1 && f[i][j] == 1) {
common++;
}
}
profit += p[i][common];
}
if (profit > max) {
max = profit;
}
}
printf("%ld\n", max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146365/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146365/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca [10 x i32], i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp154 = icmp sgt i32 %3, 0
br i1 %cmp154, label %for.cond1.preheader, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%4 = zext i32 %3 to i64
%vla11267 = alloca [11 x i64], i64 %4, align 16
br label %while.cond.preheader
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %entry ]
%arrayidx6 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 0
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%arrayidx6.1 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 1
%call7.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1)
%arrayidx6.2 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 2
%call7.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2)
%arrayidx6.3 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 3
%call7.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.3)
%arrayidx6.4 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 4
%call7.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.4)
%arrayidx6.5 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 5
%call7.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.5)
%arrayidx6.6 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 6
%call7.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.6)
%arrayidx6.7 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 7
%call7.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.7)
%arrayidx6.8 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 8
%call7.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.8)
%arrayidx6.9 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv, i64 9
%call7.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.9)
%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.cond1.preheader, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup: ; preds = %for.cond1.preheader
%7 = zext i32 %5 to i64
%vla11 = alloca [11 x i64], i64 %7, align 16
%cmp14157 = icmp sgt i32 %5, 0
br i1 %cmp14157, label %for.cond18.preheader, label %while.cond.preheader
for.cond18.preheader: ; preds = %for.cond.cleanup, %for.cond18.preheader
%indvars.iv179 = phi i64 [ %indvars.iv.next180, %for.cond18.preheader ], [ 0, %for.cond.cleanup ]
%arrayidx25 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 0
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25)
%arrayidx25.1 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 1
%call26.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.1)
%arrayidx25.2 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 2
%call26.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.2)
%arrayidx25.3 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 3
%call26.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.3)
%arrayidx25.4 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 4
%call26.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.4)
%arrayidx25.5 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 5
%call26.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.5)
%arrayidx25.6 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 6
%call26.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.6)
%arrayidx25.7 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 7
%call26.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.7)
%arrayidx25.8 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 8
%call26.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.8)
%arrayidx25.9 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 9
%call26.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.9)
%arrayidx25.10 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv179, i64 10
%call26.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25.10)
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp14 = icmp slt i64 %indvars.iv.next180, %9
br i1 %cmp14, label %for.cond18.preheader, label %for.cond.cleanup15, !llvm.loop !11
for.cond.cleanup15: ; preds = %for.cond18.preheader
%cmp46161 = icmp sgt i32 %8, 0
br i1 %cmp46161, label %for.body48.preheader, label %while.cond.preheader
for.body48.preheader: ; preds = %for.cond.cleanup15
%wide.trip.count = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count, 1
%10 = icmp eq i32 %8, 1
br i1 %10, label %while.cond.preheader.loopexit.unr-lcssa, label %for.body48.preheader.new
for.body48.preheader.new: ; preds = %for.body48.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body48
while.cond.preheader.loopexit.unr-lcssa: ; preds = %for.body48, %for.body48.preheader
%max.1.lcssa.ph = phi i64 [ undef, %for.body48.preheader ], [ %max.1.1, %for.body48 ]
%indvars.iv185.unr = phi i64 [ 0, %for.body48.preheader ], [ %indvars.iv.next186.1, %for.body48 ]
%max.0162.unr = phi i64 [ 0, %for.body48.preheader ], [ %max.1.1, %for.body48 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.cond.preheader, label %for.body48.epil
for.body48.epil: ; preds = %while.cond.preheader.loopexit.unr-lcssa
%arrayidx50.epil = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv185.unr
%11 = load i32, ptr %arrayidx50.epil, align 8, !tbaa !5
%cmp52.epil = icmp eq i32 %11, 1
%arrayidx55.epil = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv185.unr, i64 1
%arrayidx57.epil = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv185.unr
%.pn.in.epil = select i1 %cmp52.epil, ptr %arrayidx55.epil, ptr %arrayidx57.epil
%.pn.epil = load i64, ptr %.pn.in.epil, align 8, !tbaa !12
%max.1.epil = add nsw i64 %.pn.epil, %max.0162.unr
br label %while.cond.preheader
while.cond.preheader: ; preds = %for.body48.epil, %while.cond.preheader.loopexit.unr-lcssa, %for.cond.cleanup.thread, %for.cond.cleanup, %for.cond.cleanup15
%cmp46161275 = phi i1 [ false, %for.cond.cleanup15 ], [ false, %for.cond.cleanup ], [ false, %for.cond.cleanup.thread ], [ %cmp46161, %while.cond.preheader.loopexit.unr-lcssa ], [ %cmp46161, %for.body48.epil ]
%.lcssa274 = phi i32 [ %8, %for.cond.cleanup15 ], [ %5, %for.cond.cleanup ], [ %3, %for.cond.cleanup.thread ], [ %8, %while.cond.preheader.loopexit.unr-lcssa ], [ %8, %for.body48.epil ]
%vla11269273 = phi ptr [ %vla11, %for.cond.cleanup15 ], [ %vla11, %for.cond.cleanup ], [ %vla11267, %for.cond.cleanup.thread ], [ %vla11, %while.cond.preheader.loopexit.unr-lcssa ], [ %vla11, %for.body48.epil ]
%max.0.lcssa = phi i64 [ 0, %for.cond.cleanup15 ], [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ %max.1.lcssa.ph, %while.cond.preheader.loopexit.unr-lcssa ], [ %max.1.epil, %for.body48.epil ]
%wide.trip.count200 = zext i32 %.lcssa274 to i64
br label %while.cond
for.body48: ; preds = %for.body48, %for.body48.preheader.new
%indvars.iv185 = phi i64 [ 0, %for.body48.preheader.new ], [ %indvars.iv.next186.1, %for.body48 ]
%max.0162 = phi i64 [ 0, %for.body48.preheader.new ], [ %max.1.1, %for.body48 ]
%niter = phi i64 [ 0, %for.body48.preheader.new ], [ %niter.next.1, %for.body48 ]
%arrayidx50 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv185
%12 = load i32, ptr %arrayidx50, align 16, !tbaa !5
%cmp52 = icmp eq i32 %12, 1
%arrayidx55 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv185, i64 1
%arrayidx57 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv185
%.pn.in = select i1 %cmp52, ptr %arrayidx55, ptr %arrayidx57
%.pn = load i64, ptr %.pn.in, align 8, !tbaa !12
%max.1 = add nsw i64 %.pn, %max.0162
%indvars.iv.next186 = or i64 %indvars.iv185, 1
%arrayidx50.1 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv.next186
%13 = load i32, ptr %arrayidx50.1, align 8, !tbaa !5
%cmp52.1 = icmp eq i32 %13, 1
%arrayidx55.1 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv.next186, i64 1
%arrayidx57.1 = getelementptr inbounds [11 x i64], ptr %vla11, i64 %indvars.iv.next186
%.pn.in.1 = select i1 %cmp52.1, ptr %arrayidx55.1, ptr %arrayidx57.1
%.pn.1 = load i64, ptr %.pn.in.1, align 8, !tbaa !12
%max.1.1 = add nsw i64 %.pn.1, %max.1
%indvars.iv.next186.1 = add nuw nsw i64 %indvars.iv185, 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 %while.cond.preheader.loopexit.unr-lcssa, label %for.body48, !llvm.loop !14
while.cond: ; preds = %while.cond.preheader, %for.cond.cleanup88
%bit.sroa.0.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem, %for.cond.cleanup88 ]
%bit.sroa.10.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.1, %for.cond.cleanup88 ]
%bit.sroa.16.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.2, %for.cond.cleanup88 ]
%bit.sroa.22.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.3, %for.cond.cleanup88 ]
%bit.sroa.28.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.4, %for.cond.cleanup88 ]
%bit.sroa.34.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.5, %for.cond.cleanup88 ]
%bit.sroa.40.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.6, %for.cond.cleanup88 ]
%bit.sroa.46.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.7, %for.cond.cleanup88 ]
%bit.sroa.52.0 = phi i32 [ 0, %while.cond.preheader ], [ %rem.8, %for.cond.cleanup88 ]
%bit.sroa.58.0 = phi i32 [ 0, %while.cond.preheader ], [ %add74.8, %for.cond.cleanup88 ]
%max.2 = phi i64 [ %max.0.lcssa, %while.cond.preheader ], [ %spec.select, %for.cond.cleanup88 ]
%inc64 = add nuw nsw i32 %bit.sroa.0.0, 1
%div258 = lshr i32 %inc64, 1
%add74 = add nuw nsw i32 %bit.sroa.10.0, %div258
%rem = and i32 %inc64, 1
%div.1259 = lshr i32 %add74, 1
%add74.1 = add nuw nsw i32 %bit.sroa.16.0, %div.1259
%rem.1 = and i32 %add74, 1
%div.2260 = lshr i32 %add74.1, 1
%add74.2 = add nuw nsw i32 %bit.sroa.22.0, %div.2260
%rem.2 = and i32 %add74.1, 1
%div.3261 = lshr i32 %add74.2, 1
%add74.3 = add nuw nsw i32 %bit.sroa.28.0, %div.3261
%rem.3 = and i32 %add74.2, 1
%div.4262 = lshr i32 %add74.3, 1
%add74.4 = add nuw nsw i32 %bit.sroa.34.0, %div.4262
%rem.4 = and i32 %add74.3, 1
%div.5263 = lshr i32 %add74.4, 1
%add74.5 = add nuw nsw i32 %bit.sroa.40.0, %div.5263
%rem.5 = and i32 %add74.4, 1
%div.6264 = lshr i32 %add74.5, 1
%add74.6 = add nuw nsw i32 %bit.sroa.46.0, %div.6264
%rem.6 = and i32 %add74.5, 1
%div.7265 = lshr i32 %add74.6, 1
%add74.7 = add nuw nsw i32 %bit.sroa.52.0, %div.7265
%rem.7 = and i32 %add74.6, 1
%div.8266 = lshr i32 %add74.7, 1
%add74.8 = add nuw nsw i32 %bit.sroa.58.0, %div.8266
%rem.8 = and i32 %add74.7, 1
%cmp82 = icmp ugt i32 %add74.8, 1
br i1 %cmp82, label %while.end, label %for.cond86.preheader
for.cond86.preheader: ; preds = %while.cond
br i1 %cmp46161275, label %for.cond91.preheader.preheader, label %for.cond.cleanup88
for.cond91.preheader.preheader: ; preds = %for.cond86.preheader
%cmp97.not = icmp eq i32 %rem, 0
%cmp97.1.not = icmp eq i32 %rem.1, 0
%cmp97.2.not = icmp eq i32 %rem.2, 0
%cmp97.3.not = icmp eq i32 %rem.3, 0
%cmp97.4.not = icmp eq i32 %rem.4, 0
%cmp97.5.not = icmp eq i32 %rem.5, 0
%cmp97.6.not = icmp eq i32 %rem.6, 0
%cmp97.7.not = icmp eq i32 %rem.7, 0
%cmp97.8.not = icmp eq i32 %rem.8, 0
%cmp97.9 = icmp eq i32 %add74.8, 1
br label %for.cond91.preheader
for.cond91.preheader: ; preds = %for.cond91.preheader.preheader, %for.inc106.9
%indvars.iv197 = phi i64 [ 0, %for.cond91.preheader.preheader ], [ %indvars.iv.next198, %for.inc106.9 ]
%profit.0169 = phi i64 [ 0, %for.cond91.preheader.preheader ], [ %add113, %for.inc106.9 ]
br i1 %cmp97.not, label %for.inc106, label %land.lhs.true
for.cond.cleanup88: ; preds = %for.inc106.9, %for.cond86.preheader
%profit.0.lcssa = phi i64 [ 0, %for.cond86.preheader ], [ %add113, %for.inc106.9 ]
%spec.select = call i64 @llvm.smax.i64(i64 %profit.0.lcssa, i64 %max.2)
br label %while.cond
land.lhs.true: ; preds = %for.cond91.preheader
%arrayidx101 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 0
%14 = load i32, ptr %arrayidx101, align 8, !tbaa !5
%cmp102 = icmp eq i32 %14, 1
%inc104 = zext i1 %cmp102 to i32
br label %for.inc106
for.inc106: ; preds = %land.lhs.true, %for.cond91.preheader
%common.1 = phi i32 [ 0, %for.cond91.preheader ], [ %inc104, %land.lhs.true ]
br i1 %cmp97.1.not, label %for.inc106.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.inc106
%arrayidx101.1 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 1
%15 = load i32, ptr %arrayidx101.1, align 4, !tbaa !5
%cmp102.1 = icmp eq i32 %15, 1
%inc104.1 = zext i1 %cmp102.1 to i32
%spec.select151.1 = add nuw nsw i32 %common.1, %inc104.1
br label %for.inc106.1
for.inc106.1: ; preds = %land.lhs.true.1, %for.inc106
%common.1.1 = phi i32 [ %common.1, %for.inc106 ], [ %spec.select151.1, %land.lhs.true.1 ]
br i1 %cmp97.2.not, label %for.inc106.2, label %land.lhs.true.2
land.lhs.true.2: ; preds = %for.inc106.1
%arrayidx101.2 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 2
%16 = load i32, ptr %arrayidx101.2, align 8, !tbaa !5
%cmp102.2 = icmp eq i32 %16, 1
%inc104.2 = zext i1 %cmp102.2 to i32
%spec.select151.2 = add nuw nsw i32 %common.1.1, %inc104.2
br label %for.inc106.2
for.inc106.2: ; preds = %land.lhs.true.2, %for.inc106.1
%common.1.2 = phi i32 [ %common.1.1, %for.inc106.1 ], [ %spec.select151.2, %land.lhs.true.2 ]
br i1 %cmp97.3.not, label %for.inc106.3, label %land.lhs.true.3
land.lhs.true.3: ; preds = %for.inc106.2
%arrayidx101.3 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 3
%17 = load i32, ptr %arrayidx101.3, align 4, !tbaa !5
%cmp102.3 = icmp eq i32 %17, 1
%inc104.3 = zext i1 %cmp102.3 to i32
%spec.select151.3 = add nuw nsw i32 %common.1.2, %inc104.3
br label %for.inc106.3
for.inc106.3: ; preds = %land.lhs.true.3, %for.inc106.2
%common.1.3 = phi i32 [ %common.1.2, %for.inc106.2 ], [ %spec.select151.3, %land.lhs.true.3 ]
br i1 %cmp97.4.not, label %for.inc106.4, label %land.lhs.true.4
land.lhs.true.4: ; preds = %for.inc106.3
%arrayidx101.4 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 4
%18 = load i32, ptr %arrayidx101.4, align 8, !tbaa !5
%cmp102.4 = icmp eq i32 %18, 1
%inc104.4 = zext i1 %cmp102.4 to i32
%spec.select151.4 = add nuw nsw i32 %common.1.3, %inc104.4
br label %for.inc106.4
for.inc106.4: ; preds = %land.lhs.true.4, %for.inc106.3
%common.1.4 = phi i32 [ %common.1.3, %for.inc106.3 ], [ %spec.select151.4, %land.lhs.true.4 ]
br i1 %cmp97.5.not, label %for.inc106.5, label %land.lhs.true.5
land.lhs.true.5: ; preds = %for.inc106.4
%arrayidx101.5 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 5
%19 = load i32, ptr %arrayidx101.5, align 4, !tbaa !5
%cmp102.5 = icmp eq i32 %19, 1
%inc104.5 = zext i1 %cmp102.5 to i32
%spec.select151.5 = add nuw nsw i32 %common.1.4, %inc104.5
br label %for.inc106.5
for.inc106.5: ; preds = %land.lhs.true.5, %for.inc106.4
%common.1.5 = phi i32 [ %common.1.4, %for.inc106.4 ], [ %spec.select151.5, %land.lhs.true.5 ]
br i1 %cmp97.6.not, label %for.inc106.6, label %land.lhs.true.6
land.lhs.true.6: ; preds = %for.inc106.5
%arrayidx101.6 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 6
%20 = load i32, ptr %arrayidx101.6, align 8, !tbaa !5
%cmp102.6 = icmp eq i32 %20, 1
%inc104.6 = zext i1 %cmp102.6 to i32
%spec.select151.6 = add nuw nsw i32 %common.1.5, %inc104.6
br label %for.inc106.6
for.inc106.6: ; preds = %land.lhs.true.6, %for.inc106.5
%common.1.6 = phi i32 [ %common.1.5, %for.inc106.5 ], [ %spec.select151.6, %land.lhs.true.6 ]
br i1 %cmp97.7.not, label %for.inc106.7, label %land.lhs.true.7
land.lhs.true.7: ; preds = %for.inc106.6
%arrayidx101.7 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 7
%21 = load i32, ptr %arrayidx101.7, align 4, !tbaa !5
%cmp102.7 = icmp eq i32 %21, 1
%inc104.7 = zext i1 %cmp102.7 to i32
%spec.select151.7 = add nuw nsw i32 %common.1.6, %inc104.7
br label %for.inc106.7
for.inc106.7: ; preds = %land.lhs.true.7, %for.inc106.6
%common.1.7 = phi i32 [ %common.1.6, %for.inc106.6 ], [ %spec.select151.7, %land.lhs.true.7 ]
br i1 %cmp97.8.not, label %for.inc106.8, label %land.lhs.true.8
land.lhs.true.8: ; preds = %for.inc106.7
%arrayidx101.8 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 8
%22 = load i32, ptr %arrayidx101.8, align 8, !tbaa !5
%cmp102.8 = icmp eq i32 %22, 1
%inc104.8 = zext i1 %cmp102.8 to i32
%spec.select151.8 = add nuw nsw i32 %common.1.7, %inc104.8
br label %for.inc106.8
for.inc106.8: ; preds = %land.lhs.true.8, %for.inc106.7
%common.1.8 = phi i32 [ %common.1.7, %for.inc106.7 ], [ %spec.select151.8, %land.lhs.true.8 ]
br i1 %cmp97.9, label %land.lhs.true.9, label %for.inc106.9
land.lhs.true.9: ; preds = %for.inc106.8
%arrayidx101.9 = getelementptr inbounds [10 x i32], ptr %vla, i64 %indvars.iv197, i64 9
%23 = load i32, ptr %arrayidx101.9, align 4, !tbaa !5
%cmp102.9 = icmp eq i32 %23, 1
%inc104.9 = zext i1 %cmp102.9 to i32
%spec.select151.9 = add nuw nsw i32 %common.1.8, %inc104.9
br label %for.inc106.9
for.inc106.9: ; preds = %land.lhs.true.9, %for.inc106.8
%common.1.9 = phi i32 [ %common.1.8, %for.inc106.8 ], [ %spec.select151.9, %land.lhs.true.9 ]
%idxprom111 = zext i32 %common.1.9 to i64
%arrayidx112 = getelementptr inbounds [11 x i64], ptr %vla11269273, i64 %indvars.iv197, i64 %idxprom111
%24 = load i64, ptr %arrayidx112, align 8, !tbaa !12
%add113 = add nsw i64 %24, %profit.0169
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%exitcond201.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count200
br i1 %exitcond201.not, label %for.cond.cleanup88, label %for.cond91.preheader, !llvm.loop !15
while.end: ; preds = %while.cond
%call120 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %max.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(){
int i,j,k,l;
int n;
int f[105][15];
int p[105][15];
int t[15];
int s[105];
int point;
for(i=0;i<100;i++)
{
s[i]=0;
}
int max;
for(i=0;i<10;i++)
{
t[i]=0;
}
t[0]=1;
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<10;j++)
{
scanf("%d",&f[i][j]);
}
}
for(i=0;i<n;i++)
{
for(j=0;j<11;j++)
{
scanf("%d",&p[i][j]);
}
}
for(i=0;i<1023;i++)//店の開業パターン
{
for(k=0;k<10;k++)
{
if(t[k]>=2)
{
t[k]=0;
t[k+1]++;
}
}
for(j=0;j<n;j++)
{
for(l=0;l<10;l++)
{
if(t[l]==1&&f[j][l]==1)
s[j]++;//j番目の店と被る回数
}
}
for(j=0;j<n;j++)
{
point=point+p[j][s[j]];
}
if(i==0)
{
max=point;
}else if(max<point)
{
max=point;
}
for(j=0;j<n;j++)
{
s[j]=0;//j番目の店と被る回数を0に
}
t[0]++;
point=0;
}
printf("%d",max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%f = alloca [105 x [15 x i32]], align 16
%p = alloca [105 x [15 x i32]], align 16
%s = alloca [105 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 6300, ptr nonnull %f) #5
call void @llvm.lifetime.start.p0(i64 6300, ptr nonnull %p) #5
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %s) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %s, i8 0, i64 400, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11163 = icmp sgt i32 %0, 0
br i1 %cmp11163, label %for.cond13.preheader, label %for.cond44.preheader
for.cond13.preheader: ; preds = %entry, %for.cond13.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond13.preheader ], [ 0, %entry ]
%arrayidx19 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 0
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19)
%arrayidx19.1 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 1
%call20.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.1)
%arrayidx19.2 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 2
%call20.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.2)
%arrayidx19.3 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 3
%call20.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.3)
%arrayidx19.4 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 4
%call20.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.4)
%arrayidx19.5 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 5
%call20.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.5)
%arrayidx19.6 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 6
%call20.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.6)
%arrayidx19.7 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 7
%call20.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.7)
%arrayidx19.8 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 8
%call20.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.8)
%arrayidx19.9 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv, i64 9
%call20.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19.9)
%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
%cmp11 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader, !llvm.loop !9
for.cond27.preheader: ; preds = %for.cond13.preheader
%cmp28166 = icmp sgt i32 %1, 0
br i1 %cmp28166, label %for.cond30.preheader, label %for.cond44.preheader
for.cond30.preheader: ; preds = %for.cond27.preheader, %for.cond30.preheader
%indvars.iv188 = phi i64 [ %indvars.iv.next189, %for.cond30.preheader ], [ 0, %for.cond27.preheader ]
%arrayidx36 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 0
%call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36)
%arrayidx36.1 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 1
%call37.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.1)
%arrayidx36.2 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 2
%call37.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.2)
%arrayidx36.3 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 3
%call37.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.3)
%arrayidx36.4 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 4
%call37.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.4)
%arrayidx36.5 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 5
%call37.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.5)
%arrayidx36.6 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 6
%call37.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.6)
%arrayidx36.7 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 7
%call37.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.7)
%arrayidx36.8 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 8
%call37.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.8)
%arrayidx36.9 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 9
%call37.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.9)
%arrayidx36.10 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv188, i64 10
%call37.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx36.10)
%indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp28 = icmp slt i64 %indvars.iv.next189, %4
br i1 %cmp28, label %for.cond30.preheader, label %for.cond44.preheader, !llvm.loop !11
for.cond44.preheader: ; preds = %for.cond30.preheader, %entry, %for.cond27.preheader
%.lcssa = phi i32 [ %1, %for.cond27.preheader ], [ %0, %entry ], [ %3, %for.cond30.preheader ]
%cmp62170 = icmp sgt i32 %.lcssa, 0
%5 = zext i32 %.lcssa to i64
%6 = shl nuw nsw i64 %5, 2
%xtraiter = and i64 %5, 3
%7 = icmp ult i32 %.lcssa, 4
%unroll_iter = and i64 %5, 4294967292
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond47.preheader
for.cond47.preheader: ; preds = %for.cond44.preheader, %for.end112
%t.sroa.9.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.9.2, %for.end112 ]
%t.sroa.14.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.14.2, %for.end112 ]
%t.sroa.19.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.19.2, %for.end112 ]
%t.sroa.24.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.24.2, %for.end112 ]
%t.sroa.29.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.29.2, %for.end112 ]
%t.sroa.34.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.34.2, %for.end112 ]
%t.sroa.39.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.39.2, %for.end112 ]
%t.sroa.44.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.44.2, %for.end112 ]
%t.sroa.0.0 = phi i32 [ 1, %for.cond44.preheader ], [ %inc114, %for.end112 ]
%t.sroa.49.0 = phi i32 [ 0, %for.cond44.preheader ], [ %t.sroa.49.2, %for.end112 ]
%max.0179 = phi i32 [ undef, %for.cond44.preheader ], [ %max.1253, %for.end112 ]
%i.4178 = phi i32 [ 0, %for.cond44.preheader ], [ %inc116, %for.end112 ]
%cmp52 = icmp sgt i32 %t.sroa.0.0, 1
%inc57 = zext i1 %cmp52 to i32
%spec.select256 = add nsw i32 %t.sroa.9.0, %inc57
%spec.select257 = select i1 %cmp52, i32 0, i32 %t.sroa.0.0
%cmp52.1 = icmp sgt i32 %spec.select256, 1
%t.sroa.9.2 = select i1 %cmp52.1, i32 0, i32 %spec.select256
%inc57.1 = zext i1 %cmp52.1 to i32
%t.sroa.14.1 = add nsw i32 %t.sroa.14.0, %inc57.1
%cmp52.2 = icmp sgt i32 %t.sroa.14.1, 1
%t.sroa.14.2 = select i1 %cmp52.2, i32 0, i32 %t.sroa.14.1
%inc57.2 = zext i1 %cmp52.2 to i32
%t.sroa.19.1 = add nsw i32 %t.sroa.19.0, %inc57.2
%cmp52.3 = icmp sgt i32 %t.sroa.19.1, 1
%t.sroa.19.2 = select i1 %cmp52.3, i32 0, i32 %t.sroa.19.1
%inc57.3 = zext i1 %cmp52.3 to i32
%t.sroa.24.1 = add nsw i32 %t.sroa.24.0, %inc57.3
%cmp52.4 = icmp sgt i32 %t.sroa.24.1, 1
%t.sroa.24.2 = select i1 %cmp52.4, i32 0, i32 %t.sroa.24.1
%inc57.4 = zext i1 %cmp52.4 to i32
%t.sroa.29.1 = add nsw i32 %t.sroa.29.0, %inc57.4
%cmp52.5 = icmp sgt i32 %t.sroa.29.1, 1
%t.sroa.29.2 = select i1 %cmp52.5, i32 0, i32 %t.sroa.29.1
%inc57.5 = zext i1 %cmp52.5 to i32
%t.sroa.34.1 = add nsw i32 %t.sroa.34.0, %inc57.5
%cmp52.6 = icmp sgt i32 %t.sroa.34.1, 1
%t.sroa.34.2 = select i1 %cmp52.6, i32 0, i32 %t.sroa.34.1
%inc57.6 = zext i1 %cmp52.6 to i32
%t.sroa.39.1 = add nsw i32 %t.sroa.39.0, %inc57.6
%cmp52.7 = icmp sgt i32 %t.sroa.39.1, 1
%t.sroa.39.2 = select i1 %cmp52.7, i32 0, i32 %t.sroa.39.1
%inc57.7 = zext i1 %cmp52.7 to i32
%t.sroa.44.1 = add nsw i32 %t.sroa.44.0, %inc57.7
%cmp52.8 = icmp sgt i32 %t.sroa.44.1, 1
%t.sroa.44.2 = select i1 %cmp52.8, i32 0, i32 %t.sroa.44.1
%inc57.8 = zext i1 %cmp52.8 to i32
%t.sroa.49.1 = add nsw i32 %t.sroa.49.0, %inc57.8
%cmp52.9 = icmp sgt i32 %t.sroa.49.1, 1
%t.sroa.49.2 = select i1 %cmp52.9, i32 0, i32 %t.sroa.49.1
br i1 %cmp62170, label %for.cond64.preheader.preheader, label %for.end98.thread
for.cond64.preheader.preheader: ; preds = %for.cond47.preheader
%cmp69 = icmp eq i32 %spec.select257, 1
%cmp69.1 = icmp eq i32 %t.sroa.9.2, 1
%cmp69.2 = icmp eq i32 %t.sroa.14.2, 1
%cmp69.3 = icmp eq i32 %t.sroa.19.2, 1
%cmp69.4 = icmp eq i32 %t.sroa.24.2, 1
%cmp69.5 = icmp eq i32 %t.sroa.29.2, 1
%cmp69.6 = icmp eq i32 %t.sroa.34.2, 1
%cmp69.7 = icmp eq i32 %t.sroa.39.2, 1
%cmp69.8 = icmp eq i32 %t.sroa.44.2, 1
%cmp69.9 = icmp eq i32 %t.sroa.49.2, 1
br label %for.cond64.preheader
for.cond86.preheader: ; preds = %for.inc80.9
br i1 %cmp62170, label %for.body88.preheader, label %for.end98.thread
for.body88.preheader: ; preds = %for.cond86.preheader
br i1 %7, label %for.end98.unr-lcssa, label %for.body88
for.cond64.preheader: ; preds = %for.cond64.preheader.preheader, %for.inc80.9
%indvars.iv198 = phi i64 [ 0, %for.cond64.preheader.preheader ], [ %indvars.iv.next199, %for.inc80.9 ]
%arrayidx77 = getelementptr inbounds [105 x i32], ptr %s, i64 0, i64 %indvars.iv198
br i1 %cmp69, label %land.lhs.true, label %for.inc80
land.lhs.true: ; preds = %for.cond64.preheader
%arrayidx73 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 0
%8 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%cmp74 = icmp eq i32 %8, 1
br i1 %cmp74, label %if.then75, label %for.inc80
if.then75: ; preds = %land.lhs.true
%9 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78 = add nsw i32 %9, 1
store i32 %inc78, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80
for.inc80: ; preds = %for.cond64.preheader, %land.lhs.true, %if.then75
br i1 %cmp69.1, label %land.lhs.true.1, label %for.inc80.1
land.lhs.true.1: ; preds = %for.inc80
%arrayidx73.1 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 1
%10 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5
%cmp74.1 = icmp eq i32 %10, 1
br i1 %cmp74.1, label %if.then75.1, label %for.inc80.1
if.then75.1: ; preds = %land.lhs.true.1
%11 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.1 = add nsw i32 %11, 1
store i32 %inc78.1, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.1
for.inc80.1: ; preds = %if.then75.1, %land.lhs.true.1, %for.inc80
br i1 %cmp69.2, label %land.lhs.true.2, label %for.inc80.2
land.lhs.true.2: ; preds = %for.inc80.1
%arrayidx73.2 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 2
%12 = load i32, ptr %arrayidx73.2, align 4, !tbaa !5
%cmp74.2 = icmp eq i32 %12, 1
br i1 %cmp74.2, label %if.then75.2, label %for.inc80.2
if.then75.2: ; preds = %land.lhs.true.2
%13 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.2 = add nsw i32 %13, 1
store i32 %inc78.2, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.2
for.inc80.2: ; preds = %if.then75.2, %land.lhs.true.2, %for.inc80.1
br i1 %cmp69.3, label %land.lhs.true.3, label %for.inc80.3
land.lhs.true.3: ; preds = %for.inc80.2
%arrayidx73.3 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 3
%14 = load i32, ptr %arrayidx73.3, align 4, !tbaa !5
%cmp74.3 = icmp eq i32 %14, 1
br i1 %cmp74.3, label %if.then75.3, label %for.inc80.3
if.then75.3: ; preds = %land.lhs.true.3
%15 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.3 = add nsw i32 %15, 1
store i32 %inc78.3, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.3
for.inc80.3: ; preds = %if.then75.3, %land.lhs.true.3, %for.inc80.2
br i1 %cmp69.4, label %land.lhs.true.4, label %for.inc80.4
land.lhs.true.4: ; preds = %for.inc80.3
%arrayidx73.4 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 4
%16 = load i32, ptr %arrayidx73.4, align 4, !tbaa !5
%cmp74.4 = icmp eq i32 %16, 1
br i1 %cmp74.4, label %if.then75.4, label %for.inc80.4
if.then75.4: ; preds = %land.lhs.true.4
%17 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.4 = add nsw i32 %17, 1
store i32 %inc78.4, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.4
for.inc80.4: ; preds = %if.then75.4, %land.lhs.true.4, %for.inc80.3
br i1 %cmp69.5, label %land.lhs.true.5, label %for.inc80.5
land.lhs.true.5: ; preds = %for.inc80.4
%arrayidx73.5 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 5
%18 = load i32, ptr %arrayidx73.5, align 4, !tbaa !5
%cmp74.5 = icmp eq i32 %18, 1
br i1 %cmp74.5, label %if.then75.5, label %for.inc80.5
if.then75.5: ; preds = %land.lhs.true.5
%19 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.5 = add nsw i32 %19, 1
store i32 %inc78.5, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.5
for.inc80.5: ; preds = %if.then75.5, %land.lhs.true.5, %for.inc80.4
br i1 %cmp69.6, label %land.lhs.true.6, label %for.inc80.6
land.lhs.true.6: ; preds = %for.inc80.5
%arrayidx73.6 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 6
%20 = load i32, ptr %arrayidx73.6, align 4, !tbaa !5
%cmp74.6 = icmp eq i32 %20, 1
br i1 %cmp74.6, label %if.then75.6, label %for.inc80.6
if.then75.6: ; preds = %land.lhs.true.6
%21 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.6 = add nsw i32 %21, 1
store i32 %inc78.6, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.6
for.inc80.6: ; preds = %if.then75.6, %land.lhs.true.6, %for.inc80.5
br i1 %cmp69.7, label %land.lhs.true.7, label %for.inc80.7
land.lhs.true.7: ; preds = %for.inc80.6
%arrayidx73.7 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 7
%22 = load i32, ptr %arrayidx73.7, align 4, !tbaa !5
%cmp74.7 = icmp eq i32 %22, 1
br i1 %cmp74.7, label %if.then75.7, label %for.inc80.7
if.then75.7: ; preds = %land.lhs.true.7
%23 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.7 = add nsw i32 %23, 1
store i32 %inc78.7, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.7
for.inc80.7: ; preds = %if.then75.7, %land.lhs.true.7, %for.inc80.6
br i1 %cmp69.8, label %land.lhs.true.8, label %for.inc80.8
land.lhs.true.8: ; preds = %for.inc80.7
%arrayidx73.8 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 8
%24 = load i32, ptr %arrayidx73.8, align 4, !tbaa !5
%cmp74.8 = icmp eq i32 %24, 1
br i1 %cmp74.8, label %if.then75.8, label %for.inc80.8
if.then75.8: ; preds = %land.lhs.true.8
%25 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.8 = add nsw i32 %25, 1
store i32 %inc78.8, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.8
for.inc80.8: ; preds = %if.then75.8, %land.lhs.true.8, %for.inc80.7
br i1 %cmp69.9, label %land.lhs.true.9, label %for.inc80.9
land.lhs.true.9: ; preds = %for.inc80.8
%arrayidx73.9 = getelementptr inbounds [105 x [15 x i32]], ptr %f, i64 0, i64 %indvars.iv198, i64 9
%26 = load i32, ptr %arrayidx73.9, align 4, !tbaa !5
%cmp74.9 = icmp eq i32 %26, 1
br i1 %cmp74.9, label %if.then75.9, label %for.inc80.9
if.then75.9: ; preds = %land.lhs.true.9
%27 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%inc78.9 = add nsw i32 %27, 1
store i32 %inc78.9, ptr %arrayidx77, align 4, !tbaa !5
br label %for.inc80.9
for.inc80.9: ; preds = %if.then75.9, %land.lhs.true.9, %for.inc80.8
%indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
%exitcond.not = icmp eq i64 %indvars.iv.next199, %5
br i1 %exitcond.not, label %for.cond86.preheader, label %for.cond64.preheader, !llvm.loop !12
for.body88: ; preds = %for.body88.preheader, %for.body88
%indvars.iv201 = phi i64 [ %indvars.iv.next202.3, %for.body88 ], [ 0, %for.body88.preheader ]
%point.1174 = phi i32 [ %add95.3, %for.body88 ], [ 0, %for.body88.preheader ]
%niter = phi i64 [ %niter.next.3, %for.body88 ], [ 0, %for.body88.preheader ]
%arrayidx92 = getelementptr inbounds [105 x i32], ptr %s, i64 0, i64 %indvars.iv201
%28 = load i32, ptr %arrayidx92, align 16, !tbaa !5
%idxprom93 = sext i32 %28 to i64
%arrayidx94 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv201, i64 %idxprom93
%29 = load i32, ptr %arrayidx94, align 4, !tbaa !5
%add95 = add nsw i32 %29, %point.1174
%indvars.iv.next202 = or i64 %indvars.iv201, 1
%arrayidx92.1 = getelementptr inbounds [105 x i32], ptr %s, i64 0, i64 %indvars.iv.next202
%30 = load i32, ptr %arrayidx92.1, align 4, !tbaa !5
%idxprom93.1 = sext i32 %30 to i64
%arrayidx94.1 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv.next202, i64 %idxprom93.1
%31 = load i32, ptr %arrayidx94.1, align 4, !tbaa !5
%add95.1 = add nsw i32 %31, %add95
%indvars.iv.next202.1 = or i64 %indvars.iv201, 2
%arrayidx92.2 = getelementptr inbounds [105 x i32], ptr %s, i64 0, i64 %indvars.iv.next202.1
%32 = load i32, ptr %arrayidx92.2, align 8, !tbaa !5
%idxprom93.2 = sext i32 %32 to i64
%arrayidx94.2 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv.next202.1, i64 %idxprom93.2
%33 = load i32, ptr %arrayidx94.2, align 4, !tbaa !5
%add95.2 = add nsw i32 %33, %add95.1
%indvars.iv.next202.2 = or i64 %indvars.iv201, 3
%arrayidx92.3 = getelementptr inbounds [105 x i32], ptr %s, i64 0, i64 %indvars.iv.next202.2
%34 = load i32, ptr %arrayidx92.3, align 4, !tbaa !5
%idxprom93.3 = sext i32 %34 to i64
%arrayidx94.3 = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv.next202.2, i64 %idxprom93.3
%35 = load i32, ptr %arrayidx94.3, align 4, !tbaa !5
%add95.3 = add nsw i32 %35, %add95.2
%indvars.iv.next202.3 = add nuw nsw i64 %indvars.iv201, 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.end98.unr-lcssa, label %for.body88, !llvm.loop !13
for.end98.thread: ; preds = %for.cond86.preheader, %for.cond47.preheader
%cmp99250 = icmp eq i32 %i.4178, 0
%spec.select251 = call i32 @llvm.smax.i32(i32 %max.0179, i32 0)
%max.1252 = select i1 %cmp99250, i32 0, i32 %spec.select251
br label %for.end112
for.end98.unr-lcssa: ; preds = %for.body88, %for.body88.preheader
%add95.lcssa.ph = phi i32 [ undef, %for.body88.preheader ], [ %add95.3, %for.body88 ]
%indvars.iv201.unr = phi i64 [ 0, %for.body88.preheader ], [ %indvars.iv.next202.3, %for.body88 ]
%point.1174.unr = phi i32 [ 0, %for.body88.preheader ], [ %add95.3, %for.body88 ]
br i1 %lcmp.mod.not, label %for.end98, label %for.body88.epil
for.body88.epil: ; preds = %for.end98.unr-lcssa, %for.body88.epil
%indvars.iv201.epil = phi i64 [ %indvars.iv.next202.epil, %for.body88.epil ], [ %indvars.iv201.unr, %for.end98.unr-lcssa ]
%point.1174.epil = phi i32 [ %add95.epil, %for.body88.epil ], [ %point.1174.unr, %for.end98.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body88.epil ], [ 0, %for.end98.unr-lcssa ]
%arrayidx92.epil = getelementptr inbounds [105 x i32], ptr %s, i64 0, i64 %indvars.iv201.epil
%36 = load i32, ptr %arrayidx92.epil, align 4, !tbaa !5
%idxprom93.epil = sext i32 %36 to i64
%arrayidx94.epil = getelementptr inbounds [105 x [15 x i32]], ptr %p, i64 0, i64 %indvars.iv201.epil, i64 %idxprom93.epil
%37 = load i32, ptr %arrayidx94.epil, align 4, !tbaa !5
%add95.epil = add nsw i32 %37, %point.1174.epil
%indvars.iv.next202.epil = add nuw nsw i64 %indvars.iv201.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.end98, label %for.body88.epil, !llvm.loop !14
for.end98: ; preds = %for.body88.epil, %for.end98.unr-lcssa
%add95.lcssa = phi i32 [ %add95.lcssa.ph, %for.end98.unr-lcssa ], [ %add95.epil, %for.body88.epil ]
%cmp99 = icmp eq i32 %i.4178, 0
%spec.select = call i32 @llvm.smax.i32(i32 %max.0179, i32 %add95.lcssa)
%max.1 = select i1 %cmp99, i32 %add95.lcssa, i32 %spec.select
br i1 %cmp62170, label %for.body107.preheader, label %for.end112
for.body107.preheader: ; preds = %for.end98
call void @llvm.memset.p0.i64(ptr nonnull align 16 %s, i8 0, i64 %6, i1 false), !tbaa !5
br label %for.end112
for.end112: ; preds = %for.end98.thread, %for.body107.preheader, %for.end98
%max.1253 = phi i32 [ %max.1252, %for.end98.thread ], [ %max.1, %for.body107.preheader ], [ %max.1, %for.end98 ]
%inc114 = add nsw i32 %spec.select257, 1
%inc116 = add nuw nsw i32 %i.4178, 1
%exitcond209.not = icmp eq i32 %inc116, 1023
br i1 %exitcond209.not, label %for.end117, label %for.cond47.preheader, !llvm.loop !16
for.end117: ; preds = %for.end112
%call118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %max.1253)
call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 6300, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 6300, ptr nonnull %f) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
int main(void){
int x,y,z;
scanf("%d %d %d",&x,&y,&z);
int ans=x/(y+z),r=x%(y+z);
printf("%d",r>=z?ans:ans-1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%2 = load i32, ptr %z, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%div = sdiv i32 %0, %add
%rem = srem i32 %0, %add
%cmp.not = icmp slt i32 %rem, %2
%sub = sext i1 %cmp.not to i32
%cond = add nsw i32 %div, %sub
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #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"}
|
#include <stdio.h>
int main(){
int comprimento, pessoa, espaco, qtd_pessoas = 0;
scanf("%d %d %d", &comprimento, &pessoa, &espaco);
for (int i = 1;;i++){
if (comprimento >= (pessoa*i + espaco*(i+1)))
qtd_pessoas = i;
else
break;
}
printf("%d\n", qtd_pessoas);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146495/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146495/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%comprimento = alloca i32, align 4
%pessoa = alloca i32, align 4
%espaco = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %comprimento) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pessoa) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %espaco) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %comprimento, ptr noundef nonnull %pessoa, ptr noundef nonnull %espaco)
%0 = load i32, ptr %comprimento, align 4, !tbaa !5
%1 = load i32, ptr %pessoa, align 4, !tbaa !5
%2 = load i32, ptr %espaco, align 4, !tbaa !5
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%qtd_pessoas.0 = phi i32 [ 0, %entry ], [ %i.0, %for.cond ]
%i.0 = phi i32 [ 1, %entry ], [ %add, %for.cond ]
%mul = mul nsw i32 %1, %i.0
%add = add nuw nsw i32 %i.0, 1
%mul1 = mul nsw i32 %2, %add
%add2 = add nsw i32 %mul1, %mul
%cmp.not = icmp slt i32 %0, %add2
br i1 %cmp.not, label %if.else, label %for.cond
if.else: ; preds = %for.cond
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %qtd_pessoas.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %espaco) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pessoa) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %comprimento) #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"}
|
#include <stdio.h>
int main (){
int a,b,c,k=0;
scanf ("%d%d%d",&a,&b,&c);
a=a-c;
for (a;a>=0;a=a-b-c){
k++;
}
printf ("%d",k-1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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 %c, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%cmp8 = icmp sgt i32 %sub, -1
br i1 %cmp8, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%3 = add i32 %1, %2
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%k.010 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%storemerge9 = phi i32 [ %sub, %for.body.lr.ph ], [ %sub2, %for.body ]
%inc = add nuw nsw i32 %k.010, 1
%sub2 = sub i32 %storemerge9, %3
%cmp = icmp sgt i32 %sub2, -1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%storemerge.lcssa = phi i32 [ %sub, %entry ], [ %sub2, %for.body ]
%k.0.lcssa = phi i32 [ -1, %entry ], [ %k.010, %for.body ]
store i32 %storemerge.lcssa, ptr %a, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int x, y, z, n;
scanf("%d %d %d", &x, &y, &z);
printf("%d", (x - z) / (y + z) );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146589/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146589/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %z, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %y, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%div = sdiv i32 %sub, %add
%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 %z) #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"}
|
#include <stdio.h>
int main()
{
int x,n,m,f;
scanf("%d %d %d",&f,&m,&n);
x=(f-n)/(m+n);
printf("%d",x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146639/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146639/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%m = alloca i32, align 4
%f = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %f, ptr noundef nonnull %m, ptr noundef nonnull %n)
%0 = load i32, ptr %f, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %m, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%div = sdiv i32 %sub, %add
%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 %f) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int t,x,i;
scanf("%d",&t);
while(t--)
{
scanf("%d",&x);
for(i=1;i<=x;i++)
printf("%d ",1);
printf("\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14669/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14669/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec7 = add nsw i32 %0, -1
store i32 %dec7, ptr %t, align 4, !tbaa !5
%tobool.not8 = icmp eq i32 %0, 0
br i1 %tobool.not8, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not5 = icmp slt i32 %1, 1
br i1 %cmp.not5, label %for.end, label %for.body
for.body: ; preds = %while.body, %for.body
%i.06 = phi i32 [ %inc, %for.body ], [ 1, %while.body ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1)
%inc = add nuw nsw i32 %i.06, 1
%2 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.06, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %while.body
%putchar = call i32 @putchar(i32 10)
%3 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int a,b,c,d;
c = 1;
d = 0;
scanf("%d%d",&a,&b);
while(c < b){
c += a - 1;
d++;
}
printf("%d",d);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146732/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146732/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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 %b, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 1
br i1 %cmp4, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %a, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%d.06 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%c.05 = phi i32 [ 1, %while.body.lr.ph ], [ %add, %while.body ]
%sub = add i32 %c.05, -1
%add = add i32 %sub, %1
%inc = add nuw nsw i32 %d.06, 1
%cmp = icmp slt i32 %add, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%d.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a=0,b=0;
int i;
scanf("%d%d",&a,&b);
for( i=0;i<30;i++){
if(b<=(a-1)*i+1)
break;
}
printf("%d",i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146776/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146776/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
store i32 0, ptr %b, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%cmp1.not = icmp sgt i32 %0, 1
br i1 %cmp1.not, label %for.inc, label %for.end
for.inc: ; preds = %entry
%cmp1.not.1 = icmp sgt i32 %0, %1
br i1 %cmp1.not.1, label %for.inc.1, label %for.end
for.inc.1: ; preds = %for.inc
%mul.2 = shl nsw i32 %sub, 1
%add.2 = or i32 %mul.2, 1
%cmp1.not.2 = icmp sgt i32 %0, %add.2
br i1 %cmp1.not.2, label %for.inc.2, label %for.end
for.inc.2: ; preds = %for.inc.1
%mul.3 = mul nsw i32 %sub, 3
%add.3 = add nsw i32 %mul.3, 1
%cmp1.not.3 = icmp sgt i32 %0, %add.3
br i1 %cmp1.not.3, label %for.inc.3, label %for.end
for.inc.3: ; preds = %for.inc.2
%mul.4 = shl nsw i32 %sub, 2
%add.4 = or i32 %mul.4, 1
%cmp1.not.4 = icmp sgt i32 %0, %add.4
br i1 %cmp1.not.4, label %for.inc.4, label %for.end
for.inc.4: ; preds = %for.inc.3
%mul.5 = mul nsw i32 %sub, 5
%add.5 = add nsw i32 %mul.5, 1
%cmp1.not.5 = icmp sgt i32 %0, %add.5
br i1 %cmp1.not.5, label %for.inc.5, label %for.end
for.inc.5: ; preds = %for.inc.4
%mul.6 = mul nsw i32 %sub, 6
%add.6 = or i32 %mul.6, 1
%cmp1.not.6 = icmp sgt i32 %0, %add.6
br i1 %cmp1.not.6, label %for.inc.6, label %for.end
for.inc.6: ; preds = %for.inc.5
%mul.7 = mul nsw i32 %sub, 7
%add.7 = add nsw i32 %mul.7, 1
%cmp1.not.7 = icmp sgt i32 %0, %add.7
br i1 %cmp1.not.7, label %for.inc.7, label %for.end
for.inc.7: ; preds = %for.inc.6
%mul.8 = shl nsw i32 %sub, 3
%add.8 = or i32 %mul.8, 1
%cmp1.not.8 = icmp sgt i32 %0, %add.8
br i1 %cmp1.not.8, label %for.inc.8, label %for.end
for.inc.8: ; preds = %for.inc.7
%mul.9 = mul nsw i32 %sub, 9
%add.9 = add nsw i32 %mul.9, 1
%cmp1.not.9 = icmp sgt i32 %0, %add.9
br i1 %cmp1.not.9, label %for.inc.9, label %for.end
for.inc.9: ; preds = %for.inc.8
%mul.10 = mul nsw i32 %sub, 10
%add.10 = or i32 %mul.10, 1
%cmp1.not.10 = icmp sgt i32 %0, %add.10
br i1 %cmp1.not.10, label %for.inc.10, label %for.end
for.inc.10: ; preds = %for.inc.9
%mul.11 = mul nsw i32 %sub, 11
%add.11 = add nsw i32 %mul.11, 1
%cmp1.not.11 = icmp sgt i32 %0, %add.11
br i1 %cmp1.not.11, label %for.inc.11, label %for.end
for.inc.11: ; preds = %for.inc.10
%mul.12 = mul nsw i32 %sub, 12
%add.12 = or i32 %mul.12, 1
%cmp1.not.12 = icmp sgt i32 %0, %add.12
br i1 %cmp1.not.12, label %for.inc.12, label %for.end
for.inc.12: ; preds = %for.inc.11
%mul.13 = mul nsw i32 %sub, 13
%add.13 = add nsw i32 %mul.13, 1
%cmp1.not.13 = icmp sgt i32 %0, %add.13
br i1 %cmp1.not.13, label %for.inc.13, label %for.end
for.inc.13: ; preds = %for.inc.12
%mul.14 = mul nsw i32 %sub, 14
%add.14 = or i32 %mul.14, 1
%cmp1.not.14 = icmp sgt i32 %0, %add.14
br i1 %cmp1.not.14, label %for.inc.14, label %for.end
for.inc.14: ; preds = %for.inc.13
%mul.15 = mul nsw i32 %sub, 15
%add.15 = add nsw i32 %mul.15, 1
%cmp1.not.15 = icmp sgt i32 %0, %add.15
br i1 %cmp1.not.15, label %for.inc.15, label %for.end
for.inc.15: ; preds = %for.inc.14
%mul.16 = shl nsw i32 %sub, 4
%add.16 = or i32 %mul.16, 1
%cmp1.not.16 = icmp sgt i32 %0, %add.16
br i1 %cmp1.not.16, label %for.inc.16, label %for.end
for.inc.16: ; preds = %for.inc.15
%mul.17 = mul nsw i32 %sub, 17
%add.17 = add nsw i32 %mul.17, 1
%cmp1.not.17 = icmp sgt i32 %0, %add.17
br i1 %cmp1.not.17, label %for.inc.17, label %for.end
for.inc.17: ; preds = %for.inc.16
%mul.18 = mul nsw i32 %sub, 18
%add.18 = or i32 %mul.18, 1
%cmp1.not.18 = icmp sgt i32 %0, %add.18
br i1 %cmp1.not.18, label %for.inc.18, label %for.end
for.inc.18: ; preds = %for.inc.17
%mul.19 = mul nsw i32 %sub, 19
%add.19 = add nsw i32 %mul.19, 1
%cmp1.not.19 = icmp sgt i32 %0, %add.19
br i1 %cmp1.not.19, label %for.inc.19, label %for.end
for.inc.19: ; preds = %for.inc.18
%mul.20 = mul nsw i32 %sub, 20
%add.20 = or i32 %mul.20, 1
%cmp1.not.20 = icmp sgt i32 %0, %add.20
br i1 %cmp1.not.20, label %for.inc.20, label %for.end
for.inc.20: ; preds = %for.inc.19
%mul.21 = mul nsw i32 %sub, 21
%add.21 = add nsw i32 %mul.21, 1
%cmp1.not.21 = icmp sgt i32 %0, %add.21
br i1 %cmp1.not.21, label %for.inc.21, label %for.end
for.inc.21: ; preds = %for.inc.20
%mul.22 = mul nsw i32 %sub, 22
%add.22 = or i32 %mul.22, 1
%cmp1.not.22 = icmp sgt i32 %0, %add.22
br i1 %cmp1.not.22, label %for.inc.22, label %for.end
for.inc.22: ; preds = %for.inc.21
%mul.23 = mul nsw i32 %sub, 23
%add.23 = add nsw i32 %mul.23, 1
%cmp1.not.23 = icmp sgt i32 %0, %add.23
br i1 %cmp1.not.23, label %for.inc.23, label %for.end
for.inc.23: ; preds = %for.inc.22
%mul.24 = mul nsw i32 %sub, 24
%add.24 = or i32 %mul.24, 1
%cmp1.not.24 = icmp sgt i32 %0, %add.24
br i1 %cmp1.not.24, label %for.inc.24, label %for.end
for.inc.24: ; preds = %for.inc.23
%mul.25 = mul nsw i32 %sub, 25
%add.25 = add nsw i32 %mul.25, 1
%cmp1.not.25 = icmp sgt i32 %0, %add.25
br i1 %cmp1.not.25, label %for.inc.25, label %for.end
for.inc.25: ; preds = %for.inc.24
%mul.26 = mul nsw i32 %sub, 26
%add.26 = or i32 %mul.26, 1
%cmp1.not.26 = icmp sgt i32 %0, %add.26
br i1 %cmp1.not.26, label %for.inc.26, label %for.end
for.inc.26: ; preds = %for.inc.25
%mul.27 = mul nsw i32 %sub, 27
%add.27 = add nsw i32 %mul.27, 1
%cmp1.not.27 = icmp sgt i32 %0, %add.27
br i1 %cmp1.not.27, label %for.inc.27, label %for.end
for.inc.27: ; preds = %for.inc.26
%mul.28 = mul nsw i32 %sub, 28
%add.28 = or i32 %mul.28, 1
%cmp1.not.28 = icmp sgt i32 %0, %add.28
br i1 %cmp1.not.28, label %for.inc.28, label %for.end
for.inc.28: ; preds = %for.inc.27
%mul.29 = mul nsw i32 %sub, 29
%add.29 = add nsw i32 %mul.29, 1
%cmp1.not.29 = icmp sgt i32 %0, %add.29
%spec.select = select i1 %cmp1.not.29, i32 30, i32 29
br label %for.end
for.end: ; preds = %for.inc.28, %for.inc.27, %for.inc.26, %for.inc.25, %for.inc.24, %for.inc.23, %for.inc.22, %for.inc.21, %for.inc.20, %for.inc.19, %for.inc.18, %for.inc.17, %for.inc.16, %for.inc.15, %for.inc.14, %for.inc.13, %for.inc.12, %for.inc.11, %for.inc.10, %for.inc.9, %for.inc.8, %for.inc.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ 1, %for.inc ], [ 2, %for.inc.1 ], [ 3, %for.inc.2 ], [ 4, %for.inc.3 ], [ 5, %for.inc.4 ], [ 6, %for.inc.5 ], [ 7, %for.inc.6 ], [ 8, %for.inc.7 ], [ 9, %for.inc.8 ], [ 10, %for.inc.9 ], [ 11, %for.inc.10 ], [ 12, %for.inc.11 ], [ 13, %for.inc.12 ], [ 14, %for.inc.13 ], [ 15, %for.inc.14 ], [ 16, %for.inc.15 ], [ 17, %for.inc.16 ], [ 18, %for.inc.17 ], [ 19, %for.inc.18 ], [ 20, %for.inc.19 ], [ 21, %for.inc.20 ], [ 22, %for.inc.21 ], [ 23, %for.inc.22 ], [ 24, %for.inc.23 ], [ 25, %for.inc.24 ], [ 26, %for.inc.25 ], [ 27, %for.inc.26 ], [ 28, %for.inc.27 ], [ %spec.select, %for.inc.28 ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa)
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,kuti_count=1, tap_count=0;
scanf("%d %d",&A, &B);
while(kuti_count < B){
kuti_count += A-1;
tap_count++;
}
printf("%d\n",tap_count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146819/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146819/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %B, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 1
br i1 %cmp4, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %A, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%tap_count.06 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%kuti_count.05 = phi i32 [ 1, %while.body.lr.ph ], [ %add, %while.body ]
%sub = add i32 %kuti_count.05, -1
%add = add i32 %sub, %1
%inc = add nuw nsw i32 %tap_count.06, 1
%cmp = icmp slt i32 %add, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%tap_count.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %tap_count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
a --;
b --;
printf("%d",(b + (a - 1)) / a);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%dec1 = add nsw i32 %1, -1
store i32 %dec1, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %0, -2
%add = add nsw i32 %sub, %dec1
%div = sdiv i32 %add, %dec
%call2 = 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>
int main()
{
int x,y,sum=1,n=0;//存储两个整数
scanf("%d%d",&x,&y);
//采取累加的办法
while(sum<y)
{
sum+=x-1;
++n;
}
printf("%d\n",n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146905/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146905/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %y, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 1
br i1 %cmp4, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %x, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%n.06 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%sum.05 = phi i32 [ 1, %while.body.lr.ph ], [ %add, %while.body ]
%sub = add i32 %sum.05, -1
%add = add i32 %sub, %1
%inc = add nuw nsw i32 %n.06, 1
%cmp = icmp slt i32 %add, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%n.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.0.lcssa)
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()
{
int a, b, t=0, c=0;
scanf("%d %d", &a, &b);
if(b == 1)
{
printf("0\n");
return 0;
}
while(c<=b)
{
c += (a-1);
t++;
if(c+1>=b)
break;
}
printf("%d\n", t);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146949/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146949/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"0\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 %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%1 = load i32, ptr %a, align 4
br label %while.cond
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
while.cond: ; preds = %while.cond.preheader, %while.body
%t.0 = phi i32 [ %inc, %while.body ], [ 0, %while.cond.preheader ]
%c.0 = phi i32 [ %add, %while.body ], [ 0, %while.cond.preheader ]
%cmp2.not = icmp sgt i32 %c.0, %0
br i1 %cmp2.not, label %while.end, label %while.body
while.body: ; preds = %while.cond
%sub = add i32 %c.0, -1
%add = add i32 %sub, %1
%inc = add nuw nsw i32 %t.0, 1
%add3 = add i32 %1, %c.0
%cmp4.not = icmp slt i32 %add3, %0
br i1 %cmp4.not, label %while.cond, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %while.cond
%t.1 = phi i32 [ %inc, %while.body ], [ %t.0, %while.cond ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t.1)
br label %cleanup
cleanup: ; preds = %while.end, %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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int main(void) {
// 入力
int a,b,cnt;
scanf("%d %d",&a,&b);
if(b<=1){
printf("0\n");
return 0;
}
cnt = (b-2)/(a-1);
cnt+=1;
printf("%d\n",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_146992/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_146992/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"0\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 %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 2
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
if.end: ; preds = %entry
%sub = add nsw i32 %0, -2
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub2 = add nsw i32 %1, -1
%div = sdiv i32 %sub, %sub2
%add = add nsw i32 %div, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %cleanup
cleanup: ; preds = %if.end, %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()
{
int ori = 1;
int A,B,ans = 0;
scanf("%d %d",&A,&B);
while(ori<B)
{
ori+=(A-1);
ans++;
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147034/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147034/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %B, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 1
br i1 %cmp4, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %A, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%ans.06 = phi i32 [ 0, %while.body.lr.ph ], [ %inc, %while.body ]
%ori.05 = phi i32 [ 1, %while.body.lr.ph ], [ %add, %while.body ]
%sub = add i32 %ori.05, -1
%add = add i32 %sub, %1
%inc = add nuw nsw i32 %ans.06, 1
%cmp = icmp slt i32 %add, %0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int N,M,X[500],x,i;
int Y[500] = {0};
scanf("%d",&N);
scanf("%d",&M);
for(i = 0;i < M;i++) {
if(M == 0) break;
else {
scanf("%d",&Y[i]);
if(Y[i] == 0) {
Y[i] = 2;
}
}
}
x = N-M;
printf("%d\n",x-1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147092/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147092/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%M = alloca i32, align 4
%Y = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %Y) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000) %Y, i8 0, i64 2000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M)
%0 = load i32, ptr %M, align 4
%cmp17 = icmp slt i32 %0, 1
br i1 %cmp17, label %for.end, label %if.else
if.else: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [500 x i32], ptr %Y, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp6 = icmp eq i32 %1, 0
br i1 %cmp6, label %if.then7, label %for.inc
if.then7: ; preds = %if.else
store i32 2, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then7, %if.else
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %M, align 4
%3 = sext i32 %2 to i64
%cmp = icmp sge i64 %indvars.iv.next, %3
%cmp2 = icmp eq i32 %2, 0
%or.cond = or i1 %cmp, %cmp2
br i1 %or.cond, label %for.end, label %if.else, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.inc ]
%4 = load i32, ptr %N, align 4, !tbaa !5
%5 = xor i32 %.lcssa, -1
%sub11 = add i32 %4, %5
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub11)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %Y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
long long memo[20];
long long get_add(long long input);
long long get_add2(long long count,int count2) {
long long result;
if(memo[count2]>0)return memo[count2]-1;
result=get_add(count-1);
memo[count2]=result+1;
return result;
}
long long get_add(long long input) {
long long result=0;
long long input2;
long long input3;
long long count;
int count2;
if(input<=0)return 0;
for(input2=input,count=1,count2=0;
input2>=10;
input2/=10,count*=10,count2++);
input3=input2;
if(input2>=4){result+=count;input3--;}
if(input2>=6){result+=count;input3--;}
result+=get_add(input-input2*count);
result+=get_add2(count,count2)*input3;
return result;
}
int main(void) {
long long input;
long long n_add,p_add;
while(1) {
scanf("%lld",&input);
if(input==0)break;
p_add=0;
while((n_add=get_add(input))>p_add) {
input+=n_add-p_add;
p_add=n_add;
}
printf("%lld\n",input);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147142/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147142/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@memo = dso_local local_unnamed_addr global [20 x i64] zeroinitializer, align 16
@.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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @get_add2(i64 noundef %count, i32 noundef %count2) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %count2 to i64
%arrayidx = getelementptr inbounds [20 x i64], ptr @memo, i64 0, i64 %idxprom
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%sub = add nsw i64 %0, -1
br label %cleanup
if.end: ; preds = %entry
%sub3 = add nsw i64 %count, -1
%call = tail call i64 @get_add(i64 noundef %sub3)
%add = add nsw i64 %call, 1
store i64 %add, ptr %arrayidx, align 8, !tbaa !5
br label %cleanup
cleanup: ; preds = %if.end, %if.then
%retval.0 = phi i64 [ %sub, %if.then ], [ %call, %if.end ]
ret i64 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @get_add(i64 noundef %input) local_unnamed_addr #2 {
entry:
%cmp = icmp slt i64 %input, 1
br i1 %cmp, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp138 = icmp ugt i64 %input, 9
br i1 %cmp138, label %for.inc, label %for.end
for.inc: ; preds = %for.cond.preheader, %for.inc
%count2.041 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ]
%count.040 = phi i64 [ %mul, %for.inc ], [ 1, %for.cond.preheader ]
%input2.039 = phi i64 [ %div, %for.inc ], [ %input, %for.cond.preheader ]
%div = udiv i64 %input2.039, 10
%mul = mul nsw i64 %count.040, 10
%inc = add nuw nsw i32 %count2.041, 1
%cmp1 = icmp ugt i64 %input2.039, 99
br i1 %cmp1, label %for.inc, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%0 = zext i32 %inc to i64
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.cond.preheader
%input2.0.lcssa = phi i64 [ %input, %for.cond.preheader ], [ %div, %for.end.loopexit ]
%count.0.lcssa = phi i64 [ 1, %for.cond.preheader ], [ %mul, %for.end.loopexit ]
%count2.0.lcssa = phi i64 [ 0, %for.cond.preheader ], [ %0, %for.end.loopexit ]
%cmp2 = icmp ugt i64 %input2.0.lcssa, 3
%spec.select = select i1 %cmp2, i64 %count.0.lcssa, i64 0
%dec = sext i1 %cmp2 to i64
%spec.select37 = add nsw i64 %input2.0.lcssa, %dec
%cmp5 = icmp ugt i64 %input2.0.lcssa, 5
%add7 = select i1 %cmp5, i64 %count.0.lcssa, i64 0
%result.1 = add nuw nsw i64 %spec.select, %add7
%dec8 = sext i1 %cmp5 to i64
%input3.1 = add nsw i64 %spec.select37, %dec8
%mul10 = mul nsw i64 %count.0.lcssa, %input2.0.lcssa
%sub = sub nsw i64 %input, %mul10
%call = tail call i64 @get_add(i64 noundef %sub)
%add11 = add nsw i64 %result.1, %call
%arrayidx.i = getelementptr inbounds [20 x i64], ptr @memo, i64 0, i64 %count2.0.lcssa
%1 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%cmp.i = icmp sgt i64 %1, 0
br i1 %cmp.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %for.end
%sub.i = add nsw i64 %1, -1
br label %get_add2.exit
if.end.i: ; preds = %for.end
%sub3.i = add nsw i64 %count.0.lcssa, -1
%call.i = tail call i64 @get_add(i64 noundef %sub3.i)
%add.i = add nsw i64 %call.i, 1
store i64 %add.i, ptr %arrayidx.i, align 8, !tbaa !5
br label %get_add2.exit
get_add2.exit: ; preds = %if.then.i, %if.end.i
%retval.0.i = phi i64 [ %sub.i, %if.then.i ], [ %call.i, %if.end.i ]
%mul13 = mul nsw i64 %retval.0.i, %input3.1
%add14 = add nsw i64 %add11, %mul13
br label %cleanup
cleanup: ; preds = %entry, %get_add2.exit
%retval.0 = phi i64 [ %add14, %get_add2.exit ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%input = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %input) #5
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%0 = load i64, ptr %input, align 8, !tbaa !5
%cmp14 = icmp eq i64 %0, 0
br i1 %cmp14, label %while.end6, label %while.cond1.preheader
while.cond1.preheader: ; preds = %entry, %while.end
%1 = phi i64 [ %4, %while.end ], [ %0, %entry ]
%call29 = call i64 @get_add(i64 noundef %1)
%cmp310 = icmp sgt i64 %call29, 0
br i1 %cmp310, label %while.body4, label %while.end
while.body4: ; preds = %while.cond1.preheader, %while.body4
%call212 = phi i64 [ %call2, %while.body4 ], [ %call29, %while.cond1.preheader ]
%p_add.011 = phi i64 [ %call212, %while.body4 ], [ 0, %while.cond1.preheader ]
%sub = sub i64 %call212, %p_add.011
%2 = load i64, ptr %input, align 8, !tbaa !5
%add = add nsw i64 %sub, %2
store i64 %add, ptr %input, align 8, !tbaa !5
%call2 = call i64 @get_add(i64 noundef %add)
%cmp3 = icmp sgt i64 %call2, %call212
br i1 %cmp3, label %while.body4, label %while.end, !llvm.loop !11
while.end: ; preds = %while.body4, %while.cond1.preheader
%3 = load i64, ptr %input, align 8, !tbaa !5
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %3)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%4 = load i64, ptr %input, align 8, !tbaa !5
%cmp = icmp eq i64 %4, 0
br i1 %cmp, label %while.end6, label %while.cond1.preheader
while.end6: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %input) #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 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#define INF 100001
int main (void){
int N;
int a,b;
int count[INF]={};//テゥツ?催・ツ按療」ツ?ョテヲツ閉ーテ・ツュツ療」ツ?ッテァツァツ?」ツ?凝」ツつ嘉ィツヲツ凝」ツ?淌・ツ渉凝ゥツ?氾」ツ?ョテゥツ?」テ」ツつ古」ツ?ヲティツ。ツ古」ツ?湘、ツコツコテヲツ閉ー
int i,max=0;
scanf("%d", &N);
while(N){
scanf("%d %d",&a ,&b);
for(a--;a!=b;a++){
// printf("%d %d\n", a, b);
count[a]++;
}
N--;
}
for(i=0;i<INF;i++){
if(count[i] > i)
count[i] = i;
if(count[i] < i)
count[i] = 0;
}
max = count[0];
for(i=1;i<INF;i++){
//if(i<10) printf("%d",count[i]);
if(count[i] > max){
max = count[i];
}
}
printf("%d\n",max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147186/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147186/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca i32, align 4
%b = alloca i32, align 4
%count = alloca [100001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %count) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %count, i8 0, i64 400004, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%.pr = load i32, ptr %N, align 4, !tbaa !5
%tobool.not54 = icmp eq i32 %.pr, 0
br i1 %tobool.not54, label %vector.body71.preheader, label %while.body
vector.body71.preheader: ; preds = %for.end, %entry
br label %vector.body71
vector.body71: ; preds = %vector.body71.preheader, %vector.body71
%index72 = phi i64 [ %index.next76, %vector.body71 ], [ 0, %vector.body71.preheader ]
%vec.ind = phi <4 x i64> [ %vec.ind.next, %vector.body71 ], [ <i64 0, i64 1, i64 2, i64 3>, %vector.body71.preheader ]
%vec.ind73 = phi <4 x i32> [ %vec.ind.next74, %vector.body71 ], [ <i32 0, i32 1, i32 2, i32 3>, %vector.body71.preheader ]
%0 = getelementptr inbounds [100001 x i32], ptr %count, i64 0, i64 %index72
%wide.load75 = load <4 x i32>, ptr %0, align 16, !tbaa !5
%1 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load75, <4 x i32> %vec.ind73)
%2 = sext <4 x i32> %wide.load75 to <4 x i64>
%3 = icmp sgt <4 x i64> %vec.ind, %2
%4 = select <4 x i1> %3, <4 x i32> zeroinitializer, <4 x i32> %1
store <4 x i32> %4, ptr %0, align 16
%index.next76 = add nuw i64 %index72, 4
%vec.ind.next = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%vec.ind.next74 = add <4 x i32> %vec.ind73, <i32 4, i32 4, i32 4, i32 4>
%5 = icmp eq i64 %index.next76, 100000
br i1 %5, label %for.body6, label %vector.body71, !llvm.loop !9
while.body: ; preds = %entry, %for.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%6 = load i32, ptr %a, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
%7 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not52 = icmp eq i32 %dec, %7
br i1 %cmp.not52, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %while.body
%8 = sext i32 %6 to i64
%9 = add nsw i64 %8, -1
%sext = sext i32 %7 to i64
%10 = add nsw i64 %sext, 1
%11 = sub nsw i64 %10, %8
%min.iters.check = icmp ult i64 %11, 8
br i1 %min.iters.check, label %for.body.preheader89, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %11, -8
%ind.end = add nsw i64 %9, %n.vec
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = add i64 %9, %index
%12 = getelementptr inbounds [100001 x i32], ptr %count, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %12, align 4, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
%wide.load66 = load <4 x i32>, ptr %13, align 4, !tbaa !5
%14 = add nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
%15 = add nsw <4 x i32> %wide.load66, <i32 1, i32 1, i32 1, i32 1>
store <4 x i32> %14, ptr %12, align 4, !tbaa !5
store <4 x i32> %15, ptr %13, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %11, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader89
for.body.preheader89: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ %9, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader89, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader89 ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %count, i64 0, i64 %indvars.iv
%17 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %17, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%18 = icmp eq i64 %indvars.iv.next, %sext
br i1 %18, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %for.body, %middle.block, %while.body
%storemerge.lcssa = phi i32 [ %dec, %while.body ], [ %7, %middle.block ], [ %7, %for.body ]
store i32 %storemerge.lcssa, ptr %a, align 4, !tbaa !5
%19 = load i32, ptr %N, align 4, !tbaa !5
%dec3 = add nsw i32 %19, -1
store i32 %dec3, ptr %N, align 4, !tbaa !5
%tobool.not = icmp eq i32 %dec3, 0
br i1 %tobool.not, label %vector.body71.preheader, label %while.body, !llvm.loop !15
for.body6: ; preds = %vector.body71
%arrayidx8 = getelementptr inbounds [100001 x i32], ptr %count, i64 0, i64 100000
%20 = load i32, ptr %arrayidx8, align 16, !tbaa !5
%spec.store.select = call i32 @llvm.smin.i32(i32 %20, i32 100000)
%cmp14 = icmp slt i32 %20, 100000
%spec.store.select51 = select i1 %cmp14, i32 0, i32 %spec.store.select
store i32 %spec.store.select51, ptr %arrayidx8, align 16
%21 = load <4 x i32>, ptr %count, align 16
%minmax.ident.splat = shufflevector <4 x i32> %21, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body81
vector.body81: ; preds = %vector.body81, %for.body6
%index82 = phi i64 [ 0, %for.body6 ], [ %index.next87, %vector.body81 ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %for.body6 ], [ %24, %vector.body81 ]
%vec.phi83 = phi <4 x i32> [ %minmax.ident.splat, %for.body6 ], [ %25, %vector.body81 ]
%offset.idx84 = or i64 %index82, 1
%22 = getelementptr inbounds [100001 x i32], ptr %count, i64 0, i64 %offset.idx84
%wide.load85 = load <4 x i32>, ptr %22, align 4, !tbaa !5
%23 = getelementptr inbounds i32, ptr %22, i64 4
%wide.load86 = load <4 x i32>, ptr %23, align 4, !tbaa !5
%24 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load85, <4 x i32> %vec.phi)
%25 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load86, <4 x i32> %vec.phi83)
%index.next87 = add nuw i64 %index82, 8
%26 = icmp eq i64 %index.next87, 100000
br i1 %26, label %middle.block77, label %vector.body81, !llvm.loop !16
middle.block77: ; preds = %vector.body81
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %24, <4 x i32> %25)
%27 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %count) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !11, !12}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !11, !12}
|
#include<stdio.h>
#include<string.h>
int main(void){
char s[100010];
int i,ans=0;
scanf("%s",s);
for(i=0;i<strlen(s)-1;i++){
if(s[i]!=s[i+1]) ans++;
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147236/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147236/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%sub = add i64 %call2, -1
%cmp16.not = icmp eq i64 %sub, 0
br i1 %cmp16.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%.pre = load i8, ptr %s, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %sub, 8
br i1 %min.iters.check, label %for.body.preheader23, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %sub, -8
%vector.recur.init = insertelement <4 x i8> poison, i8 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load22, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%vec.phi21 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%0 = or i64 %index, 1
%1 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %0
%wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load22 = load <4 x i8>, ptr %2, align 1, !tbaa !5
%3 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%4 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load22, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = icmp ne <4 x i8> %3, %wide.load
%6 = icmp ne <4 x i8> %4, %wide.load22
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = add <4 x i32> %vec.phi, %7
%10 = add <4 x i32> %vec.phi21, %8
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %10, %9
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %sub, %n.vec
%vector.recur.extract = extractelement <4 x i8> %wide.load22, i64 3
br i1 %cmp.n, label %for.end, label %for.body.preheader23
for.body.preheader23: ; preds = %for.body.preheader, %middle.block
%scalar.recur.ph = phi i8 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body.preheader ]
%indvars.iv.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body.preheader ]
%ans.018.ph = phi i32 [ %12, %middle.block ], [ 0, %for.body.preheader ]
br label %for.body
for.body: ; preds = %for.body.preheader23, %for.body
%scalar.recur = phi i8 [ %13, %for.body ], [ %scalar.recur.ph, %for.body.preheader23 ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader23 ]
%ans.018 = phi i32 [ %spec.select, %for.body ], [ %ans.018.ph, %for.body.preheader23 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx6 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%13 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8.not = icmp ne i8 %scalar.recur, %13
%inc = zext i1 %cmp8.not to i32
%spec.select = add nuw nsw i32 %ans.018, %inc
%exitcond.not = icmp eq i64 %indvars.iv.next, %sub
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body, %middle.block, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include<stdio.h>
#define mod 10000000000007
int main()
{
int testcases;
scanf("%d",&testcases);
for(int i=0;i<testcases;i++)
{
int number_123;
scanf("%d",&number_123);
for(int u1=1;u1<=number_123;u1++)
{
int x1=number_123,y1=number_123;
while(x1>0)
{
for(int i=1;i<=u1&&x1>0;i++)
{
printf("(");
x1--;
}
printf(")");
y1--;
}
for(int j=1;j<=y1;j++)
{
printf(")");
}
printf("\n");
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14728/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14728/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%testcases = alloca i32, align 4
%number_123 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %testcases) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %testcases)
%0 = load i32, ptr %testcases, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup4, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %testcases) #4
ret i32 0
for.body: ; preds = %entry, %for.cond.cleanup4
%i.052 = phi i32 [ %inc29, %for.cond.cleanup4 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %number_123) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number_123)
%1 = load i32, ptr %number_123, align 4, !tbaa !5
%cmp3.not49 = icmp slt i32 %1, 1
br i1 %cmp3.not49, label %for.cond.cleanup4, label %while.cond.preheader
while.cond.preheader: ; preds = %for.body, %for.cond.cleanup18
%2 = phi i32 [ %5, %for.cond.cleanup18 ], [ %1, %for.body ]
%u1.050 = phi i32 [ %inc26, %for.cond.cleanup18 ], [ 1, %for.body ]
%cmp644 = icmp sgt i32 %2, 0
br i1 %cmp644, label %for.cond8.preheader, label %for.cond.cleanup18
for.cond.cleanup4: ; preds = %for.cond.cleanup18, %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number_123) #4
%inc29 = add nuw nsw i32 %i.052, 1
%3 = load i32, ptr %testcases, align 4, !tbaa !5
%cmp = icmp slt i32 %inc29, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond16.preheader: ; preds = %for.cond.cleanup11
%cmp17.not47 = icmp slt i32 %y1.046, 2
br i1 %cmp17.not47, label %for.cond.cleanup18, label %for.body19
for.cond8.preheader: ; preds = %while.cond.preheader, %for.cond.cleanup11
%y1.046 = phi i32 [ %dec15, %for.cond.cleanup11 ], [ %2, %while.cond.preheader ]
%x1.045 = phi i32 [ %dec, %for.cond.cleanup11 ], [ %2, %while.cond.preheader ]
br label %for.body12
for.cond.cleanup11: ; preds = %for.body12
%putchar40 = call i32 @putchar(i32 41)
%dec15 = add nsw i32 %y1.046, -1
%cmp6 = icmp sgt i32 %x1.142, 1
br i1 %cmp6, label %for.cond8.preheader, label %for.cond16.preheader, !llvm.loop !11
for.body12: ; preds = %for.cond8.preheader, %for.body12
%i7.043 = phi i32 [ 1, %for.cond8.preheader ], [ %inc, %for.body12 ]
%x1.142 = phi i32 [ %x1.045, %for.cond8.preheader ], [ %dec, %for.body12 ]
%putchar41 = call i32 @putchar(i32 40)
%dec = add nsw i32 %x1.142, -1
%inc = add nuw nsw i32 %i7.043, 1
%cmp9 = icmp ult i32 %i7.043, %u1.050
%cmp10 = icmp ne i32 %dec, 0
%4 = select i1 %cmp9, i1 %cmp10, i1 false
br i1 %4, label %for.body12, label %for.cond.cleanup11, !llvm.loop !12
for.cond.cleanup18: ; preds = %for.body19, %while.cond.preheader, %for.cond16.preheader
%putchar = call i32 @putchar(i32 10)
%inc26 = add nuw nsw i32 %u1.050, 1
%5 = load i32, ptr %number_123, align 4, !tbaa !5
%cmp3.not.not = icmp slt i32 %u1.050, %5
br i1 %cmp3.not.not, label %while.cond.preheader, label %for.cond.cleanup4, !llvm.loop !13
for.body19: ; preds = %for.cond16.preheader, %for.body19
%j.048 = phi i32 [ %inc22, %for.body19 ], [ 1, %for.cond16.preheader ]
%putchar39 = call i32 @putchar(i32 41)
%inc22 = add nuw i32 %j.048, 1
%exitcond.not = icmp eq i32 %j.048, %dec15
br i1 %exitcond.not, label %for.cond.cleanup18, label %for.body19, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<stdint.h>
#include<inttypes.h>
typedef int32_t i32;
typedef int64_t i64;
const i32 mod = 1000000007;
i32 inv (i32 a) {
i32 t = 1;
while (a > 1) {
t = (i64) t * (mod - mod / a) % mod;
a = mod % a;
}
return t;
}
i32 comb (i64 n, i64 k) {
if (k > n - k) k = n - k;
i64 nu = 1;
i64 de = 1;
for (i32 i = 1; i <= k; ++i) {
nu = nu * (n + 1 - i) % mod;
de = de * i % mod;
}
return nu * inv (de) % mod;
}
void run (void) {
i64 n, m, k;
scanf ("%" SCNi64 "%" SCNi64 "%" SCNi64, &n, &m, &k);
i64 ans = 0;
i64 c = comb (n * m - 2, k - 2);
for (i32 d = 1; d < m; ++d) {
ans = (ans + c * d % mod * (m - d) % mod * n % mod * n) % mod;
}
for (i32 d = 1; d < n; ++d) {
ans = (ans + c * d % mod * (n - d) % mod * m % mod * m) % mod;
}
printf ("%" PRIi64 "\n", ans);
}
void gen (void) {
}
int main (void) {
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147322/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147322/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [10 x i8] c"%li%li%li\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%li\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @inv(i32 noundef %a) local_unnamed_addr #0 {
entry:
%cmp7 = icmp sgt i32 %a, 1
br i1 %cmp7, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%t.09 = phi i64 [ %rem, %while.body ], [ 1, %entry ]
%a.addr.08 = phi i32 [ %rem3, %while.body ], [ %a, %entry ]
%div = udiv i32 1000000007, %a.addr.08
%sub = sub nuw nsw i32 1000000007, %div
%conv1 = zext i32 %sub to i64
%mul = mul nuw nsw i64 %t.09, %conv1
%rem = urem i64 %mul, 1000000007
%rem3 = urem i32 1000000007, %a.addr.08
%cmp = icmp ugt i32 %rem3, 1
br i1 %cmp, label %while.body, label %while.end.loopexit, !llvm.loop !5
while.end.loopexit: ; preds = %while.body
%conv2 = trunc i64 %rem to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%t.0.lcssa = phi i32 [ 1, %entry ], [ %conv2, %while.end.loopexit ]
ret i32 %t.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @comb(i64 noundef %n, i64 noundef %k) local_unnamed_addr #2 {
entry:
%sub = sub nsw i64 %n, %k
%spec.select = tail call i64 @llvm.smin.i64(i64 %sub, i64 %k)
%cmp2.not24 = icmp slt i64 %spec.select, 1
br i1 %cmp2.not24, label %inv.exit, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %n, 1
%xtraiter = and i64 %spec.select, 1
%0 = icmp eq i64 %spec.select, 1
br i1 %0, label %for.cond.cleanup.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %spec.select, -2
br label %for.body
for.cond.cleanup.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%rem.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %rem.1, %for.body ]
%rem8.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %rem8.1, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next.1, %for.body ]
%de.026.unr = phi i64 [ 1, %for.body.lr.ph ], [ %rem8.1, %for.body ]
%nu.025.unr = phi i64 [ 1, %for.body.lr.ph ], [ %rem.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa
%sub5.epil = sub i64 %add, %indvars.iv.unr
%mul.epil = mul nsw i64 %sub5.epil, %nu.025.unr
%rem.epil = srem i64 %mul.epil, 1000000007
%mul7.epil = mul nsw i64 %indvars.iv.unr, %de.026.unr
%rem8.epil = srem i64 %mul7.epil, 1000000007
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.unr-lcssa, %for.body.epil
%rem.lcssa = phi i64 [ %rem.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %rem.epil, %for.body.epil ]
%rem8.lcssa = phi i64 [ %rem8.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %rem8.epil, %for.body.epil ]
%1 = trunc i64 %rem8.lcssa to i32
%cmp7.i = icmp sgt i32 %1, 1
br i1 %cmp7.i, label %while.body.i, label %inv.exit
while.body.i: ; preds = %for.cond.cleanup, %while.body.i
%t.09.i = phi i64 [ %rem.i, %while.body.i ], [ 1, %for.cond.cleanup ]
%a.addr.08.i = phi i32 [ %rem3.i, %while.body.i ], [ %1, %for.cond.cleanup ]
%div.i = udiv i32 1000000007, %a.addr.08.i
%sub.i = sub nuw nsw i32 1000000007, %div.i
%conv1.i = zext i32 %sub.i to i64
%mul.i = mul nuw nsw i64 %t.09.i, %conv1.i
%rem.i = urem i64 %mul.i, 1000000007
%rem3.i = urem i32 1000000007, %a.addr.08.i
%cmp.i = icmp ugt i32 %rem3.i, 1
br i1 %cmp.i, label %while.body.i, label %inv.exit, !llvm.loop !5
inv.exit: ; preds = %while.body.i, %entry, %for.cond.cleanup
%nu.0.lcssa34 = phi i64 [ %rem.lcssa, %for.cond.cleanup ], [ 1, %entry ], [ %rem.lcssa, %while.body.i ]
%t.0.lcssa.i = phi i64 [ 1, %for.cond.cleanup ], [ 1, %entry ], [ %rem.i, %while.body.i ]
%mul11 = mul nsw i64 %t.0.lcssa.i, %nu.0.lcssa34
%rem12 = srem i64 %mul11, 1000000007
%conv13 = trunc i64 %rem12 to i32
ret i32 %conv13
for.body: ; preds = %for.body, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 1, %for.body.lr.ph.new ], [ %indvars.iv.next.1, %for.body ]
%de.026 = phi i64 [ 1, %for.body.lr.ph.new ], [ %rem8.1, %for.body ]
%nu.025 = phi i64 [ 1, %for.body.lr.ph.new ], [ %rem.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub5 = sub i64 %add, %indvars.iv
%mul = mul nsw i64 %sub5, %nu.025
%rem = srem i64 %mul, 1000000007
%mul7 = mul nsw i64 %indvars.iv, %de.026
%rem8 = srem i64 %mul7, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%sub5.1 = sub i64 %add, %indvars.iv.next
%mul.1 = mul nsw i64 %sub5.1, %rem
%rem.1 = srem i64 %mul.1, 1000000007
%mul7.1 = mul nsw i64 %indvars.iv.next, %rem8
%rem8.1 = srem i64 %mul7.1, 1000000007
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.unr-lcssa, label %for.body, !llvm.loop !7
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @run() local_unnamed_addr #3 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !8
%1 = load i64, ptr %m, align 8, !tbaa !8
%mul = mul nsw i64 %1, %0
%2 = load i64, ptr %k, align 8, !tbaa !8
%sub1 = add nsw i64 %2, -2
%3 = sub i64 %mul, %2
%spec.select.i = call i64 @llvm.smin.i64(i64 %3, i64 %sub1)
%cmp2.not24.i = icmp slt i64 %spec.select.i, 1
br i1 %cmp2.not24.i, label %comb.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %spec.select.i, 1
%4 = icmp eq i64 %spec.select.i, 1
br i1 %4, label %for.cond.cleanup.i.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %spec.select.i, -2
br label %for.body.i
for.cond.cleanup.i.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%rem.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %rem.i.1, %for.body.i ]
%rem8.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %rem8.i.1, %for.body.i ]
%indvars.iv.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.body.i ]
%de.026.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %rem8.i.1, %for.body.i ]
%nu.025.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %rem.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup.i, label %for.body.i.epil
for.body.i.epil: ; preds = %for.cond.cleanup.i.unr-lcssa
%5 = xor i64 %indvars.iv.i.unr, -1
%sub5.i.epil = add i64 %mul, %5
%mul.i.epil = mul nsw i64 %nu.025.i.unr, %sub5.i.epil
%rem.i.epil = srem i64 %mul.i.epil, 1000000007
%mul7.i.epil = mul nsw i64 %de.026.i.unr, %indvars.iv.i.unr
%rem8.i.epil = srem i64 %mul7.i.epil, 1000000007
br label %for.cond.cleanup.i
for.cond.cleanup.i: ; preds = %for.cond.cleanup.i.unr-lcssa, %for.body.i.epil
%rem.i.lcssa = phi i64 [ %rem.i.lcssa.ph, %for.cond.cleanup.i.unr-lcssa ], [ %rem.i.epil, %for.body.i.epil ]
%rem8.i.lcssa = phi i64 [ %rem8.i.lcssa.ph, %for.cond.cleanup.i.unr-lcssa ], [ %rem8.i.epil, %for.body.i.epil ]
%6 = trunc i64 %rem8.i.lcssa to i32
%cmp7.i.i = icmp sgt i32 %6, 1
br i1 %cmp7.i.i, label %while.body.i.i, label %comb.exit
while.body.i.i: ; preds = %for.cond.cleanup.i, %while.body.i.i
%t.09.i.i = phi i64 [ %rem.i.i, %while.body.i.i ], [ 1, %for.cond.cleanup.i ]
%a.addr.08.i.i = phi i32 [ %rem3.i.i, %while.body.i.i ], [ %6, %for.cond.cleanup.i ]
%div.i.i = udiv i32 1000000007, %a.addr.08.i.i
%sub.i.i = sub nuw nsw i32 1000000007, %div.i.i
%conv1.i.i = zext i32 %sub.i.i to i64
%mul.i.i = mul nuw nsw i64 %t.09.i.i, %conv1.i.i
%rem.i.i = urem i64 %mul.i.i, 1000000007
%rem3.i.i = urem i32 1000000007, %a.addr.08.i.i
%cmp.i.i = icmp ugt i32 %rem3.i.i, 1
br i1 %cmp.i.i, label %while.body.i.i, label %comb.exit, !llvm.loop !5
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.body.i ]
%de.026.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %rem8.i.1, %for.body.i ]
%nu.025.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %rem.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%7 = xor i64 %indvars.iv.i, -1
%sub5.i = add i64 %mul, %7
%mul.i = mul nsw i64 %nu.025.i, %sub5.i
%rem.i = srem i64 %mul.i, 1000000007
%mul7.i = mul nsw i64 %de.026.i, %indvars.iv.i
%rem8.i = srem i64 %mul7.i, 1000000007
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%reass.sub = sub i64 %mul, %indvars.iv.i
%sub5.i.1 = add i64 %reass.sub, -2
%mul.i.1 = mul nsw i64 %rem.i, %sub5.i.1
%rem.i.1 = srem i64 %mul.i.1, 1000000007
%mul7.i.1 = mul nsw i64 %rem8.i, %indvars.iv.next.i
%rem8.i.1 = srem i64 %mul7.i.1, 1000000007
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.i.unr-lcssa, label %for.body.i, !llvm.loop !7
comb.exit: ; preds = %while.body.i.i, %entry, %for.cond.cleanup.i
%nu.0.lcssa34.i = phi i64 [ %rem.i.lcssa, %for.cond.cleanup.i ], [ 1, %entry ], [ %rem.i.lcssa, %while.body.i.i ]
%t.0.lcssa.i.i = phi i64 [ 1, %for.cond.cleanup.i ], [ 1, %entry ], [ %rem.i.i, %while.body.i.i ]
%mul11.i = mul nsw i64 %t.0.lcssa.i.i, %nu.0.lcssa34.i
%rem12.i = srem i64 %mul11.i, 1000000007
%cmp48 = icmp sgt i64 %1, 1
br i1 %cmp48, label %for.body, label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.body, %comb.exit
%ans.0.lcssa = phi i64 [ 0, %comb.exit ], [ %rem14, %for.body ]
%cmp1852 = icmp sgt i64 %0, 1
br i1 %cmp1852, label %for.body21, label %for.cond.cleanup20
for.body: ; preds = %comb.exit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %comb.exit ]
%ans.049 = phi i64 [ %rem14, %for.body ], [ 0, %comb.exit ]
%mul6 = mul nsw i64 %indvars.iv, %rem12.i
%rem = srem i64 %mul6, 1000000007
%sub8 = sub nsw i64 %1, %indvars.iv
%mul9 = mul nsw i64 %rem, %sub8
%rem10 = srem i64 %mul9, 1000000007
%mul11 = mul nsw i64 %rem10, %0
%rem12 = srem i64 %mul11, 1000000007
%mul13 = mul nsw i64 %rem12, %0
%add = add nsw i64 %mul13, %ans.049
%rem14 = srem i64 %add, 1000000007
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %1
br i1 %exitcond.not, label %for.cond16.preheader, label %for.body, !llvm.loop !12
for.cond.cleanup20: ; preds = %for.body21, %for.cond16.preheader
%ans.1.lcssa = phi i64 [ %ans.0.lcssa, %for.cond16.preheader ], [ %rem33, %for.body21 ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.1.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7
ret void
for.body21: ; preds = %for.cond16.preheader, %for.body21
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.body21 ], [ 1, %for.cond16.preheader ]
%ans.153 = phi i64 [ %rem33, %for.body21 ], [ %ans.0.lcssa, %for.cond16.preheader ]
%mul23 = mul nsw i64 %indvars.iv58, %rem12.i
%rem24 = srem i64 %mul23, 1000000007
%sub26 = sub nsw i64 %0, %indvars.iv58
%mul27 = mul nsw i64 %rem24, %sub26
%rem28 = srem i64 %mul27, 1000000007
%mul29 = mul nsw i64 %rem28, %1
%rem30 = srem i64 %mul29, 1000000007
%mul31 = mul nsw i64 %rem30, %1
%add32 = add nsw i64 %mul31, %ans.153
%rem33 = srem i64 %add32, 1000000007
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond61.not = icmp eq i64 %indvars.iv.next59, %0
br i1 %exitcond61.not, label %for.cond.cleanup20, label %for.body21, !llvm.loop !13
}
; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @gen() local_unnamed_addr #5 {
entry:
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
tail call void @run()
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
int edge[200000][2];
int qmem[400000];
int *e[100001];
int el[100001];
int prev[100001];
int s[100000];
int sl, sr;
int main(void){
int n=nextint();
int m=nextint();
for(int i=0; i<m; i++){
int A=nextint();
int B=nextint();
edge[i][0]=A;
edge[i][1]=B;
el[A]++;
el[B]++;
}
int ne=0;
for(int i=1; i<=n; i++){
e[i]=&qmem[ne];
ne+=el[i];
el[i]=0;
}
for(int i=0; i<m; i++){
int A=edge[i][0];
int B=edge[i][1];
e[A][el[A]++]=B;
e[B][el[B]++]=A;
}
int k=0;
prev[1]=1;
s[sr++]=1;
while(sl<sr){
k++;
int from = s[sl++];
for(int i=0; i<el[from]; i++){
int to = e[from][i];
if(prev[to]==0){
prev[to]=from;
s[sr++]=to;
}
}
}
if(k==n){
puts("Yes");
for(int i=2; i<=n; i++){
printf("%d\n", prev[i]);
}
}else{
puts("No");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147366/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147366/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@edge = dso_local local_unnamed_addr global [200000 x [2 x i32]] zeroinitializer, align 16
@el = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@qmem = dso_local global [400000 x i32] zeroinitializer, align 16
@e = dso_local local_unnamed_addr global [100001 x ptr] zeroinitializer, align 16
@prev = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@sr = dso_local local_unnamed_addr global i32 0, align 4
@sl = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @nextint() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #3
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%sext72 = shl i32 %cond.i, 24
%cmp.not73 = icmp ne i32 %sext72, 754974720
%4 = add i32 %sext72, -956301313
%5 = icmp ult i32 %4, -150994945
%or.cond74 = and i1 %cmp.not73, %5
br i1 %or.cond74, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %getchar_unlocked.exit
%.pre81 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit51
%6 = phi ptr [ %.pre81, %while.body.preheader ], [ %10, %getchar_unlocked.exit51 ]
%_IO_read_ptr.i42 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1
%7 = load ptr, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%_IO_read_end.i43 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2
%8 = load ptr, ptr %_IO_read_end.i43, align 8, !tbaa !14
%cmp.not.i44 = icmp ult ptr %7, %8
br i1 %cmp.not.i44, label %cond.false.i48, label %cond.true.i45, !prof !15
cond.true.i45: ; preds = %while.body
%call.i46 = tail call i32 @__uflow(ptr noundef nonnull %6) #3
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit51
cond.false.i48: ; preds = %while.body
%incdec.ptr.i49 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i49, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%9 = load i8, ptr %7, align 1, !tbaa !16
%conv3.i50 = zext i8 %9 to i32
br label %getchar_unlocked.exit51
getchar_unlocked.exit51: ; preds = %cond.true.i45, %cond.false.i48
%10 = phi ptr [ %.pre, %cond.true.i45 ], [ %6, %cond.false.i48 ]
%cond.i47 = phi i32 [ %call.i46, %cond.true.i45 ], [ %conv3.i50, %cond.false.i48 ]
%sext = shl i32 %cond.i47, 24
%cmp.not = icmp ne i32 %sext, 754974720
%11 = add i32 %sext, -956301313
%12 = icmp ult i32 %11, -150994945
%or.cond = and i1 %cmp.not, %12
br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !17
while.end: ; preds = %getchar_unlocked.exit51, %getchar_unlocked.exit
%c.0.in.lcssa = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i47, %getchar_unlocked.exit51 ]
%sext.lcssa = phi i32 [ %sext72, %getchar_unlocked.exit ], [ %sext, %getchar_unlocked.exit51 ]
%cmp12 = icmp eq i32 %sext.lcssa, 754974720
br i1 %cmp12, label %if.then, label %if.end
if.then: ; preds = %while.end
%13 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i52 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%_IO_read_end.i53 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i53, align 8, !tbaa !14
%cmp.not.i54 = icmp ult ptr %14, %15
br i1 %cmp.not.i54, label %cond.false.i58, label %cond.true.i55, !prof !15
cond.true.i55: ; preds = %if.then
%call.i56 = tail call i32 @__uflow(ptr noundef nonnull %13) #3
br label %if.end
cond.false.i58: ; preds = %if.then
%incdec.ptr.i59 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i59, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i60 = zext i8 %16 to i32
br label %if.end
if.end: ; preds = %cond.false.i58, %cond.true.i55, %while.end
%c.1.in = phi i32 [ %c.0.in.lcssa, %while.end ], [ %call.i56, %cond.true.i55 ], [ %conv3.i60, %cond.false.i58 ]
%sext4076 = shl i32 %c.1.in, 24
%17 = add i32 %sext4076, -788529153
%18 = icmp ult i32 %17, 184549375
br i1 %18, label %while.body25.preheader, label %while.end29
while.body25.preheader: ; preds = %if.end
%.pre83 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body25
while.body25: ; preds = %while.body25.preheader, %getchar_unlocked.exit71
%19 = phi ptr [ %23, %getchar_unlocked.exit71 ], [ %.pre83, %while.body25.preheader ]
%x.078 = phi i32 [ %sub, %getchar_unlocked.exit71 ], [ 0, %while.body25.preheader ]
%c.2.in77 = phi i32 [ %cond.i67, %getchar_unlocked.exit71 ], [ %c.1.in, %while.body25.preheader ]
%conv17 = and i32 %c.2.in77, 255
%mul = mul i32 %x.078, 10
%add = add nsw i32 %conv17, -48
%sub = add i32 %add, %mul
%_IO_read_ptr.i62 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 1
%20 = load ptr, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%_IO_read_end.i63 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 2
%21 = load ptr, ptr %_IO_read_end.i63, align 8, !tbaa !14
%cmp.not.i64 = icmp ult ptr %20, %21
br i1 %cmp.not.i64, label %cond.false.i68, label %cond.true.i65, !prof !15
cond.true.i65: ; preds = %while.body25
%call.i66 = tail call i32 @__uflow(ptr noundef nonnull %19) #3
%.pre82 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit71
cond.false.i68: ; preds = %while.body25
%incdec.ptr.i69 = getelementptr inbounds i8, ptr %20, i64 1
store ptr %incdec.ptr.i69, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%22 = load i8, ptr %20, align 1, !tbaa !16
%conv3.i70 = zext i8 %22 to i32
br label %getchar_unlocked.exit71
getchar_unlocked.exit71: ; preds = %cond.true.i65, %cond.false.i68
%23 = phi ptr [ %.pre82, %cond.true.i65 ], [ %19, %cond.false.i68 ]
%cond.i67 = phi i32 [ %call.i66, %cond.true.i65 ], [ %conv3.i70, %cond.false.i68 ]
%sext40 = shl i32 %cond.i67, 24
%24 = add i32 %sext40, -788529153
%25 = icmp ult i32 %24, 184549375
br i1 %25, label %while.body25, label %while.end29, !llvm.loop !19
while.end29: ; preds = %getchar_unlocked.exit71, %if.end
%x.0.lcssa = phi i32 [ 0, %if.end ], [ %sub, %getchar_unlocked.exit71 ]
%sub31 = sub i32 0, %x.0.lcssa
%cond = select i1 %cmp12, i32 %sub31, i32 %x.0.lcssa
ret i32 %cond
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 @nextint()
%call1 = tail call i32 @nextint()
%cmp135 = icmp sgt i32 %call1, 0
br i1 %cmp135, label %for.body.preheader, label %for.cond15.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %call1 to i64
br label %for.body
for.cond15.preheader: ; preds = %for.body, %entry
%cmp16.not137 = icmp slt i32 %call, 1
br i1 %cmp16.not137, label %for.cond31.preheader, label %for.body18.preheader
for.body18.preheader: ; preds = %for.cond15.preheader
%0 = zext i32 %call to i64
%xtraiter = and i64 %0, 1
%1 = icmp eq i32 %call, 1
br i1 %1, label %for.cond31.preheader.loopexit.unr-lcssa, label %for.body18.preheader.new
for.body18.preheader.new: ; preds = %for.body18.preheader
%unroll_iter = and i64 %0, 4294967294
br label %for.body18
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%call2 = tail call i32 @nextint()
%call3 = tail call i32 @nextint()
%arrayidx = getelementptr inbounds [200000 x [2 x i32]], ptr @edge, i64 0, i64 %indvars.iv
store i32 %call2, ptr %arrayidx, align 8, !tbaa !20
%arrayidx7 = getelementptr inbounds [200000 x [2 x i32]], ptr @edge, i64 0, i64 %indvars.iv, i64 1
store i32 %call3, ptr %arrayidx7, align 4, !tbaa !20
%idxprom8 = sext i32 %call2 to i64
%arrayidx9 = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %idxprom8
%2 = load i32, ptr %arrayidx9, align 4, !tbaa !20
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx9, align 4, !tbaa !20
%idxprom10 = sext i32 %call3 to i64
%arrayidx11 = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %idxprom10
%3 = load i32, ptr %arrayidx11, align 4, !tbaa !20
%inc12 = add nsw i32 %3, 1
store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !20
%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.cond15.preheader, label %for.body, !llvm.loop !21
for.cond31.preheader.loopexit.unr-lcssa.loopexit: ; preds = %for.body18
%4 = sext i32 %add.1 to i64
br label %for.cond31.preheader.loopexit.unr-lcssa
for.cond31.preheader.loopexit.unr-lcssa: ; preds = %for.cond31.preheader.loopexit.unr-lcssa.loopexit, %for.body18.preheader
%indvars.iv160.unr = phi i64 [ 1, %for.body18.preheader ], [ %indvars.iv.next161.1, %for.cond31.preheader.loopexit.unr-lcssa.loopexit ]
%ne.0139.unr = phi i64 [ 0, %for.body18.preheader ], [ %4, %for.cond31.preheader.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond31.preheader, label %for.body18.epil
for.body18.epil: ; preds = %for.cond31.preheader.loopexit.unr-lcssa
%arrayidx20.epil = getelementptr inbounds [400000 x i32], ptr @qmem, i64 0, i64 %ne.0139.unr
%arrayidx22.epil = getelementptr inbounds [100001 x ptr], ptr @e, i64 0, i64 %indvars.iv160.unr
store ptr %arrayidx20.epil, ptr %arrayidx22.epil, align 8, !tbaa !5
%arrayidx24.epil = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %indvars.iv160.unr
store i32 0, ptr %arrayidx24.epil, align 4, !tbaa !20
br label %for.cond31.preheader
for.cond31.preheader: ; preds = %for.body18.epil, %for.cond31.preheader.loopexit.unr-lcssa, %for.cond15.preheader
br i1 %cmp135, label %for.body34.preheader, label %for.cond.cleanup33
for.body34.preheader: ; preds = %for.cond31.preheader
%wide.trip.count168 = zext i32 %call1 to i64
br label %for.body34
for.body18: ; preds = %for.body18, %for.body18.preheader.new
%indvars.iv160 = phi i64 [ 1, %for.body18.preheader.new ], [ %indvars.iv.next161.1, %for.body18 ]
%ne.0139 = phi i32 [ 0, %for.body18.preheader.new ], [ %add.1, %for.body18 ]
%niter = phi i64 [ 0, %for.body18.preheader.new ], [ %niter.next.1, %for.body18 ]
%idxprom19 = sext i32 %ne.0139 to i64
%arrayidx20 = getelementptr inbounds [400000 x i32], ptr @qmem, i64 0, i64 %idxprom19
%arrayidx22 = getelementptr inbounds [100001 x ptr], ptr @e, i64 0, i64 %indvars.iv160
store ptr %arrayidx20, ptr %arrayidx22, align 8, !tbaa !5
%arrayidx24 = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %indvars.iv160
%5 = load i32, ptr %arrayidx24, align 4, !tbaa !20
%add = add nsw i32 %5, %ne.0139
store i32 0, ptr %arrayidx24, align 4, !tbaa !20
%indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
%idxprom19.1 = sext i32 %add to i64
%arrayidx20.1 = getelementptr inbounds [400000 x i32], ptr @qmem, i64 0, i64 %idxprom19.1
%arrayidx22.1 = getelementptr inbounds [100001 x ptr], ptr @e, i64 0, i64 %indvars.iv.next161
store ptr %arrayidx20.1, ptr %arrayidx22.1, align 8, !tbaa !5
%arrayidx24.1 = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %indvars.iv.next161
%6 = load i32, ptr %arrayidx24.1, align 4, !tbaa !20
%add.1 = add nsw i32 %6, %add
store i32 0, ptr %arrayidx24.1, align 4, !tbaa !20
%indvars.iv.next161.1 = add nuw nsw i64 %indvars.iv160, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond31.preheader.loopexit.unr-lcssa.loopexit, label %for.body18, !llvm.loop !22
for.cond.cleanup33: ; preds = %for.body34, %for.cond31.preheader
store i32 1, ptr getelementptr inbounds ([100001 x i32], ptr @prev, i64 0, i64 1), align 4, !tbaa !20
%7 = load i32, ptr @sr, align 4, !tbaa !20
%inc60 = add nsw i32 %7, 1
store i32 %inc60, ptr @sr, align 4, !tbaa !20
%idxprom61 = sext i32 %7 to i64
%arrayidx62 = getelementptr inbounds [100000 x i32], ptr @s, i64 0, i64 %idxprom61
store i32 1, ptr %arrayidx62, align 4, !tbaa !20
%sl.promoted = load i32, ptr @sl, align 4, !tbaa !20
%cmp63153.not = icmp sgt i32 %sl.promoted, %7
br i1 %cmp63153.not, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %for.cond.cleanup33
%8 = sext i32 %sl.promoted to i64
br label %while.body
for.body34: ; preds = %for.body34.preheader, %for.body34
%indvars.iv165 = phi i64 [ 0, %for.body34.preheader ], [ %indvars.iv.next166, %for.body34 ]
%arrayidx37 = getelementptr inbounds [200000 x [2 x i32]], ptr @edge, i64 0, i64 %indvars.iv165
%9 = load i32, ptr %arrayidx37, align 8, !tbaa !20
%arrayidx42 = getelementptr inbounds [200000 x [2 x i32]], ptr @edge, i64 0, i64 %indvars.iv165, i64 1
%10 = load i32, ptr %arrayidx42, align 4, !tbaa !20
%idxprom43 = sext i32 %9 to i64
%arrayidx44 = getelementptr inbounds [100001 x ptr], ptr @e, i64 0, i64 %idxprom43
%11 = load ptr, ptr %arrayidx44, align 8, !tbaa !5
%arrayidx46 = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %idxprom43
%12 = load i32, ptr %arrayidx46, align 4, !tbaa !20
%inc47 = add nsw i32 %12, 1
store i32 %inc47, ptr %arrayidx46, align 4, !tbaa !20
%idxprom48 = sext i32 %12 to i64
%arrayidx49 = getelementptr inbounds i32, ptr %11, i64 %idxprom48
store i32 %10, ptr %arrayidx49, align 4, !tbaa !20
%idxprom50 = sext i32 %10 to i64
%arrayidx51 = getelementptr inbounds [100001 x ptr], ptr @e, i64 0, i64 %idxprom50
%13 = load ptr, ptr %arrayidx51, align 8, !tbaa !5
%arrayidx53 = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %idxprom50
%14 = load i32, ptr %arrayidx53, align 4, !tbaa !20
%inc54 = add nsw i32 %14, 1
store i32 %inc54, ptr %arrayidx53, align 4, !tbaa !20
%idxprom55 = sext i32 %14 to i64
%arrayidx56 = getelementptr inbounds i32, ptr %13, i64 %idxprom55
store i32 %9, ptr %arrayidx56, align 4, !tbaa !20
%indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1
%exitcond169.not = icmp eq i64 %indvars.iv.next166, %wide.trip.count168
br i1 %exitcond169.not, label %for.cond.cleanup33, label %for.body34, !llvm.loop !23
while.cond.loopexit: ; preds = %if.end, %while.body
%sr.promoted149 = phi i32 [ %sr.promoted152154, %while.body ], [ %sr.promoted150, %if.end ]
%15 = sext i32 %sr.promoted149 to i64
%cmp63 = icmp slt i64 %indvars.iv.next176, %15
br i1 %cmp63, label %while.body, label %while.end, !llvm.loop !24
while.body: ; preds = %while.body.preheader, %while.cond.loopexit
%indvars.iv175 = phi i64 [ %8, %while.body.preheader ], [ %indvars.iv.next176, %while.cond.loopexit ]
%k.0156 = phi i32 [ 0, %while.body.preheader ], [ %inc64, %while.cond.loopexit ]
%sr.promoted152154 = phi i32 [ %inc60, %while.body.preheader ], [ %sr.promoted149, %while.cond.loopexit ]
%inc64 = add nuw nsw i32 %k.0156, 1
%indvars.iv.next176 = add nsw i64 %indvars.iv175, 1
%16 = trunc i64 %indvars.iv.next176 to i32
store i32 %16, ptr @sl, align 4, !tbaa !20
%arrayidx67 = getelementptr inbounds [100000 x i32], ptr @s, i64 0, i64 %indvars.iv175
%17 = load i32, ptr %arrayidx67, align 4, !tbaa !20
%idxprom70 = sext i32 %17 to i64
%arrayidx71 = getelementptr inbounds [100001 x i32], ptr @el, i64 0, i64 %idxprom70
%18 = load i32, ptr %arrayidx71, align 4, !tbaa !20
%cmp72144 = icmp sgt i32 %18, 0
br i1 %cmp72144, label %for.body74.lr.ph, label %while.cond.loopexit
for.body74.lr.ph: ; preds = %while.body
%arrayidx76 = getelementptr inbounds [100001 x ptr], ptr @e, i64 0, i64 %idxprom70
%19 = load ptr, ptr %arrayidx76, align 8, !tbaa !5
%wide.trip.count173 = zext i32 %18 to i64
br label %for.body74
for.body74: ; preds = %for.body74.lr.ph, %if.end
%indvars.iv170 = phi i64 [ 0, %for.body74.lr.ph ], [ %indvars.iv.next171, %if.end ]
%sr.promoted151 = phi i32 [ %sr.promoted152154, %for.body74.lr.ph ], [ %sr.promoted150, %if.end ]
%inc84143145 = phi i32 [ %sr.promoted152154, %for.body74.lr.ph ], [ %inc84142, %if.end ]
%arrayidx78 = getelementptr inbounds i32, ptr %19, i64 %indvars.iv170
%20 = load i32, ptr %arrayidx78, align 4, !tbaa !20
%idxprom79 = sext i32 %20 to i64
%arrayidx80 = getelementptr inbounds [100001 x i32], ptr @prev, i64 0, i64 %idxprom79
%21 = load i32, ptr %arrayidx80, align 4, !tbaa !20
%cmp81 = icmp eq i32 %21, 0
br i1 %cmp81, label %if.then, label %if.end
if.then: ; preds = %for.body74
store i32 %17, ptr %arrayidx80, align 4, !tbaa !20
%inc84 = add nsw i32 %inc84143145, 1
store i32 %inc84, ptr @sr, align 4, !tbaa !20
%idxprom85 = sext i32 %inc84143145 to i64
%arrayidx86 = getelementptr inbounds [100000 x i32], ptr @s, i64 0, i64 %idxprom85
store i32 %20, ptr %arrayidx86, align 4, !tbaa !20
br label %if.end
if.end: ; preds = %if.then, %for.body74
%sr.promoted150 = phi i32 [ %inc84, %if.then ], [ %sr.promoted151, %for.body74 ]
%inc84142 = phi i32 [ %inc84, %if.then ], [ %inc84143145, %for.body74 ]
%indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1
%exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count173
br i1 %exitcond174.not, label %while.cond.loopexit, label %for.body74, !llvm.loop !25
while.end: ; preds = %while.cond.loopexit, %for.cond.cleanup33
%k.0.lcssa = phi i32 [ 0, %for.cond.cleanup33 ], [ %inc64, %while.cond.loopexit ]
%cmp90 = icmp eq i32 %k.0.lcssa, %call
br i1 %cmp90, label %if.then91, label %if.else
if.then91: ; preds = %while.end
%call92 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str)
%cmp95.not157 = icmp slt i32 %call, 2
br i1 %cmp95.not157, label %if.end105, label %for.body97.preheader
for.body97.preheader: ; preds = %if.then91
%22 = add nuw i32 %call, 1
%wide.trip.count181 = zext i32 %22 to i64
br label %for.body97
for.body97: ; preds = %for.body97.preheader, %for.body97
%indvars.iv178 = phi i64 [ 2, %for.body97.preheader ], [ %indvars.iv.next179, %for.body97 ]
%arrayidx99 = getelementptr inbounds [100001 x i32], ptr @prev, i64 0, i64 %indvars.iv178
%23 = load i32, ptr %arrayidx99, align 4, !tbaa !20
%call100 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %23)
%indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
%exitcond182.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count181
br i1 %exitcond182.not, label %if.end105, label %for.body97, !llvm.loop !26
if.else: ; preds = %while.end
%call104 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end105
if.end105: ; preds = %for.body97, %if.then91, %if.else
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
declare i32 @__uflow(ptr noundef) local_unnamed_addr #2
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 = { "no-trapping-math"="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, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{!11, !11, i64 0}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
|
#include <stdio.h>
#include <stdlib.h>
int N, M;
int ec[114514];
int* es[114514];
void ae(int f, int t) {
es[f] = realloc(es[f], sizeof(int) * (ec[f] + 1));
if (es[f] == NULL) exit(2);
es[f][ec[f]++] = t;
}
int ayaneru[114514];
int qs, qe;
int q[114514];
int main(void) {
int i;
if (scanf("%d%d", &N, &M) != 2) return 1;
for (i = 0; i < M; i++) {
int A, B;
if (scanf("%d%d", &A, &B) != 2) return 1;
ae(A, B);
ae(B, A);
}
q[0] = 1;
ayaneru[1] = -1;
qs = 0;
qe = 1;
while (qs < qe) {
int node = q[qs];
qs++;
for (i = 0; i < ec[node]; i++) {
int next = es[node][i];
if (ayaneru[next] == 0) {
ayaneru[next] = node;
q[qe++] = next;
}
}
}
for (i = 1; i <= N; i++) {
if (ayaneru[i] == 0) {
puts("No");
return 0;
}
}
puts("Yes");
for (i = 2; i <= N; i++) {
printf("%d\n", ayaneru[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147409/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147409/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@es = dso_local local_unnamed_addr global [114514 x ptr] zeroinitializer, align 16
@ec = dso_local local_unnamed_addr global [114514 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@N = dso_local global i32 0, align 4
@M = dso_local global i32 0, align 4
@q = dso_local local_unnamed_addr global [114514 x i32] zeroinitializer, align 16
@ayaneru = dso_local local_unnamed_addr global [114514 x i32] zeroinitializer, align 16
@qs = dso_local local_unnamed_addr global i32 0, align 4
@qe = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local void @ae(i32 noundef %f, i32 noundef %t) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %f to i64
%arrayidx = getelementptr inbounds [114514 x ptr], ptr @es, i64 0, i64 %idxprom
%0 = load ptr, ptr %arrayidx, align 8, !tbaa !5
%arrayidx2 = getelementptr inbounds [114514 x i32], ptr @ec, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !9
%add = add nsw i32 %1, 1
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 2
%call = tail call ptr @realloc(ptr noundef %0, i64 noundef %mul) #5
store ptr %call, ptr %arrayidx, align 8, !tbaa !5
%cmp = icmp eq ptr %call, null
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
tail call void @exit(i32 noundef 2) #6
unreachable
if.end: ; preds = %entry
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !9
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !9
%idxprom12 = sext i32 %2 to i64
%arrayidx13 = getelementptr inbounds i32, ptr %call, i64 %idxprom12
store i32 %t, ptr %arrayidx13, align 4, !tbaa !9
ret void
}
; 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 #1
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N, ptr noundef nonnull @M)
%cmp.not = icmp eq i32 %call, 2
br i1 %cmp.not, label %for.cond.preheader, label %cleanup53
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr @M, align 4, !tbaa !9
%cmp183 = icmp sgt i32 %0, 0
br i1 %cmp183, label %for.body, label %while.body.preheader
for.body: ; preds = %for.cond.preheader, %for.inc
%i.084 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #7
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%cmp3.not = icmp eq i32 %call2, 2
br i1 %cmp3.not, label %if.end5, label %cleanup
if.end5: ; preds = %for.body
%1 = load i32, ptr %A, align 4, !tbaa !9
%2 = load i32, ptr %B, align 4, !tbaa !9
%idxprom.i = sext i32 %1 to i64
%arrayidx.i = getelementptr inbounds [114514 x ptr], ptr @es, i64 0, i64 %idxprom.i
%3 = load ptr, ptr %arrayidx.i, align 8, !tbaa !5
%arrayidx2.i = getelementptr inbounds [114514 x i32], ptr @ec, i64 0, i64 %idxprom.i
%4 = load i32, ptr %arrayidx2.i, align 4, !tbaa !9
%add.i = add nsw i32 %4, 1
%conv.i = sext i32 %add.i to i64
%mul.i = shl nsw i64 %conv.i, 2
%call.i = call ptr @realloc(ptr noundef %3, i64 noundef %mul.i) #5
store ptr %call.i, ptr %arrayidx.i, align 8, !tbaa !5
%cmp.i = icmp eq ptr %call.i, null
br i1 %cmp.i, label %if.then.i, label %ae.exit
if.then.i: ; preds = %if.end5
call void @exit(i32 noundef 2) #6
unreachable
ae.exit: ; preds = %if.end5
%5 = load i32, ptr %arrayidx2.i, align 4, !tbaa !9
%inc.i = add nsw i32 %5, 1
store i32 %inc.i, ptr %arrayidx2.i, align 4, !tbaa !9
%idxprom12.i = sext i32 %5 to i64
%arrayidx13.i = getelementptr inbounds i32, ptr %call.i, i64 %idxprom12.i
store i32 %2, ptr %arrayidx13.i, align 4, !tbaa !9
%6 = load i32, ptr %B, align 4, !tbaa !9
%7 = load i32, ptr %A, align 4, !tbaa !9
%idxprom.i68 = sext i32 %6 to i64
%arrayidx.i69 = getelementptr inbounds [114514 x ptr], ptr @es, i64 0, i64 %idxprom.i68
%8 = load ptr, ptr %arrayidx.i69, align 8, !tbaa !5
%arrayidx2.i70 = getelementptr inbounds [114514 x i32], ptr @ec, i64 0, i64 %idxprom.i68
%9 = load i32, ptr %arrayidx2.i70, align 4, !tbaa !9
%add.i71 = add nsw i32 %9, 1
%conv.i72 = sext i32 %add.i71 to i64
%mul.i73 = shl nsw i64 %conv.i72, 2
%call.i74 = call ptr @realloc(ptr noundef %8, i64 noundef %mul.i73) #5
store ptr %call.i74, ptr %arrayidx.i69, align 8, !tbaa !5
%cmp.i75 = icmp eq ptr %call.i74, null
br i1 %cmp.i75, label %if.then.i79, label %for.inc
if.then.i79: ; preds = %ae.exit
call void @exit(i32 noundef 2) #6
unreachable
cleanup: ; preds = %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #7
br label %cleanup53
for.inc: ; preds = %ae.exit
%10 = load i32, ptr %arrayidx2.i70, align 4, !tbaa !9
%inc.i76 = add nsw i32 %10, 1
store i32 %inc.i76, ptr %arrayidx2.i70, align 4, !tbaa !9
%idxprom12.i77 = sext i32 %10 to i64
%arrayidx13.i78 = getelementptr inbounds i32, ptr %call.i74, i64 %idxprom12.i77
store i32 %7, ptr %arrayidx13.i78, align 4, !tbaa !9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #7
%inc = add nuw nsw i32 %i.084, 1
%11 = load i32, ptr @M, align 4, !tbaa !9
%cmp1 = icmp slt i32 %inc, %11
br i1 %cmp1, label %for.body, label %while.body.preheader, !llvm.loop !11
while.body.preheader: ; preds = %for.inc, %for.cond.preheader
store i32 1, ptr @q, align 16, !tbaa !9
store i32 -1, ptr getelementptr inbounds ([114514 x i32], ptr @ayaneru, i64 0, i64 1), align 4, !tbaa !9
store i32 1, ptr @qe, align 4, !tbaa !9
br label %while.body
while.cond.loopexit: ; preds = %if.end27, %while.body
%qe.promoted92 = phi i32 [ %qe.promoted9597, %while.body ], [ %qe.promoted93, %if.end27 ]
%12 = sext i32 %qe.promoted92 to i64
%cmp7 = icmp slt i64 %indvars.iv.next105, %12
br i1 %cmp7, label %while.body, label %for.cond31.preheader, !llvm.loop !13
for.cond31.preheader: ; preds = %while.cond.loopexit
%13 = load i32, ptr @N, align 4, !tbaa !9
%cmp32.not99 = icmp slt i32 %13, 1
br i1 %cmp32.not99, label %for.end42, label %for.body33.preheader
for.body33.preheader: ; preds = %for.cond31.preheader
%14 = add nuw i32 %13, 1
%wide.trip.count110 = zext i32 %14 to i64
br label %for.body33
while.body: ; preds = %while.body.preheader, %while.cond.loopexit
%indvars.iv104 = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next105, %while.cond.loopexit ]
%qe.promoted9597 = phi i32 [ 1, %while.body.preheader ], [ %qe.promoted92, %while.cond.loopexit ]
%arrayidx = getelementptr inbounds [114514 x i32], ptr @q, i64 0, i64 %indvars.iv104
%15 = load i32, ptr %arrayidx, align 4, !tbaa !9
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%16 = trunc i64 %indvars.iv.next105 to i32
store i32 %16, ptr @qs, align 4, !tbaa !9
%idxprom10 = sext i32 %15 to i64
%arrayidx11 = getelementptr inbounds [114514 x i32], ptr @ec, i64 0, i64 %idxprom10
%17 = load i32, ptr %arrayidx11, align 4, !tbaa !9
%cmp1287 = icmp sgt i32 %17, 0
br i1 %cmp1287, label %for.body13.lr.ph, label %while.cond.loopexit
for.body13.lr.ph: ; preds = %while.body
%arrayidx15 = getelementptr inbounds [114514 x ptr], ptr @es, i64 0, i64 %idxprom10
%18 = load ptr, ptr %arrayidx15, align 8, !tbaa !5
%wide.trip.count = zext i32 %17 to i64
br label %for.body13
for.body13: ; preds = %for.body13.lr.ph, %if.end27
%indvars.iv = phi i64 [ 0, %for.body13.lr.ph ], [ %indvars.iv.next, %if.end27 ]
%qe.promoted94 = phi i32 [ %qe.promoted9597, %for.body13.lr.ph ], [ %qe.promoted93, %if.end27 ]
%inc248688 = phi i32 [ %qe.promoted9597, %for.body13.lr.ph ], [ %inc2485, %if.end27 ]
%arrayidx17 = getelementptr inbounds i32, ptr %18, i64 %indvars.iv
%19 = load i32, ptr %arrayidx17, align 4, !tbaa !9
%idxprom18 = sext i32 %19 to i64
%arrayidx19 = getelementptr inbounds [114514 x i32], ptr @ayaneru, i64 0, i64 %idxprom18
%20 = load i32, ptr %arrayidx19, align 4, !tbaa !9
%cmp20 = icmp eq i32 %20, 0
br i1 %cmp20, label %if.then21, label %if.end27
if.then21: ; preds = %for.body13
store i32 %15, ptr %arrayidx19, align 4, !tbaa !9
%inc24 = add nsw i32 %inc248688, 1
store i32 %inc24, ptr @qe, align 4, !tbaa !9
%idxprom25 = sext i32 %inc248688 to i64
%arrayidx26 = getelementptr inbounds [114514 x i32], ptr @q, i64 0, i64 %idxprom25
store i32 %19, ptr %arrayidx26, align 4, !tbaa !9
br label %if.end27
if.end27: ; preds = %if.then21, %for.body13
%qe.promoted93 = phi i32 [ %inc24, %if.then21 ], [ %qe.promoted94, %for.body13 ]
%inc2485 = phi i32 [ %inc24, %if.then21 ], [ %inc248688, %for.body13 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %while.cond.loopexit, label %for.body13, !llvm.loop !14
for.cond31: ; preds = %for.body33
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%exitcond111.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count110
br i1 %exitcond111.not, label %for.end42, label %for.body33, !llvm.loop !15
for.body33: ; preds = %for.body33.preheader, %for.cond31
%indvars.iv107 = phi i64 [ 1, %for.body33.preheader ], [ %indvars.iv.next108, %for.cond31 ]
%arrayidx35 = getelementptr inbounds [114514 x i32], ptr @ayaneru, i64 0, i64 %indvars.iv107
%21 = load i32, ptr %arrayidx35, align 4, !tbaa !9
%cmp36 = icmp eq i32 %21, 0
br i1 %cmp36, label %if.then37, label %for.cond31
if.then37: ; preds = %for.body33
%call38 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup53
for.end42: ; preds = %for.cond31, %for.cond31.preheader
%call43 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
%22 = load i32, ptr @N, align 4, !tbaa !9
%cmp45.not101 = icmp slt i32 %22, 2
br i1 %cmp45.not101, label %cleanup53, label %for.body46
for.body46: ; preds = %for.end42, %for.body46
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.body46 ], [ 2, %for.end42 ]
%arrayidx48 = getelementptr inbounds [114514 x i32], ptr @ayaneru, i64 0, i64 %indvars.iv112
%23 = load i32, ptr %arrayidx48, align 4, !tbaa !9
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %23)
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%24 = load i32, ptr @N, align 4, !tbaa !9
%25 = sext i32 %24 to i64
%cmp45.not.not = icmp slt i64 %indvars.iv112, %25
br i1 %cmp45.not.not, label %for.body46, label %cleanup53, !llvm.loop !16
cleanup53: ; preds = %for.body46, %for.end42, %cleanup, %entry, %if.then37
%retval.2 = phi i32 [ 1, %cleanup ], [ 0, %if.then37 ], [ 1, %entry ], [ 0, %for.end42 ], [ 0, %for.body46 ]
ret i32 %retval.2
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-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 allocsize(1) }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
|
#include<stdio.h>
#define Max 500000
#define term 1000000000
int Left[(Max/2)+2], Right[(Max/2)+2];
int c=0;
void merge(int e[], int n, int left, int mid, int right){
int i,j,k;
int x = (mid-left);
int y = (right-mid);
for ( i=0; i<x; i++ )
Left[i] = e[left+i];
for ( i=0; i<y; i++ )
Right[i] = e[mid+i];
Left[x]= Right[y] = term;
i = j = 0;
for ( k=left; k<right; k++){
c++;
if ( Left[i]<=Right[j] ){
e[k] = Left[i++];
} else {
e[k] = Right[j++];
}
}
}
void mergeSort(int e[], int n, int left, int right ){
int mid;
if ( left+1<right ){
mid=(left + right)/2;
mergeSort(e, n, left, mid);
mergeSort(e, n, mid, right);
merge(e, n, left, mid, right);
}
}
int main(){
int e[Max], n, i;
scanf("%d", &n);
for ( i=0; i<n; i++) {
scanf("%d", &e[i]);
if (e[i]>=term ){
return 1;
}
}
mergeSort(e,n,0,n);
for ( i=0; i<n; i++) {
if ( i !=0 )
printf(" ");
printf("%d", e[i]);
}
printf("\n");
printf("%d\n", c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147452/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147452/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@c = dso_local local_unnamed_addr global i32 0, align 4
@Left = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
@Right = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %e, i32 noundef %n, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%e88 = ptrtoint ptr %e to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp65 = icmp sgt i32 %sub, 0
br i1 %cmp65, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %e, i64 %0
%min.iters.check = icmp ult i32 %sub, 12
br i1 %min.iters.check, label %for.body.preheader106, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %e88
%3 = sub i64 ptrtoint (ptr @Left to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader106, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%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 ]
%4 = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load89 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load89, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader106
for.body.preheader106: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader106, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader106 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader106 ]
%gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i32, ptr %gep.prol, align 4, !tbaa !5
%arrayidx3.prol = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.prol
store i32 %11, ptr %arrayidx3.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !13
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader106
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader106 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp567 = icmp sgt i32 %sub1, 0
br i1 %cmp567, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count79 = zext i32 %sub1 to i64
%invariant.gep86 = getelementptr i32, ptr %e, i64 %13
%min.iters.check94 = icmp ult i32 %sub1, 12
br i1 %min.iters.check94, label %for.body6.preheader105, label %vector.memcheck90
vector.memcheck90: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %e88
%16 = sub i64 ptrtoint (ptr @Right to i64), %15
%diff.check91 = icmp ult i64 %16, 32
br i1 %diff.check91, label %for.body6.preheader105, label %vector.ph95
vector.ph95: ; preds = %vector.memcheck90
%n.vec97 = and i64 %wide.trip.count79, 4294967288
br label %vector.body100
vector.body100: ; preds = %vector.body100, %vector.ph95
%index101 = phi i64 [ 0, %vector.ph95 ], [ %index.next104, %vector.body100 ]
%17 = getelementptr i32, ptr %invariant.gep86, i64 %index101
%wide.load102 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load103 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %index101
store <4 x i32> %wide.load102, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load103, ptr %20, align 16, !tbaa !5
%index.next104 = add nuw i64 %index101, 8
%21 = icmp eq i64 %index.next104, %n.vec97
br i1 %21, label %middle.block92, label %vector.body100, !llvm.loop !15
middle.block92: ; preds = %vector.body100
%cmp.n99 = icmp eq i64 %n.vec97, %wide.trip.count79
br i1 %cmp.n99, label %for.end14, label %for.body6.preheader105
for.body6.preheader105: ; preds = %vector.memcheck90, %for.body6.preheader, %middle.block92
%indvars.iv75.ph = phi i64 [ 0, %vector.memcheck90 ], [ 0, %for.body6.preheader ], [ %n.vec97, %middle.block92 ]
%22 = xor i64 %indvars.iv75.ph, -1
%23 = add nsw i64 %22, %wide.trip.count79
%xtraiter107 = and i64 %wide.trip.count79, 3
%lcmp.mod108.not = icmp eq i64 %xtraiter107, 0
br i1 %lcmp.mod108.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader105, %for.body6.prol
%indvars.iv75.prol = phi i64 [ %indvars.iv.next76.prol, %for.body6.prol ], [ %indvars.iv75.ph, %for.body6.preheader105 ]
%prol.iter109 = phi i64 [ %prol.iter109.next, %for.body6.prol ], [ 0, %for.body6.preheader105 ]
%gep87.prol = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv75.prol
%24 = load i32, ptr %gep87.prol, align 4, !tbaa !5
%arrayidx11.prol = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv75.prol
store i32 %24, ptr %arrayidx11.prol, align 4, !tbaa !5
%indvars.iv.next76.prol = add nuw nsw i64 %indvars.iv75.prol, 1
%prol.iter109.next = add i64 %prol.iter109, 1
%prol.iter109.cmp.not = icmp eq i64 %prol.iter109.next, %xtraiter107
br i1 %prol.iter109.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !16
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader105
%indvars.iv75.unr = phi i64 [ %indvars.iv75.ph, %for.body6.preheader105 ], [ %indvars.iv.next76.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%26 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv
store i32 %26, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i32, ptr %gep.1, align 4, !tbaa !5
%arrayidx3.1 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.next
store i32 %27, ptr %arrayidx3.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i32, ptr %gep.2, align 4, !tbaa !5
%arrayidx3.2 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.next.1
store i32 %28, ptr %arrayidx3.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i32, ptr %gep.3, align 4, !tbaa !5
%arrayidx3.3 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.next.2
store i32 %29, ptr %arrayidx3.3, align 4, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !17
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv75 = phi i64 [ %indvars.iv.next76.3, %for.body6 ], [ %indvars.iv75.unr, %for.body6.prol.loopexit ]
%gep87 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv75
%30 = load i32, ptr %gep87, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv75
store i32 %30, ptr %arrayidx11, align 4, !tbaa !5
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%gep87.1 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv.next76
%31 = load i32, ptr %gep87.1, align 4, !tbaa !5
%arrayidx11.1 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv.next76
store i32 %31, ptr %arrayidx11.1, align 4, !tbaa !5
%indvars.iv.next76.1 = add nuw nsw i64 %indvars.iv75, 2
%gep87.2 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv.next76.1
%32 = load i32, ptr %gep87.2, align 4, !tbaa !5
%arrayidx11.2 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv.next76.1
store i32 %32, ptr %arrayidx11.2, align 4, !tbaa !5
%indvars.iv.next76.2 = add nuw nsw i64 %indvars.iv75, 3
%gep87.3 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv.next76.2
%33 = load i32, ptr %gep87.3, align 4, !tbaa !5
%arrayidx11.3 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv.next76.2
store i32 %33, ptr %arrayidx11.3, align 4, !tbaa !5
%indvars.iv.next76.3 = add nuw nsw i64 %indvars.iv75, 4
%exitcond80.not.3 = icmp eq i64 %indvars.iv.next76.3, %wide.trip.count79
br i1 %exitcond80.not.3, label %for.end14, label %for.body6, !llvm.loop !18
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block92, %for.cond4.preheader
%idxprom15 = sext i32 %sub1 to i64
%arrayidx16 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %idxprom15
store i32 1000000000, ptr %arrayidx16, align 4, !tbaa !5
%idxprom17 = sext i32 %sub to i64
%arrayidx18 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %idxprom17
store i32 1000000000, ptr %arrayidx18, align 4, !tbaa !5
%cmp2069 = icmp slt i32 %left, %right
br i1 %cmp2069, label %for.body21.preheader, label %for.end40
for.body21.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count84 = sext i32 %right to i64
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv81 = phi i64 [ %34, %for.body21.preheader ], [ %indvars.iv.next82, %for.body21 ]
%i.272 = phi i32 [ 0, %for.body21.preheader ], [ %i.3, %for.body21 ]
%j.071 = phi i32 [ 0, %for.body21.preheader ], [ %j.1, %for.body21 ]
%35 = load i32, ptr @c, align 4, !tbaa !5
%inc22 = add nsw i32 %35, 1
store i32 %inc22, ptr @c, align 4, !tbaa !5
%idxprom23 = zext i32 %i.272 to i64
%arrayidx24 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %idxprom23
%36 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = zext i32 %j.071 to i64
%arrayidx26 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %idxprom25
%37 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp sgt i32 %36, %37
%.sink = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%inc33 = zext i1 %cmp27.not to i32
%j.1 = add nuw nsw i32 %j.071, %inc33
%not.cmp27.not = xor i1 %cmp27.not, true
%inc28 = zext i1 %not.cmp27.not to i32
%i.3 = add nuw nsw i32 %i.272, %inc28
%38 = getelementptr inbounds i32, ptr %e, i64 %indvars.iv81
store i32 %.sink, ptr %38, align 4
%indvars.iv.next82 = add nsw i64 %indvars.iv81, 1
%exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
br i1 %exitcond85.not, label %for.end40, label %for.body21, !llvm.loop !19
for.end40: ; preds = %for.body21, %for.end14
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %e, i32 noundef %n, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 {
entry:
%e14 = ptrtoint ptr %e to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %e, i32 noundef %n, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %e, i32 noundef %n, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp65.i = icmp sgt i32 %sub.i, 0
br i1 %cmp65.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr i32, ptr %e, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 12
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %e14
%3 = sub i64 ptrtoint (ptr @Left to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr i32, ptr %invariant.gep.i, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load15 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load15, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i32, ptr %gep.i.prol, align 4, !tbaa !5
%arrayidx3.i.prol = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.i.prol
store i32 %11, ptr %arrayidx3.i.prol, align 4, !tbaa !5
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !21
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp567.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp567.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count79.i = zext i32 %sub1.i to i64
%invariant.gep86.i = getelementptr i32, ptr %e, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 12
br i1 %min.iters.check20, label %for.body6.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %e14
%16 = sub i64 ptrtoint (ptr @Right to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body6.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count79.i, 4294967288
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr i32, ptr %invariant.gep86.i, i64 %index27
%wide.load28 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load29 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %index27
store <4 x i32> %wide.load28, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load29, ptr %20, align 16, !tbaa !5
%index.next30 = add nuw i64 %index27, 8
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !22
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count79.i
br i1 %cmp.n25, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck16, %for.body6.preheader.i, %middle.block18
%indvars.iv75.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body6.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv75.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count79.i
%xtraiter31 = and i64 %wide.trip.count79.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv75.i.prol = phi i64 [ %indvars.iv.next76.i.prol, %for.body6.i.prol ], [ %indvars.iv75.i.ph, %for.body6.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%gep87.i.prol = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv75.i.prol
%24 = load i32, ptr %gep87.i.prol, align 4, !tbaa !5
%arrayidx11.i.prol = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv75.i.prol
store i32 %24, ptr %arrayidx11.i.prol, align 4, !tbaa !5
%indvars.iv.next76.i.prol = add nuw nsw i64 %indvars.iv75.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !23
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv75.i.unr = phi i64 [ %indvars.iv75.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next76.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i32, ptr %gep.i, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.i
store i32 %26, ptr %arrayidx3.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i32, ptr %gep.i.1, align 4, !tbaa !5
%arrayidx3.i.1 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.next.i
store i32 %27, ptr %arrayidx3.i.1, align 4, !tbaa !5
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i32, ptr %gep.i.2, align 4, !tbaa !5
%arrayidx3.i.2 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.next.i.1
store i32 %28, ptr %arrayidx3.i.2, align 4, !tbaa !5
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i32, ptr %gep.i.3, align 4, !tbaa !5
%arrayidx3.i.3 = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %indvars.iv.next.i.2
store i32 %29, ptr %arrayidx3.i.3, align 4, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !24
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv75.i = phi i64 [ %indvars.iv.next76.i.3, %for.body6.i ], [ %indvars.iv75.i.unr, %for.body6.i.prol.loopexit ]
%gep87.i = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv75.i
%30 = load i32, ptr %gep87.i, align 4, !tbaa !5
%arrayidx11.i = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv75.i
store i32 %30, ptr %arrayidx11.i, align 4, !tbaa !5
%indvars.iv.next76.i = add nuw nsw i64 %indvars.iv75.i, 1
%gep87.i.1 = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv.next76.i
%31 = load i32, ptr %gep87.i.1, align 4, !tbaa !5
%arrayidx11.i.1 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv.next76.i
store i32 %31, ptr %arrayidx11.i.1, align 4, !tbaa !5
%indvars.iv.next76.i.1 = add nuw nsw i64 %indvars.iv75.i, 2
%gep87.i.2 = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv.next76.i.1
%32 = load i32, ptr %gep87.i.2, align 4, !tbaa !5
%arrayidx11.i.2 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv.next76.i.1
store i32 %32, ptr %arrayidx11.i.2, align 4, !tbaa !5
%indvars.iv.next76.i.2 = add nuw nsw i64 %indvars.iv75.i, 3
%gep87.i.3 = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv.next76.i.2
%33 = load i32, ptr %gep87.i.3, align 4, !tbaa !5
%arrayidx11.i.3 = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %indvars.iv.next76.i.2
store i32 %33, ptr %arrayidx11.i.3, align 4, !tbaa !5
%indvars.iv.next76.i.3 = add nuw nsw i64 %indvars.iv75.i, 4
%exitcond80.not.i.3 = icmp eq i64 %indvars.iv.next76.i.3, %wide.trip.count79.i
br i1 %exitcond80.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !25
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block18, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub1.i to i64
%arrayidx16.i = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %idxprom15.i
store i32 1000000000, ptr %arrayidx16.i, align 4, !tbaa !5
%idxprom17.i = sext i32 %sub.i to i64
%arrayidx18.i = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %idxprom17.i
store i32 1000000000, ptr %arrayidx18.i, align 4, !tbaa !5
%34 = sext i32 %left to i64
%wide.trip.count84.i = sext i32 %right to i64
br label %for.body21.i
for.body21.i: ; preds = %for.body21.i, %for.end14.i
%indvars.iv81.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next82.i, %for.body21.i ]
%i.272.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body21.i ]
%j.071.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body21.i ]
%35 = load i32, ptr @c, align 4, !tbaa !5
%inc22.i = add nsw i32 %35, 1
store i32 %inc22.i, ptr @c, align 4, !tbaa !5
%idxprom23.i = zext i32 %i.272.i to i64
%arrayidx24.i = getelementptr inbounds [250002 x i32], ptr @Left, i64 0, i64 %idxprom23.i
%36 = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%idxprom25.i = zext i32 %j.071.i to i64
%arrayidx26.i = getelementptr inbounds [250002 x i32], ptr @Right, i64 0, i64 %idxprom25.i
%37 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%cmp27.not.i = icmp sgt i32 %36, %37
%.sink.i = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%inc33.i = zext i1 %cmp27.not.i to i32
%j.1.i = add nuw nsw i32 %j.071.i, %inc33.i
%not.cmp27.not.i = xor i1 %cmp27.not.i, true
%inc28.i = zext i1 %not.cmp27.not.i to i32
%i.3.i = add nuw nsw i32 %i.272.i, %inc28.i
%38 = getelementptr inbounds i32, ptr %e, i64 %indvars.iv81.i
store i32 %.sink.i, ptr %38, align 4
%indvars.iv.next82.i = add nsw i64 %indvars.iv81.i, 1
%exitcond85.not.i = icmp eq i64 %indvars.iv.next82.i, %wide.trip.count84.i
br i1 %exitcond85.not.i, label %if.end, label %for.body21.i, !llvm.loop !19
if.end: ; preds = %for.body21.i, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%e = alloca [500000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %e) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !26
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [500000 x i32], ptr %e, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %3, 999999999
br i1 %cmp4, label %cleanup, label %for.cond
for.end: ; preds = %for.cond, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.cond ]
call void @mergeSort(ptr noundef nonnull %e, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp633 = icmp sgt i32 %4, 0
br i1 %cmp633, label %if.end11.peel, label %for.end17
if.end11.peel: ; preds = %for.end
%.pre = load i32, ptr %e, align 16, !tbaa !5
%call14.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp6.peel = icmp sgt i32 %5, 1
br i1 %cmp6.peel, label %if.end11, label %for.end17
if.end11: ; preds = %if.end11.peel, %if.end11
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %if.end11 ], [ 1, %if.end11.peel ]
%putchar29 = call i32 @putchar(i32 32)
%arrayidx13 = getelementptr inbounds [500000 x i32], ptr %e, i64 0, i64 %indvars.iv37
%6 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp6 = icmp slt i64 %indvars.iv.next38, %8
br i1 %cmp6, label %if.end11, label %for.end17, !llvm.loop !27
for.end17: ; preds = %if.end11, %if.end11.peel, %for.end
%putchar = call i32 @putchar(i32 10)
%9 = load i32, ptr @c, align 4, !tbaa !5
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %9)
br label %cleanup
cleanup: ; preds = %for.body, %for.end17
%retval.0 = phi i32 [ 0, %for.end17 ], [ 1, %for.body ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %e) #6
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !10, !11}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !10, !11, !12}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !10, !11}
!25 = distinct !{!25, !10, !11}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10, !28}
!28 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#include <stdlib.h>
/*#include <math.h> INFINITY*/
#define MAX 500000
#define INFINITY 1000000001
void mergeSort(int *, int, int);
void merge(int *, int, int, int);
int L[MAX / 2 + 2], R[MAX / 2 + 2];
int count = 0;
int main(){
int *A, n, i;
scanf("%d",&n);
A = malloc(n * sizeof(int));
for(i = 0; i < n; i++){
scanf("%d",&A[i]);
}
mergeSort(A, 0, n);
for(i = 0; i < n - 1; i++){
printf("%d ",A[i]);
}
printf("%d\n",A[n - 1]);
printf("%d\n",count);
return 0;
}
void mergeSort(int *A, int left, int right){
int mid;
if(left + 1 != right){
mid = (left + right) / 2;
mergeSort(A, left, mid);
mergeSort(A, mid, right);
merge(A, left, mid, right);
}
}
void merge(int *A, int left, int mid, int right){
int i, j, k;
int n1 = mid - left;
int n2 = right - mid;
for(i = 0; i < n1; i++){
L[i] = A[left + i];
}
for(i = 0; i < n2; i++){
R[i] = A[mid + i];
}
L[n1] = INFINITY;
R[n2] = INFINITY;
i = 0;
j = 0;
for(k = left; k < right; k++){
count++;
if(L[i] <= R[j]){
A[k] = L[i++];
}
else{
A[k] = R[j++];
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147496/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147496/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@L = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @mergeSort(ptr noundef %call1, i32 noundef 0, i32 noundef %.lcssa)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp530 = icmp sgt i32 %3, 1
br i1 %cmp530, label %for.body7, label %for.end.for.end13_crit_edge
for.end.for.end13_crit_edge: ; preds = %for.end
%sub29 = add nsw i32 %3, -1
%.pre = sext i32 %sub29 to i64
br label %for.end13
for.body7: ; preds = %for.end, %for.body7
%indvars.iv36 = phi i64 [ %indvars.iv.next37, %for.body7 ], [ 0, %for.end ]
%arrayidx9 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv36
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp5 = icmp slt i64 %indvars.iv.next37, %6
br i1 %cmp5, label %for.body7, label %for.end13, !llvm.loop !11
for.end13: ; preds = %for.body7, %for.end.for.end13_crit_edge
%idxprom15.pre-phi = phi i64 [ %.pre, %for.end.for.end13_crit_edge ], [ %6, %for.body7 ]
%arrayidx16 = getelementptr inbounds i32, ptr %call1, i64 %idxprom15.pre-phi
%7 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%8 = load i32, ptr @count, align 4, !tbaa !5
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #4 {
entry:
%A12 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp.not = icmp eq i32 %add, %right
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp65.i = icmp sgt i32 %sub.i, 0
br i1 %cmp65.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 12
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr i32, ptr %invariant.gep.i, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load13 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load13, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i32, ptr %gep.i.prol, align 4, !tbaa !5
%arrayidx3.i.prol = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.i.prol
store i32 %11, ptr %arrayidx3.i.prol, align 4, !tbaa !5
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !15
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp567.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp567.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count79.i = zext i32 %sub1.i to i64
%invariant.gep86.i = getelementptr i32, ptr %A, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 12
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count79.i, 4294967288
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr i32, ptr %invariant.gep86.i, i64 %index25
%wide.load26 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load27 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %index25
store <4 x i32> %wide.load26, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load27, ptr %20, align 16, !tbaa !5
%index.next28 = add nuw i64 %index25, 8
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !17
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count79.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv75.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv75.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count79.i
%xtraiter29 = and i64 %wide.trip.count79.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv75.i.prol = phi i64 [ %indvars.iv.next76.i.prol, %for.body6.i.prol ], [ %indvars.iv75.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%gep87.i.prol = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv75.i.prol
%24 = load i32, ptr %gep87.i.prol, align 4, !tbaa !5
%arrayidx11.i.prol = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv75.i.prol
store i32 %24, ptr %arrayidx11.i.prol, align 4, !tbaa !5
%indvars.iv.next76.i.prol = add nuw nsw i64 %indvars.iv75.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !18
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv75.i.unr = phi i64 [ %indvars.iv75.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next76.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i32, ptr %gep.i, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.i
store i32 %26, ptr %arrayidx3.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i32, ptr %gep.i.1, align 4, !tbaa !5
%arrayidx3.i.1 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i
store i32 %27, ptr %arrayidx3.i.1, align 4, !tbaa !5
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i32, ptr %gep.i.2, align 4, !tbaa !5
%arrayidx3.i.2 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.1
store i32 %28, ptr %arrayidx3.i.2, align 4, !tbaa !5
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i32, ptr %gep.i.3, align 4, !tbaa !5
%arrayidx3.i.3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.2
store i32 %29, ptr %arrayidx3.i.3, align 4, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !19
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv75.i = phi i64 [ %indvars.iv.next76.i.3, %for.body6.i ], [ %indvars.iv75.i.unr, %for.body6.i.prol.loopexit ]
%gep87.i = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv75.i
%30 = load i32, ptr %gep87.i, align 4, !tbaa !5
%arrayidx11.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv75.i
store i32 %30, ptr %arrayidx11.i, align 4, !tbaa !5
%indvars.iv.next76.i = add nuw nsw i64 %indvars.iv75.i, 1
%gep87.i.1 = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv.next76.i
%31 = load i32, ptr %gep87.i.1, align 4, !tbaa !5
%arrayidx11.i.1 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next76.i
store i32 %31, ptr %arrayidx11.i.1, align 4, !tbaa !5
%indvars.iv.next76.i.1 = add nuw nsw i64 %indvars.iv75.i, 2
%gep87.i.2 = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv.next76.i.1
%32 = load i32, ptr %gep87.i.2, align 4, !tbaa !5
%arrayidx11.i.2 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next76.i.1
store i32 %32, ptr %arrayidx11.i.2, align 4, !tbaa !5
%indvars.iv.next76.i.2 = add nuw nsw i64 %indvars.iv75.i, 3
%gep87.i.3 = getelementptr i32, ptr %invariant.gep86.i, i64 %indvars.iv.next76.i.2
%33 = load i32, ptr %gep87.i.3, align 4, !tbaa !5
%arrayidx11.i.3 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next76.i.2
store i32 %33, ptr %arrayidx11.i.3, align 4, !tbaa !5
%indvars.iv.next76.i.3 = add nuw nsw i64 %indvars.iv75.i, 4
%exitcond80.not.i.3 = icmp eq i64 %indvars.iv.next76.i.3, %wide.trip.count79.i
br i1 %exitcond80.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !20
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub.i to i64
%arrayidx16.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom15.i
store i32 1000000001, ptr %arrayidx16.i, align 4, !tbaa !5
%idxprom17.i = sext i32 %sub1.i to i64
%arrayidx18.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom17.i
store i32 1000000001, ptr %arrayidx18.i, align 4, !tbaa !5
%cmp2069.i = icmp slt i32 %left, %right
br i1 %cmp2069.i, label %for.body21.preheader.i, label %if.end
for.body21.preheader.i: ; preds = %for.end14.i
%34 = sext i32 %left to i64
%wide.trip.count84.i = sext i32 %right to i64
br label %for.body21.i
for.body21.i: ; preds = %for.body21.i, %for.body21.preheader.i
%indvars.iv81.i = phi i64 [ %34, %for.body21.preheader.i ], [ %indvars.iv.next82.i, %for.body21.i ]
%i.272.i = phi i32 [ 0, %for.body21.preheader.i ], [ %i.3.i, %for.body21.i ]
%j.071.i = phi i32 [ 0, %for.body21.preheader.i ], [ %j.1.i, %for.body21.i ]
%35 = load i32, ptr @count, align 4, !tbaa !5
%inc22.i = add nsw i32 %35, 1
store i32 %inc22.i, ptr @count, align 4, !tbaa !5
%idxprom23.i = zext i32 %i.272.i to i64
%arrayidx24.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom23.i
%36 = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%idxprom25.i = zext i32 %j.071.i to i64
%arrayidx26.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom25.i
%37 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%cmp27.not.i = icmp sgt i32 %36, %37
%.sink.i = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%inc33.i = zext i1 %cmp27.not.i to i32
%j.1.i = add nuw nsw i32 %j.071.i, %inc33.i
%not.cmp27.not.i = xor i1 %cmp27.not.i, true
%inc28.i = zext i1 %not.cmp27.not.i to i32
%i.3.i = add nuw nsw i32 %i.272.i, %inc28.i
%38 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv81.i
store i32 %.sink.i, ptr %38, align 4
%indvars.iv.next82.i = add nsw i64 %indvars.iv81.i, 1
%exitcond85.not.i = icmp eq i64 %indvars.iv.next82.i, %wide.trip.count84.i
br i1 %exitcond85.not.i, label %if.end, label %for.body21.i, !llvm.loop !21
if.end: ; preds = %for.body21.i, %for.end14.i, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #4 {
entry:
%A88 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp65 = icmp sgt i32 %sub, 0
br i1 %cmp65, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 12
br i1 %min.iters.check, label %for.body.preheader106, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A88
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader106, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%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 ]
%4 = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load89 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load89, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader106
for.body.preheader106: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader106, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader106 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader106 ]
%gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i32, ptr %gep.prol, align 4, !tbaa !5
%arrayidx3.prol = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.prol
store i32 %11, ptr %arrayidx3.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !23
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader106
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader106 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp567 = icmp sgt i32 %sub1, 0
br i1 %cmp567, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count79 = zext i32 %sub1 to i64
%invariant.gep86 = getelementptr i32, ptr %A, i64 %13
%min.iters.check94 = icmp ult i32 %sub1, 12
br i1 %min.iters.check94, label %for.body6.preheader105, label %vector.memcheck90
vector.memcheck90: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A88
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check91 = icmp ult i64 %16, 32
br i1 %diff.check91, label %for.body6.preheader105, label %vector.ph95
vector.ph95: ; preds = %vector.memcheck90
%n.vec97 = and i64 %wide.trip.count79, 4294967288
br label %vector.body100
vector.body100: ; preds = %vector.body100, %vector.ph95
%index101 = phi i64 [ 0, %vector.ph95 ], [ %index.next104, %vector.body100 ]
%17 = getelementptr i32, ptr %invariant.gep86, i64 %index101
%wide.load102 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load103 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %index101
store <4 x i32> %wide.load102, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load103, ptr %20, align 16, !tbaa !5
%index.next104 = add nuw i64 %index101, 8
%21 = icmp eq i64 %index.next104, %n.vec97
br i1 %21, label %middle.block92, label %vector.body100, !llvm.loop !24
middle.block92: ; preds = %vector.body100
%cmp.n99 = icmp eq i64 %n.vec97, %wide.trip.count79
br i1 %cmp.n99, label %for.end14, label %for.body6.preheader105
for.body6.preheader105: ; preds = %vector.memcheck90, %for.body6.preheader, %middle.block92
%indvars.iv75.ph = phi i64 [ 0, %vector.memcheck90 ], [ 0, %for.body6.preheader ], [ %n.vec97, %middle.block92 ]
%22 = xor i64 %indvars.iv75.ph, -1
%23 = add nsw i64 %22, %wide.trip.count79
%xtraiter107 = and i64 %wide.trip.count79, 3
%lcmp.mod108.not = icmp eq i64 %xtraiter107, 0
br i1 %lcmp.mod108.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader105, %for.body6.prol
%indvars.iv75.prol = phi i64 [ %indvars.iv.next76.prol, %for.body6.prol ], [ %indvars.iv75.ph, %for.body6.preheader105 ]
%prol.iter109 = phi i64 [ %prol.iter109.next, %for.body6.prol ], [ 0, %for.body6.preheader105 ]
%gep87.prol = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv75.prol
%24 = load i32, ptr %gep87.prol, align 4, !tbaa !5
%arrayidx11.prol = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv75.prol
store i32 %24, ptr %arrayidx11.prol, align 4, !tbaa !5
%indvars.iv.next76.prol = add nuw nsw i64 %indvars.iv75.prol, 1
%prol.iter109.next = add i64 %prol.iter109, 1
%prol.iter109.cmp.not = icmp eq i64 %prol.iter109.next, %xtraiter107
br i1 %prol.iter109.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !25
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader105
%indvars.iv75.unr = phi i64 [ %indvars.iv75.ph, %for.body6.preheader105 ], [ %indvars.iv.next76.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%26 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv
store i32 %26, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i32, ptr %gep.1, align 4, !tbaa !5
%arrayidx3.1 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next
store i32 %27, ptr %arrayidx3.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i32, ptr %gep.2, align 4, !tbaa !5
%arrayidx3.2 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.1
store i32 %28, ptr %arrayidx3.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i32, ptr %gep.3, align 4, !tbaa !5
%arrayidx3.3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.2
store i32 %29, ptr %arrayidx3.3, align 4, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !26
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv75 = phi i64 [ %indvars.iv.next76.3, %for.body6 ], [ %indvars.iv75.unr, %for.body6.prol.loopexit ]
%gep87 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv75
%30 = load i32, ptr %gep87, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv75
store i32 %30, ptr %arrayidx11, align 4, !tbaa !5
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%gep87.1 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv.next76
%31 = load i32, ptr %gep87.1, align 4, !tbaa !5
%arrayidx11.1 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next76
store i32 %31, ptr %arrayidx11.1, align 4, !tbaa !5
%indvars.iv.next76.1 = add nuw nsw i64 %indvars.iv75, 2
%gep87.2 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv.next76.1
%32 = load i32, ptr %gep87.2, align 4, !tbaa !5
%arrayidx11.2 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next76.1
store i32 %32, ptr %arrayidx11.2, align 4, !tbaa !5
%indvars.iv.next76.2 = add nuw nsw i64 %indvars.iv75, 3
%gep87.3 = getelementptr i32, ptr %invariant.gep86, i64 %indvars.iv.next76.2
%33 = load i32, ptr %gep87.3, align 4, !tbaa !5
%arrayidx11.3 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next76.2
store i32 %33, ptr %arrayidx11.3, align 4, !tbaa !5
%indvars.iv.next76.3 = add nuw nsw i64 %indvars.iv75, 4
%exitcond80.not.3 = icmp eq i64 %indvars.iv.next76.3, %wide.trip.count79
br i1 %exitcond80.not.3, label %for.end14, label %for.body6, !llvm.loop !27
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block92, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%arrayidx16 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom15
store i32 1000000001, ptr %arrayidx16, align 4, !tbaa !5
%idxprom17 = sext i32 %sub1 to i64
%arrayidx18 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom17
store i32 1000000001, ptr %arrayidx18, align 4, !tbaa !5
%cmp2069 = icmp slt i32 %left, %right
br i1 %cmp2069, label %for.body21.preheader, label %for.end40
for.body21.preheader: ; preds = %for.end14
%34 = sext i32 %left to i64
%wide.trip.count84 = sext i32 %right to i64
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv81 = phi i64 [ %34, %for.body21.preheader ], [ %indvars.iv.next82, %for.body21 ]
%i.272 = phi i32 [ 0, %for.body21.preheader ], [ %i.3, %for.body21 ]
%j.071 = phi i32 [ 0, %for.body21.preheader ], [ %j.1, %for.body21 ]
%35 = load i32, ptr @count, align 4, !tbaa !5
%inc22 = add nsw i32 %35, 1
store i32 %inc22, ptr @count, align 4, !tbaa !5
%idxprom23 = zext i32 %i.272 to i64
%arrayidx24 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom23
%36 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = zext i32 %j.071 to i64
%arrayidx26 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom25
%37 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp sgt i32 %36, %37
%.sink = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%inc33 = zext i1 %cmp27.not to i32
%j.1 = add nuw nsw i32 %j.071, %inc33
%not.cmp27.not = xor i1 %cmp27.not, true
%inc28 = zext i1 %not.cmp27.not to i32
%i.3 = add nuw nsw i32 %i.272, %inc28
%38 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv81
store i32 %.sink, ptr %38, align 4
%indvars.iv.next82 = add nsw i64 %indvars.iv81, 1
%exitcond85.not = icmp eq i64 %indvars.iv.next82, %wide.trip.count84
br i1 %exitcond85.not, label %for.end40, label %for.body21, !llvm.loop !21
for.end40: ; preds = %for.body21, %for.end14
ret void
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10, !13, !14}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !10, !13}
!20 = distinct !{!20, !10, !13}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !13, !14}
!23 = distinct !{!23, !16}
!24 = distinct !{!24, !10, !13, !14}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !10, !13}
!27 = distinct !{!27, !10, !13}
|
#include<stdio.h>
#define INFTY 1000000001
#define N 500000
void merge(int,int,int,int);
void mergeSort(int,int,int);
int S[N],count=0;
int main(){
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
mergeSort(n,0,n);
for(i=0;i<n;i++){
if(i>0) printf(" ");
printf("%d",S[i]);
}
printf("\n");
printf("%d\n",count);
return 0;
}
void merge(int n,int l,int m,int r){
int n1,n2,L[N],R[N],k,i,j;
n1=m-l;
n2=r-m;
for(i=0;i<n1;i++){
L[i]=S[l+i];
}
for(i=0;i<n2;i++){
R[i]=S[m+i];
}
L[n1]=INFTY;
R[n2]=INFTY;
i=0;
j=0;
for(k=l;k<=r-1;k++){
count++;
if(L[i]<=R[j]){
S[k]=L[i];
i=i+1;
}else{
S[k]=R[j];
j=j+1;
}
}
}
void mergeSort(int n,int l,int r){
int m,i;
if(l+1<r){
m=(l+r)/2;
mergeSort(n,l,m);
mergeSort(n,m,r);
merge(n,l,m,r);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147539/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147539/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@S = dso_local global [500000 x i32] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, 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 [500000 x i32], ptr @S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @mergeSort(i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp324 = icmp sgt i32 %3, 0
br i1 %cmp324, label %if.end.peel, label %for.end12
if.end.peel: ; preds = %for.end
%.pre = load i32, ptr @S, align 16, !tbaa !5
%call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.peel = icmp sgt i32 %4, 1
br i1 %cmp3.peel, label %if.end, label %for.end12
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %if.end ], [ 1, %if.end.peel ]
%putchar21 = call i32 @putchar(i32 32)
%arrayidx8 = getelementptr inbounds [500000 x i32], ptr @S, i64 0, i64 %indvars.iv28
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next29, %7
br i1 %cmp3, label %if.end, label %for.end12, !llvm.loop !11
for.end12: ; preds = %if.end, %if.end.peel, %for.end
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr @count, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(i32 noundef %n, i32 noundef %l, i32 noundef %r) local_unnamed_addr #3 {
entry:
%add = add nsw i32 %l, 1
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %if.then, label %common.ret12
common.ret12: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add1 = add nsw i32 %r, %l
%div = sdiv i32 %add1, 2
tail call void @mergeSort(i32 noundef %n, i32 noundef %l, i32 noundef %div)
tail call void @mergeSort(i32 noundef %n, i32 noundef %div, i32 noundef %r)
tail call void @merge(i32 poison, i32 noundef %l, i32 noundef %div, i32 noundef %r)
br label %common.ret12
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @merge(i32 %n, i32 noundef %l, i32 noundef %m, i32 noundef %r) local_unnamed_addr #4 {
entry:
%L = alloca [500000 x i32], align 16
%R = alloca [500000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %L) #8
call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %R) #8
%sub = sub nsw i32 %m, %l
%sub1 = sub nsw i32 %r, %m
%cmp65 = icmp sgt i32 %sub, 0
br i1 %cmp65, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %l to i64
%1 = shl nsw i64 %0, 2
%scevgep = getelementptr i8, ptr @S, i64 %1
%2 = xor i32 %l, -1
%3 = add i32 %2, %m
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 2
%6 = add nuw nsw i64 %5, 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %L, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %6, i1 false), !tbaa !5
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body.preheader, %entry
%cmp567 = icmp sgt i32 %sub1, 0
br i1 %cmp567, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%7 = sext i32 %m to i64
%8 = shl nsw i64 %7, 2
%scevgep77 = getelementptr i8, ptr @S, i64 %8
%9 = xor i32 %m, -1
%10 = add i32 %9, %r
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 2
%13 = add nuw nsw i64 %12, 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %R, ptr noundef nonnull align 4 dereferenceable(1) %scevgep77, i64 %13, i1 false), !tbaa !5
br label %for.end14
for.end14: ; preds = %for.body6.preheader, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%arrayidx16 = getelementptr inbounds [500000 x i32], ptr %L, i64 0, i64 %idxprom15
store i32 1000000001, ptr %arrayidx16, align 4, !tbaa !5
%idxprom17 = sext i32 %sub1 to i64
%arrayidx18 = getelementptr inbounds [500000 x i32], ptr %R, i64 0, i64 %idxprom17
store i32 1000000001, ptr %arrayidx18, align 4, !tbaa !5
%cmp21.not.not70 = icmp slt i32 %l, %r
br i1 %cmp21.not.not70, label %for.body22.preheader, label %for.end41
for.body22.preheader: ; preds = %for.end14
%count.promoted = load i32, ptr @count, align 4, !tbaa !5
%14 = sext i32 %l to i64
%15 = add i32 %count.promoted, %r
%wide.trip.count = sext i32 %r to i64
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv = phi i64 [ %14, %for.body22.preheader ], [ %indvars.iv.next, %for.body22 ]
%j.074 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.body22 ]
%i.273 = phi i32 [ 0, %for.body22.preheader ], [ %i.3, %for.body22 ]
%idxprom24 = zext i32 %i.273 to i64
%arrayidx25 = getelementptr inbounds [500000 x i32], ptr %L, i64 0, i64 %idxprom24
%16 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%idxprom26 = zext i32 %j.074 to i64
%arrayidx27 = getelementptr inbounds [500000 x i32], ptr %R, i64 0, i64 %idxprom26
%17 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28.not = icmp sle i32 %16, %17
%.sink = tail call i32 @llvm.smin.i32(i32 %16, i32 %17)
%add33 = zext i1 %cmp28.not to i32
%i.3 = add nuw nsw i32 %i.273, %add33
%not.cmp28.not = xor i1 %cmp28.not, true
%add38 = zext i1 %not.cmp28.not to i32
%j.1 = add nuw nsw i32 %j.074, %add38
%18 = getelementptr inbounds [500000 x i32], ptr @S, i64 0, i64 %indvars.iv
store i32 %.sink, ptr %18, align 4
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond19.for.end41_crit_edge, label %for.body22, !llvm.loop !13
for.cond19.for.end41_crit_edge: ; preds = %for.body22
%19 = sub i32 %15, %l
store i32 %19, ptr @count, align 4, !tbaa !5
br label %for.end41
for.end41: ; preds = %for.cond19.for.end41_crit_edge, %for.end14
call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %R) #8
call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %L) #8
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(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 #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define INF 2000000000
int L[250002],R[250002];
int cnt=0;
void merge(int A[],int n,int l, int m, int r){
int i,j,k,n1,n2;
n1 = m - l;
n2 = r - m;
for (i = 0; i < n1; i++) {
L[i] = A[l + i];
}
for (i = 0; i < n2; i++) {
R[i] = A[m + i];
}
L[n1] = INF;
R[n2] = INF;
i = 0, j = 0;
for (k = l; k < r; k++) {
cnt++;
if (L[i] <= R[j]) {
A[k] = L[i];
i++;
}
else{
A[k] = R[j];
j++;
}
}
}
void mergesort(int A[],int n,int l,int r){
int m;
if (l+1 < r) {
m = (l + r)/2;
mergesort(A,n,l,m);
mergesort(A,n,m,r);
merge(A,n,l,m,r);
}
}
int main() {
int i,n,A[500000];
scanf("%d",&n);
for (i = 0; i < n; i++) {
scanf("%d",&A[i]);
}
mergesort(A,n,0,n);
for (i = 0; i < n; i++) {
if (i > 0) printf(" ");
printf("%d",A[i]);
}
printf("\n");
printf("%d\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_147582/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_147582/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@L = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [250002 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %l, i32 noundef %m, i32 noundef %r) local_unnamed_addr #0 {
entry:
%A90 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %m, %l
%sub1 = sub i32 %r, %m
%cmp67 = icmp sgt i32 %sub, 0
br i1 %cmp67, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %l to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 12
br i1 %min.iters.check, label %for.body.preheader108, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A90
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader108, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%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 ]
%4 = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load91 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load91, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader108
for.body.preheader108: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader108, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader108 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader108 ]
%gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i32, ptr %gep.prol, align 4, !tbaa !5
%arrayidx3.prol = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.prol
store i32 %11, ptr %arrayidx3.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !13
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader108
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader108 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp569 = icmp sgt i32 %sub1, 0
br i1 %cmp569, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %m to i64
%wide.trip.count81 = zext i32 %sub1 to i64
%invariant.gep88 = getelementptr i32, ptr %A, i64 %13
%min.iters.check96 = icmp ult i32 %sub1, 12
br i1 %min.iters.check96, label %for.body6.preheader107, label %vector.memcheck92
vector.memcheck92: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A90
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check93 = icmp ult i64 %16, 32
br i1 %diff.check93, label %for.body6.preheader107, label %vector.ph97
vector.ph97: ; preds = %vector.memcheck92
%n.vec99 = and i64 %wide.trip.count81, 4294967288
br label %vector.body102
vector.body102: ; preds = %vector.body102, %vector.ph97
%index103 = phi i64 [ 0, %vector.ph97 ], [ %index.next106, %vector.body102 ]
%17 = getelementptr i32, ptr %invariant.gep88, i64 %index103
%wide.load104 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load105 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %index103
store <4 x i32> %wide.load104, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load105, ptr %20, align 16, !tbaa !5
%index.next106 = add nuw i64 %index103, 8
%21 = icmp eq i64 %index.next106, %n.vec99
br i1 %21, label %middle.block94, label %vector.body102, !llvm.loop !15
middle.block94: ; preds = %vector.body102
%cmp.n101 = icmp eq i64 %n.vec99, %wide.trip.count81
br i1 %cmp.n101, label %for.end14, label %for.body6.preheader107
for.body6.preheader107: ; preds = %vector.memcheck92, %for.body6.preheader, %middle.block94
%indvars.iv77.ph = phi i64 [ 0, %vector.memcheck92 ], [ 0, %for.body6.preheader ], [ %n.vec99, %middle.block94 ]
%22 = xor i64 %indvars.iv77.ph, -1
%23 = add nsw i64 %22, %wide.trip.count81
%xtraiter109 = and i64 %wide.trip.count81, 3
%lcmp.mod110.not = icmp eq i64 %xtraiter109, 0
br i1 %lcmp.mod110.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader107, %for.body6.prol
%indvars.iv77.prol = phi i64 [ %indvars.iv.next78.prol, %for.body6.prol ], [ %indvars.iv77.ph, %for.body6.preheader107 ]
%prol.iter111 = phi i64 [ %prol.iter111.next, %for.body6.prol ], [ 0, %for.body6.preheader107 ]
%gep89.prol = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv77.prol
%24 = load i32, ptr %gep89.prol, align 4, !tbaa !5
%arrayidx11.prol = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77.prol
store i32 %24, ptr %arrayidx11.prol, align 4, !tbaa !5
%indvars.iv.next78.prol = add nuw nsw i64 %indvars.iv77.prol, 1
%prol.iter111.next = add i64 %prol.iter111, 1
%prol.iter111.cmp.not = icmp eq i64 %prol.iter111.next, %xtraiter109
br i1 %prol.iter111.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !16
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader107
%indvars.iv77.unr = phi i64 [ %indvars.iv77.ph, %for.body6.preheader107 ], [ %indvars.iv.next78.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%26 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv
store i32 %26, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i32, ptr %gep.1, align 4, !tbaa !5
%arrayidx3.1 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next
store i32 %27, ptr %arrayidx3.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i32, ptr %gep.2, align 4, !tbaa !5
%arrayidx3.2 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.1
store i32 %28, ptr %arrayidx3.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i32, ptr %gep.3, align 4, !tbaa !5
%arrayidx3.3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.2
store i32 %29, ptr %arrayidx3.3, align 4, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !17
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv77 = phi i64 [ %indvars.iv.next78.3, %for.body6 ], [ %indvars.iv77.unr, %for.body6.prol.loopexit ]
%gep89 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv77
%30 = load i32, ptr %gep89, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77
store i32 %30, ptr %arrayidx11, align 4, !tbaa !5
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%gep89.1 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv.next78
%31 = load i32, ptr %gep89.1, align 4, !tbaa !5
%arrayidx11.1 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78
store i32 %31, ptr %arrayidx11.1, align 4, !tbaa !5
%indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 2
%gep89.2 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv.next78.1
%32 = load i32, ptr %gep89.2, align 4, !tbaa !5
%arrayidx11.2 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.1
store i32 %32, ptr %arrayidx11.2, align 4, !tbaa !5
%indvars.iv.next78.2 = add nuw nsw i64 %indvars.iv77, 3
%gep89.3 = getelementptr i32, ptr %invariant.gep88, i64 %indvars.iv.next78.2
%33 = load i32, ptr %gep89.3, align 4, !tbaa !5
%arrayidx11.3 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.2
store i32 %33, ptr %arrayidx11.3, align 4, !tbaa !5
%indvars.iv.next78.3 = add nuw nsw i64 %indvars.iv77, 4
%exitcond82.not.3 = icmp eq i64 %indvars.iv.next78.3, %wide.trip.count81
br i1 %exitcond82.not.3, label %for.end14, label %for.body6, !llvm.loop !18
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block94, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%arrayidx16 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom15
store i32 2000000000, ptr %arrayidx16, align 4, !tbaa !5
%idxprom17 = sext i32 %sub1 to i64
%arrayidx18 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom17
store i32 2000000000, ptr %arrayidx18, align 4, !tbaa !5
%cmp2071 = icmp slt i32 %l, %r
br i1 %cmp2071, label %for.body21.preheader, label %for.end40
for.body21.preheader: ; preds = %for.end14
%34 = sext i32 %l to i64
%wide.trip.count86 = sext i32 %r to i64
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv83 = phi i64 [ %34, %for.body21.preheader ], [ %indvars.iv.next84, %for.body21 ]
%i.274 = phi i32 [ 0, %for.body21.preheader ], [ %i.3, %for.body21 ]
%j.073 = phi i32 [ 0, %for.body21.preheader ], [ %j.1, %for.body21 ]
%35 = load i32, ptr @cnt, align 4, !tbaa !5
%inc22 = add nsw i32 %35, 1
store i32 %inc22, ptr @cnt, align 4, !tbaa !5
%idxprom23 = zext i32 %i.274 to i64
%arrayidx24 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom23
%36 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = zext i32 %j.073 to i64
%arrayidx26 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom25
%37 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp sgt i32 %36, %37
%.sink = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%inc37 = zext i1 %cmp27.not to i32
%j.1 = add nuw nsw i32 %j.073, %inc37
%not.cmp27.not = xor i1 %cmp27.not, true
%inc32 = zext i1 %not.cmp27.not to i32
%i.3 = add nuw nsw i32 %i.274, %inc32
%38 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv83
store i32 %.sink, ptr %38, align 4
%indvars.iv.next84 = add nsw i64 %indvars.iv83, 1
%exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86
br i1 %exitcond87.not, label %for.end40, label %for.body21, !llvm.loop !19
for.end40: ; preds = %for.body21, %for.end14
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergesort(ptr noundef %A, i32 noundef %n, i32 noundef %l, i32 noundef %r) local_unnamed_addr #0 {
entry:
%A14 = ptrtoint ptr %A to i64
%add = add nsw i32 %l, 1
%cmp = icmp slt i32 %add, %r
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %r, %l
%div = sdiv i32 %add1, 2
tail call void @mergesort(ptr noundef %A, i32 noundef %n, i32 noundef %l, i32 noundef %div)
tail call void @mergesort(ptr noundef %A, i32 noundef %n, i32 noundef %div, i32 noundef %r)
%sub.i = sub nsw i32 %div, %l
%sub1.i = sub i32 %r, %div
%cmp67.i = icmp sgt i32 %sub.i, 0
br i1 %cmp67.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %l to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 12
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A14
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr i32, ptr %invariant.gep.i, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load15 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load15, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i32, ptr %gep.i.prol, align 4, !tbaa !5
%arrayidx3.i.prol = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.i.prol
store i32 %11, ptr %arrayidx3.i.prol, align 4, !tbaa !5
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !21
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp569.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp569.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count81.i = zext i32 %sub1.i to i64
%invariant.gep88.i = getelementptr i32, ptr %A, i64 %13
%min.iters.check20 = icmp ult i32 %sub1.i, 12
br i1 %min.iters.check20, label %for.body6.i.preheader, label %vector.memcheck16
vector.memcheck16: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A14
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check17 = icmp ult i64 %16, 32
br i1 %diff.check17, label %for.body6.i.preheader, label %vector.ph21
vector.ph21: ; preds = %vector.memcheck16
%n.vec23 = and i64 %wide.trip.count81.i, 4294967288
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next30, %vector.body26 ]
%17 = getelementptr i32, ptr %invariant.gep88.i, i64 %index27
%wide.load28 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load29 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %index27
store <4 x i32> %wide.load28, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load29, ptr %20, align 16, !tbaa !5
%index.next30 = add nuw i64 %index27, 8
%21 = icmp eq i64 %index.next30, %n.vec23
br i1 %21, label %middle.block18, label %vector.body26, !llvm.loop !22
middle.block18: ; preds = %vector.body26
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count81.i
br i1 %cmp.n25, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck16, %for.body6.preheader.i, %middle.block18
%indvars.iv77.i.ph = phi i64 [ 0, %vector.memcheck16 ], [ 0, %for.body6.preheader.i ], [ %n.vec23, %middle.block18 ]
%22 = xor i64 %indvars.iv77.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count81.i
%xtraiter31 = and i64 %wide.trip.count81.i, 3
%lcmp.mod32.not = icmp eq i64 %xtraiter31, 0
br i1 %lcmp.mod32.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv77.i.prol = phi i64 [ %indvars.iv.next78.i.prol, %for.body6.i.prol ], [ %indvars.iv77.i.ph, %for.body6.i.preheader ]
%prol.iter33 = phi i64 [ %prol.iter33.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%gep89.i.prol = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv77.i.prol
%24 = load i32, ptr %gep89.i.prol, align 4, !tbaa !5
%arrayidx11.i.prol = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77.i.prol
store i32 %24, ptr %arrayidx11.i.prol, align 4, !tbaa !5
%indvars.iv.next78.i.prol = add nuw nsw i64 %indvars.iv77.i.prol, 1
%prol.iter33.next = add i64 %prol.iter33, 1
%prol.iter33.cmp.not = icmp eq i64 %prol.iter33.next, %xtraiter31
br i1 %prol.iter33.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !23
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv77.i.unr = phi i64 [ %indvars.iv77.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next78.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i32, ptr %gep.i, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.i
store i32 %26, ptr %arrayidx3.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i32, ptr %gep.i.1, align 4, !tbaa !5
%arrayidx3.i.1 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i
store i32 %27, ptr %arrayidx3.i.1, align 4, !tbaa !5
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i32, ptr %gep.i.2, align 4, !tbaa !5
%arrayidx3.i.2 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.1
store i32 %28, ptr %arrayidx3.i.2, align 4, !tbaa !5
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i32, ptr %gep.i.3, align 4, !tbaa !5
%arrayidx3.i.3 = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.2
store i32 %29, ptr %arrayidx3.i.3, align 4, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !24
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv77.i = phi i64 [ %indvars.iv.next78.i.3, %for.body6.i ], [ %indvars.iv77.i.unr, %for.body6.i.prol.loopexit ]
%gep89.i = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv77.i
%30 = load i32, ptr %gep89.i, align 4, !tbaa !5
%arrayidx11.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv77.i
store i32 %30, ptr %arrayidx11.i, align 4, !tbaa !5
%indvars.iv.next78.i = add nuw nsw i64 %indvars.iv77.i, 1
%gep89.i.1 = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i
%31 = load i32, ptr %gep89.i.1, align 4, !tbaa !5
%arrayidx11.i.1 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.i
store i32 %31, ptr %arrayidx11.i.1, align 4, !tbaa !5
%indvars.iv.next78.i.1 = add nuw nsw i64 %indvars.iv77.i, 2
%gep89.i.2 = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i.1
%32 = load i32, ptr %gep89.i.2, align 4, !tbaa !5
%arrayidx11.i.2 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.i.1
store i32 %32, ptr %arrayidx11.i.2, align 4, !tbaa !5
%indvars.iv.next78.i.2 = add nuw nsw i64 %indvars.iv77.i, 3
%gep89.i.3 = getelementptr i32, ptr %invariant.gep88.i, i64 %indvars.iv.next78.i.2
%33 = load i32, ptr %gep89.i.3, align 4, !tbaa !5
%arrayidx11.i.3 = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %indvars.iv.next78.i.2
store i32 %33, ptr %arrayidx11.i.3, align 4, !tbaa !5
%indvars.iv.next78.i.3 = add nuw nsw i64 %indvars.iv77.i, 4
%exitcond82.not.i.3 = icmp eq i64 %indvars.iv.next78.i.3, %wide.trip.count81.i
br i1 %exitcond82.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !25
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block18, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub.i to i64
%arrayidx16.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom15.i
store i32 2000000000, ptr %arrayidx16.i, align 4, !tbaa !5
%idxprom17.i = sext i32 %sub1.i to i64
%arrayidx18.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom17.i
store i32 2000000000, ptr %arrayidx18.i, align 4, !tbaa !5
%34 = sext i32 %l to i64
%wide.trip.count86.i = sext i32 %r to i64
br label %for.body21.i
for.body21.i: ; preds = %for.body21.i, %for.end14.i
%indvars.iv83.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next84.i, %for.body21.i ]
%i.274.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.body21.i ]
%j.073.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.body21.i ]
%35 = load i32, ptr @cnt, align 4, !tbaa !5
%inc22.i = add nsw i32 %35, 1
store i32 %inc22.i, ptr @cnt, align 4, !tbaa !5
%idxprom23.i = zext i32 %i.274.i to i64
%arrayidx24.i = getelementptr inbounds [250002 x i32], ptr @L, i64 0, i64 %idxprom23.i
%36 = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%idxprom25.i = zext i32 %j.073.i to i64
%arrayidx26.i = getelementptr inbounds [250002 x i32], ptr @R, i64 0, i64 %idxprom25.i
%37 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%cmp27.not.i = icmp sgt i32 %36, %37
%.sink.i = tail call i32 @llvm.smin.i32(i32 %36, i32 %37)
%inc37.i = zext i1 %cmp27.not.i to i32
%j.1.i = add nuw nsw i32 %j.073.i, %inc37.i
%not.cmp27.not.i = xor i1 %cmp27.not.i, true
%inc32.i = zext i1 %not.cmp27.not.i to i32
%i.3.i = add nuw nsw i32 %i.274.i, %inc32.i
%38 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv83.i
store i32 %.sink.i, ptr %38, align 4
%indvars.iv.next84.i = add nsw i64 %indvars.iv83.i, 1
%exitcond87.not.i = icmp eq i64 %indvars.iv.next84.i, %wide.trip.count86.i
br i1 %exitcond87.not.i, label %if.end, label %for.body21.i, !llvm.loop !19
if.end: ; preds = %for.body21.i, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [500000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %A) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, 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 [500000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !26
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @mergesort(ptr noundef nonnull %A, i32 noundef %.lcssa, i32 noundef 0, i32 noundef %.lcssa)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp324 = icmp sgt i32 %3, 0
br i1 %cmp324, label %if.end.peel, label %for.end12
if.end.peel: ; preds = %for.end
%.pre = load i32, ptr %A, align 16, !tbaa !5
%call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.peel = icmp sgt i32 %4, 1
br i1 %cmp3.peel, label %if.end, label %for.end12
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %if.end ], [ 1, %if.end.peel ]
%putchar21 = call i32 @putchar(i32 32)
%arrayidx8 = getelementptr inbounds [500000 x i32], ptr %A, i64 0, i64 %indvars.iv28
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next29, %7
br i1 %cmp3, label %if.end, label %for.end12, !llvm.loop !27
for.end12: ; preds = %if.end, %if.end.peel, %for.end
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr @cnt, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %8)
call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %A) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !10, !11}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !10, !11, !12}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !10, !11}
!25 = distinct !{!25, !10, !11}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10, !28}
!28 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int main(){
int t,n;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
for(int u=1;u<=n;u++){
int x=n;
int y=n;
while(x>0){
for(int i=1;i<=u&&x>0;i++){
printf("(");
x--;
}
printf(")");
y--;
}
for(int j=1;j<=y;j++){
printf(")");
}
printf("\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14764/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14764/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec46 = add nsw i32 %0, -1
store i32 %dec46, ptr %t, align 4, !tbaa !5
%tobool.not47 = icmp eq i32 %0, 0
br i1 %tobool.not47, label %while.end26, label %while.body
while.cond.loopexit: ; preds = %for.cond.cleanup16, %while.body
%1 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %while.end26, label %while.body, !llvm.loop !9
while.body: ; preds = %entry, %while.cond.loopexit
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not44 = icmp slt i32 %2, 1
br i1 %cmp.not44, label %while.cond.loopexit, label %while.cond2.preheader
while.cond2.preheader: ; preds = %while.body, %for.cond.cleanup16
%3 = phi i32 [ %5, %for.cond.cleanup16 ], [ %2, %while.body ]
%u.045 = phi i32 [ %inc24, %for.cond.cleanup16 ], [ 1, %while.body ]
%cmp339 = icmp sgt i32 %3, 0
br i1 %cmp339, label %for.cond5.preheader, label %for.cond.cleanup16
for.cond14.preheader: ; preds = %for.cond.cleanup8
%cmp15.not42 = icmp slt i32 %y.041, 2
br i1 %cmp15.not42, label %for.cond.cleanup16, label %for.body17
for.cond5.preheader: ; preds = %while.cond2.preheader, %for.cond.cleanup8
%y.041 = phi i32 [ %dec13, %for.cond.cleanup8 ], [ %3, %while.cond2.preheader ]
%x.040 = phi i32 [ %dec11, %for.cond.cleanup8 ], [ %3, %while.cond2.preheader ]
br label %for.body9
for.cond.cleanup8: ; preds = %for.body9
%putchar35 = call i32 @putchar(i32 41)
%dec13 = add nsw i32 %y.041, -1
%cmp3 = icmp sgt i32 %x.137, 1
br i1 %cmp3, label %for.cond5.preheader, label %for.cond14.preheader, !llvm.loop !11
for.body9: ; preds = %for.cond5.preheader, %for.body9
%i.038 = phi i32 [ 1, %for.cond5.preheader ], [ %inc, %for.body9 ]
%x.137 = phi i32 [ %x.040, %for.cond5.preheader ], [ %dec11, %for.body9 ]
%putchar36 = call i32 @putchar(i32 40)
%dec11 = add nsw i32 %x.137, -1
%inc = add nuw nsw i32 %i.038, 1
%cmp6 = icmp ult i32 %i.038, %u.045
%cmp7 = icmp ne i32 %dec11, 0
%4 = select i1 %cmp6, i1 %cmp7, i1 false
br i1 %4, label %for.body9, label %for.cond.cleanup8, !llvm.loop !12
for.cond.cleanup16: ; preds = %for.body17, %while.cond2.preheader, %for.cond14.preheader
%putchar = call i32 @putchar(i32 10)
%inc24 = add nuw nsw i32 %u.045, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %u.045, %5
br i1 %cmp.not.not, label %while.cond2.preheader, label %while.cond.loopexit, !llvm.loop !13
for.body17: ; preds = %for.cond14.preheader, %for.body17
%j.043 = phi i32 [ %inc20, %for.body17 ], [ 1, %for.cond14.preheader ]
%putchar34 = call i32 @putchar(i32 41)
%inc20 = add nuw i32 %j.043, 1
%exitcond.not = icmp eq i32 %j.043, %dec13
br i1 %exitcond.not, label %for.cond.cleanup16, label %for.body17, !llvm.loop !14
while.end26: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
Subsets and Splits