; LLVM IR from jrouwe/JoltPhysics :: TestFramework/UI/UIButton.ll (ZNK8UIButton4DrawEv)

; 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::Color" = type { %union.anon.7 }
%union.anon.7 = type { i32 }
%class.UIButton = type <{ %class.UITextButton, %class.UITexturedQuad, %"class.JPH::Color", [4 x i8], %class.UITexturedQuad, %"class.JPH::Color", [4 x i8], %class.UITexturedQuad, %"class.JPH::Color", [4 x i8], %class.UITexturedQuad, %"class.JPH::Color", [4 x i8], %class.UITexturedQuad, %"class.JPH::Color", [4 x i8] }>
%class.UITextButton = type { %class.UIStaticText.base, %"class.JPH::Color", %"class.JPH::Color", %"class.JPH::Color", float, float, %"class.std::function", i8, i8, float }
%class.UIStaticText.base = type <{ %class.UIElement, %"class.JPH::RefConst", %"class.std::__cxx11::basic_string", %"class.JPH::Color", %"class.JPH::Color", i32, i32, i32, i32, i32, 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.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.std::function" = type { %"class.std::_Function_base", ptr }
%"class.std::_Function_base" = type { %"union.std::_Any_data", ptr }
%"union.std::_Any_data" = type { %"union.std::_Nocopy_types" }
%"union.std::_Nocopy_types" = type { { i64, i64 } }
%class.UITexturedQuad = type { %"class.JPH::RefConst.8", i32, i32, i32, i32, i32, i32, i32, i32 }
%"class.JPH::RefConst.8" = type { ptr }

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8UIButton4DrawEv(ptr noundef nonnull align 8 dereferenceable(516) %0) unnamed_addr #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %"class.JPH::Color", 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 %"class.JPH::Color", align 4
  %14 = alloca %"class.JPH::Color", align 4
  %15 = alloca %"class.JPH::Color", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8
  %17 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 1
  %18 = getelementptr inbounds %class.UITexturedQuad, ptr %17, i32 0, i32 0
  %19 = call noundef zeroext i1 @_ZNK3JPH8RefConstI7TextureEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef null)
  br i1 %19, label %20, label %129

20:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %21 = call noundef i32 @_ZNK9UIElement4GetXEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  store i32 %21, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %22 = call noundef i32 @_ZNK9UIElement4GetYEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  store i32 %22, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %23 = call noundef zeroext i1 @_ZNK9UIElement10IsDisabledEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  br i1 %23, label %24, label %26

24:                                               ; preds = %20
  %25 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 13
  br label %44

26:                                               ; preds = %20
  %27 = getelementptr inbounds %class.UITextButton, ptr %16, i32 0, i32 7
  %28 = load i8, ptr %27, align 8, !tbaa !11, !range !31, !noundef !32
  %29 = trunc i8 %28 to i1
  br i1 %29, label %30, label %32

30:                                               ; preds = %26
  %31 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 4
  br label %42

32:                                               ; preds = %26
  %33 = getelementptr inbounds %class.UIElement, ptr %16, i32 0, i32 12
  %34 = load i8, ptr %33, align 2, !tbaa !33, !range !31, !noundef !32
  %35 = trunc i8 %34 to i1
  br i1 %35, label %36, label %38

36:                                               ; preds = %32
  %37 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 7
  br label %40

38:                                               ; preds = %32
  %39 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 1
  br label %40

40:                                               ; preds = %38, %36
  %41 = phi ptr [ %37, %36 ], [ %39, %38 ]
  br label %42

42:                                               ; preds = %40, %30
  %43 = phi ptr [ %31, %30 ], [ %41, %40 ]
  br label %44

44:                                               ; preds = %42, %24
  %45 = phi ptr [ %25, %24 ], [ %43, %42 ]
  store ptr %45, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %46 = call noundef zeroext i1 @_ZNK9UIElement10IsDisabledEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 14
  br label %67

49:                                               ; preds = %44
  %50 = getelementptr inbounds %class.UITextButton, ptr %16, i32 0, i32 7
  %51 = load i8, ptr %50, align 8, !tbaa !11, !range !31, !noundef !32
  %52 = trunc i8 %51 to i1
  br i1 %52, label %53, label %55

53:                                               ; preds = %49
  %54 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 5
  br label %65

55:                                               ; preds = %49
  %56 = getelementptr inbounds %class.UIElement, ptr %16, i32 0, i32 12
  %57 = load i8, ptr %56, align 2, !tbaa !33, !range !31, !noundef !32
  %58 = trunc i8 %57 to i1
  br i1 %58, label %59, label %61

59:                                               ; preds = %55
  %60 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 8
  br label %63

61:                                               ; preds = %55
  %62 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 2
  br label %63

63:                                               ; preds = %61, %59
  %64 = phi ptr [ %60, %59 ], [ %62, %61 ]
  br label %65

65:                                               ; preds = %63, %53
  %66 = phi ptr [ %54, %53 ], [ %64, %63 ]
  br label %67

67:                                               ; preds = %65, %47
  %68 = phi ptr [ %48, %47 ], [ %66, %65 ]
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %68, i64 4, i1 false), !tbaa.struct !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %69 = call noundef i32 @_ZNK9UIElement8GetWidthEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  store i32 %69, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %70 = call noundef i32 @_ZNK9UIElement9GetHeightEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  store i32 %70, ptr %8, align 4, !tbaa !9
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = call noundef zeroext i1 @_ZNK14UITexturedQuad12HasInnerPartEv(ptr noundef nonnull align 8 dereferenceable(40) %71)
  br i1 %72, label %103, label %73

73:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %class.UITexturedQuad, ptr %74, i32 0, i32 3
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %75)
  %77 = load i32, ptr %76, align 4, !tbaa !9
  store i32 %77, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %class.UITexturedQuad, ptr %78, i32 0, i32 4
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %79)
  %81 = load i32, ptr %80, align 4, !tbaa !9
  store i32 %81, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %82 = load i32, ptr %3, align 4, !tbaa !9
  %83 = load i32, ptr %7, align 4, !tbaa !9
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = sub nsw i32 %83, %84
  %86 = sdiv i32 %85, 2
  %87 = add nsw i32 %82, %86
  store i32 %87, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %88 = load i32, ptr %4, align 4, !tbaa !9
  %89 = load i32, ptr %8, align 4, !tbaa !9
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = sub nsw i32 %89, %90
  %92 = sdiv i32 %91, 2
  %93 = add nsw i32 %88, %92
  store i32 %93, ptr %12, align 4, !tbaa !9
  %94 = call noundef ptr @_ZNK9UIElement10GetManagerEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %6, i64 4, i1 false), !tbaa.struct !34
  %100 = getelementptr inbounds %"class.JPH::Color", ptr %13, i32 0, i32 0
  %101 = getelementptr inbounds %union.anon.7, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 4
  call void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248) %94, i32 noundef %95, i32 noundef %96, i32 noundef %97, i32 noundef %98, ptr noundef nonnull align 8 dereferenceable(40) %99, i32 %102)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %113

103:                                              ; preds = %67
  %104 = call noundef ptr @_ZNK9UIElement10GetManagerEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  %105 = load i32, ptr %3, align 4, !tbaa !9
  %106 = load i32, ptr %4, align 4, !tbaa !9
  %107 = load i32, ptr %7, align 4, !tbaa !9
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %6, i64 4, i1 false), !tbaa.struct !34
  %110 = getelementptr inbounds %"class.JPH::Color", ptr %14, i32 0, i32 0
  %111 = getelementptr inbounds %union.anon.7, ptr %110, i32 0, i32 0
  %112 = load i32, ptr %111, align 4
  call void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248) %104, i32 noundef %105, i32 noundef %106, i32 noundef %107, i32 noundef %108, ptr noundef nonnull align 8 dereferenceable(40) %109, i32 %112)
  br label %113

113:                                              ; preds = %103, %73
  %114 = getelementptr inbounds %class.UIElement, ptr %16, i32 0, i32 13
  %115 = load i8, ptr %114, align 1, !tbaa !36, !range !31, !noundef !32
  %116 = trunc i8 %115 to i1
  br i1 %116, label %117, label %128

117:                                              ; preds = %113
  %118 = call noundef ptr @_ZNK9UIElement10GetManagerEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  %119 = load i32, ptr %3, align 4, !tbaa !9
  %120 = load i32, ptr %4, align 4, !tbaa !9
  %121 = load i32, ptr %7, align 4, !tbaa !9
  %122 = load i32, ptr %8, align 4, !tbaa !9
  %123 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 10
  %124 = getelementptr inbounds %class.UIButton, ptr %16, i32 0, i32 11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 8 %124, i64 4, i1 false), !tbaa.struct !34
  %125 = getelementptr inbounds %"class.JPH::Color", ptr %15, i32 0, i32 0
  %126 = getelementptr inbounds %union.anon.7, ptr %125, i32 0, i32 0
  %127 = load i32, ptr %126, align 4
  call void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248) %118, i32 noundef %119, i32 noundef %120, i32 noundef %121, i32 noundef %122, ptr noundef nonnull align 8 dereferenceable(40) %123, i32 %127)
  br label %128

128:                                              ; preds = %117, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %129

129:                                              ; preds = %128, %1
  call void @_ZNK12UITextButton10DrawCustomEv(ptr noundef nonnull align 8 dereferenceable(280) %16)
  call void @_ZNK9UIElement4DrawEv(ptr noundef nonnull align 8 dereferenceable(144) %16)
  ret void
}

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK9UIElement10IsDisabledEv(ptr noundef nonnull align 8 dereferenceable(144)) #4 align 2

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

declare void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(40), i32) #5

declare void @_ZNK12UITextButton10DrawCustomEv(ptr noundef nonnull align 8 dereferenceable(280)) #5

declare void @_ZNK9UIElement4DrawEv(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { 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 = { "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 = !{!"int", !7, i64 0}
!11 = !{!12, !22, i64 272}
!12 = !{!"_ZTS12UITextButton", !13, i64 0, !27, i64 216, !27, i64 220, !27, i64 224, !28, i64 228, !28, i64 232, !29, i64 240, !22, i64 272, !22, i64 273, !28, i64 276}
!13 = !{!"_ZTS12UIStaticText", !14, i64 0, !24, i64 144, !25, i64 152, !27, i64 184, !27, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !19, i64 208, !22, i64 212}
!14 = !{!"_ZTS9UIElement", !15, i64 0, !10, i64 8, !6, i64 16, !16, i64 24, !18, i64 48, !18, i64 60, !20, i64 72, !20, i64 80, !20, i64 88, !20, i64 96, !22, i64 104, !22, i64 105, !22, i64 106, !22, i64 107, !22, i64 108, !22, i64 109, !22, i64 110, !23, i64 112, !6, i64 136}
!15 = !{!"_ZTS15UIEventListener"}
!16 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSN9UIElement8PositionE", !19, i64 0, !20, i64 4}
!19 = !{!"_ZTSN9UIElement10EAlignmentE", !7, i64 0}
!20 = !{!"_ZTSN9UIElement4SizeE", !10, i64 0, !21, i64 4}
!21 = !{!"_ZTSN9UIElement6EUnitsE", !7, i64 0}
!22 = !{!"bool", !7, i64 0}
!23 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!24 = !{!"_ZTSN3JPH8RefConstI4FontEE", !6, i64 0}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !26, i64 0, !17, i64 8, !7, i64 16}
!26 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !6, i64 0}
!27 = !{!"_ZTSN3JPH5ColorE", !7, i64 0}
!28 = !{!"float", !7, i64 0}
!29 = !{!"_ZTSSt8functionIFvvEE", !30, i64 0, !6, i64 24}
!30 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!14, !22, i64 106}
!34 = !{i64 0, i64 4, !35}
!35 = !{!7, !7, i64 0}
!36 = !{!14, !22, i64 107}


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

; 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 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 @_ZNK8UIButton4DrawEv(ptr noundef nonnull align 8 dereferenceable(516) %0) unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = getelementptr inbounds i8, ptr %0, i64 280
  %5 = tail call noundef zeroext i1 @_ZNK3JPH8RefConstI7TextureEneEPKS1_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef null)
  br i1 %5, label %6, label %69

6:                                                ; preds = %1
  %7 = tail call noundef i32 @_ZNK9UIElement4GetXEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %8 = tail call noundef i32 @_ZNK9UIElement4GetYEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %9 = tail call noundef zeroext i1 @_ZNK9UIElement10IsDisabledEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  br i1 %9, label %10, label %12

10:                                               ; preds = %6
  %11 = getelementptr inbounds i8, ptr %0, i64 472
  br label %24

12:                                               ; preds = %6
  %13 = getelementptr inbounds i8, ptr %0, i64 272
  %14 = load i8, ptr %13, align 8, !tbaa !5, !range !29, !noundef !30
  %15 = trunc nuw i8 %14 to i1
  br i1 %15, label %16, label %18

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %0, i64 328
  br label %24

18:                                               ; preds = %12
  %19 = getelementptr inbounds i8, ptr %0, i64 106
  %20 = load i8, ptr %19, align 2, !tbaa !31, !range !29, !noundef !30
  %21 = trunc nuw i8 %20 to i1
  %22 = getelementptr inbounds i8, ptr %0, i64 376
  %23 = select i1 %21, ptr %22, ptr %4
  br label %24

24:                                               ; preds = %16, %18, %10
  %25 = phi ptr [ %11, %10 ], [ %17, %16 ], [ %23, %18 ]
  %26 = tail call noundef zeroext i1 @_ZNK9UIElement10IsDisabledEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  br i1 %26, label %35, label %27

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %0, i64 272
  %29 = load i8, ptr %28, align 8, !tbaa !5, !range !29, !noundef !30
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %35, label %31

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %0, i64 106
  %33 = load i8, ptr %32, align 2, !tbaa !31, !range !29, !noundef !30
  %34 = trunc nuw i8 %33 to i1
  %.v = select i1 %34, i64 416, i64 320
  br label %35

35:                                               ; preds = %27, %24, %31
  %.sink = phi i64 [ %.v, %31 ], [ 512, %24 ], [ 368, %27 ]
  %36 = getelementptr inbounds i8, ptr %0, i64 %.sink
  %.sroa.08.0.copyload = load i32, ptr %36, align 8, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %37 = tail call noundef i32 @_ZNK9UIElement8GetWidthEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  store i32 %37, ptr %2, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  %38 = tail call noundef i32 @_ZNK9UIElement9GetHeightEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  store i32 %38, ptr %3, align 4, !tbaa !33
  %39 = tail call noundef zeroext i1 @_ZNK14UITexturedQuad12HasInnerPartEv(ptr noundef nonnull align 8 dereferenceable(40) %25)
  br i1 %39, label %56, label %40

40:                                               ; preds = %35
  %41 = getelementptr inbounds i8, ptr %25, i64 16
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %41)
  %43 = load i32, ptr %42, align 4, !tbaa !33
  %44 = getelementptr inbounds i8, ptr %25, i64 20
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %44)
  %46 = load i32, ptr %45, align 4, !tbaa !33
  %47 = load i32, ptr %2, align 4, !tbaa !33
  %48 = sub nsw i32 %47, %43
  %49 = sdiv i32 %48, 2
  %50 = add nsw i32 %49, %7
  %51 = load i32, ptr %3, align 4, !tbaa !33
  %52 = sub nsw i32 %51, %46
  %53 = sdiv i32 %52, 2
  %54 = add nsw i32 %53, %8
  %55 = call noundef ptr @_ZNK9UIElement10GetManagerEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  call void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248) %55, i32 noundef %50, i32 noundef %54, i32 noundef %43, i32 noundef %46, ptr noundef nonnull align 8 dereferenceable(40) %25, i32 %.sroa.08.0.copyload)
  br label %58

56:                                               ; preds = %35
  %57 = tail call noundef ptr @_ZNK9UIElement10GetManagerEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  tail call void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248) %57, i32 noundef %7, i32 noundef %8, i32 noundef %37, i32 noundef %38, ptr noundef nonnull align 8 dereferenceable(40) %25, i32 %.sroa.08.0.copyload)
  br label %58

58:                                               ; preds = %56, %40
  %59 = getelementptr inbounds i8, ptr %0, i64 107
  %60 = load i8, ptr %59, align 1, !tbaa !34, !range !29, !noundef !30
  %61 = trunc nuw i8 %60 to i1
  br i1 %61, label %62, label %68

