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

@.str = external hidden unnamed_addr constant [68 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [125 x i8], align 1
@__PRETTY_FUNCTION__._ZN3qpl2ml11compression18write_stored_blockERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE = external hidden unnamed_addr constant [123 x i8], align 1

; 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 @_ZN3qpl2ml11compression18write_stored_blockERNS1_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 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = call noundef zeroext i8 @_ZNK3qpl2ml11compression18compression_stream16compression_modeEv(ptr noundef nonnull align 8 dereferenceable(28) %13) #4
  %15 = zext i8 %14 to i32
  %16 = icmp eq i32 %15, 3
  br i1 %16, label %17, label %18

17:                                               ; preds = %2
  store i32 2, ptr %3, align 4
  br label %166

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.isal_zstream, ptr %21, i32 0, i32 14
  store ptr %22, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  store ptr null, ptr %10, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 8, ptr %23, align 1, !tbaa !24
  br label %24

24:                                               ; preds = %160, %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call noundef i32 @_ZN3qpl2ml11compression25write_stored_block_headerERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(192) %25, ptr noundef nonnull align 1 dereferenceable(1) %26) #4
  store i32 %27, ptr %11, align 4, !tbaa !23
  %28 = load i32, ptr %11, align 4, !tbaa !23
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %24
  store i32 2, ptr %12, align 4
  br label %157

31:                                               ; preds = %24
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.isal_zstate, ptr %32, i32 0, i32 13
  %34 = load i32, ptr %33, align 4, !tbaa !26
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.isal_zstate, ptr %35, i32 0, i32 2
  %37 = load i32, ptr %36, align 8, !tbaa !32
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.isal_zstate, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !33
  %41 = sub i32 %37, %40
  %42 = icmp ule i32 %34, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %31
  br label %46

44:                                               ; preds = %31
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 135, ptr noundef @__PRETTY_FUNCTION__._ZN3qpl2ml11compression18write_stored_blockERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE) #5
  unreachable

45:                                               ; No predecessors!
  br label %46

46:                                               ; preds = %45, %43
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.isal_zstate, ptr %47, i32 0, i32 13
  %49 = load i32, ptr %48, align 4, !tbaa !26
  store i32 %49, ptr %7, align 4, !tbaa !23
  %50 = load ptr, ptr %4, align 8, !tbaa !5
  %51 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.isal_zstream, ptr %52, i32 0, i32 2
  %54 = load i32, ptr %53, align 4, !tbaa !34
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.isal_zstate, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !33
  %58 = sub i32 %54, %57
  store i32 %58, ptr %9, align 4, !tbaa !23
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.isal_zstream, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !36
  %64 = load i32, ptr %9, align 4, !tbaa !23
  %65 = zext i32 %64 to i64
  %66 = sub i64 0, %65
  %67 = getelementptr inbounds i8, ptr %63, i64 %66
  store ptr %67, ptr %10, align 8, !tbaa !5
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  %69 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.isal_zstream, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 8, !tbaa !37
  %73 = load i32, ptr %9, align 4, !tbaa !23
  %74 = add i32 %72, %73
  store i32 %74, ptr %8, align 4, !tbaa !23
  %75 = load i32, ptr %7, align 4, !tbaa !23
  %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 !38
  %81 = icmp ugt i32 %75, %80
  br i1 %81, label %86, label %82

82:                                               ; preds = %46
  %83 = load i32, ptr %7, align 4, !tbaa !23
  %84 = load i32, ptr %8, align 4, !tbaa !23
  %85 = icmp ugt i32 %83, %84
  br i1 %85, label %86, label %116

86:                                               ; preds = %82, %46
  %87 = load i32, ptr %7, align 4, !tbaa !23
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.isal_zstate, ptr %88, i32 0, i32 13
  store i32 %87, ptr %89, align 4, !tbaa !26
  %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 4
  %94 = load i32, ptr %93, align 8, !tbaa !38
  %95 = load i32, ptr %8, align 4, !tbaa !23
  %96 = icmp ule i32 %94, %95
  br i1 %96, label %97, label %103

97:                                               ; preds = %86
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %98, i32 0, i32 1
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.isal_zstream, ptr %100, i32 0, i32 4
  %102 = load i32, ptr %101, align 8, !tbaa !38
  br label %105

103:                                              ; preds = %86
  %104 = load i32, ptr %8, align 4, !tbaa !23
  br label %105

105:                                              ; preds = %103, %97
  %106 = phi i32 [ %102, %97 ], [ %104, %103 ]
  store i32 %106, ptr %7, align 4, !tbaa !23
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = load i32, ptr %7, align 4, !tbaa !23
  %110 = call noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192) %107, ptr noundef %108, i32 noundef %109) #4
  %111 = load i32, ptr %7, align 4, !tbaa !23
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.isal_zstate, ptr %112, i32 0, i32 13
  %114 = load i32, ptr %113, align 4, !tbaa !26
  %115 = sub i32 %114, %111
  store i32 %115, ptr %113, align 4, !tbaa !26
  store i32 2, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %157

116:                                              ; preds = %82
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = load i32, ptr %7, align 4, !tbaa !23
  %120 = call noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192) %117, ptr noundef %118, i32 noundef %119) #4
  %121 = load ptr, ptr %6, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.isal_zstate, ptr %121, i32 0, i32 13
  store i32 0, ptr %122, align 4, !tbaa !26
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 8, ptr %123, align 1, !tbaa !24
  br label %124

124:                                              ; preds = %116
  %125 = load i32, ptr %7, align 4, !tbaa !23
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.isal_zstate, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !33
  %129 = add i32 %128, %125
  store i32 %129, ptr %127, align 4, !tbaa !33
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.isal_zstate, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 4, !tbaa !33
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.isal_zstate, ptr %133, i32 0, i32 2
  %135 = load i32, ptr %134, align 8, !tbaa !32
  %136 = icmp eq i32 %132, %135
  br i1 %136, label %137, label %156

137:                                              ; preds = %124
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %138, i32 0, i32 1
  %140 = load ptr, ptr %139, align 8, !tbaa !9
  %141 = getelementptr inbounds %struct.isal_zstream, ptr %140, i32 0, i32 1
  %142 = load i32, ptr %141, align 8, !tbaa !37
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %147

144:                                              ; preds = %137
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE19reset_match_historyEv(ptr noundef nonnull align 8 dereferenceable(192) %145) #4
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 2, ptr %146, align 1, !tbaa !24
  br label %155

147:                                              ; preds = %137
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.isal_zstate, ptr %148, i32 0, i32 9
  %150 = load i8, ptr %149, align 1, !tbaa !39
  %151 = icmp ne i8 %150, 0
  %152 = zext i1 %151 to i64
  %153 = select i1 %151, i8 12, i8 13
  %154 = load ptr, ptr %5, align 8, !tbaa !5
  store i8 %153, ptr %154, align 1, !tbaa !24
  br label %155

155:                                              ; preds = %147, %144
  br label %156

156:                                              ; preds = %155, %124
  store i32 0, ptr %12, align 4
  br label %157

157:                                              ; preds = %156, %105, %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %158 = load i32, ptr %12, align 4
  switch i32 %158, label %165 [
    i32 0, label %159
    i32 2, label %164
  ]

159:                                              ; preds = %157
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = load i8, ptr %161, align 1, !tbaa !24
  %163 = icmp eq i8 %162, 8
  br i1 %163, label %24, label %164, !llvm.loop !40

164:                                              ; preds = %160, %157
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %165

165:                                              ; preds = %164, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %166

166:                                              ; preds = %165, %17
  %167 = load i32, ptr %3, align 4
  ret i32 %167
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3qpl2ml11compression25write_stored_block_headerERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 1 dereferenceable(1)) #1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

