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

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

; 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce14AudioProcessor16getXmlFromBinaryEPKvi(ptr noundef %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 i32, align 4
  %7 = alloca %"class.juce::String", align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  %11 = load i32, ptr %5, align 4, !tbaa !9
  %12 = icmp sgt i32 %11, 8
  br i1 %12, label %13, label %40

13:                                               ; preds = %2
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = call noundef i32 @_ZN4juce9ByteOrder15littleEndianIntEPKv(ptr noundef %14) #6
  %16 = icmp eq i32 %15, 556942166
  br i1 %16, label %17, label %40

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = call noundef ptr @_ZN4juce17addBytesToPointerIKviEEPT_S3_T0_(ptr noundef %18, i32 noundef 4) #6
  %20 = call noundef i32 @_ZN4juce9ByteOrder15littleEndianIntEPKv(ptr noundef %19) #6
  store i32 %20, ptr %6, align 4, !tbaa !9
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %23, label %36

23:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = sub nsw i32 %26, 8
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %27, i32 noundef %28)
  call void @_ZN4juce6String8fromUTF8EPKci(ptr dead_on_unwind writable sret(%"class.juce::String") align 8 %7, ptr noundef %25, i32 noundef %29)
  %30 = invoke noundef ptr @_ZN4juce11XmlDocument5parseERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %31 unwind label %32

31:                                               ; preds = %23
  store ptr %30, ptr %3, align 8
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  store i32 1, ptr %10, align 4
  br label %37

32:                                               ; preds = %23
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %8, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %9, align 4
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %43

36:                                               ; preds = %17
  store i32 0, ptr %10, align 4
  br label %37

37:                                               ; preds = %36, %31
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %38 = load i32, ptr %10, align 4
  switch i32 %38, label %48 [
    i32 0, label %39
    i32 1, label %41
  ]

39:                                               ; preds = %37
  br label %40

40:                                               ; preds = %39, %13, %2
  store ptr null, ptr %3, align 8
  br label %41

41:                                               ; preds = %40, %37
  %42 = load ptr, ptr %3, align 8
  ret ptr %42

43:                                               ; preds = %32
  %44 = load ptr, ptr %8, align 8
  %45 = load i32, ptr %9, align 4
  %46 = insertvalue { ptr, i32 } poison, ptr %44, 0
  %47 = insertvalue { ptr, i32 } %46, i32 %45, 1
  resume { ptr, i32 } %47

48:                                               ; preds = %37
  unreachable
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce9ByteOrder15littleEndianIntEPKv(ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce17addBytesToPointerIKviEEPT_S3_T0_(ptr noundef, i32 noundef) #3

declare noundef ptr @_ZN4juce11XmlDocument5parseERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare void @_ZN4juce6String8fromUTF8EPKci(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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 = { 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}


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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN4juce14AudioProcessor16getXmlFromBinaryEPKvi(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::String", align 8
  %4 = icmp sgt i32 %1, 8
  br i1 %4, label %5, label %.thread

5:                                                ; preds = %2
  %6 = tail call noundef i32 @_ZN4juce9ByteOrder15littleEndianIntEPKv(ptr noundef %0) #6
  %7 = icmp eq i32 %6, 556942166
  br i1 %7, label %8, label %.thread

8:                                                ; preds = %5
  %9 = tail call noundef ptr @_ZN4juce17addBytesToPointerIKviEEPT_S3_T0_(ptr noundef %0, i32 noundef 4) #6
  %10 = tail call noundef i32 @_ZN4juce9ByteOrder15littleEndianIntEPKv(ptr noundef %9) #6
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %12, label %.thread

12:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = add nsw i32 %1, -8
  %15 = tail call noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef %14, i32 noundef %10)
  call void @_ZN4juce6String8fromUTF8EPKci(ptr dead_on_unwind nonnull writable sret(%"class.juce::String") align 8 %3, ptr noundef nonnull %13, i32 noundef %15)
  %16 = invoke noundef ptr @_ZN4juce11XmlDocument5parseERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %19 unwind label %17

17:                                               ; preds = %12
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  resume { ptr, i32 } %18

19:                                               ; preds = %12
  call void @_ZN4juce6StringD1Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %.thread

.thread:                                          ; preds = %8, %2, %5, %19
  %.1 = phi ptr [ %16, %19 ], [ null, %5 ], [ null, %2 ], [ null, %8 ]
  ret ptr %.1
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce9ByteOrder15littleEndianIntEPKv(ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN4juce17addBytesToPointerIKviEEPT_S3_T0_(ptr noundef, i32 noundef) local_unnamed_addr #3

declare noundef ptr @_ZN4juce11XmlDocument5parseERKNS_6StringE(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

declare void @_ZN4juce6String8fromUTF8EPKci(ptr dead_on_unwind writable sret(%"class.juce::String") align 8, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN4juce4jminIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #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 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass,TailCallElimPass