; LLVM IR from rahulyesantharao/b-epsilon-tree :: src (test)

; 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.BeTree = type { %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %class.BeTree, align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %16 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %3, ptr noundef @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %17 unwind label %20

17:                                               ; preds = %0
  invoke void @_ZN6BeTreeC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef %3)
          to label %18 unwind label %24

18:                                               ; preds = %17
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 100000, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !5
  %19 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %19, label %142 [
    i32 0, label %29
    i32 1, label %86
  ]

20:                                               ; preds = %0
  %21 = landingpad { ptr, i32 }
          cleanup
  %22 = extractvalue { ptr, i32 } %21, 0
  store ptr %22, ptr %5, align 8
  %23 = extractvalue { ptr, i32 } %21, 1
  store i32 %23, ptr %6, align 4
  br label %28

24:                                               ; preds = %17
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %5, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %6, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #8
  br label %28

28:                                               ; preds = %24, %20
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #8
  br label %145

29:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %57, %29
  %31 = load i32, ptr %9, align 4, !tbaa !5
  %32 = load i32, ptr %7, align 4, !tbaa !5
  %33 = icmp ule i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %61

35:                                               ; preds = %30
  %36 = load i32, ptr %9, align 4, !tbaa !5
  %37 = load i32, ptr %9, align 4, !tbaa !5
  invoke void @_ZN6BeTree6InsertEjj(ptr noundef nonnull align 8 dereferenceable(48) %2, i32 noundef %36, i32 noundef %37)
          to label %38 unwind label %47

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %39 = load i32, ptr %9, align 4, !tbaa !5
  %40 = invoke noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48) %2, i32 noundef %39)
          to label %41 unwind label %51

41:                                               ; preds = %38
  store i32 %40, ptr %10, align 4, !tbaa !5
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = load i32, ptr %9, align 4, !tbaa !5
  %44 = icmp eq i32 %42, %43
  br i1 %44, label %45, label %46

45:                                               ; preds = %41
  br label %56

46:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 18, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

47:                                               ; preds = %35
  %48 = landingpad { ptr, i32 }
          cleanup
  %49 = extractvalue { ptr, i32 } %48, 0
  store ptr %49, ptr %5, align 8
  %50 = extractvalue { ptr, i32 } %48, 1
  store i32 %50, ptr %6, align 4
  br label %60

51:                                               ; preds = %38
  %52 = landingpad { ptr, i32 }
          cleanup
  %53 = extractvalue { ptr, i32 } %52, 0
  store ptr %53, ptr %5, align 8
  %54 = extractvalue { ptr, i32 } %52, 1
  store i32 %54, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %60

55:                                               ; No predecessors!
  br label %56

56:                                               ; preds = %55, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = add i32 %58, 1
  store i32 %59, ptr %9, align 4, !tbaa !5
  br label %30, !llvm.loop !9

60:                                               ; preds = %51, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %144

61:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %82, %61
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = icmp ule i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %85

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %68 = load i32, ptr %11, align 4, !tbaa !5
  %69 = invoke noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48) %2, i32 noundef %68)
          to label %70 unwind label %76

70:                                               ; preds = %67
  store i32 %69, ptr %12, align 4, !tbaa !5
  %71 = load i32, ptr %12, align 4, !tbaa !5
  %72 = load i32, ptr %11, align 4, !tbaa !5
  %73 = icmp eq i32 %71, %72
  br i1 %73, label %74, label %75

74:                                               ; preds = %70
  br label %81

75:                                               ; preds = %70
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 22, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

76:                                               ; preds = %67
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %5, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %144

80:                                               ; No predecessors!
  br label %81

81:                                               ; preds = %80, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %11, align 4, !tbaa !5
  %84 = add i32 %83, 1
  store i32 %84, ptr %11, align 4, !tbaa !5
  br label %62, !llvm.loop !11

85:                                               ; preds = %66
  br label %142

86:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %87 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %87, ptr %13, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %113, %86
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = icmp uge i32 %89, 1
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %116

92:                                               ; preds = %88
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = load i32, ptr %13, align 4, !tbaa !5
  %96 = sub i32 %94, %95
  invoke void @_ZN6BeTree6InsertEjj(ptr noundef nonnull align 8 dereferenceable(48) %2, i32 noundef %93, i32 noundef %96)
          to label %97 unwind label %107

97:                                               ; preds = %92
  %98 = load i32, ptr %13, align 4, !tbaa !5
  %99 = invoke noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48) %2, i32 noundef %98)
          to label %100 unwind label %107

100:                                              ; preds = %97
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = sub i32 %101, %102
  %104 = icmp eq i32 %99, %103
  br i1 %104, label %105, label %106

105:                                              ; preds = %100
  br label %112

106:                                              ; preds = %100
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 29, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

107:                                              ; preds = %97, %92
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %5, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %144

111:                                              ; No predecessors!
  br label %112

112:                                              ; preds = %111, %105
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %13, align 4, !tbaa !5
  %115 = add nsw i32 %114, -1
  store i32 %115, ptr %13, align 4, !tbaa !5
  br label %88, !llvm.loop !12

116:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1, ptr %14, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %138, %116
  %118 = load i32, ptr %14, align 4, !tbaa !5
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = icmp ule i32 %118, %119
  br i1 %120, label %122, label %121

121:                                              ; preds = %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %141

122:                                              ; preds = %117
  %123 = load i32, ptr %14, align 4, !tbaa !5
  %124 = invoke noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48) %2, i32 noundef %123)
          to label %125 unwind label %132

125:                                              ; preds = %122
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = load i32, ptr %14, align 4, !tbaa !5
  %128 = sub i32 %126, %127
  %129 = icmp eq i32 %124, %128
  br i1 %129, label %130, label %131

130:                                              ; preds = %125
  br label %137

131:                                              ; preds = %125
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 32, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

132:                                              ; preds = %122
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %5, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %144

136:                                              ; No predecessors!
  br label %137

137:                                              ; preds = %136, %130
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %14, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %14, align 4, !tbaa !5
  br label %117, !llvm.loop !13

141:                                              ; preds = %121
  br label %142

142:                                              ; preds = %141, %85, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @_ZN6BeTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #8
  %143 = load i32, ptr %1, align 4
  ret i32 %143

144:                                              ; preds = %132, %107, %76, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @_ZN6BeTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #8
  br label %145

145:                                              ; preds = %144, %28
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #8
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %5, align 8
  %148 = load i32, ptr %6, align 4
  %149 = insertvalue { ptr, i32 } poison, ptr %147, 0
  %150 = insertvalue { ptr, i32 } %149, i32 %148, 1
  resume { ptr, i32 } %150
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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)) #1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6BeTreeC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) unnamed_addr #5

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

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

declare void @_ZN6BeTree6InsertEjj(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i32 noundef) #5

declare noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #5

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

; Function Attrs: nounwind
declare void @_ZN6BeTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #7

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

attributes #0 = { mustprogress norecurse 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 = { 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 #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { 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 #8 = { nounwind }
attributes #9 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


; 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.BeTree = type { %"class.std::__cxx11::basic_string", ptr, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %class.BeTree, align 8
  %2 = alloca %"class.std::__cxx11::basic_string", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str)
  %5 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %2, ptr noundef nonnull @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %6 unwind label %8

6:                                                ; preds = %0
  invoke void @_ZN6BeTreeC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48) %1, ptr noundef nonnull %2)
          to label %7 unwind label %10

7:                                                ; preds = %6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #8
  br label %15

8:                                                ; preds = %0
  %9 = landingpad { ptr, i32 }
          cleanup
  br label %12

10:                                               ; preds = %6
  %11 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %2) #8
  br label %12

12:                                               ; preds = %10, %8
  %.pn = phi { ptr, i32 } [ %11, %10 ], [ %9, %8 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #8
  br label %35

13:                                               ; preds = %19
  %14 = add nsw i32 %.03244, -1
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %.preheader, label %15, !llvm.loop !5

15:                                               ; preds = %7, %13
  %.03244 = phi i32 [ 100000, %7 ], [ %14, %13 ]
  %16 = sub nuw nsw i32 100000, %.03244
  invoke void @_ZN6BeTree6InsertEjj(ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %.03244, i32 noundef %16)
          to label %17 unwind label %22

17:                                               ; preds = %15
  %18 = invoke noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %.03244)
          to label %19 unwind label %22

19:                                               ; preds = %17
  %20 = icmp eq i32 %18, %16
  br i1 %20, label %13, label %21

21:                                               ; preds = %19
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 29, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

22:                                               ; preds = %17, %15
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %34

24:                                               ; preds = %27
  %25 = add nuw nsw i32 %.045, 1
  %exitcond.not = icmp eq i32 %25, 100001
  br i1 %exitcond.not, label %33, label %.preheader, !llvm.loop !7

.preheader:                                       ; preds = %13, %24
  %.045 = phi i32 [ %25, %24 ], [ 1, %13 ]
  %26 = invoke noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48) %1, i32 noundef %.045)
          to label %27 unwind label %31

27:                                               ; preds = %.preheader
  %28 = sub nuw nsw i32 100000, %.045
  %29 = icmp eq i32 %26, %28
  br i1 %29, label %24, label %30

30:                                               ; preds = %27
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 32, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

31:                                               ; preds = %.preheader
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %34

33:                                               ; preds = %24
  call void @_ZN6BeTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  ret i32 0

34:                                               ; preds = %31, %22
  %.pn41 = phi { ptr, i32 } [ %23, %22 ], [ %32, %31 ]
  call void @_ZN6BeTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(48) %1) #8
  br label %35

35:                                               ; preds = %34, %12
  %.pn41.pn = phi { ptr, i32 } [ %.pn41, %34 ], [ %.pn, %12 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %1) #8
  resume { ptr, i32 } %.pn41.pn
}

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6BeTreeC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef) unnamed_addr #5

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

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

declare void @_ZN6BeTree6InsertEjj(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i32 noundef) local_unnamed_addr #5

declare noundef i32 @_ZN6BeTree5QueryEj(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) local_unnamed_addr #5

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

; Function Attrs: nounwind
declare void @_ZN6BeTreeD1Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #7

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

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


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