; LLVM IR from intel/qpl :: sources/middle-layer/compression/huffman_only (huffman_only_decompression)

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

%"struct.std::array" = type { [256 x %"struct.qpl::ml::compression::huffman_code"] }
%"struct.qpl::ml::compression::huffman_code" = type { i16, i8, i8 }
%"class.qpl::ml::bit_reader" = type <{ ptr, ptr, ptr, i8, [7 x i8], i64, i8, i8, i8, [5 x i8] }>
%"struct.qpl::ml::compression::huffman_only_decompression_state<qpl::ml::execution_path_t::software>::internal_state_fields_t" = type { ptr, i32, ptr, i32, i32, i8 }

@_ZN3qpl2ml4utilL21crc32_table_gzip_reflE = external hidden constant [256 x i32], align 16

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml10bit_readerC2IPKhEET_S5_(ptr noundef nonnull align 8 dereferenceable(43), ptr noundef, ptr noundef) unnamed_addr #2 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 hidden void @_ZN3qpl2ml11compressionL24initialize_huffman_tableERK30qplc_huffman_table_flat_formatRSt5arrayINS1_12huffman_codeELm256EE(ptr noundef nonnull align 4 dereferenceable(624), ptr noundef nonnull align 2 dereferenceable(1024)) #2

; Function Attrs: nounwind
declare noundef ptr @_ZN3qpl2ml11compression27decompression_huffman_table26get_sw_decompression_tableEv(ptr noundef nonnull align 8 dereferenceable(35)) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN3qpl2ml11compressionL18build_lookup_tableERKSt5arrayINS1_12huffman_codeELm256EEPh(ptr noundef nonnull align 2 dereferenceable(1024), ptr noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE16get_lookup_tableEv(ptr noundef nonnull align 8 dereferenceable(17)) #1 align 2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml10bit_reader20set_last_bits_offsetEh(ptr noundef nonnull align 8 dereferenceable(43), i8 noundef zeroext) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE14get_endiannessEv(ptr noundef nonnull align 8 dereferenceable(17)) #1 align 2

; 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 @_ZN3qpl2ml11compression19verify_huffman_onlyILNS0_16execution_path_tE2EEEjRNS1_32huffman_only_decompression_stateIXT_EEERNS1_27decompression_huffman_tableEj(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(35) %1, i32 noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::array", align 2
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca %"class.qpl::ml::bit_reader", align 8
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i16, align 2
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %21) #5
  %23 = getelementptr inbounds %"struct.qpl::ml::compression::huffman_only_decompression_state<qpl::ml::execution_path_t::software>::internal_state_fields_t", ptr %22, i32 0, i32 4
  %24 = load i32, ptr %23, align 4, !tbaa !11
  store i32 %24, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1024, ptr %9) #5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef ptr @_ZN3qpl2ml11compression27decompression_huffman_table26get_sw_decompression_tableEv(ptr noundef nonnull align 8 dereferenceable(35) %25) #5
  call void @_ZN3qpl2ml11compressionL24initialize_huffman_tableERK30qplc_huffman_table_flat_formatRSt5arrayINS1_12huffman_codeELm256EE(ptr noundef nonnull align 4 dereferenceable(624) %26, ptr noundef nonnull align 2 dereferenceable(1024) %9) #5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = call noundef ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE16get_lookup_tableEv(ptr noundef nonnull align 8 dereferenceable(17) %27) #5
  call void @_ZN3qpl2ml11compressionL18build_lookup_tableERKSt5arrayINS1_12huffman_codeELm256EEPh(ptr noundef nonnull align 2 dereferenceable(1024) %9, ptr noundef %28) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE16get_lookup_tableEv(ptr noundef nonnull align 8 dereferenceable(17) %29) #5
  store ptr %30, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %31) #5
  %33 = getelementptr inbounds %"struct.qpl::ml::compression::huffman_only_decompression_state<qpl::ml::execution_path_t::software>::internal_state_fields_t", ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  store ptr %34, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %36) #5
  %38 = getelementptr inbounds %"struct.qpl::ml::compression::huffman_only_decompression_state<qpl::ml::execution_path_t::software>::internal_state_fields_t", ptr %37, i32 0, i32 1
  %39 = load i32, ptr %38, align 8, !tbaa !14
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %35, i64 %40
  store ptr %41, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %13) #5
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN3qpl2ml10bit_readerC2IPKhEET_S5_(ptr noundef nonnull align 8 dereferenceable(43) %13, ptr noundef %42, ptr noundef %43)
          to label %44 unwind label %103

44:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %45) #5
  %47 = getelementptr inbounds %"struct.qpl::ml::compression::huffman_only_decompression_state<qpl::ml::execution_path_t::software>::internal_state_fields_t", ptr %46, i32 0, i32 5
  %48 = load i8, ptr %47, align 8, !tbaa !15
  store i8 %48, ptr %14, align 1, !tbaa !16
  %49 = load i8, ptr %14, align 1, !tbaa !16
  call void @_ZN3qpl2ml10bit_reader20set_last_bits_offsetEh(ptr noundef nonnull align 8 dereferenceable(43) %13, i8 noundef zeroext %49) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = call noundef zeroext i8 @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE14get_endiannessEv(ptr noundef nonnull align 8 dereferenceable(17) %50) #5
  %52 = zext i8 %51 to i32
  %53 = icmp eq i32 %52, 1
  %54 = zext i1 %53 to i8
  store i8 %54, ptr %15, align 1, !tbaa !17
  %55 = load i8, ptr %15, align 1, !tbaa !17, !range !19, !noundef !20
  %56 = trunc i8 %55 to i1
  call void @_ZN3qpl2ml10bit_reader14set_big_endianEb(ptr noundef nonnull align 8 dereferenceable(43) %13, i1 noundef zeroext %56) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  store i8 1, ptr %16, align 1, !tbaa !17
  br label %57

57:                                               ; preds = %92, %44
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #5
  %58 = call noundef zeroext i16 @_ZN3qpl2ml10bit_reader9peek_bitsEh(ptr noundef nonnull align 8 dereferenceable(43) %13, i8 noundef zeroext 15) #5
  store i16 %58, ptr %17, align 2, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  %59 = load ptr, ptr %10, align 8, !tbaa !5
  %60 = load i16, ptr %17, align 2, !tbaa !21
  %61 = zext i16 %60 to i64
  %62 = getelementptr inbounds i8, ptr %59, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !16
  store i8 %63, ptr %18, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  %64 = load i8, ptr %18, align 1, !tbaa !16
  %65 = zext i8 %64 to i64
  %66 = call noundef nonnull align 2 dereferenceable(4) ptr @_ZNSt5arrayIN3qpl2ml11compression12huffman_codeELm256EEixEm(ptr noundef nonnull align 2 dereferenceable(1024) %9, i64 noundef %65) #5
  %67 = getelementptr inbounds %"struct.qpl::ml::compression::huffman_code", ptr %66, i32 0, i32 2
  %68 = load i8, ptr %67, align 1, !tbaa !23
  store i8 %68, ptr %19, align 1, !tbaa !16
  %69 = load i8, ptr %19, align 1, !tbaa !16
  call void @_ZN3qpl2ml10bit_reader10shift_bitsEh(ptr noundef nonnull align 8 dereferenceable(43) %13, i8 noundef zeroext %69) #5
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = xor i32 %70, -1
  store i32 %71, ptr %8, align 4, !tbaa !9
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = lshr i32 %72, 8
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = and i32 %74, 255
  %76 = load i8, ptr %18, align 1, !tbaa !16
  %77 = zext i8 %76 to i32
  %78 = xor i32 %75, %77
  %79 = zext i32 %78 to i64
  %80 = getelementptr inbounds [256 x i32], ptr @_ZN3qpl2ml4utilL21crc32_table_gzip_reflE, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = xor i32 %73, %81
  store i32 %82, ptr %8, align 4, !tbaa !9
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = xor i32 %83, -1
  store i32 %84, ptr %8, align 4, !tbaa !9
  %85 = call noundef zeroext i1 @_ZNK3qpl2ml10bit_reader13is_overflowedEv(ptr noundef nonnull align 8 dereferenceable(43) %13) #5
  br i1 %85, label %86, label %89

