; LLVM IR from libtcod/libtcod :: src/libtcod/bsp.ll (ZN7TCODBsp26traverseInvertedLevelOrderEP16ITCODBspCallbackPv)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl" }
%"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl" = type { %"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.0" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; 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 @_ZNSt6vectorIP7TCODBspSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7TCODBsp26traverseInvertedLevelOrderEP16ITCODBspCallbackPv(ptr noundef nonnull align 8 dereferenceable(54) %0, ptr noundef %1, ptr noundef %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store ptr %20, ptr %10, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %21 unwind label %45

21:                                               ; preds = %3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %22

22:                                               ; preds = %75, %21
  %23 = call noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  %24 = xor i1 %23, true
  br i1 %24, label %25, label %77

25:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %27, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %28 = call ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  %29 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %28, ptr %29, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKP7TCODBspSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #3
  %30 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.0", ptr %14, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8
  %32 = invoke ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr %31)
          to label %33 unwind label %49

33:                                               ; preds = %25
  %34 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %32, ptr %34, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %35 unwind label %53

35:                                               ; preds = %33
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = invoke noundef ptr @_ZNK7TCODBsp7getLeftEv(ptr noundef nonnull align 8 dereferenceable(54) %36)
          to label %38 unwind label %53

38:                                               ; preds = %35
  %39 = icmp ne ptr %37, null
  br i1 %39, label %40, label %61

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %41 = load ptr, ptr %13, align 8, !tbaa !5
  %42 = invoke noundef ptr @_ZNK7TCODBsp7getLeftEv(ptr noundef nonnull align 8 dereferenceable(54) %41)
          to label %43 unwind label %57

43:                                               ; preds = %40
  store ptr %42, ptr %17, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %44 unwind label %57

44:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %61

45:                                               ; preds = %3
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %11, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %100

49:                                               ; preds = %25
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %11, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %76

53:                                               ; preds = %61, %35, %33
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %11, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %12, align 4
  br label %76

57:                                               ; preds = %43, %40
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %11, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  br label %76

61:                                               ; preds = %44, %38
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = invoke noundef ptr @_ZNK7TCODBsp8getRightEv(ptr noundef nonnull align 8 dereferenceable(54) %62)
          to label %64 unwind label %53

64:                                               ; preds = %61
  %65 = icmp ne ptr %63, null
  br i1 %65, label %66, label %75

66:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = invoke noundef ptr @_ZNK7TCODBsp8getRightEv(ptr noundef nonnull align 8 dereferenceable(54) %67)
          to label %69 unwind label %71

69:                                               ; preds = %66
  store ptr %68, ptr %18, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(8) %18)
          to label %70 unwind label %71

70:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %75

71:                                               ; preds = %69, %66
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %11, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %76

75:                                               ; preds = %70, %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %22, !llvm.loop !9

76:                                               ; preds = %71, %57, %53, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %100

77:                                               ; preds = %22
  br label %78

78:                                               ; preds = %96, %77
  %79 = call noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  %80 = xor i1 %79, true
  br i1 %80, label %81, label %97

81:                                               ; preds = %78
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = load ptr, ptr %82, align 8, !tbaa !11
  %87 = getelementptr inbounds ptr, ptr %86, i64 2
  %88 = load ptr, ptr %87, align 8
  %89 = invoke noundef zeroext i1 %88(ptr noundef nonnull align 8 dereferenceable(8) %82, ptr noundef %84, ptr noundef %85)
          to label %90 unwind label %92

90:                                               ; preds = %81
  br i1 %89, label %96, label %91

91:                                               ; preds = %90
  store i1 false, ptr %4, align 1
  store i32 1, ptr %19, align 4
  br label %98

92:                                               ; preds = %81
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %11, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %12, align 4
  br label %100

96:                                               ; preds = %90
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  br label %78, !llvm.loop !13

97:                                               ; preds = %78
  store i1 true, ptr %4, align 1
  store i32 1, ptr %19, align 4
  br label %98

98:                                               ; preds = %97, %91
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  %99 = load i1, ptr %4, align 1
  ret i1 %99

100:                                              ; preds = %92, %76, %45
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #3
  br label %101

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

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

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl" }
%"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl" = type { %"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<TCODBsp *, std::allocator<TCODBsp *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator.0" = type { ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

declare i32 @__gxx_personality_v0(...)

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

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

; 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 @_ZNSt6vectorIP7TCODBspSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN7TCODBsp26traverseInvertedLevelOrderEP16ITCODBspCallbackPv(ptr noundef nonnull align 8 dereferenceable(54) %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator.0", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #3
  store ptr %0, ptr %6, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %12 unwind label %28

12:                                               ; preds = %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #3
  %13 = call noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  br i1 %13, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %45, %12
  %14 = call noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  br i1 %14, label %._crit_edge, label %.lr.ph12

.lr.ph:                                           ; preds = %12, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  %16 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %16, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #3
  %17 = call ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  store ptr %17, ptr %9, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKP7TCODBspSt6vectorIS2_SaIS2_EEEC2IPS2_vEERKNS0_IT_S7_EE(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #3
  %18 = load ptr, ptr %8, align 8
  %19 = invoke ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS1_S3_EE(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr %18)
          to label %20 unwind label %30

20:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %21 unwind label %32

21:                                               ; preds = %20
  %22 = load ptr, ptr %7, align 8, !tbaa !5
  %23 = call noundef ptr @_ZNK7TCODBsp7getLeftEv(ptr noundef nonnull align 8 dereferenceable(54) %22)
  %.not = icmp eq ptr %23, null
  br i1 %.not, label %36, label %24

24:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #3
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = call noundef ptr @_ZNK7TCODBsp7getLeftEv(ptr noundef nonnull align 8 dereferenceable(54) %25)
  store ptr %26, ptr %10, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %27 unwind label %34

27:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  br label %36

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

30:                                               ; preds = %.lr.ph
  %31 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #3
  br label %47

32:                                               ; preds = %20
  %33 = landingpad { ptr, i32 }
          cleanup
  br label %47

34:                                               ; preds = %24
  %35 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #3
  br label %47

36:                                               ; preds = %27, %21
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call noundef ptr @_ZNK7TCODBsp8getRightEv(ptr noundef nonnull align 8 dereferenceable(54) %37)
  %.not8 = icmp eq ptr %38, null
  br i1 %.not8, label %45, label %39

39:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #3
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = call noundef ptr @_ZNK7TCODBsp8getRightEv(ptr noundef nonnull align 8 dereferenceable(54) %40)
  store ptr %41, ptr %11, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIP7TCODBspSaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(8) %11)
          to label %42 unwind label %43

42:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  br label %45

43:                                               ; preds = %39
  %44 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #3
  br label %47

45:                                               ; preds = %42, %36
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  %46 = call noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  br i1 %46, label %.preheader, label %.lr.ph, !llvm.loop !9

47:                                               ; preds = %43, %34, %32, %30
  %.pn = phi { ptr, i32 } [ %44, %43 ], [ %35, %34 ], [ %33, %32 ], [ %31, %30 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  br label %59

.lr.ph12:                                         ; preds = %.preheader, %57
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIP7TCODBspSaIS1_EE4backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = load ptr, ptr %1, align 8, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %50, i64 16
  %52 = load ptr, ptr %51, align 8
  %53 = invoke noundef zeroext i1 %52(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %49, ptr noundef %2)
          to label %54 unwind label %55

54:                                               ; preds = %.lr.ph12
  br i1 %53, label %57, label %._crit_edge

55:                                               ; preds = %.lr.ph12
  %56 = landingpad { ptr, i32 }
          cleanup
  br label %59

57:                                               ; preds = %54
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EE8pop_backEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  %58 = call noundef zeroext i1 @_ZNKSt6vectorIP7TCODBspSaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  br i1 %58, label %._crit_edge, label %.lr.ph12, !llvm.loop !13

._crit_edge:                                      ; preds = %54, %57, %.preheader
  %.lcssa = phi i1 [ true, %.preheader ], [ %53, %57 ], [ %53, %54 ]
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  ret i1 %.lcssa

59:                                               ; preds = %55, %47, %28
  %.pn.pn = phi { ptr, i32 } [ %.pn, %47 ], [ %56, %55 ], [ %29, %28 ]
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @_ZNSt6vectorIP7TCODBspSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  resume { ptr, i32 } %.pn.pn
}

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

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = distinct !{!13, !10}


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