; LLVM IR from div-bargali/Data-Structures-and-Algorithms :: C++/Data-Structures/Tree (huffman_decoding)

; 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.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl" }
%"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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::allocator.5" = type { i8 }
%struct.node = type { i32, i8, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z14huffman_hiddenNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::priority_queue", align 8
  %4 = alloca %"class.std::vector.3", align 8
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::allocator.5", align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #5
  call void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef 256, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %15 unwind label %22

15:                                               ; preds = %1
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  br label %16

16:                                               ; preds = %36, %15
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #5
  %20 = icmp ult i64 %18, %19
  br i1 %20, label %26, label %21

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

22:                                               ; preds = %1
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %7, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %8, align 4
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %137

26:                                               ; preds = %16
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %28)
          to label %30 unwind label %39

30:                                               ; preds = %26
  %31 = load i8, ptr %29, align 1, !tbaa !11
  %32 = sext i8 %31 to i64
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %32) #5
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %33, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %30
  %37 = load i32, ptr %9, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %9, align 4, !tbaa !9
  br label %16, !llvm.loop !12

39:                                               ; preds = %26
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %7, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %136

43:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %77, %43
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = icmp slt i32 %45, 256
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %80

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %49 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #6
          to label %50 unwind label %72

50:                                               ; preds = %48
  store ptr %49, ptr %11, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.node, ptr %51, i32 0, i32 2
  store ptr null, ptr %52, align 8, !tbaa !14
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.node, ptr %53, i32 0, i32 3
  store ptr null, ptr %54, align 8, !tbaa !16
  %55 = load i32, ptr %10, align 4, !tbaa !9
  %56 = trunc i32 %55 to i8
  %57 = load ptr, ptr %11, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.node, ptr %57, i32 0, i32 1
  store i8 %56, ptr %58, align 4, !tbaa !17
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %60) #5
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.node, ptr %63, i32 0, i32 0
  store i32 %62, ptr %64, align 8, !tbaa !18
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %66) #5
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %76

70:                                               ; preds = %50
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %71 unwind label %72

71:                                               ; preds = %70
  br label %76

72:                                               ; preds = %70, %48
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %7, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %136

76:                                               ; preds = %71, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %77

77:                                               ; preds = %76
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %10, align 4, !tbaa !9
  br label %44, !llvm.loop !19

80:                                               ; preds = %47
  br label %81

81:                                               ; preds = %113, %80
  %82 = invoke noundef i64 @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %83 unwind label %114

83:                                               ; preds = %81
  %84 = icmp ne i64 %82, 1
  br i1 %84, label %85, label %132

85:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %86 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %87 unwind label %118

87:                                               ; preds = %85
  %88 = load ptr, ptr %86, align 8, !tbaa !5
  store ptr %88, ptr %12, align 8, !tbaa !5
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %89 unwind label %118

89:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %90 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %91 unwind label %122

91:                                               ; preds = %89
  %92 = load ptr, ptr %90, align 8, !tbaa !5
  store ptr %92, ptr %13, align 8, !tbaa !5
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %93 unwind label %122

93:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %94 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 24) #6
          to label %95 unwind label %126

95:                                               ; preds = %93
  store ptr %94, ptr %14, align 8, !tbaa !5
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.node, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !18
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.node, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !18
  %102 = add nsw i32 %98, %101
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.node, ptr %103, i32 0, i32 0
  store i32 %102, ptr %104, align 8, !tbaa !18
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.node, ptr %105, i32 0, i32 1
  store i8 0, ptr %106, align 4, !tbaa !17
  %107 = load ptr, ptr %12, align 8, !tbaa !5
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.node, ptr %108, i32 0, i32 2
  store ptr %107, ptr %109, align 8, !tbaa !14
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = load ptr, ptr %14, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.node, ptr %111, i32 0, i32 3
  store ptr %110, ptr %112, align 8, !tbaa !16
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25) %3, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %113 unwind label %126

113:                                              ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %81, !llvm.loop !20

114:                                              ; preds = %132, %81
  %115 = landingpad { ptr, i32 }
          cleanup
  %116 = extractvalue { ptr, i32 } %115, 0
  store ptr %116, ptr %7, align 8
  %117 = extractvalue { ptr, i32 } %115, 1
  store i32 %117, ptr %8, align 4
  br label %136

118:                                              ; preds = %87, %85
  %119 = landingpad { ptr, i32 }
          cleanup
  %120 = extractvalue { ptr, i32 } %119, 0
  store ptr %120, ptr %7, align 8
  %121 = extractvalue { ptr, i32 } %119, 1
  store i32 %121, ptr %8, align 4
  br label %131

122:                                              ; preds = %91, %89
  %123 = landingpad { ptr, i32 }
          cleanup
  %124 = extractvalue { ptr, i32 } %123, 0
  store ptr %124, ptr %7, align 8
  %125 = extractvalue { ptr, i32 } %123, 1
  store i32 %125, ptr %8, align 4
  br label %130

126:                                              ; preds = %95, %93
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %7, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %130

130:                                              ; preds = %126, %122
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %131

131:                                              ; preds = %130, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %136

132:                                              ; preds = %83
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %3)
          to label %134 unwind label %114

134:                                              ; preds = %132
  %135 = load ptr, ptr %133, align 8, !tbaa !5
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  ret ptr %135

136:                                              ; preds = %131, %114, %72, %39
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %137

137:                                              ; preds = %136, %22
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #5
  call void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #5
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr %7, align 8
  %140 = load i32, ptr %8, align 4
  %141 = insertvalue { ptr, i32 } poison, ptr %139, 0
  %142 = insertvalue { ptr, i32 } %141, i32 %140, 1
  resume { ptr, i32 } %142
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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) #1

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

; 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) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #2 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 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 = { 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 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 = { 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 #5 = { nounwind }
attributes #6 = { builtin allocsize(0) }

!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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !6, i64 8}
!15 = !{!"_ZTS4node", !10, i64 0, !7, i64 4, !6, i64 8, !6, i64 16}
!16 = !{!15, !6, i64 16}
!17 = !{!15, !7, i64 4}
!18 = !{!15, !10, i64 0}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}


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

%"class.std::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl" }
%"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<node *, std::allocator<node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.3" = type { %"struct.std::_Vector_base.4" }
%"struct.std::_Vector_base.4" = 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::allocator.5" = type { i8 }

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z14huffman_hiddenNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::priority_queue", align 8
  %3 = alloca %"class.std::vector.3", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::allocator.5", align 1
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #6
  call void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt6vectorIiSaIiEEC2EmRKiRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 256, ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %8 unwind label %10

8:                                                ; preds = %1
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  %9 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %.not31 = icmp eq i64 %9, 0
  br i1 %.not31, label %.preheader26.preheader, label %.lr.ph

.preheader26.preheader:                           ; preds = %.lr.ph, %8
  br label %.preheader26

10:                                               ; preds = %1
  %11 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  br label %60

.lr.ph:                                           ; preds = %8, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %8 ]
  %12 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = sext i8 %13 to i64
  %15 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %14) #6
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = add nsw i32 %16, 1
  store i32 %17, ptr %15, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %0) #6
  %19 = icmp ugt i64 %18, %indvars.iv.next
  br i1 %19, label %.lr.ph, label %.preheader26.preheader, !llvm.loop !10

.preheader:                                       ; preds = %34
  %20 = call noundef i64 @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %.not29 = icmp eq i64 %20, 1
  br i1 %.not29, label %._crit_edge, label %.lr.ph30

.preheader26:                                     ; preds = %.preheader26.preheader, %34
  %indvars.iv33 = phi i64 [ %indvars.iv.next34, %34 ], [ 0, %.preheader26.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  %21 = invoke noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #7
          to label %22 unwind label %32

22:                                               ; preds = %.preheader26
  store ptr %21, ptr %6, align 8, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %21, i64 8
  %24 = trunc i64 %indvars.iv33 to i8
  %25 = getelementptr inbounds i8, ptr %21, i64 4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %23, i8 0, i64 16, i1 false)
  store i8 %24, ptr %25, align 4, !tbaa !14
  %26 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv33) #6
  %27 = load i32, ptr %26, align 4, !tbaa !5
  %28 = load ptr, ptr %6, align 8, !tbaa !12
  store i32 %27, ptr %28, align 8, !tbaa !16
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv33) #6
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %.not22 = icmp eq i32 %30, 0
  br i1 %.not22, label %34, label %31

31:                                               ; preds = %22
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %34 unwind label %32

32:                                               ; preds = %31, %.preheader26
  %33 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %59

34:                                               ; preds = %31, %22
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next34, 256
  br i1 %exitcond.not, label %.preheader, label %.preheader26, !llvm.loop !17

.lr.ph30:                                         ; preds = %.preheader, %49
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %36 = load ptr, ptr %35, align 8, !tbaa !12
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
          to label %37 unwind label %51

37:                                               ; preds = %.lr.ph30
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %39 = load ptr, ptr %38, align 8, !tbaa !12
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3popEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
          to label %40 unwind label %53

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %41 = invoke noalias noundef nonnull dereferenceable(24) ptr @_Znwm(i64 noundef 24) #7
          to label %42 unwind label %55

42:                                               ; preds = %40
  store ptr %41, ptr %7, align 8, !tbaa !12
  %43 = load i32, ptr %36, align 8, !tbaa !16
  %44 = load i32, ptr %39, align 8, !tbaa !16
  %45 = add nsw i32 %44, %43
  store i32 %45, ptr %41, align 8, !tbaa !16
  %46 = getelementptr inbounds i8, ptr %41, i64 4
  store i8 0, ptr %46, align 4, !tbaa !14
  %47 = getelementptr inbounds i8, ptr %41, i64 8
  store ptr %36, ptr %47, align 8, !tbaa !18
  %48 = getelementptr inbounds i8, ptr %41, i64 16
  store ptr %39, ptr %48, align 8, !tbaa !19
  invoke void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25) %2, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %49 unwind label %55

49:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %50 = call noundef i64 @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4sizeEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %.not = icmp eq i64 %50, 1
  br i1 %.not, label %._crit_edge, label %.lr.ph30, !llvm.loop !20

51:                                               ; preds = %.lr.ph30
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %59

53:                                               ; preds = %37
  %54 = landingpad { ptr, i32 }
          cleanup
  br label %59

55:                                               ; preds = %42, %40
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %59

._crit_edge:                                      ; preds = %49, %.preheader
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25) %2)
  %58 = load ptr, ptr %57, align 8, !tbaa !12
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  ret ptr %58

59:                                               ; preds = %51, %55, %53, %32
  %.pn23 = phi { ptr, i32 } [ %33, %32 ], [ %52, %51 ], [ %56, %55 ], [ %54, %53 ]
  call void @_ZNSt6vectorIiSaIiEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %60

60:                                               ; preds = %59, %10
  %.pn23.pn = phi { ptr, i32 } [ %.pn23, %59 ], [ %11, %10 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefED2Ev(ptr noundef nonnull align 8 dereferenceable(25) %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn23.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIiEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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) #1

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

; 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 #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt14priority_queueIP4nodeSt6vectorIS1_SaIS1_EE5derefE3topEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIiED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { builtin allocsize(0) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = !{!15, !7, i64 4}
!15 = !{!"_ZTS4node", !6, i64 0, !7, i64 4, !13, i64 8, !13, i64 16}
!16 = !{!15, !6, i64 0}
!17 = distinct !{!17, !11}
!18 = !{!15, !13, i64 8}
!19 = !{!15, !13, i64 16}
!20 = distinct !{!20, !11}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass