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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce7Toolbar10createItemERNS_18ToolbarItemFactoryEi(ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %8 = load i32, ptr %5, align 4, !tbaa !9
  %9 = icmp eq i32 %8, -1
  br i1 %9, label %10, label %18

10:                                               ; preds = %2
  %11 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 440) #3
  %12 = load i32, ptr %5, align 4, !tbaa !9
  invoke void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433) %11, i32 noundef %12, float noundef 0x3FB99999A0000000, i1 noundef zeroext true)
          to label %13 unwind label %14

13:                                               ; preds = %10
  store ptr %11, ptr %3, align 8
  br label %47

14:                                               ; preds = %10
  %15 = landingpad { ptr, i32 }
          cleanup
  %16 = extractvalue { ptr, i32 } %15, 0
  store ptr %16, ptr %6, align 8
  %17 = extractvalue { ptr, i32 } %15, 1
  store i32 %17, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %11, i64 noundef 440) #4
  br label %49

18:                                               ; preds = %2
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = icmp eq i32 %19, -2
  br i1 %20, label %21, label %29

21:                                               ; preds = %18
  %22 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 440) #3
  %23 = load i32, ptr %5, align 4, !tbaa !9
  invoke void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433) %22, i32 noundef %23, float noundef 5.000000e-01, i1 noundef zeroext false)
          to label %24 unwind label %25

24:                                               ; preds = %21
  store ptr %22, ptr %3, align 8
  br label %47

25:                                               ; preds = %21
  %26 = landingpad { ptr, i32 }
          cleanup
  %27 = extractvalue { ptr, i32 } %26, 0
  store ptr %27, ptr %6, align 8
  %28 = extractvalue { ptr, i32 } %26, 1
  store i32 %28, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %22, i64 noundef 440) #4
  br label %49

29:                                               ; preds = %18
  %30 = load i32, ptr %5, align 4, !tbaa !9
  %31 = icmp eq i32 %30, -3
  br i1 %31, label %32, label %40

32:                                               ; preds = %29
  %33 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 440) #3
  %34 = load i32, ptr %5, align 4, !tbaa !9
  invoke void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433) %33, i32 noundef %34, float noundef 0.000000e+00, i1 noundef zeroext false)
          to label %35 unwind label %36

35:                                               ; preds = %32
  store ptr %33, ptr %3, align 8
  br label %47

36:                                               ; preds = %32
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %6, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %7, align 4
  call void @_ZdlPvm(ptr noundef %33, i64 noundef 440) #4
  br label %49

40:                                               ; preds = %29
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = load ptr, ptr %41, align 8, !tbaa !11
  %44 = getelementptr inbounds ptr, ptr %43, i64 4
  %45 = load ptr, ptr %44, align 8
  %46 = call noundef ptr %45(ptr noundef nonnull align 8 dereferenceable(8) %41, i32 noundef %42)
  store ptr %46, ptr %3, align 8
  br label %47

47:                                               ; preds = %40, %35, %24, %13
  %48 = load ptr, ptr %3, align 8
  ret ptr %48

49:                                               ; preds = %36, %25, %14
  %50 = load ptr, ptr %6, align 8
  %51 = load i32, ptr %7, align 4
  %52 = insertvalue { ptr, i32 } poison, ptr %50, 0
  %53 = insertvalue { ptr, i32 } %52, i32 %51, 1
  resume { ptr, i32 } %53
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433), i32 noundef, float noundef, i1 noundef zeroext) unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { builtin allocsize(0) }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}


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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce7Toolbar10createItemERNS_18ToolbarItemFactoryEi(ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  switch i32 %1, label %15 [
    i32 -1, label %3
    i32 -2, label %7
    i32 -3, label %11
  ]

3:                                                ; preds = %2
  %4 = tail call noalias noundef nonnull dereferenceable(440) ptr @_Znwm(i64 noundef 440) #3
  invoke void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433) %4, i32 noundef -1, float noundef 0x3FB99999A0000000, i1 noundef zeroext true)
          to label %20 unwind label %5

5:                                                ; preds = %3
  %6 = landingpad { ptr, i32 }
          cleanup
  br label %21

7:                                                ; preds = %2
  %8 = tail call noalias noundef nonnull dereferenceable(440) ptr @_Znwm(i64 noundef 440) #3
  invoke void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433) %8, i32 noundef -2, float noundef 5.000000e-01, i1 noundef zeroext false)
          to label %20 unwind label %9

9:                                                ; preds = %7
  %10 = landingpad { ptr, i32 }
          cleanup
  br label %21

11:                                               ; preds = %2
  %12 = tail call noalias noundef nonnull dereferenceable(440) ptr @_Znwm(i64 noundef 440) #3
  invoke void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433) %12, i32 noundef -3, float noundef 0.000000e+00, i1 noundef zeroext false)
          to label %20 unwind label %13

13:                                               ; preds = %11
  %14 = landingpad { ptr, i32 }
          cleanup
  br label %21

15:                                               ; preds = %2
  %16 = load ptr, ptr %0, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 32
  %18 = load ptr, ptr %17, align 8
  %19 = tail call noundef ptr %18(ptr noundef nonnull align 8 dereferenceable(8) %0, i32 noundef %1)
  br label %20

20:                                               ; preds = %11, %7, %3, %15
  %.011 = phi ptr [ %19, %15 ], [ %4, %3 ], [ %8, %7 ], [ %12, %11 ]
  ret ptr %.011

21:                                               ; preds = %13, %9, %5
  %.sink = phi ptr [ %12, %13 ], [ %8, %9 ], [ %4, %5 ]
  %.pn = phi { ptr, i32 } [ %14, %13 ], [ %10, %9 ], [ %6, %5 ]
  tail call void @_ZdlPvm(ptr noundef nonnull %.sink, i64 noundef 440) #4
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce7Toolbar6SpacerC2Eifb(ptr noundef nonnull align 8 dereferenceable(433), i32 noundef, float noundef, i1 noundef zeroext) unnamed_addr #2 align 2

attributes #0 = { 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 #1 = { 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 #2 = { 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 #3 = { builtin allocsize(0) }
attributes #4 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass