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

; 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::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }

@_ZN4juce9juce_argcE = external global i32, align 4
@_ZN4juce9juce_argvE = external global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN4juce6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce19JUCEApplicationBase24getCommandLineParametersEv(ptr dead_on_unwind noalias writable sret(%"class.juce::String") align 8 %0) #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.juce::String", align 8
  %4 = alloca i32, align 4
  %5 = alloca %"class.juce::String", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.juce::String", align 8
  store ptr %0, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %45, %1
  %10 = load i32, ptr %4, align 4, !tbaa !5
  %11 = load i32, ptr @_ZN4juce9juce_argcE, align 4, !tbaa !5
  %12 = icmp slt i32 %10, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %50

14:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %15 = load ptr, ptr @_ZN4juce9juce_argvE, align 8, !tbaa !9
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds ptr, ptr %15, i64 %17
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  invoke void @_ZN4juce6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef %19)
          to label %20 unwind label %28

20:                                               ; preds = %14
  %21 = call noundef zeroext i1 @_ZNK4juce6String12containsCharEw(ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef signext 32) #4
  br i1 %21, label %22, label %40

22:                                               ; preds = %20
  %23 = invoke noundef zeroext i1 @_ZNK4juce6String14isQuotedStringEv(ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %24 unwind label %32

24:                                               ; preds = %22
  br i1 %23, label %40, label %25

25:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  invoke void @_ZNK4juce6String6quotedEw(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %8, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef signext 34)
          to label %26 unwind label %36

26:                                               ; preds = %25
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %40

28:                                               ; preds = %14
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %6, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %7, align 4
  br label %49

32:                                               ; preds = %42, %40, %22
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %6, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %7, align 4
  br label %48

36:                                               ; preds = %25
  %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 @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %48

40:                                               ; preds = %26, %24, %20
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %42 unwind label %32

42:                                               ; preds = %40
  %43 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringEc(ptr noundef nonnull align 8 dereferenceable(8) %41, i8 noundef signext 32)
          to label %44 unwind label %32

44:                                               ; preds = %42
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %4, align 4, !tbaa !5
  br label %9, !llvm.loop !11

48:                                               ; preds = %36, %32
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #4
  br label %49

49:                                               ; preds = %48, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %56

50:                                               ; preds = %13
  invoke void @_ZNK4juce6String4trimEv(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %51 unwind label %52

51:                                               ; preds = %50
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret void

52:                                               ; preds = %50
  %53 = landingpad { ptr, i32 }
          cleanup
  %54 = extractvalue { ptr, i32 } %53, 0
  store ptr %54, ptr %6, align 8
  %55 = extractvalue { ptr, i32 } %53, 1
  store i32 %55, ptr %7, align 4
  br label %56

56:                                               ; preds = %52, %49
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %57

57:                                               ; preds = %56
  %58 = load ptr, ptr %6, align 8
  %59 = load i32, ptr %7, align 4
  %60 = insertvalue { ptr, i32 } poison, ptr %58, 0
  %61 = insertvalue { ptr, i32 } %60, i32 %59, 1
  resume { ptr, i32 } %61
}

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

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce6String12containsCharEw(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef signext) #2

declare noundef zeroext i1 @_ZNK4juce6String14isQuotedStringEv(ptr noundef nonnull align 8 dereferenceable(8)) #1

declare void @_ZNK4juce6String6quotedEw(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef signext) #1

; Function Attrs: nounwind
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringEc(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

declare void @_ZNK4juce6String4trimEv(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(8)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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"

%"class.juce::String" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }

@_ZN4juce9juce_argcE = external local_unnamed_addr global i32, align 4
@_ZN4juce9juce_argvE = external local_unnamed_addr global ptr, align 8

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN4juce6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce19JUCEApplicationBase24getCommandLineParametersEv(ptr dead_on_unwind noalias writable sret(%"class.juce::String") align 8 %0) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.juce::String", align 8
  %3 = alloca %"class.juce::String", align 8
  %4 = alloca %"class.juce::String", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN4juce6StringC1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  %5 = load i32, ptr @_ZN4juce9juce_argcE, align 4, !tbaa !5
  %6 = icmp sgt i32 %5, 1
  br i1 %6, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %28, %1
  invoke void @_ZNK4juce6String4trimEv(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %34 unwind label %35

.lr.ph:                                           ; preds = %1, %28
  %indvars.iv = phi i64 [ %indvars.iv.next, %28 ], [ 1, %1 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %7 = load ptr, ptr @_ZN4juce9juce_argvE, align 8, !tbaa !9
  %8 = getelementptr inbounds ptr, ptr %7, i64 %indvars.iv
  %9 = load ptr, ptr %8, align 8, !tbaa !9
  invoke void @_ZN4juce6StringC1EPKc(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %9)
          to label %10 unwind label %18

10:                                               ; preds = %.lr.ph
  %11 = call noundef zeroext i1 @_ZNK4juce6String12containsCharEw(ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef signext 32) #4
  br i1 %11, label %12, label %24

12:                                               ; preds = %10
  %13 = invoke noundef zeroext i1 @_ZNK4juce6String14isQuotedStringEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %14 unwind label %20

14:                                               ; preds = %12
  br i1 %13, label %24, label %15

15:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  invoke void @_ZNK4juce6String6quotedEw(ptr dead_on_unwind nonnull writable sret(%"class.juce::String") align 8 %4, ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef signext 34)
          to label %16 unwind label %22

16:                                               ; preds = %15
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4juce6StringaSEOS0_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %24

18:                                               ; preds = %.lr.ph
  %19 = landingpad { ptr, i32 }
          cleanup
  br label %33

20:                                               ; preds = %26, %24, %12
  %21 = landingpad { ptr, i32 }
          cleanup
  br label %32

22:                                               ; preds = %15
  %23 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %32

24:                                               ; preds = %16, %14, %10
  %25 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringERKS0_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %26 unwind label %20

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringEc(ptr noundef nonnull align 8 dereferenceable(8) %25, i8 noundef signext 32)
          to label %28 unwind label %20

28:                                               ; preds = %26
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %29 = load i32, ptr @_ZN4juce9juce_argcE, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = icmp slt i64 %indvars.iv.next, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !11

32:                                               ; preds = %22, %20
  %.pn = phi { ptr, i32 } [ %21, %20 ], [ %23, %22 ]
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  br label %33

33:                                               ; preds = %32, %18
  %.pn.pn = phi { ptr, i32 } [ %.pn, %32 ], [ %19, %18 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %37

34:                                               ; preds = %._crit_edge
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  ret void

35:                                               ; preds = %._crit_edge
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %37

37:                                               ; preds = %35, %33
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %33 ], [ %36, %35 ]
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn.pn.pn
}

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

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZNK4juce6String12containsCharEw(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef signext) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK4juce6String14isQuotedStringEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

declare void @_ZNK4juce6String6quotedEw(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef signext) local_unnamed_addr #1

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringEc(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZN4jucelsERNS_6StringERKS0_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

declare void @_ZNK4juce6String4trimEv(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass