; LLVM IR from intel/qpl :: sources/c_api/legacy_hw_path (qpl_hw_compress_job)

; 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.qpl::ml::compression::compression_huffman_table" = type <{ ptr, ptr, ptr, ptr, i8, i8, i8, i8, [4 x i8] }>
%struct.qpl_job = type { ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, ptr, i32, i32, i8, i8, i8, i64, i64, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.qpl_aux_data }
%struct.qpl_aux_data = type { ptr, ptr, ptr, ptr, ptr, i32 }
%struct.qpl_hw_state = type { %struct.hw_decompress_analytics_descriptor, %struct.hw_iaa_completion_record, [2 x %struct.hw_iaa_aecs_analytic], [2 x %struct.hw_iaa_aecs_compress], %struct.qpl_buffer, %struct.qpl_execution_history, i32, i32, i32, %struct.hw_huffman_code, i32, %struct.hw_accelerator_context, i32, i32, i8, i8, i32, i32, %struct.qpl_execution_record }
%struct.hw_decompress_analytics_descriptor = type { i32, i32, ptr, ptr, ptr, i32, i16, i16, ptr, i32, i32, i32, i32 }
%struct.hw_iaa_completion_record = type { i8, i8, i8, i8, i32, i64, i64, i32, i8, i8, i16, i32, i32, i32, i32, i64, i64 }
%struct.hw_iaa_aecs_analytic = type { %struct.hw_iaa_aecs_filter, [36 x i32], %struct.hw_iaa_aecs_decompress }
%struct.hw_iaa_aecs_filter = type { i32, i32, i32, i32, i32, i32 }
%struct.hw_iaa_aecs_decompress = type { [2 x i32], i32, i32, [32 x i64], [32 x i8], i32, i8, i8, i16, [5 x i32], [5 x i32], [5 x i32], [5 x i32], [62 x i32], %union.anon, i16, i16, %union.anon.7, %struct.anon.9, i16, [4096 x i8], [6 x i32] }
%union.anon = type { %struct.anon }
%struct.anon = type { [6 x i32], [224 x i8], [5 x i32] }
%union.anon.7 = type { %struct.anon.8 }
%struct.anon.8 = type { [2 x i32], [144 x i8], [5 x i32] }
%struct.anon.9 = type { i16 }
%struct.hw_iaa_aecs_compress = type { i32, i32, [5 x i32], i32, [256 x i8], %struct.hw_iaa_histogram, [12288 x i8] }
%struct.hw_iaa_histogram = type { [286 x i32], [2 x i32], [30 x i32], [2 x i32] }
%struct.qpl_buffer = type { [1024 x i8], i32, i32 }
%struct.qpl_execution_history = type { i8, i32, i32, i32, ptr }
%struct.hw_huffman_code = type { i16, i8, i8 }
%struct.hw_accelerator_context = type { %struct.hw_device_properties, ptr }
%struct.hw_device_properties = type { i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.qpl_execution_record = type { double, i32, i32 }

@_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher = external hidden global ptr, align 8
@_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher = external hidden global i64, align 8

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

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #1

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(975232) ptr @_ZN3qpl2ml10dispatcher13hw_dispatcher12get_instanceEv() #2

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #1

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qpl2ml10dispatcher13hw_dispatcher13is_hw_supportEv(ptr noundef nonnull align 8 dereferenceable(975232)) #2

; Function Attrs: nounwind
declare noundef i32 @_ZNK3qpl2ml10dispatcher13hw_dispatcher18get_hw_init_statusEv(ptr noundef nonnull align 8 dereferenceable(975232)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3qpl2ml4util43convert_hw_accelerator_status_to_qpl_statusEj(i32 noundef) #3

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

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(9752) ptr @_ZNK3qpl2ml10dispatcher13hw_dispatcher6deviceEm(ptr noundef nonnull align 8 dereferenceable(975232), i64 noundef) #2

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qpl2ml10dispatcher9hw_device22get_header_gen_supportEv(ptr noundef nonnull align 8 dereferenceable(9752)) #2

declare void @hw_iaa_descriptor_init_deflate_body(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL48hw_iaa_descriptor_compress_set_huffman_only_modeP13hw_descriptor(ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL46hw_iaa_descriptor_compress_set_mini_block_sizeP13hw_descriptor24hw_iaa_mini_block_size_t(ptr noundef, i32 noundef) #3

declare void @hw_iaa_descriptor_set_completion_record(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z20use_as_huffman_tableILN3qpl2ml11compression23compression_algorithm_eE2EEDaP17qpl_huffman_table(ptr noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL45hw_iaa_descriptor_compress_set_be_output_modeP13hw_descriptor(ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL33hw_iaa_descriptor_set_crc_rfc3720P13hw_descriptor(ptr noundef) #3

declare void @hw_iaa_descriptor_compress_set_aecs(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3qpl2ml4util38are_iaa_gen_2_min_capabilities_presentEv() #3

; Function Attrs: mustprogress uwtable
define dso_local i32 @hw_descriptor_compress_init_deflate_dynamic(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #6 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"class.qpl::ml::compression::compression_huffman_table", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #1
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.qpl_job, ptr %23, i32 0, i32 7
  %25 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %25, ptr %12, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #1
  %26 = load i32, ptr %12, align 4, !tbaa !21
  %27 = and i32 %26, 32
  %28 = icmp ne i32 %27, 0
  %29 = zext i1 %28 to i8
  store i8 %29, ptr %13, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #1
  %30 = load i32, ptr %12, align 4, !tbaa !21
  %31 = and i32 %30, 2
  %32 = icmp ne i32 %31, 0
  %33 = zext i1 %32 to i64
  %34 = select i1 %32, i32 1, i32 0
  %35 = icmp ne i32 %34, 0
  %36 = zext i1 %35 to i8
  store i8 %36, ptr %14, align 1, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #1
  store i8 0, ptr %15, align 1, !tbaa !22
  %37 = load atomic i8, ptr @_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher acquire, align 8
  %38 = icmp eq i8 %37, 0
  br i1 %38, label %39, label %44, !prof !24

39:                                               ; preds = %5
  %40 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher) #1
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %44

42:                                               ; preds = %39
  %43 = call noundef nonnull align 8 dereferenceable(975232) ptr @_ZN3qpl2ml10dispatcher13hw_dispatcher12get_instanceEv() #1
  store ptr %43, ptr @_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher, align 8, !tbaa !5
  call void @__cxa_guard_release(ptr @_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher) #1
  br label %44

44:                                               ; preds = %42, %39, %5
  %45 = load ptr, ptr @_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher, align 8, !tbaa !5
  %46 = call noundef zeroext i1 @_ZNK3qpl2ml10dispatcher13hw_dispatcher13is_hw_supportEv(ptr noundef nonnull align 8 dereferenceable(975232) %45) #1
  br i1 %46, label %52, label %47

47:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #1
  %48 = load ptr, ptr @_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher, align 8, !tbaa !5
  %49 = call noundef i32 @_ZNK3qpl2ml10dispatcher13hw_dispatcher18get_hw_init_statusEv(ptr noundef nonnull align 8 dereferenceable(975232) %48) #1
  store i32 %49, ptr %16, align 4, !tbaa !25
  %50 = load i32, ptr %16, align 4, !tbaa !25
  %51 = call noundef i32 @_ZN3qpl2ml4util43convert_hw_accelerator_status_to_qpl_statusEj(i32 noundef %50)
  store i32 %51, ptr %6, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #1
  br label %194

52:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #1
  %53 = load ptr, ptr @_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher, align 8, !tbaa !5
  %54 = call noundef nonnull align 8 dereferenceable(9752) ptr @_ZNK3qpl2ml10dispatcher13hw_dispatcher6deviceEm(ptr noundef nonnull align 8 dereferenceable(975232) %53, i64 noundef 0) #1
  store ptr %54, ptr %18, align 8, !tbaa !5
  %55 = load ptr, ptr %18, align 8, !tbaa !5
  %56 = call noundef zeroext i1 @_ZNK3qpl2ml10dispatcher9hw_device22get_header_gen_supportEv(ptr noundef nonnull align 8 dereferenceable(9752) %55) #1
  %57 = zext i1 %56 to i8
  store i8 %57, ptr %15, align 1, !tbaa !22
  %58 = load i32, ptr %12, align 4, !tbaa !21
  %59 = and i32 %58, 32
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %52
  br label %66

62:                                               ; preds = %52
  %63 = load i8, ptr %15, align 1, !tbaa !22, !range !27, !noundef !28
  %64 = trunc i8 %63 to i1
  %65 = zext i1 %64 to i32
  br label %66

66:                                               ; preds = %62, %61
  %67 = phi i32 [ 0, %61 ], [ %65, %62 ]
  %68 = icmp ne i32 %67, 0
  %69 = zext i1 %68 to i8
  store i8 %69, ptr %15, align 1, !tbaa !22
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = call noundef i32 @_ZL48hw_iaa_aecs_compress_accumulator_get_actual_bitsPK20hw_iaa_aecs_compress(ptr noundef %70)
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.qpl_hw_state, ptr %72, i32 0, i32 10
  store i32 %71, ptr %73, align 8, !tbaa !29
  %74 = load i8, ptr %13, align 1, !tbaa !22, !range !27, !noundef !28
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %95

76:                                               ; preds = %66
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.hw_iaa_aecs_compress, ptr %78, i32 0, i32 5
  call void @hw_iaa_aecs_compress_set_huffman_only_huffman_table_from_histogram(ptr noundef %77, ptr noundef %79)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #1
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.qpl_job, ptr %80, i32 0, i32 13
  %82 = load ptr, ptr %81, align 8, !tbaa !45
  %83 = call noundef ptr @_Z20use_as_huffman_tableILN3qpl2ml11compression23compression_algorithm_eE2EEDaP17qpl_huffman_table(ptr noundef %82)
  store ptr %83, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %20) #1
  %84 = load ptr, ptr %19, align 8, !tbaa !5
  %85 = call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_sw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %84) #1
  %86 = load ptr, ptr %19, align 8, !tbaa !5
  %87 = call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE38get_isal_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %86) #1
  %88 = load ptr, ptr %19, align 8, !tbaa !5
  %89 = call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_hw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %88) #1
  %90 = load ptr, ptr %19, align 8, !tbaa !5
  %91 = call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE22get_deflate_header_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %90) #1
  call void @_ZN3qpl2ml11compression25compression_huffman_tableC1EPhS3_S3_S3_(ptr noundef nonnull align 8 dereferenceable(36) %20, ptr noundef %85, ptr noundef %87, ptr noundef %89, ptr noundef %91) #1
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = call noundef ptr @_ZNK3qpl2ml11compression25compression_huffman_table24get_sw_compression_tableEv(ptr noundef nonnull align 8 dereferenceable(36) %20) #1
  call void @hw_iaa_aecs_compress_store_huffman_only_huffman_table(ptr noundef %92, ptr noundef %93)
  %94 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE28set_deflate_header_bits_sizeEj(ptr noundef nonnull align 8 dereferenceable(72) %94, i32 noundef 0) #1
  call void @llvm.lifetime.end.p0(i64 40, ptr %20) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #1
  br label %106

95:                                               ; preds = %66
  %96 = load i8, ptr %15, align 1, !tbaa !22, !range !27, !noundef !28
  %97 = trunc i8 %96 to i1
  br i1 %97, label %105, label %98

98:                                               ; preds = %95
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.hw_iaa_aecs_compress, ptr %100, i32 0, i32 5
  %102 = load i8, ptr %14, align 1, !tbaa !22, !range !27, !noundef !28
  %103 = trunc i8 %102 to i1
  %104 = zext i1 %103 to i32
  call void @hw_iaa_aecs_compress_write_deflate_dynamic_header_from_histogram(ptr noundef %99, ptr noundef %101, i32 noundef %104)
  br label %105

105:                                              ; preds = %98, %95
  br label %106

106:                                              ; preds = %105, %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #1
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.qpl_job, ptr %107, i32 0, i32 4
  %109 = load i32, ptr %108, align 8, !tbaa !46
  store i32 %109, ptr %21, align 4, !tbaa !21
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.qpl_job, ptr %110, i32 0, i32 7
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = and i32 10, %112
  %114 = icmp eq i32 10, %113
  br i1 %114, label %115, label %125

115:                                              ; preds = %106
  %116 = load i32, ptr %21, align 4, !tbaa !21
  %117 = icmp ugt i32 %116, 8
  br i1 %117, label %118, label %121

118:                                              ; preds = %115
  %119 = load i32, ptr %21, align 4, !tbaa !21
  %120 = sub i32 %119, 8
  br label %123

121:                                              ; preds = %115
  %122 = load i32, ptr %21, align 4, !tbaa !21
  br label %123

123:                                              ; preds = %121, %118
  %124 = phi i32 [ %120, %118 ], [ %122, %121 ]
  store i32 %124, ptr %21, align 4, !tbaa !21
  br label %125

125:                                              ; preds = %123, %106
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = load ptr, ptr %9, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.qpl_job, ptr %127, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !47
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.qpl_job, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 8, !tbaa !48
  %133 = load ptr, ptr %9, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.qpl_job, ptr %133, i32 0, i32 3
  %135 = load ptr, ptr %134, align 8, !tbaa !49
  %136 = load i32, ptr %21, align 4, !tbaa !21
  call void @hw_iaa_descriptor_init_deflate_body(ptr noundef %126, ptr noundef %129, i32 noundef %132, ptr noundef %135, i32 noundef %136)
  %137 = load i32, ptr %12, align 4, !tbaa !21
  %138 = and i32 %137, 16
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %142

140:                                              ; preds = %125
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL45hw_iaa_descriptor_compress_set_be_output_modeP13hw_descriptor(ptr noundef %141)
  br label %142

142:                                              ; preds = %140, %125
  %143 = load i32, ptr %12, align 4, !tbaa !21
  %144 = and i32 %143, 32768
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %148

146:                                              ; preds = %142
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL48hw_iaa_descriptor_compress_set_huffman_only_modeP13hw_descriptor(ptr noundef %147)
  br label %148

148:                                              ; preds = %146, %142
  %149 = load i32, ptr %12, align 4, !tbaa !21
  %150 = and i32 %149, 4
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %154

152:                                              ; preds = %148
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL33hw_iaa_descriptor_set_crc_rfc3720P13hw_descriptor(ptr noundef %153)
  br label %154

154:                                              ; preds = %152, %148
  %155 = load ptr, ptr %7, align 8, !tbaa !5
  %156 = load ptr, ptr %9, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.qpl_job, ptr %156, i32 0, i32 15
  %158 = load i32, ptr %157, align 8, !tbaa !50
  call void @_ZL46hw_iaa_descriptor_compress_set_mini_block_sizeP13hw_descriptor24hw_iaa_mini_block_size_t(ptr noundef %155, i32 noundef %158)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #1
  %159 = load i8, ptr %14, align 1, !tbaa !22, !range !27, !noundef !28
  %160 = trunc i8 %159 to i1
  br i1 %160, label %161, label %166

161:                                              ; preds = %154
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.qpl_hw_state, ptr %162, i32 0, i32 7
  %164 = load i32, ptr %163, align 4, !tbaa !51
  %165 = or i32 16, %164
  br label %171

166:                                              ; preds = %154
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.qpl_hw_state, ptr %167, i32 0, i32 7
  %169 = load i32, ptr %168, align 4, !tbaa !51
  %170 = or i32 272, %169
  br label %171

171:                                              ; preds = %166, %161
  %172 = phi i32 [ %165, %161 ], [ %170, %166 ]
  store i32 %172, ptr %22, align 4, !tbaa !21
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.qpl_hw_state, ptr %174, i32 0, i32 3
  %176 = getelementptr inbounds [2 x %struct.hw_iaa_aecs_compress], ptr %175, i64 0, i64 0
  %177 = load i32, ptr %22, align 4, !tbaa !21
  %178 = call noundef zeroext i1 @_ZN3qpl2ml4util38are_iaa_gen_2_min_capabilities_presentEv()
  %179 = xor i1 %178, true
  call void @hw_iaa_descriptor_compress_set_aecs(ptr noundef %173, ptr noundef %176, i32 noundef %177, i1 noundef zeroext %179)
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = load ptr, ptr %11, align 8, !tbaa !5
  call void @hw_iaa_descriptor_set_completion_record(ptr noundef %180, ptr noundef %181)
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.hw_iaa_completion_record, ptr %182, i32 0, i32 0
  store i8 0, ptr %183, align 1, !tbaa !52
  %184 = load i8, ptr %13, align 1, !tbaa !22, !range !27, !noundef !28
  %185 = trunc i8 %184 to i1
  br i1 %185, label %193, label %186

186:                                              ; preds = %171
  %187 = load ptr, ptr %7, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.hw_decompress_analytics_descriptor, ptr %187, i32 0, i32 7
  %189 = load i16, ptr %188, align 1, !tbaa !53
  %190 = zext i16 %189 to i32
  %191 = or i32 %190, 4
  %192 = trunc i32 %191 to i16
  store i16 %192, ptr %188, align 1, !tbaa !53
  br label %193

193:                                              ; preds = %186, %171
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #1
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #1
  br label %194

194:                                              ; preds = %193, %47
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #1
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #1
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #1
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #1
  %195 = load i32, ptr %6, align 4
  ret i32 %195
}

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

declare void @hw_iaa_aecs_compress_set_huffman_only_huffman_table_from_histogram(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_sw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) #2

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE38get_isal_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) #2

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_hw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) #2

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE22get_deflate_header_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) #2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression25compression_huffman_tableC1EPhS3_S3_S3_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #2

declare void @hw_iaa_aecs_compress_store_huffman_only_huffman_table(ptr noundef, ptr noundef) #4

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression25compression_huffman_table24get_sw_compression_tableEv(ptr noundef nonnull align 8 dereferenceable(36)) #2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE28set_deflate_header_bits_sizeEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) #2

declare void @hw_iaa_aecs_compress_write_deflate_dynamic_header_from_histogram(ptr noundef, ptr noundef, i32 noundef) #4

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

!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, !11, i64 36}
!10 = !{!"_ZTS7qpl_job", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !11, i64 24, !11, i64 28, !12, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !13, i64 52, !14, i64 56, !6, i64 64, !6, i64 72, !15, i64 80, !6, i64 88, !11, i64 96, !11, i64 100, !7, i64 104, !7, i64 105, !7, i64 106, !16, i64 112, !16, i64 120, !6, i64 128, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !17, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !18, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !11, i64 188, !19, i64 192}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS13qpl_operation", !7, i64 0}
!13 = !{!"_ZTS22qpl_compression_levels", !7, i64 0}
!14 = !{!"_ZTS19qpl_statistics_mode", !7, i64 0}
!15 = !{!"_ZTS19qpl_mini_block_size", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_ZTS14qpl_out_format", !7, i64 0}
!18 = !{!"_ZTS10qpl_parser", !7, i64 0}
!19 = !{!"_ZTS12qpl_aux_data", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !20, i64 40}
!20 = !{!"_ZTS10qpl_path_t", !7, i64 0}
!21 = !{!11, !11, i64 0}
!22 = !{!23, !23, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"branch_weights", i32 1, i32 1048575}
!25 = !{!26, !26, i64 0}
!26 = !{!"_ZTS21hw_accelerator_status", !7, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!30, !11, i64 39664}
!30 = !{!"_ZTS12qpl_hw_state", !31, i64 0, !33, i64 64, !7, i64 128, !7, i64 10880, !34, i64 38592, !35, i64 39624, !11, i64 39648, !11, i64 39652, !11, i64 39656, !38, i64 39660, !11, i64 39664, !39, i64 39672, !11, i64 39704, !11, i64 39708, !23, i64 39712, !23, i64 39713, !41, i64 39716, !42, i64 39720, !43, i64 39728}
!31 = !{!"_ZTS34hw_decompress_analytics_descriptor", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !32, i64 36, !32, i64 38, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60}
!32 = !{!"short", !7, i64 0}
!33 = !{!"_ZTS24hw_iaa_completion_record", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !16, i64 8, !16, i64 16, !11, i64 24, !7, i64 28, !7, i64 29, !32, i64 30, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !16, i64 48, !16, i64 56}
!34 = !{!"_ZTS10qpl_buffer", !7, i64 0, !11, i64 1024, !11, i64 1028}
!35 = !{!"_ZTS21qpl_execution_history", !23, i64 0, !36, i64 4, !37, i64 8, !11, i64 12, !6, i64 16}
!36 = !{!"_ZTS23qpl_task_execution_step", !7, i64 0}
!37 = !{!"_ZTS14qpl_comp_style", !7, i64 0}
!38 = !{!"_ZTS15hw_huffman_code", !32, i64 0, !7, i64 2, !7, i64 3}
!39 = !{!"_ZTS22hw_accelerator_context", !40, i64 0, !6, i64 24}
!40 = !{!"_ZTS20hw_device_properties", !11, i64 0, !11, i64 4, !11, i64 8, !23, i64 12, !23, i64 13, !23, i64 14, !23, i64 15, !23, i64 16, !23, i64 17, !23, i64 18, !23, i64 19, !23, i64 20, !23, i64 21, !23, i64 22}
!41 = !{!"_ZTS25hw_multidescriptor_status", !7, i64 0}
!42 = !{!"_ZTS10qpl_status", !7, i64 0}
!43 = !{!"_ZTS20qpl_execution_record", !44, i64 0, !11, i64 8, !11, i64 12}
!44 = !{!"double", !7, i64 0}
!45 = !{!10, !6, i64 64}
!46 = !{!10, !11, i64 24}
!47 = !{!10, !6, i64 0}
!48 = !{!10, !11, i64 8}
!49 = !{!10, !6, i64 16}
!50 = !{!10, !15, i64 80}
!51 = !{!30, !11, i64 39652}
!52 = !{!33, !7, i64 0}
!53 = !{!31, !32, i64 38}


; 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.qpl::ml::compression::compression_huffman_table" = type <{ ptr, ptr, ptr, ptr, i8, i8, i8, i8, [4 x i8] }>

@_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher = external hidden local_unnamed_addr global ptr, align 8
@_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher = external hidden global i64, align 8

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(975232) ptr @_ZN3qpl2ml10dispatcher13hw_dispatcher12get_instanceEv() local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qpl2ml10dispatcher13hw_dispatcher13is_hw_supportEv(ptr noundef nonnull align 8 dereferenceable(975232)) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef i32 @_ZNK3qpl2ml10dispatcher13hw_dispatcher18get_hw_init_statusEv(ptr noundef nonnull align 8 dereferenceable(975232)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3qpl2ml4util43convert_hw_accelerator_status_to_qpl_statusEj(i32 noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(9752) ptr @_ZNK3qpl2ml10dispatcher13hw_dispatcher6deviceEm(ptr noundef nonnull align 8 dereferenceable(975232), i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qpl2ml10dispatcher9hw_device22get_header_gen_supportEv(ptr noundef nonnull align 8 dereferenceable(9752)) local_unnamed_addr #2

declare void @hw_iaa_descriptor_init_deflate_body(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL48hw_iaa_descriptor_compress_set_huffman_only_modeP13hw_descriptor(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL46hw_iaa_descriptor_compress_set_mini_block_sizeP13hw_descriptor24hw_iaa_mini_block_size_t(ptr noundef, i32 noundef) local_unnamed_addr #3

declare void @hw_iaa_descriptor_set_completion_record(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z20use_as_huffman_tableILN3qpl2ml11compression23compression_algorithm_eE2EEDaP17qpl_huffman_table(ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL45hw_iaa_descriptor_compress_set_be_output_modeP13hw_descriptor(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL33hw_iaa_descriptor_set_crc_rfc3720P13hw_descriptor(ptr noundef) local_unnamed_addr #3

declare void @hw_iaa_descriptor_compress_set_aecs(ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN3qpl2ml4util38are_iaa_gen_2_min_capabilities_presentEv() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @hw_descriptor_compress_init_deflate_dynamic(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #6 {
  %6 = alloca %"class.qpl::ml::compression::compression_huffman_table", align 8
  %7 = getelementptr inbounds i8, ptr %2, i64 36
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = and i32 %8, 32
  %.not = icmp eq i32 %9, 0
  %10 = and i32 %8, 2
  %.not54 = icmp eq i32 %10, 0
  %11 = load atomic i8, ptr @_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher acquire, align 8
  %12 = icmp eq i8 %11, 0
  br i1 %12, label %13, label %17, !prof !20

13:                                               ; preds = %5
  %14 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher) #7
  %.not53 = icmp eq i32 %14, 0
  br i1 %.not53, label %17, label %15

15:                                               ; preds = %13
  %16 = tail call noundef nonnull align 8 dereferenceable(975232) ptr @_ZN3qpl2ml10dispatcher13hw_dispatcher12get_instanceEv() #7
  store ptr %16, ptr @_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher, align 8, !tbaa !21
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher) #7
  br label %17

17:                                               ; preds = %15, %13, %5
  %18 = load ptr, ptr @_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher, align 8, !tbaa !21
  %19 = tail call noundef zeroext i1 @_ZNK3qpl2ml10dispatcher13hw_dispatcher13is_hw_supportEv(ptr noundef nonnull align 8 dereferenceable(975232) %18) #7
  %20 = load ptr, ptr @_ZZ43hw_descriptor_compress_init_deflate_dynamicE10dispatcher, align 8, !tbaa !21
  br i1 %19, label %24, label %21

21:                                               ; preds = %17
  %22 = tail call noundef i32 @_ZNK3qpl2ml10dispatcher13hw_dispatcher18get_hw_init_statusEv(ptr noundef nonnull align 8 dereferenceable(975232) %20) #7
  %23 = tail call noundef i32 @_ZN3qpl2ml4util43convert_hw_accelerator_status_to_qpl_statusEj(i32 noundef %22)
  br label %77

24:                                               ; preds = %17
  %25 = tail call noundef nonnull align 8 dereferenceable(9752) ptr @_ZNK3qpl2ml10dispatcher13hw_dispatcher6deviceEm(ptr noundef nonnull align 8 dereferenceable(975232) %20, i64 noundef 0) #7
  %26 = tail call noundef zeroext i1 @_ZNK3qpl2ml10dispatcher9hw_device22get_header_gen_supportEv(ptr noundef nonnull align 8 dereferenceable(9752) %25) #7
  %27 = tail call noundef i32 @_ZL48hw_iaa_aecs_compress_accumulator_get_actual_bitsPK20hw_iaa_aecs_compress(ptr noundef %3)
  %28 = getelementptr inbounds i8, ptr %1, i64 39664
  store i32 %27, ptr %28, align 8, !tbaa !22
  br i1 %.not, label %39, label %29

29:                                               ; preds = %24
  %30 = getelementptr inbounds i8, ptr %3, i64 288
  tail call void @hw_iaa_aecs_compress_set_huffman_only_huffman_table_from_histogram(ptr noundef %3, ptr noundef nonnull %30)
  %31 = getelementptr inbounds i8, ptr %2, i64 64
  %32 = load ptr, ptr %31, align 8, !tbaa !39
  %33 = tail call noundef ptr @_Z20use_as_huffman_tableILN3qpl2ml11compression23compression_algorithm_eE2EEDaP17qpl_huffman_table(ptr noundef %32)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #7
  %34 = tail call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_sw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %33) #7
  %35 = tail call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE38get_isal_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %33) #7
  %36 = tail call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_hw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %33) #7
  %37 = tail call noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE22get_deflate_header_ptrEv(ptr noundef nonnull align 8 dereferenceable(72) %33) #7
  call void @_ZN3qpl2ml11compression25compression_huffman_tableC1EPhS3_S3_S3_(ptr noundef nonnull align 8 dereferenceable(36) %6, ptr noundef %34, ptr noundef %35, ptr noundef %36, ptr noundef %37) #7
  %38 = call noundef ptr @_ZNK3qpl2ml11compression25compression_huffman_table24get_sw_compression_tableEv(ptr noundef nonnull align 8 dereferenceable(36) %6) #7
  call void @hw_iaa_aecs_compress_store_huffman_only_huffman_table(ptr noundef %3, ptr noundef %38)
  call void @_ZN3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE28set_deflate_header_bits_sizeEj(ptr noundef nonnull align 8 dereferenceable(72) %33, i32 noundef 0) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #7
  br label %42

39:                                               ; preds = %24
  br i1 %26, label %42, label %40

40:                                               ; preds = %39
  %41 = getelementptr inbounds i8, ptr %3, i64 288
  %.lobit = lshr exact i32 %10, 1
  tail call void @hw_iaa_aecs_compress_write_deflate_dynamic_header_from_histogram(ptr noundef %3, ptr noundef nonnull %41, i32 noundef %.lobit)
  br label %42

42:                                               ; preds = %39, %40, %29
  %43 = getelementptr inbounds i8, ptr %2, i64 24
  %44 = load i32, ptr %43, align 8, !tbaa !40
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = and i32 %45, 10
  %47 = icmp eq i32 %46, 10
  %48 = icmp ugt i32 %44, 8
  %49 = add i32 %44, -8
  %50 = and i1 %48, %47
  %.052 = select i1 %50, i32 %49, i32 %44
  %51 = load ptr, ptr %2, align 8, !tbaa !41
  %52 = getelementptr inbounds i8, ptr %2, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !42
  %54 = getelementptr inbounds i8, ptr %2, i64 16
  %55 = load ptr, ptr %54, align 8, !tbaa !43
  call void @hw_iaa_descriptor_init_deflate_body(ptr noundef %0, ptr noundef %51, i32 noundef %53, ptr noundef %55, i32 noundef %.052)
  %56 = and i32 %8, 16
  %.not55 = icmp eq i32 %56, 0
  br i1 %.not55, label %58, label %57

57:                                               ; preds = %42
  call void @_ZL45hw_iaa_descriptor_compress_set_be_output_modeP13hw_descriptor(ptr noundef %0)
  br label %58

58:                                               ; preds = %57, %42
  %59 = and i32 %8, 32768
  %.not56 = icmp eq i32 %59, 0
  br i1 %.not56, label %61, label %60

60:                                               ; preds = %58
  call void @_ZL48hw_iaa_descriptor_compress_set_huffman_only_modeP13hw_descriptor(ptr noundef %0)
  br label %61

61:                                               ; preds = %60, %58
  %62 = and i32 %8, 4
  %.not57 = icmp eq i32 %62, 0
  br i1 %.not57, label %64, label %63

63:                                               ; preds = %61
  call void @_ZL33hw_iaa_descriptor_set_crc_rfc3720P13hw_descriptor(ptr noundef %0)
  br label %64

64:                                               ; preds = %63, %61
  %65 = getelementptr inbounds i8, ptr %2, i64 80
  %66 = load i32, ptr %65, align 8, !tbaa !44
  call void @_ZL46hw_iaa_descriptor_compress_set_mini_block_sizeP13hw_descriptor24hw_iaa_mini_block_size_t(ptr noundef %0, i32 noundef %66)
  %67 = getelementptr inbounds i8, ptr %1, i64 39652
  %68 = load i32, ptr %67, align 4, !tbaa !45
  %. = select i1 %.not54, i32 272, i32 16
  %69 = or i32 %68, %.
  %70 = getelementptr inbounds i8, ptr %1, i64 10880
  %71 = call noundef zeroext i1 @_ZN3qpl2ml4util38are_iaa_gen_2_min_capabilities_presentEv()
  %72 = xor i1 %71, true
  call void @hw_iaa_descriptor_compress_set_aecs(ptr noundef %0, ptr noundef nonnull %70, i32 noundef %69, i1 noundef zeroext %72)
  call void @hw_iaa_descriptor_set_completion_record(ptr noundef %0, ptr noundef %4)
  store i8 0, ptr %4, align 1, !tbaa !46
  br i1 %.not, label %73, label %77

73:                                               ; preds = %64
  %74 = getelementptr inbounds i8, ptr %0, i64 38
  %75 = load i16, ptr %74, align 1, !tbaa !47
  %76 = or i16 %75, 4
  store i16 %76, ptr %74, align 1, !tbaa !47
  br label %77

77:                                               ; preds = %64, %73, %21
  %.0 = phi i32 [ %23, %21 ], [ 0, %73 ], [ 0, %64 ]
  ret i32 %.0
}

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

declare void @hw_iaa_aecs_compress_set_huffman_only_huffman_table_from_histogram(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_sw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE38get_isal_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE36get_hw_compression_huffman_table_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE22get_deflate_header_ptrEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression25compression_huffman_tableC1EPhS3_S3_S3_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef, ptr noundef, ptr noundef, ptr noundef) unnamed_addr #2

declare void @hw_iaa_aecs_compress_store_huffman_only_huffman_table(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare noundef ptr @_ZNK3qpl2ml11compression25compression_huffman_table24get_sw_compression_tableEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE2EE28set_deflate_header_bits_sizeEj(ptr noundef nonnull align 8 dereferenceable(72), i32 noundef) local_unnamed_addr #2

declare void @hw_iaa_aecs_compress_write_deflate_dynamic_header_from_histogram(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

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

!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 36}
!6 = !{!"_ZTS7qpl_job", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16, !10, i64 24, !10, i64 28, !11, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !12, i64 52, !13, i64 56, !7, i64 64, !7, i64 72, !14, i64 80, !7, i64 88, !10, i64 96, !10, i64 100, !8, i64 104, !8, i64 105, !8, i64 106, !15, i64 112, !15, i64 120, !7, i64 128, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !16, i64 152, !10, i64 156, !10, i64 160, !10, i64 164, !10, i64 168, !17, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !18, i64 192}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTS13qpl_operation", !8, i64 0}
!12 = !{!"_ZTS22qpl_compression_levels", !8, i64 0}
!13 = !{!"_ZTS19qpl_statistics_mode", !8, i64 0}
!14 = !{!"_ZTS19qpl_mini_block_size", !8, i64 0}
!15 = !{!"long", !8, i64 0}
!16 = !{!"_ZTS14qpl_out_format", !8, i64 0}
!17 = !{!"_ZTS10qpl_parser", !8, i64 0}
!18 = !{!"_ZTS12qpl_aux_data", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !19, i64 40}
!19 = !{!"_ZTS10qpl_path_t", !8, i64 0}
!20 = !{!"branch_weights", i32 1, i32 1048575}
!21 = !{!7, !7, i64 0}
!22 = !{!23, !10, i64 39664}
!23 = !{!"_ZTS12qpl_hw_state", !24, i64 0, !26, i64 64, !8, i64 128, !8, i64 10880, !27, i64 38592, !28, i64 39624, !10, i64 39648, !10, i64 39652, !10, i64 39656, !32, i64 39660, !10, i64 39664, !33, i64 39672, !10, i64 39704, !10, i64 39708, !29, i64 39712, !29, i64 39713, !35, i64 39716, !36, i64 39720, !37, i64 39728}
!24 = !{!"_ZTS34hw_decompress_analytics_descriptor", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !25, i64 36, !25, i64 38, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60}
!25 = !{!"short", !8, i64 0}
!26 = !{!"_ZTS24hw_iaa_completion_record", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !10, i64 4, !15, i64 8, !15, i64 16, !10, i64 24, !8, i64 28, !8, i64 29, !25, i64 30, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !15, i64 48, !15, i64 56}
!27 = !{!"_ZTS10qpl_buffer", !8, i64 0, !10, i64 1024, !10, i64 1028}
!28 = !{!"_ZTS21qpl_execution_history", !29, i64 0, !30, i64 4, !31, i64 8, !10, i64 12, !7, i64 16}
!29 = !{!"bool", !8, i64 0}
!30 = !{!"_ZTS23qpl_task_execution_step", !8, i64 0}
!31 = !{!"_ZTS14qpl_comp_style", !8, i64 0}
!32 = !{!"_ZTS15hw_huffman_code", !25, i64 0, !8, i64 2, !8, i64 3}
!33 = !{!"_ZTS22hw_accelerator_context", !34, i64 0, !7, i64 24}
!34 = !{!"_ZTS20hw_device_properties", !10, i64 0, !10, i64 4, !10, i64 8, !29, i64 12, !29, i64 13, !29, i64 14, !29, i64 15, !29, i64 16, !29, i64 17, !29, i64 18, !29, i64 19, !29, i64 20, !29, i64 21, !29, i64 22}
!35 = !{!"_ZTS25hw_multidescriptor_status", !8, i64 0}
!36 = !{!"_ZTS10qpl_status", !8, i64 0}
!37 = !{!"_ZTS20qpl_execution_record", !38, i64 0, !10, i64 8, !10, i64 12}
!38 = !{!"double", !8, i64 0}
!39 = !{!6, !7, i64 64}
!40 = !{!6, !10, i64 24}
!41 = !{!6, !7, i64 0}
!42 = !{!6, !10, i64 8}
!43 = !{!6, !7, i64 16}
!44 = !{!6, !14, i64 80}
!45 = !{!23, !10, i64 39652}
!46 = !{!26, !8, i64 0}
!47 = !{!24, !25, i64 38}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass