; LLVM IR from weicao/cascadb :: src/tree/node.ll (ZN7cascadb9InnerNode9read_fromERNS_11BlockReaderEb)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.cascadb::Slice" = type <{ ptr, i32, [4 x i8] }>
%"class.cascadb::InnerNode" = type { %"class.cascadb::DataNode.base", i8, i64, ptr, %"class.cascadb::Slice", i32, i32, i32, i16, %"class.std::vector", i64, i64, i64 }
%"class.cascadb::DataNode.base" = type <{ %"class.cascadb::Node", ptr, i32 }>
%"class.cascadb::Node" = type { ptr, %"class.std::__cxx11::basic_string", i64, %"class.cascadb::Mutex", i8, i8, i8, %struct.timeval, %struct.timeval, i32, i32, %"class.cascadb::RWLock" }
%"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] }
%"class.cascadb::Mutex" = type { i8, %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.timeval = type { i64, i64 }
%"class.cascadb::RWLock" = type { %union.pthread_rwlock_t }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl" }
%"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl" = type { %"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl_data" }
%"struct.std::_Vector_base<cascadb::Pivot, std::allocator<cascadb::Pivot>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.cascadb::Pivot" = type <{ %"class.cascadb::Slice", %"class.cascadb::Slice", i64, ptr, i32, i32, i32, i16, [2 x i8] }>
%"class.cascadb::DataNode" = type <{ %"class.cascadb::Node", ptr, i32, [4 x i8] }>

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt64EPm(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #0 align 2

; 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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 noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode9read_fromERNS_11BlockReaderEb(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %2) unnamed_addr #0 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"class.cascadb::Slice", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %12 = zext i1 %2 to i8
  store i8 %12, ptr %7, align 1, !tbaa !9
  %13 = load ptr, ptr %5, align 8
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 1
  %16 = call noundef zeroext i1 @_ZN7cascadb11BlockReader8readBoolEPb(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef %15)
  br i1 %16, label %18, label %17

17:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %152

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %19, ptr noundef %8)
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

22:                                               ; preds = %18
  %23 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %24 = load i32, ptr %8, align 4, !tbaa !11
  %25 = zext i32 %24 to i64
  call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %25)
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 2
  %28 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt64EPm(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef %27)
  br i1 %28, label %30, label %29

29:                                               ; preds = %22
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

30:                                               ; preds = %22
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 5
  %33 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %31, ptr noundef %32)
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

35:                                               ; preds = %30
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 6
  %38 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef %37)
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

40:                                               ; preds = %35
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 7
  %43 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef %42)
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

45:                                               ; preds = %40
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 8
  %48 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt16EPt(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef %47)
  br i1 %48, label %50, label %49

49:                                               ; preds = %45
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

50:                                               ; preds = %45
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 4
  %53 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(12) %52)
  br i1 %53, label %55, label %54

54:                                               ; preds = %50
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

55:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !13
  br label %56

56:                                               ; preds = %135, %55
  %57 = load i64, ptr %10, align 8, !tbaa !13
  %58 = load i32, ptr %8, align 4, !tbaa !11
  %59 = zext i32 %58 to i64
  %60 = icmp ult i64 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  store i32 2, ptr %9, align 4
  br label %138

62:                                               ; preds = %56
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %65 = load i64, ptr %10, align 8, !tbaa !13
  %66 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %64, i64 noundef %65) #5
  %67 = getelementptr inbounds %"class.cascadb::Pivot", ptr %66, i32 0, i32 0
  %68 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %63, ptr noundef nonnull align 8 dereferenceable(12) %67)
  br i1 %68, label %70, label %69

69:                                               ; preds = %62
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %138

70:                                               ; preds = %62
  %71 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %72 = load i64, ptr %10, align 8, !tbaa !13
  %73 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %71, i64 noundef %72) #5
  %74 = getelementptr inbounds %"class.cascadb::Pivot", ptr %73, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %74, i64 16, i1 false), !tbaa.struct !15
  %75 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8
  %77 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 1
  %78 = load i32, ptr %77, align 8
  %79 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %13, ptr %76, i32 %78)
  %80 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 10
  %81 = load i64, ptr %80, align 8, !tbaa !16
  %82 = add i64 %81, %79
  store i64 %82, ptr %80, align 8, !tbaa !16
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %85 = load i64, ptr %10, align 8, !tbaa !13
  %86 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %85) #5
  %87 = getelementptr inbounds %"class.cascadb::Pivot", ptr %86, i32 0, i32 2
  %88 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt64EPm(ptr noundef nonnull align 8 dereferenceable(16) %83, ptr noundef %87)
  br i1 %88, label %90, label %89

89:                                               ; preds = %70
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %138

90:                                               ; preds = %70
  %91 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %92 = load i64, ptr %10, align 8, !tbaa !13
  %93 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %91, i64 noundef %92) #5
  %94 = getelementptr inbounds %"class.cascadb::Pivot", ptr %93, i32 0, i32 3
  store ptr null, ptr %94, align 8, !tbaa !32
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %97 = load i64, ptr %10, align 8, !tbaa !13
  %98 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %96, i64 noundef %97) #5
  %99 = getelementptr inbounds %"class.cascadb::Pivot", ptr %98, i32 0, i32 4
  %100 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %95, ptr noundef %99)
  br i1 %100, label %102, label %101

101:                                              ; preds = %90
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %138

102:                                              ; preds = %90
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %105 = load i64, ptr %10, align 8, !tbaa !13
  %106 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %105) #5
  %107 = getelementptr inbounds %"class.cascadb::Pivot", ptr %106, i32 0, i32 5
  %108 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %103, ptr noundef %107)
  br i1 %108, label %110, label %109

109:                                              ; preds = %102
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %138

110:                                              ; preds = %102
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %113 = load i64, ptr %10, align 8, !tbaa !13
  %114 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %112, i64 noundef %113) #5
  %115 = getelementptr inbounds %"class.cascadb::Pivot", ptr %114, i32 0, i32 6
  %116 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %111, ptr noundef %115)
  br i1 %116, label %118, label %117

117:                                              ; preds = %110
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %138

118:                                              ; preds = %110
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %121 = load i64, ptr %10, align 8, !tbaa !13
  %122 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %120, i64 noundef %121) #5
  %123 = getelementptr inbounds %"class.cascadb::Pivot", ptr %122, i32 0, i32 7
  %124 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt16EPt(ptr noundef nonnull align 8 dereferenceable(16) %119, ptr noundef %123)
  br i1 %124, label %126, label %125

125:                                              ; preds = %118
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %138

126:                                              ; preds = %118
  %127 = load ptr, ptr %6, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.cascadb::InnerNode", ptr %13, i32 0, i32 9
  %129 = load i64, ptr %10, align 8, !tbaa !13
  %130 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef %129) #5
  %131 = getelementptr inbounds %"class.cascadb::Pivot", ptr %130, i32 0, i32 1
  %132 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %127, ptr noundef nonnull align 8 dereferenceable(12) %131)
  br i1 %132, label %134, label %133

133:                                              ; preds = %126
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %138

134:                                              ; preds = %126
  br label %135

135:                                              ; preds = %134
  %136 = load i64, ptr %10, align 8, !tbaa !13
  %137 = add i64 %136, 1
  store i64 %137, ptr %10, align 8, !tbaa !13
  br label %56, !llvm.loop !34

138:                                              ; preds = %133, %125, %117, %109, %101, %89, %69, %61
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %139 = load i32, ptr %9, align 4
  switch i32 %139, label %151 [
    i32 2, label %140
  ]

140:                                              ; preds = %138
  %141 = load i8, ptr %7, align 1, !tbaa !9, !range !36, !noundef !37
  %142 = trunc i8 %141 to i1
  br i1 %142, label %148, label %143

143:                                              ; preds = %140
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = call noundef zeroext i1 @_ZN7cascadb9InnerNode15load_all_msgbufERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(312) %13, ptr noundef nonnull align 8 dereferenceable(16) %144)
  br i1 %145, label %147, label %146

146:                                              ; preds = %143
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

147:                                              ; preds = %143
  br label %150

148:                                              ; preds = %140
  %149 = getelementptr inbounds %"class.cascadb::DataNode", ptr %13, i32 0, i32 2
  store i32 2, ptr %149, align 8, !tbaa !38
  br label %150

150:                                              ; preds = %148, %147
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %151

151:                                              ; preds = %150, %146, %138, %54, %49, %44, %39, %34, %29, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %152

152:                                              ; preds = %151, %17
  %153 = load i1, ptr %4, align 1
  ret i1 %153
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockReader8readBoolEPb(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt16EPt(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) #0 align 2

declare noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(12)) #4

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode15load_all_msgbufERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(16)) #0 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 = { "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 }

!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 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{i64 0, i64 8, !5, i64 8, i64 4, !11}
!16 = !{!17, !14, i64 288}
!17 = !{!"_ZTSN7cascadb9InnerNodeE", !18, i64 0, !10, i64 212, !14, i64 216, !6, i64 224, !26, i64 232, !12, i64 248, !12, i64 252, !12, i64 256, !27, i64 260, !28, i64 264, !14, i64 288, !14, i64 296, !14, i64 304}
!18 = !{!"_ZTSN7cascadb8DataNodeE", !19, i64 0, !6, i64 200, !25, i64 208}
!19 = !{!"_ZTSN7cascadb4NodeE", !20, i64 8, !14, i64 40, !22, i64 48, !10, i64 96, !10, i64 97, !10, i64 98, !23, i64 104, !23, i64 120, !12, i64 136, !12, i64 140, !24, i64 144}
!20 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !21, i64 0, !14, i64 8, !7, i64 16}
!21 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!22 = !{!"_ZTSN7cascadb5MutexE", !10, i64 0, !7, i64 8}
!23 = !{!"_ZTS7timeval", !14, i64 0, !14, i64 8}
!24 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!25 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!26 = !{!"_ZTSN7cascadb5SliceE", !6, i64 0, !12, i64 8}
!27 = !{!"short", !7, i64 0}
!28 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = !{!33, !6, i64 40}
!33 = !{!"_ZTSN7cascadb5PivotE", !26, i64 0, !26, i64 16, !14, i64 32, !6, i64 40, !12, i64 48, !12, i64 52, !12, i64 56, !27, i64 60}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{i8 0, i8 2}
!37 = !{}
!38 = !{!18, !25, i64 208}


; 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 uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt64EPm(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef) local_unnamed_addr #0 align 2

; 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 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 nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode9read_fromERNS_11BlockReaderEb(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, i1 noundef zeroext %2) unnamed_addr #0 align 2 {
  %4 = alloca i32, align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 212
  %6 = tail call noundef zeroext i1 @_ZN7cascadb11BlockReader8readBoolEPb(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %5)
  br i1 %6, label %7, label %74

7:                                                ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %8 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %4)
  br i1 %8, label %9, label %.loopexit

9:                                                ; preds = %7
  %10 = getelementptr inbounds i8, ptr %0, i64 264
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = zext i32 %11 to i64
  call void @_ZNSt6vectorIN7cascadb5PivotESaIS1_EE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %12)
  %13 = getelementptr inbounds i8, ptr %0, i64 216
  %14 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt64EPm(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %13)
  br i1 %14, label %15, label %.loopexit

15:                                               ; preds = %9
  %16 = getelementptr inbounds i8, ptr %0, i64 248
  %17 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %16)
  br i1 %17, label %18, label %.loopexit

18:                                               ; preds = %15
  %19 = getelementptr inbounds i8, ptr %0, i64 252
  %20 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %19)
  br i1 %20, label %21, label %.loopexit

21:                                               ; preds = %18
  %22 = getelementptr inbounds i8, ptr %0, i64 256
  %23 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %22)
  br i1 %23, label %24, label %.loopexit

24:                                               ; preds = %21
  %25 = getelementptr inbounds i8, ptr %0, i64 260
  %26 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt16EPt(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %25)
  br i1 %26, label %27, label %.loopexit

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %0, i64 232
  %29 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(12) %28)
  br i1 %29, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %27
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %.not32.not = icmp eq i32 %30, 0
  br i1 %.not32.not, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %31 = getelementptr inbounds i8, ptr %0, i64 288
  br label %36

32:                                               ; preds = %65
  %33 = add nuw nsw i64 %.03133, 1
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = zext i32 %34 to i64
  %.not = icmp ult i64 %33, %35
  br i1 %.not, label %36, label %.critedge, !llvm.loop !9

36:                                               ; preds = %.lr.ph, %32
  %.03133 = phi i64 [ 0, %.lr.ph ], [ %33, %32 ]
  %37 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %38 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(12) %37)
  br i1 %38, label %39, label %.loopexit

39:                                               ; preds = %36
  %40 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %.sroa.0.0.copyload = load ptr, ptr %40, align 8, !tbaa !11
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %40, i64 8
  %.sroa.2.0.copyload = load i32, ptr %.sroa.2.0..sroa_idx, align 8, !tbaa !5
  %41 = call noundef i64 @_ZN7cascadb9InnerNode10pivot_sizeENS_5SliceE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr %.sroa.0.0.copyload, i32 %.sroa.2.0.copyload)
  %42 = load i64, ptr %31, align 8, !tbaa !13
  %43 = add i64 %42, %41
  store i64 %43, ptr %31, align 8, !tbaa !13
  %44 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %45 = getelementptr inbounds i8, ptr %44, i64 32
  %46 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt64EPm(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %45)
  br i1 %46, label %47, label %.loopexit

47:                                               ; preds = %39
  %48 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  store ptr null, ptr %49, align 8, !tbaa !31
  %50 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %51 = getelementptr inbounds i8, ptr %50, i64 48
  %52 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %51)
  br i1 %52, label %53, label %.loopexit

53:                                               ; preds = %47
  %54 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %55 = getelementptr inbounds i8, ptr %54, i64 52
  %56 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %55)
  br i1 %56, label %57, label %.loopexit

57:                                               ; preds = %53
  %58 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %59 = getelementptr inbounds i8, ptr %58, i64 56
  %60 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt32EPj(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %59)
  br i1 %60, label %61, label %.loopexit

61:                                               ; preds = %57
  %62 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %63 = getelementptr inbounds i8, ptr %62, i64 60
  %64 = call noundef zeroext i1 @_ZN7cascadb11BlockReader10readUInt16EPt(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull %63)
  br i1 %64, label %65, label %.loopexit

65:                                               ; preds = %61
  %66 = call noundef nonnull align 8 dereferenceable(62) ptr @_ZNSt6vectorIN7cascadb5PivotESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %.03133) #4
  %67 = getelementptr inbounds i8, ptr %66, i64 16
  %68 = call noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(12) %67)
  br i1 %68, label %32, label %.loopexit

.critedge:                                        ; preds = %32, %.preheader
  br i1 %2, label %71, label %69

69:                                               ; preds = %.critedge
  %70 = call noundef zeroext i1 @_ZN7cascadb9InnerNode15load_all_msgbufERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(312) %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br i1 %70, label %73, label %.loopexit

71:                                               ; preds = %.critedge
  %72 = getelementptr inbounds i8, ptr %0, i64 208
  store i32 2, ptr %72, align 8, !tbaa !33
  br label %73

73:                                               ; preds = %69, %71
  br label %.loopexit

.loopexit:                                        ; preds = %36, %39, %47, %53, %57, %61, %65, %69, %27, %24, %21, %18, %15, %9, %7, %73
  %.1 = phi i1 [ true, %73 ], [ false, %7 ], [ false, %9 ], [ false, %15 ], [ false, %18 ], [ false, %21 ], [ false, %24 ], [ false, %27 ], [ false, %69 ], [ false, %65 ], [ false, %61 ], [ false, %57 ], [ false, %53 ], [ false, %47 ], [ false, %39 ], [ false, %36 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %74

74:                                               ; preds = %3, %.loopexit
  %.2 = phi i1 [ %.1, %.loopexit ], [ false, %3 ]
  ret i1 %.2
}

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

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

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

declare noundef zeroext i1 @_ZN7cascadb11BlockReader9readSliceERNS_5SliceE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN7cascadb9InnerNode15load_all_msgbufERNS_11BlockReaderE(ptr noundef nonnull align 8 dereferenceable(312), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !19, i64 288}
!14 = !{!"_ZTSN7cascadb9InnerNodeE", !15, i64 0, !21, i64 212, !19, i64 216, !12, i64 224, !25, i64 232, !6, i64 248, !6, i64 252, !6, i64 256, !26, i64 260, !27, i64 264, !19, i64 288, !19, i64 296, !19, i64 304}
!15 = !{!"_ZTSN7cascadb8DataNodeE", !16, i64 0, !12, i64 200, !24, i64 208}
!16 = !{!"_ZTSN7cascadb4NodeE", !17, i64 8, !19, i64 40, !20, i64 48, !21, i64 96, !21, i64 97, !21, i64 98, !22, i64 104, !22, i64 120, !6, i64 136, !6, i64 140, !23, i64 144}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !19, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !12, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSN7cascadb5MutexE", !21, i64 0, !7, i64 8}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTS7timeval", !19, i64 0, !19, i64 8}
!23 = !{!"_ZTSN7cascadb6RWLockE", !7, i64 0}
!24 = !{!"_ZTSN7cascadb10NodeStatusE", !7, i64 0}
!25 = !{!"_ZTSN7cascadb5SliceE", !12, i64 0, !6, i64 8}
!26 = !{!"short", !7, i64 0}
!27 = !{!"_ZTSSt6vectorIN7cascadb5PivotESaIS1_EE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIN7cascadb5PivotESaIS1_EE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE12_Vector_implE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN7cascadb5PivotESaIS1_EE17_Vector_impl_dataE", !12, i64 0, !12, i64 8, !12, i64 16}
!31 = !{!32, !12, i64 40}
!32 = !{!"_ZTSN7cascadb5PivotE", !25, i64 0, !25, i64 16, !19, i64 32, !12, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !26, i64 60}
!33 = !{!15, !24, i64 208}


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