; LLVM IR from cruppstahl/upscaledb :: src/3page_manager (freelist)

; 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.std::pair" = type { i8, %"struct.std::_Rb_tree_const_iterator" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"struct.upscaledb::Freelist" = type { ptr, %"class.std::map", i64, i64 }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, unsigned long>, std::_Select1st<std::pair<const unsigned long, unsigned long>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, unsigned long>, std::_Select1st<std::pair<const unsigned long, unsigned long>>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.upscaledb::EnvConfig" = type <{ i32, i32, i32, i32, i64, i64, i64, %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_string", i32, i8, [16 x i8], [3 x i8], i64, i32, [4 x i8] }>
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"struct.std::pair.3" = type { i64, i64 }

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm = external hidden unnamed_addr constant [156 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local { i8, ptr } @_ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm(ptr noundef nonnull align 8 dereferenceable(72) %0, i8 %1, ptr %2, ptr noundef %3, i64 noundef %4) #0 align 2 {
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::pair", align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %20 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %25 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %26 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %27 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %28 = alloca i32, align 4
  %29 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %31 = getelementptr inbounds { i8, ptr }, ptr %7, i32 0, i32 0
  store i8 %1, ptr %31, align 8
  %32 = getelementptr inbounds { i8, ptr }, ptr %7, i32 0, i32 1
  store ptr %2, ptr %32, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i64 %4, ptr %10, align 8, !tbaa !9
  %33 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %34 = getelementptr inbounds %"struct.upscaledb::Freelist", ptr %33, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !11
  %36 = getelementptr inbounds %"struct.upscaledb::EnvConfig", ptr %35, i32 0, i32 3
  %37 = load i32, ptr %36, align 4, !tbaa !21
  store i32 %37, ptr %11, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %38 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %38, i64 8, i1 false), !tbaa.struct !28
  %39 = getelementptr inbounds %"struct.std::pair", ptr %7, i32 0, i32 0
  %40 = load i8, ptr %39, align 8, !tbaa !29, !range !32, !noundef !33
  %41 = trunc i8 %40 to i1
  %42 = zext i1 %41 to i32
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %48

44:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %45 = getelementptr inbounds %"struct.upscaledb::Freelist", ptr %33, i32 0, i32 1
  %46 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %45) #5
  %47 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %14, i32 0, i32 0
  store ptr %46, ptr %47, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %13, i64 8, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %57

48:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %49 = getelementptr inbounds %"struct.upscaledb::Freelist", ptr %33, i32 0, i32 1
  %50 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %49) #5
  %51 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %16, i32 0, i32 0
  store ptr %50, ptr %51, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #5
  %52 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  br i1 %52, label %53, label %54

53:                                               ; preds = %48
  br label %56

54:                                               ; preds = %48
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 41, ptr noundef @__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm) #6
  unreachable

55:                                               ; No predecessors!
  br label %56

56:                                               ; preds = %55, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %57

57:                                               ; preds = %56, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %58, ptr %18, align 8, !tbaa !5
  %59 = load ptr, ptr %18, align 8, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %59, i64 8
  store ptr %60, ptr %18, align 8, !tbaa !5
  %61 = load ptr, ptr %18, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  store ptr %62, ptr %18, align 8, !tbaa !5
  br label %63

63:                                               ; preds = %132, %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %64 = getelementptr inbounds %"struct.upscaledb::Freelist", ptr %33, i32 0, i32 1
  %65 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %64) #5
  %66 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %20, i32 0, i32 0
  store ptr %65, ptr %66, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #5
  %67 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br i1 %67, label %68, label %154

68:                                               ; preds = %63
  %69 = load ptr, ptr %18, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 9
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = ptrtoint ptr %70 to i64
  %73 = ptrtoint ptr %71 to i64
  %74 = sub i64 %72, %73
  %75 = load i64, ptr %10, align 8, !tbaa !9
  %76 = icmp sge i64 %74, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %68
  br label %154

78:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 1, ptr %21, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %79 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %80 = getelementptr inbounds %"struct.std::pair.3", ptr %79, i32 0, i32 0
  %81 = load i64, ptr %80, align 8, !tbaa !34
  store i64 %81, ptr %22, align 8, !tbaa !9
  %82 = load i64, ptr %22, align 8, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !27
  %84 = zext i32 %83 to i64
  %85 = urem i64 %82, %84
  %86 = icmp eq i64 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %78
  br label %90

88:                                               ; preds = %78
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 58, ptr noundef @__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm) #6
  unreachable

89:                                               ; No predecessors!
  br label %90

90:                                               ; preds = %89, %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %91 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %92 = getelementptr inbounds %"struct.std::pair.3", ptr %91, i32 0, i32 0
  %93 = load i64, ptr %92, align 8, !tbaa !34
  store i64 %93, ptr %23, align 8, !tbaa !9
  %94 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #5
  %95 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %24, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  br label %96

96:                                               ; preds = %123, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %97 = getelementptr inbounds %"struct.upscaledb::Freelist", ptr %33, i32 0, i32 1
  %98 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %97) #5
  %99 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %26, i32 0, i32 0
  store ptr %98, ptr %99, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #5
  %100 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %25) #5
  br i1 %100, label %101, label %104

101:                                              ; preds = %96
  %102 = load i32, ptr %21, align 4, !tbaa !27
  %103 = icmp ult i32 %102, 15
  br label %104

104:                                              ; preds = %101, %96
  %105 = phi i1 [ false, %96 ], [ %103, %101 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br i1 %105, label %106, label %126

106:                                              ; preds = %104
  %107 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #5
  %108 = getelementptr inbounds %"struct.std::pair.3", ptr %107, i32 0, i32 0
  %109 = load i64, ptr %108, align 8, !tbaa !34
  %110 = load i64, ptr %23, align 8, !tbaa !9
  %111 = load i32, ptr %11, align 4, !tbaa !27
  %112 = zext i32 %111 to i64
  %113 = add i64 %110, %112
  %114 = icmp ne i64 %109, %113
  br i1 %114, label %115, label %116

115:                                              ; preds = %106
  br label %126

116:                                              ; preds = %106
  %117 = load i32, ptr %11, align 4, !tbaa !27
  %118 = zext i32 %117 to i64
  %119 = load i64, ptr %23, align 8, !tbaa !9
  %120 = add i64 %119, %118
  store i64 %120, ptr %23, align 8, !tbaa !9
  %121 = load i32, ptr %21, align 4, !tbaa !27
  %122 = add i32 %121, 1
  store i32 %122, ptr %21, align 4, !tbaa !27
  br label %123

123:                                              ; preds = %116
  %124 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef 0) #5
  %125 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %27, i32 0, i32 0
  store ptr %124, ptr %125, align 8
  br label %96, !llvm.loop !36

126:                                              ; preds = %115, %104
  %127 = load i32, ptr %21, align 4, !tbaa !27
  %128 = icmp ult i32 %127, 16
  br i1 %128, label %129, label %130

129:                                              ; preds = %126
  br label %132

130:                                              ; preds = %126
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 77, ptr noundef @__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm) #6
  unreachable

131:                                              ; No predecessors!
  br label %132

132:                                              ; preds = %131, %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %133 = load ptr, ptr %18, align 8, !tbaa !5
  %134 = getelementptr inbounds i8, ptr %133, i64 1
  %135 = load i64, ptr %22, align 8, !tbaa !9
  %136 = load i32, ptr %11, align 4, !tbaa !27
  %137 = zext i32 %136 to i64
  %138 = udiv i64 %135, %137
  %139 = call noundef i64 @_ZN9upscaledb6Pickle10encode_u64EPhm(ptr noundef %134, i64 noundef %138)
  %140 = trunc i64 %139 to i32
  store i32 %140, ptr %28, align 4, !tbaa !27
  %141 = load i32, ptr %21, align 4, !tbaa !27
  %142 = shl i32 %141, 4
  %143 = load i32, ptr %28, align 4, !tbaa !27
  %144 = or i32 %142, %143
  %145 = trunc i32 %144 to i8
  %146 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %145, ptr %146, align 1, !tbaa !38
  %147 = load i32, ptr %28, align 4, !tbaa !27
  %148 = add nsw i32 1, %147
  %149 = load ptr, ptr %18, align 8, !tbaa !5
  %150 = sext i32 %148 to i64
  %151 = getelementptr inbounds i8, ptr %149, i64 %150
  store ptr %151, ptr %18, align 8, !tbaa !5
  %152 = load i32, ptr %17, align 4, !tbaa !27
  %153 = add i32 %152, 1
  store i32 %153, ptr %17, align 4, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %63, !llvm.loop !39

154:                                              ; preds = %77, %63
  %155 = load i32, ptr %17, align 4, !tbaa !27
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds i8, ptr %156, i64 8
  store i32 %155, ptr %157, align 4, !tbaa !27
  call void @_ZNSt4pairIbSt23_Rb_tree_const_iteratorIS_IKmmEEEC2IbS3_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES7_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %158 = getelementptr inbounds %"struct.upscaledb::Freelist", ptr %33, i32 0, i32 1
  %159 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %158) #5
  %160 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  store ptr %159, ptr %160, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #5
  %161 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %29) #5
  %162 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 0
  %163 = zext i1 %161 to i8
  store i8 %163, ptr %162, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  %164 = getelementptr inbounds %"struct.std::pair", ptr %6, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %164, ptr align 8 %12, i64 8, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %165 = load { i8, ptr }, ptr %6, align 8
  ret { i8, ptr } %165
}

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

; 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) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEppEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9upscaledb6Pickle10encode_u64EPhm(ptr noundef, i64 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIbSt23_Rb_tree_const_iteratorIS_IKmmEEEC2IbS3_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES7_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 = { 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 }
attributes #6 = { 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, !6, i64 0}
!12 = !{!"_ZTSN9upscaledb8FreelistE", !6, i64 0, !13, i64 8, !10, i64 56, !10, i64 64}
!13 = !{!"_ZTSSt3mapImmSt4lessImESaISt4pairIKmmEEE", !14, i64 0}
!14 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmmESt10_Select1stIS2_ESt4lessImESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmmESt10_Select1stIS2_ESt4lessImESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !16, i64 0, !18, i64 8}
!16 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !17, i64 0}
!17 = !{!"_ZTSSt4lessImE"}
!18 = !{!"_ZTSSt15_Rb_tree_header", !19, i64 0, !10, i64 32}
!19 = !{!"_ZTSSt18_Rb_tree_node_base", !20, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!21 = !{!22, !23, i64 12}
!22 = !{!"_ZTSN9upscaledb9EnvConfigE", !23, i64 0, !23, i64 4, !23, i64 8, !23, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !24, i64 40, !24, i64 72, !23, i64 104, !26, i64 108, !7, i64 109, !10, i64 128, !23, i64 136}
!23 = !{!"int", !7, i64 0}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !10, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!23, !23, i64 0}
!28 = !{i64 0, i64 8, !5}
!29 = !{!30, !26, i64 0}
!30 = !{!"_ZTSSt4pairIbSt23_Rb_tree_const_iteratorIS_IKmmEEE", !26, i64 0, !31, i64 8}
!31 = !{!"_ZTSSt23_Rb_tree_const_iteratorISt4pairIKmmEE", !6, i64 0}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!35, !10, i64 0}
!35 = !{!"_ZTSSt4pairIKmmE", !10, i64 0, !10, i64 8}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!7, !7, i64 0}
!39 = distinct !{!39, !37}


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

%"struct.std::pair" = type { i8, %"struct.std::_Rb_tree_const_iterator" }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [84 x i8], align 1
@__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm = external hidden unnamed_addr constant [156 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local { i8, ptr } @_ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm(ptr noundef nonnull align 8 dereferenceable(72) %0, i8 %1, ptr %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #0 align 2 {
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %12 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %13 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %14 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %15 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %16 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %17 = load ptr, ptr %0, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %17, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  store ptr %2, ptr %7, align 8, !tbaa !25
  %20 = and i8 %1, 1
  %21 = icmp eq i8 %20, 0
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %21, label %23, label %25

23:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  %24 = tail call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %22) #3
  store ptr %24, ptr %8, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  br label %30

25:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %26 = tail call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %22) #3
  store ptr %26, ptr %10, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #3
  %27 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 41, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm) #4
  unreachable

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  br label %30

30:                                               ; preds = %29, %23
  %31 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  %32 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %31) #3
  store ptr %32, ptr %12, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #3
  %33 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  %34 = ptrtoint ptr %3 to i64
  %.not44 = icmp sgt i64 %4, 21
  %or.cond45 = and i1 %33, %.not44
  br i1 %or.cond45, label %.lr.ph49, label %._crit_edge50

.lr.ph49:                                         ; preds = %30
  %35 = getelementptr inbounds i8, ptr %3, i64 12
  %36 = zext i32 %19 to i64
  br label %37

37:                                               ; preds = %.lr.ph49, %.thread
  %.047 = phi i32 [ 0, %.lr.ph49 ], [ %71, %.thread ]
  %.02846 = phi ptr [ %35, %.lr.ph49 ], [ %70, %.thread ]
  %38 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %39 = load i64, ptr %38, align 8, !tbaa !26
  %40 = urem i64 %39, %36
  %41 = udiv i64 %39, %36
  %42 = icmp eq i64 %40, 0
  br i1 %42, label %44, label %43

43:                                               ; preds = %37
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 58, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm) #4
  unreachable

44:                                               ; preds = %37
  %45 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %46 = load i64, ptr %45, align 8, !tbaa !26
  %47 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  %48 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %31) #3
  store ptr %48, ptr %14, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %49 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br i1 %49, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %44, %53
  %.02943 = phi i32 [ %54, %53 ], [ 1, %44 ]
  %.03042 = phi i64 [ %51, %53 ], [ %46, %44 ]
  %50 = call noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #3
  %51 = load i64, ptr %50, align 8, !tbaa !26
  %52 = add i64 %.03042, %36
  %.not32 = icmp eq i64 %51, %52
  br i1 %.not32, label %53, label %.thread

53:                                               ; preds = %.lr.ph
  %54 = add nuw nsw i32 %.02943, 1
  %55 = call ptr @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEppEi(ptr noundef nonnull align 8 dereferenceable(8) %7, i32 noundef 0) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #3
  %56 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %31) #3
  store ptr %56, ptr %14, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %14) #3
  %57 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %13) #3
  %58 = icmp ult i32 %.02943, 14
  %59 = select i1 %57, i1 %58, i1 false
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #3
  br i1 %59, label %.lr.ph, label %._crit_edge, !llvm.loop !28

._crit_edge:                                      ; preds = %53
  %60 = icmp ult i32 %.02943, 15
  br i1 %60, label %.thread, label %61

61:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 77, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN9upscaledb8Freelist12encode_stateESt4pairIbSt23_Rb_tree_const_iteratorIS1_IKmmEEEPhm) #4
  unreachable

.thread:                                          ; preds = %.lr.ph, %44, %._crit_edge
  %.02937 = phi i32 [ %54, %._crit_edge ], [ 1, %44 ], [ %.02943, %.lr.ph ]
  %62 = getelementptr inbounds i8, ptr %.02846, i64 1
  %63 = call noundef i64 @_ZN9upscaledb6Pickle10encode_u64EPhm(ptr noundef nonnull %62, i64 noundef %41)
  %64 = trunc i64 %63 to i32
  %65 = shl nuw nsw i32 %.02937, 4
  %66 = or i32 %65, %64
  %67 = trunc i32 %66 to i8
  store i8 %67, ptr %.02846, align 1, !tbaa !30
  %68 = shl i64 %63, 32
  %sext = add i64 %68, 4294967296
  %69 = ashr exact i64 %sext, 32
  %70 = getelementptr inbounds i8, ptr %.02846, i64 %69
  %71 = add i32 %.047, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #3
  %72 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %31) #3
  store ptr %72, ptr %12, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #3
  %73 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  %74 = getelementptr inbounds i8, ptr %70, i64 9
  %75 = ptrtoint ptr %74 to i64
  %76 = sub i64 %75, %34
  %.not = icmp slt i64 %76, %4
  %or.cond = select i1 %73, i1 %.not, i1 false
  br i1 %or.cond, label %37, label %._crit_edge50, !llvm.loop !31

._crit_edge50:                                    ; preds = %.thread, %30
  %.0.lcssa = phi i32 [ 0, %30 ], [ %71, %.thread ]
  %77 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %.0.lcssa, ptr %77, align 4, !tbaa !32
  call void @_ZNSt4pairIbSt23_Rb_tree_const_iteratorIS_IKmmEEEC2IbS3_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES7_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #3
  %78 = call ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %31) #3
  store ptr %78, ptr %16, align 8
  call void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #3
  %79 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %15) #3
  %80 = zext i1 %79 to i8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #3
  %81 = load i64, ptr %7, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  %.fca.0.insert = insertvalue { i8, ptr } poison, i8 %80, 0
  %.fca.1.load.cast = inttoptr i64 %81 to ptr
  %.fca.1.insert = insertvalue { i8, ptr } %.fca.0.insert, ptr %.fca.1.load.cast, 1
  ret { i8, ptr } %.fca.1.insert
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt23_Rb_tree_const_iteratorISt4pairIKmmEEC2ERKSt17_Rb_tree_iteratorIS2_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt4pairIKmmEES5_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapImmSt4lessImESaISt4pairIKmmEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) 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 #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIKmmEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN9upscaledb6Pickle10encode_u64EPhm(ptr noundef, i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIbSt23_Rb_tree_const_iteratorIS_IKmmEEEC2IbS3_TnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES7_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #0 align 2

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }
attributes #4 = { 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, !7, i64 0}
!6 = !{!"_ZTSN9upscaledb8FreelistE", !7, i64 0, !10, i64 8, !18, i64 56, !18, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt3mapImmSt4lessImESaISt4pairIKmmEEE", !11, i64 0}
!11 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmmESt10_Select1stIS2_ESt4lessImESaIS2_EE", !12, i64 0}
!12 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmmESt10_Select1stIS2_ESt4lessImESaIS2_EE13_Rb_tree_implIS6_Lb1EEE", !13, i64 0, !15, i64 8}
!13 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !14, i64 0}
!14 = !{!"_ZTSSt4lessImE"}
!15 = !{!"_ZTSSt15_Rb_tree_header", !16, i64 0, !18, i64 32}
!16 = !{!"_ZTSSt18_Rb_tree_node_base", !17, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!17 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!18 = !{!"long", !8, i64 0}
!19 = !{!20, !21, i64 12}
!20 = !{!"_ZTSN9upscaledb9EnvConfigE", !21, i64 0, !21, i64 4, !21, i64 8, !21, i64 12, !18, i64 16, !18, i64 24, !18, i64 32, !22, i64 40, !22, i64 72, !21, i64 104, !24, i64 108, !8, i64 109, !18, i64 128, !21, i64 136}
!21 = !{!"int", !8, i64 0}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !23, i64 0, !18, i64 8, !8, i64 16}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !7, i64 0}
!24 = !{!"bool", !8, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!27, !18, i64 0}
!27 = !{!"_ZTSSt4pairIKmmE", !18, i64 0, !18, i64 8}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!8, !8, i64 0}
!31 = distinct !{!31, !29}
!32 = !{!21, !21, i64 0}


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