; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (basisu_enc)

; 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.basisu::vector.16" = type { ptr, i32, i32 }
%"class.basisu::histogram" = type { %"class.basisu::vector.18" }
%"class.basisu::vector.18" = type { ptr, i32, i32 }
%"class.basisu::huffman_encoding_table" = type { %"class.basisu::vector.16", %"class.basisu::vector.4" }
%"class.basisu::vector.4" = type { ptr, i32, i32 }
%"class.basisu::bitwise_coder" = type { %"class.basisu::vector.4", i32, i32, i64 }

@.str.4 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE = external hidden unnamed_addr constant [83 x i8], align 1
@_ZN6basisuL33g_huffman_sorted_codelength_codesE = external hidden constant [21 x i8], align 16
@.str.23 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorItE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 2 dereferenceable(2)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu13bitwise_coder12end_zero_runERNS_6vectorItEERj(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.basisu::vector.16", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i16, align 2
  %19 = alloca %"class.basisu::histogram", align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.basisu::huffman_encoding_table", align 8
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %27 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %28 = getelementptr inbounds %"class.basisu::bitwise_coder", ptr %27, i32 0, i32 3
  %29 = load i64, ptr %28, align 8, !tbaa !9
  store i64 %29, ptr %6, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %30)
  store ptr %31, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = call noundef i32 @_ZNK6basisu22huffman_encoding_table20get_total_used_codesEv(ptr noundef nonnull align 8 dereferenceable(32) %32)
  store i32 %33, ptr %8, align 4, !tbaa !15
  %34 = load i32, ptr %8, align 4, !tbaa !15
  %35 = call noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %34, i32 noundef 14)
  %36 = load i32, ptr %8, align 4, !tbaa !15
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %39, label %38

38:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %318

39:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @_ZN6basisu6vectorItEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %40 = load i32, ptr %8, align 4, !tbaa !15
  %41 = add i32 %40, 16
  %42 = zext i32 %41 to i64
  invoke void @_ZN6basisu6vectorItE7reserveEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %42)
          to label %43 unwind label %49

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 -1, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !15
  br label %44

44:                                               ; preds = %124, %43
  %45 = load i32, ptr %16, align 4, !tbaa !15
  %46 = load i32, ptr %8, align 4, !tbaa !15
  %47 = icmp ule i32 %45, %46
  br i1 %47, label %53, label %48

48:                                               ; preds = %44
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %128

49:                                               ; preds = %39
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %11, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %12, align 4
  br label %317

53:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %54 = load i32, ptr %16, align 4, !tbaa !15
  %55 = load i32, ptr %8, align 4, !tbaa !15
  %56 = icmp eq i32 %54, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  br label %66

58:                                               ; preds = %53
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = load i32, ptr %16, align 4, !tbaa !15
  %61 = zext i32 %60 to i64
  %62 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %59, i64 noundef %61)
          to label %63 unwind label %77

63:                                               ; preds = %58
  %64 = load i8, ptr %62, align 1, !tbaa !16
  %65 = zext i8 %64 to i32
  br label %66

66:                                               ; preds = %63, %57
  %67 = phi i32 [ 255, %57 ], [ %65, %63 ]
  store i32 %67, ptr %17, align 4, !tbaa !15
  %68 = load i32, ptr %17, align 4, !tbaa !15
  %69 = icmp eq i32 %68, 255
  br i1 %69, label %73, label %70

70:                                               ; preds = %66
  %71 = load i32, ptr %17, align 4, !tbaa !15
  %72 = icmp ule i32 %71, 16
  br label %73

73:                                               ; preds = %70, %66
  %74 = phi i1 [ true, %66 ], [ %72, %70 ]
  br i1 %74, label %75, label %76

75:                                               ; preds = %73
  br label %82

76:                                               ; preds = %73
  call void @__assert_fail(ptr noundef @.str.22, ptr noundef @.str.4, i32 noundef 1091, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE) #6
  unreachable

77:                                               ; preds = %119, %113, %108, %90, %85, %58
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %11, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %12, align 4
  br label %127

81:                                               ; No predecessors!
  br label %82

82:                                               ; preds = %81, %75
  %83 = load i32, ptr %17, align 4, !tbaa !15
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %113

85:                                               ; preds = %82
  invoke void @_ZN6basisu13bitwise_coder12end_zero_runERNS_6vectorItEERj(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %86 unwind label %77

86:                                               ; preds = %85
  %87 = load i32, ptr %17, align 4, !tbaa !15
  %88 = load i32, ptr %13, align 4, !tbaa !15
  %89 = icmp ne i32 %87, %88
  br i1 %89, label %90, label %104

90:                                               ; preds = %86
  %91 = load i32, ptr %13, align 4, !tbaa !15
  invoke void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef %91)
          to label %92 unwind label %77

92:                                               ; preds = %90
  %93 = load i32, ptr %17, align 4, !tbaa !15
  %94 = icmp ne i32 %93, 255
  br i1 %94, label %95, label %103

95:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #5
  %96 = load i32, ptr %17, align 4, !tbaa !15
  %97 = trunc i32 %96 to i16
  store i16 %97, ptr %18, align 2, !tbaa !17
  invoke void @_ZN6basisu6vectorItE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 2 dereferenceable(2) %18)
          to label %98 unwind label %99

98:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #5
  br label %103

99:                                               ; preds = %95
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %11, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #5
  br label %127

103:                                              ; preds = %98, %92
  br label %112

104:                                              ; preds = %86
  %105 = load i32, ptr %15, align 4, !tbaa !15
  %106 = add i32 %105, 1
  store i32 %106, ptr %15, align 4, !tbaa !15
  %107 = icmp eq i32 %106, 134
  br i1 %107, label %108, label %111

108:                                              ; preds = %104
  %109 = load i32, ptr %13, align 4, !tbaa !15
  invoke void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef %109)
          to label %110 unwind label %77

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110, %104
  br label %112

112:                                              ; preds = %111, %103
  br label %122

113:                                              ; preds = %82
  %114 = load i32, ptr %13, align 4, !tbaa !15
  invoke void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %15, i32 noundef %114)
          to label %115 unwind label %77

115:                                              ; preds = %113
  %116 = load i32, ptr %14, align 4, !tbaa !15
  %117 = add i32 %116, 1
  store i32 %117, ptr %14, align 4, !tbaa !15
  %118 = icmp eq i32 %117, 138
  br i1 %118, label %119, label %121

119:                                              ; preds = %115
  invoke void @_ZN6basisu13bitwise_coder12end_zero_runERNS_6vectorItEERj(ptr noundef nonnull align 8 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %14)
          to label %120 unwind label %77

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120, %115
  br label %122

122:                                              ; preds = %121, %112
  %123 = load i32, ptr %17, align 4, !tbaa !15
  store i32 %123, ptr %13, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %124

124:                                              ; preds = %122
  %125 = load i32, ptr %16, align 4, !tbaa !15
  %126 = add i32 %125, 1
  store i32 %126, ptr %16, align 4, !tbaa !15
  br label %44, !llvm.loop !19

127:                                              ; preds = %99, %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %316

128:                                              ; preds = %48
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #5
  invoke void @_ZN6basisu9histogramC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef 21)
          to label %129 unwind label %136

129:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !15
  br label %130

130:                                              ; preds = %153, %129
  %131 = load i32, ptr %20, align 4, !tbaa !15
  %132 = invoke noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %133 unwind label %140

133:                                              ; preds = %130
  %134 = icmp ult i32 %131, %132
  br i1 %134, label %144, label %135

135:                                              ; preds = %133
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %156

136:                                              ; preds = %128
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %11, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %12, align 4
  br label %315

140:                                              ; preds = %148, %144, %130
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %11, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %314

144:                                              ; preds = %133
  %145 = load i32, ptr %20, align 4, !tbaa !15
  %146 = zext i32 %145 to i64
  %147 = invoke noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %146)
          to label %148 unwind label %140

148:                                              ; preds = %144
  %149 = load i16, ptr %147, align 2, !tbaa !17
  %150 = zext i16 %149 to i32
  %151 = and i32 %150, 63
  invoke void @_ZN6basisu9histogram3incEj(ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef %151)
          to label %152 unwind label %140

152:                                              ; preds = %148
  br label %153

153:                                              ; preds = %152
  %154 = load i32, ptr %20, align 4, !tbaa !15
  %155 = add i32 %154, 1
  store i32 %155, ptr %20, align 4, !tbaa !15
  br label %130, !llvm.loop !21

156:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #5
  invoke void @_ZN6basisu22huffman_encoding_tableC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %157 unwind label %161

157:                                              ; preds = %156
  %158 = invoke noundef zeroext i1 @_ZN6basisu22huffman_encoding_table4initERKNS_9histogramEj(ptr noundef nonnull align 8 dereferenceable(32) %21, ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef 7)
          to label %159 unwind label %165

159:                                              ; preds = %157
  br i1 %158, label %169, label %160

160:                                              ; preds = %159
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %311

161:                                              ; preds = %156
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %11, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %12, align 4
  br label %313

165:                                              ; preds = %157
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %11, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %12, align 4
  br label %312

169:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 21, ptr %22, align 4, !tbaa !15
  br label %170

170:                                              ; preds = %192, %169
  %171 = load i32, ptr %22, align 4, !tbaa !15
  %172 = icmp ugt i32 %171, 0
  br i1 %172, label %173, label %195

173:                                              ; preds = %170
  %174 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %175 unwind label %187

175:                                              ; preds = %173
  %176 = load i32, ptr %22, align 4, !tbaa !15
  %177 = sub i32 %176, 1
  %178 = zext i32 %177 to i64
  %179 = getelementptr inbounds [21 x i8], ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 0, i64 %178
  %180 = load i8, ptr %179, align 1, !tbaa !16
  %181 = zext i8 %180 to i64
  %182 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %174, i64 noundef %181)
          to label %183 unwind label %187

183:                                              ; preds = %175
  %184 = load i8, ptr %182, align 1, !tbaa !16
  %185 = icmp ne i8 %184, 0
  br i1 %185, label %186, label %191

186:                                              ; preds = %183
  br label %195

187:                                              ; preds = %201, %175, %173
  %188 = landingpad { ptr, i32 }
          cleanup
  %189 = extractvalue { ptr, i32 } %188, 0
  store ptr %189, ptr %11, align 8
  %190 = extractvalue { ptr, i32 } %188, 1
  store i32 %190, ptr %12, align 4
  br label %310

191:                                              ; preds = %183
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %22, align 4, !tbaa !15
  %194 = add i32 %193, -1
  store i32 %194, ptr %22, align 4, !tbaa !15
  br label %170, !llvm.loop !22

195:                                              ; preds = %186, %170
  %196 = load i32, ptr %22, align 4, !tbaa !15
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %199

198:                                              ; preds = %195
  br label %201

199:                                              ; preds = %195
  call void @__assert_fail(ptr noundef @.str.23, ptr noundef @.str.4, i32 noundef 1132, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE) #6
  unreachable

200:                                              ; No predecessors!
  br label %201

201:                                              ; preds = %200, %198
  %202 = load i32, ptr %22, align 4, !tbaa !15
  %203 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %202, i32 noundef 5)
          to label %204 unwind label %187

204:                                              ; preds = %201
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !15
  br label %205

205:                                              ; preds = %224, %204
  %206 = load i32, ptr %23, align 4, !tbaa !15
  %207 = load i32, ptr %22, align 4, !tbaa !15
  %208 = icmp ult i32 %206, %207
  br i1 %208, label %210, label %209

209:                                              ; preds = %205
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %231

210:                                              ; preds = %205
  %211 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %212 unwind label %227

212:                                              ; preds = %210
  %213 = load i32, ptr %23, align 4, !tbaa !15
  %214 = zext i32 %213 to i64
  %215 = getelementptr inbounds [21 x i8], ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 0, i64 %214
  %216 = load i8, ptr %215, align 1, !tbaa !16
  %217 = zext i8 %216 to i64
  %218 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %211, i64 noundef %217)
          to label %219 unwind label %227

219:                                              ; preds = %212
  %220 = load i8, ptr %218, align 1, !tbaa !16
  %221 = zext i8 %220 to i32
  %222 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %221, i32 noundef 3)
          to label %223 unwind label %227

223:                                              ; preds = %219
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %23, align 4, !tbaa !15
  %226 = add i32 %225, 1
  store i32 %226, ptr %23, align 4, !tbaa !15
  br label %205, !llvm.loop !23

227:                                              ; preds = %219, %212, %210
  %228 = landingpad { ptr, i32 }
          cleanup
  %229 = extractvalue { ptr, i32 } %228, 0
  store ptr %229, ptr %11, align 8
  %230 = extractvalue { ptr, i32 } %228, 1
  store i32 %230, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %310

231:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !15
  br label %232

232:                                              ; preds = %299, %231
  %233 = load i32, ptr %24, align 4, !tbaa !15
  %234 = invoke noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
          to label %235 unwind label %238

235:                                              ; preds = %232
  %236 = icmp ult i32 %233, %234
  br i1 %236, label %242, label %237

237:                                              ; preds = %235
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %304

238:                                              ; preds = %232
  %239 = landingpad { ptr, i32 }
          cleanup
  %240 = extractvalue { ptr, i32 } %239, 0
  store ptr %240, ptr %11, align 8
  %241 = extractvalue { ptr, i32 } %239, 1
  store i32 %241, ptr %12, align 4
  br label %303

242:                                              ; preds = %235
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  %243 = load i32, ptr %24, align 4, !tbaa !15
  %244 = zext i32 %243 to i64
  %245 = invoke noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %244)
          to label %246 unwind label %266

246:                                              ; preds = %242
  %247 = load i16, ptr %245, align 2, !tbaa !17
  %248 = zext i16 %247 to i32
  %249 = and i32 %248, 63
  store i32 %249, ptr %25, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %250 = load i32, ptr %24, align 4, !tbaa !15
  %251 = zext i32 %250 to i64
  %252 = invoke noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %251)
          to label %253 unwind label %270

253:                                              ; preds = %246
  %254 = load i16, ptr %252, align 2, !tbaa !17
  %255 = zext i16 %254 to i32
  %256 = ashr i32 %255, 6
  store i32 %256, ptr %26, align 4, !tbaa !15
  %257 = load i32, ptr %25, align 4, !tbaa !15
  %258 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_codeEjRKNS_22huffman_encoding_tableE(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %257, ptr noundef nonnull align 8 dereferenceable(32) %21)
          to label %259 unwind label %270

259:                                              ; preds = %253
  %260 = load i32, ptr %25, align 4, !tbaa !15
  %261 = icmp eq i32 %260, 17
  br i1 %261, label %262, label %274

262:                                              ; preds = %259
  %263 = load i32, ptr %26, align 4, !tbaa !15
  %264 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %263, i32 noundef 3)
          to label %265 unwind label %270

265:                                              ; preds = %262
  br label %298

266:                                              ; preds = %242
  %267 = landingpad { ptr, i32 }
          cleanup
  %268 = extractvalue { ptr, i32 } %267, 0
  store ptr %268, ptr %11, align 8
  %269 = extractvalue { ptr, i32 } %267, 1
  store i32 %269, ptr %12, align 4
  br label %302

270:                                              ; preds = %291, %284, %277, %262, %253, %246
  %271 = landingpad { ptr, i32 }
          cleanup
  %272 = extractvalue { ptr, i32 } %271, 0
  store ptr %272, ptr %11, align 8
  %273 = extractvalue { ptr, i32 } %271, 1
  store i32 %273, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %302

274:                                              ; preds = %259
  %275 = load i32, ptr %25, align 4, !tbaa !15
  %276 = icmp eq i32 %275, 18
  br i1 %276, label %277, label %281

277:                                              ; preds = %274
  %278 = load i32, ptr %26, align 4, !tbaa !15
  %279 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %278, i32 noundef 7)
          to label %280 unwind label %270

280:                                              ; preds = %277
  br label %297

281:                                              ; preds = %274
  %282 = load i32, ptr %25, align 4, !tbaa !15
  %283 = icmp eq i32 %282, 19
  br i1 %283, label %284, label %288

284:                                              ; preds = %281
  %285 = load i32, ptr %26, align 4, !tbaa !15
  %286 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %285, i32 noundef 2)
          to label %287 unwind label %270

287:                                              ; preds = %284
  br label %296

288:                                              ; preds = %281
  %289 = load i32, ptr %25, align 4, !tbaa !15
  %290 = icmp eq i32 %289, 20
  br i1 %290, label %291, label %295

291:                                              ; preds = %288
  %292 = load i32, ptr %26, align 4, !tbaa !15
  %293 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %292, i32 noundef 7)
          to label %294 unwind label %270

294:                                              ; preds = %291
  br label %295

295:                                              ; preds = %294, %288
  br label %296

296:                                              ; preds = %295, %287
  br label %297

297:                                              ; preds = %296, %280
  br label %298

298:                                              ; preds = %297, %265
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %299

299:                                              ; preds = %298
  %300 = load i32, ptr %24, align 4, !tbaa !15
  %301 = add i32 %300, 1
  store i32 %301, ptr %24, align 4, !tbaa !15
  br label %232, !llvm.loop !24

302:                                              ; preds = %270, %266
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %303

303:                                              ; preds = %302, %238
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %310

304:                                              ; preds = %237
  %305 = getelementptr inbounds %"class.basisu::bitwise_coder", ptr %27, i32 0, i32 3
  %306 = load i64, ptr %305, align 8, !tbaa !9
  %307 = load i64, ptr %6, align 8, !tbaa !14
  %308 = sub i64 %306, %307
  %309 = trunc i64 %308 to i32
  store i32 %309, ptr %3, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %311

310:                                              ; preds = %303, %227, %187
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %312

311:                                              ; preds = %304, %160
  call void @_ZN6basisu22huffman_encoding_tableD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  call void @_ZN6basisu9histogramD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @_ZN6basisu6vectorItED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %318

312:                                              ; preds = %310, %165
  call void @_ZN6basisu22huffman_encoding_tableD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %21) #5
  br label %313

313:                                              ; preds = %312, %161
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #5
  br label %314

314:                                              ; preds = %313, %140
  call void @_ZN6basisu9histogramD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #5
  br label %315

315:                                              ; preds = %314, %136
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #5
  br label %316

316:                                              ; preds = %315, %127
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %317

317:                                              ; preds = %316, %49
  call void @_ZN6basisu6vectorItED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %320

318:                                              ; preds = %311, %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %319 = load i32, ptr %3, align 4
  ret i32 %319

320:                                              ; preds = %317
  %321 = load ptr, ptr %11, align 8
  %322 = load i32, ptr %12, align 4
  %323 = insertvalue { ptr, i32 } poison, ptr %321, 0
  %324 = insertvalue { ptr, i32 } %323, i32 %322, 1
  resume { ptr, i32 } %324
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorItE7reserveEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu9histogram3incEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6basisu22huffman_encoding_table4initERKNS_9histogramEj(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu13bitwise_coder8put_codeEjRKNS_22huffman_encoding_tableE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu22huffman_encoding_tableD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 #4 = { inlinehint 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 #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, !13, i64 24}
!10 = !{!"_ZTSN6basisu13bitwise_coderE", !11, i64 0, !12, i64 16, !12, i64 20, !13, i64 24}
!11 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !12, i64 8, !12, i64 12}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"short", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}


; 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.basisu::vector.16" = type { ptr, i32, i32 }
%"class.basisu::histogram" = type { %"class.basisu::vector.18" }
%"class.basisu::vector.18" = type { ptr, i32, i32 }
%"class.basisu::huffman_encoding_table" = type { %"class.basisu::vector.16", %"class.basisu::vector.4" }
%"class.basisu::vector.4" = type { ptr, i32, i32 }

@.str.4 = external hidden unnamed_addr constant [110 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [39 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE = external hidden unnamed_addr constant [83 x i8], align 1
@_ZN6basisuL33g_huffman_sorted_codelength_codesE = external hidden local_unnamed_addr constant [21 x i8], align 16
@.str.23 = external hidden unnamed_addr constant [23 x i8], align 1
@switch.table._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE = private unnamed_addr constant [4 x i32] [i32 3, i32 7, i32 2, i32 7], align 4

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorItE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6basisu13bitwise_coder12end_zero_runERNS_6vectorItEERj(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.basisu::vector.16", align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i16, align 2
  %7 = alloca %"class.basisu::histogram", align 8
  %8 = alloca %"class.basisu::huffman_encoding_table", align 8
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %12 = tail call noundef i32 @_ZNK6basisu22huffman_encoding_table20get_total_used_codesEv(ptr noundef nonnull align 8 dereferenceable(32) %1)
  %13 = tail call noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %12, i32 noundef 14)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %229, label %14

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #5
  call void @_ZN6basisu6vectorItEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %15 = add i32 %12, 16
  %16 = zext i32 %15 to i64
  invoke void @_ZN6basisu6vectorItE7reserveEm(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %16)
          to label %17 unwind label %20

17:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 0, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  store i32 0, ptr %5, align 4, !tbaa !13
  br label %22

18:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  invoke void @_ZN6basisu9histogramC2Ej(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 21)
          to label %.preheader92 unwind label %60

.preheader92:                                     ; preds = %18
  %19 = call noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %.not102 = icmp eq i32 %19, 0
  br i1 %.not102, label %._crit_edge, label %.lr.ph

20:                                               ; preds = %14
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %228

22:                                               ; preds = %17, %57
  %.05895 = phi i32 [ 0, %17 ], [ %59, %57 ]
  %.05994 = phi i32 [ -1, %17 ], [ %58, %57 ]
  %23 = icmp eq i32 %.05895, %12
  br i1 %23, label %.thread88, label %24

24:                                               ; preds = %22
  %25 = zext i32 %.05895 to i64
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %25)
  %27 = load i8, ptr %26, align 1, !tbaa !14
  %28 = add i8 %27, 1
  %29 = icmp ult i8 %28, 18
  br i1 %29, label %33, label %30

30:                                               ; preds = %24
  call void @__assert_fail(ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.4, i32 noundef 1091, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE) #6
  unreachable

31:                                               ; preds = %56, %51, %50, %39, %.thread88
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %227

33:                                               ; preds = %24
  %34 = icmp eq i8 %27, -1
  %35 = zext i8 %27 to i32
  %.not81 = icmp eq i8 %27, 0
  br i1 %.not81, label %51, label %.thread88

.thread88:                                        ; preds = %22, %33
  %36 = phi i32 [ %35, %33 ], [ 255, %22 ]
  %37 = phi i1 [ %34, %33 ], [ true, %22 ]
  invoke void @_ZN6basisu13bitwise_coder12end_zero_runERNS_6vectorItEERj(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %38 unwind label %31

38:                                               ; preds = %.thread88
  %.not82 = icmp eq i32 %36, %.05994
  br i1 %.not82, label %46, label %39

39:                                               ; preds = %38
  invoke void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %.05994)
          to label %40 unwind label %31

40:                                               ; preds = %39
  br i1 %37, label %57, label %41

41:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %6) #5
  %42 = trunc nuw nsw i32 %36 to i16
  store i16 %42, ptr %6, align 2, !tbaa !15
  invoke void @_ZN6basisu6vectorItE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 2 dereferenceable(2) %6)
          to label %43 unwind label %44

43:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %6) #5
  br label %57

44:                                               ; preds = %41
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %6) #5
  br label %227

46:                                               ; preds = %38
  %47 = load i32, ptr %5, align 4, !tbaa !13
  %48 = add i32 %47, 1
  store i32 %48, ptr %5, align 4, !tbaa !13
  %49 = icmp eq i32 %48, 134
  br i1 %49, label %50, label %57

50:                                               ; preds = %46
  invoke void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %.05994)
          to label %57 unwind label %31

51:                                               ; preds = %33
  invoke void @_ZN6basisu13bitwise_coder15end_nonzero_runERNS_6vectorItEERjj(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef %.05994)
          to label %52 unwind label %31

52:                                               ; preds = %51
  %53 = load i32, ptr %4, align 4, !tbaa !13
  %54 = add i32 %53, 1
  store i32 %54, ptr %4, align 4, !tbaa !13
  %55 = icmp eq i32 %54, 138
  br i1 %55, label %56, label %57

56:                                               ; preds = %52
  invoke void @_ZN6basisu13bitwise_coder12end_zero_runERNS_6vectorItEERj(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %57 unwind label %31

57:                                               ; preds = %52, %56, %43, %40, %50, %46
  %58 = phi i32 [ 0, %52 ], [ 0, %56 ], [ %36, %43 ], [ %36, %40 ], [ %.05994, %50 ], [ %.05994, %46 ]
  %59 = add i32 %.05895, 1
  %.not71 = icmp ugt i32 %59, %12
  br i1 %.not71, label %18, label %22, !llvm.loop !17

._crit_edge:                                      ; preds = %68, %.preheader92
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #5
  invoke void @_ZN6basisu22huffman_encoding_tableC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %72 unwind label %80

60:                                               ; preds = %18
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %226

62:                                               ; preds = %.lr.ph
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %225

.lr.ph:                                           ; preds = %.preheader92, %68
  %indvars.iv = phi i64 [ %indvars.iv.next, %68 ], [ 0, %.preheader92 ]
  %64 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %indvars.iv)
  %65 = load i16, ptr %64, align 2, !tbaa !15
  %66 = and i16 %65, 63
  %67 = zext nneg i16 %66 to i32
  invoke void @_ZN6basisu9histogram3incEj(ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef %67)
          to label %68 unwind label %62

68:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %69 = call noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %70 = zext i32 %69 to i64
  %71 = icmp ult i64 %indvars.iv.next, %70
  br i1 %71, label %.lr.ph, label %._crit_edge, !llvm.loop !19

72:                                               ; preds = %._crit_edge
  %73 = invoke noundef zeroext i1 @_ZN6basisu22huffman_encoding_table4initERKNS_9histogramEj(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(16) %7, i32 noundef 7)
          to label %74 unwind label %82

74:                                               ; preds = %72
  br i1 %73, label %.preheader91.preheader, label %222

.preheader91.preheader:                           ; preds = %74
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %76 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 20), align 4, !tbaa !14
  %77 = zext i8 %76 to i64
  %78 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %75, i64 noundef %77)
  %79 = load i8, ptr %78, align 1, !tbaa !14
  %.not73 = icmp eq i8 %79, 0
  br i1 %.not73, label %.preheader91.1, label %186, !llvm.loop !20

80:                                               ; preds = %._crit_edge
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %224

82:                                               ; preds = %72
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %223

.preheader91.1:                                   ; preds = %.preheader91.preheader
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %85 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 19), align 1, !tbaa !14
  %86 = zext i8 %85 to i64
  %87 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %84, i64 noundef %86)
  %88 = load i8, ptr %87, align 1, !tbaa !14
  %.not73.1 = icmp eq i8 %88, 0
  br i1 %.not73.1, label %.preheader91.2, label %186, !llvm.loop !20

.preheader91.2:                                   ; preds = %.preheader91.1
  %89 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %90 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 18), align 2, !tbaa !14
  %91 = zext i8 %90 to i64
  %92 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %89, i64 noundef %91)
  %93 = load i8, ptr %92, align 1, !tbaa !14
  %.not73.2 = icmp eq i8 %93, 0
  br i1 %.not73.2, label %.preheader91.3, label %186, !llvm.loop !20

.preheader91.3:                                   ; preds = %.preheader91.2
  %94 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %95 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 17), align 1, !tbaa !14
  %96 = zext i8 %95 to i64
  %97 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %94, i64 noundef %96)
  %98 = load i8, ptr %97, align 1, !tbaa !14
  %.not73.3 = icmp eq i8 %98, 0
  br i1 %.not73.3, label %.preheader91.4, label %186, !llvm.loop !20

.preheader91.4:                                   ; preds = %.preheader91.3
  %99 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %100 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 16), align 16, !tbaa !14
  %101 = zext i8 %100 to i64
  %102 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %99, i64 noundef %101)
  %103 = load i8, ptr %102, align 1, !tbaa !14
  %.not73.4 = icmp eq i8 %103, 0
  br i1 %.not73.4, label %.preheader91.5, label %186, !llvm.loop !20

.preheader91.5:                                   ; preds = %.preheader91.4
  %104 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %105 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 15), align 1, !tbaa !14
  %106 = zext i8 %105 to i64
  %107 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %104, i64 noundef %106)
  %108 = load i8, ptr %107, align 1, !tbaa !14
  %.not73.5 = icmp eq i8 %108, 0
  br i1 %.not73.5, label %.preheader91.6, label %186, !llvm.loop !20

.preheader91.6:                                   ; preds = %.preheader91.5
  %109 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %110 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 14), align 2, !tbaa !14
  %111 = zext i8 %110 to i64
  %112 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %109, i64 noundef %111)
  %113 = load i8, ptr %112, align 1, !tbaa !14
  %.not73.6 = icmp eq i8 %113, 0
  br i1 %.not73.6, label %.preheader91.7, label %186, !llvm.loop !20

.preheader91.7:                                   ; preds = %.preheader91.6
  %114 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %115 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 13), align 1, !tbaa !14
  %116 = zext i8 %115 to i64
  %117 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %114, i64 noundef %116)
  %118 = load i8, ptr %117, align 1, !tbaa !14
  %.not73.7 = icmp eq i8 %118, 0
  br i1 %.not73.7, label %.preheader91.8, label %186, !llvm.loop !20

.preheader91.8:                                   ; preds = %.preheader91.7
  %119 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %120 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 12), align 4, !tbaa !14
  %121 = zext i8 %120 to i64
  %122 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %119, i64 noundef %121)
  %123 = load i8, ptr %122, align 1, !tbaa !14
  %.not73.8 = icmp eq i8 %123, 0
  br i1 %.not73.8, label %.preheader91.9, label %186, !llvm.loop !20

.preheader91.9:                                   ; preds = %.preheader91.8
  %124 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %125 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 11), align 1, !tbaa !14
  %126 = zext i8 %125 to i64
  %127 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %124, i64 noundef %126)
  %128 = load i8, ptr %127, align 1, !tbaa !14
  %.not73.9 = icmp eq i8 %128, 0
  br i1 %.not73.9, label %.preheader91.10, label %186, !llvm.loop !20

.preheader91.10:                                  ; preds = %.preheader91.9
  %129 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %130 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 10), align 2, !tbaa !14
  %131 = zext i8 %130 to i64
  %132 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %129, i64 noundef %131)
  %133 = load i8, ptr %132, align 1, !tbaa !14
  %.not73.10 = icmp eq i8 %133, 0
  br i1 %.not73.10, label %.preheader91.11, label %186, !llvm.loop !20

.preheader91.11:                                  ; preds = %.preheader91.10
  %134 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %135 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 9), align 1, !tbaa !14
  %136 = zext i8 %135 to i64
  %137 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %134, i64 noundef %136)
  %138 = load i8, ptr %137, align 1, !tbaa !14
  %.not73.11 = icmp eq i8 %138, 0
  br i1 %.not73.11, label %.preheader91.12, label %186, !llvm.loop !20

.preheader91.12:                                  ; preds = %.preheader91.11
  %139 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %140 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 8), align 8, !tbaa !14
  %141 = zext i8 %140 to i64
  %142 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %139, i64 noundef %141)
  %143 = load i8, ptr %142, align 1, !tbaa !14
  %.not73.12 = icmp eq i8 %143, 0
  br i1 %.not73.12, label %.preheader91.13, label %186, !llvm.loop !20

.preheader91.13:                                  ; preds = %.preheader91.12
  %144 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %145 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 7), align 1, !tbaa !14
  %146 = zext i8 %145 to i64
  %147 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %144, i64 noundef %146)
  %148 = load i8, ptr %147, align 1, !tbaa !14
  %.not73.13 = icmp eq i8 %148, 0
  br i1 %.not73.13, label %.preheader91.14, label %186, !llvm.loop !20

.preheader91.14:                                  ; preds = %.preheader91.13
  %149 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %150 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 6), align 2, !tbaa !14
  %151 = zext i8 %150 to i64
  %152 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %149, i64 noundef %151)
  %153 = load i8, ptr %152, align 1, !tbaa !14
  %.not73.14 = icmp eq i8 %153, 0
  br i1 %.not73.14, label %.preheader91.15, label %186, !llvm.loop !20

.preheader91.15:                                  ; preds = %.preheader91.14
  %154 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %155 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 5), align 1, !tbaa !14
  %156 = zext i8 %155 to i64
  %157 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %154, i64 noundef %156)
  %158 = load i8, ptr %157, align 1, !tbaa !14
  %.not73.15 = icmp eq i8 %158, 0
  br i1 %.not73.15, label %.preheader91.16, label %186, !llvm.loop !20

.preheader91.16:                                  ; preds = %.preheader91.15
  %159 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %160 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 4), align 4, !tbaa !14
  %161 = zext i8 %160 to i64
  %162 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %159, i64 noundef %161)
  %163 = load i8, ptr %162, align 1, !tbaa !14
  %.not73.16 = icmp eq i8 %163, 0
  br i1 %.not73.16, label %.preheader91.17, label %186, !llvm.loop !20

.preheader91.17:                                  ; preds = %.preheader91.16
  %164 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %165 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 3), align 1, !tbaa !14
  %166 = zext i8 %165 to i64
  %167 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %164, i64 noundef %166)
  %168 = load i8, ptr %167, align 1, !tbaa !14
  %.not73.17 = icmp eq i8 %168, 0
  br i1 %.not73.17, label %.preheader91.18, label %186, !llvm.loop !20

.preheader91.18:                                  ; preds = %.preheader91.17
  %169 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %170 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 2), align 2, !tbaa !14
  %171 = zext i8 %170 to i64
  %172 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %169, i64 noundef %171)
  %173 = load i8, ptr %172, align 1, !tbaa !14
  %.not73.18 = icmp eq i8 %173, 0
  br i1 %.not73.18, label %.preheader91.19, label %186, !llvm.loop !20

.preheader91.19:                                  ; preds = %.preheader91.18
  %174 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %175 = load i8, ptr getelementptr inbounds (i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 1), align 1, !tbaa !14
  %176 = zext i8 %175 to i64
  %177 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %174, i64 noundef %176)
  %178 = load i8, ptr %177, align 1, !tbaa !14
  %.not73.19 = icmp eq i8 %178, 0
  br i1 %.not73.19, label %.preheader91.20, label %186, !llvm.loop !20

.preheader91.20:                                  ; preds = %.preheader91.19
  %179 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %180 = load i8, ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, align 16, !tbaa !14
  %181 = zext i8 %180 to i64
  %182 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %179, i64 noundef %181)
  %183 = load i8, ptr %182, align 1, !tbaa !14
  %.not73.20 = icmp eq i8 %183, 0
  br i1 %.not73.20, label %.preheader91.21, label %186, !llvm.loop !20

184:                                              ; preds = %186
  %185 = landingpad { ptr, i32 }
          cleanup
  br label %223

.preheader91.21:                                  ; preds = %.preheader91.20
  call void @__assert_fail(ptr noundef nonnull @.str.23, ptr noundef nonnull @.str.4, i32 noundef 1132, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE) #6
  unreachable

186:                                              ; preds = %.preheader91.20, %.preheader91.19, %.preheader91.18, %.preheader91.17, %.preheader91.16, %.preheader91.15, %.preheader91.14, %.preheader91.13, %.preheader91.12, %.preheader91.11, %.preheader91.10, %.preheader91.9, %.preheader91.8, %.preheader91.7, %.preheader91.6, %.preheader91.5, %.preheader91.4, %.preheader91.3, %.preheader91.2, %.preheader91.1, %.preheader91.preheader
  %.054.lcssa104.wide = phi i32 [ 21, %.preheader91.preheader ], [ 20, %.preheader91.1 ], [ 19, %.preheader91.2 ], [ 18, %.preheader91.3 ], [ 17, %.preheader91.4 ], [ 16, %.preheader91.5 ], [ 15, %.preheader91.6 ], [ 14, %.preheader91.7 ], [ 13, %.preheader91.8 ], [ 12, %.preheader91.9 ], [ 11, %.preheader91.10 ], [ 10, %.preheader91.11 ], [ 9, %.preheader91.12 ], [ 8, %.preheader91.13 ], [ 7, %.preheader91.14 ], [ 6, %.preheader91.15 ], [ 5, %.preheader91.16 ], [ 4, %.preheader91.17 ], [ 3, %.preheader91.18 ], [ 2, %.preheader91.19 ], [ 1, %.preheader91.20 ]
  %187 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.054.lcssa104.wide, i32 noundef 5)
          to label %.preheader90.preheader unwind label %184

.preheader90.preheader:                           ; preds = %186
  %wide.trip.count = zext nneg i32 %.054.lcssa104.wide to i64
  br label %.preheader90

.preheader:                                       ; preds = %197
  %188 = call noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %.not103 = icmp eq i32 %188, 0
  br i1 %.not103, label %._crit_edge101, label %.lr.ph100

.preheader90:                                     ; preds = %.preheader90.preheader, %197
  %indvars.iv109 = phi i64 [ 0, %.preheader90.preheader ], [ %indvars.iv.next110, %197 ]
  %189 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32) %8)
  %190 = getelementptr inbounds [21 x i8], ptr @_ZN6basisuL33g_huffman_sorted_codelength_codesE, i64 0, i64 %indvars.iv109
  %191 = load i8, ptr %190, align 1, !tbaa !14
  %192 = zext i8 %191 to i64
  %193 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16) %189, i64 noundef %192)
  %194 = load i8, ptr %193, align 1, !tbaa !14
  %195 = zext i8 %194 to i32
  %196 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %195, i32 noundef 3)
          to label %197 unwind label %198

197:                                              ; preds = %.preheader90
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.preheader90, !llvm.loop !21

198:                                              ; preds = %.preheader90
  %199 = landingpad { ptr, i32 }
          cleanup
  br label %223

._crit_edge101:                                   ; preds = %218, %.preheader
  %200 = load i64, ptr %9, align 8, !tbaa !5
  %201 = sub i64 %200, %10
  %202 = trunc i64 %201 to i32
  br label %222

.lr.ph100:                                        ; preds = %.preheader, %218
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %218 ], [ 0, %.preheader ]
  %203 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %indvars.iv112)
  %204 = load i16, ptr %203, align 2, !tbaa !15
  %205 = and i16 %204, 63
  %206 = zext nneg i16 %205 to i32
  %207 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %indvars.iv112)
  %208 = load i16, ptr %207, align 2, !tbaa !15
  %209 = lshr i16 %208, 6
  %210 = zext nneg i16 %209 to i32
  %211 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_codeEjRKNS_22huffman_encoding_tableE(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %206, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %212 unwind label %214

212:                                              ; preds = %.lr.ph100
  %switch.tableidx = add nsw i16 %205, -17
  %213 = icmp ult i16 %switch.tableidx, 4
  br i1 %213, label %switch.lookup, label %218

214:                                              ; preds = %switch.lookup, %.lr.ph100
  %215 = landingpad { ptr, i32 }
          cleanup
  br label %223

switch.lookup:                                    ; preds = %212
  %216 = zext nneg i16 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [4 x i32], ptr @switch.table._ZN6basisu13bitwise_coder18emit_huffman_tableERKNS_22huffman_encoding_tableE, i64 0, i64 %216
  %switch.load = load i32, ptr %switch.gep, align 4
  %217 = invoke noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %210, i32 noundef %switch.load)
          to label %218 unwind label %214

218:                                              ; preds = %212, %switch.lookup
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %219 = call noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  %220 = zext i32 %219 to i64
  %221 = icmp ult i64 %indvars.iv.next113, %220
  br i1 %221, label %.lr.ph100, label %._crit_edge101, !llvm.loop !22

222:                                              ; preds = %74, %._crit_edge101
  %.0 = phi i32 [ %202, %._crit_edge101 ], [ 0, %74 ]
  call void @_ZN6basisu22huffman_encoding_tableD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  call void @_ZN6basisu9histogramD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @_ZN6basisu6vectorItED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  br label %229

223:                                              ; preds = %184, %198, %214, %82
  %.pn.pn = phi { ptr, i32 } [ %83, %82 ], [ %199, %198 ], [ %215, %214 ], [ %185, %184 ]
  call void @_ZN6basisu22huffman_encoding_tableD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #5
  br label %224

224:                                              ; preds = %223, %80
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %223 ], [ %81, %80 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #5
  br label %225

225:                                              ; preds = %224, %62
  %.pn78 = phi { ptr, i32 } [ %63, %62 ], [ %.pn.pn.pn, %224 ]
  call void @_ZN6basisu9histogramD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #5
  br label %226

226:                                              ; preds = %225, %60
  %.pn78.pn = phi { ptr, i32 } [ %.pn78, %225 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  br label %227

227:                                              ; preds = %31, %44, %226
  %.pn84.pn = phi { ptr, i32 } [ %.pn78.pn, %226 ], [ %45, %44 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  br label %228

228:                                              ; preds = %227, %20
  %.pn84.pn.pn = phi { ptr, i32 } [ %.pn84.pn, %227 ], [ %21, %20 ]
  call void @_ZN6basisu6vectorItED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn84.pn.pn

229:                                              ; preds = %2, %222
  %.1 = phi i32 [ %.0, %222 ], [ 0, %2 ]
  ret i32 %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNK6basisu22huffman_encoding_table14get_code_sizesEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK6basisu22huffman_encoding_table20get_total_used_codesEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu13bitwise_coder8put_bitsEjj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, i32 noundef) local_unnamed_addr #4 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorItE7reserveEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNK6basisu6vectorIhEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK6basisu6vectorItE4sizeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu9histogram3incEj(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #4 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6basisu13bitwise_coder8put_codeEjRKNS_22huffman_encoding_tableE(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu22huffman_encoding_tableD2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 #4 = { inlinehint 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 #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, !12, i64 24}
!6 = !{!"_ZTSN6basisu13bitwise_coderE", !7, i64 0, !11, i64 16, !11, i64 20, !12, i64 24}
!7 = !{!"_ZTSN6basisu6vectorIhEE", !8, i64 0, !11, i64 8, !11, i64 12}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"long", !9, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!9, !9, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"short", !9, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass