; LLVM IR from hlzz/libvot :: src/vocab_tree/vot_pipeline.ll (ZN3vot18BuildImageDatabaseEPKcS1_S1_NS_8SiftTypeEmi)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.vot::VocabTree" = type { i32, i32, i32, i64, i64, i64, i32, ptr }
%"class.vot::SiftData" = type { i32, i32, i32, i32, i32, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.14 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [58 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

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

declare noundef i32 @_ZN2tw2IO12ExtractLinesEPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) #2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3vot8SiftData12ReadSiftFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3vot8SiftData15ReadOpenmvgDescIhLm128EEEbRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare void @_ZN3vot9VocabTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3vot9VocabTree9WriteTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #2

declare noundef zeroext i1 @_ZN3vot9VocabTree8ReadTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) #2

declare noundef zeroext i1 @_ZN3vot9VocabTree9ClearTreeEv(ptr noundef nonnull align 8 dereferenceable(56)) #2

; Function Attrs: nounwind
declare void @_ZN3vot9VocabTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3vot18BuildImageDatabaseEPKcS1_S1_NS_8SiftTypeEmi(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i64 noundef %4, i32 noundef %5) #4 personality ptr @__gxx_personality_v0 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::vector", align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca %"class.vot::VocabTree", align 8
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca %"class.vot::SiftData", align 8
  %22 = alloca double, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store i32 %3, ptr %11, align 4, !tbaa !9
  store i64 %4, ptr %12, align 8, !tbaa !11
  store i32 %5, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #6
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = invoke noundef i32 @_ZN2tw2IO12ExtractLinesEPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE(ptr noundef %23, ptr noundef nonnull align 8 dereferenceable(24) %14)
          to label %25 unwind label %46

25:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %26 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  store i64 %26, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 56, ptr %18) #6
  invoke void @_ZN3vot9VocabTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %27 unwind label %50

27:                                               ; preds = %25
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = invoke noundef zeroext i1 @_ZN3vot9VocabTree8ReadTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56) %18, ptr noundef %28)
          to label %30 unwind label %54

30:                                               ; preds = %27
  %31 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.14)
          to label %32 unwind label %54

32:                                               ; preds = %30
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef %33)
          to label %35 unwind label %54

35:                                               ; preds = %32
  %36 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %37 unwind label %54

37:                                               ; preds = %35
  invoke void @_ZNK3vot9VocabTree4ShowEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %38 unwind label %54

38:                                               ; preds = %37
  %39 = invoke noundef zeroext i1 @_ZN3vot9VocabTree17SetConstantWeightEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %40 unwind label %54

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !11
  br label %41

41:                                               ; preds = %101, %40
  %42 = load i64, ptr %19, align 8, !tbaa !11
  %43 = load i64, ptr %17, align 8, !tbaa !11
  %44 = icmp ult i64 %42, %43
  br i1 %44, label %58, label %45

45:                                               ; preds = %41
  store i32 2, ptr %20, align 4
  br label %110

46:                                               ; preds = %6
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %15, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %16, align 4
  br label %136

50:                                               ; preds = %25
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %15, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %16, align 4
  br label %135

54:                                               ; preds = %129, %126, %124, %121, %119, %115, %112, %38, %37, %35, %32, %30, %27
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %15, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %16, align 4
  br label %134

58:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 40, ptr %21) #6
  invoke void @_ZN3vot8SiftDataC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21)
          to label %59 unwind label %61

59:                                               ; preds = %58
  %60 = load i32, ptr %11, align 4, !tbaa !9
  switch i32 %60, label %79 [
    i32 0, label %65
    i32 1, label %74
  ]

61:                                               ; preds = %58
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %15, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %16, align 4
  br label %109

65:                                               ; preds = %59
  %66 = load i64, ptr %19, align 8, !tbaa !11
  %67 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %66) #6
  %68 = invoke noundef zeroext i1 @_ZN3vot8SiftData12ReadSiftFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %21, ptr noundef nonnull align 8 dereferenceable(32) %67)
          to label %69 unwind label %70

69:                                               ; preds = %65
  br label %82

70:                                               ; preds = %79, %74, %65
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %15, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %16, align 4
  br label %108

74:                                               ; preds = %59
  %75 = load i64, ptr %19, align 8, !tbaa !11
  %76 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %75) #6
  %77 = invoke noundef zeroext i1 @_ZN3vot8SiftData15ReadOpenmvgDescIhLm128EEEbRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %21, ptr noundef nonnull align 8 dereferenceable(32) %76)
          to label %78 unwind label %70

78:                                               ; preds = %74
  br label %82

79:                                               ; preds = %59
  %80 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.15)
          to label %81 unwind label %70

81:                                               ; preds = %79
  store i1 false, ptr %7, align 1
  store i32 1, ptr %20, align 4
  br label %98

82:                                               ; preds = %78, %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %83 = load i64, ptr %12, align 8, !tbaa !11
  %84 = load i64, ptr %19, align 8, !tbaa !11
  %85 = add i64 %83, %84
  %86 = load i32, ptr %13, align 4, !tbaa !13
  %87 = invoke noundef double @_ZN3vot9VocabTree13AddImage2TreeEmRNS_8SiftDataEi(ptr noundef nonnull align 8 dereferenceable(56) %18, i64 noundef %85, ptr noundef nonnull align 8 dereferenceable(40) %21, i32 noundef %86)
          to label %88 unwind label %104

88:                                               ; preds = %82
  store double %87, ptr %22, align 8, !tbaa !15
  %89 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.16)
          to label %90 unwind label %104

90:                                               ; preds = %88
  %91 = load i64, ptr %12, align 8, !tbaa !11
  %92 = load i64, ptr %19, align 8, !tbaa !11
  %93 = add i64 %91, %92
  %94 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %89, i64 noundef %93)
          to label %95 unwind label %104

95:                                               ; preds = %90
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %94, ptr noundef @.str.17)
          to label %97 unwind label %104

97:                                               ; preds = %95
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  store i32 0, ptr %20, align 4
  br label %98

98:                                               ; preds = %97, %81
  call void @_ZN3vot8SiftDataD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #6
  %99 = load i32, ptr %20, align 4
  switch i32 %99, label %110 [
    i32 0, label %100
  ]

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100
  %102 = load i64, ptr %19, align 8, !tbaa !11
  %103 = add i64 %102, 1
  store i64 %103, ptr %19, align 8, !tbaa !11
  br label %41, !llvm.loop !17

104:                                              ; preds = %95, %90, %88, %82
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %15, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %108

108:                                              ; preds = %104, %70
  call void @_ZN3vot8SiftDataD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21) #6
  br label %109

109:                                              ; preds = %108, %61
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %134

110:                                              ; preds = %98, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  %111 = load i32, ptr %20, align 4
  switch i32 %111, label %132 [
    i32 2, label %112
  ]

112:                                              ; preds = %110
  %113 = load i64, ptr %17, align 8, !tbaa !11
  %114 = invoke noundef zeroext i1 @_ZN3vot9VocabTree18ComputeTFIDFWeightEm(ptr noundef nonnull align 8 dereferenceable(56) %18, i64 noundef %113)
          to label %115 unwind label %54

115:                                              ; preds = %112
  %116 = load i64, ptr %12, align 8, !tbaa !11
  %117 = load i64, ptr %17, align 8, !tbaa !11
  %118 = invoke noundef zeroext i1 @_ZN3vot9VocabTree17NormalizeDatabaseEmm(ptr noundef nonnull align 8 dereferenceable(56) %18, i64 noundef %116, i64 noundef %117)
          to label %119 unwind label %54

119:                                              ; preds = %115
  %120 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.18)
          to label %121 unwind label %54

121:                                              ; preds = %119
  %122 = load ptr, ptr %10, align 8, !tbaa !5
  %123 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %120, ptr noundef %122)
          to label %124 unwind label %54

124:                                              ; preds = %121
  %125 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %123, i8 noundef signext 10)
          to label %126 unwind label %54

126:                                              ; preds = %124
  %127 = load ptr, ptr %10, align 8, !tbaa !5
  %128 = invoke noundef zeroext i1 @_ZNK3vot9VocabTree9WriteTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56) %18, ptr noundef %127)
          to label %129 unwind label %54

129:                                              ; preds = %126
  %130 = invoke noundef zeroext i1 @_ZN3vot9VocabTree9ClearTreeEv(ptr noundef nonnull align 8 dereferenceable(56) %18)
          to label %131 unwind label %54

131:                                              ; preds = %129
  store i1 true, ptr %7, align 1
  store i32 1, ptr %20, align 4
  br label %132

132:                                              ; preds = %131, %110
  call void @_ZN3vot9VocabTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %18) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  %133 = load i1, ptr %7, align 1
  ret i1 %133

134:                                              ; preds = %109, %54
  call void @_ZN3vot9VocabTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %18) #6
  br label %135

135:                                              ; preds = %134, %50
  call void @llvm.lifetime.end.p0(i64 56, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %136

136:                                              ; preds = %135, %46
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #6
  br label %137

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

declare void @_ZNK3vot9VocabTree4ShowEv(ptr noundef nonnull align 8 dereferenceable(56)) #2

declare noundef zeroext i1 @_ZN3vot9VocabTree17SetConstantWeightEv(ptr noundef nonnull align 8 dereferenceable(56)) #2

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

declare noundef double @_ZN3vot9VocabTree13AddImage2TreeEmRNS_8SiftDataEi(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #2

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

declare noundef zeroext i1 @_ZN3vot9VocabTree18ComputeTFIDFWeightEm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) #2

declare noundef zeroext i1 @_ZN3vot9VocabTree17NormalizeDatabaseEmm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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 #4 = { 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 = { 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 = { 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 = !{!"_ZTSN3vot8SiftTypeE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::__cxx11::basic_string<char>, std::allocator<std::__cxx11::basic_string<char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.vot::VocabTree" = type { i32, i32, i32, i64, i64, i64, i32, ptr }
%"class.vot::SiftData" = type { i32, i32, i32, i32, i32, ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.14 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [58 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

declare noundef i32 @_ZN2tw2IO12ExtractLinesEPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE(ptr noundef, ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3vot8SiftData12ReadSiftFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN3vot8SiftData15ReadOpenmvgDescIhLm128EEEbRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

declare void @_ZN3vot9VocabTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #2

declare noundef zeroext i1 @_ZNK3vot9VocabTree9WriteTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN3vot9VocabTree8ReadTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN3vot9VocabTree9ClearTreeEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2

; Function Attrs: nounwind
declare void @_ZN3vot9VocabTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(56)) unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN3vot18BuildImageDatabaseEPKcS1_S1_NS_8SiftTypeEmi(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i64 noundef %4, i32 noundef %5) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::vector", align 8
  %8 = alloca %"class.vot::VocabTree", align 8
  %9 = alloca %"class.vot::SiftData", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  %10 = invoke noundef i32 @_ZN2tw2IO12ExtractLinesEPKcRSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS9_EE(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %11 unwind label %52

11:                                               ; preds = %6
  %12 = call noundef i64 @_ZNKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %8) #6
  invoke void @_ZN3vot9VocabTreeC1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %13 unwind label %54

13:                                               ; preds = %11
  %14 = invoke noundef zeroext i1 @_ZN3vot9VocabTree8ReadTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %1)
          to label %15 unwind label %56

15:                                               ; preds = %13
  %16 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.14)
          to label %17 unwind label %56

17:                                               ; preds = %15
  %18 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef %1)
          to label %19 unwind label %56

19:                                               ; preds = %17
  %20 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %21 unwind label %56

21:                                               ; preds = %19
  invoke void @_ZNK3vot9VocabTree4ShowEv(ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %22 unwind label %56

22:                                               ; preds = %21
  %23 = invoke noundef zeroext i1 @_ZN3vot9VocabTree17SetConstantWeightEv(ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %.preheader unwind label %56

.preheader:                                       ; preds = %22
  %.not46 = icmp eq i64 %12, 0
  br i1 %.not46, label %.critedge41, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  switch i32 %3, label %.lr.ph.split [
    i32 0, label %.lr.ph.split.us
    i32 1, label %.lr.ph.split.us51
  ]

.lr.ph.split.us:                                  ; preds = %.lr.ph, %35
  %.02647.us = phi i64 [ %36, %35 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #6
  call void @_ZN3vot8SiftDataC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9)
  %24 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %.02647.us) #6
  %25 = invoke noundef zeroext i1 @_ZN3vot8SiftData12ReadSiftFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 8 dereferenceable(32) %24)
          to label %26 unwind label %.loopexit.split.us

26:                                               ; preds = %.lr.ph.split.us
  %27 = add i64 %.02647.us, %4
  %28 = invoke noundef double @_ZN3vot9VocabTree13AddImage2TreeEmRNS_8SiftDataEi(ptr noundef nonnull align 8 dereferenceable(56) %8, i64 noundef %27, ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef %5)
          to label %29 unwind label %.split.us

29:                                               ; preds = %26
  %30 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.16)
          to label %31 unwind label %.split.us

31:                                               ; preds = %29
  %32 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %30, i64 noundef %27)
          to label %33 unwind label %.split.us

33:                                               ; preds = %31
  %34 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull @.str.17)
          to label %35 unwind label %.split.us

35:                                               ; preds = %33
  call void @_ZN3vot8SiftDataD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #6
  %36 = add nuw i64 %.02647.us, 1
  %exitcond61 = icmp eq i64 %36, %12
  br i1 %exitcond61, label %.critedge41, label %.lr.ph.split.us, !llvm.loop !5

.loopexit.split.us:                               ; preds = %.lr.ph.split.us
  %lpad.loopexit.us = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.split.us:                                        ; preds = %33, %31, %29, %26
  %37 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.lr.ph.split.us51:                                ; preds = %.lr.ph, %49
  %.02647.us53 = phi i64 [ %50, %49 ], [ 0, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #6
  call void @_ZN3vot8SiftDataC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9)
  %38 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %.02647.us53) #6
  %39 = invoke noundef zeroext i1 @_ZN3vot8SiftData15ReadOpenmvgDescIhLm128EEEbRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(40) %9, ptr noundef nonnull align 8 dereferenceable(32) %38)
          to label %40 unwind label %.loopexit.split.split.us

40:                                               ; preds = %.lr.ph.split.us51
  %41 = add i64 %.02647.us53, %4
  %42 = invoke noundef double @_ZN3vot9VocabTree13AddImage2TreeEmRNS_8SiftDataEi(ptr noundef nonnull align 8 dereferenceable(56) %8, i64 noundef %41, ptr noundef nonnull align 8 dereferenceable(40) %9, i32 noundef %5)
          to label %43 unwind label %.split.split.us

43:                                               ; preds = %40
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.16)
          to label %45 unwind label %.split.split.us

45:                                               ; preds = %43
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEm(ptr noundef nonnull align 8 dereferenceable(8) %44, i64 noundef %41)
          to label %47 unwind label %.split.split.us

47:                                               ; preds = %45
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @.str.17)
          to label %49 unwind label %.split.split.us

49:                                               ; preds = %47
  call void @_ZN3vot8SiftDataD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #6
  %50 = add nuw i64 %.02647.us53, 1
  %exitcond = icmp eq i64 %50, %12
  br i1 %exitcond, label %.critedge41, label %.lr.ph.split.us51, !llvm.loop !5

.loopexit.split.split.us:                         ; preds = %.lr.ph.split.us51
  %lpad.loopexit.us55 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.split.split.us:                                  ; preds = %47, %45, %43, %40
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

52:                                               ; preds = %6
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %75

54:                                               ; preds = %11
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %74

56:                                               ; preds = %70, %68, %66, %64, %62, %60, %.critedge41, %22, %21, %19, %17, %15, %13
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %73

.lr.ph.split:                                     ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #6
  call void @_ZN3vot8SiftDataC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9)
  %58 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.15)
          to label %.critedge unwind label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.lr.ph.split
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit

.loopexit:                                        ; preds = %.split.split.us, %.split.us, %.loopexit.split-lp, %.loopexit.split.us, %.loopexit.split.split.us
  %.pn = phi { ptr, i32 } [ %lpad.loopexit.split-lp, %.loopexit.split-lp ], [ %lpad.loopexit.us55, %.loopexit.split.split.us ], [ %lpad.loopexit.us, %.loopexit.split.us ], [ %51, %.split.split.us ], [ %37, %.split.us ]
  call void @_ZN3vot8SiftDataD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #6
  br label %73

.critedge:                                        ; preds = %.lr.ph.split
  call void @_ZN3vot8SiftDataD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #6
  br label %72

.critedge41:                                      ; preds = %49, %35, %.preheader
  %59 = invoke noundef zeroext i1 @_ZN3vot9VocabTree18ComputeTFIDFWeightEm(ptr noundef nonnull align 8 dereferenceable(56) %8, i64 noundef %12)
          to label %60 unwind label %56

60:                                               ; preds = %.critedge41
  %61 = invoke noundef zeroext i1 @_ZN3vot9VocabTree17NormalizeDatabaseEmm(ptr noundef nonnull align 8 dereferenceable(56) %8, i64 noundef %4, i64 noundef %12)
          to label %62 unwind label %56

62:                                               ; preds = %60
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.18)
          to label %64 unwind label %56

64:                                               ; preds = %62
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef %2)
          to label %66 unwind label %56

66:                                               ; preds = %64
  %67 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %65, i8 noundef signext 10)
          to label %68 unwind label %56

68:                                               ; preds = %66
  %69 = invoke noundef zeroext i1 @_ZNK3vot9VocabTree9WriteTreeEPKc(ptr noundef nonnull align 8 dereferenceable(56) %8, ptr noundef %2)
          to label %70 unwind label %56

70:                                               ; preds = %68
  %71 = invoke noundef zeroext i1 @_ZN3vot9VocabTree9ClearTreeEv(ptr noundef nonnull align 8 dereferenceable(56) %8)
          to label %72 unwind label %56

72:                                               ; preds = %.critedge, %70
  %.not45 = phi i1 [ false, %.critedge ], [ true, %70 ]
  call void @_ZN3vot9VocabTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #6
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  ret i1 %.not45

73:                                               ; preds = %.loopexit, %56
  %.pn36 = phi { ptr, i32 } [ %57, %56 ], [ %.pn, %.loopexit ]
  call void @_ZN3vot9VocabTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(56) %8) #6
  br label %74

74:                                               ; preds = %73, %54
  %.pn36.pn = phi { ptr, i32 } [ %.pn36, %73 ], [ %55, %54 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %8) #6
  br label %75

75:                                               ; preds = %74, %52
  %.pn36.pn.pn = phi { ptr, i32 } [ %.pn36.pn, %74 ], [ %53, %52 ]
  call void @_ZNSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS5_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  resume { ptr, i32 } %.pn36.pn.pn
}

declare void @_ZNK3vot9VocabTree4ShowEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN3vot9VocabTree17SetConstantWeightEv(ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #2

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

declare noundef double @_ZN3vot9VocabTree13AddImage2TreeEmRNS_8SiftDataEi(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #2

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

declare noundef zeroext i1 @_ZN3vot9VocabTree18ComputeTFIDFWeightEm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN3vot9VocabTree17NormalizeDatabaseEmm(ptr noundef nonnull align 8 dereferenceable(56), i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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 #4 = { 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 = { 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass