; LLVM IR from VTIvanov20/eight-ball-pool :: src/settings_menu.ll (ZN12SettingsMenu6CreateEv)

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

%struct.Rectangle = type { float, float, float, float }
%class.SettingsMenu = type { %"class.DrawableManager::Drawable.base", %"class.std::__cxx11::list" }
%"class.DrawableManager::Drawable.base" = type <{ ptr, i32 }>
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<UIElement *, std::allocator<UIElement *>>::_List_impl" }
%"struct.std::__cxx11::_List_base<UIElement *, std::allocator<UIElement *>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12SettingsMenu6CreateEv(ptr noundef nonnull align 8 dereferenceable(40) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca %struct.Rectangle, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca %struct.Rectangle, align 4
  %9 = alloca ptr, align 8
  %10 = alloca %struct.Rectangle, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %11 = load ptr, ptr %2, align 8
  %12 = getelementptr inbounds %class.SettingsMenu, ptr %11, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %13 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 112) #7
  %14 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 0
  store float 5.400000e+02, ptr %14, align 4, !tbaa !9
  %15 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 1
  store float 4.350000e+02, ptr %15, align 4, !tbaa !12
  %16 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 2
  store float 2.000000e+02, ptr %16, align 4, !tbaa !13
  %17 = getelementptr inbounds %struct.Rectangle, ptr %4, i32 0, i32 3
  store float 5.000000e+01, ptr %17, align 4, !tbaa !14
  %18 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %4, i32 0, i32 0
  %19 = load <2 x float>, ptr %18, align 4
  %20 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %4, i32 0, i32 1
  %21 = load <2 x float>, ptr %20, align 4
  invoke void @_ZN6ButtonC2EPKc9Rectanglef(ptr noundef nonnull align 8 dereferenceable(112) %13, ptr noundef @.str, <2 x float> %19, <2 x float> %21, float noundef 0.000000e+00)
          to label %22 unwind label %49

22:                                               ; preds = %1
  store ptr %13, ptr %3, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIP9UIElementSaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %12, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  %23 = getelementptr inbounds %class.SettingsMenu, ptr %11, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #7
  %25 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 0
  store float 5.400000e+02, ptr %25, align 4, !tbaa !9
  %26 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 1
  store float 3.600000e+02, ptr %26, align 4, !tbaa !12
  %27 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 2
  store float 5.000000e+01, ptr %27, align 4, !tbaa !13
  %28 = getelementptr inbounds %struct.Rectangle, ptr %8, i32 0, i32 3
  store float 5.000000e+01, ptr %28, align 4, !tbaa !14
  %29 = invoke zeroext i1 @IsWindowFullscreen()
          to label %30 unwind label %53

30:                                               ; preds = %22
  %31 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  %32 = load <2 x float>, ptr %31, align 4
  %33 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  %34 = load <2 x float>, ptr %33, align 4
  invoke void @_ZN8CheckBoxC2EPKc9Rectanglefb(ptr noundef nonnull align 8 dereferenceable(48) %24, ptr noundef @.str.1, <2 x float> %32, <2 x float> %34, float noundef 0.000000e+00, i1 noundef zeroext %29)
          to label %35 unwind label %53

35:                                               ; preds = %30
  store ptr %24, ptr %7, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIP9UIElementSaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %36 = getelementptr inbounds %class.SettingsMenu, ptr %11, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %37 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #7
  %38 = getelementptr inbounds %struct.Rectangle, ptr %10, i32 0, i32 0
  store float 5.400000e+02, ptr %38, align 4, !tbaa !9
  %39 = getelementptr inbounds %struct.Rectangle, ptr %10, i32 0, i32 1
  store float 2.850000e+02, ptr %39, align 4, !tbaa !12
  %40 = getelementptr inbounds %struct.Rectangle, ptr %10, i32 0, i32 2
  store float 5.000000e+01, ptr %40, align 4, !tbaa !13
  %41 = getelementptr inbounds %struct.Rectangle, ptr %10, i32 0, i32 3
  store float 5.000000e+01, ptr %41, align 4, !tbaa !14
  %42 = invoke noundef zeroext i1 @_ZN11GameManager9IsAudioOnEv()
          to label %43 unwind label %57

43:                                               ; preds = %35
  %44 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 0
  %45 = load <2 x float>, ptr %44, align 4
  %46 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %10, i32 0, i32 1
  %47 = load <2 x float>, ptr %46, align 4
  invoke void @_ZN8CheckBoxC2EPKc9Rectanglefb(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef @.str.2, <2 x float> %45, <2 x float> %47, float noundef 0.000000e+00, i1 noundef zeroext %42)
          to label %48 unwind label %57

48:                                               ; preds = %43
  store ptr %37, ptr %9, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIP9UIElementSaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef nonnull align 8 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  ret void

49:                                               ; preds = %1
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %5, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %13, i64 noundef 112) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  br label %61

53:                                               ; preds = %30, %22
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %5, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %24, i64 noundef 48) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %61

57:                                               ; preds = %43, %35
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  call void @_ZdlPvm(ptr noundef %37, i64 noundef 48) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %61

61:                                               ; preds = %57, %53, %49
  %62 = load ptr, ptr %5, align 8
  %63 = load i32, ptr %6, align 4
  %64 = insertvalue { ptr, i32 } poison, ptr %62, 0
  %65 = insertvalue { ptr, i32 } %64, i32 %63, 1
  resume { ptr, i32 } %65
}

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ButtonC2EPKc9Rectanglef(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef, <2 x float>, <2 x float>, float noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #4

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

declare zeroext i1 @IsWindowFullscreen() #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CheckBoxC2EPKc9Rectanglefb(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, <2 x float>, <2 x float>, float noundef, i1 noundef zeroext) unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZN11GameManager9IsAudioOnEv() #5

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin allocsize(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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"_ZTS9Rectangle", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!11 = !{!"float", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 8}
!14 = !{!10, !11, i64 12}


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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12SettingsMenu6CreateEv(ptr noundef nonnull align 8 dereferenceable(40) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %6 = tail call noalias noundef nonnull dereferenceable(112) ptr @_Znwm(i64 noundef 112) #7
  invoke void @_ZN6ButtonC2EPKc9Rectanglef(ptr noundef nonnull align 8 dereferenceable(112) %6, ptr noundef nonnull @.str, <2 x float> <float 5.400000e+02, float 4.350000e+02>, <2 x float> <float 2.000000e+02, float 5.000000e+01>, float noundef 0.000000e+00)
          to label %7 unwind label %16

7:                                                ; preds = %1
  store ptr %6, ptr %2, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIP9UIElementSaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %8 = call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #7
  %9 = invoke zeroext i1 @IsWindowFullscreen()
          to label %10 unwind label %18

10:                                               ; preds = %7
  invoke void @_ZN8CheckBoxC2EPKc9Rectanglefb(ptr noundef nonnull align 8 dereferenceable(48) %8, ptr noundef nonnull @.str.1, <2 x float> <float 5.400000e+02, float 3.600000e+02>, <2 x float> <float 5.000000e+01, float 5.000000e+01>, float noundef 0.000000e+00, i1 noundef zeroext %9)
          to label %11 unwind label %18

11:                                               ; preds = %10
  store ptr %8, ptr %3, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIP9UIElementSaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %12 = call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #7
  %13 = invoke noundef zeroext i1 @_ZN11GameManager9IsAudioOnEv()
          to label %14 unwind label %20

14:                                               ; preds = %11
  invoke void @_ZN8CheckBoxC2EPKc9Rectanglefb(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull @.str.2, <2 x float> <float 5.400000e+02, float 2.850000e+02>, <2 x float> <float 5.000000e+01, float 5.000000e+01>, float noundef 0.000000e+00, i1 noundef zeroext %13)
          to label %15 unwind label %20

15:                                               ; preds = %14
  store ptr %12, ptr %4, align 8, !tbaa !5
  call void @_ZNSt7__cxx114listIP9UIElementSaIS2_EE9push_backEOS2_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret void

16:                                               ; preds = %1
  %17 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %6, i64 noundef 112) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %22

18:                                               ; preds = %10, %7
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %8, i64 noundef 48) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %22

20:                                               ; preds = %14, %11
  %21 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %12, i64 noundef 48) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  br label %22

22:                                               ; preds = %20, %18, %16
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %19, %18 ], [ %17, %16 ]
  resume { ptr, i32 } %.pn
}

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6ButtonC2EPKc9Rectanglef(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef, <2 x float>, <2 x float>, float noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #4

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

declare zeroext i1 @IsWindowFullscreen() local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8CheckBoxC2EPKc9Rectanglefb(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, <2 x float>, <2 x float>, float noundef, i1 noundef zeroext) unnamed_addr #0 align 2

declare noundef zeroext i1 @_ZN11GameManager9IsAudioOnEv() local_unnamed_addr #5

attributes #0 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nobuiltin allocsize(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 = { nobuiltin nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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"}


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