; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode (juce_audio_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::AudioChannelSet" = type { %"class.juce::BigInteger" }
%"class.juce::BigInteger" = type <{ %"class.juce::HeapBlock.9", [4 x i32], i64, i32, i8, [3 x i8] }>
%"class.juce::HeapBlock.9" = type { ptr }
%"class.juce::StringArray" = type { %"class.juce::Array.11" }
%"class.juce::Array.11" = type { %"class.juce::ArrayAllocationBase.12", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.12" = type <{ %"class.juce::HeapBlock.13", i32, [4 x i8] }>
%"class.juce::HeapBlock.13" = type { ptr }
%"class.juce::StringRef" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }

; 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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce15AudioChannelSet21fromAbbreviatedStringERKNS_6StringE(ptr dead_on_unwind noalias writable sret(%"class.juce::AudioChannelSet") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.juce::StringArray", align 8
  %6 = alloca %"class.juce::StringRef", align 8
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #6
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN4juce9StringRefC1ERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  call void @_ZN4juce11StringArray10fromTokensENS_9StringRefEb(ptr dead_on_unwind writable sret(%"class.juce::StringArray") align 8 %5, ptr noundef %6, i1 noundef zeroext true)
  store i1 false, ptr %7, align 1
  call void @_ZN4juce15AudioChannelSetC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %32, %2
  %14 = load i32, ptr %8, align 4, !tbaa !9
  %15 = call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %16 = icmp slt i32 %14, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %35

18:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %19) #6
  %21 = call noundef i32 @_ZN4juce15AudioChannelSet30getChannelTypeFromAbbreviationERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %20)
  store i32 %21, ptr %9, align 4, !tbaa !11
  %22 = load i32, ptr %9, align 4, !tbaa !11
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %31

24:                                               ; preds = %18
  %25 = load i32, ptr %9, align 4, !tbaa !11
  invoke void @_ZN4juce15AudioChannelSet10addChannelENS0_11ChannelTypeE(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %25)
          to label %26 unwind label %27

26:                                               ; preds = %24
  br label %31

27:                                               ; preds = %24
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %10, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  call void @_ZN4juce11StringArrayD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  br label %39

31:                                               ; preds = %26, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %32

32:                                               ; preds = %31
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %8, align 4, !tbaa !9
  br label %13, !llvm.loop !13

35:                                               ; preds = %17
  store i1 true, ptr %7, align 1
  %36 = load i1, ptr %7, align 1
  br i1 %36, label %38, label %37

37:                                               ; preds = %35
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  br label %38

38:                                               ; preds = %37, %35
  call void @_ZN4juce11StringArrayD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #6
  ret void

39:                                               ; preds = %27
  %40 = load ptr, ptr %10, align 8
  %41 = load i32, ptr %11, align 4
  %42 = insertvalue { ptr, i32 } poison, ptr %40, 0
  %43 = insertvalue { ptr, i32 } %42, i32 %41, 1
  resume { ptr, i32 } %43
}

declare void @_ZN4juce11StringArray10fromTokensENS_9StringRefEb(ptr dead_on_unwind writable sret(%"class.juce::StringArray") align 8, ptr noundef, i1 noundef zeroext) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce15AudioChannelSetC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4juce15AudioChannelSet10addChannelENS0_11ChannelTypeE(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { "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 #5 = { 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 #6 = { 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 = !{!"_ZTSN4juce15AudioChannelSet11ChannelTypeE", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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::AudioChannelSet" = type { %"class.juce::BigInteger" }
%"class.juce::BigInteger" = type <{ %"class.juce::HeapBlock.9", [4 x i32], i64, i32, i8, [3 x i8] }>
%"class.juce::HeapBlock.9" = type { ptr }
%"class.juce::StringArray" = type { %"class.juce::Array.11" }
%"class.juce::Array.11" = type { %"class.juce::ArrayAllocationBase.12", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.12" = type <{ %"class.juce::HeapBlock.13", i32, [4 x i8] }>
%"class.juce::HeapBlock.13" = type { ptr }
%"class.juce::StringRef" = type { %"class.juce::CharPointer_UTF8" }
%"class.juce::CharPointer_UTF8" = type { ptr }

; 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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4juce15AudioChannelSet21fromAbbreviatedStringERKNS_6StringE(ptr dead_on_unwind noalias writable sret(%"class.juce::AudioChannelSet") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::StringArray", align 8
  %4 = alloca %"class.juce::StringRef", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  call void @_ZN4juce9StringRefC1ERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %1) #6
  call void @_ZN4juce11StringArray10fromTokensENS_9StringRefEb(ptr dead_on_unwind nonnull writable sret(%"class.juce::StringArray") align 8 %3, ptr noundef nonnull %4, i1 noundef zeroext true)
  call void @_ZN4juce15AudioChannelSetC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  %5 = call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %12
  %.09 = phi i32 [ %13, %12 ], [ 0, %2 ]
  %7 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK4juce11StringArrayixEi(ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %.09) #6
  %8 = call noundef i32 @_ZN4juce15AudioChannelSet30getChannelTypeFromAbbreviationERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %12, label %9

9:                                                ; preds = %.lr.ph
  invoke void @_ZN4juce15AudioChannelSet10addChannelENS0_11ChannelTypeE(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %8)
          to label %12 unwind label %10

10:                                               ; preds = %9
  %11 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %0) #6
  call void @_ZN4juce11StringArrayD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  resume { ptr, i32 } %11

12:                                               ; preds = %9, %.lr.ph
  %13 = add nuw nsw i32 %.09, 1
  %14 = call noundef i32 @_ZNK4juce11StringArray4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  %15 = icmp slt i32 %13, %14
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %12, %2
  call void @_ZN4juce11StringArrayD1Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  ret void
}

declare void @_ZN4juce11StringArray10fromTokensENS_9StringRefEb(ptr dead_on_unwind writable sret(%"class.juce::StringArray") align 8, ptr noundef, i1 noundef zeroext) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4juce15AudioChannelSetC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) 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 #5 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 @_ZN4juce15AudioChannelSet10addChannelENS0_11ChannelTypeE(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4juce15AudioChannelSetD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { "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 #5 = { 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 #6 = { 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,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass