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

; 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::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }

@_ZTIN4juce13ComponentPeerE = external dso_local constant { ptr, ptr }, align 8
@_ZTIN4juce18LinuxComponentPeerE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9RectangleIiED2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9RectangleIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce32juce_LinuxScaledToPhysicalBoundsEPNS_13ComponentPeerERKNS_9RectangleIiEE(ptr dead_on_unwind noalias writable sret(%"class.juce::Rectangle") align 4 %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(16) %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca %"class.juce::Rectangle", align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  store i1 false, ptr %7, align 1
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN4juce9RectangleIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %15, label %13

13:                                               ; preds = %3
  %14 = call ptr @__dynamic_cast(ptr %11, ptr @_ZTIN4juce13ComponentPeerE, ptr @_ZTIN4juce18LinuxComponentPeerE, i64 0) #3
  br label %16

15:                                               ; preds = %3
  br label %16

16:                                               ; preds = %15, %13
  %17 = phi ptr [ %14, %13 ], [ null, %15 ]
  store ptr %17, ptr %8, align 8, !tbaa !5
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %23

20:                                               ; preds = %16
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = call noundef double @_ZN4juce18LinuxComponentPeer15getCurrentScaleEv(ptr noundef nonnull align 8 dereferenceable(644) %21) #3
  call void @_ZN4juce9RectangleIiEmLIdEES1_T_(ptr dead_on_unwind writable sret(%"class.juce::Rectangle") align 4 %9, ptr noundef nonnull align 4 dereferenceable(16) %0, double noundef %22) #3
  call void @_ZN4juce9RectangleIiED2Ev(ptr noundef nonnull align 4 dereferenceable(16) %9) #3
  br label %23

23:                                               ; preds = %20, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  store i1 true, ptr %7, align 1
  %24 = load i1, ptr %7, align 1
  br i1 %24, label %26, label %25

25:                                               ; preds = %23
  call void @_ZN4juce9RectangleIiED2Ev(ptr noundef nonnull align 4 dereferenceable(16) %0) #3
  br label %26

26:                                               ; preds = %25, %23
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce18LinuxComponentPeer15getCurrentScaleEv(ptr noundef nonnull align 8 dereferenceable(644)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9RectangleIiEmLIdEES1_T_(ptr dead_on_unwind noalias writable sret(%"class.juce::Rectangle") align 4, ptr noundef nonnull align 4 dereferenceable(16), double noundef) #0 align 2

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


; 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::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }

@_ZTIN4juce13ComponentPeerE = external dso_local constant { ptr, ptr }, align 8
@_ZTIN4juce18LinuxComponentPeerE = external dso_local constant { ptr, ptr, ptr }, align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9RectangleIiED2Ev(ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9RectangleIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #0 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
declare ptr @__dynamic_cast(ptr, ptr, ptr, i64) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce32juce_LinuxScaledToPhysicalBoundsEPNS_13ComponentPeerERKNS_9RectangleIiEE(ptr dead_on_unwind noalias nonnull writable sret(%"class.juce::Rectangle") align 4 %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(16) %2) local_unnamed_addr #0 {
  %4 = alloca %"class.juce::Rectangle", align 4
  tail call void @_ZN4juce9RectangleIiEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) %2) #2
  %5 = icmp eq ptr %1, null
  br i1 %5, label %.thread, label %6

6:                                                ; preds = %3
  %7 = tail call ptr @__dynamic_cast(ptr nonnull %1, ptr nonnull @_ZTIN4juce13ComponentPeerE, ptr nonnull @_ZTIN4juce18LinuxComponentPeerE, i64 0) #2
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %.thread, label %8

8:                                                ; preds = %6
  %9 = tail call noundef double @_ZN4juce18LinuxComponentPeer15getCurrentScaleEv(ptr noundef nonnull align 8 dereferenceable(644) %7) #2
  call void @_ZN4juce9RectangleIiEmLIdEES1_T_(ptr dead_on_unwind nonnull writable sret(%"class.juce::Rectangle") align 4 %4, ptr noundef nonnull align 4 dereferenceable(16) %0, double noundef %9) #2
  call void @_ZN4juce9RectangleIiED2Ev(ptr noundef nonnull align 4 dereferenceable(16) %4) #2
  br label %.thread

.thread:                                          ; preds = %3, %6, %8
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN4juce18LinuxComponentPeer15getCurrentScaleEv(ptr noundef nonnull align 8 dereferenceable(644)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce9RectangleIiEmLIdEES1_T_(ptr dead_on_unwind noalias writable sret(%"class.juce::Rectangle") align 4, ptr noundef nonnull align 4 dereferenceable(16), double noundef) local_unnamed_addr #0 align 2

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn memory(read) }
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)"}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass