; LLVM IR from scandum/binary_search :: monobound_bsearch (main)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@rnd = external dso_local global i32, align 4
@runs = external dso_local global i32, align 4
@loop = external dso_local global i32, align 4
@r_array = external dso_local global ptr, align 8
@o_array = external dso_local global ptr, align 8
@max = external dso_local global i32, align 4
@density = external dso_local global i32, align 4
@top = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @monobound_bsearch(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @execute(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare void @srand(i32 noundef) #2

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 100000, ptr @max, align 4, !tbaa !5
  store i32 10000, ptr @loop, align 4, !tbaa !5
  store i32 10, ptr @density, align 4, !tbaa !5
  store i32 1000, ptr @runs, align 4, !tbaa !5
  %8 = call i64 @time(ptr noundef null) #7
  %9 = trunc i64 %8 to i32
  store i32 %9, ptr @rnd, align 4, !tbaa !5
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 1
  br i1 %11, label %12, label %17

12:                                               ; preds = %2
  %13 = load ptr, ptr %5, align 8, !tbaa !9
  %14 = getelementptr inbounds ptr, ptr %13, i64 1
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = call i32 @atoi(ptr noundef %15) #8
  store i32 %16, ptr @max, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %12, %2
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp sgt i32 %18, 2
  br i1 %19, label %20, label %25

20:                                               ; preds = %17
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = getelementptr inbounds ptr, ptr %21, i64 2
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = call i32 @atoi(ptr noundef %23) #8
  store i32 %24, ptr @runs, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %20, %17
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 3
  br i1 %27, label %28, label %33

28:                                               ; preds = %25
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds ptr, ptr %29, i64 3
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = call i32 @atoi(ptr noundef %31) #8
  store i32 %32, ptr @loop, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %28, %25
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 4
  br i1 %35, label %36, label %41

36:                                               ; preds = %33
  %37 = load ptr, ptr %5, align 8, !tbaa !9
  %38 = getelementptr inbounds ptr, ptr %37, i64 4
  %39 = load ptr, ptr %38, align 8, !tbaa !9
  %40 = call i32 @atoi(ptr noundef %39) #8
  store i32 %40, ptr @rnd, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %36, %33
  %42 = load i32, ptr @max, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = mul i64 %43, 4
  %45 = call noalias ptr @malloc(i64 noundef %44) #9
  store ptr %45, ptr @o_array, align 8, !tbaa !9
  %46 = load i32, ptr @loop, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = mul i64 %47, 4
  %49 = call noalias ptr @malloc(i64 noundef %48) #9
  store ptr %49, ptr @r_array, align 8, !tbaa !9
  %50 = load i32, ptr @max, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = load i32, ptr @density, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = mul nsw i64 %51, %53
  %55 = icmp sgt i64 %54, 2000000000
  br i1 %55, label %56, label %57

56:                                               ; preds = %41
  store i32 2, ptr @density, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %56, %41
  store i32 0, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %58

58:                                               ; preds = %73, %57
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = load i32, ptr @max, align 4, !tbaa !5
  %61 = icmp slt i32 %59, %60
  br i1 %61, label %62, label %76

62:                                               ; preds = %58
  %63 = call i32 @rand() #7
  %64 = load i32, ptr @density, align 4, !tbaa !5
  %65 = mul nsw i32 %64, 2
  %66 = srem i32 %63, %65
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = add nsw i32 %67, %66
  store i32 %68, ptr %7, align 4, !tbaa !5
  %69 = load ptr, ptr @o_array, align 8, !tbaa !9
  %70 = load i32, ptr %6, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr %69, i64 %71
  store i32 %68, ptr %72, align 4, !tbaa !5
  br label %73

73:                                               ; preds = %62
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %6, align 4, !tbaa !5
  br label %58, !llvm.loop !11

76:                                               ; preds = %58
  %77 = load ptr, ptr @o_array, align 8, !tbaa !9
  %78 = load i32, ptr @max, align 4, !tbaa !5
  %79 = sub nsw i32 %78, 1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %77, i64 %80
  %82 = load i32, ptr %81, align 4, !tbaa !5
  %83 = load i32, ptr @density, align 4, !tbaa !5
  %84 = add nsw i32 %82, %83
  store i32 %84, ptr @top, align 4, !tbaa !5
  %85 = load i32, ptr @rnd, align 4, !tbaa !5
  call void @srand(i32 noundef %85) #7
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %98, %76
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = load i32, ptr @loop, align 4, !tbaa !5
  %89 = icmp slt i32 %87, %88
  br i1 %89, label %90, label %101

90:                                               ; preds = %86
  %91 = call i32 @rand() #7
  %92 = load i32, ptr @top, align 4, !tbaa !5
  %93 = srem i32 %91, %92
  %94 = load ptr, ptr @r_array, align 8, !tbaa !9
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i32, ptr %94, i64 %96
  store i32 %93, ptr %97, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %90
  %99 = load i32, ptr %6, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %6, align 4, !tbaa !5
  br label %86, !llvm.loop !13

101:                                              ; preds = %86
  %102 = load i32, ptr @max, align 4, !tbaa !5
  %103 = load i32, ptr @runs, align 4, !tbaa !5
  %104 = load i32, ptr @loop, align 4, !tbaa !5
  %105 = load i32, ptr @rnd, align 4, !tbaa !5
  %106 = load i32, ptr @density, align 4, !tbaa !5
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %102, i32 noundef %103, i32 noundef %104, i32 noundef %105, i32 noundef %106)
  %108 = load i32, ptr @max, align 4, !tbaa !5
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %108)
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef @.str.9)
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef @.str.10, ptr noundef @.str.10, ptr noundef @.str.10, ptr noundef @.str.10, ptr noundef @.str.10, ptr noundef @.str.10)
  call void @execute(ptr noundef @monobound_bsearch, ptr noundef @.str.11)
  call void @execute(ptr noundef @bsearch, ptr noundef @.str.12)
  %112 = load ptr, ptr @o_array, align 8, !tbaa !9
  call void @free(ptr noundef %112) #7
  %113 = load ptr, ptr @r_array, align 8, !tbaa !9
  call void @free(ptr noundef %113) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  ret i32 0
}

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

; Function Attrs: nounwind
declare i32 @rand() #2

; Function Attrs: inlinehint nounwind uwtable
declare ptr @bsearch(ptr noundef nonnull, ptr noundef nonnull, i64 noundef, i64 noundef, ptr noundef nonnull) #6

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-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 = { inlinehint nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind allocsize(0) "no-trapping-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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 willreturn memory(read) }
attributes #9 = { nounwind allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@rnd = external dso_local local_unnamed_addr global i32, align 4
@runs = external dso_local local_unnamed_addr global i32, align 4
@loop = external dso_local local_unnamed_addr global i32, align 4
@r_array = external dso_local local_unnamed_addr global ptr, align 8
@o_array = external dso_local local_unnamed_addr global ptr, align 8
@max = external dso_local local_unnamed_addr global i32, align 4
@density = external dso_local local_unnamed_addr global i32, align 4
@top = external dso_local local_unnamed_addr global i32, align 4
@.str.1 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @monobound_bsearch(ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @execute(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  store i32 100000, ptr @max, align 4, !tbaa !5
  store i32 10000, ptr @loop, align 4, !tbaa !5
  store i32 10, ptr @density, align 4, !tbaa !5
  store i32 1000, ptr @runs, align 4, !tbaa !5
  %3 = tail call i64 @time(ptr noundef null) #7
  %4 = trunc i64 %3 to i32
  store i32 %4, ptr @rnd, align 4, !tbaa !5
  %5 = icmp sgt i32 %0, 1
  br i1 %5, label %6, label %..thread19_crit_edge

..thread19_crit_edge:                             ; preds = %2
  %.pre = load i32, ptr @max, align 4, !tbaa !5
  br label %.thread19

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %1, i64 8
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = tail call i32 @atoi(ptr nocapture noundef %8) #8
  store i32 %9, ptr @max, align 4, !tbaa !5
  %.not = icmp eq i32 %0, 2
  br i1 %.not, label %.thread19, label %10

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = tail call i32 @atoi(ptr nocapture noundef %12) #8
  store i32 %13, ptr @runs, align 4, !tbaa !5
  %14 = icmp ugt i32 %0, 3
  br i1 %14, label %15, label %.thread19

15:                                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %1, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = tail call i32 @atoi(ptr nocapture noundef %17) #8
  store i32 %18, ptr @loop, align 4, !tbaa !5
  %.not20 = icmp eq i32 %0, 4
  br i1 %.not20, label %.thread19, label %19

19:                                               ; preds = %15
  %20 = getelementptr inbounds i8, ptr %1, i64 32
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = tail call i32 @atoi(ptr nocapture noundef %21) #8
  store i32 %22, ptr @rnd, align 4, !tbaa !5
  br label %.thread19

.thread19:                                        ; preds = %..thread19_crit_edge, %6, %10, %19, %15
  %23 = phi i32 [ %4, %..thread19_crit_edge ], [ %4, %6 ], [ %4, %10 ], [ %22, %19 ], [ %4, %15 ]
  %24 = phi i32 [ %.pre, %..thread19_crit_edge ], [ %9, %6 ], [ %9, %10 ], [ %9, %19 ], [ %9, %15 ]
  %25 = sext i32 %24 to i64
  %26 = shl nsw i64 %25, 2
  %27 = tail call noalias ptr @malloc(i64 noundef %26) #9
  store ptr %27, ptr @o_array, align 8, !tbaa !9
  %28 = load i32, ptr @loop, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = shl nsw i64 %29, 2
  %31 = tail call noalias ptr @malloc(i64 noundef %30) #9
  store ptr %31, ptr @r_array, align 8, !tbaa !9
  %32 = load i32, ptr @density, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = mul nsw i64 %33, %25
  %35 = icmp sgt i64 %34, 2000000000
  br i1 %35, label %36, label %37

36:                                               ; preds = %.thread19
  store i32 2, ptr @density, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %36, %.thread19
  %38 = phi i32 [ 2, %36 ], [ %32, %.thread19 ]
  %39 = icmp sgt i32 %24, 0
  br i1 %39, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %37, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %37 ]
  %.023 = phi i32 [ %44, %.lr.ph ], [ 0, %37 ]
  %40 = tail call i32 @rand() #7
  %41 = load i32, ptr @density, align 4, !tbaa !5
  %42 = shl nsw i32 %41, 1
  %43 = srem i32 %40, %42
  %44 = add nsw i32 %43, %.023
  %45 = load ptr, ptr @o_array, align 8, !tbaa !9
  %46 = getelementptr inbounds i32, ptr %45, i64 %indvars.iv
  store i32 %44, ptr %46, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %47 = load i32, ptr @max, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = icmp slt i64 %indvars.iv.next, %48
  br i1 %49, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !11

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre35 = load i32, ptr @density, align 4, !tbaa !5
  %.pre36 = load i32, ptr @rnd, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %37
  %.pre-phi = phi i64 [ %48, %._crit_edge.loopexit ], [ %25, %37 ]
  %50 = phi i32 [ %.pre36, %._crit_edge.loopexit ], [ %23, %37 ]
  %51 = phi i32 [ %.pre35, %._crit_edge.loopexit ], [ %38, %37 ]
  %52 = phi ptr [ %45, %._crit_edge.loopexit ], [ %27, %37 ]
  %53 = getelementptr i32, ptr %52, i64 %.pre-phi
  %54 = getelementptr i8, ptr %53, i64 -4
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = add nsw i32 %51, %55
  store i32 %56, ptr @top, align 4, !tbaa !5
  tail call void @srand(i32 noundef %50) #7
  %57 = load i32, ptr @loop, align 4, !tbaa !5
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph26, label %._crit_edge27

.lr.ph26:                                         ; preds = %._crit_edge, %.lr.ph26
  %indvars.iv32 = phi i64 [ %indvars.iv.next33, %.lr.ph26 ], [ 0, %._crit_edge ]
  %59 = tail call i32 @rand() #7
  %60 = load i32, ptr @top, align 4, !tbaa !5
  %61 = srem i32 %59, %60
  %62 = load ptr, ptr @r_array, align 8, !tbaa !9
  %63 = getelementptr inbounds i32, ptr %62, i64 %indvars.iv32
  store i32 %61, ptr %63, align 4, !tbaa !5
  %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
  %64 = load i32, ptr @loop, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = icmp slt i64 %indvars.iv.next33, %65
  br i1 %66, label %.lr.ph26, label %._crit_edge27, !llvm.loop !13

._crit_edge27:                                    ; preds = %.lr.ph26, %._crit_edge
  %.lcssa = phi i32 [ %57, %._crit_edge ], [ %64, %.lr.ph26 ]
  %67 = load i32, ptr @max, align 4, !tbaa !5
  %68 = load i32, ptr @runs, align 4, !tbaa !5
  %69 = load i32, ptr @rnd, align 4, !tbaa !5
  %70 = load i32, ptr @density, align 4, !tbaa !5
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %67, i32 noundef %68, i32 noundef %.lcssa, i32 noundef %69, i32 noundef %70)
  %72 = load i32, ptr @max, align 4, !tbaa !5
  %73 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %72)
  %74 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9)
  %75 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.10)
  tail call void @execute(ptr noundef nonnull @monobound_bsearch, ptr noundef nonnull @.str.11)
  tail call void @execute(ptr noundef nonnull @bsearch, ptr noundef nonnull @.str.12)
  %76 = load ptr, ptr @o_array, align 8, !tbaa !9
  tail call void @free(ptr noundef %76) #7
  %77 = load ptr, ptr @r_array, align 8, !tbaa !9
  tail call void @free(ptr noundef %77) #7
  ret i32 0
}

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare ptr @bsearch(ptr noundef nonnull, ptr noundef nonnull, i64 noundef, i64 noundef, ptr noundef nonnull) #5

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn 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 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind allocsize(0) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!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 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass