; LLVM IR from microsoft/Multiverso :: Applications/WordEmbedding/src (huffman_encoder)

; 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.wordembedding::HuffLabelInfo" = type <{ %"class.std::vector.0", %"class.std::vector.5", i32, [4 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.wordembedding::HuffmanEncoder" = type { %"class.std::vector", ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<wordembedding::HuffLabelInfo, std::allocator<wordembedding::HuffLabelInfo>>::_Vector_impl" }
%"struct.std::_Vector_base<wordembedding::HuffLabelInfo, std::allocator<wordembedding::HuffLabelInfo>>::_Vector_impl" = type { %"struct.std::_Vector_base<wordembedding::HuffLabelInfo, std::allocator<wordembedding::HuffLabelInfo>>::_Vector_impl_data" }
%"struct.std::_Vector_base<wordembedding::HuffLabelInfo, std::allocator<wordembedding::HuffLabelInfo>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.wordembedding::WordInfo" = type { %"class.std::__cxx11::basic_string", i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13wordembedding14HuffmanEncoder9Save2FileEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.wordembedding::HuffLabelInfo", align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call noalias ptr @fopen(ptr noundef %15, ptr noundef @.str)
  store ptr %16, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %97

19:                                               ; preds = %2
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.wordembedding::HuffmanEncoder", ptr %14, i32 0, i32 0
  %22 = call noundef i64 @_ZNKSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #7
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef @.str.1, i64 noundef %22) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %91, %19
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = zext i32 %25 to i64
  %27 = getelementptr inbounds %"class.wordembedding::HuffmanEncoder", ptr %14, i32 0, i32 0
  %28 = call noundef i64 @_ZNKSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %27) #7
  %29 = icmp ult i64 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %24
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %94

31:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 56, ptr %8) #7
  %32 = getelementptr inbounds %"class.wordembedding::HuffmanEncoder", ptr %14, i32 0, i32 0
  %33 = load i32, ptr %6, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = call noundef nonnull align 8 dereferenceable(52) ptr @_ZNSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %32, i64 noundef %34) #7
  call void @_ZN13wordembedding13HuffLabelInfoC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(52) %8, ptr noundef nonnull align 8 dereferenceable(52) %35)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %36 = getelementptr inbounds %"class.wordembedding::HuffmanEncoder", ptr %14, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = invoke noundef ptr @_ZN13wordembedding10Dictionary11GetWordInfoEi(ptr noundef nonnull align 8 dereferenceable(152) %37, i32 noundef %38)
          to label %40 unwind label %54

40:                                               ; preds = %31
  store ptr %39, ptr %9, align 8, !tbaa !5
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load ptr, ptr %9, align 8, !tbaa !5
  %43 = getelementptr inbounds %"struct.wordembedding::WordInfo", ptr %42, i32 0, i32 0
  %44 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %43) #7
  %45 = getelementptr inbounds %"struct.wordembedding::HuffLabelInfo", ptr %8, i32 0, i32 2
  %46 = load i32, ptr %45, align 8, !tbaa !17
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.2, ptr noundef %44, i32 noundef %46) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %67, %40
  %49 = load i32, ptr %12, align 4, !tbaa !9
  %50 = getelementptr inbounds %"struct.wordembedding::HuffLabelInfo", ptr %8, i32 0, i32 2
  %51 = load i32, ptr %50, align 8, !tbaa !17
  %52 = icmp slt i32 %49, %51
  br i1 %52, label %58, label %53

53:                                               ; preds = %48
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %70

54:                                               ; preds = %31
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %10, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %8) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %100

58:                                               ; preds = %48
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.wordembedding::HuffLabelInfo", ptr %8, i32 0, i32 1
  %61 = load i32, ptr %12, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %62) #7
  %64 = load i8, ptr %63, align 1, !tbaa !27
  %65 = sext i8 %64 to i32
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef @.str.3, i32 noundef %65) #7
  br label %67

67:                                               ; preds = %58
  %68 = load i32, ptr %12, align 4, !tbaa !9
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %12, align 4, !tbaa !9
  br label %48, !llvm.loop !28

70:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %85, %70
  %72 = load i32, ptr %13, align 4, !tbaa !9
  %73 = getelementptr inbounds %"struct.wordembedding::HuffLabelInfo", ptr %8, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !17
  %75 = icmp slt i32 %72, %74
  br i1 %75, label %77, label %76

76:                                               ; preds = %71
  store i32 8, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %88

77:                                               ; preds = %71
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %"struct.wordembedding::HuffLabelInfo", ptr %8, i32 0, i32 0
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef %81) #7
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.3, i32 noundef %83) #7
  br label %85

85:                                               ; preds = %77
  %86 = load i32, ptr %13, align 4, !tbaa !9
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %13, align 4, !tbaa !9
  br label %71, !llvm.loop !30

88:                                               ; preds = %76
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef @.str.4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %8) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #7
  br label %91

91:                                               ; preds = %88
  %92 = load i32, ptr %6, align 4, !tbaa !9
  %93 = add i32 %92, 1
  store i32 %93, ptr %6, align 4, !tbaa !9
  br label %24, !llvm.loop !31

94:                                               ; preds = %30
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = call i32 @fclose(ptr noundef %95)
  br label %99

97:                                               ; preds = %2
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  call void (ptr, ...) @_ZN10multiverso3Log5ErrorEPKcz(ptr noundef @.str.5, ptr noundef %98)
  br label %99

99:                                               ; preds = %97, %94
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret void

100:                                              ; preds = %54
  %101 = load ptr, ptr %10, align 8
  %102 = load i32, ptr %11, align 4
  %103 = insertvalue { ptr, i32 } poison, ptr %101, 0
  %104 = insertvalue { ptr, i32 } %103, i32 %102, 1
  resume { ptr, i32 } %104
}

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN13wordembedding13HuffLabelInfoC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #5 align 2

declare noundef ptr @_ZN13wordembedding10Dictionary11GetWordInfoEi(ptr noundef nonnull align 8 dereferenceable(152), i32 noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #6 align 2

declare i32 @fclose(ptr noundef) #2

declare void @_ZN10multiverso3Log5ErrorEPKcz(ptr noundef, ...) #2

attributes #0 = { mustprogress 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 = { "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 = { 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 #5 = { inlinehint mustprogress 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 #6 = { 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 #7 = { 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, !6, i64 24}
!12 = !{!"_ZTSN13wordembedding14HuffmanEncoderE", !13, i64 0, !6, i64 24}
!13 = !{!"_ZTSSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!18, !10, i64 48}
!18 = !{!"_ZTSN13wordembedding13HuffLabelInfoE", !19, i64 0, !23, i64 24, !10, i64 48}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!"_ZTSSt6vectorIcSaIcEE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIcSaIcEE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!7, !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}


; 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.wordembedding::HuffLabelInfo" = type <{ %"class.std::vector.0", %"class.std::vector.5", i32, [4 x i8] }>
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [2 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13wordembedding14HuffmanEncoder9Save2FileEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.wordembedding::HuffLabelInfo", align 8
  %4 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str)
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %45, label %5

5:                                                ; preds = %2
  %6 = tail call noundef i64 @_ZNKSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.1, i64 noundef %6) #7
  %8 = tail call noundef i64 @_ZNKSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %.not33 = icmp eq i64 %8, 0
  br i1 %.not33, label %._crit_edge32, label %.lr.ph31

.lr.ph31:                                         ; preds = %5
  %9 = getelementptr inbounds i8, ptr %0, i64 24
  %10 = getelementptr inbounds i8, ptr %3, i64 48
  %11 = getelementptr inbounds i8, ptr %3, i64 24
  br label %13

._crit_edge32:                                    ; preds = %._crit_edge, %5
  %12 = call i32 @fclose(ptr noundef nonnull %4)
  br label %46

13:                                               ; preds = %.lr.ph31, %._crit_edge
  %14 = phi i64 [ 0, %.lr.ph31 ], [ %36, %._crit_edge ]
  %.02329 = phi i32 [ 0, %.lr.ph31 ], [ %35, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #7
  %15 = call noundef nonnull align 8 dereferenceable(52) ptr @_ZNSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %14) #7
  call void @_ZN13wordembedding13HuffLabelInfoC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(52) %3, ptr noundef nonnull align 8 dereferenceable(52) %15)
  %16 = load ptr, ptr %9, align 8, !tbaa !5
  %17 = invoke noundef ptr @_ZN13wordembedding10Dictionary11GetWordInfoEi(ptr noundef nonnull align 8 dereferenceable(152) %16, i32 noundef %.02329)
          to label %18 unwind label %25

18:                                               ; preds = %13
  %19 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %17) #7
  %20 = load i32, ptr %10, align 8, !tbaa !14
  %21 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.2, ptr noundef %19, i32 noundef %20) #7
  %22 = load i32, ptr %10, align 8, !tbaa !14
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %24 = icmp sgt i32 %31, 0
  br i1 %24, label %.lr.ph28, label %._crit_edge

25:                                               ; preds = %13
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %3) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #7
  resume { ptr, i32 } %26

.lr.ph:                                           ; preds = %18, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %18 ]
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %indvars.iv) #7
  %28 = load i8, ptr %27, align 1, !tbaa !25
  %29 = sext i8 %28 to i32
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.3, i32 noundef %29) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %31 = load i32, ptr %10, align 8, !tbaa !14
  %32 = sext i32 %31 to i64
  %33 = icmp slt i64 %indvars.iv.next, %32
  br i1 %33, label %.lr.ph, label %.preheader, !llvm.loop !26

._crit_edge:                                      ; preds = %.lr.ph28, %18, %.preheader
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.4) #7
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %3) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #7
  %35 = add i32 %.02329, 1
  %36 = zext i32 %35 to i64
  %37 = call noundef i64 @_ZNKSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %38 = icmp ugt i64 %37, %36
  br i1 %38, label %13, label %._crit_edge32, !llvm.loop !28

.lr.ph28:                                         ; preds = %.preheader, %.lr.ph28
  %indvars.iv35 = phi i64 [ %indvars.iv.next36, %.lr.ph28 ], [ 0, %.preheader ]
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv35) #7
  %40 = load i32, ptr %39, align 4, !tbaa !29
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %4, ptr noundef nonnull @.str.3, i32 noundef %40) #7
  %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
  %42 = load i32, ptr %10, align 8, !tbaa !14
  %43 = sext i32 %42 to i64
  %44 = icmp slt i64 %indvars.iv.next36, %43
  br i1 %44, label %.lr.ph28, label %._crit_edge, !llvm.loop !30

45:                                               ; preds = %2
  tail call void (ptr, ...) @_ZN10multiverso3Log5ErrorEPKcz(ptr noundef nonnull @.str.5, ptr noundef %1)
  br label %46

46:                                               ; preds = %45, %._crit_edge32
  ret void
}

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN13wordembedding13HuffLabelInfoC2ERKS0_(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #4 align 2

declare noundef ptr @_ZN13wordembedding10Dictionary11GetWordInfoEi(ptr noundef nonnull align 8 dereferenceable(152), i32 noundef) local_unnamed_addr #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52)) unnamed_addr #6 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

declare void @_ZN10multiverso3Log5ErrorEPKcz(ptr noundef, ...) local_unnamed_addr #5

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { inlinehint mustprogress 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 #5 = { "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 #6 = { 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 #7 = { 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, !11, i64 24}
!6 = !{!"_ZTSN13wordembedding14HuffmanEncoderE", !7, i64 0, !11, i64 24}
!7 = !{!"_ZTSSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!15, !24, i64 48}
!15 = !{!"_ZTSN13wordembedding13HuffLabelInfoE", !16, i64 0, !20, i64 24, !24, i64 48}
!16 = !{!"_ZTSSt6vectorIiSaIiEE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!20 = !{!"_ZTSSt6vectorIcSaIcEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIcSaIcEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!24 = !{!"int", !12, i64 0}
!25 = !{!12, !12, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!24, !24, i64 0}
!30 = distinct !{!30, !27}


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