; LLVM IR from seppo0010/rlite :: src (page_btree)

; 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.rl_btree_node = type { ptr, ptr, ptr, i64 }
%struct.rl_hashkey = type { i64, i64 }
%struct.rl_btree = type { ptr, i64, i64, ptr, i64, i64 }

; 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

declare i32 @get_4bytes(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_btree_node_create(ptr noundef, ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_btree_node_destroy(ptr noundef, ptr noundef) #3

; 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

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_btree_node_deserialize_hash_sha1_hashkey(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %16 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %16, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %10, align 8, !tbaa !5
  %19 = call i32 @rl_btree_node_create(ptr noundef %17, ptr noundef %18, ptr noundef %9)
  store i32 %19, ptr %11, align 4, !tbaa !9
  %20 = load i32, ptr %11, align 4, !tbaa !9
  %21 = icmp ne i32 0, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %4
  br label %179

23:                                               ; preds = %4
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = call i32 @get_4bytes(ptr noundef %24)
  %26 = sext i32 %25 to i64
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.rl_btree_node, ptr %27, i32 0, i32 3
  store i64 %26, ptr %28, align 8, !tbaa !11
  store i64 4, ptr %13, align 8, !tbaa !14
  store i64 0, ptr %12, align 8, !tbaa !14
  br label %29

29:                                               ; preds = %156, %23
  %30 = load i64, ptr %12, align 8, !tbaa !14
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.rl_btree_node, ptr %31, i32 0, i32 3
  %33 = load i64, ptr %32, align 8, !tbaa !11
  %34 = icmp slt i64 %30, %33
  br i1 %34, label %35, label %159

35:                                               ; preds = %29
  %36 = call noalias ptr @malloc(i64 noundef 20) #7
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.rl_btree_node, ptr %37, i32 0, i32 0
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  %40 = load i64, ptr %12, align 8, !tbaa !14
  %41 = getelementptr inbounds ptr, ptr %39, i64 %40
  store ptr %36, ptr %41, align 8, !tbaa !5
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.rl_btree_node, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !15
  %45 = load i64, ptr %12, align 8, !tbaa !14
  %46 = getelementptr inbounds ptr, ptr %44, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %53, label %49

49:                                               ; preds = %35
  %50 = load i64, ptr %12, align 8, !tbaa !14
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.rl_btree_node, ptr %51, i32 0, i32 3
  store i64 %50, ptr %52, align 8, !tbaa !11
  store i32 4, ptr %11, align 4, !tbaa !9
  br label %179

53:                                               ; preds = %35
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.rl_btree_node, ptr %54, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !15
  %57 = load i64, ptr %12, align 8, !tbaa !14
  %58 = getelementptr inbounds ptr, ptr %56, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %60 = load ptr, ptr %8, align 8, !tbaa !5
  %61 = load i64, ptr %13, align 8, !tbaa !14
  %62 = getelementptr inbounds i8, ptr %60, i64 %61
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %59, ptr align 1 %62, i64 20, i1 false)
  %63 = call noalias ptr @malloc(i64 noundef 16) #7
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.rl_btree_node, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !16
  %67 = load i64, ptr %12, align 8, !tbaa !14
  %68 = getelementptr inbounds ptr, ptr %66, i64 %67
  store ptr %63, ptr %68, align 8, !tbaa !5
  store ptr %63, ptr %15, align 8, !tbaa !5
  %69 = load ptr, ptr %9, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.rl_btree_node, ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  %72 = load i64, ptr %12, align 8, !tbaa !14
  %73 = getelementptr inbounds ptr, ptr %71, i64 %72
  %74 = load ptr, ptr %73, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %86, label %76

76:                                               ; preds = %53
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.rl_btree_node, ptr %77, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !15
  %80 = load i64, ptr %12, align 8, !tbaa !14
  %81 = getelementptr inbounds ptr, ptr %79, i64 %80
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  call void @free(ptr noundef %82) #6
  %83 = load i64, ptr %12, align 8, !tbaa !14
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.rl_btree_node, ptr %84, i32 0, i32 3
  store i64 %83, ptr %85, align 8, !tbaa !11
  store i32 4, ptr %11, align 4, !tbaa !9
  br label %179

86:                                               ; preds = %53
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = load i64, ptr %13, align 8, !tbaa !14
  %89 = add nsw i64 %88, 20
  %90 = getelementptr inbounds i8, ptr %87, i64 %89
  %91 = call i32 @get_4bytes(ptr noundef %90)
  %92 = sext i32 %91 to i64
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.rl_hashkey, ptr %93, i32 0, i32 0
  store i64 %92, ptr %94, align 8, !tbaa !17
  %95 = load ptr, ptr %8, align 8, !tbaa !5
  %96 = load i64, ptr %13, align 8, !tbaa !14
  %97 = add nsw i64 %96, 24
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  %99 = call i32 @get_4bytes(ptr noundef %98)
  %100 = sext i32 %99 to i64
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.rl_hashkey, ptr %101, i32 0, i32 1
  store i64 %100, ptr %102, align 8, !tbaa !19
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = load i64, ptr %13, align 8, !tbaa !14
  %105 = add nsw i64 %104, 28
  %106 = getelementptr inbounds i8, ptr %103, i64 %105
  %107 = call i32 @get_4bytes(ptr noundef %106)
  %108 = sext i32 %107 to i64
  store i64 %108, ptr %14, align 8, !tbaa !14
  %109 = load i64, ptr %14, align 8, !tbaa !14
  %110 = icmp ne i64 %109, 0
  br i1 %110, label %111, label %153

111:                                              ; preds = %86
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.rl_btree_node, ptr %112, i32 0, i32 1
  %114 = load ptr, ptr %113, align 8, !tbaa !20
  %115 = icmp ne ptr %114, null
  br i1 %115, label %146, label %116

116:                                              ; preds = %111
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.rl_btree, ptr %117, i32 0, i32 1
  %119 = load i64, ptr %118, align 8, !tbaa !21
  %120 = add nsw i64 %119, 1
  %121 = mul i64 8, %120
  %122 = call noalias ptr @malloc(i64 noundef %121) #7
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.rl_btree_node, ptr %123, i32 0, i32 1
  store ptr %122, ptr %124, align 8, !tbaa !20
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.rl_btree_node, ptr %125, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !20
  %128 = icmp ne ptr %127, null
  br i1 %128, label %145, label %129

129:                                              ; preds = %116
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.rl_btree_node, ptr %130, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !15
  %133 = load i64, ptr %12, align 8, !tbaa !14
  %134 = getelementptr inbounds ptr, ptr %132, i64 %133
  %135 = load ptr, ptr %134, align 8, !tbaa !5
  call void @free(ptr noundef %135) #6
  %136 = load ptr, ptr %9, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.rl_btree_node, ptr %136, i32 0, i32 2
  %138 = load ptr, ptr %137, align 8, !tbaa !16
  %139 = load i64, ptr %12, align 8, !tbaa !14
  %140 = getelementptr inbounds ptr, ptr %138, i64 %139
  %141 = load ptr, ptr %140, align 8, !tbaa !5
  call void @free(ptr noundef %141) #6
  %142 = load i64, ptr %12, align 8, !tbaa !14
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.rl_btree_node, ptr %143, i32 0, i32 3
  store i64 %142, ptr %144, align 8, !tbaa !11
  store i32 4, ptr %11, align 4, !tbaa !9
  br label %179

145:                                              ; preds = %116
  br label %146

146:                                              ; preds = %145, %111
  %147 = load i64, ptr %14, align 8, !tbaa !14
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.rl_btree_node, ptr %148, i32 0, i32 1
  %150 = load ptr, ptr %149, align 8, !tbaa !20
  %151 = load i64, ptr %12, align 8, !tbaa !14
  %152 = getelementptr inbounds i64, ptr %150, i64 %151
  store i64 %147, ptr %152, align 8, !tbaa !14
  br label %153

153:                                              ; preds = %146, %86
  %154 = load i64, ptr %13, align 8, !tbaa !14
  %155 = add nsw i64 %154, 32
  store i64 %155, ptr %13, align 8, !tbaa !14
  br label %156

156:                                              ; preds = %153
  %157 = load i64, ptr %12, align 8, !tbaa !14
  %158 = add nsw i64 %157, 1
  store i64 %158, ptr %12, align 8, !tbaa !14
  br label %29, !llvm.loop !23

159:                                              ; preds = %29
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = load i64, ptr %13, align 8, !tbaa !14
  %162 = getelementptr inbounds i8, ptr %160, i64 %161
  %163 = call i32 @get_4bytes(ptr noundef %162)
  %164 = sext i32 %163 to i64
  store i64 %164, ptr %14, align 8, !tbaa !14
  %165 = load i64, ptr %14, align 8, !tbaa !14
  %166 = icmp ne i64 %165, 0
  br i1 %166, label %167, label %176

167:                                              ; preds = %159
  %168 = load i64, ptr %14, align 8, !tbaa !14
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.rl_btree_node, ptr %169, i32 0, i32 1
  %171 = load ptr, ptr %170, align 8, !tbaa !20
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.rl_btree_node, ptr %172, i32 0, i32 3
  %174 = load i64, ptr %173, align 8, !tbaa !11
  %175 = getelementptr inbounds i64, ptr %171, i64 %174
  store i64 %168, ptr %175, align 8, !tbaa !14
  br label %176

176:                                              ; preds = %167, %159
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %177, ptr %178, align 8, !tbaa !5
  br label %179

179:                                              ; preds = %176, %129, %76, %49, %22
  %180 = load i32, ptr %11, align 4, !tbaa !9
  %181 = icmp ne i32 %180, 0
  br i1 %181, label %182, label %189

182:                                              ; preds = %179
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = icmp ne ptr %183, null
  br i1 %184, label %185, label %189

185:                                              ; preds = %182
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = call i32 @rl_btree_node_destroy(ptr noundef %186, ptr noundef %187)
  br label %189

189:                                              ; preds = %185, %182, %179
  %190 = load i32, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret i32 %190
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "no-trapping-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 uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"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 24}
!12 = !{!"rl_btree_node", !6, i64 0, !6, i64 8, !6, i64 16, !13, i64 24}
!13 = !{!"long", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !6, i64 0}
!16 = !{!12, !6, i64 16}
!17 = !{!18, !13, i64 0}
!18 = !{!"rl_hashkey", !13, i64 0, !13, i64 8}
!19 = !{!18, !13, i64 8}
!20 = !{!12, !6, i64 8}
!21 = !{!22, !13, i64 8}
!22 = !{!"rl_btree", !6, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !13, i64 32, !13, i64 40}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 #1

declare i32 @get_4bytes(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_btree_node_create(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @rl_btree_node_destroy(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress 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

; Function Attrs: nounwind uwtable
define dso_local i32 @rl_btree_node_deserialize_hash_sha1_hashkey(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store ptr null, ptr %5, align 8, !tbaa !5
  %6 = call i32 @rl_btree_node_create(ptr noundef %0, ptr noundef %2, ptr noundef nonnull %5)
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %86

7:                                                ; preds = %4
  %8 = call i32 @get_4bytes(ptr noundef %3) #6
  %9 = sext i32 %8 to i64
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 24
  store i64 %9, ptr %11, align 8, !tbaa !9
  %12 = icmp sgt i32 %8, 0
  br i1 %12, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %7
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  br label %14

14:                                               ; preds = %.lr.ph, %71
  %15 = phi ptr [ %10, %.lr.ph ], [ %.pre, %71 ]
  %.04170 = phi i64 [ 4, %.lr.ph ], [ %72, %71 ]
  %.04269 = phi i64 [ 0, %.lr.ph ], [ %73, %71 ]
  %16 = call noalias dereferenceable_or_null(20) ptr @malloc(i64 noundef 20) #7
  %17 = load ptr, ptr %15, align 8, !tbaa !12
  %18 = getelementptr inbounds ptr, ptr %17, i64 %.04269
  store ptr %16, ptr %18, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8
  %20 = load ptr, ptr %19, align 8, !tbaa !12
  %21 = getelementptr inbounds ptr, ptr %20, i64 %.04269
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %.not49 = icmp eq ptr %22, null
  br i1 %.not49, label %.thread85.sink.split, label %23

23:                                               ; preds = %14
  %24 = getelementptr inbounds i8, ptr %3, i64 %.04170
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(20) %22, ptr noundef nonnull align 1 dereferenceable(20) %24, i64 20, i1 false)
  %25 = call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #7
  %26 = getelementptr inbounds i8, ptr %19, i64 16
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds ptr, ptr %27, i64 %.04269
  store ptr %25, ptr %28, align 8, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = getelementptr inbounds ptr, ptr %31, i64 %.04269
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %.not50 = icmp eq ptr %33, null
  br i1 %.not50, label %34, label %39

34:                                               ; preds = %23
  %35 = load ptr, ptr %29, align 8, !tbaa !12
  %36 = getelementptr inbounds ptr, ptr %35, i64 %.04269
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  call void @free(ptr noundef %37) #6
  %38 = load ptr, ptr %5, align 8
  br label %.thread85.sink.split

39:                                               ; preds = %23
  %40 = getelementptr inbounds i8, ptr %24, i64 20
  %41 = call i32 @get_4bytes(ptr noundef nonnull %40) #6
  %42 = sext i32 %41 to i64
  store i64 %42, ptr %25, align 8, !tbaa !14
  %43 = getelementptr inbounds i8, ptr %24, i64 24
  %44 = call i32 @get_4bytes(ptr noundef nonnull %43) #6
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %25, i64 8
  store i64 %45, ptr %46, align 8, !tbaa !16
  %47 = getelementptr inbounds i8, ptr %24, i64 28
  %48 = call i32 @get_4bytes(ptr noundef nonnull %47) #6
  %49 = sext i32 %48 to i64
  %.not51 = icmp eq i32 %48, 0
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  br i1 %.not51, label %71, label %50

50:                                               ; preds = %39
  %51 = getelementptr inbounds i8, ptr %.pre, i64 8
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  %.not52 = icmp eq ptr %52, null
  br i1 %.not52, label %53, label %68

53:                                               ; preds = %50
  %54 = load i64, ptr %13, align 8, !tbaa !18
  %55 = shl i64 %54, 3
  %56 = add i64 %55, 8
  %57 = call noalias ptr @malloc(i64 noundef %56) #7
  store ptr %57, ptr %51, align 8, !tbaa !17
  %.not53 = icmp eq ptr %57, null
  br i1 %.not53, label %58, label %68

58:                                               ; preds = %53
  %59 = load ptr, ptr %.pre, align 8, !tbaa !12
  %60 = getelementptr inbounds ptr, ptr %59, i64 %.04269
  %61 = load ptr, ptr %60, align 8, !tbaa !5
  call void @free(ptr noundef %61) #6
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 16
  %64 = load ptr, ptr %63, align 8, !tbaa !13
  %65 = getelementptr inbounds ptr, ptr %64, i64 %.04269
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  call void @free(ptr noundef %66) #6
  %67 = load ptr, ptr %5, align 8
  br label %.thread85.sink.split

68:                                               ; preds = %53, %50
  %69 = phi ptr [ %57, %53 ], [ %52, %50 ]
  %70 = getelementptr inbounds i64, ptr %69, i64 %.04269
  store i64 %49, ptr %70, align 8, !tbaa !20
  br label %71

71:                                               ; preds = %68, %39
  %72 = add nuw nsw i64 %.04170, 32
  %73 = add nuw nsw i64 %.04269, 1
  %74 = getelementptr inbounds i8, ptr %.pre, i64 24
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = icmp slt i64 %73, %75
  br i1 %76, label %14, label %._crit_edge, !llvm.loop !21

._crit_edge:                                      ; preds = %71, %7
  %.041.lcssa = phi i64 [ 4, %7 ], [ %72, %71 ]
  %77 = getelementptr inbounds i8, ptr %3, i64 %.041.lcssa
  %78 = call i32 @get_4bytes(ptr noundef nonnull %77) #6
  %.not48 = icmp eq i32 %78, 0
  %.pre82 = load ptr, ptr %5, align 8, !tbaa !5
  br i1 %.not48, label %.thread, label %79

79:                                               ; preds = %._crit_edge
  %80 = sext i32 %78 to i64
  %81 = getelementptr inbounds i8, ptr %.pre82, i64 8
  %82 = load ptr, ptr %81, align 8, !tbaa !17
  %83 = getelementptr inbounds i8, ptr %.pre82, i64 24
  %84 = load i64, ptr %83, align 8, !tbaa !9
  %85 = getelementptr inbounds i64, ptr %82, i64 %84
  store i64 %80, ptr %85, align 8, !tbaa !20
  br label %.thread

.thread:                                          ; preds = %._crit_edge, %79
  store ptr %.pre82, ptr %1, align 8, !tbaa !5
  br label %90

86:                                               ; preds = %4
  %.pre84 = load ptr, ptr %5, align 8
  %.not57 = icmp eq ptr %.pre84, null
  br i1 %.not57, label %90, label %.thread85

.thread85.sink.split:                             ; preds = %14, %58, %34
  %.lcssa.sink = phi ptr [ %38, %34 ], [ %67, %58 ], [ %19, %14 ]
  %87 = getelementptr inbounds i8, ptr %.lcssa.sink, i64 24
  store i64 %.04269, ptr %87, align 8, !tbaa !9
  br label %.thread85

.thread85:                                        ; preds = %.thread85.sink.split, %86
  %.088 = phi i32 [ %6, %86 ], [ 4, %.thread85.sink.split ]
  %88 = phi ptr [ %.pre84, %86 ], [ %.lcssa.sink, %.thread85.sink.split ]
  %89 = call i32 @rl_btree_node_destroy(ptr noundef %0, ptr noundef nonnull %88)
  br label %90

90:                                               ; preds = %.thread, %.thread85, %86
  %.056 = phi i32 [ 0, %.thread ], [ %.088, %.thread85 ], [ %6, %86 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  ret i32 %.056
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "no-trapping-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 uwtable "min-legal-vector-width"="0" "no-trapping-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 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"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, !11, i64 24}
!10 = !{!"rl_btree_node", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!10, !6, i64 16}
!14 = !{!15, !11, i64 0}
!15 = !{!"rl_hashkey", !11, i64 0, !11, i64 8}
!16 = !{!15, !11, i64 8}
!17 = !{!10, !6, i64 8}
!18 = !{!19, !11, i64 8}
!19 = !{!"rl_btree", !6, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !11, i64 32, !11, i64 40}
!20 = !{!11, !11, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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