; 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_tE2EE19reset_match_historyEv(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 = { 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 #4 = { nounwind }
attributes #5 = { 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 = !{!13, !13, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !7, i64 0}
!26 = !{!27, !13, i64 76}
!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, !31, 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", !30, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!30 = !{!"long", !7, i64 0}
!31 = !{!"short", !7, i64 0}
!32 = !{!27, !13, i64 8}
!33 = !{!27, !13, i64 4}
!34 = !{!35, !13, i64 12}
!35 = !{!"_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, !31, i64 56, !31, i64 58, !31, i64 60, !31, i64 62, !27, i64 64}
!36 = !{!35, !6, i64 0}
!37 = !{!35, !13, i64 8}
!38 = !{!35, !13, i64 24}
!39 = !{!27, !7, i64 69}
!40 = distinct !{!40, !41}
!41 = !{!"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 [68 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [125 x i8], align 1
@__PRETTY_FUNCTION__._ZN3qpl2ml11compression18write_stored_blockERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE = external hidden unnamed_addr constant [123 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_ZN3qpl2ml11compression18write_stored_blockERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef nonnull 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) #4
  %4 = icmp eq i8 %3, 3
  br i1 %4, label %.thread59, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  store i8 8, ptr %1, align 1, !tbaa !22
  %8 = getelementptr inbounds i8, ptr %7, i64 140
  %9 = getelementptr inbounds i8, ptr %7, i64 72
  %10 = getelementptr inbounds i8, ptr %7, i64 68
  br label %11

11:                                               ; preds = %38, %5
  %12 = tail call 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) #4
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %.thread59

13:                                               ; preds = %11
  %14 = load i32, ptr %8, align 4, !tbaa !24
  %15 = load i32, ptr %9, align 8, !tbaa !30
  %16 = load i32, ptr %10, align 4, !tbaa !31
  %17 = sub i32 %15, %16
  %.not51 = icmp ugt i32 %14, %17
  br i1 %.not51, label %18, label %19

18:                                               ; preds = %13
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 135, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3qpl2ml11compression18write_stored_blockERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE) #5
  unreachable

19:                                               ; preds = %13
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 12
  %22 = load i32, ptr %21, align 4, !tbaa !32
  %23 = sub i32 %22, %16
  %24 = load ptr, ptr %20, align 8, !tbaa !34
  %25 = zext i32 %23 to i64
  %26 = sub nsw i64 0, %25
  %27 = getelementptr inbounds i8, ptr %24, i64 %26
  %28 = getelementptr inbounds i8, ptr %20, i64 8
  %29 = load i32, ptr %28, align 8, !tbaa !35
  %30 = add i32 %29, %23
  %31 = getelementptr inbounds i8, ptr %20, i64 24
  %32 = load i32, ptr %31, align 8, !tbaa !36
  %33 = icmp ugt i32 %14, %32
  %34 = icmp ugt i32 %14, %30
  %or.cond = select i1 %33, i1 true, i1 %34
  br i1 %or.cond, label %.thread56, label %38

.thread56:                                        ; preds = %19
  %. = tail call i32 @llvm.umin.i32(i32 %32, i32 %30)
  %35 = tail call noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %27, i32 noundef %.) #4
  %36 = load i32, ptr %8, align 4, !tbaa !24
  %37 = sub i32 %36, %.
  store i32 %37, ptr %8, align 4, !tbaa !24
  br label %.thread59

38:                                               ; preds = %19
  %39 = tail call noundef i32 @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE11write_bytesEPKhj(ptr noundef nonnull align 8 dereferenceable(192) %0, ptr noundef %27, i32 noundef %14) #4
  store i32 0, ptr %8, align 4, !tbaa !24
  store i8 8, ptr %1, align 1, !tbaa !22
  %40 = load i32, ptr %10, align 4, !tbaa !31
  %41 = add i32 %40, %14
  store i32 %41, ptr %10, align 4, !tbaa !31
  %42 = load i32, ptr %9, align 8, !tbaa !30
  %43 = icmp eq i32 %41, %42
  br i1 %43, label %44, label %11

44:                                               ; preds = %38
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load i32, ptr %46, align 8, !tbaa !35
  %.not52 = icmp eq i32 %47, 0
  br i1 %.not52, label %49, label %48

48:                                               ; preds = %44
  tail call void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE19reset_match_historyEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #4
  store i8 2, ptr %1, align 1, !tbaa !22
  br label %.thread59

49:                                               ; preds = %44
  %50 = getelementptr inbounds i8, ptr %7, i64 133
  %51 = load i8, ptr %50, align 1, !tbaa !37
  %.not53 = icmp eq i8 %51, 0
  %52 = select i1 %.not53, i8 13, i8 12
  store i8 %52, ptr %1, align 1, !tbaa !22
  br label %.thread59

.thread59:                                        ; preds = %11, %49, %48, %.thread56, %2
  %.3 = phi i32 [ 2, %2 ], [ 2, %.thread56 ], [ 0, %48 ], [ 0, %49 ], [ 0, %11 ]
  ret i32 %.3
}

; 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
declare dso_local noundef i32 @_ZN3qpl2ml11compression25write_stored_block_headerERNS1_13deflate_stateILNS0_16execution_path_tE2EEERNS1_19compression_state_tE(ptr noundef nonnull align 8 dereferenceable(192), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #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 = { 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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
attributes #5 = { 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, !23, i64 0}
!23 = !{!"_ZTSN3qpl2ml11compression19compression_state_tE", !10, i64 0}
!24 = !{!25, !9, i64 76}
!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, !29, 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 = !{!"short", !10, i64 0}
!30 = !{!25, !9, i64 8}
!31 = !{!25, !9, i64 4}
!32 = !{!33, !9, i64 12}
!33 = !{!"_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, !29, i64 56, !29, i64 58, !29, i64 60, !29, i64 62, !25, i64 64}
!34 = !{!33, !16, i64 0}
!35 = !{!33, !9, i64 8}
!36 = !{!33, !9, i64 24}
!37 = !{!25, !10, i64 69}


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