; LLVM IR from jrouwe/JoltPhysics :: TestFramework/UI/UIManager.ll (ZN9UIManager13SwitchToStateENS_6EStateE)

; 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.UIManager = type { %class.UIElement, ptr, ptr, %"class.JPH::Array.3", i8, %"class.std::unique_ptr", %"class.std::unique_ptr", %"class.std::function", i32, float }
%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.0", 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.0" = type { i64, i64, ptr }
%"class.JPH::Array.3" = type { i64, i64, ptr }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Head_base.7" }
%"struct.std::_Head_base.7" = type { ptr }
%"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 } }

; 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 @_ZN9UIManager13SwitchToStateENS_6EStateE(ptr noundef nonnull align 8 dereferenceable(248) %0, i32 noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %21 = load ptr, ptr %3, align 8
  %22 = getelementptr inbounds %class.UIManager, ptr %21, i32 0, i32 8
  %23 = load i32, ptr %22, align 8, !tbaa !11
  switch i32 %23, label %45 [
    i32 1, label %24
    i32 3, label %24
    i32 2, label %44
    i32 4, label %44
    i32 0, label %44
  ]

24:                                               ; preds = %2, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %25 = getelementptr inbounds %class.UIElement, ptr %21, i32 0, i32 3
  store ptr %25, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %26)
  store ptr %27, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %28)
  store ptr %29, ptr %7, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %40, %24
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = icmp ne ptr %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %43

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  store ptr %37, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = call noundef ptr @_Z13GetRTTIOfTypeP16UIAnimationSlide(ptr noundef null)
  call void @_ZN9UIElement13StopAnimationEPKN3JPH4RTTIE(ptr noundef nonnull align 8 dereferenceable(144) %38, ptr noundef %39)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %40

40:                                               ; preds = %35
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds ptr, ptr %41, i32 1
  store ptr %42, ptr %6, align 8, !tbaa !5
  br label %30

43:                                               ; preds = %34
  br label %46

44:                                               ; preds = %2, %2, %2
  br label %45

45:                                               ; preds = %44, %2
  br label %46

46:                                               ; preds = %45, %43
  %47 = load i32, ptr %4, align 4, !tbaa !9
  %48 = getelementptr inbounds %class.UIManager, ptr %21, i32 0, i32 8
  store i32 %47, ptr %48, align 8, !tbaa !11
  %49 = getelementptr inbounds %class.UIManager, ptr %21, i32 0, i32 9
  store float 0.000000e+00, ptr %49, align 4, !tbaa !34
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  call void @_ZN9UIManager33GetMaxElementDistanceToScreenEdgeERiS0_(ptr noundef nonnull align 8 dereferenceable(248) %21, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %50 = load i32, ptr %4, align 4, !tbaa !9
  switch i32 %50, label %124 [
    i32 1, label %51
    i32 3, label %82
    i32 4, label %113
    i32 2, label %123
    i32 0, label %123
  ]

51:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %52 = getelementptr inbounds %class.UIElement, ptr %21, i32 0, i32 3
  store ptr %52, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %53)
  store ptr %54, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %55 = load ptr, ptr %11, align 8, !tbaa !5
  %56 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %55)
  store ptr %56, ptr %13, align 8, !tbaa !5
  br label %57

57:                                               ; preds = %78, %51
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = icmp ne ptr %58, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %81

62:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = load ptr, ptr %63, align 8, !tbaa !5
  store ptr %64, ptr %14, align 8, !tbaa !5
  %65 = load ptr, ptr %14, align 8, !tbaa !5
  %66 = call noundef zeroext i1 @_ZNK9UIElement20HasActivateAnimationEv(ptr noundef nonnull align 8 dereferenceable(144) %65)
  br i1 %66, label %67, label %77

67:                                               ; preds = %62
  %68 = load ptr, ptr %14, align 8, !tbaa !5
  %69 = call noundef ptr @_ZN16UIAnimationSlidenwEm(i64 noundef 48)
  %70 = load i32, ptr %9, align 4, !tbaa !35
  %71 = load i32, ptr %10, align 4, !tbaa !35
  invoke void @_ZN16UIAnimationSlideC1ENS_5EModeEiiff(ptr noundef nonnull align 8 dereferenceable(48) %69, i32 noundef 0, i32 noundef %70, i32 noundef %71, float noundef 0.000000e+00, float noundef 0x3FC99999A0000000)
          to label %72 unwind label %73

72:                                               ; preds = %67
  call void @_ZN9UIElement14StartAnimationEP11UIAnimation(ptr noundef nonnull align 8 dereferenceable(144) %68, ptr noundef %69)
  br label %77

73:                                               ; preds = %67
  %74 = landingpad { ptr, i32 }
          cleanup
  %75 = extractvalue { ptr, i32 } %74, 0
  store ptr %75, ptr %15, align 8
  %76 = extractvalue { ptr, i32 } %74, 1
  store i32 %76, ptr %16, align 4
  call void @_ZN16UIAnimationSlidedlEPv(ptr noundef %69) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %126

77:                                               ; preds = %72, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds ptr, ptr %79, i32 1
  store ptr %80, ptr %12, align 8, !tbaa !5
  br label %57

81:                                               ; preds = %61
  br label %125

82:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %83 = getelementptr inbounds %class.UIElement, ptr %21, i32 0, i32 3
  store ptr %83, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %84 = load ptr, ptr %17, align 8, !tbaa !5
  %85 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %84)
  store ptr %85, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %86)
  store ptr %87, ptr %19, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %109, %82
  %89 = load ptr, ptr %18, align 8, !tbaa !5
  %90 = load ptr, ptr %19, align 8, !tbaa !5
  %91 = icmp ne ptr %89, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %112

93:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %94 = load ptr, ptr %18, align 8, !tbaa !5
  %95 = load ptr, ptr %94, align 8, !tbaa !5
  store ptr %95, ptr %20, align 8, !tbaa !5
  %96 = load ptr, ptr %20, align 8, !tbaa !5
  %97 = call noundef zeroext i1 @_ZNK9UIElement22HasDeactivateAnimationEv(ptr noundef nonnull align 8 dereferenceable(144) %96)
  br i1 %97, label %98, label %108

98:                                               ; preds = %93
  %99 = load ptr, ptr %20, align 8, !tbaa !5
  %100 = call noundef ptr @_ZN16UIAnimationSlidenwEm(i64 noundef 48)
  %101 = load i32, ptr %9, align 4, !tbaa !35
  %102 = load i32, ptr %10, align 4, !tbaa !35
  invoke void @_ZN16UIAnimationSlideC1ENS_5EModeEiiff(ptr noundef nonnull align 8 dereferenceable(48) %100, i32 noundef 1, i32 noundef %101, i32 noundef %102, float noundef 0.000000e+00, float noundef 0x3FC99999A0000000)
          to label %103 unwind label %104

103:                                              ; preds = %98
  call void @_ZN9UIElement14StartAnimationEP11UIAnimation(ptr noundef nonnull align 8 dereferenceable(144) %99, ptr noundef %100)
  br label %108

104:                                              ; preds = %98
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %15, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %16, align 4
  call void @_ZN16UIAnimationSlidedlEPv(ptr noundef %100) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %126

108:                                              ; preds = %103, %93
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %109

109:                                              ; preds = %108
  %110 = load ptr, ptr %18, align 8, !tbaa !5
  %111 = getelementptr inbounds ptr, ptr %110, i32 1
  store ptr %111, ptr %18, align 8, !tbaa !5
  br label %88

112:                                              ; preds = %92
  br label %125

113:                                              ; preds = %46
  %114 = load ptr, ptr %21, align 8, !tbaa !36
  %115 = getelementptr inbounds ptr, ptr %114, i64 2
  %116 = load ptr, ptr %115, align 8
  %117 = call noundef zeroext i1 %116(ptr noundef nonnull align 8 dereferenceable(248) %21, i32 noundef 1, ptr noundef %21)
  %118 = getelementptr inbounds %class.UIManager, ptr %21, i32 0, i32 7
  %119 = call noundef zeroext i1 @_ZNKSt8functionIFvvEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %118) #7
  br i1 %119, label %120, label %122

120:                                              ; preds = %113
  %121 = getelementptr inbounds %class.UIManager, ptr %21, i32 0, i32 7
  call void @_ZNKSt8functionIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(32) %121)
  br label %122

122:                                              ; preds = %120, %113
  br label %125

123:                                              ; preds = %46, %46
  br label %124

124:                                              ; preds = %123, %46
  br label %125

125:                                              ; preds = %124, %122, %112, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  ret void

126:                                              ; preds = %104, %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %127

127:                                              ; preds = %126
  %128 = load ptr, ptr %15, align 8
  %129 = load i32, ptr %16, align 4
  %130 = insertvalue { ptr, i32 } poison, ptr %128, 0
  %131 = insertvalue { ptr, i32 } %130, i32 %129, 1
  resume { ptr, i32 } %131
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9UIManager33GetMaxElementDistanceToScreenEdgeERiS0_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1 align 2

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

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

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

declare void @_ZN9UIElement13StopAnimationEPKN3JPH4RTTIE(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) #4

declare noundef ptr @_Z13GetRTTIOfTypeP16UIAnimationSlide(ptr noundef) #4

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

declare void @_ZN9UIElement14StartAnimationEP11UIAnimation(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) #4

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN16UIAnimationSlidenwEm(i64 noundef) #5 align 2

declare void @_ZN16UIAnimationSlideC1ENS_5EModeEiiff(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef) unnamed_addr #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN16UIAnimationSlidedlEPv(ptr noundef) #6 align 2

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

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

attributes #0 = { 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 = { alwaysinline 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 = { alwaysinline 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 #7 = { 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 = !{!"_ZTSN9UIManager6EStateE", !7, i64 0}
!11 = !{!12, !10, i64 240}
!12 = !{!"_ZTS9UIManager", !13, i64 0, !6, i64 144, !6, i64 152, !24, i64 160, !22, i64 184, !25, i64 192, !25, i64 200, !31, i64 208, !10, i64 240, !33, i64 244}
!13 = !{!"_ZTS9UIElement", !14, i64 0, !15, 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}
!14 = !{!"_ZTS15UIEventListener"}
!15 = !{!"int", !7, i64 0}
!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", !15, 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 = !{!"_ZTSN3JPH5ArrayINS0_IP9UIElementNS_12STLAllocatorIS2_EEEENS3_IS5_EEEE", !17, i64 0, !17, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt10unique_ptrI13PipelineStateSt14default_deleteIS0_EE", !26, i64 0}
!26 = !{!"_ZTSSt15__uniq_ptr_dataI13PipelineStateSt14default_deleteIS0_ELb1ELb1EE", !27, i64 0}
!27 = !{!"_ZTSSt15__uniq_ptr_implI13PipelineStateSt14default_deleteIS0_EE", !28, i64 0}
!28 = !{!"_ZTSSt5tupleIJP13PipelineStateSt14default_deleteIS0_EEE", !29, i64 0}
!29 = !{!"_ZTSSt11_Tuple_implILm0EJP13PipelineStateSt14default_deleteIS0_EEE", !30, i64 0}
!30 = !{!"_ZTSSt10_Head_baseILm0EP13PipelineStateLb0EE", !6, i64 0}
!31 = !{!"_ZTSSt8functionIFvvEE", !32, i64 0, !6, i64 24}
!32 = !{!"_ZTSSt14_Function_base", !7, i64 0, !6, i64 16}
!33 = !{!"float", !7, i64 0}
!34 = !{!12, !33, i64 244}
!35 = !{!15, !15, i64 0}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !8, i64 0}


; 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

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 @_ZN9UIManager13SwitchToStateENS_6EStateE(ptr noundef nonnull align 8 dereferenceable(248) %0, i32 noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 240
  %6 = load i32, ptr %5, align 8, !tbaa !5
  switch i32 %6, label %.loopexit35 [
    i32 1, label %7
    i32 3, label %7
  ]

7:                                                ; preds = %2, %2
  %8 = getelementptr inbounds i8, ptr %0, i64 24
  %9 = tail call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %10 = tail call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %8)
  %.not37 = icmp eq ptr %9, %10
  br i1 %.not37, label %.loopexit35, label %.lr.ph

.lr.ph:                                           ; preds = %7, %.lr.ph
  %.038 = phi ptr [ %13, %.lr.ph ], [ %9, %7 ]
  %11 = load ptr, ptr %.038, align 8, !tbaa !32
  %12 = tail call noundef ptr @_Z13GetRTTIOfTypeP16UIAnimationSlide(ptr noundef null)
  tail call void @_ZN9UIElement13StopAnimationEPKN3JPH4RTTIE(ptr noundef nonnull align 8 dereferenceable(144) %11, ptr noundef %12)
  %13 = getelementptr inbounds i8, ptr %.038, i64 8
  %.not = icmp eq ptr %13, %10
  br i1 %.not, label %.loopexit35, label %.lr.ph

.loopexit35:                                      ; preds = %.lr.ph, %7, %2
  store i32 %1, ptr %5, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 244
  store float 0.000000e+00, ptr %14, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @_ZN9UIManager33GetMaxElementDistanceToScreenEdgeERiS0_(ptr noundef nonnull align 8 dereferenceable(248) %0, ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  switch i32 %1, label %.loopexit [
    i32 1, label %15
    i32 3, label %30
    i32 4, label %45
  ]

15:                                               ; preds = %.loopexit35
  %16 = getelementptr inbounds i8, ptr %0, i64 24
  %17 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %18 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16)
  %.not3242 = icmp eq ptr %17, %18
  br i1 %.not3242, label %.loopexit, label %.lr.ph44

.lr.ph44:                                         ; preds = %15, %28
  %.02743 = phi ptr [ %29, %28 ], [ %17, %15 ]
  %19 = load ptr, ptr %.02743, align 8, !tbaa !32
  %20 = call noundef zeroext i1 @_ZNK9UIElement20HasActivateAnimationEv(ptr noundef nonnull align 8 dereferenceable(144) %19)
  br i1 %20, label %21, label %28

21:                                               ; preds = %.lr.ph44
  %22 = call noundef ptr @_ZN16UIAnimationSlidenwEm(i64 noundef 48)
  %23 = load i32, ptr %3, align 4, !tbaa !34
  %24 = load i32, ptr %4, align 4, !tbaa !34
  invoke void @_ZN16UIAnimationSlideC1ENS_5EModeEiiff(ptr noundef nonnull align 8 dereferenceable(48) %22, i32 noundef 0, i32 noundef %23, i32 noundef %24, float noundef 0.000000e+00, float noundef 0x3FC99999A0000000)
          to label %25 unwind label %26

25:                                               ; preds = %21
  call void @_ZN9UIElement14StartAnimationEP11UIAnimation(ptr noundef nonnull align 8 dereferenceable(144) %19, ptr noundef nonnull %22)
  br label %28

26:                                               ; preds = %21
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %53

28:                                               ; preds = %25, %.lr.ph44
  %29 = getelementptr inbounds i8, ptr %.02743, i64 8
  %.not32 = icmp eq ptr %29, %18
  br i1 %.not32, label %.loopexit, label %.lr.ph44

30:                                               ; preds = %.loopexit35
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %33 = call noundef ptr @_ZN3JPH5ArrayIP9UIElementNS_12STLAllocatorIS2_EEE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %31)
  %.not3139 = icmp eq ptr %32, %33
  br i1 %.not3139, label %.loopexit, label %.lr.ph41

.lr.ph41:                                         ; preds = %30, %43
  %.02840 = phi ptr [ %44, %43 ], [ %32, %30 ]
  %34 = load ptr, ptr %.02840, align 8, !tbaa !32
  %35 = call noundef zeroext i1 @_ZNK9UIElement22HasDeactivateAnimationEv(ptr noundef nonnull align 8 dereferenceable(144) %34)
  br i1 %35, label %36, label %43

36:                                               ; preds = %.lr.ph41
  %37 = call noundef ptr @_ZN16UIAnimationSlidenwEm(i64 noundef 48)
  %38 = load i32, ptr %3, align 4, !tbaa !34
  %39 = load i32, ptr %4, align 4, !tbaa !34
  invoke void @_ZN16UIAnimationSlideC1ENS_5EModeEiiff(ptr noundef nonnull align 8 dereferenceable(48) %37, i32 noundef 1, i32 noundef %38, i32 noundef %39, float noundef 0.000000e+00, float noundef 0x3FC99999A0000000)
          to label %40 unwind label %41

40:                                               ; preds = %36
  call void @_ZN9UIElement14StartAnimationEP11UIAnimation(ptr noundef nonnull align 8 dereferenceable(144) %34, ptr noundef nonnull %37)
  br label %43

41:                                               ; preds = %36
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %53

43:                                               ; preds = %40, %.lr.ph41
  %44 = getelementptr inbounds i8, ptr %.02840, i64 8
  %.not31 = icmp eq ptr %44, %33
  br i1 %.not31, label %.loopexit, label %.lr.ph41

45:                                               ; preds = %.loopexit35
  %46 = load ptr, ptr %0, align 8, !tbaa !35
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %48 = load ptr, ptr %47, align 8
  %49 = call noundef zeroext i1 %48(ptr noundef nonnull align 8 dereferenceable(248) %0, i32 noundef 1, ptr noundef nonnull %0)
  %50 = getelementptr inbounds i8, ptr %0, i64 208
  %51 = call noundef zeroext i1 @_ZNKSt8functionIFvvEEcvbEv(ptr noundef nonnull align 8 dereferenceable(32) %50) #7
  br i1 %51, label %52, label %.loopexit

52:                                               ; preds = %45
  call void @_ZNKSt8functionIFvvEEclEv(ptr noundef nonnull align 8 dereferenceable(32) %50)
  br label %.loopexit

.loopexit:                                        ; preds = %43, %28, %30, %15, %.loopexit35, %45, %52
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret void

53:                                               ; preds = %41, %26
  %.lcssa48.sink = phi ptr [ %37, %41 ], [ %22, %26 ]
  %.pn = phi { ptr, i32 } [ %42, %41 ], [ %27, %26 ]
  call void @_ZN16UIAnimationSlidedlEPv(ptr noundef %.lcssa48.sink) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9UIManager33GetMaxElementDistanceToScreenEdgeERiS0_(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

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

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

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

declare void @_ZN9UIElement13StopAnimationEPKN3JPH4RTTIE(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) local_unnamed_addr #4

declare noundef ptr @_Z13GetRTTIOfTypeP16UIAnimationSlide(ptr noundef) local_unnamed_addr #4

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

declare void @_ZN9UIElement14StartAnimationEP11UIAnimation(ptr noundef nonnull align 8 dereferenceable(144), ptr noundef) local_unnamed_addr #4

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN16UIAnimationSlidenwEm(i64 noundef) local_unnamed_addr #5 align 2

declare void @_ZN16UIAnimationSlideC1ENS_5EModeEiiff(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i32 noundef, i32 noundef, float noundef, float noundef) unnamed_addr #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN16UIAnimationSlidedlEPv(ptr noundef) local_unnamed_addr #6 align 2

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

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

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 = { alwaysinline 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 = { alwaysinline 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 #7 = { 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, !30, i64 240}
!6 = !{!"_ZTS9UIManager", !7, i64 0, !12, i64 144, !12, i64 152, !21, i64 160, !19, i64 184, !22, i64 192, !22, i64 200, !28, i64 208, !30, i64 240, !31, i64 244}
!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 = !{!"_ZTSN3JPH5ArrayINS0_IP9UIElementNS_12STLAllocatorIS2_EEEENS3_IS5_EEEE", !14, i64 0, !14, i64 8, !12, i64 16}
!22 = !{!"_ZTSSt10unique_ptrI13PipelineStateSt14default_deleteIS0_EE", !23, i64 0}
!23 = !{!"_ZTSSt15__uniq_ptr_dataI13PipelineStateSt14default_deleteIS0_ELb1ELb1EE", !24, i64 0}
!24 = !{!"_ZTSSt15__uniq_ptr_implI13PipelineStateSt14default_deleteIS0_EE", !25, i64 0}
!25 = !{!"_ZTSSt5tupleIJP13PipelineStateSt14default_deleteIS0_EEE", !26, i64 0}
!26 = !{!"_ZTSSt11_Tuple_implILm0EJP13PipelineStateSt14default_deleteIS0_EEE", !27, i64 0}
!27 = !{!"_ZTSSt10_Head_baseILm0EP13PipelineStateLb0EE", !12, i64 0}
!28 = !{!"_ZTSSt8functionIFvvEE", !29, i64 0, !12, i64 24}
!29 = !{!"_ZTSSt14_Function_base", !10, i64 0, !12, i64 16}
!30 = !{!"_ZTSN9UIManager6EStateE", !10, i64 0}
!31 = !{!"float", !10, i64 0}
!32 = !{!12, !12, i64 0}
!33 = !{!6, !31, i64 244}
!34 = !{!9, !9, i64 0}
!35 = !{!36, !36, i64 0}
!36 = !{!"vtable pointer", !11, i64 0}


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