86:                                               ; preds = %57
  %87 = call noundef i32 @_ZNK3qpl2ml10bit_reader20get_buffer_bit_countEv(ptr noundef nonnull align 8 dereferenceable(43) %13) #5
  %88 = icmp ugt i32 %87, 0
  br label %89

89:                                               ; preds = %86, %57
  %90 = phi i1 [ true, %57 ], [ %88, %86 ]
  %91 = zext i1 %90 to i8
  store i8 %91, ptr %16, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #5
  br label %92

92:                                               ; preds = %89
  %93 = load i8, ptr %16, align 1, !tbaa !17, !range !19, !noundef !20
  %94 = trunc i8 %93 to i1
  br i1 %94, label %57, label %95, !llvm.loop !25

95:                                               ; preds = %92
  %96 = load i32, ptr %7, align 4, !tbaa !9
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = icmp ne i32 %96, %97
  br i1 %98, label %99, label %100

99:                                               ; preds = %95
  store i32 229, ptr %4, align 4
  store i32 1, ptr %20, align 4
  br label %101

100:                                              ; preds = %95
  store i32 0, ptr %4, align 4
  store i32 1, ptr %20, align 4
  br label %101

101:                                              ; preds = %100, %99
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %102 = load i32, ptr %4, align 4
  ret i32 %102

103:                                              ; preds = %3
  %104 = landingpad { ptr, i32 }
          catch ptr null
  %105 = extractvalue { ptr, i32 } %104, 0
  call void @__clang_call_terminate(ptr %105) #6
  unreachable
}

; Function Attrs: nounwind
declare void @_ZN3qpl2ml10bit_reader14set_big_endianEb(ptr noundef nonnull align 8 dereferenceable(43), i1 noundef zeroext) #4

; Function Attrs: nounwind
declare noundef zeroext i16 @_ZN3qpl2ml10bit_reader9peek_bitsEh(ptr noundef nonnull align 8 dereferenceable(43), i8 noundef zeroext) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(4) ptr @_ZNSt5arrayIN3qpl2ml11compression12huffman_codeELm256EEixEm(ptr noundef nonnull align 2 dereferenceable(1024), i64 noundef) #2 align 2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml10bit_reader10shift_bitsEh(ptr noundef nonnull align 8 dereferenceable(43), i8 noundef zeroext) #4

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qpl2ml10bit_reader13is_overflowedEv(ptr noundef nonnull align 8 dereferenceable(43)) #4

; Function Attrs: nounwind
declare noundef i32 @_ZNK3qpl2ml10bit_reader20get_buffer_bit_countEv(ptr noundef nonnull align 8 dereferenceable(43)) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 = { 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 #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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 28}
!12 = !{!"_ZTSN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE23internal_state_fields_tE", !6, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !7, i64 32}
!13 = !{!12, !6, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!12, !7, i64 32}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = !{!24, !7, i64 3}
!24 = !{!"_ZTSN3qpl2ml11compression12huffman_codeE", !22, i64 0, !7, i64 2, !7, i64 3}
!25 = distinct !{!25, !26}
!26 = !{!"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"

%"struct.std::array" = type { [256 x %"struct.qpl::ml::compression::huffman_code"] }
%"struct.qpl::ml::compression::huffman_code" = type { i16, i8, i8 }
%"class.qpl::ml::bit_reader" = type <{ ptr, ptr, ptr, i8, [7 x i8], i64, i8, i8, i8, [5 x i8] }>

@_ZN3qpl2ml4utilL21crc32_table_gzip_reflE = external hidden local_unnamed_addr constant [256 x i32], align 16

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3qpl2ml10bit_readerC2IPKhEET_S5_(ptr noundef nonnull align 8 dereferenceable(43), ptr noundef, ptr noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN3qpl2ml11compressionL24initialize_huffman_tableERK30qplc_huffman_table_flat_formatRSt5arrayINS1_12huffman_codeELm256EE(ptr noundef nonnull align 4 dereferenceable(624), ptr noundef nonnull align 2 dereferenceable(1024)) local_unnamed_addr #2

; Function Attrs: nounwind
declare noundef ptr @_ZN3qpl2ml11compression27decompression_huffman_table26get_sw_decompression_tableEv(ptr noundef nonnull align 8 dereferenceable(35)) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN3qpl2ml11compressionL18build_lookup_tableERKSt5arrayINS1_12huffman_codeELm256EEPh(ptr noundef nonnull align 2 dereferenceable(1024), ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE16get_lookup_tableEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #1 align 2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml10bit_reader20set_last_bits_offsetEh(ptr noundef nonnull align 8 dereferenceable(43), i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE14get_endiannessEv(ptr noundef nonnull align 8 dereferenceable(17)) local_unnamed_addr #1 align 2

; 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, 230) i32 @_ZN3qpl2ml11compression19verify_huffman_onlyILNS0_16execution_path_tE2EEEjRNS1_32huffman_only_decompression_stateIXT_EEERNS1_27decompression_huffman_tableEj(ptr noundef nonnull align 8 dereferenceable(17) %0, ptr noundef nonnull align 8 dereferenceable(35) %1, i32 noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"struct.std::array", align 2
  %5 = alloca %"class.qpl::ml::bit_reader", align 8
  %6 = tail call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  %7 = getelementptr inbounds i8, ptr %6, i64 28
  %8 = load i32, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #4
  %9 = tail call noundef ptr @_ZN3qpl2ml11compression27decompression_huffman_table26get_sw_decompression_tableEv(ptr noundef nonnull align 8 dereferenceable(35) %1) #4
  call void @_ZN3qpl2ml11compressionL24initialize_huffman_tableERK30qplc_huffman_table_flat_formatRSt5arrayINS1_12huffman_codeELm256EE(ptr noundef nonnull align 4 dereferenceable(624) %9, ptr noundef nonnull align 2 dereferenceable(1024) %4) #4
  %10 = call noundef ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE16get_lookup_tableEv(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  call void @_ZN3qpl2ml11compressionL18build_lookup_tableERKSt5arrayINS1_12huffman_codeELm256EEPh(ptr noundef nonnull align 2 dereferenceable(1024) %4, ptr noundef %10) #4
  %11 = call noundef ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE16get_lookup_tableEv(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  %12 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  %15 = getelementptr inbounds i8, ptr %14, i64 8
  %16 = load i32, ptr %15, align 8, !tbaa !12
  %17 = zext i32 %16 to i64
  %18 = getelementptr inbounds i8, ptr %13, i64 %17
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #4
  call void @_ZN3qpl2ml10bit_readerC2IPKhEET_S5_(ptr noundef nonnull align 8 dereferenceable(43) %5, ptr noundef %13, ptr noundef %18)
  %19 = call noundef nonnull align 8 dereferenceable(40) ptr @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE10get_fieldsEv(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  %20 = getelementptr inbounds i8, ptr %19, i64 32
  %21 = load i8, ptr %20, align 8, !tbaa !13
  call void @_ZN3qpl2ml10bit_reader20set_last_bits_offsetEh(ptr noundef nonnull align 8 dereferenceable(43) %5, i8 noundef zeroext %21) #4
  %22 = call noundef zeroext i8 @_ZN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE14get_endiannessEv(ptr noundef nonnull align 8 dereferenceable(17) %0) #4
  %23 = icmp eq i8 %22, 1
  call void @_ZN3qpl2ml10bit_reader14set_big_endianEb(ptr noundef nonnull align 8 dereferenceable(43) %5, i1 noundef zeroext %23) #4
  %24 = xor i32 %8, -1
  br label %.critedge

.critedge:                                        ; preds = %.critedge.backedge, %3
  %.025 = phi i32 [ %24, %3 ], [ %40, %.critedge.backedge ]
  %25 = call noundef zeroext i16 @_ZN3qpl2ml10bit_reader9peek_bitsEh(ptr noundef nonnull align 8 dereferenceable(43) %5, i8 noundef zeroext 15) #4
  %26 = zext i16 %25 to i64
  %27 = getelementptr inbounds i8, ptr %11, i64 %26
  %28 = load i8, ptr %27, align 1, !tbaa !14
  %29 = zext i8 %28 to i64
  %30 = call noundef nonnull align 2 dereferenceable(4) ptr @_ZNSt5arrayIN3qpl2ml11compression12huffman_codeELm256EEixEm(ptr noundef nonnull align 2 dereferenceable(1024) %4, i64 noundef %29) #4
  %31 = getelementptr inbounds i8, ptr %30, i64 3
  %32 = load i8, ptr %31, align 1, !tbaa !15
  call void @_ZN3qpl2ml10bit_reader10shift_bitsEh(ptr noundef nonnull align 8 dereferenceable(43) %5, i8 noundef zeroext %32) #4
  %33 = lshr i32 %.025, 8
  %34 = and i32 %.025, 255
  %35 = zext i8 %28 to i32
  %36 = xor i32 %34, %35
  %37 = zext nneg i32 %36 to i64
  %38 = getelementptr inbounds [256 x i32], ptr @_ZN3qpl2ml4utilL21crc32_table_gzip_reflE, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !18
  %40 = xor i32 %39, %33
  %41 = call noundef zeroext i1 @_ZNK3qpl2ml10bit_reader13is_overflowedEv(ptr noundef nonnull align 8 dereferenceable(43) %5) #4
  br i1 %41, label %42, label %.critedge.backedge

42:                                               ; preds = %.critedge
  %43 = call noundef i32 @_ZNK3qpl2ml10bit_reader20get_buffer_bit_countEv(ptr noundef nonnull align 8 dereferenceable(43) %5) #4
  %.not26 = icmp eq i32 %43, 0
  br i1 %.not26, label %44, label %.critedge.backedge

.critedge.backedge:                               ; preds = %42, %.critedge
  br label %.critedge, !llvm.loop !19

44:                                               ; preds = %42
  %45 = xor i32 %40, %2
  %.not = icmp eq i32 %45, -1
  %. = select i1 %.not, i32 0, i32 229
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #4
  ret i32 %.
}

; Function Attrs: nounwind
declare void @_ZN3qpl2ml10bit_reader14set_big_endianEb(ptr noundef nonnull align 8 dereferenceable(43), i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nounwind
declare noundef zeroext i16 @_ZN3qpl2ml10bit_reader9peek_bitsEh(ptr noundef nonnull align 8 dereferenceable(43), i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(4) ptr @_ZNSt5arrayIN3qpl2ml11compression12huffman_codeELm256EEixEm(ptr noundef nonnull align 2 dereferenceable(1024), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN3qpl2ml10bit_reader10shift_bitsEh(ptr noundef nonnull align 8 dereferenceable(43), i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK3qpl2ml10bit_reader13is_overflowedEv(ptr noundef nonnull align 8 dereferenceable(43)) local_unnamed_addr #3

; Function Attrs: nounwind
declare noundef i32 @_ZNK3qpl2ml10bit_reader20get_buffer_bit_countEv(ptr noundef nonnull align 8 dereferenceable(43)) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 "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, !10, i64 28}
!6 = !{!"_ZTSN3qpl2ml11compression32huffman_only_decompression_stateILNS0_16execution_path_tE2EE23internal_state_fields_tE", !7, i64 0, !10, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !8, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!6, !8, i64 32}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !8, i64 3}
!16 = !{!"_ZTSN3qpl2ml11compression12huffman_codeE", !17, i64 0, !8, i64 2, !8, i64 3}
!17 = !{!"short", !8, i64 0}
!18 = !{!10, !10, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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