; 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::ChoicePropertyComponent" = type <{ %"class.juce::PropertyComponent.base", [4 x i8], %"class.juce::ComboBox::Listener", %"class.juce::StringArray", %"class.juce::ComboBox", i8, [7 x i8] }>
%"class.juce::PropertyComponent.base" = type <{ %"class.juce::Component.base", [3 x i8], %"class.juce::SettableTooltipClient", i32 }>
%"class.juce::Component.base" = type <{ %"class.juce::MouseListener", %"class.juce::String", %"class.juce::String", ptr, %"class.juce::Rectangle", %"class.juce::ScopedPointer", %"class.juce::ScopedPointer.0", %"class.juce::Array", ptr, %"class.juce::MouseCursor", ptr, %"class.juce::ScopedPointer.1", %"class.juce::ScopedPointer.2", %"class.juce::ScopedPointer.3", %"class.juce::ListenerList", %"class.juce::NamedValueSet", %"class.juce::WeakReference<juce::Component>::Master", %union.anon, i8 }>
%"class.juce::MouseListener" = type { ptr }
%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }
%"class.juce::Rectangle" = type { %"class.juce::Point", i32, i32 }
%"class.juce::Point" = type { i32, i32 }
%"class.juce::ScopedPointer" = type { ptr }
%"class.juce::ScopedPointer.0" = type { ptr }
%"class.juce::Array" = type { %"class.juce::ArrayAllocationBase", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase" = type <{ %"class.juce::HeapBlock", i32, [4 x i8] }>
%"class.juce::HeapBlock" = type { ptr }
%"class.juce::MouseCursor" = type { ptr }
%"class.juce::ScopedPointer.1" = type { ptr }
%"class.juce::ScopedPointer.2" = type { ptr }
%"class.juce::ScopedPointer.3" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.4" }
%"class.juce::Array.4" = type { %"class.juce::ArrayAllocationBase.5", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.5" = type <{ %"class.juce::HeapBlock.6", i32, [4 x i8] }>
%"class.juce::HeapBlock.6" = type { ptr }
%"class.juce::NamedValueSet" = type { %"class.juce::Array.9" }
%"class.juce::Array.9" = type { %"class.juce::ArrayAllocationBase.10", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.10" = type <{ %"class.juce::HeapBlock.11", i32, [4 x i8] }>
%"class.juce::HeapBlock.11" = type { ptr }
%"class.juce::WeakReference<juce::Component>::Master" = type { %"class.juce::ReferenceCountedObjectPtr" }
%"class.juce::ReferenceCountedObjectPtr" = type { ptr }
%union.anon = type { i32 }
%"class.juce::SettableTooltipClient" = type { %"class.juce::TooltipClient", %"class.juce::String" }
%"class.juce::TooltipClient" = type { ptr }
%"class.juce::ComboBox::Listener" = type { ptr }
%"class.juce::StringArray" = type { %"class.juce::Array.150" }
%"class.juce::Array.150" = type { %"class.juce::ArrayAllocationBase.151", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.151" = type <{ %"class.juce::HeapBlock.152", i32, [4 x i8] }>
%"class.juce::HeapBlock.152" = type { ptr }
%"class.juce::ComboBox" = type <{ %"class.juce::Component.base", [3 x i8], %"class.juce::SettableTooltipClient", %"class.juce::Label::Listener", %"class.juce::Value::Listener", %"class.juce::AsyncUpdater", %"class.juce::PopupMenu", %"class.juce::Value", i32, i8, i8, i8, i8, float, [4 x i8], %"class.juce::ListenerList.244", %"class.juce::ScopedPointer.250", %"class.juce::String", %"class.juce::String", i32, [4 x i8] }>
%"class.juce::Label::Listener" = type { ptr }
%"class.juce::Value::Listener" = type { ptr }
%"class.juce::AsyncUpdater" = type { ptr, %"class.juce::ReferenceCountedObjectPtr.15" }
%"class.juce::ReferenceCountedObjectPtr.15" = type { ptr }
%"class.juce::PopupMenu" = type { %"class.juce::OwnedArray.239", %"class.juce::WeakReference.37" }
%"class.juce::OwnedArray.239" = type { %"class.juce::ArrayAllocationBase.240", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.240" = type <{ %"class.juce::HeapBlock.241", i32, [4 x i8] }>
%"class.juce::HeapBlock.241" = type { ptr }
%"class.juce::WeakReference.37" = type { %"class.juce::ReferenceCountedObjectPtr.38" }
%"class.juce::ReferenceCountedObjectPtr.38" = type { ptr }
%"class.juce::Value" = type { %"class.juce::ReferenceCountedObjectPtr.116", %"class.juce::ListenerList.117" }
%"class.juce::ReferenceCountedObjectPtr.116" = type { ptr }
%"class.juce::ListenerList.117" = type { %"class.juce::Array.118" }
%"class.juce::Array.118" = type { %"class.juce::ArrayAllocationBase.119", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.119" = type <{ %"class.juce::HeapBlock.120", i32, [4 x i8] }>
%"class.juce::HeapBlock.120" = type { ptr }
%"class.juce::ListenerList.244" = type { %"class.juce::Array.245" }
%"class.juce::Array.245" = type { %"class.juce::ArrayAllocationBase.246", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.246" = type <{ %"class.juce::HeapBlock.247", i32, [4 x i8] }>
%"class.juce::HeapBlock.247" = type { ptr }
%"class.juce::ScopedPointer.250" = type { ptr }

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

; 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
declare dso_local void @_ZN4juce9Component17addAndMakeVisibleERS0_i(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef nonnull align 8 dereferenceable(197), i32 noundef) #1 align 2

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

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

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce8ComboBox15setEditableTextEb(ptr noundef nonnull align 8 dereferenceable(380), i1 noundef zeroext) #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce23ChoicePropertyComponent14createComboBoxEv(ptr noundef nonnull align 8 dereferenceable(641) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  %5 = getelementptr inbounds %"class.juce::ChoicePropertyComponent", ptr %4, i32 0, i32 4
  call void @_ZN4juce9Component17addAndMakeVisibleERS0_i(ptr noundef nonnull align 8 dereferenceable(197) %4, ptr noundef nonnull align 8 dereferenceable(197) %5, i32 noundef -1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %6

6:                                                ; preds = %27, %1
  %7 = load i32, ptr %3, align 4, !tbaa !9
  %8 = getelementptr inbounds %"class.juce::ChoicePropertyComponent", ptr %4, i32 0, i32 3
  %9 = call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  %10 = icmp slt i32 %7, %9
  br i1 %10, label %12, label %11

11:                                               ; preds = %6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %30

12:                                               ; preds = %6
  %13 = getelementptr inbounds %"class.juce::ChoicePropertyComponent", ptr %4, i32 0, i32 3
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24) %13, i32 noundef %14) #4
  %16 = call noundef zeroext i1 @_ZNK4juce6String10isNotEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  br i1 %16, label %17, label %24

17:                                               ; preds = %12
  %18 = getelementptr inbounds %"class.juce::ChoicePropertyComponent", ptr %4, i32 0, i32 4
  %19 = getelementptr inbounds %"class.juce::ChoicePropertyComponent", ptr %4, i32 0, i32 3
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24) %19, i32 noundef %20) #4
  %22 = load i32, ptr %3, align 4, !tbaa !9
  %23 = add nsw i32 %22, 1
  call void @_ZN4juce8ComboBox7addItemERKNS_6StringEi(ptr noundef nonnull align 8 dereferenceable(380) %18, ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef %23)
  br label %26

24:                                               ; preds = %12
  %25 = getelementptr inbounds %"class.juce::ChoicePropertyComponent", ptr %4, i32 0, i32 4
  call void @_ZN4juce8ComboBox12addSeparatorEv(ptr noundef nonnull align 8 dereferenceable(380) %25)
  br label %26

26:                                               ; preds = %24, %17
  br label %27

27:                                               ; preds = %26
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !9
  br label %6, !llvm.loop !11

30:                                               ; preds = %11
  %31 = getelementptr inbounds %"class.juce::ChoicePropertyComponent", ptr %4, i32 0, i32 4
  call void @_ZN4juce8ComboBox15setEditableTextEb(ptr noundef nonnull align 8 dereferenceable(380) %31, i1 noundef zeroext false)
  ret void
}

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 = { 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 #4 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; 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 uwtable
declare dso_local void @_ZN4juce9Component17addAndMakeVisibleERS0_i(ptr noundef nonnull align 8 dereferenceable(197), ptr noundef nonnull align 8 dereferenceable(197), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4juce6String10isNotEmptyEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1 align 2

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

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce8ComboBox15setEditableTextEb(ptr noundef nonnull align 8 dereferenceable(380), i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce8ComboBox7addItemERKNS_6StringEi(ptr noundef nonnull align 8 dereferenceable(380), ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce8ComboBox12addSeparatorEv(ptr noundef nonnull align 8 dereferenceable(380)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce23ChoicePropertyComponent14createComboBoxEv(ptr noundef nonnull align 8 dereferenceable(641) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 256
  tail call void @_ZN4juce9Component17addAndMakeVisibleERS0_i(ptr noundef nonnull align 8 dereferenceable(197) %0, ptr noundef nonnull align 8 dereferenceable(197) %2, i32 noundef -1)
  %3 = getelementptr inbounds i8, ptr %0, i64 232
  %4 = tail call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  %5 = icmp sgt i32 %4, 0
  br i1 %5, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %12, %1
  tail call void @_ZN4juce8ComboBox15setEditableTextEb(ptr noundef nonnull align 8 dereferenceable(380) %2, i1 noundef zeroext false)
  ret void

.lr.ph:                                           ; preds = %1, %12
  %.05 = phi i32 [ %8, %12 ], [ 0, %1 ]
  %6 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.05) #3
  %7 = tail call noundef zeroext i1 @_ZNK4juce6String10isNotEmptyEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #3
  %8 = add nuw nsw i32 %.05, 1
  br i1 %7, label %9, label %11

9:                                                ; preds = %.lr.ph
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.05) #3
  tail call void @_ZN4juce8ComboBox7addItemERKNS_6StringEi(ptr noundef nonnull align 8 dereferenceable(380) %2, ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef %8)
  br label %12

11:                                               ; preds = %.lr.ph
  tail call void @_ZN4juce8ComboBox12addSeparatorEv(ptr noundef nonnull align 8 dereferenceable(380) %2)
  br label %12

12:                                               ; preds = %9, %11
  %13 = tail call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #3
  %14 = icmp slt i32 %8, %13
  br i1 %14, label %.lr.ph, label %._crit_edge, !llvm.loop !5
}

attributes #0 = { 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 #1 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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