; LLVM IR from mitdbg/deneva :: storage/index_btree.ll (ZN11index_btree4initEm)

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

%class.mem_alloc = type { i8 }
%class.index_btree = type { %class.index_base, i64, i32, ptr, ptr, ptr }
%class.index_base = type { ptr, ptr }

@g_thread_cnt = external global i32, align 4
@g_part_alloc = external global i8, align 1
@g_mem_pad = external global i8, align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__._ZN11index_btree4initEm = external hidden unnamed_addr constant [39 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11index_btree4initEm(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %1) unnamed_addr #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %16 = load ptr, ptr %3, align 8
  %17 = load i64, ptr %4, align 8, !tbaa !9
  %18 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 1
  store i64 %17, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 2
  store i32 16, ptr %19, align 8, !tbaa !15
  %20 = load i64, ptr %4, align 8, !tbaa !9
  %21 = mul i64 %20, 8
  %22 = call noalias ptr @malloc(i64 noundef %21) #7
  %23 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 3
  store ptr %22, ptr %23, align 8, !tbaa !16
  %24 = load i32, ptr @g_thread_cnt, align 4, !tbaa !17
  %25 = zext i32 %24 to i64
  %26 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %25, i64 8)
  %27 = extractvalue { i64, i1 } %26, 1
  %28 = extractvalue { i64, i1 } %26, 0
  %29 = select i1 %27, i64 -1, i64 %28
  %30 = call noalias noundef nonnull ptr @_Znam(i64 noundef %29) #8
  %31 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 4
  store ptr %30, ptr %31, align 8, !tbaa !18
  %32 = load i8, ptr @g_part_alloc, align 1, !tbaa !19, !range !21, !noundef !22
  %33 = trunc i8 %32 to i1
  br i1 %33, label %34, label %84

34:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !17
  br label %35

35:                                               ; preds = %80, %34
  %36 = load i32, ptr %5, align 4, !tbaa !17
  %37 = load i32, ptr @g_thread_cnt, align 4, !tbaa !17
  %38 = icmp ult i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %83

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 8, ptr %7, align 4, !tbaa !17
  %41 = load i8, ptr @g_mem_pad, align 1, !tbaa !19, !range !21, !noundef !22
  %42 = trunc i8 %41 to i1
  br i1 %42, label %43, label %53

43:                                               ; preds = %40
  %44 = load i32, ptr %7, align 4, !tbaa !17
  %45 = urem i32 %44, 64
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %53

47:                                               ; preds = %43
  %48 = load i32, ptr %7, align 4, !tbaa !17
  %49 = urem i32 %48, 64
  %50 = sub i32 64, %49
  %51 = load i32, ptr %7, align 4, !tbaa !17
  %52 = add i32 %51, %50
  store i32 %52, ptr %7, align 4, !tbaa !17
  br label %53

53:                                               ; preds = %47, %43, %40
  %54 = load i32, ptr %7, align 4, !tbaa !17
  %55 = zext i32 %54 to i64
  %56 = call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef %55)
  %57 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 4
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = load i32, ptr %5, align 4, !tbaa !17
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %58, i64 %60
  store ptr %56, ptr %61, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !17
  br label %62

62:                                               ; preds = %76, %53
  %63 = load i32, ptr %8, align 4, !tbaa !17
  %64 = icmp ult i32 %63, 1
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  br label %79

66:                                               ; preds = %62
  %67 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 4
  %68 = load ptr, ptr %67, align 8, !tbaa !18
  %69 = load i32, ptr %5, align 4, !tbaa !17
  %70 = zext i32 %69 to i64
  %71 = getelementptr inbounds ptr, ptr %68, i64 %70
  %72 = load ptr, ptr %71, align 8, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !17
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds ptr, ptr %72, i64 %74
  store ptr null, ptr %75, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %66
  %77 = load i32, ptr %8, align 4, !tbaa !17
  %78 = add i32 %77, 1
  store i32 %78, ptr %8, align 4, !tbaa !17
  br label %62, !llvm.loop !23

79:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %80

80:                                               ; preds = %79
  %81 = load i32, ptr %5, align 4, !tbaa !17
  %82 = add i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !17
  br label %35, !llvm.loop !25

83:                                               ; preds = %39
  br label %101

84:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !17
  br label %85

85:                                               ; preds = %97, %84
  %86 = load i32, ptr %9, align 4, !tbaa !17
  %87 = load i32, ptr @g_thread_cnt, align 4, !tbaa !17
  %88 = icmp ult i32 %86, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %85
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  br label %100

90:                                               ; preds = %85
  %91 = call noalias noundef nonnull ptr @_Znam(i64 noundef 8) #8
  %92 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 4
  %93 = load ptr, ptr %92, align 8, !tbaa !18
  %94 = load i32, ptr %9, align 4, !tbaa !17
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds ptr, ptr %93, i64 %95
  store ptr %91, ptr %96, align 8, !tbaa !5
  br label %97

97:                                               ; preds = %90
  %98 = load i32, ptr %9, align 4, !tbaa !17
  %99 = add i32 %98, 1
  store i32 %99, ptr %9, align 4, !tbaa !17
  br label %85, !llvm.loop !26

100:                                              ; preds = %89
  br label %101

101:                                              ; preds = %100, %83
  %102 = load i32, ptr @g_thread_cnt, align 4, !tbaa !17
  %103 = zext i32 %102 to i64
  %104 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %103, i64 8)
  %105 = extractvalue { i64, i1 } %104, 1
  %106 = extractvalue { i64, i1 } %104, 0
  %107 = select i1 %105, i64 -1, i64 %106
  %108 = call noalias noundef nonnull ptr @_Znam(i64 noundef %107) #8
  %109 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 5
  store ptr %108, ptr %109, align 8, !tbaa !27
  %110 = load i8, ptr @g_part_alloc, align 1, !tbaa !19, !range !21, !noundef !22
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %162

112:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !17
  br label %113

113:                                              ; preds = %158, %112
  %114 = load i32, ptr %10, align 4, !tbaa !17
  %115 = load i32, ptr @g_thread_cnt, align 4, !tbaa !17
  %116 = icmp ult i32 %114, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %113
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %161

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #9
  store i32 4, ptr %11, align 4, !tbaa !17
  %119 = load i8, ptr @g_mem_pad, align 1, !tbaa !19, !range !21, !noundef !22
  %120 = trunc i8 %119 to i1
  br i1 %120, label %121, label %131

121:                                              ; preds = %118
  %122 = load i32, ptr %11, align 4, !tbaa !17
  %123 = urem i32 %122, 64
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %131

125:                                              ; preds = %121
  %126 = load i32, ptr %11, align 4, !tbaa !17
  %127 = urem i32 %126, 64
  %128 = sub i32 64, %127
  %129 = load i32, ptr %11, align 4, !tbaa !17
  %130 = add i32 %129, %128
  store i32 %130, ptr %11, align 4, !tbaa !17
  br label %131

131:                                              ; preds = %125, %121, %118
  %132 = load i32, ptr %11, align 4, !tbaa !17
  %133 = zext i32 %132 to i64
  %134 = call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef %133)
  %135 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 5
  %136 = load ptr, ptr %135, align 8, !tbaa !27
  %137 = load i32, ptr %10, align 4, !tbaa !17
  %138 = zext i32 %137 to i64
  %139 = getelementptr inbounds ptr, ptr %136, i64 %138
  store ptr %134, ptr %139, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  store i32 0, ptr %12, align 4, !tbaa !17
  br label %140

140:                                              ; preds = %154, %131
  %141 = load i32, ptr %12, align 4, !tbaa !17
  %142 = icmp ult i32 %141, 1
  br i1 %142, label %144, label %143

143:                                              ; preds = %140
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %157

144:                                              ; preds = %140
  %145 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 5
  %146 = load ptr, ptr %145, align 8, !tbaa !27
  %147 = load i32, ptr %10, align 4, !tbaa !17
  %148 = zext i32 %147 to i64
  %149 = getelementptr inbounds ptr, ptr %146, i64 %148
  %150 = load ptr, ptr %149, align 8, !tbaa !5
  %151 = load i32, ptr %12, align 4, !tbaa !17
  %152 = zext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr %150, i64 %152
  store i32 0, ptr %153, align 4, !tbaa !17
  br label %154

154:                                              ; preds = %144
  %155 = load i32, ptr %12, align 4, !tbaa !17
  %156 = add i32 %155, 1
  store i32 %156, ptr %12, align 4, !tbaa !17
  br label %140, !llvm.loop !28

157:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #9
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %10, align 4, !tbaa !17
  %160 = add i32 %159, 1
  store i32 %160, ptr %10, align 4, !tbaa !17
  br label %113, !llvm.loop !29

161:                                              ; preds = %117
  br label %179

162:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !17
  br label %163

163:                                              ; preds = %175, %162
  %164 = load i32, ptr %13, align 4, !tbaa !17
  %165 = load i32, ptr @g_thread_cnt, align 4, !tbaa !17
  %166 = icmp ult i32 %164, %165
  br i1 %166, label %168, label %167

167:                                              ; preds = %163
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %178

168:                                              ; preds = %163
  %169 = call noalias noundef nonnull ptr @_Znam(i64 noundef 4) #8
  %170 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 5
  %171 = load ptr, ptr %170, align 8, !tbaa !27
  %172 = load i32, ptr %13, align 4, !tbaa !17
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds ptr, ptr %171, i64 %173
  store ptr %169, ptr %174, align 8, !tbaa !5
  br label %175

175:                                              ; preds = %168
  %176 = load i32, ptr %13, align 4, !tbaa !17
  %177 = add i32 %176, 1
  store i32 %177, ptr %13, align 4, !tbaa !17
  br label %163, !llvm.loop !30

178:                                              ; preds = %167
  br label %179

179:                                              ; preds = %178, %161
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  store i32 0, ptr %14, align 4, !tbaa !17
  br label %180

180:                                              ; preds = %201, %179
  %181 = load i32, ptr %14, align 4, !tbaa !17
  %182 = zext i32 %181 to i64
  %183 = load i64, ptr %4, align 8, !tbaa !9
  %184 = icmp ult i64 %182, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %180
  store i32 20, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %204

186:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #9
  %187 = load i32, ptr %14, align 4, !tbaa !17
  %188 = zext i32 %187 to i64
  %189 = getelementptr inbounds %class.index_btree, ptr %16, i32 0, i32 3
  %190 = load ptr, ptr %189, align 8, !tbaa !16
  %191 = load i32, ptr %14, align 4, !tbaa !17
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds ptr, ptr %190, i64 %192
  %194 = call noundef i32 @_ZN11index_btree7make_lfEmRP7bt_node(ptr noundef nonnull align 8 dereferenceable(56) %16, i64 noundef %188, ptr noundef nonnull align 8 dereferenceable(8) %193)
  store i32 %194, ptr %15, align 4, !tbaa !31
  %195 = load i32, ptr %15, align 4, !tbaa !31
  %196 = icmp eq i32 %195, 0
  br i1 %196, label %197, label %198

197:                                              ; preds = %186
  br label %200

198:                                              ; preds = %186
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 33, ptr noundef @__PRETTY_FUNCTION__._ZN11index_btree4initEm) #10
  unreachable

199:                                              ; No predecessors!
  br label %200

200:                                              ; preds = %199, %197
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #9
  br label %201

201:                                              ; preds = %200
  %202 = load i32, ptr %14, align 4, !tbaa !17
  %203 = add i32 %202, 1
  store i32 %203, ptr %14, align 4, !tbaa !17
  br label %180, !llvm.loop !33

204:                                              ; preds = %185
  ret i32 0
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

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

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN11index_btree7make_lfEmRP7bt_node(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nobuiltin 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "no-trapping-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 = { nounwind allocsize(0) }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"_ZTS11index_btree", !13, i64 0, !10, i64 16, !14, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!13 = !{!"_ZTS10index_base", !6, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !14, i64 24}
!16 = !{!12, !6, i64 32}
!17 = !{!14, !14, i64 0}
!18 = !{!12, !6, i64 40}
!19 = !{!20, !20, i64 0}
!20 = !{!"bool", !7, i64 0}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}
!27 = !{!12, !6, i64 48}
!28 = distinct !{!28, !24}
!29 = distinct !{!29, !24}
!30 = distinct !{!30, !24}
!31 = !{!32, !32, i64 0}
!32 = !{!"_ZTS2RC", !7, i64 0}
!33 = distinct !{!33, !24}


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

%class.mem_alloc = type { i8 }

@g_thread_cnt = external local_unnamed_addr global i32, align 4
@g_part_alloc = external local_unnamed_addr global i8, align 1
@g_mem_pad = external local_unnamed_addr global i8, align 1
@mem_allocator = external global %class.mem_alloc, align 1
@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__._ZN11index_btree4initEm = external hidden unnamed_addr constant [39 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11index_btree4initEm(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %1) unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  store i64 %1, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 16, ptr %4, align 8, !tbaa !13
  %5 = shl i64 %1, 3
  %6 = tail call noalias ptr @malloc(i64 noundef %5) #5
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %6, ptr %7, align 8, !tbaa !14
  %8 = load i32, ptr @g_thread_cnt, align 4, !tbaa !15
  %9 = zext i32 %8 to i64
  %10 = shl nuw nsw i64 %9, 3
  %11 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %10) #6
  %12 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %11, ptr %12, align 8, !tbaa !16
  %13 = load i8, ptr @g_part_alloc, align 1, !tbaa !17, !range !19, !noundef !20
  %14 = trunc nuw i8 %13 to i1
  %.not60 = icmp eq i32 %8, 0
  br i1 %14, label %.preheader49, label %.preheader51

.preheader51:                                     ; preds = %2
  br i1 %.not60, label %.loopexit50, label %.lr.ph

.preheader49:                                     ; preds = %2
  br i1 %.not60, label %.loopexit50, label %.critedge

.critedge:                                        ; preds = %.preheader49, %.critedge
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.critedge ], [ 0, %.preheader49 ]
  %15 = load i8, ptr @g_mem_pad, align 1, !tbaa !17, !range !19, !noundef !20
  %16 = trunc nuw i8 %15 to i1
  %.043 = select i1 %16, i64 64, i64 8
  %17 = tail call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef %.043)
  %18 = load ptr, ptr %12, align 8, !tbaa !16
  %19 = getelementptr inbounds ptr, ptr %18, i64 %indvars.iv67
  store ptr %17, ptr %19, align 8, !tbaa !21
  %20 = load ptr, ptr %12, align 8, !tbaa !16
  %21 = getelementptr inbounds ptr, ptr %20, i64 %indvars.iv67
  %22 = load ptr, ptr %21, align 8, !tbaa !21
  store ptr null, ptr %22, align 8, !tbaa !21
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %23 = load i32, ptr @g_thread_cnt, align 4, !tbaa !15
  %24 = zext i32 %23 to i64
  %25 = icmp ult i64 %indvars.iv.next68, %24
  br i1 %25, label %.critedge, label %.loopexit50.loopexit, !llvm.loop !22

.lr.ph:                                           ; preds = %.preheader51, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader51 ]
  %26 = tail call noalias noundef nonnull dereferenceable(8) ptr @_Znam(i64 noundef 8) #6
  %27 = load ptr, ptr %12, align 8, !tbaa !16
  %28 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv
  store ptr %26, ptr %28, align 8, !tbaa !21
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %9
  br i1 %exitcond.not, label %.loopexit50, label %.lr.ph, !llvm.loop !24

.loopexit50.loopexit:                             ; preds = %.critedge
  %.pre = load i8, ptr @g_part_alloc, align 1, !tbaa !17, !range !19
  br label %.loopexit50

.loopexit50:                                      ; preds = %.lr.ph, %.loopexit50.loopexit, %.preheader51, %.preheader49
  %29 = phi i8 [ %.pre, %.loopexit50.loopexit ], [ %13, %.preheader51 ], [ %13, %.preheader49 ], [ %13, %.lr.ph ]
  %30 = phi i32 [ %23, %.loopexit50.loopexit ], [ 0, %.preheader51 ], [ 0, %.preheader49 ], [ %8, %.lr.ph ]
  %31 = zext i32 %30 to i64
  %32 = shl nuw nsw i64 %31, 3
  %33 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %32) #6
  %34 = getelementptr inbounds i8, ptr %0, i64 48
  store ptr %33, ptr %34, align 8, !tbaa !25
  %35 = trunc nuw i8 %29 to i1
  %.not62 = icmp eq i32 %30, 0
  br i1 %35, label %.preheader, label %.preheader47

.preheader47:                                     ; preds = %.loopexit50
  br i1 %.not62, label %.loopexit, label %.lr.ph56

.preheader:                                       ; preds = %.loopexit50
  br i1 %.not62, label %.loopexit, label %.critedge46

.critedge46:                                      ; preds = %.preheader, %.critedge46
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.critedge46 ], [ 0, %.preheader ]
  %36 = load i8, ptr @g_mem_pad, align 1, !tbaa !17, !range !19, !noundef !20
  %37 = trunc nuw i8 %36 to i1
  %.039 = select i1 %37, i64 64, i64 4
  %38 = tail call noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1) @mem_allocator, i64 noundef %.039)
  %39 = load ptr, ptr %34, align 8, !tbaa !25
  %40 = getelementptr inbounds ptr, ptr %39, i64 %indvars.iv75
  store ptr %38, ptr %40, align 8, !tbaa !21
  %41 = load ptr, ptr %34, align 8, !tbaa !25
  %42 = getelementptr inbounds ptr, ptr %41, i64 %indvars.iv75
  %43 = load ptr, ptr %42, align 8, !tbaa !21
  store i32 0, ptr %43, align 4, !tbaa !15
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %44 = load i32, ptr @g_thread_cnt, align 4, !tbaa !15
  %45 = zext i32 %44 to i64
  %46 = icmp ult i64 %indvars.iv.next76, %45
  br i1 %46, label %.critedge46, label %.loopexit, !llvm.loop !26

.lr.ph56:                                         ; preds = %.preheader47, %.lr.ph56
  %indvars.iv70 = phi i64 [ %indvars.iv.next71, %.lr.ph56 ], [ 0, %.preheader47 ]
  %47 = tail call noalias noundef nonnull dereferenceable(4) ptr @_Znam(i64 noundef 4) #6
  %48 = load ptr, ptr %34, align 8, !tbaa !25
  %49 = getelementptr inbounds ptr, ptr %48, i64 %indvars.iv70
  store ptr %47, ptr %49, align 8, !tbaa !21
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond74.not = icmp eq i64 %indvars.iv.next71, %31
  br i1 %exitcond74.not, label %.loopexit, label %.lr.ph56, !llvm.loop !27

.loopexit:                                        ; preds = %.lr.ph56, %.critedge46, %.preheader47, %.preheader
  %.not63 = icmp eq i64 %1, 0
  br i1 %.not63, label %._crit_edge, label %.lr.ph59

50:                                               ; preds = %.lr.ph59
  %51 = add i32 %.03658, 1
  %52 = zext i32 %51 to i64
  %53 = icmp ult i64 %52, %1
  br i1 %53, label %.lr.ph59, label %._crit_edge, !llvm.loop !28

._crit_edge:                                      ; preds = %50, %.loopexit
  ret i32 0

.lr.ph59:                                         ; preds = %.loopexit, %50
  %54 = phi i64 [ %52, %50 ], [ 0, %.loopexit ]
  %.03658 = phi i32 [ %51, %50 ], [ 0, %.loopexit ]
  %55 = load ptr, ptr %7, align 8, !tbaa !14
  %56 = getelementptr inbounds ptr, ptr %55, i64 %54
  %57 = tail call noundef i32 @_ZN11index_btree7make_lfEmRP7bt_node(ptr noundef nonnull align 8 dereferenceable(56) %0, i64 noundef %54, ptr noundef nonnull align 8 dereferenceable(8) %56)
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %50, label %59

59:                                               ; preds = %.lr.ph59
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 33, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN11index_btree4initEm) #7
  unreachable
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #2

declare noundef ptr @_ZN9mem_alloc5allocEm(ptr noundef nonnull align 1 dereferenceable(1), i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN11index_btree7make_lfEmRP7bt_node(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nobuiltin 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 #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 = { 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 #5 = { nounwind allocsize(0) }
attributes #6 = { builtin allocsize(0) }
attributes #7 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_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, !11, i64 16}
!6 = !{!"_ZTS11index_btree", !7, i64 0, !11, i64 16, !12, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}
!7 = !{!"_ZTS10index_base", !8, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"long", !9, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = !{!6, !12, i64 24}
!14 = !{!6, !8, i64 32}
!15 = !{!12, !12, i64 0}
!16 = !{!6, !8, i64 40}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !9, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!6, !8, i64 48}
!26 = distinct !{!26, !23}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23}


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