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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.qpl::ml::compression::deflate_state" = type { %"class.qpl::ml::compression::compression_stream.base", ptr, ptr, %"class.qpl::ml::compression::huffman_table_icf", %struct.deflate_hash_table_t, %"class.qpl::ml::compression::index_table_t", i8, i8, ptr, i8, ptr, i32, i32, i32, i8, ptr, ptr }
%"class.qpl::ml::compression::compression_stream.base" = type <{ ptr, %"struct.qpl::ml::util::checksum_accumulator", i8, i8, %"struct.qpl::ml::compression::chunk_type", i32, i32 }>
%"struct.qpl::ml::util::checksum_accumulator" = type { i32, i32 }
%"struct.qpl::ml::compression::chunk_type" = type { i8, i8 }
%"class.qpl::ml::compression::huffman_table_icf" = type { ptr, i32, i32 }
%struct.deflate_hash_table_t = type { ptr, ptr, i32, i32, i32, i32, i32 }
%"class.qpl::ml::compression::index_table_t" = type <{ ptr, i32, i32, i32, [4 x i8] }>
%struct.isal_zstream = type { ptr, i32, i32, ptr, i32, i32, ptr, i32, i32, ptr, i16, i16, i16, i16, %struct.isal_zstate }
%struct.isal_zstate = type { i32, i32, i32, i32, i32, i32, %struct.BitBuf2, i32, i8, i8, i8, i8, i16, i32, [16 x i8], i32, i32, i32, i32, [65824 x i8], [8192 x i16] }
%struct.BitBuf2 = type { i64, i32, ptr, ptr, ptr }
%struct.level_buf = type { %struct.hufftables_icf, %struct.isal_mod_hist, i32, i32, [328 x i8], ptr, i64, ptr, %union.anon.4 }
%struct.hufftables_icf = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { [31 x %struct.huff_code], [513 x %struct.huff_code] }
%struct.huff_code = type { %union.anon.0 }
%union.anon.0 = type { %struct.anon.1 }
%struct.anon.1 = type { i32 }
%struct.isal_mod_hist = type { [30 x i32], [513 x i32] }
%union.anon.4 = type { %struct.hash_map_buf }
%struct.hash_map_buf = type { [32768 x i16], ptr, ptr, [4096 x %struct.deflate_icf], [288 x %struct.deflate_icf] }
%struct.deflate_icf = type { i32 }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE19reset_match_historyEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %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 i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %11 = call noundef nonnull align 8 dereferenceable(168) ptr @_ZN3qpl7core_sw10dispatcher18kernels_dispatcher12get_instanceEv() #5
  %12 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3qpl7core_sw10dispatcher18kernels_dispatcher17get_deflate_tableEv(ptr noundef nonnull align 8 dereferenceable(168) %11) #5
  %13 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIPvLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef 2) #5
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %14, ptr %4, align 8, !tbaa !5
  store ptr %4, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %15 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 1
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.isal_zstream, ptr %16, i32 0, i32 9
  %18 = load ptr, ptr %17, align 8, !tbaa !23
  store ptr %18, ptr %5, align 8, !tbaa !5
  %19 = call noundef zeroext i8 @_ZNK3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE17compression_levelEv(ptr noundef nonnull align 8 dereferenceable(192) %10) #5
  %20 = zext i8 %19 to i32
  %21 = icmp eq i32 %20, 3
  br i1 %21, label %22, label %58

22:                                               ; preds = %1
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.level_buf, ptr %23, i32 0, i32 8
  %25 = getelementptr inbounds %struct.hash_map_buf, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds [32768 x i16], ptr %25, i64 0, i64 0
  %27 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %28 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %27, i32 0, i32 0
  store ptr %26, ptr %28, align 8, !tbaa !30
  %29 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %30 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !30
  %32 = getelementptr inbounds i32, ptr %31, i64 4096
  %33 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %34 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %33, i32 0, i32 1
  store ptr %32, ptr %34, align 8, !tbaa !31
  %35 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.isal_zstream, ptr %36, i32 0, i32 2
  %38 = load i32, ptr %37, align 4, !tbaa !32
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %57

40:                                               ; preds = %22
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  invoke void %42(ptr noundef %43)
          to label %44 unwind label %118

44:                                               ; preds = %40
  %45 = invoke noundef i32 @_ZN3qpl2ml4util10build_maskIjLj12EEET_v()
          to label %46 unwind label %118

46:                                               ; preds = %44
  %47 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %48 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %47, i32 0, i32 2
  store i32 %45, ptr %48, align 8, !tbaa !33
  %49 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %50 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %49, i32 0, i32 3
  store i32 4096, ptr %50, align 4, !tbaa !34
  %51 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %52 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %51, i32 0, i32 4
  store i32 32, ptr %52, align 8, !tbaa !35
  %53 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %54 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %53, i32 0, i32 5
  store i32 258, ptr %54, align 4, !tbaa !36
  %55 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 4
  %56 = getelementptr inbounds %struct.deflate_hash_table_t, ptr %55, i32 0, i32 6
  store i32 258, ptr %56, align 8, !tbaa !37
  br label %57

57:                                               ; preds = %46, %22
  br label %117

58:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %59 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.isal_zstream, ptr %60, i32 0, i32 14
  store ptr %61, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %62 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.isal_zstream, ptr %63, i32 0, i32 7
  %65 = load i32, ptr %64, align 8, !tbaa !38
  %66 = icmp eq i32 %65, 3
  br i1 %66, label %67, label %72

67:                                               ; preds = %58
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.level_buf, ptr %68, i32 0, i32 8
  %70 = getelementptr inbounds %struct.hash_map_buf, ptr %69, i32 0, i32 0
  %71 = getelementptr inbounds [32768 x i16], ptr %70, i64 0, i64 0
  br label %76

72:                                               ; preds = %58
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.isal_zstate, ptr %73, i32 0, i32 20
  %75 = getelementptr inbounds [8192 x i16], ptr %74, i64 0, i64 0
  br label %76

76:                                               ; preds = %72, %67
  %77 = phi ptr [ %71, %67 ], [ %75, %72 ]
  store ptr %77, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.isal_zstate, ptr %78, i32 0, i32 4
  %80 = load i32, ptr %79, align 8, !tbaa !39
  %81 = add i32 %80, 1
  %82 = mul i32 2, %81
  store i32 %82, ptr %8, align 4, !tbaa !40
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.isal_zstate, ptr %83, i32 0, i32 11
  store i8 0, ptr %84, align 1, !tbaa !41
  %85 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 1
  %86 = load ptr, ptr %85, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.isal_zstream, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 4, !tbaa !32
  %89 = and i32 %88, 65535
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %95

91:                                               ; preds = %76
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !40
  %94 = zext i32 %93 to i64
  call void @llvm.memset.p0.i64(ptr align 2 %92, i8 0, i64 %94, i1 false)
  br label %116

95:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !40
  br label %96

96:                                               ; preds = %112, %95
  %97 = load i32, ptr %9, align 4, !tbaa !40
  %98 = load i32, ptr %8, align 4, !tbaa !40
  %99 = udiv i32 %98, 2
  %100 = icmp ult i32 %97, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %115

102:                                              ; preds = %96
  %103 = getelementptr inbounds %"class.qpl::ml::compression::deflate_state", ptr %10, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.isal_zstream, ptr %104, i32 0, i32 2
  %106 = load i32, ptr %105, align 4, !tbaa !32
  %107 = trunc i32 %106 to i16
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load i32, ptr %9, align 4, !tbaa !40
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds i16, ptr %108, i64 %110
  store i16 %107, ptr %111, align 2, !tbaa !42
  br label %112

112:                                              ; preds = %102
  %113 = load i32, ptr %9, align 4, !tbaa !40
  %114 = add i32 %113, 1
  store i32 %114, ptr %9, align 4, !tbaa !40
  br label %96, !llvm.loop !43

115:                                              ; preds = %101
  br label %116

116:                                              ; preds = %115, %91
  call void @llvm.lifetime.end.p0(i64 4, 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
  br label %117

117:                                              ; preds = %116, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void

118:                                              ; preds = %44, %40
  %119 = landingpad { ptr, i32 }
          catch ptr null
  %120 = extractvalue { ptr, i32 } %119, 0
  call void @__clang_call_terminate(ptr %120) #6
  unreachable
}

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

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(168) ptr @_ZN3qpl7core_sw10dispatcher18kernels_dispatcher12get_instanceEv() #2

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3qpl7core_sw10dispatcher18kernels_dispatcher17get_deflate_tableEv(ptr noundef nonnull align 8 dereferenceable(168)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIPvLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE17compression_levelEv(ptr noundef nonnull align 8 dereferenceable(192)) #0 align 2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3qpl2ml4util10build_maskIjLj12EEET_v() #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { 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 = { noinline noreturn nounwind uwtable "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 48}
!24 = !{!"_ZTS12isal_zstream", !6, i64 0, !13, i64 8, !13, i64 12, !6, i64 16, !13, i64 24, !13, i64 28, !6, i64 32, !13, i64 40, !13, i64 44, !6, i64 48, !25, i64 56, !25, i64 58, !25, i64 60, !25, i64 62, !26, i64 64}
!25 = !{!"short", !7, i64 0}
!26 = !{!"_ZTS11isal_zstate", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !27, i64 20, !28, i64 24, !13, i64 64, !7, i64 68, !7, i64 69, !7, i64 70, !7, i64 71, !25, i64 72, !13, i64 76, !7, i64 80, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !7, i64 112, !7, i64 65936}
!27 = !{!"_ZTS17isal_zstate_state", !7, i64 0}
!28 = !{!"_ZTS7BitBuf2", !29, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!29 = !{!"long", !7, i64 0}
!30 = !{!10, !6, i64 64}
!31 = !{!10, !6, i64 72}
!32 = !{!24, !13, i64 12}
!33 = !{!10, !13, i64 80}
!34 = !{!10, !13, i64 84}
!35 = !{!10, !13, i64 88}
!36 = !{!10, !13, i64 92}
!37 = !{!10, !13, i64 96}
!38 = !{!24, !13, i64 40}
!39 = !{!26, !13, i64 16}
!40 = !{!13, !13, i64 0}
!41 = !{!26, !7, i64 71}
!42 = !{!25, !25, i64 0}
!43 = distinct !{!43, !44}
!44 = !{!"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"

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE19reset_match_historyEv(ptr noundef nonnull align 8 dereferenceable(192) %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = tail call noundef nonnull align 8 dereferenceable(168) ptr @_ZN3qpl7core_sw10dispatcher18kernels_dispatcher12get_instanceEv() #4
  %3 = tail call noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3qpl7core_sw10dispatcher18kernels_dispatcher17get_deflate_tableEv(ptr noundef nonnull align 8 dereferenceable(168) %2) #4
  %4 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIPvLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 2) #4
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %7, i64 48
  %9 = load ptr, ptr %8, align 8, !tbaa !23
  %10 = tail call noundef zeroext i8 @_ZNK3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE17compression_levelEv(ptr noundef nonnull align 8 dereferenceable(192) %0) #4
  %11 = icmp eq i8 %10, 3
  br i1 %11, label %12, label %26

12:                                               ; preds = %1
  %13 = getelementptr inbounds i8, ptr %9, i64 4712
  %14 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %13, ptr %14, align 8, !tbaa !30
  %15 = getelementptr inbounds i8, ptr %9, i64 21096
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  store ptr %15, ptr %16, align 8, !tbaa !31
  %17 = load ptr, ptr %6, align 8, !tbaa !9
  %18 = getelementptr inbounds i8, ptr %17, i64 12
  %19 = load i32, ptr %18, align 4, !tbaa !32
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %.loopexit

21:                                               ; preds = %12
  invoke void %5(ptr noundef nonnull %14)
          to label %22 unwind label %51

22:                                               ; preds = %21
  %23 = tail call noundef i32 @_ZN3qpl2ml4util10build_maskIjLj12EEET_v()
  %24 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %23, ptr %24, align 8, !tbaa !33
  %25 = getelementptr inbounds i8, ptr %0, i64 84
  store <4 x i32> <i32 4096, i32 32, i32 258, i32 258>, ptr %25, align 4, !tbaa !34
  br label %.loopexit

26:                                               ; preds = %1
  %27 = load ptr, ptr %6, align 8, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %27, i64 40
  %29 = load i32, ptr %28, align 8, !tbaa !35
  %30 = icmp eq i32 %29, 3
  %31 = getelementptr inbounds i8, ptr %9, i64 4712
  %32 = getelementptr inbounds i8, ptr %27, i64 66000
  %33 = select i1 %30, ptr %31, ptr %32
  %34 = getelementptr inbounds i8, ptr %27, i64 80
  %35 = load i32, ptr %34, align 8, !tbaa !36
  %36 = shl i32 %35, 1
  %37 = add i32 %36, 2
  %38 = getelementptr inbounds i8, ptr %27, i64 135
  store i8 0, ptr %38, align 1, !tbaa !37
  %39 = getelementptr inbounds i8, ptr %27, i64 12
  %40 = load i32, ptr %39, align 4, !tbaa !32
  %41 = and i32 %40, 65535
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %48, label %.preheader

.preheader:                                       ; preds = %26
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %43 = lshr exact i32 %37, 1
  %44 = trunc i32 %40 to i16
  %wide.trip.count = zext nneg i32 %43 to i64
  %min.iters.check = icmp ult i32 %37, 32
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483632
  %broadcast.splatinsert = insertelement <8 x i16> poison, i16 %44, i64 0
  %broadcast.splat = shufflevector <8 x i16> %broadcast.splatinsert, <8 x i16> poison, <8 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %45 = getelementptr inbounds i16, ptr %33, i64 %index
  %46 = getelementptr inbounds i8, ptr %45, i64 16
  store <8 x i16> %broadcast.splat, ptr %45, align 2, !tbaa !38
  store <8 x i16> %broadcast.splat, ptr %46, align 2, !tbaa !38
  %index.next = add nuw i64 %index, 16
  %47 = icmp eq i64 %index.next, %n.vec
  br i1 %47, label %middle.block, label %vector.body, !llvm.loop !39

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

48:                                               ; preds = %26
  %49 = zext i32 %37 to i64
  tail call void @llvm.memset.p0.i64(ptr nonnull align 2 %33, i8 0, i64 %49, i1 false)
  br label %.loopexit

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %50 = getelementptr inbounds i16, ptr %33, i64 %indvars.iv
  store i16 %44, ptr %50, align 2, !tbaa !38
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %scalar.ph, !llvm.loop !43

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %.preheader, %48, %12, %22
  ret void

51:                                               ; preds = %21
  %52 = landingpad { ptr, i32 }
          catch ptr null
  %53 = extractvalue { ptr, i32 } %52, 0
  tail call void @__clang_call_terminate(ptr %53) #5
  unreachable
}

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(168) ptr @_ZN3qpl7core_sw10dispatcher18kernels_dispatcher12get_instanceEv() local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(24) ptr @_ZNK3qpl7core_sw10dispatcher18kernels_dispatcher17get_deflate_tableEv(ptr noundef nonnull align 8 dereferenceable(168)) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt5arrayIPvLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK3qpl2ml11compression13deflate_stateILNS0_16execution_path_tE2EE17compression_levelEv(ptr noundef nonnull align 8 dereferenceable(192)) local_unnamed_addr #0 align 2

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 nounwind uwtable
declare dso_local noundef i32 @_ZN3qpl2ml4util10build_maskIjLj12EEET_v() local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!24, !6, i64 48}
!24 = !{!"_ZTS12isal_zstream", !6, i64 0, !13, i64 8, !13, i64 12, !6, i64 16, !13, i64 24, !13, i64 28, !6, i64 32, !13, i64 40, !13, i64 44, !6, i64 48, !25, i64 56, !25, i64 58, !25, i64 60, !25, i64 62, !26, i64 64}
!25 = !{!"short", !7, i64 0}
!26 = !{!"_ZTS11isal_zstate", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !27, i64 20, !28, i64 24, !13, i64 64, !7, i64 68, !7, i64 69, !7, i64 70, !7, i64 71, !25, i64 72, !13, i64 76, !7, i64 80, !13, i64 96, !13, i64 100, !13, i64 104, !13, i64 108, !7, i64 112, !7, i64 65936}
!27 = !{!"_ZTS17isal_zstate_state", !7, i64 0}
!28 = !{!"_ZTS7BitBuf2", !29, i64 0, !13, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!29 = !{!"long", !7, i64 0}
!30 = !{!10, !6, i64 64}
!31 = !{!10, !6, i64 72}
!32 = !{!24, !13, i64 12}
!33 = !{!10, !13, i64 80}
!34 = !{!13, !13, i64 0}
!35 = !{!24, !13, i64 40}
!36 = !{!26, !13, i64 16}
!37 = !{!26, !7, i64 71}
!38 = !{!25, !25, i64 0}
!39 = distinct !{!39, !40, !41, !42}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!"llvm.loop.isvectorized", i32 1}
!42 = !{!"llvm.loop.unroll.runtime.disable"}
!43 = distinct !{!43, !40, !42, !41}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass