Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int main(void) {
int a, b, c, d, e, k;
scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e,&k);
if (b - a <= k) {
if (c - a <= k) {
if (d - a <= k) {
if (e - a <= k) {
if (c - b <= k) {
if (d - b <= k) {
if (e - b <= k) {
if (d - c <= k) {
if (e - c <= k) {
if (e - d <= k) {
printf("Yay!\n");
return 0;
}
}
}
}
}
}
}
}
}
}
printf(":(\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202560/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202560/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d%d%d%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c":(\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %k)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %sub, %2
br i1 %cmp.not, label %if.end37, label %if.then
if.then: ; preds = %entry
%3 = load i32, ptr %c, align 4, !tbaa !5
%sub1 = sub nsw i32 %3, %1
%cmp2.not = icmp sgt i32 %sub1, %2
br i1 %cmp2.not, label %if.end37, label %if.then3
if.then3: ; preds = %if.then
%4 = load i32, ptr %d, align 4, !tbaa !5
%sub4 = sub nsw i32 %4, %1
%cmp5.not = icmp sgt i32 %sub4, %2
br i1 %cmp5.not, label %if.end37, label %if.then6
if.then6: ; preds = %if.then3
%5 = load i32, ptr %e, align 4, !tbaa !5
%sub7 = sub nsw i32 %5, %1
%cmp8.not = icmp sgt i32 %sub7, %2
%sub10 = sub nsw i32 %3, %0
%cmp11.not = icmp sgt i32 %sub10, %2
%or.cond = select i1 %cmp8.not, i1 true, i1 %cmp11.not
%sub13 = sub nsw i32 %4, %0
%cmp14.not = icmp sgt i32 %sub13, %2
%or.cond45 = select i1 %or.cond, i1 true, i1 %cmp14.not
%sub16 = sub nsw i32 %5, %0
%cmp17.not = icmp sgt i32 %sub16, %2
%or.cond46 = select i1 %or.cond45, i1 true, i1 %cmp17.not
%sub19 = sub nsw i32 %4, %3
%cmp20.not = icmp sgt i32 %sub19, %2
%or.cond47 = select i1 %or.cond46, i1 true, i1 %cmp20.not
%sub22 = sub nsw i32 %5, %3
%cmp23.not = icmp sgt i32 %sub22, %2
%or.cond48 = select i1 %or.cond47, i1 true, i1 %cmp23.not
%sub25 = sub nsw i32 %5, %4
%cmp26.not = icmp sgt i32 %sub25, %2
%or.cond49 = select i1 %or.cond48, i1 true, i1 %cmp26.not
br i1 %or.cond49, label %if.end37, label %cleanup
if.end37: ; preds = %if.then, %if.then6, %if.then3, %entry
br label %cleanup
cleanup: ; preds = %if.then6, %if.end37
%str.sink = phi ptr [ @str, %if.end37 ], [ @str.3, %if.then6 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 i;
int A[5];
int k;
int count=0;
for(i=0;i<5;++i){
scanf("%d", &A[i]);
}
scanf("%d", &k);
for(i=4;i>=0;--i){
for(int j=0;j<5;++j){
if(A[i]-A[j] <= k){continue;}else{printf(":(");return 0;}
}
}
printf("Yay!");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202603/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202603/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [5 x i32], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%arrayidx.1 = getelementptr inbounds [5 x i32], ptr %A, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [5 x i32], ptr %A, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [5 x i32], ptr %A, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [5 x i32], ptr %A, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%2 = load i32, ptr %A, align 16, !tbaa !5
%sub = sub nsw i32 %1, %2
%cmp12.not = icmp sgt i32 %sub, %0
br i1 %cmp12.not, label %if.else, label %for.cond5
for.cond5: ; preds = %entry
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%sub.1 = sub nsw i32 %1, %3
%cmp12.not.1 = icmp sgt i32 %sub.1, %0
br i1 %cmp12.not.1, label %if.else, label %for.cond5.1
for.cond5.1: ; preds = %for.cond5
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%sub.2 = sub nsw i32 %1, %4
%cmp12.not.2 = icmp sgt i32 %sub.2, %0
br i1 %cmp12.not.2, label %if.else, label %for.cond5.2
for.cond5.2: ; preds = %for.cond5.1
%5 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%sub.3 = sub nsw i32 %1, %5
%cmp12.not.3 = icmp sgt i32 %sub.3, %0
%cmp12.not.4 = icmp slt i32 %0, 0
%or.cond = or i1 %cmp12.not.3, %cmp12.not.4
%sub.136 = sub nsw i32 %5, %2
%cmp12.not.137 = icmp sgt i32 %sub.136, %0
%or.cond48 = select i1 %or.cond, i1 true, i1 %cmp12.not.137
%sub.1.1 = sub nsw i32 %5, %3
%cmp12.not.1.1 = icmp sgt i32 %sub.1.1, %0
%or.cond49 = select i1 %or.cond48, i1 true, i1 %cmp12.not.1.1
%sub.2.1 = sub nsw i32 %5, %4
%cmp12.not.2.1 = icmp sgt i32 %sub.2.1, %0
%or.cond50 = select i1 %or.cond49, i1 true, i1 %cmp12.not.2.1
%sub.4.1 = sub nsw i32 %5, %1
%cmp12.not.4.1 = icmp sgt i32 %sub.4.1, %0
%or.cond51 = select i1 %or.cond50, i1 true, i1 %cmp12.not.4.1
%sub.239 = sub nsw i32 %4, %2
%cmp12.not.240 = icmp sgt i32 %sub.239, %0
%or.cond52 = select i1 %or.cond51, i1 true, i1 %cmp12.not.240
%sub.1.2 = sub nsw i32 %4, %3
%cmp12.not.1.2 = icmp sgt i32 %sub.1.2, %0
%or.cond53 = select i1 %or.cond52, i1 true, i1 %cmp12.not.1.2
%sub.3.2 = sub nsw i32 %4, %5
%cmp12.not.3.2 = icmp sgt i32 %sub.3.2, %0
%or.cond54 = select i1 %or.cond53, i1 true, i1 %cmp12.not.3.2
%sub.4.2 = sub nsw i32 %4, %1
%cmp12.not.4.2 = icmp sgt i32 %sub.4.2, %0
%or.cond55 = select i1 %or.cond54, i1 true, i1 %cmp12.not.4.2
%sub.342 = sub nsw i32 %3, %2
%cmp12.not.343 = icmp sgt i32 %sub.342, %0
%or.cond56 = select i1 %or.cond55, i1 true, i1 %cmp12.not.343
%sub.2.3 = sub nsw i32 %3, %4
%cmp12.not.2.3 = icmp sgt i32 %sub.2.3, %0
%or.cond57 = select i1 %or.cond56, i1 true, i1 %cmp12.not.2.3
%sub.3.3 = sub nsw i32 %3, %5
%cmp12.not.3.3 = icmp sgt i32 %sub.3.3, %0
%or.cond58 = select i1 %or.cond57, i1 true, i1 %cmp12.not.3.3
%sub.4.3 = sub nsw i32 %3, %1
%cmp12.not.4.3 = icmp sgt i32 %sub.4.3, %0
%or.cond59 = select i1 %or.cond58, i1 true, i1 %cmp12.not.4.3
%sub.1.4 = sub nsw i32 %2, %3
%cmp12.not.1.4 = icmp sgt i32 %sub.1.4, %0
%or.cond60 = select i1 %or.cond59, i1 true, i1 %cmp12.not.1.4
%sub.2.4 = sub nsw i32 %2, %4
%cmp12.not.2.4 = icmp sgt i32 %sub.2.4, %0
%or.cond61 = select i1 %or.cond60, i1 true, i1 %cmp12.not.2.4
%sub.3.4 = sub nsw i32 %2, %5
%cmp12.not.3.4 = icmp sgt i32 %sub.3.4, %0
%or.cond62 = select i1 %or.cond61, i1 true, i1 %cmp12.not.3.4
%sub.4.4 = sub nsw i32 %2, %1
%cmp12.not.4.4 = icmp sgt i32 %sub.4.4, %0
%or.cond63 = select i1 %or.cond62, i1 true, i1 %cmp12.not.4.4
br i1 %or.cond63, label %if.else, label %cleanup20
if.else: ; preds = %for.cond5.2, %for.cond5.1, %for.cond5, %entry
br label %cleanup20
cleanup20: ; preds = %for.cond5.2, %if.else
%.str.1.sink = phi ptr [ @.str.1, %if.else ], [ @.str.2, %for.cond5.2 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b,c,d,e,k;
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&k);
if(e-a <= k)
{
puts("Yay!");
}
else
{
puts(":(");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202647/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202647/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %sub, %2
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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>
#include<string.h>
#define max(a,b) (a>b?a:b)
int mv[4][2] = {{1,0},{0,1},{-1,0},{0,-1}};
int ori[10][10];
int map[10][10];
int fa[100];
int color[100];
int x,y,tar;
int find(int now){
if(fa[now]==-1)return now;
return fa[now] = find(fa[now]);
}
void chkun()
{
int i,j,k;
int dx,dy;
int ta,tb;
for(i=0;i<x;i++){
for(j=0;j<y;j++){
for(k=0;k<2;k++){
dx = i + mv[k][0];
dy = j + mv[k][1];
if(0<=dx && dx<x && 0<=dy && dy<y){
ta = find(map[dx][dy]), tb = find(map[i][j]);
if(ta!=tb && color[ta]==color[tb]){
fa[ta] = tb;
}
}
}
}
}
}
int dfs(int a,int b, int c, int d, int e){
int i,j;
memset(fa,-1,sizeof(fa));
int cn = 0;
int tem,total;
for(i=0;i<x;i++){
for(j=0;j<y;j++){
map[i][j] = cn;
color[cn] = ori[i][j];
cn++;
}
}
chkun();
color[find(map[0][0])] = a;
chkun();
color[find(map[0][0])] = b;
chkun();
color[find(map[0][0])] = c;
chkun();
color[find(map[0][0])] = d;
chkun();
color[find(map[0][0])] = e;
chkun();
tem = find(map[0][0]);
if(color[tem]!=tar)return 0;
total = 0;
for(i=0;i<x;i++){
for(j=0;j<y;j++){
if(find(map[i][j])==tem)total++;
}
}
return total;
}
int main()
{
int i,j,k,l;
int ans;
while(scanf("%d%d%d",&x,&y,&tar)!=EOF){
if(!(x+y+tar))break;
for(i=0;i<x;i++){
for(j=0;j<y;j++){
scanf("%d",&ori[i][j]);
}
}
ans = 1;
for(i=1;i<=6;i++){
for(j=1;j<=6;j++){
for(k=1;k<=6;k++){
for(l=1;l<=6;l++){
ans = max(ans,dfs(i,j,k,l,tar));
}
}
}
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202690/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202690/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mv = dso_local local_unnamed_addr global [4 x [2 x i32]] [[2 x i32] [i32 1, i32 0], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 -1, i32 0], [2 x i32] [i32 0, i32 -1]], align 16
@fa = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@x = dso_local global i32 0, align 4
@y = dso_local global i32 0, align 4
@map = dso_local local_unnamed_addr global [10 x [10 x i32]] zeroinitializer, align 16
@color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16
@ori = dso_local global [10 x [10 x i32]] zeroinitializer, align 16
@tar = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @find(i32 noundef %now) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %now to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr @fa, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp eq i32 %0, -1
br i1 %cmp, label %common.ret8, label %if.end
common.ret8: ; preds = %entry, %if.end
%common.ret8.op = phi i32 [ %call, %if.end ], [ %now, %entry ]
ret i32 %common.ret8.op
if.end: ; preds = %entry
%call = tail call i32 @find(i32 noundef %0)
store i32 %call, ptr %arrayidx, align 4, !tbaa !5
br label %common.ret8
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @chkun() local_unnamed_addr #1 {
entry:
%0 = load i32, ptr @x, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
%1 = load i32, ptr @y, align 4
%2 = icmp sgt i32 %1, 0
%or.cond74 = select i1 %cmp65, i1 %2, i1 false
br i1 %or.cond74, label %for.cond1.preheader, label %for.end43
for.cond1.preheader: ; preds = %entry, %for.inc41
%3 = phi i32 [ %25, %for.inc41 ], [ %0, %entry ]
%4 = phi i32 [ %26, %for.inc41 ], [ %1, %entry ]
%indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.inc41 ], [ 0, %entry ]
%cmp263 = icmp sgt i32 %4, 0
br i1 %cmp263, label %for.cond4.preheader.lr.ph, label %for.inc41
for.cond4.preheader.lr.ph: ; preds = %for.cond1.preheader
%5 = trunc i64 %indvars.iv70 to i32
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.cond4.preheader.lr.ph, %for.inc.1
%6 = phi i32 [ %4, %for.cond4.preheader.lr.ph ], [ %23, %for.inc.1 ]
%indvars.iv = phi i64 [ 0, %for.cond4.preheader.lr.ph ], [ %indvars.iv.next, %for.inc.1 ]
%arrayidx25 = getelementptr inbounds [10 x [10 x i32]], ptr @map, i64 0, i64 %indvars.iv70, i64 %indvars.iv
%7 = load i32, ptr @mv, align 16, !tbaa !5
%add = add nsw i32 %7, %5
%8 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 0, i64 1), align 4, !tbaa !5
%9 = trunc i64 %indvars.iv to i32
%add11 = add nsw i32 %8, %9
%cmp12 = icmp sgt i32 %add, -1
br i1 %cmp12, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.cond4.preheader
%10 = load i32, ptr @x, align 4, !tbaa !5
%cmp13 = icmp slt i32 %add, %10
%cmp15 = icmp sgt i32 %add11, -1
%or.cond = select i1 %cmp13, i1 %cmp15, i1 false
%cmp17 = icmp slt i32 %add11, %6
%or.cond61 = select i1 %or.cond, i1 %cmp17, i1 false
br i1 %or.cond61, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true
%idxprom18 = zext i32 %add to i64
%idxprom20 = zext i32 %add11 to i64
%arrayidx21 = getelementptr inbounds [10 x [10 x i32]], ptr @map, i64 0, i64 %idxprom18, i64 %idxprom20
%11 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%call = tail call i32 @find(i32 noundef %11)
%12 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%call26 = tail call i32 @find(i32 noundef %12)
%cmp27.not = icmp eq i32 %call, %call26
br i1 %cmp27.not, label %for.inc, label %land.lhs.true28
land.lhs.true28: ; preds = %if.then
%idxprom29 = sext i32 %call to i64
%arrayidx30 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom29
%13 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%idxprom31 = sext i32 %call26 to i64
%arrayidx32 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom31
%14 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%cmp33 = icmp eq i32 %13, %14
br i1 %cmp33, label %if.then34, label %for.inc
if.then34: ; preds = %land.lhs.true28
%arrayidx36 = getelementptr inbounds [100 x i32], ptr @fa, i64 0, i64 %idxprom29
store i32 %call26, ptr %arrayidx36, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond4.preheader, %land.lhs.true, %if.then34, %land.lhs.true28, %if.then
%15 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 1), align 8, !tbaa !5
%add.1 = add nsw i32 %15, %5
%16 = load i32, ptr getelementptr inbounds ([4 x [2 x i32]], ptr @mv, i64 0, i64 1, i64 1), align 4, !tbaa !5
%add11.1 = add nsw i32 %16, %9
%cmp12.1 = icmp sgt i32 %add.1, -1
br i1 %cmp12.1, label %land.lhs.true.1, label %for.inc.1
land.lhs.true.1: ; preds = %for.inc
%17 = load i32, ptr @x, align 4, !tbaa !5
%cmp13.1 = icmp slt i32 %add.1, %17
%cmp15.1 = icmp sgt i32 %add11.1, -1
%or.cond.1 = select i1 %cmp13.1, i1 %cmp15.1, i1 false
%18 = load i32, ptr @y, align 4
%cmp17.1 = icmp slt i32 %add11.1, %18
%or.cond61.1 = select i1 %or.cond.1, i1 %cmp17.1, i1 false
br i1 %or.cond61.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %land.lhs.true.1
%idxprom18.1 = zext i32 %add.1 to i64
%idxprom20.1 = zext i32 %add11.1 to i64
%arrayidx21.1 = getelementptr inbounds [10 x [10 x i32]], ptr @map, i64 0, i64 %idxprom18.1, i64 %idxprom20.1
%19 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%call.1 = tail call i32 @find(i32 noundef %19)
%20 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%call26.1 = tail call i32 @find(i32 noundef %20)
%cmp27.not.1 = icmp eq i32 %call.1, %call26.1
br i1 %cmp27.not.1, label %for.inc.1, label %land.lhs.true28.1
land.lhs.true28.1: ; preds = %if.then.1
%idxprom29.1 = sext i32 %call.1 to i64
%arrayidx30.1 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom29.1
%21 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5
%idxprom31.1 = sext i32 %call26.1 to i64
%arrayidx32.1 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom31.1
%22 = load i32, ptr %arrayidx32.1, align 4, !tbaa !5
%cmp33.1 = icmp eq i32 %21, %22
br i1 %cmp33.1, label %if.then34.1, label %for.inc.1
if.then34.1: ; preds = %land.lhs.true28.1
%arrayidx36.1 = getelementptr inbounds [100 x i32], ptr @fa, i64 0, i64 %idxprom29.1
store i32 %call26.1, ptr %arrayidx36.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then34.1, %land.lhs.true28.1, %if.then.1, %land.lhs.true.1, %for.inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%23 = load i32, ptr @y, align 4
%24 = sext i32 %23 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %24
br i1 %cmp2, label %for.cond4.preheader, label %for.inc41.loopexit, !llvm.loop !9
for.inc41.loopexit: ; preds = %for.inc.1
%.pre = load i32, ptr @x, align 4, !tbaa !5
br label %for.inc41
for.inc41: ; preds = %for.inc41.loopexit, %for.cond1.preheader
%25 = phi i32 [ %.pre, %for.inc41.loopexit ], [ %3, %for.cond1.preheader ]
%26 = phi i32 [ %23, %for.inc41.loopexit ], [ %4, %for.cond1.preheader ]
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%27 = sext i32 %25 to i64
%cmp = icmp slt i64 %indvars.iv.next71, %27
br i1 %cmp, label %for.cond1.preheader, label %for.end43, !llvm.loop !11
for.end43: ; preds = %for.inc41, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d, i32 noundef %e) local_unnamed_addr #1 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) @fa, i8 -1, i64 400, i1 false)
%0 = load i32, ptr @x, align 4, !tbaa !5
%cmp78 = icmp sgt i32 %0, 0
br i1 %cmp78, label %for.cond1.preheader.lr.ph, label %for.end15
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr @y, align 4, !tbaa !5
%cmp275 = icmp sgt i32 %1, 0
br i1 %cmp275, label %for.cond1.preheader.us.preheader, label %for.end15
for.cond1.preheader.us.preheader: ; preds = %for.cond1.preheader.lr.ph
%2 = zext i32 %1 to i64
%3 = shl nuw nsw i64 %2, 2
%wide.trip.count97 = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %1, 8
%n.vec = and i64 %2, 4294967288
%cmp.n = icmp eq i64 %n.vec, %2
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc13_crit_edge.us
%indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next, %for.cond1.for.inc13_crit_edge.us ]
%cn.080.us = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next.lcssa, %for.cond1.for.inc13_crit_edge.us ]
%4 = mul nuw nsw i64 %indvar, 40
%scevgep90 = getelementptr i8, ptr @ori, i64 %4
%sext = shl i64 %cn.080.us, 32
%5 = ashr exact i64 %sext, 32
%6 = ashr exact i64 %sext, 30
%scevgep = getelementptr i8, ptr @color, i64 %6
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %scevgep, ptr align 8 %scevgep90, i64 %3, i1 false), !tbaa !5
br i1 %min.iters.check, label %for.body3.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond1.preheader.us
%ind.end = add nsw i64 %5, %n.vec
%7 = trunc i64 %cn.080.us to i32
%.splatinsert109 = insertelement <4 x i32> poison, i32 %7, i64 0
%.splat110 = shufflevector <4 x i32> %.splatinsert109, <4 x i32> poison, <4 x i32> zeroinitializer
%induction111 = add <4 x i32> %.splat110, <i32 0, i32 1, i32 2, i32 3>
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind112 = phi <4 x i32> [ %induction111, %vector.ph ], [ %vec.ind.next115, %vector.body ]
%step.add113 = add <4 x i32> %vec.ind112, <i32 4, i32 4, i32 4, i32 4>
%8 = getelementptr inbounds [10 x [10 x i32]], ptr @map, i64 0, i64 %indvar, i64 %index
store <4 x i32> %vec.ind112, ptr %8, align 8, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
store <4 x i32> %step.add113, ptr %9, align 8, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next115 = add <4 x i32> %vec.ind112, <i32 8, i32 8, i32 8, i32 8>
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond1.for.inc13_crit_edge.us, label %for.body3.us.preheader
for.body3.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block
%indvars.iv91.ph = phi i64 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block ]
%indvars.iv.ph = phi i64 [ %5, %for.cond1.preheader.us ], [ %ind.end, %middle.block ]
br label %for.body3.us
for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body3.us ], [ %indvars.iv91.ph, %for.body3.us.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.us ], [ %indvars.iv.ph, %for.body3.us.preheader ]
%arrayidx5.us = getelementptr inbounds [10 x [10 x i32]], ptr @map, i64 0, i64 %indvar, i64 %indvars.iv91
%11 = trunc i64 %indvars.iv to i32
store i32 %11, ptr %arrayidx5.us, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%exitcond.not = icmp eq i64 %indvars.iv.next92, %2
br i1 %exitcond.not, label %for.cond1.for.inc13_crit_edge.us, label %for.body3.us, !llvm.loop !16
for.cond1.for.inc13_crit_edge.us: ; preds = %for.body3.us, %middle.block
%indvars.iv.next.lcssa = phi i64 [ %ind.end, %middle.block ], [ %indvars.iv.next, %for.body3.us ]
%indvar.next = add nuw nsw i64 %indvar, 1
%exitcond98.not = icmp eq i64 %indvar.next, %wide.trip.count97
br i1 %exitcond98.not, label %for.end15, label %for.cond1.preheader.us, !llvm.loop !17
for.end15: ; preds = %for.cond1.for.inc13_crit_edge.us, %for.cond1.preheader.lr.ph, %entry
tail call void @chkun()
%12 = load i32, ptr @map, align 16, !tbaa !5
%call = tail call i32 @find(i32 noundef %12)
%idxprom16 = sext i32 %call to i64
%arrayidx17 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom16
store i32 %a, ptr %arrayidx17, align 4, !tbaa !5
tail call void @chkun()
%13 = load i32, ptr @map, align 16, !tbaa !5
%call18 = tail call i32 @find(i32 noundef %13)
%idxprom19 = sext i32 %call18 to i64
%arrayidx20 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom19
store i32 %b, ptr %arrayidx20, align 4, !tbaa !5
tail call void @chkun()
%14 = load i32, ptr @map, align 16, !tbaa !5
%call21 = tail call i32 @find(i32 noundef %14)
%idxprom22 = sext i32 %call21 to i64
%arrayidx23 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom22
store i32 %c, ptr %arrayidx23, align 4, !tbaa !5
tail call void @chkun()
%15 = load i32, ptr @map, align 16, !tbaa !5
%call24 = tail call i32 @find(i32 noundef %15)
%idxprom25 = sext i32 %call24 to i64
%arrayidx26 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom25
store i32 %d, ptr %arrayidx26, align 4, !tbaa !5
tail call void @chkun()
%16 = load i32, ptr @map, align 16, !tbaa !5
%call27 = tail call i32 @find(i32 noundef %16)
%idxprom28 = sext i32 %call27 to i64
%arrayidx29 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom28
store i32 %e, ptr %arrayidx29, align 4, !tbaa !5
tail call void @chkun()
%17 = load i32, ptr @map, align 16, !tbaa !5
%call30 = tail call i32 @find(i32 noundef %17)
%idxprom31 = sext i32 %call30 to i64
%arrayidx32 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom31
%18 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%19 = load i32, ptr @tar, align 4, !tbaa !5
%cmp33.not = icmp eq i32 %18, %19
%20 = load i32, ptr @x, align 4
%cmp3584 = icmp sgt i32 %20, 0
%or.cond = select i1 %cmp33.not, i1 %cmp3584, i1 false
%21 = load i32, ptr @y, align 4
%22 = icmp sgt i32 %21, 0
%or.cond106 = select i1 %or.cond, i1 %22, i1 false
br i1 %or.cond106, label %for.cond37.preheader, label %cleanup
for.cond37.preheader: ; preds = %for.end15, %for.inc52
%23 = phi i32 [ %28, %for.inc52 ], [ %20, %for.end15 ]
%24 = phi i32 [ %29, %for.inc52 ], [ %21, %for.end15 ]
%indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.inc52 ], [ 0, %for.end15 ]
%total.086 = phi i32 [ %total.1.lcssa, %for.inc52 ], [ 0, %for.end15 ]
%cmp3881 = icmp sgt i32 %24, 0
br i1 %cmp3881, label %for.body39, label %for.inc52
for.body39: ; preds = %for.cond37.preheader, %for.body39
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body39 ], [ 0, %for.cond37.preheader ]
%total.183 = phi i32 [ %spec.select, %for.body39 ], [ %total.086, %for.cond37.preheader ]
%arrayidx43 = getelementptr inbounds [10 x [10 x i32]], ptr @map, i64 0, i64 %indvars.iv102, i64 %indvars.iv99
%25 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%call44 = tail call i32 @find(i32 noundef %25)
%cmp45 = icmp eq i32 %call44, %call30
%inc47 = zext i1 %cmp45 to i32
%spec.select = add nsw i32 %total.183, %inc47
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%26 = load i32, ptr @y, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp38 = icmp slt i64 %indvars.iv.next100, %27
br i1 %cmp38, label %for.body39, label %for.inc52.loopexit, !llvm.loop !18
for.inc52.loopexit: ; preds = %for.body39
%.pre = load i32, ptr @x, align 4, !tbaa !5
br label %for.inc52
for.inc52: ; preds = %for.inc52.loopexit, %for.cond37.preheader
%28 = phi i32 [ %23, %for.cond37.preheader ], [ %.pre, %for.inc52.loopexit ]
%29 = phi i32 [ %24, %for.cond37.preheader ], [ %26, %for.inc52.loopexit ]
%total.1.lcssa = phi i32 [ %total.086, %for.cond37.preheader ], [ %spec.select, %for.inc52.loopexit ]
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%30 = sext i32 %28 to i64
%cmp35 = icmp slt i64 %indvars.iv.next103, %30
br i1 %cmp35, label %for.cond37.preheader, label %cleanup, !llvm.loop !19
cleanup: ; preds = %for.inc52, %for.end15
%retval.0 = phi i32 [ 0, %for.end15 ], [ %total.1.lcssa, %for.inc52 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call72 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @tar)
%cmp.not73 = icmp eq i32 %call72, -1
br i1 %cmp.not73, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end38
%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 @tar, align 4, !tbaa !5
%add1 = sub i32 0, %2
%tobool.not = icmp eq i32 %add, %add1
br i1 %tobool.not, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body
%cmp262 = icmp sgt i32 %0, 0
%3 = icmp sgt i32 %1, 0
%or.cond = and i1 %cmp262, %3
br i1 %or.cond, label %for.cond3.preheader, label %for.cond15.preheader.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.inc9
%4 = phi i32 [ %8, %for.inc9 ], [ %0, %for.cond.preheader ]
%5 = phi i32 [ %9, %for.inc9 ], [ %1, %for.cond.preheader ]
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.inc9 ], [ 0, %for.cond.preheader ]
%cmp460 = icmp sgt i32 %5, 0
br i1 %cmp460, label %for.body5, label %for.inc9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [10 x [10 x i32]], ptr @ori, i64 0, i64 %indvars.iv76, i64 %indvars.iv
%call8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr @y, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp4, label %for.body5, label %for.inc9.loopexit, !llvm.loop !20
for.inc9.loopexit: ; preds = %for.body5
%.pre = load i32, ptr @x, align 4, !tbaa !5
br label %for.inc9
for.inc9: ; preds = %for.inc9.loopexit, %for.cond3.preheader
%8 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %4, %for.cond3.preheader ]
%9 = phi i32 [ %6, %for.inc9.loopexit ], [ %5, %for.cond3.preheader ]
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%10 = sext i32 %8 to i64
%cmp2 = icmp slt i64 %indvars.iv.next77, %10
br i1 %cmp2, label %for.cond3.preheader, label %for.cond15.preheader.preheader, !llvm.loop !21
for.cond15.preheader.preheader: ; preds = %for.inc9, %for.cond.preheader
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond15.preheader.preheader, %for.inc36
%ans.071 = phi i32 [ %cond.5, %for.inc36 ], [ 1, %for.cond15.preheader.preheader ]
%i.170 = phi i32 [ %inc37, %for.inc36 ], [ 1, %for.cond15.preheader.preheader ]
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.cond15.preheader, %for.inc33
%ans.169 = phi i32 [ %ans.071, %for.cond15.preheader ], [ %cond.5, %for.inc33 ]
%j.168 = phi i32 [ 1, %for.cond15.preheader ], [ %inc34, %for.inc33 ]
br label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.cond18.preheader, %cond.end.5
%ans.267 = phi i32 [ %ans.169, %for.cond18.preheader ], [ %cond.5, %cond.end.5 ]
%k.066 = phi i32 [ 1, %for.cond18.preheader ], [ %inc31, %cond.end.5 ]
%11 = load i32, ptr @tar, align 4, !tbaa !5
%call24 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 1, i32 noundef %11)
%cmp25 = icmp sgt i32 %ans.267, %call24
br i1 %cmp25, label %cond.end, label %cond.false
cond.false: ; preds = %for.cond21.preheader
%12 = load i32, ptr @tar, align 4, !tbaa !5
%call26 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 1, i32 noundef %12)
br label %cond.end
cond.end: ; preds = %for.cond21.preheader, %cond.false
%cond = phi i32 [ %call26, %cond.false ], [ %ans.267, %for.cond21.preheader ]
%13 = load i32, ptr @tar, align 4, !tbaa !5
%call24.1 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 2, i32 noundef %13)
%cmp25.1 = icmp sgt i32 %cond, %call24.1
br i1 %cmp25.1, label %cond.end.1, label %cond.false.1
cond.false.1: ; preds = %cond.end
%14 = load i32, ptr @tar, align 4, !tbaa !5
%call26.1 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 2, i32 noundef %14)
br label %cond.end.1
cond.end.1: ; preds = %cond.false.1, %cond.end
%cond.1 = phi i32 [ %call26.1, %cond.false.1 ], [ %cond, %cond.end ]
%15 = load i32, ptr @tar, align 4, !tbaa !5
%call24.2 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 3, i32 noundef %15)
%cmp25.2 = icmp sgt i32 %cond.1, %call24.2
br i1 %cmp25.2, label %cond.end.2, label %cond.false.2
cond.false.2: ; preds = %cond.end.1
%16 = load i32, ptr @tar, align 4, !tbaa !5
%call26.2 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 3, i32 noundef %16)
br label %cond.end.2
cond.end.2: ; preds = %cond.false.2, %cond.end.1
%cond.2 = phi i32 [ %call26.2, %cond.false.2 ], [ %cond.1, %cond.end.1 ]
%17 = load i32, ptr @tar, align 4, !tbaa !5
%call24.3 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 4, i32 noundef %17)
%cmp25.3 = icmp sgt i32 %cond.2, %call24.3
br i1 %cmp25.3, label %cond.end.3, label %cond.false.3
cond.false.3: ; preds = %cond.end.2
%18 = load i32, ptr @tar, align 4, !tbaa !5
%call26.3 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 4, i32 noundef %18)
br label %cond.end.3
cond.end.3: ; preds = %cond.false.3, %cond.end.2
%cond.3 = phi i32 [ %call26.3, %cond.false.3 ], [ %cond.2, %cond.end.2 ]
%19 = load i32, ptr @tar, align 4, !tbaa !5
%call24.4 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 5, i32 noundef %19)
%cmp25.4 = icmp sgt i32 %cond.3, %call24.4
br i1 %cmp25.4, label %cond.end.4, label %cond.false.4
cond.false.4: ; preds = %cond.end.3
%20 = load i32, ptr @tar, align 4, !tbaa !5
%call26.4 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 5, i32 noundef %20)
br label %cond.end.4
cond.end.4: ; preds = %cond.false.4, %cond.end.3
%cond.4 = phi i32 [ %call26.4, %cond.false.4 ], [ %cond.3, %cond.end.3 ]
%21 = load i32, ptr @tar, align 4, !tbaa !5
%call24.5 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 6, i32 noundef %21)
%cmp25.5 = icmp sgt i32 %cond.4, %call24.5
br i1 %cmp25.5, label %cond.end.5, label %cond.false.5
cond.false.5: ; preds = %cond.end.4
%22 = load i32, ptr @tar, align 4, !tbaa !5
%call26.5 = tail call i32 @dfs(i32 noundef %i.170, i32 noundef %j.168, i32 noundef %k.066, i32 noundef 6, i32 noundef %22)
br label %cond.end.5
cond.end.5: ; preds = %cond.false.5, %cond.end.4
%cond.5 = phi i32 [ %call26.5, %cond.false.5 ], [ %cond.4, %cond.end.4 ]
%inc31 = add nuw nsw i32 %k.066, 1
%exitcond.not = icmp eq i32 %inc31, 7
br i1 %exitcond.not, label %for.inc33, label %for.cond21.preheader, !llvm.loop !22
for.inc33: ; preds = %cond.end.5
%inc34 = add nuw nsw i32 %j.168, 1
%exitcond79.not = icmp eq i32 %inc34, 7
br i1 %exitcond79.not, label %for.inc36, label %for.cond18.preheader, !llvm.loop !23
for.inc36: ; preds = %for.inc33
%inc37 = add nuw nsw i32 %i.170, 1
%exitcond80.not = icmp eq i32 %inc37, 7
br i1 %exitcond80.not, label %for.end38, label %for.cond15.preheader, !llvm.loop !24
for.end38: ; preds = %for.inc36
%call39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cond.5)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @tar)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !25
while.end: ; preds = %for.end38, %while.body, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
attributes #0 = { nofree 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 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !12}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !12}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
|
#include <stdio.h>
int main(void){
int i = 1, j = 1;
int month, days;
int day[13][32];
day[1][1] = 3;
day[2][1] = 6;
day[3][1] = 0;
day[4][1] = 3;
day[5][1] = 5;
day[6][1] = 1;
day[7][1] = 3;
day[8][1] = 6;
day[9][1] = 2;
day[10][1] = 4;
day[11][1] = 0;
day[12][1] = 2;
for( i = 1; i <= 12; i++) {
for( j = 2; j <= 31; j++) {
day[i][j] = ( day[i][j-1] + 1 ) % 7;
}
}
while(1) {
scanf( "%d%d", &month, &days );
if( month == 0 ) break;
if( day[month][days] == 0 )
printf("Monday\n");
else if( day[month][days] == 1 )
printf("Tuesday\n");
else if( day[month][days] == 2 )
printf("Wednesday\n");
else if( day[month][days] == 3 )
printf("Thursday\n");
else if( day[month][days] == 4 )
printf("Friday\n");
else if( day[month][days] == 5 )
printf("Saturday\n");
else
printf("Sunday\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202748/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202748/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.8 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.11 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@str.12 = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.13 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@reltable.main = private unnamed_addr constant [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%month = alloca i32, align 4
%days = alloca i32, align 4
%day = alloca [13 x [32 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %month) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %days) #5
call void @llvm.lifetime.start.p0(i64 1664, ptr nonnull %day) #5
%arrayidx1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 1
store i32 3, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 1
store i32 6, ptr %arrayidx3, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 1
store i32 0, ptr %arrayidx5, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 1
store i32 3, ptr %arrayidx7, align 4, !tbaa !5
%arrayidx9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 1
store i32 5, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 1
store i32 1, ptr %arrayidx11, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 1
store i32 3, ptr %arrayidx13, align 4, !tbaa !5
%arrayidx15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 1
store i32 6, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 1
store i32 2, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 1
store i32 4, ptr %arrayidx19, align 4, !tbaa !5
%arrayidx21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 1
store i32 0, ptr %arrayidx21, align 4, !tbaa !5
%arrayidx23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 1
store i32 2, ptr %arrayidx23, align 4, !tbaa !5
%arrayidx33 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 2
store i32 4, ptr %arrayidx33, align 8, !tbaa !5
%arrayidx33.1128 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 3
store i32 5, ptr %arrayidx33.1128, align 4, !tbaa !5
%arrayidx33.2134 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 4
store i32 6, ptr %arrayidx33.2134, align 16, !tbaa !5
%arrayidx33.3140 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 5
store i32 0, ptr %arrayidx33.3140, align 4, !tbaa !5
%arrayidx33.4146 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 6
store i32 1, ptr %arrayidx33.4146, align 8, !tbaa !5
%arrayidx33.5152 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 7
store i32 2, ptr %arrayidx33.5152, align 4, !tbaa !5
%arrayidx33.6158 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 8
store i32 3, ptr %arrayidx33.6158, align 16, !tbaa !5
%arrayidx33.7164 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 9
store i32 4, ptr %arrayidx33.7164, align 4, !tbaa !5
%arrayidx33.8170 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 10
store i32 5, ptr %arrayidx33.8170, align 8, !tbaa !5
%arrayidx33.9176 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 11
store i32 6, ptr %arrayidx33.9176, align 4, !tbaa !5
%arrayidx33.10182 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 12
store i32 0, ptr %arrayidx33.10182, align 16, !tbaa !5
%arrayidx33.11188 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 13
store i32 1, ptr %arrayidx33.11188, align 4, !tbaa !5
%arrayidx33.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 14
store i32 2, ptr %arrayidx33.12, align 8, !tbaa !5
%arrayidx33.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 15
store i32 3, ptr %arrayidx33.13, align 4, !tbaa !5
%arrayidx33.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 16
store i32 4, ptr %arrayidx33.14, align 16, !tbaa !5
%arrayidx33.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 17
store i32 5, ptr %arrayidx33.15, align 4, !tbaa !5
%arrayidx33.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 18
store i32 6, ptr %arrayidx33.16, align 8, !tbaa !5
%arrayidx33.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 19
store i32 0, ptr %arrayidx33.17, align 4, !tbaa !5
%arrayidx33.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 20
store i32 1, ptr %arrayidx33.18, align 16, !tbaa !5
%arrayidx33.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 21
store i32 2, ptr %arrayidx33.19, align 4, !tbaa !5
%arrayidx33.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 22
store i32 3, ptr %arrayidx33.20, align 8, !tbaa !5
%arrayidx33.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 23
store i32 4, ptr %arrayidx33.21, align 4, !tbaa !5
%arrayidx33.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 24
store i32 5, ptr %arrayidx33.22, align 16, !tbaa !5
%arrayidx33.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 25
store i32 6, ptr %arrayidx33.23, align 4, !tbaa !5
%arrayidx33.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 26
store i32 0, ptr %arrayidx33.24, align 8, !tbaa !5
%arrayidx33.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 27
store i32 1, ptr %arrayidx33.25, align 4, !tbaa !5
%arrayidx33.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 28
store i32 2, ptr %arrayidx33.26, align 16, !tbaa !5
%arrayidx33.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 29
store i32 3, ptr %arrayidx33.27, align 4, !tbaa !5
%arrayidx33.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 30
store i32 4, ptr %arrayidx33.28, align 8, !tbaa !5
%arrayidx33.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 1, i64 31
store i32 5, ptr %arrayidx33.29, align 4, !tbaa !5
%.pre = load i32, ptr %arrayidx3, align 4, !tbaa !5
%add.1 = add nsw i32 %.pre, 1
%rem.1 = srem i32 %add.1, 7
%arrayidx33.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 2
store i32 %rem.1, ptr %arrayidx33.1, align 8, !tbaa !5
%add.1.1 = add nsw i32 %rem.1, 1
%rem.1.1 = srem i32 %add.1.1, 7
%arrayidx33.1.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 3
store i32 %rem.1.1, ptr %arrayidx33.1.1, align 4, !tbaa !5
%add.1.2 = add nsw i32 %rem.1.1, 1
%rem.1.2 = srem i32 %add.1.2, 7
%arrayidx33.1.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 4
store i32 %rem.1.2, ptr %arrayidx33.1.2, align 16, !tbaa !5
%add.1.3 = add nsw i32 %rem.1.2, 1
%rem.1.3 = srem i32 %add.1.3, 7
%arrayidx33.1.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 5
store i32 %rem.1.3, ptr %arrayidx33.1.3, align 4, !tbaa !5
%add.1.4 = add nsw i32 %rem.1.3, 1
%rem.1.4 = srem i32 %add.1.4, 7
%arrayidx33.1.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 6
store i32 %rem.1.4, ptr %arrayidx33.1.4, align 8, !tbaa !5
%add.1.5 = add nsw i32 %rem.1.4, 1
%rem.1.5 = srem i32 %add.1.5, 7
%arrayidx33.1.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 7
store i32 %rem.1.5, ptr %arrayidx33.1.5, align 4, !tbaa !5
%add.1.6 = add nsw i32 %rem.1.5, 1
%rem.1.6 = srem i32 %add.1.6, 7
%arrayidx33.1.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 8
store i32 %rem.1.6, ptr %arrayidx33.1.6, align 16, !tbaa !5
%add.1.7 = add nsw i32 %rem.1.6, 1
%rem.1.7 = srem i32 %add.1.7, 7
%arrayidx33.1.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 9
store i32 %rem.1.7, ptr %arrayidx33.1.7, align 4, !tbaa !5
%add.1.8 = add nsw i32 %rem.1.7, 1
%rem.1.8 = srem i32 %add.1.8, 7
%arrayidx33.1.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 10
store i32 %rem.1.8, ptr %arrayidx33.1.8, align 8, !tbaa !5
%add.1.9 = add nsw i32 %rem.1.8, 1
%rem.1.9 = srem i32 %add.1.9, 7
%arrayidx33.1.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 11
store i32 %rem.1.9, ptr %arrayidx33.1.9, align 4, !tbaa !5
%add.1.10 = add nsw i32 %rem.1.9, 1
%rem.1.10 = srem i32 %add.1.10, 7
%arrayidx33.1.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 12
store i32 %rem.1.10, ptr %arrayidx33.1.10, align 16, !tbaa !5
%add.1.11 = add nsw i32 %rem.1.10, 1
%rem.1.11 = srem i32 %add.1.11, 7
%arrayidx33.1.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 13
store i32 %rem.1.11, ptr %arrayidx33.1.11, align 4, !tbaa !5
%add.1.12 = add nsw i32 %rem.1.11, 1
%rem.1.12 = srem i32 %add.1.12, 7
%arrayidx33.1.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 14
store i32 %rem.1.12, ptr %arrayidx33.1.12, align 8, !tbaa !5
%add.1.13 = add nsw i32 %rem.1.12, 1
%rem.1.13 = srem i32 %add.1.13, 7
%arrayidx33.1.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 15
store i32 %rem.1.13, ptr %arrayidx33.1.13, align 4, !tbaa !5
%add.1.14 = add nsw i32 %rem.1.13, 1
%rem.1.14 = srem i32 %add.1.14, 7
%arrayidx33.1.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 16
store i32 %rem.1.14, ptr %arrayidx33.1.14, align 16, !tbaa !5
%add.1.15 = add nsw i32 %rem.1.14, 1
%rem.1.15 = srem i32 %add.1.15, 7
%arrayidx33.1.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 17
store i32 %rem.1.15, ptr %arrayidx33.1.15, align 4, !tbaa !5
%add.1.16 = add nsw i32 %rem.1.15, 1
%rem.1.16 = srem i32 %add.1.16, 7
%arrayidx33.1.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 18
store i32 %rem.1.16, ptr %arrayidx33.1.16, align 8, !tbaa !5
%add.1.17 = add nsw i32 %rem.1.16, 1
%rem.1.17 = srem i32 %add.1.17, 7
%arrayidx33.1.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 19
store i32 %rem.1.17, ptr %arrayidx33.1.17, align 4, !tbaa !5
%add.1.18 = add nsw i32 %rem.1.17, 1
%rem.1.18 = srem i32 %add.1.18, 7
%arrayidx33.1.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 20
store i32 %rem.1.18, ptr %arrayidx33.1.18, align 16, !tbaa !5
%add.1.19 = add nsw i32 %rem.1.18, 1
%rem.1.19 = srem i32 %add.1.19, 7
%arrayidx33.1.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 21
store i32 %rem.1.19, ptr %arrayidx33.1.19, align 4, !tbaa !5
%add.1.20 = add nsw i32 %rem.1.19, 1
%rem.1.20 = srem i32 %add.1.20, 7
%arrayidx33.1.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 22
store i32 %rem.1.20, ptr %arrayidx33.1.20, align 8, !tbaa !5
%add.1.21 = add nsw i32 %rem.1.20, 1
%rem.1.21 = srem i32 %add.1.21, 7
%arrayidx33.1.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 23
store i32 %rem.1.21, ptr %arrayidx33.1.21, align 4, !tbaa !5
%add.1.22 = add nsw i32 %rem.1.21, 1
%rem.1.22 = srem i32 %add.1.22, 7
%arrayidx33.1.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 24
store i32 %rem.1.22, ptr %arrayidx33.1.22, align 16, !tbaa !5
%add.1.23 = add nsw i32 %rem.1.22, 1
%rem.1.23 = srem i32 %add.1.23, 7
%arrayidx33.1.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 25
store i32 %rem.1.23, ptr %arrayidx33.1.23, align 4, !tbaa !5
%add.1.24 = add nsw i32 %rem.1.23, 1
%rem.1.24 = srem i32 %add.1.24, 7
%arrayidx33.1.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 26
store i32 %rem.1.24, ptr %arrayidx33.1.24, align 8, !tbaa !5
%add.1.25 = add nsw i32 %rem.1.24, 1
%rem.1.25 = srem i32 %add.1.25, 7
%arrayidx33.1.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 27
store i32 %rem.1.25, ptr %arrayidx33.1.25, align 4, !tbaa !5
%add.1.26 = add nsw i32 %rem.1.25, 1
%rem.1.26 = srem i32 %add.1.26, 7
%arrayidx33.1.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 28
store i32 %rem.1.26, ptr %arrayidx33.1.26, align 16, !tbaa !5
%add.1.27 = add nsw i32 %rem.1.26, 1
%rem.1.27 = srem i32 %add.1.27, 7
%arrayidx33.1.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 29
store i32 %rem.1.27, ptr %arrayidx33.1.27, align 4, !tbaa !5
%add.1.28 = add nsw i32 %rem.1.27, 1
%rem.1.28 = srem i32 %add.1.28, 7
%arrayidx33.1.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 30
store i32 %rem.1.28, ptr %arrayidx33.1.28, align 8, !tbaa !5
%add.1.29 = add nsw i32 %rem.1.28, 1
%rem.1.29 = srem i32 %add.1.29, 7
%arrayidx33.1.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 2, i64 31
store i32 %rem.1.29, ptr %arrayidx33.1.29, align 4, !tbaa !5
%.pre115 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%add.2 = add nsw i32 %.pre115, 1
%rem.2 = srem i32 %add.2, 7
%arrayidx33.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 2
store i32 %rem.2, ptr %arrayidx33.2, align 8, !tbaa !5
%add.2.1 = add nsw i32 %rem.2, 1
%rem.2.1 = srem i32 %add.2.1, 7
%arrayidx33.2.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 3
store i32 %rem.2.1, ptr %arrayidx33.2.1, align 4, !tbaa !5
%add.2.2 = add nsw i32 %rem.2.1, 1
%rem.2.2 = srem i32 %add.2.2, 7
%arrayidx33.2.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 4
store i32 %rem.2.2, ptr %arrayidx33.2.2, align 16, !tbaa !5
%add.2.3 = add nsw i32 %rem.2.2, 1
%rem.2.3 = srem i32 %add.2.3, 7
%arrayidx33.2.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 5
store i32 %rem.2.3, ptr %arrayidx33.2.3, align 4, !tbaa !5
%add.2.4 = add nsw i32 %rem.2.3, 1
%rem.2.4 = srem i32 %add.2.4, 7
%arrayidx33.2.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 6
store i32 %rem.2.4, ptr %arrayidx33.2.4, align 8, !tbaa !5
%add.2.5 = add nsw i32 %rem.2.4, 1
%rem.2.5 = srem i32 %add.2.5, 7
%arrayidx33.2.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 7
store i32 %rem.2.5, ptr %arrayidx33.2.5, align 4, !tbaa !5
%add.2.6 = add nsw i32 %rem.2.5, 1
%rem.2.6 = srem i32 %add.2.6, 7
%arrayidx33.2.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 8
store i32 %rem.2.6, ptr %arrayidx33.2.6, align 16, !tbaa !5
%add.2.7 = add nsw i32 %rem.2.6, 1
%rem.2.7 = srem i32 %add.2.7, 7
%arrayidx33.2.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 9
store i32 %rem.2.7, ptr %arrayidx33.2.7, align 4, !tbaa !5
%add.2.8 = add nsw i32 %rem.2.7, 1
%rem.2.8 = srem i32 %add.2.8, 7
%arrayidx33.2.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 10
store i32 %rem.2.8, ptr %arrayidx33.2.8, align 8, !tbaa !5
%add.2.9 = add nsw i32 %rem.2.8, 1
%rem.2.9 = srem i32 %add.2.9, 7
%arrayidx33.2.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 11
store i32 %rem.2.9, ptr %arrayidx33.2.9, align 4, !tbaa !5
%add.2.10 = add nsw i32 %rem.2.9, 1
%rem.2.10 = srem i32 %add.2.10, 7
%arrayidx33.2.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 12
store i32 %rem.2.10, ptr %arrayidx33.2.10, align 16, !tbaa !5
%add.2.11 = add nsw i32 %rem.2.10, 1
%rem.2.11 = srem i32 %add.2.11, 7
%arrayidx33.2.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 13
store i32 %rem.2.11, ptr %arrayidx33.2.11, align 4, !tbaa !5
%add.2.12 = add nsw i32 %rem.2.11, 1
%rem.2.12 = srem i32 %add.2.12, 7
%arrayidx33.2.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 14
store i32 %rem.2.12, ptr %arrayidx33.2.12, align 8, !tbaa !5
%add.2.13 = add nsw i32 %rem.2.12, 1
%rem.2.13 = srem i32 %add.2.13, 7
%arrayidx33.2.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 15
store i32 %rem.2.13, ptr %arrayidx33.2.13, align 4, !tbaa !5
%add.2.14 = add nsw i32 %rem.2.13, 1
%rem.2.14 = srem i32 %add.2.14, 7
%arrayidx33.2.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 16
store i32 %rem.2.14, ptr %arrayidx33.2.14, align 16, !tbaa !5
%add.2.15 = add nsw i32 %rem.2.14, 1
%rem.2.15 = srem i32 %add.2.15, 7
%arrayidx33.2.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 17
store i32 %rem.2.15, ptr %arrayidx33.2.15, align 4, !tbaa !5
%add.2.16 = add nsw i32 %rem.2.15, 1
%rem.2.16 = srem i32 %add.2.16, 7
%arrayidx33.2.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 18
store i32 %rem.2.16, ptr %arrayidx33.2.16, align 8, !tbaa !5
%add.2.17 = add nsw i32 %rem.2.16, 1
%rem.2.17 = srem i32 %add.2.17, 7
%arrayidx33.2.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 19
store i32 %rem.2.17, ptr %arrayidx33.2.17, align 4, !tbaa !5
%add.2.18 = add nsw i32 %rem.2.17, 1
%rem.2.18 = srem i32 %add.2.18, 7
%arrayidx33.2.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 20
store i32 %rem.2.18, ptr %arrayidx33.2.18, align 16, !tbaa !5
%add.2.19 = add nsw i32 %rem.2.18, 1
%rem.2.19 = srem i32 %add.2.19, 7
%arrayidx33.2.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 21
store i32 %rem.2.19, ptr %arrayidx33.2.19, align 4, !tbaa !5
%add.2.20 = add nsw i32 %rem.2.19, 1
%rem.2.20 = srem i32 %add.2.20, 7
%arrayidx33.2.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 22
store i32 %rem.2.20, ptr %arrayidx33.2.20, align 8, !tbaa !5
%add.2.21 = add nsw i32 %rem.2.20, 1
%rem.2.21 = srem i32 %add.2.21, 7
%arrayidx33.2.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 23
store i32 %rem.2.21, ptr %arrayidx33.2.21, align 4, !tbaa !5
%add.2.22 = add nsw i32 %rem.2.21, 1
%rem.2.22 = srem i32 %add.2.22, 7
%arrayidx33.2.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 24
store i32 %rem.2.22, ptr %arrayidx33.2.22, align 16, !tbaa !5
%add.2.23 = add nsw i32 %rem.2.22, 1
%rem.2.23 = srem i32 %add.2.23, 7
%arrayidx33.2.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 25
store i32 %rem.2.23, ptr %arrayidx33.2.23, align 4, !tbaa !5
%add.2.24 = add nsw i32 %rem.2.23, 1
%rem.2.24 = srem i32 %add.2.24, 7
%arrayidx33.2.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 26
store i32 %rem.2.24, ptr %arrayidx33.2.24, align 8, !tbaa !5
%add.2.25 = add nsw i32 %rem.2.24, 1
%rem.2.25 = srem i32 %add.2.25, 7
%arrayidx33.2.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 27
store i32 %rem.2.25, ptr %arrayidx33.2.25, align 4, !tbaa !5
%add.2.26 = add nsw i32 %rem.2.25, 1
%rem.2.26 = srem i32 %add.2.26, 7
%arrayidx33.2.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 28
store i32 %rem.2.26, ptr %arrayidx33.2.26, align 16, !tbaa !5
%add.2.27 = add nsw i32 %rem.2.26, 1
%rem.2.27 = srem i32 %add.2.27, 7
%arrayidx33.2.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 29
store i32 %rem.2.27, ptr %arrayidx33.2.27, align 4, !tbaa !5
%add.2.28 = add nsw i32 %rem.2.27, 1
%rem.2.28 = srem i32 %add.2.28, 7
%arrayidx33.2.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 30
store i32 %rem.2.28, ptr %arrayidx33.2.28, align 8, !tbaa !5
%add.2.29 = add nsw i32 %rem.2.28, 1
%rem.2.29 = srem i32 %add.2.29, 7
%arrayidx33.2.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 3, i64 31
store i32 %rem.2.29, ptr %arrayidx33.2.29, align 4, !tbaa !5
%.pre116 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add.3 = add nsw i32 %.pre116, 1
%rem.3 = srem i32 %add.3, 7
%arrayidx33.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 2
store i32 %rem.3, ptr %arrayidx33.3, align 8, !tbaa !5
%add.3.1 = add nsw i32 %rem.3, 1
%rem.3.1 = srem i32 %add.3.1, 7
%arrayidx33.3.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 3
store i32 %rem.3.1, ptr %arrayidx33.3.1, align 4, !tbaa !5
%add.3.2 = add nsw i32 %rem.3.1, 1
%rem.3.2 = srem i32 %add.3.2, 7
%arrayidx33.3.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 4
store i32 %rem.3.2, ptr %arrayidx33.3.2, align 16, !tbaa !5
%add.3.3 = add nsw i32 %rem.3.2, 1
%rem.3.3 = srem i32 %add.3.3, 7
%arrayidx33.3.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 5
store i32 %rem.3.3, ptr %arrayidx33.3.3, align 4, !tbaa !5
%add.3.4 = add nsw i32 %rem.3.3, 1
%rem.3.4 = srem i32 %add.3.4, 7
%arrayidx33.3.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 6
store i32 %rem.3.4, ptr %arrayidx33.3.4, align 8, !tbaa !5
%add.3.5 = add nsw i32 %rem.3.4, 1
%rem.3.5 = srem i32 %add.3.5, 7
%arrayidx33.3.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 7
store i32 %rem.3.5, ptr %arrayidx33.3.5, align 4, !tbaa !5
%add.3.6 = add nsw i32 %rem.3.5, 1
%rem.3.6 = srem i32 %add.3.6, 7
%arrayidx33.3.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 8
store i32 %rem.3.6, ptr %arrayidx33.3.6, align 16, !tbaa !5
%add.3.7 = add nsw i32 %rem.3.6, 1
%rem.3.7 = srem i32 %add.3.7, 7
%arrayidx33.3.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 9
store i32 %rem.3.7, ptr %arrayidx33.3.7, align 4, !tbaa !5
%add.3.8 = add nsw i32 %rem.3.7, 1
%rem.3.8 = srem i32 %add.3.8, 7
%arrayidx33.3.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 10
store i32 %rem.3.8, ptr %arrayidx33.3.8, align 8, !tbaa !5
%add.3.9 = add nsw i32 %rem.3.8, 1
%rem.3.9 = srem i32 %add.3.9, 7
%arrayidx33.3.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 11
store i32 %rem.3.9, ptr %arrayidx33.3.9, align 4, !tbaa !5
%add.3.10 = add nsw i32 %rem.3.9, 1
%rem.3.10 = srem i32 %add.3.10, 7
%arrayidx33.3.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 12
store i32 %rem.3.10, ptr %arrayidx33.3.10, align 16, !tbaa !5
%add.3.11 = add nsw i32 %rem.3.10, 1
%rem.3.11 = srem i32 %add.3.11, 7
%arrayidx33.3.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 13
store i32 %rem.3.11, ptr %arrayidx33.3.11, align 4, !tbaa !5
%add.3.12 = add nsw i32 %rem.3.11, 1
%rem.3.12 = srem i32 %add.3.12, 7
%arrayidx33.3.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 14
store i32 %rem.3.12, ptr %arrayidx33.3.12, align 8, !tbaa !5
%add.3.13 = add nsw i32 %rem.3.12, 1
%rem.3.13 = srem i32 %add.3.13, 7
%arrayidx33.3.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 15
store i32 %rem.3.13, ptr %arrayidx33.3.13, align 4, !tbaa !5
%add.3.14 = add nsw i32 %rem.3.13, 1
%rem.3.14 = srem i32 %add.3.14, 7
%arrayidx33.3.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 16
store i32 %rem.3.14, ptr %arrayidx33.3.14, align 16, !tbaa !5
%add.3.15 = add nsw i32 %rem.3.14, 1
%rem.3.15 = srem i32 %add.3.15, 7
%arrayidx33.3.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 17
store i32 %rem.3.15, ptr %arrayidx33.3.15, align 4, !tbaa !5
%add.3.16 = add nsw i32 %rem.3.15, 1
%rem.3.16 = srem i32 %add.3.16, 7
%arrayidx33.3.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 18
store i32 %rem.3.16, ptr %arrayidx33.3.16, align 8, !tbaa !5
%add.3.17 = add nsw i32 %rem.3.16, 1
%rem.3.17 = srem i32 %add.3.17, 7
%arrayidx33.3.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 19
store i32 %rem.3.17, ptr %arrayidx33.3.17, align 4, !tbaa !5
%add.3.18 = add nsw i32 %rem.3.17, 1
%rem.3.18 = srem i32 %add.3.18, 7
%arrayidx33.3.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 20
store i32 %rem.3.18, ptr %arrayidx33.3.18, align 16, !tbaa !5
%add.3.19 = add nsw i32 %rem.3.18, 1
%rem.3.19 = srem i32 %add.3.19, 7
%arrayidx33.3.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 21
store i32 %rem.3.19, ptr %arrayidx33.3.19, align 4, !tbaa !5
%add.3.20 = add nsw i32 %rem.3.19, 1
%rem.3.20 = srem i32 %add.3.20, 7
%arrayidx33.3.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 22
store i32 %rem.3.20, ptr %arrayidx33.3.20, align 8, !tbaa !5
%add.3.21 = add nsw i32 %rem.3.20, 1
%rem.3.21 = srem i32 %add.3.21, 7
%arrayidx33.3.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 23
store i32 %rem.3.21, ptr %arrayidx33.3.21, align 4, !tbaa !5
%add.3.22 = add nsw i32 %rem.3.21, 1
%rem.3.22 = srem i32 %add.3.22, 7
%arrayidx33.3.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 24
store i32 %rem.3.22, ptr %arrayidx33.3.22, align 16, !tbaa !5
%add.3.23 = add nsw i32 %rem.3.22, 1
%rem.3.23 = srem i32 %add.3.23, 7
%arrayidx33.3.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 25
store i32 %rem.3.23, ptr %arrayidx33.3.23, align 4, !tbaa !5
%add.3.24 = add nsw i32 %rem.3.23, 1
%rem.3.24 = srem i32 %add.3.24, 7
%arrayidx33.3.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 26
store i32 %rem.3.24, ptr %arrayidx33.3.24, align 8, !tbaa !5
%add.3.25 = add nsw i32 %rem.3.24, 1
%rem.3.25 = srem i32 %add.3.25, 7
%arrayidx33.3.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 27
store i32 %rem.3.25, ptr %arrayidx33.3.25, align 4, !tbaa !5
%add.3.26 = add nsw i32 %rem.3.25, 1
%rem.3.26 = srem i32 %add.3.26, 7
%arrayidx33.3.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 28
store i32 %rem.3.26, ptr %arrayidx33.3.26, align 16, !tbaa !5
%add.3.27 = add nsw i32 %rem.3.26, 1
%rem.3.27 = srem i32 %add.3.27, 7
%arrayidx33.3.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 29
store i32 %rem.3.27, ptr %arrayidx33.3.27, align 4, !tbaa !5
%add.3.28 = add nsw i32 %rem.3.27, 1
%rem.3.28 = srem i32 %add.3.28, 7
%arrayidx33.3.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 30
store i32 %rem.3.28, ptr %arrayidx33.3.28, align 8, !tbaa !5
%add.3.29 = add nsw i32 %rem.3.28, 1
%rem.3.29 = srem i32 %add.3.29, 7
%arrayidx33.3.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 4, i64 31
store i32 %rem.3.29, ptr %arrayidx33.3.29, align 4, !tbaa !5
%.pre117 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%add.4 = add nsw i32 %.pre117, 1
%rem.4 = srem i32 %add.4, 7
%arrayidx33.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 2
store i32 %rem.4, ptr %arrayidx33.4, align 8, !tbaa !5
%add.4.1 = add nsw i32 %rem.4, 1
%rem.4.1 = srem i32 %add.4.1, 7
%arrayidx33.4.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 3
store i32 %rem.4.1, ptr %arrayidx33.4.1, align 4, !tbaa !5
%add.4.2 = add nsw i32 %rem.4.1, 1
%rem.4.2 = srem i32 %add.4.2, 7
%arrayidx33.4.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 4
store i32 %rem.4.2, ptr %arrayidx33.4.2, align 16, !tbaa !5
%add.4.3 = add nsw i32 %rem.4.2, 1
%rem.4.3 = srem i32 %add.4.3, 7
%arrayidx33.4.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 5
store i32 %rem.4.3, ptr %arrayidx33.4.3, align 4, !tbaa !5
%add.4.4 = add nsw i32 %rem.4.3, 1
%rem.4.4 = srem i32 %add.4.4, 7
%arrayidx33.4.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 6
store i32 %rem.4.4, ptr %arrayidx33.4.4, align 8, !tbaa !5
%add.4.5 = add nsw i32 %rem.4.4, 1
%rem.4.5 = srem i32 %add.4.5, 7
%arrayidx33.4.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 7
store i32 %rem.4.5, ptr %arrayidx33.4.5, align 4, !tbaa !5
%add.4.6 = add nsw i32 %rem.4.5, 1
%rem.4.6 = srem i32 %add.4.6, 7
%arrayidx33.4.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 8
store i32 %rem.4.6, ptr %arrayidx33.4.6, align 16, !tbaa !5
%add.4.7 = add nsw i32 %rem.4.6, 1
%rem.4.7 = srem i32 %add.4.7, 7
%arrayidx33.4.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 9
store i32 %rem.4.7, ptr %arrayidx33.4.7, align 4, !tbaa !5
%add.4.8 = add nsw i32 %rem.4.7, 1
%rem.4.8 = srem i32 %add.4.8, 7
%arrayidx33.4.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 10
store i32 %rem.4.8, ptr %arrayidx33.4.8, align 8, !tbaa !5
%add.4.9 = add nsw i32 %rem.4.8, 1
%rem.4.9 = srem i32 %add.4.9, 7
%arrayidx33.4.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 11
store i32 %rem.4.9, ptr %arrayidx33.4.9, align 4, !tbaa !5
%add.4.10 = add nsw i32 %rem.4.9, 1
%rem.4.10 = srem i32 %add.4.10, 7
%arrayidx33.4.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 12
store i32 %rem.4.10, ptr %arrayidx33.4.10, align 16, !tbaa !5
%add.4.11 = add nsw i32 %rem.4.10, 1
%rem.4.11 = srem i32 %add.4.11, 7
%arrayidx33.4.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 13
store i32 %rem.4.11, ptr %arrayidx33.4.11, align 4, !tbaa !5
%add.4.12 = add nsw i32 %rem.4.11, 1
%rem.4.12 = srem i32 %add.4.12, 7
%arrayidx33.4.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 14
store i32 %rem.4.12, ptr %arrayidx33.4.12, align 8, !tbaa !5
%add.4.13 = add nsw i32 %rem.4.12, 1
%rem.4.13 = srem i32 %add.4.13, 7
%arrayidx33.4.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 15
store i32 %rem.4.13, ptr %arrayidx33.4.13, align 4, !tbaa !5
%add.4.14 = add nsw i32 %rem.4.13, 1
%rem.4.14 = srem i32 %add.4.14, 7
%arrayidx33.4.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 16
store i32 %rem.4.14, ptr %arrayidx33.4.14, align 16, !tbaa !5
%add.4.15 = add nsw i32 %rem.4.14, 1
%rem.4.15 = srem i32 %add.4.15, 7
%arrayidx33.4.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 17
store i32 %rem.4.15, ptr %arrayidx33.4.15, align 4, !tbaa !5
%add.4.16 = add nsw i32 %rem.4.15, 1
%rem.4.16 = srem i32 %add.4.16, 7
%arrayidx33.4.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 18
store i32 %rem.4.16, ptr %arrayidx33.4.16, align 8, !tbaa !5
%add.4.17 = add nsw i32 %rem.4.16, 1
%rem.4.17 = srem i32 %add.4.17, 7
%arrayidx33.4.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 19
store i32 %rem.4.17, ptr %arrayidx33.4.17, align 4, !tbaa !5
%add.4.18 = add nsw i32 %rem.4.17, 1
%rem.4.18 = srem i32 %add.4.18, 7
%arrayidx33.4.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 20
store i32 %rem.4.18, ptr %arrayidx33.4.18, align 16, !tbaa !5
%add.4.19 = add nsw i32 %rem.4.18, 1
%rem.4.19 = srem i32 %add.4.19, 7
%arrayidx33.4.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 21
store i32 %rem.4.19, ptr %arrayidx33.4.19, align 4, !tbaa !5
%add.4.20 = add nsw i32 %rem.4.19, 1
%rem.4.20 = srem i32 %add.4.20, 7
%arrayidx33.4.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 22
store i32 %rem.4.20, ptr %arrayidx33.4.20, align 8, !tbaa !5
%add.4.21 = add nsw i32 %rem.4.20, 1
%rem.4.21 = srem i32 %add.4.21, 7
%arrayidx33.4.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 23
store i32 %rem.4.21, ptr %arrayidx33.4.21, align 4, !tbaa !5
%add.4.22 = add nsw i32 %rem.4.21, 1
%rem.4.22 = srem i32 %add.4.22, 7
%arrayidx33.4.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 24
store i32 %rem.4.22, ptr %arrayidx33.4.22, align 16, !tbaa !5
%add.4.23 = add nsw i32 %rem.4.22, 1
%rem.4.23 = srem i32 %add.4.23, 7
%arrayidx33.4.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 25
store i32 %rem.4.23, ptr %arrayidx33.4.23, align 4, !tbaa !5
%add.4.24 = add nsw i32 %rem.4.23, 1
%rem.4.24 = srem i32 %add.4.24, 7
%arrayidx33.4.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 26
store i32 %rem.4.24, ptr %arrayidx33.4.24, align 8, !tbaa !5
%add.4.25 = add nsw i32 %rem.4.24, 1
%rem.4.25 = srem i32 %add.4.25, 7
%arrayidx33.4.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 27
store i32 %rem.4.25, ptr %arrayidx33.4.25, align 4, !tbaa !5
%add.4.26 = add nsw i32 %rem.4.25, 1
%rem.4.26 = srem i32 %add.4.26, 7
%arrayidx33.4.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 28
store i32 %rem.4.26, ptr %arrayidx33.4.26, align 16, !tbaa !5
%add.4.27 = add nsw i32 %rem.4.26, 1
%rem.4.27 = srem i32 %add.4.27, 7
%arrayidx33.4.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 29
store i32 %rem.4.27, ptr %arrayidx33.4.27, align 4, !tbaa !5
%add.4.28 = add nsw i32 %rem.4.27, 1
%rem.4.28 = srem i32 %add.4.28, 7
%arrayidx33.4.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 30
store i32 %rem.4.28, ptr %arrayidx33.4.28, align 8, !tbaa !5
%add.4.29 = add nsw i32 %rem.4.28, 1
%rem.4.29 = srem i32 %add.4.29, 7
%arrayidx33.4.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 5, i64 31
store i32 %rem.4.29, ptr %arrayidx33.4.29, align 4, !tbaa !5
%.pre118 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%add.5 = add nsw i32 %.pre118, 1
%rem.5 = srem i32 %add.5, 7
%arrayidx33.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 2
store i32 %rem.5, ptr %arrayidx33.5, align 8, !tbaa !5
%add.5.1 = add nsw i32 %rem.5, 1
%rem.5.1 = srem i32 %add.5.1, 7
%arrayidx33.5.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 3
store i32 %rem.5.1, ptr %arrayidx33.5.1, align 4, !tbaa !5
%add.5.2 = add nsw i32 %rem.5.1, 1
%rem.5.2 = srem i32 %add.5.2, 7
%arrayidx33.5.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 4
store i32 %rem.5.2, ptr %arrayidx33.5.2, align 16, !tbaa !5
%add.5.3 = add nsw i32 %rem.5.2, 1
%rem.5.3 = srem i32 %add.5.3, 7
%arrayidx33.5.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 5
store i32 %rem.5.3, ptr %arrayidx33.5.3, align 4, !tbaa !5
%add.5.4 = add nsw i32 %rem.5.3, 1
%rem.5.4 = srem i32 %add.5.4, 7
%arrayidx33.5.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 6
store i32 %rem.5.4, ptr %arrayidx33.5.4, align 8, !tbaa !5
%add.5.5 = add nsw i32 %rem.5.4, 1
%rem.5.5 = srem i32 %add.5.5, 7
%arrayidx33.5.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 7
store i32 %rem.5.5, ptr %arrayidx33.5.5, align 4, !tbaa !5
%add.5.6 = add nsw i32 %rem.5.5, 1
%rem.5.6 = srem i32 %add.5.6, 7
%arrayidx33.5.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 8
store i32 %rem.5.6, ptr %arrayidx33.5.6, align 16, !tbaa !5
%add.5.7 = add nsw i32 %rem.5.6, 1
%rem.5.7 = srem i32 %add.5.7, 7
%arrayidx33.5.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 9
store i32 %rem.5.7, ptr %arrayidx33.5.7, align 4, !tbaa !5
%add.5.8 = add nsw i32 %rem.5.7, 1
%rem.5.8 = srem i32 %add.5.8, 7
%arrayidx33.5.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 10
store i32 %rem.5.8, ptr %arrayidx33.5.8, align 8, !tbaa !5
%add.5.9 = add nsw i32 %rem.5.8, 1
%rem.5.9 = srem i32 %add.5.9, 7
%arrayidx33.5.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 11
store i32 %rem.5.9, ptr %arrayidx33.5.9, align 4, !tbaa !5
%add.5.10 = add nsw i32 %rem.5.9, 1
%rem.5.10 = srem i32 %add.5.10, 7
%arrayidx33.5.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 12
store i32 %rem.5.10, ptr %arrayidx33.5.10, align 16, !tbaa !5
%add.5.11 = add nsw i32 %rem.5.10, 1
%rem.5.11 = srem i32 %add.5.11, 7
%arrayidx33.5.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 13
store i32 %rem.5.11, ptr %arrayidx33.5.11, align 4, !tbaa !5
%add.5.12 = add nsw i32 %rem.5.11, 1
%rem.5.12 = srem i32 %add.5.12, 7
%arrayidx33.5.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 14
store i32 %rem.5.12, ptr %arrayidx33.5.12, align 8, !tbaa !5
%add.5.13 = add nsw i32 %rem.5.12, 1
%rem.5.13 = srem i32 %add.5.13, 7
%arrayidx33.5.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 15
store i32 %rem.5.13, ptr %arrayidx33.5.13, align 4, !tbaa !5
%add.5.14 = add nsw i32 %rem.5.13, 1
%rem.5.14 = srem i32 %add.5.14, 7
%arrayidx33.5.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 16
store i32 %rem.5.14, ptr %arrayidx33.5.14, align 16, !tbaa !5
%add.5.15 = add nsw i32 %rem.5.14, 1
%rem.5.15 = srem i32 %add.5.15, 7
%arrayidx33.5.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 17
store i32 %rem.5.15, ptr %arrayidx33.5.15, align 4, !tbaa !5
%add.5.16 = add nsw i32 %rem.5.15, 1
%rem.5.16 = srem i32 %add.5.16, 7
%arrayidx33.5.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 18
store i32 %rem.5.16, ptr %arrayidx33.5.16, align 8, !tbaa !5
%add.5.17 = add nsw i32 %rem.5.16, 1
%rem.5.17 = srem i32 %add.5.17, 7
%arrayidx33.5.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 19
store i32 %rem.5.17, ptr %arrayidx33.5.17, align 4, !tbaa !5
%add.5.18 = add nsw i32 %rem.5.17, 1
%rem.5.18 = srem i32 %add.5.18, 7
%arrayidx33.5.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 20
store i32 %rem.5.18, ptr %arrayidx33.5.18, align 16, !tbaa !5
%add.5.19 = add nsw i32 %rem.5.18, 1
%rem.5.19 = srem i32 %add.5.19, 7
%arrayidx33.5.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 21
store i32 %rem.5.19, ptr %arrayidx33.5.19, align 4, !tbaa !5
%add.5.20 = add nsw i32 %rem.5.19, 1
%rem.5.20 = srem i32 %add.5.20, 7
%arrayidx33.5.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 22
store i32 %rem.5.20, ptr %arrayidx33.5.20, align 8, !tbaa !5
%add.5.21 = add nsw i32 %rem.5.20, 1
%rem.5.21 = srem i32 %add.5.21, 7
%arrayidx33.5.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 23
store i32 %rem.5.21, ptr %arrayidx33.5.21, align 4, !tbaa !5
%add.5.22 = add nsw i32 %rem.5.21, 1
%rem.5.22 = srem i32 %add.5.22, 7
%arrayidx33.5.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 24
store i32 %rem.5.22, ptr %arrayidx33.5.22, align 16, !tbaa !5
%add.5.23 = add nsw i32 %rem.5.22, 1
%rem.5.23 = srem i32 %add.5.23, 7
%arrayidx33.5.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 25
store i32 %rem.5.23, ptr %arrayidx33.5.23, align 4, !tbaa !5
%add.5.24 = add nsw i32 %rem.5.23, 1
%rem.5.24 = srem i32 %add.5.24, 7
%arrayidx33.5.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 26
store i32 %rem.5.24, ptr %arrayidx33.5.24, align 8, !tbaa !5
%add.5.25 = add nsw i32 %rem.5.24, 1
%rem.5.25 = srem i32 %add.5.25, 7
%arrayidx33.5.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 27
store i32 %rem.5.25, ptr %arrayidx33.5.25, align 4, !tbaa !5
%add.5.26 = add nsw i32 %rem.5.25, 1
%rem.5.26 = srem i32 %add.5.26, 7
%arrayidx33.5.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 28
store i32 %rem.5.26, ptr %arrayidx33.5.26, align 16, !tbaa !5
%add.5.27 = add nsw i32 %rem.5.26, 1
%rem.5.27 = srem i32 %add.5.27, 7
%arrayidx33.5.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 29
store i32 %rem.5.27, ptr %arrayidx33.5.27, align 4, !tbaa !5
%add.5.28 = add nsw i32 %rem.5.27, 1
%rem.5.28 = srem i32 %add.5.28, 7
%arrayidx33.5.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 30
store i32 %rem.5.28, ptr %arrayidx33.5.28, align 8, !tbaa !5
%add.5.29 = add nsw i32 %rem.5.28, 1
%rem.5.29 = srem i32 %add.5.29, 7
%arrayidx33.5.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 6, i64 31
store i32 %rem.5.29, ptr %arrayidx33.5.29, align 4, !tbaa !5
%.pre119 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%add.6 = add nsw i32 %.pre119, 1
%rem.6 = srem i32 %add.6, 7
%arrayidx33.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 2
store i32 %rem.6, ptr %arrayidx33.6, align 8, !tbaa !5
%add.6.1 = add nsw i32 %rem.6, 1
%rem.6.1 = srem i32 %add.6.1, 7
%arrayidx33.6.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 3
store i32 %rem.6.1, ptr %arrayidx33.6.1, align 4, !tbaa !5
%add.6.2 = add nsw i32 %rem.6.1, 1
%rem.6.2 = srem i32 %add.6.2, 7
%arrayidx33.6.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 4
store i32 %rem.6.2, ptr %arrayidx33.6.2, align 16, !tbaa !5
%add.6.3 = add nsw i32 %rem.6.2, 1
%rem.6.3 = srem i32 %add.6.3, 7
%arrayidx33.6.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 5
store i32 %rem.6.3, ptr %arrayidx33.6.3, align 4, !tbaa !5
%add.6.4 = add nsw i32 %rem.6.3, 1
%rem.6.4 = srem i32 %add.6.4, 7
%arrayidx33.6.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 6
store i32 %rem.6.4, ptr %arrayidx33.6.4, align 8, !tbaa !5
%add.6.5 = add nsw i32 %rem.6.4, 1
%rem.6.5 = srem i32 %add.6.5, 7
%arrayidx33.6.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 7
store i32 %rem.6.5, ptr %arrayidx33.6.5, align 4, !tbaa !5
%add.6.6 = add nsw i32 %rem.6.5, 1
%rem.6.6 = srem i32 %add.6.6, 7
%arrayidx33.6.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 8
store i32 %rem.6.6, ptr %arrayidx33.6.6, align 16, !tbaa !5
%add.6.7 = add nsw i32 %rem.6.6, 1
%rem.6.7 = srem i32 %add.6.7, 7
%arrayidx33.6.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 9
store i32 %rem.6.7, ptr %arrayidx33.6.7, align 4, !tbaa !5
%add.6.8 = add nsw i32 %rem.6.7, 1
%rem.6.8 = srem i32 %add.6.8, 7
%arrayidx33.6.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 10
store i32 %rem.6.8, ptr %arrayidx33.6.8, align 8, !tbaa !5
%add.6.9 = add nsw i32 %rem.6.8, 1
%rem.6.9 = srem i32 %add.6.9, 7
%arrayidx33.6.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 11
store i32 %rem.6.9, ptr %arrayidx33.6.9, align 4, !tbaa !5
%add.6.10 = add nsw i32 %rem.6.9, 1
%rem.6.10 = srem i32 %add.6.10, 7
%arrayidx33.6.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 12
store i32 %rem.6.10, ptr %arrayidx33.6.10, align 16, !tbaa !5
%add.6.11 = add nsw i32 %rem.6.10, 1
%rem.6.11 = srem i32 %add.6.11, 7
%arrayidx33.6.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 13
store i32 %rem.6.11, ptr %arrayidx33.6.11, align 4, !tbaa !5
%add.6.12 = add nsw i32 %rem.6.11, 1
%rem.6.12 = srem i32 %add.6.12, 7
%arrayidx33.6.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 14
store i32 %rem.6.12, ptr %arrayidx33.6.12, align 8, !tbaa !5
%add.6.13 = add nsw i32 %rem.6.12, 1
%rem.6.13 = srem i32 %add.6.13, 7
%arrayidx33.6.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 15
store i32 %rem.6.13, ptr %arrayidx33.6.13, align 4, !tbaa !5
%add.6.14 = add nsw i32 %rem.6.13, 1
%rem.6.14 = srem i32 %add.6.14, 7
%arrayidx33.6.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 16
store i32 %rem.6.14, ptr %arrayidx33.6.14, align 16, !tbaa !5
%add.6.15 = add nsw i32 %rem.6.14, 1
%rem.6.15 = srem i32 %add.6.15, 7
%arrayidx33.6.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 17
store i32 %rem.6.15, ptr %arrayidx33.6.15, align 4, !tbaa !5
%add.6.16 = add nsw i32 %rem.6.15, 1
%rem.6.16 = srem i32 %add.6.16, 7
%arrayidx33.6.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 18
store i32 %rem.6.16, ptr %arrayidx33.6.16, align 8, !tbaa !5
%add.6.17 = add nsw i32 %rem.6.16, 1
%rem.6.17 = srem i32 %add.6.17, 7
%arrayidx33.6.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 19
store i32 %rem.6.17, ptr %arrayidx33.6.17, align 4, !tbaa !5
%add.6.18 = add nsw i32 %rem.6.17, 1
%rem.6.18 = srem i32 %add.6.18, 7
%arrayidx33.6.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 20
store i32 %rem.6.18, ptr %arrayidx33.6.18, align 16, !tbaa !5
%add.6.19 = add nsw i32 %rem.6.18, 1
%rem.6.19 = srem i32 %add.6.19, 7
%arrayidx33.6.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 21
store i32 %rem.6.19, ptr %arrayidx33.6.19, align 4, !tbaa !5
%add.6.20 = add nsw i32 %rem.6.19, 1
%rem.6.20 = srem i32 %add.6.20, 7
%arrayidx33.6.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 22
store i32 %rem.6.20, ptr %arrayidx33.6.20, align 8, !tbaa !5
%add.6.21 = add nsw i32 %rem.6.20, 1
%rem.6.21 = srem i32 %add.6.21, 7
%arrayidx33.6.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 23
store i32 %rem.6.21, ptr %arrayidx33.6.21, align 4, !tbaa !5
%add.6.22 = add nsw i32 %rem.6.21, 1
%rem.6.22 = srem i32 %add.6.22, 7
%arrayidx33.6.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 24
store i32 %rem.6.22, ptr %arrayidx33.6.22, align 16, !tbaa !5
%add.6.23 = add nsw i32 %rem.6.22, 1
%rem.6.23 = srem i32 %add.6.23, 7
%arrayidx33.6.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 25
store i32 %rem.6.23, ptr %arrayidx33.6.23, align 4, !tbaa !5
%add.6.24 = add nsw i32 %rem.6.23, 1
%rem.6.24 = srem i32 %add.6.24, 7
%arrayidx33.6.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 26
store i32 %rem.6.24, ptr %arrayidx33.6.24, align 8, !tbaa !5
%add.6.25 = add nsw i32 %rem.6.24, 1
%rem.6.25 = srem i32 %add.6.25, 7
%arrayidx33.6.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 27
store i32 %rem.6.25, ptr %arrayidx33.6.25, align 4, !tbaa !5
%add.6.26 = add nsw i32 %rem.6.25, 1
%rem.6.26 = srem i32 %add.6.26, 7
%arrayidx33.6.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 28
store i32 %rem.6.26, ptr %arrayidx33.6.26, align 16, !tbaa !5
%add.6.27 = add nsw i32 %rem.6.26, 1
%rem.6.27 = srem i32 %add.6.27, 7
%arrayidx33.6.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 29
store i32 %rem.6.27, ptr %arrayidx33.6.27, align 4, !tbaa !5
%add.6.28 = add nsw i32 %rem.6.27, 1
%rem.6.28 = srem i32 %add.6.28, 7
%arrayidx33.6.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 30
store i32 %rem.6.28, ptr %arrayidx33.6.28, align 8, !tbaa !5
%add.6.29 = add nsw i32 %rem.6.28, 1
%rem.6.29 = srem i32 %add.6.29, 7
%arrayidx33.6.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 7, i64 31
store i32 %rem.6.29, ptr %arrayidx33.6.29, align 4, !tbaa !5
%.pre120 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%add.7 = add nsw i32 %.pre120, 1
%rem.7 = srem i32 %add.7, 7
%arrayidx33.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 2
store i32 %rem.7, ptr %arrayidx33.7, align 8, !tbaa !5
%add.7.1 = add nsw i32 %rem.7, 1
%rem.7.1 = srem i32 %add.7.1, 7
%arrayidx33.7.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 3
store i32 %rem.7.1, ptr %arrayidx33.7.1, align 4, !tbaa !5
%add.7.2 = add nsw i32 %rem.7.1, 1
%rem.7.2 = srem i32 %add.7.2, 7
%arrayidx33.7.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 4
store i32 %rem.7.2, ptr %arrayidx33.7.2, align 16, !tbaa !5
%add.7.3 = add nsw i32 %rem.7.2, 1
%rem.7.3 = srem i32 %add.7.3, 7
%arrayidx33.7.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 5
store i32 %rem.7.3, ptr %arrayidx33.7.3, align 4, !tbaa !5
%add.7.4 = add nsw i32 %rem.7.3, 1
%rem.7.4 = srem i32 %add.7.4, 7
%arrayidx33.7.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 6
store i32 %rem.7.4, ptr %arrayidx33.7.4, align 8, !tbaa !5
%add.7.5 = add nsw i32 %rem.7.4, 1
%rem.7.5 = srem i32 %add.7.5, 7
%arrayidx33.7.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 7
store i32 %rem.7.5, ptr %arrayidx33.7.5, align 4, !tbaa !5
%add.7.6 = add nsw i32 %rem.7.5, 1
%rem.7.6 = srem i32 %add.7.6, 7
%arrayidx33.7.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 8
store i32 %rem.7.6, ptr %arrayidx33.7.6, align 16, !tbaa !5
%add.7.7 = add nsw i32 %rem.7.6, 1
%rem.7.7 = srem i32 %add.7.7, 7
%arrayidx33.7.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 9
store i32 %rem.7.7, ptr %arrayidx33.7.7, align 4, !tbaa !5
%add.7.8 = add nsw i32 %rem.7.7, 1
%rem.7.8 = srem i32 %add.7.8, 7
%arrayidx33.7.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 10
store i32 %rem.7.8, ptr %arrayidx33.7.8, align 8, !tbaa !5
%add.7.9 = add nsw i32 %rem.7.8, 1
%rem.7.9 = srem i32 %add.7.9, 7
%arrayidx33.7.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 11
store i32 %rem.7.9, ptr %arrayidx33.7.9, align 4, !tbaa !5
%add.7.10 = add nsw i32 %rem.7.9, 1
%rem.7.10 = srem i32 %add.7.10, 7
%arrayidx33.7.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 12
store i32 %rem.7.10, ptr %arrayidx33.7.10, align 16, !tbaa !5
%add.7.11 = add nsw i32 %rem.7.10, 1
%rem.7.11 = srem i32 %add.7.11, 7
%arrayidx33.7.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 13
store i32 %rem.7.11, ptr %arrayidx33.7.11, align 4, !tbaa !5
%add.7.12 = add nsw i32 %rem.7.11, 1
%rem.7.12 = srem i32 %add.7.12, 7
%arrayidx33.7.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 14
store i32 %rem.7.12, ptr %arrayidx33.7.12, align 8, !tbaa !5
%add.7.13 = add nsw i32 %rem.7.12, 1
%rem.7.13 = srem i32 %add.7.13, 7
%arrayidx33.7.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 15
store i32 %rem.7.13, ptr %arrayidx33.7.13, align 4, !tbaa !5
%add.7.14 = add nsw i32 %rem.7.13, 1
%rem.7.14 = srem i32 %add.7.14, 7
%arrayidx33.7.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 16
store i32 %rem.7.14, ptr %arrayidx33.7.14, align 16, !tbaa !5
%add.7.15 = add nsw i32 %rem.7.14, 1
%rem.7.15 = srem i32 %add.7.15, 7
%arrayidx33.7.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 17
store i32 %rem.7.15, ptr %arrayidx33.7.15, align 4, !tbaa !5
%add.7.16 = add nsw i32 %rem.7.15, 1
%rem.7.16 = srem i32 %add.7.16, 7
%arrayidx33.7.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 18
store i32 %rem.7.16, ptr %arrayidx33.7.16, align 8, !tbaa !5
%add.7.17 = add nsw i32 %rem.7.16, 1
%rem.7.17 = srem i32 %add.7.17, 7
%arrayidx33.7.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 19
store i32 %rem.7.17, ptr %arrayidx33.7.17, align 4, !tbaa !5
%add.7.18 = add nsw i32 %rem.7.17, 1
%rem.7.18 = srem i32 %add.7.18, 7
%arrayidx33.7.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 20
store i32 %rem.7.18, ptr %arrayidx33.7.18, align 16, !tbaa !5
%add.7.19 = add nsw i32 %rem.7.18, 1
%rem.7.19 = srem i32 %add.7.19, 7
%arrayidx33.7.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 21
store i32 %rem.7.19, ptr %arrayidx33.7.19, align 4, !tbaa !5
%add.7.20 = add nsw i32 %rem.7.19, 1
%rem.7.20 = srem i32 %add.7.20, 7
%arrayidx33.7.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 22
store i32 %rem.7.20, ptr %arrayidx33.7.20, align 8, !tbaa !5
%add.7.21 = add nsw i32 %rem.7.20, 1
%rem.7.21 = srem i32 %add.7.21, 7
%arrayidx33.7.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 23
store i32 %rem.7.21, ptr %arrayidx33.7.21, align 4, !tbaa !5
%add.7.22 = add nsw i32 %rem.7.21, 1
%rem.7.22 = srem i32 %add.7.22, 7
%arrayidx33.7.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 24
store i32 %rem.7.22, ptr %arrayidx33.7.22, align 16, !tbaa !5
%add.7.23 = add nsw i32 %rem.7.22, 1
%rem.7.23 = srem i32 %add.7.23, 7
%arrayidx33.7.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 25
store i32 %rem.7.23, ptr %arrayidx33.7.23, align 4, !tbaa !5
%add.7.24 = add nsw i32 %rem.7.23, 1
%rem.7.24 = srem i32 %add.7.24, 7
%arrayidx33.7.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 26
store i32 %rem.7.24, ptr %arrayidx33.7.24, align 8, !tbaa !5
%add.7.25 = add nsw i32 %rem.7.24, 1
%rem.7.25 = srem i32 %add.7.25, 7
%arrayidx33.7.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 27
store i32 %rem.7.25, ptr %arrayidx33.7.25, align 4, !tbaa !5
%add.7.26 = add nsw i32 %rem.7.25, 1
%rem.7.26 = srem i32 %add.7.26, 7
%arrayidx33.7.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 28
store i32 %rem.7.26, ptr %arrayidx33.7.26, align 16, !tbaa !5
%add.7.27 = add nsw i32 %rem.7.26, 1
%rem.7.27 = srem i32 %add.7.27, 7
%arrayidx33.7.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 29
store i32 %rem.7.27, ptr %arrayidx33.7.27, align 4, !tbaa !5
%add.7.28 = add nsw i32 %rem.7.27, 1
%rem.7.28 = srem i32 %add.7.28, 7
%arrayidx33.7.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 30
store i32 %rem.7.28, ptr %arrayidx33.7.28, align 8, !tbaa !5
%add.7.29 = add nsw i32 %rem.7.28, 1
%rem.7.29 = srem i32 %add.7.29, 7
%arrayidx33.7.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 8, i64 31
store i32 %rem.7.29, ptr %arrayidx33.7.29, align 4, !tbaa !5
%.pre121 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%add.8 = add nsw i32 %.pre121, 1
%rem.8 = srem i32 %add.8, 7
%arrayidx33.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 2
store i32 %rem.8, ptr %arrayidx33.8, align 8, !tbaa !5
%add.8.1 = add nsw i32 %rem.8, 1
%rem.8.1 = srem i32 %add.8.1, 7
%arrayidx33.8.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 3
store i32 %rem.8.1, ptr %arrayidx33.8.1, align 4, !tbaa !5
%add.8.2 = add nsw i32 %rem.8.1, 1
%rem.8.2 = srem i32 %add.8.2, 7
%arrayidx33.8.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 4
store i32 %rem.8.2, ptr %arrayidx33.8.2, align 16, !tbaa !5
%add.8.3 = add nsw i32 %rem.8.2, 1
%rem.8.3 = srem i32 %add.8.3, 7
%arrayidx33.8.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 5
store i32 %rem.8.3, ptr %arrayidx33.8.3, align 4, !tbaa !5
%add.8.4 = add nsw i32 %rem.8.3, 1
%rem.8.4 = srem i32 %add.8.4, 7
%arrayidx33.8.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 6
store i32 %rem.8.4, ptr %arrayidx33.8.4, align 8, !tbaa !5
%add.8.5 = add nsw i32 %rem.8.4, 1
%rem.8.5 = srem i32 %add.8.5, 7
%arrayidx33.8.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 7
store i32 %rem.8.5, ptr %arrayidx33.8.5, align 4, !tbaa !5
%add.8.6 = add nsw i32 %rem.8.5, 1
%rem.8.6 = srem i32 %add.8.6, 7
%arrayidx33.8.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 8
store i32 %rem.8.6, ptr %arrayidx33.8.6, align 16, !tbaa !5
%add.8.7 = add nsw i32 %rem.8.6, 1
%rem.8.7 = srem i32 %add.8.7, 7
%arrayidx33.8.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 9
store i32 %rem.8.7, ptr %arrayidx33.8.7, align 4, !tbaa !5
%add.8.8 = add nsw i32 %rem.8.7, 1
%rem.8.8 = srem i32 %add.8.8, 7
%arrayidx33.8.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 10
store i32 %rem.8.8, ptr %arrayidx33.8.8, align 8, !tbaa !5
%add.8.9 = add nsw i32 %rem.8.8, 1
%rem.8.9 = srem i32 %add.8.9, 7
%arrayidx33.8.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 11
store i32 %rem.8.9, ptr %arrayidx33.8.9, align 4, !tbaa !5
%add.8.10 = add nsw i32 %rem.8.9, 1
%rem.8.10 = srem i32 %add.8.10, 7
%arrayidx33.8.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 12
store i32 %rem.8.10, ptr %arrayidx33.8.10, align 16, !tbaa !5
%add.8.11 = add nsw i32 %rem.8.10, 1
%rem.8.11 = srem i32 %add.8.11, 7
%arrayidx33.8.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 13
store i32 %rem.8.11, ptr %arrayidx33.8.11, align 4, !tbaa !5
%add.8.12 = add nsw i32 %rem.8.11, 1
%rem.8.12 = srem i32 %add.8.12, 7
%arrayidx33.8.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 14
store i32 %rem.8.12, ptr %arrayidx33.8.12, align 8, !tbaa !5
%add.8.13 = add nsw i32 %rem.8.12, 1
%rem.8.13 = srem i32 %add.8.13, 7
%arrayidx33.8.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 15
store i32 %rem.8.13, ptr %arrayidx33.8.13, align 4, !tbaa !5
%add.8.14 = add nsw i32 %rem.8.13, 1
%rem.8.14 = srem i32 %add.8.14, 7
%arrayidx33.8.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 16
store i32 %rem.8.14, ptr %arrayidx33.8.14, align 16, !tbaa !5
%add.8.15 = add nsw i32 %rem.8.14, 1
%rem.8.15 = srem i32 %add.8.15, 7
%arrayidx33.8.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 17
store i32 %rem.8.15, ptr %arrayidx33.8.15, align 4, !tbaa !5
%add.8.16 = add nsw i32 %rem.8.15, 1
%rem.8.16 = srem i32 %add.8.16, 7
%arrayidx33.8.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 18
store i32 %rem.8.16, ptr %arrayidx33.8.16, align 8, !tbaa !5
%add.8.17 = add nsw i32 %rem.8.16, 1
%rem.8.17 = srem i32 %add.8.17, 7
%arrayidx33.8.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 19
store i32 %rem.8.17, ptr %arrayidx33.8.17, align 4, !tbaa !5
%add.8.18 = add nsw i32 %rem.8.17, 1
%rem.8.18 = srem i32 %add.8.18, 7
%arrayidx33.8.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 20
store i32 %rem.8.18, ptr %arrayidx33.8.18, align 16, !tbaa !5
%add.8.19 = add nsw i32 %rem.8.18, 1
%rem.8.19 = srem i32 %add.8.19, 7
%arrayidx33.8.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 21
store i32 %rem.8.19, ptr %arrayidx33.8.19, align 4, !tbaa !5
%add.8.20 = add nsw i32 %rem.8.19, 1
%rem.8.20 = srem i32 %add.8.20, 7
%arrayidx33.8.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 22
store i32 %rem.8.20, ptr %arrayidx33.8.20, align 8, !tbaa !5
%add.8.21 = add nsw i32 %rem.8.20, 1
%rem.8.21 = srem i32 %add.8.21, 7
%arrayidx33.8.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 23
store i32 %rem.8.21, ptr %arrayidx33.8.21, align 4, !tbaa !5
%add.8.22 = add nsw i32 %rem.8.21, 1
%rem.8.22 = srem i32 %add.8.22, 7
%arrayidx33.8.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 24
store i32 %rem.8.22, ptr %arrayidx33.8.22, align 16, !tbaa !5
%add.8.23 = add nsw i32 %rem.8.22, 1
%rem.8.23 = srem i32 %add.8.23, 7
%arrayidx33.8.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 25
store i32 %rem.8.23, ptr %arrayidx33.8.23, align 4, !tbaa !5
%add.8.24 = add nsw i32 %rem.8.23, 1
%rem.8.24 = srem i32 %add.8.24, 7
%arrayidx33.8.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 26
store i32 %rem.8.24, ptr %arrayidx33.8.24, align 8, !tbaa !5
%add.8.25 = add nsw i32 %rem.8.24, 1
%rem.8.25 = srem i32 %add.8.25, 7
%arrayidx33.8.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 27
store i32 %rem.8.25, ptr %arrayidx33.8.25, align 4, !tbaa !5
%add.8.26 = add nsw i32 %rem.8.25, 1
%rem.8.26 = srem i32 %add.8.26, 7
%arrayidx33.8.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 28
store i32 %rem.8.26, ptr %arrayidx33.8.26, align 16, !tbaa !5
%add.8.27 = add nsw i32 %rem.8.26, 1
%rem.8.27 = srem i32 %add.8.27, 7
%arrayidx33.8.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 29
store i32 %rem.8.27, ptr %arrayidx33.8.27, align 4, !tbaa !5
%add.8.28 = add nsw i32 %rem.8.27, 1
%rem.8.28 = srem i32 %add.8.28, 7
%arrayidx33.8.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 30
store i32 %rem.8.28, ptr %arrayidx33.8.28, align 8, !tbaa !5
%add.8.29 = add nsw i32 %rem.8.28, 1
%rem.8.29 = srem i32 %add.8.29, 7
%arrayidx33.8.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 9, i64 31
store i32 %rem.8.29, ptr %arrayidx33.8.29, align 4, !tbaa !5
%.pre122 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%add.9 = add nsw i32 %.pre122, 1
%rem.9 = srem i32 %add.9, 7
%arrayidx33.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 2
store i32 %rem.9, ptr %arrayidx33.9, align 8, !tbaa !5
%add.9.1 = add nsw i32 %rem.9, 1
%rem.9.1 = srem i32 %add.9.1, 7
%arrayidx33.9.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 3
store i32 %rem.9.1, ptr %arrayidx33.9.1, align 4, !tbaa !5
%add.9.2 = add nsw i32 %rem.9.1, 1
%rem.9.2 = srem i32 %add.9.2, 7
%arrayidx33.9.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 4
store i32 %rem.9.2, ptr %arrayidx33.9.2, align 16, !tbaa !5
%add.9.3 = add nsw i32 %rem.9.2, 1
%rem.9.3 = srem i32 %add.9.3, 7
%arrayidx33.9.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 5
store i32 %rem.9.3, ptr %arrayidx33.9.3, align 4, !tbaa !5
%add.9.4 = add nsw i32 %rem.9.3, 1
%rem.9.4 = srem i32 %add.9.4, 7
%arrayidx33.9.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 6
store i32 %rem.9.4, ptr %arrayidx33.9.4, align 8, !tbaa !5
%add.9.5 = add nsw i32 %rem.9.4, 1
%rem.9.5 = srem i32 %add.9.5, 7
%arrayidx33.9.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 7
store i32 %rem.9.5, ptr %arrayidx33.9.5, align 4, !tbaa !5
%add.9.6 = add nsw i32 %rem.9.5, 1
%rem.9.6 = srem i32 %add.9.6, 7
%arrayidx33.9.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 8
store i32 %rem.9.6, ptr %arrayidx33.9.6, align 16, !tbaa !5
%add.9.7 = add nsw i32 %rem.9.6, 1
%rem.9.7 = srem i32 %add.9.7, 7
%arrayidx33.9.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 9
store i32 %rem.9.7, ptr %arrayidx33.9.7, align 4, !tbaa !5
%add.9.8 = add nsw i32 %rem.9.7, 1
%rem.9.8 = srem i32 %add.9.8, 7
%arrayidx33.9.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 10
store i32 %rem.9.8, ptr %arrayidx33.9.8, align 8, !tbaa !5
%add.9.9 = add nsw i32 %rem.9.8, 1
%rem.9.9 = srem i32 %add.9.9, 7
%arrayidx33.9.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 11
store i32 %rem.9.9, ptr %arrayidx33.9.9, align 4, !tbaa !5
%add.9.10 = add nsw i32 %rem.9.9, 1
%rem.9.10 = srem i32 %add.9.10, 7
%arrayidx33.9.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 12
store i32 %rem.9.10, ptr %arrayidx33.9.10, align 16, !tbaa !5
%add.9.11 = add nsw i32 %rem.9.10, 1
%rem.9.11 = srem i32 %add.9.11, 7
%arrayidx33.9.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 13
store i32 %rem.9.11, ptr %arrayidx33.9.11, align 4, !tbaa !5
%add.9.12 = add nsw i32 %rem.9.11, 1
%rem.9.12 = srem i32 %add.9.12, 7
%arrayidx33.9.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 14
store i32 %rem.9.12, ptr %arrayidx33.9.12, align 8, !tbaa !5
%add.9.13 = add nsw i32 %rem.9.12, 1
%rem.9.13 = srem i32 %add.9.13, 7
%arrayidx33.9.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 15
store i32 %rem.9.13, ptr %arrayidx33.9.13, align 4, !tbaa !5
%add.9.14 = add nsw i32 %rem.9.13, 1
%rem.9.14 = srem i32 %add.9.14, 7
%arrayidx33.9.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 16
store i32 %rem.9.14, ptr %arrayidx33.9.14, align 16, !tbaa !5
%add.9.15 = add nsw i32 %rem.9.14, 1
%rem.9.15 = srem i32 %add.9.15, 7
%arrayidx33.9.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 17
store i32 %rem.9.15, ptr %arrayidx33.9.15, align 4, !tbaa !5
%add.9.16 = add nsw i32 %rem.9.15, 1
%rem.9.16 = srem i32 %add.9.16, 7
%arrayidx33.9.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 18
store i32 %rem.9.16, ptr %arrayidx33.9.16, align 8, !tbaa !5
%add.9.17 = add nsw i32 %rem.9.16, 1
%rem.9.17 = srem i32 %add.9.17, 7
%arrayidx33.9.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 19
store i32 %rem.9.17, ptr %arrayidx33.9.17, align 4, !tbaa !5
%add.9.18 = add nsw i32 %rem.9.17, 1
%rem.9.18 = srem i32 %add.9.18, 7
%arrayidx33.9.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 20
store i32 %rem.9.18, ptr %arrayidx33.9.18, align 16, !tbaa !5
%add.9.19 = add nsw i32 %rem.9.18, 1
%rem.9.19 = srem i32 %add.9.19, 7
%arrayidx33.9.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 21
store i32 %rem.9.19, ptr %arrayidx33.9.19, align 4, !tbaa !5
%add.9.20 = add nsw i32 %rem.9.19, 1
%rem.9.20 = srem i32 %add.9.20, 7
%arrayidx33.9.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 22
store i32 %rem.9.20, ptr %arrayidx33.9.20, align 8, !tbaa !5
%add.9.21 = add nsw i32 %rem.9.20, 1
%rem.9.21 = srem i32 %add.9.21, 7
%arrayidx33.9.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 23
store i32 %rem.9.21, ptr %arrayidx33.9.21, align 4, !tbaa !5
%add.9.22 = add nsw i32 %rem.9.21, 1
%rem.9.22 = srem i32 %add.9.22, 7
%arrayidx33.9.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 24
store i32 %rem.9.22, ptr %arrayidx33.9.22, align 16, !tbaa !5
%add.9.23 = add nsw i32 %rem.9.22, 1
%rem.9.23 = srem i32 %add.9.23, 7
%arrayidx33.9.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 25
store i32 %rem.9.23, ptr %arrayidx33.9.23, align 4, !tbaa !5
%add.9.24 = add nsw i32 %rem.9.23, 1
%rem.9.24 = srem i32 %add.9.24, 7
%arrayidx33.9.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 26
store i32 %rem.9.24, ptr %arrayidx33.9.24, align 8, !tbaa !5
%add.9.25 = add nsw i32 %rem.9.24, 1
%rem.9.25 = srem i32 %add.9.25, 7
%arrayidx33.9.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 27
store i32 %rem.9.25, ptr %arrayidx33.9.25, align 4, !tbaa !5
%add.9.26 = add nsw i32 %rem.9.25, 1
%rem.9.26 = srem i32 %add.9.26, 7
%arrayidx33.9.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 28
store i32 %rem.9.26, ptr %arrayidx33.9.26, align 16, !tbaa !5
%add.9.27 = add nsw i32 %rem.9.26, 1
%rem.9.27 = srem i32 %add.9.27, 7
%arrayidx33.9.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 29
store i32 %rem.9.27, ptr %arrayidx33.9.27, align 4, !tbaa !5
%add.9.28 = add nsw i32 %rem.9.27, 1
%rem.9.28 = srem i32 %add.9.28, 7
%arrayidx33.9.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 30
store i32 %rem.9.28, ptr %arrayidx33.9.28, align 8, !tbaa !5
%add.9.29 = add nsw i32 %rem.9.28, 1
%rem.9.29 = srem i32 %add.9.29, 7
%arrayidx33.9.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 10, i64 31
store i32 %rem.9.29, ptr %arrayidx33.9.29, align 4, !tbaa !5
%.pre123 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%add.10 = add nsw i32 %.pre123, 1
%rem.10 = srem i32 %add.10, 7
%arrayidx33.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 2
store i32 %rem.10, ptr %arrayidx33.10, align 8, !tbaa !5
%add.10.1 = add nsw i32 %rem.10, 1
%rem.10.1 = srem i32 %add.10.1, 7
%arrayidx33.10.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 3
store i32 %rem.10.1, ptr %arrayidx33.10.1, align 4, !tbaa !5
%add.10.2 = add nsw i32 %rem.10.1, 1
%rem.10.2 = srem i32 %add.10.2, 7
%arrayidx33.10.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 4
store i32 %rem.10.2, ptr %arrayidx33.10.2, align 16, !tbaa !5
%add.10.3 = add nsw i32 %rem.10.2, 1
%rem.10.3 = srem i32 %add.10.3, 7
%arrayidx33.10.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 5
store i32 %rem.10.3, ptr %arrayidx33.10.3, align 4, !tbaa !5
%add.10.4 = add nsw i32 %rem.10.3, 1
%rem.10.4 = srem i32 %add.10.4, 7
%arrayidx33.10.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 6
store i32 %rem.10.4, ptr %arrayidx33.10.4, align 8, !tbaa !5
%add.10.5 = add nsw i32 %rem.10.4, 1
%rem.10.5 = srem i32 %add.10.5, 7
%arrayidx33.10.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 7
store i32 %rem.10.5, ptr %arrayidx33.10.5, align 4, !tbaa !5
%add.10.6 = add nsw i32 %rem.10.5, 1
%rem.10.6 = srem i32 %add.10.6, 7
%arrayidx33.10.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 8
store i32 %rem.10.6, ptr %arrayidx33.10.6, align 16, !tbaa !5
%add.10.7 = add nsw i32 %rem.10.6, 1
%rem.10.7 = srem i32 %add.10.7, 7
%arrayidx33.10.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 9
store i32 %rem.10.7, ptr %arrayidx33.10.7, align 4, !tbaa !5
%add.10.8 = add nsw i32 %rem.10.7, 1
%rem.10.8 = srem i32 %add.10.8, 7
%arrayidx33.10.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 10
store i32 %rem.10.8, ptr %arrayidx33.10.8, align 8, !tbaa !5
%add.10.9 = add nsw i32 %rem.10.8, 1
%rem.10.9 = srem i32 %add.10.9, 7
%arrayidx33.10.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 11
store i32 %rem.10.9, ptr %arrayidx33.10.9, align 4, !tbaa !5
%add.10.10 = add nsw i32 %rem.10.9, 1
%rem.10.10 = srem i32 %add.10.10, 7
%arrayidx33.10.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 12
store i32 %rem.10.10, ptr %arrayidx33.10.10, align 16, !tbaa !5
%add.10.11 = add nsw i32 %rem.10.10, 1
%rem.10.11 = srem i32 %add.10.11, 7
%arrayidx33.10.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 13
store i32 %rem.10.11, ptr %arrayidx33.10.11, align 4, !tbaa !5
%add.10.12 = add nsw i32 %rem.10.11, 1
%rem.10.12 = srem i32 %add.10.12, 7
%arrayidx33.10.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 14
store i32 %rem.10.12, ptr %arrayidx33.10.12, align 8, !tbaa !5
%add.10.13 = add nsw i32 %rem.10.12, 1
%rem.10.13 = srem i32 %add.10.13, 7
%arrayidx33.10.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 15
store i32 %rem.10.13, ptr %arrayidx33.10.13, align 4, !tbaa !5
%add.10.14 = add nsw i32 %rem.10.13, 1
%rem.10.14 = srem i32 %add.10.14, 7
%arrayidx33.10.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 16
store i32 %rem.10.14, ptr %arrayidx33.10.14, align 16, !tbaa !5
%add.10.15 = add nsw i32 %rem.10.14, 1
%rem.10.15 = srem i32 %add.10.15, 7
%arrayidx33.10.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 17
store i32 %rem.10.15, ptr %arrayidx33.10.15, align 4, !tbaa !5
%add.10.16 = add nsw i32 %rem.10.15, 1
%rem.10.16 = srem i32 %add.10.16, 7
%arrayidx33.10.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 18
store i32 %rem.10.16, ptr %arrayidx33.10.16, align 8, !tbaa !5
%add.10.17 = add nsw i32 %rem.10.16, 1
%rem.10.17 = srem i32 %add.10.17, 7
%arrayidx33.10.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 19
store i32 %rem.10.17, ptr %arrayidx33.10.17, align 4, !tbaa !5
%add.10.18 = add nsw i32 %rem.10.17, 1
%rem.10.18 = srem i32 %add.10.18, 7
%arrayidx33.10.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 20
store i32 %rem.10.18, ptr %arrayidx33.10.18, align 16, !tbaa !5
%add.10.19 = add nsw i32 %rem.10.18, 1
%rem.10.19 = srem i32 %add.10.19, 7
%arrayidx33.10.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 21
store i32 %rem.10.19, ptr %arrayidx33.10.19, align 4, !tbaa !5
%add.10.20 = add nsw i32 %rem.10.19, 1
%rem.10.20 = srem i32 %add.10.20, 7
%arrayidx33.10.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 22
store i32 %rem.10.20, ptr %arrayidx33.10.20, align 8, !tbaa !5
%add.10.21 = add nsw i32 %rem.10.20, 1
%rem.10.21 = srem i32 %add.10.21, 7
%arrayidx33.10.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 23
store i32 %rem.10.21, ptr %arrayidx33.10.21, align 4, !tbaa !5
%add.10.22 = add nsw i32 %rem.10.21, 1
%rem.10.22 = srem i32 %add.10.22, 7
%arrayidx33.10.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 24
store i32 %rem.10.22, ptr %arrayidx33.10.22, align 16, !tbaa !5
%add.10.23 = add nsw i32 %rem.10.22, 1
%rem.10.23 = srem i32 %add.10.23, 7
%arrayidx33.10.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 25
store i32 %rem.10.23, ptr %arrayidx33.10.23, align 4, !tbaa !5
%add.10.24 = add nsw i32 %rem.10.23, 1
%rem.10.24 = srem i32 %add.10.24, 7
%arrayidx33.10.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 26
store i32 %rem.10.24, ptr %arrayidx33.10.24, align 8, !tbaa !5
%add.10.25 = add nsw i32 %rem.10.24, 1
%rem.10.25 = srem i32 %add.10.25, 7
%arrayidx33.10.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 27
store i32 %rem.10.25, ptr %arrayidx33.10.25, align 4, !tbaa !5
%add.10.26 = add nsw i32 %rem.10.25, 1
%rem.10.26 = srem i32 %add.10.26, 7
%arrayidx33.10.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 28
store i32 %rem.10.26, ptr %arrayidx33.10.26, align 16, !tbaa !5
%add.10.27 = add nsw i32 %rem.10.26, 1
%rem.10.27 = srem i32 %add.10.27, 7
%arrayidx33.10.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 29
store i32 %rem.10.27, ptr %arrayidx33.10.27, align 4, !tbaa !5
%add.10.28 = add nsw i32 %rem.10.27, 1
%rem.10.28 = srem i32 %add.10.28, 7
%arrayidx33.10.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 30
store i32 %rem.10.28, ptr %arrayidx33.10.28, align 8, !tbaa !5
%add.10.29 = add nsw i32 %rem.10.28, 1
%rem.10.29 = srem i32 %add.10.29, 7
%arrayidx33.10.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 11, i64 31
store i32 %rem.10.29, ptr %arrayidx33.10.29, align 4, !tbaa !5
%.pre124 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%add.11 = add nsw i32 %.pre124, 1
%rem.11 = srem i32 %add.11, 7
%arrayidx33.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 2
store i32 %rem.11, ptr %arrayidx33.11, align 8, !tbaa !5
%add.11.1 = add nsw i32 %rem.11, 1
%rem.11.1 = srem i32 %add.11.1, 7
%arrayidx33.11.1 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 3
store i32 %rem.11.1, ptr %arrayidx33.11.1, align 4, !tbaa !5
%add.11.2 = add nsw i32 %rem.11.1, 1
%rem.11.2 = srem i32 %add.11.2, 7
%arrayidx33.11.2 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 4
store i32 %rem.11.2, ptr %arrayidx33.11.2, align 16, !tbaa !5
%add.11.3 = add nsw i32 %rem.11.2, 1
%rem.11.3 = srem i32 %add.11.3, 7
%arrayidx33.11.3 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 5
store i32 %rem.11.3, ptr %arrayidx33.11.3, align 4, !tbaa !5
%add.11.4 = add nsw i32 %rem.11.3, 1
%rem.11.4 = srem i32 %add.11.4, 7
%arrayidx33.11.4 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 6
store i32 %rem.11.4, ptr %arrayidx33.11.4, align 8, !tbaa !5
%add.11.5 = add nsw i32 %rem.11.4, 1
%rem.11.5 = srem i32 %add.11.5, 7
%arrayidx33.11.5 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 7
store i32 %rem.11.5, ptr %arrayidx33.11.5, align 4, !tbaa !5
%add.11.6 = add nsw i32 %rem.11.5, 1
%rem.11.6 = srem i32 %add.11.6, 7
%arrayidx33.11.6 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 8
store i32 %rem.11.6, ptr %arrayidx33.11.6, align 16, !tbaa !5
%add.11.7 = add nsw i32 %rem.11.6, 1
%rem.11.7 = srem i32 %add.11.7, 7
%arrayidx33.11.7 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 9
store i32 %rem.11.7, ptr %arrayidx33.11.7, align 4, !tbaa !5
%add.11.8 = add nsw i32 %rem.11.7, 1
%rem.11.8 = srem i32 %add.11.8, 7
%arrayidx33.11.8 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 10
store i32 %rem.11.8, ptr %arrayidx33.11.8, align 8, !tbaa !5
%add.11.9 = add nsw i32 %rem.11.8, 1
%rem.11.9 = srem i32 %add.11.9, 7
%arrayidx33.11.9 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 11
store i32 %rem.11.9, ptr %arrayidx33.11.9, align 4, !tbaa !5
%add.11.10 = add nsw i32 %rem.11.9, 1
%rem.11.10 = srem i32 %add.11.10, 7
%arrayidx33.11.10 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 12
store i32 %rem.11.10, ptr %arrayidx33.11.10, align 16, !tbaa !5
%add.11.11 = add nsw i32 %rem.11.10, 1
%rem.11.11 = srem i32 %add.11.11, 7
%arrayidx33.11.11 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 13
store i32 %rem.11.11, ptr %arrayidx33.11.11, align 4, !tbaa !5
%add.11.12 = add nsw i32 %rem.11.11, 1
%rem.11.12 = srem i32 %add.11.12, 7
%arrayidx33.11.12 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 14
store i32 %rem.11.12, ptr %arrayidx33.11.12, align 8, !tbaa !5
%add.11.13 = add nsw i32 %rem.11.12, 1
%rem.11.13 = srem i32 %add.11.13, 7
%arrayidx33.11.13 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 15
store i32 %rem.11.13, ptr %arrayidx33.11.13, align 4, !tbaa !5
%add.11.14 = add nsw i32 %rem.11.13, 1
%rem.11.14 = srem i32 %add.11.14, 7
%arrayidx33.11.14 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 16
store i32 %rem.11.14, ptr %arrayidx33.11.14, align 16, !tbaa !5
%add.11.15 = add nsw i32 %rem.11.14, 1
%rem.11.15 = srem i32 %add.11.15, 7
%arrayidx33.11.15 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 17
store i32 %rem.11.15, ptr %arrayidx33.11.15, align 4, !tbaa !5
%add.11.16 = add nsw i32 %rem.11.15, 1
%rem.11.16 = srem i32 %add.11.16, 7
%arrayidx33.11.16 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 18
store i32 %rem.11.16, ptr %arrayidx33.11.16, align 8, !tbaa !5
%add.11.17 = add nsw i32 %rem.11.16, 1
%rem.11.17 = srem i32 %add.11.17, 7
%arrayidx33.11.17 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 19
store i32 %rem.11.17, ptr %arrayidx33.11.17, align 4, !tbaa !5
%add.11.18 = add nsw i32 %rem.11.17, 1
%rem.11.18 = srem i32 %add.11.18, 7
%arrayidx33.11.18 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 20
store i32 %rem.11.18, ptr %arrayidx33.11.18, align 16, !tbaa !5
%add.11.19 = add nsw i32 %rem.11.18, 1
%rem.11.19 = srem i32 %add.11.19, 7
%arrayidx33.11.19 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 21
store i32 %rem.11.19, ptr %arrayidx33.11.19, align 4, !tbaa !5
%add.11.20 = add nsw i32 %rem.11.19, 1
%rem.11.20 = srem i32 %add.11.20, 7
%arrayidx33.11.20 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 22
store i32 %rem.11.20, ptr %arrayidx33.11.20, align 8, !tbaa !5
%add.11.21 = add nsw i32 %rem.11.20, 1
%rem.11.21 = srem i32 %add.11.21, 7
%arrayidx33.11.21 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 23
store i32 %rem.11.21, ptr %arrayidx33.11.21, align 4, !tbaa !5
%add.11.22 = add nsw i32 %rem.11.21, 1
%rem.11.22 = srem i32 %add.11.22, 7
%arrayidx33.11.22 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 24
store i32 %rem.11.22, ptr %arrayidx33.11.22, align 16, !tbaa !5
%add.11.23 = add nsw i32 %rem.11.22, 1
%rem.11.23 = srem i32 %add.11.23, 7
%arrayidx33.11.23 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 25
store i32 %rem.11.23, ptr %arrayidx33.11.23, align 4, !tbaa !5
%add.11.24 = add nsw i32 %rem.11.23, 1
%rem.11.24 = srem i32 %add.11.24, 7
%arrayidx33.11.24 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 26
store i32 %rem.11.24, ptr %arrayidx33.11.24, align 8, !tbaa !5
%add.11.25 = add nsw i32 %rem.11.24, 1
%rem.11.25 = srem i32 %add.11.25, 7
%arrayidx33.11.25 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 27
store i32 %rem.11.25, ptr %arrayidx33.11.25, align 4, !tbaa !5
%add.11.26 = add nsw i32 %rem.11.25, 1
%rem.11.26 = srem i32 %add.11.26, 7
%arrayidx33.11.26 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 28
store i32 %rem.11.26, ptr %arrayidx33.11.26, align 16, !tbaa !5
%add.11.27 = add nsw i32 %rem.11.26, 1
%rem.11.27 = srem i32 %add.11.27, 7
%arrayidx33.11.27 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 29
store i32 %rem.11.27, ptr %arrayidx33.11.27, align 4, !tbaa !5
%add.11.28 = add nsw i32 %rem.11.27, 1
%rem.11.28 = srem i32 %add.11.28, 7
%arrayidx33.11.28 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 30
store i32 %rem.11.28, ptr %arrayidx33.11.28, align 8, !tbaa !5
%add.11.29 = add nsw i32 %rem.11.28, 1
%rem.11.29 = srem i32 %add.11.29, 7
%arrayidx33.11.29 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 12, i64 31
store i32 %rem.11.29, ptr %arrayidx33.11.29, align 4, !tbaa !5
%call107 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %days)
%0 = load i32, ptr %month, align 4, !tbaa !5
%cmp37108 = icmp eq i32 %0, 0
br i1 %cmp37108, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end91
%1 = phi i32 [ %6, %if.end91 ], [ %0, %entry ]
%idxprom38 = sext i32 %1 to i64
%2 = load i32, ptr %days, align 4, !tbaa !5
%idxprom40 = sext i32 %2 to i64
%arrayidx41 = getelementptr inbounds [13 x [32 x i32]], ptr %day, i64 0, i64 %idxprom38, i64 %idxprom40
%3 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%4 = icmp ult i32 %3, 6
br i1 %4, label %switch.lookup, label %if.end91
switch.lookup: ; preds = %if.end
%5 = sext i32 %3 to i64
%reltable.shift = shl i64 %5, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end91
if.end91: ; preds = %if.end, %switch.lookup
%str.12.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @str, %if.end ]
%puts103 = call i32 @puts(ptr nonnull dereferenceable(1) %str.12.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %days)
%6 = load i32, ptr %month, align 4, !tbaa !5
%cmp37 = icmp eq i32 %6, 0
br i1 %cmp37, label %while.end, label %if.end
while.end: ; preds = %if.end91, %entry
call void @llvm.lifetime.end.p0(i64 1664, ptr nonnull %day) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %days) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %month) #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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int i,m,d,temp;
int mon[13]={0};
temp = 31;
mon[0] = 0;
mon[1] = 31;
for(i=2;i<12;i++){
if(i==4||i==6||i==9||i==11)
mon[i]+=temp+30;
else if(i==2)
mon[i]+=temp+29;
else
mon[i]+=temp+31;
temp = mon[i];
}
while(scanf("%d %d",&m,&d)){
if(m==0)
break;
temp=(mon[m-1]+d)%7;
if(temp==1)
printf("Thursday\n");
else if(temp==2)
printf("Friday\n");
else if(temp==3)
printf("Saturday\n");
else if(temp==4)
printf("Sunday\n");
else if(temp==5)
printf("Monday\n");
else if(temp==6)
printf("Tuesday\n");
else if(temp==0)
printf("Wednesday\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202791/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202791/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@str.8 = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.10 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.11 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.12 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.13 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
if.end21.9:
%m = alloca i32, align 4
%d = alloca i32, align 4
%mon = alloca [13 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %mon) #6
%arrayidx1 = getelementptr inbounds [13 x i32], ptr %mon, i64 0, i64 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(52) %mon, i8 0, i64 52, i1 false)
store <4 x i32> <i32 31, i32 60, i32 91, i32 121>, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx19.3 = getelementptr inbounds [13 x i32], ptr %mon, i64 0, i64 5
store <4 x i32> <i32 152, i32 182, i32 213, i32 244>, ptr %arrayidx19.3, align 4, !tbaa !5
%arrayidx8.7 = getelementptr inbounds [13 x i32], ptr %mon, i64 0, i64 9
store i32 274, ptr %arrayidx8.7, align 4, !tbaa !5
%arrayidx19.8 = getelementptr inbounds [13 x i32], ptr %mon, i64 0, i64 10
store i32 305, ptr %arrayidx19.8, align 8, !tbaa !5
%arrayidx8.9 = getelementptr inbounds [13 x i32], ptr %mon, i64 0, i64 11
store i32 335, ptr %arrayidx8.9, align 4, !tbaa !5
%call94 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %d)
%tobool95 = icmp eq i32 %call94, 0
%0 = load i32, ptr %m, align 4
%cmp2496 = icmp eq i32 %0, 0
%or.cond6697 = select i1 %tobool95, i1 true, i1 %cmp2496
br i1 %or.cond6697, label %while.end, label %if.end26
if.end26: ; preds = %if.end21.9, %if.end63
%1 = phi i32 [ %6, %if.end63 ], [ %0, %if.end21.9 ]
%sub = add nsw i32 %1, -1
%idxprom27 = sext i32 %sub to i64
%arrayidx28 = getelementptr inbounds [13 x i32], ptr %mon, i64 0, i64 %idxprom27
%2 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add29 = add nsw i32 %3, %2
%rem = srem i32 %add29, 7
%4 = icmp ult i32 %rem, 7
br i1 %4, label %switch.lookup, label %if.end63
switch.lookup: ; preds = %if.end26
%5 = sext i32 %rem to i64
%reltable.shift = shl i64 %5, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts90 = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %if.end63
if.end63: ; preds = %if.end26, %switch.lookup
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %d)
%tobool = icmp eq i32 %call, 0
%6 = load i32, ptr %m, align 4
%cmp24 = icmp eq i32 %6, 0
%or.cond66 = select i1 %tobool, i1 true, i1 %cmp24
br i1 %or.cond66, label %while.end, label %if.end26, !llvm.loop !9
while.end: ; preds = %if.end63, %if.end21.9
call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %mon) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync 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 = !{!"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 month;
int date;
int mod;
scanf("%d%d", &month, &date);
while (month != 0){
if(month == 1){
mod = date % 7;
}
else if(month == 2){
mod = (date + 31) % 7;
}
else if(month == 3){
mod = (date + 60) % 7;
}
else if(month == 4){
mod = (date + 91) % 7;
}
else if(month == 5){
mod = (date + 121) % 7;
}
else if(month == 6){
mod = (date + 152) % 7;
}
else if(month == 7){
mod = (date + 182) % 7;
}
else if(month == 8){
mod = (date + 213) % 7;
}
else if(month == 9){
mod = (date + 244) % 7;
}
else if(month == 10){
mod = (date + 274) % 7;
}
else if(month == 11){
mod = (date + 305) % 7;
}
else if(month == 12){
mod = (date + 335) % 7;
}
switch (mod){
case 1:
printf("Thursday\n");
break;
case 2:
printf("Friday\n");
break;
case 3:
printf("Saturday\n");
break;
case 4:
printf("Sunday\n");
break;
case 5:
printf("Monday\n");
break;
case 6:
printf("Tuesday\n");
break;
default:
printf("Wednesday\n");
break;
}
scanf("%d%d", &month, &date);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202841/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202841/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.8 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.13 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@reltable.main = private unnamed_addr constant [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%month = alloca i32, align 4
%date = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %month) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %date) #5
br label %while.cond
while.cond: ; preds = %sw.epilog, %entry
%mod.0 = phi i32 [ undef, %entry ], [ %mod.1, %sw.epilog ]
%call78 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %date)
%0 = load i32, ptr %month, align 4, !tbaa !5
switch i32 %0, label %if.end65 [
i32 0, label %while.end
i32 1, label %if.then
i32 2, label %if.then3
i32 3, label %if.then7
i32 4, label %if.then12
i32 5, label %if.then17
i32 6, label %if.then22
i32 7, label %if.then27
i32 8, label %if.then32
i32 9, label %if.then37
i32 10, label %if.then42
i32 11, label %if.then47
i32 12, label %if.then52
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %date, align 4, !tbaa !5
%rem = srem i32 %1, 7
br label %if.end65
if.then3: ; preds = %while.cond
%2 = load i32, ptr %date, align 4, !tbaa !5
%add = add nsw i32 %2, 31
%rem4 = srem i32 %add, 7
br label %if.end65
if.then7: ; preds = %while.cond
%3 = load i32, ptr %date, align 4, !tbaa !5
%add8 = add nsw i32 %3, 60
%rem9 = srem i32 %add8, 7
br label %if.end65
if.then12: ; preds = %while.cond
%4 = load i32, ptr %date, align 4, !tbaa !5
%add13 = add nsw i32 %4, 91
%rem14 = srem i32 %add13, 7
br label %if.end65
if.then17: ; preds = %while.cond
%5 = load i32, ptr %date, align 4, !tbaa !5
%add18 = add nsw i32 %5, 121
%rem19 = srem i32 %add18, 7
br label %if.end65
if.then22: ; preds = %while.cond
%6 = load i32, ptr %date, align 4, !tbaa !5
%add23 = add nsw i32 %6, 152
%rem24 = srem i32 %add23, 7
br label %if.end65
if.then27: ; preds = %while.cond
%7 = load i32, ptr %date, align 4, !tbaa !5
%add28 = add nsw i32 %7, 182
%rem29 = srem i32 %add28, 7
br label %if.end65
if.then32: ; preds = %while.cond
%8 = load i32, ptr %date, align 4, !tbaa !5
%add33 = add nsw i32 %8, 213
%rem34 = srem i32 %add33, 7
br label %if.end65
if.then37: ; preds = %while.cond
%9 = load i32, ptr %date, align 4, !tbaa !5
%add38 = add nsw i32 %9, 244
%rem39 = srem i32 %add38, 7
br label %if.end65
if.then42: ; preds = %while.cond
%10 = load i32, ptr %date, align 4, !tbaa !5
%add43 = add nsw i32 %10, 274
%rem44 = srem i32 %add43, 7
br label %if.end65
if.then47: ; preds = %while.cond
%11 = load i32, ptr %date, align 4, !tbaa !5
%add48 = add nsw i32 %11, 305
%rem49 = srem i32 %add48, 7
br label %if.end65
if.then52: ; preds = %while.cond
%12 = load i32, ptr %date, align 4, !tbaa !5
%add53 = add nsw i32 %12, 335
%rem54 = srem i32 %add53, 7
br label %if.end65
if.end65: ; preds = %while.cond, %if.then3, %if.then12, %if.then22, %if.then32, %if.then42, %if.then52, %if.then47, %if.then37, %if.then27, %if.then17, %if.then7, %if.then
%mod.1 = phi i32 [ %rem, %if.then ], [ %rem4, %if.then3 ], [ %rem9, %if.then7 ], [ %rem14, %if.then12 ], [ %rem19, %if.then17 ], [ %rem24, %if.then22 ], [ %rem29, %if.then27 ], [ %rem34, %if.then32 ], [ %rem39, %if.then37 ], [ %rem44, %if.then42 ], [ %rem49, %if.then47 ], [ %rem54, %if.then52 ], [ %mod.0, %while.cond ]
%switch.tableidx = add i32 %mod.1, -1
%13 = icmp ult i32 %switch.tableidx, 6
br i1 %13, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %if.end65
%14 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %14, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %sw.epilog
sw.epilog: ; preds = %if.end65, %switch.lookup
%str.13.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @str.13, %if.end65 ]
%puts84 = call i32 @puts(ptr nonnull dereferenceable(1) %str.13.sink)
br label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %date) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %month) #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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 willreturn memory(argmem: read) }
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 m,d,days,i;
int date[13] = {0,31,29,31,30,31,30,31,31,30,31,30,31};
char *day[7] = {
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
};
while(1){
scanf("%d %d",&m,&d);
if(m == 0){
break;
}
days = 0;
for(i = 1;i < m;i++){
days += date[i];
}
days += d;
days += 2;
printf("%s\n",day[days%7]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202906/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202906/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.date = private unnamed_addr constant [13 x i32] [i32 0, i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31], align 16
@.str = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@.str.4 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@.str.5 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.5 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.6 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
@.str.7 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %m, ptr noundef nonnull %d)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp16 = icmp eq i32 %0, 0
br i1 %cmp16, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %11, %for.end ], [ %0, %entry ]
%cmp112 = icmp sgt i32 %1, 1
br i1 %cmp112, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %1, 9
br i1 %min.iters.check, label %for.body.preheader20, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi18 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [13 x i32], ptr @__const.main.date, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load19 = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = add <4 x i32> %wide.load, %vec.phi
%6 = add <4 x i32> %wide.load19, %vec.phi18
%index.next = add nuw i64 %index, 8
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %6, %5
%8 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader20
for.body.preheader20: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%days.013.ph = phi i32 [ 0, %for.body.preheader ], [ %8, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader20, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader20 ]
%days.013 = phi i32 [ %add, %for.body ], [ %days.013.ph, %for.body.preheader20 ]
%arrayidx = getelementptr inbounds [13 x i32], ptr @__const.main.date, i64 0, i64 %indvars.iv
%9 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %9, %days.013
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %for.cond.preheader
%days.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %8, %middle.block ], [ %add, %for.body ]
%10 = load i32, ptr %d, align 4, !tbaa !5
%add2 = add i32 %days.0.lcssa, 2
%add3 = add i32 %add2, %10
%rem = srem i32 %add3, 7
%idxprom4 = sext i32 %rem to i64
%reltable.shift = shl i64 %idxprom4, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %m, ptr noundef nonnull %d)
%11 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp eq i32 %11, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include<stdio.h>
int main()
{
int n,k;
scanf("%d%d",&n,&k);
int i;
i=k;
int save ;
save=k;
int flag=0;
i=k+1;
while(1)
{
if(flag==0)
{
printf("%d",i);
i--;
if(i==0)
{
flag=1;
i=save+2;
if(save==n-1)
{
break;
}
}
printf(" ");
}
else if (flag==1)
{
printf("%d",i);
i++;
if(i==n+1)
{
break;
}
printf(" ");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2030/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2030/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%add4 = add nsw i32 %0, 2
br label %while.cond
while.cond: ; preds = %if.end18, %entry
%i.0 = phi i32 [ %add, %entry ], [ %i.2, %if.end18 ]
%flag.0 = phi i32 [ 0, %entry ], [ %flag.2, %if.end18 ]
%cmp = icmp eq i32 %flag.0, 0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
br i1 %cmp, label %if.then, label %if.then10
if.then: ; preds = %while.cond
%dec = add nsw i32 %i.0, -1
%cmp2 = icmp eq i32 %dec, 0
br i1 %cmp2, label %if.then3, label %if.end18
if.then3: ; preds = %if.then
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%cmp5 = icmp eq i32 %0, %sub
br i1 %cmp5, label %while.end, label %if.end18
if.then10: ; preds = %while.cond
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp13 = icmp eq i32 %i.0, %2
br i1 %cmp13, label %while.end, label %if.end15
if.end15: ; preds = %if.then10
%inc = add nsw i32 %i.0, 1
br label %if.end18
if.end18: ; preds = %if.then, %if.then3, %if.end15
%i.2 = phi i32 [ %inc, %if.end15 ], [ %add4, %if.then3 ], [ %dec, %if.then ]
%flag.2 = phi i32 [ 1, %if.end15 ], [ 1, %if.then3 ], [ 0, %if.then ]
%putchar = call i32 @putchar(i32 32)
br label %while.cond
while.end: ; preds = %if.then10, %if.then3
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: 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"}
|
#include<stdio.h>
#include<math.h>
int main(void)
{
long long int a,b,c=1,i=2,count=1;
scanf("%lld%lld",&a,&b);
while(c!=0){
c=a%b;
a=b;
b=c;
}
while(i*i<=a){
if(a%i==0){
count++;
while(a%i==0)
a/=i;
}
i++;
}
if(a>1)
count++;
printf("%lld",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203042/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203042/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%a.promoted = load i64, ptr %a, align 8, !tbaa !5
%b.promoted = load i64, ptr %b, align 8, !tbaa !5
br label %while.body
while.cond1.preheader: ; preds = %while.body
store i64 %rem2728, ptr %a, align 8, !tbaa !5
store i64 0, ptr %b, align 8, !tbaa !5
%cmp2.not38 = icmp slt i64 %rem2728, 4
br i1 %cmp2.not38, label %while.end12, label %while.body3
while.body: ; preds = %entry, %while.body
%0 = phi i64 [ %a.promoted, %entry ], [ %rem2728, %while.body ]
%rem2728 = phi i64 [ %b.promoted, %entry ], [ %rem, %while.body ]
%rem = srem i64 %0, %rem2728
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.cond1.preheader, label %while.body, !llvm.loop !9
while.body3: ; preds = %while.cond1.preheader, %if.end
%count.041 = phi i64 [ %count.1, %if.end ], [ 1, %while.cond1.preheader ]
%i.040 = phi i64 [ %inc11, %if.end ], [ 2, %while.cond1.preheader ]
%div.lcssa3739 = phi i64 [ %div.lcssa35, %if.end ], [ %rem2728, %while.cond1.preheader ]
%rem4 = srem i64 %div.lcssa3739, %i.040
%cmp5 = icmp eq i64 %rem4, 0
br i1 %cmp5, label %while.body9.preheader, label %if.end
while.body9.preheader: ; preds = %while.body3
%inc = add nsw i64 %count.041, 1
br label %while.body9
while.body9: ; preds = %while.body9.preheader, %while.body9
%div3033 = phi i64 [ %div, %while.body9 ], [ %div.lcssa3739, %while.body9.preheader ]
%div = sdiv i64 %div3033, %i.040
%rem7 = srem i64 %div, %i.040
%cmp8 = icmp eq i64 %rem7, 0
br i1 %cmp8, label %while.body9, label %while.cond6.if.end.loopexit_crit_edge, !llvm.loop !11
while.cond6.if.end.loopexit_crit_edge: ; preds = %while.body9
store i64 %div, ptr %a, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %while.cond6.if.end.loopexit_crit_edge, %while.body3
%div.lcssa35 = phi i64 [ %div.lcssa3739, %while.body3 ], [ %div, %while.cond6.if.end.loopexit_crit_edge ]
%count.1 = phi i64 [ %count.041, %while.body3 ], [ %inc, %while.cond6.if.end.loopexit_crit_edge ]
%inc11 = add nuw nsw i64 %i.040, 1
%mul = mul nsw i64 %inc11, %inc11
%cmp2.not = icmp sgt i64 %mul, %div.lcssa35
br i1 %cmp2.not, label %while.end12, label %while.body3, !llvm.loop !12
while.end12: ; preds = %if.end, %while.cond1.preheader
%count.0.lcssa = phi i64 [ 1, %while.cond1.preheader ], [ %count.1, %if.end ]
%.lcssa = phi i64 [ %rem2728, %while.cond1.preheader ], [ %div.lcssa35, %if.end ]
%cmp13 = icmp sgt i64 %.lcssa, 1
%inc15 = zext i1 %cmp13 to i64
%spec.select = add nsw i64 %count.0.lcssa, %inc15
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <math.h>
long int gcd(long int a, long int b) {
long int t; // �⏕�ϐ�
while ( b != 0 ) { // ������0�ɂȂ�܂�
t = a%b; a = b; b = t; // �������]�ɒu��������
}
return a; // ������0�ɂȂ����Ƃ��̈����GCD
}
long int
main(){
long int A,B,i;
long int cnt=0;
long int K;
scanf("%ld %ld",&A,&B);
long int tmp;
if(B>A){tmp = A;
A=B;
B=tmp;
}
if(B==1){
printf("1\n");return 0;
}
long int bb,j;
bb = gcd(A,B);
long int ans =1;
for(i=2;i*i<=(bb);i++){
if(bb%i == 0){
ans++;
while(bb%i==0){
bb = bb/i;
}
}
}
if(bb>1)ans++;
printf("%ld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203086/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203086/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
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 !5
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: 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 i64 @main() local_unnamed_addr #2 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %B, align 8, !tbaa !7
%1 = load i64, ptr %A, align 8, !tbaa !7
%cmp = icmp sgt i64 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i64 %0, ptr %A, align 8, !tbaa !7
store i64 %1, ptr %B, align 8, !tbaa !7
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i64 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i64 [ %1, %if.then ], [ %0, %entry ]
switch i64 %3, label %while.body.i [
i64 1, label %if.then2
i64 0, label %gcd.exit
]
if.then2: ; preds = %if.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
while.body.i: ; preds = %if.end, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %2, %if.end ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %3, %if.end ]
%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 %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %if.end
%a.addr.0.lcssa.i = phi i64 [ %2, %if.end ], [ %b.addr.05.i, %while.body.i ]
%cmp6.not39 = icmp slt i64 %a.addr.0.lcssa.i, 4
br i1 %cmp6.not39, label %for.end, label %for.body
for.body: ; preds = %gcd.exit, %for.inc
%ans.042 = phi i64 [ %ans.1, %for.inc ], [ 1, %gcd.exit ]
%bb.041 = phi i64 [ %bb.2, %for.inc ], [ %a.addr.0.lcssa.i, %gcd.exit ]
%i.040 = phi i64 [ %inc12, %for.inc ], [ 2, %gcd.exit ]
%rem = srem i64 %bb.041, %i.040
%cmp7 = icmp eq i64 %rem, 0
br i1 %cmp7, label %while.body.preheader, label %for.inc
while.body.preheader: ; preds = %for.body
%inc = add nsw i64 %ans.042, 1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%bb.138 = phi i64 [ %div, %while.body ], [ %bb.041, %while.body.preheader ]
%div = sdiv i64 %bb.138, %i.040
%rem9 = srem i64 %div, %i.040
%cmp10 = icmp eq i64 %rem9, 0
br i1 %cmp10, label %while.body, label %for.inc, !llvm.loop !11
for.inc: ; preds = %while.body, %for.body
%bb.2 = phi i64 [ %bb.041, %for.body ], [ %div, %while.body ]
%ans.1 = phi i64 [ %ans.042, %for.body ], [ %inc, %while.body ]
%inc12 = add nuw nsw i64 %i.040, 1
%mul = mul nsw i64 %inc12, %inc12
%cmp6.not = icmp sgt i64 %mul, %bb.2
br i1 %cmp6.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.inc, %gcd.exit
%bb.0.lcssa = phi i64 [ %a.addr.0.lcssa.i, %gcd.exit ], [ %bb.2, %for.inc ]
%ans.0.lcssa = phi i64 [ 1, %gcd.exit ], [ %ans.1, %for.inc ]
%cmp13 = icmp sgt i64 %bb.0.lcssa, 1
%inc15 = zext i1 %cmp13 to i64
%spec.select = add nsw i64 %ans.0.lcssa, %inc15
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %spec.select)
br label %cleanup
cleanup: ; preds = %for.end, %if.then2
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #5
ret i64 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
|
#include <stdio.h>
int main(void)
{
int ha,hb,ka,kb,a,b,c,d,ht,kt;
scanf("%d %d",&ha,&hb);
scanf("%d %d",&ka,&kb);
scanf("%d %d %d %d",&a,&b,&c,&d);
ht=ha*a+hb*b;
if(ha>=10)
ht+=(ha/10)*c;
if(hb>=20)
ht+=(hb/20)*d;
kt=ka*a+kb*b;
if(ka>=10)
kt+=(ka/10)*c;
if(kb>=20)
kt+=(kb/20)*d;
if(ht>kt)
printf("hiroshi\n");
if(kt>ht)
printf("kenjiro\n");
if(kt==ht)
printf("even\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203143/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203143/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %d %d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"hiroshi\00", align 1
@str.5 = private unnamed_addr constant [8 x i8] c"kenjiro\00", align 1
@str.6 = private unnamed_addr constant [5 x i8] c"even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ha = alloca i32, align 4
%hb = alloca i32, align 4
%ka = alloca i32, align 4
%kb = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ha) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %hb) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ka) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kb) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ha, ptr noundef nonnull %hb)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ka, ptr noundef nonnull %kb)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %ha, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %hb, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %2
%add = add nsw i32 %mul3, %mul
%cmp = icmp sgt i32 %0, 9
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%div = udiv i32 %0, 10
%4 = load i32, ptr %c, align 4, !tbaa !5
%mul4 = mul nsw i32 %4, %div
%add5 = add nsw i32 %mul4, %add
br label %if.end
if.end: ; preds = %if.then, %entry
%ht.0 = phi i32 [ %add5, %if.then ], [ %add, %entry ]
%cmp6 = icmp sgt i32 %2, 19
br i1 %cmp6, label %if.then7, label %if.end11
if.then7: ; preds = %if.end
%div8 = udiv i32 %2, 20
%5 = load i32, ptr %d, align 4, !tbaa !5
%mul9 = mul nsw i32 %5, %div8
%add10 = add nsw i32 %mul9, %ht.0
br label %if.end11
if.end11: ; preds = %if.then7, %if.end
%ht.1 = phi i32 [ %add10, %if.then7 ], [ %ht.0, %if.end ]
%6 = load i32, ptr %ka, align 4, !tbaa !5
%mul12 = mul nsw i32 %6, %1
%7 = load i32, ptr %kb, align 4, !tbaa !5
%mul13 = mul nsw i32 %7, %3
%add14 = add nsw i32 %mul13, %mul12
%cmp15 = icmp sgt i32 %6, 9
br i1 %cmp15, label %if.then16, label %if.end20
if.then16: ; preds = %if.end11
%div17 = udiv i32 %6, 10
%8 = load i32, ptr %c, align 4, !tbaa !5
%mul18 = mul nsw i32 %8, %div17
%add19 = add nsw i32 %mul18, %add14
br label %if.end20
if.end20: ; preds = %if.then16, %if.end11
%kt.0 = phi i32 [ %add19, %if.then16 ], [ %add14, %if.end11 ]
%cmp21 = icmp sgt i32 %7, 19
br i1 %cmp21, label %if.then22, label %if.end26
if.then22: ; preds = %if.end20
%div23 = udiv i32 %7, 20
%9 = load i32, ptr %d, align 4, !tbaa !5
%mul24 = mul nsw i32 %9, %div23
%add25 = add nsw i32 %mul24, %kt.0
br label %if.end26
if.end26: ; preds = %if.then22, %if.end20
%kt.1 = phi i32 [ %add25, %if.then22 ], [ %kt.0, %if.end20 ]
%cmp27 = icmp sgt i32 %ht.1, %kt.1
br i1 %cmp27, label %if.then28, label %if.end30
if.then28: ; preds = %if.end26
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end30
if.end30: ; preds = %if.then28, %if.end26
%cmp31 = icmp sgt i32 %kt.1, %ht.1
br i1 %cmp31, label %if.then32, label %if.end34
if.then32: ; preds = %if.end30
%puts50 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end34
if.end34: ; preds = %if.then32, %if.end30
%cmp35 = icmp eq i32 %kt.1, %ht.1
br i1 %cmp35, label %if.then36, label %if.end38
if.then36: ; preds = %if.end34
%puts51 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %if.end38
if.end38: ; preds = %if.then36, %if.end34
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kb) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ka) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %hb) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ha) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int h[2],k[2],a,b,c,d,i,w,x,y,z;
for(i=0;i<2;i++){
scanf("%d",&h[i]);
}
for(i=0;i<2;i++){
scanf("%d",&k[i]);
}
scanf("%d %d %d %d",&a,&b,&c,&d);
x=h[0]*a+h[1]*b;
w=h[0]/10;
x=x+c*w;
z=h[1]/20;
x=x+d*z;
y=k[0]*a+k[1]*b;
w=k[0]/10;
y=y+c*w;
z=k[1]/20;
y=y+d*z;
if(x<y) printf("kenjiro\n");
else if(x==y) printf("even\n");
else printf("hiroshi\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203187/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203187/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"hiroshi\00", align 1
@str.5 = private unnamed_addr constant [5 x i8] c"even\00", align 1
@str.6 = private unnamed_addr constant [8 x i8] c"kenjiro\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca [2 x i32], align 4
%k = alloca [2 x i32], align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h)
%arrayidx.1 = getelementptr inbounds [2 x i32], ptr %h, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%arrayidx5.1 = getelementptr inbounds [2 x i32], ptr %k, i64 0, i64 1
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%mul13 = mul nsw i32 %3, %2
%add = add nsw i32 %mul13, %mul
%div = sdiv i32 %0, 10
%4 = load i32, ptr %c, align 4, !tbaa !5
%mul15 = mul nsw i32 %4, %div
%add16 = add nsw i32 %add, %mul15
%div18 = sdiv i32 %2, 20
%5 = load i32, ptr %d, align 4, !tbaa !5
%mul19 = mul nsw i32 %5, %div18
%add20 = add nsw i32 %add16, %mul19
%6 = load i32, ptr %k, align 4, !tbaa !5
%mul22 = mul nsw i32 %6, %1
%7 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%mul24 = mul nsw i32 %7, %3
%add25 = add nsw i32 %mul24, %mul22
%div27 = sdiv i32 %6, 10
%mul28 = mul nsw i32 %div27, %4
%add29 = add nsw i32 %add25, %mul28
%div31 = sdiv i32 %7, 20
%mul32 = mul nsw i32 %div31, %5
%add33 = add nsw i32 %add29, %mul32
%cmp34 = icmp slt i32 %add20, %add33
%cmp36 = icmp eq i32 %add20, %add33
%str.5.str = select i1 %cmp36, ptr @str.5, ptr @str
%str.5.sink = select i1 %cmp34, ptr @str.6, ptr %str.5.str
%puts55 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int MIN(int a,int b){return a<b?a:b;}
int MAX(int a,int b){return a<b?b:a;}
int ta[100010],to[100010],co[100010],nt[100010],it[100010],l[100010];
int MF(int e,int s,int t,int min){
if(s==t)return min;
int i,r;
for(;it[s]+1;it[s]=nt[it[s]]){
if(co[it[s]]==0||l[s]>=l[to[it[s]]])continue;
r=MF(e,to[it[s]],t,MIN(min,co[it[s]]));
co[it[s]]-=r;
co[(it[s]+e)%(2*e)]+=r;
if(r)return r;
}
return 0;
}
//呼び出す方
//頂点v、辺eのグラフでsからgに流す
int maxf(int v,int e,int s,int g){
int i,a=0,q[100010],t,r,c=3;
while(1){
for(i=t=0;i<v;i++)l[i]=0;
for(r=l[q[0]=s]=1;r-t;t++){
for(i=ta[q[t]];i+1;i=nt[i]){
if(co[i]&&l[to[i]]==0)l[q[r++]=to[i]]=l[q[t]]+1;
}
}
if(l[g]==0)return a;
for(i=0;i<v;i++)it[i]=ta[i];
while(r=MF(e,s,g,1e9))a+=r;
}
}
void mklsb(int v,int e,int *a,int *b,int *c){
int i;
for(i=0;i<v;i++)ta[i]=-1;
for(i=0;i<e;i++){
nt[i ]=ta[to[i+e]=a[i]];
nt[i+e]=ta[to[i ]=b[i]];
co[ta[a[i]]=i ]=c[i];
co[ta[b[i]]=i+e]=0;
}
}
int main(){
int n,m,i,j,t,r=0,a[100010],b[100010],c[100010],d;
char s[100010];
scanf("%d %d %s",&n,&m,s);
for(i=0;s[i];i++){
scanf("%d",&d);
if(s[i]=='L'){
a[r]=0;
b[r]=i+1;
c[r++]=0;
a[r]=i+1;
b[r]=n+1;
c[r++]=d;
}
else{
a[r]=0;
b[r]=i+1;
c[r++]=d;
a[r]=i+1;
b[r]=n+1;
c[r++]=0;
}
}
while(m--){
scanf("%d %d %d",&i,&j,&t);
a[r]=MIN(i,j);
b[r]=MAX(i,j);
c[r++]=t;
}
mklsb(n+2,r,a,b,c);
printf("%d\n",maxf(n+2,r,0,n+1));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203237/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203237/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@it = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16
@co = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16
@l = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16
@to = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16
@nt = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16
@ta = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [9 x i8] c"%d %d %s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @MIN(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @MAX(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @MF(i32 noundef %e, i32 noundef %s, i32 noundef %t, i32 noundef %min) local_unnamed_addr #1 {
entry:
%cmp = icmp eq i32 %s, %t
br i1 %cmp, label %return, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%idxprom = sext i32 %s to i64
%arrayidx = getelementptr inbounds [100010 x i32], ptr @it, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%tobool.not63 = icmp eq i32 %0, -1
br i1 %tobool.not63, label %return, label %for.body.lr.ph
for.body.lr.ph: ; preds = %for.cond.preheader
%arrayidx7 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom
%mul = shl nsw i32 %e, 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%1 = phi i32 [ %0, %for.body.lr.ph ], [ %9, %for.inc ]
%idxprom3 = sext i32 %1 to i64
%arrayidx4 = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %idxprom3
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %2, 0
br i1 %cmp5, label %for.inc, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %idxprom3
%4 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%idxprom12 = sext i32 %4 to i64
%arrayidx13 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom12
%5 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14.not = icmp slt i32 %3, %5
br i1 %cmp14.not, label %if.end16, label %for.inc
if.end16: ; preds = %lor.lhs.false
%cond.i = tail call i32 @llvm.smin.i32(i32 %min, i32 %2)
%call25 = tail call i32 @MF(i32 noundef %e, i32 noundef %4, i32 noundef %t, i32 noundef %cond.i)
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom28 = sext i32 %6 to i64
%arrayidx29 = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %idxprom28
%7 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%sub = sub nsw i32 %7, %call25
store i32 %sub, ptr %arrayidx29, align 4, !tbaa !5
%add32 = add nsw i32 %6, %e
%rem = srem i32 %add32, %mul
%idxprom33 = sext i32 %rem to i64
%arrayidx34 = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %idxprom33
%8 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%add35 = add nsw i32 %8, %call25
store i32 %add35, ptr %arrayidx34, align 4, !tbaa !5
%tobool36.not = icmp eq i32 %call25, 0
br i1 %tobool36.not, label %for.inc, label %return
for.inc: ; preds = %if.end16, %for.body, %lor.lhs.false
%idxprom41.pre-phi = phi i64 [ %idxprom28, %if.end16 ], [ %idxprom3, %for.body ], [ %idxprom3, %lor.lhs.false ]
%arrayidx42 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %idxprom41.pre-phi
%9 = load i32, ptr %arrayidx42, align 4, !tbaa !5
store i32 %9, ptr %arrayidx, align 4, !tbaa !5
%tobool.not = icmp eq i32 %9, -1
br i1 %tobool.not, label %return, label %for.body, !llvm.loop !9
return: ; preds = %for.inc, %if.end16, %for.cond.preheader, %entry
%retval.1 = phi i32 [ %min, %entry ], [ 0, %for.cond.preheader ], [ 0, %for.inc ], [ %call25, %if.end16 ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @maxf(i32 noundef %v, i32 noundef %e, i32 noundef %s, i32 noundef %g) local_unnamed_addr #3 {
entry:
%q = alloca [100010 x i32], align 16
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %q) #10
%idxprom40 = sext i32 %g to i64
%arrayidx41 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom40
%cmp79 = icmp sgt i32 %v, 0
%idxprom2 = sext i32 %s to i64
%arrayidx3 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom2
%0 = zext i32 %v to i64
%1 = shl nuw nsw i64 %0, 2
br label %while.cond
while.cond.loopexit: ; preds = %while.cond55
br label %while.cond, !llvm.loop !11
while.cond: ; preds = %while.cond.loopexit, %entry
%a.0 = phi i32 [ 0, %entry ], [ %a.1, %while.cond.loopexit ]
br i1 %cmp79, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.cond
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @l, i8 0, i64 %1, i1 false), !tbaa !5
br label %for.end
for.end: ; preds = %for.body.preheader, %while.cond
store i32 %s, ptr %q, align 16, !tbaa !5
store i32 1, ptr %arrayidx3, align 4, !tbaa !5
br label %for.body5
for.body5: ; preds = %for.end, %for.inc37
%indvars.iv = phi i64 [ 0, %for.end ], [ %indvars.iv.next, %for.inc37 ]
%r.086 = phi i32 [ 1, %for.end ], [ %r.1.lcssa, %for.inc37 ]
%arrayidx7 = getelementptr inbounds [100010 x i32], ptr %q, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%idxprom8 = sext i32 %2 to i64
%arrayidx9 = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom8
%i.181 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%tobool11.not82 = icmp eq i32 %i.181, -1
br i1 %tobool11.not82, label %for.inc37, label %for.body12
for.body12: ; preds = %for.body5, %for.inc33
%i.184 = phi i32 [ %i.1, %for.inc33 ], [ %i.181, %for.body5 ]
%r.183 = phi i32 [ %r.2, %for.inc33 ], [ %r.086, %for.body5 ]
%idxprom13 = sext i32 %i.184 to i64
%arrayidx14 = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %idxprom13
%3 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%tobool15.not = icmp eq i32 %3, 0
br i1 %tobool15.not, label %for.inc33, label %land.lhs.true
land.lhs.true: ; preds = %for.body12
%arrayidx17 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %idxprom13
%4 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%idxprom18 = sext i32 %4 to i64
%arrayidx19 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom18
%5 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp eq i32 %5, 0
br i1 %cmp20, label %if.then, label %for.inc33
if.then: ; preds = %land.lhs.true
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%idxprom23 = sext i32 %6 to i64
%arrayidx24 = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom23
%7 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%add25 = add nsw i32 %7, 1
%inc28 = add nsw i32 %r.183, 1
%idxprom29 = sext i32 %r.183 to i64
%arrayidx30 = getelementptr inbounds [100010 x i32], ptr %q, i64 0, i64 %idxprom29
store i32 %4, ptr %arrayidx30, align 4, !tbaa !5
store i32 %add25, ptr %arrayidx19, align 4, !tbaa !5
br label %for.inc33
for.inc33: ; preds = %for.body12, %land.lhs.true, %if.then
%r.2 = phi i32 [ %inc28, %if.then ], [ %r.183, %land.lhs.true ], [ %r.183, %for.body12 ]
%arrayidx35 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %idxprom13
%i.1 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%tobool11.not = icmp eq i32 %i.1, -1
br i1 %tobool11.not, label %for.inc37, label %for.body12, !llvm.loop !12
for.inc37: ; preds = %for.inc33, %for.body5
%r.1.lcssa = phi i32 [ %r.086, %for.body5 ], [ %r.2, %for.inc33 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = zext i32 %r.1.lcssa to i64
%tobool.not = icmp eq i64 %indvars.iv.next, %8
br i1 %tobool.not, label %for.end39, label %for.body5, !llvm.loop !13
for.end39: ; preds = %for.inc37
%9 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%cmp42 = icmp eq i32 %9, 0
br i1 %cmp42, label %if.then43, label %for.cond45.preheader
for.cond45.preheader: ; preds = %for.end39
br i1 %cmp79, label %for.body47.preheader, label %while.cond55.preheader
while.cond55.preheader: ; preds = %for.body47.preheader, %for.cond45.preheader
br label %while.cond55
for.body47.preheader: ; preds = %for.cond45.preheader
tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @it, ptr nonnull align 16 @ta, i64 %1, i1 false), !tbaa !5
br label %while.cond55.preheader
if.then43: ; preds = %for.end39
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %q) #10
ret i32 %a.0
while.cond55: ; preds = %while.cond55.preheader, %while.cond55
%a.1 = phi i32 [ %add58, %while.cond55 ], [ %a.0, %while.cond55.preheader ]
%call = tail call i32 @MF(i32 noundef %e, i32 noundef %s, i32 noundef %g, i32 noundef 1000000000)
%tobool56.not = icmp eq i32 %call, 0
%add58 = add nsw i32 %call, %a.1
br i1 %tobool56.not, label %while.cond.loopexit, label %while.cond55, !llvm.loop !11
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @mklsb(i32 noundef %v, i32 noundef %e, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, ptr nocapture noundef readonly %c) local_unnamed_addr #4 {
entry:
%cmp59 = icmp sgt i32 %v, 0
br i1 %cmp59, label %for.body.preheader, label %for.cond1.preheader
for.body.preheader: ; preds = %entry
%0 = zext i32 %v to i64
%1 = shl nuw nsw i64 %0, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @ta, i8 -1, i64 %1, i1 false), !tbaa !5
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.body.preheader, %entry
%cmp261 = icmp sgt i32 %e, 0
br i1 %cmp261, label %for.body3.preheader, label %for.end38
for.body3.preheader: ; preds = %for.cond1.preheader
%2 = zext i32 %e to i64
%wide.trip.count = zext i32 %e to i64
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.body3 ]
%arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%4 = add nuw nsw i64 %indvars.iv, %2
%arrayidx7 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %4
store i32 %3, ptr %arrayidx7, align 4, !tbaa !5
%idxprom8 = sext i32 %3 to i64
%arrayidx9 = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %indvars.iv
store i32 %5, ptr %arrayidx11, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv
%6 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%arrayidx15 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %indvars.iv
store i32 %6, ptr %arrayidx15, align 4, !tbaa !5
%idxprom16 = sext i32 %6 to i64
%arrayidx17 = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom16
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx20 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %4
store i32 %7, ptr %arrayidx20, align 4, !tbaa !5
%arrayidx22 = getelementptr inbounds i32, ptr %c, i64 %indvars.iv
%8 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%idxprom25 = sext i32 %9 to i64
%arrayidx26 = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom25
%10 = trunc i64 %indvars.iv to i32
store i32 %10, ptr %arrayidx26, align 4, !tbaa !5
%arrayidx28 = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %indvars.iv
store i32 %8, ptr %arrayidx28, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%idxprom32 = sext i32 %11 to i64
%arrayidx33 = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom32
%12 = trunc i64 %4 to i32
store i32 %12, ptr %arrayidx33, align 4, !tbaa !5
%arrayidx35 = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %4
store i32 0, ptr %arrayidx35, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end38, label %for.body3, !llvm.loop !14
for.end38: ; preds = %for.body3, %for.cond1.preheader
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%q.i = alloca [100010 x i32], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
%i = alloca i32, align 4
%j = alloca i32, align 4
%t = alloca i32, align 4
%a = alloca [100010 x i32], align 16
%b = alloca [100010 x i32], align 16
%c = alloca [100010 x i32], align 16
%d = alloca i32, align 4
%s = alloca [100010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #10
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %a) #10
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %b) #10
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %c) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #10
call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %s) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %s)
store i32 0, ptr %i, align 4, !tbaa !5
%0 = load i8, ptr %s, align 16, !tbaa !15
%tobool.not82 = icmp eq i8 %0, 0
br i1 %tobool.not82, label %while.cond.preheader, label %for.body
while.cond.preheader.loopexit: ; preds = %for.inc
%1 = trunc i64 %indvars.iv.next to i32
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.loopexit, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %1, %while.cond.preheader.loopexit ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%dec84 = add nsw i32 %2, -1
store i32 %dec84, ptr %m, align 4, !tbaa !5
%tobool38.not85 = icmp eq i32 %2, 0
br i1 %tobool38.not85, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %while.cond.preheader
%3 = zext i32 %r.0.lcssa to i64
br label %while.body
for.body: ; preds = %entry, %for.inc
%4 = phi i32 [ %add, %for.inc ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %d)
%idxprom2 = zext i32 %4 to i64
%arrayidx3 = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %idxprom2
%5 = load i8, ptr %arrayidx3, align 1, !tbaa !15
%cmp = icmp eq i8 %5, 76
%arrayidx6 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 0, ptr %arrayidx6, align 8, !tbaa !5
%add = add nuw nsw i32 %4, 1
%arrayidx8 = getelementptr inbounds [100010 x i32], ptr %b, i64 0, i64 %indvars.iv
store i32 %add, ptr %arrayidx8, align 8, !tbaa !5
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %for.body
%6 = or i64 %indvars.iv, 1
%arrayidx10 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %indvars.iv
store i32 0, ptr %arrayidx10, align 8, !tbaa !5
%arrayidx13 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %6
store i32 %add, ptr %arrayidx13, align 4, !tbaa !5
%7 = load i32, ptr %n, align 4, !tbaa !5
%add14 = add nsw i32 %7, 1
%arrayidx16 = getelementptr inbounds [100010 x i32], ptr %b, i64 0, i64 %6
store i32 %add14, ptr %arrayidx16, align 4, !tbaa !5
%8 = load i32, ptr %d, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %for.body
%9 = load i32, ptr %d, align 4, !tbaa !5
%10 = or i64 %indvars.iv, 1
%arrayidx27 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %indvars.iv
store i32 %9, ptr %arrayidx27, align 8, !tbaa !5
%arrayidx30 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %10
store i32 %add, ptr %arrayidx30, align 4, !tbaa !5
%11 = load i32, ptr %n, align 4, !tbaa !5
%add31 = add nsw i32 %11, 1
%arrayidx33 = getelementptr inbounds [100010 x i32], ptr %b, i64 0, i64 %10
store i32 %add31, ptr %arrayidx33, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%.sink94 = phi i64 [ %6, %if.then ], [ %10, %if.else ]
%.sink = phi i32 [ %8, %if.then ], [ 0, %if.else ]
%arrayidx19 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %.sink94
store i32 %.sink, ptr %arrayidx19, align 4, !tbaa !5
%indvars.iv.next = add nuw i64 %indvars.iv, 2
store i32 %add, ptr %i, align 4, !tbaa !5
%idxprom = zext i32 %add to i64
%arrayidx = getelementptr inbounds [100010 x i8], ptr %s, i64 0, i64 %idxprom
%12 = load i8, ptr %arrayidx, align 1, !tbaa !15
%tobool.not = icmp eq i8 %12, 0
br i1 %tobool.not, label %while.cond.preheader.loopexit, label %for.body, !llvm.loop !16
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv91 = phi i64 [ %3, %while.body.preheader ], [ %indvars.iv.next92, %while.body ]
%call39 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i, ptr noundef nonnull %j, ptr noundef nonnull %t)
%13 = load i32, ptr %i, align 4, !tbaa !5
%14 = load i32, ptr %j, align 4, !tbaa !5
%cond.i = call i32 @llvm.smin.i32(i32 %13, i32 %14)
%arrayidx42 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %indvars.iv91
store i32 %cond.i, ptr %arrayidx42, align 4, !tbaa !5
%cond.i73 = call i32 @llvm.smax.i32(i32 %13, i32 %14)
%arrayidx45 = getelementptr inbounds [100010 x i32], ptr %b, i64 0, i64 %indvars.iv91
store i32 %cond.i73, ptr %arrayidx45, align 4, !tbaa !5
%15 = load i32, ptr %t, align 4, !tbaa !5
%indvars.iv.next92 = add nuw i64 %indvars.iv91, 1
%arrayidx48 = getelementptr inbounds [100010 x i32], ptr %c, i64 0, i64 %indvars.iv91
store i32 %15, ptr %arrayidx48, align 4, !tbaa !5
%16 = load i32, ptr %m, align 4, !tbaa !5
%dec = add nsw i32 %16, -1
store i32 %dec, ptr %m, align 4, !tbaa !5
%tobool38.not = icmp eq i32 %16, 0
br i1 %tobool38.not, label %while.end.loopexit, label %while.body, !llvm.loop !17
while.end.loopexit: ; preds = %while.body
%17 = trunc i64 %indvars.iv.next92 to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %while.cond.preheader
%r.2.lcssa = phi i32 [ %r.0.lcssa, %while.cond.preheader ], [ %17, %while.end.loopexit ]
%18 = load i32, ptr %n, align 4, !tbaa !5
%add49 = add nsw i32 %18, 2
%cmp59.i = icmp sgt i32 %18, -2
br i1 %cmp59.i, label %for.body.preheader.i, label %for.cond1.preheader.i
for.body.preheader.i: ; preds = %while.end
%19 = zext i32 %add49 to i64
%20 = shl nuw nsw i64 %19, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @ta, i8 -1, i64 %20, i1 false), !tbaa !5
br label %for.cond1.preheader.i
for.cond1.preheader.i: ; preds = %for.body.preheader.i, %while.end
%cmp261.i.not = icmp eq i32 %r.2.lcssa, 0
br i1 %cmp261.i.not, label %mklsb.exit, label %for.body3.preheader.i
for.body3.preheader.i: ; preds = %for.cond1.preheader.i
%21 = zext i32 %r.2.lcssa to i64
br label %for.body3.i
for.body3.i: ; preds = %for.body3.i, %for.body3.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.body3.i ]
%arrayidx5.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%23 = add nuw nsw i64 %indvars.iv.i, %21
%arrayidx7.i = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %23
store i32 %22, ptr %arrayidx7.i, align 4, !tbaa !5
%idxprom8.i = sext i32 %22 to i64
%arrayidx9.i = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom8.i
%24 = load i32, ptr %arrayidx9.i, align 4, !tbaa !5
%arrayidx11.i = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %indvars.iv.i
store i32 %24, ptr %arrayidx11.i, align 4, !tbaa !5
%arrayidx13.i = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.i
%25 = load i32, ptr %arrayidx13.i, align 4, !tbaa !5
%arrayidx15.i = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %indvars.iv.i
store i32 %25, ptr %arrayidx15.i, align 4, !tbaa !5
%idxprom16.i = sext i32 %25 to i64
%arrayidx17.i = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom16.i
%26 = load i32, ptr %arrayidx17.i, align 4, !tbaa !5
%arrayidx20.i = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %23
store i32 %26, ptr %arrayidx20.i, align 4, !tbaa !5
%arrayidx22.i = getelementptr inbounds i32, ptr %c, i64 %indvars.iv.i
%27 = load i32, ptr %arrayidx22.i, align 4, !tbaa !5
%28 = trunc i64 %indvars.iv.i to i32
store i32 %28, ptr %arrayidx9.i, align 4, !tbaa !5
%arrayidx28.i = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %indvars.iv.i
store i32 %27, ptr %arrayidx28.i, align 4, !tbaa !5
%29 = trunc i64 %23 to i32
store i32 %29, ptr %arrayidx17.i, align 4, !tbaa !5
%arrayidx35.i = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %23
store i32 0, ptr %arrayidx35.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %21
br i1 %exitcond.not.i, label %mklsb.exit, label %for.body3.i, !llvm.loop !14
mklsb.exit: ; preds = %for.body3.i, %for.cond1.preheader.i
%add54 = add nsw i32 %18, 1
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %q.i) #10
%idxprom40.i = sext i32 %add54 to i64
%arrayidx41.i = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom40.i
%30 = zext i32 %add49 to i64
%31 = shl nuw nsw i64 %30, 2
br label %while.cond.i
while.cond.loopexit.i: ; preds = %while.cond55.i
br label %while.cond.i, !llvm.loop !11
while.cond.i: ; preds = %while.cond.loopexit.i, %mklsb.exit
%a.0.i = phi i32 [ 0, %mklsb.exit ], [ %a.1.i, %while.cond.loopexit.i ]
br i1 %cmp59.i, label %for.body.preheader.i81, label %for.end.i
for.body.preheader.i81: ; preds = %while.cond.i
call void @llvm.memset.p0.i64(ptr nonnull align 16 @l, i8 0, i64 %31, i1 false), !tbaa !5
br label %for.end.i
for.end.i: ; preds = %for.body.preheader.i81, %while.cond.i
store i32 0, ptr %q.i, align 16, !tbaa !5
store i32 1, ptr @l, align 16, !tbaa !5
br label %for.body5.i
for.body5.i: ; preds = %for.inc37.i, %for.end.i
%indvars.iv.i74 = phi i64 [ 0, %for.end.i ], [ %indvars.iv.next.i80, %for.inc37.i ]
%r.086.i = phi i32 [ 1, %for.end.i ], [ %r.1.lcssa.i, %for.inc37.i ]
%arrayidx7.i75 = getelementptr inbounds [100010 x i32], ptr %q.i, i64 0, i64 %indvars.iv.i74
%32 = load i32, ptr %arrayidx7.i75, align 4, !tbaa !5
%idxprom8.i76 = sext i32 %32 to i64
%arrayidx9.i77 = getelementptr inbounds [100010 x i32], ptr @ta, i64 0, i64 %idxprom8.i76
%i.181.i = load i32, ptr %arrayidx9.i77, align 4, !tbaa !5
%tobool11.not82.i = icmp eq i32 %i.181.i, -1
br i1 %tobool11.not82.i, label %for.inc37.i, label %for.body12.i
for.body12.i: ; preds = %for.body5.i, %for.inc33.i
%i.184.i = phi i32 [ %i.1.i, %for.inc33.i ], [ %i.181.i, %for.body5.i ]
%r.183.i = phi i32 [ %r.2.i, %for.inc33.i ], [ %r.086.i, %for.body5.i ]
%idxprom13.i = sext i32 %i.184.i to i64
%arrayidx14.i = getelementptr inbounds [100010 x i32], ptr @co, i64 0, i64 %idxprom13.i
%33 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
%tobool15.not.i = icmp eq i32 %33, 0
br i1 %tobool15.not.i, label %for.inc33.i, label %land.lhs.true.i
land.lhs.true.i: ; preds = %for.body12.i
%arrayidx17.i78 = getelementptr inbounds [100010 x i32], ptr @to, i64 0, i64 %idxprom13.i
%34 = load i32, ptr %arrayidx17.i78, align 4, !tbaa !5
%idxprom18.i = sext i32 %34 to i64
%arrayidx19.i = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom18.i
%35 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
%cmp20.i = icmp eq i32 %35, 0
br i1 %cmp20.i, label %if.then.i, label %for.inc33.i
if.then.i: ; preds = %land.lhs.true.i
%36 = load i32, ptr %arrayidx7.i75, align 4, !tbaa !5
%idxprom23.i = sext i32 %36 to i64
%arrayidx24.i = getelementptr inbounds [100010 x i32], ptr @l, i64 0, i64 %idxprom23.i
%37 = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%add25.i = add nsw i32 %37, 1
%inc28.i = add nsw i32 %r.183.i, 1
%idxprom29.i = sext i32 %r.183.i to i64
%arrayidx30.i = getelementptr inbounds [100010 x i32], ptr %q.i, i64 0, i64 %idxprom29.i
store i32 %34, ptr %arrayidx30.i, align 4, !tbaa !5
store i32 %add25.i, ptr %arrayidx19.i, align 4, !tbaa !5
br label %for.inc33.i
for.inc33.i: ; preds = %if.then.i, %land.lhs.true.i, %for.body12.i
%r.2.i = phi i32 [ %inc28.i, %if.then.i ], [ %r.183.i, %land.lhs.true.i ], [ %r.183.i, %for.body12.i ]
%arrayidx35.i79 = getelementptr inbounds [100010 x i32], ptr @nt, i64 0, i64 %idxprom13.i
%i.1.i = load i32, ptr %arrayidx35.i79, align 4, !tbaa !5
%tobool11.not.i = icmp eq i32 %i.1.i, -1
br i1 %tobool11.not.i, label %for.inc37.i, label %for.body12.i, !llvm.loop !12
for.inc37.i: ; preds = %for.inc33.i, %for.body5.i
%r.1.lcssa.i = phi i32 [ %r.086.i, %for.body5.i ], [ %r.2.i, %for.inc33.i ]
%indvars.iv.next.i80 = add nuw nsw i64 %indvars.iv.i74, 1
%38 = zext i32 %r.1.lcssa.i to i64
%tobool.not.i = icmp eq i64 %indvars.iv.next.i80, %38
br i1 %tobool.not.i, label %for.end39.i, label %for.body5.i, !llvm.loop !13
for.end39.i: ; preds = %for.inc37.i
%39 = load i32, ptr %arrayidx41.i, align 4, !tbaa !5
%cmp42.i = icmp eq i32 %39, 0
br i1 %cmp42.i, label %maxf.exit, label %for.cond45.preheader.i
for.cond45.preheader.i: ; preds = %for.end39.i
br i1 %cmp59.i, label %for.body47.preheader.i, label %while.cond55.i.preheader
for.body47.preheader.i: ; preds = %for.cond45.preheader.i
call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @it, ptr nonnull align 16 @ta, i64 %31, i1 false), !tbaa !5
br label %while.cond55.i.preheader
while.cond55.i.preheader: ; preds = %for.body47.preheader.i, %for.cond45.preheader.i
br label %while.cond55.i
while.cond55.i: ; preds = %while.cond55.i.preheader, %while.cond55.i
%a.1.i = phi i32 [ %add58.i, %while.cond55.i ], [ %a.0.i, %while.cond55.i.preheader ]
%call.i = call i32 @MF(i32 noundef %r.2.lcssa, i32 noundef 0, i32 noundef %add54, i32 noundef 1000000000)
%tobool56.not.i = icmp eq i32 %call.i, 0
%add58.i = add nsw i32 %call.i, %a.1.i
br i1 %tobool56.not.i, label %while.cond.loopexit.i, label %while.cond55.i, !llvm.loop !11
maxf.exit: ; preds = %for.end39.i
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %q.i) #10
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %a.0.i)
call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %s) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #10
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %c) #10
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %b) #10
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %a) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
; 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) #9
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nosync nounwind memory(readwrite, argmem: 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~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 = !{!7, !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#include <math.h>
int main(void) {
int A[3];
int N, i = 0;
int a, b, c;
int max;
scanf("%d", &N);
while(i++ < N) {
scanf("%d %d %d", &a, &b, &c);
if(a > b) {
A[2] = b;
if(a > c) {
A[0] = a;
A[1] = c;
}
else {
A[0] = c;
A[1] = a;
}
}
else {
A[2] = a;
if(b > c) {
A[0] = b;
A[1] = c;
}
else {
A[0] = c;
A[1] = b;
}
}
if(pow(A[0], 2) == pow(A[1], 2) + pow(A[2], 2)) {
printf("YES\n");
}
else printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203280/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203280/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %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 4, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp46 = icmp sgt i32 %0, 0
br i1 %cmp46, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%inc47 = phi i32 [ %inc, %while.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%3 = load i32, ptr %c, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %1, i32 %2)
%.49 = call i32 @llvm.smin.i32(i32 %1, i32 %2)
%.44 = call i32 @llvm.smin.i32(i32 %., i32 %3)
%.45 = call i32 @llvm.smax.i32(i32 %., i32 %3)
%conv = sitofp i32 %.45 to double
%square = fmul double %conv, %conv
%conv23 = sitofp i32 %.44 to double
%square40 = fmul double %conv23, %conv23
%conv26 = sitofp i32 %.49 to double
%square41 = fmul double %conv26, %conv26
%add = fadd double %square40, %square41
%cmp28 = fcmp oeq double %square, %add
%str.sink = select i1 %cmp28, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%inc = add nuw nsw i32 %inc47, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc47, %4
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int N,a,b,c,esc,count,count1;
scanf("%d",&N);
for(count=0;count<N;count++){
scanf("%d %d %d",&a,&b,&c);
for(count1=0;count1<2;count1++){
if(a>b){
esc=b;
b=a;
a=esc;
}
if(b>c){
esc=c;
c=b;
b=esc;
}
}
if(a*a+b*b==c*c){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203338/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203338/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.end18
for.body: ; preds = %entry, %for.inc.1
%count.028 = phi i32 [ %inc17, %for.inc.1 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%c.promoted = load i32, ptr %c, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %a.promoted, %b.promoted
br i1 %cmp5, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %a.promoted, ptr %b, align 4, !tbaa !5
store i32 %b.promoted, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%1 = phi i32 [ %a.promoted, %if.then ], [ %b.promoted, %for.body ]
%2 = phi i32 [ %b.promoted, %if.then ], [ %a.promoted, %for.body ]
%cmp6 = icmp sgt i32 %1, %c.promoted
br i1 %cmp6, label %if.then7, label %for.inc
if.then7: ; preds = %if.end
store i32 %1, ptr %c, align 4, !tbaa !5
store i32 %c.promoted, ptr %b, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end, %if.then7
%3 = phi i32 [ %c.promoted, %if.end ], [ %1, %if.then7 ]
%4 = phi i32 [ %1, %if.end ], [ %c.promoted, %if.then7 ]
%cmp5.1 = icmp sgt i32 %2, %4
br i1 %cmp5.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %for.inc
store i32 %2, ptr %b, align 4, !tbaa !5
store i32 %4, ptr %a, align 4, !tbaa !5
br label %if.end.1
if.end.1: ; preds = %if.then.1, %for.inc
%5 = phi i32 [ %4, %if.then.1 ], [ %2, %for.inc ]
%6 = phi i32 [ %2, %if.then.1 ], [ %4, %for.inc ]
%cmp6.1 = icmp sgt i32 %6, %3
br i1 %cmp6.1, label %if.then7.1, label %for.inc.1
if.then7.1: ; preds = %if.end.1
store i32 %6, ptr %c, align 4, !tbaa !5
store i32 %3, ptr %b, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then7.1, %if.end.1
%7 = phi i32 [ %6, %if.then7.1 ], [ %3, %if.end.1 ]
%8 = phi i32 [ %3, %if.then7.1 ], [ %6, %if.end.1 ]
%mul = mul nsw i32 %5, %5
%mul9 = mul nsw i32 %8, %8
%add = add nuw nsw i32 %mul9, %mul
%mul10 = mul nsw i32 %7, %7
%cmp11 = icmp eq i32 %add, %mul10
%str.4.str = select i1 %cmp11, ptr @str.4, ptr @str
%puts25 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc17 = add nuw nsw i32 %count.028, 1
%9 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc17, %9
br i1 %cmp, label %for.body, label %for.end18, !llvm.loop !9
for.end18: ; preds = %for.inc.1, %entry
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
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 a,i,l,m,n,max1,max2,max3;
scanf("%d",&a);
for(i=0;i<a;i++){
scanf("%d",&l);
max1 = l;
scanf("%d",&m);
if(max1<m){
max1 = m;
max2 = l;
}else{
max1 = l;
max2 = m;
}
scanf("%d",&n);
if(max1<n){
max3 = max2;
max2 = max1;
max1 = n;
}else if(max2>n){
max3 = n;
}else if(max2<n<max1){
max3 = max2;
max2 = n;
}
if((max1)*(max1)==(max2)*(max2)+(max3)*(max3)){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203381/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203381/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%l = alloca i32, align 4
%m = alloca i32, align 4
%n = 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 %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #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 %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp43 = icmp sgt i32 %0, 0
br i1 %cmp43, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end17
%max3.045 = phi i32 [ %max3.1, %if.end17 ], [ undef, %entry ]
%i.044 = phi i32 [ %inc, %if.end17 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%1 = load i32, ptr %l, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp3 = icmp slt i32 %1, %2
%3 = load i32, ptr %l, align 4
%max1.0 = select i1 %cmp3, i32 %2, i32 %3
%max2.0 = select i1 %cmp3, i32 %3, i32 %2
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp slt i32 %max1.0, %4
br i1 %cmp5, label %if.end17, label %if.else7
if.else7: ; preds = %for.body
%cmp8 = icmp sgt i32 %max2.0, %4
br i1 %cmp8, label %if.end17, label %if.else10
if.else10: ; preds = %if.else7
%cmp11 = icmp slt i32 %max2.0, %4
%conv = zext i1 %cmp11 to i32
%cmp12 = icmp sgt i32 %max1.0, %conv
%spec.select = select i1 %cmp12, i32 %4, i32 %max2.0
%spec.select42 = select i1 %cmp12, i32 %max2.0, i32 %max3.045
br label %if.end17
if.end17: ; preds = %if.else10, %if.else7, %for.body
%max1.1 = phi i32 [ %4, %for.body ], [ %max1.0, %if.else7 ], [ %max1.0, %if.else10 ]
%max2.1 = phi i32 [ %max1.0, %for.body ], [ %max2.0, %if.else7 ], [ %spec.select, %if.else10 ]
%max3.1 = phi i32 [ %max2.0, %for.body ], [ %4, %if.else7 ], [ %spec.select42, %if.else10 ]
%mul = mul nsw i32 %max1.1, %max1.1
%mul18 = mul nsw i32 %max2.1, %max2.1
%mul19 = mul nsw i32 %max3.1, %max3.1
%add = add nuw nsw i32 %mul19, %mul18
%cmp20 = icmp eq i32 %mul, %add
%str.3.str = select i1 %cmp20, ptr @str.3, ptr @str
%puts41 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%inc = add nuw nsw i32 %i.044, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end17, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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 @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 n, i, a, b, c;
scanf("%d", &n);
for (i = 0; i < n; ++i) {
scanf("%d %d %d", &a, &b, &c);
if ((a * a == b * b + c * c)
|| (b * b == c * c + a * a)
|| (c * c == a * a + b * b))
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203424/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203424/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%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 %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add14 = add nuw nsw i32 %mul2, %mul
%cmp15 = icmp eq i32 %mul3, %add14
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
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
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 n;
int a;
int b;
int c;
int i;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%d%d%d", &a, &b, &c);
if ((a * a) + (b * b) == (c * c)){
printf("YES\n");
}
else if ((b * b) + (c * c) == (a * a)){
printf("YES\n");
}
else if ((a * a) + (c * c) == (b * b)){
printf("YES\n");
}
else {
printf("NO\n");
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203475/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203475/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.6 = 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 i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.030 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul2, %mul
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%cmp4 = icmp eq i32 %add, %mul3
br i1 %cmp4, label %for.inc, label %if.else
if.else: ; preds = %for.body
%add8 = add nuw nsw i32 %mul3, %mul2
%cmp10 = icmp eq i32 %add8, %mul
br i1 %cmp10, label %for.inc, label %if.else13
if.else13: ; preds = %if.else
%add16 = add nuw nsw i32 %mul3, %mul
%cmp18 = icmp eq i32 %add16, %mul2
%str.4.str = select i1 %cmp18, ptr @str.6, ptr @str
br label %for.inc
for.inc: ; preds = %if.else13, %if.else, %for.body
%str.6.sink = phi ptr [ @str.6, %for.body ], [ @str.6, %if.else ], [ %str.4.str, %if.else13 ]
%puts28 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
%inc = add nuw nsw i32 %i.030, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
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
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 n, hen[3], i, j, k, co;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%d %d %d", &hen[0], &hen[1], &hen[2]);
for (j = 0; j < 3; j++){
hen[j] *= hen[j];
}
for (j = 0; j < 3; j++){
for (k = 0; k < 3; k++){
if (hen[j] < hen[k]){
co = hen[j];
hen[j] = hen[k];
hen[k] = co;
}
}
}
//printf("%d %d %d", hen[0], hen[1], hen[2]);
if (hen[0] + hen[1] == hen[2]) printf("YES\n");
else printf("NO\n");
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203525/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203525/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%hen = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %hen) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp64 = icmp sgt i32 %0, 0
br i1 %cmp64, label %for.body.lr.ph, label %for.end45
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %hen, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %hen, i64 0, i64 2
br label %for.inc29
for.inc29: ; preds = %for.inc29.2.2, %for.body.lr.ph
%i.065 = phi i32 [ 0, %for.body.lr.ph ], [ %inc44, %for.inc29.2.2 ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %hen, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %hen, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
store i32 %mul, ptr %hen, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %2, %2
store i32 %mul.1, ptr %arrayidx1, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%mul.2 = mul nsw i32 %3, %3
store i32 %mul.2, ptr %arrayidx2, align 4, !tbaa !5
%cmp20.1 = icmp ult i32 %mul, %mul.1
br i1 %cmp20.1, label %if.then.1, label %for.inc29.1
if.then.1: ; preds = %for.inc29
store i32 %mul.1, ptr %hen, align 4, !tbaa !5
store i32 %mul, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc29.1
for.inc29.1: ; preds = %if.then.1, %for.inc29
%4 = phi i32 [ %mul, %if.then.1 ], [ %mul.1, %for.inc29 ]
%5 = phi i32 [ %mul.1, %if.then.1 ], [ %mul, %for.inc29 ]
%cmp20.2 = icmp ult i32 %5, %mul.2
br i1 %cmp20.2, label %if.then.2, label %for.inc29.2
if.then.2: ; preds = %for.inc29.1
store i32 %mul.2, ptr %hen, align 4, !tbaa !5
store i32 %5, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc29.2
for.inc29.2: ; preds = %if.then.2, %for.inc29.1
%6 = phi i32 [ %5, %if.then.2 ], [ %mul.2, %for.inc29.1 ]
%7 = phi i32 [ %mul.2, %if.then.2 ], [ %5, %for.inc29.1 ]
%cmp20.169 = icmp slt i32 %4, %7
br i1 %cmp20.169, label %if.then.170, label %for.inc29.1.1
if.then.170: ; preds = %for.inc29.2
store i32 %7, ptr %arrayidx1, align 4, !tbaa !5
store i32 %4, ptr %hen, align 4, !tbaa !5
br label %for.inc29.1.1
for.inc29.1.1: ; preds = %for.inc29.2, %if.then.170
%8 = phi i32 [ %4, %if.then.170 ], [ %7, %for.inc29.2 ]
%9 = phi i32 [ %7, %if.then.170 ], [ %4, %for.inc29.2 ]
%cmp20.2.1 = icmp slt i32 %9, %6
br i1 %cmp20.2.1, label %if.then.2.1, label %for.inc29.2.1
if.then.2.1: ; preds = %for.inc29.1.1
store i32 %6, ptr %arrayidx1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc29.2.1
for.inc29.2.1: ; preds = %if.then.2.1, %for.inc29.1.1
%10 = phi i32 [ %6, %if.then.2.1 ], [ %9, %for.inc29.1.1 ]
%11 = phi i32 [ %9, %if.then.2.1 ], [ %6, %for.inc29.1.1 ]
%cmp20.272 = icmp slt i32 %11, %8
br i1 %cmp20.272, label %if.then.273, label %for.inc29.274
if.then.273: ; preds = %for.inc29.2.1
store i32 %8, ptr %arrayidx2, align 4, !tbaa !5
store i32 %11, ptr %hen, align 4, !tbaa !5
br label %for.inc29.274
for.inc29.274: ; preds = %if.then.273, %for.inc29.2.1
%12 = phi i32 [ %11, %if.then.273 ], [ %8, %for.inc29.2.1 ]
%13 = phi i32 [ %8, %if.then.273 ], [ %11, %for.inc29.2.1 ]
%cmp20.1.2 = icmp slt i32 %13, %10
br i1 %cmp20.1.2, label %if.then.1.2, label %for.inc29.2.2
if.then.1.2: ; preds = %for.inc29.274
store i32 %10, ptr %arrayidx2, align 4, !tbaa !5
store i32 %13, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc29.2.2
for.inc29.2.2: ; preds = %for.inc29.274, %if.then.1.2
%14 = phi i32 [ %13, %if.then.1.2 ], [ %10, %for.inc29.274 ]
%15 = phi i32 [ %10, %if.then.1.2 ], [ %13, %for.inc29.274 ]
%add = add nsw i32 %14, %12
%cmp38 = icmp eq i32 %add, %15
%str.4.str = select i1 %cmp38, ptr @str.4, ptr @str
%puts60 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc44 = add nuw nsw i32 %i.065, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc44, %16
br i1 %cmp, label %for.inc29, label %for.end45, !llvm.loop !9
for.end45: ; preds = %for.inc29.2.2, %entry
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %hen) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
void checkTri(int,int,int);
int main(){
int a,b,c,n,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d %d",&a,&b,&c);
checkTri(a,b,c);
}
return 0;
}
void checkTri(int a,int b,int c){
a*=a;
b*=b;
c*=c;
if(a==b+c)printf("YES\n");
else if(b==a+c)printf("YES\n");
else if(c==a+b)printf("YES\n");
else printf("NO\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203569/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203569/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%n = 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 %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
%cmp3 = icmp sgt i32 %0, 0
br i1 %cmp3, label %for.body, label %for.end
for.body: ; preds = %entry, %checkTri.exit
%i.04 = phi i32 [ %inc, %checkTri.exit ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul.i = mul nsw i32 %1, %1
%mul1.i = mul nsw i32 %2, %2
%mul2.i = mul nsw i32 %3, %3
%add.i = add nuw nsw i32 %mul2.i, %mul1.i
%cmp.i = icmp eq i32 %mul.i, %add.i
br i1 %cmp.i, label %checkTri.exit, label %if.else.i
if.else.i: ; preds = %for.body
%add3.i = add nuw nsw i32 %mul2.i, %mul.i
%cmp4.i = icmp eq i32 %mul1.i, %add3.i
br i1 %cmp4.i, label %checkTri.exit, label %if.else7.i
if.else7.i: ; preds = %if.else.i
%add8.i = add nuw nsw i32 %mul1.i, %mul.i
%cmp9.i = icmp eq i32 %mul2.i, %add8.i
%str.4.str.i = select i1 %cmp9.i, ptr @str.6, ptr @str
br label %checkTri.exit
checkTri.exit: ; preds = %for.body, %if.else.i, %if.else7.i
%str.5.sink.i = phi ptr [ @str.6, %for.body ], [ @str.6, %if.else.i ], [ %str.4.str.i, %if.else7.i ]
%puts29.i = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink.i)
%inc = add nuw nsw i32 %i.04, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %checkTri.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @checkTri(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%mul = mul nsw i32 %a, %a
%mul1 = mul nsw i32 %b, %b
%mul2 = mul nsw i32 %c, %c
%add = add nuw nsw i32 %mul2, %mul1
%cmp = icmp eq i32 %mul, %add
br i1 %cmp, label %if.end15, label %if.else
if.else: ; preds = %entry
%add3 = add nuw nsw i32 %mul2, %mul
%cmp4 = icmp eq i32 %mul1, %add3
br i1 %cmp4, label %if.end15, label %if.else7
if.else7: ; preds = %if.else
%add8 = add nuw nsw i32 %mul1, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%str.4.str = select i1 %cmp9, ptr @str.6, ptr @str
br label %if.end15
if.end15: ; preds = %if.else7, %if.else, %entry
%str.5.sink = phi ptr [ @str.6, %entry ], [ @str.6, %if.else ], [ %str.4.str, %if.else7 ]
%puts29 = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 N;
scanf("%d", &N);
int i;
int A[N];
int B[N];
int C[N];
char ans[N][4];
for( i = 0; i < N; i++ ){
ans[i][0] = 'N';
ans[i][1] = 'O';
ans[i][2] = '\0';
ans[i][3] = '\0';
scanf("%d %d %d", A+i, B+i, C+i );
if( A[i]*A[i] == (B[i]*B[i] + C[i]*C[i]) ){
ans[i][0] = 'Y';
ans[i][1] = 'E';
ans[i][2] = 'S';
}
if( B[i]*B[i] == (A[i]*A[i] + C[i]*C[i]) ){
ans[i][0] = 'Y';
ans[i][1] = 'E';
ans[i][2] = 'S';
}
if( C[i]*C[i] == (A[i]*A[i] + B[i]*B[i]) ){
ans[i][0] = 'Y';
ans[i][1] = 'E';
ans[i][2] = 'S';
}
}
for( i = 0; i < N; i++ ){
printf("%s\n", ans[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203611/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203611/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%vla2 = alloca i32, i64 %4, align 16
%vla3 = alloca [4 x i8], i64 %4, align 16
%cmp146 = icmp sgt i32 %3, 0
br i1 %cmp146, label %for.body, label %for.end107
for.cond99.preheader: ; preds = %for.inc
%5 = icmp sgt i32 %9, 0
br i1 %5, label %for.body101, label %for.end107
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [4 x i8], ptr %vla3, i64 %indvars.iv
%arrayidx7 = getelementptr inbounds [4 x i8], ptr %vla3, i64 %indvars.iv, i64 1
%arrayidx10 = getelementptr inbounds [4 x i8], ptr %vla3, i64 %indvars.iv, i64 2
store <4 x i8> <i8 78, i8 79, i8 0, i8 0>, ptr %arrayidx, align 4, !tbaa !9
%add.ptr = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%add.ptr15 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%add.ptr17 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr15, ptr noundef nonnull %add.ptr17)
%6 = load i32, ptr %add.ptr, align 4, !tbaa !5
%mul = mul nsw i32 %6, %6
%7 = load i32, ptr %add.ptr15, align 4, !tbaa !5
%mul27 = mul nsw i32 %7, %7
%8 = load i32, ptr %add.ptr17, align 4, !tbaa !5
%mul32 = mul nsw i32 %8, %8
%add = add nuw nsw i32 %mul32, %mul27
%cmp33 = icmp eq i32 %mul, %add
br i1 %cmp33, label %if.then, label %if.end
if.then: ; preds = %for.body
store i8 89, ptr %arrayidx, align 4, !tbaa !9
store i8 69, ptr %arrayidx7, align 1, !tbaa !9
store i8 83, ptr %arrayidx10, align 2, !tbaa !9
br label %if.end
if.end: ; preds = %if.then, %for.body
%add58 = add nuw nsw i32 %mul32, %mul
%cmp59 = icmp eq i32 %mul27, %add58
br i1 %cmp59, label %if.then60, label %if.end70
if.then60: ; preds = %if.end
store i8 89, ptr %arrayidx, align 4, !tbaa !9
store i8 69, ptr %arrayidx7, align 1, !tbaa !9
store i8 83, ptr %arrayidx10, align 2, !tbaa !9
br label %if.end70
if.end70: ; preds = %if.then60, %if.end
%add86 = add nuw nsw i32 %mul27, %mul
%cmp87 = icmp eq i32 %mul32, %add86
br i1 %cmp87, label %if.then88, label %for.inc
if.then88: ; preds = %if.end70
store i8 89, ptr %arrayidx, align 4, !tbaa !9
store i8 69, ptr %arrayidx7, align 1, !tbaa !9
store i8 83, ptr %arrayidx10, align 2, !tbaa !9
br label %for.inc
for.inc: ; preds = %if.end70, %if.then88
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %N, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.cond99.preheader, !llvm.loop !10
for.body101: ; preds = %for.cond99.preheader, %for.body101
%indvars.iv151 = phi i64 [ %indvars.iv.next152, %for.body101 ], [ 0, %for.cond99.preheader ]
%arrayidx103 = getelementptr inbounds [4 x i8], ptr %vla3, i64 %indvars.iv151
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx103)
%indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
%11 = load i32, ptr %N, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp100 = icmp slt i64 %indvars.iv.next152, %12
br i1 %cmp100, label %for.body101, label %for.end107, !llvm.loop !12
for.end107: ; preds = %for.body101, %entry, %for.cond99.preheader
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
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
int main(void){
int a, b, c, num, i, tmp;
scanf("%d", &num);
for(i = 0; i < num; i++){
scanf("%d %d %d", &a, &b, &c);
if(a < b){
tmp = a;
a = b;
b = tmp;
}
if(a < c){
tmp = a;
a = c;
c = tmp;
}
if(a * a == b * b + c * c){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203655/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203655/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%num = 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 %num) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end5
%i.020 = phi i32 [ %inc, %if.end5 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp slt i32 %1, %2
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 %1, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%3 = phi i32 [ %1, %if.then ], [ %2, %for.body ]
%4 = phi i32 [ %2, %if.then ], [ %1, %for.body ]
%5 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp slt i32 %4, %5
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %5, ptr %a, align 4, !tbaa !5
store i32 %4, ptr %c, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%6 = phi i32 [ %4, %if.then4 ], [ %5, %if.end ]
%7 = phi i32 [ %5, %if.then4 ], [ %4, %if.end ]
%mul = mul nsw i32 %7, %7
%mul6 = mul nsw i32 %3, %3
%mul7 = mul nsw i32 %6, %6
%add = add nuw nsw i32 %mul7, %mul6
%cmp8 = icmp eq i32 %mul, %add
%str.4.str = select i1 %cmp8, ptr @str.4, ptr @str
%puts18 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.020, 1
%8 = load i32, ptr %num, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end5, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int a,b,c,n,i;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d %d %d",&a,&b,&c);
a*=a; b*=b; c*=c;
if(a+b==c || b+c==a || c+a==b)
printf("YES\n");
else
printf("NO\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203705/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203705/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%n = 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 %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not15 = icmp slt i32 %0, 1
br i1 %cmp.not15, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.016 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
store i32 %mul, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
store i32 %mul2, ptr %b, align 4, !tbaa !5
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
store i32 %mul3, ptr %c, align 4, !tbaa !5
%add = add nuw nsw i32 %mul2, %mul
%cmp4 = icmp eq i32 %add, %mul3
%add5 = add nuw nsw i32 %mul3, %mul2
%cmp6 = icmp eq i32 %add5, %mul
%or.cond = select i1 %cmp4, i1 true, i1 %cmp6
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %add8, %mul2
%or.cond14 = select i1 %or.cond, i1 true, i1 %cmp9
%str.4.str = select i1 %or.cond14, ptr @str.4, ptr @str
%puts13 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.016, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.016, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 @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 i,N,a,b,c;
scanf("%d",&N);
for(i=0; i<N; i++){
scanf("%d %d %d",&a,&b,&c);
if(a*a==b*b+c*c || b*b==a*a+c*c || c*c==a*a+b*b)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203749/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203749/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add14 = add nuw nsw i32 %mul2, %mul
%cmp15 = icmp eq i32 %mul3, %add14
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
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
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 square(int x);
int main(void)
{
int i, a, temp, tcount, sides[3];
scanf("%d", &tcount);
for(a=0; a<tcount; a++)
{
scanf("%d %d %d", &sides[0], &sides[1], &sides[2]);
for(i = 0; i < 2; i++)
{
if(sides[i + 1] < sides[i])
{
temp = sides[i];
sides[i] = sides[i + 1];
sides[i + 1] = temp;
}
}
if(square(sides[2]) == (square(sides[0]) + square(sides[1])))
{
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}
int square(int x)
{
return x * x;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203813/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203813/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%tcount = alloca i32, align 4
%sides = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tcount) #5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %sides) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tcount)
%0 = load i32, ptr %tcount, align 4, !tbaa !5
%cmp49 = icmp sgt i32 %0, 0
br i1 %cmp49, label %for.body.lr.ph, label %for.end35
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %sides, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %sides, i64 0, i64 2
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc.1
%a.050 = phi i32 [ 0, %for.body.lr.ph ], [ %inc34, %for.inc.1 ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %sides, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%2 = load i32, ptr %sides, align 4, !tbaa !5
%cmp10 = icmp slt i32 %1, %2
br i1 %cmp10, label %if.then, label %for.inc
if.then: ; preds = %for.body
store i32 %1, ptr %sides, align 4, !tbaa !5
store i32 %2, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%3 = phi i32 [ %2, %for.body ], [ %1, %if.then ]
%4 = phi i32 [ %1, %for.body ], [ %2, %if.then ]
%5 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp10.1 = icmp slt i32 %5, %4
br i1 %cmp10.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 %5, ptr %arrayidx1, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%6 = phi i32 [ %5, %if.then.1 ], [ %4, %for.inc ]
%7 = phi i32 [ %4, %if.then.1 ], [ %5, %for.inc ]
%mul.i = mul nsw i32 %7, %7
%mul.i46 = mul nsw i32 %3, %3
%mul.i47 = mul nsw i32 %6, %6
%add27 = add nuw nsw i32 %mul.i47, %mul.i46
%cmp28 = icmp eq i32 %mul.i, %add27
%str.4.str = select i1 %cmp28, ptr @str.4, ptr @str
%puts45 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc34 = add nuw nsw i32 %a.050, 1
%8 = load i32, ptr %tcount, align 4, !tbaa !5
%cmp = icmp slt i32 %inc34, %8
br i1 %cmp, label %for.body, label %for.end35, !llvm.loop !9
for.end35: ; preds = %for.inc.1, %entry
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %sides) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tcount) #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 norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @square(i32 noundef %x) local_unnamed_addr #3 {
entry:
%mul = mul nsw i32 %x, %x
ret i32 %mul
}
; 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 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 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main (int argc, char* argv[])
{
int n, array[3], temp, i, j, k;
scanf("%d", &n);
for (i=0; i<n; i++) {
scanf("%d %d %d", &array[0], &array[1], &array[2]);
for (j=2; 0<j; j--) {
for (k=0; k<j; k++) {
if (array[k+1] < array[k]) {
temp = array[k];
array[k] = array[k+1];
array[k+1] = temp;
}
}
}
if (array[0]*array[0] + array[1]*array[1] == array[2]*array[2]) {
puts("YES");
} else {
puts("NO");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203879/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203879/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%array = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %array) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp56 = icmp sgt i32 %0, 0
br i1 %cmp56, label %for.body.lr.ph, label %for.end42
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %array, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %array, i64 0, i64 2
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc.1
%i.057 = phi i32 [ 0, %for.body.lr.ph ], [ %inc41, %for.inc.1 ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %array, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%2 = load i32, ptr %array, align 4, !tbaa !5
%cmp13 = icmp slt i32 %1, %2
br i1 %cmp13, label %if.then, label %for.inc
if.then: ; preds = %for.body
store i32 %1, ptr %array, align 4, !tbaa !5
store i32 %2, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%3 = phi i32 [ %2, %for.body ], [ %1, %if.then ]
%4 = phi i32 [ %1, %for.body ], [ %2, %if.then ]
%5 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp13.163 = icmp slt i32 %5, %4
br i1 %cmp13.163, label %if.then.165, label %for.inc.166
if.then.165: ; preds = %for.inc
store i32 %5, ptr %arrayidx1, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.166
for.inc.166: ; preds = %if.then.165, %for.inc
%6 = phi i32 [ %4, %if.then.165 ], [ %5, %for.inc ]
%7 = phi i32 [ %5, %if.then.165 ], [ %4, %for.inc ]
%cmp13.1 = icmp slt i32 %7, %3
br i1 %cmp13.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc.166
store i32 %7, ptr %array, align 4, !tbaa !5
store i32 %3, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc.166
%8 = phi i32 [ %3, %if.then.1 ], [ %7, %for.inc.166 ]
%9 = phi i32 [ %7, %if.then.1 ], [ %3, %for.inc.166 ]
%mul = mul nsw i32 %9, %9
%mul30 = mul nsw i32 %8, %8
%add31 = add nuw nsw i32 %mul30, %mul
%mul34 = mul nsw i32 %6, %6
%cmp35 = icmp eq i32 %add31, %mul34
%.str.2..str.3 = select i1 %cmp35, ptr @.str.2, ptr @.str.3
%call37 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
%inc41 = add nuw nsw i32 %i.057, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc41, %10
br i1 %cmp, label %for.body, label %for.end42, !llvm.loop !9
for.end42: ; preds = %for.inc.1, %entry
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %array) #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 judgeTriangle(int* num);
int judgeRightTriangle(int* num);
int main(){
int dataSize;
int num[3];
int i;
scanf("%d", &dataSize);
for(i = 0; i < dataSize; i++)
{
scanf("%d %d %d", num, num+1, num+2);
if((judgeTriangle(num) == 1) && (judgeRightTriangle(num) == 1))
{
printf("YES\n");
}
else
{
printf("NO\n");
}
}
return 0;
}
int judgeTriangle(int* num)
{
int i;
int sam = 0;
for(i = 0; i < 3; i++)
{
sam += num[i];
}
for(i = 0; i < 3; i++)
{
/* 0以下の辺がないか */
if(num[i] <= 0)
{
return 0;
}
/* 線になっていないか */
if(num[i] >= (sam-num[i]))
{
return 0;
}
}
return 1;
}
int judgeRightTriangle(int* num)
{
int i;
int dnum[3];
int dsum = 0;
for(i = 0; i < 3; i++)
{
dnum[i] = num[i]*num[i];
dsum += dnum[i];
}
for(i = 0; i < 3; i++)
{
if(dnum[i] == (dsum-dnum[i]))
{
return 1;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203921/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203921/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%dataSize = alloca i32, align 4
%num = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %dataSize) #5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %num) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %dataSize)
%0 = load i32, ptr %dataSize, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %0, 0
br i1 %cmp25, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%add.ptr = getelementptr inbounds i32, ptr %num, i64 1
%add.ptr3 = getelementptr inbounds i32, ptr %num, i64 2
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%i.026 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %num, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr3)
%1 = load i32, ptr %num, align 4, !tbaa !5
%2 = load i32, ptr %add.ptr, align 4, !tbaa !5
%add.1.i = add nsw i32 %2, %1
%3 = load i32, ptr %add.ptr3, align 4, !tbaa !5
%add.2.i = add nsw i32 %3, %add.1.i
%cmp6.i = icmp sgt i32 %1, 0
%sub.i = sub nsw i32 %add.2.i, %1
%cmp11.not.i = icmp slt i32 %1, %sub.i
%or.cond.i = select i1 %cmp6.i, i1 %cmp11.not.i, i1 false
br i1 %or.cond.i, label %for.cond1.i, label %if.else
for.cond1.i: ; preds = %for.body
%cmp6.1.i = icmp sgt i32 %2, 0
%sub.1.i = sub nsw i32 %add.2.i, %2
%cmp11.not.1.i = icmp slt i32 %2, %sub.1.i
%or.cond.1.i = select i1 %cmp6.1.i, i1 %cmp11.not.1.i, i1 false
br i1 %or.cond.1.i, label %judgeTriangle.exit, label %if.else
judgeTriangle.exit: ; preds = %for.cond1.i
%cmp6.2.i = icmp slt i32 %3, 1
%cmp11.not.2.i = icmp sge i32 %3, %add.1.i
%or.cond.2.i.not = select i1 %cmp6.2.i, i1 true, i1 %cmp11.not.2.i
br i1 %or.cond.2.i.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %judgeTriangle.exit
%mul.i = mul nsw i32 %1, %1
%mul.1.i = mul nsw i32 %2, %2
%add.1.i16 = add nuw nsw i32 %mul.1.i, %mul.i
%mul.2.i = mul nsw i32 %3, %3
%add.2.i18 = add nuw nsw i32 %mul.2.i, %add.1.i16
%sub.i19 = sub nsw i32 %add.2.i18, %mul.i
%cmp14.i = icmp eq i32 %mul.i, %sub.i19
%sub.1.i20 = sub nsw i32 %add.2.i18, %mul.1.i
%cmp14.1.i = icmp eq i32 %mul.1.i, %sub.1.i20
%or.cond.i21 = select i1 %cmp14.i, i1 true, i1 %cmp14.1.i
%cmp14.2.i = icmp eq i32 %mul.2.i, %add.1.i16
%or.cond36.i = or i1 %cmp14.2.i, %or.cond.i21
br i1 %or.cond36.i, label %for.inc, label %if.else
if.else: ; preds = %for.cond1.i, %for.body, %land.lhs.true, %judgeTriangle.exit
br label %for.inc
for.inc: ; preds = %land.lhs.true, %if.else
%str.4.sink = phi ptr [ @str, %if.else ], [ @str.4, %land.lhs.true ]
%puts14 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
%inc = add nuw nsw i32 %i.026, 1
%4 = load i32, ptr %dataSize, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %num) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %dataSize) #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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @judgeTriangle(ptr nocapture noundef readonly %num) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %num, align 4, !tbaa !5
%arrayidx.1 = getelementptr inbounds i32, ptr %num, i64 1
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add.1 = add nsw i32 %1, %0
%arrayidx.2 = getelementptr inbounds i32, ptr %num, i64 2
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%add.2 = add nsw i32 %2, %add.1
%cmp6 = icmp sgt i32 %0, 0
%sub = sub nsw i32 %add.2, %0
%cmp11.not = icmp slt i32 %0, %sub
%or.cond = select i1 %cmp6, i1 %cmp11.not, i1 false
br i1 %or.cond, label %for.cond1, label %cleanup
for.cond1: ; preds = %entry
%cmp6.1 = icmp sgt i32 %1, 0
%sub.1 = sub nsw i32 %add.2, %1
%cmp11.not.1 = icmp slt i32 %1, %sub.1
%or.cond.1 = select i1 %cmp6.1, i1 %cmp11.not.1, i1 false
br i1 %or.cond.1, label %for.cond1.1, label %cleanup
for.cond1.1: ; preds = %for.cond1
%cmp6.2 = icmp sgt i32 %2, 0
%cmp11.not.2 = icmp slt i32 %2, %add.1
%or.cond.2 = select i1 %cmp6.2, i1 %cmp11.not.2, i1 false
%spec.select = zext i1 %or.cond.2 to i32
br label %cleanup
cleanup: ; preds = %for.cond1.1, %for.cond1, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond1 ], [ %spec.select, %for.cond1.1 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @judgeRightTriangle(ptr nocapture noundef readonly %num) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %num, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%arrayidx.1 = getelementptr inbounds i32, ptr %num, i64 1
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%mul.1 = mul nsw i32 %1, %1
%add.1 = add nuw nsw i32 %mul.1, %mul
%arrayidx.2 = getelementptr inbounds i32, ptr %num, i64 2
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%mul.2 = mul nsw i32 %2, %2
%add.2 = add nuw nsw i32 %mul.2, %add.1
%sub = sub nsw i32 %add.2, %mul
%cmp14 = icmp eq i32 %mul, %sub
%sub.1 = sub nsw i32 %add.2, %mul.1
%cmp14.1 = icmp eq i32 %mul.1, %sub.1
%or.cond = select i1 %cmp14, i1 true, i1 %cmp14.1
%cmp14.2 = icmp eq i32 %mul.2, %add.1
%or.cond36 = or i1 %or.cond, %cmp14.2
%retval.0 = zext i1 %or.cond36 to i32
ret i32 %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
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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
/*
1000 以下の3つの正の整数を入力し、
それぞれの長さを3辺とする三角形が直角三角形である場合には YES を、
違う場合には NO と出力して終了するプログラムを作成して下さい。
手順:
・データセット数nを入力
・x,y,rを入力
・x,y,rのいずれかが1以上1000以下の範囲になければ、その入力はカウントしない。(i--)
・r^2==(x^2+y^2)なら、YES
そうでなければ、NOを表示する。
・データセット数(n)回繰り返して終了。
・結果:Wrong answer
なぜか不正解。
3つの入力の内、x,y,rを切り替えられるようにしてみたが、やはり不正解。(x^2==(y^2+r^2)とか、y^2==(x^2+r^2)とか。)
*/
#include <stdio.h>
int main()
{
int x[1000],y[1000],r[1000];
int i,count=0;
int n;
while(1){
scanf("%d",&n);
if(n<=1000){
break;
}
}
for(i=0; i<n; i++){
scanf("%d %d %d",&x[i],&y[i],&r[i]);
if(x[i]<1||x[i]>1000||y[i]<1||y[i]>1000||r[i]<1||r[i]>1000){
i--;
}
}
for(i=0; i<n; i++){
if(r[i]*r[i]==(x[i]*x[i])+(y[i]*y[i])){
printf("YES\n");
}
else if(x[i]*x[i]==(y[i]*y[i])+(r[i]*r[i])){
printf("YES\n");
}
else if(y[i]*y[i]==(x[i]*x[i])+(r[i]*r[i])){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203972/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203972/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.6 = 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:
%x = alloca [1000 x i32], align 16
%y = alloca [1000 x i32], align 16
%r = alloca [1000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 1001
br i1 %cmp, label %for.cond.preheader, label %while.cond
for.cond.preheader: ; preds = %while.cond
%cmp1136 = icmp sgt i32 %0, 0
br i1 %cmp1136, label %for.body, label %for.end97
for.cond31.preheader: ; preds = %for.inc
%1 = icmp sgt i32 %8, 0
br i1 %1, label %for.body33, label %for.end97
for.body: ; preds = %for.cond.preheader, %for.inc
%i.0137 = phi i32 [ %inc, %for.inc ], [ 0, %for.cond.preheader ]
%idxprom = sext i32 %i.0137 to i64
%arrayidx = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %idxprom
%arrayidx3 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %idxprom
%arrayidx5 = getelementptr inbounds [1000 x i32], ptr %r, i64 0, i64 %idxprom
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx5)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%3 = add i32 %2, -1001
%or.cond = icmp ult i32 %3, -1000
br i1 %or.cond, label %if.then29, label %lor.lhs.false13
lor.lhs.false13: ; preds = %for.body
%4 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%5 = add i32 %4, -1001
%or.cond134 = icmp ult i32 %5, -1000
br i1 %or.cond134, label %if.then29, label %lor.lhs.false21
lor.lhs.false21: ; preds = %lor.lhs.false13
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%7 = add i32 %6, -1001
%or.cond135 = icmp ult i32 %7, -1000
br i1 %or.cond135, label %if.then29, label %for.inc
if.then29: ; preds = %lor.lhs.false21, %lor.lhs.false13, %for.body
%dec = add nsw i32 %i.0137, -1
br label %for.inc
for.inc: ; preds = %lor.lhs.false21, %if.then29
%i.1 = phi i32 [ %dec, %if.then29 ], [ %i.0137, %lor.lhs.false21 ]
%inc = add nsw i32 %i.1, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %8
br i1 %cmp1, label %for.body, label %for.cond31.preheader, !llvm.loop !9
for.body33: ; preds = %for.cond31.preheader, %for.inc95
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc95 ], [ 0, %for.cond31.preheader ]
%arrayidx35 = getelementptr inbounds [1000 x i32], ptr %r, i64 0, i64 %indvars.iv
%9 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%mul = mul nsw i32 %9, %9
%arrayidx39 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%mul42 = mul nsw i32 %10, %10
%arrayidx44 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv
%11 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%mul47 = mul nsw i32 %11, %11
%add = add nuw nsw i32 %mul47, %mul42
%cmp48 = icmp eq i32 %mul, %add
br i1 %cmp48, label %for.inc95, label %if.else
if.else: ; preds = %for.body33
%add66 = add nuw nsw i32 %mul47, %mul
%cmp67 = icmp eq i32 %mul42, %add66
br i1 %cmp67, label %for.inc95, label %if.else70
if.else70: ; preds = %if.else
%add86 = add nuw nsw i32 %mul42, %mul
%cmp87 = icmp eq i32 %mul47, %add86
%str.4.str = select i1 %cmp87, ptr @str.6, ptr @str
br label %for.inc95
for.inc95: ; preds = %if.else70, %if.else, %for.body33
%str.6.sink = phi ptr [ @str.6, %for.body33 ], [ @str.6, %if.else ], [ %str.4.str, %if.else70 ]
%puts133 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp32 = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp32, label %for.body33, label %for.end97, !llvm.loop !11
for.end97: ; preds = %for.inc95, %for.cond.preheader, %for.cond31.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int a,b,c;
int i,n;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d %d",&a,&b,&c);
if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a) printf("YES\n");
else printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204021/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204021/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%n = 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 %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
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul2, %mul
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%cmp4 = icmp eq i32 %add, %mul3
%add7 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %add7, %mul2
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add13 = add nuw nsw i32 %mul3, %mul2
%cmp15 = icmp eq i32 %add13, %mul
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
#include<string.h>
#include<math.h>
int maxsubsequence(int n,int a[n]){
int max=0;
float sum=0,c=0;
for(int p=0;p<n;p++){
int q;
//int sum=0,c=0;
for(q=0;q<p;q++){
if(a[p]==a[q])
break;
}
if(p==q){
sum = sum + a[p];
c++;
}
}
for(int i=0;i<n;i++){
if(sum/c < a[i]){
max++;
a[i]=0;
}
}
if(maxsubsequence(n,a)==0)
return max;
maxsubsequence(n,a);
}
int main(){
int t;
scanf("%d",&t);
int ans[t];
for(int i=0;i<t;i++){
int n,min = 200,c=0;
scanf("%d",&n);
int a[n];
for(int j=0;j<n;j++){
scanf("%d",&a[j]);
if(min>a[j])
min = a[j];
}
for(int j=0;j<n;j++){
if(min==a[j]){
c++;
}
}
ans[i] = n-c;
}
for(int i=0;i<t;i++){
printf("%d\n",ans[i]);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @maxsubsequence(i32 noundef %n, ptr noundef %a) local_unnamed_addr #0 {
entry:
%cmp69 = icmp sgt i32 %n, 0
br i1 %cmp69, label %tailrecurse.us.us.preheader, label %entry.split.split
tailrecurse.us.us.preheader: ; preds = %entry
%wide.trip.count124 = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
%n.vec = and i64 %wide.trip.count124, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count124
br label %tailrecurse.us.us
tailrecurse.us.us: ; preds = %for.cond16.for.cond.cleanup19_crit_edge.us.us, %tailrecurse.us.us.preheader
%ret.tr.us.us = phi i32 [ poison, %tailrecurse.us.us.preheader ], [ %38, %for.cond16.for.cond.cleanup19_crit_edge.us.us ]
%ret.known.tr.us.us = phi i1 [ false, %tailrecurse.us.us.preheader ], [ true, %for.cond16.for.cond.cleanup19_crit_edge.us.us ]
br label %for.cond1.preheader.us.us
for.body20.us.us: ; preds = %for.body20.us.us.preheader, %for.inc31.us.us
%indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.inc31.us.us ], [ %indvars.iv126.ph, %for.body20.us.us.preheader ]
%max.076.us.us = phi i32 [ %max.1.us.us, %for.inc31.us.us ], [ %max.076.us.us.ph, %for.body20.us.us.preheader ]
%arrayidx22.us.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv126
%0 = load i32, ptr %arrayidx22.us.us, align 4, !tbaa !5
%conv23.us.us = sitofp i32 %0 to float
%cmp24.us.us = fcmp olt float %div.us.us, %conv23.us.us
br i1 %cmp24.us.us, label %if.then26.us.us, label %for.inc31.us.us
if.then26.us.us: ; preds = %for.body20.us.us
%inc27.us.us = add nsw i32 %max.076.us.us, 1
store i32 0, ptr %arrayidx22.us.us, align 4, !tbaa !5
br label %for.inc31.us.us
for.inc31.us.us: ; preds = %if.then26.us.us, %for.body20.us.us
%max.1.us.us = phi i32 [ %inc27.us.us, %if.then26.us.us ], [ %max.076.us.us, %for.body20.us.us ]
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%exitcond129.not = icmp eq i64 %indvars.iv.next127, %wide.trip.count124
br i1 %exitcond129.not, label %for.cond16.for.cond.cleanup19_crit_edge.us.us, label %for.body20.us.us, !llvm.loop !9
for.body3.us.us: ; preds = %for.body3.lr.ph.us.us, %for.inc.us.us
%indvars.iv = phi i64 [ 0, %for.body3.lr.ph.us.us ], [ %indvars.iv.next, %for.inc.us.us ]
%arrayidx5.us.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%1 = load i32, ptr %arrayidx5.us.us, align 4, !tbaa !5
%cmp6.us.us = icmp eq i32 %4, %1
br i1 %cmp6.us.us, label %for.end.us.us, label %for.inc.us.us
for.inc.us.us: ; preds = %for.body3.us.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv121
br i1 %exitcond.not, label %for.end.us.us, label %for.body3.us.us, !llvm.loop !13
for.end.us.us: ; preds = %for.inc.us.us, %for.body3.us.us, %for.cond1.preheader.us.us
%q.0.lcssa.us.us = phi i64 [ 0, %for.cond1.preheader.us.us ], [ %indvars.iv, %for.body3.us.us ], [ %indvars.iv121, %for.inc.us.us ]
%2 = and i64 %q.0.lcssa.us.us, 4294967295
%cmp7.us.us = icmp eq i64 %indvars.iv121, %2
br i1 %cmp7.us.us, label %if.then8.us.us, label %if.end12.us.us
if.then8.us.us: ; preds = %for.end.us.us
%arrayidx10.us.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv121
%3 = load i32, ptr %arrayidx10.us.us, align 4, !tbaa !5
%conv.us.us = sitofp i32 %3 to float
%add.us.us = fadd float %sum.070.us.us, %conv.us.us
%inc11.us.us = fadd float %c.071.us.us, 1.000000e+00
br label %if.end12.us.us
if.end12.us.us: ; preds = %if.then8.us.us, %for.end.us.us
%sum.1.us.us = phi float [ %add.us.us, %if.then8.us.us ], [ %sum.070.us.us, %for.end.us.us ]
%c.1.us.us = phi float [ %inc11.us.us, %if.then8.us.us ], [ %c.071.us.us, %for.end.us.us ]
%indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
%exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124
br i1 %exitcond125.not, label %for.cond.for.cond16.preheader_crit_edge.us.us, label %for.cond1.preheader.us.us, !llvm.loop !14
for.cond1.preheader.us.us: ; preds = %if.end12.us.us, %tailrecurse.us.us
%indvars.iv121 = phi i64 [ %indvars.iv.next122, %if.end12.us.us ], [ 0, %tailrecurse.us.us ]
%c.071.us.us = phi float [ %c.1.us.us, %if.end12.us.us ], [ 0.000000e+00, %tailrecurse.us.us ]
%sum.070.us.us = phi float [ %sum.1.us.us, %if.end12.us.us ], [ 0.000000e+00, %tailrecurse.us.us ]
%cmp266.us.us.not = icmp eq i64 %indvars.iv121, 0
br i1 %cmp266.us.us.not, label %for.end.us.us, label %for.body3.lr.ph.us.us
for.body3.lr.ph.us.us: ; preds = %for.cond1.preheader.us.us
%arrayidx.us.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv121
%4 = load i32, ptr %arrayidx.us.us, align 4, !tbaa !5
br label %for.body3.us.us
for.cond.for.cond16.preheader_crit_edge.us.us: ; preds = %if.end12.us.us
%div.us.us = fdiv float %sum.1.us.us, %c.1.us.us
br i1 %min.iters.check, label %for.body20.us.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond.for.cond16.preheader_crit_edge.us.us
%broadcast.splatinsert = insertelement <4 x float> poison, float %div.us.us, i64 0
%broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %pred.store.continue147, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue147 ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi, %pred.store.continue147 ]
%vec.phi132 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi148, %pred.store.continue147 ]
%5 = or i64 %index, 4
%6 = getelementptr inbounds i32, ptr %a, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load133 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = sitofp <4 x i32> %wide.load to <4 x float>
%9 = sitofp <4 x i32> %wide.load133 to <4 x float>
%10 = fcmp olt <4 x float> %broadcast.splat, %8
%11 = fcmp olt <4 x float> %broadcast.splat, %9
%12 = extractelement <4 x i1> %10, i64 0
br i1 %12, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%13 = getelementptr inbounds i32, ptr %a, i64 %index
store i32 0, ptr %13, align 4, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%14 = extractelement <4 x i1> %10, i64 1
br i1 %14, label %pred.store.if134, label %pred.store.continue135
pred.store.if134: ; preds = %pred.store.continue
%15 = or i64 %index, 1
%16 = getelementptr inbounds i32, ptr %a, i64 %15
store i32 0, ptr %16, align 4, !tbaa !5
br label %pred.store.continue135
pred.store.continue135: ; preds = %pred.store.if134, %pred.store.continue
%17 = extractelement <4 x i1> %10, i64 2
br i1 %17, label %pred.store.if136, label %pred.store.continue137
pred.store.if136: ; preds = %pred.store.continue135
%18 = or i64 %index, 2
%19 = getelementptr inbounds i32, ptr %a, i64 %18
store i32 0, ptr %19, align 4, !tbaa !5
br label %pred.store.continue137
pred.store.continue137: ; preds = %pred.store.if136, %pred.store.continue135
%20 = extractelement <4 x i1> %10, i64 3
br i1 %20, label %pred.store.if138, label %pred.store.continue139
pred.store.if138: ; preds = %pred.store.continue137
%21 = or i64 %index, 3
%22 = getelementptr inbounds i32, ptr %a, i64 %21
store i32 0, ptr %22, align 4, !tbaa !5
br label %pred.store.continue139
pred.store.continue139: ; preds = %pred.store.if138, %pred.store.continue137
%23 = extractelement <4 x i1> %11, i64 0
br i1 %23, label %pred.store.if140, label %pred.store.continue141
pred.store.if140: ; preds = %pred.store.continue139
%24 = getelementptr inbounds i32, ptr %a, i64 %5
store i32 0, ptr %24, align 4, !tbaa !5
br label %pred.store.continue141
pred.store.continue141: ; preds = %pred.store.if140, %pred.store.continue139
%25 = extractelement <4 x i1> %11, i64 1
br i1 %25, label %pred.store.if142, label %pred.store.continue143
pred.store.if142: ; preds = %pred.store.continue141
%26 = or i64 %index, 5
%27 = getelementptr inbounds i32, ptr %a, i64 %26
store i32 0, ptr %27, align 4, !tbaa !5
br label %pred.store.continue143
pred.store.continue143: ; preds = %pred.store.if142, %pred.store.continue141
%28 = extractelement <4 x i1> %11, i64 2
br i1 %28, label %pred.store.if144, label %pred.store.continue145
pred.store.if144: ; preds = %pred.store.continue143
%29 = or i64 %index, 6
%30 = getelementptr inbounds i32, ptr %a, i64 %29
store i32 0, ptr %30, align 4, !tbaa !5
br label %pred.store.continue145
pred.store.continue145: ; preds = %pred.store.if144, %pred.store.continue143
%31 = extractelement <4 x i1> %11, i64 3
br i1 %31, label %pred.store.if146, label %pred.store.continue147
pred.store.if146: ; preds = %pred.store.continue145
%32 = or i64 %index, 7
%33 = getelementptr inbounds i32, ptr %a, i64 %32
store i32 0, ptr %33, align 4, !tbaa !5
br label %pred.store.continue147
pred.store.continue147: ; preds = %pred.store.if146, %pred.store.continue145
%34 = zext <4 x i1> %10 to <4 x i32>
%predphi = add <4 x i32> %vec.phi, %34
%35 = zext <4 x i1> %11 to <4 x i32>
%predphi148 = add <4 x i32> %vec.phi132, %35
%index.next = add nuw i64 %index, 8
%36 = icmp eq i64 %index.next, %n.vec
br i1 %36, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %pred.store.continue147
%bin.rdx = add <4 x i32> %predphi148, %predphi
%37 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond16.for.cond.cleanup19_crit_edge.us.us, label %for.body20.us.us.preheader
for.body20.us.us.preheader: ; preds = %for.cond.for.cond16.preheader_crit_edge.us.us, %middle.block
%indvars.iv126.ph = phi i64 [ 0, %for.cond.for.cond16.preheader_crit_edge.us.us ], [ %n.vec, %middle.block ]
%max.076.us.us.ph = phi i32 [ 0, %for.cond.for.cond16.preheader_crit_edge.us.us ], [ %37, %middle.block ]
br label %for.body20.us.us
for.cond16.for.cond.cleanup19_crit_edge.us.us: ; preds = %for.inc31.us.us, %middle.block
%max.1.us.us.lcssa = phi i32 [ %37, %middle.block ], [ %max.1.us.us, %for.inc31.us.us ]
%call.us.us = tail call i32 @maxsubsequence(i32 noundef %n, ptr noundef nonnull %a)
%cmp34.us.us = icmp eq i32 %call.us.us, 0
%38 = select i1 %ret.known.tr.us.us, i32 %ret.tr.us.us, i32 %max.1.us.us.lcssa
br i1 %cmp34.us.us, label %cleanup, label %tailrecurse.us.us
entry.split.split: ; preds = %entry
%call110 = tail call i32 @maxsubsequence(i32 noundef %n, ptr noundef %a)
%cmp34111 = icmp eq i32 %call110, 0
br i1 %cmp34111, label %cleanup, label %if.end37
if.end37: ; preds = %entry.split.split, %if.end37
%call = tail call i32 @maxsubsequence(i32 noundef %n, ptr noundef %a)
%cmp34 = icmp eq i32 %call, 0
br i1 %cmp34, label %cleanup, label %if.end37
cleanup: ; preds = %if.end37, %for.cond16.for.cond.cleanup19_crit_edge.us.us, %entry.split.split
%.us-phi79 = phi i32 [ 0, %entry.split.split ], [ %38, %for.cond16.for.cond.cleanup19_crit_edge.us.us ], [ 0, %if.end37 ]
ret i32 %.us-phi79
}
; 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:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %t, align 4, !tbaa !5
%cmp66 = icmp sgt i32 %3, 0
br i1 %cmp66, label %for.body, label %for.cond.cleanup36
for.cond34.preheader: ; preds = %for.cond.cleanup17
%4 = icmp sgt i32 %22, 0
br i1 %4, label %for.body37, label %for.cond.cleanup36
for.body: ; preds = %entry, %for.cond.cleanup17
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.cond.cleanup17 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%7 = call ptr @llvm.stacksave.p0()
%vla3 = alloca i32, i64 %6, align 16
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp558 = icmp sgt i32 %8, 0
br i1 %cmp558, label %for.body7, label %for.cond.cleanup17
for.cond15.preheader: ; preds = %for.body7
%cmp1662 = icmp sgt i32 %20, 0
br i1 %cmp1662, label %for.body18.preheader, label %for.cond.cleanup17
for.body18.preheader: ; preds = %for.cond15.preheader
%wide.trip.count = zext i32 %20 to i64
%min.iters.check = icmp ult i32 %20, 8
br i1 %min.iters.check, label %for.body18.preheader90, label %vector.ph
vector.ph: ; preds = %for.body18.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %spec.select, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi88 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%9 = getelementptr inbounds i32, ptr %vla3, i64 %index
%wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load89 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = icmp eq <4 x i32> %broadcast.splat, %wide.load
%12 = icmp eq <4 x i32> %broadcast.splat, %wide.load89
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = add <4 x i32> %vec.phi, %13
%16 = add <4 x i32> %vec.phi88, %14
%index.next = add nuw i64 %index, 8
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !16
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %16, %15
%18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup17, label %for.body18.preheader90
for.body18.preheader90: ; preds = %for.body18.preheader, %middle.block
%indvars.iv72.ph = phi i64 [ 0, %for.body18.preheader ], [ %n.vec, %middle.block ]
%c.063.ph = phi i32 [ 0, %for.body18.preheader ], [ %18, %middle.block ]
br label %for.body18
for.body7: ; preds = %for.body, %for.body7
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 0, %for.body ]
%min.059 = phi i32 [ %spec.select, %for.body7 ], [ 200, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%19 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.059, i32 %19)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp5 = icmp slt i64 %indvars.iv.next, %21
br i1 %cmp5, label %for.body7, label %for.cond15.preheader, !llvm.loop !17
for.cond.cleanup17: ; preds = %for.body18, %middle.block, %for.body, %for.cond15.preheader
%.lcssa85 = phi i32 [ %20, %for.cond15.preheader ], [ %8, %for.body ], [ %20, %middle.block ], [ %20, %for.body18 ]
%c.0.lcssa = phi i32 [ 0, %for.cond15.preheader ], [ 0, %for.body ], [ %18, %middle.block ], [ %spec.select57, %for.body18 ]
%sub = sub nsw i32 %.lcssa85, %c.0.lcssa
%arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv75
store i32 %sub, ptr %arrayidx29, align 4, !tbaa !5
call void @llvm.stackrestore.p0(ptr %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%22 = load i32, ptr %t, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp = icmp slt i64 %indvars.iv.next76, %23
br i1 %cmp, label %for.body, label %for.cond34.preheader, !llvm.loop !18
for.body18: ; preds = %for.body18.preheader90, %for.body18
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body18 ], [ %indvars.iv72.ph, %for.body18.preheader90 ]
%c.063 = phi i32 [ %spec.select57, %for.body18 ], [ %c.063.ph, %for.body18.preheader90 ]
%arrayidx20 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv72
%24 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%cmp21 = icmp eq i32 %spec.select, %24
%inc23 = zext i1 %cmp21 to i32
%spec.select57 = add nuw nsw i32 %c.063, %inc23
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%exitcond.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup17, label %for.body18, !llvm.loop !19
for.cond.cleanup36: ; preds = %for.body37, %entry, %for.cond34.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
for.body37: ; preds = %for.cond34.preheader, %for.body37
%indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.body37 ], [ 0, %for.cond34.preheader ]
%arrayidx39 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv78
%25 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %25)
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%26 = load i32, ptr %t, align 4, !tbaa !5
%27 = sext i32 %26 to i64
%cmp35 = icmp slt i64 %indvars.iv.next79, %27
br i1 %cmp35, label %for.body37, label %for.cond.cleanup36, !llvm.loop !20
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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.unroll.runtime.disable"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10, !12, !11}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !11, !12}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
#include <stdlib.h>
int is_right_triangle(int a, int b, int c) {
return a * a == b * b + c * c;
}
int main(void) {
int i, n, a, b, c;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d %d %d", &a, &b, &c);
if (is_right_triangle(a, b, c) ||
is_right_triangle(b, a, c) ||
is_right_triangle(c, a, b)) {
puts("YES");
} else {
puts("NO");
}
}
return EXIT_SUCCESS;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204122/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204122/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @is_right_triangle(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%mul = mul nsw i32 %a, %a
%mul1 = mul nsw i32 %b, %b
%mul2 = mul nsw i32 %c, %c
%add = add nuw nsw i32 %mul2, %mul1
%cmp = icmp eq i32 %mul, %add
%conv = zext i1 %cmp 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
%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 %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.025 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul.i = mul nsw i32 %1, %1
%mul1.i = mul nsw i32 %2, %2
%mul2.i = mul nsw i32 %3, %3
%add.i = add nuw nsw i32 %mul2.i, %mul1.i
%cmp.i.not = icmp eq i32 %mul.i, %add.i
%add.i14 = add nuw nsw i32 %mul2.i, %mul.i
%cmp.i15.not = icmp eq i32 %mul1.i, %add.i14
%or.cond = select i1 %cmp.i.not, i1 true, i1 %cmp.i15.not
%add.i20 = add nuw nsw i32 %mul1.i, %mul.i
%cmp.i21.not = icmp eq i32 %mul2.i, %add.i20
%or.cond23 = select i1 %or.cond, i1 true, i1 %cmp.i21.not
%.str.2..str.3 = select i1 %or.cond23, ptr @.str.2, ptr @.str.3
%call8 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
%inc = add nuw nsw i32 %i.025, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
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
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) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 isright(int, int, int);
int main(void){
int i, N, a, b, c;
scanf("%d\n", &N);
for(i = 0; i < N; i++){
scanf("%d %d %d", &a, &b, &c);
if((a*a == b*b + c*c) || (b*b == c*c + a*a) || (c*c == a*a + b*b)){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204173/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204173/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.022 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add14 = add nuw nsw i32 %mul2, %mul
%cmp15 = icmp eq i32 %mul3, %add14
%or.cond20 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond20, ptr @str.4, ptr @str
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.022, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
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
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(){
int Data;
int n;
int Factor[1000][3];
scanf("%d\n",&Data);
for(n=0;n<Data;n++){
scanf(" %d %d %d",&Factor[n][0],&Factor[n][1],&Factor[n][2]);
}
int l,m;
for(l=0;l<Data;l++){
int a,b,c;
a=b=c=0;
a=Factor[l][0]*Factor[l][0];
b=Factor[l][1]*Factor[l][1];
c=Factor[l][2]*Factor[l][2];
if(a==b+c||b==a+c||c==b+a){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204223/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204223/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c" %d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%Data = alloca i32, align 4
%Factor = alloca [1000 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Data) #4
call void @llvm.lifetime.start.p0(i64 12000, ptr nonnull %Factor) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Data)
%0 = load i32, ptr %Data, align 4, !tbaa !5
%cmp62 = icmp sgt i32 %0, 0
br i1 %cmp62, label %for.body, label %for.end42
for.cond9.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body11, label %for.end42
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x [3 x i32]], ptr %Factor, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [1000 x [3 x i32]], ptr %Factor, i64 0, i64 %indvars.iv, i64 1
%arrayidx7 = getelementptr inbounds [1000 x [3 x i32]], ptr %Factor, i64 0, i64 %indvars.iv, i64 2
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %Data, 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.cond9.preheader, !llvm.loop !9
for.body11: ; preds = %for.cond9.preheader, %for.body11
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body11 ], [ 0, %for.cond9.preheader ]
%arrayidx13 = getelementptr inbounds [1000 x [3 x i32]], ptr %Factor, i64 0, i64 %indvars.iv67
%4 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%mul = mul nsw i32 %4, %4
%arrayidx20 = getelementptr inbounds [1000 x [3 x i32]], ptr %Factor, i64 0, i64 %indvars.iv67, i64 1
%5 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%mul24 = mul nsw i32 %5, %5
%arrayidx27 = getelementptr inbounds [1000 x [3 x i32]], ptr %Factor, i64 0, i64 %indvars.iv67, i64 2
%6 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%mul31 = mul nsw i32 %6, %6
%add = add nuw nsw i32 %mul31, %mul24
%cmp32 = icmp eq i32 %mul, %add
%add33 = add nuw nsw i32 %mul31, %mul
%cmp34 = icmp eq i32 %mul24, %add33
%or.cond = select i1 %cmp32, i1 true, i1 %cmp34
%add36 = add nuw nsw i32 %mul24, %mul
%cmp37 = icmp eq i32 %mul31, %add36
%or.cond61 = select i1 %or.cond, i1 true, i1 %cmp37
%str.4.str = select i1 %or.cond61, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%7 = load i32, ptr %Data, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp10 = icmp slt i64 %indvars.iv.next68, %8
br i1 %cmp10, label %for.body11, label %for.end42, !llvm.loop !11
for.end42: ; preds = %for.body11, %entry, %for.cond9.preheader
call void @llvm.lifetime.end.p0(i64 12000, ptr nonnull %Factor) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Data) #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"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int compare_int(const void *a, const void *b){
return *(int *)b - *(int *)a;
}
int main(int argc, char const *argv[]) {
int N;
scanf("%d", &N);
int M = 3 * N;
int a[M];
for (int i = 0; i < M; i++) {
scanf("%d", a + i);
}
qsort(a, M, sizeof(int), compare_int);
// for (int i = 0; i < M; i++) {
// printf("a[%d] = %d\n", i, a[i]);
// }
long long int sum = 0;
for (int i = 0; i < N; i++) {
//printf("a[%d] = %d\n", 1 + 2 * i, a[1 + 2 * i]);
sum += a[1 + 2 * i];
}
printf("%lld\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204267/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204267/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%mul = mul i32 %0, 3
%1 = zext i32 %mul to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%smax = call i32 @llvm.smax.i32(i32 %mul, i32 1)
%wide.trip.count = zext i32 %smax to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%conv = sext i32 %mul to i64
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @compare_int) #7
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp424 = icmp sgt i32 %3, 0
br i1 %cmp424, label %for.body7.preheader, label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond.cleanup
%wide.trip.count33 = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 5
br i1 %min.iters.check, label %for.body7.preheader38, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.mod.vf = and i64 %wide.trip.count33, 3
%4 = icmp eq i64 %n.mod.vf, 0
%5 = select i1 %4, i64 4, i64 %n.mod.vf
%n.vec = sub nsw i64 %wide.trip.count33, %5
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%vec.phi35 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%6 = shl nuw nsw i64 %index, 1
%7 = shl i64 %index, 1
%8 = or i64 %6, 1
%9 = or i64 %7, 5
%10 = getelementptr inbounds i32, ptr %vla, i64 %8
%11 = getelementptr inbounds i32, ptr %vla, i64 %9
%wide.vec = load <4 x i32>, ptr %10, align 4, !tbaa !5
%wide.vec36 = load <4 x i32>, ptr %11, align 4, !tbaa !5
%strided.vec = shufflevector <4 x i32> %wide.vec, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%strided.vec37 = shufflevector <4 x i32> %wide.vec36, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%12 = sext <2 x i32> %strided.vec to <2 x i64>
%13 = sext <2 x i32> %strided.vec37 to <2 x i64>
%14 = add <2 x i64> %vec.phi, %12
%15 = add <2 x i64> %vec.phi35, %13
%index.next = add nuw i64 %index, 4
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %15, %14
%17 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
br label %for.body7.preheader38
for.body7.preheader38: ; preds = %for.body7.preheader, %middle.block
%indvars.iv28.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ]
%sum.025.ph = phi i64 [ 0, %for.body7.preheader ], [ %17, %middle.block ]
br label %for.body7
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%add.ptr = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
for.cond.cleanup6: ; preds = %for.body7, %for.cond.cleanup
%sum.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ %add10, %for.body7 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
for.body7: ; preds = %for.body7.preheader38, %for.body7
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %for.body7 ], [ %indvars.iv28.ph, %for.body7.preheader38 ]
%sum.025 = phi i64 [ %add10, %for.body7 ], [ %sum.025.ph, %for.body7.preheader38 ]
%18 = shl nuw nsw i64 %indvars.iv28, 1
%19 = or i64 %18, 1
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %19
%20 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv9 = sext i32 %20 to i64
%add10 = add nsw i64 %sum.025, %conv9
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%exitcond34.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count33
br i1 %exitcond34.not, label %for.cond.cleanup6, label %for.body7, !llvm.loop !14
}
; 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
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !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 check(int arr[],int n)
{
float avg=0;
int count=0,i;
for(i=0;i<n;i++)
{
avg+=arr[i];
if(arr[i]!=0) count++;
}
avg/=(float)count;
count=0;
for(i=0;i<n;i++)
{
if(avg<(float)arr[i])
{
count++;
}
}
if(count==0) return 0;
else return 1;
}
int main(void)
{
long t;
scanf("%lu",&t);
while(t--)
{
long n;
scanf("%lu\n",&n);
int arr[n],i;
for(i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
while(check(arr,n))
{
float avg=0;
int count=0;
for(i=0;i<n;i++)
{
avg+=arr[i];
if(arr[i]!=0) count++;
}
avg/=count;
for(i=0;i<n;i++)
{
if((float)arr[i]>avg)
arr[i]=0;
}
}
int count=0;
for(i=0;i<n;i++)
{
if(arr[i]==0)
{
count++;
}
}
printf("%d\n",count);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20431/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20431/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lu\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1
@.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\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @check(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp41 = icmp sgt i32 %n, 0
br i1 %cmp41, label %for.body.preheader, label %for.end21
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %n, 1
br i1 %0, label %for.end.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%count.043 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%avg.042 = phi float [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %1 to float
%add = fadd float %avg.042, %conv
%cmp3.not = icmp ne i32 %1, 0
%inc = zext i1 %cmp3.not to i32
%spec.select = add nuw nsw i32 %count.043, %inc
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.next
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%conv.1 = sitofp i32 %2 to float
%add.1 = fadd float %add, %conv.1
%cmp3.not.1 = icmp ne i32 %2, 0
%inc.1 = zext i1 %cmp3.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.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.end.unr-lcssa, label %for.body, !llvm.loop !9
for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi float [ undef, %for.body.preheader ], [ %add.1, %for.body ]
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%count.043.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ]
%avg.042.unr = phi float [ 0.000000e+00, %for.body.preheader ], [ %add.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.unr-lcssa
%arrayidx.epil = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.unr
%3 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%conv.epil = sitofp i32 %3 to float
%add.epil = fadd float %avg.042.unr, %conv.epil
%cmp3.not.epil = icmp ne i32 %3, 0
%inc.epil = zext i1 %cmp3.not.epil to i32
%spec.select.epil = add nuw nsw i32 %count.043.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.end.unr-lcssa, %for.body.epil
%add.lcssa = phi float [ %add.lcssa.ph, %for.end.unr-lcssa ], [ %add.epil, %for.body.epil ]
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%4 = sitofp i32 %spec.select.lcssa to float
%5 = fdiv float %add.lcssa, %4
br i1 %cmp41, label %for.body10.preheader, label %for.end21
for.body10.preheader: ; preds = %for.end
%wide.trip.count54 = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body10.preheader59, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x float> poison, float %5, i64 0
%broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%vec.phi57 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%6 = getelementptr inbounds i32, ptr %arr, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load58 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = sitofp <4 x i32> %wide.load to <4 x float>
%9 = sitofp <4 x i32> %wide.load58 to <4 x float>
%10 = fcmp olt <4 x float> %broadcast.splat, %8
%11 = fcmp olt <4 x float> %broadcast.splat, %9
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = add <4 x i32> %vec.phi, %12
%15 = add <4 x i32> %vec.phi57, %13
%index.next = add nuw i64 %index, 8
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %15, %14
%17 = tail 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.end21.loopexit, label %for.body10.preheader59
for.body10.preheader59: ; preds = %for.body10.preheader, %middle.block
%indvars.iv51.ph = phi i64 [ 0, %for.body10.preheader ], [ %n.vec, %middle.block ]
%count.247.ph = phi i32 [ 0, %for.body10.preheader ], [ %17, %middle.block ]
br label %for.body10
for.body10: ; preds = %for.body10.preheader59, %for.body10
%indvars.iv51 = phi i64 [ %indvars.iv.next52, %for.body10 ], [ %indvars.iv51.ph, %for.body10.preheader59 ]
%count.247 = phi i32 [ %count.3, %for.body10 ], [ %count.247.ph, %for.body10.preheader59 ]
%arrayidx12 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv51
%18 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%conv13 = sitofp i32 %18 to float
%cmp14 = fcmp olt float %5, %conv13
%inc17 = zext i1 %cmp14 to i32
%count.3 = add nuw nsw i32 %count.247, %inc17
%indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
%exitcond55.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count54
br i1 %exitcond55.not, label %for.end21.loopexit, label %for.body10, !llvm.loop !14
for.end21.loopexit: ; preds = %for.body10, %middle.block
%count.3.lcssa = phi i32 [ %17, %middle.block ], [ %count.3, %for.body10 ]
%19 = icmp ne i32 %count.3.lcssa, 0
%20 = zext i1 %19 to i32
br label %for.end21
for.end21: ; preds = %entry, %for.end21.loopexit, %for.end
%count.2.lcssa = phi i32 [ 0, %for.end ], [ %20, %for.end21.loopexit ], [ 0, %entry ]
ret i32 %count.2.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !15
%dec97 = add nsw i64 %0, -1
store i64 %dec97, ptr %t, align 8, !tbaa !15
%tobool.not98 = icmp eq i64 %0, 0
br i1 %tobool.not98, label %while.end60, label %while.body
while.body: ; preds = %entry, %for.end58
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !15
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i64, ptr %n, align 8, !tbaa !15
%cmp79 = icmp sgt i64 %3, 0
br i1 %cmp79, label %for.body, label %while.cond4.preheader
while.cond4.preheader: ; preds = %for.body, %while.body
%.lcssa = phi i64 [ %3, %while.body ], [ %5, %for.body ]
%conv5 = trunc i64 %.lcssa to i32
%cmp41.i = icmp sgt i32 %conv5, 0
%wide.trip.count.i = and i64 %.lcssa, 4294967295
%cmp1182 = icmp sgt i64 %.lcssa, 0
br i1 %cmp41.i, label %for.body.i.preheader, label %for.cond44.preheader
for.body.i.preheader: ; preds = %while.cond4.preheader
%min.iters.check151 = icmp ult i64 %wide.trip.count.i, 8
%n.mod.vf153 = and i64 %.lcssa, 7
%n.vec154 = sub nsw i64 %wide.trip.count.i, %n.mod.vf153
%cmp.n156 = icmp eq i64 %n.mod.vf153, 0
%xtraiter = and i64 %.lcssa, 1
%4 = icmp eq i64 %.lcssa, 1
%unroll_iter = and i64 %.lcssa, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%min.iters.check124 = icmp ult i64 %.lcssa, 8
%n.vec127 = and i64 %.lcssa, -8
%cmp.n129 = icmp eq i64 %.lcssa, %n.vec127
br label %for.body.i
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i64, ptr %n, align 8, !tbaa !15
%cmp = icmp sgt i64 %5, %indvars.iv.next
br i1 %cmp, label %for.body, label %while.cond4.preheader, !llvm.loop !17
while.cond4.loopexit: ; preds = %for.inc40, %middle.block122, %for.cond9.preheader, %for.end24
br i1 %cmp41.i, label %for.body.i.backedge, label %for.cond44.preheader
for.body.i: ; preds = %for.body.i.backedge, %for.body.i.preheader
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.i.be, %for.body.i.backedge ]
%count.043.i = phi i32 [ 0, %for.body.i.preheader ], [ %count.043.i.be, %for.body.i.backedge ]
%avg.042.i = phi float [ 0.000000e+00, %for.body.i.preheader ], [ %avg.042.i.be, %for.body.i.backedge ]
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%conv.i = sitofp i32 %6 to float
%add.i = fadd float %avg.042.i, %conv.i
%cmp3.not.i = icmp ne i32 %6, 0
%inc.i = zext i1 %cmp3.not.i to i32
%spec.select.i = add nuw nsw i32 %count.043.i, %inc.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.body10.preheader.i, label %for.body.i.backedge
for.body.i.backedge: ; preds = %for.body.i, %while.cond4.loopexit
%indvars.iv.i.be = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %while.cond4.loopexit ]
%count.043.i.be = phi i32 [ %spec.select.i, %for.body.i ], [ 0, %while.cond4.loopexit ]
%avg.042.i.be = phi float [ %add.i, %for.body.i ], [ 0.000000e+00, %while.cond4.loopexit ]
br label %for.body.i, !llvm.loop !18
for.body10.preheader.i: ; preds = %for.body.i
%7 = sitofp i32 %spec.select.i to float
%8 = fdiv float %add.i, %7
br i1 %min.iters.check151, label %for.body10.i.preheader, label %vector.ph152
vector.ph152: ; preds = %for.body10.preheader.i
%broadcast.splatinsert163 = insertelement <4 x float> poison, float %8, i64 0
%broadcast.splat164 = shufflevector <4 x float> %broadcast.splatinsert163, <4 x float> poison, <4 x i32> zeroinitializer
br label %vector.body157
vector.body157: ; preds = %vector.body157, %vector.ph152
%index158 = phi i64 [ 0, %vector.ph152 ], [ %index.next165, %vector.body157 ]
%vec.phi159 = phi <4 x i32> [ zeroinitializer, %vector.ph152 ], [ %17, %vector.body157 ]
%vec.phi160 = phi <4 x i32> [ zeroinitializer, %vector.ph152 ], [ %18, %vector.body157 ]
%9 = getelementptr inbounds i32, ptr %vla, i64 %index158
%wide.load161 = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load162 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = sitofp <4 x i32> %wide.load161 to <4 x float>
%12 = sitofp <4 x i32> %wide.load162 to <4 x float>
%13 = fcmp olt <4 x float> %broadcast.splat164, %11
%14 = fcmp olt <4 x float> %broadcast.splat164, %12
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = zext <4 x i1> %14 to <4 x i32>
%17 = add <4 x i32> %vec.phi159, %15
%18 = add <4 x i32> %vec.phi160, %16
%index.next165 = add nuw i64 %index158, 8
%19 = icmp eq i64 %index.next165, %n.vec154
br i1 %19, label %middle.block149, label %vector.body157, !llvm.loop !19
middle.block149: ; preds = %vector.body157
%bin.rdx166 = add <4 x i32> %18, %17
%20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx166)
br i1 %cmp.n156, label %check.exit, label %for.body10.i.preheader
for.body10.i.preheader: ; preds = %for.body10.preheader.i, %middle.block149
%indvars.iv51.i.ph = phi i64 [ 0, %for.body10.preheader.i ], [ %n.vec154, %middle.block149 ]
%count.247.i.ph = phi i32 [ 0, %for.body10.preheader.i ], [ %20, %middle.block149 ]
br label %for.body10.i
for.body10.i: ; preds = %for.body10.i.preheader, %for.body10.i
%indvars.iv51.i = phi i64 [ %indvars.iv.next52.i, %for.body10.i ], [ %indvars.iv51.i.ph, %for.body10.i.preheader ]
%count.247.i = phi i32 [ %count.3.i, %for.body10.i ], [ %count.247.i.ph, %for.body10.i.preheader ]
%arrayidx12.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv51.i
%21 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5
%conv13.i = sitofp i32 %21 to float
%cmp14.i = fcmp olt float %8, %conv13.i
%inc17.i = zext i1 %cmp14.i to i32
%count.3.i = add nuw nsw i32 %count.247.i, %inc17.i
%indvars.iv.next52.i = add nuw nsw i64 %indvars.iv51.i, 1
%exitcond55.not.i = icmp eq i64 %indvars.iv.next52.i, %wide.trip.count.i
br i1 %exitcond55.not.i, label %check.exit, label %for.body10.i, !llvm.loop !20
check.exit: ; preds = %for.body10.i, %middle.block149
%count.3.i.lcssa = phi i32 [ %20, %middle.block149 ], [ %count.3.i, %for.body10.i ]
%.not = icmp eq i32 %count.3.i.lcssa, 0
br i1 %.not, label %for.cond44.preheader, label %for.cond9.preheader
for.cond44.preheader: ; preds = %check.exit, %while.cond4.loopexit, %while.cond4.preheader
br i1 %cmp1182, label %for.body48.preheader, label %for.end58
for.body48.preheader: ; preds = %for.cond44.preheader
%min.iters.check = icmp ult i64 %.lcssa, 8
br i1 %min.iters.check, label %for.body48.preheader169, label %vector.ph
vector.ph: ; preds = %for.body48.preheader
%n.vec = and i64 %.lcssa, -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 ], [ %28, %vector.body ]
%vec.phi120 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %29, %vector.body ]
%22 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %22, align 16, !tbaa !5
%23 = getelementptr inbounds i32, ptr %22, i64 4
%wide.load121 = load <4 x i32>, ptr %23, align 16, !tbaa !5
%24 = icmp eq <4 x i32> %wide.load, zeroinitializer
%25 = icmp eq <4 x i32> %wide.load121, zeroinitializer
%26 = zext <4 x i1> %24 to <4 x i32>
%27 = zext <4 x i1> %25 to <4 x i32>
%28 = add <4 x i32> %vec.phi, %26
%29 = add <4 x i32> %vec.phi120, %27
%index.next = add nuw i64 %index, 8
%30 = icmp eq i64 %index.next, %n.vec
br i1 %30, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %29, %28
%31 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %.lcssa, %n.vec
br i1 %cmp.n, label %for.end58, label %for.body48.preheader169
for.body48.preheader169: ; preds = %for.body48.preheader, %middle.block
%indvars.iv108.ph = phi i64 [ 0, %for.body48.preheader ], [ %n.vec, %middle.block ]
%count43.094.ph = phi i32 [ 0, %for.body48.preheader ], [ %31, %middle.block ]
br label %for.body48
for.cond9.preheader: ; preds = %check.exit
br i1 %cmp1182, label %for.body13.preheader, label %while.cond4.loopexit
for.body13.preheader: ; preds = %for.cond9.preheader
br i1 %4, label %for.end24.unr-lcssa, label %for.body13
for.body13: ; preds = %for.body13.preheader, %for.body13
%indvars.iv101 = phi i64 [ %indvars.iv.next102.1, %for.body13 ], [ 0, %for.body13.preheader ]
%count.085 = phi i32 [ %spec.select.1, %for.body13 ], [ 0, %for.body13.preheader ]
%avg.084 = phi float [ %add.1, %for.body13 ], [ 0.000000e+00, %for.body13.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body13 ], [ 0, %for.body13.preheader ]
%arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv101
%32 = load i32, ptr %arrayidx15, align 8, !tbaa !5
%conv16 = sitofp i32 %32 to float
%add = fadd float %avg.084, %conv16
%cmp19.not = icmp ne i32 %32, 0
%inc21 = zext i1 %cmp19.not to i32
%spec.select = add nuw nsw i32 %count.085, %inc21
%indvars.iv.next102 = or i64 %indvars.iv101, 1
%arrayidx15.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next102
%33 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%conv16.1 = sitofp i32 %33 to float
%add.1 = fadd float %add, %conv16.1
%cmp19.not.1 = icmp ne i32 %33, 0
%inc21.1 = zext i1 %cmp19.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc21.1
%indvars.iv.next102.1 = add nuw nsw i64 %indvars.iv101, 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.end24.unr-lcssa, label %for.body13, !llvm.loop !22
for.end24.unr-lcssa: ; preds = %for.body13, %for.body13.preheader
%add.lcssa.ph = phi float [ undef, %for.body13.preheader ], [ %add.1, %for.body13 ]
%spec.select.lcssa.ph = phi i32 [ undef, %for.body13.preheader ], [ %spec.select.1, %for.body13 ]
%indvars.iv101.unr = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next102.1, %for.body13 ]
%count.085.unr = phi i32 [ 0, %for.body13.preheader ], [ %spec.select.1, %for.body13 ]
%avg.084.unr = phi float [ 0.000000e+00, %for.body13.preheader ], [ %add.1, %for.body13 ]
br i1 %lcmp.mod.not, label %for.end24, label %for.body13.epil
for.body13.epil: ; preds = %for.end24.unr-lcssa
%arrayidx15.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv101.unr
%34 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5
%conv16.epil = sitofp i32 %34 to float
%add.epil = fadd float %avg.084.unr, %conv16.epil
%cmp19.not.epil = icmp ne i32 %34, 0
%inc21.epil = zext i1 %cmp19.not.epil to i32
%spec.select.epil = add nuw nsw i32 %count.085.unr, %inc21.epil
br label %for.end24
for.end24: ; preds = %for.end24.unr-lcssa, %for.body13.epil
%add.lcssa = phi float [ %add.lcssa.ph, %for.end24.unr-lcssa ], [ %add.epil, %for.body13.epil ]
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end24.unr-lcssa ], [ %spec.select.epil, %for.body13.epil ]
%conv25 = sitofp i32 %spec.select.lcssa to float
%div = fdiv float %add.lcssa, %conv25
br i1 %cmp1182, label %for.body30.preheader, label %while.cond4.loopexit
for.body30.preheader: ; preds = %for.end24
br i1 %min.iters.check124, label %for.body30.preheader168, label %vector.ph125
vector.ph125: ; preds = %for.body30.preheader
%broadcast.splatinsert = insertelement <4 x float> poison, float %div, i64 0
%broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
br label %vector.body130
vector.body130: ; preds = %pred.store.continue147, %vector.ph125
%index131 = phi i64 [ 0, %vector.ph125 ], [ %index.next148, %pred.store.continue147 ]
%35 = or i64 %index131, 4
%36 = getelementptr inbounds i32, ptr %vla, i64 %index131
%wide.load132 = load <4 x i32>, ptr %36, align 16, !tbaa !5
%37 = getelementptr inbounds i32, ptr %36, i64 4
%wide.load133 = load <4 x i32>, ptr %37, align 16, !tbaa !5
%38 = sitofp <4 x i32> %wide.load132 to <4 x float>
%39 = sitofp <4 x i32> %wide.load133 to <4 x float>
%40 = fcmp olt <4 x float> %broadcast.splat, %38
%41 = fcmp olt <4 x float> %broadcast.splat, %39
%42 = extractelement <4 x i1> %40, i64 0
br i1 %42, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body130
%43 = getelementptr inbounds i32, ptr %vla, i64 %index131
store i32 0, ptr %43, align 16, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body130
%44 = extractelement <4 x i1> %40, i64 1
br i1 %44, label %pred.store.if134, label %pred.store.continue135
pred.store.if134: ; preds = %pred.store.continue
%45 = or i64 %index131, 1
%46 = getelementptr inbounds i32, ptr %vla, i64 %45
store i32 0, ptr %46, align 4, !tbaa !5
br label %pred.store.continue135
pred.store.continue135: ; preds = %pred.store.if134, %pred.store.continue
%47 = extractelement <4 x i1> %40, i64 2
br i1 %47, label %pred.store.if136, label %pred.store.continue137
pred.store.if136: ; preds = %pred.store.continue135
%48 = or i64 %index131, 2
%49 = getelementptr inbounds i32, ptr %vla, i64 %48
store i32 0, ptr %49, align 8, !tbaa !5
br label %pred.store.continue137
pred.store.continue137: ; preds = %pred.store.if136, %pred.store.continue135
%50 = extractelement <4 x i1> %40, i64 3
br i1 %50, label %pred.store.if138, label %pred.store.continue139
pred.store.if138: ; preds = %pred.store.continue137
%51 = or i64 %index131, 3
%52 = getelementptr inbounds i32, ptr %vla, i64 %51
store i32 0, ptr %52, align 4, !tbaa !5
br label %pred.store.continue139
pred.store.continue139: ; preds = %pred.store.if138, %pred.store.continue137
%53 = extractelement <4 x i1> %41, i64 0
br i1 %53, label %pred.store.if140, label %pred.store.continue141
pred.store.if140: ; preds = %pred.store.continue139
%54 = getelementptr inbounds i32, ptr %vla, i64 %35
store i32 0, ptr %54, align 16, !tbaa !5
br label %pred.store.continue141
pred.store.continue141: ; preds = %pred.store.if140, %pred.store.continue139
%55 = extractelement <4 x i1> %41, i64 1
br i1 %55, label %pred.store.if142, label %pred.store.continue143
pred.store.if142: ; preds = %pred.store.continue141
%56 = or i64 %index131, 5
%57 = getelementptr inbounds i32, ptr %vla, i64 %56
store i32 0, ptr %57, align 4, !tbaa !5
br label %pred.store.continue143
pred.store.continue143: ; preds = %pred.store.if142, %pred.store.continue141
%58 = extractelement <4 x i1> %41, i64 2
br i1 %58, label %pred.store.if144, label %pred.store.continue145
pred.store.if144: ; preds = %pred.store.continue143
%59 = or i64 %index131, 6
%60 = getelementptr inbounds i32, ptr %vla, i64 %59
store i32 0, ptr %60, align 8, !tbaa !5
br label %pred.store.continue145
pred.store.continue145: ; preds = %pred.store.if144, %pred.store.continue143
%61 = extractelement <4 x i1> %41, i64 3
br i1 %61, label %pred.store.if146, label %pred.store.continue147
pred.store.if146: ; preds = %pred.store.continue145
%62 = or i64 %index131, 7
%63 = getelementptr inbounds i32, ptr %vla, i64 %62
store i32 0, ptr %63, align 4, !tbaa !5
br label %pred.store.continue147
pred.store.continue147: ; preds = %pred.store.if146, %pred.store.continue145
%index.next148 = add nuw i64 %index131, 8
%64 = icmp eq i64 %index.next148, %n.vec127
br i1 %64, label %middle.block122, label %vector.body130, !llvm.loop !23
middle.block122: ; preds = %pred.store.continue147
br i1 %cmp.n129, label %while.cond4.loopexit, label %for.body30.preheader168
for.body30.preheader168: ; preds = %for.body30.preheader, %middle.block122
%indvars.iv104.ph = phi i64 [ 0, %for.body30.preheader ], [ %n.vec127, %middle.block122 ]
br label %for.body30
for.body30: ; preds = %for.body30.preheader168, %for.inc40
%indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.inc40 ], [ %indvars.iv104.ph, %for.body30.preheader168 ]
%arrayidx32 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv104
%65 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%conv33 = sitofp i32 %65 to float
%cmp34 = fcmp olt float %div, %conv33
br i1 %cmp34, label %if.then36, label %for.inc40
if.then36: ; preds = %for.body30
store i32 0, ptr %arrayidx32, align 4, !tbaa !5
br label %for.inc40
for.inc40: ; preds = %for.body30, %if.then36
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%exitcond107.not = icmp eq i64 %indvars.iv.next105, %.lcssa
br i1 %exitcond107.not, label %while.cond4.loopexit, label %for.body30, !llvm.loop !24
for.body48: ; preds = %for.body48.preheader169, %for.body48
%indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.body48 ], [ %indvars.iv108.ph, %for.body48.preheader169 ]
%count43.094 = phi i32 [ %spec.select78, %for.body48 ], [ %count43.094.ph, %for.body48.preheader169 ]
%arrayidx50 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv108
%66 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%cmp51 = icmp eq i32 %66, 0
%inc54 = zext i1 %cmp51 to i32
%spec.select78 = add nuw nsw i32 %count43.094, %inc54
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond111.not = icmp eq i64 %indvars.iv.next109, %.lcssa
br i1 %exitcond111.not, label %for.end58, label %for.body48, !llvm.loop !25
for.end58: ; preds = %for.body48, %middle.block, %for.cond44.preheader
%count43.0.lcssa = phi i32 [ 0, %for.cond44.preheader ], [ %31, %middle.block ], [ %spec.select78, %for.body48 ]
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %count43.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
%67 = load i64, ptr %t, align 8, !tbaa !15
%dec = add nsw i64 %67, -1
store i64 %dec, ptr %t, align 8, !tbaa !15
%tobool.not = icmp eq i64 %67, 0
br i1 %tobool.not, label %while.end60, label %while.body, !llvm.loop !26
while.end60: ; preds = %for.end58, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !12, !13}
!20 = distinct !{!20, !10, !13, !12}
!21 = distinct !{!21, !10, !12, !13}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10, !12, !13}
!24 = distinct !{!24, !10, !13, !12}
!25 = distinct !{!25, !10, !13, !12}
!26 = distinct !{!26, !10}
|
#include <stdio.h>
int main(void)
{
int n, i, minNo;
float h, w, min, diff;
while (1)
{
scanf("%d", &n);
if (!n)
break;
min = 999999;
while (n--)
{
scanf("%d%f%f", &i, &h, &w);
h /= 100.0;
diff = 22.0 - w / (h*h);
if (diff < 0)
diff *= -1;
if (min > diff || min == diff && minNo > i)
{
min = diff;
minNo = i;
}
}
printf("%d\n", minNo);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204353/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204353/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%f%f\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
%i = alloca i32, align 4
%h = alloca float, align 4
%w = alloca float, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not33 = icmp eq i32 %0, 0
br i1 %tobool.not33, label %while.end22, label %while.cond1.preheader
while.cond1.preheader: ; preds = %entry, %while.end
%1 = phi i32 [ %4, %while.end ], [ %0, %entry ]
%minNo.034 = phi i32 [ %minNo.2, %while.end ], [ undef, %entry ]
%dec29 = add nsw i32 %1, -1
store i32 %dec29, ptr %n, align 4, !tbaa !5
br label %while.body3
while.body3: ; preds = %while.cond1.preheader, %if.end20
%min.031 = phi float [ 9.999990e+05, %while.cond1.preheader ], [ %min.1, %if.end20 ]
%minNo.130 = phi i32 [ %minNo.034, %while.cond1.preheader ], [ %minNo.2, %if.end20 ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i, ptr noundef nonnull %h, ptr noundef nonnull %w)
%2 = load float, ptr %h, align 4, !tbaa !9
%conv5 = fdiv float %2, 1.000000e+02
store float %conv5, ptr %h, align 4, !tbaa !9
%3 = load float, ptr %w, align 4, !tbaa !9
%mul = fmul float %conv5, %conv5
%div6 = fdiv float %3, %mul
%conv8 = fsub float 2.200000e+01, %div6
%cmp = fcmp olt float %conv8, 0.000000e+00
%mul11 = fneg float %conv8
%diff.0 = select i1 %cmp, float %mul11, float %conv8
%cmp13 = fcmp ogt float %min.031, %diff.0
%.pre = load i32, ptr %i, align 4
br i1 %cmp13, label %if.then19, label %lor.lhs.false
lor.lhs.false: ; preds = %while.body3
%cmp15 = fcmp oeq float %min.031, %diff.0
%cmp17 = icmp sgt i32 %minNo.130, %.pre
%or.cond = select i1 %cmp15, i1 %cmp17, i1 false
br i1 %or.cond, label %if.then19, label %if.end20
if.then19: ; preds = %lor.lhs.false, %while.body3
br label %if.end20
if.end20: ; preds = %if.then19, %lor.lhs.false
%minNo.2 = phi i32 [ %.pre, %if.then19 ], [ %minNo.130, %lor.lhs.false ]
%min.1 = phi float [ %diff.0, %if.then19 ], [ %min.031, %lor.lhs.false ]
%.pr = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %.pr, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool2.not = icmp eq i32 %.pr, 0
br i1 %tobool2.not, label %while.end, label %while.body3, !llvm.loop !11
while.end: ; preds = %if.end20
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %minNo.2)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%4 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %4, 0
br i1 %tobool.not, label %while.end22, label %while.cond1.preheader
while.end22: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
int max(const void *a, const void *b){return *(int*)b - *(int*)a;}
uint64_t a[13] = {0};
uint64_t b[13] = {0};
int main(void)
{
b[0] = 1;
while(1){
char c;
uint64_t f;
scanf("%c",&c);
if(c=='\n') break;
for(int i=0;i<13;i++) a[i] = 0;
if(c!='?')
{
f = c - '0';
for(int i=0;i<13;i++)
{
a[((i*10)+f) % 13] = b[i];
a[((i*10)+f) % 13] %= 1000000007;
}
}else{
for(int j=0;j<=9;j++) for(int i=0;i<13;i++)
{
a[((i*10)+j) % 13] += b[i];
a[((i*10)+j) % 13]%= 1000000007;
}
}
// for(int i=0;i<13;i++) printf("%d:%ld %ld\n",i,a[i],b[i]);
for(int i=0;i<13;i++) b[i] = a[i];
}
printf("%ld\n", a[5]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204403/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204403/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@a = dso_local local_unnamed_addr global [13 x i64] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [13 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @max(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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%c = alloca i8, align 1
store i64 1, ptr @b, align 16, !tbaa !9
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #6
%call101 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !11
%cmp102 = icmp eq i8 %0, 10
br i1 %cmp102, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end60
%1 = phi i8 [ %58, %if.end60 ], [ %0, %entry ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @a, i8 0, i64 104, i1 false), !tbaa !9
%cmp5.not = icmp eq i8 %1, 63
br i1 %cmp5.not, label %for.cond35.preheader.preheader, label %if.then7
for.cond35.preheader.preheader: ; preds = %for.cond.preheader
%.pre = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 4), align 16, !tbaa !9
%.pre114 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 5), align 8, !tbaa !9
%.pre115 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 6), align 16, !tbaa !9
%.pre116 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 7), align 8, !tbaa !9
%.pre117 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 8), align 16, !tbaa !9
%.pre118 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 9), align 8, !tbaa !9
%.pre119 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 10), align 16, !tbaa !9
%2 = load i64, ptr @b, align 16, !tbaa !9
%3 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !9
%4 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 2), align 16, !tbaa !9
%5 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 3), align 8, !tbaa !9
%6 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 11), align 8, !tbaa !9
%7 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 12), align 16, !tbaa !9
br label %for.cond35.preheader
if.then7: ; preds = %for.cond.preheader
%conv4 = sext i8 %1 to i64
%sub = add nsw i64 %conv4, -48
%8 = load i64, ptr @b, align 16, !tbaa !9
%rem = urem i64 %sub, 13
%arrayidx19 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem
%rem25 = urem i64 %8, 1000000007
store i64 %rem25, ptr %arrayidx19, align 8, !tbaa !9
%9 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 1), align 8, !tbaa !9
%add.1 = add nsw i64 %conv4, -38
%rem.1 = urem i64 %add.1, 13
%arrayidx19.1 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.1
%rem25.1 = urem i64 %9, 1000000007
store i64 %rem25.1, ptr %arrayidx19.1, align 8, !tbaa !9
%10 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 2), align 16, !tbaa !9
%add.2 = add nsw i64 %conv4, -28
%rem.2 = urem i64 %add.2, 13
%arrayidx19.2 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.2
%rem25.2 = urem i64 %10, 1000000007
store i64 %rem25.2, ptr %arrayidx19.2, align 8, !tbaa !9
%11 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 3), align 8, !tbaa !9
%add.3 = add nsw i64 %conv4, -18
%rem.3 = urem i64 %add.3, 13
%arrayidx19.3 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.3
%rem25.3 = urem i64 %11, 1000000007
store i64 %rem25.3, ptr %arrayidx19.3, align 8, !tbaa !9
%12 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 4), align 16, !tbaa !9
%add.4 = add nsw i64 %conv4, -8
%rem.4 = urem i64 %add.4, 13
%arrayidx19.4 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.4
%rem25.4 = urem i64 %12, 1000000007
store i64 %rem25.4, ptr %arrayidx19.4, align 8, !tbaa !9
%13 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 5), align 8, !tbaa !9
%add.5 = add nsw i64 %conv4, 2
%rem.5 = urem i64 %add.5, 13
%arrayidx19.5 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.5
%rem25.5 = urem i64 %13, 1000000007
store i64 %rem25.5, ptr %arrayidx19.5, align 8, !tbaa !9
%14 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 6), align 16, !tbaa !9
%add.6 = add nsw i64 %conv4, 12
%rem.6 = urem i64 %add.6, 13
%arrayidx19.6 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.6
%rem25.6 = urem i64 %14, 1000000007
store i64 %rem25.6, ptr %arrayidx19.6, align 8, !tbaa !9
%15 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 7), align 8, !tbaa !9
%add.7 = add nsw i64 %conv4, 22
%rem.7 = urem i64 %add.7, 13
%arrayidx19.7 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.7
%rem25.7 = urem i64 %15, 1000000007
store i64 %rem25.7, ptr %arrayidx19.7, align 8, !tbaa !9
%16 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 8), align 16, !tbaa !9
%add.8 = add nsw i64 %conv4, 32
%rem.8 = urem i64 %add.8, 13
%arrayidx19.8 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.8
%rem25.8 = urem i64 %16, 1000000007
store i64 %rem25.8, ptr %arrayidx19.8, align 8, !tbaa !9
%17 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 9), align 8, !tbaa !9
%add.9 = add nsw i64 %conv4, 42
%rem.9 = urem i64 %add.9, 13
%arrayidx19.9 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.9
%rem25.9 = urem i64 %17, 1000000007
store i64 %rem25.9, ptr %arrayidx19.9, align 8, !tbaa !9
%18 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 10), align 16, !tbaa !9
%add.10 = add nsw i64 %conv4, 52
%rem.10 = urem i64 %add.10, 13
%arrayidx19.10 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.10
%rem25.10 = urem i64 %18, 1000000007
store i64 %rem25.10, ptr %arrayidx19.10, align 8, !tbaa !9
%19 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 11), align 8, !tbaa !9
%add.11 = add nsw i64 %conv4, 62
%rem.11 = urem i64 %add.11, 13
%arrayidx19.11 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.11
%rem25.11 = urem i64 %19, 1000000007
store i64 %rem25.11, ptr %arrayidx19.11, align 8, !tbaa !9
%20 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @b, i64 0, i64 12), align 16, !tbaa !9
%add.12 = add nsw i64 %conv4, 72
%rem.12 = urem i64 %add.12, 13
%arrayidx19.12 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %rem.12
%rem25.12 = urem i64 %20, 1000000007
store i64 %rem25.12, ptr %arrayidx19.12, align 8, !tbaa !9
br label %if.end60
for.cond35.preheader: ; preds = %for.cond35.preheader.preheader, %for.cond35.preheader
%indvars.iv = phi i64 [ 0, %for.cond35.preheader.preheader ], [ %indvars.iv.next, %for.cond35.preheader ]
%arrayidx46 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %indvars.iv
%21 = load i64, ptr %arrayidx46, align 8, !tbaa !9
%add47 = add i64 %21, %2
%rem53 = urem i64 %add47, 1000000007
store i64 %rem53, ptr %arrayidx46, align 8, !tbaa !9
%22 = trunc i64 %indvars.iv to i32
%23 = add i32 %22, 10
%rem44.1 = urem i32 %23, 13
%idxprom45.1 = zext i32 %rem44.1 to i64
%arrayidx46.1 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.1
%24 = load i64, ptr %arrayidx46.1, align 8, !tbaa !9
%add47.1 = add i64 %24, %3
%rem53.1 = urem i64 %add47.1, 1000000007
store i64 %rem53.1, ptr %arrayidx46.1, align 8, !tbaa !9
%25 = trunc i64 %indvars.iv to i32
%26 = add i32 %25, 20
%rem44.2 = urem i32 %26, 13
%idxprom45.2 = zext i32 %rem44.2 to i64
%arrayidx46.2 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.2
%27 = load i64, ptr %arrayidx46.2, align 8, !tbaa !9
%add47.2 = add i64 %27, %4
%rem53.2 = urem i64 %add47.2, 1000000007
store i64 %rem53.2, ptr %arrayidx46.2, align 8, !tbaa !9
%28 = trunc i64 %indvars.iv to i32
%29 = add i32 %28, 30
%rem44.3 = urem i32 %29, 13
%idxprom45.3 = zext i32 %rem44.3 to i64
%arrayidx46.3 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.3
%30 = load i64, ptr %arrayidx46.3, align 8, !tbaa !9
%add47.3 = add i64 %30, %5
%rem53.3 = urem i64 %add47.3, 1000000007
store i64 %rem53.3, ptr %arrayidx46.3, align 8, !tbaa !9
%31 = trunc i64 %indvars.iv to i32
%32 = add i32 %31, 40
%rem44.4 = urem i32 %32, 13
%idxprom45.4 = zext i32 %rem44.4 to i64
%arrayidx46.4 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.4
%33 = load i64, ptr %arrayidx46.4, align 8, !tbaa !9
%add47.4 = add i64 %33, %.pre
%rem53.4 = urem i64 %add47.4, 1000000007
store i64 %rem53.4, ptr %arrayidx46.4, align 8, !tbaa !9
%34 = trunc i64 %indvars.iv to i32
%35 = add i32 %34, 50
%rem44.5 = urem i32 %35, 13
%idxprom45.5 = zext i32 %rem44.5 to i64
%arrayidx46.5 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.5
%36 = load i64, ptr %arrayidx46.5, align 8, !tbaa !9
%add47.5 = add i64 %36, %.pre114
%rem53.5 = urem i64 %add47.5, 1000000007
store i64 %rem53.5, ptr %arrayidx46.5, align 8, !tbaa !9
%37 = trunc i64 %indvars.iv to i32
%38 = add i32 %37, 60
%rem44.6 = urem i32 %38, 13
%idxprom45.6 = zext i32 %rem44.6 to i64
%arrayidx46.6 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.6
%39 = load i64, ptr %arrayidx46.6, align 8, !tbaa !9
%add47.6 = add i64 %39, %.pre115
%rem53.6 = urem i64 %add47.6, 1000000007
store i64 %rem53.6, ptr %arrayidx46.6, align 8, !tbaa !9
%40 = trunc i64 %indvars.iv to i32
%41 = add i32 %40, 70
%rem44.7 = urem i32 %41, 13
%idxprom45.7 = zext i32 %rem44.7 to i64
%arrayidx46.7 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.7
%42 = load i64, ptr %arrayidx46.7, align 8, !tbaa !9
%add47.7 = add i64 %42, %.pre116
%rem53.7 = urem i64 %add47.7, 1000000007
store i64 %rem53.7, ptr %arrayidx46.7, align 8, !tbaa !9
%43 = trunc i64 %indvars.iv to i32
%44 = add i32 %43, 80
%rem44.8 = urem i32 %44, 13
%idxprom45.8 = zext i32 %rem44.8 to i64
%arrayidx46.8 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.8
%45 = load i64, ptr %arrayidx46.8, align 8, !tbaa !9
%add47.8 = add i64 %45, %.pre117
%rem53.8 = urem i64 %add47.8, 1000000007
store i64 %rem53.8, ptr %arrayidx46.8, align 8, !tbaa !9
%46 = trunc i64 %indvars.iv to i32
%47 = add i32 %46, 90
%rem44.9 = urem i32 %47, 13
%idxprom45.9 = zext i32 %rem44.9 to i64
%arrayidx46.9 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.9
%48 = load i64, ptr %arrayidx46.9, align 8, !tbaa !9
%add47.9 = add i64 %48, %.pre118
%rem53.9 = urem i64 %add47.9, 1000000007
store i64 %rem53.9, ptr %arrayidx46.9, align 8, !tbaa !9
%49 = trunc i64 %indvars.iv to i32
%50 = add i32 %49, 100
%rem44.10 = urem i32 %50, 13
%idxprom45.10 = zext i32 %rem44.10 to i64
%arrayidx46.10 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.10
%51 = load i64, ptr %arrayidx46.10, align 8, !tbaa !9
%add47.10 = add i64 %51, %.pre119
%rem53.10 = urem i64 %add47.10, 1000000007
store i64 %rem53.10, ptr %arrayidx46.10, align 8, !tbaa !9
%52 = trunc i64 %indvars.iv to i32
%53 = add i32 %52, 110
%rem44.11 = urem i32 %53, 13
%idxprom45.11 = zext i32 %rem44.11 to i64
%arrayidx46.11 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.11
%54 = load i64, ptr %arrayidx46.11, align 8, !tbaa !9
%add47.11 = add i64 %54, %6
%rem53.11 = urem i64 %add47.11, 1000000007
store i64 %rem53.11, ptr %arrayidx46.11, align 8, !tbaa !9
%55 = trunc i64 %indvars.iv to i32
%56 = add i32 %55, 120
%rem44.12 = urem i32 %56, 13
%idxprom45.12 = zext i32 %rem44.12 to i64
%arrayidx46.12 = getelementptr inbounds [13 x i64], ptr @a, i64 0, i64 %idxprom45.12
%57 = load i64, ptr %arrayidx46.12, align 8, !tbaa !9
%add47.12 = add i64 %57, %7
%rem53.12 = urem i64 %add47.12, 1000000007
store i64 %rem53.12, ptr %arrayidx46.12, align 8, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 10
br i1 %exitcond.not, label %if.end60, label %for.cond35.preheader, !llvm.loop !12
if.end60: ; preds = %for.cond35.preheader, %if.then7
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) @b, ptr noundef nonnull align 16 dereferenceable(104) @a, i64 104, i1 false), !tbaa !9
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #6
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%58 = load i8, ptr %c, align 1, !tbaa !11
%cmp = icmp eq i8 %58, 10
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end60, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #6
%59 = load i64, ptr getelementptr inbounds ([13 x i64], ptr @a, i64 0, i64 5), align 8, !tbaa !9
%call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %59)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n,d,cnt=0;
for(scanf("%d%d",&n,&d);0<n;n-=2*d+1,cnt++);
printf("%d",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204447/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204447/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = 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 %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %.pr, 0
br i1 %cmp3, label %for.inc.lr.ph, label %for.end
for.inc.lr.ph: ; preds = %entry
%0 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%add.neg = xor i32 %mul, -1
br label %for.inc
for.inc: ; preds = %for.inc.lr.ph, %for.inc
%cnt.04 = phi i32 [ 0, %for.inc.lr.ph ], [ %inc, %for.inc ]
%1 = phi i32 [ %.pr, %for.inc.lr.ph ], [ %sub, %for.inc ]
%sub = add i32 %1, %add.neg
%inc = add nuw nsw i32 %cnt.04, 1
%cmp = icmp sgt i32 %sub, 0
br i1 %cmp, label %for.inc, label %for.cond.for.end_crit_edge, !llvm.loop !9
for.cond.for.end_crit_edge: ; preds = %for.inc
store i32 %sub, ptr %n, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %entry
%cnt.0.lcssa = phi i32 [ %inc, %for.cond.for.end_crit_edge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
/* ex4_1
shu_t */
#include<stdio.h>
#include<math.h>
int main(void){
int tree_num, d;
int ans;
//input N and D
scanf("%d %d",&tree_num,&d);
//answer: round up to tree_num divided by 2*D+1
ans = ceil((double) tree_num/(2*d+1));
//output the answer
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%tree_num = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tree_num) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tree_num, ptr noundef nonnull %d)
%0 = load i32, ptr %tree_num, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%conv1 = sitofp i32 %add to double
%div = fdiv double %conv, %conv1
%2 = call double @llvm.ceil.f64(double %div)
%conv2 = fptosi double %2 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tree_num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* ex4_1
kosaq */
#include <stdio.h>
#include <math.h>
int main(void){
double n_tree;//N本の林檎の木をn_treeで定義
double d_range;//一人は、D本先までを監視できるのでDをd_rangeで定義
double one_observe;//一人が監視できる林檎の木の数
int people_number;//N本の林檎の木を監視するために必要な人数の最小値
scanf("%lf %lf", &n_tree, &d_range);//NとDを入力
one_observe = d_range * 2 + 1;//一人が監視できる林檎の木の数
people_number = ceil(n_tree / one_observe);//N本の林檎の木を監視するために必要な人数の最小値は(n_tree / one_observ)eの小数値を切り上げた整数
printf("%d\n", people_number);//N本の林檎の木を監視するために必要な人数の最小値を出力
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204533/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204533/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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_tree = alloca double, align 8
%d_range = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n_tree) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d_range) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n_tree, ptr noundef nonnull %d_range)
%0 = load double, ptr %d_range, align 8, !tbaa !5
%1 = call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double 1.000000e+00)
%2 = load double, ptr %n_tree, align 8, !tbaa !5
%div = fdiv double %2, %1
%3 = call double @llvm.ceil.f64(double %div)
%conv = fptosi double %3 to i32
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d_range) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n_tree) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int n, d;
scanf("%d%d",&n,&d);
if(n%(d*2+1)==0)
printf("%d\n",n/(d*2+1));
else
printf("%d\n",n/(d*2+1)+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204584/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204584/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%d = 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 %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%rem = srem i32 %0, %add
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %0, %add
%add7 = zext i1 %cmp to i32
%add7.sink = add nsw i32 %div, %add7
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add7.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int N, D;
int horieyui;
if (scanf("%d%d", &N, &D) != 2) return 1;
horieyui = D + 1 + D;
printf("%d\n", (N + horieyui - 1) / horieyui);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204627/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204627/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%N = alloca i32, align 4
%D = 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 %D) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D)
%cmp.not = icmp eq i32 %call, 2
br i1 %cmp.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%0 = load i32, ptr %D, align 4, !tbaa !5
%reass.add = shl i32 %0, 1
%add1 = or i32 %reass.add, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%add2 = add i32 %1, -1
%sub = add i32 %add2, %add1
%div = sdiv i32 %sub, %add1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 0, %if.end ], [ 1, %entry ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,m;
scanf("%d%d",&n,&m);
m*=2;
m++;
int t=n/m;
if(n%m)
t++;
printf("%d\n",t);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204670/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204670/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%m = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%inc = or i32 %mul, 1
store i32 %inc, ptr %m, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %1, %inc
%rem = srem i32 %1, %inc
%tobool.not = icmp ne i32 %rem, 0
%inc1 = zext i1 %tobool.not to i32
%spec.select = add nsw i32 %div, %inc1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
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(void)
{
int n,d;
scanf("%d%d",&n,&d);
if(n%(2*d+1)==0) printf("%d",n/(2*d+1));
else printf("%d\n",n/(2*d+1)+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204713/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204713/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%rem = srem i32 %0, %add
%cmp = icmp eq i32 %rem, 0
%div = sdiv i32 %0, %add
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end
if.else: ; preds = %entry
%add7 = add nsw i32 %div, 1
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add7)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, char * argv[]) {
int n ,d, ans, i;
scanf("%d%d", &n, &d);
ans = 0;
for(i = 0;i < n;){
i += 2*d + 1;
ans++;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204757/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204757/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = 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 %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.07 = phi i32 [ 0, %for.body.lr.ph ], [ %add1, %for.body ]
%ans.06 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%add = add nsw i32 %i.07, 1
%add1 = add i32 %add, %mul
%inc = add nuw nsw i32 %ans.06, 1
%cmp = icmp slt i32 %add1, %0
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %for.body ]
%call2 = 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 %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int n,a,b,i,j,k,p;
int arr[100];
int fz[100];
scanf("%d",&n);
for(i=0; i<n; i++)
{
scanf("%d %d",&a,&b);
for(j=0; j<a; j++)
{
scanf("%d",&arr[j]);
}
for(k=1; k<=b+1; k++)
{
for(p=0; p<a; p++)
{
if(arr[p]==k)
{
b=b+1;
break;
}
}
}
fz[i]=b;
}
for(i=0; i<n; i++)
printf("%d\n",fz[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20480/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20480/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%arr = alloca [100 x i32], align 16
%fz = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %arr) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %fz) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp61 = icmp sgt i32 %0, 0
br i1 %cmp61, label %for.body, label %for.end35
for.cond27.preheader: ; preds = %for.end21
%1 = icmp sgt i32 %6, 0
br i1 %1, label %for.body29, label %for.end35
for.body: ; preds = %entry, %for.end21
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.end21 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%2 = load i32, ptr %a, align 4, !tbaa !5
%cmp348 = icmp sgt i32 %2, 0
br i1 %cmp348, label %for.body4, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body4, %for.body
%.lcssa = phi i32 [ %2, %for.body ], [ %4, %for.body4 ]
%b.promoted = load i32, ptr %b, align 4, !tbaa !5
%cmp7.not55 = icmp sgt i32 %b.promoted, -1
%cmp1050 = icmp sgt i32 %.lcssa, 0
%or.cond = and i1 %cmp7.not55, %cmp1050
br i1 %or.cond, label %for.cond9.preheader.us.preheader, label %for.end21
for.cond9.preheader.us.preheader: ; preds = %for.cond6.preheader
%wide.trip.count = zext i32 %.lcssa to i64
br label %for.cond9.preheader.us
for.cond9.preheader.us: ; preds = %for.cond9.preheader.us.preheader, %for.inc19.us
%k.057.us = phi i32 [ %inc20.us, %for.inc19.us ], [ 1, %for.cond9.preheader.us.preheader ]
%add5356.us = phi i32 [ %add52.us, %for.inc19.us ], [ %b.promoted, %for.cond9.preheader.us.preheader ]
%add59.us = add nsw i32 %add5356.us, 1
br label %for.body11.us
for.cond9.us: ; preds = %for.body11.us
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
br i1 %exitcond.not, label %for.inc19.us, label %for.body11.us, !llvm.loop !9
for.body11.us: ; preds = %for.cond9.preheader.us, %for.cond9.us
%indvars.iv68 = phi i64 [ 0, %for.cond9.preheader.us ], [ %indvars.iv.next69, %for.cond9.us ]
%arrayidx13.us = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv68
%3 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%cmp14.us = icmp eq i32 %3, %k.057.us
br i1 %cmp14.us, label %if.then.us, label %for.cond9.us
if.then.us: ; preds = %for.body11.us
store i32 %add59.us, ptr %b, align 4, !tbaa !5
br label %for.inc19.us
for.inc19.us: ; preds = %for.cond9.us, %if.then.us
%add52.us = phi i32 [ %add59.us, %if.then.us ], [ %add5356.us, %for.cond9.us ]
%inc20.us = add nuw nsw i32 %k.057.us, 1
%cmp7.not.us = icmp sgt i32 %k.057.us, %add52.us
br i1 %cmp7.not.us, label %for.end21, label %for.cond9.preheader.us, !llvm.loop !11
for.body4: ; preds = %for.body, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %a, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp3, label %for.body4, label %for.cond6.preheader, !llvm.loop !12
for.end21: ; preds = %for.inc19.us, %for.cond6.preheader
%.lcssa47 = phi i32 [ %b.promoted, %for.cond6.preheader ], [ %add52.us, %for.inc19.us ]
%arrayidx23 = getelementptr inbounds [100 x i32], ptr %fz, i64 0, i64 %indvars.iv71
store i32 %.lcssa47, ptr %arrayidx23, align 4, !tbaa !5
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next72, %7
br i1 %cmp, label %for.body, label %for.cond27.preheader, !llvm.loop !13
for.body29: ; preds = %for.cond27.preheader, %for.body29
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body29 ], [ 0, %for.cond27.preheader ]
%arrayidx31 = getelementptr inbounds [100 x i32], ptr %fz, i64 0, i64 %indvars.iv74
%8 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp28 = icmp slt i64 %indvars.iv.next75, %10
br i1 %cmp28, label %for.body29, label %for.end35, !llvm.loop !14
for.end35: ; preds = %for.body29, %entry, %for.cond27.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %fz) #3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %arr) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main(void) {
// 入力
int n,d,result=0;
scanf("%d %d",&n,&d);
float tmp1=(n/(d*2.0+1.0));
int tmp2=(int)tmp1;
if(tmp1==tmp2)result=tmp2;
else result=tmp2+1;
printf("%d\n",result);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204843/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204843/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%1 = load i32, ptr %d, align 4, !tbaa !5
%conv1 = sitofp i32 %1 to double
%2 = call double @llvm.fmuladd.f64(double %conv1, double 2.000000e+00, double 1.000000e+00)
%div = fdiv double %conv, %2
%conv2 = fptrunc double %div to float
%conv3 = fptosi float %conv2 to i32
%conv4 = sitofp i32 %conv3 to float
%cmp = fcmp une float %conv2, %conv4
%add = zext i1 %cmp to i32
%result.0 = add nsw i32 %add, %conv3
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int n,d,res;
scanf("%d %d",&n,&d);
res=n/(d*2+1);
if(n%(d*2+1) != 0){
res++;
}
printf("%d",res);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204894/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204894/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = 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 %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%div = sdiv i32 %0, %add
%rem = srem i32 %0, %add
%cmp.not = icmp ne i32 %rem, 0
%inc = zext i1 %cmp.not to i32
%spec.select = add nsw i32 %div, %inc
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int n, d;
scanf("%d %d", &n, &d);
int cansee = d * 2 + 1;
int ans = 0;
while(n > 0) {
n -= cansee;
ans++;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204937/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204937/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%d = 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 %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%add.neg = xor i32 %mul, -1
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %.pr, 0
br i1 %cmp3, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%ans.04 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%1 = phi i32 [ %sub, %while.body ], [ %.pr, %entry ]
%sub = add i32 %1, %add.neg
%inc = add nuw nsw i32 %ans.04, 1
%cmp = icmp sgt i32 %sub, 0
br i1 %cmp, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %sub, ptr %n, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%ans.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%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 %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
printf("%s",(a%500<=b)?"Yes":"No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204980/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204980/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%rem = srem i32 %0, 500
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%cond = select i1 %cmp.not, ptr @.str.3, ptr @.str.2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %cond)
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 n,a;
scanf("%d\n",&n);
scanf("%d",&a);
if((n%500)<=a){
printf("Yes");
}
else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205022/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205022/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%.str.3..str.2 = select i1 %cmp.not, ptr @.str.3, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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,d;
scanf("%d%d",&a,&b);
d=a%500;
if(d<=b){
printf("Yes\n");
}
else if(a<500&&a<=b){
printf("Yes\n");
} else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205066/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205066/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%cmp2 = icmp sgt i32 %0, 499
%cmp3.not = icmp sgt i32 %0, %1
%or.cond = or i1 %cmp2, %cmp3.not
%str.str.3 = select i1 %or.cond, ptr @str, ptr @str.4
%str.3.sink = select i1 %cmp.not, ptr %str.str.3, ptr @str.4
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int N, A;
scanf("%d%d", &N, &A);
printf("%s\n", N%500 <= A ? "Yes" : "No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205109/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205109/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %A, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%cond = select i1 %cmp.not, ptr @.str.3, ptr @.str.2
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int N,A,i;
int sum,flag = 0;
scanf("%d%d",&N,&A);
for(i=0;i<=20;i++){
sum = 500*i;
if(N <= sum + A && N >= sum){
flag = 1;
}
}
if(flag == 1){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205152/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205152/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [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 i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%cmp1.not = icmp sle i32 %0, %1
%cmp2.not = icmp sgt i32 %0, -1
%or.cond.not = and i1 %cmp2.not, %cmp1.not
%2 = insertelement <4 x i32> poison, i32 %1, i64 0
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = add nsw <4 x i32> %3, <i32 2000, i32 1500, i32 1000, i32 500>
%5 = insertelement <4 x i32> poison, i32 %0, i64 0
%6 = shufflevector <4 x i32> %5, <4 x i32> poison, <4 x i32> zeroinitializer
%7 = icmp sle <4 x i32> %6, %4
%8 = icmp sgt <4 x i32> %6, <i32 1999, i32 1499, i32 999, i32 499>
%9 = and <4 x i1> %8, %7
%10 = insertelement <16 x i32> poison, i32 %1, i64 0
%11 = shufflevector <16 x i32> %10, <16 x i32> poison, <16 x i32> zeroinitializer
%12 = add nsw <16 x i32> %11, <i32 9500, i32 10000, i32 9000, i32 8500, i32 8000, i32 7500, i32 7000, i32 6500, i32 6000, i32 5500, i32 5000, i32 4500, i32 4000, i32 3500, i32 3000, i32 2500>
%13 = insertelement <16 x i32> poison, i32 %0, i64 0
%14 = shufflevector <16 x i32> %13, <16 x i32> poison, <16 x i32> zeroinitializer
%15 = icmp sle <16 x i32> %14, %12
%16 = icmp sgt <16 x i32> %14, <i32 9499, i32 9999, i32 8999, i32 8499, i32 7999, i32 7499, i32 6999, i32 6499, i32 5999, i32 5499, i32 4999, i32 4499, i32 3999, i32 3499, i32 2999, i32 2499>
%17 = and <16 x i1> %16, %15
%18 = freeze <16 x i1> %17
%19 = bitcast <16 x i1> %18 to i16
%20 = icmp ne i16 %19, 0
%21 = freeze <4 x i1> %9
%22 = bitcast <4 x i1> %21 to i4
%23 = icmp ne i4 %22, 0
%op.rdx = or i1 %20, %23
%op.rdx24 = select i1 %op.rdx, i1 true, i1 %or.cond.not
%str.3.str = select i1 %op.rdx24, 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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int N, A;
scanf("%d", &N);
scanf("%d", &A);
if (N % 500 <= A){
printf("Yes\n");
}
else {
printf("No\n");
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205196/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205196/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %A, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){
int N, A;
scanf("%d%d", &N, &A);
if(N%500<=A)
printf("Yes\n");
else
printf("No\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205239/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205239/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [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 i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %A, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %rem, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: 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 N,A;
scanf("%d%d",&N,&A);
if(N%500 > A)
{
printf("No\n");
}
else
{
printf("Yes\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205282/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205282/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 500
%1 = load i32, ptr %A, align 4, !tbaa !5
%cmp = icmp sgt i32 %rem, %1
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: 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 n,i,x=0,y=0;
char s[101];
scanf("%d%s",&n,s);
for(i=0;i<n;i++){y+=1-(s[i]==')')*2;x=x<y?x:y;}
for(i=0;i<-x;i++)printf("(");printf("%s",s);for(i=0;i<y-x;i++)printf(")");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205332/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205332/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp38 = icmp sgt i32 %0, 0
br i1 %cmp38, label %for.body.preheader, label %for.end13
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %0, 1
br i1 %1, label %for.cond5.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.cond5.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %add.1, %for.body ]
%cond.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %cond.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%y.041.unr = phi i32 [ 0, %for.body.preheader ], [ %add.1, %for.body ]
%x.040.unr = phi i32 [ 0, %for.body.preheader ], [ %cond.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond5.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond5.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%cmp1.epil = icmp eq i8 %2, 41
%sub.epil = select i1 %cmp1.epil, i32 -1, i32 1
%add.epil = add nsw i32 %sub.epil, %y.041.unr
%cond.epil = call i32 @llvm.smin.i32(i32 %x.040.unr, i32 %add.epil)
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.cond5.preheader.unr-lcssa, %for.body.epil
%add.lcssa = phi i32 [ %add.lcssa.ph, %for.cond5.preheader.unr-lcssa ], [ %add.epil, %for.body.epil ]
%cond.lcssa = phi i32 [ %cond.lcssa.ph, %for.cond5.preheader.unr-lcssa ], [ %cond.epil, %for.body.epil ]
%cmp743 = icmp slt i32 %cond.lcssa, 0
br i1 %cmp743, label %for.body9.preheader, label %for.end13
for.body9.preheader: ; preds = %for.cond5.preheader
%sub6 = sub i32 0, %cond.lcssa
%smax = call i32 @llvm.smax.i32(i32 %sub6, i32 1)
br label %for.body9
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%y.041 = phi i32 [ 0, %for.body.preheader.new ], [ %add.1, %for.body ]
%x.040 = phi i32 [ 0, %for.body.preheader.new ], [ %cond.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx, align 2, !tbaa !9
%cmp1 = icmp eq i8 %3, 41
%sub = select i1 %cmp1, i32 -1, i32 1
%add = add nsw i32 %sub, %y.041
%cond = call i32 @llvm.smin.i32(i32 %x.040, i32 %add)
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%cmp1.1 = icmp eq i8 %4, 41
%sub.1 = select i1 %cmp1.1, i32 -1, i32 1
%add.1 = add nsw i32 %sub.1, %add
%cond.1 = call i32 @llvm.smin.i32(i32 %cond, i32 %add.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.cond5.preheader.unr-lcssa, label %for.body, !llvm.loop !10
for.body9: ; preds = %for.body9.preheader, %for.body9
%i.144 = phi i32 [ %inc12, %for.body9 ], [ 0, %for.body9.preheader ]
%putchar37 = call i32 @putchar(i32 40)
%inc12 = add nuw nsw i32 %i.144, 1
%exitcond48.not = icmp eq i32 %inc12, %smax
br i1 %exitcond48.not, label %for.end13, label %for.body9, !llvm.loop !12
for.end13: ; preds = %for.body9, %entry, %for.cond5.preheader
%y.0.lcssa54 = phi i32 [ %add.lcssa, %for.cond5.preheader ], [ 0, %entry ], [ %add.lcssa, %for.body9 ]
%x.0.lcssa53 = phi i32 [ %cond.lcssa, %for.cond5.preheader ], [ 0, %entry ], [ %cond.lcssa, %for.body9 ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %s)
%sub17 = sub nsw i32 %y.0.lcssa54, %x.0.lcssa53
%cmp1845 = icmp sgt i32 %sub17, 0
br i1 %cmp1845, label %for.body20, label %for.end24
for.body20: ; preds = %for.end13, %for.body20
%i.246 = phi i32 [ %inc23, %for.body20 ], [ 0, %for.end13 ]
%putchar = call i32 @putchar(i32 41)
%inc23 = add nuw nsw i32 %i.246, 1
%exitcond49.not = icmp eq i32 %inc23, %sub17
br i1 %exitcond49.not, label %for.end24, label %for.body20, !llvm.loop !13
for.end24: ; preds = %for.body20, %for.end13
call void @llvm.lifetime.end.p0(i64 101, 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include<stdio.h>
int main() {
int n;
int i;
char s[110] = {};
char ans[210] = {};
int numleft[110] = {};
int numright[110] = {};
int lmax = 0;
int rmax = 0;
scanf("%d\n", &n);
for (i = 1; i < n+1; i++) {
scanf("%c", &s[i]);
if (s[i] == ')') {
numleft[i] = numleft[i-1] + 1;
} else if (s[i] == '(') {
numleft[i] = numleft[i-1] - 1;
}
if (lmax <= numleft[i]) {
lmax = numleft[i];
}
/*printf("%d\n", numleft[i]);*/
}
for (i = n; i > 0; i--) {
if (s[i] == ')') {
numright[i] = numright[i+1] - 1;
} else if (s[i] == '(') {
numright[i] = numright[i+1] + 1;
}
if (rmax <= numright[i]) {
rmax = numright[i];
}
}
/*printf("%d %d\n", lmax, rmax);*/
for (i = 1; i < lmax+1; i++) {
ans[i] = '(';
}
for (i = lmax+1; i < lmax + n+1; i++) {
ans[i] = s[i-lmax];
}
for (i = lmax + n+1; i < lmax + n + rmax + 1; i++) {
ans[i] = ')';
}
for (i = 1; i < n+lmax+rmax+1; i++) {
printf("%c", ans[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205390/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205390/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\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 [110 x i8], align 16
%ans = alloca [210 x i8], align 16
%numleft = alloca [110 x i32], align 16
%numright = alloca [110 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 110, ptr nonnull %s) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(110) %s, i8 0, i64 110, i1 false)
call void @llvm.lifetime.start.p0(i64 210, ptr nonnull %ans) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(210) %ans, i8 0, i64 210, i1 false)
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %numleft) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) %numleft, i8 0, i64 440, i1 false)
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %numright) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) %numright, i8 0, i64 440, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not170 = icmp slt i32 %0, 1
br i1 %cmp.not170, label %for.cond112.preheader, label %for.body
for.cond32.preheader: ; preds = %if.end23
%cmp33174 = icmp sgt i32 %5, 0
br i1 %cmp33174, label %for.body35.preheader, label %for.cond73.preheader
for.body35.preheader: ; preds = %for.cond32.preheader
%1 = zext i32 %5 to i64
br label %for.body35
for.body: ; preds = %entry, %if.end23
%2 = phi i32 [ %4, %if.end23 ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end23 ], [ 1, %entry ]
%lmax.0172 = phi i32 [ %spec.select, %if.end23 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [110 x i8], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%3 = load i8, ptr %arrayidx, align 1, !tbaa !9
switch i8 %3, label %for.body.if.end23_crit_edge [
i8 41, label %if.then
i8 40, label %if.then16
]
for.body.if.end23_crit_edge: ; preds = %for.body
%arrayidx25.phi.trans.insert = getelementptr inbounds [110 x i32], ptr %numleft, i64 0, i64 %indvars.iv
%.pre = load i32, ptr %arrayidx25.phi.trans.insert, align 4, !tbaa !5
br label %if.end23
if.then: ; preds = %for.body
%add8 = add nsw i32 %2, 1
%arrayidx10 = getelementptr inbounds [110 x i32], ptr %numleft, i64 0, i64 %indvars.iv
store i32 %add8, ptr %arrayidx10, align 4, !tbaa !5
br label %if.end23
if.then16: ; preds = %for.body
%sub20 = add nsw i32 %2, -1
%arrayidx22 = getelementptr inbounds [110 x i32], ptr %numleft, i64 0, i64 %indvars.iv
store i32 %sub20, ptr %arrayidx22, align 4, !tbaa !5
br label %if.end23
if.end23: ; preds = %for.body.if.end23_crit_edge, %if.then16, %if.then
%4 = phi i32 [ %.pre, %for.body.if.end23_crit_edge ], [ %sub20, %if.then16 ], [ %add8, %if.then ]
%spec.select = call i32 @llvm.smax.i32(i32 %lmax.0172, i32 %4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp.not.not, label %for.body, label %for.cond32.preheader, !llvm.loop !10
for.cond73.preheader: ; preds = %if.end62, %for.cond32.preheader
%cmp33174218 = phi i1 [ false, %for.cond32.preheader ], [ %cmp33174, %if.end62 ]
%rmax.0.lcssa = phi i32 [ 0, %for.cond32.preheader ], [ %spec.select169, %if.end62 ]
%cmp75.not178 = icmp slt i32 %spec.select, 1
br i1 %cmp75.not178, label %for.cond84.preheader, label %for.body77.preheader
for.body77.preheader: ; preds = %for.cond73.preheader
%scevgep = getelementptr inbounds i8, ptr %ans, i64 1
%7 = zext i32 %spec.select to i64
call void @llvm.memset.p0.i64(ptr nonnull align 1 %scevgep, i8 40, i64 %7, i1 false), !tbaa !9
%add85233 = add i32 %5, %spec.select
br i1 %cmp33174218, label %for.body89.preheader, label %for.cond100.preheader
for.body35: ; preds = %for.body35.preheader, %if.end62
%indvars.iv192 = phi i64 [ %1, %for.body35.preheader ], [ %indvars.iv.next193, %if.end62 ]
%rmax.0176 = phi i32 [ 0, %for.body35.preheader ], [ %spec.select169, %if.end62 ]
%arrayidx37 = getelementptr inbounds [110 x i8], ptr %s, i64 0, i64 %indvars.iv192
%8 = load i8, ptr %arrayidx37, align 1, !tbaa !9
switch i8 %8, label %for.body35.if.end62_crit_edge [
i8 41, label %if.then41
i8 40, label %if.then54
]
for.body35.if.end62_crit_edge: ; preds = %for.body35
%arrayidx64.phi.trans.insert = getelementptr inbounds [110 x i32], ptr %numright, i64 0, i64 %indvars.iv192
%.pre214 = load i32, ptr %arrayidx64.phi.trans.insert, align 4, !tbaa !5
br label %if.end62
if.then41: ; preds = %for.body35
%9 = add nuw nsw i64 %indvars.iv192, 1
%arrayidx44 = getelementptr inbounds [110 x i32], ptr %numright, i64 0, i64 %9
%10 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%sub45 = add nsw i32 %10, -1
%arrayidx47 = getelementptr inbounds [110 x i32], ptr %numright, i64 0, i64 %indvars.iv192
store i32 %sub45, ptr %arrayidx47, align 4, !tbaa !5
br label %if.end62
if.then54: ; preds = %for.body35
%11 = add nuw nsw i64 %indvars.iv192, 1
%arrayidx57 = getelementptr inbounds [110 x i32], ptr %numright, i64 0, i64 %11
%12 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%add58 = add nsw i32 %12, 1
%arrayidx60 = getelementptr inbounds [110 x i32], ptr %numright, i64 0, i64 %indvars.iv192
store i32 %add58, ptr %arrayidx60, align 4, !tbaa !5
br label %if.end62
if.end62: ; preds = %for.body35.if.end62_crit_edge, %if.then54, %if.then41
%13 = phi i32 [ %.pre214, %for.body35.if.end62_crit_edge ], [ %add58, %if.then54 ], [ %sub45, %if.then41 ]
%spec.select169 = call i32 @llvm.smax.i32(i32 %rmax.0176, i32 %13)
%indvars.iv.next193 = add nsw i64 %indvars.iv192, -1
%cmp33 = icmp sgt i64 %indvars.iv192, 1
br i1 %cmp33, label %for.body35, label %for.cond73.preheader, !llvm.loop !12
for.cond84.preheader: ; preds = %for.cond73.preheader
%add85 = add i32 %5, %spec.select
br i1 %cmp33174218, label %for.body89.preheader, label %for.cond100.preheader
for.body89.preheader: ; preds = %for.body77.preheader, %for.cond84.preheader
%add85236 = phi i32 [ %add85233, %for.body77.preheader ], [ %add85, %for.cond84.preheader ]
%14 = add nuw i32 %spec.select, 1
%15 = sext i32 %14 to i64
%scevgep200 = getelementptr i8, ptr %ans, i64 %15
%16 = zext i32 %spec.select to i64
%17 = sub nsw i64 %15, %16
%scevgep201 = getelementptr i8, ptr %s, i64 %17
%smax = call i32 @llvm.smax.i32(i32 %add85236, i32 %14)
%18 = xor i32 %spec.select, -1
%19 = add i32 %smax, %18
%20 = zext i32 %19 to i64
%21 = add nuw nsw i64 %20, 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep200, ptr noundef nonnull align 1 dereferenceable(1) %scevgep201, i64 %21, i1 false), !tbaa !9
br label %for.cond100.preheader
for.cond100.preheader: ; preds = %for.body77.preheader, %for.body89.preheader, %for.cond84.preheader
%add85232 = phi i32 [ %add85236, %for.body89.preheader ], [ %add85, %for.cond84.preheader ], [ %add85233, %for.body77.preheader ]
%cmp104183 = icmp sgt i32 %rmax.0.lcssa, 0
br i1 %cmp104183, label %for.body106.preheader, label %for.cond112.preheader
for.body106.preheader: ; preds = %for.cond100.preheader
%add102 = add i32 %rmax.0.lcssa, %add85232
%22 = add i32 %add85232, 1
%23 = sext i32 %22 to i64
%scevgep206 = getelementptr i8, ptr %ans, i64 %23
%smax207 = call i32 @llvm.smax.i32(i32 %add102, i32 %22)
%24 = xor i32 %5, -1
%25 = add i32 %smax207, %24
%26 = sub i32 %25, %spec.select
%27 = zext i32 %26 to i64
%28 = add nuw nsw i64 %27, 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep206, i8 41, i64 %28, i1 false), !tbaa !9
br label %for.cond112.preheader
for.cond112.preheader: ; preds = %entry, %for.body106.preheader, %for.cond100.preheader
%rmax.0.lcssa225230242 = phi i32 [ %rmax.0.lcssa, %for.body106.preheader ], [ %rmax.0.lcssa, %for.cond100.preheader ], [ 0, %entry ]
%lmax.0.lcssa217224231241 = phi i32 [ %spec.select, %for.body106.preheader ], [ %spec.select, %for.cond100.preheader ], [ 0, %entry ]
%29 = phi i32 [ %5, %for.body106.preheader ], [ %5, %for.cond100.preheader ], [ %0, %entry ]
%add113 = add nuw i32 %rmax.0.lcssa225230242, %lmax.0.lcssa217224231241
%add114185 = add i32 %add113, %29
%cmp116.not186 = icmp slt i32 %add114185, 1
br i1 %cmp116.not186, label %for.end125, label %for.body118
for.body118: ; preds = %for.cond112.preheader, %for.body118
%indvars.iv211 = phi i64 [ %indvars.iv.next212, %for.body118 ], [ 1, %for.cond112.preheader ]
%arrayidx120 = getelementptr inbounds [210 x i8], ptr %ans, i64 0, i64 %indvars.iv211
%30 = load i8, ptr %arrayidx120, align 1, !tbaa !9
%conv121 = sext i8 %30 to i32
%putchar = call i32 @putchar(i32 %conv121)
%indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
%31 = load i32, ptr %n, align 4, !tbaa !5
%add114 = add i32 %add113, %31
%32 = sext i32 %add114 to i64
%cmp116.not.not = icmp slt i64 %indvars.iv211, %32
br i1 %cmp116.not.not, label %for.body118, label %for.end125, !llvm.loop !13
for.end125: ; preds = %for.body118, %for.cond112.preheader
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %numright) #7
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %numleft) #7
call void @llvm.lifetime.end.p0(i64 210, ptr nonnull %ans) #7
call void @llvm.lifetime.end.p0(i64 110, ptr nonnull %s) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
(a==b&&b==c)?puts("Yes"):puts("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205433/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205433/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp1 = icmp eq i32 %1, %2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int a, b, c;
char s[100];
scanf("%d%d%d%s", &a, &b, &c, s);
if (a == b && a == c) {
printf("Yes");
} else {
printf("No");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205477/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205477/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #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 %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp1 = icmp eq i32 %0, %2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%.str.1..str.2 = select i1 %or.cond, 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 100, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main(void){
int a,c,b;
scanf("%d %d %d",&a,&b,&c);
if(a==b){
if(b==c){
if(a==c){
printf("Yes\n");
return 0;
}
}
}
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205563/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205563/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%c = 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 %c) #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, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp1 = icmp eq i32 %0, %2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #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 @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 <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))
int compare_sz_asc(const void* a, const void* b) {
return *((size_t*)a) < *((size_t*)b) ? -1 : 1;
}
int compare_sz_desc(const void* a, const void* b) {
return *((size_t*)a) > * ((size_t*)b) ? -1 : 1;
}
int compare_i64_asc(const void* a, const void* b) {
return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}
int compare_i64_desc(const void* a, const void* b) {
return *((int64_t*)a) > * ((int64_t*)b) ? -1 : 1;
}
int compare_c_asc(const void* a, const void* b) {
return *((char*)a) < *((char*)b) ? -1 : 1;
}
int compare_c_desc(const void* a, const void* b) {
return *((char*)a) > * ((char*)b) ? -1 : 1;
}
static size_t powSz(const size_t base, const size_t exp) {
if (exp == 0) {
return 1;
}
if (exp == 1) {
return base;
}
if (exp % 2 == 0) {
return powSz(base * base, exp / 2);
}
else {
return base * powSz(base, exp - 1);
}
}
static size_t comb(const size_t n, const size_t r) {
size_t result = 1;
for (size_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static uint64_t combU64(const uint64_t n, const uint64_t r) {
uint64_t result = 1;
for (uint64_t i = 0; i < r; i++) {
result *= n - i;
result /= i + 1;
}
return result;
}
static size_t gcdZu(size_t m, size_t n) {
size_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
static uint64_t gcdU64(uint64_t m, uint64_t n)
{
uint64_t temp;
while (m % n != 0) {
temp = n;
n = m % n;
m = temp;
}
return n;
}
typedef struct {
uint64_t A;
uint64_t B;
} _reward;
static _reward reward[100000];
typedef struct {
size_t idx;
}BHeap_Val;
#define BHEAP_VAL_TYPE BHeap_Val
static int _bHeap_Compare(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node) {
const uint64_t parentVal = reward[parent->idx].B;
const uint64_t nodeVal = reward[node->idx].B;
//printf("%zu %zu\n", parent->idx, node->idx);
return parentVal >= nodeVal ? -1 : 1;
}
#define BHEAP_INVALID_NODE ((size_t)100000000)
typedef struct {
BHEAP_VAL_TYPE val;
} BHeap_Node;
static struct {
size_t size;
int (*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node);
} bHeap_Info;
static BHeap_Node bHeap_Node[1 << 20];
static void bHeap_Init(int(*compare)(const BHEAP_VAL_TYPE* parent, const BHEAP_VAL_TYPE* node)) {
bHeap_Info.size = 0;
bHeap_Info.compare = compare;
}
static void bHeap_UpHeap(const size_t nodeIdx) {
if (nodeIdx == 0) {
return;
}
const size_t parentIdx = (nodeIdx + 1) / 2 - 1;
const int compareResult = bHeap_Info.compare(&(bHeap_Node[parentIdx].val), &(bHeap_Node[nodeIdx].val));
if (0 < compareResult) {
const BHEAP_VAL_TYPE tmp = bHeap_Node[parentIdx].val;
bHeap_Node[parentIdx].val = bHeap_Node[nodeIdx].val;
bHeap_Node[nodeIdx].val = tmp;
if (parentIdx != 0) {
bHeap_UpHeap(parentIdx);
}
}
}
static void bHeap_DownHeap(const size_t nodeIdx) {
if (bHeap_Info.size - 1 <= nodeIdx) {
return;
}
const size_t leftIdx = 2 * (nodeIdx + 1) - 1;
if (leftIdx < bHeap_Info.size) {
const int leftResult = bHeap_Info.compare(&(bHeap_Node[nodeIdx].val), &(bHeap_Node[leftIdx].val));
size_t swapTarget = leftResult < 0 ? BHEAP_INVALID_NODE : leftIdx;
const size_t rightIdx = leftIdx + 1;
if (rightIdx < bHeap_Info.size) {
const int rightResult = bHeap_Info.compare(&(bHeap_Node[nodeIdx].val), &(bHeap_Node[rightIdx].val));
if (swapTarget == BHEAP_INVALID_NODE) {
if (0 < rightResult) {
swapTarget = rightIdx;
}
}
else {
if (0 < rightResult) {
const int rightLeftResult = bHeap_Info.compare(&(bHeap_Node[leftIdx].val), &(bHeap_Node[rightIdx].val));
if (0 < rightLeftResult) {
swapTarget = rightIdx;
}
}
}
}
if (swapTarget != BHEAP_INVALID_NODE) {
const BHEAP_VAL_TYPE tmp = bHeap_Node[nodeIdx].val;
bHeap_Node[nodeIdx].val = bHeap_Node[swapTarget].val;
bHeap_Node[swapTarget].val = tmp;
bHeap_DownHeap(swapTarget);
}
}
}
static void bHeap_Add(const BHEAP_VAL_TYPE val) {
bHeap_Node[bHeap_Info.size].val = val;
bHeap_Info.size++;
bHeap_UpHeap(bHeap_Info.size - 1);
}
static void bHeap_RemoveTop(void) {
if (bHeap_Info.size == 0) {
return;
}
if (bHeap_Info.size == 1) {
bHeap_Info.size--;
return;
}
bHeap_Node[0].val = bHeap_Node[bHeap_Info.size - 1].val;
bHeap_Info.size--;
bHeap_DownHeap(0);
}
static BHEAP_VAL_TYPE* bHeap_GetTopVal(void) {
return bHeap_Info.size == 0 ? NULL : &(bHeap_Node[0].val);
}
static int compare_f(const void* a, const void* b) {
const _reward* aP = (_reward*)a;
const _reward* bP = (_reward*)b;
if (aP->A < bP->A) {
return -1;
}
return 1;
}
int main(void) {
char S[11];
scanf("%s", S);
S[3] = '8';
puts(S);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205707/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205707/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ult i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_sz_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp ugt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_i64_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp slt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_c_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !9
%1 = load i8, ptr %b, align 1, !tbaa !9
%cmp = icmp sgt i8 %0, %1
%cond = select i1 %cmp, i32 -1, i32 1
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%S = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%arrayidx = getelementptr inbounds [11 x i8], ptr %S, i64 0, i64 3
store i8 56, ptr %arrayidx, align 1, !tbaa !9
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %S)
call void @llvm.lifetime.end.p0(i64 11, 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) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include<stdio.h>
int main()
{
int n;
char s[10];
scanf("%s",s);
s[3]=s[3]+1;
printf("%s\n",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205794/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205794/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 3
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%add = add i8 %0, 1
store i8 %add, ptr %arrayidx, align 1, !tbaa !5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int abs(int x)
{
if (x > 0){
return (x);
}
return (-x);
}
int main()
{
int N, T, E;
int x;
int i, j;
scanf("%d %d %d", &N, &T, &E);
for (i = 0; i < N; i++){
scanf("%d", &x);
for (j = 1; x * j - T <= E; j++){
if (abs(x * j - T) <= E){
printf("%d\n", i + 1);
return (0);
}
}
}
printf("-1\n");
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205952/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205952/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @abs(i32 noundef %x) local_unnamed_addr #0 {
entry:
%retval.0 = tail call i32 @llvm.abs.i32(i32 %x, i1 true)
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%T = alloca i32, align 4
%E = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %E) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %T, ptr noundef nonnull %E)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.end11
for.body: ; preds = %entry, %for.inc9
%i.028 = phi i32 [ %inc10, %for.inc9 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr %T, align 4, !tbaa !5
%3 = load i32, ptr %E, align 4, !tbaa !5
%sub23 = sub nsw i32 %1, %2
%cmp3.not24 = icmp sgt i32 %sub23, %3
br i1 %cmp3.not24, label %for.inc9, label %for.body4
for.cond2: ; preds = %for.body4
%inc = add nuw nsw i32 %j.025, 1
%mul = mul nsw i32 %1, %inc
%sub = sub nsw i32 %mul, %2
%cmp3.not = icmp sgt i32 %sub, %3
br i1 %cmp3.not, label %for.inc9, label %for.body4, !llvm.loop !9
for.body4: ; preds = %for.body, %for.cond2
%sub26 = phi i32 [ %sub, %for.cond2 ], [ %sub23, %for.body ]
%j.025 = phi i32 [ %inc, %for.cond2 ], [ 1, %for.body ]
%4 = call i32 @llvm.abs.i32(i32 %sub26, i1 true)
%cmp7.not = icmp sgt i32 %4, %3
br i1 %cmp7.not, label %for.cond2, label %if.then
if.then: ; preds = %for.body4
%add = add nuw nsw i32 %i.028, 1
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %cleanup
for.inc9: ; preds = %for.cond2, %for.body
%inc10 = add nuw nsw i32 %i.028, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc10, %5
br i1 %cmp, label %for.body, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.inc9, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
cleanup: ; preds = %for.end11, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %E) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int three_min( int c ,int a ,int n )
{
if( c > a )
{
c = a ;
}
if( c > n )
{
return n ;
}
return c ;
}
int min_min( int c ,int a )
{
return c > a ? a : c ;
}
int main()
{
int q ;
int c ,a ,n ;
int ans ;
scanf( "%d" ,&q ) ;
int i ;
for( i = 0 ; i < q ; ++i )
{
ans = 0 ;
scanf( "%d %d %d" ,&c ,&a ,&n ) ;
if( c == 0 ) ;
else if( a > 0 )
{
int min = three_min( c ,a ,n ) ;
if( n > 0 )
{
c -= min ;
a -= min ;
n -= min ;
ans += min ;
}
if( a > 0 )
{
min = min_min( c / 2 ,a ) ;
c -= ( min * 2 ) ;
a -= min ;
ans += min ;
}
}
ans += c / 3 ;
printf( "%d\n" ,ans ) ;
}
return 0 ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205996/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205996/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @three_min(i32 noundef %c, i32 noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %c, i32 %a)
%retval.0 = tail call i32 @llvm.smin.i32(i32 %spec.select, i32 %n)
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min_min(i32 noundef %c, i32 noundef %a) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %c, i32 %a)
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%q = alloca i32, align 4
%c = alloca i32, align 4
%a = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end18
%i.035 = phi i32 [ %inc, %if.end18 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %a, ptr noundef nonnull %n)
%1 = load i32, ptr %c, align 4, !tbaa !5
%cmp2 = icmp ne i32 %1, 0
%2 = load i32, ptr %a, align 4
%cmp3 = icmp sgt i32 %2, 0
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %if.then4, label %if.end18
if.then4: ; preds = %for.body
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %3, 0
br i1 %cmp6, label %if.end, label %if.then11
if.end: ; preds = %if.then4
%spec.select.i = call i32 @llvm.smin.i32(i32 %1, i32 %2)
%retval.0.i = call i32 @llvm.smin.i32(i32 %spec.select.i, i32 %3)
%sub = sub nsw i32 %1, %retval.0.i
store i32 %sub, ptr %c, align 4, !tbaa !5
%sub8 = sub nsw i32 %2, %retval.0.i
store i32 %sub8, ptr %a, align 4, !tbaa !5
%sub9 = sub nsw i32 %3, %retval.0.i
store i32 %sub9, ptr %n, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %sub8, 0
br i1 %cmp10, label %if.then11, label %if.end18
if.then11: ; preds = %if.then4, %if.end
%ans.038 = phi i32 [ %retval.0.i, %if.end ], [ 0, %if.then4 ]
%4 = phi i32 [ %sub8, %if.end ], [ %2, %if.then4 ]
%5 = phi i32 [ %sub, %if.end ], [ %1, %if.then4 ]
%div = sdiv i32 %5, 2
%cond.i = call i32 @llvm.smin.i32(i32 %div, i32 %4)
%mul = shl nsw i32 %cond.i, 1
%sub13 = sub nsw i32 %5, %mul
store i32 %sub13, ptr %c, align 4, !tbaa !5
%sub14 = sub nsw i32 %4, %cond.i
store i32 %sub14, ptr %a, align 4, !tbaa !5
%add15 = add nsw i32 %cond.i, %ans.038
br label %if.end18
if.end18: ; preds = %if.end, %if.then11, %for.body
%6 = phi i32 [ %1, %for.body ], [ %sub13, %if.then11 ], [ %sub, %if.end ]
%ans.2 = phi i32 [ 0, %for.body ], [ %add15, %if.then11 ], [ %retval.0.i, %if.end ]
%div19 = sdiv i32 %6, 3
%add20 = add nsw i32 %div19, %ans.2
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add20)
%inc = add nuw nsw i32 %i.035, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %7
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end18, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
typedef int32_t i32;
typedef int64_t i64;
typedef uint64_t u64;
void set_at (u64 *b, i32 k) {
b[k >> 6] |= (u64) 1 << (k & 63);
}
i32 get_at (u64 *b, i32 k) {
return (b[k >> 6] >> (k & 63)) & 1;
}
int func (u64 *a, u64 *b, u64 *c, i32 l, i32 r) {
i32 i = l;
for (; i <= r && i < (l / 64 + 1) * 64; ++i) {
if (get_at (a, i) && get_at (b, i) && get_at (c, i)) {
return 1;
}
}
for (; i + 63 <= r; i += 64) {
if ((a[i / 64] & b[i / 64] & c[i / 64]) != 0) {
return 1;
}
}
for (; i <= r; ++i) {
if (get_at (a, i) && get_at (b, i) && get_at (c, i)) {
return 1;
}
}
return 0;
}
void run (void) {
i32 n;
scanf ("%" SCNi32, &n);
u64 **win = (u64 **) calloc (n, sizeof (u64 *));
for (i32 i = 0; i < n; ++i) {
win[i] = (u64 *) calloc (n / 64 + 1, sizeof (u64));
}
char *s = (char *) calloc (n + 1, sizeof (char));
for (i32 i = 1; i < n; ++i) {
scanf ("%s", s);
for (i32 j = 0; j < i; ++j) {
if (s[j] == '0') {
set_at (win[j], i);
} else {
set_at (win[i], j);
}
}
}
u64 **dpL = (u64 **) calloc (n, sizeof (u64 *));
u64 **dpR = (u64 **) calloc (n, sizeof (u64 *));
for (i32 i = 0; i < n; ++i) {
dpL[i] = (u64 *) calloc (n / 64 + 1, sizeof (u64));
set_at (dpL[i], i);
dpR[i] = (u64 *) calloc (n / 64 + 1, sizeof (u64));
set_at (dpR[i], i);
}
for (i32 len = 2; len <= n; ++len) {
for (i32 l = 0; l + len - 1 < n; ++l) {
i32 r = l + len - 1;
if (func (win[l], dpR[l + 1], dpL[r], l + 1, r)) {
set_at (dpL[r], l);
}
if (func (win[r], dpR[l], dpL[r - 1], l, r - 1)) {
set_at (dpR[l], r);
}
}
}
i32 ans = 0;
for (i32 i = 0; i < n; ++i) {
ans += get_at (dpR[0], i) & get_at (dpL[n - 1], i);
}
printf ("%" PRIi32 "\n", ans);
}
int main (void) {
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%i\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%i\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @set_at(ptr nocapture noundef %b, i32 noundef %k) local_unnamed_addr #0 {
entry:
%and = and i32 %k, 63
%sh_prom = zext i32 %and to i64
%shl = shl nuw i64 1, %sh_prom
%shr = ashr i32 %k, 6
%idxprom = sext i32 %shr to i64
%arrayidx = getelementptr inbounds i64, ptr %b, i64 %idxprom
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%or = or i64 %0, %shl
store i64 %or, ptr %arrayidx, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @get_at(ptr nocapture noundef readonly %b, i32 noundef %k) local_unnamed_addr #1 {
entry:
%shr = ashr i32 %k, 6
%idxprom = sext i32 %shr to i64
%arrayidx = getelementptr inbounds i64, ptr %b, i64 %idxprom
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%and = and i32 %k, 63
%sh_prom = zext i32 %and to i64
%shr1 = lshr i64 %0, %sh_prom
%1 = trunc i64 %shr1 to i32
%conv = and i32 %1, 1
ret i32 %conv
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @func(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b, ptr nocapture noundef readonly %c, i32 noundef %l, i32 noundef %r) local_unnamed_addr #2 {
entry:
%cmp.not110 = icmp sgt i32 %l, %r
br i1 %cmp.not110, label %for.end, label %land.rhs.lr.ph
land.rhs.lr.ph: ; preds = %entry
%div = sdiv i32 %l, 64
%add = shl nsw i32 %div, 6
%mul = add i32 %add, 64
%smax = tail call i32 @llvm.smax.i32(i32 %l, i32 %mul)
%0 = add i32 %r, 1
br label %land.rhs
land.rhs: ; preds = %land.rhs.lr.ph, %for.inc
%i.0111 = phi i32 [ %l, %land.rhs.lr.ph ], [ %inc, %for.inc ]
%exitcond.not = icmp eq i32 %i.0111, %smax
br i1 %exitcond.not, label %for.end, label %for.body
for.body: ; preds = %land.rhs
%shr.i = ashr i32 %i.0111, 6
%idxprom.i = sext i32 %shr.i to i64
%arrayidx.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.i
%1 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%and.i = and i32 %i.0111, 63
%sh_prom.i = zext i32 %and.i to i64
%2 = shl nuw i64 1, %sh_prom.i
%3 = and i64 %1, %2
%tobool.not = icmp eq i64 %3, 0
br i1 %tobool.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%arrayidx.i67 = getelementptr inbounds i64, ptr %b, i64 %idxprom.i
%4 = load i64, ptr %arrayidx.i67, align 8, !tbaa !5
%5 = and i64 %4, %2
%tobool3.not = icmp eq i64 %5, 0
br i1 %tobool3.not, label %for.inc, label %land.lhs.true4
land.lhs.true4: ; preds = %land.lhs.true
%arrayidx.i74 = getelementptr inbounds i64, ptr %c, i64 %idxprom.i
%6 = load i64, ptr %arrayidx.i74, align 8, !tbaa !5
%7 = and i64 %6, %2
%tobool6.not = icmp eq i64 %7, 0
br i1 %tobool6.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.body, %land.lhs.true, %land.lhs.true4
%inc = add i32 %i.0111, 1
%exitcond123.not = icmp eq i32 %i.0111, %r
br i1 %exitcond123.not, label %for.end, label %land.rhs, !llvm.loop !9
for.end: ; preds = %land.rhs, %for.inc, %entry
%i.0.lcssa = phi i32 [ %l, %entry ], [ %0, %for.inc ], [ %smax, %land.rhs ]
%add8113 = add nsw i32 %i.0.lcssa, 63
%cmp9.not114 = icmp sgt i32 %add8113, %r
br i1 %cmp9.not114, label %for.cond25.preheader, label %for.body10
for.cond25.preheader: ; preds = %for.inc22, %for.end
%i.1.lcssa = phi i32 [ %i.0.lcssa, %for.end ], [ %add23, %for.inc22 ]
%cmp26.not117 = icmp sgt i32 %i.1.lcssa, %r
br i1 %cmp26.not117, label %cleanup, label %for.body27
for.body10: ; preds = %for.end, %for.inc22
%i.1115 = phi i32 [ %add23, %for.inc22 ], [ %i.0.lcssa, %for.end ]
%div11 = sdiv i32 %i.1115, 64
%idxprom = sext i32 %div11 to i64
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom
%8 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx14 = getelementptr inbounds i64, ptr %b, i64 %idxprom
%9 = load i64, ptr %arrayidx14, align 8, !tbaa !5
%and = and i64 %9, %8
%arrayidx17 = getelementptr inbounds i64, ptr %c, i64 %idxprom
%10 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%and18 = and i64 %and, %10
%cmp19.not = icmp eq i64 %and18, 0
br i1 %cmp19.not, label %for.inc22, label %cleanup
for.inc22: ; preds = %for.body10
%add23 = add nsw i32 %i.1115, 64
%add8 = add nsw i32 %i.1115, 127
%cmp9.not = icmp sgt i32 %add8, %r
br i1 %cmp9.not, label %for.cond25.preheader, label %for.body10, !llvm.loop !11
for.body27: ; preds = %for.cond25.preheader, %for.inc38
%i.2118 = phi i32 [ %inc39, %for.inc38 ], [ %i.1.lcssa, %for.cond25.preheader ]
%shr.i79 = ashr i32 %i.2118, 6
%idxprom.i80 = sext i32 %shr.i79 to i64
%arrayidx.i81 = getelementptr inbounds i64, ptr %a, i64 %idxprom.i80
%11 = load i64, ptr %arrayidx.i81, align 8, !tbaa !5
%and.i82 = and i32 %i.2118, 63
%sh_prom.i83 = zext i32 %and.i82 to i64
%12 = shl nuw i64 1, %sh_prom.i83
%13 = and i64 %11, %12
%tobool29.not = icmp eq i64 %13, 0
br i1 %tobool29.not, label %for.inc38, label %land.lhs.true30
land.lhs.true30: ; preds = %for.body27
%arrayidx.i88 = getelementptr inbounds i64, ptr %b, i64 %idxprom.i80
%14 = load i64, ptr %arrayidx.i88, align 8, !tbaa !5
%15 = and i64 %14, %12
%tobool32.not = icmp eq i64 %15, 0
br i1 %tobool32.not, label %for.inc38, label %land.lhs.true33
land.lhs.true33: ; preds = %land.lhs.true30
%arrayidx.i95 = getelementptr inbounds i64, ptr %c, i64 %idxprom.i80
%16 = load i64, ptr %arrayidx.i95, align 8, !tbaa !5
%17 = and i64 %16, %12
%tobool35.not = icmp eq i64 %17, 0
br i1 %tobool35.not, label %for.inc38, label %cleanup
for.inc38: ; preds = %for.body27, %land.lhs.true30, %land.lhs.true33
%inc39 = add i32 %i.2118, 1
%exitcond124.not = icmp eq i32 %i.2118, %r
br i1 %exitcond124.not, label %cleanup, label %for.body27, !llvm.loop !12
cleanup: ; preds = %land.lhs.true4, %for.body10, %land.lhs.true33, %for.inc38, %for.cond25.preheader
%retval.0 = phi i32 [ 0, %for.cond25.preheader ], [ 1, %land.lhs.true33 ], [ 0, %for.inc38 ], [ 1, %for.body10 ], [ 1, %land.lhs.true4 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 nounwind uwtable
define dso_local void @run() local_unnamed_addr #4 {
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 !13
%conv = sext i32 %0 to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #9
%cmp308 = icmp sgt i32 %0, 0
br i1 %cmp308, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%div357366 = lshr i32 %0, 6
%add = add nuw nsw i32 %div357366, 1
%conv3 = zext i32 %add to i64
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%add5 = add nsw i32 %0, 1
%conv6 = sext i32 %add5 to i64
%call7 = call noalias ptr @calloc(i64 noundef %conv6, i64 noundef 1) #9
%cmp10311 = icmp sgt i32 %0, 1
br i1 %cmp10311, label %for.body13, label %for.cond.cleanup12
for.body: ; preds = %for.body.lr.ph, %for.body
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
%call4 = call noalias ptr @calloc(i64 noundef %conv3, i64 noundef 8) #9
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv
store ptr %call4, ptr %arrayidx, align 8, !tbaa !15
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !17
for.cond.cleanup12: ; preds = %for.cond.cleanup18, %for.cond.cleanup
%conv35.pre-phi = phi i64 [ %conv, %for.cond.cleanup ], [ %2, %for.cond.cleanup18 ]
%.lcssa = phi i32 [ %0, %for.cond.cleanup ], [ %1, %for.cond.cleanup18 ]
%call36 = call noalias ptr @calloc(i64 noundef %conv35.pre-phi, i64 noundef 8) #9
%call38 = call noalias ptr @calloc(i64 noundef %conv35.pre-phi, i64 noundef 8) #9
%cmp41313 = icmp sgt i32 %.lcssa, 0
br i1 %cmp41313, label %for.body44.lr.ph, label %for.cond.cleanup114
for.body44.lr.ph: ; preds = %for.cond.cleanup12
%div45358367 = lshr i32 %.lcssa, 6
%add46 = add nuw nsw i32 %div45358367, 1
%conv47 = zext i32 %add46 to i64
%wide.trip.count344 = zext i32 %.lcssa to i64
br label %for.body44
for.body13: ; preds = %for.cond.cleanup, %for.cond.cleanup18
%indvars.iv338 = phi i64 [ %indvars.iv.next339, %for.cond.cleanup18 ], [ 1, %for.cond.cleanup ]
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %call7)
%arrayidx28 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv338
%shr.i = lshr i64 %indvars.iv338, 6
%idxprom.i = and i64 %shr.i, 67108863
br label %for.body19
for.cond.cleanup18: ; preds = %for.inc29
%indvars.iv.next339 = add nuw nsw i64 %indvars.iv338, 1
%1 = load i32, ptr %n, align 4, !tbaa !13
%2 = sext i32 %1 to i64
%cmp10 = icmp slt i64 %indvars.iv.next339, %2
br i1 %cmp10, label %for.body13, label %for.cond.cleanup12, !llvm.loop !18
for.body19: ; preds = %for.body13, %for.inc29
%indvars.iv333 = phi i64 [ 0, %for.body13 ], [ %indvars.iv.next334, %for.inc29 ]
%arrayidx21 = getelementptr inbounds i8, ptr %call7, i64 %indvars.iv333
%3 = load i8, ptr %arrayidx21, align 1, !tbaa !19
%cmp23 = icmp eq i8 %3, 48
br i1 %cmp23, label %if.then, label %if.else
if.then: ; preds = %for.body19
%arrayidx26 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv333
%4 = load ptr, ptr %arrayidx26, align 8, !tbaa !15
%arrayidx.i = getelementptr inbounds i64, ptr %4, i64 %idxprom.i
br label %for.inc29
if.else: ; preds = %for.body19
%5 = load ptr, ptr %arrayidx28, align 8, !tbaa !15
%shr.i186 = lshr i64 %indvars.iv333, 6
%idxprom.i187 = and i64 %shr.i186, 67108863
%arrayidx.i188 = getelementptr inbounds i64, ptr %5, i64 %idxprom.i187
br label %for.inc29
for.inc29: ; preds = %if.then, %if.else
%arrayidx.i.sink365 = phi ptr [ %arrayidx.i, %if.then ], [ %arrayidx.i188, %if.else ]
%and.i.pn.in = phi i64 [ %indvars.iv338, %if.then ], [ %indvars.iv333, %if.else ]
%and.i.pn = and i64 %and.i.pn.in, 63
%shl.i.sink = shl nuw i64 1, %and.i.pn
%6 = load i64, ptr %arrayidx.i.sink365, align 8, !tbaa !5
%or.i = or i64 %6, %shl.i.sink
store i64 %or.i, ptr %arrayidx.i.sink365, align 8, !tbaa !5
%indvars.iv.next334 = add nuw nsw i64 %indvars.iv333, 1
%exitcond337.not = icmp eq i64 %indvars.iv.next334, %indvars.iv338
br i1 %exitcond337.not, label %for.cond.cleanup18, label %for.body19, !llvm.loop !20
for.cond64.preheader: ; preds = %for.body44
%cmp65.not321 = icmp slt i32 %.lcssa, 2
br i1 %cmp65.not321, label %for.cond111.preheader, label %for.cond69.preheader.preheader
for.cond69.preheader.preheader: ; preds = %for.cond64.preheader
%7 = add nuw i32 %.lcssa, 1
%wide.trip.count353 = zext i32 %7 to i64
br label %for.cond69.preheader
for.body44: ; preds = %for.body44.lr.ph, %for.body44
%indvars.iv341 = phi i64 [ 0, %for.body44.lr.ph ], [ %indvars.iv.next342, %for.body44 ]
%call48 = call noalias ptr @calloc(i64 noundef %conv47, i64 noundef 8) #9
%arrayidx50 = getelementptr inbounds ptr, ptr %call36, i64 %indvars.iv341
store ptr %call48, ptr %arrayidx50, align 8, !tbaa !15
%and.i190 = and i64 %indvars.iv341, 63
%shl.i192 = shl nuw i64 1, %and.i190
%shr.i193 = lshr i64 %indvars.iv341, 6
%idxprom.i194 = and i64 %shr.i193, 67108863
%arrayidx.i195 = getelementptr inbounds i64, ptr %call48, i64 %idxprom.i194
store i64 %shl.i192, ptr %arrayidx.i195, align 8, !tbaa !5
%call56 = call noalias ptr @calloc(i64 noundef %conv47, i64 noundef 8) #9
%arrayidx58 = getelementptr inbounds ptr, ptr %call38, i64 %indvars.iv341
store ptr %call56, ptr %arrayidx58, align 8, !tbaa !15
%arrayidx.i202 = getelementptr inbounds i64, ptr %call56, i64 %idxprom.i194
store i64 %shl.i192, ptr %arrayidx.i202, align 8, !tbaa !5
%indvars.iv.next342 = add nuw nsw i64 %indvars.iv341, 1
%exitcond345.not = icmp eq i64 %indvars.iv.next342, %wide.trip.count344
br i1 %exitcond345.not, label %for.cond64.preheader, label %for.body44, !llvm.loop !21
for.cond69.preheader: ; preds = %for.cond69.preheader.preheader, %for.cond.cleanup73
%indvars.iv350 = phi i64 [ 2, %for.cond69.preheader.preheader ], [ %indvars.iv.next351, %for.cond.cleanup73 ]
br label %for.body74
for.cond111.preheader: ; preds = %for.cond.cleanup73, %for.cond64.preheader
br i1 %cmp41313, label %for.body115.lr.ph, label %for.cond.cleanup114
for.body115.lr.ph: ; preds = %for.cond111.preheader
%8 = load ptr, ptr %call38, align 8, !tbaa !15
%sub118 = add nsw i32 %.lcssa, -1
%idxprom119 = zext i32 %sub118 to i64
%arrayidx120 = getelementptr inbounds ptr, ptr %call36, i64 %idxprom119
%9 = load ptr, ptr %arrayidx120, align 8, !tbaa !15
%min.iters.check = icmp ult i32 %.lcssa, 4
br i1 %min.iters.check, label %for.body115.preheader, label %vector.ph
vector.ph: ; preds = %for.body115.lr.ph
%n.vec = and i32 %.lcssa, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %38, %vector.body ]
%vec.phi375 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %39, %vector.body ]
%step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
%10 = lshr i32 %index, 6
%11 = lshr i32 %index, 6
%12 = zext i32 %10 to i64
%13 = zext i32 %11 to i64
%14 = getelementptr inbounds i64, ptr %8, i64 %12
%15 = getelementptr inbounds i64, ptr %8, i64 %13
%16 = load i64, ptr %14, align 8, !tbaa !5
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %16, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
%17 = load i64, ptr %15, align 8, !tbaa !5
%broadcast.splatinsert376 = insertelement <2 x i64> poison, i64 %17, i64 0
%broadcast.splat377 = shufflevector <2 x i64> %broadcast.splatinsert376, <2 x i64> poison, <2 x i32> zeroinitializer
%18 = and <2 x i32> %vec.ind, <i32 63, i32 63>
%19 = and <2 x i32> %step.add, <i32 63, i32 63>
%20 = zext <2 x i32> %18 to <2 x i64>
%21 = zext <2 x i32> %19 to <2 x i64>
%22 = lshr <2 x i64> %broadcast.splat, %20
%23 = lshr <2 x i64> %broadcast.splat377, %21
%24 = trunc <2 x i64> %22 to <2 x i32>
%25 = trunc <2 x i64> %23 to <2 x i32>
%26 = getelementptr inbounds i64, ptr %9, i64 %12
%27 = getelementptr inbounds i64, ptr %9, i64 %13
%28 = load i64, ptr %26, align 8, !tbaa !5
%broadcast.splatinsert378 = insertelement <2 x i64> poison, i64 %28, i64 0
%broadcast.splat379 = shufflevector <2 x i64> %broadcast.splatinsert378, <2 x i64> poison, <2 x i32> zeroinitializer
%29 = load i64, ptr %27, align 8, !tbaa !5
%broadcast.splatinsert380 = insertelement <2 x i64> poison, i64 %29, i64 0
%broadcast.splat381 = shufflevector <2 x i64> %broadcast.splatinsert380, <2 x i64> poison, <2 x i32> zeroinitializer
%30 = lshr <2 x i64> %broadcast.splat379, %20
%31 = lshr <2 x i64> %broadcast.splat381, %21
%32 = trunc <2 x i64> %30 to <2 x i32>
%33 = trunc <2 x i64> %31 to <2 x i32>
%34 = and <2 x i32> %24, <i32 1, i32 1>
%35 = and <2 x i32> %25, <i32 1, i32 1>
%36 = and <2 x i32> %34, %32
%37 = and <2 x i32> %35, %33
%38 = add <2 x i32> %36, %vec.phi
%39 = add <2 x i32> %37, %vec.phi375
%index.next = add nuw i32 %index, 4
%vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
%40 = icmp eq i32 %index.next, %n.vec
br i1 %40, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i32> %39, %38
%41 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %.lcssa, %n.vec
br i1 %cmp.n, label %for.cond.cleanup114, label %for.body115.preheader
for.body115.preheader: ; preds = %for.body115.lr.ph, %middle.block
%i110.0325.ph = phi i32 [ 0, %for.body115.lr.ph ], [ %n.vec, %middle.block ]
%ans.0324.ph = phi i32 [ 0, %for.body115.lr.ph ], [ %41, %middle.block ]
br label %for.body115
for.cond.cleanup73: ; preds = %if.end103
%indvars.iv.next351 = add nuw nsw i64 %indvars.iv350, 1
%exitcond354.not = icmp eq i64 %indvars.iv.next351, %wide.trip.count353
br i1 %exitcond354.not, label %for.cond111.preheader, label %for.cond69.preheader, !llvm.loop !25
for.body74: ; preds = %for.cond69.preheader, %if.end103
%indvars.iv346 = phi i64 [ 0, %for.cond69.preheader ], [ %indvars.iv.next347, %if.end103 ]
%add70317.in = phi i64 [ %indvars.iv350, %for.cond69.preheader ], [ %86, %if.end103 ]
%add70317 = trunc i64 %add70317.in to i32
%sub320 = add nsw i32 %add70317, -1
%arrayidx78 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv346
%42 = load ptr, ptr %arrayidx78, align 8, !tbaa !15
%indvars.iv.next347 = add nuw nsw i64 %indvars.iv346, 1
%arrayidx81 = getelementptr inbounds ptr, ptr %call38, i64 %indvars.iv.next347
%43 = load ptr, ptr %arrayidx81, align 8, !tbaa !15
%idxprom82 = sext i32 %sub320 to i64
%arrayidx83 = getelementptr inbounds ptr, ptr %call36, i64 %idxprom82
%44 = load ptr, ptr %arrayidx83, align 8, !tbaa !15
%cmp.not110.i.not = icmp slt i64 %indvars.iv346, %idxprom82
%45 = trunc i64 %indvars.iv.next347 to i32
br i1 %cmp.not110.i.not, label %land.rhs.lr.ph.i, label %for.end.i
land.rhs.lr.ph.i: ; preds = %for.body74
%div.i302 = and i32 %45, 2147483584
%mul.i = add nuw i32 %div.i302, 64
%smax.i = call i32 @llvm.smax.i32(i32 %45, i32 %mul.i)
br label %land.rhs.i
land.rhs.i: ; preds = %for.inc.i, %land.rhs.lr.ph.i
%i.0111.i = phi i32 [ %45, %land.rhs.lr.ph.i ], [ %inc.i, %for.inc.i ]
%exitcond.not.i = icmp eq i32 %i.0111.i, %smax.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body.i
for.body.i: ; preds = %land.rhs.i
%shr.i.i = ashr i32 %i.0111.i, 6
%idxprom.i.i = sext i32 %shr.i.i to i64
%arrayidx.i.i = getelementptr inbounds i64, ptr %42, i64 %idxprom.i.i
%46 = load i64, ptr %arrayidx.i.i, align 8, !tbaa !5
%and.i.i = and i32 %i.0111.i, 63
%sh_prom.i.i = zext i32 %and.i.i to i64
%47 = shl nuw i64 1, %sh_prom.i.i
%48 = and i64 %46, %47
%tobool.not.i = icmp eq i64 %48, 0
br i1 %tobool.not.i, label %for.inc.i, label %land.lhs.true.i
land.lhs.true.i: ; preds = %for.body.i
%arrayidx.i67.i = getelementptr inbounds i64, ptr %43, i64 %idxprom.i.i
%49 = load i64, ptr %arrayidx.i67.i, align 8, !tbaa !5
%50 = and i64 %49, %47
%tobool3.not.i = icmp eq i64 %50, 0
br i1 %tobool3.not.i, label %for.inc.i, label %land.lhs.true4.i
land.lhs.true4.i: ; preds = %land.lhs.true.i
%arrayidx.i74.i = getelementptr inbounds i64, ptr %44, i64 %idxprom.i.i
%51 = load i64, ptr %arrayidx.i74.i, align 8, !tbaa !5
%52 = and i64 %51, %47
%tobool6.not.i = icmp eq i64 %52, 0
br i1 %tobool6.not.i, label %for.inc.i, label %if.then86
for.inc.i: ; preds = %land.lhs.true4.i, %land.lhs.true.i, %for.body.i
%inc.i = add nuw i32 %i.0111.i, 1
%exitcond123.not.i = icmp eq i32 %i.0111.i, %sub320
br i1 %exitcond123.not.i, label %for.end.i, label %land.rhs.i, !llvm.loop !9
for.end.i: ; preds = %for.inc.i, %land.rhs.i, %for.body74
%i.0.lcssa.i = phi i32 [ %45, %for.body74 ], [ %smax.i, %land.rhs.i ], [ %add70317, %for.inc.i ]
%add8113.i = add nsw i32 %i.0.lcssa.i, 63
%cmp9.not114.i.not = icmp slt i32 %add8113.i, %add70317
br i1 %cmp9.not114.i.not, label %for.body10.i.preheader, label %for.cond25.preheader.i
for.body10.i.preheader: ; preds = %for.end.i
%invariant.op = add nsw i32 %add70317, -127
br label %for.body10.i
for.cond25.preheader.i: ; preds = %for.inc22.i, %for.end.i
%i.1.lcssa.i = phi i32 [ %i.0.lcssa.i, %for.end.i ], [ %add23.i, %for.inc22.i ]
%cmp26.not117.i.not = icmp slt i32 %i.1.lcssa.i, %add70317
br i1 %cmp26.not117.i.not, label %for.body27.i, label %if.end89
for.body10.i: ; preds = %for.body10.i.preheader, %for.inc22.i
%i.1115.i = phi i32 [ %add23.i, %for.inc22.i ], [ %i.0.lcssa.i, %for.body10.i.preheader ]
%div11.i = sdiv i32 %i.1115.i, 64
%idxprom.i204 = sext i32 %div11.i to i64
%arrayidx.i205 = getelementptr inbounds i64, ptr %42, i64 %idxprom.i204
%53 = load i64, ptr %arrayidx.i205, align 8, !tbaa !5
%arrayidx14.i = getelementptr inbounds i64, ptr %43, i64 %idxprom.i204
%54 = load i64, ptr %arrayidx14.i, align 8, !tbaa !5
%and.i206 = and i64 %54, %53
%arrayidx17.i = getelementptr inbounds i64, ptr %44, i64 %idxprom.i204
%55 = load i64, ptr %arrayidx17.i, align 8, !tbaa !5
%and18.i = and i64 %and.i206, %55
%cmp19.not.i = icmp eq i64 %and18.i, 0
br i1 %cmp19.not.i, label %for.inc22.i, label %if.then86
for.inc22.i: ; preds = %for.body10.i
%add23.i = add nsw i32 %i.1115.i, 64
%cmp9.not.i.not = icmp slt i32 %i.1115.i, %invariant.op
br i1 %cmp9.not.i.not, label %for.body10.i, label %for.cond25.preheader.i, !llvm.loop !11
for.body27.i: ; preds = %for.cond25.preheader.i, %for.inc38.i
%i.2118.i = phi i32 [ %inc39.i, %for.inc38.i ], [ %i.1.lcssa.i, %for.cond25.preheader.i ]
%shr.i79.i = ashr i32 %i.2118.i, 6
%idxprom.i80.i = sext i32 %shr.i79.i to i64
%arrayidx.i81.i = getelementptr inbounds i64, ptr %42, i64 %idxprom.i80.i
%56 = load i64, ptr %arrayidx.i81.i, align 8, !tbaa !5
%and.i82.i = and i32 %i.2118.i, 63
%sh_prom.i83.i = zext i32 %and.i82.i to i64
%57 = shl nuw i64 1, %sh_prom.i83.i
%58 = and i64 %57, %56
%tobool29.not.i = icmp eq i64 %58, 0
br i1 %tobool29.not.i, label %for.inc38.i, label %land.lhs.true30.i
land.lhs.true30.i: ; preds = %for.body27.i
%arrayidx.i88.i = getelementptr inbounds i64, ptr %43, i64 %idxprom.i80.i
%59 = load i64, ptr %arrayidx.i88.i, align 8, !tbaa !5
%60 = and i64 %59, %57
%tobool32.not.i = icmp eq i64 %60, 0
br i1 %tobool32.not.i, label %for.inc38.i, label %land.lhs.true33.i
land.lhs.true33.i: ; preds = %land.lhs.true30.i
%arrayidx.i95.i = getelementptr inbounds i64, ptr %44, i64 %idxprom.i80.i
%61 = load i64, ptr %arrayidx.i95.i, align 8, !tbaa !5
%62 = and i64 %61, %57
%tobool35.not.i = icmp eq i64 %62, 0
br i1 %tobool35.not.i, label %for.inc38.i, label %if.then86
for.inc38.i: ; preds = %land.lhs.true33.i, %land.lhs.true30.i, %for.body27.i
%inc39.i = add i32 %i.2118.i, 1
%exitcond124.not.i = icmp eq i32 %i.2118.i, %sub320
br i1 %exitcond124.not.i, label %if.end89, label %for.body27.i, !llvm.loop !12
if.then86: ; preds = %land.lhs.true4.i, %for.body10.i, %land.lhs.true33.i
%and.i207 = and i64 %indvars.iv346, 63
%shl.i209 = shl nuw i64 1, %and.i207
%shr.i210 = lshr i64 %indvars.iv346, 6
%idxprom.i211 = and i64 %shr.i210, 67108863
%arrayidx.i212 = getelementptr inbounds i64, ptr %44, i64 %idxprom.i211
%63 = load i64, ptr %arrayidx.i212, align 8, !tbaa !5
%or.i213 = or i64 %63, %shl.i209
store i64 %or.i213, ptr %arrayidx.i212, align 8, !tbaa !5
br label %if.end89
if.end89: ; preds = %for.inc38.i, %for.cond25.preheader.i, %if.then86
%arrayidx91 = getelementptr inbounds ptr, ptr %call1, i64 %idxprom82
%64 = load ptr, ptr %arrayidx91, align 8, !tbaa !15
%arrayidx93 = getelementptr inbounds ptr, ptr %call38, i64 %indvars.iv346
%65 = load ptr, ptr %arrayidx93, align 8, !tbaa !15
%sub94 = add nsw i32 %add70317, -2
%idxprom95 = sext i32 %sub94 to i64
%arrayidx96 = getelementptr inbounds ptr, ptr %call36, i64 %idxprom95
%66 = load ptr, ptr %arrayidx96, align 8, !tbaa !15
%cmp.not110.i214 = icmp sgt i64 %indvars.iv346, %idxprom95
%67 = trunc i64 %indvars.iv346 to i32
br i1 %cmp.not110.i214, label %for.end.i240, label %land.rhs.lr.ph.i215
land.rhs.lr.ph.i215: ; preds = %if.end89
%div.i216303 = and i32 %67, 2147483584
%mul.i218 = add nuw i32 %div.i216303, 64
%smax.i219 = call i32 @llvm.smax.i32(i32 %67, i32 %mul.i218)
br label %land.rhs.i220
land.rhs.i220: ; preds = %for.inc.i237, %land.rhs.lr.ph.i215
%i.0111.i221 = phi i32 [ %67, %land.rhs.lr.ph.i215 ], [ %inc.i238, %for.inc.i237 ]
%exitcond.not.i222 = icmp eq i32 %i.0111.i221, %smax.i219
br i1 %exitcond.not.i222, label %for.end.i240, label %for.body.i223
for.body.i223: ; preds = %land.rhs.i220
%shr.i.i224 = ashr i32 %i.0111.i221, 6
%idxprom.i.i225 = sext i32 %shr.i.i224 to i64
%arrayidx.i.i226 = getelementptr inbounds i64, ptr %64, i64 %idxprom.i.i225
%68 = load i64, ptr %arrayidx.i.i226, align 8, !tbaa !5
%and.i.i227 = and i32 %i.0111.i221, 63
%sh_prom.i.i228 = zext i32 %and.i.i227 to i64
%69 = shl nuw i64 1, %sh_prom.i.i228
%70 = and i64 %68, %69
%tobool.not.i229 = icmp eq i64 %70, 0
br i1 %tobool.not.i229, label %for.inc.i237, label %land.lhs.true.i230
land.lhs.true.i230: ; preds = %for.body.i223
%arrayidx.i67.i231 = getelementptr inbounds i64, ptr %65, i64 %idxprom.i.i225
%71 = load i64, ptr %arrayidx.i67.i231, align 8, !tbaa !5
%72 = and i64 %71, %69
%tobool3.not.i232 = icmp eq i64 %72, 0
br i1 %tobool3.not.i232, label %for.inc.i237, label %land.lhs.true4.i233
land.lhs.true4.i233: ; preds = %land.lhs.true.i230
%arrayidx.i74.i234 = getelementptr inbounds i64, ptr %66, i64 %idxprom.i.i225
%73 = load i64, ptr %arrayidx.i74.i234, align 8, !tbaa !5
%74 = and i64 %73, %69
%tobool6.not.i235 = icmp eq i64 %74, 0
br i1 %tobool6.not.i235, label %for.inc.i237, label %if.then100
for.inc.i237: ; preds = %land.lhs.true4.i233, %land.lhs.true.i230, %for.body.i223
%inc.i238 = add nuw i32 %i.0111.i221, 1
%exitcond123.not.i239 = icmp eq i32 %i.0111.i221, %sub94
br i1 %exitcond123.not.i239, label %for.end.i240, label %land.rhs.i220, !llvm.loop !9
for.end.i240: ; preds = %for.inc.i237, %land.rhs.i220, %if.end89
%i.0.lcssa.i241 = phi i32 [ %67, %if.end89 ], [ %smax.i219, %land.rhs.i220 ], [ %sub320, %for.inc.i237 ]
%add8113.i242 = add nsw i32 %i.0.lcssa.i241, 63
%cmp9.not114.i243 = icmp sgt i32 %add8113.i242, %sub94
br i1 %cmp9.not114.i243, label %for.cond25.preheader.i258, label %for.body10.i244
for.cond25.preheader.i258: ; preds = %for.inc22.i254, %for.end.i240
%i.1.lcssa.i259 = phi i32 [ %i.0.lcssa.i241, %for.end.i240 ], [ %add23.i255, %for.inc22.i254 ]
%cmp26.not117.i260 = icmp sgt i32 %i.1.lcssa.i259, %sub94
br i1 %cmp26.not117.i260, label %if.end103, label %for.body27.i261
for.body10.i244: ; preds = %for.end.i240, %for.inc22.i254
%i.1115.i245 = phi i32 [ %add23.i255, %for.inc22.i254 ], [ %i.0.lcssa.i241, %for.end.i240 ]
%div11.i246 = sdiv i32 %i.1115.i245, 64
%idxprom.i247 = sext i32 %div11.i246 to i64
%arrayidx.i248 = getelementptr inbounds i64, ptr %64, i64 %idxprom.i247
%75 = load i64, ptr %arrayidx.i248, align 8, !tbaa !5
%arrayidx14.i249 = getelementptr inbounds i64, ptr %65, i64 %idxprom.i247
%76 = load i64, ptr %arrayidx14.i249, align 8, !tbaa !5
%and.i250 = and i64 %76, %75
%arrayidx17.i251 = getelementptr inbounds i64, ptr %66, i64 %idxprom.i247
%77 = load i64, ptr %arrayidx17.i251, align 8, !tbaa !5
%and18.i252 = and i64 %and.i250, %77
%cmp19.not.i253 = icmp eq i64 %and18.i252, 0
br i1 %cmp19.not.i253, label %for.inc22.i254, label %if.then100
for.inc22.i254: ; preds = %for.body10.i244
%add23.i255 = add nsw i32 %i.1115.i245, 64
%add8.i256 = add nsw i32 %i.1115.i245, 127
%cmp9.not.i257 = icmp sgt i32 %add8.i256, %sub94
br i1 %cmp9.not.i257, label %for.cond25.preheader.i258, label %for.body10.i244, !llvm.loop !11
for.body27.i261: ; preds = %for.cond25.preheader.i258, %for.inc38.i275
%i.2118.i262 = phi i32 [ %inc39.i276, %for.inc38.i275 ], [ %i.1.lcssa.i259, %for.cond25.preheader.i258 ]
%shr.i79.i263 = ashr i32 %i.2118.i262, 6
%idxprom.i80.i264 = sext i32 %shr.i79.i263 to i64
%arrayidx.i81.i265 = getelementptr inbounds i64, ptr %64, i64 %idxprom.i80.i264
%78 = load i64, ptr %arrayidx.i81.i265, align 8, !tbaa !5
%and.i82.i266 = and i32 %i.2118.i262, 63
%sh_prom.i83.i267 = zext i32 %and.i82.i266 to i64
%79 = shl nuw i64 1, %sh_prom.i83.i267
%80 = and i64 %79, %78
%tobool29.not.i268 = icmp eq i64 %80, 0
br i1 %tobool29.not.i268, label %for.inc38.i275, label %land.lhs.true30.i269
land.lhs.true30.i269: ; preds = %for.body27.i261
%arrayidx.i88.i270 = getelementptr inbounds i64, ptr %65, i64 %idxprom.i80.i264
%81 = load i64, ptr %arrayidx.i88.i270, align 8, !tbaa !5
%82 = and i64 %81, %79
%tobool32.not.i271 = icmp eq i64 %82, 0
br i1 %tobool32.not.i271, label %for.inc38.i275, label %land.lhs.true33.i272
land.lhs.true33.i272: ; preds = %land.lhs.true30.i269
%arrayidx.i95.i273 = getelementptr inbounds i64, ptr %66, i64 %idxprom.i80.i264
%83 = load i64, ptr %arrayidx.i95.i273, align 8, !tbaa !5
%84 = and i64 %83, %79
%tobool35.not.i274 = icmp eq i64 %84, 0
br i1 %tobool35.not.i274, label %for.inc38.i275, label %if.then100
for.inc38.i275: ; preds = %land.lhs.true33.i272, %land.lhs.true30.i269, %for.body27.i261
%inc39.i276 = add i32 %i.2118.i262, 1
%exitcond124.not.i277 = icmp eq i32 %i.2118.i262, %sub94
br i1 %exitcond124.not.i277, label %if.end103, label %for.body27.i261, !llvm.loop !12
if.then100: ; preds = %land.lhs.true4.i233, %for.body10.i244, %land.lhs.true33.i272
%and.i279 = and i32 %sub320, 63
%sh_prom.i280 = zext i32 %and.i279 to i64
%shl.i281 = shl nuw i64 1, %sh_prom.i280
%shr.i282 = ashr i32 %sub320, 6
%idxprom.i283 = sext i32 %shr.i282 to i64
%arrayidx.i284 = getelementptr inbounds i64, ptr %65, i64 %idxprom.i283
%85 = load i64, ptr %arrayidx.i284, align 8, !tbaa !5
%or.i285 = or i64 %85, %shl.i281
store i64 %or.i285, ptr %arrayidx.i284, align 8, !tbaa !5
br label %if.end103
if.end103: ; preds = %for.inc38.i275, %for.cond25.preheader.i258, %if.then100
%86 = add nuw nsw i64 %indvars.iv.next347, %indvars.iv350
%cmp71.not = icmp sgt i64 %86, %conv35.pre-phi
br i1 %cmp71.not, label %for.cond.cleanup73, label %for.body74, !llvm.loop !26
for.cond.cleanup114: ; preds = %for.body115, %middle.block, %for.cond.cleanup12, %for.cond111.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond111.preheader ], [ 0, %for.cond.cleanup12 ], [ %41, %middle.block ], [ %add122, %for.body115 ]
%call126 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret void
for.body115: ; preds = %for.body115.preheader, %for.body115
%i110.0325 = phi i32 [ %inc124, %for.body115 ], [ %i110.0325.ph, %for.body115.preheader ]
%ans.0324 = phi i32 [ %add122, %for.body115 ], [ %ans.0324.ph, %for.body115.preheader ]
%shr.i286 = lshr i32 %i110.0325, 6
%idxprom.i287 = zext i32 %shr.i286 to i64
%arrayidx.i288 = getelementptr inbounds i64, ptr %8, i64 %idxprom.i287
%87 = load i64, ptr %arrayidx.i288, align 8, !tbaa !5
%and.i289 = and i32 %i110.0325, 63
%sh_prom.i290 = zext i32 %and.i289 to i64
%shr1.i = lshr i64 %87, %sh_prom.i290
%88 = trunc i64 %shr1.i to i32
%arrayidx.i293 = getelementptr inbounds i64, ptr %9, i64 %idxprom.i287
%89 = load i64, ptr %arrayidx.i293, align 8, !tbaa !5
%shr1.i296 = lshr i64 %89, %sh_prom.i290
%90 = trunc i64 %shr1.i296 to i32
%conv.i297 = and i32 %88, 1
%and = and i32 %conv.i297, %90
%add122 = add nuw nsw i32 %and, %ans.0324
%inc124 = add nuw nsw i32 %i110.0325, 1
%exitcond355.not = icmp eq i32 %inc124, %.lcssa
br i1 %exitcond355.not, label %for.cond.cleanup114, label %for.body115, !llvm.loop !27
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
tail call void @run()
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !23, !24}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10, !24, !23}
|
#include <stdio.h>
int main(void) {
int prog[1000000];
int i,j,k;
int a,d,n;
for(i=2;i<1000000;i++)
prog[i] = 1;
for(j=2;j*j<1000000;j++){
for(k=j*j;k<1000000;k=k+j)
prog[k] = 0;
}
while(1){
scanf("%d %d %d",&a,&d,&n);
if(!a && !d && !n)
break;
int x,y,z=0;
for(x=a;z!=n;x=x+d){
if(prog[x] == 1)
z++;
y=x;
}
printf("%d\n",y);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206089/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206089/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%prog = alloca [1000000 x i32], align 16
%a = alloca i32, align 4
%d = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %prog) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
br label %vector.body
vector.body: ; preds = %vector.body.3, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.3, %vector.body.3 ]
%offset.idx = or i64 %index, 2
%0 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 %offset.idx
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %1, align 8, !tbaa !5
%offset.idx.1 = or i64 %index, 10
%2 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 %offset.idx.1
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %2, align 8, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 8, !tbaa !5
%offset.idx.2 = or i64 %index, 18
%4 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 %offset.idx.2
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 8, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %5, align 8, !tbaa !5
%6 = icmp eq i64 %index, 999968
br i1 %6, label %for.body, label %vector.body.3, !llvm.loop !9
vector.body.3: ; preds = %vector.body
%offset.idx.3 = or i64 %index, 26
%7 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 %offset.idx.3
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 8, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 8, !tbaa !5
%index.next.3 = add nuw nsw i64 %index, 32
br label %vector.body
for.body: ; preds = %vector.body
%arrayidx = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 999994
store i32 1, ptr %arrayidx, align 8, !tbaa !5
%arrayidx.1 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 999995
store i32 1, ptr %arrayidx.1, align 4, !tbaa !5
%arrayidx.2 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 999996
store i32 1, ptr %arrayidx.2, align 16, !tbaa !5
%arrayidx.3 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 999997
store i32 1, ptr %arrayidx.3, align 4, !tbaa !5
%arrayidx.4 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 999998
store i32 1, ptr %arrayidx.4, align 8, !tbaa !5
%arrayidx.5 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 999999
store i32 1, ptr %arrayidx.5, align 4, !tbaa !5
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.inc12.1, %for.body
%indvars.iv59 = phi i64 [ 2, %for.body ], [ %indvars.iv.next60.1, %for.inc12.1 ]
%mul47 = phi i64 [ 4, %for.body ], [ %mul.1, %for.inc12.1 ]
%9 = and i64 %mul47, 4294967295
br label %for.body7
while.cond.preheader: ; preds = %for.inc12.1
%call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d, ptr noundef nonnull %n)
%10 = load i32, ptr %a, align 4, !tbaa !5
%tobool52 = icmp ne i32 %10, 0
%11 = load i32, ptr %d, align 4
%tobool1553 = icmp ne i32 %11, 0
%or.cond54 = select i1 %tobool52, i1 true, i1 %tobool1553
%12 = load i32, ptr %n, align 4
%tobool1755 = icmp ne i32 %12, 0
%or.cond3156 = select i1 %or.cond54, i1 true, i1 %tobool1755
br i1 %or.cond3156, label %for.cond18.preheader, label %while.end
for.body7: ; preds = %for.cond5.preheader, %for.body7
%indvars.iv61 = phi i64 [ %9, %for.cond5.preheader ], [ %indvars.iv.next62, %for.body7 ]
%arrayidx9 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 %indvars.iv61
store i32 0, ptr %arrayidx9, align 4, !tbaa !5
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, %indvars.iv59
%cmp6 = icmp ult i64 %indvars.iv.next62, 1000000
br i1 %cmp6, label %for.body7, label %for.inc12, !llvm.loop !13
for.inc12: ; preds = %for.body7
%indvars.iv.next60 = or i64 %indvars.iv59, 1
%mul = mul i64 %indvars.iv.next60, %indvars.iv.next60
%13 = and i64 %mul, 4294967295
br label %for.body7.1
for.body7.1: ; preds = %for.body7.1, %for.inc12
%indvars.iv61.1 = phi i64 [ %13, %for.inc12 ], [ %indvars.iv.next62.1, %for.body7.1 ]
%arrayidx9.1 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 %indvars.iv61.1
store i32 0, ptr %arrayidx9.1, align 4, !tbaa !5
%indvars.iv.next62.1 = add nuw nsw i64 %indvars.iv61.1, %indvars.iv.next60
%cmp6.1 = icmp ult i64 %indvars.iv.next62.1, 1000000
br i1 %cmp6.1, label %for.body7.1, label %for.inc12.1, !llvm.loop !13
for.inc12.1: ; preds = %for.body7.1
%indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59, 2
%mul.1 = mul i64 %indvars.iv.next60.1, %indvars.iv.next60.1
%exitcond65.not.1 = icmp eq i64 %indvars.iv.next60.1, 1000
br i1 %exitcond65.not.1, label %while.cond.preheader, label %for.cond5.preheader, !llvm.loop !14
for.cond18.preheader: ; preds = %while.cond.preheader, %for.end29
%14 = phi i32 [ %23, %for.end29 ], [ %12, %while.cond.preheader ]
%15 = phi i32 [ %22, %for.end29 ], [ %11, %while.cond.preheader ]
%16 = phi i32 [ %21, %for.end29 ], [ %10, %while.cond.preheader ]
%y.057 = phi i32 [ %y.1.lcssa, %for.end29 ], [ undef, %while.cond.preheader ]
%cmp19.not48 = icmp eq i32 %14, 0
br i1 %cmp19.not48, label %for.end29, label %for.body20.preheader
for.body20.preheader: ; preds = %for.cond18.preheader
%17 = sext i32 %16 to i64
%18 = sext i32 %15 to i64
br label %for.body20
for.body20: ; preds = %for.body20.preheader, %for.body20
%indvars.iv66 = phi i64 [ %17, %for.body20.preheader ], [ %indvars.iv.next67, %for.body20 ]
%z.050 = phi i32 [ 0, %for.body20.preheader ], [ %spec.select, %for.body20 ]
%arrayidx22 = getelementptr inbounds [1000000 x i32], ptr %prog, i64 0, i64 %indvars.iv66
%19 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp eq i32 %19, 1
%inc25 = zext i1 %cmp23 to i32
%spec.select = add nuw nsw i32 %z.050, %inc25
%indvars.iv.next67 = add i64 %indvars.iv66, %18
%cmp19.not = icmp eq i32 %spec.select, %14
br i1 %cmp19.not, label %for.end29.loopexit, label %for.body20, !llvm.loop !15
for.end29.loopexit: ; preds = %for.body20
%20 = trunc i64 %indvars.iv66 to i32
br label %for.end29
for.end29: ; preds = %for.end29.loopexit, %for.cond18.preheader
%y.1.lcssa = phi i32 [ %y.057, %for.cond18.preheader ], [ %20, %for.end29.loopexit ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d, ptr noundef nonnull %n)
%21 = load i32, ptr %a, align 4, !tbaa !5
%tobool = icmp ne i32 %21, 0
%22 = load i32, ptr %d, align 4
%tobool15 = icmp ne i32 %22, 0
%or.cond = select i1 %tobool, i1 true, i1 %tobool15
%23 = load i32, ptr %n, align 4
%tobool17 = icmp ne i32 %23, 0
%or.cond31 = select i1 %or.cond, i1 true, i1 %tobool17
br i1 %or.cond31, label %for.cond18.preheader, label %while.end
while.end: ; preds = %for.end29, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %prog) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
#define NUM_MAX 100000
int get_str(char *str, int size)
{
char format[100];
if (size == 0)
return 0;
snprintf(format, sizeof(format), "%%%ds", size);
scanf(format, str);
return 0;
}
int main(void) {
static char str[NUM_MAX];
get_str(str, NUM_MAX);
int len = strlen(str);
int i;
int point = 0;
int pa = 0;
for(i = 1; i < len; i++) {
char cur = str[i];
int gu = i-pa;
if(cur == 'g') {
if(gu > pa) {
pa++; point++;
}
} else {
if(gu <= pa) {
// AtCodeer takes gu only
point--;
} else {
// aiko
pa++;
}
}
#ifdef DEBUG
printf("round #%d -> %d %d\n", i+1, pa, point);
#endif
}
printf("%d\n", point);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206131/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206131/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%%%ds\00", align 1
@main.str = internal global [100000 x i8] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @get_str(ptr noundef %str, i32 noundef %size) local_unnamed_addr #0 {
entry:
%format = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %format) #4
%cmp = icmp eq i32 %size, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%call = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %format, i64 noundef 100, ptr noundef nonnull @.str, i32 noundef %size) #4
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull %format, ptr noundef %str)
br label %cleanup
cleanup: ; preds = %entry, %if.end
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %format) #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 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%format.i = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %format.i) #4
%call.i = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %format.i, i64 noundef 100, ptr noundef nonnull @.str, i32 noundef 100000) #4
%call2.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull %format.i, ptr noundef nonnull @main.str)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %format.i) #4
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @main.str) #5
%conv = trunc i64 %call1 to i32
%cmp29 = icmp sgt i32 %conv, 1
br i1 %cmp29, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call1, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %if.end16
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %if.end16 ]
%point.031 = phi i32 [ 0, %for.body.preheader ], [ %point.1, %if.end16 ]
%pa.030 = phi i32 [ 0, %for.body.preheader ], [ %pa.1, %if.end16 ]
%arrayidx = getelementptr inbounds [100000 x i8], ptr @main.str, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%1 = trunc i64 %indvars.iv to i32
%sub = sub nsw i32 %1, %pa.030
%cmp4 = icmp eq i8 %0, 103
%cmp6 = icmp sgt i32 %sub, %pa.030
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %for.body
br i1 %cmp6, label %if.then8, label %if.end16
if.then8: ; preds = %if.then
%inc = add nsw i32 %pa.030, 1
%inc9 = add nsw i32 %point.031, 1
br label %if.end16
if.else: ; preds = %for.body
br i1 %cmp6, label %if.else13, label %if.then12
if.then12: ; preds = %if.else
%dec = add nsw i32 %point.031, -1
br label %if.end16
if.else13: ; preds = %if.else
%inc14 = add nsw i32 %pa.030, 1
br label %if.end16
if.end16: ; preds = %if.then12, %if.else13, %if.then, %if.then8
%pa.1 = phi i32 [ %inc, %if.then8 ], [ %pa.030, %if.then ], [ %pa.030, %if.then12 ], [ %inc14, %if.else13 ]
%point.1 = phi i32 [ %inc9, %if.then8 ], [ %point.031, %if.then ], [ %dec, %if.then12 ], [ %point.031, %if.else13 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %if.end16, %entry
%point.0.lcssa = phi i32 [ 0, %entry ], [ %point.1, %if.end16 ]
%call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %point.0.lcssa)
ret i32 0
}
; 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int ta[10010],to[60010],nt[60010];
int id[10010],rid[10010],cmp[100010],r=0,f[10010]={0};
void sdfs(int e,int s,int k){
int i;
f[s]++;
for(i=ta[s];i+1;i=nt[i]){
if(i<e&&k<0&&f[to[i]]==0||i>=e&&k>=0&&f[to[i]]==1)sdfs(e,to[i],k);
}
k<0?(id[rid[s]=r++]=s):(cmp[s]=k);
}
void scc(int v,int e,int *a,int *b){
int i,k;
for(i=0;i<v;i++)ta[i]=-1;
for(i=0;i<e;i++){
nt[i ]=ta[to[i+e]=a[i]];
nt[i+e]=ta[to[i ]=b[i]];
ta[a[i]]=i;
ta[b[i]]=i+e;
}
for(i=k=0;i<v;i++){
if(f[i]==0)sdfs(e,i,-1);
}
for(i=r;i;i--){
if(f[id[i-1]]==1)sdfs(e,id[i-1],id[i-1]);
}
}
int main(){
int v,e,a[100010],b[100010],s,t,i;
scanf("%d %d",&v,&e);
for(i=0;i<e;i++)scanf("%d %d",&a[i],&b[i]);
scc(v,e,a,b);
scanf("%d",&v);
while(v--){
scanf("%d %d",&s,&t);
printf("%d\n",cmp[s]-cmp[t]?0:1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206175/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206175/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@r = dso_local local_unnamed_addr global i32 0, align 4
@f = dso_local local_unnamed_addr global [10010 x i32] zeroinitializer, align 16
@ta = dso_local local_unnamed_addr global [10010 x i32] zeroinitializer, align 16
@to = dso_local local_unnamed_addr global [60010 x i32] zeroinitializer, align 16
@nt = dso_local local_unnamed_addr global [60010 x i32] zeroinitializer, align 16
@id = dso_local local_unnamed_addr global [10010 x i32] zeroinitializer, align 16
@rid = dso_local local_unnamed_addr global [10010 x i32] zeroinitializer, align 16
@cmp = dso_local local_unnamed_addr global [100010 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @sdfs(i32 noundef %e, i32 noundef %s, i32 noundef %k) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %s to i64
%arrayidx = getelementptr inbounds [10010 x i32], ptr @f, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom
%i.051 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%tobool.not52 = icmp eq i32 %i.051, -1
br i1 %tobool.not52, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%cmp3 = icmp slt i32 %k, 0
br i1 %cmp3, label %for.body, label %for.body.us
for.body.us: ; preds = %for.body.lr.ph, %for.inc.us
%i.053.us = phi i32 [ %i.0.us, %for.inc.us ], [ %i.051, %for.body.lr.ph ]
%cmp10.us.not = icmp slt i32 %i.053.us, %e
%.pre72 = sext i32 %i.053.us to i64
br i1 %cmp10.us.not, label %for.inc.us, label %land.lhs.true13.us
land.lhs.true13.us: ; preds = %for.body.us
%arrayidx15.us = getelementptr inbounds [60010 x i32], ptr @to, i64 0, i64 %.pre72
%1 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5
%idxprom16.us = sext i32 %1 to i64
%arrayidx17.us = getelementptr inbounds [10010 x i32], ptr @f, i64 0, i64 %idxprom16.us
%2 = load i32, ptr %arrayidx17.us, align 4, !tbaa !5
%cmp18.us = icmp eq i32 %2, 1
br i1 %cmp18.us, label %if.then.us, label %for.inc.us
if.then.us: ; preds = %land.lhs.true13.us
tail call void @sdfs(i32 noundef %e, i32 noundef %1, i32 noundef %k)
br label %for.inc.us
for.inc.us: ; preds = %for.body.us, %if.then.us, %land.lhs.true13.us
%arrayidx22.us = getelementptr inbounds [60010 x i32], ptr @nt, i64 0, i64 %.pre72
%i.0.us = load i32, ptr %arrayidx22.us, align 4, !tbaa !5
%tobool.not.us = icmp eq i32 %i.0.us, -1
br i1 %tobool.not.us, label %for.end, label %for.body.us, !llvm.loop !9
for.body: ; preds = %for.body.lr.ph, %for.inc
%i.053 = phi i32 [ %i.0, %for.inc ], [ %i.051, %for.body.lr.ph ]
%cmp = icmp slt i32 %i.053, %e
%idxprom5 = sext i32 %i.053 to i64
br i1 %cmp, label %land.lhs.true4, label %for.inc
land.lhs.true4: ; preds = %for.body
%arrayidx6 = getelementptr inbounds [60010 x i32], ptr @to, i64 0, i64 %idxprom5
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%idxprom7 = sext i32 %3 to i64
%arrayidx8 = getelementptr inbounds [10010 x i32], ptr @f, i64 0, i64 %idxprom7
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %4, 0
br i1 %cmp9, label %if.then, label %for.inc
if.then: ; preds = %land.lhs.true4
tail call void @sdfs(i32 noundef %e, i32 noundef %3, i32 noundef %k)
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true4, %if.then
%arrayidx22 = getelementptr inbounds [60010 x i32], ptr @nt, i64 0, i64 %idxprom5
%i.0 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%tobool.not = icmp eq i32 %i.0, -1
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc.us, %for.inc, %entry
%cmp23 = icmp slt i32 %k, 0
br i1 %cmp23, label %cond.true, label %cond.false
cond.true: ; preds = %for.end
%5 = load i32, ptr @r, align 4, !tbaa !5
%inc24 = add nsw i32 %5, 1
store i32 %inc24, ptr @r, align 4, !tbaa !5
%arrayidx26 = getelementptr inbounds [10010 x i32], ptr @rid, i64 0, i64 %idxprom
store i32 %5, ptr %arrayidx26, align 4, !tbaa !5
%idxprom27 = sext i32 %5 to i64
%arrayidx28 = getelementptr inbounds [10010 x i32], ptr @id, i64 0, i64 %idxprom27
store i32 %s, ptr %arrayidx28, align 4, !tbaa !5
br label %cond.end
cond.false: ; preds = %for.end
%arrayidx30 = getelementptr inbounds [100010 x i32], ptr @cmp, i64 0, i64 %idxprom
store i32 %k, ptr %arrayidx30, align 4, !tbaa !5
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
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 @scc(i32 noundef %v, i32 noundef %e, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
entry:
%cmp90 = icmp sgt i32 %v, 0
br i1 %cmp90, label %for.body.preheader, label %for.cond1.preheader
for.body.preheader: ; preds = %entry
%0 = zext i32 %v to i64
%1 = shl nuw nsw i64 %0, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @ta, i8 -1, i64 %1, i1 false), !tbaa !5
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.body.preheader, %entry
%cmp292 = icmp sgt i32 %e, 0
br i1 %cmp292, label %for.body3.preheader, label %for.cond33.preheader
for.body3.preheader: ; preds = %for.cond1.preheader
%2 = zext i32 %e to i64
%wide.trip.count = zext i32 %e to i64
br label %for.body3
for.cond33.preheader: ; preds = %for.body3, %for.cond1.preheader
br i1 %cmp90, label %for.body35.preheader, label %for.end41
for.body35.preheader: ; preds = %for.cond33.preheader
%wide.trip.count104 = zext i32 %v to i64
br label %for.body35
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.body3 ]
%arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%4 = add nuw nsw i64 %indvars.iv, %2
%arrayidx7 = getelementptr inbounds [60010 x i32], ptr @to, i64 0, i64 %4
store i32 %3, ptr %arrayidx7, align 4, !tbaa !5
%idxprom8 = sext i32 %3 to i64
%arrayidx9 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [60010 x i32], ptr @nt, i64 0, i64 %indvars.iv
store i32 %5, ptr %arrayidx11, align 4, !tbaa !5
%arrayidx13 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv
%6 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%arrayidx15 = getelementptr inbounds [60010 x i32], ptr @to, i64 0, i64 %indvars.iv
store i32 %6, ptr %arrayidx15, align 4, !tbaa !5
%idxprom16 = sext i32 %6 to i64
%arrayidx17 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom16
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx20 = getelementptr inbounds [60010 x i32], ptr @nt, i64 0, i64 %4
store i32 %7, ptr %arrayidx20, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%idxprom23 = sext i32 %8 to i64
%arrayidx24 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom23
%9 = trunc i64 %indvars.iv to i32
store i32 %9, ptr %arrayidx24, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%idxprom28 = sext i32 %10 to i64
%arrayidx29 = getelementptr inbounds [10010 x i32], ptr @ta, i64 0, i64 %idxprom28
%11 = trunc i64 %4 to i32
store i32 %11, ptr %arrayidx29, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond33.preheader, label %for.body3, !llvm.loop !11
for.body35: ; preds = %for.body35.preheader, %for.inc39
%indvars.iv101 = phi i64 [ 0, %for.body35.preheader ], [ %indvars.iv.next102, %for.inc39 ]
%arrayidx37 = getelementptr inbounds [10010 x i32], ptr @f, i64 0, i64 %indvars.iv101
%12 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%cmp38 = icmp eq i32 %12, 0
br i1 %cmp38, label %if.then, label %for.inc39
if.then: ; preds = %for.body35
%13 = trunc i64 %indvars.iv101 to i32
tail call void @sdfs(i32 noundef %e, i32 noundef %13, i32 noundef -1)
br label %for.inc39
for.inc39: ; preds = %for.body35, %if.then
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%exitcond105.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count104
br i1 %exitcond105.not, label %for.end41, label %for.body35, !llvm.loop !12
for.end41: ; preds = %for.inc39, %for.cond33.preheader
%14 = load i32, ptr @r, align 4, !tbaa !5
%tobool.not96 = icmp eq i32 %14, 0
br i1 %tobool.not96, label %for.end58, label %for.body43.preheader
for.body43.preheader: ; preds = %for.end41
%15 = sext i32 %14 to i64
br label %for.body43
for.body43: ; preds = %for.body43.preheader, %for.inc57
%indvars.iv106 = phi i64 [ %15, %for.body43.preheader ], [ %indvars.iv.next107, %for.inc57 ]
%indvars.iv.next107 = add nsw i64 %indvars.iv106, -1
%arrayidx45 = getelementptr inbounds [10010 x i32], ptr @id, i64 0, i64 %indvars.iv.next107
%16 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%idxprom46 = sext i32 %16 to i64
%arrayidx47 = getelementptr inbounds [10010 x i32], ptr @f, i64 0, i64 %idxprom46
%17 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%cmp48 = icmp eq i32 %17, 1
br i1 %cmp48, label %if.then49, label %for.inc57
if.then49: ; preds = %for.body43
tail call void @sdfs(i32 noundef %e, i32 noundef %16, i32 noundef %16)
br label %for.inc57
for.inc57: ; preds = %for.body43, %if.then49
%18 = and i64 %indvars.iv.next107, 4294967295
%tobool.not = icmp eq i64 %18, 0
br i1 %tobool.not, label %for.end58, label %for.body43, !llvm.loop !13
for.end58: ; preds = %for.inc57, %for.end41
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%v = alloca i32, align 4
%e = alloca i32, align 4
%a = alloca [100010 x i32], align 16
%b = alloca [100010 x i32], align 16
%s = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #6
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v, ptr noundef nonnull %e)
%0 = load i32, ptr %e, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, 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 [100010 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100010 x i32], ptr %b, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %e, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
%3 = load i32, ptr %v, align 4, !tbaa !5
call void @scc(i32 noundef %3, i32 noundef %.lcssa, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v)
%4 = load i32, ptr %v, align 4, !tbaa !5
%dec18 = add nsw i32 %4, -1
store i32 %dec18, ptr %v, align 4, !tbaa !5
%tobool.not19 = icmp eq i32 %4, 0
br i1 %tobool.not19, label %while.end, label %while.body
while.body: ; preds = %for.end, %while.body
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%5 = load i32, ptr %s, align 4, !tbaa !5
%idxprom7 = sext i32 %5 to i64
%arrayidx8 = getelementptr inbounds [100010 x i32], ptr @cmp, i64 0, i64 %idxprom7
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%7 = load i32, ptr %t, align 4, !tbaa !5
%idxprom9 = sext i32 %7 to i64
%arrayidx10 = getelementptr inbounds [100010 x i32], ptr @cmp, i64 0, i64 %idxprom9
%8 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%tobool11.not = icmp eq i32 %6, %8
%cond = zext i1 %tobool11.not to i32
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cond)
%9 = load i32, ptr %v, align 4, !tbaa !5
%dec = add nsw i32 %9, -1
store i32 %dec, ptr %v, align 4, !tbaa !5
%tobool.not = icmp eq i32 %9, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main()
{
int L;
double a;
scanf("%d",&L);
a= L/3.0;
printf("%lf",a*a*a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206247/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206247/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L)
%0 = load i32, ptr %L, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%div = fdiv double %conv, 3.000000e+00
%mul = fmul double %div, %div
%mul1 = fmul double %div, %mul
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #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()
{
double L, vol, a;
scanf("%lf", &L);
a = L / 3.;
vol = a * a * a;
printf("%.12lf", vol);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206290/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206290/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.12lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %L) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L)
%0 = load double, ptr %L, align 8, !tbaa !5
%div = fdiv double %0, 3.000000e+00
%mul = fmul double %div, %div
%mul1 = fmul double %div, %mul
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %L) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
double l;
scanf("%lf",&l);
printf("%9.6f\n",l * l * l / 27);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206333/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206333/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%9.6f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%0 = load double, ptr %l, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %0, %mul
%div = fdiv double %mul1, 2.700000e+01
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
double V;
scanf("%d",&a);
V=(double)(a*a*a)/27;
printf("%lf",V);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206377/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206377/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%conv = sitofp i32 %mul1 to double
%div = fdiv double %conv, 2.700000e+01
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div)
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>
#include<string.h>
#define M 1000005
#define A 100005
typedef long long (ll);
char s[60][60],t[5];
ll x[31625],y[15820],z[A];
int main()
{
ll a,b,c,d,e,f,g,h,i,j,k,l,m,n,o;
scanf("%lli",&a);
for(;a;a--)
{
scanf("%lli",&d);
scanf("%lli%lli%lli",&e,&f,&g);
for(h=0;h<d;h++)
scanf("%s",s[h]);
i=-1;
for(h=0;h<d;h++){
for(j=0;j<e;j++){
if(s[h][j]=='B')
{
i=2;
break;
}
}
if (i==2)break;
}
if(i==2){
if(s[f-1][g-1]=='B')i=0;
else {
for (h=0;h<d;h++){
if(s[h][g-1]=='B'){
i=1;
break;
}
}
if(i==2){
for(h=0;h<e;h++){
if(s[f-1][h]=='B'){
i=1;
break;
}
}
}
}
}
printf("%lli",i);
printf("\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20642/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20642/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lli\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%lli%lli%lli\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@s = dso_local global [60 x [60 x i8]] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [5 x i8] zeroinitializer, align 1
@x = dso_local local_unnamed_addr global [31625 x i64] zeroinitializer, align 16
@y = dso_local local_unnamed_addr global [15820 x i64] zeroinitializer, align 16
@z = dso_local local_unnamed_addr global [100005 x i64] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%d = alloca i64, align 8
%e = alloca i64, align 8
%f = alloca i64, align 8
%g = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %e) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %f) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %g) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%.pr = load i64, ptr %a, align 8, !tbaa !5
%tobool.not110 = icmp eq i64 %.pr, 0
br i1 %tobool.not110, label %for.end75, label %for.body
for.body: ; preds = %entry, %if.end71
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e, ptr noundef nonnull %f, ptr noundef nonnull %g)
%0 = load i64, ptr %d, align 8, !tbaa !5
%cmp98 = icmp sgt i64 %0, 0
br i1 %cmp98, label %for.body4, label %if.end71
for.cond6.preheader: ; preds = %for.body4
%cmp7102 = icmp sgt i64 %6, 0
br i1 %cmp7102, label %for.cond9.preheader.lr.ph, label %if.end71
for.cond9.preheader.lr.ph: ; preds = %for.cond6.preheader
%1 = load i64, ptr %e, align 8, !tbaa !5
%cmp10100 = icmp sgt i64 %1, 0
br i1 %cmp10100, label %for.cond9.preheader.us, label %if.end71
for.cond9.preheader.us: ; preds = %for.cond9.preheader.lr.ph, %for.cond9.for.inc23_crit_edge.us
%h.1103.us = phi i64 [ %inc24.us, %for.cond9.for.inc23_crit_edge.us ], [ 0, %for.cond9.preheader.lr.ph ]
br label %for.body11.us
for.cond9.us: ; preds = %for.body11.us
%inc17.us = add nuw nsw i64 %j.0101.us, 1
%exitcond.not = icmp eq i64 %inc17.us, %1
br i1 %exitcond.not, label %for.cond9.for.inc23_crit_edge.us, label %for.body11.us, !llvm.loop !9
for.body11.us: ; preds = %for.cond9.preheader.us, %for.cond9.us
%j.0101.us = phi i64 [ 0, %for.cond9.preheader.us ], [ %inc17.us, %for.cond9.us ]
%arrayidx13.us = getelementptr inbounds [60 x [60 x i8]], ptr @s, i64 0, i64 %h.1103.us, i64 %j.0101.us
%2 = load i8, ptr %arrayidx13.us, align 1, !tbaa !11
%cmp14.us = icmp eq i8 %2, 66
br i1 %cmp14.us, label %if.then28.split.us, label %for.cond9.us
for.cond9.for.inc23_crit_edge.us: ; preds = %for.cond9.us
%inc24.us = add nuw nsw i64 %h.1103.us, 1
%exitcond115.not = icmp eq i64 %inc24.us, %6
br i1 %exitcond115.not, label %if.end71, label %for.cond9.preheader.us, !llvm.loop !12
if.then28.split.us: ; preds = %for.body11.us
%3 = load i64, ptr %f, align 8, !tbaa !5
%sub = add nsw i64 %3, -1
%4 = load i64, ptr %g, align 8, !tbaa !5
%sub30 = add nsw i64 %4, -1
%arrayidx31 = getelementptr inbounds [60 x [60 x i8]], ptr @s, i64 0, i64 %sub, i64 %sub30
%5 = load i8, ptr %arrayidx31, align 1, !tbaa !11
%cmp33 = icmp eq i8 %5, 66
br i1 %cmp33, label %if.end71, label %for.body39
for.body4: ; preds = %for.body, %for.body4
%h.099 = phi i64 [ %inc, %for.body4 ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds [60 x [60 x i8]], ptr @s, i64 0, i64 %h.099
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %h.099, 1
%6 = load i64, ptr %d, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %6
br i1 %cmp, label %for.body4, label %for.cond6.preheader, !llvm.loop !13
for.cond36: ; preds = %for.body39
%inc49 = add nuw nsw i64 %h.2105, 1
%exitcond116.not = icmp eq i64 %inc49, %6
br i1 %exitcond116.not, label %for.body57, label %for.body39, !llvm.loop !14
for.body39: ; preds = %if.then28.split.us, %for.cond36
%h.2105 = phi i64 [ %inc49, %for.cond36 ], [ 0, %if.then28.split.us ]
%arrayidx42 = getelementptr inbounds [60 x [60 x i8]], ptr @s, i64 0, i64 %h.2105, i64 %sub30
%7 = load i8, ptr %arrayidx42, align 1, !tbaa !11
%cmp44 = icmp eq i8 %7, 66
br i1 %cmp44, label %if.end71, label %for.cond36
for.cond54: ; preds = %for.body57
%inc67 = add nuw nsw i64 %h.3107, 1
%exitcond117.not = icmp eq i64 %inc67, %1
br i1 %exitcond117.not, label %if.end71, label %for.body57, !llvm.loop !15
for.body57: ; preds = %for.cond36, %for.cond54
%h.3107 = phi i64 [ %inc67, %for.cond54 ], [ 0, %for.cond36 ]
%arrayidx60 = getelementptr inbounds [60 x [60 x i8]], ptr @s, i64 0, i64 %sub, i64 %h.3107
%8 = load i8, ptr %arrayidx60, align 1, !tbaa !11
%cmp62 = icmp eq i8 %8, 66
br i1 %cmp62, label %if.end71, label %for.cond54
if.end71: ; preds = %for.cond9.for.inc23_crit_edge.us, %for.body39, %for.cond54, %for.body57, %for.body, %for.cond9.preheader.lr.ph, %for.cond6.preheader, %if.then28.split.us
%i.4 = phi i64 [ 0, %if.then28.split.us ], [ -1, %for.cond6.preheader ], [ -1, %for.cond9.preheader.lr.ph ], [ -1, %for.body ], [ 2, %for.cond54 ], [ 1, %for.body57 ], [ 1, %for.body39 ], [ -1, %for.cond9.for.inc23_crit_edge.us ]
%call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %i.4)
%putchar = call i32 @putchar(i32 10)
%9 = load i64, ptr %a, align 8, !tbaa !5
%dec = add nsw i64 %9, -1
store i64 %dec, ptr %a, align 8, !tbaa !5
%tobool.not = icmp eq i64 %dec, 0
br i1 %tobool.not, label %for.end75, label %for.body, !llvm.loop !16
for.end75: ; preds = %if.end71, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %f) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = !{!"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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned long long int uint64;
typedef long long int int64;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
//set many funcs template
//Ver.20181228
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
void get_N (int64 *n)
{
int cnt;
cnt = scanf("%lld", n);
return;
}
void get_NK (int64 *n, int64 *k)
{
int cnt;
cnt = scanf("%lld %lld", n, k);
return;
}
void get_N1234 (int64 *n1, int64 *n2, int64 *n3, int64 *n4)
{
int cnt;
if (n2 == NULL) {
cnt = scanf("%lld", n1);
return;
}
if (n3 == NULL) {
cnt = scanf("%lld %lld", n1, n2);
return;
}
if (n4 == NULL) {
cnt = scanf("%lld %lld %lld", n1, n2, n3);
return;
}
cnt = scanf("%lld %lld %lld %lld", n1, n2, n3, n4);
return;
}
void omit_LF (void)
{
char c;
int cnt;
cnt = scanf("%c", &c);
return;
}
char *get_S (int64 n)
{
char *buf;
int i;
int cnt;
buf = malloc((size_t)(n * sizeof(char)));
if (buf == NULL) {
return NULL;
}
cnt = scanf("%s", buf);
return buf;
}
char *get_SN (int64 max, int64 *size)
{
char *buf;
int i;
int n;
int cnt;
buf = malloc((size_t)(max * sizeof(char)));
if (buf == NULL) {
return NULL;
}
cnt = scanf("%s", buf);
n = strlen(buf);
*size = n;
return buf;
}
int64 *get_NSeq (int64 n)
{
int64 *buf;
int64 i;
buf = malloc((size_t)(n * sizeof(int64)));
for (i=0; i<n; i++) {
get_N(&buf[i]);
}
return buf;
}
typedef struct _tmp_t {
int64 a;
int64 b;
} tmp_t;
int compare_a(const void *a, const void *b)
{
tmp_t *x;
tmp_t *y;
x = (tmp_t *)a;
y = (tmp_t *)b;
if (x->a > y->a) return 1;
if (x->a < y->a) return -1;
return 0;
}
int compare_b(const void *a, const void *b)
{
tmp_t *x;
tmp_t *y;
x = (tmp_t *)a;
y = (tmp_t *)b;
if (x->b > y->b) return 1;
if (x->b < y->b) return -1;
return 0;
}
void qsort_a (tmp_t *array, int size)
{
qsort(array, size, sizeof(tmp_t), compare_a);
}
void qsort_b (tmp_t *array, int size)
{
qsort(array, size, sizeof(tmp_t), compare_b);
}
int main()
{
int64 L;
double x,y,z;
get_N(&L);
x = L/3.0;
y = L/3.0;
z = L-x-y;
// printf("%lf,%lf,%lf\n", x,y,z);
printf("%lf", (x*y*z));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206463/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206463/source.c"
target datalayout = "e-m:e-p270: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._tmp_t = type { i64, i64 }
@.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 [15 x i8] c"%lld %lld %lld\00", align 1
@.str.3 = private unnamed_addr constant [20 x i8] c"%lld %lld %lld %lld\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.6 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @get_N(ptr noundef %n) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @get_NK(ptr noundef %n, ptr noundef %k) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %n, ptr noundef %k)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @get_N1234(ptr noundef %n1, ptr noundef %n2, ptr noundef %n3, ptr noundef %n4) local_unnamed_addr #0 {
entry:
%cmp = icmp eq ptr %n2, null
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n1)
br label %cleanup
if.end: ; preds = %entry
%cmp1 = icmp eq ptr %n3, null
br i1 %cmp1, label %if.then2, label %if.end4
if.then2: ; preds = %if.end
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %n1, ptr noundef nonnull %n2)
br label %cleanup
if.end4: ; preds = %if.end
%cmp5 = icmp eq ptr %n4, null
br i1 %cmp5, label %if.then6, label %if.end8
if.then6: ; preds = %if.end4
%call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %n1, ptr noundef nonnull %n2, ptr noundef nonnull %n3)
br label %cleanup
if.end8: ; preds = %if.end4
%call9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %n1, ptr noundef nonnull %n2, ptr noundef nonnull %n3, ptr noundef nonnull %n4)
br label %cleanup
cleanup: ; preds = %if.end8, %if.then6, %if.then2, %if.then
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @omit_LF() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %c)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #7
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local ptr @get_S(i64 noundef %n) local_unnamed_addr #0 {
entry:
%call = tail call noalias ptr @malloc(i64 noundef %n) #8
%cmp = icmp eq ptr %call, null
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %call)
br label %cleanup
cleanup: ; preds = %entry, %if.end
ret ptr %call
}
; 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 nounwind uwtable
define dso_local ptr @get_SN(i64 noundef %max, ptr nocapture noundef writeonly %size) local_unnamed_addr #0 {
entry:
%call = tail call noalias ptr @malloc(i64 noundef %max) #8
%cmp = icmp eq ptr %call, null
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %call)
%call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %call) #9
%sext = shl i64 %call2, 32
%conv3 = ashr exact i64 %sext, 32
store i64 %conv3, ptr %size, align 8, !tbaa !5
br label %cleanup
cleanup: ; preds = %entry, %if.end
ret ptr %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local ptr @get_NSeq(i64 noundef %n) local_unnamed_addr #0 {
entry:
%mul = shl i64 %n, 3
%call = tail call noalias ptr @malloc(i64 noundef %mul) #8
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.06 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %call, i64 %i.06
%call.i = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%inc = add nuw nsw i64 %i.06, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
ret ptr %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_a(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !11
%1 = load i64, ptr %b, align 8, !tbaa !11
%cmp = icmp sgt i64 %0, %1
%cmp5 = icmp slt i64 %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 @compare_b(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%b1 = getelementptr inbounds %struct._tmp_t, ptr %a, i64 0, i32 1
%0 = load i64, ptr %b1, align 8, !tbaa !13
%b2 = getelementptr inbounds %struct._tmp_t, ptr %b, i64 0, i32 1
%1 = load i64, ptr %b2, align 8, !tbaa !13
%cmp = icmp sgt i64 %0, %1
%cmp5 = icmp slt i64 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @qsort_a(ptr noundef %array, i32 noundef %size) local_unnamed_addr #0 {
entry:
%conv = sext i32 %size to i64
tail call void @qsort(ptr noundef %array, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @compare_a) #7
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @qsort_b(ptr noundef %array, i32 noundef %size) local_unnamed_addr #0 {
entry:
%conv = sext i32 %size to i64
tail call void @qsort(ptr noundef %array, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @compare_b) #7
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %L) #7
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L)
%0 = load i64, ptr %L, align 8, !tbaa !5
%conv = sitofp i64 %0 to double
%div = fdiv double %conv, 3.000000e+00
%sub = fsub double %conv, %div
%sub4 = fsub double %sub, %div
%mul = fmul double %div, %div
%mul5 = fmul double %mul, %sub4
%call = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %mul5)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %L) #7
ret i32 0
}
; 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 nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long 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, !6, i64 0}
!12 = !{!"_tmp_t", !6, i64 0, !6, i64 8}
!13 = !{!12, !6, i64 8}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
//N = number of atoms
int main()
{
//int i,j,k,l;
double L;
double i;
double ans;
scanf("%lf",&L);
i = (L/3.0);
ans = (i*i*i);
printf("%f\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206506/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206506/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %L) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L)
%0 = load double, ptr %L, align 8, !tbaa !5
%div = fdiv double %0, 3.000000e+00
%mul = fmul double %div, %div
%mul1 = fmul double %div, %mul
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %L) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int n, A[10000], top1, B[10000], top2, C[10000], top3;
int num;
int ans1;
int main() {
int i;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
scanf("%d", &num);
if (num == 1) A[++top1] = i;
if (num == 2) B[++top2] = i;
if (num == 3) C[++top3] = i;
}
ans1 = top1;
if (top2 < ans1) ans1 = top2;
if (top3 < ans1) ans1 = top3;
printf("%d\n", ans1);
for (i = 1; i <= ans1; i++) printf("%d %d %d\n", A[i], B[i], C[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20655/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20655/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@num = dso_local global i32 0, align 4
@A = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16
@top1 = dso_local local_unnamed_addr global i32 0, align 4
@B = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16
@top2 = dso_local local_unnamed_addr global i32 0, align 4
@C = dso_local local_unnamed_addr global [10000 x i32] zeroinitializer, align 16
@top3 = dso_local local_unnamed_addr global i32 0, align 4
@ans1 = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not49 = icmp slt i32 %0, 1
br i1 %cmp.not49, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.050 = phi i32 [ %inc15, %for.inc ], [ 1, %entry ]
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @num)
%1 = load i32, ptr @num, align 4, !tbaa !5
switch i32 %1, label %for.inc [
i32 1, label %if.end.thread
i32 2, label %if.then4
i32 3, label %if.then10
]
if.end.thread: ; preds = %for.body
%2 = load i32, ptr @top1, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr @top1, align 4, !tbaa !5
br label %for.inc.sink.split
if.then4: ; preds = %for.body
%3 = load i32, ptr @top2, align 4, !tbaa !5
%inc5 = add nsw i32 %3, 1
store i32 %inc5, ptr @top2, align 4, !tbaa !5
br label %for.inc.sink.split
if.then10: ; preds = %for.body
%4 = load i32, ptr @top3, align 4, !tbaa !5
%inc11 = add nsw i32 %4, 1
store i32 %inc11, ptr @top3, align 4, !tbaa !5
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then10, %if.end.thread, %if.then4
%inc5.sink = phi i32 [ %inc5, %if.then4 ], [ %inc, %if.end.thread ], [ %inc11, %if.then10 ]
%B.sink = phi ptr [ @B, %if.then4 ], [ @A, %if.end.thread ], [ @C, %if.then10 ]
%idxprom6 = sext i32 %inc5.sink to i64
%arrayidx7 = getelementptr inbounds [10000 x i32], ptr %B.sink, i64 0, i64 %idxprom6
store i32 %i.050, ptr %arrayidx7, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc15 = add nuw nsw i32 %i.050, 1
%5 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.050, %5
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%6 = load i32, ptr @top1, align 4, !tbaa !5
%7 = load i32, ptr @top2, align 4, !tbaa !5
%spec.store.select = tail call i32 @llvm.smin.i32(i32 %7, i32 %6)
%8 = load i32, ptr @top3, align 4, !tbaa !5
%spec.store.select46 = tail call i32 @llvm.smin.i32(i32 %8, i32 %spec.store.select)
store i32 %spec.store.select46, ptr @ans1, align 4
%call22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.store.select46)
%9 = load i32, ptr @ans1, align 4, !tbaa !5
%cmp24.not51 = icmp slt i32 %9, 1
br i1 %cmp24.not51, label %for.end35, label %for.body25
for.body25: ; preds = %for.end, %for.body25
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body25 ], [ 1, %for.end ]
%arrayidx27 = getelementptr inbounds [10000 x i32], ptr @A, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%arrayidx29 = getelementptr inbounds [10000 x i32], ptr @B, i64 0, i64 %indvars.iv
%11 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%arrayidx31 = getelementptr inbounds [10000 x i32], ptr @C, i64 0, i64 %indvars.iv
%12 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%call32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10, i32 noundef %11, i32 noundef %12)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr @ans1, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp24.not.not = icmp slt i64 %indvars.iv, %14
br i1 %cmp24.not.not, label %for.body25, label %for.end35, !llvm.loop !11
for.end35: ; preds = %for.body25, %for.end
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x){
while(x->left!=NIL) x=x->left;
return x;
}
Node treeMaximum(Node x){
while(x->right!=NIL) x=x->right;
return x;
}
Node treeSearch(Node u, int k){
if(u==NIL || k==u->key) return u;
if(k<u->key) return treeSearch(u->left,k);
else return treeSearch(u->right,k);
}
Node treeSuccessor(Node x){
Node y;
if(x->right!=NIL) return treeMinimum(x->right);
y=x->parent;
while(y!=NIL && x==y->right){
x=y;
y=y->parent;
}
return y;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z->left==NIL || z->right == NIL) y=z;
else y=treeSuccessor(z);
if(y->left!=NIL) x=y->left;
else x=y->right;
if(x!=NIL) x->parent = y->parent;
if(y->parent==NIL) root=x;
else if(y==y->parent->left) y->parent->left = x;
else y->parent->right = x;
if(y!=z) z->key=y->key;
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while (x!=NIL){
y=x;
if(z->key < x->key){
x=x->left;
}
else{
x=x->right;
}
}
z->parent=y;
if(y==NIL) root =z;
else if(z->key<y->key) y->left=z;
else (y->right = z);
}
void inorder(Node u){
if(u==NIL) return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(Node u){
if(u==NIL) return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206593/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMaximum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%0 = load ptr, ptr %x.addr.0, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !14
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp14 = icmp eq ptr %u, null
br i1 %cmp14, label %return, label %lor.lhs.false
lor.lhs.false: ; preds = %entry, %if.end
%u.tr15 = phi ptr [ %u.tr.be, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !15
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %return, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 1
%spec.select = select i1 %cmp3, ptr %left, ptr %u.tr15
%u.tr.be = load ptr, ptr %spec.select, align 8, !tbaa !16
%cmp = icmp eq ptr %u.tr.be, null
br i1 %cmp, label %return, label %lor.lhs.false
return: ; preds = %lor.lhs.false, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ null, %if.end ], [ %u.tr15, %lor.lhs.false ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !13
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !18
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !13
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !13
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.058, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !17
%parent11 = getelementptr inbounds %struct.node, ptr %x.054, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.060 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.060, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !16
%cmp28.not = icmp eq ptr %y.060, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !15
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !15
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !16
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !15
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !15
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !16
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !19
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !17
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !17
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !15
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !16
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.067 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !21
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !16
%3 = load i32, ptr %x, align 4, !tbaa !20
%cmp14.i = icmp eq ptr %2, null
br i1 %cmp14.i, label %if.else, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.then, %if.end.i
%u.tr15.i = phi ptr [ %u.tr.be.i, %if.end.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !15
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 1
%spec.select.i = select i1 %cmp3.i, ptr %left.i, ptr %u.tr15.i
%u.tr.be.i = load ptr, ptr %spec.select.i, align 8, !tbaa !16
%cmp.i = icmp eq ptr %u.tr.be.i, null
br i1 %cmp.i, label %if.else, label %lor.lhs.false.i
if.then8: ; preds = %lor.lhs.false.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.end.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !20
%6 = load ptr, ptr @root, align 8, !tbaa !16
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !15
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i
while.body.i: ; preds = %if.then16, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !15
%cmp3.i42 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i42, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !16
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %insert.exit, label %while.body.i, !llvm.loop !19
insert.exit: ; preds = %while.body.i, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !17
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !16
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !16
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !16
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !16
%11 = load i32, ptr %x, align 4, !tbaa !20
%cmp14.i44 = icmp eq ptr %10, null
br i1 %cmp14.i44, label %treeSearch.exit56, label %lor.lhs.false.i45
lor.lhs.false.i45: ; preds = %if.then31, %if.end.i49
%u.tr15.i46 = phi ptr [ %u.tr.be.i53, %if.end.i49 ], [ %10, %if.then31 ]
%key.i47 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 3
%12 = load i32, ptr %key.i47, align 8, !tbaa !15
%cmp1.i48 = icmp eq i32 %12, %11
br i1 %cmp1.i48, label %treeSearch.exit56, label %if.end.i49
if.end.i49: ; preds = %lor.lhs.false.i45
%cmp3.i50 = icmp sgt i32 %12, %11
%left.i51 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 1
%spec.select.i52 = select i1 %cmp3.i50, ptr %left.i51, ptr %u.tr15.i46
%u.tr.be.i53 = load ptr, ptr %spec.select.i52, align 8, !tbaa !16
%cmp.i54 = icmp eq ptr %u.tr.be.i53, null
br i1 %cmp.i54, label %treeSearch.exit56, label %lor.lhs.false.i45
treeSearch.exit56: ; preds = %lor.lhs.false.i45, %if.end.i49, %if.then31
%retval.0.i55 = phi ptr [ null, %if.then31 ], [ %u.tr15.i46, %lor.lhs.false.i45 ], [ null, %if.end.i49 ]
%left.i57 = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 1
%13 = load ptr, ptr %left.i57, align 8, !tbaa !5
%cmp.i58 = icmp eq ptr %13, null
br i1 %cmp.i58, label %if.end8.i, label %lor.lhs.false.i59
lor.lhs.false.i59: ; preds = %treeSearch.exit56
%14 = load ptr, ptr %retval.0.i55, align 8, !tbaa !13
%cmp1.i60 = icmp eq ptr %14, null
br i1 %cmp1.i60, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i59, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i59 ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit56
%y.0.ph.i = phi ptr [ %retval.0.i55, %treeSearch.exit56 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !13
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i59
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %retval.0.i55, %lor.lhs.false.i59 ]
%x.054.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i59 ]
%parent.i61 = getelementptr inbounds %struct.node, ptr %y.058.i, i64 0, i32 2
%17 = load ptr, ptr %parent.i61, align 8, !tbaa !17
%parent11.i = getelementptr inbounds %struct.node, ptr %x.054.i, i64 0, i32 2
store ptr %17, ptr %parent11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.060.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 2
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !17
%cmp14.i62 = icmp eq ptr %18, null
br i1 %cmp14.i62, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.060.i, %19
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !16
%cmp28.not.i = icmp eq ptr %y.060.i, %retval.0.i55
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i63 = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 3
%20 = load i32, ptr %key.i63, align 8, !tbaa !15
%key30.i = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !15
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.067, 1
%21 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = !{!6, !10, i64 24}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !7, i64 16}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!10, !10, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !12}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *r;
struct node *l;
struct node *p;
int key;
};
typedef struct node * Node;
Node root;
Node find(Node u, int k){
while(u!=NULL && k != u->key){
if(k<u->key)u=u->l;
else u=u->r;
}
return u;
}
Node mini(Node x){
while(x->l!=NULL)
x=x->l;
return x;
}
Node suc(Node x){
if(x->r!=NULL)
return mini(x->r);
Node y=x->p;
while(y!=NULL && x==y->r){
x=y;
y=y->p;
}
return y;
}
void insert(int k){
Node x = root;
Node y = NULL;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->l = NULL;
z->r = NULL;
while(x!=NULL){
y=x;
if(z->key < x->key){
x=x->l;
}
else {
x=x->r;
}
}
z->p=y;
if(y==NULL){
root=z;
}
else{
if(z->key < y->key){
y->l=z;
}
else{
y->r=z;
}
}
}
void inorder(Node u){
if(u==NULL)return ;
inorder(u->l);
printf(" %d",u->key);
inorder(u->r);
}
void preorder(Node u){
if(u==NULL)return ;
printf(" %d",u->key);
preorder(u->l);
preorder(u->r);
}
void delete(Node z){
Node x;
Node y;
if(z->l==NULL || z->r==NULL)
y=z;
else y=suc(z);
if(y->l!=NULL){
x=y->l;
}
else{
x=y->r;
}
if(x!=NULL){
x->p=y->p;
}
if(y->p==NULL){
root=x;
}
else{
if(y==y->p->l){
y->p->l=x;
}
else{
y->p->r=x;
}
}
if(y!=z){
z->key=y->key;
}
free(y);
}
int main(){
int n, i, x;
char c[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", c);
if ( c[0] == 'f' ){
scanf("%d", &x);
Node t = find(root, x);
if ( t != NULL ) printf("yes\n");
else printf("no\n");
}
else if ( c[0] == 'i' ){
scanf("%d", &x);
insert(x);
}
else if ( c[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if(c[0]=='d'){
scanf("%d", &x);
delete(find(root,x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206643/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206643/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp.not10 = icmp eq ptr %u, null
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !5
%cmp1.not = icmp eq i32 %0, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %0, %k
%l = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %l, ptr %u.addr.011
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !11
%cmp.not = icmp eq ptr %u.addr.1, null
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !12
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ null, %entry ], [ null, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @mini(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%l = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %l, align 8, !tbaa !14
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !15
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @suc(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !16
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%l.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %l.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !15
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !18
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #2 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !11
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !5
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !5
%cmp3 = icmp sgt i32 %1, %k
%l4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %l4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !11
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !19
if.then7: ; preds = %entry
%p37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %p37, align 8, !tbaa !17
br label %if.end17
if.else8: ; preds = %while.body
%p = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %p, align 8, !tbaa !17
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !5
%cmp11 = icmp sgt i32 %2, %k
%l13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %l13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%l13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %l13.sink, align 8, !tbaa !11
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #2 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%l = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %l, align 8, !tbaa !14
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !16
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #2 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%l = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %l, align 8, !tbaa !14
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !16
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @delete(ptr noundef %z) local_unnamed_addr #5 {
entry:
%l = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %l, align 8, !tbaa !14
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !16
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%l.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %l.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !15
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !16
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.059 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.055 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%p = getelementptr inbounds %struct.node, ptr %y.059, i64 0, i32 2
%4 = load ptr, ptr %p, align 8, !tbaa !17
%p11 = getelementptr inbounds %struct.node, ptr %x.055, i64 0, i32 2
store ptr %4, ptr %p11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.061 = phi ptr [ %y.059, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.056 = phi ptr [ %x.055, %if.then10 ], [ null, %if.end8 ]
%p13 = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 2
%5 = load ptr, ptr %p13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%l18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %l18, align 8, !tbaa !14
%cmp19 = icmp eq ptr %y.061, %6
%l18. = select i1 %cmp19, ptr %l18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%l18.sink = phi ptr [ @root, %if.end12 ], [ %l18., %if.else16 ]
store ptr %x.056, ptr %l18.sink, align 8, !tbaa !11
%cmp28.not = icmp eq ptr %y.061, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !5
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !5
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
tail call void @free(ptr noundef nonnull %y.061) #10
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%c = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #10
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %c) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.064 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %c)
%1 = load i8, ptr %c, align 16, !tbaa !21
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !11
%3 = load i32, ptr %x, align 4, !tbaa !20
%cmp.not10.i = icmp eq ptr %2, null
br i1 %cmp.not10.i, label %if.else, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !5
%cmp1.not.i = icmp eq i32 %4, %3
br i1 %cmp1.not.i, label %if.then8, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp sgt i32 %4, %3
%l.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %l.i, ptr %u.addr.011.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !11
%cmp.not.i = icmp eq ptr %u.addr.1.i, null
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !12
if.then8: ; preds = %land.rhs.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %while.body.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !20
%6 = load ptr, ptr @root, align 8, !tbaa !11
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !5
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i42
while.body.i42: ; preds = %if.then16, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !5
%cmp3.i43 = icmp sgt i32 %7, %5
%l4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %l4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !11
%cmp.not.i44 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i44, label %insert.exit, label %while.body.i42, !llvm.loop !19
insert.exit: ; preds = %while.body.i42, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i42 ]
%l13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i42 ]
%p37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %p37.i, align 8, !tbaa !17
store ptr %call.i, ptr %l13.sink.i, align 8, !tbaa !11
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !11
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !11
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !11
%11 = load i32, ptr %x, align 4, !tbaa !20
%cmp.not10.i45 = icmp eq ptr %10, null
br i1 %cmp.not10.i45, label %find.exit57, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then31, %while.body.i50
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i50 ], [ %10, %if.then31 ]
%key.i48 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 3
%12 = load i32, ptr %key.i48, align 8, !tbaa !5
%cmp1.not.i49 = icmp eq i32 %12, %11
br i1 %cmp1.not.i49, label %find.exit57, label %while.body.i50
while.body.i50: ; preds = %land.rhs.i46
%cmp3.i51 = icmp sgt i32 %12, %11
%l.i52 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 1
%u.addr.1.in.i53 = select i1 %cmp3.i51, ptr %l.i52, ptr %u.addr.011.i47
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !11
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, null
br i1 %cmp.not.i55, label %find.exit57, label %land.rhs.i46, !llvm.loop !12
find.exit57: ; preds = %land.rhs.i46, %while.body.i50, %if.then31
%u.addr.0.lcssa.i56 = phi ptr [ null, %if.then31 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ null, %while.body.i50 ]
%l.i58 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 1
%13 = load ptr, ptr %l.i58, align 8, !tbaa !14
%cmp.i = icmp eq ptr %13, null
br i1 %cmp.i, label %if.end8.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %find.exit57
%14 = load ptr, ptr %u.addr.0.lcssa.i56, align 8, !tbaa !16
%cmp1.i = icmp eq ptr %14, null
br i1 %cmp1.i, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i ]
%l.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %l.i.i.i, align 8, !tbaa !14
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !15
if.end8.i: ; preds = %while.cond.i.i.i, %find.exit57
%y.0.ph.i = phi ptr [ %u.addr.0.lcssa.i56, %find.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !16
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i
%y.059.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %u.addr.0.lcssa.i56, %lor.lhs.false.i ]
%x.055.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i ]
%p.i59 = getelementptr inbounds %struct.node, ptr %y.059.i, i64 0, i32 2
%17 = load ptr, ptr %p.i59, align 8, !tbaa !17
%p11.i = getelementptr inbounds %struct.node, ptr %x.055.i, i64 0, i32 2
store ptr %17, ptr %p11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.061.i = phi ptr [ %y.059.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.056.i = phi ptr [ %x.055.i, %if.then10.i ], [ null, %if.end8.i ]
%p13.i = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 2
%18 = load ptr, ptr %p13.i, align 8, !tbaa !17
%cmp14.i = icmp eq ptr %18, null
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%l18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %l18.i, align 8, !tbaa !14
%cmp19.i = icmp eq ptr %y.061.i, %19
%l18..i = select i1 %cmp19.i, ptr %l18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%l18.sink.i = phi ptr [ @root, %if.end12.i ], [ %l18..i, %if.else16.i ]
store ptr %x.056.i, ptr %l18.sink.i, align 8, !tbaa !11
%cmp28.not.i = icmp eq ptr %y.061.i, %u.addr.0.lcssa.i56
br i1 %cmp28.not.i, label %delete.exit, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i60 = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 3
%20 = load i32, ptr %key.i60, align 8, !tbaa !5
%key30.i = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !5
br label %delete.exit
delete.exit: ; preds = %if.end27.i, %if.then29.i
call void @free(ptr noundef nonnull %y.061.i) #10
br label %for.inc
for.inc: ; preds = %for.body, %if.then8, %if.else, %if.then23, %delete.exit, %insert.exit
%inc = add nuw nsw i32 %i.064, 1
%21 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %c) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
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 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !10, i64 24}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !7, i64 8}
!15 = distinct !{!15, !13}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !7, i64 16}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = !{!10, !10, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !13}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x){
while(x->left!=NIL)
x=x->left;
return x;
}
Node treeSearch(Node u, int k){
while(u!=NIL && k!=u->key){
//if(u->key == k)return u;
if(u->key < k) u=u->right;
else u=u->left;
}
return u;
}
Node treeSuccessor(Node x){
Node y;
if(x->right!=NIL)
return treeMinimum(x->right);
y=x->parent;
while(y!=NIL && x==y->right){
x=y;
y=y->parent;
}
return y;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z->left==NIL || z->right==NIL)y=z;
else y=treeSuccessor(z);
if(y->left!=NIL)x = y->left;
else x = y->right;
if(x!=NIL)x->parent = y->parent;
if(y->parent == NIL) root=x;
else{
if(y == y->parent->left)y->parent->left = x;
else y->parent->right = x;
}
if(y!=z)z->key = y->key;
free(y);
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y=x;
if(z->key < x->key)x=x->left;
else x=x->right;
}
z->parent = y;
if(y==NIL)root=z;
else if(z->key < y->key) y->left =z;
else y->right = z;
}
void inorder(Node u){
if(u->left!=NIL)inorder(u->left);
printf(" %d",u->key);
if(u->right!=NIL)inorder(u->right);
}
void preorder(Node u){
printf(" %d",u->key);
if(u->left!=NIL)preorder(u->left);
if(u->right!=NIL)preorder(u->right);
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206687/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206687/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp.not10 = icmp eq ptr %u, null
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%cmp1.not = icmp eq i32 %0, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp slt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %u.addr.011, ptr %left
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %u.addr.1, null
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !15
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ null, %entry ], [ null, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !16
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !18
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !16
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !16
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.059 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.055 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.059, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !17
%parent11 = getelementptr inbounds %struct.node, ptr %x.055, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.061 = phi ptr [ %y.059, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.056 = phi ptr [ %x.055, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.061, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.056, ptr %left18.sink, align 8, !tbaa !14
%cmp28.not = icmp eq ptr %y.061, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !13
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !13
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
tail call void @free(ptr noundef nonnull %y.061) #9
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !14
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !13
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !13
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !19
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !17
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !17
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !13
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !14
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr nocapture noundef readonly %u) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end, %entry
%u.tr = phi ptr [ %u, %entry ], [ %2, %if.end ]
%left = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
tail call void @inorder(ptr noundef nonnull %0)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%key = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !13
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr, align 8, !tbaa !16
%cmp2.not = icmp eq ptr %2, null
br i1 %cmp2.not, label %if.end5, label %tailrecurse
if.end5: ; preds = %if.end
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr nocapture noundef readonly %u) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end, %entry
%u.tr = phi ptr [ %u, %entry ], [ %2, %if.end ]
%key = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %1, null
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
tail call void @preorder(ptr noundef nonnull %1)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%2 = load ptr, ptr %u.tr, align 8, !tbaa !16
%cmp2.not = icmp eq ptr %2, null
br i1 %cmp2.not, label %if.end5, label %tailrecurse
if.end5: ; preds = %if.end
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.064 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !21
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !14
%3 = load i32, ptr %x, align 4, !tbaa !20
%cmp.not10.i = icmp eq ptr %2, null
br i1 %cmp.not10.i, label %if.else, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !13
%cmp1.not.i = icmp eq i32 %4, %3
br i1 %cmp1.not.i, label %if.then8, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp slt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %u.addr.011.i, ptr %left.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %u.addr.1.i, null
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !15
if.then8: ; preds = %land.rhs.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %while.body.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !20
%6 = load ptr, ptr @root, align 8, !tbaa !14
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !13
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i42
while.body.i42: ; preds = %if.then16, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !13
%cmp3.i43 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !14
%cmp.not.i44 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i44, label %insert.exit, label %while.body.i42, !llvm.loop !19
insert.exit: ; preds = %while.body.i42, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i42 ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i42 ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !17
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !14
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !14
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !14
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !14
%11 = load i32, ptr %x, align 4, !tbaa !20
%cmp.not10.i45 = icmp eq ptr %10, null
br i1 %cmp.not10.i45, label %treeSearch.exit57, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then31, %while.body.i50
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i50 ], [ %10, %if.then31 ]
%key.i48 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 3
%12 = load i32, ptr %key.i48, align 8, !tbaa !13
%cmp1.not.i49 = icmp eq i32 %12, %11
br i1 %cmp1.not.i49, label %treeSearch.exit57, label %while.body.i50
while.body.i50: ; preds = %land.rhs.i46
%cmp3.i51 = icmp slt i32 %12, %11
%left.i52 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 1
%u.addr.1.in.i53 = select i1 %cmp3.i51, ptr %u.addr.011.i47, ptr %left.i52
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !14
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, null
br i1 %cmp.not.i55, label %treeSearch.exit57, label %land.rhs.i46, !llvm.loop !15
treeSearch.exit57: ; preds = %land.rhs.i46, %while.body.i50, %if.then31
%u.addr.0.lcssa.i56 = phi ptr [ null, %if.then31 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ null, %while.body.i50 ]
%left.i58 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 1
%13 = load ptr, ptr %left.i58, align 8, !tbaa !5
%cmp.i = icmp eq ptr %13, null
br i1 %cmp.i, label %if.end8.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %treeSearch.exit57
%14 = load ptr, ptr %u.addr.0.lcssa.i56, align 8, !tbaa !16
%cmp1.i = icmp eq ptr %14, null
br i1 %cmp1.i, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit57
%y.0.ph.i = phi ptr [ %u.addr.0.lcssa.i56, %treeSearch.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !16
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i
%y.059.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %u.addr.0.lcssa.i56, %lor.lhs.false.i ]
%x.055.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i ]
%parent.i59 = getelementptr inbounds %struct.node, ptr %y.059.i, i64 0, i32 2
%17 = load ptr, ptr %parent.i59, align 8, !tbaa !17
%parent11.i = getelementptr inbounds %struct.node, ptr %x.055.i, i64 0, i32 2
store ptr %17, ptr %parent11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.061.i = phi ptr [ %y.059.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.056.i = phi ptr [ %x.055.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 2
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !17
%cmp14.i = icmp eq ptr %18, null
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.061.i, %19
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.056.i, ptr %left18.sink.i, align 8, !tbaa !14
%cmp28.not.i = icmp eq ptr %y.061.i, %u.addr.0.lcssa.i56
br i1 %cmp28.not.i, label %treeDelete.exit, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i60 = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 3
%20 = load i32, ptr %key.i60, align 8, !tbaa !13
%key30.i = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !13
br label %treeDelete.exit
treeDelete.exit: ; preds = %if.end27.i, %if.then29.i
call void @free(ptr noundef nonnull %y.061.i) #9
br label %for.inc
for.inc: ; preds = %for.body, %if.then8, %if.else, %if.then23, %treeDelete.exit, %insert.exit
%inc = add nuw nsw i32 %i.064, 1
%21 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !10, i64 24}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !7, i64 16}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!10, !10, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !12}
|
# define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
typedef struct node {
int key;
struct node *p_left;
struct node *p_right;
struct node *p_parent;
}NODE;
NODE *insert(int value, NODE *p_root); /* ?????\ */
void inorderTreeWalk(NODE *p_node); /* ??????????????? */
void preorderTreeWalk(NODE *p_node); /* ??????????????? */
int find(int value, NODE *p_root); /* ??¢?´¢ */
void delete(int value, NODE *p_root); /* ?????? */
void deleteHasNoChildNode(NODE *z); /* ?????????????????????????????????????????? */
void deleteHasOneChildNode(NODE *z); /* ?????????????????????????????????????????? */
void deleteHasTwoChildlenNode(NODE *z); /* ?????????????????????????????????????????? */
int main(void) {
char command[20];
int value, n, i;
int result_find;
NODE *p_root = NULL;
scanf("%d", &n);/* ????????°?????\??? */
for (i = 0; i < n; i++) {
scanf("%s", &command);
/* insert */
if (command[0] == 'i') {
scanf("%d", &value);
p_root = insert(value, p_root);
}
/* print */
else if (command[0] == 'p') {
inorderTreeWalk(p_root);
printf("\n");
preorderTreeWalk(p_root);
printf("\n");
}
/* find */
else if (command[0] == 'f') {
scanf("%d", &value);
result_find =find(value, p_root);
if (result_find == 0) {
printf("no\n");
}
else {
printf("yes\n");
}
}
/* delete */
else if (command[0] == 'd') {
scanf("%d", &value);
delete(value, p_root);
}
}
return 0;
}
NODE* insert(int value, NODE *p_root) {
NODE *x = p_root; /* ??? */
NODE *y = NULL; /* x?????? */
NODE *z = (NODE *)malloc(sizeof(NODE));
z->key = value;
z->p_left = NULL;
z->p_right = NULL;
while (x != NULL) {
y = x;
if (z->key < x->key) {
x = x->p_left; /* ?????????????§???? */
}
else {
x = x->p_right; /* ?????????????§???? */
}
}
z->p_parent = y;
if (y == NULL) { /* ??¨???????????´??? */
p_root = z;
}
else if (z->key < y->key) {
y->p_left = z; //z?????????????????????
}
else {
y->p_right = z; //z?????????????????????
}
return p_root;
}
//?????????????????§??¨???
void inorderTreeWalk(NODE *p_node) {
if (p_node == NULL) {
return;
}
inorderTreeWalk(p_node->p_left);
printf(" %d", p_node->key);
inorderTreeWalk(p_node->p_right);
}
//?????????????????§??¨???
void preorderTreeWalk(NODE *p_node) {
if (p_node == NULL) {
return;
}
printf(" %d", p_node->key);
preorderTreeWalk(p_node->p_left);
preorderTreeWalk(p_node->p_right);
}
/* ??????????????????value????????¨????????????????????±????????? */
/* ????????????0 : ?????¨?????????, 1 : ?????¨?????? */
int find(int value, NODE *p_root) {
NODE *p_node;
p_node = p_root;
while (1) {
if (p_node->key > value) {
if (p_node->p_left != NULL) {
p_node = p_node->p_left; /* ?????????????§???? */
}
else {
return 0;
}
}
else if (p_node->key < value) {
if (p_node->p_right != NULL) {
p_node = p_node->p_right; /* ?????????????§???? */
}
else {
return 0;
}
}
else {
return 1;
}
}
}
void delete(int value, NODE *p_root) {
NODE *z;
z = p_root;
/* ?????????????????????????????¢??? */
while (1) {
if (z->key > value) {
z = z->p_left; /* ?????????????§???? */
}
else if (z->key < value) {
z = z->p_right; /* ?????????????§???? */
}
else {
break;
}
}
/* ??????????±????????????????????????????????????¨??? */
if (z->p_left == NULL && z->p_right == NULL) {
deleteHasNoChildNode(z);
}
/* ??????????±??????????????????????????????????????????¨??? */
else if (z->p_right == NULL || z->p_left == NULL) {
deleteHasOneChildNode(z);
}
/* ??????????±????????????????????????????????????¨??? */
else {
deleteHasTwoChildlenNode(z);
}
}
/* ?????????????????????????????????????????? */
void deleteHasNoChildNode(NODE *z) {
if (z->key >= z->p_parent->key) {
z->p_parent->p_right = NULL;
}
else {
z->p_parent->p_left = NULL;
}
free(z);
}
/* ?????????????????????????????????????????? */
void deleteHasOneChildNode(NODE *z) {
/* ????????????????????¨??? */
if (z->p_left != NULL) {
if (z->key > z->p_parent->key) {
z->p_parent->p_right = z->p_left;
}
else {
z->p_parent->p_left = z->p_left;
}
z->p_left->p_parent = z->p_parent;
}
/* ????????????????????¨??? */
else{
if (z->key > z->p_parent->key) {
z->p_parent->p_right = z->p_right;
}
else {
z->p_parent->p_left = z->p_right;
}
z->p_right->p_parent = z->p_parent;
}
free(z);
}
/* ?????????????????????????????????????????? */
void deleteHasTwoChildlenNode(NODE *z) {
NODE *y; /* z????¬??????? */
y = z;
if (y->p_right != NULL) {
y = y->p_right;
while (y->p_left != NULL) {
y = y->p_left;
}
}
else {
y = z->p_parent;
}
/* y????????????z????????????????????? */
z->key = y->key;
/* y????????? */
if (y->p_left == NULL && y->p_right == NULL) {
deleteHasNoChildNode(y);
}
else{
deleteHasOneChildNode(y);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206737/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206737/source.c"
target datalayout = "e-m:e-p270: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.node = type { i32, ptr, ptr, ptr }
@.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.5 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"yes\00", align 1
@str.6 = private unnamed_addr constant [3 x i8] c"no\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%command = alloca [20 x i8], align 16
%value = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %command) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %value) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp48 = icmp sgt i32 %0, 0
br i1 %cmp48, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%p_root.050 = phi ptr [ %p_root.1, %for.inc ], [ null, %entry ]
%i.049 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %command)
%1 = load i8, ptr %command, align 16, !tbaa !9
switch i8 %1, label %for.inc [
i8 105, label %if.then
i8 112, label %if.then10
i8 102, label %if.then18
i8 100, label %if.then32
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value)
%2 = load i32, ptr %value, align 4, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
store i32 %2, ptr %call.i, align 8, !tbaa !10
%p_left.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 1
%cmp.not35.i = icmp eq ptr %p_root.050, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %p_left.i, i8 0, i64 16, i1 false)
br i1 %cmp.not35.i, label %while.end.thread.i, label %while.body.i
while.end.thread.i: ; preds = %if.then
%p_parent38.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store ptr null, ptr %p_parent38.i, align 8, !tbaa !13
br label %for.inc
while.body.i: ; preds = %if.then, %while.body.i
%x.036.i = phi ptr [ %x.1.i, %while.body.i ], [ %p_root.050, %if.then ]
%3 = load i32, ptr %x.036.i, align 8, !tbaa !10
%cmp3.i = icmp sgt i32 %3, %2
%p_left4.i = getelementptr inbounds %struct.node, ptr %x.036.i, i64 0, i32 1
%p_right5.i = getelementptr inbounds %struct.node, ptr %x.036.i, i64 0, i32 2
%x.1.in.i = select i1 %cmp3.i, ptr %p_left4.i, ptr %p_right5.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %if.else8.i, label %while.body.i, !llvm.loop !15
if.else8.i: ; preds = %while.body.i
%p_parent.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store ptr %x.036.i, ptr %p_parent.i, align 8, !tbaa !13
br i1 %cmp3.i, label %if.then12.i, label %if.else14.i
if.then12.i: ; preds = %if.else8.i
store ptr %call.i, ptr %p_left4.i, align 8, !tbaa !17
br label %for.inc
if.else14.i: ; preds = %if.else8.i
store ptr %call.i, ptr %p_right5.i, align 8, !tbaa !18
br label %for.inc
if.then10: ; preds = %for.body
call void @inorderTreeWalk(ptr noundef %p_root.050)
%putchar = call i32 @putchar(i32 10)
call void @preorderTreeWalk(ptr noundef %p_root.050)
%putchar44 = call i32 @putchar(i32 10)
br label %for.inc
if.then18: ; preds = %for.body
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value)
%4 = load i32, ptr %value, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i.backedge, %if.then18
%p_node.0.i = phi ptr [ %p_root.050, %if.then18 ], [ %p_node.0.i.be, %while.cond.i.backedge ]
%5 = load i32, ptr %p_node.0.i, align 8, !tbaa !10
%cmp.i = icmp sgt i32 %5, %4
br i1 %cmp.i, label %if.then.i, label %if.else4.i
if.then.i: ; preds = %while.cond.i
%p_left.i45 = getelementptr inbounds %struct.node, ptr %p_node.0.i, i64 0, i32 1
%6 = load ptr, ptr %p_left.i45, align 8, !tbaa !17
%cmp1.not.i = icmp eq ptr %6, null
br i1 %cmp1.not.i, label %if.then23, label %while.cond.i.backedge
if.else4.i: ; preds = %while.cond.i
%cmp6.i = icmp slt i32 %5, %4
br i1 %cmp6.i, label %if.then7.i, label %if.else25
if.then7.i: ; preds = %if.else4.i
%p_right.i = getelementptr inbounds %struct.node, ptr %p_node.0.i, i64 0, i32 2
%7 = load ptr, ptr %p_right.i, align 8, !tbaa !18
%cmp8.not.i = icmp eq ptr %7, null
br i1 %cmp8.not.i, label %if.then23, label %while.cond.i.backedge
while.cond.i.backedge: ; preds = %if.then7.i, %if.then.i
%p_node.0.i.be = phi ptr [ %6, %if.then.i ], [ %7, %if.then7.i ]
br label %while.cond.i
if.then23: ; preds = %if.then.i, %if.then7.i
%puts43 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else25: ; preds = %if.else4.i
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then32: ; preds = %for.body
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %value)
%8 = load i32, ptr %value, align 4, !tbaa !5
call void @delete(i32 noundef %8, ptr noundef %p_root.050)
br label %for.inc
for.inc: ; preds = %if.else14.i, %if.then12.i, %while.end.thread.i, %for.body, %if.else25, %if.then23, %if.then32, %if.then10
%p_root.1 = phi ptr [ %p_root.050, %if.then10 ], [ %p_root.050, %if.then23 ], [ %p_root.050, %if.else25 ], [ %p_root.050, %if.then32 ], [ %p_root.050, %for.body ], [ %p_root.050, %if.then12.i ], [ %p_root.050, %if.else14.i ], [ %call.i, %while.end.thread.i ]
%inc = add nuw nsw i32 %i.049, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %9
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !19
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %value) #10
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %command) #10
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local ptr @insert(i32 noundef %value, ptr noundef %p_root) local_unnamed_addr #3 {
entry:
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
store i32 %value, ptr %call, align 8, !tbaa !10
%p_left = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
%cmp.not35 = icmp eq ptr %p_root, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %p_left, i8 0, i64 16, i1 false)
br i1 %cmp.not35, label %while.end.thread, label %while.body
while.end.thread: ; preds = %entry
%p_parent38 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store ptr null, ptr %p_parent38, align 8, !tbaa !13
br label %if.end17
while.body: ; preds = %entry, %while.body
%x.036 = phi ptr [ %x.1, %while.body ], [ %p_root, %entry ]
%0 = load i32, ptr %x.036, align 8, !tbaa !10
%cmp3 = icmp sgt i32 %0, %value
%p_left4 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 1
%p_right5 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 2
%x.1.in = select i1 %cmp3, ptr %p_left4, ptr %p_right5
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !15
if.else8: ; preds = %while.body
%p_parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store ptr %x.036, ptr %p_parent, align 8, !tbaa !13
%1 = load i32, ptr %x.036, align 8, !tbaa !10
%cmp11 = icmp sgt i32 %1, %value
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%p_left13 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 1
store ptr %call, ptr %p_left13, align 8, !tbaa !17
br label %if.end17
if.else14: ; preds = %if.else8
%p_right15 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 2
store ptr %call, ptr %p_right15, align 8, !tbaa !18
br label %if.end17
if.end17: ; preds = %while.end.thread, %if.then12, %if.else14
%p_root.addr.0 = phi ptr [ %p_root, %if.then12 ], [ %p_root, %if.else14 ], [ %call, %while.end.thread ]
ret ptr %p_root.addr.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorderTreeWalk(ptr noundef readonly %p_node) local_unnamed_addr #3 {
entry:
%cmp4 = icmp eq ptr %p_node, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%p_node.tr5 = phi ptr [ %2, %if.end ], [ %p_node, %entry ]
%p_left = getelementptr inbounds %struct.node, ptr %p_node.tr5, i64 0, i32 1
%0 = load ptr, ptr %p_left, align 8, !tbaa !17
tail call void @inorderTreeWalk(ptr noundef %0)
%1 = load i32, ptr %p_node.tr5, align 8, !tbaa !10
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %1)
%p_right = getelementptr inbounds %struct.node, ptr %p_node.tr5, i64 0, i32 2
%2 = load ptr, ptr %p_right, align 8, !tbaa !18
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorderTreeWalk(ptr noundef readonly %p_node) local_unnamed_addr #3 {
entry:
%cmp4 = icmp eq ptr %p_node, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%p_node.tr5 = phi ptr [ %2, %if.end ], [ %p_node, %entry ]
%0 = load i32, ptr %p_node.tr5, align 8, !tbaa !10
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %0)
%p_left = getelementptr inbounds %struct.node, ptr %p_node.tr5, i64 0, i32 1
%1 = load ptr, ptr %p_left, align 8, !tbaa !17
tail call void @preorderTreeWalk(ptr noundef %1)
%p_right = getelementptr inbounds %struct.node, ptr %p_node.tr5, i64 0, i32 2
%2 = load ptr, ptr %p_right, align 8, !tbaa !18
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @find(i32 noundef %value, ptr nocapture noundef readonly %p_root) local_unnamed_addr #4 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%p_node.0 = phi ptr [ %p_root, %entry ], [ %p_node.0.be, %while.cond.backedge ]
%0 = load i32, ptr %p_node.0, align 8, !tbaa !10
%cmp = icmp sgt i32 %0, %value
br i1 %cmp, label %if.then, label %if.else4
if.then: ; preds = %while.cond
%p_left = getelementptr inbounds %struct.node, ptr %p_node.0, i64 0, i32 1
%1 = load ptr, ptr %p_left, align 8, !tbaa !17
%cmp1.not = icmp eq ptr %1, null
br i1 %cmp1.not, label %cleanup, label %while.cond.backedge
if.else4: ; preds = %while.cond
%cmp6 = icmp slt i32 %0, %value
br i1 %cmp6, label %if.then7, label %cleanup
if.then7: ; preds = %if.else4
%p_right = getelementptr inbounds %struct.node, ptr %p_node.0, i64 0, i32 2
%2 = load ptr, ptr %p_right, align 8, !tbaa !18
%cmp8.not = icmp eq ptr %2, null
br i1 %cmp8.not, label %cleanup, label %while.cond.backedge
while.cond.backedge: ; preds = %if.then7, %if.then
%p_node.0.be = phi ptr [ %1, %if.then ], [ %2, %if.then7 ]
br label %while.cond
cleanup: ; preds = %if.else4, %if.then7, %if.then
%retval.0 = phi i32 [ 0, %if.then ], [ 0, %if.then7 ], [ 1, %if.else4 ]
ret i32 %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @delete(i32 noundef %value, ptr nocapture noundef %p_root) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %if.end5, %entry
%z.0 = phi ptr [ %p_root, %entry ], [ %z.1, %if.end5 ]
%0 = load i32, ptr %z.0, align 8, !tbaa !10
%cmp = icmp sgt i32 %0, %value
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.cond
%p_left = getelementptr inbounds %struct.node, ptr %z.0, i64 0, i32 1
br label %if.end5
if.else: ; preds = %while.cond
%cmp2 = icmp slt i32 %0, %value
br i1 %cmp2, label %if.then3, label %while.end
if.then3: ; preds = %if.else
%p_right = getelementptr inbounds %struct.node, ptr %z.0, i64 0, i32 2
br label %if.end5
if.end5: ; preds = %if.then3, %if.then
%z.1.in = phi ptr [ %p_left, %if.then ], [ %p_right, %if.then3 ]
%z.1 = load ptr, ptr %z.1.in, align 8, !tbaa !14
br label %while.cond
while.end: ; preds = %if.else
%p_left6 = getelementptr inbounds %struct.node, ptr %z.0, i64 0, i32 1
%1 = load ptr, ptr %p_left6, align 8, !tbaa !17
%cmp7 = icmp eq ptr %1, null
%p_right8 = getelementptr inbounds %struct.node, ptr %z.0, i64 0, i32 2
%2 = load ptr, ptr %p_right8, align 8, !tbaa !18
%cmp9 = icmp eq ptr %2, null
br i1 %cmp7, label %land.lhs.true, label %if.else11.thread
land.lhs.true: ; preds = %while.end
%p_parent.i = getelementptr inbounds %struct.node, ptr %z.0, i64 0, i32 3
%3 = load ptr, ptr %p_parent.i, align 8, !tbaa !13
%4 = load i32, ptr %3, align 8, !tbaa !10
br i1 %cmp9, label %if.then10, label %if.else11
if.then10: ; preds = %land.lhs.true
%cmp.not.i = icmp slt i32 %0, %4
%p_left.i = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 1
%p_right.i = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 2
%p_left.sink.i = select i1 %cmp.not.i, ptr %p_left.i, ptr %p_right.i
store ptr null, ptr %p_left.sink.i, align 8, !tbaa !14
br label %if.end19
if.else11: ; preds = %land.lhs.true
%cmp16.i = icmp sgt i32 %0, %4
br i1 %cmp16.i, label %if.then17.i, label %if.else21.i
if.else11.thread: ; preds = %while.end
br i1 %cmp9, label %if.then16.thread, label %while.cond.i
if.then16.thread: ; preds = %if.else11.thread
%p_parent14.i45 = getelementptr inbounds %struct.node, ptr %z.0, i64 0, i32 3
%5 = load ptr, ptr %p_parent14.i45, align 8, !tbaa !13
%6 = load i32, ptr %5, align 8, !tbaa !10
%cmp16.i46 = icmp sgt i32 %0, %6
br i1 %cmp16.i46, label %if.then3.i, label %if.else.i
if.then3.i: ; preds = %if.then16.thread
%p_right.i33 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 2
store ptr %1, ptr %p_right.i33, align 8, !tbaa !18
br label %deleteHasOneChildNode.exit
if.else.i: ; preds = %if.then16.thread
%p_left8.i = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
store ptr %1, ptr %p_left8.i, align 8, !tbaa !17
%.pre.i = load ptr, ptr %p_left6, align 8, !tbaa !17
br label %deleteHasOneChildNode.exit
if.then17.i: ; preds = %if.else11
%p_right20.i = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 2
store ptr %2, ptr %p_right20.i, align 8, !tbaa !18
%.pre47.i = load ptr, ptr %p_right8, align 8, !tbaa !18
br label %deleteHasOneChildNode.exit
if.else21.i: ; preds = %if.else11
%p_left24.i = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 1
store ptr %2, ptr %p_left24.i, align 8, !tbaa !17
br label %deleteHasOneChildNode.exit
deleteHasOneChildNode.exit: ; preds = %if.then3.i, %if.else.i, %if.then17.i, %if.else21.i
%7 = phi ptr [ %5, %if.else.i ], [ %5, %if.then3.i ], [ %3, %if.else21.i ], [ %3, %if.then17.i ]
%.sink.i = phi ptr [ %.pre.i, %if.else.i ], [ %1, %if.then3.i ], [ %2, %if.else21.i ], [ %.pre47.i, %if.then17.i ]
%p_parent28.i = getelementptr inbounds %struct.node, ptr %.sink.i, i64 0, i32 3
store ptr %7, ptr %p_parent28.i, align 8, !tbaa !13
br label %if.end19
while.cond.i: ; preds = %if.else11.thread, %while.cond.i
%y.0.i = phi ptr [ %8, %while.cond.i ], [ %2, %if.else11.thread ]
%p_left.i36 = getelementptr inbounds %struct.node, ptr %y.0.i, i64 0, i32 1
%8 = load ptr, ptr %p_left.i36, align 8, !tbaa !17
%cmp2.not.i = icmp eq ptr %8, null
br i1 %cmp2.not.i, label %land.lhs.true.i, label %while.cond.i, !llvm.loop !20
land.lhs.true.i: ; preds = %while.cond.i
%9 = load i32, ptr %y.0.i, align 8, !tbaa !10
store i32 %9, ptr %z.0, align 8, !tbaa !10
%p_right7.i = getelementptr inbounds %struct.node, ptr %y.0.i, i64 0, i32 2
%10 = load ptr, ptr %p_right7.i, align 8, !tbaa !18
%cmp8.i = icmp eq ptr %10, null
%11 = load i32, ptr %y.0.i, align 8, !tbaa !10
%p_parent.i.i = getelementptr inbounds %struct.node, ptr %y.0.i, i64 0, i32 3
%12 = load ptr, ptr %p_parent.i.i, align 8, !tbaa !13
%13 = load i32, ptr %12, align 8, !tbaa !10
br i1 %cmp8.i, label %if.then9.i, label %if.else12.i.i
if.then9.i: ; preds = %land.lhs.true.i
%cmp.not.i.i = icmp slt i32 %11, %13
%p_left.i.i = getelementptr inbounds %struct.node, ptr %12, i64 0, i32 1
%p_right.i.i = getelementptr inbounds %struct.node, ptr %12, i64 0, i32 2
%p_left.sink.i.i = select i1 %cmp.not.i.i, ptr %p_left.i.i, ptr %p_right.i.i
store ptr null, ptr %p_left.sink.i.i, align 8, !tbaa !14
br label %if.end19
if.else12.i.i: ; preds = %land.lhs.true.i
%cmp16.i27.i = icmp sgt i32 %11, %13
br i1 %cmp16.i27.i, label %if.then17.i.i, label %if.else21.i.i
if.then17.i.i: ; preds = %if.else12.i.i
%p_right20.i.i = getelementptr inbounds %struct.node, ptr %12, i64 0, i32 2
store ptr %10, ptr %p_right20.i.i, align 8, !tbaa !18
%.pre47.i.i = load ptr, ptr %p_right7.i, align 8, !tbaa !18
br label %deleteHasOneChildNode.exit.i
if.else21.i.i: ; preds = %if.else12.i.i
%p_left24.i.i = getelementptr inbounds %struct.node, ptr %12, i64 0, i32 1
store ptr %10, ptr %p_left24.i.i, align 8, !tbaa !17
br label %deleteHasOneChildNode.exit.i
deleteHasOneChildNode.exit.i: ; preds = %if.else21.i.i, %if.then17.i.i
%.sink.i.i = phi ptr [ %10, %if.else21.i.i ], [ %.pre47.i.i, %if.then17.i.i ]
%p_parent28.i.i = getelementptr inbounds %struct.node, ptr %.sink.i.i, i64 0, i32 3
store ptr %12, ptr %p_parent28.i.i, align 8, !tbaa !13
br label %if.end19
if.end19: ; preds = %deleteHasOneChildNode.exit.i, %if.then9.i, %deleteHasOneChildNode.exit, %if.then10
%z.0.lcssa.sink = phi ptr [ %z.0, %deleteHasOneChildNode.exit ], [ %z.0, %if.then10 ], [ %y.0.i, %if.then9.i ], [ %y.0.i, %deleteHasOneChildNode.exit.i ]
tail call void @free(ptr noundef nonnull %z.0.lcssa.sink) #10
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @deleteHasNoChildNode(ptr nocapture noundef %z) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr %z, align 8, !tbaa !10
%p_parent = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
%1 = load ptr, ptr %p_parent, align 8, !tbaa !13
%2 = load i32, ptr %1, align 8, !tbaa !10
%cmp.not = icmp slt i32 %0, %2
%p_left = getelementptr inbounds %struct.node, ptr %1, i64 0, i32 1
%p_right = getelementptr inbounds %struct.node, ptr %1, i64 0, i32 2
%p_left.sink = select i1 %cmp.not, ptr %p_left, ptr %p_right
store ptr null, ptr %p_left.sink, align 8, !tbaa !14
tail call void @free(ptr noundef nonnull %z) #10
ret void
}
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @deleteHasOneChildNode(ptr nocapture noundef %z) local_unnamed_addr #6 {
entry:
%p_left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %p_left, align 8, !tbaa !17
%cmp.not = icmp eq ptr %0, null
%1 = load i32, ptr %z, align 8, !tbaa !10
%p_parent14 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
%2 = load ptr, ptr %p_parent14, align 8, !tbaa !13
%3 = load i32, ptr %2, align 8, !tbaa !10
%cmp16 = icmp sgt i32 %1, %3
br i1 %cmp.not, label %if.else12, label %if.then
if.then: ; preds = %entry
br i1 %cmp16, label %if.then3, label %if.else
if.then3: ; preds = %if.then
%p_right = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 2
store ptr %0, ptr %p_right, align 8, !tbaa !18
br label %if.end29
if.else: ; preds = %if.then
%p_left8 = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 1
store ptr %0, ptr %p_left8, align 8, !tbaa !17
%.pre = load ptr, ptr %p_left, align 8, !tbaa !17
br label %if.end29
if.else12: ; preds = %entry
%p_right18 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%4 = load ptr, ptr %p_right18, align 8, !tbaa !18
br i1 %cmp16, label %if.then17, label %if.else21
if.then17: ; preds = %if.else12
%p_right20 = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 2
store ptr %4, ptr %p_right20, align 8, !tbaa !18
%.pre47 = load ptr, ptr %p_right18, align 8, !tbaa !18
br label %if.end29
if.else21: ; preds = %if.else12
%p_left24 = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 1
store ptr %4, ptr %p_left24, align 8, !tbaa !17
br label %if.end29
if.end29: ; preds = %if.then17, %if.else21, %if.then3, %if.else
%.sink = phi ptr [ %.pre, %if.else ], [ %0, %if.then3 ], [ %4, %if.else21 ], [ %.pre47, %if.then17 ]
%p_parent28 = getelementptr inbounds %struct.node, ptr %.sink, i64 0, i32 3
store ptr %2, ptr %p_parent28, align 8, !tbaa !13
tail call void @free(ptr noundef nonnull %z) #10
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @deleteHasTwoChildlenNode(ptr nocapture noundef %z) local_unnamed_addr #0 {
entry:
%p_right = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%0 = load ptr, ptr %p_right, align 8, !tbaa !18
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %if.end, label %while.cond
while.cond: ; preds = %entry, %while.cond
%y.0 = phi ptr [ %1, %while.cond ], [ %0, %entry ]
%p_left = getelementptr inbounds %struct.node, ptr %y.0, i64 0, i32 1
%1 = load ptr, ptr %p_left, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %1, null
br i1 %cmp2.not, label %if.end.thread, label %while.cond, !llvm.loop !20
if.end.thread: ; preds = %while.cond
%2 = load i32, ptr %y.0, align 8, !tbaa !10
store i32 %2, ptr %z, align 8, !tbaa !10
br label %land.lhs.true
if.end: ; preds = %entry
%p_parent = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
%3 = load ptr, ptr %p_parent, align 8, !tbaa !13
%p_left5.phi.trans.insert = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 1
%.pre = load ptr, ptr %p_left5.phi.trans.insert, align 8, !tbaa !17
%4 = load i32, ptr %3, align 8, !tbaa !10
store i32 %4, ptr %z, align 8, !tbaa !10
%p_left5 = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 1
%cmp6 = icmp eq ptr %.pre, null
br i1 %cmp6, label %land.lhs.true, label %if.then.i
land.lhs.true: ; preds = %if.end.thread, %if.end
%y.132 = phi ptr [ %y.0, %if.end.thread ], [ %3, %if.end ]
%p_right7 = getelementptr inbounds %struct.node, ptr %y.132, i64 0, i32 2
%5 = load ptr, ptr %p_right7, align 8, !tbaa !18
%cmp8 = icmp eq ptr %5, null
%6 = load i32, ptr %y.132, align 8, !tbaa !10
%p_parent.i = getelementptr inbounds %struct.node, ptr %y.132, i64 0, i32 3
%7 = load ptr, ptr %p_parent.i, align 8, !tbaa !13
%8 = load i32, ptr %7, align 8, !tbaa !10
br i1 %cmp8, label %if.then9, label %if.else12.i
if.then9: ; preds = %land.lhs.true
%cmp.not.i = icmp slt i32 %6, %8
%p_left.i = getelementptr inbounds %struct.node, ptr %7, i64 0, i32 1
%p_right.i = getelementptr inbounds %struct.node, ptr %7, i64 0, i32 2
%p_left.sink.i = select i1 %cmp.not.i, ptr %p_left.i, ptr %p_right.i
store ptr null, ptr %p_left.sink.i, align 8, !tbaa !14
br label %if.end11
if.then.i: ; preds = %if.end
%9 = load i32, ptr %3, align 8, !tbaa !10
%p_parent14.i = getelementptr inbounds %struct.node, ptr %3, i64 0, i32 3
%10 = load ptr, ptr %p_parent14.i, align 8, !tbaa !13
%11 = load i32, ptr %10, align 8, !tbaa !10
%cmp16.i = icmp sgt i32 %9, %11
br i1 %cmp16.i, label %if.then3.i, label %if.else.i
if.then3.i: ; preds = %if.then.i
%p_right.i25 = getelementptr inbounds %struct.node, ptr %10, i64 0, i32 2
store ptr %.pre, ptr %p_right.i25, align 8, !tbaa !18
br label %deleteHasOneChildNode.exit
if.else.i: ; preds = %if.then.i
%p_left8.i = getelementptr inbounds %struct.node, ptr %10, i64 0, i32 1
store ptr %.pre, ptr %p_left8.i, align 8, !tbaa !17
%.pre.i = load ptr, ptr %p_left5, align 8, !tbaa !17
br label %deleteHasOneChildNode.exit
if.else12.i: ; preds = %land.lhs.true
%cmp16.i27 = icmp sgt i32 %6, %8
br i1 %cmp16.i27, label %if.then17.i, label %if.else21.i
if.then17.i: ; preds = %if.else12.i
%p_right20.i = getelementptr inbounds %struct.node, ptr %7, i64 0, i32 2
store ptr %5, ptr %p_right20.i, align 8, !tbaa !18
%.pre47.i = load ptr, ptr %p_right7, align 8, !tbaa !18
br label %deleteHasOneChildNode.exit
if.else21.i: ; preds = %if.else12.i
%p_left24.i = getelementptr inbounds %struct.node, ptr %7, i64 0, i32 1
store ptr %5, ptr %p_left24.i, align 8, !tbaa !17
br label %deleteHasOneChildNode.exit
deleteHasOneChildNode.exit: ; preds = %if.then3.i, %if.else.i, %if.then17.i, %if.else21.i
%y.133 = phi ptr [ %3, %if.else.i ], [ %3, %if.then3.i ], [ %y.132, %if.else21.i ], [ %y.132, %if.then17.i ]
%12 = phi ptr [ %10, %if.else.i ], [ %10, %if.then3.i ], [ %7, %if.else21.i ], [ %7, %if.then17.i ]
%.sink.i = phi ptr [ %.pre.i, %if.else.i ], [ %.pre, %if.then3.i ], [ %5, %if.else21.i ], [ %.pre47.i, %if.then17.i ]
%p_parent28.i = getelementptr inbounds %struct.node, ptr %.sink.i, i64 0, i32 3
store ptr %12, ptr %p_parent28.i, align 8, !tbaa !13
br label %if.end11
if.end11: ; preds = %deleteHasOneChildNode.exit, %if.then9
%y.133.sink = phi ptr [ %y.133, %deleteHasOneChildNode.exit ], [ %y.132, %if.then9 ]
tail call void @free(ptr noundef nonnull %y.133.sink) #10
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #8
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nounwind }
attributes #11 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"node", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 24}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!11, !12, i64 24}
!14 = !{!12, !12, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!11, !12, i64 8}
!18 = !{!11, !12, i64 16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
|
#include <stdio.h>
#include <stdlib.h>
#define MAX 500001
#define NIL NULL
struct node{
int key;
struct node *parent;
struct node *left;
struct node *right;
};
typedef struct node * Node;
Node root;
Node treeMinimum(Node x){
while(x->left!=NIL) x=x->left;
return x;
}
Node treeSearch(Node x, int k){
if(x==NIL||k==x->key)
return x;
if(k<x->key) return treeSearch(x->left,k);
else return treeSearch(x->right,k);
}
Node treeSuccessor(Node x){
Node y;
if(x->right!=NIL) return treeMinimum(x->right);
y=x->parent;
while(y!=NIL&&x==y->right){
x=y;
y=y->parent;
return y;
}
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z->left==NIL||z->right==NIL) y=z;
else y=treeSuccessor(z);
if(y->left!=NIL) x=y->left;
else x=y->right;
if(x!=NIL) x->parent=y->parent;
if(y->parent==NIL) root=x;
else if(y==y->parent->left) y->parent->left=x;
else y->parent->right=x;
if(y!=x) z->key=y->key;
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y=x;
if(z->key<x->key) x=x->left;
else x=x->right;
}
z->parent=y;
if(y==NIL) root=z;
else if(z->key<y->key) y->left=z;
else y->right=z;
}
void inorder(Node x){
if(x!=NIL){
inorder(x->left);
printf(" %d",x->key);
inorder(x->right);
}
}
void preorder(Node x){
if(x!=NIL){
printf(" %d",x->key);
preorder(x->left);
preorder(x->right);
}
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
}
else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
}
else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206780/source.c"
target datalayout = "e-m:e-p270: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.node = type { i32, ptr, ptr, ptr }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %x, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp14 = icmp eq ptr %x, null
br i1 %cmp14, label %return, label %lor.lhs.false
lor.lhs.false: ; preds = %entry, %if.end
%x.tr15 = phi ptr [ %x.tr.be, %if.end ], [ %x, %entry ]
%0 = load i32, ptr %x.tr15, align 8, !tbaa !13
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %return, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %x.tr15, i64 0, i32 2
%right = getelementptr inbounds %struct.node, ptr %x.tr15, i64 0, i32 3
%x.tr.be.in = select i1 %cmp3, ptr %left, ptr %right
%x.tr.be = load ptr, ptr %x.tr.be.in, align 8, !tbaa !14
%cmp = icmp eq ptr %x.tr.be, null
br i1 %cmp, label %return, label %lor.lhs.false
return: ; preds = %lor.lhs.false, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ null, %if.end ], [ %x.tr15, %lor.lhs.false ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%right = getelementptr inbounds %struct.node, ptr %x, i64 0, i32 3
%0 = load ptr, ptr %right, align 8, !tbaa !15
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %if.end, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 2
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !11
if.end: ; preds = %entry
%parent = getelementptr inbounds %struct.node, ptr %x, i64 0, i32 1
%2 = load ptr, ptr %parent, align 8, !tbaa !16
%cmp2.not = icmp eq ptr %2, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %if.end
%right3 = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 3
%3 = load ptr, ptr %right3, align 8, !tbaa !15
%cmp4 = icmp eq ptr %3, %x
br i1 %cmp4, label %while.body, label %cleanup
while.body: ; preds = %land.rhs
%parent5 = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 1
%4 = load ptr, ptr %parent5, align 8, !tbaa !16
br label %cleanup
cleanup: ; preds = %while.cond.i, %land.rhs, %if.end, %while.body
%retval.0 = phi ptr [ %4, %while.body ], [ undef, %if.end ], [ undef, %land.rhs ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%right = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
%1 = load ptr, ptr %right, align 8, !tbaa !15
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 2
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%right7 = getelementptr inbounds %struct.node, ptr %y.0.ph, i64 0, i32 3
%3 = load ptr, ptr %right7, align 8, !tbaa !15
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.058, i64 0, i32 1
%4 = load ptr, ptr %parent, align 8, !tbaa !16
%parent11 = getelementptr inbounds %struct.node, ptr %x.054, i64 0, i32 1
store ptr %4, ptr %parent11, align 8, !tbaa !16
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.060 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 1
%5 = load ptr, ptr %parent13, align 8, !tbaa !16
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 2
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.060, %6
%right25 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 3
%spec.select = select i1 %cmp19, ptr %left18, ptr %right25
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %spec.select, %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !14
%cmp28.not = icmp eq ptr %y.060, %x.055
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%7 = load i32, ptr %y.060, align 8, !tbaa !13
store i32 %7, ptr %z, align 8, !tbaa !13
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !14
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %k, ptr %call, align 8, !tbaa !13
%left = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %left, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%1 = load i32, ptr %x.035, align 8, !tbaa !13
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 2
%right5 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%x.1.in = select i1 %cmp3, ptr %left4, ptr %right5
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !17
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
store ptr null, ptr %parent37, align 8, !tbaa !16
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
store ptr %x.035, ptr %parent, align 8, !tbaa !16
%2 = load i32, ptr %x.035, align 8, !tbaa !13
%cmp11 = icmp sgt i32 %2, %k
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 2
br label %if.end17
if.else14: ; preds = %if.else8
%right15 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
br label %if.end17
if.end17: ; preds = %if.then12, %if.else14, %if.then7
%left13.sink = phi ptr [ %left13, %if.then12 ], [ %right15, %if.else14 ], [ @root, %if.then7 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !14
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
%cmp.not4 = icmp eq ptr %x, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%x.tr5 = phi ptr [ %2, %if.then ], [ %x, %entry ]
%left = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%1 = load i32, ptr %x.tr5, align 8, !tbaa !13
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%right = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 3
%2 = load ptr, ptr %right, align 8, !tbaa !15
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
%cmp.not4 = icmp eq ptr %x, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%x.tr5 = phi ptr [ %2, %if.then ], [ %x, %entry ]
%0 = load i32, ptr %x.tr5, align 8, !tbaa !13
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%right = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 3
%2 = load ptr, ptr %right, align 8, !tbaa !15
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !18
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.066 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !19
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !14
%3 = load i32, ptr %x, align 4, !tbaa !18
%cmp14.i = icmp eq ptr %2, null
br i1 %cmp14.i, label %if.else, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.then, %if.end.i
%x.tr15.i = phi ptr [ %x.tr.be.i, %if.end.i ], [ %2, %if.then ]
%4 = load i32, ptr %x.tr15.i, align 8, !tbaa !13
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %x.tr15.i, i64 0, i32 2
%right.i = getelementptr inbounds %struct.node, ptr %x.tr15.i, i64 0, i32 3
%x.tr.be.in.i = select i1 %cmp3.i, ptr %left.i, ptr %right.i
%x.tr.be.i = load ptr, ptr %x.tr.be.in.i, align 8, !tbaa !14
%cmp.i = icmp eq ptr %x.tr.be.i, null
br i1 %cmp.i, label %if.else, label %lor.lhs.false.i
if.then8: ; preds = %lor.lhs.false.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.end.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !18
%6 = load ptr, ptr @root, align 8, !tbaa !14
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %5, ptr %call.i, align 8, !tbaa !13
%left.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %left.i41, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i
while.body.i: ; preds = %if.then16, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %6, %if.then16 ]
%7 = load i32, ptr %x.035.i, align 8, !tbaa !13
%cmp3.i42 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 2
%right5.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%x.1.in.i = select i1 %cmp3.i42, ptr %left4.i, ptr %right5.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %insert.exit, label %while.body.i, !llvm.loop !17
insert.exit: ; preds = %while.body.i, %if.then16
%x.035.i.lcssa.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i ]
%parent.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 1
store ptr %x.035.i.lcssa.sink, ptr %parent.i, align 8, !tbaa !16
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !14
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !14
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !14
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !14
%11 = load i32, ptr %x, align 4, !tbaa !18
%cmp14.i43 = icmp eq ptr %10, null
br i1 %cmp14.i43, label %treeSearch.exit55, label %lor.lhs.false.i44
lor.lhs.false.i44: ; preds = %if.then31, %if.end.i47
%x.tr15.i45 = phi ptr [ %x.tr.be.i52, %if.end.i47 ], [ %10, %if.then31 ]
%12 = load i32, ptr %x.tr15.i45, align 8, !tbaa !13
%cmp1.i46 = icmp eq i32 %12, %11
br i1 %cmp1.i46, label %treeSearch.exit55, label %if.end.i47
if.end.i47: ; preds = %lor.lhs.false.i44
%cmp3.i48 = icmp sgt i32 %12, %11
%left.i49 = getelementptr inbounds %struct.node, ptr %x.tr15.i45, i64 0, i32 2
%right.i50 = getelementptr inbounds %struct.node, ptr %x.tr15.i45, i64 0, i32 3
%x.tr.be.in.i51 = select i1 %cmp3.i48, ptr %left.i49, ptr %right.i50
%x.tr.be.i52 = load ptr, ptr %x.tr.be.in.i51, align 8, !tbaa !14
%cmp.i53 = icmp eq ptr %x.tr.be.i52, null
br i1 %cmp.i53, label %treeSearch.exit55, label %lor.lhs.false.i44
treeSearch.exit55: ; preds = %lor.lhs.false.i44, %if.end.i47, %if.then31
%retval.0.i54 = phi ptr [ null, %if.then31 ], [ %x.tr15.i45, %lor.lhs.false.i44 ], [ null, %if.end.i47 ]
%left.i56 = getelementptr inbounds %struct.node, ptr %retval.0.i54, i64 0, i32 2
%13 = load ptr, ptr %left.i56, align 8, !tbaa !5
%cmp.i57 = icmp eq ptr %13, null
br i1 %cmp.i57, label %if.end8.i, label %lor.lhs.false.i58
lor.lhs.false.i58: ; preds = %treeSearch.exit55
%right.i59 = getelementptr inbounds %struct.node, ptr %retval.0.i54, i64 0, i32 3
%14 = load ptr, ptr %right.i59, align 8, !tbaa !15
%cmp1.i60 = icmp eq ptr %14, null
br i1 %cmp1.i60, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i58, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i58 ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 2
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit55
%y.0.ph.i = phi ptr [ %retval.0.i54, %treeSearch.exit55 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%right7.i = getelementptr inbounds %struct.node, ptr %y.0.ph.i, i64 0, i32 3
%16 = load ptr, ptr %right7.i, align 8, !tbaa !15
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i58
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %retval.0.i54, %lor.lhs.false.i58 ]
%x.054.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i58 ]
%parent.i61 = getelementptr inbounds %struct.node, ptr %y.058.i, i64 0, i32 1
%17 = load ptr, ptr %parent.i61, align 8, !tbaa !16
%parent11.i = getelementptr inbounds %struct.node, ptr %x.054.i, i64 0, i32 1
store ptr %17, ptr %parent11.i, align 8, !tbaa !16
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.060.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 1
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !16
%cmp14.i62 = icmp eq ptr %18, null
br i1 %cmp14.i62, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 2
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.060.i, %19
%right25.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 3
%spec.select.i = select i1 %cmp19.i, ptr %left18.i, ptr %right25.i
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %spec.select.i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !14
%cmp28.not.i = icmp eq ptr %y.060.i, %x.055.i
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%20 = load i32, ptr %y.060.i, align 8, !tbaa !13
store i32 %20, ptr %retval.0.i54, align 8, !tbaa !13
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.066, 1
%21 = load i32, ptr %n, align 4, !tbaa !18
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !10, i64 16}
!6 = !{!"node", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 0}
!14 = !{!10, !10, i64 0}
!15 = !{!6, !10, i64 24}
!16 = !{!6, !10, i64 8}
!17 = distinct !{!17, !12}
!18 = !{!7, !7, i64 0}
!19 = !{!8, !8, i64 0}
!20 = distinct !{!20, !12}
|
#include <stdio.h>
#include <stdlib.h>
struct Node{
int key;
struct Node *right,*left,*parent;
};
struct Node *root,*NIL;
void insert(int k){
struct Node *y=NIL;
struct Node *x=root;
struct Node *z;
z=(struct Node *)malloc(sizeof(struct Node));
z->key=k;
z->left=NIL;
z->right=NIL;
while(x!=NIL){
y=x;
if(z->key<x->key) x=x->left;
else x=x->right;
}
z->parent=y;
if(y==NIL)root=z;
else if(z->key<y->key) y->left=z;
else y->right=z;
}
struct Node * find(struct Node *x,int k){
while(x!=NIL && k!=x->key){
if(k<x->key) x=x->left;
else x=x->right;
}
return x;
}
struct Node * getMinimum(struct Node *x){
while(x->left!=NIL){
x=x->left;
}
return x;
}
struct Node * getSuccessor(struct Node *x){
if(x->right!=NIL) return getMinimum(x->right);
struct Node *y= x->parent;
while(y!=NIL&&x==y->right){
x=y;
y=y->parent;
}
return y;
}
void delete(struct Node *z){
struct Node *y;
struct Node *x;
if(z->left==NIL || z->right==NIL){
y=z;
} else {
y=getSuccessor(z);
}
if(y->left!=NIL){
x=y->left;
} else {
x=y->right;
}
if(x!=NIL){
x->parent=y->parent;
}
if(y->parent==NIL){
root=x;
} else {
if(y==y->parent->left){
y->parent->left=x;
} else {
y->parent->right=x;
}
}
if (y!=z) {
z->key=y->key;
}
free(y);
}
void inorder(struct Node *u){
if(u==NIL) return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(struct Node *u){
if(u==NIL) return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(){
int n,i,x;
struct Node *fi;
char str[20];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",str);
if(str[0]=='i'){
scanf("%d",&x);
insert(x);
}
else if(str[0]=='p'){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if(str[0]=='f'){
scanf("%d",&x);
fi=find(root,x);
if(fi==NIL) printf("no\n");
else printf("yes\n");
}
else if(str[0]='d'){
scanf("%d",&x);
delete(find(root,x));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206830/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206830/source.c"
target datalayout = "e-m:e-p270: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.Node = type { i32, ptr, ptr, ptr }
@NIL = dso_local local_unnamed_addr global ptr null, align 8
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"yes\00", align 1
@str.6 = private unnamed_addr constant [3 x i8] c"no\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%1 = load ptr, ptr @root, align 8, !tbaa !5
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %k, ptr %call, align 8, !tbaa !9
%left = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 2
store ptr %0, ptr %left, align 8, !tbaa !12
%right = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 1
store ptr %0, ptr %right, align 8, !tbaa !13
%cmp.not34 = icmp eq ptr %1, %0
br i1 %cmp.not34, label %while.end.thread, label %while.body
while.end.thread: ; preds = %entry
%parent37 = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 3
store ptr %0, ptr %parent37, align 8, !tbaa !14
br label %if.end17
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %1, %entry ]
%2 = load i32, ptr %x.035, align 8, !tbaa !9
%cmp3 = icmp sgt i32 %2, %k
%left4 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 2
%right5 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %right5
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.1, %0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body
%parent = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 3
store ptr %x.035, ptr %parent, align 8, !tbaa !14
%cmp6 = icmp eq ptr %x.035, %0
br i1 %cmp6, label %if.end17, label %if.else8
if.else8: ; preds = %while.end
%3 = load i32, ptr %x.035, align 8, !tbaa !9
%cmp11 = icmp sgt i32 %3, %k
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%left13 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 2
br label %if.end17
if.else14: ; preds = %if.else8
%right15 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 1
br label %if.end17
if.end17: ; preds = %while.end, %while.end.thread, %if.then12, %if.else14
%left13.sink = phi ptr [ %left13, %if.then12 ], [ %right15, %if.else14 ], [ @root, %while.end.thread ], [ @root, %while.end ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %x, i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10 = icmp eq ptr %0, %x
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%x.addr.011 = phi ptr [ %x.addr.1, %while.body ], [ %x, %entry ]
%1 = load i32, ptr %x.addr.011, align 8, !tbaa !9
%cmp1.not = icmp eq i32 %1, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %1, %k
%left = getelementptr inbounds %struct.Node, ptr %x.addr.011, i64 0, i32 2
%right = getelementptr inbounds %struct.Node, ptr %x.addr.011, i64 0, i32 1
%x.addr.1.in = select i1 %cmp3, ptr %left, ptr %right
%x.addr.1 = load ptr, ptr %x.addr.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.addr.1, %0
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !17
while.end: ; preds = %land.rhs, %while.body, %entry
%x.addr.0.lcssa = phi ptr [ %x, %entry ], [ %0, %while.body ], [ %x.addr.011, %land.rhs ]
ret ptr %x.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @getMinimum(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%left = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !12
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !18
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @getSuccessor(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
%right = getelementptr inbounds %struct.Node, ptr %x, i64 0, i32 1
%0 = load ptr, ptr %right, align 8, !tbaa !13
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, %1
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %2, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i, i64 0, i32 2
%2 = load ptr, ptr %left.i, align 8, !tbaa !12
%cmp.not.i = icmp eq ptr %2, %1
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !18
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 3
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !14
%cmp2.not = icmp eq ptr %y.0, %0
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%right3 = getelementptr inbounds %struct.Node, ptr %y.0, i64 0, i32 1
%3 = load ptr, ptr %right3, align 8, !tbaa !13
%cmp4 = icmp eq ptr %x.addr.0, %3
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !19
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ %0, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @delete(ptr noundef %z) local_unnamed_addr #4 {
entry:
%left = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !12
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%right = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 1
%2 = load ptr, ptr %right, align 8, !tbaa !13
%cmp1 = icmp eq ptr %2, %1
br i1 %cmp1, label %if.end, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %3, %while.cond.i.i ], [ %2, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i, i64 0, i32 2
%3 = load ptr, ptr %left.i.i, align 8, !tbaa !12
%cmp.not.i.i = icmp eq ptr %3, %1
br i1 %cmp.not.i.i, label %if.else6, label %while.cond.i.i, !llvm.loop !18
if.end: ; preds = %entry, %lor.lhs.false
%cmp3.not = icmp eq ptr %0, %1
br i1 %cmp3.not, label %if.else6, label %if.end8
if.else6: ; preds = %while.cond.i.i, %if.end
%y.057 = phi ptr [ %z, %if.end ], [ %x.addr.0.i.i, %while.cond.i.i ]
%right7 = getelementptr inbounds %struct.Node, ptr %y.057, i64 0, i32 1
%4 = load ptr, ptr %right7, align 8, !tbaa !13
br label %if.end8
if.end8: ; preds = %if.end, %if.else6
%y.056 = phi ptr [ %y.057, %if.else6 ], [ %z, %if.end ]
%x.0 = phi ptr [ %4, %if.else6 ], [ %0, %if.end ]
%cmp9.not = icmp eq ptr %x.0, %1
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %if.end8
%parent = getelementptr inbounds %struct.Node, ptr %y.056, i64 0, i32 3
%5 = load ptr, ptr %parent, align 8, !tbaa !14
%parent11 = getelementptr inbounds %struct.Node, ptr %x.0, i64 0, i32 3
store ptr %5, ptr %parent11, align 8, !tbaa !14
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%parent13 = getelementptr inbounds %struct.Node, ptr %y.056, i64 0, i32 3
%6 = load ptr, ptr %parent13, align 8, !tbaa !14
%cmp14 = icmp eq ptr %6, %1
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.Node, ptr %6, i64 0, i32 2
%7 = load ptr, ptr %left18, align 8, !tbaa !12
%cmp19 = icmp eq ptr %y.056, %7
%right25 = getelementptr inbounds %struct.Node, ptr %6, i64 0, i32 1
%spec.select = select i1 %cmp19, ptr %left18, ptr %right25
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %spec.select, %if.else16 ]
store ptr %x.0, ptr %left18.sink, align 8, !tbaa !5
%cmp28.not = icmp eq ptr %y.056, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%8 = load i32, ptr %y.056, align 8, !tbaa !9
store i32 %8, ptr %z, align 8, !tbaa !9
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
tail call void @free(ptr noundef nonnull %y.056) #9
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !12
tail call void @inorder(ptr noundef %1)
%2 = load i32, ptr %u.tr5, align 8, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%right = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 1
%3 = load ptr, ptr %right, align 8, !tbaa !13
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%1 = load i32, ptr %u.tr5, align 8, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%left = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 2
%2 = load ptr, ptr %left, align 8, !tbaa !12
tail call void @preorder(ptr noundef %2)
%right = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 1
%3 = load ptr, ptr %right, align 8, !tbaa !13
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%str = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %str) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.066 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %str)
%1 = load i8, ptr %str, align 16, !tbaa !21
switch i8 %1, label %if.else26 [
i8 105, label %if.then
i8 112, label %if.then9
i8 102, label %if.then17
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load i32, ptr %x, align 4, !tbaa !20
%3 = load ptr, ptr @NIL, align 8, !tbaa !5
%4 = load ptr, ptr @root, align 8, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %2, ptr %call.i, align 8, !tbaa !9
%left.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 2
store ptr %3, ptr %left.i, align 8, !tbaa !12
%right.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 1
store ptr %3, ptr %right.i, align 8, !tbaa !13
%cmp.not34.i = icmp eq ptr %4, %3
br i1 %cmp.not34.i, label %while.end.thread.i, label %while.body.i
while.end.thread.i: ; preds = %if.then
%parent37.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 3
store ptr %3, ptr %parent37.i, align 8, !tbaa !14
br label %insert.exit
while.body.i: ; preds = %if.then, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %4, %if.then ]
%5 = load i32, ptr %x.035.i, align 8, !tbaa !9
%cmp3.i = icmp sgt i32 %5, %2
%left4.i = getelementptr inbounds %struct.Node, ptr %x.035.i, i64 0, i32 2
%right5.i = getelementptr inbounds %struct.Node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i, ptr %left4.i, ptr %right5.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %x.1.i, %3
br i1 %cmp.not.i, label %while.end.i, label %while.body.i, !llvm.loop !15
while.end.i: ; preds = %while.body.i
%parent.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 3
store ptr %x.035.i, ptr %parent.i, align 8, !tbaa !14
%cmp6.i = icmp eq ptr %x.035.i, %3
%spec.select63 = select i1 %cmp6.i, ptr @root, ptr %x.1.in.i
br label %insert.exit
insert.exit: ; preds = %while.end.i, %while.end.thread.i
%left13.sink.i = phi ptr [ @root, %while.end.thread.i ], [ %spec.select63, %while.end.i ]
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !5
br label %for.inc
if.then9: ; preds = %for.body
%6 = load ptr, ptr @root, align 8, !tbaa !5
call void @inorder(ptr noundef %6)
%putchar = call i32 @putchar(i32 10)
%7 = load ptr, ptr @root, align 8, !tbaa !5
call void @preorder(ptr noundef %7)
%putchar37 = call i32 @putchar(i32 10)
br label %for.inc
if.then17: ; preds = %for.body
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%8 = load ptr, ptr @root, align 8, !tbaa !5
%9 = load i32, ptr %x, align 4, !tbaa !20
%10 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i = icmp eq ptr %10, %8
br i1 %cmp.not10.i, label %find.exit, label %land.rhs.i
land.rhs.i: ; preds = %if.then17, %while.body.i38
%x.addr.011.i = phi ptr [ %x.addr.1.i, %while.body.i38 ], [ %8, %if.then17 ]
%11 = load i32, ptr %x.addr.011.i, align 8, !tbaa !9
%cmp1.not.i = icmp eq i32 %11, %9
br i1 %cmp1.not.i, label %find.exit, label %while.body.i38
while.body.i38: ; preds = %land.rhs.i
%cmp3.i39 = icmp sgt i32 %11, %9
%left.i40 = getelementptr inbounds %struct.Node, ptr %x.addr.011.i, i64 0, i32 2
%right.i41 = getelementptr inbounds %struct.Node, ptr %x.addr.011.i, i64 0, i32 1
%x.addr.1.in.i = select i1 %cmp3.i39, ptr %left.i40, ptr %right.i41
%x.addr.1.i = load ptr, ptr %x.addr.1.in.i, align 8, !tbaa !5
%cmp.not.i42 = icmp eq ptr %x.addr.1.i, %10
br i1 %cmp.not.i42, label %if.then22, label %land.rhs.i, !llvm.loop !17
find.exit: ; preds = %land.rhs.i, %if.then17
%x.addr.0.lcssa.i = phi ptr [ %8, %if.then17 ], [ %x.addr.011.i, %land.rhs.i ]
%cmp20 = icmp eq ptr %x.addr.0.lcssa.i, %10
br i1 %cmp20, label %if.then22, label %if.else24
if.then22: ; preds = %while.body.i38, %find.exit
%puts36 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else24: ; preds = %find.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.else26: ; preds = %for.body
store i8 100, ptr %str, align 16, !tbaa !21
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%12 = load ptr, ptr @root, align 8, !tbaa !5
%13 = load i32, ptr %x, align 4, !tbaa !20
%14 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i44 = icmp eq ptr %14, %12
br i1 %cmp.not10.i44, label %find.exit57, label %land.rhs.i45
land.rhs.i45: ; preds = %if.else26, %while.body.i48
%x.addr.011.i46 = phi ptr [ %x.addr.1.i53, %while.body.i48 ], [ %12, %if.else26 ]
%15 = load i32, ptr %x.addr.011.i46, align 8, !tbaa !9
%cmp1.not.i47 = icmp eq i32 %15, %13
br i1 %cmp1.not.i47, label %find.exit57, label %while.body.i48
while.body.i48: ; preds = %land.rhs.i45
%cmp3.i49 = icmp sgt i32 %15, %13
%left.i50 = getelementptr inbounds %struct.Node, ptr %x.addr.011.i46, i64 0, i32 2
%right.i51 = getelementptr inbounds %struct.Node, ptr %x.addr.011.i46, i64 0, i32 1
%x.addr.1.in.i52 = select i1 %cmp3.i49, ptr %left.i50, ptr %right.i51
%x.addr.1.i53 = load ptr, ptr %x.addr.1.in.i52, align 8, !tbaa !5
%cmp.not.i54 = icmp eq ptr %x.addr.1.i53, %14
br i1 %cmp.not.i54, label %find.exit57, label %land.rhs.i45, !llvm.loop !17
find.exit57: ; preds = %land.rhs.i45, %while.body.i48, %if.else26
%x.addr.0.lcssa.i56 = phi ptr [ %12, %if.else26 ], [ %x.addr.011.i46, %land.rhs.i45 ], [ %14, %while.body.i48 ]
%left.i58 = getelementptr inbounds %struct.Node, ptr %x.addr.0.lcssa.i56, i64 0, i32 2
%16 = load ptr, ptr %left.i58, align 8, !tbaa !12
%cmp.i = icmp eq ptr %16, %14
br i1 %cmp.i, label %if.else6.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %find.exit57
%right.i59 = getelementptr inbounds %struct.Node, ptr %x.addr.0.lcssa.i56, i64 0, i32 1
%17 = load ptr, ptr %right.i59, align 8, !tbaa !13
%cmp1.i = icmp eq ptr %17, %14
br i1 %cmp1.i, label %if.end8.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %18, %while.cond.i.i.i ], [ %17, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i.i, i64 0, i32 2
%18 = load ptr, ptr %left.i.i.i, align 8, !tbaa !12
%cmp.not.i.i.i = icmp eq ptr %18, %14
br i1 %cmp.not.i.i.i, label %if.else6.i, label %while.cond.i.i.i, !llvm.loop !18
if.else6.i: ; preds = %while.cond.i.i.i, %find.exit57
%y.057.i = phi ptr [ %x.addr.0.lcssa.i56, %find.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%right7.i = getelementptr inbounds %struct.Node, ptr %y.057.i, i64 0, i32 1
%19 = load ptr, ptr %right7.i, align 8, !tbaa !13
br label %if.end8.i
if.end8.i: ; preds = %lor.lhs.false.i, %if.else6.i
%y.056.i = phi ptr [ %y.057.i, %if.else6.i ], [ %x.addr.0.lcssa.i56, %lor.lhs.false.i ]
%x.0.i = phi ptr [ %19, %if.else6.i ], [ %16, %lor.lhs.false.i ]
%cmp9.not.i = icmp eq ptr %x.0.i, %14
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i
%parent.i60 = getelementptr inbounds %struct.Node, ptr %y.056.i, i64 0, i32 3
%20 = load ptr, ptr %parent.i60, align 8, !tbaa !14
%parent11.i = getelementptr inbounds %struct.Node, ptr %x.0.i, i64 0, i32 3
store ptr %20, ptr %parent11.i, align 8, !tbaa !14
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%parent13.i = getelementptr inbounds %struct.Node, ptr %y.056.i, i64 0, i32 3
%21 = load ptr, ptr %parent13.i, align 8, !tbaa !14
%cmp14.i = icmp eq ptr %21, %14
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.Node, ptr %21, i64 0, i32 2
%22 = load ptr, ptr %left18.i, align 8, !tbaa !12
%cmp19.i = icmp eq ptr %y.056.i, %22
%right25.i = getelementptr inbounds %struct.Node, ptr %21, i64 0, i32 1
%spec.select.i = select i1 %cmp19.i, ptr %left18.i, ptr %right25.i
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %spec.select.i, %if.else16.i ]
store ptr %x.0.i, ptr %left18.sink.i, align 8, !tbaa !5
%cmp28.not.i = icmp eq ptr %y.056.i, %x.addr.0.lcssa.i56
br i1 %cmp28.not.i, label %delete.exit, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%23 = load i32, ptr %y.056.i, align 8, !tbaa !9
store i32 %23, ptr %x.addr.0.lcssa.i56, align 8, !tbaa !9
br label %delete.exit
delete.exit: ; preds = %if.end27.i, %if.then29.i
call void @free(ptr noundef nonnull %y.056.i) #9
br label %for.inc
for.inc: ; preds = %insert.exit, %delete.exit, %if.else24, %if.then22, %if.then9
%inc = add nuw nsw i32 %i.066, 1
%24 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %24
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %str) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"Node", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = !{!10, !6, i64 8}
!14 = !{!10, !6, i64 24}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = !{!11, !11, i64 0}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !16}
|
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>
#define NIL NULL
#define TREE_VALUE INT_MAX
typedef struct Node* NodePointer;
typedef NodePointer Tree;
typedef struct Node {
int key;
NodePointer p, left, right;
} Node;
NodePointer makeNode(int key) {
NodePointer node = (NodePointer)malloc(sizeof(Node));
node->key = key;
node->p = node->left = node->right = NIL;
return node;
}
void treeInsert(Tree tree, NodePointer z) {
NodePointer y = NIL;
NodePointer x = tree->left;
while(x != NIL) {
y = x;
if(z->key < x->key) {
x = x->left;
} else {
x = x->right;
}
}
z->p = y;
if(y == NIL) {
tree->left = z; // if T is empty
} else if(z->key < y->key) {
y->left = z;
} else {
y->right = z;
}
}
void printInorder(NodePointer node) {
if(node->left != NIL) printInorder(node->left);
if(node->key != TREE_VALUE) printf(" %d", node->key);
if(node->right != NIL) printInorder(node->right);
}
void printPreorder(NodePointer node) {
if(node->key != TREE_VALUE) printf(" %d", node->key);
if(node->left != NIL) printPreorder(node->left);
if(node->right != NIL) printPreorder(node->right);
}
NodePointer find(NodePointer node, int key) {
if(node == NIL) return NIL;
if(node->key == key) return node;
else if(key < node->key)
return find(node->left, key);
else
return find(node->right, key);
}
NodePointer treeMinimum(NodePointer x) {
while(x->left != NIL) {
x = x->left;
}
return x;
}
NodePointer treeSuccessor(NodePointer x) {
NodePointer y;
if(x->right != NIL)
return treeMinimum(x->right);
y = x->p;
while(y != NIL && x == y->right) {
x = y;
y = y->p;
}
return y;
}
void treeDelete(Tree T, NodePointer z) {
NodePointer x, y;
if(z->left == NIL || z->right == NIL)
y = z;
else
y = treeSuccessor(z);
if(y->left != NIL)
x = y->left;
else
x = y->right;
if(x != NIL)
x->p = y->p;
if(y->p == NIL)
T->left = x;
else if(y == y->p->left)
y->p->left = x;
else
y->p->right = x;
if(y != z)
z->key = y->key;
}
int main() {
int N, key;
char str[10];
Tree tree;
// initialize tree
tree = makeNode(TREE_VALUE);
scanf("%d", &N);
while(N--) {
scanf("%s", str);
if(str[0] == 'i') {
scanf("%d", &key);
treeInsert(tree, makeNode(key));
} else if(str[0] == 'p') {
printInorder(tree);
printf("\n");
printPreorder(tree);
printf("\n");
} else if(str[0] == 'f') {
scanf("%d", &key);
printf(find(tree,key)?"yes\n":"no\n");
} else {
scanf("%d", &key);
treeDelete(tree, find(tree,key));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206874/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206874/source.c"
target datalayout = "e-m:e-p270: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.Node = type { i32, ptr, ptr, ptr }
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"yes\0A\00", align 1
@.str.5 = private unnamed_addr constant [4 x i8] c"no\0A\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @makeNode(i32 noundef %key) local_unnamed_addr #0 {
entry:
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
store i32 %key, ptr %call, align 8, !tbaa !5
%p = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %p, i8 0, i64 24, i1 false)
ret ptr %call
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeInsert(ptr nocapture noundef %tree, ptr noundef %z) local_unnamed_addr #3 {
entry:
%left = getelementptr inbounds %struct.Node, ptr %tree, i64 0, i32 2
%x.031 = load ptr, ptr %left, align 8, !tbaa !11
%cmp.not32 = icmp eq ptr %x.031, null
br i1 %cmp.not32, label %if.then5, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%0 = load i32, ptr %z, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%x.033 = phi ptr [ %x.031, %while.body.lr.ph ], [ %x.0, %while.body ]
%1 = load i32, ptr %x.033, align 8, !tbaa !5
%cmp2 = icmp slt i32 %0, %1
%left3 = getelementptr inbounds %struct.Node, ptr %x.033, i64 0, i32 2
%right = getelementptr inbounds %struct.Node, ptr %x.033, i64 0, i32 3
%x.1.in = select i1 %cmp2, ptr %left3, ptr %right
%x.0 = load ptr, ptr %x.1.in, align 8, !tbaa !11
%cmp.not = icmp eq ptr %x.0, null
br i1 %cmp.not, label %if.else7, label %while.body, !llvm.loop !12
if.then5: ; preds = %entry
%p35 = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 1
store ptr null, ptr %p35, align 8, !tbaa !14
br label %if.end16
if.else7: ; preds = %while.body
%p = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 1
store ptr %x.033, ptr %p, align 8, !tbaa !14
%2 = load i32, ptr %z, align 8, !tbaa !5
%3 = load i32, ptr %x.033, align 8, !tbaa !5
%cmp10 = icmp slt i32 %2, %3
br i1 %cmp10, label %if.then11, label %if.else13
if.then11: ; preds = %if.else7
%left12 = getelementptr inbounds %struct.Node, ptr %x.033, i64 0, i32 2
br label %if.end16
if.else13: ; preds = %if.else7
%right14 = getelementptr inbounds %struct.Node, ptr %x.033, i64 0, i32 3
br label %if.end16
if.end16: ; preds = %if.then11, %if.else13, %if.then5
%left12.sink = phi ptr [ %left12, %if.then11 ], [ %right14, %if.else13 ], [ %left, %if.then5 ]
store ptr %z, ptr %left12.sink, align 8, !tbaa !11
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printInorder(ptr nocapture noundef readonly %node) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end5, %entry
%node.tr = phi ptr [ %node, %entry ], [ %2, %if.end5 ]
%left = getelementptr inbounds %struct.Node, ptr %node.tr, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !15
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
tail call void @printInorder(ptr noundef nonnull %0)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%1 = load i32, ptr %node.tr, align 8, !tbaa !5
%cmp2.not = icmp eq i32 %1, 2147483647
br i1 %cmp2.not, label %if.end5, label %if.then3
if.then3: ; preds = %if.end
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%right = getelementptr inbounds %struct.Node, ptr %node.tr, i64 0, i32 3
%2 = load ptr, ptr %right, align 8, !tbaa !16
%cmp6.not = icmp eq ptr %2, null
br i1 %cmp6.not, label %if.end9, label %tailrecurse
if.end9: ; preds = %if.end5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @printPreorder(ptr nocapture noundef readonly %node) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end5, %entry
%node.tr = phi ptr [ %node, %entry ], [ %2, %if.end5 ]
%0 = load i32, ptr %node.tr, align 8, !tbaa !5
%cmp.not = icmp eq i32 %0, 2147483647
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%left = getelementptr inbounds %struct.Node, ptr %node.tr, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !15
%cmp2.not = icmp eq ptr %1, null
br i1 %cmp2.not, label %if.end5, label %if.then3
if.then3: ; preds = %if.end
tail call void @printPreorder(ptr noundef nonnull %1)
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%right = getelementptr inbounds %struct.Node, ptr %node.tr, i64 0, i32 3
%2 = load ptr, ptr %right, align 8, !tbaa !16
%cmp6.not = icmp eq ptr %2, null
br i1 %cmp6.not, label %if.end9, label %tailrecurse
if.end9: ; preds = %if.end5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %node, i32 noundef %key) local_unnamed_addr #6 {
entry:
%cmp17 = icmp eq ptr %node, null
br i1 %cmp17, label %return, label %if.end
if.end: ; preds = %entry, %if.else
%node.tr18 = phi ptr [ %node.tr.be, %if.else ], [ %node, %entry ]
%0 = load i32, ptr %node.tr18, align 8, !tbaa !5
%cmp2 = icmp eq i32 %0, %key
br i1 %cmp2, label %return, label %if.else
if.else: ; preds = %if.end
%cmp5 = icmp sgt i32 %0, %key
%left = getelementptr inbounds %struct.Node, ptr %node.tr18, i64 0, i32 2
%right = getelementptr inbounds %struct.Node, ptr %node.tr18, i64 0, i32 3
%node.tr.be.in = select i1 %cmp5, ptr %left, ptr %right
%node.tr.be = load ptr, ptr %node.tr.be.in, align 8, !tbaa !11
%cmp = icmp eq ptr %node.tr.be, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.else, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ %node.tr18, %if.end ], [ null, %if.else ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #6 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !15
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !17
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #6 {
entry:
%right = getelementptr inbounds %struct.Node, ptr %x, i64 0, i32 3
%0 = load ptr, ptr %right, align 8, !tbaa !16
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i, i64 0, i32 2
%1 = load ptr, ptr %left.i, align 8, !tbaa !15
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !17
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 1
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !14
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%right3 = getelementptr inbounds %struct.Node, ptr %y.0, i64 0, i32 3
%2 = load ptr, ptr %right3, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !18
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr nocapture noundef writeonly %T, ptr noundef %z) local_unnamed_addr #3 {
entry:
%left = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !15
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%right = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 3
%1 = load ptr, ptr %right, align 8, !tbaa !16
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i, i64 0, i32 2
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !15
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !17
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%right7 = getelementptr inbounds %struct.Node, ptr %y.0.ph, i64 0, i32 3
%3 = load ptr, ptr %right7, align 8, !tbaa !16
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.059 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.055 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%p = getelementptr inbounds %struct.Node, ptr %y.059, i64 0, i32 1
%4 = load ptr, ptr %p, align 8, !tbaa !14
%p11 = getelementptr inbounds %struct.Node, ptr %x.055, i64 0, i32 1
store ptr %4, ptr %p11, align 8, !tbaa !14
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.061 = phi ptr [ %y.059, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.056 = phi ptr [ %x.055, %if.then10 ], [ null, %if.end8 ]
%p13 = getelementptr inbounds %struct.Node, ptr %y.061, i64 0, i32 1
%5 = load ptr, ptr %p13, align 8, !tbaa !14
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.then15, label %if.else17
if.then15: ; preds = %if.end12
%left16 = getelementptr inbounds %struct.Node, ptr %T, i64 0, i32 2
br label %if.end28
if.else17: ; preds = %if.end12
%left19 = getelementptr inbounds %struct.Node, ptr %5, i64 0, i32 2
%6 = load ptr, ptr %left19, align 8, !tbaa !15
%cmp20 = icmp eq ptr %y.061, %6
%right26 = getelementptr inbounds %struct.Node, ptr %5, i64 0, i32 3
%spec.select = select i1 %cmp20, ptr %left19, ptr %right26
br label %if.end28
if.end28: ; preds = %if.else17, %if.then15
%left19.sink = phi ptr [ %left16, %if.then15 ], [ %spec.select, %if.else17 ]
store ptr %x.056, ptr %left19.sink, align 8, !tbaa !11
%cmp29.not = icmp eq ptr %y.061, %z
br i1 %cmp29.not, label %if.end32, label %if.then30
if.then30: ; preds = %if.end28
%7 = load i32, ptr %y.061, align 8, !tbaa !5
store i32 %7, ptr %z, align 8, !tbaa !5
br label %if.end32
if.end32: ; preds = %if.then30, %if.end28
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%N = alloca i32, align 4
%key = alloca i32, align 4
%str = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #10
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %str) #10
%call.i = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
store i32 2147483647, ptr %call.i, align 8, !tbaa !5
%p.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %p.i, i8 0, i64 24, i1 false)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !19
%dec57 = add nsw i32 %0, -1
store i32 %dec57, ptr %N, align 4, !tbaa !19
%tobool.not58 = icmp eq i32 %0, 0
br i1 %tobool.not58, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%left.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end27
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %str)
%1 = load i8, ptr %str, align 1, !tbaa !20
switch i8 %1, label %if.else23 [
i8 105, label %if.then
i8 112, label %if.then10
i8 102, label %if.then18
]
if.then: ; preds = %while.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %key)
%2 = load i32, ptr %key, align 4, !tbaa !19
%call.i34 = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
store i32 %2, ptr %call.i34, align 8, !tbaa !5
%p.i35 = getelementptr inbounds %struct.Node, ptr %call.i34, i64 0, i32 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %p.i35, i8 0, i64 24, i1 false)
%x.031.i = load ptr, ptr %left.i, align 8, !tbaa !11
%cmp.not32.i = icmp eq ptr %x.031.i, null
br i1 %cmp.not32.i, label %treeInsert.exit, label %while.body.i
while.body.i: ; preds = %if.then, %while.body.i
%x.033.i = phi ptr [ %x.0.i, %while.body.i ], [ %x.031.i, %if.then ]
%3 = load i32, ptr %x.033.i, align 8, !tbaa !5
%cmp2.i = icmp slt i32 %2, %3
%left3.i = getelementptr inbounds %struct.Node, ptr %x.033.i, i64 0, i32 2
%right.i = getelementptr inbounds %struct.Node, ptr %x.033.i, i64 0, i32 3
%x.1.in.i = select i1 %cmp2.i, ptr %left3.i, ptr %right.i
%x.0.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !11
%cmp.not.i = icmp eq ptr %x.0.i, null
br i1 %cmp.not.i, label %treeInsert.exit, label %while.body.i, !llvm.loop !12
treeInsert.exit: ; preds = %while.body.i, %if.then
%storemerge = phi ptr [ null, %if.then ], [ %x.033.i, %while.body.i ]
%left12.sink.i = phi ptr [ %left.i, %if.then ], [ %x.1.in.i, %while.body.i ]
store ptr %storemerge, ptr %p.i35, align 8, !tbaa !14
store ptr %call.i34, ptr %left12.sink.i, align 8, !tbaa !11
br label %if.end27
if.then10: ; preds = %while.body
call void @printInorder(ptr noundef nonnull %call.i)
%putchar = call i32 @putchar(i32 10)
call void @printPreorder(ptr noundef nonnull %call.i)
%putchar33 = call i32 @putchar(i32 10)
br label %if.end27
if.then18: ; preds = %while.body
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %key)
%4 = load i32, ptr %key, align 4, !tbaa !19
br label %if.end.i
if.end.i: ; preds = %if.then18, %if.else.i
%node.tr18.i = phi ptr [ %node.tr.be.i, %if.else.i ], [ %call.i, %if.then18 ]
%5 = load i32, ptr %node.tr18.i, align 8, !tbaa !5
%cmp2.i37.not = icmp eq i32 %5, %4
br i1 %cmp2.i37.not, label %find.exit, label %if.else.i
if.else.i: ; preds = %if.end.i
%cmp5.i = icmp sgt i32 %5, %4
%left.i38 = getelementptr inbounds %struct.Node, ptr %node.tr18.i, i64 0, i32 2
%right.i39 = getelementptr inbounds %struct.Node, ptr %node.tr18.i, i64 0, i32 3
%node.tr.be.in.i = select i1 %cmp5.i, ptr %left.i38, ptr %right.i39
%node.tr.be.i = load ptr, ptr %node.tr.be.in.i, align 8, !tbaa !11
%cmp.i = icmp eq ptr %node.tr.be.i, null
br i1 %cmp.i, label %find.exit, label %if.end.i
find.exit: ; preds = %if.end.i, %if.else.i
%cond = phi ptr [ @.str.4, %if.end.i ], [ @.str.5, %if.else.i ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
br label %if.end27
if.else23: ; preds = %while.body
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %key)
%6 = load i32, ptr %key, align 4, !tbaa !19
br label %if.end.i41
if.end.i41: ; preds = %if.else23, %if.else.i44
%node.tr18.i42 = phi ptr [ %node.tr.be.i49, %if.else.i44 ], [ %call.i, %if.else23 ]
%7 = load i32, ptr %node.tr18.i42, align 8, !tbaa !5
%cmp2.i43 = icmp eq i32 %7, %6
br i1 %cmp2.i43, label %find.exit52, label %if.else.i44
if.else.i44: ; preds = %if.end.i41
%cmp5.i45 = icmp sgt i32 %7, %6
%left.i46 = getelementptr inbounds %struct.Node, ptr %node.tr18.i42, i64 0, i32 2
%right.i47 = getelementptr inbounds %struct.Node, ptr %node.tr18.i42, i64 0, i32 3
%node.tr.be.in.i48 = select i1 %cmp5.i45, ptr %left.i46, ptr %right.i47
%node.tr.be.i49 = load ptr, ptr %node.tr.be.in.i48, align 8, !tbaa !11
%cmp.i50 = icmp eq ptr %node.tr.be.i49, null
br i1 %cmp.i50, label %find.exit52, label %if.end.i41
find.exit52: ; preds = %if.end.i41, %if.else.i44
%retval.0.i51 = phi ptr [ %node.tr18.i42, %if.end.i41 ], [ null, %if.else.i44 ]
%left.i53 = getelementptr inbounds %struct.Node, ptr %retval.0.i51, i64 0, i32 2
%8 = load ptr, ptr %left.i53, align 8, !tbaa !15
%cmp.i54 = icmp eq ptr %8, null
br i1 %cmp.i54, label %if.end8.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %find.exit52
%right.i55 = getelementptr inbounds %struct.Node, ptr %retval.0.i51, i64 0, i32 3
%9 = load ptr, ptr %right.i55, align 8, !tbaa !16
%cmp1.i = icmp eq ptr %9, null
br i1 %cmp1.i, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %10, %while.cond.i.i.i ], [ %9, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i.i, i64 0, i32 2
%10 = load ptr, ptr %left.i.i.i, align 8, !tbaa !15
%cmp.not.i.i.i = icmp eq ptr %10, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !17
if.end8.i: ; preds = %while.cond.i.i.i, %find.exit52
%y.0.ph.i = phi ptr [ %retval.0.i51, %find.exit52 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%right7.i = getelementptr inbounds %struct.Node, ptr %y.0.ph.i, i64 0, i32 3
%11 = load ptr, ptr %right7.i, align 8, !tbaa !16
%cmp9.not.i = icmp eq ptr %11, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i
%y.059.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %retval.0.i51, %lor.lhs.false.i ]
%x.055.i = phi ptr [ %11, %if.end8.i ], [ %8, %lor.lhs.false.i ]
%p.i56 = getelementptr inbounds %struct.Node, ptr %y.059.i, i64 0, i32 1
%12 = load ptr, ptr %p.i56, align 8, !tbaa !14
%p11.i = getelementptr inbounds %struct.Node, ptr %x.055.i, i64 0, i32 1
store ptr %12, ptr %p11.i, align 8, !tbaa !14
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.061.i = phi ptr [ %y.059.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.056.i = phi ptr [ %x.055.i, %if.then10.i ], [ null, %if.end8.i ]
%p13.i = getelementptr inbounds %struct.Node, ptr %y.061.i, i64 0, i32 1
%13 = load ptr, ptr %p13.i, align 8, !tbaa !14
%cmp14.i = icmp eq ptr %13, null
br i1 %cmp14.i, label %if.end28.i, label %if.else17.i
if.else17.i: ; preds = %if.end12.i
%left19.i = getelementptr inbounds %struct.Node, ptr %13, i64 0, i32 2
%14 = load ptr, ptr %left19.i, align 8, !tbaa !15
%cmp20.i = icmp eq ptr %y.061.i, %14
%right26.i = getelementptr inbounds %struct.Node, ptr %13, i64 0, i32 3
%spec.select.i = select i1 %cmp20.i, ptr %left19.i, ptr %right26.i
br label %if.end28.i
if.end28.i: ; preds = %if.end12.i, %if.else17.i
%left19.sink.i = phi ptr [ %spec.select.i, %if.else17.i ], [ %left.i, %if.end12.i ]
store ptr %x.056.i, ptr %left19.sink.i, align 8, !tbaa !11
%cmp29.not.i = icmp eq ptr %y.061.i, %retval.0.i51
br i1 %cmp29.not.i, label %if.end27, label %if.then30.i
if.then30.i: ; preds = %if.end28.i
%15 = load i32, ptr %y.061.i, align 8, !tbaa !5
store i32 %15, ptr %retval.0.i51, align 8, !tbaa !5
br label %if.end27
if.end27: ; preds = %if.then30.i, %if.end28.i, %if.then10, %find.exit, %treeInsert.exit
%16 = load i32, ptr %N, align 4, !tbaa !19
%dec = add nsw i32 %16, -1
store i32 %dec, ptr %N, align 4, !tbaa !19
%tobool.not = icmp eq i32 %16, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !21
while.end: ; preds = %if.end27, %entry
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %str) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #10
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE 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 = !{!"Node", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !10, i64 8}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !10, i64 24}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = !{!7, !7, i64 0}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !13}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
int count =0;
int count2 = 0;
Node treeMinimum(Node x){
while (x->left != NIL){
x = x->left;
}
return x;
}
Node IterativetreeSearch(Node u, int k){
while(u !=NIL && k !=u->key){
if(k < u->key){
u = u->left;
}
else u = u->right;
}
return u;
}
/*
Node treeSearch(Node u, int k){
if(u == NIL || k == u->key) return u;
if(k < u->key)
return treeSearch(u->left,k);
else return treeSearch(u->right,k);
}*/
Node treeSuccessor(Node x){
Node y;
if(x->right != NIL){
return treeMinimum(x->right);
}
y = x->parent;
while(y != NIL && x == y->right){
x = y;
y = y->parent;
}
return y;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z->left == NIL || z->right == NIL){
y = z;
}
else {
y = treeSuccessor(z);
}
if(y->left != NIL){
x = y->left;
}
else {
x = y->right;
}
if(x != NIL){
x->parent = y->parent;
}
if(y->parent == NIL){
root = x;
}
else if(y == y-> parent ->left){
y->parent->left =x;
}
else y-> parent -> right = x;
if(y != z){
z->key = y->key;
}
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x != NIL){
y = x;
if(z->key < x->key){
x = x->left;
}
else x = x->right;
}
z->parent = y;
if(y == NIL){
root = z;
}
else if (z->key < y->key){
y->left = z;
}
else y->right = z;
}
void inorder(Node u){
if(u != NIL){
inorder(u->left);
printf(" ");
printf("%d",u->key);
inorder(u->right);
}
}
void preorder(Node u){
if (u != NIL) {
printf(" ");
printf("%d",u->key);
preorder(u->left);
preorder(u->right);
}
}
int main(){
int n, i, x;
//int ,num[500000];
char com[20];
scanf("%d", &n);
//for ( i = 0; i < n; i++ ){num[i] = 0;}//???
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = IterativetreeSearch(root, x);
if ( t != NIL ){
printf("yes\n");
/*num[count] = 1;
count++;
*/
}
else {
printf("no\n");
/*num[count] = 2;
count++;*/
}
}
else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
}
else if ( com[0] == 'p' ){
/*if(count2 == 0){
for(j=0;j<n;j++){
if(num[j]==1)printf("yes\n");
else if(num[j]==2)printf("no\n");
else printf("");
count2 = 1;
}
}*/
inorder(root);
printf("\n");
preorder(root);
printf("\n");
count = 0;
}
else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(IterativetreeSearch(root, x));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206917/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206917/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@count = dso_local local_unnamed_addr global i32 0, align 4
@count2 = dso_local local_unnamed_addr global i32 0, align 4
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @IterativetreeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp.not10 = icmp eq ptr %u, null
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%cmp1.not = icmp eq i32 %0, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %left, ptr %u.addr.011
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %u.addr.1, null
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !15
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ null, %entry ], [ null, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !16
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !18
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !16
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !16
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.058, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !17
%parent11 = getelementptr inbounds %struct.node, ptr %x.054, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.060 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.060, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !14
%cmp28.not = icmp eq ptr %y.060, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !13
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !13
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !14
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !13
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !13
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !19
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !17
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !17
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !13
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !14
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp.not5 = icmp eq ptr %u, null
br i1 %cmp.not5, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr6 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr6, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%putchar = tail call i32 @putchar(i32 32)
%key = getelementptr inbounds %struct.node, ptr %u.tr6, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !13
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%2 = load ptr, ptr %u.tr6, align 8, !tbaa !16
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp.not5 = icmp eq ptr %u, null
br i1 %cmp.not5, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr6 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%putchar = tail call i32 @putchar(i32 32)
%key = getelementptr inbounds %struct.node, ptr %u.tr6, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr6, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr6, align 8, !tbaa !16
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.064 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !21
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !14
%3 = load i32, ptr %x, align 4, !tbaa !20
%cmp.not10.i = icmp eq ptr %2, null
br i1 %cmp.not10.i, label %if.else, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !13
%cmp1.not.i = icmp eq i32 %4, %3
br i1 %cmp1.not.i, label %if.then8, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %left.i, ptr %u.addr.011.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %u.addr.1.i, null
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !15
if.then8: ; preds = %land.rhs.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %while.body.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !20
%6 = load ptr, ptr @root, align 8, !tbaa !14
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !13
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i42
while.body.i42: ; preds = %if.then16, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !13
%cmp3.i43 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !14
%cmp.not.i44 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i44, label %insert.exit, label %while.body.i42, !llvm.loop !19
insert.exit: ; preds = %while.body.i42, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i42 ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i42 ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !17
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !14
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !14
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !14
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
store i32 0, ptr @count, align 4, !tbaa !20
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !14
%11 = load i32, ptr %x, align 4, !tbaa !20
%cmp.not10.i45 = icmp eq ptr %10, null
br i1 %cmp.not10.i45, label %IterativetreeSearch.exit57, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then31, %while.body.i50
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i50 ], [ %10, %if.then31 ]
%key.i48 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 3
%12 = load i32, ptr %key.i48, align 8, !tbaa !13
%cmp1.not.i49 = icmp eq i32 %12, %11
br i1 %cmp1.not.i49, label %IterativetreeSearch.exit57, label %while.body.i50
while.body.i50: ; preds = %land.rhs.i46
%cmp3.i51 = icmp sgt i32 %12, %11
%left.i52 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 1
%u.addr.1.in.i53 = select i1 %cmp3.i51, ptr %left.i52, ptr %u.addr.011.i47
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !14
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, null
br i1 %cmp.not.i55, label %IterativetreeSearch.exit57, label %land.rhs.i46, !llvm.loop !15
IterativetreeSearch.exit57: ; preds = %land.rhs.i46, %while.body.i50, %if.then31
%u.addr.0.lcssa.i56 = phi ptr [ null, %if.then31 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ null, %while.body.i50 ]
%left.i58 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 1
%13 = load ptr, ptr %left.i58, align 8, !tbaa !5
%cmp.i = icmp eq ptr %13, null
br i1 %cmp.i, label %if.end8.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %IterativetreeSearch.exit57
%14 = load ptr, ptr %u.addr.0.lcssa.i56, align 8, !tbaa !16
%cmp1.i = icmp eq ptr %14, null
br i1 %cmp1.i, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %IterativetreeSearch.exit57
%y.0.ph.i = phi ptr [ %u.addr.0.lcssa.i56, %IterativetreeSearch.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !16
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %u.addr.0.lcssa.i56, %lor.lhs.false.i ]
%x.054.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i ]
%parent.i59 = getelementptr inbounds %struct.node, ptr %y.058.i, i64 0, i32 2
%17 = load ptr, ptr %parent.i59, align 8, !tbaa !17
%parent11.i = getelementptr inbounds %struct.node, ptr %x.054.i, i64 0, i32 2
store ptr %17, ptr %parent11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.060.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 2
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !17
%cmp14.i = icmp eq ptr %18, null
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.060.i, %19
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !14
%cmp28.not.i = icmp eq ptr %y.060.i, %u.addr.0.lcssa.i56
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i60 = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 3
%20 = load i32, ptr %key.i60, align 8, !tbaa !13
%key30.i = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !13
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.064, 1
%21 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !10, i64 24}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !7, i64 16}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!10, !10, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !12}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Node {
int key;
struct Node *right, *left, *parent;
};
typedef struct Node Node;
Node *root, *NIL;
Node * treeMinimum(Node *x) {
while(x->left != NIL)
x = x->left;
return x;
}
Node * find(Node *u, int k) {
while(u != NIL && k != u->key) {
if(k < u->key) u = u->left;
else u = u->right;
}
return u;
}
Node * treeSuccessor(Node *x) {
if(x->right != NIL) return treeMinimum(x->right);
Node *y = x->parent;
while(y != NIL && x == y->right) {
x = y;
y = y->parent;
}
return y;
}
void treeDelete(Node *z) {
Node *y; // 削除する対象
Node *x; // yの子
// 削除する節点を決める
if(z->left == NIL || z->right == NIL) y = z;
else y = treeSuccessor(z);
// yの子xを決める
if(y->left != NIL) {
x = y->left;
} else {
x = y->right;
}
if(x != NIL) {
x->parent = y->parent;
}
if(y->parent == NIL) {
root = x;
} else {
if(y == y->parent->left) {
y->parent->left = x;
} else {
y->parent->right = x;
}
}
if(y != z) {
z->key = y->key;
}
}
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x != NIL) {
y = x;
if(z->key < x->key) {
x = x->left;
} else {
x = x->right;
}
}
z->parent = y;
if(y == NIL) {
root = z;
} else {
if( z->key < y->key) {
y->left = z;
} else {
y->right = z;
}
}
}
void inorder(Node *u) {
if(u == NIL) return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(Node *u) {
if(u == NIL) return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(void) {
int n, i, x;
char com[16];
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%s",com);
if(!strcmp(com,"find")) {
scanf("%d",&x);
Node *t = find(root,x);
if(t != NIL) printf("yes\n");
else printf("no\n");
} else if(!strcmp(com,"insert")) {
scanf("%d",&x);
insert(x);
} else if(!strcmp(com,"print")) {
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if(!strcmp(com,"delete")) {
scanf("%d",&x);
treeDelete(find(root,x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206960/source.c"
target datalayout = "e-m:e-p270: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.Node = type { i32, ptr, ptr, ptr }
@NIL = dso_local local_unnamed_addr global ptr null, align 8
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"find\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"insert\00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@.str.9 = private unnamed_addr constant [7 x i8] c"delete\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.10 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%left = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !9
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !12
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10 = icmp eq ptr %0, %u
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%1 = load i32, ptr %u.addr.011, align 8, !tbaa !14
%cmp1.not = icmp eq i32 %1, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %1, %k
%left = getelementptr inbounds %struct.Node, ptr %u.addr.011, i64 0, i32 2
%right = getelementptr inbounds %struct.Node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %left, ptr %right
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %u.addr.1, %0
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !15
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ %u, %entry ], [ %0, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%right = getelementptr inbounds %struct.Node, ptr %x, i64 0, i32 1
%0 = load ptr, ptr %right, align 8, !tbaa !16
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, %1
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %2, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i, i64 0, i32 2
%2 = load ptr, ptr %left.i, align 8, !tbaa !9
%cmp.not.i = icmp eq ptr %2, %1
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !12
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 3
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, %0
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%right3 = getelementptr inbounds %struct.Node, ptr %y.0, i64 0, i32 1
%3 = load ptr, ptr %right3, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %3
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !18
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ %0, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !9
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%right = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 1
%2 = load ptr, ptr %right, align 8, !tbaa !16
%cmp1 = icmp eq ptr %2, %1
br i1 %cmp1, label %if.end, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %3, %while.cond.i.i ], [ %2, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i, i64 0, i32 2
%3 = load ptr, ptr %left.i.i, align 8, !tbaa !9
%cmp.not.i.i = icmp eq ptr %3, %1
br i1 %cmp.not.i.i, label %if.else6, label %while.cond.i.i, !llvm.loop !12
if.end: ; preds = %entry, %lor.lhs.false
%cmp3.not = icmp eq ptr %0, %1
br i1 %cmp3.not, label %if.else6, label %if.end8
if.else6: ; preds = %while.cond.i.i, %if.end
%y.056 = phi ptr [ %z, %if.end ], [ %x.addr.0.i.i, %while.cond.i.i ]
%right7 = getelementptr inbounds %struct.Node, ptr %y.056, i64 0, i32 1
%4 = load ptr, ptr %right7, align 8, !tbaa !16
br label %if.end8
if.end8: ; preds = %if.end, %if.else6
%y.055 = phi ptr [ %y.056, %if.else6 ], [ %z, %if.end ]
%x.0 = phi ptr [ %4, %if.else6 ], [ %0, %if.end ]
%cmp9.not = icmp eq ptr %x.0, %1
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %if.end8
%parent = getelementptr inbounds %struct.Node, ptr %y.055, i64 0, i32 3
%5 = load ptr, ptr %parent, align 8, !tbaa !17
%parent11 = getelementptr inbounds %struct.Node, ptr %x.0, i64 0, i32 3
store ptr %5, ptr %parent11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%parent13 = getelementptr inbounds %struct.Node, ptr %y.055, i64 0, i32 3
%6 = load ptr, ptr %parent13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %6, %1
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.Node, ptr %6, i64 0, i32 2
%7 = load ptr, ptr %left18, align 8, !tbaa !9
%cmp19 = icmp eq ptr %y.055, %7
%right25 = getelementptr inbounds %struct.Node, ptr %6, i64 0, i32 1
%spec.select = select i1 %cmp19, ptr %left18, ptr %right25
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %spec.select, %if.else16 ]
store ptr %x.0, ptr %left18.sink, align 8, !tbaa !5
%cmp28.not = icmp eq ptr %y.055, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%8 = load i32, ptr %y.055, align 8, !tbaa !14
store i32 %8, ptr %z, align 8, !tbaa !14
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%1 = load ptr, ptr @root, align 8, !tbaa !5
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %k, ptr %call, align 8, !tbaa !14
%left = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 2
store ptr %0, ptr %left, align 8, !tbaa !9
%right = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 1
store ptr %0, ptr %right, align 8, !tbaa !16
%cmp.not34 = icmp eq ptr %1, %0
br i1 %cmp.not34, label %while.end.thread, label %while.body
while.end.thread: ; preds = %entry
%parent37 = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 3
store ptr %0, ptr %parent37, align 8, !tbaa !17
br label %if.end17
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %1, %entry ]
%2 = load i32, ptr %x.035, align 8, !tbaa !14
%cmp3 = icmp sgt i32 %2, %k
%left4 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 2
%right5 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %right5
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.1, %0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !19
while.end: ; preds = %while.body
%parent = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 3
store ptr %x.035, ptr %parent, align 8, !tbaa !17
%cmp6 = icmp eq ptr %x.035, %0
br i1 %cmp6, label %if.end17, label %if.else8
if.else8: ; preds = %while.end
%3 = load i32, ptr %x.035, align 8, !tbaa !14
%cmp11 = icmp sgt i32 %3, %k
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%left13 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 2
br label %if.end17
if.else14: ; preds = %if.else8
%right15 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 1
br label %if.end17
if.end17: ; preds = %while.end, %while.end.thread, %if.then12, %if.else14
%left13.sink = phi ptr [ %left13, %if.then12 ], [ %right15, %if.else14 ], [ @root, %while.end.thread ], [ @root, %while.end ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !9
tail call void @inorder(ptr noundef %1)
%2 = load i32, ptr %u.tr5, align 8, !tbaa !14
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%right = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 1
%3 = load ptr, ptr %right, align 8, !tbaa !16
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%1 = load i32, ptr %u.tr5, align 8, !tbaa !14
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%left = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 2
%2 = load ptr, ptr %left, align 8, !tbaa !9
tail call void @preorder(ptr noundef %2)
%right = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 1
%3 = load ptr, ptr %right, align 8, !tbaa !16
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [16 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.067 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(5) %com, ptr noundef nonnull dereferenceable(5) @.str.3, i64 5)
%tobool.not = icmp eq i32 %bcmp, 0
br i1 %tobool.not, label %if.then, label %if.else10
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load ptr, ptr @root, align 8, !tbaa !5
%2 = load i32, ptr %x, align 4, !tbaa !20
%3 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i = icmp eq ptr %3, %1
br i1 %cmp.not10.i, label %find.exit, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %1, %if.then ]
%4 = load i32, ptr %u.addr.011.i, align 8, !tbaa !14
%cmp1.not.i = icmp eq i32 %4, %2
br i1 %cmp1.not.i, label %find.exit, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp sgt i32 %4, %2
%left.i = getelementptr inbounds %struct.Node, ptr %u.addr.011.i, i64 0, i32 2
%right.i = getelementptr inbounds %struct.Node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %left.i, ptr %right.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %u.addr.1.i, %3
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !15
find.exit: ; preds = %land.rhs.i, %if.then
%u.addr.0.lcssa.i = phi ptr [ %1, %if.then ], [ %u.addr.011.i, %land.rhs.i ]
%cmp6.not = icmp eq ptr %u.addr.0.lcssa.i, %3
br i1 %cmp6.not, label %if.else, label %if.then7
if.then7: ; preds = %find.exit
%puts35 = call i32 @puts(ptr nonnull dereferenceable(1) @str.10)
br label %for.inc
if.else: ; preds = %while.body.i, %find.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.else10: ; preds = %for.body
%bcmp36 = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %com, ptr noundef nonnull dereferenceable(7) @.str.6, i64 7)
%tobool13.not = icmp eq i32 %bcmp36, 0
br i1 %tobool13.not, label %if.then14, label %if.else16
if.then14: ; preds = %if.else10
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !20
%6 = load ptr, ptr @NIL, align 8, !tbaa !5
%7 = load ptr, ptr @root, align 8, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %5, ptr %call.i, align 8, !tbaa !14
%left.i40 = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 2
store ptr %6, ptr %left.i40, align 8, !tbaa !9
%right.i41 = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 1
store ptr %6, ptr %right.i41, align 8, !tbaa !16
%cmp.not34.i = icmp eq ptr %7, %6
br i1 %cmp.not34.i, label %while.end.thread.i, label %while.body.i42
while.end.thread.i: ; preds = %if.then14
%parent37.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 3
store ptr %6, ptr %parent37.i, align 8, !tbaa !17
br label %insert.exit
while.body.i42: ; preds = %if.then14, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %7, %if.then14 ]
%8 = load i32, ptr %x.035.i, align 8, !tbaa !14
%cmp3.i43 = icmp sgt i32 %8, %5
%left4.i = getelementptr inbounds %struct.Node, ptr %x.035.i, i64 0, i32 2
%right5.i = getelementptr inbounds %struct.Node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %right5.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !5
%cmp.not.i44 = icmp eq ptr %x.1.i, %6
br i1 %cmp.not.i44, label %while.end.i, label %while.body.i42, !llvm.loop !19
while.end.i: ; preds = %while.body.i42
%parent.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 3
store ptr %x.035.i, ptr %parent.i, align 8, !tbaa !17
%cmp6.i = icmp eq ptr %x.035.i, %6
%spec.select64 = select i1 %cmp6.i, ptr @root, ptr %x.1.in.i
br label %insert.exit
insert.exit: ; preds = %while.end.i, %while.end.thread.i
%left13.sink.i = phi ptr [ @root, %while.end.thread.i ], [ %spec.select64, %while.end.i ]
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !5
br label %for.inc
if.else16: ; preds = %if.else10
%bcmp37 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %com, ptr noundef nonnull dereferenceable(6) @.str.7, i64 6)
%tobool19.not = icmp eq i32 %bcmp37, 0
br i1 %tobool19.not, label %if.then20, label %if.else23
if.then20: ; preds = %if.else16
%9 = load ptr, ptr @root, align 8, !tbaa !5
call void @inorder(ptr noundef %9)
%putchar = call i32 @putchar(i32 10)
%10 = load ptr, ptr @root, align 8, !tbaa !5
call void @preorder(ptr noundef %10)
%putchar38 = call i32 @putchar(i32 10)
br label %for.inc
if.else23: ; preds = %if.else16
%bcmp39 = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %com, ptr noundef nonnull dereferenceable(7) @.str.9, i64 7)
%tobool26.not = icmp eq i32 %bcmp39, 0
br i1 %tobool26.not, label %if.then27, label %for.inc
if.then27: ; preds = %if.else23
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%11 = load ptr, ptr @root, align 8, !tbaa !5
%12 = load i32, ptr %x, align 4, !tbaa !20
%13 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i45 = icmp eq ptr %13, %11
br i1 %cmp.not10.i45, label %find.exit58, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then27, %while.body.i49
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i49 ], [ %11, %if.then27 ]
%14 = load i32, ptr %u.addr.011.i47, align 8, !tbaa !14
%cmp1.not.i48 = icmp eq i32 %14, %12
br i1 %cmp1.not.i48, label %find.exit58, label %while.body.i49
while.body.i49: ; preds = %land.rhs.i46
%cmp3.i50 = icmp sgt i32 %14, %12
%left.i51 = getelementptr inbounds %struct.Node, ptr %u.addr.011.i47, i64 0, i32 2
%right.i52 = getelementptr inbounds %struct.Node, ptr %u.addr.011.i47, i64 0, i32 1
%u.addr.1.in.i53 = select i1 %cmp3.i50, ptr %left.i51, ptr %right.i52
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !5
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, %13
br i1 %cmp.not.i55, label %find.exit58, label %land.rhs.i46, !llvm.loop !15
find.exit58: ; preds = %land.rhs.i46, %while.body.i49, %if.then27
%u.addr.0.lcssa.i57 = phi ptr [ %11, %if.then27 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ %13, %while.body.i49 ]
%left.i59 = getelementptr inbounds %struct.Node, ptr %u.addr.0.lcssa.i57, i64 0, i32 2
%15 = load ptr, ptr %left.i59, align 8, !tbaa !9
%cmp.i = icmp eq ptr %15, %13
br i1 %cmp.i, label %if.else6.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %find.exit58
%right.i60 = getelementptr inbounds %struct.Node, ptr %u.addr.0.lcssa.i57, i64 0, i32 1
%16 = load ptr, ptr %right.i60, align 8, !tbaa !16
%cmp1.i = icmp eq ptr %16, %13
br i1 %cmp1.i, label %if.end8.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %17, %while.cond.i.i.i ], [ %16, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i.i, i64 0, i32 2
%17 = load ptr, ptr %left.i.i.i, align 8, !tbaa !9
%cmp.not.i.i.i = icmp eq ptr %17, %13
br i1 %cmp.not.i.i.i, label %if.else6.i, label %while.cond.i.i.i, !llvm.loop !12
if.else6.i: ; preds = %while.cond.i.i.i, %find.exit58
%y.056.i = phi ptr [ %u.addr.0.lcssa.i57, %find.exit58 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%right7.i = getelementptr inbounds %struct.Node, ptr %y.056.i, i64 0, i32 1
%18 = load ptr, ptr %right7.i, align 8, !tbaa !16
br label %if.end8.i
if.end8.i: ; preds = %lor.lhs.false.i, %if.else6.i
%y.055.i = phi ptr [ %y.056.i, %if.else6.i ], [ %u.addr.0.lcssa.i57, %lor.lhs.false.i ]
%x.0.i = phi ptr [ %18, %if.else6.i ], [ %15, %lor.lhs.false.i ]
%cmp9.not.i = icmp eq ptr %x.0.i, %13
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i
%parent.i61 = getelementptr inbounds %struct.Node, ptr %y.055.i, i64 0, i32 3
%19 = load ptr, ptr %parent.i61, align 8, !tbaa !17
%parent11.i = getelementptr inbounds %struct.Node, ptr %x.0.i, i64 0, i32 3
store ptr %19, ptr %parent11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%parent13.i = getelementptr inbounds %struct.Node, ptr %y.055.i, i64 0, i32 3
%20 = load ptr, ptr %parent13.i, align 8, !tbaa !17
%cmp14.i = icmp eq ptr %20, %13
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.Node, ptr %20, i64 0, i32 2
%21 = load ptr, ptr %left18.i, align 8, !tbaa !9
%cmp19.i = icmp eq ptr %y.055.i, %21
%right25.i = getelementptr inbounds %struct.Node, ptr %20, i64 0, i32 1
%spec.select.i = select i1 %cmp19.i, ptr %left18.i, ptr %right25.i
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %spec.select.i, %if.else16.i ]
store ptr %x.0.i, ptr %left18.sink.i, align 8, !tbaa !5
%cmp28.not.i = icmp eq ptr %y.055.i, %u.addr.0.lcssa.i57
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%22 = load i32, ptr %y.055.i, align 8, !tbaa !14
store i32 %22, ptr %u.addr.0.lcssa.i57, align 8, !tbaa !14
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %if.then7, %if.else, %if.then20, %if.else23, %insert.exit
%inc = add nuw nsw i32 %i.067, 1
%23 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %23
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind willreturn memory(argmem: read) }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"Node", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !11, i64 0}
!15 = distinct !{!15, !13}
!16 = !{!10, !6, i64 8}
!17 = !{!10, !6, i64 24}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = !{!11, !11, i64 0}
!21 = distinct !{!21, !13}
|
#include<stdio.h>
int main()
{
int a[5001],x[5001]={},y[5001]={},z[5001]={},lc,w,n,num,one=0,two=0,three=0,i=1,j=1,k=1;
scanf("%d",&n);
for(lc=1;lc<=n;lc++)
{
scanf("%d",&num);
if(num==1)
{
one++;
x[i]=lc;
i++;
}
else if(num==2)
{
two++;
y[j]=lc;
j++;
}
else
{
three++;
z[k]=lc;
k++;
}
}
//for(i=0;i<one;i++)
// printf("%d",x[i]);
if(one<=two && one<=three)
{
printf("%d\n",one);
w=one;
}
else if(two<=one && two<=three)
{ printf("%d\n",two);
w=two;
}
else
{
printf("%d\n",three);
w=three;
}
i=j=k=1;
for(lc=1;lc<=w;lc++)
printf("%d %d %d\n",x[i++],y[j++],z[k++]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20701/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20701/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [5001 x i32], align 16
%y = alloca [5001 x i32], align 16
%z = alloca [5001 x i32], align 16
%n = alloca i32, align 4
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20004, ptr nonnull %x) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20004) %x, i8 0, i64 20004, i1 false)
call void @llvm.lifetime.start.p0(i64 20004, ptr nonnull %y) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20004) %y, i8 0, i64 20004, i1 false)
call void @llvm.lifetime.start.p0(i64 20004, ptr nonnull %z) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20004) %z, i8 0, i64 20004, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not74 = icmp slt i32 %0, 1
br i1 %cmp.not74, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%k.081 = phi i32 [ %k.1, %for.inc ], [ 1, %entry ]
%j.080 = phi i32 [ %j.1, %for.inc ], [ 1, %entry ]
%i.079 = phi i32 [ %i.1, %for.inc ], [ 1, %entry ]
%three.078 = phi i32 [ %three.1, %for.inc ], [ 0, %entry ]
%two.077 = phi i32 [ %two.1, %for.inc ], [ 0, %entry ]
%one.076 = phi i32 [ %one.1, %for.inc ], [ 0, %entry ]
%lc.075 = phi i32 [ %inc16, %for.inc ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%1 = load i32, ptr %num, align 4, !tbaa !5
switch i32 %1, label %if.else10 [
i32 1, label %if.then
i32 2, label %if.then5
]
if.then: ; preds = %for.body
%inc = add nsw i32 %one.076, 1
%idxprom = sext i32 %i.079 to i64
%arrayidx = getelementptr inbounds [5001 x i32], ptr %x, i64 0, i64 %idxprom
store i32 %lc.075, ptr %arrayidx, align 4, !tbaa !5
%inc3 = add nsw i32 %i.079, 1
br label %for.inc
if.then5: ; preds = %for.body
%inc6 = add nsw i32 %two.077, 1
%idxprom7 = sext i32 %j.080 to i64
%arrayidx8 = getelementptr inbounds [5001 x i32], ptr %y, i64 0, i64 %idxprom7
store i32 %lc.075, ptr %arrayidx8, align 4, !tbaa !5
%inc9 = add nsw i32 %j.080, 1
br label %for.inc
if.else10: ; preds = %for.body
%inc11 = add nsw i32 %three.078, 1
%idxprom12 = sext i32 %k.081 to i64
%arrayidx13 = getelementptr inbounds [5001 x i32], ptr %z, i64 0, i64 %idxprom12
store i32 %lc.075, ptr %arrayidx13, align 4, !tbaa !5
%inc14 = add nsw i32 %k.081, 1
br label %for.inc
for.inc: ; preds = %if.then, %if.else10, %if.then5
%one.1 = phi i32 [ %inc, %if.then ], [ %one.076, %if.then5 ], [ %one.076, %if.else10 ]
%two.1 = phi i32 [ %two.077, %if.then ], [ %inc6, %if.then5 ], [ %two.077, %if.else10 ]
%three.1 = phi i32 [ %three.078, %if.then ], [ %three.078, %if.then5 ], [ %inc11, %if.else10 ]
%i.1 = phi i32 [ %inc3, %if.then ], [ %i.079, %if.then5 ], [ %i.079, %if.else10 ]
%j.1 = phi i32 [ %j.080, %if.then ], [ %inc9, %if.then5 ], [ %j.080, %if.else10 ]
%k.1 = phi i32 [ %k.081, %if.then ], [ %k.081, %if.then5 ], [ %inc14, %if.else10 ]
%inc16 = add nuw nsw i32 %lc.075, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %lc.075, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%one.0.lcssa = phi i32 [ 0, %entry ], [ %one.1, %for.inc ]
%two.0.lcssa = phi i32 [ 0, %entry ], [ %two.1, %for.inc ]
%three.0.lcssa = phi i32 [ 0, %entry ], [ %three.1, %for.inc ]
%cmp17.not = icmp sgt i32 %one.0.lcssa, %two.0.lcssa
%cmp18.not = icmp sgt i32 %one.0.lcssa, %three.0.lcssa
%or.cond = select i1 %cmp17.not, i1 true, i1 %cmp18.not
%cmp22.not = icmp sgt i32 %two.0.lcssa, %one.0.lcssa
%cmp24.not = icmp sgt i32 %two.0.lcssa, %three.0.lcssa
%or.cond73 = select i1 %cmp22.not, i1 true, i1 %cmp24.not
%three.0.lcssa.two.0.lcssa = select i1 %or.cond73, i32 %three.0.lcssa, i32 %two.0.lcssa
%two.0.lcssa.sink = select i1 %or.cond, i32 %three.0.lcssa.two.0.lcssa, i32 %one.0.lcssa
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %two.0.lcssa.sink)
%cmp32.not84 = icmp slt i32 %two.0.lcssa.sink, 1
br i1 %cmp32.not84, label %for.end46, label %for.body33.preheader
for.body33.preheader: ; preds = %for.end
%3 = add nuw i32 %two.0.lcssa.sink, 1
%wide.trip.count = zext i32 %3 to i64
br label %for.body33
for.body33: ; preds = %for.body33.preheader, %for.body33
%indvars.iv = phi i64 [ 1, %for.body33.preheader ], [ %indvars.iv.next, %for.body33 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx36 = getelementptr inbounds [5001 x i32], ptr %x, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%arrayidx39 = getelementptr inbounds [5001 x i32], ptr %y, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%arrayidx42 = getelementptr inbounds [5001 x i32], ptr %z, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4, i32 noundef %5, i32 noundef %6)
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end46, label %for.body33, !llvm.loop !11
for.end46: ; preds = %for.body33, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 20004, ptr nonnull %z) #4
call void @llvm.lifetime.end.p0(i64 20004, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 20004, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <string.h>
#define M 500000
#define NIL -1
typedef struct node_tbl
{
int key,p,l,r;
} node;
node T[M+1];
int root=NIL;
int size=0;
void insert(int k){
int y=NIL;
int x=root;
int z=size++;
T[z].key=k;
T[z].l=NIL;
T[z].r=NIL;
while (x!=NIL)
{
y=x;
if (T[z].key<T[x].key) x=T[x].l;
else x=T[x].r;
}
T[z].p=y;
if (y==NIL) root=z;
else{
if (T[z].key<T[y].key)
T[y].l=z;
else
T[y].r=z;
}
}
int find(int u){
int id,x=0;
scanf("%d",&id);
while(1){
if(T[x].key==0){
return NIL;
}
else if(T[x].key==id){
return x;
}
else if(id<T[x].key) x=T[x].l;
else if(id>T[x].key) x=T[x].r;
}
}
int Min(int x){
while(T[x].l!=NIL) x=T[x].l;
return x;
}
int Successor(int x){
int y;
if(T[x].r!=NIL) return Min(T[x].r);
y=T[x].p;
while(y!=NIL && x==T[y].r){
x=y;
y=T[y].p;
}
return y;
}
void delete(){
int x,y,z;
z=find(root);
//printf("|%d|",z);
if(T[z].l==NIL || T[z].r==NIL) y=z;
else y=Successor(z);
if(T[y].l!=NIL) x=T[y].l;
else x=T[y].r;
if(x!=NIL) T[x].p=T[y].p;
if(T[y].p==NIL) root=x;
else if(y==T[T[y].p].l) T[T[y].p].l=x;
else if(y==T[T[y].p].r) T[T[y].p].r=x;
if(y!=z) T[z].key=T[y].key;
}
void inorder(int u){
if (u==NIL) return;
inorder(T[u].l);
printf(" %d", T[u].key);
inorder(T[u].r);
}
void preorder(int u){
if (u==NIL) return;
printf(" %d", T[u].key);
preorder(T[u].l);
preorder(T[u].r);
}
int main(){
char o[8];
int n,x,i;
scanf("%d", &n);
for (i=0;i<n;i++){
scanf("%s",o);
if(!strcmp("insert",o)){
scanf("%d",&x);
insert(x);
}
else if(!strcmp("find",o)){
if(find(root)==NIL) printf("no\n");
else printf("yes\n");
}
else if(!strcmp("print",o)){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if(!strcmp("delete",o)) delete();
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207053/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207053/source.c"
target datalayout = "e-m:e-p270: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.node_tbl = type { i32, i32, i32, i32 }
@root = dso_local local_unnamed_addr global i32 -1, align 4
@size = dso_local local_unnamed_addr global i32 0, align 4
@T = dso_local local_unnamed_addr global [500001 x %struct.node_tbl] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"insert\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"find\00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@.str.9 = private unnamed_addr constant [7 x i8] c"delete\00", align 1
@str = private unnamed_addr constant [4 x i8] c"yes\00", align 1
@str.10 = private unnamed_addr constant [3 x i8] c"no\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @root, align 4, !tbaa !5
%1 = load i32, ptr @size, align 4, !tbaa !5
%inc = add nsw i32 %1, 1
store i32 %inc, ptr @size, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom
store i32 %k, ptr %arrayidx, align 16, !tbaa !9
%l = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 2
store i32 -1, ptr %l, align 8, !tbaa !11
%r = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 3
store i32 -1, ptr %r, align 4, !tbaa !12
%cmp.not56 = icmp eq i32 %0, -1
br i1 %cmp.not56, label %if.then21, label %while.body
while.body: ; preds = %entry, %while.body
%x.057 = phi i32 [ %x.1, %while.body ], [ %0, %entry ]
%idxprom8 = sext i32 %x.057 to i64
%arrayidx9 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom8
%2 = load i32, ptr %arrayidx9, align 16, !tbaa !9
%cmp11 = icmp sgt i32 %2, %k
%l14 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom8, i32 2
%r17 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom8, i32 3
%x.1.in = select i1 %cmp11, ptr %l14, ptr %r17
%x.1 = load i32, ptr %x.1.in, align 4, !tbaa !5
%cmp.not = icmp eq i32 %x.1, -1
br i1 %cmp.not, label %if.else22, label %while.body, !llvm.loop !13
if.then21: ; preds = %entry
%p59 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 1
store i32 -1, ptr %p59, align 4, !tbaa !15
store i32 %1, ptr @root, align 4, !tbaa !5
br label %if.end39
if.else22: ; preds = %while.body
%p = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 1
store i32 %x.057, ptr %p, align 4, !tbaa !15
%idxprom26 = sext i32 %x.057 to i64
%arrayidx27 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom26
%3 = load i32, ptr %arrayidx27, align 16, !tbaa !9
%cmp29 = icmp sgt i32 %3, %k
br i1 %cmp29, label %if.then30, label %if.else34
if.then30: ; preds = %if.else22
%l33 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom26, i32 2
store i32 %1, ptr %l33, align 8, !tbaa !11
br label %if.end39
if.else34: ; preds = %if.else22
%r37 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom26, i32 3
store i32 %1, ptr %r37, align 4, !tbaa !12
br label %if.end39
if.end39: ; preds = %if.then30, %if.else34, %if.then21
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 @find(i32 noundef %u) local_unnamed_addr #2 {
entry:
%id = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %id)
%0 = load i32, ptr @T, align 16, !tbaa !9
%cmp33 = icmp eq i32 %0, 0
br i1 %cmp33, label %cleanup, label %if.else.lr.ph
if.else.lr.ph: ; preds = %entry
%1 = load i32, ptr %id, align 4, !tbaa !5
%cmp437 = icmp eq i32 %0, %1
br i1 %cmp437, label %cleanup, label %if.else6
if.else: ; preds = %if.else6
%cmp4 = icmp eq i32 %3, %1
br i1 %cmp4, label %cleanup, label %if.else6
if.else6: ; preds = %if.else.lr.ph, %if.else
%idxprom3538 = phi i64 [ %idxprom, %if.else ], [ 0, %if.else.lr.ph ]
%2 = phi i32 [ %3, %if.else ], [ %0, %if.else.lr.ph ]
%cmp10 = icmp slt i32 %1, %2
%l = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom3538, i32 2
%r = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom3538, i32 3
%x.1.in = select i1 %cmp10, ptr %l, ptr %r
%x.1 = load i32, ptr %x.1.in, align 4, !tbaa !5
%idxprom = sext i32 %x.1 to i64
%arrayidx = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom
%3 = load i32, ptr %arrayidx, align 16, !tbaa !9
%cmp = icmp eq i32 %3, 0
br i1 %cmp, label %cleanup, label %if.else
cleanup: ; preds = %if.else, %if.else6, %if.else.lr.ph, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 0, %if.else.lr.ph ], [ -1, %if.else6 ], [ %x.1, %if.else ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id) #7
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @Min(i32 noundef %x) local_unnamed_addr #4 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi i32 [ %x, %entry ], [ %0, %while.cond ]
%idxprom = sext i32 %x.addr.0 to i64
%l = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 2
%0 = load i32, ptr %l, align 8, !tbaa !11
%cmp.not = icmp eq i32 %0, -1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !16
while.end: ; preds = %while.cond
ret i32 %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @Successor(i32 noundef %x) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %x to i64
%r = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 3
%0 = load i32, ptr %r, align 4, !tbaa !12
%cmp.not = icmp eq i32 %0, -1
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi i32 [ %1, %while.cond.i ], [ %0, %entry ]
%idxprom.i = sext i32 %x.addr.0.i to i64
%l.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i, i32 2
%1 = load i32, ptr %l.i, align 8, !tbaa !11
%cmp.not.i = icmp eq i32 %1, -1
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !16
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi i32 [ %y.0, %land.rhs ], [ %x, %entry ]
%idxprom.pn = phi i64 [ %idxprom7, %land.rhs ], [ %idxprom, %entry ]
%y.0.in = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.pn, i32 1
%y.0 = load i32, ptr %y.0.in, align 4, !tbaa !15
%cmp6.not = icmp eq i32 %y.0, -1
br i1 %cmp6.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%idxprom7 = sext i32 %y.0 to i64
%r9 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom7, i32 3
%2 = load i32, ptr %r9, align 4, !tbaa !12
%cmp10 = icmp eq i32 %x.addr.0, %2
br i1 %cmp10, label %while.cond, label %cleanup, !llvm.loop !17
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi i32 [ %y.0, %land.rhs ], [ -1, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @delete() local_unnamed_addr #2 {
entry:
%id.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id.i) #7
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %id.i)
%0 = load i32, ptr @T, align 16, !tbaa !9
%cmp33.i = icmp eq i32 %0, 0
br i1 %cmp33.i, label %find.exit, label %if.else.lr.ph.i
if.else.lr.ph.i: ; preds = %entry
%1 = load i32, ptr %id.i, align 4, !tbaa !5
%cmp4.i102 = icmp eq i32 %0, %1
br i1 %cmp4.i102, label %find.exit, label %if.else6.i
if.else.i: ; preds = %if.else6.i
%cmp4.i = icmp eq i32 %3, %1
br i1 %cmp4.i, label %find.exit, label %if.else6.i
if.else6.i: ; preds = %if.else.lr.ph.i, %if.else.i
%idxprom35.i103 = phi i64 [ %idxprom.i, %if.else.i ], [ 0, %if.else.lr.ph.i ]
%2 = phi i32 [ %3, %if.else.i ], [ %0, %if.else.lr.ph.i ]
%cmp10.i = icmp slt i32 %1, %2
%l.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom35.i103, i32 2
%r.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom35.i103, i32 3
%x.1.in.i = select i1 %cmp10.i, ptr %l.i, ptr %r.i
%x.1.i = load i32, ptr %x.1.in.i, align 4, !tbaa !5
%idxprom.i = sext i32 %x.1.i to i64
%arrayidx.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i
%3 = load i32, ptr %arrayidx.i, align 16, !tbaa !9
%cmp.i = icmp eq i32 %3, 0
br i1 %cmp.i, label %find.exit, label %if.else.i
find.exit: ; preds = %if.else6.i, %if.else.i, %if.else.lr.ph.i, %entry
%retval.0.i = phi i32 [ -1, %entry ], [ 0, %if.else.lr.ph.i ], [ -1, %if.else6.i ], [ %x.1.i, %if.else.i ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id.i) #7
%idxprom = sext i32 %retval.0.i to i64
%arrayidx = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom
%l = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 2
%4 = load i32, ptr %l, align 8, !tbaa !11
%cmp = icmp eq i32 %4, -1
br i1 %cmp, label %if.end17, label %lor.lhs.false
lor.lhs.false: ; preds = %find.exit
%r = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 3
%5 = load i32, ptr %r, align 4, !tbaa !12
%cmp3 = icmp eq i32 %5, -1
br i1 %cmp3, label %if.end, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi i32 [ %6, %while.cond.i.i ], [ %5, %lor.lhs.false ]
%idxprom.i.i = sext i32 %x.addr.0.i.i to i64
%l.i.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i.i, i32 2
%6 = load i32, ptr %l.i.i, align 8, !tbaa !11
%cmp.not.i.i = icmp eq i32 %6, -1
br i1 %cmp.not.i.i, label %if.end17, label %while.cond.i.i, !llvm.loop !16
if.end: ; preds = %lor.lhs.false
%arrayidx6 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom
br label %if.then19
if.end17: ; preds = %while.cond.i.i, %find.exit
%idxprom5.pre-phi.ph = phi i64 [ %idxprom, %find.exit ], [ %idxprom.i.i, %while.cond.i.i ]
%y.0.ph = phi i32 [ %retval.0.i, %find.exit ], [ %x.addr.0.i.i, %while.cond.i.i ]
%arrayidx6107 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom5.pre-phi.ph
%r16 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom5.pre-phi.ph, i32 3
%7 = load i32, ptr %r16, align 4, !tbaa !12
%cmp18.not = icmp eq i32 %7, -1
br i1 %cmp18.not, label %if.end25, label %if.then19
if.then19: ; preds = %if.end, %if.end17
%arrayidx6115 = phi ptr [ %arrayidx6107, %if.end17 ], [ %arrayidx6, %if.end ]
%y.0112 = phi i32 [ %y.0.ph, %if.end17 ], [ %retval.0.i, %if.end ]
%idxprom5.pre-phi109 = phi i64 [ %idxprom5.pre-phi.ph, %if.end17 ], [ %idxprom, %if.end ]
%x.0100 = phi i32 [ %7, %if.end17 ], [ %4, %if.end ]
%p = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom5.pre-phi109, i32 1
%8 = load i32, ptr %p, align 4, !tbaa !15
%idxprom22 = sext i32 %x.0100 to i64
%p24 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom22, i32 1
store i32 %8, ptr %p24, align 4, !tbaa !15
br label %if.end25
if.end25: ; preds = %if.then19, %if.end17
%arrayidx6116 = phi ptr [ %arrayidx6115, %if.then19 ], [ %arrayidx6107, %if.end17 ]
%y.0113 = phi i32 [ %y.0112, %if.then19 ], [ %y.0.ph, %if.end17 ]
%idxprom5.pre-phi110 = phi i64 [ %idxprom5.pre-phi109, %if.then19 ], [ %idxprom5.pre-phi.ph, %if.end17 ]
%x.0101 = phi i32 [ %x.0100, %if.then19 ], [ -1, %if.end17 ]
%p28 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom5.pre-phi110, i32 1
%9 = load i32, ptr %p28, align 4, !tbaa !15
%cmp29 = icmp eq i32 %9, -1
br i1 %cmp29, label %if.then30, label %if.else31
if.then30: ; preds = %if.end25
store i32 %x.0101, ptr @root, align 4, !tbaa !5
br label %if.end63
if.else31: ; preds = %if.end25
%idxprom35 = sext i32 %9 to i64
%l37 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom35, i32 2
%10 = load i32, ptr %l37, align 8, !tbaa !11
%cmp38 = icmp eq i32 %y.0113, %10
br i1 %cmp38, label %if.then39, label %if.else46
if.then39: ; preds = %if.else31
store i32 %x.0101, ptr %l37, align 8, !tbaa !11
br label %if.end63
if.else46: ; preds = %if.else31
%r52 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom35, i32 3
%11 = load i32, ptr %r52, align 4, !tbaa !12
%cmp53 = icmp eq i32 %y.0113, %11
br i1 %cmp53, label %if.then54, label %if.end63
if.then54: ; preds = %if.else46
store i32 %x.0101, ptr %r52, align 4, !tbaa !12
br label %if.end63
if.end63: ; preds = %if.then39, %if.then54, %if.else46, %if.then30
%cmp64.not = icmp eq i32 %y.0113, %retval.0.i
br i1 %cmp64.not, label %if.end71, label %if.then65
if.then65: ; preds = %if.end63
%12 = load i32, ptr %arrayidx6116, align 16, !tbaa !9
store i32 %12, ptr %arrayidx, align 16, !tbaa !9
br label %if.end71
if.end71: ; preds = %if.then65, %if.end63
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(i32 noundef %u) local_unnamed_addr #2 {
entry:
%cmp8 = icmp eq i32 %u, -1
br i1 %cmp8, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr9 = phi i32 [ %2, %if.end ], [ %u, %entry ]
%idxprom = sext i32 %u.tr9 to i64
%arrayidx = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom
%l = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 2
%0 = load i32, ptr %l, align 8, !tbaa !11
tail call void @inorder(i32 noundef %0)
%1 = load i32, ptr %arrayidx, align 16, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%r = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 3
%2 = load i32, ptr %r, align 4, !tbaa !12
%cmp = icmp eq i32 %2, -1
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(i32 noundef %u) local_unnamed_addr #2 {
entry:
%cmp8 = icmp eq i32 %u, -1
br i1 %cmp8, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr9 = phi i32 [ %2, %if.end ], [ %u, %entry ]
%idxprom = sext i32 %u.tr9 to i64
%arrayidx = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 16, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%l = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 2
%1 = load i32, ptr %l, align 8, !tbaa !11
tail call void @preorder(i32 noundef %1)
%r = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom, i32 3
%2 = load i32, ptr %r, align 4, !tbaa !12
%cmp = icmp eq i32 %2, -1
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%id.i = alloca i32, align 4
%o = alloca [8 x i8], align 1
%n = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %o) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp48 = icmp sgt i32 %0, 0
br i1 %cmp48, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.049 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %o)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) @.str.3, ptr noundef nonnull dereferenceable(7) %o, i64 7)
%tobool.not = icmp eq i32 %bcmp, 0
br i1 %tobool.not, label %if.then, label %if.else
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr @root, align 4, !tbaa !5
%3 = load i32, ptr @size, align 4, !tbaa !5
%inc.i = add nsw i32 %3, 1
store i32 %inc.i, ptr @size, align 4, !tbaa !5
%idxprom.i = sext i32 %3 to i64
%arrayidx.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i
store i32 %1, ptr %arrayidx.i, align 16, !tbaa !9
%l.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i, i32 2
store i32 -1, ptr %l.i, align 8, !tbaa !11
%r.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i, i32 3
store i32 -1, ptr %r.i, align 4, !tbaa !12
%cmp.not56.i = icmp eq i32 %2, -1
br i1 %cmp.not56.i, label %if.then21.i, label %while.body.i
while.body.i: ; preds = %if.then, %while.body.i
%x.057.i = phi i32 [ %x.1.i, %while.body.i ], [ %2, %if.then ]
%idxprom8.i = sext i32 %x.057.i to i64
%arrayidx9.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom8.i
%4 = load i32, ptr %arrayidx9.i, align 16, !tbaa !9
%cmp11.i = icmp sgt i32 %4, %1
%l14.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom8.i, i32 2
%r17.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom8.i, i32 3
%x.1.in.i = select i1 %cmp11.i, ptr %l14.i, ptr %r17.i
%x.1.i = load i32, ptr %x.1.in.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %x.1.i, -1
br i1 %cmp.not.i, label %if.else22.i, label %while.body.i, !llvm.loop !13
if.then21.i: ; preds = %if.then
%p59.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i, i32 1
store i32 -1, ptr %p59.i, align 4, !tbaa !15
store i32 %3, ptr @root, align 4, !tbaa !5
br label %for.inc
if.else22.i: ; preds = %while.body.i
%p.i = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i, i32 1
store i32 %x.057.i, ptr %p.i, align 4, !tbaa !15
br i1 %cmp11.i, label %if.then30.i, label %if.else34.i
if.then30.i: ; preds = %if.else22.i
store i32 %3, ptr %l14.i, align 8, !tbaa !11
br label %for.inc
if.else34.i: ; preds = %if.else22.i
store i32 %3, ptr %r17.i, align 4, !tbaa !12
br label %for.inc
if.else: ; preds = %for.body
%bcmp32 = call i32 @bcmp(ptr noundef nonnull dereferenceable(5) @.str.4, ptr noundef nonnull dereferenceable(5) %o, i64 5)
%tobool7.not = icmp eq i32 %bcmp32, 0
br i1 %tobool7.not, label %if.then8, label %if.else15
if.then8: ; preds = %if.else
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %id.i) #7
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %id.i)
%5 = load i32, ptr @T, align 16, !tbaa !9
%cmp33.i = icmp eq i32 %5, 0
br i1 %cmp33.i, label %find.exit.thread, label %if.else.lr.ph.i
if.else.lr.ph.i: ; preds = %if.then8
%6 = load i32, ptr %id.i, align 4, !tbaa !5
%cmp4.i46 = icmp eq i32 %5, %6
br i1 %cmp4.i46, label %find.exit.thread51, label %if.else6.i
find.exit.thread51: ; preds = %if.else.lr.ph.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id.i) #7
br label %if.else13
if.else.i: ; preds = %if.else6.i
%cmp4.i = icmp eq i32 %8, %6
br i1 %cmp4.i, label %find.exit, label %if.else6.i
if.else6.i: ; preds = %if.else.lr.ph.i, %if.else.i
%idxprom35.i47 = phi i64 [ %idxprom.i41, %if.else.i ], [ 0, %if.else.lr.ph.i ]
%7 = phi i32 [ %8, %if.else.i ], [ %5, %if.else.lr.ph.i ]
%cmp10.i = icmp slt i32 %6, %7
%l.i37 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom35.i47, i32 2
%r.i38 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom35.i47, i32 3
%x.1.in.i39 = select i1 %cmp10.i, ptr %l.i37, ptr %r.i38
%x.1.i40 = load i32, ptr %x.1.in.i39, align 4, !tbaa !5
%idxprom.i41 = sext i32 %x.1.i40 to i64
%arrayidx.i42 = getelementptr inbounds [500001 x %struct.node_tbl], ptr @T, i64 0, i64 %idxprom.i41
%8 = load i32, ptr %arrayidx.i42, align 16, !tbaa !9
%cmp.i = icmp eq i32 %8, 0
br i1 %cmp.i, label %find.exit.thread, label %if.else.i
find.exit.thread: ; preds = %if.else6.i, %if.then8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id.i) #7
br label %if.then11
find.exit: ; preds = %if.else.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %id.i) #7
%cmp10 = icmp eq i32 %x.1.i40, -1
br i1 %cmp10, label %if.then11, label %if.else13
if.then11: ; preds = %find.exit.thread, %find.exit
%puts33 = call i32 @puts(ptr nonnull dereferenceable(1) @str.10)
br label %for.inc
if.else13: ; preds = %find.exit.thread51, %find.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.else15: ; preds = %if.else
%bcmp34 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) @.str.7, ptr noundef nonnull dereferenceable(6) %o, i64 6)
%tobool18.not = icmp eq i32 %bcmp34, 0
br i1 %tobool18.not, label %if.then19, label %if.else22
if.then19: ; preds = %if.else15
%9 = load i32, ptr @root, align 4, !tbaa !5
call void @inorder(i32 noundef %9)
%putchar = call i32 @putchar(i32 10)
%10 = load i32, ptr @root, align 4, !tbaa !5
call void @preorder(i32 noundef %10)
%putchar35 = call i32 @putchar(i32 10)
br label %for.inc
if.else22: ; preds = %if.else15
%bcmp36 = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) @.str.9, ptr noundef nonnull dereferenceable(7) %o, i64 7)
%tobool25.not = icmp eq i32 %bcmp36, 0
br i1 %tobool25.not, label %if.then26, label %for.inc
if.then26: ; preds = %if.else22
call void @delete()
br label %for.inc
for.inc: ; preds = %if.else34.i, %if.then30.i, %if.then21.i, %if.then19, %if.then26, %if.else22, %if.then11, %if.else13
%inc = add nuw nsw i32 %i.049, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %11
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !18
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %o) #7
ret i32 0
}
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"node_tbl", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 12}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!10, !6, i64 4}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
|
#include <stdio.h>
#include <stdlib.h>
#define nil NULL
struct node{
struct node *right;
struct node *left;
struct node *p;
int key;
};
typedef struct node * Node;
Node root;
Node treeMinimum(Node);
Node treeMaximum(Node);
Node treeSearch(Node, int);
Node treeSuccessor(Node);
void treeDelete(Node);
void transplant(Node,Node);
void insert(int);
void inorder(Node);
void preorder(Node);
int main(){
int n, a, x;
char command[20];
scanf("%d",&n);
for(a = 0; a < n; a++){
scanf("%s",command);
if(command[0] == 'f'){
scanf("%d",&x);
Node t = treeSearch(root,x);
if(t != nil) printf("yes\n");
else printf("no\n");
}
else if(command[0] == 'i'){
scanf("%d",&x);
insert(x);
}
else if(command[0] == 'p'){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if(command[0] == 'd'){
scanf("%d",&x);
treeDelete(treeSearch(root,x));
}
}
return 0;
}
Node treeMinimum(Node x){
while(x->left != nil) x = x->left;
return x;
}
Node treeMaximum(Node x){
while(x->right != nil) x = x->right;
return x;
}
Node treeSearch(Node x, int k){
if(x == nil || k == x->key) return x;
if(k < x->key) return treeSearch(x->left,k);
else return treeSearch(x->right,k);
}
Node treeSuccessor(Node x){
Node y;
if(x->right != nil) return treeMinimum(x->right);
y = x->p;
while(y != nil && x == y->right){
x = y;
y = y->p;
}
return y;
}
void treeDelete(Node z){
Node y;
if(z->left == nil) transplant(z,z->right);
else if(z->right == nil) transplant(z,z->left);
else{
y = treeMinimum(z->right);
if(y->p != z){
transplant(y,y->right);
y->right = z->right;
y->right->p = y;
}
transplant(z,y);
y->left = z->left;
y->left->p = y;
}
}
void transplant(Node u, Node v){
if(u->p == nil) root = v;
else if(u == u->p->left) u->p->left = v;
else u->p->right = v;
if(v != nil) v->p = u->p;
}
void insert(int k){
Node y = nil;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = nil;
z->right = nil;
while(x != nil){
y = x;
if(z->key < x->key) x = x->left;
else x = x->right;
}
z->p = y;
if(y == nil) root = z;
else if(z->key < y->key) y->left = z;
else y->right = z;
}
void inorder(Node x){
if(x != nil){
inorder(x->left);
printf(" %d",x->key);
inorder(x->right);
}
}
void preorder(Node x){
if(x != nil){
printf(" %d",x->key);
preorder(x->left);
preorder(x->right);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207097/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207097/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@.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
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str.5 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = 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
%x = alloca i32, align 4
%command = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %command) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp64 = icmp sgt i32 %0, 0
br i1 %cmp64, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%a.065 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %command)
%1 = load i8, ptr %command, align 16, !tbaa !9
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !10
%3 = load i32, ptr %x, align 4, !tbaa !5
%cmp14.i = icmp eq ptr %2, null
br i1 %cmp14.i, label %if.else, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.then, %if.end.i
%x.tr15.i = phi ptr [ %x.tr.be.i, %if.end.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %x.tr15.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !12
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %x.tr15.i, i64 0, i32 1
%spec.select.i = select i1 %cmp3.i, ptr %left.i, ptr %x.tr15.i
%x.tr.be.i = load ptr, ptr %spec.select.i, align 8, !tbaa !10
%cmp.i = icmp eq ptr %x.tr.be.i, null
br i1 %cmp.i, label %if.else, label %lor.lhs.false.i
if.then8: ; preds = %lor.lhs.false.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.end.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !5
%6 = load ptr, ptr @root, align 8, !tbaa !10
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !12
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i
while.body.i: ; preds = %if.then16, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !12
%cmp3.i42 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i42, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !10
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %insert.exit, label %while.body.i, !llvm.loop !14
insert.exit: ; preds = %while.body.i, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i ]
%p37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %p37.i, align 8, !tbaa !16
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !10
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !10
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !10
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !10
%11 = load i32, ptr %x, align 4, !tbaa !5
%cmp14.i44 = icmp eq ptr %10, null
br i1 %cmp14.i44, label %treeSearch.exit56, label %lor.lhs.false.i45
lor.lhs.false.i45: ; preds = %if.then31, %if.end.i49
%x.tr15.i46 = phi ptr [ %x.tr.be.i53, %if.end.i49 ], [ %10, %if.then31 ]
%key.i47 = getelementptr inbounds %struct.node, ptr %x.tr15.i46, i64 0, i32 3
%12 = load i32, ptr %key.i47, align 8, !tbaa !12
%cmp1.i48 = icmp eq i32 %12, %11
br i1 %cmp1.i48, label %treeSearch.exit56, label %if.end.i49
if.end.i49: ; preds = %lor.lhs.false.i45
%cmp3.i50 = icmp sgt i32 %12, %11
%left.i51 = getelementptr inbounds %struct.node, ptr %x.tr15.i46, i64 0, i32 1
%spec.select.i52 = select i1 %cmp3.i50, ptr %left.i51, ptr %x.tr15.i46
%x.tr.be.i53 = load ptr, ptr %spec.select.i52, align 8, !tbaa !10
%cmp.i54 = icmp eq ptr %x.tr.be.i53, null
br i1 %cmp.i54, label %treeSearch.exit56, label %lor.lhs.false.i45
treeSearch.exit56: ; preds = %lor.lhs.false.i45, %if.end.i49, %if.then31
%retval.0.i55 = phi ptr [ null, %if.then31 ], [ %x.tr15.i46, %lor.lhs.false.i45 ], [ null, %if.end.i49 ]
%left.i57 = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 1
%13 = load ptr, ptr %left.i57, align 8, !tbaa !17
%cmp.i58 = icmp eq ptr %13, null
%14 = load ptr, ptr %retval.0.i55, align 8, !tbaa !18
br i1 %cmp.i58, label %if.then.i, label %if.else.i
if.then.i: ; preds = %treeSearch.exit56
%p.i.i = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 2
%15 = load ptr, ptr %p.i.i, align 8, !tbaa !16
%cmp.i.i = icmp eq ptr %15, null
br i1 %cmp.i.i, label %if.end8.i.i, label %if.else.i.i
if.else.i.i: ; preds = %if.then.i
%left.i.i = getelementptr inbounds %struct.node, ptr %15, i64 0, i32 1
%16 = load ptr, ptr %left.i.i, align 8, !tbaa !17
%cmp2.i.i = icmp eq ptr %16, %retval.0.i55
%left..i.i = select i1 %cmp2.i.i, ptr %left.i.i, ptr %15
br label %if.end8.i.i
if.end8.i.i: ; preds = %if.else.i.i, %if.then.i
%left.sink.i.i = phi ptr [ @root, %if.then.i ], [ %left..i.i, %if.else.i.i ]
store ptr %14, ptr %left.sink.i.i, align 8, !tbaa !10
%cmp9.not.i.i = icmp eq ptr %14, null
br i1 %cmp9.not.i.i, label %for.inc, label %if.end19.sink.split.i
if.else.i: ; preds = %treeSearch.exit56
%cmp2.i = icmp eq ptr %14, null
br i1 %cmp2.i, label %if.then3.i, label %while.cond.i.i
if.then3.i: ; preds = %if.else.i
%p.i40.i = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 2
%17 = load ptr, ptr %p.i40.i, align 8, !tbaa !16
%cmp.i41.i = icmp eq ptr %17, null
br i1 %cmp.i41.i, label %transplant.exit51.i, label %if.else.i42.i
if.else.i42.i: ; preds = %if.then3.i
%left.i43.i = getelementptr inbounds %struct.node, ptr %17, i64 0, i32 1
%18 = load ptr, ptr %left.i43.i, align 8, !tbaa !17
%cmp2.i44.i = icmp eq ptr %18, %retval.0.i55
%left..i45.i = select i1 %cmp2.i44.i, ptr %left.i43.i, ptr %17
br label %transplant.exit51.i
transplant.exit51.i: ; preds = %if.else.i42.i, %if.then3.i
%left.sink.i47.i = phi ptr [ @root, %if.then3.i ], [ %left..i45.i, %if.else.i42.i ]
store ptr %13, ptr %left.sink.i47.i, align 8, !tbaa !10
br label %if.end19.sink.split.i
while.cond.i.i: ; preds = %if.else.i, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %19, %while.cond.i.i ], [ %14, %if.else.i ]
%left.i52.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%19 = load ptr, ptr %left.i52.i, align 8, !tbaa !17
%cmp.not.i.i = icmp eq ptr %19, null
br i1 %cmp.not.i.i, label %treeMinimum.exit.i, label %while.cond.i.i, !llvm.loop !19
treeMinimum.exit.i: ; preds = %while.cond.i.i
%left.i52.i.le = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%p.i59 = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 2
%20 = load ptr, ptr %p.i59, align 8, !tbaa !16
%cmp7.not.i = icmp eq ptr %20, %retval.0.i55
br i1 %cmp7.not.i, label %if.end.i60, label %if.then8.i
if.then8.i: ; preds = %treeMinimum.exit.i
%21 = load ptr, ptr %x.addr.0.i.i, align 8, !tbaa !18
%cmp.i54.i = icmp eq ptr %20, null
br i1 %cmp.i54.i, label %if.end8.i59.i, label %if.else.i55.i
if.else.i55.i: ; preds = %if.then8.i
%left.i56.i = getelementptr inbounds %struct.node, ptr %20, i64 0, i32 1
%22 = load ptr, ptr %left.i56.i, align 8, !tbaa !17
%cmp2.i57.i = icmp eq ptr %22, %x.addr.0.i.i
%left..i58.i = select i1 %cmp2.i57.i, ptr %left.i56.i, ptr %20
br label %if.end8.i59.i
if.end8.i59.i: ; preds = %if.else.i55.i, %if.then8.i
%left.sink.i60.i = phi ptr [ @root, %if.then8.i ], [ %left..i58.i, %if.else.i55.i ]
store ptr %21, ptr %left.sink.i60.i, align 8, !tbaa !10
%cmp9.not.i61.i = icmp eq ptr %21, null
br i1 %cmp9.not.i61.i, label %transplant.exit64.i, label %if.then10.i62.i
if.then10.i62.i: ; preds = %if.end8.i59.i
%p12.i63.i = getelementptr inbounds %struct.node, ptr %21, i64 0, i32 2
store ptr %20, ptr %p12.i63.i, align 8, !tbaa !16
br label %transplant.exit64.i
transplant.exit64.i: ; preds = %if.then10.i62.i, %if.end8.i59.i
%23 = load ptr, ptr %retval.0.i55, align 8, !tbaa !18
store ptr %23, ptr %x.addr.0.i.i, align 8, !tbaa !18
%p13.i = getelementptr inbounds %struct.node, ptr %23, i64 0, i32 2
store ptr %x.addr.0.i.i, ptr %p13.i, align 8, !tbaa !16
br label %if.end.i60
if.end.i60: ; preds = %transplant.exit64.i, %treeMinimum.exit.i
%p.i65.i = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 2
%24 = load ptr, ptr %p.i65.i, align 8, !tbaa !16
%cmp.i66.i = icmp eq ptr %24, null
br i1 %cmp.i66.i, label %transplant.exit76.i, label %if.else.i67.i
if.else.i67.i: ; preds = %if.end.i60
%left.i68.i = getelementptr inbounds %struct.node, ptr %24, i64 0, i32 1
%25 = load ptr, ptr %left.i68.i, align 8, !tbaa !17
%cmp2.i69.i = icmp eq ptr %25, %retval.0.i55
%left..i70.i = select i1 %cmp2.i69.i, ptr %left.i68.i, ptr %24
br label %transplant.exit76.i
transplant.exit76.i: ; preds = %if.else.i67.i, %if.end.i60
%left.sink.i72.i = phi ptr [ @root, %if.end.i60 ], [ %left..i70.i, %if.else.i67.i ]
store ptr %x.addr.0.i.i, ptr %left.sink.i72.i, align 8, !tbaa !10
store ptr %24, ptr %p.i59, align 8, !tbaa !16
%26 = load ptr, ptr %left.i57, align 8, !tbaa !17
store ptr %26, ptr %left.i52.i.le, align 8, !tbaa !17
br label %if.end19.sink.split.i
if.end19.sink.split.i: ; preds = %transplant.exit76.i, %transplant.exit51.i, %if.end8.i.i
%.sink79.i = phi ptr [ %13, %transplant.exit51.i ], [ %26, %transplant.exit76.i ], [ %14, %if.end8.i.i ]
%.sink.i = phi ptr [ %17, %transplant.exit51.i ], [ %x.addr.0.i.i, %transplant.exit76.i ], [ %15, %if.end8.i.i ]
%p12.i.i = getelementptr inbounds %struct.node, ptr %.sink79.i, i64 0, i32 2
store ptr %.sink.i, ptr %p12.i.i, align 8, !tbaa !16
br label %for.inc
for.inc: ; preds = %if.end19.sink.split.i, %if.end8.i.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %a.065, 1
%27 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %27
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %command) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %x, i32 noundef %k) local_unnamed_addr #3 {
entry:
%cmp14 = icmp eq ptr %x, null
br i1 %cmp14, label %return, label %lor.lhs.false
lor.lhs.false: ; preds = %entry, %if.end
%x.tr15 = phi ptr [ %x.tr.be, %if.end ], [ %x, %entry ]
%key = getelementptr inbounds %struct.node, ptr %x.tr15, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !12
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %return, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %x.tr15, i64 0, i32 1
%spec.select = select i1 %cmp3, ptr %left, ptr %x.tr15
%x.tr.be = load ptr, ptr %spec.select, align 8, !tbaa !10
%cmp = icmp eq ptr %x.tr.be, null
br i1 %cmp, label %return, label %lor.lhs.false
return: ; preds = %lor.lhs.false, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ null, %if.end ], [ %x.tr15, %lor.lhs.false ]
ret ptr %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !10
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !12
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !12
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !10
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !14
if.then7: ; preds = %entry
%p37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %p37, align 8, !tbaa !16
br label %if.end17
if.else8: ; preds = %while.body
%p = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %p, align 8, !tbaa !16
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !12
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !10
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp eq ptr %x, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%x.tr5 = phi ptr [ %2, %if.then ], [ %x, %entry ]
%left = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !17
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !12
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %1)
%2 = load ptr, ptr %x.tr5, align 8, !tbaa !18
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp eq ptr %x, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%x.tr5 = phi ptr [ %2, %if.then ], [ %x, %entry ]
%key = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !12
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %x.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !17
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %x.tr5, align 8, !tbaa !18
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef readonly %z) local_unnamed_addr #4 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !17
%cmp = icmp eq ptr %0, null
%1 = load ptr, ptr %z, align 8, !tbaa !18
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%p.i = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%2 = load ptr, ptr %p.i, align 8, !tbaa !16
%cmp.i = icmp eq ptr %2, null
br i1 %cmp.i, label %if.end8.i, label %if.else.i
if.else.i: ; preds = %if.then
%left.i = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 1
%3 = load ptr, ptr %left.i, align 8, !tbaa !17
%cmp2.i = icmp eq ptr %3, %z
%left..i = select i1 %cmp2.i, ptr %left.i, ptr %2
br label %if.end8.i
if.end8.i: ; preds = %if.else.i, %if.then
%left.sink.i = phi ptr [ @root, %if.then ], [ %left..i, %if.else.i ]
store ptr %1, ptr %left.sink.i, align 8, !tbaa !10
%cmp9.not.i = icmp eq ptr %1, null
br i1 %cmp9.not.i, label %if.end19, label %if.end19.sink.split
if.else: ; preds = %entry
%cmp2 = icmp eq ptr %1, null
br i1 %cmp2, label %if.then3, label %while.cond.i
if.then3: ; preds = %if.else
%p.i40 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%4 = load ptr, ptr %p.i40, align 8, !tbaa !16
%cmp.i41 = icmp eq ptr %4, null
br i1 %cmp.i41, label %transplant.exit51, label %if.else.i42
if.else.i42: ; preds = %if.then3
%left.i43 = getelementptr inbounds %struct.node, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %left.i43, align 8, !tbaa !17
%cmp2.i44 = icmp eq ptr %5, %z
%left..i45 = select i1 %cmp2.i44, ptr %left.i43, ptr %4
br label %transplant.exit51
transplant.exit51: ; preds = %if.else.i42, %if.then3
%left.sink.i47 = phi ptr [ @root, %if.then3 ], [ %left..i45, %if.else.i42 ]
store ptr %0, ptr %left.sink.i47, align 8, !tbaa !10
br label %if.end19.sink.split
while.cond.i: ; preds = %if.else, %while.cond.i
%x.addr.0.i = phi ptr [ %6, %while.cond.i ], [ %1, %if.else ]
%left.i52 = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%6 = load ptr, ptr %left.i52, align 8, !tbaa !17
%cmp.not.i = icmp eq ptr %6, null
br i1 %cmp.not.i, label %treeMinimum.exit, label %while.cond.i, !llvm.loop !19
treeMinimum.exit: ; preds = %while.cond.i
%left.i52.le = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%p = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 2
%7 = load ptr, ptr %p, align 8, !tbaa !16
%cmp7.not = icmp eq ptr %7, %z
br i1 %cmp7.not, label %if.end, label %if.then8
if.then8: ; preds = %treeMinimum.exit
%8 = load ptr, ptr %x.addr.0.i, align 8, !tbaa !18
%cmp.i54 = icmp eq ptr %7, null
br i1 %cmp.i54, label %if.end8.i59, label %if.else.i55
if.else.i55: ; preds = %if.then8
%left.i56 = getelementptr inbounds %struct.node, ptr %7, i64 0, i32 1
%9 = load ptr, ptr %left.i56, align 8, !tbaa !17
%cmp2.i57 = icmp eq ptr %9, %x.addr.0.i
%left..i58 = select i1 %cmp2.i57, ptr %left.i56, ptr %7
br label %if.end8.i59
if.end8.i59: ; preds = %if.else.i55, %if.then8
%left.sink.i60 = phi ptr [ @root, %if.then8 ], [ %left..i58, %if.else.i55 ]
store ptr %8, ptr %left.sink.i60, align 8, !tbaa !10
%cmp9.not.i61 = icmp eq ptr %8, null
br i1 %cmp9.not.i61, label %transplant.exit64, label %if.then10.i62
if.then10.i62: ; preds = %if.end8.i59
%p12.i63 = getelementptr inbounds %struct.node, ptr %8, i64 0, i32 2
store ptr %7, ptr %p12.i63, align 8, !tbaa !16
br label %transplant.exit64
transplant.exit64: ; preds = %if.end8.i59, %if.then10.i62
%10 = load ptr, ptr %z, align 8, !tbaa !18
store ptr %10, ptr %x.addr.0.i, align 8, !tbaa !18
%p13 = getelementptr inbounds %struct.node, ptr %10, i64 0, i32 2
store ptr %x.addr.0.i, ptr %p13, align 8, !tbaa !16
br label %if.end
if.end: ; preds = %transplant.exit64, %treeMinimum.exit
%p.i65 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%11 = load ptr, ptr %p.i65, align 8, !tbaa !16
%cmp.i66 = icmp eq ptr %11, null
br i1 %cmp.i66, label %transplant.exit76, label %if.else.i67
if.else.i67: ; preds = %if.end
%left.i68 = getelementptr inbounds %struct.node, ptr %11, i64 0, i32 1
%12 = load ptr, ptr %left.i68, align 8, !tbaa !17
%cmp2.i69 = icmp eq ptr %12, %z
%left..i70 = select i1 %cmp2.i69, ptr %left.i68, ptr %11
br label %transplant.exit76
transplant.exit76: ; preds = %if.else.i67, %if.end
%left.sink.i72 = phi ptr [ @root, %if.end ], [ %left..i70, %if.else.i67 ]
store ptr %x.addr.0.i, ptr %left.sink.i72, align 8, !tbaa !10
store ptr %11, ptr %p, align 8, !tbaa !16
%13 = load ptr, ptr %left, align 8, !tbaa !17
store ptr %13, ptr %left.i52.le, align 8, !tbaa !17
br label %if.end19.sink.split
if.end19.sink.split: ; preds = %if.end8.i, %transplant.exit76, %transplant.exit51
%.sink79 = phi ptr [ %0, %transplant.exit51 ], [ %13, %transplant.exit76 ], [ %1, %if.end8.i ]
%.sink = phi ptr [ %4, %transplant.exit51 ], [ %x.addr.0.i, %transplant.exit76 ], [ %2, %if.end8.i ]
%p12.i = getelementptr inbounds %struct.node, ptr %.sink79, i64 0, i32 2
store ptr %.sink, ptr %p12.i, align 8, !tbaa !16
br label %if.end19
if.end19: ; preds = %if.end19.sink.split, %if.end8.i
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !17
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !19
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMaximum(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%0 = load ptr, ptr %x.addr.0, align 8, !tbaa !18
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !21
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !18
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !17
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !19
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !16
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !18
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !22
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @transplant(ptr noundef readonly %u, ptr noundef %v) local_unnamed_addr #5 {
entry:
%p = getelementptr inbounds %struct.node, ptr %u, i64 0, i32 2
%0 = load ptr, ptr %p, align 8, !tbaa !16
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %if.else
if.else: ; preds = %entry
%left = getelementptr inbounds %struct.node, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !17
%cmp2 = icmp eq ptr %1, %u
%left. = select i1 %cmp2, ptr %left, ptr %0
br label %if.end8
if.end8: ; preds = %if.else, %entry
%left.sink = phi ptr [ @root, %entry ], [ %left., %if.else ]
store ptr %v, ptr %left.sink, align 8, !tbaa !10
%cmp9.not = icmp eq ptr %v, null
br i1 %cmp9.not, label %if.end13, label %if.then10
if.then10: ; preds = %if.end8
%p12 = getelementptr inbounds %struct.node, ptr %v, i64 0, i32 2
store ptr %0, ptr %p12, align 8, !tbaa !16
br label %if.end13
if.end13: ; preds = %if.then10, %if.end8
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !6, i64 24}
!13 = !{!"node", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!13, !11, i64 16}
!17 = !{!13, !11, i64 8}
!18 = !{!13, !11, i64 0}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}
|
#include <stdio.h>
int main()
{
int n, k, l, c, d, p, nl, np;
scanf("%d%d%d%d%d%d%d%d", &n, &k, &l, &c, &d, &p, &nl, &np);
int ans = 0, x = k * l, y = c * d, z = p, dx = n * nl, dy = n, dz = n * np;
while (x >= dx && y >= dy && z >= dz)
x -= dx, y -=dy, z -= dz, ++ans;
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20714/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20714/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d%d%d%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%l = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%p = alloca i32, align 4
%nl = alloca i32, align 4
%np = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nl) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %np) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %l, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %p, ptr noundef nonnull %nl, ptr noundef nonnull %np)
%0 = load i32, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %l, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, %2
%4 = load i32, ptr %p, align 4, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = load i32, ptr %nl, align 4, !tbaa !5
%mul2 = mul nsw i32 %6, %5
%7 = load i32, ptr %np, align 4, !tbaa !5
%mul3 = mul nsw i32 %7, %5
%cmp.not17 = icmp slt i32 %mul, %mul2
%cmp4.not18 = icmp slt i32 %mul1, %5
%or.cond19 = select i1 %cmp.not17, i1 true, i1 %cmp4.not18
%cmp5.not20 = icmp slt i32 %4, %mul3
%or.cond1621 = select i1 %or.cond19, i1 true, i1 %cmp5.not20
br i1 %or.cond1621, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%ans.025 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%x.024 = phi i32 [ %sub, %while.body ], [ %mul, %entry ]
%y.023 = phi i32 [ %sub6, %while.body ], [ %mul1, %entry ]
%z.022 = phi i32 [ %sub7, %while.body ], [ %4, %entry ]
%sub = sub nsw i32 %x.024, %mul2
%sub6 = sub nsw i32 %y.023, %5
%sub7 = sub nsw i32 %z.022, %mul3
%inc = add nuw nsw i32 %ans.025, 1
%cmp.not = icmp slt i32 %sub, %mul2
%cmp4.not = icmp slt i32 %sub6, %5
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp4.not
%cmp5.not = icmp slt i32 %sub7, %mul3
%or.cond16 = select i1 %or.cond, i1 true, i1 %cmp5.not
br i1 %or.cond16, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call8 = 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 %np) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nl) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x){
while(x->left !=NIL) x=x->left;
return x;
}
Node treeMaximum(Node x){
while(x->right != NIL) x=x->right;
return x;
}
Node treeSuccessor(Node x){
Node y;
if(x->right != NIL) return treeMinimum(x->right);
y=x->parent;
while(y!=NIL && x==y->right){
x=y;
y=y->parent;
}
return y;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z->left==NIL || z->right==NIL) y=z;
else y=treeSuccessor(z);
if(y->left !=NIL) x=y->left;
else x=y->right;
if(x!=NIL) x->parent=y->parent;
if(y->parent ==NIL)
root=x;
else if(y==y->parent->left) y->parent->left=x;
else y->parent->right=x;
if(y!=z) z->key=y->key;
}
Node treeSearch(Node u, int k){
while(u!=NIL&&k!=u->key){
if(k<u->key) u=u->left;
else u=u->right;
}
return u;
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y = x;
if(z->key < x->key) x=x->left;
else x=x->right;
}
z->parent = y;
if(y==NIL) root=z;
else if(z->key<y->key) y->left = z;
else y->right = z;
}
void inorder(Node u){
if(u!=NIL){
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
}
void preorder(Node u){
if(u!=NIL){
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207183/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207183/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = 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.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMaximum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%0 = load ptr, ptr %x.addr.0, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !14
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !15
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !13
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !16
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !13
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !13
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.058, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !15
%parent11 = getelementptr inbounds %struct.node, ptr %x.054, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !15
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.060 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !15
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.060, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !17
%cmp28.not = icmp eq ptr %y.060, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !18
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !18
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp.not10 = icmp eq ptr %u, null
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !18
%cmp1.not = icmp eq i32 %0, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %left, ptr %u.addr.011
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !17
%cmp.not = icmp eq ptr %u.addr.1, null
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !19
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ null, %entry ], [ null, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !17
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !18
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !18
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !17
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !20
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !15
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !15
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !18
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !17
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp.not4 = icmp eq ptr %u, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr5 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !18
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp.not4 = icmp eq ptr %u, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr5 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !18
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !21
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.064 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !22
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !17
%3 = load i32, ptr %x, align 4, !tbaa !21
%cmp.not10.i = icmp eq ptr %2, null
br i1 %cmp.not10.i, label %if.else, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !18
%cmp1.not.i = icmp eq i32 %4, %3
br i1 %cmp1.not.i, label %if.then8, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %left.i, ptr %u.addr.011.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !17
%cmp.not.i = icmp eq ptr %u.addr.1.i, null
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !19
if.then8: ; preds = %land.rhs.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %while.body.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !21
%6 = load ptr, ptr @root, align 8, !tbaa !17
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !18
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i42
while.body.i42: ; preds = %if.then16, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !18
%cmp3.i43 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !17
%cmp.not.i44 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i44, label %insert.exit, label %while.body.i42, !llvm.loop !20
insert.exit: ; preds = %while.body.i42, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i42 ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i42 ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !15
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !17
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !17
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !17
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !17
%11 = load i32, ptr %x, align 4, !tbaa !21
%cmp.not10.i45 = icmp eq ptr %10, null
br i1 %cmp.not10.i45, label %treeSearch.exit57, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then31, %while.body.i50
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i50 ], [ %10, %if.then31 ]
%key.i48 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 3
%12 = load i32, ptr %key.i48, align 8, !tbaa !18
%cmp1.not.i49 = icmp eq i32 %12, %11
br i1 %cmp1.not.i49, label %treeSearch.exit57, label %while.body.i50
while.body.i50: ; preds = %land.rhs.i46
%cmp3.i51 = icmp sgt i32 %12, %11
%left.i52 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 1
%u.addr.1.in.i53 = select i1 %cmp3.i51, ptr %left.i52, ptr %u.addr.011.i47
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !17
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, null
br i1 %cmp.not.i55, label %treeSearch.exit57, label %land.rhs.i46, !llvm.loop !19
treeSearch.exit57: ; preds = %land.rhs.i46, %while.body.i50, %if.then31
%u.addr.0.lcssa.i56 = phi ptr [ null, %if.then31 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ null, %while.body.i50 ]
%left.i58 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 1
%13 = load ptr, ptr %left.i58, align 8, !tbaa !5
%cmp.i = icmp eq ptr %13, null
br i1 %cmp.i, label %if.end8.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %treeSearch.exit57
%14 = load ptr, ptr %u.addr.0.lcssa.i56, align 8, !tbaa !13
%cmp1.i = icmp eq ptr %14, null
br i1 %cmp1.i, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit57
%y.0.ph.i = phi ptr [ %u.addr.0.lcssa.i56, %treeSearch.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !13
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %u.addr.0.lcssa.i56, %lor.lhs.false.i ]
%x.054.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i ]
%parent.i59 = getelementptr inbounds %struct.node, ptr %y.058.i, i64 0, i32 2
%17 = load ptr, ptr %parent.i59, align 8, !tbaa !15
%parent11.i = getelementptr inbounds %struct.node, ptr %x.054.i, i64 0, i32 2
store ptr %17, ptr %parent11.i, align 8, !tbaa !15
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.060.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 2
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !15
%cmp14.i = icmp eq ptr %18, null
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.060.i, %19
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !17
%cmp28.not.i = icmp eq ptr %y.060.i, %u.addr.0.lcssa.i56
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i60 = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 3
%20 = load i32, ptr %key.i60, align 8, !tbaa !18
%key30.i = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !18
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.064, 1
%21 = load i32, ptr %n, align 4, !tbaa !21
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !23
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = !{!6, !7, i64 16}
!16 = distinct !{!16, !12}
!17 = !{!7, !7, i64 0}
!18 = !{!6, !10, i64 24}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!10, !10, i64 0}
!22 = !{!8, !8, i64 0}
!23 = distinct !{!23, !12}
|
#include<stdio.h>
#include<stdlib.h>
#define NIL NULL
struct node{
struct node *parent;
struct node *right;
struct node *left;
int key;
};
typedef struct node * Node;
Node root;
Node Minimum(Node x);
Node Search(Node u, int k);
Node Successor(Node x);
void Delete(Node z);
void insert(int k);
void inorder(Node u);
void preorder(Node u);
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = Search(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if ( com[0] == 'd' ){
scanf("%d", &x);
Delete(Search(root, x));
}
}
return 0;
}
Node Minimum(Node x){
while(x->left!=NIL){
x=x->left;
}
return x;
}
Node Search(Node u, int k){
if(u==NIL || k==u->key) return u;
if(k<u->key) return Search(u->left,k);
else return Search(u->right,k);
}
Node Successor(Node x){
if (x->right!=NIL) return Minimum(x->right);
root=x->parent;
while(root!=NIL && x==root->right){
x=root;
root=root->parent;
}
return root;
}
void Delete(Node z){
Node y;
Node x;
if(z->left==NIL || z->right==NIL){ y=z;
}
else y=Successor(z);
if(y->left!=NIL) {x=y->left;
}
else x=y->right;
if(x!=NIL) {x->parent=y->parent;
}
if(y->parent==NIL){ root=x;
}
else if(y==y->parent->left) {y->parent->left=x;
}
else y->parent->right=x;
if(y!=z) {z->key=y->key;
}
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y=x;
if(z->key<x->key) x=x->left;
else x=x->right;
z->parent=y;
}
if(y==NIL) root=z;
else if (z->key<y->key)
y->left=z;
else y->right=z;
}
void inorder(Node u){
if(u!=NIL) {
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
}
void preorder(Node u){
if(u!=NIL){
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207226/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207226/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@.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
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str.5 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = 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
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp67 = icmp sgt i32 %0, 0
br i1 %cmp67, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.068 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !9
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !10
%3 = load i32, ptr %x, align 4, !tbaa !5
%cmp14.i = icmp eq ptr %2, null
br i1 %cmp14.i, label %if.else, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.then, %if.end.i
%u.tr15.i = phi ptr [ %u.tr.be.i, %if.end.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !12
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 2
%right.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 1
%u.tr.be.in.i = select i1 %cmp3.i, ptr %left.i, ptr %right.i
%u.tr.be.i = load ptr, ptr %u.tr.be.in.i, align 8, !tbaa !10
%cmp.i = icmp eq ptr %u.tr.be.i, null
br i1 %cmp.i, label %if.else, label %lor.lhs.false.i
if.then8: ; preds = %lor.lhs.false.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.end.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !5
%6 = load ptr, ptr @root, align 8, !tbaa !10
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !12
%right.i42 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 1
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %right.i42, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i
while.body.i: ; preds = %if.then16, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !12
%cmp3.i43 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 2
%right5.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %right5.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !10
store ptr %x.035.i, ptr %call.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %insert.exit, label %while.body.i, !llvm.loop !15
insert.exit: ; preds = %while.body.i, %if.then16
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i ]
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !10
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !10
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !10
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !10
%11 = load i32, ptr %x, align 4, !tbaa !5
%cmp14.i44 = icmp eq ptr %10, null
br i1 %cmp14.i44, label %Search.exit57, label %lor.lhs.false.i45
lor.lhs.false.i45: ; preds = %if.then31, %if.end.i49
%u.tr15.i46 = phi ptr [ %u.tr.be.i54, %if.end.i49 ], [ %10, %if.then31 ]
%key.i47 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 3
%12 = load i32, ptr %key.i47, align 8, !tbaa !12
%cmp1.i48 = icmp eq i32 %12, %11
br i1 %cmp1.i48, label %Search.exit57, label %if.end.i49
if.end.i49: ; preds = %lor.lhs.false.i45
%cmp3.i50 = icmp sgt i32 %12, %11
%left.i51 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 2
%right.i52 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 1
%u.tr.be.in.i53 = select i1 %cmp3.i50, ptr %left.i51, ptr %right.i52
%u.tr.be.i54 = load ptr, ptr %u.tr.be.in.i53, align 8, !tbaa !10
%cmp.i55 = icmp eq ptr %u.tr.be.i54, null
br i1 %cmp.i55, label %Search.exit57, label %lor.lhs.false.i45
Search.exit57: ; preds = %lor.lhs.false.i45, %if.end.i49, %if.then31
%retval.0.i56 = phi ptr [ null, %if.then31 ], [ %u.tr15.i46, %lor.lhs.false.i45 ], [ null, %if.end.i49 ]
%left.i58 = getelementptr inbounds %struct.node, ptr %retval.0.i56, i64 0, i32 2
%13 = load ptr, ptr %left.i58, align 8, !tbaa !17
%cmp.i59 = icmp eq ptr %13, null
br i1 %cmp.i59, label %if.end8.i, label %lor.lhs.false.i60
lor.lhs.false.i60: ; preds = %Search.exit57
%right.i61 = getelementptr inbounds %struct.node, ptr %retval.0.i56, i64 0, i32 1
%14 = load ptr, ptr %right.i61, align 8, !tbaa !18
%cmp1.i62 = icmp eq ptr %14, null
br i1 %cmp1.i62, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i60, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i60 ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 2
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !17
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !19
if.end8.i: ; preds = %while.cond.i.i.i, %Search.exit57
%y.0.ph.i = phi ptr [ %retval.0.i56, %Search.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%right7.i = getelementptr inbounds %struct.node, ptr %y.0.ph.i, i64 0, i32 1
%16 = load ptr, ptr %right7.i, align 8, !tbaa !18
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i60
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %retval.0.i56, %lor.lhs.false.i60 ]
%x.054.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i60 ]
%17 = load ptr, ptr %y.058.i, align 8, !tbaa !14
store ptr %17, ptr %x.054.i, align 8, !tbaa !14
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.059.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%18 = load ptr, ptr %y.059.i, align 8, !tbaa !14
%cmp14.i63 = icmp eq ptr %18, null
br i1 %cmp14.i63, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 2
%19 = load ptr, ptr %left18.i, align 8, !tbaa !17
%cmp19.i = icmp eq ptr %y.059.i, %19
%right25.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%spec.select.i = select i1 %cmp19.i, ptr %left18.i, ptr %right25.i
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %spec.select.i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !10
%cmp28.not.i = icmp eq ptr %y.059.i, %retval.0.i56
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i64 = getelementptr inbounds %struct.node, ptr %y.059.i, i64 0, i32 3
%20 = load i32, ptr %key.i64, align 8, !tbaa !12
%key30.i = getelementptr inbounds %struct.node, ptr %retval.0.i56, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !12
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.068, 1
%21 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @Search(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #3 {
entry:
%cmp14 = icmp eq ptr %u, null
br i1 %cmp14, label %return, label %lor.lhs.false
lor.lhs.false: ; preds = %entry, %if.end
%u.tr15 = phi ptr [ %u.tr.be, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !12
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %return, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 2
%right = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 1
%u.tr.be.in = select i1 %cmp3, ptr %left, ptr %right
%u.tr.be = load ptr, ptr %u.tr.be.in, align 8, !tbaa !10
%cmp = icmp eq ptr %u.tr.be, null
br i1 %cmp, label %return, label %lor.lhs.false
return: ; preds = %lor.lhs.false, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ null, %if.end ], [ %u.tr15, %lor.lhs.false ]
ret ptr %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !10
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !12
%right = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %right, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.end17, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !12
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 2
%right5 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %right5
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !10
store ptr %x.035, ptr %call, align 8, !tbaa !14
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !15
if.else8: ; preds = %while.body
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !12
%cmp11 = icmp sgt i32 %2, %k
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 2
br label %if.end17
if.else14: ; preds = %if.else8
%right15 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
br label %if.end17
if.end17: ; preds = %entry, %if.then12, %if.else14
%left13.sink = phi ptr [ %left13, %if.then12 ], [ %right15, %if.else14 ], [ @root, %entry ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !10
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp eq ptr %u, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr5 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !17
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !12
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %1)
%right = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%2 = load ptr, ptr %right, align 8, !tbaa !18
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp eq ptr %u, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr5 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !12
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !17
tail call void @preorder(ptr noundef %1)
%right = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%2 = load ptr, ptr %right, align 8, !tbaa !18
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @Delete(ptr noundef %z) local_unnamed_addr #4 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !17
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%right = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%1 = load ptr, ptr %right, align 8, !tbaa !18
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 2
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !17
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !19
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%right7 = getelementptr inbounds %struct.node, ptr %y.0.ph, i64 0, i32 1
%3 = load ptr, ptr %right7, align 8, !tbaa !18
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%4 = load ptr, ptr %y.058, align 8, !tbaa !14
store ptr %4, ptr %x.054, align 8, !tbaa !14
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.059 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%5 = load ptr, ptr %y.059, align 8, !tbaa !14
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 2
%6 = load ptr, ptr %left18, align 8, !tbaa !17
%cmp19 = icmp eq ptr %y.059, %6
%right25 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%spec.select = select i1 %cmp19, ptr %left18, ptr %right25
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %spec.select, %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !10
%cmp28.not = icmp eq ptr %y.059, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.059, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !12
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !12
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @Minimum(ptr noundef readonly %x) local_unnamed_addr #3 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !17
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !19
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local ptr @Successor(ptr noundef readonly %x) local_unnamed_addr #5 {
entry:
%right = getelementptr inbounds %struct.node, ptr %x, i64 0, i32 1
%0 = load ptr, ptr %right, align 8, !tbaa !18
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 2
%1 = load ptr, ptr %left.i, align 8, !tbaa !17
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !19
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %storemerge, %land.rhs ], [ %x, %entry ]
%storemerge = load ptr, ptr %x.addr.0, align 8, !tbaa !14
store ptr %storemerge, ptr @root, align 8, !tbaa !10
%cmp2.not = icmp eq ptr %storemerge, null
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%right3 = getelementptr inbounds %struct.node, ptr %storemerge, i64 0, i32 1
%2 = load ptr, ptr %right3, align 8, !tbaa !18
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !21
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %storemerge, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !6, i64 24}
!13 = !{!"node", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24}
!14 = !{!13, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!13, !11, i64 16}
!18 = !{!13, !11, i64 8}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
|
#include <stdio.h>
#include <string.h>
int main(void) {
char s[100];
char t[100];
int leng1;
int leng2;
int judge = 1;
scanf("%s", s);
scanf("%s", t);
leng1 = strlen(s);
leng2 = strlen(t);
for(int i = 0; i < leng1; i++) {
if(s[i] != t[i]) {
judge = 0;
}
}
if(judge == 1 && leng2 - leng1 == 1) {
printf("Yes");
} else {
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207277/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207277/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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:
%s = alloca [100 x i8], align 16
%t = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %t) #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, ptr noundef nonnull %t)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%conv = trunc i64 %call4 to i32
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #5
%cmp27 = icmp sgt i32 %conv, 0
br i1 %cmp27, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call4, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader38, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call4, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %6, %vector.body ]
%vec.phi31 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %7, %vector.body ]
%0 = getelementptr inbounds [100 x i8], ptr %s, 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.load32 = load <4 x i8>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds [100 x i8], ptr %t, i64 0, i64 %index
%wide.load33 = load <4 x i8>, ptr %2, align 8, !tbaa !5
%3 = getelementptr inbounds i8, ptr %2, i64 4
%wide.load34 = load <4 x i8>, ptr %3, align 4, !tbaa !5
%4 = icmp eq <4 x i8> %wide.load, %wide.load33
%5 = icmp eq <4 x i8> %wide.load32, %wide.load34
%6 = select <4 x i1> %4, <4 x i32> %vec.phi, <4 x i32> zeroinitializer
%7 = select <4 x i1> %5, <4 x i32> %vec.phi31, <4 x i32> zeroinitializer
%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
%rdx.select.cmp.not = icmp ne <4 x i32> %6, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp3537 = icmp ne <4 x i32> %7, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp35 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp3537
%9 = bitcast <4 x i1> %rdx.select.cmp35 to i4
%.not = icmp eq i4 %9, 0
%rdx.select36 = zext i1 %.not to i32
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader38
for.body.preheader38: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%judge.028.ph = phi i32 [ 1, %for.body.preheader ], [ %rdx.select36, %middle.block ]
br label %for.body
for.cond.cleanup.loopexit.loopexit: ; preds = %for.body
%10 = icmp eq i32 %spec.select, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %middle.block, %for.cond.cleanup.loopexit.loopexit, %entry
%judge.0.lcssa = phi i1 [ true, %entry ], [ %.not, %middle.block ], [ %10, %for.cond.cleanup.loopexit.loopexit ]
%conv7 = trunc i64 %call6 to i32
%sub = sub nsw i32 %conv7, %conv
%cmp17 = icmp eq i32 %sub, 1
%or.cond = select i1 %judge.0.lcssa, i1 %cmp17, i1 false
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4
ret i32 0
for.body: ; preds = %for.body.preheader38, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader38 ]
%judge.028 = phi i32 [ %spec.select, %for.body ], [ %judge.028.ph, %for.body.preheader38 ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%11 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx11 = getelementptr inbounds [100 x i8], ptr %t, i64 0, i64 %indvars.iv
%12 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%cmp13.not = icmp eq i8 %11, %12
%spec.select = select i1 %cmp13.not, i32 %judge.028, i32 0
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup.loopexit.loopexit, 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: 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 nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !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 mini(int a,int b)
{
if(a < b)
return a;
else
return b;
}
int main()
{
int n,k,l,c,d,p,nl,np,ans,min,m1,m2,m3;
scanf("%d%d%d%d%d%d%d%d",&n,&k,&l,&c,&d,&p,&nl,&np);
m1 = (k*l)/nl;
m2 = (c*d);
m3 = p/np;
printf("%d\n",mini(m1,mini(m2,m3))/n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20732/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20732/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d%d%d%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @mini(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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%l = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%p = alloca i32, align 4
%nl = alloca i32, align 4
%np = 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 %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nl) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %np) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %l, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %p, ptr noundef nonnull %nl, ptr noundef nonnull %np)
%0 = load i32, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %l, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %nl, align 4, !tbaa !5
%div = sdiv i32 %mul, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%4 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %4, %3
%5 = load i32, ptr %p, align 4, !tbaa !5
%6 = load i32, ptr %np, align 4, !tbaa !5
%div2 = sdiv i32 %5, %6
%a.b.i = call i32 @llvm.smin.i32(i32 %mul1, i32 %div2)
%a.b.i7 = call i32 @llvm.smin.i32(i32 %div, i32 %a.b.i)
%7 = load i32, ptr %n, align 4, !tbaa !5
%div5 = sdiv i32 %a.b.i7, %7
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %np) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nl) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(void){
// Your code here
int k,cnt=0,t;
char a[20],s[20];
scanf("%s%s",a,s);
k=strlen(s);
t=strlen(a);
for(int i=0;i<k;i++){
if(a[i]==s[i])cnt++;
}
if(cnt!=t)printf("No\n");
else if(t+1==k)printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207370/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207370/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [20 x i8], align 16
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%conv = trunc i64 %call3 to i32
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #7
%conv6 = trunc i64 %call5 to i32
%cmp32 = icmp sgt i32 %conv, 0
br i1 %cmp32, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call3, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader40, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call3, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
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 ], [ %8, %vector.body ]
%vec.phi36 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%0 = getelementptr inbounds [20 x i8], ptr %a, 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.load37 = load <4 x i8>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %index
%wide.load38 = load <4 x i8>, ptr %2, align 8, !tbaa !5
%3 = getelementptr inbounds i8, ptr %2, i64 4
%wide.load39 = load <4 x i8>, ptr %3, align 4, !tbaa !5
%4 = icmp eq <4 x i8> %wide.load, %wide.load38
%5 = icmp eq <4 x i8> %wide.load37, %wide.load39
%6 = zext <4 x i1> %4 to <4 x i32>
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = add <4 x i32> %vec.phi, %6
%9 = add <4 x i32> %vec.phi36, %7
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader40
for.body.preheader40: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%cnt.033.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %11, %middle.block ], [ %spec.select, %for.body ]
%cmp15.not = icmp eq i32 %cnt.0.lcssa, %conv6
br i1 %cmp15.not, label %if.else, label %if.end24.sink.split
for.body: ; preds = %for.body.preheader40, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader40 ]
%cnt.033 = phi i32 [ %spec.select, %for.body ], [ %cnt.033.ph, %for.body.preheader40 ]
%arrayidx = getelementptr inbounds [20 x i8], ptr %a, i64 0, i64 %indvars.iv
%12 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx10 = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv
%13 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%cmp12 = icmp eq i8 %12, %13
%inc = zext i1 %cmp12 to i32
%spec.select = add nuw nsw i32 %cnt.033, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12
if.else: ; preds = %for.cond.cleanup
%add = add nsw i32 %conv6, 1
%cmp19 = icmp eq i32 %add, %conv
br i1 %cmp19, label %if.end24.sink.split, label %if.end24
if.end24.sink.split: ; preds = %if.else, %for.cond.cleanup
%str.sink = phi ptr [ @str.3, %for.cond.cleanup ], [ @str, %if.else ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
br label %if.end24
if.end24: ; preds = %if.end24.sink.split, %if.else
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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>
#include<string.h>
int main(void){
char a[11];
char b[11];
int len;
scanf("%s",a);
scanf("%s",b);
len = strlen(a);
b[len]='\0';
if(strcmp(a,b)==0)
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207413/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207413/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [11 x i8], align 1
%b = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #5
%sext = shl i64 %call4, 32
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [11 x i8], ptr %b, i64 0, i64 %idxprom
store i8 0, ptr %arrayidx, align 1, !tbaa !5
%call7 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #5
%cmp = icmp eq i32 %call7, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 11, 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 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 i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(){
char s[11];
char t[11];
int flag = 0;
scanf("%s",s);
scanf("%s",t);
for(int i = 0; i < strlen(s); i++){
if(s[i] != t[i]){
flag = 1;
break;
}
}
if(flag == 0) printf("Yes\n");
else printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207457/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207457/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca [11 x i8], align 1
%t = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp.not25.not = icmp eq i64 %call4, 0
br i1 %cmp.not25.not, label %if.end17, label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call4
br i1 %exitcond.not, label %if.end17, label %for.body, !llvm.loop !5
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%arrayidx8 = getelementptr inbounds [11 x i8], ptr %t, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx8, align 1, !tbaa !7
%cmp10.not = icmp eq i8 %0, %1
br i1 %cmp10.not, label %for.cond, label %if.end17
if.end17: ; preds = %for.body, %for.cond, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ @str.3, %for.cond ], [ @str, %for.body ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 11, 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 @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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int n, m;
scanf("%d%d", &n, &m);
char s[100][101];
int i, j;
for (i = 0; i < n; i++)
scanf("%s", s[i]);
int mm[100];
for (i = 0; i < m; i++) {
mm[i] = '0';
for (j = 0; j < n; j++) {
if (mm[i] == '0' || s[j][i] > mm[i])
mm[i] = s[j][i];
}
}
int c = 0;
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++)
if (s[i][j] == mm[j])
break;
if (j != m)
c++;
}
printf("%d\n", c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20750/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20750/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%s = alloca [100 x [101 x i8]], align 16
%mm = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
call void @llvm.lifetime.start.p0(i64 10100, ptr nonnull %s) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp88 = icmp sgt i32 %0, 0
br i1 %cmp88, 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 [100 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)
%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
%.lcssa87 = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %mm) #3
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp394 = icmp sgt i32 %3, 0
%cmp890 = icmp sgt i32 %.lcssa87, 0
br i1 %cmp394, label %for.body4.lr.ph, label %for.cond34.preheader.thread
for.body4.lr.ph: ; preds = %for.end
%wide.trip.count120 = zext i32 %3 to i64
br i1 %cmp890, label %for.body4.us.preheader, label %for.body4.preheader
for.body4.preheader: ; preds = %for.body4.lr.ph
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body4.preheader140, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count120, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr inbounds [100 x i32], ptr %mm, i64 0, i64 %index
store <4 x i32> <i32 48, i32 48, i32 48, i32 48>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> <i32 48, i32 48, i32 48, i32 48>, ptr %5, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count120
br i1 %cmp.n, label %for.cond34.preheader, label %for.body4.preheader140
for.body4.preheader140: ; preds = %for.body4.preheader, %middle.block
%indvars.iv109.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
br label %for.body4
for.body4.us.preheader: ; preds = %for.body4.lr.ph
%wide.trip.count115 = zext i32 %.lcssa87 to i64
%xtraiter = and i64 %wide.trip.count115, 1
%7 = icmp eq i32 %.lcssa87, 1
%unroll_iter = and i64 %wide.trip.count115, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.body4.us
for.body4.us: ; preds = %for.body4.us.preheader, %for.cond7.for.inc31_crit_edge.us
%indvars.iv117 = phi i64 [ 0, %for.body4.us.preheader ], [ %indvars.iv.next118, %for.cond7.for.inc31_crit_edge.us ]
%arrayidx6.us = getelementptr inbounds [100 x i32], ptr %mm, i64 0, i64 %indvars.iv117
br i1 %7, label %for.cond7.for.inc31_crit_edge.us.unr-lcssa, label %for.body9.us
for.body9.us: ; preds = %for.body4.us, %for.body9.us
%indvars.iv112 = phi i64 [ %indvars.iv.next113.1, %for.body9.us ], [ 0, %for.body4.us ]
%conv2593.us = phi i32 [ %conv2592.us.1, %for.body9.us ], [ 48, %for.body4.us ]
%niter = phi i64 [ %niter.next.1, %for.body9.us ], [ 0, %for.body4.us ]
%cmp12.us = icmp eq i32 %conv2593.us, 48
%arrayidx24.us.phi.trans.insert = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv112, i64 %indvars.iv117
%.pre = load i8, ptr %arrayidx24.us.phi.trans.insert, align 1, !tbaa !14
%.pre132 = sext i8 %.pre to i32
%cmp19.us = icmp slt i32 %conv2593.us, %.pre132
%or.cond = select i1 %cmp12.us, i1 true, i1 %cmp19.us
%conv2592.us = select i1 %or.cond, i32 %.pre132, i32 %conv2593.us
%indvars.iv.next113 = or i64 %indvars.iv112, 1
%cmp12.us.1 = icmp eq i32 %conv2592.us, 48
%arrayidx24.us.phi.trans.insert.1 = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv.next113, i64 %indvars.iv117
%.pre.1 = load i8, ptr %arrayidx24.us.phi.trans.insert.1, align 1, !tbaa !14
%.pre132.1 = sext i8 %.pre.1 to i32
%cmp19.us.1 = icmp slt i32 %conv2592.us, %.pre132.1
%or.cond.1 = select i1 %cmp12.us.1, i1 true, i1 %cmp19.us.1
%conv2592.us.1 = select i1 %or.cond.1, i32 %.pre132.1, i32 %conv2592.us
%indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond7.for.inc31_crit_edge.us.unr-lcssa, label %for.body9.us, !llvm.loop !15
for.cond7.for.inc31_crit_edge.us.unr-lcssa: ; preds = %for.body9.us, %for.body4.us
%conv2592.us.lcssa.ph = phi i32 [ undef, %for.body4.us ], [ %conv2592.us.1, %for.body9.us ]
%indvars.iv112.unr = phi i64 [ 0, %for.body4.us ], [ %indvars.iv.next113.1, %for.body9.us ]
%conv2593.us.unr = phi i32 [ 48, %for.body4.us ], [ %conv2592.us.1, %for.body9.us ]
br i1 %lcmp.mod.not, label %for.cond7.for.inc31_crit_edge.us, label %for.body9.us.epil
for.body9.us.epil: ; preds = %for.cond7.for.inc31_crit_edge.us.unr-lcssa
%cmp12.us.epil = icmp eq i32 %conv2593.us.unr, 48
%arrayidx24.us.phi.trans.insert.epil = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv112.unr, i64 %indvars.iv117
%.pre.epil = load i8, ptr %arrayidx24.us.phi.trans.insert.epil, align 1, !tbaa !14
%.pre132.epil = sext i8 %.pre.epil to i32
%cmp19.us.epil = icmp slt i32 %conv2593.us.unr, %.pre132.epil
%or.cond.epil = select i1 %cmp12.us.epil, i1 true, i1 %cmp19.us.epil
%conv2592.us.epil = select i1 %or.cond.epil, i32 %.pre132.epil, i32 %conv2593.us.unr
br label %for.cond7.for.inc31_crit_edge.us
for.cond7.for.inc31_crit_edge.us: ; preds = %for.cond7.for.inc31_crit_edge.us.unr-lcssa, %for.body9.us.epil
%conv2592.us.lcssa = phi i32 [ %conv2592.us.lcssa.ph, %for.cond7.for.inc31_crit_edge.us.unr-lcssa ], [ %conv2592.us.epil, %for.body9.us.epil ]
store i32 %conv2592.us.lcssa, ptr %arrayidx6.us, align 4, !tbaa !5
%indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
%exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count120
br i1 %exitcond121.not, label %for.cond34.preheader, label %for.body4.us, !llvm.loop !16
for.cond34.preheader: ; preds = %for.body4, %for.cond7.for.inc31_crit_edge.us, %middle.block
%cmp35101 = icmp sgt i32 %.lcssa87, 0
br i1 %cmp35101, label %for.cond38.preheader.lr.ph, label %for.end63
for.cond34.preheader.thread: ; preds = %for.end
br i1 %cmp890, label %for.cond38.preheader.lr.ph.split, label %for.end63
for.cond38.preheader.lr.ph: ; preds = %for.cond34.preheader
br i1 %cmp394, label %for.cond38.preheader.us.preheader, label %for.cond38.preheader.lr.ph.split
for.cond38.preheader.us.preheader: ; preds = %for.cond38.preheader.lr.ph
%wide.trip.count130 = zext i32 %.lcssa87 to i64
%wide.trip.count125 = zext i32 %3 to i64
br label %for.cond38.preheader.us
for.cond38.preheader.us: ; preds = %for.cond38.preheader.us.preheader, %for.end55.us
%indvars.iv127 = phi i64 [ 0, %for.cond38.preheader.us.preheader ], [ %indvars.iv.next128, %for.end55.us ]
%c.0103.us = phi i32 [ 0, %for.cond38.preheader.us.preheader ], [ %spec.select.us, %for.end55.us ]
br label %for.body41.us
for.body41.us: ; preds = %for.cond38.preheader.us, %for.inc53.us
%indvars.iv122 = phi i64 [ 0, %for.cond38.preheader.us ], [ %indvars.iv.next123, %for.inc53.us ]
%arrayidx45.us = getelementptr inbounds [100 x [101 x i8]], ptr %s, i64 0, i64 %indvars.iv127, i64 %indvars.iv122
%8 = load i8, ptr %arrayidx45.us, align 1, !tbaa !14
%conv46.us = sext i8 %8 to i32
%arrayidx48.us = getelementptr inbounds [100 x i32], ptr %mm, i64 0, i64 %indvars.iv122
%9 = load i32, ptr %arrayidx48.us, align 4, !tbaa !5
%cmp49.us = icmp eq i32 %9, %conv46.us
br i1 %cmp49.us, label %for.end55.us.split.loop.exit135, label %for.inc53.us
for.inc53.us: ; preds = %for.body41.us
%indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
%exitcond126.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count125
br i1 %exitcond126.not, label %for.end55.us, label %for.body41.us, !llvm.loop !17
for.end55.us.split.loop.exit135: ; preds = %for.body41.us
%10 = trunc i64 %indvars.iv122 to i32
br label %for.end55.us
for.end55.us: ; preds = %for.inc53.us, %for.end55.us.split.loop.exit135
%j.1.lcssa.us = phi i32 [ %10, %for.end55.us.split.loop.exit135 ], [ %3, %for.inc53.us ]
%cmp56.not.us = icmp ne i32 %j.1.lcssa.us, %3
%inc59.us = zext i1 %cmp56.not.us to i32
%spec.select.us = add nuw nsw i32 %c.0103.us, %inc59.us
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%exitcond131.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count130
br i1 %exitcond131.not, label %for.end63, label %for.cond38.preheader.us, !llvm.loop !18
for.cond38.preheader.lr.ph.split: ; preds = %for.cond34.preheader.thread, %for.cond38.preheader.lr.ph
%cmp56.not.not = icmp eq i32 %3, 0
%11 = select i1 %cmp56.not.not, i32 0, i32 %.lcssa87
br label %for.end63
for.body4: ; preds = %for.body4.preheader140, %for.body4
%indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.body4 ], [ %indvars.iv109.ph, %for.body4.preheader140 ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %mm, i64 0, i64 %indvars.iv109
store i32 48, ptr %arrayidx6, align 4, !tbaa !5
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
%exitcond.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count120
br i1 %exitcond.not, label %for.cond34.preheader, label %for.body4, !llvm.loop !19
for.end63: ; preds = %for.end55.us, %for.cond34.preheader.thread, %for.cond38.preheader.lr.ph.split, %for.cond34.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond34.preheader ], [ %11, %for.cond38.preheader.lr.ph.split ], [ 0, %for.cond34.preheader.thread ], [ %spec.select.us, %for.end55.us ]
%call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %mm) #3
call void @llvm.lifetime.end.p0(i64 10100, 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 %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !13, !12}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.