; LLVM IR from turi-code/SFrame :: oss_src/sframe/unfair_lock.ll (ZN8graphlab11unfair_lock6unlockEv)

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

%"struct.std::_Rb_tree_iterator" = type { ptr }
%"class.graphlab::unfair_lock" = type { %"class.graphlab::mutex", %"class.graphlab::mutex", i8, %"class.std::map", i64, i32, double, i32, double, i64, i8, %"class.graphlab::timer" }
%"class.graphlab::mutex" = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, graphlab::conditional *>, std::_Select1st<std::pair<const unsigned long, graphlab::conditional *>>, std::less<unsigned long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned long, std::pair<const unsigned long, graphlab::conditional *>, std::_Select1st<std::pair<const unsigned long, graphlab::conditional *>>, std::less<unsigned long>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.graphlab::timer" = type { %struct.timeval }
%struct.timeval = type { i64, i64 }
%"struct.std::pair" = type { i64, ptr }
%"struct.graphlab::(anonymous namespace)::unfair_lock_priority" = type { i64, %"class.graphlab::conditional" }
%"class.graphlab::conditional" = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }

; 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 uwtable
declare hidden noundef ptr @_ZN8graphlab12_GLOBAL__N_124get_unfair_lock_priorityEv() #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #3 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab11unfair_lock6unlockEv(ptr noundef nonnull align 8 dereferenceable(208) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  %6 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 1
  call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %6)
  %7 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 9
  %8 = load i64, ptr %7, align 8, !tbaa !9
  %9 = add i64 %8, 1
  store i64 %9, ptr %7, align 8, !tbaa !9
  %10 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 9
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = icmp eq i64 %11, 100
  br i1 %12, label %13, label %96

13:                                               ; preds = %1
  %14 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 11
  %15 = call noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  %16 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 8
  store double %15, ptr %16, align 8, !tbaa !26
  %17 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 10
  %18 = load i8, ptr %17, align 8, !tbaa !27, !range !28, !noundef !29
  %19 = trunc i8 %18 to i1
  br i1 %19, label %34, label %20

20:                                               ; preds = %13
  %21 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 8
  %22 = load double, ptr %21, align 8, !tbaa !26
  %23 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 6
  %24 = load double, ptr %23, align 8, !tbaa !30
  %25 = fadd double %24, 5.000000e-01
  %26 = fcmp ogt double %22, %25
  br i1 %26, label %27, label %34

27:                                               ; preds = %20
  %28 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 5
  store i32 0, ptr %28, align 8, !tbaa !31
  %29 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 6
  store double 0.000000e+00, ptr %29, align 8, !tbaa !30
  %30 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 7
  store i32 50, ptr %30, align 8, !tbaa !32
  %31 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 8
  store double 0.000000e+00, ptr %31, align 8, !tbaa !26
  %32 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 9
  store i64 0, ptr %32, align 8, !tbaa !9
  %33 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 10
  store i8 1, ptr %33, align 8, !tbaa !27
  br label %94

34:                                               ; preds = %20, %13
  %35 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 10
  store i8 0, ptr %35, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %36 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 7
  %37 = load i32, ptr %36, align 8, !tbaa !32
  store i32 %37, ptr %3, align 4, !tbaa !33
  %38 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 6
  %39 = load double, ptr %38, align 8, !tbaa !30
  %40 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 8
  %41 = load double, ptr %40, align 8, !tbaa !26
  %42 = fcmp ogt double %39, %41
  br i1 %42, label %43, label %51

43:                                               ; preds = %34
  %44 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 7
  %45 = load i32, ptr %44, align 8, !tbaa !32
  %46 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 5
  %47 = load i32, ptr %46, align 8, !tbaa !31
  %48 = sub nsw i32 %45, %47
  %49 = load i32, ptr %3, align 4, !tbaa !33
  %50 = add nsw i32 %49, %48
  store i32 %50, ptr %3, align 4, !tbaa !33
  br label %66

51:                                               ; preds = %34
  %52 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 6
  %53 = load double, ptr %52, align 8, !tbaa !30
  %54 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 8
  %55 = load double, ptr %54, align 8, !tbaa !26
  %56 = fcmp olt double %53, %55
  br i1 %56, label %57, label %65

57:                                               ; preds = %51
  %58 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 7
  %59 = load i32, ptr %58, align 8, !tbaa !32
  %60 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 5
  %61 = load i32, ptr %60, align 8, !tbaa !31
  %62 = sub nsw i32 %59, %61
  %63 = load i32, ptr %3, align 4, !tbaa !33
  %64 = sub nsw i32 %63, %62
  store i32 %64, ptr %3, align 4, !tbaa !33
  br label %65

65:                                               ; preds = %57, %51
  br label %66

66:                                               ; preds = %65, %43
  %67 = load i32, ptr %3, align 4, !tbaa !33
  %68 = icmp slt i32 %67, 0
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  store i32 0, ptr %3, align 4, !tbaa !33
  br label %70

70:                                               ; preds = %69, %66
  %71 = load i32, ptr %3, align 4, !tbaa !33
  %72 = icmp sgt i32 %71, 100
  br i1 %72, label %73, label %74

73:                                               ; preds = %70
  store i32 100, ptr %3, align 4, !tbaa !33
  br label %74

74:                                               ; preds = %73, %70
  %75 = load i32, ptr %3, align 4, !tbaa !33
  %76 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 7
  %77 = load i32, ptr %76, align 8, !tbaa !32
  %78 = icmp eq i32 %75, %77
  br i1 %78, label %79, label %84

79:                                               ; preds = %74
  %80 = load i32, ptr %3, align 4, !tbaa !33
  %81 = sext i32 %80 to i64
  %82 = add i64 %81, 5
  %83 = trunc i64 %82 to i32
  store i32 %83, ptr %3, align 4, !tbaa !33
  br label %84

84:                                               ; preds = %79, %74
  %85 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 7
  %86 = load i32, ptr %85, align 8, !tbaa !32
  %87 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 5
  store i32 %86, ptr %87, align 8, !tbaa !31
  %88 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 8
  %89 = load double, ptr %88, align 8, !tbaa !26
  %90 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 6
  store double %89, ptr %90, align 8, !tbaa !30
  %91 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 9
  store i64 0, ptr %91, align 8, !tbaa !9
  %92 = load i32, ptr %3, align 4, !tbaa !33
  %93 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 7
  store i32 %92, ptr %93, align 8, !tbaa !32
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %94

94:                                               ; preds = %84, %27
  %95 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 11
  call void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %95)
  br label %96

96:                                               ; preds = %94, %1
  %97 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 0
  call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %97)
  %98 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 3
  %99 = call noundef i64 @_ZNKSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %98) #5
  %100 = icmp ugt i64 %99, 0
  br i1 %100, label %101, label %108

101:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %102 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 3
  %103 = call ptr @_ZNSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %102) #5
  %104 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %4, i32 0, i32 0
  store ptr %103, ptr %104, align 8
  %105 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN8graphlab11conditionalEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %106 = getelementptr inbounds %"struct.std::pair", ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !34
  call void @_ZNK8graphlab11conditional6signalEv(ptr noundef nonnull align 8 dereferenceable(48) %107)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %108

108:                                              ; preds = %101, %96
  %109 = call noundef ptr @_ZN8graphlab12_GLOBAL__N_124get_unfair_lock_priorityEv()
  %110 = getelementptr inbounds %"struct.graphlab::(anonymous namespace)::unfair_lock_priority", ptr %109, i32 0, i32 0
  %111 = load i64, ptr %110, align 8, !tbaa !36
  %112 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 4
  store i64 %111, ptr %112, align 8, !tbaa !39
  %113 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 2
  store volatile i8 0, ptr %113, align 8, !tbaa !40
  %114 = getelementptr inbounds %"class.graphlab::unfair_lock", ptr %5, i32 0, i32 1
  call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %114)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab11conditional6signalEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = { 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 #5 = { 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, !21, i64 176}
!10 = !{!"_ZTSN8graphlab11unfair_lockE", !11, i64 0, !11, i64 40, !12, i64 80, !13, i64 88, !21, i64 136, !22, i64 144, !23, i64 152, !22, i64 160, !23, i64 168, !21, i64 176, !12, i64 184, !24, i64 192}
!11 = !{!"_ZTSN8graphlab5mutexE", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"_ZTSSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE", !14, i64 0}
!14 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmPN8graphlab11conditionalEESt10_Select1stIS5_ESt4lessImESaIS5_EE", !15, i64 0}
!15 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmPN8graphlab11conditionalEESt10_Select1stIS5_ESt4lessImESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !16, i64 0, !18, i64 8}
!16 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !17, i64 0}
!17 = !{!"_ZTSSt4lessImE"}
!18 = !{!"_ZTSSt15_Rb_tree_header", !19, i64 0, !21, i64 32}
!19 = !{!"_ZTSSt18_Rb_tree_node_base", !20, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!20 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = !{!"double", !7, i64 0}
!24 = !{!"_ZTSN8graphlab5timerE", !25, i64 0}
!25 = !{!"_ZTS7timeval", !21, i64 0, !21, i64 8}
!26 = !{!10, !23, i64 168}
!27 = !{!10, !12, i64 184}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!10, !23, i64 152}
!31 = !{!10, !22, i64 144}
!32 = !{!10, !22, i64 160}
!33 = !{!22, !22, i64 0}
!34 = !{!35, !6, i64 8}
!35 = !{!"_ZTSSt4pairIKmPN8graphlab11conditionalEE", !21, i64 0, !6, i64 8}
!36 = !{!37, !21, i64 0}
!37 = !{!"_ZTSN8graphlab12_GLOBAL__N_120unfair_lock_priorityE", !21, i64 0, !38, i64 8}
!38 = !{!"_ZTSN8graphlab11conditionalE", !7, i64 0}
!39 = !{!10, !21, i64 136}
!40 = !{!10, !12, i64 80}


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

%"struct.std::_Rb_tree_iterator" = 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

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN8graphlab12_GLOBAL__N_124get_unfair_lock_priorityEv() local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab11unfair_lock6unlockEv(ptr noundef nonnull align 8 dereferenceable(208) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZNK8graphlab5mutex4lockEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  %4 = getelementptr inbounds i8, ptr %0, i64 176
  %5 = load i64, ptr %4, align 8, !tbaa !5
  %6 = add i64 %5, 1
  store i64 %6, ptr %4, align 8, !tbaa !5
  %7 = icmp eq i64 %6, 100
  br i1 %7, label %8, label %37

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 192
  %10 = tail call noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  %11 = getelementptr inbounds i8, ptr %0, i64 168
  store double %10, ptr %11, align 8, !tbaa !25
  %12 = getelementptr inbounds i8, ptr %0, i64 184
  %13 = load i8, ptr %12, align 8, !tbaa !26, !range !27, !noundef !28
  %14 = trunc nuw i8 %13 to i1
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 152
  %.pre = load double, ptr %.phi.trans.insert, align 8, !tbaa !29
  %15 = fadd double %.pre, 5.000000e-01
  %16 = fcmp ule double %10, %15
  %or.cond.not = select i1 %14, i1 true, i1 %16
  br i1 %or.cond.not, label %._crit_edge, label %17

17:                                               ; preds = %8
  %18 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 0, ptr %18, align 8, !tbaa !30
  store double 0.000000e+00, ptr %.phi.trans.insert, align 8, !tbaa !29
  %19 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 50, ptr %19, align 8, !tbaa !31
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  store i8 1, ptr %12, align 8, !tbaa !26
  br label %36

._crit_edge:                                      ; preds = %8
  store i8 0, ptr %12, align 8, !tbaa !26
  %20 = getelementptr inbounds i8, ptr %0, i64 160
  %21 = load i32, ptr %20, align 8, !tbaa !31
  %22 = getelementptr inbounds i8, ptr %0, i64 152
  %23 = fcmp ogt double %.pre, %10
  br i1 %23, label %24, label %28

24:                                               ; preds = %._crit_edge
  %25 = getelementptr inbounds i8, ptr %0, i64 144
  %26 = load i32, ptr %25, align 8, !tbaa !30
  %factor = shl i32 %21, 1
  %27 = sub i32 %factor, %26
  br label %33

28:                                               ; preds = %._crit_edge
  %29 = fcmp olt double %.pre, %10
  br i1 %29, label %30, label %33

30:                                               ; preds = %28
  %31 = getelementptr inbounds i8, ptr %0, i64 144
  %32 = load i32, ptr %31, align 8, !tbaa !30
  br label %33

33:                                               ; preds = %28, %30, %24
  %.0 = phi i32 [ %27, %24 ], [ %32, %30 ], [ %21, %28 ]
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %.0, i32 0)
  %spec.store.select1 = tail call i32 @llvm.umin.i32(i32 %spec.store.select, i32 100)
  %34 = icmp eq i32 %spec.store.select1, %21
  %narrow = add nuw nsw i32 %spec.store.select1, 5
  %spec.select = select i1 %34, i32 %narrow, i32 %spec.store.select1
  %35 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 %21, ptr %35, align 8, !tbaa !30
  store double %10, ptr %22, align 8, !tbaa !29
  store i64 0, ptr %4, align 8, !tbaa !5
  store i32 %spec.select, ptr %20, align 8, !tbaa !31
  br label %36

36:                                               ; preds = %33, %17
  tail call void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
  br label %37

37:                                               ; preds = %36, %1
  tail call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %0)
  %38 = getelementptr inbounds i8, ptr %0, i64 88
  %39 = tail call noundef i64 @_ZNKSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %38) #7
  %.not = icmp eq i64 %39, 0
  br i1 %.not, label %45, label %40

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %41 = tail call ptr @_ZNSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %38) #7
  store ptr %41, ptr %2, align 8
  %42 = call noundef ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKmPN8graphlab11conditionalEEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #7
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !32
  call void @_ZNK8graphlab11conditional6signalEv(ptr noundef nonnull align 8 dereferenceable(48) %44)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  br label %45

45:                                               ; preds = %40, %37
  %46 = call noundef ptr @_ZN8graphlab12_GLOBAL__N_124get_unfair_lock_priorityEv()
  %47 = load i64, ptr %46, align 8, !tbaa !34
  %48 = getelementptr inbounds i8, ptr %0, i64 136
  store i64 %47, ptr %48, align 8, !tbaa !37
  %49 = getelementptr inbounds i8, ptr %0, i64 80
  store volatile i8 0, ptr %49, align 8, !tbaa !38
  call void @_ZNK8graphlab5mutex6unlockEv(ptr noundef nonnull align 8 dereferenceable(40) %3)
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK8graphlab5timer12current_timeEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN8graphlab5timer5startEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK8graphlab11conditional6signalEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { inlinehint 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 = { 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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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, !20, i64 176}
!6 = !{!"_ZTSN8graphlab11unfair_lockE", !7, i64 0, !7, i64 40, !10, i64 80, !11, i64 88, !20, i64 136, !21, i64 144, !22, i64 152, !21, i64 160, !22, i64 168, !20, i64 176, !10, i64 184, !23, i64 192}
!7 = !{!"_ZTSN8graphlab5mutexE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"_ZTSSt3mapImPN8graphlab11conditionalESt4lessImESaISt4pairIKmS2_EEE", !12, i64 0}
!12 = !{!"_ZTSSt8_Rb_treeImSt4pairIKmPN8graphlab11conditionalEESt10_Select1stIS5_ESt4lessImESaIS5_EE", !13, i64 0}
!13 = !{!"_ZTSNSt8_Rb_treeImSt4pairIKmPN8graphlab11conditionalEESt10_Select1stIS5_ESt4lessImESaIS5_EE13_Rb_tree_implIS9_Lb1EEE", !14, i64 0, !16, i64 8}
!14 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessImEE", !15, i64 0}
!15 = !{!"_ZTSSt4lessImE"}
!16 = !{!"_ZTSSt15_Rb_tree_header", !17, i64 0, !20, i64 32}
!17 = !{!"_ZTSSt18_Rb_tree_node_base", !18, i64 0, !19, i64 8, !19, i64 16, !19, i64 24}
!18 = !{!"_ZTSSt14_Rb_tree_color", !8, i64 0}
!19 = !{!"any pointer", !8, i64 0}
!20 = !{!"long", !8, i64 0}
!21 = !{!"int", !8, i64 0}
!22 = !{!"double", !8, i64 0}
!23 = !{!"_ZTSN8graphlab5timerE", !24, i64 0}
!24 = !{!"_ZTS7timeval", !20, i64 0, !20, i64 8}
!25 = !{!6, !22, i64 168}
!26 = !{!6, !10, i64 184}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!6, !22, i64 152}
!30 = !{!6, !21, i64 144}
!31 = !{!6, !21, i64 160}
!32 = !{!33, !19, i64 8}
!33 = !{!"_ZTSSt4pairIKmPN8graphlab11conditionalEE", !20, i64 0, !19, i64 8}
!34 = !{!35, !20, i64 0}
!35 = !{!"_ZTSN8graphlab12_GLOBAL__N_120unfair_lock_priorityE", !20, i64 0, !36, i64 8}
!36 = !{!"_ZTSN8graphlab11conditionalE", !8, i64 0}
!37 = !{!6, !20, i64 136}
!38 = !{!6, !10, i64 80}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass