; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/juce_gui_basics.ll (ZN4juce12DialogWindow13LaunchOptionsC2Ev)

; 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.juce::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }
%"struct.juce::DialogWindow::LaunchOptions" = type <{ %"class.juce::String", %"class.juce::Colour", [4 x i8], %"class.juce::OptionalScopedPointer.358", ptr, i8, i8, i8, i8, [4 x i8] }>
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::OptionalScopedPointer.358" = type <{ %"class.juce::ScopedPointer.159", i8, [7 x i8] }>
%"class.juce::ScopedPointer.159" = type { ptr }

@_ZN4juce7Colours9lightgreyE = external global %"class.juce::Colour", align 1

; Function Attrs: nounwind
declare void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #1

; Function Attrs: nounwind
declare void @_ZN4juce6ColourC1ERKS0_(ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce12DialogWindow13LaunchOptionsC2Ev(ptr noundef nonnull align 8 dereferenceable(44) %0) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 0
  call void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #3
  %5 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 1
  call void @_ZN4juce6ColourC1ERKS0_(ptr noundef nonnull align 1 dereferenceable(4) %5, ptr noundef nonnull align 1 dereferenceable(4) @_ZN4juce7Colours9lightgreyE) #3
  %6 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 3
  invoke void @_ZN4juce21OptionalScopedPointerINS_9ComponentEEC2Ev(ptr noundef nonnull align 8 dereferenceable(9) %6)
          to label %7 unwind label %13

7:                                                ; preds = %1
  %8 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 4
  store ptr null, ptr %8, align 8, !tbaa !9
  %9 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 5
  store i8 1, ptr %9, align 8, !tbaa !18
  %10 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 6
  store i8 1, ptr %10, align 1, !tbaa !19
  %11 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 7
  store i8 1, ptr %11, align 2, !tbaa !20
  %12 = getelementptr inbounds %"struct.juce::DialogWindow::LaunchOptions", ptr %3, i32 0, i32 8
  store i8 0, ptr %12, align 1, !tbaa !21
  ret void

13:                                               ; preds = %1
  %14 = landingpad { ptr, i32 }
          catch ptr null
  %15 = extractvalue { ptr, i32 } %14, 0
  call void @__clang_call_terminate(ptr %15) #4
  unreachable
}

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

attributes #0 = { 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 #1 = { noinline noreturn nounwind uwtable "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 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 = { nounwind }
attributes #4 = { noreturn 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, !6, i64 32}
!10 = !{!"_ZTSN4juce12DialogWindow13LaunchOptionsE", !11, i64 0, !13, i64 8, !15, i64 16, !6, i64 32, !17, i64 40, !17, i64 41, !17, i64 42, !17, i64 43}
!11 = !{!"_ZTSN4juce6StringE", !12, i64 0}
!12 = !{!"_ZTSN4juce16CharPointer_UTF8E", !6, i64 0}
!13 = !{!"_ZTSN4juce6ColourE", !14, i64 0}
!14 = !{!"_ZTSN4juce9PixelARGBE", !7, i64 0}
!15 = !{!"_ZTSN4juce21OptionalScopedPointerINS_9ComponentEEE", !16, i64 0, !17, i64 8}
!16 = !{!"_ZTSN4juce13ScopedPointerINS_9ComponentEEE", !6, i64 0}
!17 = !{!"bool", !7, i64 0}
!18 = !{!10, !17, i64 40}
!19 = !{!10, !17, i64 41}
!20 = !{!10, !17, i64 42}
!21 = !{!10, !17, i64 43}


; 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.juce::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }

@_ZN4juce7Colours9lightgreyE = external global %"class.juce::Colour", align 1

; Function Attrs: nounwind
declare void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN4juce6ColourC1ERKS0_(ptr noundef nonnull align 1 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce12DialogWindow13LaunchOptionsC2Ev(ptr noundef nonnull align 8 dereferenceable(44) %0) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %0) #2
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @_ZN4juce6ColourC1ERKS0_(ptr noundef nonnull align 1 dereferenceable(4) %2, ptr noundef nonnull align 1 dereferenceable(4) @_ZN4juce7Colours9lightgreyE) #2
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZN4juce21OptionalScopedPointerINS_9ComponentEEC2Ev(ptr noundef nonnull align 8 dereferenceable(9) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr null, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 40
  store <4 x i8> <i8 1, i8 1, i8 1, i8 0>, ptr %5, align 8, !tbaa !17
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce21OptionalScopedPointerINS_9ComponentEEC2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 32}
!6 = !{!"_ZTSN4juce12DialogWindow13LaunchOptionsE", !7, i64 0, !12, i64 8, !14, i64 16, !9, i64 32, !16, i64 40, !16, i64 41, !16, i64 42, !16, i64 43}
!7 = !{!"_ZTSN4juce6StringE", !8, i64 0}
!8 = !{!"_ZTSN4juce16CharPointer_UTF8E", !9, i64 0}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"_ZTSN4juce6ColourE", !13, i64 0}
!13 = !{!"_ZTSN4juce9PixelARGBE", !10, i64 0}
!14 = !{!"_ZTSN4juce21OptionalScopedPointerINS_9ComponentEEE", !15, i64 0, !16, i64 8}
!15 = !{!"_ZTSN4juce13ScopedPointerINS_9ComponentEEE", !9, i64 0}
!16 = !{!"bool", !10, i64 0}
!17 = !{!16, !16, i64 0}


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