; 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_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: nounwind uwtable
define dso_local i32 @rl_btree_node_deserialize_hash_long_long(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 i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  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) #5
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %15, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store i64 4, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %9, align 8, !tbaa !5
  %18 = call i32 @rl_btree_node_create(ptr noundef %16, ptr noundef %17, ptr noundef %10)
  store i32 %18, ptr %14, align 4, !tbaa !11
  %19 = load i32, ptr %14, align 4, !tbaa !11
  %20 = icmp ne i32 0, %19
  br i1 %20, label %21, label %22

21:                                               ; preds = %4
  br label %170

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

28:                                               ; preds = %147, %22
  %29 = load i64, ptr %11, align 8, !tbaa !9
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.rl_btree_node, ptr %30, i32 0, i32 3
  %32 = load i64, ptr %31, align 8, !tbaa !13
  %33 = icmp slt i64 %29, %32
  br i1 %33, label %34, label %150

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

48:                                               ; preds = %34
  %49 = load i64, ptr %11, align 8, !tbaa !9
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.rl_btree_node, ptr %50, i32 0, i32 3
  store i64 %49, ptr %51, align 8, !tbaa !13
  store i32 4, ptr %14, align 4, !tbaa !11
  br label %170

52:                                               ; preds = %34
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = load i64, ptr %12, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %53, i64 %54
  %56 = call i32 @get_4bytes(ptr noundef %55)
  %57 = sext i32 %56 to i64
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.rl_btree_node, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !15
  %61 = load i64, ptr %11, align 8, !tbaa !9
  %62 = getelementptr inbounds ptr, ptr %60, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  store i64 %57, ptr %63, align 8, !tbaa !9
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = load i64, ptr %12, align 8, !tbaa !9
  %66 = add nsw i64 %65, 4
  %67 = getelementptr inbounds i8, ptr %64, i64 %66
  %68 = call i32 @get_4bytes(ptr noundef %67)
  %69 = sext i32 %68 to i64
  store i64 %69, ptr %13, align 8, !tbaa !9
  %70 = load i64, ptr %13, align 8, !tbaa !9
  %71 = icmp ne i64 %70, 0
  br i1 %71, label %72, label %108

72:                                               ; preds = %52
  %73 = load ptr, ptr %10, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.rl_btree_node, ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !16
  %76 = icmp ne ptr %75, null
  br i1 %76, label %101, label %77

77:                                               ; preds = %72
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.rl_btree, ptr %78, i32 0, i32 1
  %80 = load i64, ptr %79, align 8, !tbaa !17
  %81 = add nsw i64 %80, 1
  %82 = mul i64 8, %81
  %83 = call noalias ptr @malloc(i64 noundef %82) #6
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.rl_btree_node, ptr %84, i32 0, i32 1
  store ptr %83, ptr %85, align 8, !tbaa !16
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.rl_btree_node, ptr %86, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !16
  %89 = icmp ne ptr %88, null
  br i1 %89, label %100, label %90

90:                                               ; preds = %77
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.rl_btree_node, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !15
  %94 = load i64, ptr %11, align 8, !tbaa !9
  %95 = getelementptr inbounds ptr, ptr %93, i64 %94
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  call void @free(ptr noundef %96) #5
  %97 = load i64, ptr %11, align 8, !tbaa !9
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.rl_btree_node, ptr %98, i32 0, i32 3
  store i64 %97, ptr %99, align 8, !tbaa !13
  store i32 4, ptr %14, align 4, !tbaa !11
  br label %170

100:                                              ; preds = %77
  br label %101

101:                                              ; preds = %100, %72
  %102 = load i64, ptr %13, align 8, !tbaa !9
  %103 = load ptr, ptr %10, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.rl_btree_node, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !16
  %106 = load i64, ptr %11, align 8, !tbaa !9
  %107 = getelementptr inbounds i64, ptr %105, i64 %106
  store i64 %102, ptr %107, align 8, !tbaa !9
  br label %108

108:                                              ; preds = %101, %52
  %109 = call noalias ptr @malloc(i64 noundef 8) #6
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.rl_btree_node, ptr %110, i32 0, i32 2
  %112 = load ptr, ptr %111, align 8, !tbaa !19
  %113 = load i64, ptr %11, align 8, !tbaa !9
  %114 = getelementptr inbounds ptr, ptr %112, i64 %113
  store ptr %109, ptr %114, align 8, !tbaa !5
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.rl_btree_node, ptr %115, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !19
  %118 = load i64, ptr %11, align 8, !tbaa !9
  %119 = getelementptr inbounds ptr, ptr %117, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !5
  %121 = icmp ne ptr %120, null
  br i1 %121, label %132, label %122

122:                                              ; preds = %108
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.rl_btree_node, ptr %123, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !15
  %126 = load i64, ptr %11, align 8, !tbaa !9
  %127 = getelementptr inbounds ptr, ptr %125, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  call void @free(ptr noundef %128) #5
  %129 = load i64, ptr %11, align 8, !tbaa !9
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.rl_btree_node, ptr %130, i32 0, i32 3
  store i64 %129, ptr %131, align 8, !tbaa !13
  store i32 4, ptr %14, align 4, !tbaa !11
  br label %170

132:                                              ; preds = %108
  %133 = load ptr, ptr %8, align 8, !tbaa !5
  %134 = load i64, ptr %12, align 8, !tbaa !9
  %135 = add nsw i64 %134, 8
  %136 = getelementptr inbounds i8, ptr %133, i64 %135
  %137 = call i32 @get_4bytes(ptr noundef %136)
  %138 = sext i32 %137 to i64
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.rl_btree_node, ptr %139, i32 0, i32 2
  %141 = load ptr, ptr %140, align 8, !tbaa !19
  %142 = load i64, ptr %11, align 8, !tbaa !9
  %143 = getelementptr inbounds ptr, ptr %141, i64 %142
  %144 = load ptr, ptr %143, align 8, !tbaa !5
  store i64 %138, ptr %144, align 8, !tbaa !9
  %145 = load i64, ptr %12, align 8, !tbaa !9
  %146 = add nsw i64 %145, 12
  store i64 %146, ptr %12, align 8, !tbaa !9
  br label %147

147:                                              ; preds = %132
  %148 = load i64, ptr %11, align 8, !tbaa !9
  %149 = add nsw i64 %148, 1
  store i64 %149, ptr %11, align 8, !tbaa !9
  br label %28, !llvm.loop !20

150:                                              ; preds = %28
  %151 = load ptr, ptr %8, align 8, !tbaa !5
  %152 = load i64, ptr %12, align 8, !tbaa !9
  %153 = getelementptr inbounds i8, ptr %151, i64 %152
  %154 = call i32 @get_4bytes(ptr noundef %153)
  %155 = sext i32 %154 to i64
  store i64 %155, ptr %13, align 8, !tbaa !9
  %156 = load i64, ptr %13, align 8, !tbaa !9
  %157 = icmp ne i64 %156, 0
  br i1 %157, label %158, label %167

158:                                              ; preds = %150
  %159 = load i64, ptr %13, align 8, !tbaa !9
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.rl_btree_node, ptr %160, i32 0, i32 1
  %162 = load ptr, ptr %161, align 8, !tbaa !16
  %163 = load ptr, ptr %10, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.rl_btree_node, ptr %163, i32 0, i32 3
  %165 = load i64, ptr %164, align 8, !tbaa !13
  %166 = getelementptr inbounds i64, ptr %162, i64 %165
  store i64 %159, ptr %166, align 8, !tbaa !9
  br label %167

167:                                              ; preds = %158, %150
  %168 = load ptr, ptr %10, align 8, !tbaa !5
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %168, ptr %169, align 8, !tbaa !5
  br label %170

170:                                              ; preds = %167, %122, %90, %48, %21
  %171 = load i32, ptr %14, align 4, !tbaa !11
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %173, label %180

173:                                              ; preds = %170
  %174 = load ptr, ptr %10, align 8, !tbaa !5
  %175 = icmp ne ptr %174, null
  br i1 %175, label %176, label %180

176:                                              ; preds = %173
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = call i32 @rl_btree_node_destroy(ptr noundef %177, ptr noundef %178)
  br label %180

180:                                              ; preds = %176, %173, %170
  %181 = load i32, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  ret i32 %181
}

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 = { nounwind }
attributes #6 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 24}
!14 = !{!"rl_btree_node", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24}
!15 = !{!14, !6, i64 0}
!16 = !{!14, !6, i64 8}
!17 = !{!18, !10, i64 8}
!18 = !{!"rl_btree", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !10, i64 40}
!19 = !{!14, !6, i64 16}
!20 = distinct !{!20, !21}
!21 = !{!"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: nounwind uwtable
define dso_local i32 @rl_btree_node_deserialize_hash_long_long(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) #5
  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 %88

7:                                                ; preds = %4
  %8 = call i32 @get_4bytes(ptr noundef %3) #5
  %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, %65
  %15 = phi ptr [ %10, %.lr.ph ], [ %69, %65 ]
  %.03764 = phi i64 [ 4, %.lr.ph ], [ %74, %65 ]
  %.03863 = phi i64 [ 0, %.lr.ph ], [ %75, %65 ]
  %16 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #6
  %17 = load ptr, ptr %15, align 8, !tbaa !12
  %18 = getelementptr inbounds ptr, ptr %17, i64 %.03863
  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 %.03863
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %.not44 = icmp eq ptr %22, null
  br i1 %.not44, label %.thread78.sink.split, label %23

23:                                               ; preds = %14
  %24 = getelementptr inbounds i8, ptr %3, i64 %.03764
  %25 = call i32 @get_4bytes(ptr noundef nonnull %24) #5
  %26 = sext i32 %25 to i64
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = getelementptr inbounds ptr, ptr %28, i64 %.03863
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  store i64 %26, ptr %30, align 8, !tbaa !13
  %31 = getelementptr inbounds i8, ptr %24, i64 4
  %32 = call i32 @get_4bytes(ptr noundef nonnull %31) #5
  %33 = sext i32 %32 to i64
  %.not45 = icmp eq i32 %32, 0
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  br i1 %.not45, label %50, label %34

34:                                               ; preds = %23
  %35 = getelementptr inbounds i8, ptr %.pre, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %.not46 = icmp eq ptr %36, null
  br i1 %.not46, label %37, label %47

37:                                               ; preds = %34
  %38 = load i64, ptr %13, align 8, !tbaa !15
  %39 = shl i64 %38, 3
  %40 = add i64 %39, 8
  %41 = call noalias ptr @malloc(i64 noundef %40) #6
  store ptr %41, ptr %35, align 8, !tbaa !14
  %.not47 = icmp eq ptr %41, null
  br i1 %.not47, label %42, label %47

42:                                               ; preds = %37
  %43 = load ptr, ptr %.pre, align 8, !tbaa !12
  %44 = getelementptr inbounds ptr, ptr %43, i64 %.03863
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  call void @free(ptr noundef %45) #5
  %46 = load ptr, ptr %5, align 8
  br label %.thread78.sink.split

47:                                               ; preds = %37, %34
  %48 = phi ptr [ %41, %37 ], [ %36, %34 ]
  %49 = getelementptr inbounds i64, ptr %48, i64 %.03863
  store i64 %33, ptr %49, align 8, !tbaa !13
  br label %50

50:                                               ; preds = %47, %23
  %51 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #6
  %52 = getelementptr inbounds i8, ptr %.pre, i64 16
  %53 = load ptr, ptr %52, align 8, !tbaa !17
  %54 = getelementptr inbounds ptr, ptr %53, i64 %.03863
  store ptr %51, ptr %54, align 8, !tbaa !5
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i64 16
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %58 = getelementptr inbounds ptr, ptr %57, i64 %.03863
  %59 = load ptr, ptr %58, align 8, !tbaa !5
  %.not48 = icmp eq ptr %59, null
  br i1 %.not48, label %60, label %65

60:                                               ; preds = %50
  %61 = load ptr, ptr %55, align 8, !tbaa !12
  %62 = getelementptr inbounds ptr, ptr %61, i64 %.03863
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  call void @free(ptr noundef %63) #5
  %64 = load ptr, ptr %5, align 8
  br label %.thread78.sink.split

65:                                               ; preds = %50
  %66 = getelementptr inbounds i8, ptr %24, i64 8
  %67 = call i32 @get_4bytes(ptr noundef nonnull %66) #5
  %68 = sext i32 %67 to i64
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = load ptr, ptr %70, align 8, !tbaa !17
  %72 = getelementptr inbounds ptr, ptr %71, i64 %.03863
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  store i64 %68, ptr %73, align 8, !tbaa !13
  %74 = add nuw nsw i64 %.03764, 12
  %75 = add nuw nsw i64 %.03863, 1
  %76 = getelementptr inbounds i8, ptr %69, i64 24
  %77 = load i64, ptr %76, align 8, !tbaa !9
  %78 = icmp slt i64 %75, %77
  br i1 %78, label %14, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %65, %7
  %.037.lcssa = phi i64 [ 4, %7 ], [ %74, %65 ]
  %79 = getelementptr inbounds i8, ptr %3, i64 %.037.lcssa
  %80 = call i32 @get_4bytes(ptr noundef nonnull %79) #5
  %.not43 = icmp eq i32 %80, 0
  %.pre75 = load ptr, ptr %5, align 8, !tbaa !5
  br i1 %.not43, label %.thread, label %81

81:                                               ; preds = %._crit_edge
  %82 = sext i32 %80 to i64
  %83 = getelementptr inbounds i8, ptr %.pre75, i64 8
  %84 = load ptr, ptr %83, align 8, !tbaa !14
  %85 = getelementptr inbounds i8, ptr %.pre75, i64 24
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = getelementptr inbounds i64, ptr %84, i64 %86
  store i64 %82, ptr %87, align 8, !tbaa !13
  br label %.thread

.thread:                                          ; preds = %._crit_edge, %81
  store ptr %.pre75, ptr %1, align 8, !tbaa !5
  br label %92

88:                                               ; preds = %4
  %.pre77 = load ptr, ptr %5, align 8
  %.not52 = icmp eq ptr %.pre77, null
  br i1 %.not52, label %92, label %.thread78

.thread78.sink.split:                             ; preds = %14, %60, %42
  %.lcssa.sink = phi ptr [ %46, %42 ], [ %64, %60 ], [ %19, %14 ]
  %89 = getelementptr inbounds i8, ptr %.lcssa.sink, i64 24
  store i64 %.03863, ptr %89, align 8, !tbaa !9
  br label %.thread78

.thread78:                                        ; preds = %.thread78.sink.split, %88
  %.081 = phi i32 [ %6, %88 ], [ 4, %.thread78.sink.split ]
  %90 = phi ptr [ %.pre77, %88 ], [ %.lcssa.sink, %.thread78.sink.split ]
  %91 = call i32 @rl_btree_node_destroy(ptr noundef %0, ptr noundef nonnull %90)
  br label %92

92:                                               ; preds = %.thread, %.thread78, %88
  %.051 = phi i32 [ 0, %.thread ], [ %.081, %.thread78 ], [ %6, %88 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  ret i32 %.051
}

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 = { nounwind }
attributes #6 = { 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 = !{!11, !11, i64 0}
!14 = !{!10, !6, i64 8}
!15 = !{!16, !11, i64 8}
!16 = !{!"rl_btree", !6, i64 0, !11, i64 8, !11, i64 16, !6, i64 24, !11, i64 32, !11, i64 40}
!17 = !{!10, !6, i64 16}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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