; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/juce_data_structures.ll (ZNK4juce5ValueeqERKS0_)

; 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::var" = type { ptr, %"union.juce::var::ValueUnion" }
%"union.juce::var::ValueUnion" = type { i64 }
%"class.juce::Value" = type { %"class.juce::ReferenceCountedObjectPtr.0", %"class.juce::ListenerList" }
%"class.juce::ReferenceCountedObjectPtr.0" = type { ptr }
%"class.juce::ListenerList" = type { %"class.juce::Array.1" }
%"class.juce::Array.1" = type { %"class.juce::ArrayAllocationBase.2", i32, [4 x i8] }
%"class.juce::ArrayAllocationBase.2" = type <{ %"class.juce::HeapBlock.3", i32, [4 x i8] }>
%"class.juce::HeapBlock.3" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_5Value11ValueSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4juce5Value8getValueEv(ptr dead_on_unwind noalias writable sret(%"class.juce::var") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

; Function Attrs: nounwind
declare void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN4juceeqINS_5Value11ValueSourceEEEbRKNS_25ReferenceCountedObjectPtrIT_EES7_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce5ValueeqERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.juce::var", align 8
  %7 = alloca i1, align 1
  %8 = alloca i1, align 1
  %9 = alloca %"class.juce::var", align 8
  %10 = alloca i1, align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i1, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8
  %15 = getelementptr inbounds %"class.juce::Value", ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.juce::Value", ptr %16, i32 0, i32 0
  %18 = call noundef zeroext i1 @_ZN4juceeqINS_5Value11ValueSourceEEEbRKNS_25ReferenceCountedObjectPtrIT_EES7_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %17) #4
  store i1 false, ptr %7, align 1
  store i1 false, ptr %8, align 1
  store i1 false, ptr %10, align 1
  store i1 false, ptr %13, align 1
  br i1 %18, label %28, label %19

19:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #4
  store i1 true, ptr %7, align 1
  %20 = getelementptr inbounds %"class.juce::Value", ptr %14, i32 0, i32 0
  %21 = call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_5Value11ValueSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #4
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 2
  %24 = load ptr, ptr %23, align 8
  call void %24(ptr dead_on_unwind writable sret(%"class.juce::var") align 8 %6, ptr noundef nonnull align 8 dereferenceable(56) %21)
  store i1 true, ptr %8, align 1
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  store i1 true, ptr %10, align 1
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  invoke void @_ZNK4juce5Value8getValueEv(ptr dead_on_unwind writable sret(%"class.juce::var") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %25)
          to label %26 unwind label %43

26:                                               ; preds = %19
  store i1 true, ptr %13, align 1
  %27 = call noundef zeroext i1 @_ZN4juceeqERKNS_3varES2_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  br label %28

28:                                               ; preds = %26, %2
  %29 = phi i1 [ true, %2 ], [ %27, %26 ]
  store i1 %29, ptr %3, align 1
  %30 = load i1, ptr %13, align 1
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  call void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  br label %32

32:                                               ; preds = %31, %28
  %33 = load i1, ptr %10, align 1
  br i1 %33, label %34, label %35

34:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  br label %35

35:                                               ; preds = %34, %32
  %36 = load i1, ptr %8, align 1
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  call void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  br label %38

38:                                               ; preds = %37, %35
  %39 = load i1, ptr %7, align 1
  br i1 %39, label %40, label %41

40:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  br label %41

41:                                               ; preds = %40, %38
  %42 = load i1, ptr %3, align 1
  ret i1 %42

43:                                               ; preds = %19
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %11, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %12, align 4
  %47 = load i1, ptr %10, align 1
  br i1 %47, label %48, label %49

48:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  br label %49

49:                                               ; preds = %48, %43
  %50 = load i1, ptr %8, align 1
  br i1 %50, label %51, label %52

51:                                               ; preds = %49
  call void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #4
  br label %52

52:                                               ; preds = %51, %49
  %53 = load i1, ptr %7, align 1
  br i1 %53, label %54, label %55

54:                                               ; preds = %52
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #4
  br label %55

55:                                               ; preds = %54, %52
  br label %56

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

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN4juceeqERKNS_3varES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #3

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 = { 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 = { 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 = !{!"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"

%"class.juce::var" = type { ptr, %"union.juce::var::ValueUnion" }
%"union.juce::var::ValueUnion" = type { i64 }

declare i32 @__gxx_personality_v0(...)

; 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4juce5Value8getValueEv(ptr dead_on_unwind noalias writable sret(%"class.juce::var") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

; Function Attrs: nounwind
declare void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZNK4juce5ValueeqERKS0_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.juce::var", align 8
  %4 = alloca %"class.juce::var", align 8
  %5 = tail call noundef zeroext i1 @_ZN4juceeqINS_5Value11ValueSourceEEEbRKNS_25ReferenceCountedObjectPtrIT_EES7_(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #4
  br i1 %5, label %.critedge16, label %6

6:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %7 = tail call noundef ptr @_ZNK4juce25ReferenceCountedObjectPtrINS_5Value11ValueSourceEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %0) #4
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load ptr, ptr %9, align 8
  call void %10(ptr dead_on_unwind nonnull writable sret(%"class.juce::var") align 8 %3, ptr noundef nonnull align 8 dereferenceable(56) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  invoke void @_ZNK4juce5Value8getValueEv(ptr dead_on_unwind nonnull writable sret(%"class.juce::var") align 8 %4, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %.critedge unwind label %13

.critedge:                                        ; preds = %6
  %11 = call noundef zeroext i1 @_ZN4juceeqERKNS_3varES2_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  br label %.critedge16

.critedge16:                                      ; preds = %2, %.critedge
  %12 = phi i1 [ %11, %.critedge ], [ true, %2 ]
  ret i1 %12

13:                                               ; preds = %6
  %14 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @_ZN4juce3varD1Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  resume { ptr, i32 } %14
}

; Function Attrs: nounwind
declare noundef zeroext i1 @_ZN4juceeqERKNS_3varES2_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

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 = { 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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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