; LLVM IR from turi-code/SFrame :: oss_src/metric/metrics_server.ll (ZN8graphlab34delete_all_metric_server_callbacksEv)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab34delete_all_metric_server_callbacksEv() #0 {
  %1 = call noundef nonnull align 8 dereferenceable(56) ptr @_ZN8graphlabL13callback_lockEv()
  %2 = icmp eq ptr %1, null
  br i1 %2, label %4, label %3

3:                                                ; preds = %0
  call void @_ZN8graphlab6rwlockD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %1) #3
  call void @_ZdlPvm(ptr noundef %1, i64 noundef 56) #4
  br label %4

4:                                                ; preds = %3, %0
  %5 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZN8graphlabL9callbacksB5cxx11Ev()
  %6 = icmp eq ptr %5, null
  br i1 %6, label %8, label %7

7:                                                ; preds = %4
  call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN5boost8functionIFSt4pairIS5_S5_ERS_IS5_S5_St4lessIS5_ESaIS8_IKS5_S5_EEEEEESB_SaIS8_ISC_SI_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #3
  call void @_ZdlPvm(ptr noundef %5, i64 noundef 48) #4
  br label %8

8:                                                ; preds = %7, %4
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(56) ptr @_ZN8graphlabL13callback_lockEv() #0

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(48) ptr @_ZN8graphlabL9callbacksB5cxx11Ev() #0

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

attributes #0 = { 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 #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 = { 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 #3 = { nounwind }
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)"}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab34delete_all_metric_server_callbacksEv() local_unnamed_addr #0 {
  %1 = tail call noundef nonnull align 8 dereferenceable(56) ptr @_ZN8graphlabL13callback_lockEv()
  tail call void @_ZN8graphlab6rwlockD2Ev(ptr noundef nonnull align 8 dereferenceable(56) %1) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %1, i64 noundef 56) #4
  %2 = tail call noundef nonnull align 8 dereferenceable(48) ptr @_ZN8graphlabL9callbacksB5cxx11Ev()
  tail call void @_ZNSt3mapINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN5boost8functionIFSt4pairIS5_S5_ERS_IS5_S5_St4lessIS5_ESaIS8_IKS5_S5_EEEEEESB_SaIS8_ISC_SI_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #3
  tail call void @_ZdlPvm(ptr noundef nonnull %2, i64 noundef 48) #4
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(56) ptr @_ZN8graphlabL13callback_lockEv() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef nonnull align 8 dereferenceable(48) ptr @_ZN8graphlabL9callbacksB5cxx11Ev() local_unnamed_addr #0

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

attributes #0 = { 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 #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 = { 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 #3 = { nounwind }
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)"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,SimplifyCFGPass,TailCallElimPass