; LLVM IR from intel/qpl :: sources/middle-layer/compression/deflate/containers (huffman_table)

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

%"struct.std::array.5" = type { [29 x i32] }
%"struct.std::array.6" = type { [30 x i32] }
%struct.rl_code = type { i8, i8 }
%struct.hufftables_icf = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { [31 x %struct.huff_code], [513 x %struct.huff_code] }
%struct.huff_code = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { i32 }
%struct.isal_mod_hist = type { [30 x i32], [513 x i32] }
%struct.anon.2 = type { i16, i8, i8 }
%"class.qpl::ml::compression::huffman_table_icf" = type { ptr, i32, i32 }
%struct.BitBuf2 = type { i64, i32, ptr, ptr, ptr }

@_ZN3qpl2ml11compressionL22length_code_extra_bitsE = external hidden constant %"struct.std::array.5", align 4
@_ZN3qpl2ml11compressionL24distance_code_extra_bitsE = external hidden constant %"struct.std::array.6", align 4
@_ZN3qpl2ml11compressionL16fixed_hufftablesE = external hidden global { { { [31 x { { { i8, i8, i8, i8 } } }], <{ [288 x { { { i8, i8, i8, i8 } } }], [225 x { { { i8, i8, i8, i8 } } }] }> } } }, align 4

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZN3qpl2ml11compression23write_huffman_table_icfEP7BitBuf2RNS1_17huffman_table_icfEP13isal_mod_histNS1_18compression_mode_tEj(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef %2, i8 noundef zeroext %3, i32 noundef %4) #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca [316 x %struct.rl_code], align 16
  %14 = alloca [19 x i64], align 16
  %15 = alloca [316 x i16], align 16
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i8 %3, ptr %9, align 1, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 632, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 152, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 632, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 3, ptr %17, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNK3qpl2ml11compression17huffman_table_icf23get_isal_huffman_tablesEv(ptr noundef nonnull align 8 dereferenceable(16) %25) #7
  %27 = getelementptr inbounds %struct.hufftables_icf, ptr %26, i32 0, i32 0
  %28 = getelementptr inbounds %struct.anon, ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds [513 x %struct.huff_code], ptr %28, i64 0, i64 0
  store ptr %29, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = call noundef ptr @_ZNK3qpl2ml11compression17huffman_table_icf23get_isal_huffman_tablesEv(ptr noundef nonnull align 8 dereferenceable(16) %30) #7
  %32 = getelementptr inbounds %struct.hufftables_icf, ptr %31, i32 0, i32 0
  %33 = getelementptr inbounds %struct.anon, ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds [31 x %struct.huff_code], ptr %33, i64 0, i64 0
  store ptr %34, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.isal_mod_hist, ptr %35, i32 0, i32 1
  %37 = getelementptr inbounds [513 x i32], ptr %36, i64 0, i64 0
  store ptr %37, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.isal_mod_hist, ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds [30 x i32], ptr %39, i64 0, i64 0
  store ptr %40, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store ptr getelementptr inbounds (%struct.anon, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i32 0, i32 1), ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, ptr %23, align 8, !tbaa !5
  %41 = getelementptr inbounds [19 x i64], ptr %14, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %41, i8 0, i64 152, i1 false)
  %42 = load i8, ptr %9, align 1, !tbaa !9
  %43 = zext i8 %42 to i32
  %44 = icmp ne i32 %43, 1
  br i1 %44, label %45, label %244

45:                                               ; preds = %5
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %46

46:                                               ; preds = %95, %45
  %47 = load i32, ptr %12, align 4, !tbaa !11
  %48 = icmp ult i32 %47, 257
  br i1 %48, label %49, label %98

49:                                               ; preds = %46
  %50 = load ptr, ptr %18, align 8, !tbaa !5
  %51 = load i32, ptr %12, align 4, !tbaa !11
  %52 = zext i32 %51 to i64
  %53 = getelementptr inbounds %struct.huff_code, ptr %50, i64 %52
  %54 = getelementptr inbounds %struct.huff_code, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %struct.anon.2, ptr %54, i32 0, i32 2
  %56 = load i8, ptr %55, align 1, !tbaa !15
  %57 = zext i8 %56 to i16
  %58 = load i32, ptr %12, align 4, !tbaa !11
  %59 = zext i32 %58 to i64
  %60 = getelementptr inbounds [316 x i16], ptr %15, i64 0, i64 %59
  store i16 %57, ptr %60, align 2, !tbaa !16
  %61 = load ptr, ptr %18, align 8, !tbaa !5
  %62 = load i32, ptr %12, align 4, !tbaa !11
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds %struct.huff_code, ptr %61, i64 %63
  %65 = getelementptr inbounds %struct.huff_code, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.anon.2, ptr %65, i32 0, i32 2
  %67 = load i8, ptr %66, align 1, !tbaa !15
  %68 = zext i8 %67 to i32
  %69 = load ptr, ptr %20, align 8, !tbaa !5
  %70 = load i32, ptr %12, align 4, !tbaa !11
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr %69, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !11
  %74 = mul i32 %68, %73
  %75 = zext i32 %74 to i64
  %76 = load i64, ptr %16, align 8, !tbaa !13
  %77 = add i64 %76, %75
  store i64 %77, ptr %16, align 8, !tbaa !13
  %78 = load ptr, ptr %22, align 8, !tbaa !5
  %79 = load i32, ptr %12, align 4, !tbaa !11
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds %struct.huff_code, ptr %78, i64 %80
  %82 = getelementptr inbounds %struct.huff_code, ptr %81, i32 0, i32 0
  %83 = getelementptr inbounds %struct.anon.2, ptr %82, i32 0, i32 2
  %84 = load i8, ptr %83, align 1, !tbaa !15
  %85 = zext i8 %84 to i32
  %86 = load ptr, ptr %20, align 8, !tbaa !5
  %87 = load i32, ptr %12, align 4, !tbaa !11
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %86, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = mul i32 %85, %90
  %92 = zext i32 %91 to i64
  %93 = load i64, ptr %17, align 8, !tbaa !13
  %94 = add i64 %93, %92
  store i64 %94, ptr %17, align 8, !tbaa !13
  br label %95

95:                                               ; preds = %49
  %96 = load i32, ptr %12, align 4, !tbaa !11
  %97 = add i32 %96, 1
  store i32 %97, ptr %12, align 4, !tbaa !11
  br label %46, !llvm.loop !18

98:                                               ; preds = %46
  br label %99

99:                                               ; preds = %166, %98
  %100 = load i32, ptr %12, align 4, !tbaa !11
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %101, i32 0, i32 1
  %103 = load i32, ptr %102, align 8, !tbaa !20
  %104 = add i32 %103, 1
  %105 = icmp ult i32 %100, %104
  br i1 %105, label %106, label %169

106:                                              ; preds = %99
  %107 = load ptr, ptr %18, align 8, !tbaa !5
  %108 = load i32, ptr %12, align 4, !tbaa !11
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds %struct.huff_code, ptr %107, i64 %109
  %111 = getelementptr inbounds %struct.huff_code, ptr %110, i32 0, i32 0
  %112 = getelementptr inbounds %struct.anon.2, ptr %111, i32 0, i32 2
  %113 = load i8, ptr %112, align 1, !tbaa !15
  %114 = zext i8 %113 to i16
  %115 = load i32, ptr %12, align 4, !tbaa !11
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds [316 x i16], ptr %15, i64 0, i64 %116
  store i16 %114, ptr %117, align 2, !tbaa !16
  %118 = load ptr, ptr %18, align 8, !tbaa !5
  %119 = load i32, ptr %12, align 4, !tbaa !11
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds %struct.huff_code, ptr %118, i64 %120
  %122 = getelementptr inbounds %struct.huff_code, ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %struct.anon.2, ptr %122, i32 0, i32 2
  %124 = load i8, ptr %123, align 1, !tbaa !15
  %125 = zext i8 %124 to i32
  %126 = load i32, ptr %12, align 4, !tbaa !11
  %127 = sub i32 %126, 257
  %128 = zext i32 %127 to i64
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116) @_ZN3qpl2ml11compressionL22length_code_extra_bitsE, i64 noundef %128) #7
  %130 = load i32, ptr %129, align 4, !tbaa !11
  %131 = add i32 %125, %130
  %132 = zext i32 %131 to i64
  %133 = load ptr, ptr %20, align 8, !tbaa !5
  %134 = load i32, ptr %12, align 4, !tbaa !11
  %135 = zext i32 %134 to i64
  %136 = getelementptr inbounds i32, ptr %133, i64 %135
  %137 = load i32, ptr %136, align 4, !tbaa !11
  %138 = zext i32 %137 to i64
  %139 = mul i64 %132, %138
  %140 = load i64, ptr %16, align 8, !tbaa !13
  %141 = add i64 %140, %139
  store i64 %141, ptr %16, align 8, !tbaa !13
  %142 = load ptr, ptr %22, align 8, !tbaa !5
  %143 = load i32, ptr %12, align 4, !tbaa !11
  %144 = zext i32 %143 to i64
  %145 = getelementptr inbounds %struct.huff_code, ptr %142, i64 %144
  %146 = getelementptr inbounds %struct.huff_code, ptr %145, i32 0, i32 0
  %147 = getelementptr inbounds %struct.anon.2, ptr %146, i32 0, i32 2
  %148 = load i8, ptr %147, align 1, !tbaa !15
  %149 = zext i8 %148 to i32
  %150 = load i32, ptr %12, align 4, !tbaa !11
  %151 = sub i32 %150, 257
  %152 = zext i32 %151 to i64
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116) @_ZN3qpl2ml11compressionL22length_code_extra_bitsE, i64 noundef %152) #7
  %154 = load i32, ptr %153, align 4, !tbaa !11
  %155 = add i32 %149, %154
  %156 = zext i32 %155 to i64
  %157 = load ptr, ptr %20, align 8, !tbaa !5
  %158 = load i32, ptr %12, align 4, !tbaa !11
  %159 = zext i32 %158 to i64
  %160 = getelementptr inbounds i32, ptr %157, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !11
  %162 = zext i32 %161 to i64
  %163 = mul i64 %156, %162
  %164 = load i64, ptr %17, align 8, !tbaa !13
  %165 = add i64 %164, %163
  store i64 %165, ptr %17, align 8, !tbaa !13
  br label %166

166:                                              ; preds = %106
  %167 = load i32, ptr %12, align 4, !tbaa !11
  %168 = add i32 %167, 1
  store i32 %168, ptr %12, align 4, !tbaa !11
  br label %99, !llvm.loop !22

169:                                              ; preds = %99
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %170

170:                                              ; preds = %240, %169
  %171 = load i32, ptr %12, align 4, !tbaa !11
  %172 = load ptr, ptr %7, align 8, !tbaa !5
  %173 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 4, !tbaa !23
  %175 = add i32 %174, 1
  %176 = icmp ult i32 %171, %175
  br i1 %176, label %177, label %243

177:                                              ; preds = %170
  %178 = load ptr, ptr %19, align 8, !tbaa !5
  %179 = load i32, ptr %12, align 4, !tbaa !11
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds %struct.huff_code, ptr %178, i64 %180
  %182 = getelementptr inbounds %struct.huff_code, ptr %181, i32 0, i32 0
  %183 = getelementptr inbounds %struct.anon.2, ptr %182, i32 0, i32 2
  %184 = load i8, ptr %183, align 1, !tbaa !15
  %185 = zext i8 %184 to i16
  %186 = load i32, ptr %12, align 4, !tbaa !11
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %187, i32 0, i32 1
  %189 = load i32, ptr %188, align 8, !tbaa !20
  %190 = add i32 %186, %189
  %191 = add i32 %190, 1
  %192 = zext i32 %191 to i64
  %193 = getelementptr inbounds [316 x i16], ptr %15, i64 0, i64 %192
  store i16 %185, ptr %193, align 2, !tbaa !16
  %194 = load ptr, ptr %19, align 8, !tbaa !5
  %195 = load i32, ptr %12, align 4, !tbaa !11
  %196 = zext i32 %195 to i64
  %197 = getelementptr inbounds %struct.huff_code, ptr %194, i64 %196
  %198 = getelementptr inbounds %struct.huff_code, ptr %197, i32 0, i32 0
  %199 = getelementptr inbounds %struct.anon.2, ptr %198, i32 0, i32 2
  %200 = load i8, ptr %199, align 1, !tbaa !15
  %201 = zext i8 %200 to i32
  %202 = load i32, ptr %12, align 4, !tbaa !11
  %203 = zext i32 %202 to i64
  %204 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120) @_ZN3qpl2ml11compressionL24distance_code_extra_bitsE, i64 noundef %203) #7
  %205 = load i32, ptr %204, align 4, !tbaa !11
  %206 = add i32 %201, %205
  %207 = zext i32 %206 to i64
  %208 = load ptr, ptr %21, align 8, !tbaa !5
  %209 = load i32, ptr %12, align 4, !tbaa !11
  %210 = zext i32 %209 to i64
  %211 = getelementptr inbounds i32, ptr %208, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !11
  %213 = zext i32 %212 to i64
  %214 = mul i64 %207, %213
  %215 = load i64, ptr %16, align 8, !tbaa !13
  %216 = add i64 %215, %214
  store i64 %216, ptr %16, align 8, !tbaa !13
  %217 = load ptr, ptr %23, align 8, !tbaa !5
  %218 = load i32, ptr %12, align 4, !tbaa !11
  %219 = zext i32 %218 to i64
  %220 = getelementptr inbounds %struct.huff_code, ptr %217, i64 %219
  %221 = getelementptr inbounds %struct.huff_code, ptr %220, i32 0, i32 0
  %222 = getelementptr inbounds %struct.anon.2, ptr %221, i32 0, i32 2
  %223 = load i8, ptr %222, align 1, !tbaa !15
  %224 = zext i8 %223 to i32
  %225 = load i32, ptr %12, align 4, !tbaa !11
  %226 = zext i32 %225 to i64
  %227 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120) @_ZN3qpl2ml11compressionL24distance_code_extra_bitsE, i64 noundef %226) #7
  %228 = load i32, ptr %227, align 4, !tbaa !11
  %229 = add i32 %224, %228
  %230 = zext i32 %229 to i64
  %231 = load ptr, ptr %21, align 8, !tbaa !5
  %232 = load i32, ptr %12, align 4, !tbaa !11
  %233 = zext i32 %232 to i64
  %234 = getelementptr inbounds i32, ptr %231, i64 %233
  %235 = load i32, ptr %234, align 4, !tbaa !11
  %236 = zext i32 %235 to i64
  %237 = mul i64 %230, %236
  %238 = load i64, ptr %17, align 8, !tbaa !13
  %239 = add i64 %238, %237
  store i64 %239, ptr %17, align 8, !tbaa !13
  br label %240

240:                                              ; preds = %177
  %241 = load i32, ptr %12, align 4, !tbaa !11
  %242 = add i32 %241, 1
  store i32 %242, ptr %12, align 4, !tbaa !11
  br label %170, !llvm.loop !24

243:                                              ; preds = %170
  br label %345

244:                                              ; preds = %5
  %245 = load ptr, ptr %7, align 8, !tbaa !5
  %246 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %245, i32 0, i32 1
  store i32 285, ptr %246, align 8, !tbaa !20
  %247 = load ptr, ptr %7, align 8, !tbaa !5
  %248 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %247, i32 0, i32 2
  store i32 29, ptr %248, align 4, !tbaa !23
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %249

249:                                              ; preds = %270, %244
  %250 = load i32, ptr %12, align 4, !tbaa !11
  %251 = icmp ule i32 %250, 256
  br i1 %251, label %252, label %273

252:                                              ; preds = %249
  %253 = load ptr, ptr %22, align 8, !tbaa !5
  %254 = load i32, ptr %12, align 4, !tbaa !11
  %255 = zext i32 %254 to i64
  %256 = getelementptr inbounds %struct.huff_code, ptr %253, i64 %255
  %257 = getelementptr inbounds %struct.huff_code, ptr %256, i32 0, i32 0
  %258 = getelementptr inbounds %struct.anon.2, ptr %257, i32 0, i32 2
  %259 = load i8, ptr %258, align 1, !tbaa !15
  %260 = zext i8 %259 to i32
  %261 = load ptr, ptr %20, align 8, !tbaa !5
  %262 = load i32, ptr %12, align 4, !tbaa !11
  %263 = zext i32 %262 to i64
  %264 = getelementptr inbounds i32, ptr %261, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !11
  %266 = mul i32 %260, %265
  %267 = zext i32 %266 to i64
  %268 = load i64, ptr %17, align 8, !tbaa !13
  %269 = add i64 %268, %267
  store i64 %269, ptr %17, align 8, !tbaa !13
  br label %270

270:                                              ; preds = %252
  %271 = load i32, ptr %12, align 4, !tbaa !11
  %272 = add i32 %271, 1
  store i32 %272, ptr %12, align 4, !tbaa !11
  br label %249, !llvm.loop !25

273:                                              ; preds = %249
  br label %274

274:                                              ; preds = %306, %273
  %275 = load i32, ptr %12, align 4, !tbaa !11
  %276 = load ptr, ptr %7, align 8, !tbaa !5
  %277 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %276, i32 0, i32 1
  %278 = load i32, ptr %277, align 8, !tbaa !20
  %279 = add i32 %278, 1
  %280 = icmp ult i32 %275, %279
  br i1 %280, label %281, label %309

281:                                              ; preds = %274
  %282 = load ptr, ptr %22, align 8, !tbaa !5
  %283 = load i32, ptr %12, align 4, !tbaa !11
  %284 = zext i32 %283 to i64
  %285 = getelementptr inbounds %struct.huff_code, ptr %282, i64 %284
  %286 = getelementptr inbounds %struct.huff_code, ptr %285, i32 0, i32 0
  %287 = getelementptr inbounds %struct.anon.2, ptr %286, i32 0, i32 2
  %288 = load i8, ptr %287, align 1, !tbaa !15
  %289 = zext i8 %288 to i32
  %290 = load i32, ptr %12, align 4, !tbaa !11
  %291 = sub i32 %290, 257
  %292 = zext i32 %291 to i64
  %293 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116) @_ZN3qpl2ml11compressionL22length_code_extra_bitsE, i64 noundef %292) #7
  %294 = load i32, ptr %293, align 4, !tbaa !11
  %295 = add i32 %289, %294
  %296 = zext i32 %295 to i64
  %297 = load ptr, ptr %20, align 8, !tbaa !5
  %298 = load i32, ptr %12, align 4, !tbaa !11
  %299 = zext i32 %298 to i64
  %300 = getelementptr inbounds i32, ptr %297, i64 %299
  %301 = load i32, ptr %300, align 4, !tbaa !11
  %302 = zext i32 %301 to i64
  %303 = mul i64 %296, %302
  %304 = load i64, ptr %17, align 8, !tbaa !13
  %305 = add i64 %304, %303
  store i64 %305, ptr %17, align 8, !tbaa !13
  br label %306

306:                                              ; preds = %281
  %307 = load i32, ptr %12, align 4, !tbaa !11
  %308 = add i32 %307, 1
  store i32 %308, ptr %12, align 4, !tbaa !11
  br label %274, !llvm.loop !26

309:                                              ; preds = %274
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %310

310:                                              ; preds = %341, %309
  %311 = load i32, ptr %12, align 4, !tbaa !11
  %312 = load ptr, ptr %7, align 8, !tbaa !5
  %313 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %312, i32 0, i32 2
  %314 = load i32, ptr %313, align 4, !tbaa !23
  %315 = add i32 %314, 1
  %316 = icmp ult i32 %311, %315
  br i1 %316, label %317, label %344

317:                                              ; preds = %310
  %318 = load ptr, ptr %23, align 8, !tbaa !5
  %319 = load i32, ptr %12, align 4, !tbaa !11
  %320 = zext i32 %319 to i64
  %321 = getelementptr inbounds %struct.huff_code, ptr %318, i64 %320
  %322 = getelementptr inbounds %struct.huff_code, ptr %321, i32 0, i32 0
  %323 = getelementptr inbounds %struct.anon.2, ptr %322, i32 0, i32 2
  %324 = load i8, ptr %323, align 1, !tbaa !15
  %325 = zext i8 %324 to i32
  %326 = load i32, ptr %12, align 4, !tbaa !11
  %327 = zext i32 %326 to i64
  %328 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120) @_ZN3qpl2ml11compressionL24distance_code_extra_bitsE, i64 noundef %327) #7
  %329 = load i32, ptr %328, align 4, !tbaa !11
  %330 = add i32 %325, %329
  %331 = zext i32 %330 to i64
  %332 = load ptr, ptr %21, align 8, !tbaa !5
  %333 = load i32, ptr %12, align 4, !tbaa !11
  %334 = zext i32 %333 to i64
  %335 = getelementptr inbounds i32, ptr %332, i64 %334
  %336 = load i32, ptr %335, align 4, !tbaa !11
  %337 = zext i32 %336 to i64
  %338 = mul i64 %331, %337
  %339 = load i64, ptr %17, align 8, !tbaa !13
  %340 = add i64 %339, %338
  store i64 %340, ptr %17, align 8, !tbaa !13
  br label %341

341:                                              ; preds = %317
  %342 = load i32, ptr %12, align 4, !tbaa !11
  %343 = add i32 %342, 1
  store i32 %343, ptr %12, align 4, !tbaa !11
  br label %310, !llvm.loop !27

344:                                              ; preds = %310
  br label %345

345:                                              ; preds = %344, %243
  %346 = load i64, ptr %17, align 8, !tbaa !13
  %347 = load i64, ptr %16, align 8, !tbaa !13
  %348 = icmp ugt i64 %346, %347
  br i1 %348, label %349, label %405

349:                                              ; preds = %345
  %350 = load i8, ptr %9, align 1, !tbaa !9
  %351 = zext i8 %350 to i32
  %352 = icmp ne i32 %351, 1
  br i1 %352, label %353, label %405

353:                                              ; preds = %349
  %354 = getelementptr inbounds [316 x i16], ptr %15, i64 0, i64 0
  %355 = load ptr, ptr %7, align 8, !tbaa !5
  %356 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %355, i32 0, i32 1
  %357 = load i32, ptr %356, align 8, !tbaa !20
  %358 = add i32 %357, 1
  %359 = getelementptr inbounds [19 x i64], ptr %14, i64 0, i64 0
  %360 = getelementptr inbounds [316 x %struct.rl_code], ptr %13, i64 0, i64 0
  %361 = call noundef i32 @_ZN3qpl2ml11compression9rl_encodeEPtjPmP7rl_code(ptr noundef %354, i32 noundef %358, ptr noundef %359, ptr noundef %360) #7
  store i32 %361, ptr %11, align 4, !tbaa !11
  %362 = getelementptr inbounds [316 x i16], ptr %15, i64 0, i64 0
  %363 = load ptr, ptr %7, align 8, !tbaa !5
  %364 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %363, i32 0, i32 1
  %365 = load i32, ptr %364, align 8, !tbaa !20
  %366 = zext i32 %365 to i64
  %367 = getelementptr inbounds i16, ptr %362, i64 %366
  %368 = getelementptr inbounds i16, ptr %367, i64 1
  %369 = load ptr, ptr %7, align 8, !tbaa !5
  %370 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %369, i32 0, i32 2
  %371 = load i32, ptr %370, align 4, !tbaa !23
  %372 = add i32 %371, 1
  %373 = getelementptr inbounds [19 x i64], ptr %14, i64 0, i64 0
  %374 = getelementptr inbounds [316 x %struct.rl_code], ptr %13, i64 0, i64 0
  %375 = load i32, ptr %11, align 4, !tbaa !11
  %376 = zext i32 %375 to i64
  %377 = getelementptr inbounds %struct.rl_code, ptr %374, i64 %376
  %378 = call noundef i32 @_ZN3qpl2ml11compression9rl_encodeEPtjPmP7rl_code(ptr noundef %368, i32 noundef %372, ptr noundef %373, ptr noundef %377) #7
  %379 = load i32, ptr %11, align 4, !tbaa !11
  %380 = add i32 %379, %378
  store i32 %380, ptr %11, align 4, !tbaa !11
  %381 = load ptr, ptr %6, align 8, !tbaa !5
  %382 = getelementptr inbounds [316 x %struct.rl_code], ptr %13, i64 0, i64 0
  %383 = load i32, ptr %11, align 4, !tbaa !11
  %384 = getelementptr inbounds [19 x i64], ptr %14, i64 0, i64 0
  %385 = load ptr, ptr %7, align 8, !tbaa !5
  %386 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %385, i32 0, i32 1
  %387 = load i32, ptr %386, align 8, !tbaa !20
  %388 = sub i32 %387, 256
  %389 = load ptr, ptr %7, align 8, !tbaa !5
  %390 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_icf", ptr %389, i32 0, i32 2
  %391 = load i32, ptr %390, align 4, !tbaa !23
  %392 = load i32, ptr %10, align 4, !tbaa !11
  %393 = call noundef i32 @_ZN3qpl2ml11compression13create_headerEP7BitBuf2P7rl_codejPmjjj(ptr noundef %381, ptr noundef %382, i32 noundef %383, ptr noundef %384, i32 noundef %388, i32 noundef %391, i32 noundef %392) #7
  %394 = load ptr, ptr %6, align 8, !tbaa !5
  %395 = invoke noundef i32 @_ZL11buffer_usedP7BitBuf2(ptr noundef %394)
          to label %396 unwind label %423

396:                                              ; preds = %353
  %397 = mul i32 8, %395
  %398 = load ptr, ptr %6, align 8, !tbaa !5
  %399 = getelementptr inbounds %struct.BitBuf2, ptr %398, i32 0, i32 1
  %400 = load i32, ptr %399, align 8, !tbaa !28
  %401 = add i32 %397, %400
  %402 = zext i32 %401 to i64
  %403 = load i64, ptr %16, align 8, !tbaa !13
  %404 = add i64 %403, %402
  store i64 %404, ptr %16, align 8, !tbaa !13
  br label %421

405:                                              ; preds = %349, %345
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, ptr %24, align 8, !tbaa !5
  %406 = load ptr, ptr %24, align 8, !tbaa !5
  %407 = load ptr, ptr %24, align 8, !tbaa !5
  %408 = getelementptr inbounds i8, ptr %407, i64 2176
  %409 = load ptr, ptr %7, align 8, !tbaa !5
  %410 = call noundef ptr @_ZNK3qpl2ml11compression17huffman_table_icf23get_isal_huffman_tablesEv(ptr noundef nonnull align 8 dereferenceable(16) %409) #7
  call void @_ZN3qpl7core_sw4util4copyIPhS3_EEvT_S4_T0_(ptr noundef %406, ptr noundef %408, ptr noundef %410) #7
  %411 = load i32, ptr %10, align 4, !tbaa !11
  %412 = icmp ne i32 %411, 0
  %413 = zext i1 %412 to i64
  %414 = select i1 %412, i32 1, i32 0
  store i32 %414, ptr %10, align 4, !tbaa !11
  %415 = load ptr, ptr %6, align 8, !tbaa !5
  %416 = load i32, ptr %10, align 4, !tbaa !11
  %417 = or i32 2, %416
  %418 = zext i32 %417 to i64
  invoke void @_ZL10write_bitsP7BitBuf2mj(ptr noundef %415, i64 noundef %418, i32 noundef 3)
          to label %419 unwind label %423

419:                                              ; preds = %405
  %420 = load i64, ptr %17, align 8, !tbaa !13
  store i64 %420, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  br label %421

421:                                              ; preds = %419, %396
  %422 = load i64, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 632, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 152, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 632, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  ret i64 %422

423:                                              ; preds = %405, %353
  %424 = landingpad { ptr, i32 }
          catch ptr null
  %425 = extractvalue { ptr, i32 } %424, 0
  call void @__clang_call_terminate(ptr %425) #8
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120), i64 noundef) #0 align 2

; Function Attrs: nounwind
declare noundef i32 @_ZN3qpl2ml11compression9rl_encodeEPtjPmP7rl_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare noundef i32 @_ZN3qpl2ml11compression13create_headerEP7BitBuf2P7rl_codejPmjjj(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11buffer_usedP7BitBuf2(ptr noundef) #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl7core_sw4util4copyIPhS3_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL10write_bitsP7BitBuf2mj(ptr noundef, i64 noundef, i32 noundef) #6

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { 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 #5 = { noinline noreturn nounwind uwtable "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 #6 = { 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 #7 = { nounwind }
attributes #8 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTSN3qpl2ml11compression18compression_mode_tE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !12, i64 8}
!21 = !{!"_ZTSN3qpl2ml11compression17huffman_table_icfE", !6, i64 0, !12, i64 8, !12, i64 12}
!22 = distinct !{!22, !19}
!23 = !{!21, !12, i64 12}
!24 = distinct !{!24, !19}
!25 = distinct !{!25, !19}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}
!28 = !{!29, !12, i64 8}
!29 = !{!"_ZTS7BitBuf2", !14, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}


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

%"struct.std::array.5" = type { [29 x i32] }
%"struct.std::array.6" = type { [30 x i32] }
%struct.rl_code = type { i8, i8 }
%struct.huff_code = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { i32 }

@_ZN3qpl2ml11compressionL22length_code_extra_bitsE = external hidden constant %"struct.std::array.5", align 4
@_ZN3qpl2ml11compressionL24distance_code_extra_bitsE = external hidden constant %"struct.std::array.6", align 4
@_ZN3qpl2ml11compressionL16fixed_hufftablesE = external hidden global { { { [31 x { { { i8, i8, i8, i8 } } }], <{ [288 x { { { i8, i8, i8, i8 } } }], [225 x { { { i8, i8, i8, i8 } } }] }> } } }, align 4

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i64 @_ZN3qpl2ml11compression23write_huffman_table_icfEP7BitBuf2RNS1_17huffman_table_icfEP13isal_mod_histNS1_18compression_mode_tEj(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr nocapture noundef readonly %2, i8 noundef zeroext %3, i32 noundef %4) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %6 = alloca [316 x %struct.rl_code], align 16
  %7 = alloca [19 x i64], align 16
  %8 = alloca [316 x i16], align 16
  call void @llvm.lifetime.start.p0(i64 632, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 632, ptr nonnull %8) #7
  %9 = tail call noundef ptr @_ZNK3qpl2ml11compression17huffman_table_icf23get_isal_huffman_tablesEv(ptr noundef nonnull align 8 dereferenceable(16) %1) #7
  %10 = tail call noundef ptr @_ZNK3qpl2ml11compression17huffman_table_icf23get_isal_huffman_tablesEv(ptr noundef nonnull align 8 dereferenceable(16) %1) #7
  %11 = getelementptr inbounds i8, ptr %2, i64 120
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(152) %7, i8 0, i64 152, i1 false)
  %12 = icmp ne i8 %3, 1
  br i1 %12, label %.preheader121, label %108

.preheader121:                                    ; preds = %5
  %invariant.gep = getelementptr inbounds i8, ptr %9, i64 127
  br label %17

.preheader120:                                    ; preds = %17
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !5
  %15 = add i32 %14, -257
  %16 = icmp ult i32 %15, -258
  br i1 %16, label %.lr.ph146, label %.preheader

17:                                               ; preds = %32, %.preheader121
  %indvars.iv178 = phi i64 [ 0, %.preheader121 ], [ %indvars.iv.next179.1, %32 ]
  %.0109138 = phi i64 [ 0, %.preheader121 ], [ %41, %32 ]
  %.0114137 = phi i64 [ 3, %.preheader121 ], [ %46, %32 ]
  %gep135 = getelementptr inbounds %struct.huff_code, ptr %invariant.gep, i64 %indvars.iv178
  %18 = load i8, ptr %gep135, align 1, !tbaa !11
  %19 = zext i8 %18 to i16
  %20 = getelementptr inbounds [316 x i16], ptr %8, i64 0, i64 %indvars.iv178
  store i16 %19, ptr %20, align 4, !tbaa !12
  %21 = zext i8 %18 to i32
  %22 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv178
  %23 = load i32, ptr %22, align 4, !tbaa !14
  %24 = mul i32 %23, %21
  %25 = zext i32 %24 to i64
  %26 = add i64 %.0109138, %25
  %gep136 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv178
  %27 = load i8, ptr %gep136, align 1, !tbaa !11
  %28 = zext i8 %27 to i32
  %29 = mul i32 %23, %28
  %30 = zext i32 %29 to i64
  %31 = add i64 %.0114137, %30
  %exitcond181.not = icmp eq i64 %indvars.iv178, 256
  br i1 %exitcond181.not, label %.preheader120, label %32, !llvm.loop !15

32:                                               ; preds = %17
  %indvars.iv.next179 = or disjoint i64 %indvars.iv178, 1
  %gep135.1 = getelementptr inbounds %struct.huff_code, ptr %invariant.gep, i64 %indvars.iv.next179
  %33 = load i8, ptr %gep135.1, align 1, !tbaa !11
  %34 = zext i8 %33 to i16
  %35 = getelementptr inbounds [316 x i16], ptr %8, i64 0, i64 %indvars.iv.next179
  store i16 %34, ptr %35, align 2, !tbaa !12
  %36 = zext i8 %33 to i32
  %37 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next179
  %38 = load i32, ptr %37, align 4, !tbaa !14
  %39 = mul i32 %38, %36
  %40 = zext i32 %39 to i64
  %41 = add i64 %26, %40
  %gep136.1 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv.next179
  %42 = load i8, ptr %gep136.1, align 1, !tbaa !11
  %43 = zext i8 %42 to i32
  %44 = mul i32 %38, %43
  %45 = zext i32 %44 to i64
  %46 = add i64 %31, %45
  %indvars.iv.next179.1 = add nuw nsw i64 %indvars.iv178, 2
  br label %17

.preheader:                                       ; preds = %.lr.ph146, %.preheader120
  %.1115.lcssa = phi i64 [ %31, %.preheader120 ], [ %72, %.lr.ph146 ]
  %.1110.lcssa = phi i64 [ %26, %.preheader120 ], [ %62, %.lr.ph146 ]
  %47 = getelementptr inbounds i8, ptr %1, i64 12
  %invariant.gep149 = getelementptr inbounds i8, ptr %10, i64 3
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %.not159 = icmp eq i32 %48, -1
  br i1 %.not159, label %.loopexit, label %.lr.ph155

.lr.ph146:                                        ; preds = %.preheader120, %.lr.ph146
  %indvars.iv182 = phi i64 [ %indvars.iv.next183, %.lr.ph146 ], [ 257, %.preheader120 ]
  %.1110144 = phi i64 [ %62, %.lr.ph146 ], [ %26, %.preheader120 ]
  %.1115143 = phi i64 [ %72, %.lr.ph146 ], [ %31, %.preheader120 ]
  %gep141 = getelementptr inbounds %struct.huff_code, ptr %invariant.gep, i64 %indvars.iv182
  %49 = load i8, ptr %gep141, align 1, !tbaa !11
  %50 = zext i8 %49 to i16
  %51 = getelementptr inbounds [316 x i16], ptr %8, i64 0, i64 %indvars.iv182
  store i16 %50, ptr %51, align 2, !tbaa !12
  %52 = zext i8 %49 to i32
  %53 = add nsw i64 %indvars.iv182, -257
  %54 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116) @_ZN3qpl2ml11compressionL22length_code_extra_bitsE, i64 noundef %53) #7
  %55 = load i32, ptr %54, align 4, !tbaa !14
  %56 = add i32 %55, %52
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv182
  %59 = load i32, ptr %58, align 4, !tbaa !14
  %60 = zext i32 %59 to i64
  %61 = mul nuw i64 %57, %60
  %62 = add i64 %61, %.1110144
  %gep142 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv182
  %63 = load i8, ptr %gep142, align 1, !tbaa !11
  %64 = zext i8 %63 to i32
  %65 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116) @_ZN3qpl2ml11compressionL22length_code_extra_bitsE, i64 noundef %53) #7
  %66 = load i32, ptr %65, align 4, !tbaa !14
  %67 = add i32 %66, %64
  %68 = zext i32 %67 to i64
  %69 = load i32, ptr %58, align 4, !tbaa !14
  %70 = zext i32 %69 to i64
  %71 = mul nuw i64 %68, %70
  %72 = add i64 %71, %.1115143
  %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1
  %73 = load i32, ptr %13, align 8, !tbaa !5
  %74 = add i32 %73, 1
  %75 = zext i32 %74 to i64
  %76 = icmp ult i64 %indvars.iv.next183, %75
  br i1 %76, label %.lr.ph146, label %.preheader, !llvm.loop !18

.lr.ph155:                                        ; preds = %.preheader, %.lr.ph155
  %indvars.iv185 = phi i64 [ %indvars.iv.next186, %.lr.ph155 ], [ 0, %.preheader ]
  %.2111153 = phi i64 [ %93, %.lr.ph155 ], [ %.1110.lcssa, %.preheader ]
  %.2116152 = phi i64 [ %103, %.lr.ph155 ], [ %.1115.lcssa, %.preheader ]
  %gep150 = getelementptr inbounds %struct.huff_code, ptr %invariant.gep149, i64 %indvars.iv185
  %77 = load i8, ptr %gep150, align 1, !tbaa !11
  %78 = zext i8 %77 to i16
  %79 = load i32, ptr %13, align 8, !tbaa !5
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
  %80 = trunc nuw i64 %indvars.iv.next186 to i32
  %81 = add i32 %79, %80
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds [316 x i16], ptr %8, i64 0, i64 %82
  store i16 %78, ptr %83, align 2, !tbaa !12
  %84 = zext i8 %77 to i32
  %85 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120) @_ZN3qpl2ml11compressionL24distance_code_extra_bitsE, i64 noundef %indvars.iv185) #7
  %86 = load i32, ptr %85, align 4, !tbaa !14
  %87 = add i32 %86, %84
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv185
  %90 = load i32, ptr %89, align 4, !tbaa !14
  %91 = zext i32 %90 to i64
  %92 = mul nuw i64 %88, %91
  %93 = add i64 %92, %.2111153
  %gep151 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 3), i64 %indvars.iv185
  %94 = load i8, ptr %gep151, align 1, !tbaa !11
  %95 = zext i8 %94 to i32
  %96 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120) @_ZN3qpl2ml11compressionL24distance_code_extra_bitsE, i64 noundef %indvars.iv185) #7
  %97 = load i32, ptr %96, align 4, !tbaa !14
  %98 = add i32 %97, %95
  %99 = zext i32 %98 to i64
  %100 = load i32, ptr %89, align 4, !tbaa !14
  %101 = zext i32 %100 to i64
  %102 = mul nuw i64 %99, %101
  %103 = add i64 %102, %.2116152
  %104 = load i32, ptr %47, align 4, !tbaa !17
  %105 = add i32 %104, 1
  %106 = zext i32 %105 to i64
  %107 = icmp ult i64 %indvars.iv.next186, %106
  br i1 %107, label %.lr.ph155, label %.loopexit, !llvm.loop !19

108:                                              ; preds = %5
  %109 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 285, ptr %109, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %1, i64 12
  store i32 29, ptr %110, align 4, !tbaa !17
  br label %111

111:                                              ; preds = %119, %108
  %indvars.iv = phi i64 [ 0, %108 ], [ %indvars.iv.next.3, %119 ]
  %.3117125 = phi i64 [ 3, %108 ], [ %140, %119 ]
  %gep = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv
  %112 = load i8, ptr %gep, align 1, !tbaa !11
  %113 = zext i8 %112 to i32
  %114 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv
  %115 = load i32, ptr %114, align 4, !tbaa !14
  %116 = mul i32 %115, %113
  %117 = zext i32 %116 to i64
  %118 = add i64 %.3117125, %117
  %exitcond.not = icmp eq i64 %indvars.iv, 256
  br i1 %exitcond.not, label %.lr.ph, label %119, !llvm.loop !20

119:                                              ; preds = %111
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %gep.1 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv.next
  %120 = load i8, ptr %gep.1, align 1, !tbaa !11
  %121 = zext i8 %120 to i32
  %122 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next
  %123 = load i32, ptr %122, align 4, !tbaa !14
  %124 = mul i32 %123, %121
  %125 = zext i32 %124 to i64
  %126 = add i64 %118, %125
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %gep.2 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv.next.1
  %127 = load i8, ptr %gep.2, align 1, !tbaa !11
  %128 = zext i8 %127 to i32
  %129 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next.1
  %130 = load i32, ptr %129, align 4, !tbaa !14
  %131 = mul i32 %130, %128
  %132 = zext i32 %131 to i64
  %133 = add i64 %126, %132
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %gep.3 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv.next.2
  %134 = load i8, ptr %gep.3, align 1, !tbaa !11
  %135 = zext i8 %134 to i32
  %136 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv.next.2
  %137 = load i32, ptr %136, align 4, !tbaa !14
  %138 = mul i32 %137, %135
  %139 = zext i32 %138 to i64
  %140 = add i64 %133, %139
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  br label %111

.preheader122:                                    ; preds = %.lr.ph
  %.pre = load i32, ptr %110, align 4, !tbaa !17
  %.not158 = icmp eq i32 %.pre, -1
  br i1 %.not158, label %.loopexit, label %.lr.ph133

.lr.ph:                                           ; preds = %111, %.lr.ph
  %indvars.iv172 = phi i64 [ %indvars.iv.next173, %.lr.ph ], [ 257, %111 ]
  %.4118128 = phi i64 [ %152, %.lr.ph ], [ %118, %111 ]
  %gep127 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 127), i64 %indvars.iv172
  %141 = load i8, ptr %gep127, align 1, !tbaa !11
  %142 = zext i8 %141 to i32
  %143 = add nsw i64 %indvars.iv172, -257
  %144 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116) @_ZN3qpl2ml11compressionL22length_code_extra_bitsE, i64 noundef %143) #7
  %145 = load i32, ptr %144, align 4, !tbaa !14
  %146 = add i32 %145, %142
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds i32, ptr %11, i64 %indvars.iv172
  %149 = load i32, ptr %148, align 4, !tbaa !14
  %150 = zext i32 %149 to i64
  %151 = mul nuw i64 %147, %150
  %152 = add i64 %151, %.4118128
  %indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
  %153 = load i32, ptr %109, align 8, !tbaa !5
  %154 = add i32 %153, 1
  %155 = zext i32 %154 to i64
  %156 = icmp ult i64 %indvars.iv.next173, %155
  br i1 %156, label %.lr.ph, label %.preheader122, !llvm.loop !21

.lr.ph133:                                        ; preds = %.preheader122, %.lr.ph133
  %indvars.iv175 = phi i64 [ %indvars.iv.next176, %.lr.ph133 ], [ 0, %.preheader122 ]
  %.5119131 = phi i64 [ %167, %.lr.ph133 ], [ %152, %.preheader122 ]
  %gep130 = getelementptr inbounds %struct.huff_code, ptr getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 3), i64 %indvars.iv175
  %157 = load i8, ptr %gep130, align 1, !tbaa !11
  %158 = zext i8 %157 to i32
  %159 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120) @_ZN3qpl2ml11compressionL24distance_code_extra_bitsE, i64 noundef %indvars.iv175) #7
  %160 = load i32, ptr %159, align 4, !tbaa !14
  %161 = add i32 %160, %158
  %162 = zext i32 %161 to i64
  %163 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv175
  %164 = load i32, ptr %163, align 4, !tbaa !14
  %165 = zext i32 %164 to i64
  %166 = mul nuw i64 %162, %165
  %167 = add i64 %166, %.5119131
  %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1
  %168 = load i32, ptr %110, align 4, !tbaa !17
  %169 = add i32 %168, 1
  %170 = zext i32 %169 to i64
  %171 = icmp ult i64 %indvars.iv.next176, %170
  br i1 %171, label %.lr.ph133, label %.loopexit, !llvm.loop !22

.loopexit:                                        ; preds = %.lr.ph133, %.lr.ph155, %.preheader122, %.preheader
  %.6 = phi i64 [ %.1115.lcssa, %.preheader ], [ %152, %.preheader122 ], [ %103, %.lr.ph155 ], [ %167, %.lr.ph133 ]
  %.3112 = phi i64 [ %.1110.lcssa, %.preheader ], [ 0, %.preheader122 ], [ %93, %.lr.ph155 ], [ 0, %.lr.ph133 ]
  %172 = icmp ugt i64 %.6, %.3112
  %or.cond = and i1 %12, %172
  br i1 %or.cond, label %173, label %200

173:                                              ; preds = %.loopexit
  %174 = getelementptr inbounds i8, ptr %1, i64 8
  %175 = load i32, ptr %174, align 8, !tbaa !5
  %176 = add i32 %175, 1
  %177 = call noundef i32 @_ZN3qpl2ml11compression9rl_encodeEPtjPmP7rl_code(ptr noundef nonnull %8, i32 noundef %176, ptr noundef nonnull %7, ptr noundef nonnull %6) #7
  %178 = load i32, ptr %174, align 8, !tbaa !5
  %179 = zext i32 %178 to i64
  %180 = getelementptr inbounds i16, ptr %8, i64 %179
  %181 = getelementptr inbounds i8, ptr %180, i64 2
  %182 = getelementptr inbounds i8, ptr %1, i64 12
  %183 = load i32, ptr %182, align 4, !tbaa !17
  %184 = add i32 %183, 1
  %185 = zext i32 %177 to i64
  %186 = getelementptr inbounds %struct.rl_code, ptr %6, i64 %185
  %187 = call noundef i32 @_ZN3qpl2ml11compression9rl_encodeEPtjPmP7rl_code(ptr noundef nonnull %181, i32 noundef %184, ptr noundef nonnull %7, ptr noundef nonnull %186) #7
  %188 = add i32 %187, %177
  %189 = load i32, ptr %174, align 8, !tbaa !5
  %190 = add i32 %189, -256
  %191 = load i32, ptr %182, align 4, !tbaa !17
  %192 = call noundef i32 @_ZN3qpl2ml11compression13create_headerEP7BitBuf2P7rl_codejPmjjj(ptr noundef %0, ptr noundef nonnull %6, i32 noundef %188, ptr noundef nonnull %7, i32 noundef %190, i32 noundef %191, i32 noundef %4) #7
  %193 = call noundef i32 @_ZL11buffer_usedP7BitBuf2(ptr noundef %0)
  %194 = shl i32 %193, 3
  %195 = getelementptr inbounds i8, ptr %0, i64 8
  %196 = load i32, ptr %195, align 8, !tbaa !23
  %197 = add i32 %194, %196
  %198 = zext i32 %197 to i64
  %199 = add i64 %.3112, %198
  br label %204

200:                                              ; preds = %.loopexit
  %201 = tail call noundef ptr @_ZNK3qpl2ml11compression17huffman_table_icf23get_isal_huffman_tablesEv(ptr noundef nonnull align 8 dereferenceable(16) %1) #7
  tail call void @_ZN3qpl7core_sw4util4copyIPhS3_EEvT_S4_T0_(ptr noundef nonnull @_ZN3qpl2ml11compressionL16fixed_hufftablesE, ptr noundef nonnull getelementptr inbounds (i8, ptr @_ZN3qpl2ml11compressionL16fixed_hufftablesE, i64 2176), ptr noundef %201) #7
  %.not = icmp ne i32 %4, 0
  %202 = zext i1 %.not to i64
  %203 = or disjoint i64 %202, 2
  invoke void @_ZL10write_bitsP7BitBuf2mj(ptr noundef %0, i64 noundef %203, i32 noundef 3)
          to label %204 unwind label %205

204:                                              ; preds = %200, %173
  %.4113 = phi i64 [ %199, %173 ], [ %.6, %200 ]
  call void @llvm.lifetime.end.p0(i64 632, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 632, ptr nonnull %6) #7
  ret i64 %.4113

205:                                              ; preds = %200
  %206 = landingpad { ptr, i32 }
          catch ptr null
  %207 = extractvalue { ptr, i32 } %206, 0
  tail call void @__clang_call_terminate(ptr %207) #8
  unreachable
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm29EEixEm(ptr noundef nonnull align 4 dereferenceable(116), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt5arrayIjLm30EEixEm(ptr noundef nonnull align 4 dereferenceable(120), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nounwind
declare noundef i32 @_ZN3qpl2ml11compression9rl_encodeEPtjPmP7rl_code(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare noundef i32 @_ZN3qpl2ml11compression13create_headerEP7BitBuf2P7rl_codejPmjjj(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL11buffer_usedP7BitBuf2(ptr noundef) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl7core_sw4util4copyIPhS3_EEvT_S4_T0_(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL10write_bitsP7BitBuf2mj(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { 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 #5 = { noinline noreturn nounwind uwtable "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 #6 = { 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 #7 = { nounwind }
attributes #8 = { 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, !10, i64 8}
!6 = !{!"_ZTSN3qpl2ml11compression17huffman_table_icfE", !7, i64 0, !10, i64 8, !10, i64 12}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !8, i64 0}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!6, !10, i64 12}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16}
!23 = !{!24, !10, i64 8}
!24 = !{!"_ZTS7BitBuf2", !25, i64 0, !10, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!25 = !{!"long", !8, i64 0}


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