; LLVM IR from wichue/nethello :: src/net (StickyPacket)

; 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.chw::LogContextCapture" = type { %"class.std::shared_ptr.0", ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.chw::_MsgHdr_" = type { %union.anon, i32 }
%union.anon = type { i32 }

@.str = external hidden unnamed_addr constant [74 x i8], align 1
@__FUNCTION__._ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.chw::LogContextCapture", align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.chw::LogContextCapture", align 8
  %15 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 8, ptr %6, align 4, !tbaa !9
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  %18 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %17)
  %19 = load i32, ptr %6, align 4, !tbaa !9
  %20 = zext i32 %19 to i64
  %21 = icmp ult i64 %18, %20
  br i1 %21, label %22, label %23

22:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %181

23:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %24) #5
  %26 = call noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %25)
  store ptr %26, ptr %8, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #5
  %29 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %28)
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 1, !tbaa !11
  %33 = zext i32 %32 to i64
  %34 = icmp ult i64 %29, %33
  br i1 %34, label %35, label %70

35:                                               ; preds = %23
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 1, !tbaa !11
  %39 = zext i32 %38 to i64
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %40) #5
  %42 = call noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %41)
  %43 = icmp ugt i64 %39, %42
  br i1 %43, label %44, label %69

44:                                               ; preds = %35
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %45, i32 0, i32 1
  %47 = load i32, ptr %46, align 1, !tbaa !11
  %48 = icmp ugt i32 %47, 268435456
  br i1 %48, label %49, label %61

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %50 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
  call void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(144) %50, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE, i32 noundef 35, ptr noundef @.str.1)
  %51 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA22_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 1 dereferenceable(22) @.str.2)
          to label %52 unwind label %57

52:                                               ; preds = %49
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %53, i32 0, i32 1
  %55 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRjEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %51, ptr noundef nonnull align 4 dereferenceable(4) %54)
          to label %56 unwind label %57

56:                                               ; preds = %52
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %179

57:                                               ; preds = %52, %49
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %10, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %11, align 4
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  br label %180

61:                                               ; preds = %44
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %62) #5
  %64 = load ptr, ptr %8, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 1, !tbaa !11
  %67 = zext i32 %66 to i64
  %68 = call noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25) %63, i64 noundef %67)
  br label %69

69:                                               ; preds = %61, %35
  br label %178

70:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %121, %70
  br label %72

72:                                               ; preds = %71
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %73) #5
  %75 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %74)
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = zext i32 %76 to i64
  %78 = sub i64 %75, %77
  %79 = load i32, ptr %6, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = icmp ult i64 %78, %80
  br i1 %81, label %82, label %83

82:                                               ; preds = %72
  br label %122

83:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %84) #5
  %86 = call noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %85)
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  store ptr %89, ptr %13, align 8, !tbaa !5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %90) #5
  %92 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %91)
  %93 = load i32, ptr %12, align 4, !tbaa !9
  %94 = zext i32 %93 to i64
  %95 = sub i64 %92, %94
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %96, i32 0, i32 1
  %98 = load i32, ptr %97, align 1, !tbaa !11
  %99 = zext i32 %98 to i64
  %100 = icmp uge i64 %95, %99
  br i1 %100, label %101, label %117

101:                                              ; preds = %83
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %103) #5
  %105 = call noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %104)
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds i8, ptr %105, i64 %107
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 1, !tbaa !11
  call void @_ZNKSt8functionIFvPcjEEclES0_j(ptr noundef nonnull align 8 dereferenceable(32) %102, ptr noundef %108, i32 noundef %111)
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %"struct.chw::_MsgHdr_", ptr %112, i32 0, i32 1
  %114 = load i32, ptr %113, align 1, !tbaa !11
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = add i32 %115, %114
  store i32 %116, ptr %12, align 4, !tbaa !9
  br label %118

117:                                              ; preds = %83
  store i32 3, ptr %7, align 4
  br label %119

118:                                              ; preds = %101
  store i32 0, ptr %7, align 4
  br label %119

119:                                              ; preds = %118, %117
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %120 = load i32, ptr %7, align 4
  switch i32 %120, label %188 [
    i32 0, label %121
    i32 3, label %122
  ]

121:                                              ; preds = %119
  br label %71, !llvm.loop !13

122:                                              ; preds = %119, %82
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = zext i32 %123 to i64
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %125) #5
  %127 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %126)
  %128 = icmp ult i64 %124, %127
  br i1 %128, label %129, label %138

129:                                              ; preds = %122
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %130) #5
  %132 = load i32, ptr %12, align 4, !tbaa !9
  %133 = zext i32 %132 to i64
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %134) #5
  %136 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %135)
  %137 = call noundef i32 @_ZN3chw6Buffer5AlignEmm(ptr noundef nonnull align 8 dereferenceable(25) %131, i64 noundef %133, i64 noundef %136)
  store i32 %137, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %175

138:                                              ; preds = %122
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %141) #5
  %143 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %142)
  %144 = icmp eq i64 %140, %143
  br i1 %144, label %145, label %148

145:                                              ; preds = %138
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %146) #5
  call void @_ZN3chw6Buffer5ResetEv(ptr noundef nonnull align 8 dereferenceable(25) %147)
  br label %173

148:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %149 = call noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
  call void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(144) %149, i32 noundef 4, ptr noundef @.str, ptr noundef @__FUNCTION__._ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE, i32 noundef 77, ptr noundef @.str.1)
  %150 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA14_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 1 dereferenceable(14) @.str.3)
          to label %151 unwind label %164

151:                                              ; preds = %148
  %152 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRjEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %150, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %153 unwind label %164

153:                                              ; preds = %151
  %154 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA15_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %152, ptr noundef nonnull align 1 dereferenceable(15) @.str.4)
          to label %155 unwind label %164

155:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %156) #5
  %158 = invoke noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %157)
          to label %159 unwind label %168

159:                                              ; preds = %155
  store i64 %158, ptr %15, align 8, !tbaa !15
  %160 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsImEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %154, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %161 unwind label %168

161:                                              ; preds = %159
  %162 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA2_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %160, ptr noundef nonnull align 1 dereferenceable(2) @.str.5)
          to label %163 unwind label %168

163:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %175

164:                                              ; preds = %153, %151, %148
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %10, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %11, align 4
  br label %172

168:                                              ; preds = %161, %159, %155
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %10, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %172

172:                                              ; preds = %168, %164
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %180

173:                                              ; preds = %145
  br label %174

174:                                              ; preds = %173
  store i32 0, ptr %7, align 4
  br label %175

175:                                              ; preds = %174, %163, %129
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %176 = load i32, ptr %7, align 4
  switch i32 %176, label %179 [
    i32 0, label %177
  ]

177:                                              ; preds = %175
  br label %178

178:                                              ; preds = %177, %69
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %179

179:                                              ; preds = %178, %175, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %181

180:                                              ; preds = %172, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %183

181:                                              ; preds = %179, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %182 = load i32, ptr %3, align 4
  ret i32 %182

183:                                              ; preds = %180
  %184 = load ptr, ptr %10, align 8
  %185 = load i32, ptr %11, align 4
  %186 = insertvalue { ptr, i32 } poison, ptr %184, 0
  %187 = insertvalue { ptr, i32 } %186, i32 %185, 1
  resume { ptr, i32 } %187

188:                                              ; preds = %119
  unreachable
}

; Function Attrs: 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 noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

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

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

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

declare noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv() #3

declare void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA22_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(22)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNKSt8functionIFvPcjEEclES0_j(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, i32 noundef) #0 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA14_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(14)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA15_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(15)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA2_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(2)) #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 = { 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 "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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"_ZTSN3chw8_MsgHdr_E", !7, i64 0, !10, i64 4}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.chw::LogContextCapture" = type { %"class.std::shared_ptr.0", ptr }
%"class.std::shared_ptr.0" = type { %"class.std::__shared_ptr.1" }
%"class.std::__shared_ptr.1" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }

@.str = external hidden unnamed_addr constant [74 x i8], align 1
@__FUNCTION__._ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.chw::LogContextCapture", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.chw::LogContextCapture", align 8
  %6 = alloca i64, align 8
  %7 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %8 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %7)
  %9 = icmp ult i64 %8, 8
  br i1 %9, label %101, label %10

10:                                               ; preds = %2
  %11 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %12 = tail call noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %11)
  %13 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %14 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %13)
  %15 = getelementptr inbounds i8, ptr %12, i64 4
  %16 = load i32, ptr %15, align 1, !tbaa !5
  %17 = zext i32 %16 to i64
  %18 = icmp ult i64 %14, %17
  br i1 %18, label %19, label %39

19:                                               ; preds = %10
  %20 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %21 = tail call noundef i64 @_ZN3chw6Buffer8CapacityEv(ptr noundef nonnull align 8 dereferenceable(25) %20)
  %22 = icmp ult i64 %21, %17
  br i1 %22, label %23, label %101

23:                                               ; preds = %19
  %24 = load i32, ptr %15, align 1, !tbaa !5
  %25 = icmp ugt i32 %24, 268435456
  br i1 %25, label %26, label %34

26:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  %27 = tail call noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
  call void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(144) %27, i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE, i32 noundef 35, ptr noundef nonnull @.str.1)
  %28 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA22_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 1 dereferenceable(22) @.str.2)
          to label %29 unwind label %32

29:                                               ; preds = %26
  %30 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRjEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 4 dereferenceable(4) %15)
          to label %31 unwind label %32

31:                                               ; preds = %29
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %101

32:                                               ; preds = %29, %26
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  br label %100

34:                                               ; preds = %23
  %35 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %36 = load i32, ptr %15, align 1, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = tail call noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25) %35, i64 noundef %37)
  br label %101

39:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 0, ptr %4, align 4, !tbaa !10
  %40 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %41 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %40)
  %42 = icmp ult i64 %41, 8
  br i1 %42, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %39, %53
  %storemerge45 = phi i32 [ %59, %53 ], [ 0, %39 ]
  %43 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %44 = tail call noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %43)
  %45 = zext i32 %storemerge45 to i64
  %46 = getelementptr inbounds i8, ptr %44, i64 %45
  %47 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %48 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %47)
  %49 = sub i64 %48, %45
  %50 = getelementptr inbounds i8, ptr %46, i64 4
  %51 = load i32, ptr %50, align 1, !tbaa !5
  %52 = zext i32 %51 to i64
  %.not = icmp ult i64 %49, %52
  br i1 %.not, label %.thread.loopexit, label %53

53:                                               ; preds = %.lr.ph
  %54 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %55 = tail call noundef ptr @_ZN3chw6Buffer4dataEv(ptr noundef nonnull align 8 dereferenceable(25) %54)
  %56 = getelementptr inbounds i8, ptr %55, i64 %45
  %57 = load i32, ptr %50, align 1, !tbaa !5
  tail call void @_ZNKSt8functionIFvPcjEEclES0_j(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %56, i32 noundef %57)
  %58 = load i32, ptr %50, align 1, !tbaa !5
  %59 = add i32 %storemerge45, %58
  store i32 %59, ptr %4, align 4, !tbaa !10
  %60 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %61 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %60)
  %62 = zext i32 %59 to i64
  %63 = sub i64 %61, %62
  %64 = icmp ult i64 %63, 8
  br i1 %64, label %.thread.loopexit, label %.lr.ph

.thread.loopexit:                                 ; preds = %.lr.ph, %53
  %65 = phi i32 [ %storemerge45, %.lr.ph ], [ %59, %53 ]
  %66 = zext i32 %65 to i64
  br label %.thread

.thread:                                          ; preds = %.thread.loopexit, %39
  %67 = phi i64 [ %66, %.thread.loopexit ], [ 0, %39 ]
  %68 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %69 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %68)
  %70 = icmp ugt i64 %69, %67
  %71 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  br i1 %70, label %72, label %76

72:                                               ; preds = %.thread
  %73 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %74 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %73)
  %75 = tail call noundef i32 @_ZN3chw6Buffer5AlignEmm(ptr noundef nonnull align 8 dereferenceable(25) %71, i64 noundef %67, i64 noundef %74)
  br label %.thread42

76:                                               ; preds = %.thread
  %77 = tail call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %71)
  %78 = icmp eq i64 %77, %67
  br i1 %78, label %98, label %79

79:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  %80 = tail call noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv()
  call void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(144) %80, i32 noundef 4, ptr noundef nonnull @.str, ptr noundef nonnull @__FUNCTION__._ZN3chw12StickyPacketERKSt10shared_ptrINS_6BufferEERKSt8functionIFvPcjEE, i32 noundef 77, ptr noundef nonnull @.str.1)
  %81 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA14_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 1 dereferenceable(14) @.str.3)
          to label %82 unwind label %93

82:                                               ; preds = %79
  %83 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRjEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %81, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %84 unwind label %93

84:                                               ; preds = %82
  %85 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA15_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %83, ptr noundef nonnull align 1 dereferenceable(15) @.str.4)
          to label %86 unwind label %93

86:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  %87 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  %88 = call noundef i64 @_ZN3chw6Buffer4SizeEv(ptr noundef nonnull align 8 dereferenceable(25) %87)
  store i64 %88, ptr %6, align 8, !tbaa !11
  %89 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsImEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %85, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %90 unwind label %95

90:                                               ; preds = %86
  %91 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA2_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24) %89, ptr noundef nonnull align 1 dereferenceable(2) @.str.5)
          to label %92 unwind label %95

92:                                               ; preds = %90
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %.thread42

93:                                               ; preds = %84, %82, %79
  %94 = landingpad { ptr, i32 }
          cleanup
  br label %97

95:                                               ; preds = %90, %86
  %96 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  br label %97

97:                                               ; preds = %95, %93
  %.pn = phi { ptr, i32 } [ %96, %95 ], [ %94, %93 ]
  call void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %100

.thread42:                                        ; preds = %72, %92
  %.0.ph = phi i32 [ 1, %92 ], [ %75, %72 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %101

98:                                               ; preds = %76
  %99 = tail call noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5
  tail call void @_ZN3chw6Buffer5ResetEv(ptr noundef nonnull align 8 dereferenceable(25) %99)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %101

100:                                              ; preds = %97, %32
  %.pn38 = phi { ptr, i32 } [ %33, %32 ], [ %.pn, %97 ]
  resume { ptr, i32 } %.pn38

101:                                              ; preds = %34, %19, %98, %.thread42, %31, %2
  %.2 = phi i32 [ 0, %2 ], [ 1, %31 ], [ %.0.ph, %.thread42 ], [ 0, %98 ], [ 0, %19 ], [ 0, %34 ]
  ret i32 %.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 nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3chw6BufferELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

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

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

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

declare noundef nonnull align 8 dereferenceable(144) ptr @_ZN3chw9getLoggerEv() local_unnamed_addr #3

declare void @_ZN3chw17LogContextCaptureC1ERNS_6LoggerENS_8LogLevelEPKcS5_iS5_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(144), i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA22_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(22)) local_unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN3chw17LogContextCaptureD1Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #4

; 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 uwtable
declare dso_local noundef i32 @_ZN3chw6Buffer11SetCapacityEm(ptr noundef nonnull align 8 dereferenceable(25), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA14_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(14)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA15_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(15)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3chw17LogContextCapturelsIRA2_KcEERS0_OT_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(2)) 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 "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, !9, i64 4}
!6 = !{!"_ZTSN3chw8_MsgHdr_E", !7, i64 0, !9, i64 4}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!9, !9, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}


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