; 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: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN3qpl2ml11compression19write_stored_blocksEPhjS2_jjb(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #0

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

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

; Function Attrs: nounwind
declare noundef zeroext i8 @_ZNK3qpl2ml11compression18compression_stream16compression_modeEv(ptr noundef nonnull align 8 dereferenceable(28)) #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN3qpl2ml11compression31recover_and_write_stored_blocksERNS1_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 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = call noundef zeroext i8 @_ZNK3qpl2ml11compression18compression_stream16compression_modeEv(ptr noundef nonnull align 8 dereferenceable(28) %9) #4
  %11 = zext i8 %10 to i32
  %12 = icmp eq i32 %11, 3
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store i32 2, ptr %3, align 4
  br label %165

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.qpl::ml::compression::deflate_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 5
  %19 = load i32, ptr %18, align 4, !tbaa !23
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %20, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds %struct.isal_zstream, ptr %22, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !30
  %25 = zext i32 %19 to i64
  %26 = sub i64 0, %25
  %27 = getelementptr inbounds i8, ptr %24, i64 %26
  store ptr %27, ptr %23, align 8, !tbaa !30
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"class.qpl::ml::compression::deflate_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 5
  %32 = load i32, ptr %31, align 4, !tbaa !23
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.isal_zstream, ptr %35, i32 0, i32 4
  %37 = load i32, ptr %36, align 8, !tbaa !31
  %38 = add i32 %37, %32
  store i32 %38, ptr %36, align 8, !tbaa !31
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.isal_zstream, ptr %41, i32 0, i32 5
  store i32 0, ptr %42, align 4, !tbaa !23
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.isal_zstream, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 4, !tbaa !32
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %48, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.isal_zstream, ptr %50, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !33
  %53 = zext i32 %47 to i64
  %54 = sub i64 0, %53
  %55 = getelementptr inbounds i8, ptr %52, i64 %54
  store ptr %55, ptr %51, align 8, !tbaa !33
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %56, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.isal_zstream, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 4, !tbaa !32
  %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 1
  %65 = load i32, ptr %64, align 8, !tbaa !34
  %66 = add i32 %65, %60
  store i32 %66, ptr %64, align 8, !tbaa !34
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.isal_zstream, ptr %69, i32 0, i32 2
  store i32 0, ptr %70, align 4, !tbaa !32
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !9
  %74 = getelementptr inbounds %struct.isal_zstream, ptr %73, i32 0, i32 4
  %75 = load i32, ptr %74, align 8, !tbaa !31
  %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 1
  %80 = load i32, ptr %79, align 8, !tbaa !34
  %81 = call noundef i32 @_ZN3qpl2ml11compressionL22get_stored_blocks_sizeEj(i32 noundef %80) #4
  %82 = icmp ult i32 %75, %81
  br i1 %82, label %83, label %84

83:                                               ; preds = %14
  store i32 2, ptr %3, align 4
  br label %165

84:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.isal_zstream, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !33
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.isal_zstream, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 8, !tbaa !34
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %95, i32 0, i32 1
  %97 = load ptr, ptr %96, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.isal_zstream, ptr %97, i32 0, i32 3
  %99 = load ptr, ptr %98, align 8, !tbaa !30
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.isal_zstream, ptr %102, i32 0, i32 4
  %104 = load i32, ptr %103, align 8, !tbaa !31
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = call noundef zeroext i1 @_ZNK3qpl2ml11compression18compression_stream13is_last_chunkEv(ptr noundef nonnull align 8 dereferenceable(28) %105) #4
  %107 = call noundef i64 @_ZN3qpl2ml11compression19write_stored_blocksEPhjS2_jjb(ptr noundef %89, i32 noundef %94, ptr noundef %99, i32 noundef %104, i32 noundef 0, i1 noundef zeroext %106) #4
  store i64 %107, ptr %6, align 8, !tbaa !35
  %108 = load i64, ptr %6, align 8, !tbaa !35
  %109 = icmp slt i64 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %84
  store i32 2, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %164

111:                                              ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %112 = load i64, ptr %6, align 8, !tbaa !35
  %113 = trunc i64 %112 to i32
  store i32 %113, ptr %8, align 4, !tbaa !36
  %114 = load i32, ptr %8, align 4, !tbaa !36
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.isal_zstream, ptr %117, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !30
  %120 = sext i32 %114 to i64
  %121 = getelementptr inbounds i8, ptr %119, i64 %120
  store ptr %121, ptr %118, align 8, !tbaa !30
  %122 = load i32, ptr %8, align 4, !tbaa !36
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.isal_zstream, ptr %125, i32 0, i32 4
  %127 = load i32, ptr %126, align 8, !tbaa !31
  %128 = sub i32 %127, %122
  store i32 %128, ptr %126, align 8, !tbaa !31
  %129 = load i32, ptr %8, align 4, !tbaa !36
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %130, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  %133 = getelementptr inbounds %struct.isal_zstream, ptr %132, i32 0, i32 5
  %134 = load i32, ptr %133, align 4, !tbaa !23
  %135 = add i32 %134, %129
  store i32 %135, ptr %133, align 4, !tbaa !23
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = getelementptr inbounds %struct.isal_zstream, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 8, !tbaa !34
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %141, i32 0, i32 1
  %143 = load ptr, ptr %142, align 8, !tbaa !9
  %144 = getelementptr inbounds %struct.isal_zstream, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !33
  %146 = zext i32 %140 to i64
  %147 = getelementptr inbounds i8, ptr %145, i64 %146
  store ptr %147, ptr %144, align 8, !tbaa !33
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %148, i32 0, i32 1
  %150 = load ptr, ptr %149, align 8, !tbaa !9
  %151 = getelementptr inbounds %struct.isal_zstream, ptr %150, i32 0, i32 1
  %152 = load i32, ptr %151, align 8, !tbaa !34
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %153, i32 0, i32 1
  %155 = load ptr, ptr %154, align 8, !tbaa !9
  %156 = getelementptr inbounds %struct.isal_zstream, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 4, !tbaa !32
  %158 = add i32 %157, %152
  store i32 %158, ptr %156, align 4, !tbaa !32
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %159, i32 0, i32 1
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = getelementptr inbounds %struct.isal_zstream, ptr %161, i32 0, i32 1
  store i32 0, ptr %162, align 8, !tbaa !34
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 13, ptr %163, align 1, !tbaa !37
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %164

164:                                              ; preds = %111, %110
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %165

165:                                              ; preds = %164, %83, %13
  %166 = load i32, ptr %3, align 4
  ret i32 %166
}

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

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

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 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 = { 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, !13, i64 28}
!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 = !{!24, !6, i64 16}
!31 = !{!24, !13, i64 24}
!32 = !{!24, !13, i64 12}
!33 = !{!24, !6, i64 0}
!34 = !{!24, !13, i64 8}
!35 = !{!29, !29, i64 0}
!36 = !{!13, !13, i64 0}
!37 = !{!38, !38, i64 0}
!38 = !{!"_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
declare dso_local noundef i64 @_ZN3qpl2ml11compression19write_stored_blocksEPhjS2_jjb(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

; Function Attrs: nounwind
declare noundef zeroext i8 @_ZNK3qpl2ml11compression18compression_stream16compression_modeEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef range(i32 0, 3) i32 @_ZN3qpl2ml11compression31recover_and_write_stored_blocksERNS1_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 {
  %3 = tail call noundef zeroext i8 @_ZNK3qpl2ml11compression18compression_stream16compression_modeEv(ptr noundef nonnull align 8 dereferenceable(28) %0) #3
  %4 = icmp eq i8 %3, 3
  br i1 %4, label %62, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 28
  %9 = load i32, ptr %8, align 4, !tbaa !22
  %10 = getelementptr inbounds i8, ptr %7, i64 16
  %11 = load ptr, ptr %10, align 8, !tbaa !29
  %12 = zext i32 %9 to i64
  %13 = sub nsw i64 0, %12
  %14 = getelementptr inbounds i8, ptr %11, i64 %13
  store ptr %14, ptr %10, align 8, !tbaa !29
  %15 = getelementptr inbounds i8, ptr %7, i64 24
  %16 = load i32, ptr %15, align 8, !tbaa !30
  %17 = add i32 %16, %9
  store i32 %17, ptr %15, align 8, !tbaa !30
  store i32 0, ptr %8, align 4, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %7, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !31
  %20 = load ptr, ptr %7, align 8, !tbaa !32
  %21 = zext i32 %19 to i64
  %22 = sub nsw i64 0, %21
  %23 = getelementptr inbounds i8, ptr %20, i64 %22
  store ptr %23, ptr %7, align 8, !tbaa !32
  %24 = getelementptr inbounds i8, ptr %7, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !33
  %26 = add i32 %25, %19
  store i32 %26, ptr %24, align 8, !tbaa !33
  store i32 0, ptr %18, align 4, !tbaa !31
  %27 = tail call noundef i32 @_ZN3qpl2ml11compressionL22get_stored_blocks_sizeEj(i32 noundef %26) #3
  %28 = icmp ult i32 %17, %27
  br i1 %28, label %62, label %29

29:                                               ; preds = %5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = load ptr, ptr %30, align 8, !tbaa !32
  %32 = getelementptr inbounds i8, ptr %30, i64 8
  %33 = load i32, ptr %32, align 8, !tbaa !33
  %34 = getelementptr inbounds i8, ptr %30, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !29
  %36 = getelementptr inbounds i8, ptr %30, i64 24
  %37 = load i32, ptr %36, align 8, !tbaa !30
  %38 = tail call noundef zeroext i1 @_ZNK3qpl2ml11compression18compression_stream13is_last_chunkEv(ptr noundef nonnull align 8 dereferenceable(28) %0) #3
  %39 = tail call noundef i64 @_ZN3qpl2ml11compression19write_stored_blocksEPhjS2_jjb(ptr noundef %31, i32 noundef %33, ptr noundef %35, i32 noundef %37, i32 noundef 0, i1 noundef zeroext %38) #3
  %40 = icmp slt i64 %39, 0
  br i1 %40, label %62, label %41

41:                                               ; preds = %29
  %42 = trunc i64 %39 to i32
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  %45 = load ptr, ptr %44, align 8, !tbaa !29
  %sext = shl i64 %39, 32
  %46 = ashr exact i64 %sext, 32
  %47 = getelementptr inbounds i8, ptr %45, i64 %46
  store ptr %47, ptr %44, align 8, !tbaa !29
  %48 = getelementptr inbounds i8, ptr %43, i64 24
  %49 = load i32, ptr %48, align 8, !tbaa !30
  %50 = sub i32 %49, %42
  store i32 %50, ptr %48, align 8, !tbaa !30
  %51 = getelementptr inbounds i8, ptr %43, i64 28
  %52 = load i32, ptr %51, align 4, !tbaa !22
  %53 = add i32 %52, %42
  store i32 %53, ptr %51, align 4, !tbaa !22
  %54 = getelementptr inbounds i8, ptr %43, i64 8
  %55 = load i32, ptr %54, align 8, !tbaa !33
  %56 = load ptr, ptr %43, align 8, !tbaa !32
  %57 = zext i32 %55 to i64
  %58 = getelementptr inbounds i8, ptr %56, i64 %57
  store ptr %58, ptr %43, align 8, !tbaa !32
  %59 = getelementptr inbounds i8, ptr %43, i64 12
  %60 = load i32, ptr %59, align 4, !tbaa !31
  %61 = add i32 %60, %55
  store i32 %61, ptr %59, align 4, !tbaa !31
  store i32 0, ptr %54, align 8, !tbaa !33
  store i8 13, ptr %1, align 1, !tbaa !34
  br label %62

62:                                               ; preds = %41, %29, %5, %2
  %.1 = phi i32 [ 2, %2 ], [ 2, %5 ], [ 0, %41 ], [ 2, %29 ]
  ret i32 %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN3qpl2ml11compressionL22get_stored_blocks_sizeEj(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qpl2ml11compression18compression_stream13is_last_chunkEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #1

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 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 #3 = { 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 28}
!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 = !{!23, !16, i64 16}
!30 = !{!23, !9, i64 24}
!31 = !{!23, !9, i64 12}
!32 = !{!23, !16, i64 0}
!33 = !{!23, !9, i64 8}
!34 = !{!35, !35, i64 0}
!35 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !10, i64 0}


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