; LLVM IR from intel/qpl :: sources/middle-layer/compression/deflate/compression_units (stored_block_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 }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN3qpl2ml11compression25write_stored_block_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) #1 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 i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = 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) #5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct.isal_zstream, ptr %19, i32 0, i32 14
  store ptr %20, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.isal_zstate, ptr %21, i32 0, i32 6
  store ptr %22, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 0, ptr %8, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.isal_zstate, ptr %23, i32 0, i32 2
  %25 = load i32, ptr %24, align 8, !tbaa !26
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.isal_zstate, ptr %26, i32 0, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !31
  %29 = sub i32 %25, %28
  store i32 %29, ptr %13, align 4, !tbaa !25
  %30 = load i32, ptr %13, align 4, !tbaa !25
  %31 = icmp ugt i32 %30, 65535
  br i1 %31, label %32, label %33

32:                                               ; preds = %2
  store i64 65535, ptr %8, align 8, !tbaa !23
  store i32 65535, ptr %9, align 4, !tbaa !25
  br label %78

33:                                               ; preds = %2
  %34 = load i32, ptr %13, align 4, !tbaa !25
  %35 = zext i32 %34 to i64
  %36 = xor i64 %35, -1
  store i64 %36, ptr %8, align 8, !tbaa !23
  %37 = load i64, ptr %8, align 8, !tbaa !23
  %38 = shl i64 %37, 16
  store i64 %38, ptr %8, align 8, !tbaa !23
  %39 = load i32, ptr %13, align 4, !tbaa !25
  %40 = and i32 %39, 65535
  %41 = zext i32 %40 to i64
  %42 = load i64, ptr %8, align 8, !tbaa !23
  %43 = or i64 %42, %41
  store i64 %43, ptr %8, align 8, !tbaa !23
  %44 = load i32, ptr %13, align 4, !tbaa !25
  store i32 %44, ptr %9, align 4, !tbaa !25
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.isal_zstream, ptr %47, i32 0, i32 2
  %49 = load i32, ptr %48, align 4, !tbaa !32
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.isal_zstate, ptr %50, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !31
  %53 = sub i32 %49, %52
  store i32 %53, ptr %12, align 4, !tbaa !25
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %54, i32 0, i32 1
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.isal_zstream, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !34
  %59 = load i32, ptr %12, align 4, !tbaa !25
  %60 = add i32 %58, %59
  store i32 %60, ptr %11, align 4, !tbaa !25
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.isal_zstream, ptr %63, i32 0, i32 10
  %65 = load i16, ptr %64, align 8, !tbaa !35
  %66 = icmp ne i16 %65, 0
  br i1 %66, label %67, label %77

67:                                               ; preds = %33
  %68 = load i32, ptr %11, align 4, !tbaa !25
  %69 = load i32, ptr %13, align 4, !tbaa !25
  %70 = icmp eq i32 %68, %69
  br i1 %70, label %71, label %77

71:                                               ; preds = %67
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %72, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !9
  %75 = getelementptr inbounds %struct.isal_zstream, ptr %74, i32 0, i32 14
  %76 = getelementptr inbounds %struct.isal_zstate, ptr %75, i32 0, i32 9
  store i8 1, ptr %76, align 1, !tbaa !36
  br label %77

77:                                               ; preds = %71, %67, %33
  br label %78

78:                                               ; preds = %77, %32
  %79 = load ptr, ptr %7, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.BitBuf2, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 8, !tbaa !37
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %106

83:                                               ; preds = %78
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %84, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.isal_zstream, ptr %86, i32 0, i32 4
  %88 = load i32, ptr %87, align 8, !tbaa !38
  %89 = icmp uge i32 %88, 5
  br i1 %89, label %90, label %106

90:                                               ; preds = %83
  %91 = load i64, ptr %8, align 8, !tbaa !23
  %92 = shl i64 %91, 8
  store i64 %92, ptr %8, align 8, !tbaa !23
  %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 14
  %97 = getelementptr inbounds %struct.isal_zstate, ptr %96, i32 0, i32 9
  %98 = load i8, ptr %97, align 1, !tbaa !36
  %99 = zext i8 %98 to i64
  %100 = load i64, ptr %8, align 8, !tbaa !23
  %101 = or i64 %100, %99
  store i64 %101, ptr %8, align 8, !tbaa !23
  store i32 5, ptr %10, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  store ptr %8, ptr %14, align 8, !tbaa !5
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  %104 = load i32, ptr %10, align 4, !tbaa !25
  %105 = call noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192) %102, ptr noundef %103, i32 noundef %104) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %133

106:                                              ; preds = %83, %78
  %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 !38
  %112 = icmp uge i32 %111, 8
  br i1 %112, label %113, label %126

113:                                              ; preds = %106
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %114) #5
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = load ptr, ptr %6, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.isal_zstate, ptr %116, i32 0, i32 9
  %118 = load i8, ptr %117, align 1, !tbaa !39
  %119 = zext i8 %118 to i64
  invoke void @_ZL16write_bits_flushP7BitBuf2mj(ptr noundef %115, i64 noundef %119, i32 noundef 3)
          to label %120 unwind label %140

120:                                              ; preds = %113
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %121) #5
  store i32 4, ptr %10, align 4, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr %8, ptr %15, align 8, !tbaa !5
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = load i32, ptr %10, align 4, !tbaa !25
  %125 = call noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192) %122, ptr noundef %123, i32 noundef %124) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %132

126:                                              ; preds = %106
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.isal_zstream, ptr %129, i32 0, i32 14
  %131 = getelementptr inbounds %struct.isal_zstate, ptr %130, i32 0, i32 9
  store i8 0, ptr %131, align 1, !tbaa !36
  store i32 2, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %138

132:                                              ; preds = %120
  br label %133

133:                                              ; preds = %132, %90
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 9, ptr %134, align 1, !tbaa !40
  %135 = load i32, ptr %9, align 4, !tbaa !25
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.isal_zstate, ptr %136, i32 0, i32 13
  store i32 %135, ptr %137, align 4, !tbaa !42
  store i32 0, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %138

138:                                              ; preds = %133, %126
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %139 = load i32, ptr %3, align 4
  ret i32 %139

140:                                              ; preds = %113
  %141 = landingpad { ptr, i32 }
          catch ptr null
  %142 = extractvalue { ptr, i32 } %141, 0
  call void @__clang_call_terminate(ptr %142) #6
  unreachable
}

; Function Attrs: nounwind
declare noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef, i32 noundef) unnamed_addr #2

; 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 @_ZL16write_bits_flushP7BitBuf2mj(ptr noundef, i64 noundef, i32 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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !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, !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!13, !13, i64 0}
!26 = !{!27, !13, i64 8}
!27 = !{!"_ZTS11isal_zstate", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !28, i64 20, !29, i64 24, !13, i64 64, !7, i64 68, !7, i64 69, !7, i64 70, !7, i64 71, !30, 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}
!28 = !{!"_ZTS17isal_zstate_state", !7, i64 0}
!29 = !{!"_ZTS7BitBuf2", !24, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!30 = !{!"short", !7, i64 0}
!31 = !{!27, !13, i64 4}
!32 = !{!33, !13, i64 12}
!33 = !{!"_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, !30, i64 56, !30, i64 58, !30, i64 60, !30, i64 62, !27, i64 64}
!34 = !{!33, !13, i64 8}
!35 = !{!33, !30, i64 56}
!36 = !{!33, !7, i64 133}
!37 = !{!29, !13, i64 8}
!38 = !{!33, !13, i64 24}
!39 = !{!27, !7, i64 69}
!40 = !{!41, !41, i64 0}
!41 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !7, i64 0}
!42 = !{!27, !13, i64 76}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 3) i32 @_ZN3qpl2ml11compression25write_stored_block_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 #1 personality ptr @__gxx_personality_v0 {
  %3 = alloca i64, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 88
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %7 = getelementptr inbounds i8, ptr %5, i64 72
  %8 = load i32, ptr %7, align 8, !tbaa !22
  %9 = getelementptr inbounds i8, ptr %5, i64 68
  %10 = load i32, ptr %9, align 4, !tbaa !28
  %11 = sub i32 %8, %10
  %12 = icmp ugt i32 %11, 65535
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i64 65535, ptr %3, align 8, !tbaa !29
  br label %32

14:                                               ; preds = %2
  %15 = xor i32 %11, -1
  %16 = sext i32 %15 to i64
  %17 = shl nsw i64 %16, 16
  %18 = zext nneg i32 %11 to i64
  %19 = or disjoint i64 %17, %18
  store i64 %19, ptr %3, align 8, !tbaa !29
  %20 = getelementptr inbounds i8, ptr %5, i64 56
  %21 = load i16, ptr %20, align 8, !tbaa !30
  %.not = icmp eq i16 %21, 0
  br i1 %.not, label %32, label %22

22:                                               ; preds = %14
  %23 = getelementptr inbounds i8, ptr %5, i64 8
  %24 = load i32, ptr %23, align 8, !tbaa !32
  %25 = getelementptr inbounds i8, ptr %5, i64 12
  %26 = load i32, ptr %25, align 4, !tbaa !33
  %27 = sub i32 %24, %10
  %28 = add i32 %27, %26
  %29 = icmp eq i32 %28, %11
  br i1 %29, label %30, label %32

30:                                               ; preds = %22
  %31 = getelementptr inbounds i8, ptr %5, i64 133
  store i8 1, ptr %31, align 1, !tbaa !34
  br label %32

32:                                               ; preds = %14, %22, %30, %13
  %33 = phi i64 [ 65535, %13 ], [ %19, %30 ], [ %19, %22 ], [ %19, %14 ]
  %.034 = phi i32 [ 65535, %13 ], [ %11, %30 ], [ %11, %22 ], [ %11, %14 ]
  %34 = getelementptr inbounds i8, ptr %5, i64 96
  %35 = load i32, ptr %34, align 8, !tbaa !35
  %36 = icmp eq i32 %35, 0
  %37 = getelementptr inbounds i8, ptr %5, i64 24
  %38 = load i32, ptr %37, align 8, !tbaa !36
  br i1 %36, label %39, label %47

39:                                               ; preds = %32
  %40 = icmp ugt i32 %38, 4
  br i1 %40, label %41, label %.thread

41:                                               ; preds = %39
  %42 = shl nsw i64 %33, 8
  %43 = getelementptr inbounds i8, ptr %5, i64 133
  %44 = load i8, ptr %43, align 1, !tbaa !34
  %45 = zext i8 %44 to i64
  %46 = or disjoint i64 %42, %45
  store i64 %46, ptr %3, align 8, !tbaa !29
  br label %55

47:                                               ; preds = %32
  %48 = icmp ugt i32 %38, 7
  br i1 %48, label %49, label %.thread

49:                                               ; preds = %47
  tail call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE16reset_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #5
  %50 = getelementptr inbounds i8, ptr %5, i64 133
  %51 = load i8, ptr %50, align 1, !tbaa !37
  %52 = zext i8 %51 to i64
  invoke void @_ZL16write_bits_flushP7BitBuf2mj(ptr noundef nonnull %6, i64 noundef %52, i32 noundef 3)
          to label %53 unwind label %59

53:                                               ; preds = %49
  tail call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE15dump_bit_bufferEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #5
  br label %55

.thread:                                          ; preds = %39, %47
  %54 = getelementptr inbounds i8, ptr %5, i64 133
  store i8 0, ptr %54, align 1, !tbaa !34
  br label %58

55:                                               ; preds = %53, %41
  %.sink = phi i32 [ 4, %53 ], [ 5, %41 ]
  %56 = call noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull %3, i32 noundef %.sink) #5
  store i8 9, ptr %1, align 1, !tbaa !38
  %57 = getelementptr inbounds i8, ptr %5, i64 140
  store i32 %.034, ptr %57, align 4, !tbaa !40
  br label %58

58:                                               ; preds = %55, %.thread
  %.0 = phi i32 [ 0, %55 ], [ 2, %.thread ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 %.0

59:                                               ; preds = %49
  %60 = landingpad { ptr, i32 }
          catch ptr null
  %61 = extractvalue { ptr, i32 } %60, 0
  tail call void @__clang_call_terminate(ptr %61) #6
  unreachable
}

; Function Attrs: nounwind
declare noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef, i32 noundef) unnamed_addr #2

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

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

declare i32 @__gxx_personality_v0(...)

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { nounwind }
attributes #6 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !9, i64 8}
!23 = !{!"_ZTS11isal_zstate", !9, i64 0, !9, i64 4, !9, i64 8, !9, i64 12, !9, i64 16, !24, i64 20, !25, i64 24, !9, i64 64, !10, i64 68, !10, i64 69, !10, i64 70, !10, i64 71, !27, 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}
!24 = !{!"_ZTS17isal_zstate_state", !10, i64 0}
!25 = !{!"_ZTS7BitBuf2", !26, i64 0, !9, i64 8, !16, i64 16, !16, i64 24, !16, i64 32}
!26 = !{!"long", !10, i64 0}
!27 = !{!"short", !10, i64 0}
!28 = !{!23, !9, i64 4}
!29 = !{!26, !26, i64 0}
!30 = !{!31, !27, i64 56}
!31 = !{!"_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, !27, i64 56, !27, i64 58, !27, i64 60, !27, i64 62, !23, i64 64}
!32 = !{!31, !9, i64 8}
!33 = !{!31, !9, i64 12}
!34 = !{!31, !10, i64 133}
!35 = !{!25, !9, i64 8}
!36 = !{!31, !9, i64 24}
!37 = !{!23, !10, i64 69}
!38 = !{!39, !39, i64 0}
!39 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !10, i64 0}
!40 = !{!23, !9, i64 76}


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