; 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::Colour" = type { %"class.juce::PixelARGB" }
%"class.juce::PixelARGB" = type { %union.anon.77 }
%union.anon.77 = type { i32 }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::TextLayout" = type { %"class.juce::OwnedArray.296", float, float, %"class.juce::Justification", [4 x i8] }
%"class.juce::OwnedArray.296" = type { %"class.juce::ArrayAllocationBase.297", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.297" = type <{ %"class.juce::HeapBlock.298", i32, [4 x i8] }>
%"class.juce::HeapBlock.298" = type { ptr }
%"class.juce::Justification" = type { i32 }

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

; 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 noundef i32 @_ZNK4juce9RectangleIiE10getCentreXEv(ptr noundef nonnull align 4 dereferenceable(16)) #0 align 2

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

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

; Function Attrs: nounwind
declare void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce14LookAndFeel_V216getTooltipBoundsERKNS_6StringENS_5PointIiEENS_9RectangleIiEE(ptr dead_on_unwind noalias writable sret(%"class.juce::Rectangle") align 4 %0, ptr noundef nonnull align 8 dereferenceable(304) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef %3, ptr noundef %4) unnamed_addr #0 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %"class.juce::TextLayout", align 8
  %12 = alloca %"class.juce::Colour", align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.juce::Rectangle", align 4
  store ptr %0, ptr %6, align 8
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %16 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #3
  %17 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4juce6ColourC1ERKS0_(ptr noundef nonnull align 1 dereferenceable(4) %12, ptr noundef nonnull align 1 dereferenceable(4) @_ZN4juce7Colours5blackE) #3
  call void @_ZN4juce18LookAndFeelHelpersL17layoutTooltipTextERKNS_6StringENS_6ColourE(ptr dead_on_unwind writable sret(%"class.juce::TextLayout") align 8 %11, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef %12) #3
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %18 = call noundef float @_ZNK4juce10TextLayout8getWidthEv(ptr noundef nonnull align 8 dereferenceable(36) %11) #3
  %19 = fadd float %18, 1.400000e+01
  %20 = fptosi float %19 to i32
  store i32 %20, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  %21 = call noundef float @_ZNK4juce10TextLayout9getHeightEv(ptr noundef nonnull align 8 dereferenceable(36) %11) #3
  %22 = fadd float %21, 6.000000e+00
  %23 = fptosi float %22 to i32
  store i32 %23, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #3
  %24 = getelementptr inbounds %"class.juce::Point", ptr %3, i32 0, i32 0
  %25 = load i32, ptr %24, align 4, !tbaa !11
  %26 = call noundef i32 @_ZNK4juce9RectangleIiE10getCentreXEv(ptr noundef nonnull align 4 dereferenceable(16) %4) #3
  %27 = icmp sgt i32 %25, %26
  br i1 %27, label %28, label %34

28:                                               ; preds = %5
  %29 = getelementptr inbounds %"class.juce::Point", ptr %3, i32 0, i32 0
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = load i32, ptr %13, align 4, !tbaa !9
  %32 = add nsw i32 %31, 12
  %33 = sub nsw i32 %30, %32
  br label %38

34:                                               ; preds = %5
  %35 = getelementptr inbounds %"class.juce::Point", ptr %3, i32 0, i32 0
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = add nsw i32 %36, 24
  br label %38

38:                                               ; preds = %34, %28
  %39 = phi i32 [ %33, %28 ], [ %37, %34 ]
  %40 = getelementptr inbounds %"class.juce::Point", ptr %3, i32 0, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !13
  %42 = call noundef i32 @_ZNK4juce9RectangleIiE10getCentreYEv(ptr noundef nonnull align 4 dereferenceable(16) %4) #3
  %43 = icmp sgt i32 %41, %42
  br i1 %43, label %44, label %50

44:                                               ; preds = %38
  %45 = getelementptr inbounds %"class.juce::Point", ptr %3, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !13
  %47 = load i32, ptr %14, align 4, !tbaa !9
  %48 = add nsw i32 %47, 6
  %49 = sub nsw i32 %46, %48
  br label %54

50:                                               ; preds = %38
  %51 = getelementptr inbounds %"class.juce::Point", ptr %3, i32 0, i32 1
  %52 = load i32, ptr %51, align 4, !tbaa !13
  %53 = add nsw i32 %52, 6
  br label %54

54:                                               ; preds = %50, %44
  %55 = phi i32 [ %49, %44 ], [ %53, %50 ]
  %56 = load i32, ptr %13, align 4, !tbaa !9
  %57 = load i32, ptr %14, align 4, !tbaa !9
  call void @_ZN4juce9RectangleIiEC2Eiiii(ptr noundef nonnull align 4 dereferenceable(16) %15, i32 noundef %39, i32 noundef %55, i32 noundef %56, i32 noundef %57) #3
  call void @_ZNK4juce9RectangleIiE17constrainedWithinERKS1_(ptr dead_on_unwind writable sret(%"class.juce::Rectangle") align 4 %0, ptr noundef nonnull align 4 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(16) %4) #3
  call void @_ZN4juce9RectangleIiED2Ev(ptr noundef nonnull align 4 dereferenceable(16) %15) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @_ZN4juce10TextLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %11) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN4juce18LookAndFeelHelpersL17layoutTooltipTextERKNS_6StringENS_6ColourE(ptr dead_on_unwind noalias writable sret(%"class.juce::TextLayout") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4juce10TextLayout8getWidthEv(ptr noundef nonnull align 8 dereferenceable(36)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4juce10TextLayout9getHeightEv(ptr noundef nonnull align 8 dereferenceable(36)) #0 align 2

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

; Function Attrs: nounwind
declare void @_ZN4juce10TextLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #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 "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 }

!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, !10, i64 0}
!12 = !{!"_ZTSN4juce5PointIiEE", !10, i64 0, !10, i64 4}
!13 = !{!12, !10, i64 4}


; 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 }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::TextLayout" = type { %"class.juce::OwnedArray.296", float, float, %"class.juce::Justification", [4 x i8] }
%"class.juce::OwnedArray.296" = type { %"class.juce::ArrayAllocationBase.297", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.297" = type <{ %"class.juce::HeapBlock.298", i32, [4 x i8] }>
%"class.juce::HeapBlock.298" = type { ptr }
%"class.juce::Justification" = type { i32 }

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress 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 noundef i32 @_ZNK4juce9RectangleIiE10getCentreXEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK4juce9RectangleIiE10getCentreYEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #0 align 2

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

; Function Attrs: nounwind
declare void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4)) unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4juce14LookAndFeel_V216getTooltipBoundsERKNS_6StringENS_5PointIiEENS_9RectangleIiEE(ptr dead_on_unwind noalias writable sret(%"class.juce::Rectangle") align 4 %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(304) %1, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr nocapture noundef readonly %3, ptr noundef %4) unnamed_addr #0 align 2 {
  %6 = alloca %"class.juce::TextLayout", align 8
  %7 = alloca %"class.juce::Colour", align 1
  %8 = alloca %"class.juce::Rectangle", align 4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #3
  call void @_ZN4juce6ColourC1ERKS0_(ptr noundef nonnull align 1 dereferenceable(4) %7, ptr noundef nonnull align 1 dereferenceable(4) @_ZN4juce7Colours5blackE) #3
  call void @_ZN4juce18LookAndFeelHelpersL17layoutTooltipTextERKNS_6StringENS_6ColourE(ptr dead_on_unwind nonnull writable sret(%"class.juce::TextLayout") align 8 %6, ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull %7) #3
  call void @_ZN4juce6ColourD1Ev(ptr noundef nonnull align 1 dereferenceable(4) %7) #3
  %9 = call noundef float @_ZNK4juce10TextLayout8getWidthEv(ptr noundef nonnull align 8 dereferenceable(36) %6) #3
  %10 = fadd float %9, 1.400000e+01
  %11 = fptosi float %10 to i32
  %12 = call noundef float @_ZNK4juce10TextLayout9getHeightEv(ptr noundef nonnull align 8 dereferenceable(36) %6) #3
  %13 = fadd float %12, 6.000000e+00
  %14 = fptosi float %13 to i32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #3
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = call noundef i32 @_ZNK4juce9RectangleIiE10getCentreXEv(ptr noundef nonnull align 4 dereferenceable(16) %4) #3
  %17 = icmp sgt i32 %15, %16
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %reass.sub = sub i32 %18, %11
  %19 = add i32 %reass.sub, -12
  %20 = add nsw i32 %18, 24
  %21 = select i1 %17, i32 %19, i32 %20
  %22 = getelementptr inbounds i8, ptr %3, i64 4
  %23 = load i32, ptr %22, align 4, !tbaa !10
  %24 = call noundef i32 @_ZNK4juce9RectangleIiE10getCentreYEv(ptr noundef nonnull align 4 dereferenceable(16) %4) #3
  %25 = icmp sgt i32 %23, %24
  %26 = load i32, ptr %22, align 4, !tbaa !10
  %reass.sub8 = sub i32 %26, %14
  %27 = add i32 %reass.sub8, -6
  %28 = add nsw i32 %26, 6
  %29 = select i1 %25, i32 %27, i32 %28
  call void @_ZN4juce9RectangleIiEC2Eiiii(ptr noundef nonnull align 4 dereferenceable(16) %8, i32 noundef %21, i32 noundef %29, i32 noundef %11, i32 noundef %14) #3
  call void @_ZNK4juce9RectangleIiE17constrainedWithinERKS1_(ptr dead_on_unwind writable sret(%"class.juce::Rectangle") align 4 %0, ptr noundef nonnull align 4 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(16) %4) #3
  call void @_ZN4juce9RectangleIiED2Ev(ptr noundef nonnull align 4 dereferenceable(16) %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #3
  call void @_ZN4juce10TextLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #3
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #3
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN4juce18LookAndFeelHelpersL17layoutTooltipTextERKNS_6StringENS_6ColourE(ptr dead_on_unwind noalias writable sret(%"class.juce::TextLayout") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4juce10TextLayout8getWidthEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK4juce10TextLayout9getHeightEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #0 align 2

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

; Function Attrs: nounwind
declare void @_ZN4juce10TextLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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, !7, i64 0}
!6 = !{!"_ZTSN4juce5PointIiEE", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass