; LLVM IR from intel/qpl :: sources/middle-layer/compression/huffman_only (huffman_only_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::huffman_only_state" = type { %"struct.qpl::ml::util::checksum_accumulator", ptr, ptr, ptr, i8, i32, i8, i8, i8, i8, ptr }
%"struct.qpl::ml::util::checksum_accumulator" = type { i32, i32 }
%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 }

@.str = external hidden unnamed_addr constant [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [112 x i8], align 1
@__PRETTY_FUNCTION__._ZN3qpl2ml11compression27huffman_only_compress_blockERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE = external hidden unnamed_addr constant [137 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml11compression12update_stateERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEEPhS6_S6_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef, ptr noundef) #0

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

declare i32 @__gxx_personality_v0(...)

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

; 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 i32 @_ZN3qpl2ml11compression27huffman_only_compress_blockERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(56) %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 i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  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) #7
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_state", ptr %15, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = getelementptr inbounds %struct.isal_zstream, ptr %17, i32 0, i32 14
  store ptr %18, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.isal_zstate, ptr %19, i32 0, i32 6
  store ptr %20, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_state", ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.isal_zstream, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !17
  store ptr %25, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %26, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_state", ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.isal_zstream, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 8, !tbaa !24
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %27, i64 %33
  store ptr %34, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !16
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_state", ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.isal_zstream, ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !24
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %53

41:                                               ; preds = %2
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_state", ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.isal_zstream, ptr %44, i32 0, i32 10
  %46 = load i16, ptr %45, align 8, !tbaa !25
  %47 = icmp ne i16 %46, 0
  br i1 %47, label %48, label %50

48:                                               ; preds = %41
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 4, ptr %49, align 1, !tbaa !26
  br label %52

50:                                               ; preds = %41
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 13, ptr %51, align 1, !tbaa !26
  br label %52

52:                                               ; preds = %50, %48
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %114

53:                                               ; preds = %2
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression18huffman_only_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(56) %54) #7
  br label %55

55:                                               ; preds = %85, %53
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i64 288
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = icmp ult ptr %57, %58
  br i1 %59, label %60, label %88

60:                                               ; preds = %55
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = invoke noundef i32 @_ZL7is_fullP7BitBuf2(ptr noundef %61)
          to label %63 unwind label %116

63:                                               ; preds = %60
  %64 = icmp ne i32 %62, 0
  br i1 %64, label %65, label %70

65:                                               ; preds = %63
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = load ptr, ptr %9, align 8, !tbaa !5
  %68 = load ptr, ptr %10, align 8, !tbaa !5
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression12update_stateERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEEPhS6_S6_(ptr noundef nonnull align 8 dereferenceable(56) %66, ptr noundef %67, ptr noundef %68, ptr noundef %69) #7
  store i32 2, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %114

70:                                               ; preds = %63
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = load i32, ptr %71, align 4, !tbaa !16
  store i32 %72, ptr %8, align 4, !tbaa !16
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_state", ptr %73, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.isal_zstream, ptr %75, i32 0, i32 6
  %77 = load ptr, ptr %76, align 8, !tbaa !28
  %78 = load i32, ptr %8, align 4, !tbaa !16
  %79 = and i32 %78, 255
  invoke void @_ZN3qpl2ml11compressionL16get_literal_codeEPK15isal_hufftablesjRjS5_(ptr noundef %77, i32 noundef %79, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %80 unwind label %116

80:                                               ; preds = %70
  %81 = load ptr, ptr %7, align 8, !tbaa !5
  %82 = load i32, ptr %12, align 4, !tbaa !16
  %83 = zext i32 %82 to i64
  %84 = load i32, ptr %13, align 4, !tbaa !16
  invoke void @_ZL10write_bitsP7BitBuf2mj(ptr noundef %81, i64 noundef %83, i32 noundef %84)
          to label %85 unwind label %116

85:                                               ; preds = %80
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i32 1
  store ptr %87, ptr %10, align 8, !tbaa !5
  br label %55, !llvm.loop !29

88:                                               ; preds = %55
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = load ptr, ptr %9, align 8, !tbaa !5
  %91 = load ptr, ptr %10, align 8, !tbaa !5
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression12update_stateERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEEPhS6_S6_(ptr noundef nonnull align 8 dereferenceable(56) %89, ptr noundef %90, ptr noundef %91, ptr noundef %92) #7
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_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 1
  %97 = load i32, ptr %96, align 8, !tbaa !24
  %98 = icmp ule i32 %97, 288
  br i1 %98, label %99, label %100

99:                                               ; preds = %88
  br label %102

100:                                              ; preds = %88
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 78, ptr noundef @__PRETTY_FUNCTION__._ZN3qpl2ml11compression27huffman_only_compress_blockERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE) #8
  unreachable

101:                                              ; No predecessors!
  br label %102

102:                                              ; preds = %101, %99
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.qpl::ml::compression::huffman_only_state", ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = getelementptr inbounds %struct.isal_zstream, ptr %105, i32 0, i32 10
  %107 = load i16, ptr %106, align 8, !tbaa !25
  %108 = icmp ne i16 %107, 0
  br i1 %108, label %109, label %111

109:                                              ; preds = %102
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 4, ptr %110, align 1, !tbaa !26
  br label %113

111:                                              ; preds = %102
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 13, ptr %112, align 1, !tbaa !26
  br label %113

113:                                              ; preds = %111, %109
  store i32 0, ptr %3, align 4
  store i32 1, ptr %14, align 4
  br label %114

114:                                              ; preds = %113, %65, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %115 = load i32, ptr %3, align 4
  ret i32 %115

116:                                              ; preds = %80, %70, %60
  %117 = landingpad { ptr, i32 }
          catch ptr null
  %118 = extractvalue { ptr, i32 } %117, 0
  call void @__clang_call_terminate(ptr %118) #8
  unreachable
}

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression18huffman_only_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(56)) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN3qpl2ml11compressionL16get_literal_codeEPK15isal_hufftablesjRjS5_(ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr 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 = { 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 #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 = { 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 #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !6, i64 8}
!10 = !{!"_ZTSN3qpl2ml11compression18huffman_only_stateILNS0_16execution_path_tE2EEE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !13, i64 32, !12, i64 36, !14, i64 40, !15, i64 41, !7, i64 42, !14, i64 43, !6, i64 48}
!11 = !{!"_ZTSN3qpl2ml4util20checksum_accumulatorE", !12, i64 0, !12, i64 4}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSN3qpl2ml11compression12endianness_tE", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!"_ZTSN3qpl2ml11compression18compression_mode_tE", !7, i64 0}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTS12isal_zstream", !6, i64 0, !12, i64 8, !12, i64 12, !6, i64 16, !12, i64 24, !12, i64 28, !6, i64 32, !12, i64 40, !12, i64 44, !6, i64 48, !19, i64 56, !19, i64 58, !19, i64 60, !19, i64 62, !20, i64 64}
!19 = !{!"short", !7, i64 0}
!20 = !{!"_ZTS11isal_zstate", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !21, i64 20, !22, i64 24, !12, i64 64, !7, i64 68, !7, i64 69, !7, i64 70, !7, i64 71, !19, i64 72, !12, i64 76, !7, i64 80, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !7, i64 112, !7, i64 65936}
!21 = !{!"_ZTS17isal_zstate_state", !7, i64 0}
!22 = !{!"_ZTS7BitBuf2", !23, i64 0, !12, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!23 = !{!"long", !7, i64 0}
!24 = !{!18, !12, i64 8}
!25 = !{!18, !19, i64 56}
!26 = !{!27, !27, i64 0}
!27 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !7, i64 0}
!28 = !{!18, !6, i64 32}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; 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"

@.str = external hidden unnamed_addr constant [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [112 x i8], align 1
@__PRETTY_FUNCTION__._ZN3qpl2ml11compression27huffman_only_compress_blockERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE = external hidden unnamed_addr constant [137 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml11compression12update_stateERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEEPhS6_S6_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare i32 @__gxx_personality_v0(...)

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

; 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 range(i32 0, 3) i32 @_ZN3qpl2ml11compression27huffman_only_compress_blockERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr nocapture noundef nonnull writeonly align 1 dereferenceable(1) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 88
  %8 = load ptr, ptr %6, align 8, !tbaa !15
  %9 = getelementptr inbounds i8, ptr %6, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !22
  %11 = zext i32 %10 to i64
  %12 = getelementptr inbounds i8, ptr %8, i64 %11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  store i32 0, ptr %4, align 4, !tbaa !23
  %13 = icmp eq i32 %10, 0
  br i1 %13, label %14, label %17

14:                                               ; preds = %2
  %15 = getelementptr inbounds i8, ptr %6, i64 56
  %16 = load i16, ptr %15, align 8, !tbaa !24
  %.not34 = icmp eq i16 %16, 0
  %. = select i1 %.not34, i8 13, i8 4
  store i8 %., ptr %1, align 1, !tbaa !25
  br label %42

17:                                               ; preds = %2
  tail call void @_ZN3qpl2ml11compression18huffman_only_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(56) %0) #7
  %18 = icmp ugt i32 %10, 288
  br i1 %18, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %17, %30
  %.03139 = phi ptr [ %31, %30 ], [ %8, %17 ]
  %19 = call noundef i32 @_ZL7is_fullP7BitBuf2(ptr noundef nonnull %7)
  %.not33 = icmp eq i32 %19, 0
  br i1 %.not33, label %21, label %20

20:                                               ; preds = %.lr.ph
  call void @_ZN3qpl2ml11compression12update_stateERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEEPhS6_S6_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %8, ptr noundef %.03139, ptr noundef nonnull %12) #7
  br label %42

21:                                               ; preds = %.lr.ph
  %22 = load i32, ptr %.03139, align 4, !tbaa !23
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 32
  %25 = load ptr, ptr %24, align 8, !tbaa !27
  %26 = and i32 %22, 255
  call void @_ZN3qpl2ml11compressionL16get_literal_codeEPK15isal_hufftablesjRjS5_(ptr noundef %25, i32 noundef %26, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %27 = load i32, ptr %3, align 4, !tbaa !23
  %28 = zext i32 %27 to i64
  %29 = load i32, ptr %4, align 4, !tbaa !23
  invoke void @_ZL10write_bitsP7BitBuf2mj(ptr noundef nonnull %7, i64 noundef %28, i32 noundef %29)
          to label %30 unwind label %43

30:                                               ; preds = %21
  %31 = getelementptr inbounds i8, ptr %.03139, i64 1
  %32 = getelementptr inbounds i8, ptr %.03139, i64 289
  %33 = icmp ult ptr %32, %12
  br i1 %33, label %.lr.ph, label %._crit_edge, !llvm.loop !28

._crit_edge:                                      ; preds = %30, %17
  %.031.lcssa = phi ptr [ %8, %17 ], [ %31, %30 ]
  call void @_ZN3qpl2ml11compression12update_stateERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEEPhS6_S6_(ptr noundef nonnull align 8 dereferenceable(56) %0, ptr noundef %8, ptr noundef %.031.lcssa, ptr noundef nonnull %12) #7
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load i32, ptr %35, align 8, !tbaa !22
  %37 = icmp ult i32 %36, 289
  br i1 %37, label %39, label %38

38:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 78, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3qpl2ml11compression27huffman_only_compress_blockERNS1_18huffman_only_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE) #8
  unreachable

39:                                               ; preds = %._crit_edge
  %40 = getelementptr inbounds i8, ptr %34, i64 56
  %41 = load i16, ptr %40, align 8, !tbaa !24
  %.not = icmp eq i16 %41, 0
  %.36 = select i1 %.not, i8 13, i8 4
  store i8 %.36, ptr %1, align 1, !tbaa !25
  br label %42

42:                                               ; preds = %39, %20, %14
  %.0 = phi i32 [ 0, %14 ], [ 2, %20 ], [ 0, %39 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret i32 %.0

43:                                               ; preds = %21
  %44 = landingpad { ptr, i32 }
          catch ptr null
  %45 = extractvalue { ptr, i32 } %44, 0
  call void @__clang_call_terminate(ptr %45) #8
  unreachable
}

; Function Attrs: nounwind
declare void @_ZN3qpl2ml11compression18huffman_only_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN3qpl2ml11compressionL16get_literal_codeEPK15isal_hufftablesjRjS5_(ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr 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 = { 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 #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 = { 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 #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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, !11, i64 8}
!6 = !{!"_ZTSN3qpl2ml11compression18huffman_only_stateILNS0_16execution_path_tE2EEE", !7, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !12, i64 32, !8, i64 36, !13, i64 40, !14, i64 41, !9, i64 42, !13, i64 43, !11, i64 48}
!7 = !{!"_ZTSN3qpl2ml4util20checksum_accumulatorE", !8, i64 0, !8, i64 4}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_ZTSN3qpl2ml11compression12endianness_tE", !9, i64 0}
!13 = !{!"bool", !9, i64 0}
!14 = !{!"_ZTSN3qpl2ml11compression18compression_mode_tE", !9, i64 0}
!15 = !{!16, !11, i64 0}
!16 = !{!"_ZTS12isal_zstream", !11, i64 0, !8, i64 8, !8, i64 12, !11, i64 16, !8, i64 24, !8, i64 28, !11, i64 32, !8, i64 40, !8, i64 44, !11, i64 48, !17, i64 56, !17, i64 58, !17, i64 60, !17, i64 62, !18, i64 64}
!17 = !{!"short", !9, i64 0}
!18 = !{!"_ZTS11isal_zstate", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12, !8, i64 16, !19, i64 20, !20, i64 24, !8, i64 64, !9, i64 68, !9, i64 69, !9, i64 70, !9, i64 71, !17, i64 72, !8, i64 76, !9, i64 80, !8, i64 96, !8, i64 100, !8, i64 104, !8, i64 108, !9, i64 112, !9, i64 65936}
!19 = !{!"_ZTS17isal_zstate_state", !9, i64 0}
!20 = !{!"_ZTS7BitBuf2", !21, i64 0, !8, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!21 = !{!"long", !9, i64 0}
!22 = !{!16, !8, i64 8}
!23 = !{!8, !8, i64 0}
!24 = !{!16, !17, i64 56}
!25 = !{!26, !26, i64 0}
!26 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !9, i64 0}
!27 = !{!16, !11, i64 32}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass