; 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.std::nothrow_t" = type { i8 }
%"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 }

@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@__PRETTY_FUNCTION__._ZN13wordembedding14HuffmanEncoder22BuildFromTermFrequencyEPKc = external hidden unnamed_addr constant [73 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

declare i32 @fclose(ptr noundef) #1

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

; Function Attrs: nobuiltin nounwind allocsize(0)
declare noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) #3

declare void @_ZN13wordembedding10DictionaryC1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #1

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvRKSt9nothrow_t(ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) #4

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) #1

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

declare void @_ZN13wordembedding10Dictionary6InsertEPKcl(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13wordembedding14HuffmanEncoder24BuildHuffmanTreeFromDictEv(ptr noundef nonnull align 8 dereferenceable(32)) #7 align 2

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

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 901, ptr %6) #8
  %19 = call noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef 152, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #9
  %20 = icmp eq ptr %19, null
  store i1 false, ptr %8, align 1
  br i1 %20, label %23, label %21

21:                                               ; preds = %18
  store ptr %19, ptr %7, align 8
  store i1 true, ptr %8, align 1
  invoke void @_ZN13wordembedding10DictionaryC1Ev(ptr noundef nonnull align 8 dereferenceable(152) %19)
          to label %22 unwind label %31

22:                                               ; preds = %21
  br label %23

23:                                               ; preds = %22, %18
  %24 = phi ptr [ %19, %22 ], [ null, %18 ]
  %25 = getelementptr inbounds %"class.wordembedding::HuffmanEncoder", ptr %13, i32 0, i32 1
  store ptr %24, ptr %25, align 8, !tbaa !9
  %26 = getelementptr inbounds %"class.wordembedding::HuffmanEncoder", ptr %13, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %23
  br label %40

30:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.7, i32 noundef 204, ptr noundef @__PRETTY_FUNCTION__._ZN13wordembedding14HuffmanEncoder22BuildFromTermFrequencyEPKc) #10
  unreachable

31:                                               ; preds = %21
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %9, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %10, align 4
  %35 = load i1, ptr %8, align 1
  br i1 %35, label %36, label %38

36:                                               ; preds = %31
  %37 = load ptr, ptr %7, align 8
  call void @_ZdlPvRKSt9nothrow_t(ptr noundef %37, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #11
  br label %38

38:                                               ; preds = %36, %31
  br label %63

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %29
  br label %41

41:                                               ; preds = %55, %40
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds [901 x i8], ptr %6, i64 0, i64 0
  %44 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %42, ptr noundef @.str.10, ptr noundef %43)
  %45 = icmp ne i32 %44, -1
  br i1 %45, label %46, label %60

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 56, ptr %11) #8
  call void @_ZN13wordembedding13HuffLabelInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = invoke i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %47, ptr noundef @.str.11, ptr noundef %12)
          to label %49 unwind label %56

49:                                               ; preds = %46
  %50 = getelementptr inbounds %"class.wordembedding::HuffmanEncoder", ptr %13, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !9
  %52 = getelementptr inbounds [901 x i8], ptr %6, i64 0, i64 0
  %53 = load i32, ptr %12, align 4, !tbaa !15
  %54 = sext i32 %53 to i64
  invoke void @_ZN13wordembedding10Dictionary6InsertEPKcl(ptr noundef nonnull align 8 dereferenceable(152) %51, ptr noundef %52, i64 noundef %54)
          to label %55 unwind label %56

55:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %11) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #8
  br label %41, !llvm.loop !17

56:                                               ; preds = %49, %46
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %9, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %11) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #8
  br label %63

60:                                               ; preds = %41
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call i32 @fclose(ptr noundef %61)
  call void @_ZN13wordembedding14HuffmanEncoder24BuildHuffmanTreeFromDictEv(ptr noundef nonnull align 8 dereferenceable(32) %13)
  call void @llvm.lifetime.end.p0(i64 901, ptr %6) #8
  br label %66

63:                                               ; preds = %56, %38
  call void @llvm.lifetime.end.p0(i64 901, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %67

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

66:                                               ; preds = %64, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  ret void

67:                                               ; preds = %63
  %68 = load ptr, ptr %9, align 8
  %69 = load i32, ptr %10, align 4
  %70 = insertvalue { ptr, i32 } poison, ptr %68, 0
  %71 = insertvalue { ptr, i32 } %70, i32 %69, 1
  resume { ptr, i32 } %71
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #3 = { nobuiltin nounwind allocsize(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 = { nobuiltin 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = { 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 #8 = { nounwind }
attributes #9 = { builtin nounwind allocsize(0) }
attributes #10 = { noreturn nounwind }
attributes #11 = { builtin 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 24}
!10 = !{!"_ZTSN13wordembedding14HuffmanEncoderE", !11, i64 0, !6, i64 24}
!11 = !{!"_ZTSSt6vectorIN13wordembedding13HuffLabelInfoESaIS1_EE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN13wordembedding13HuffLabelInfoESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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::nothrow_t" = type { i8 }
%"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.5 = external hidden unnamed_addr constant [20 x i8], align 1
@_ZSt7nothrow = external global %"struct.std::nothrow_t", align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [105 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [3 x i8], align 1
@__PRETTY_FUNCTION__._ZN13wordembedding14HuffmanEncoder22BuildFromTermFrequencyEPKc = external hidden unnamed_addr constant [73 x i8], align 1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: nobuiltin nounwind allocsize(0)
declare noalias noundef ptr @_ZnwmRKSt9nothrow_t(i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4

declare void @_ZN13wordembedding10DictionaryC1Ev(ptr noundef nonnull align 8 dereferenceable(152)) unnamed_addr #3

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvRKSt9nothrow_t(ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #5

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

declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3

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

declare void @_ZN13wordembedding10Dictionary6InsertEPKcl(ptr noundef nonnull align 8 dereferenceable(152), ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN13wordembedding14HuffmanEncoder24BuildHuffmanTreeFromDictEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #8 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13wordembedding14HuffmanEncoder22BuildFromTermFrequencyEPKc(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) local_unnamed_addr #8 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [901 x i8], align 16
  %4 = alloca %"struct.wordembedding::HuffLabelInfo", align 8
  %5 = alloca i32, align 4
  %6 = tail call noalias ptr @fopen(ptr noundef %1, ptr noundef nonnull @.str.8)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %29, label %7

7:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 901, ptr nonnull %3) #9
  %8 = tail call noalias noundef dereferenceable_or_null(152) ptr @_ZnwmRKSt9nothrow_t(i64 noundef 152, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #10
  %9 = icmp eq ptr %8, null
  br i1 %9, label %14, label %10

10:                                               ; preds = %7
  invoke void @_ZN13wordembedding10DictionaryC1Ev(ptr noundef nonnull align 8 dereferenceable(152) %8)
          to label %11 unwind label %16

11:                                               ; preds = %10
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %8, ptr %12, align 8, !tbaa !5
  %13 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %6, ptr noundef nonnull @.str.10, ptr noundef nonnull %3)
  %.not1417 = icmp eq i32 %13, -1
  br i1 %.not1417, label %._crit_edge, label %.lr.ph

14:                                               ; preds = %7
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr null, ptr %15, align 8, !tbaa !5
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, i32 noundef 204, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13wordembedding14HuffmanEncoder22BuildFromTermFrequencyEPKc) #11
  unreachable

16:                                               ; preds = %10
  %17 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvRKSt9nothrow_t(ptr noundef nonnull %8, ptr noundef nonnull align 1 dereferenceable(1) @_ZSt7nothrow) #12
  br label %28

.lr.ph:                                           ; preds = %11, %23
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #9
  call void @_ZN13wordembedding13HuffLabelInfoC2Ev(ptr noundef nonnull align 8 dereferenceable(52) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #9
  %18 = invoke i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %6, ptr noundef nonnull @.str.11, ptr noundef nonnull %5)
          to label %19 unwind label %25

19:                                               ; preds = %.lr.ph
  %20 = load ptr, ptr %12, align 8, !tbaa !5
  %21 = load i32, ptr %5, align 4, !tbaa !14
  %22 = sext i32 %21 to i64
  invoke void @_ZN13wordembedding10Dictionary6InsertEPKcl(ptr noundef nonnull align 8 dereferenceable(152) %20, ptr noundef nonnull %3, i64 noundef %22)
          to label %23 unwind label %25

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %4) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #9
  %24 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef nonnull %6, ptr noundef nonnull @.str.10, ptr noundef nonnull %3)
  %.not14 = icmp eq i32 %24, -1
  br i1 %.not14, label %._crit_edge, label %.lr.ph, !llvm.loop !16

25:                                               ; preds = %19, %.lr.ph
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #9
  call void @_ZN13wordembedding13HuffLabelInfoD2Ev(ptr noundef nonnull align 8 dereferenceable(52) %4) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #9
  br label %28

._crit_edge:                                      ; preds = %23, %11
  %27 = call i32 @fclose(ptr noundef nonnull %6)
  call void @_ZN13wordembedding14HuffmanEncoder24BuildHuffmanTreeFromDictEv(ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.end.p0(i64 901, ptr nonnull %3) #9
  br label %30

28:                                               ; preds = %16, %25
  %.pn = phi { ptr, i32 } [ %26, %25 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 901, ptr nonnull %3) #9
  resume { ptr, i32 } %.pn

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

30:                                               ; preds = %29, %._crit_edge
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { "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 = { nobuiltin nounwind allocsize(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 = { nobuiltin 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 #6 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin nounwind allocsize(0) }
attributes #11 = { noreturn nounwind }
attributes #12 = { builtin 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, !15, i64 0}
!15 = !{!"int", !12, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass