; LLVM IR from jrouwe/JoltPhysics :: TestFramework/UI/UIStaticText.ll (ZN12UIStaticText10AutoLayoutEv)

; 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.JPH::Float2" = type { float, float }
%"class.std::basic_string_view" = type { i64, ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char, std::char_traits<char>, JPH::STLAllocator<char>>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%class.UIStaticText = type <{ %class.UIElement, %"class.JPH::RefConst", %"class.std::__cxx11::basic_string", %"class.JPH::Color", %"class.JPH::Color", i32, i32, i32, i32, i32, i8, [3 x i8] }>
%class.UIElement = type { %class.UIEventListener, i32, ptr, %"class.JPH::Array", %"class.UIElement::Position", %"class.UIElement::Position", %"class.UIElement::Size", %"class.UIElement::Size", %"class.UIElement::Size", %"class.UIElement::Size", i8, i8, i8, i8, i8, i8, i8, %"class.JPH::Array.2", ptr }
%class.UIEventListener = type { ptr }
%"class.JPH::Array" = type { i64, i64, ptr }
%"class.UIElement::Position" = type { i32, %"class.UIElement::Size" }
%"class.UIElement::Size" = type { i32, i32 }
%"class.JPH::Array.2" = type { i64, i64, ptr }
%"class.JPH::RefConst" = type { ptr }
%"class.JPH::Color" = type { %union.anon.7 }
%union.anon.7 = type { i32 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12UIStaticText10AutoLayoutEv(ptr noundef nonnull align 8 dereferenceable(213) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.JPH::Float2", align 4
  %4 = alloca %"class.std::basic_string_view", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  call void @_ZN9UIElement10AutoLayoutEv(ptr noundef nonnull align 8 dereferenceable(144) %10)
  %11 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 1
  %12 = call noundef zeroext i1 @_ZNK3JPH8RefConstI4FontEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef null)
  br i1 %12, label %13, label %67

13:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %14 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 1
  %15 = call noundef ptr @_ZNK3JPH8RefConstI4FontEptEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #6
  call void @_ZNK12UIStaticText14GetWrappedTextB5cxx11Ev(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef nonnull align 8 dereferenceable(213) %10)
  %16 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  %17 = getelementptr inbounds { i64, ptr }, ptr %4, i32 0, i32 0
  %18 = extractvalue { i64, ptr } %16, 0
  store i64 %18, ptr %17, align 8
  %19 = getelementptr inbounds { i64, ptr }, ptr %4, i32 0, i32 1
  %20 = extractvalue { i64, ptr } %16, 1
  store ptr %20, ptr %19, align 8
  %21 = invoke <2 x float> @_ZNK4Font11MeasureTextERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(51376) %15, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %22 unwind label %56

22:                                               ; preds = %13
  store <2 x float> %21, ptr %3, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %23 = getelementptr inbounds %"class.JPH::Float2", ptr %3, i32 0, i32 0
  %24 = load float, ptr %23, align 4, !tbaa !9
  %25 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 1
  %26 = call noundef ptr @_ZNK3JPH8RefConstI4FontEptEv(ptr noundef nonnull align 8 dereferenceable(8) %25)
  %27 = call noundef i32 @_ZNK4Font13GetCharHeightEv(ptr noundef nonnull align 8 dereferenceable(51376) %26)
  %28 = sitofp i32 %27 to float
  %29 = fmul float %24, %28
  %30 = fptosi float %29 to i32
  %31 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 5
  %32 = load i32, ptr %31, align 8, !tbaa !12
  %33 = add nsw i32 %30, %32
  %34 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 6
  %35 = load i32, ptr %34, align 4, !tbaa !29
  %36 = add nsw i32 %33, %35
  store i32 %36, ptr %8, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %37 = getelementptr inbounds %"class.JPH::Float2", ptr %3, i32 0, i32 1
  %38 = load float, ptr %37, align 4, !tbaa !31
  %39 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 1
  %40 = call noundef ptr @_ZNK3JPH8RefConstI4FontEptEv(ptr noundef nonnull align 8 dereferenceable(8) %39)
  %41 = call noundef i32 @_ZNK4Font13GetCharHeightEv(ptr noundef nonnull align 8 dereferenceable(51376) %40)
  %42 = sitofp i32 %41 to float
  %43 = fmul float %38, %42
  %44 = fptosi float %43 to i32
  %45 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 7
  %46 = load i32, ptr %45, align 8, !tbaa !32
  %47 = add nsw i32 %44, %46
  %48 = getelementptr inbounds %class.UIStaticText, ptr %10, i32 0, i32 8
  %49 = load i32, ptr %48, align 4, !tbaa !33
  %50 = add nsw i32 %47, %49
  store i32 %50, ptr %9, align 4, !tbaa !30
  %51 = call noundef i32 @_ZNK9UIElement8GetWidthEv(ptr noundef nonnull align 8 dereferenceable(144) %10)
  %52 = icmp sle i32 %51, 0
  br i1 %52, label %53, label %60

53:                                               ; preds = %22
  %54 = getelementptr inbounds %class.UIElement, ptr %10, i32 0, i32 6
  %55 = load i32, ptr %8, align 4, !tbaa !30
  call void @_ZN9UIElement4Size3SetEiNS_6EUnitsE(ptr noundef nonnull align 4 dereferenceable(8) %54, i32 noundef %55, i32 noundef 0)
  br label %60

56:                                               ; preds = %13
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %6, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %7, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %68

60:                                               ; preds = %53, %22
  %61 = call noundef i32 @_ZNK9UIElement9GetHeightEv(ptr noundef nonnull align 8 dereferenceable(144) %10)
  %62 = icmp sle i32 %61, 0
  br i1 %62, label %63, label %66

63:                                               ; preds = %60
  %64 = getelementptr inbounds %class.UIElement, ptr %10, i32 0, i32 7
  %65 = load i32, ptr %9, align 4, !tbaa !30
  call void @_ZN9UIElement4Size3SetEiNS_6EUnitsE(ptr noundef nonnull align 4 dereferenceable(8) %64, i32 noundef %65, i32 noundef 0)
  br label %66

66:                                               ; preds = %63, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %67

67:                                               ; preds = %66, %1
  ret void

68:                                               ; preds = %56
  %69 = load ptr, ptr %6, align 8
  %70 = load i32, ptr %7, align 4
  %71 = insertvalue { ptr, i32 } poison, ptr %69, 0
  %72 = insertvalue { ptr, i32 } %71, i32 %70, 1
  resume { ptr, i32 } %72
}

declare void @_ZN9UIElement10AutoLayoutEv(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH8RefConstI4FontEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

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

declare <2 x float> @_ZNK4Font11MeasureTextERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(51376), ptr noundef nonnull align 8 dereferenceable(16)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK12UIStaticText14GetWrappedTextB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(213)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4Font13GetCharHeightEv(ptr noundef nonnull align 8 dereferenceable(51376)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9UIElement8GetWidthEv(ptr noundef nonnull align 8 dereferenceable(144)) #5 align 2

declare void @_ZN9UIElement4Size3SetEiNS_6EUnitsE(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9UIElement9GetHeightEv(ptr noundef nonnull align 8 dereferenceable(144)) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="64" "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 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 #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 = { 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 #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, !11, i64 0}
!10 = !{!"_ZTSN3JPH6Float2E", !11, i64 0, !11, i64 4}
!11 = !{!"float", !7, i64 0}
!12 = !{!13, !16, i64 192}
!13 = !{!"_ZTS12UIStaticText", !14, i64 0, !25, i64 144, !26, i64 152, !28, i64 184, !28, i64 188, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !20, i64 208, !23, i64 212}
!14 = !{!"_ZTS9UIElement", !15, i64 0, !16, i64 8, !6, i64 16, !17, i64 24, !19, i64 48, !19, i64 60, !21, i64 72, !21, i64 80, !21, i64 88, !21, i64 96, !23, i64 104, !23, i64 105, !23, i64 106, !23, i64 107, !23, i64 108, !23, i64 109, !23, i64 110, !24, i64 112, !6, i64 136}
!15 = !{!"_ZTS15UIEventListener"}
!16 = !{!"int", !7, i64 0}
!17 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !18, i64 0, !18, i64 8, !6, i64 16}
!18 = !{!"long", !7, i64 0}
!19 = !{!"_ZTSN9UIElement8PositionE", !20, i64 0, !21, i64 4}
!20 = !{!"_ZTSN9UIElement10EAlignmentE", !7, i64 0}
!21 = !{!"_ZTSN9UIElement4SizeE", !16, i64 0, !22, i64 4}
!22 = !{!"_ZTSN9UIElement6EUnitsE", !7, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !18, i64 0, !18, i64 8, !6, i64 16}
!25 = !{!"_ZTSN3JPH8RefConstI4FontEE", !6, i64 0}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !27, i64 0, !18, i64 8, !7, i64 16}
!27 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!28 = !{!"_ZTSN3JPH5ColorE", !7, i64 0}
!29 = !{!13, !16, i64 196}
!30 = !{!16, !16, i64 0}
!31 = !{!10, !11, i64 4}
!32 = !{!13, !16, i64 200}
!33 = !{!13, !16, i64 204}


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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12UIStaticText10AutoLayoutEv(ptr noundef nonnull align 8 dereferenceable(213) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::basic_string_view", align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  tail call void @_ZN9UIElement10AutoLayoutEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %4 = getelementptr inbounds i8, ptr %0, i64 144
  %5 = tail call noundef zeroext i1 @_ZNK3JPH8RefConstI4FontEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef null)
  br i1 %5, label %6, label %47

6:                                                ; preds = %1
  %7 = tail call noundef ptr @_ZNK3JPH8RefConstI4FontEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #6
  call void @_ZNK12UIStaticText14GetWrappedTextB5cxx11Ev(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, ptr noundef nonnull align 8 dereferenceable(213) %0)
  %8 = call { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  %9 = extractvalue { i64, ptr } %8, 0
  store i64 %9, ptr %2, align 8
  %10 = getelementptr inbounds i8, ptr %2, i64 8
  %11 = extractvalue { i64, ptr } %8, 1
  store ptr %11, ptr %10, align 8
  %12 = invoke <2 x float> @_ZNK4Font11MeasureTextERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(51376) %7, ptr noundef nonnull align 8 dereferenceable(16) %2)
          to label %13 unwind label %40

13:                                               ; preds = %6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  %14 = call noundef ptr @_ZNK3JPH8RefConstI4FontEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %15 = call noundef i32 @_ZNK4Font13GetCharHeightEv(ptr noundef nonnull align 8 dereferenceable(51376) %14)
  %16 = getelementptr inbounds i8, ptr %0, i64 192
  %17 = load i32, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 196
  %19 = load i32, ptr %18, align 4, !tbaa !25
  %.sroa.0.4.vec.extract = extractelement <2 x float> %12, i64 1
  %20 = call noundef ptr @_ZNK3JPH8RefConstI4FontEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %21 = call noundef i32 @_ZNK4Font13GetCharHeightEv(ptr noundef nonnull align 8 dereferenceable(51376) %20)
  %22 = sitofp i32 %21 to float
  %23 = fmul float %.sroa.0.4.vec.extract, %22
  %24 = fptosi float %23 to i32
  %25 = getelementptr inbounds i8, ptr %0, i64 200
  %26 = load i32, ptr %25, align 8, !tbaa !26
  %27 = getelementptr inbounds i8, ptr %0, i64 204
  %28 = load i32, ptr %27, align 4, !tbaa !27
  %29 = add i32 %28, %26
  %30 = add i32 %29, %24
  %31 = call noundef i32 @_ZNK9UIElement8GetWidthEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %32 = icmp slt i32 %31, 1
  br i1 %32, label %33, label %42

33:                                               ; preds = %13
  %.sroa.0.0.vec.extract = extractelement <2 x float> %12, i64 0
  %34 = sitofp i32 %15 to float
  %35 = fmul float %.sroa.0.0.vec.extract, %34
  %36 = fptosi float %35 to i32
  %37 = add i32 %19, %17
  %38 = add i32 %37, %36
  %39 = getelementptr inbounds i8, ptr %0, i64 72
  call void @_ZN9UIElement4Size3SetEiNS_6EUnitsE(ptr noundef nonnull align 4 dereferenceable(8) %39, i32 noundef %38, i32 noundef 0)
  br label %42

40:                                               ; preds = %6
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #6
  resume { ptr, i32 } %41

42:                                               ; preds = %33, %13
  %43 = call noundef i32 @_ZNK9UIElement9GetHeightEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %44 = icmp slt i32 %43, 1
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %0, i64 80
  call void @_ZN9UIElement4Size3SetEiNS_6EUnitsE(ptr noundef nonnull align 4 dereferenceable(8) %46, i32 noundef %30, i32 noundef 0)
  br label %47

47:                                               ; preds = %42, %45, %1
  ret void
}

declare void @_ZN9UIElement10AutoLayoutEv(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3JPH8RefConstI4FontEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

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

declare <2 x float> @_ZNK4Font11MeasureTextERKSt17basic_string_viewIcSt11char_traitsIcEE(ptr noundef nonnull align 8 dereferenceable(51376), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK12UIStaticText14GetWrappedTextB5cxx11Ev(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef nonnull align 8 dereferenceable(213)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local { i64, ptr } @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEcvSt17basic_string_viewIcS2_EEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4Font13GetCharHeightEv(ptr noundef nonnull align 8 dereferenceable(51376)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9UIElement8GetWidthEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #5 align 2

declare void @_ZN9UIElement4Size3SetEiNS_6EUnitsE(ptr noundef nonnull align 4 dereferenceable(8), i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZNK9UIElement9GetHeightEv(ptr noundef nonnull align 8 dereferenceable(144)) local_unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="64" "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 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 #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 = { 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 #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, !9, i64 192}
!6 = !{!"_ZTS12UIStaticText", !7, i64 0, !21, i64 144, !22, i64 152, !24, i64 184, !24, i64 188, !9, i64 192, !9, i64 196, !9, i64 200, !9, i64 204, !16, i64 208, !19, i64 212}
!7 = !{!"_ZTS9UIElement", !8, i64 0, !9, i64 8, !12, i64 16, !13, i64 24, !15, i64 48, !15, i64 60, !17, i64 72, !17, i64 80, !17, i64 88, !17, i64 96, !19, i64 104, !19, i64 105, !19, i64 106, !19, i64 107, !19, i64 108, !19, i64 109, !19, i64 110, !20, i64 112, !12, i64 136}
!8 = !{!"_ZTS15UIEventListener"}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"any pointer", !10, i64 0}
!13 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !14, i64 0, !14, i64 8, !12, i64 16}
!14 = !{!"long", !10, i64 0}
!15 = !{!"_ZTSN9UIElement8PositionE", !16, i64 0, !17, i64 4}
!16 = !{!"_ZTSN9UIElement10EAlignmentE", !10, i64 0}
!17 = !{!"_ZTSN9UIElement4SizeE", !9, i64 0, !18, i64 4}
!18 = !{!"_ZTSN9UIElement6EUnitsE", !10, i64 0}
!19 = !{!"bool", !10, i64 0}
!20 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !14, i64 0, !14, i64 8, !12, i64 16}
!21 = !{!"_ZTSN3JPH8RefConstI4FontEE", !12, i64 0}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !23, i64 0, !14, i64 8, !10, i64 16}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !12, i64 0}
!24 = !{!"_ZTSN3JPH5ColorE", !10, i64 0}
!25 = !{!6, !9, i64 196}
!26 = !{!6, !9, i64 200}
!27 = !{!6, !9, i64 204}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass