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

; 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::huffman_table_t" = type { %"struct.qpl::ml::compression::huffman_table_meta_t", i8, ptr, ptr, %"class.std::unique_ptr", %struct.allocator_t }
%"struct.qpl::ml::compression::huffman_table_meta_t" = type { [4 x i8], i32, i8, i8, i8, i8, i32 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.1" = type { ptr }
%struct.allocator_t = type { ptr, ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef zeroext i1 @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE0EE8is_equalERKS4_(ptr noundef nonnull align 8 dereferenceable(72) %0, ptr noundef nonnull align 8 dereferenceable(72) %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %11 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  store i8 1, ptr %5, align 1, !tbaa !9
  %12 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_t", ptr %11, i32 0, i32 2
  %13 = load ptr, ptr %12, align 8, !tbaa !11
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %25

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %16 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_t", ptr %11, i32 0, i32 2
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  store ptr %17, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_t", ptr %18, i32 0, i32 2
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  store ptr %20, ptr %7, align 8, !tbaa !5
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI29qpl_compression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(3904) %21, ptr noundef nonnull align 64 dereferenceable(3904) %22) #3
  %24 = zext i1 %23 to i8
  store i8 %24, ptr %5, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %25

25:                                               ; preds = %15, %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  store i8 1, ptr %8, align 1, !tbaa !9
  %26 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_t", ptr %11, i32 0, i32 3
  %27 = load ptr, ptr %26, align 8, !tbaa !28
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %39

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %30 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_t", ptr %11, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !28
  store ptr %31, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.qpl::ml::compression::huffman_table_t", ptr %32, i32 0, i32 3
  %34 = load ptr, ptr %33, align 8, !tbaa !28
  store ptr %34, ptr %10, align 8, !tbaa !5
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = call noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI31qpl_decompression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(27584) %35, ptr noundef nonnull align 64 dereferenceable(27584) %36) #3
  %38 = zext i1 %37 to i8
  store i8 %38, ptr %8, align 1, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %39

39:                                               ; preds = %29, %25
  %40 = load i8, ptr %5, align 1, !tbaa !9, !range !29, !noundef !30
  %41 = trunc i8 %40 to i1
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = load i8, ptr %8, align 1, !tbaa !9, !range !29, !noundef !30
  %44 = trunc i8 %43 to i1
  br label %45

45:                                               ; preds = %42, %39
  %46 = phi i1 [ false, %39 ], [ %44, %42 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  ret i1 %46
}

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI29qpl_compression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(3904), ptr noundef nonnull align 64 dereferenceable(3904)) #2

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI31qpl_decompression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(27584), ptr noundef nonnull align 64 dereferenceable(27584)) #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 = { 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 = !{!"bool", !7, i64 0}
!11 = !{!12, !6, i64 24}
!12 = !{!"_ZTSN3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE0EEE", !13, i64 0, !10, i64 16, !6, i64 24, !6, i64 32, !19, i64 40, !27, i64 56}
!13 = !{!"_ZTSN3qpl2ml11compression20huffman_table_meta_tE", !7, i64 0, !14, i64 4, !15, i64 8, !16, i64 9, !17, i64 10, !18, i64 11, !14, i64 12}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN3qpl2ml11compression23compression_algorithm_eE", !7, i64 0}
!16 = !{!"_ZTSN3qpl2ml11compression15table_version_eE", !7, i64 0}
!17 = !{!"_ZTSN3qpl2ml11compression20huffman_table_type_eE", !7, i64 0}
!18 = !{!"_ZTSN3qpl2ml16execution_path_tE", !7, i64 0}
!19 = !{!"_ZTSSt10unique_ptrIA_hPFvPvEE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_dataIhPFvPvELb1ELb1EE", !21, i64 0}
!21 = !{!"_ZTSSt15__uniq_ptr_implIhPFvPvEE", !22, i64 0}
!22 = !{!"_ZTSSt5tupleIJPhPFvPvEEE", !23, i64 0}
!23 = !{!"_ZTSSt11_Tuple_implILm0EJPhPFvPvEEE", !24, i64 0, !26, i64 8}
!24 = !{!"_ZTSSt11_Tuple_implILm1EJPFvPvEEE", !25, i64 0}
!25 = !{!"_ZTSSt10_Head_baseILm1EPFvPvELb0EE", !6, i64 0}
!26 = !{!"_ZTSSt10_Head_baseILm0EPhLb0EE", !6, i64 0}
!27 = !{!"_ZTS11allocator_t", !6, i64 0, !6, i64 8}
!28 = !{!12, !6, i64 32}
!29 = !{i8 0, i8 2}
!30 = !{}


; 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 noundef zeroext i1 @_ZNK3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE0EE8is_equalERKS4_(ptr nocapture noundef nonnull readonly align 8 dereferenceable(72) %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(72) %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %9, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %1, i64 24
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = tail call noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI29qpl_compression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(3904) %4, ptr noundef nonnull align 64 dereferenceable(3904) %7) #2
  br label %9

9:                                                ; preds = %5, %2
  %.0 = phi i1 [ %8, %5 ], [ true, %2 ]
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = load ptr, ptr %10, align 8, !tbaa !26
  %.not11 = icmp eq ptr %11, null
  br i1 %.not11, label %16, label %12

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %1, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !26
  %15 = tail call noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI31qpl_decompression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(27584) %11, ptr noundef nonnull align 64 dereferenceable(27584) %14) #2
  br label %16

16:                                               ; preds = %12, %9
  %.08 = phi i1 [ %15, %12 ], [ true, %9 ]
  %17 = and i1 %.0, %.08
  ret i1 %17
}

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI29qpl_compression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(3904), ptr noundef nonnull align 64 dereferenceable(3904)) local_unnamed_addr #1

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN3qpl2ml11compression8is_equalI31qpl_decompression_huffman_tableS3_EEbRT_RT0_(ptr noundef nonnull align 64 dereferenceable(27584), ptr noundef nonnull align 64 dereferenceable(27584)) 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 = { 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 24}
!6 = !{!"_ZTSN3qpl2ml11compression15huffman_table_tILNS1_23compression_algorithm_eE0EEE", !7, i64 0, !15, i64 16, !16, i64 24, !16, i64 32, !17, i64 40, !25, i64 56}
!7 = !{!"_ZTSN3qpl2ml11compression20huffman_table_meta_tE", !8, i64 0, !10, i64 4, !11, i64 8, !12, i64 9, !13, i64 10, !14, i64 11, !10, i64 12}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN3qpl2ml11compression23compression_algorithm_eE", !8, i64 0}
!12 = !{!"_ZTSN3qpl2ml11compression15table_version_eE", !8, i64 0}
!13 = !{!"_ZTSN3qpl2ml11compression20huffman_table_type_eE", !8, i64 0}
!14 = !{!"_ZTSN3qpl2ml16execution_path_tE", !8, i64 0}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"any pointer", !8, i64 0}
!17 = !{!"_ZTSSt10unique_ptrIA_hPFvPvEE", !18, i64 0}
!18 = !{!"_ZTSSt15__uniq_ptr_dataIhPFvPvELb1ELb1EE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_implIhPFvPvEE", !20, i64 0}
!20 = !{!"_ZTSSt5tupleIJPhPFvPvEEE", !21, i64 0}
!21 = !{!"_ZTSSt11_Tuple_implILm0EJPhPFvPvEEE", !22, i64 0, !24, i64 8}
!22 = !{!"_ZTSSt11_Tuple_implILm1EJPFvPvEEE", !23, i64 0}
!23 = !{!"_ZTSSt10_Head_baseILm1EPFvPvELb0EE", !16, i64 0}
!24 = !{!"_ZTSSt10_Head_baseILm0EPhLb0EE", !16, i64 0}
!25 = !{!"_ZTS11allocator_t", !16, i64 0, !16, i64 8}
!26 = !{!6, !16, i64 32}


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