; LLVM IR from begeekmyfriend/bplustree :: lib (bplustree)

; 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"

%struct.bplus_node = type { i64, i64, i64, i64, i32, i32 }
%struct.bplus_tree = type { ptr, [5 x i32], [1024 x i8], i32, i32, i64, i64, %struct.list_head }
%struct.list_head = type { ptr, ptr }
%struct.free_block = type { %struct.list_head, i64 }

@_max_entries = external hidden global i32, align 4
@_max_order = external hidden global i32, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@_block_size = external hidden global i32, align 4
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__.bplus_tree_init = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 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 i32 @bplus_open(ptr noundef) #1

declare i32 @open(ptr noundef, i32 noundef, ...) #2

declare i32 @fsync(i32 noundef) #2

declare i32 @close(i32 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @bplus_tree_init(ptr noundef %0, i32 noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %struct.bplus_node, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 40, ptr %7) #9
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = call i64 @strlen(ptr noundef %12) #10
  %14 = icmp uge i64 %13, 1024
  br i1 %14, label %15, label %18

15:                                               ; preds = %2
  %16 = load ptr, ptr @stderr, align 8, !tbaa !5
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str) #9
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %146

18:                                               ; preds = %2
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = sub nsw i32 %20, 1
  %22 = and i32 %19, %21
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %18
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.1) #9
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %146

27:                                               ; preds = %18
  %28 = load i32, ptr %5, align 4, !tbaa !9
  %29 = icmp slt i32 %28, 40
  br i1 %29, label %30, label %33

30:                                               ; preds = %27
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.2) #9
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %146

33:                                               ; preds = %27
  %34 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %34, ptr @_block_size, align 4, !tbaa !9
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = sub i64 %36, 40
  %38 = udiv i64 %37, 12
  %39 = trunc i64 %38 to i32
  store i32 %39, ptr @_max_order, align 4, !tbaa !9
  %40 = load i32, ptr %5, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = sub i64 %41, 40
  %43 = udiv i64 %42, 12
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr @_max_entries, align 4, !tbaa !9
  %45 = load i32, ptr @_max_order, align 4, !tbaa !9
  %46 = icmp sle i32 %45, 2
  br i1 %46, label %47, label %50

47:                                               ; preds = %33
  %48 = load ptr, ptr @stderr, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str.2) #9
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %146

50:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #9
  %51 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 1096) #11
  store ptr %51, ptr %9, align 8, !tbaa !5
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %55

54:                                               ; preds = %50
  br label %56

55:                                               ; preds = %50
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 1082, ptr noundef @__PRETTY_FUNCTION__.bplus_tree_init) #12
  unreachable

56:                                               ; preds = %54
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.bplus_tree, ptr %57, i32 0, i32 7
  call void @list_init(ptr noundef %58)
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.bplus_tree, ptr %59, i32 0, i32 2
  %61 = getelementptr inbounds [1024 x i8], ptr %60, i64 0, i64 0
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = call ptr @strcpy(ptr noundef %61, ptr noundef %62) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.bplus_tree, ptr %64, i32 0, i32 2
  %66 = getelementptr inbounds [1024 x i8], ptr %65, i64 0, i64 0
  %67 = call ptr @strcat(ptr noundef %66, ptr noundef @.str.5) #9
  %68 = call i32 (ptr, i32, ...) @open(ptr noundef %67, i32 noundef 2, i32 noundef 420)
  store i32 %68, ptr %10, align 4, !tbaa !9
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = icmp sge i32 %69, 0
  br i1 %70, label %71, label %108

71:                                               ; preds = %56
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = call i64 @offset_load(i32 noundef %72)
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.bplus_tree, ptr %74, i32 0, i32 5
  store i64 %73, ptr %75, align 8, !tbaa !11
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = call i64 @offset_load(i32 noundef %76)
  %78 = trunc i64 %77 to i32
  store i32 %78, ptr @_block_size, align 4, !tbaa !9
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = call i64 @offset_load(i32 noundef %79)
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.bplus_tree, ptr %81, i32 0, i32 6
  store i64 %80, ptr %82, align 8, !tbaa !15
  br label %83

83:                                               ; preds = %94, %71
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = call i64 @offset_load(i32 noundef %84)
  %86 = trunc i64 %85 to i32
  store i32 %86, ptr %6, align 4, !tbaa !9
  %87 = icmp ne i32 %86, -559038737
  br i1 %87, label %88, label %103

88:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %89 = call noalias ptr @malloc(i64 noundef 24) #13
  store ptr %89, ptr %11, align 8, !tbaa !5
  %90 = load ptr, ptr %11, align 8, !tbaa !5
  %91 = icmp ne ptr %90, null
  br i1 %91, label %92, label %93

92:                                               ; preds = %88
  br label %94

93:                                               ; preds = %88
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.4, i32 noundef 1095, ptr noundef @__PRETTY_FUNCTION__.bplus_tree_init) #12
  unreachable

94:                                               ; preds = %92
  %95 = load i32, ptr %6, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.free_block, ptr %97, i32 0, i32 1
  store i64 %96, ptr %98, align 8, !tbaa !16
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.free_block, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.bplus_tree, ptr %101, i32 0, i32 7
  call void @list_add(ptr noundef %100, ptr noundef %102)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %83, !llvm.loop !18

103:                                              ; preds = %83
  %104 = load i32, ptr %10, align 4, !tbaa !9
  %105 = call i32 @fsync(i32 noundef %104)
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = call i32 @close(i32 noundef %106)
  br label %114

108:                                              ; preds = %56
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.bplus_tree, ptr %109, i32 0, i32 5
  store i64 3735928559, ptr %110, align 8, !tbaa !11
  %111 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %111, ptr @_block_size, align 4, !tbaa !9
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.bplus_tree, ptr %112, i32 0, i32 6
  store i64 0, ptr %113, align 8, !tbaa !15
  br label %114

114:                                              ; preds = %108, %103
  %115 = load i32, ptr @_block_size, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = sub i64 %116, 40
  %118 = udiv i64 %117, 12
  %119 = trunc i64 %118 to i32
  store i32 %119, ptr @_max_order, align 4, !tbaa !9
  %120 = load i32, ptr @_block_size, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = sub i64 %121, 40
  %123 = udiv i64 %122, 12
  %124 = trunc i64 %123 to i32
  store i32 %124, ptr @_max_entries, align 4, !tbaa !9
  %125 = load i32, ptr @_max_order, align 4, !tbaa !9
  %126 = load i32, ptr @_max_entries, align 4, !tbaa !9
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %125, i32 noundef %126)
  %128 = load i32, ptr @_block_size, align 4, !tbaa !9
  %129 = mul nsw i32 %128, 5
  %130 = sext i32 %129 to i64
  %131 = call noalias ptr @malloc(i64 noundef %130) #13
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.bplus_tree, ptr %132, i32 0, i32 0
  store ptr %131, ptr %133, align 8, !tbaa !20
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = call i32 @bplus_open(ptr noundef %134)
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.bplus_tree, ptr %136, i32 0, i32 3
  store i32 %135, ptr %137, align 4, !tbaa !21
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.bplus_tree, ptr %138, i32 0, i32 3
  %140 = load i32, ptr %139, align 4, !tbaa !21
  %141 = icmp sge i32 %140, 0
  br i1 %141, label %142, label %143

142:                                              ; preds = %114
  br label %144

143:                                              ; preds = %114
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.4, i32 noundef 1117, ptr noundef @__PRETTY_FUNCTION__.bplus_tree_init) #12
  unreachable

144:                                              ; preds = %142
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %145, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #9
  br label %146

146:                                              ; preds = %144, %47, %30, %24, %15
  call void @llvm.lifetime.end.p0(i64 40, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  %147 = load ptr, ptr %3, align 8
  ret ptr %147
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @list_init(ptr noundef) #7

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare ptr @strcat(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @offset_load(i32 noundef) #7

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @list_add(ptr noundef, ptr noundef) #7

declare i32 @printf(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 = { "no-trapping-math"="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 willreturn memory(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 "no-trapping-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,1) "no-trapping-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind allocsize(0,1) }
attributes #12 = { noreturn nounwind }
attributes #13 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 1064}
!12 = !{!"bplus_tree", !6, i64 0, !7, i64 8, !7, i64 28, !10, i64 1052, !10, i64 1056, !13, i64 1064, !13, i64 1072, !14, i64 1080}
!13 = !{!"long", !7, i64 0}
!14 = !{!"list_head", !6, i64 0, !6, i64 8}
!15 = !{!12, !13, i64 1072}
!16 = !{!17, !13, i64 16}
!17 = !{!"free_block", !14, i64 0, !13, i64 16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!12, !6, i64 0}
!21 = !{!12, !10, i64 1052}


; 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"

@_max_entries = external hidden local_unnamed_addr global i32, align 4
@_max_order = external hidden local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [27 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@_block_size = external hidden local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [74 x i8], align 1
@__PRETTY_FUNCTION__.bplus_tree_init = external hidden unnamed_addr constant [48 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @bplus_open(ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #1

declare i32 @fsync(i32 noundef) local_unnamed_addr #2

declare i32 @close(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @bplus_tree_init(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #11
  %4 = icmp ugt i64 %3, 1023
  br i1 %4, label %.sink.split, label %5

5:                                                ; preds = %2
  %6 = tail call range(i32 0, 33) i32 @llvm.ctpop.i32(i32 %1)
  %.not = icmp ult i32 %6, 2
  br i1 %.not, label %7, label %.sink.split

7:                                                ; preds = %5
  %8 = icmp slt i32 %1, 40
  br i1 %8, label %.sink.split, label %9

9:                                                ; preds = %7
  store i32 %1, ptr @_block_size, align 4, !tbaa !5
  %10 = zext nneg i32 %1 to i64
  %11 = add nsw i64 %10, -40
  %.lhs.trunc = trunc i64 %11 to i32
  %12 = udiv i32 %.lhs.trunc, 12
  store i32 %12, ptr @_max_order, align 4, !tbaa !5
  store i32 %12, ptr @_max_entries, align 4, !tbaa !5
  %13 = icmp ult i64 %11, 36
  br i1 %13, label %.sink.split, label %14

14:                                               ; preds = %9
  %15 = tail call noalias dereferenceable_or_null(1096) ptr @calloc(i64 noundef 1, i64 noundef 1096) #12
  %.not39 = icmp eq ptr %15, null
  br i1 %.not39, label %16, label %17

16:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 1082, ptr noundef nonnull @__PRETTY_FUNCTION__.bplus_tree_init) #13
  unreachable

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %15, i64 1080
  tail call void @list_init(ptr noundef nonnull %18)
  %19 = getelementptr inbounds i8, ptr %15, i64 28
  %20 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) %0) #14
  %21 = tail call ptr @strcat(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.5) #14
  %22 = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull %19, i32 noundef 2, i32 noundef 420) #14
  %23 = icmp sgt i32 %22, -1
  br i1 %23, label %24, label %43

24:                                               ; preds = %17
  %25 = tail call i64 @offset_load(i32 noundef %22)
  %26 = getelementptr inbounds i8, ptr %15, i64 1064
  store i64 %25, ptr %26, align 8, !tbaa !9
  %27 = tail call i64 @offset_load(i32 noundef %22)
  %28 = trunc i64 %27 to i32
  store i32 %28, ptr @_block_size, align 4, !tbaa !5
  %29 = tail call i64 @offset_load(i32 noundef %22)
  %30 = getelementptr inbounds i8, ptr %15, i64 1072
  store i64 %29, ptr %30, align 8, !tbaa !14
  %31 = tail call i64 @offset_load(i32 noundef %22)
  %32 = and i64 %31, 4294967295
  %.not4042 = icmp eq i64 %32, 3735928559
  br i1 %.not4042, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24, %36
  %33 = phi i64 [ %39, %36 ], [ %31, %24 ]
  %34 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #15
  %.not41 = icmp eq ptr %34, null
  br i1 %.not41, label %35, label %36

35:                                               ; preds = %.lr.ph
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.4, i32 noundef 1095, ptr noundef nonnull @__PRETTY_FUNCTION__.bplus_tree_init) #13
  unreachable

36:                                               ; preds = %.lr.ph
  %sext = shl i64 %33, 32
  %37 = ashr exact i64 %sext, 32
  %38 = getelementptr inbounds i8, ptr %34, i64 16
  store i64 %37, ptr %38, align 8, !tbaa !15
  tail call void @list_add(ptr noundef nonnull %34, ptr noundef nonnull %18)
  %39 = tail call i64 @offset_load(i32 noundef %22)
  %40 = and i64 %39, 4294967295
  %.not40 = icmp eq i64 %40, 3735928559
  br i1 %.not40, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %36, %24
  %41 = tail call i32 @fsync(i32 noundef %22) #14
  %42 = tail call i32 @close(i32 noundef %22) #14
  %.pre = load i32, ptr @_block_size, align 4, !tbaa !5
  br label %46

43:                                               ; preds = %17
  %44 = getelementptr inbounds i8, ptr %15, i64 1064
  store i64 3735928559, ptr %44, align 8, !tbaa !9
  store i32 %1, ptr @_block_size, align 4, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %15, i64 1072
  store i64 0, ptr %45, align 8, !tbaa !14
  br label %46

46:                                               ; preds = %43, %._crit_edge
  %47 = phi i32 [ %1, %43 ], [ %.pre, %._crit_edge ]
  %48 = sext i32 %47 to i64
  %49 = add nsw i64 %48, -40
  %50 = udiv i64 %49, 12
  %51 = trunc i64 %50 to i32
  store i32 %51, ptr @_max_order, align 4, !tbaa !5
  store i32 %51, ptr @_max_entries, align 4, !tbaa !5
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %51, i32 noundef %51)
  %53 = load i32, ptr @_block_size, align 4, !tbaa !5
  %54 = mul nsw i32 %53, 5
  %55 = sext i32 %54 to i64
  %56 = tail call noalias ptr @malloc(i64 noundef %55) #15
  store ptr %56, ptr %15, align 8, !tbaa !19
  %57 = tail call i32 @bplus_open(ptr noundef %0)
  %58 = getelementptr inbounds i8, ptr %15, i64 1052
  store i32 %57, ptr %58, align 4, !tbaa !20
  %59 = icmp sgt i32 %57, -1
  br i1 %59, label %63, label %60

60:                                               ; preds = %46
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.4, i32 noundef 1117, ptr noundef nonnull @__PRETTY_FUNCTION__.bplus_tree_init) #13
  unreachable

.sink.split:                                      ; preds = %9, %7, %5, %2
  %.str.2.sink = phi ptr [ @.str, %2 ], [ @.str.1, %5 ], [ @.str.2, %7 ], [ @.str.2, %9 ]
  %61 = load ptr, ptr @stderr, align 8, !tbaa !21
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef nonnull %.str.2.sink) #16
  br label %63

63:                                               ; preds = %.sink.split, %46
  %.0 = phi ptr [ %15, %46 ], [ null, %.sink.split ]
  ret ptr %.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 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; 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 #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @list_init(ptr noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #8

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly) local_unnamed_addr #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @offset_load(i32 noundef) local_unnamed_addr #7

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @list_add(ptr noundef, ptr noundef) local_unnamed_addr #7

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #10

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 "no-trapping-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,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 #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(0,1) }
attributes #13 = { noreturn nounwind }
attributes #14 = { nounwind }
attributes #15 = { nounwind allocsize(0) }
attributes #16 = { cold nounwind }

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

!0 = !{i32 1, !"wchar_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, !12, i64 1064}
!10 = !{!"bplus_tree", !11, i64 0, !7, i64 8, !7, i64 28, !6, i64 1052, !6, i64 1056, !12, i64 1064, !12, i64 1072, !13, i64 1080}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"list_head", !11, i64 0, !11, i64 8}
!14 = !{!10, !12, i64 1072}
!15 = !{!16, !12, i64 16}
!16 = !{!"free_block", !13, i64 0, !12, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !11, i64 0}
!20 = !{!10, !6, i64 1052}
!21 = !{!11, !11, i64 0}


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