62:                                               ; preds = %58
  %63 = call noundef ptr @_ZNK9UIElement10GetManagerEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  %64 = load i32, ptr %2, align 4, !tbaa !33
  %65 = load i32, ptr %3, align 4, !tbaa !33
  %66 = getelementptr inbounds i8, ptr %0, i64 424
  %67 = getelementptr inbounds i8, ptr %0, i64 464
  %.sroa.0.0.copyload = load i32, ptr %67, align 8, !tbaa !32
  call void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248) %63, i32 noundef %7, i32 noundef %8, i32 noundef %64, i32 noundef %65, ptr noundef nonnull align 8 dereferenceable(40) %66, i32 %.sroa.0.0.copyload)
  br label %68

68:                                               ; preds = %62, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  br label %69

69:                                               ; preds = %68, %1
  call void @_ZNK12UITextButton10DrawCustomEv(ptr noundef nonnull align 8 dereferenceable(280) %0)
  call void @_ZNK9UIElement4DrawEv(ptr noundef nonnull align 8 dereferenceable(144) %0)
  ret void
}

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

declare void @_ZN9UIManager8DrawQuadEiiiiRK14UITexturedQuadN3JPH5ColorE(ptr noundef nonnull align 8 dereferenceable(248), i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(40), i32) local_unnamed_addr #4

declare void @_ZNK12UITextButton10DrawCustomEv(ptr noundef nonnull align 8 dereferenceable(280)) local_unnamed_addr #4

declare void @_ZNK9UIElement4DrawEv(ptr noundef nonnull align 8 dereferenceable(144)) unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { 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 = { "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 }

!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, !20, i64 272}
!6 = !{!"_ZTS12UITextButton", !7, i64 0, !25, i64 216, !25, i64 220, !25, i64 224, !26, i64 228, !26, i64 232, !27, i64 240, !20, i64 272, !20, i64 273, !26, i64 276}
!7 = !{!"_ZTS12UIStaticText", !8, i64 0, !22, i64 144, !23, i64 152, !25, i64 184, !25, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !17, i64 208, !20, i64 212}
!8 = !{!"_ZTS9UIElement", !9, i64 0, !10, i64 8, !13, i64 16, !14, i64 24, !16, i64 48, !16, i64 60, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !20, i64 104, !20, i64 105, !20, i64 106, !20, i64 107, !20, i64 108, !20, i64 109, !20, i64 110, !21, i64 112, !13, i64 136}
!9 = !{!"_ZTS15UIEventListener"}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"any pointer", !11, i64 0}
!14 = !{!"_ZTSN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !13, i64 16}
!15 = !{!"long", !11, i64 0}
!16 = !{!"_ZTSN9UIElement8PositionE", !17, i64 0, !18, i64 4}
!17 = !{!"_ZTSN9UIElement10EAlignmentE", !11, i64 0}
!18 = !{!"_ZTSN9UIElement4SizeE", !10, i64 0, !19, i64 4}
!19 = !{!"_ZTSN9UIElement6EUnitsE", !11, i64 0}
!20 = !{!"bool", !11, i64 0}
!21 = !{!"_ZTSN3JPH5ArrayIP11UIAnimationNS_12STLAllocatorIS2_EEEE", !15, i64 0, !15, i64 8, !13, i64 16}
!22 = !{!"_ZTSN3JPH8RefConstI4FontEE", !13, i64 0}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEEE", !24, i64 0, !15, i64 8, !11, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcEN3JPH12STLAllocatorIcEEE12_Alloc_hiderE", !13, i64 0}
!25 = !{!"_ZTSN3JPH5ColorE", !11, i64 0}
!26 = !{!"float", !11, i64 0}
!27 = !{!"_ZTSSt8functionIFvvEE", !28, i64 0, !13, i64 24}
!28 = !{!"_ZTSSt14_Function_base", !11, i64 0, !13, i64 16}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!8, !20, i64 106}
!32 = !{!11, !11, i64 0}
!33 = !{!10, !10, i64 0}
!34 = !{!8, !20, i64 107}


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