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

; 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::deflate_state" = type { %"class.qpl::ml::compression::compression_stream.base", ptr, ptr, %"class.qpl::ml::compression::huffman_table_icf", %struct.deflate_hash_table_t, %"class.qpl::ml::compression::index_table_t", i8, i8, ptr, i8, ptr, i32, i32, i32, i8, ptr, ptr }
%"class.qpl::ml::compression::compression_stream.base" = type <{ ptr, %"struct.qpl::ml::util::checksum_accumulator", i8, i8, %"struct.qpl::ml::compression::chunk_type", i32, i32 }>
%"struct.qpl::ml::util::checksum_accumulator" = type { i32, i32 }
%"struct.qpl::ml::compression::chunk_type" = type { i8, i8 }
%"class.qpl::ml::compression::huffman_table_icf" = type { ptr, i32, i32 }
%struct.deflate_hash_table_t = type { ptr, ptr, i32, i32, i32, i32, i32 }
%"class.qpl::ml::compression::index_table_t" = type <{ ptr, i32, i32, i32, [4 x i8] }>
%struct.isal_zstream = type { ptr, i32, i32, ptr, i32, i32, ptr, i32, i32, ptr, i16, i16, i16, i16, %struct.isal_zstate }
%struct.isal_zstate = type { i32, i32, i32, i32, i32, i32, %struct.BitBuf2, i32, i8, i8, i8, i8, i16, i32, [16 x i8], i32, i32, i32, i32, [65824 x i8], [8192 x i16] }
%struct.BitBuf2 = type { i64, i32, ptr, ptr, ptr }
%struct.level_buf = type { %struct.hufftables_icf, %struct.isal_mod_hist, i32, i32, [328 x i8], ptr, i64, ptr, %union.anon.4 }
%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] }
%union.anon.4 = type { %struct.hash_map_buf }
%struct.hash_map_buf = type { [32768 x i16], ptr, ptr, [4096 x %struct.deflate_icf], [288 x %struct.deflate_icf] }
%struct.deflate_icf = type { i32 }

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN3qpl2ml11compression25write_buffered_icf_headerERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull align 1 dereferenceable(1) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %16, i32 0, i32 1
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct.isal_zstream, ptr %18, i32 0, i32 14
  store ptr %19, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.isal_zstate, ptr %20, i32 0, i32 6
  store ptr %21, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %22, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.isal_zstream, ptr %24, i32 0, i32 9
  %26 = load ptr, ptr %25, align 8, !tbaa !23
  store ptr %26, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.level_buf, ptr %27, i32 0, i32 4
  %29 = getelementptr inbounds [328 x i8], ptr %28, i64 0, i64 0
  store ptr %29, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.level_buf, ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 4, !tbaa !30
  store i32 %32, ptr %10, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.level_buf, ptr %33, i32 0, i32 3
  %35 = load i32, ptr %34, align 8, !tbaa !35
  store i32 %35, ptr %11, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = load i32, ptr %10, align 4, !tbaa !34
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %36, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !36
  %41 = zext i8 %40 to i32
  store i32 %41, ptr %12, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %42 = load i32, ptr %10, align 4, !tbaa !34
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.isal_zstate, ptr %43, i32 0, i32 13
  %45 = load i32, ptr %44, align 4, !tbaa !37
  %46 = sub i32 %42, %45
  store i32 %46, ptr %13, align 4, !tbaa !34
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.BitBuf2, ptr %47, i32 0, i32 1
  %49 = load i32, ptr %48, align 8, !tbaa !38
  %50 = icmp ne i32 %49, 0
  br i1 %50, label %51, label %64

51:                                               ; preds = %2
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = getelementptr inbounds %struct.isal_zstream, ptr %54, i32 0, i32 4
  %56 = load i32, ptr %55, align 8, !tbaa !39
  %57 = icmp ult i32 %56, 8
  br i1 %57, label %58, label %59

58:                                               ; preds = %51
  store i32 2, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %153

59:                                               ; preds = %51
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %60) #6
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZL5flushP7BitBuf2(ptr noundef %61)
          to label %62 unwind label %155

62:                                               ; preds = %59
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %63) #6
  br label %64

64:                                               ; preds = %62, %2
  %65 = load i32, ptr %13, align 4, !tbaa !34
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %130

67:                                               ; preds = %64
  %68 = load i32, ptr %13, align 4, !tbaa !34
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %69, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.isal_zstream, ptr %71, i32 0, i32 4
  %73 = load i32, ptr %72, align 8, !tbaa !39
  %74 = icmp ugt i32 %68, %73
  br i1 %74, label %75, label %81

75:                                               ; preds = %67
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.isal_zstream, ptr %78, i32 0, i32 4
  %80 = load i32, ptr %79, align 8, !tbaa !39
  store i32 %80, ptr %13, align 4, !tbaa !34
  br label %81

81:                                               ; preds = %75, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.isal_zstate, ptr %83, i32 0, i32 13
  %85 = load i32, ptr %84, align 4, !tbaa !37
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %82, i64 %86
  store ptr %87, ptr %15, align 8, !tbaa !5
  %88 = load ptr, ptr %15, align 8, !tbaa !5
  %89 = load ptr, ptr %15, align 8, !tbaa !5
  %90 = load i32, ptr %13, align 4, !tbaa !34
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %93, i32 0, i32 1
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.isal_zstream, ptr %95, i32 0, i32 3
  %97 = load ptr, ptr %96, align 8, !tbaa !40
  call void @_ZN3qpl7core_sw4util4copyIPhS3_EEvT_S4_T0_(ptr noundef %88, ptr noundef %92, ptr noundef %97) #6
  %98 = load i32, ptr %13, align 4, !tbaa !34
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.isal_zstream, ptr %101, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !40
  %104 = zext i32 %98 to i64
  %105 = getelementptr inbounds i8, ptr %103, i64 %104
  store ptr %105, ptr %102, align 8, !tbaa !40
  %106 = load i32, ptr %13, align 4, !tbaa !34
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.isal_zstream, ptr %109, i32 0, i32 4
  %111 = load i32, ptr %110, align 8, !tbaa !39
  %112 = sub i32 %111, %106
  store i32 %112, ptr %110, align 8, !tbaa !39
  %113 = load i32, ptr %13, align 4, !tbaa !34
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %114, i32 0, i32 1
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds %struct.isal_zstream, ptr %116, i32 0, i32 5
  %118 = load i32, ptr %117, align 4, !tbaa !41
  %119 = add i32 %118, %113
  store i32 %119, ptr %117, align 4, !tbaa !41
  %120 = load i32, ptr %13, align 4, !tbaa !34
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.isal_zstate, ptr %121, i32 0, i32 13
  %123 = load i32, ptr %122, align 4, !tbaa !37
  %124 = add i32 %123, %120
  store i32 %124, ptr %122, align 4, !tbaa !37
  %125 = load i32, ptr %10, align 4, !tbaa !34
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.isal_zstate, ptr %126, i32 0, i32 13
  %128 = load i32, ptr %127, align 4, !tbaa !37
  %129 = sub i32 %125, %128
  store i32 %129, ptr %13, align 4, !tbaa !34
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %130

130:                                              ; preds = %81, %64
  %131 = load i32, ptr %13, align 4, !tbaa !34
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %133, label %150

133:                                              ; preds = %130
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %134, i32 0, i32 1
  %136 = load ptr, ptr %135, align 8, !tbaa !9
  %137 = getelementptr inbounds %struct.isal_zstream, ptr %136, i32 0, i32 4
  %138 = load i32, ptr %137, align 8, !tbaa !39
  %139 = icmp uge i32 %138, 8
  br i1 %139, label %140, label %150

140:                                              ; preds = %133
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %141) #6
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = load i32, ptr %12, align 4, !tbaa !34
  %144 = zext i32 %143 to i64
  %145 = load i32, ptr %11, align 4, !tbaa !34
  invoke void @_ZL10write_bitsP7BitBuf2mj(ptr noundef %142, i64 noundef %144, i32 noundef %145)
          to label %146 unwind label %155

146:                                              ; preds = %140
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.isal_zstate, ptr %147, i32 0, i32 13
  store i32 0, ptr %148, align 4, !tbaa !37
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %149) #6
  br label %151

150:                                              ; preds = %133, %130
  store i32 2, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %153

151:                                              ; preds = %146
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 7, ptr %152, align 1, !tbaa !42
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %153

153:                                              ; preds = %151, %150, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  %154 = load i32, ptr %3, align 4
  ret i32 %154

155:                                              ; preds = %140, %59
  %156 = landingpad { ptr, i32 }
          catch ptr null
  %157 = extractvalue { ptr, i32 } %156, 0
  call void @__clang_call_terminate(ptr %157) #7
  unreachable
}

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

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192)) #2

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192)) #2

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

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

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

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 = { 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 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 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { 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, !6, i64 32}
!10 = !{!"_ZTSN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EEE", !11, i64 0, !6, i64 32, !6, i64 40, !18, i64 48, !19, i64 64, !20, i64 104, !21, i64 128, !22, i64 129, !6, i64 136, !17, i64 144, !6, i64 152, !13, i64 160, !13, i64 164, !13, i64 168, !17, i64 172, !6, i64 176, !6, i64 184}
!11 = !{!"_ZTSN3qpl2ml11compression18compression_streamE", !12, i64 8, !14, i64 16, !15, i64 17, !16, i64 18, !13, i64 20, !13, i64 24}
!12 = !{!"_ZTSN3qpl2ml4util20checksum_accumulatorE", !13, i64 0, !13, i64 4}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSN3qpl2ml11compression18compression_mode_tE", !7, i64 0}
!15 = !{!"_ZTSN3qpl2ml11compression17mini_block_size_tE", !7, i64 0}
!16 = !{!"_ZTSN3qpl2ml11compression10chunk_typeE", !17, i64 0, !17, i64 1}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTSN3qpl2ml11compression17huffman_table_icfE", !6, i64 0, !13, i64 8, !13, i64 12}
!19 = !{!"_ZTS20deflate_hash_table_t", !6, i64 0, !6, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32}
!20 = !{!"_ZTSN3qpl2ml11compression13index_table_tE", !6, i64 0, !13, i64 8, !13, i64 12, !13, i64 16}
!21 = !{!"_ZTSN3qpl2ml11compression19compression_level_tE", !7, i64 0}
!22 = !{!"_ZTSN3qpl2ml11compression20dictionary_support_tE", !7, i64 0}
!23 = !{!24, !6, i64 48}
!24 = !{!"_ZTS12isal_zstream", !6, i64 0, !13, i64 8, !13, i64 12, !6, i64 16, !13, i64 24, !13, i64 28, !6, i64 32, !13, i64 40, !13, i64 44, !6, i64 48, !25, i64 56, !25, i64 58, !25, i64 60, !25, i64 62, !26, i64 64}
!25 = !{!"short", !7, i64 0}
!26 = !{!"_ZTS11isal_zstate", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !27, i64 20, !28, i64 24, !13, i64 64, !7, i64 68, !7, i64 69, !7, i64 70, !7, i64 71, !25, i64 72, !13, i64 76, !7, i64 80, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !7, i64 112, !7, i64 65936}
!27 = !{!"_ZTS17isal_zstate_state", !7, i64 0}
!28 = !{!"_ZTS7BitBuf2", !29, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!29 = !{!"long", !7, i64 0}
!30 = !{!31, !13, i64 4348}
!31 = !{!"_ZTS9level_buf", !32, i64 0, !33, i64 2176, !13, i64 4348, !13, i64 4352, !7, i64 4356, !6, i64 4688, !29, i64 4696, !6, i64 4704, !7, i64 4712}
!32 = !{!"_ZTS14hufftables_icf", !7, i64 0}
!33 = !{!"_ZTS13isal_mod_hist", !7, i64 0, !7, i64 120}
!34 = !{!13, !13, i64 0}
!35 = !{!31, !13, i64 4352}
!36 = !{!7, !7, i64 0}
!37 = !{!26, !13, i64 76}
!38 = !{!28, !13, i64 8}
!39 = !{!24, !13, i64 24}
!40 = !{!24, !6, i64 16}
!41 = !{!24, !13, i64 28}
!42 = !{!43, !43, i64 0}
!43 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !7, i64 0}


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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 3) i32 @_ZN3qpl2ml11compression25write_buffered_icf_headerERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 88
  %6 = getelementptr inbounds i8, ptr %4, i64 48
  %7 = load ptr, ptr %6, align 8, !tbaa !22
  %8 = getelementptr inbounds i8, ptr %7, i64 4356
  %9 = getelementptr inbounds i8, ptr %7, i64 4348
  %10 = load i32, ptr %9, align 4, !tbaa !29
  %11 = getelementptr inbounds i8, ptr %7, i64 4352
  %12 = load i32, ptr %11, align 8, !tbaa !33
  %13 = zext i32 %10 to i64
  %14 = getelementptr inbounds i8, ptr %8, i64 %13
  %15 = load i8, ptr %14, align 1, !tbaa !34
  %16 = getelementptr inbounds i8, ptr %4, i64 140
  %17 = load i32, ptr %16, align 4, !tbaa !35
  %18 = sub i32 %10, %17
  %19 = getelementptr inbounds i8, ptr %4, i64 96
  %20 = load i32, ptr %19, align 8, !tbaa !36
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %27, label %21

21:                                               ; preds = %2
  %22 = getelementptr inbounds i8, ptr %4, i64 24
  %23 = load i32, ptr %22, align 8, !tbaa !37
  %24 = icmp ult i32 %23, 8
  br i1 %24, label %54, label %25

25:                                               ; preds = %21
  tail call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #6
  invoke void @_ZL5flushP7BitBuf2(ptr noundef nonnull %5)
          to label %26 unwind label %55

26:                                               ; preds = %25
  tail call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #6
  %.pre.pre = load ptr, ptr %3, align 8, !tbaa !5
  br label %27

27:                                               ; preds = %26, %2
  %.pre = phi ptr [ %.pre.pre, %26 ], [ %4, %2 ]
  %.not48 = icmp eq i32 %10, %17
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 24
  %.pre49 = load i32, ptr %.phi.trans.insert, align 8, !tbaa !37
  br i1 %.not48, label %.critedge, label %28

28:                                               ; preds = %27
  %spec.select = tail call i32 @llvm.umin.i32(i32 %18, i32 %.pre49)
  %29 = load i32, ptr %16, align 4, !tbaa !35
  %30 = zext i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr %8, i64 %30
  %32 = zext i32 %spec.select to i64
  %33 = getelementptr inbounds i8, ptr %31, i64 %32
  %34 = getelementptr inbounds i8, ptr %.pre, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !38
  tail call void @_ZN3qpl7core_sw4util4copyIPhS3_EEvT_S4_T0_(ptr noundef nonnull %31, ptr noundef nonnull %33, ptr noundef %35) #6
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !38
  %39 = getelementptr inbounds i8, ptr %38, i64 %32
  store ptr %39, ptr %37, align 8, !tbaa !38
  %40 = getelementptr inbounds i8, ptr %36, i64 24
  %41 = load i32, ptr %40, align 8, !tbaa !37
  %42 = sub i32 %41, %spec.select
  store i32 %42, ptr %40, align 8, !tbaa !37
  %43 = getelementptr inbounds i8, ptr %36, i64 28
  %44 = load i32, ptr %43, align 4, !tbaa !39
  %45 = add i32 %44, %spec.select
  store i32 %45, ptr %43, align 4, !tbaa !39
  %46 = load i32, ptr %16, align 4, !tbaa !35
  %47 = add i32 %46, %spec.select
  store i32 %47, ptr %16, align 4, !tbaa !35
  %48 = icmp eq i32 %10, %47
  br i1 %48, label %.critedge, label %54

.critedge:                                        ; preds = %27, %28
  %49 = phi i32 [ %42, %28 ], [ %.pre49, %27 ]
  %50 = icmp ugt i32 %49, 7
  br i1 %50, label %51, label %54

51:                                               ; preds = %.critedge
  tail call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #6
  %52 = zext i8 %15 to i64
  invoke void @_ZL10write_bitsP7BitBuf2mj(ptr noundef nonnull %5, i64 noundef %52, i32 noundef %12)
          to label %53 unwind label %55

53:                                               ; preds = %51
  store i32 0, ptr %16, align 4, !tbaa !35
  tail call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #6
  store i8 7, ptr %1, align 1, !tbaa !40
  br label %54

54:                                               ; preds = %28, %.critedge, %21, %53
  %.0 = phi i32 [ 0, %53 ], [ 2, %21 ], [ 2, %.critedge ], [ 2, %28 ]
  ret i32 %.0

55:                                               ; preds = %51, %25
  %56 = landingpad { ptr, i32 }
          catch ptr null
  %57 = extractvalue { ptr, i32 } %56, 0
  tail call void @__clang_call_terminate(ptr %57) #7
  unreachable
}

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @_ZL5flushP7BitBuf2(ptr noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #1

; 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 #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #5

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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, !16, i64 32}
!6 = !{!"_ZTSN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EEE", !7, i64 0, !16, i64 32, !16, i64 40, !17, i64 48, !18, i64 64, !19, i64 104, !20, i64 128, !21, i64 129, !16, i64 136, !15, i64 144, !16, i64 152, !9, i64 160, !9, i64 164, !9, i64 168, !15, i64 172, !16, i64 176, !16, i64 184}
!7 = !{!"_ZTSN3qpl2ml11compression18compression_streamE", !8, i64 8, !12, i64 16, !13, i64 17, !14, i64 18, !9, i64 20, !9, i64 24}
!8 = !{!"_ZTSN3qpl2ml4util20checksum_accumulatorE", !9, i64 0, !9, i64 4}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN3qpl2ml11compression18compression_mode_tE", !10, i64 0}
!13 = !{!"_ZTSN3qpl2ml11compression17mini_block_size_tE", !10, i64 0}
!14 = !{!"_ZTSN3qpl2ml11compression10chunk_typeE", !15, i64 0, !15, i64 1}
!15 = !{!"bool", !10, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{!"_ZTSN3qpl2ml11compression17huffman_table_icfE", !16, i64 0, !9, i64 8, !9, i64 12}
!18 = !{!"_ZTS20deflate_hash_table_t", !16, i64 0, !16, i64 8, !9, i64 16, !9, i64 20, !9, i64 24, !9, i64 28, !9, i64 32}
!19 = !{!"_ZTSN3qpl2ml11compression13index_table_tE", !16, i64 0, !9, i64 8, !9, i64 12, !9, i64 16}
!20 = !{!"_ZTSN3qpl2ml11compression19compression_level_tE", !10, i64 0}
!21 = !{!"_ZTSN3qpl2ml11compression20dictionary_support_tE", !10, i64 0}
!22 = !{!23, !16, i64 48}
!23 = !{!"_ZTS12isal_zstream", !16, i64 0, !9, i64 8, !9, i64 12, !16, i64 16, !9, i64 24, !9, i64 28, !16, i64 32, !9, i64 40, !9, i64 44, !16, i64 48, !24, i64 56, !24, i64 58, !24, i64 60, !24, i64 62, !25, i64 64}
!24 = !{!"short", !10, i64 0}
!25 = !{!"_ZTS11isal_zstate", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !26, i64 20, !27, i64 24, !9, i64 64, !10, i64 68, !10, i64 69, !10, i64 70, !10, i64 71, !24, i64 72, !9, i64 76, !10, i64 80, !9, i64 96, !9, i64 100, !9, i64 104, !9, i64 108, !10, i64 112, !10, i64 65936}
!26 = !{!"_ZTS17isal_zstate_state", !10, i64 0}
!27 = !{!"_ZTS7BitBuf2", !28, i64 0, !9, i64 8, !16, i64 16, !16, i64 24, !16, i64 32}
!28 = !{!"long", !10, i64 0}
!29 = !{!30, !9, i64 4348}
!30 = !{!"_ZTS9level_buf", !31, i64 0, !32, i64 2176, !9, i64 4348, !9, i64 4352, !10, i64 4356, !16, i64 4688, !28, i64 4696, !16, i64 4704, !10, i64 4712}
!31 = !{!"_ZTS14hufftables_icf", !10, i64 0}
!32 = !{!"_ZTS13isal_mod_hist", !10, i64 0, !10, i64 120}
!33 = !{!30, !9, i64 4352}
!34 = !{!10, !10, i64 0}
!35 = !{!25, !9, i64 76}
!36 = !{!27, !9, i64 8}
!37 = !{!23, !9, i64 24}
!38 = !{!23, !16, i64 16}
!39 = !{!23, !9, i64 28}
!40 = !{!41, !41, i64 0}
!41 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !10, i64 0}


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