; LLVM IR from turi-code/SFrame :: oss_src/rpc (dc_tcp_comm)

; 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.graphlab::dc_impl::dc_tcp_comm::socket_info" = type { i64, ptr, i32, i32, ptr, ptr, i8, %"class.graphlab::mutex", %"struct.graphlab::dc_impl::circular_iovec_buffer", %struct.msghdr }
%"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 }
%"struct.graphlab::dc_impl::circular_iovec_buffer" = type { %"class.std::vector.34", %"class.std::vector.34", i64, i64, i64 }
%"class.std::vector.34" = type { %"struct.std::_Vector_base.35" }
%"struct.std::_Vector_base.35" = type { %"struct.std::_Vector_base<iovec, std::allocator<iovec>>::_Vector_impl" }
%"struct.std::_Vector_base<iovec, std::allocator<iovec>>::_Vector_impl" = type { %"struct.std::_Vector_base<iovec, std::allocator<iovec>>::_Vector_impl_data" }
%"struct.std::_Vector_base<iovec, std::allocator<iovec>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.msghdr = type { ptr, i32, ptr, i64, ptr, i64, i32 }
%"class.graphlab::dc_impl::dc_tcp_comm" = type <{ %"class.graphlab::dc_impl::dc_comm_base", i16, i16, i8, [3 x i8], %"class.std::__cxx11::basic_string", %"class.std::vector.8", %"class.std::map", %"class.std::vector.16", %"class.std::vector", %"class.std::vector.0", %"class.graphlab::atomic", %"class.graphlab::mutex", %"class.graphlab::conditional", %"class.std::vector.21", %"class.graphlab::atomic", %"class.graphlab::atomic", %"class.graphlab::thread_group", ptr, %"class.graphlab::thread_group", ptr, ptr, ptr, %"struct.graphlab::dc_impl::dc_tcp_comm::timeout_event", %"struct.graphlab::dc_impl::dc_tcp_comm::timeout_event", %"class.graphlab::fixed_dense_bitset", i32, [4 x i8], %"class.graphlab::thread", i8, [7 x i8] }>
%"class.graphlab::dc_impl::dc_comm_base" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned short>, std::_Select1st<std::pair<const unsigned int, unsigned short>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned short>, std::_Select1st<std::pair<const unsigned int, unsigned short>>, std::less<unsigned int>>::_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.std::vector.16" = type { %"struct.std::_Vector_base.17" }
%"struct.std::_Vector_base.17" = type { %"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<graphlab::dc_impl::dc_receive *, std::allocator<graphlab::dc_impl::dc_receive *>>::_Vector_impl" }
%"struct.std::_Vector_base<graphlab::dc_impl::dc_receive *, std::allocator<graphlab::dc_impl::dc_receive *>>::_Vector_impl" = type { %"struct.std::_Vector_base<graphlab::dc_impl::dc_receive *, std::allocator<graphlab::dc_impl::dc_receive *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<graphlab::dc_impl::dc_receive *, std::allocator<graphlab::dc_impl::dc_receive *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<graphlab::dc_impl::dc_send *, std::allocator<graphlab::dc_impl::dc_send *>>::_Vector_impl" }
%"struct.std::_Vector_base<graphlab::dc_impl::dc_send *, std::allocator<graphlab::dc_impl::dc_send *>>::_Vector_impl" = type { %"struct.std::_Vector_base<graphlab::dc_impl::dc_send *, std::allocator<graphlab::dc_impl::dc_send *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<graphlab::dc_impl::dc_send *, std::allocator<graphlab::dc_impl::dc_send *>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"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 }
%"class.std::vector.21" = type { %"struct.std::_Vector_base.22" }
%"struct.std::_Vector_base.22" = type { %"struct.std::_Vector_base<graphlab::dc_impl::dc_tcp_comm::socket_info, std::allocator<graphlab::dc_impl::dc_tcp_comm::socket_info>>::_Vector_impl" }
%"struct.std::_Vector_base<graphlab::dc_impl::dc_tcp_comm::socket_info, std::allocator<graphlab::dc_impl::dc_tcp_comm::socket_info>>::_Vector_impl" = type { %"struct.std::_Vector_base<graphlab::dc_impl::dc_tcp_comm::socket_info, std::allocator<graphlab::dc_impl::dc_tcp_comm::socket_info>>::_Vector_impl_data" }
%"struct.std::_Vector_base<graphlab::dc_impl::dc_tcp_comm::socket_info, std::allocator<graphlab::dc_impl::dc_tcp_comm::socket_info>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.graphlab::atomic" = type { %"class.graphlab::graphlab_impl::atomic_impl" }
%"class.graphlab::graphlab_impl::atomic_impl" = type { i64 }
%"class.graphlab::thread_group" = type { i64, i64, %"class.graphlab::mutex", %"class.graphlab::conditional", %"class.std::queue" }
%"class.std::queue" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<unsigned long, const char *>, std::allocator<std::pair<unsigned long, const char *>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.graphlab::dc_impl::dc_tcp_comm::timeout_event" = type { i8, ptr }
%"class.graphlab::fixed_dense_bitset" = type { [4 x i64] }
%"class.graphlab::thread" = type <{ i64, i64, i64, i8, [7 x i8] }>

@.str.6 = external hidden unnamed_addr constant [78 x i8], align 1
@__func__._ZN8graphlab7dc_impl11dc_tcp_comm15send_till_blockERNS1_11socket_infoE = external hidden unnamed_addr constant [16 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [13 x i8], align 1

; 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 noundef nonnull align 8 dereferenceable(896) ptr @_Z13global_loggerv() #1

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN19log_stream_dispatchILb1EE4execEiPKcS2_ib(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPKc(ptr noundef nonnull align 8 dereferenceable(896), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPFRSoS0_E(ptr noundef nonnull align 8 dereferenceable(896), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8graphlab7dc_impl21circular_iovec_buffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(72)) #4 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8graphlab7dc_impl11dc_tcp_comm15send_till_blockERNS1_11socket_infoE(ptr noundef nonnull align 8 dereferenceable(833) %0, ptr noundef nonnull align 8 dereferenceable(216) %1) #5 align 2 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %9, i32 0, i32 6
  store i8 0, ptr %10, align 8, !tbaa !9
  br label %11

11:                                               ; preds = %62, %2
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %12, i32 0, i32 8
  %14 = call noundef zeroext i1 @_ZNK8graphlab7dc_impl21circular_iovec_buffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(72) %13)
  %15 = xor i1 %14, true
  br i1 %15, label %16, label %63

16:                                               ; preds = %11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %17, i32 0, i32 8
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %19, i32 0, i32 9
  call void @_ZN8graphlab7dc_impl21circular_iovec_buffer11fill_msghdrER6msghdr(ptr noundef nonnull align 8 dereferenceable(72) %18, ptr noundef nonnull align 8 dereferenceable(56) %20)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %21, i32 0, i32 2
  %23 = load i32, ptr %22, align 8, !tbaa !21
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %24, i32 0, i32 9
  %26 = call i64 @sendmsg(i32 noundef %23, ptr noundef %25, i32 noundef 0)
  store i64 %26, ptr %6, align 8, !tbaa !22
  %27 = load i64, ptr %6, align 8, !tbaa !22
  %28 = icmp slt i64 %27, 0
  br i1 %28, label %29, label %53

29:                                               ; preds = %16
  %30 = call ptr @__errno_location() #10
  %31 = load i32, ptr %30, align 4, !tbaa !23
  %32 = icmp eq i32 %31, 11
  br i1 %32, label %37, label %33

33:                                               ; preds = %29
  %34 = call ptr @__errno_location() #10
  %35 = load i32, ptr %34, align 4, !tbaa !23
  %36 = icmp eq i32 %35, 11
  br i1 %36, label %37, label %40

37:                                               ; preds = %33, %29
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %38, i32 0, i32 6
  store i8 1, ptr %39, align 8, !tbaa !9
  store i1 false, ptr %3, align 1
  store i32 1, ptr %7, align 4
  br label %60

40:                                               ; preds = %33
  %41 = call noundef nonnull align 8 dereferenceable(896) ptr @_Z13global_loggerv()
  %42 = call noundef i32 @_ZN11file_logger13get_log_levelEv(ptr noundef nonnull align 8 dereferenceable(896) %41)
  %43 = icmp sge i32 5, %42
  br i1 %43, label %44, label %52

44:                                               ; preds = %40
  %45 = call noundef nonnull align 8 dereferenceable(896) ptr @_ZN19log_stream_dispatchILb1EE4execEiPKcS2_ib(i32 noundef 5, ptr noundef @.str.6, ptr noundef @__func__._ZN8graphlab7dc_impl11dc_tcp_comm15send_till_blockERNS1_11socket_infoE, i32 noundef 338, i1 noundef zeroext true)
  %46 = call noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPKc(ptr noundef nonnull align 8 dereferenceable(896) %45, ptr noundef @.str.18)
  %47 = call ptr @__errno_location() #10
  %48 = load i32, ptr %47, align 4, !tbaa !23
  %49 = call ptr @strerror(i32 noundef %48) #9
  %50 = call noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsIPcEERS_T_(ptr noundef nonnull align 8 dereferenceable(896) %46, ptr noundef %49)
  %51 = call noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPFRSoS0_E(ptr noundef nonnull align 8 dereferenceable(896) %50, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %52

52:                                               ; preds = %44, %40
  call void @abort() #11
  unreachable

53:                                               ; preds = %16
  %54 = getelementptr inbounds %"class.graphlab::dc_impl::dc_tcp_comm", ptr %8, i32 0, i32 15
  %55 = load i64, ptr %6, align 8, !tbaa !22
  %56 = call noundef i64 @_ZN8graphlab13graphlab_impl11atomic_implImLb1EE3incEm(ptr noundef nonnull align 8 dereferenceable(8) %54, i64 noundef %55)
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %"struct.graphlab::dc_impl::dc_tcp_comm::socket_info", ptr %57, i32 0, i32 8
  %59 = load i64, ptr %6, align 8, !tbaa !22
  call void @_ZN8graphlab7dc_impl21circular_iovec_buffer4sentEm(ptr noundef nonnull align 8 dereferenceable(72) %58, i64 noundef %59)
  store i32 0, ptr %7, align 4
  br label %60

60:                                               ; preds = %53, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  %61 = load i32, ptr %7, align 4
  switch i32 %61, label %66 [
    i32 0, label %62
    i32 1, label %64
  ]

62:                                               ; preds = %60
  br label %11, !llvm.loop !24

63:                                               ; preds = %11
  store i1 true, ptr %3, align 1
  br label %64

64:                                               ; preds = %63, %60
  %65 = load i1, ptr %3, align 1
  ret i1 %65

66:                                               ; preds = %60
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab7dc_impl21circular_iovec_buffer11fill_msghdrER6msghdr(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(56)) #5 align 2

declare i64 @sendmsg(i32 noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #6

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsIPcEERS_T_(ptr noundef nonnull align 8 dereferenceable(896), ptr noundef) #5 align 2

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #7

; Function Attrs: noreturn nounwind
declare void @abort() #8

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab7dc_impl21circular_iovec_buffer4sentEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) #5 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #3 = { 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 #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 = { 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 #6 = { nounwind willreturn memory(none) "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 #7 = { 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 #8 = { noreturn 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { noreturn 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, !13, i64 40}
!10 = !{!"_ZTSN8graphlab7dc_impl11dc_tcp_comm11socket_infoE", !11, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !6, i64 24, !6, i64 32, !13, i64 40, !14, i64 48, !15, i64 88, !20, i64 160}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN8graphlab5mutexE", !7, i64 0}
!15 = !{!"_ZTSN8graphlab7dc_impl21circular_iovec_bufferE", !16, i64 0, !16, i64 24, !11, i64 48, !11, i64 56, !11, i64 64}
!16 = !{!"_ZTSSt6vectorI5iovecSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseI5iovecSaIS0_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI5iovecSaIS0_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseI5iovecSaIS0_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTS6msghdr", !6, i64 0, !12, i64 8, !6, i64 16, !11, i64 24, !6, i64 32, !11, i64 40, !12, i64 48}
!21 = !{!10, !12, i64 16}
!22 = !{!11, !11, i64 0}
!23 = !{!12, !12, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"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"

@.str.6 = external hidden unnamed_addr constant [78 x i8], align 1
@__func__._ZN8graphlab7dc_impl11dc_tcp_comm15send_till_blockERNS1_11socket_infoE = external hidden unnamed_addr constant [16 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [13 x i8], align 1

declare noundef nonnull align 8 dereferenceable(896) ptr @_Z13global_loggerv() local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN19log_stream_dispatchILb1EE4execEiPKcS2_ib(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPKc(ptr noundef nonnull align 8 dereferenceable(896), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPFRSoS0_E(ptr noundef nonnull align 8 dereferenceable(896), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8graphlab7dc_impl21circular_iovec_buffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(72)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN8graphlab7dc_impl11dc_tcp_comm15send_till_blockERNS1_11socket_infoE(ptr noundef nonnull align 8 dereferenceable(833) %0, ptr noundef nonnull align 8 dereferenceable(216) %1) local_unnamed_addr #4 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 40
  store i8 0, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %1, i64 88
  %5 = tail call noundef zeroext i1 @_ZNK8graphlab7dc_impl21circular_iovec_buffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(72) %4)
  br i1 %5, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %6 = getelementptr inbounds i8, ptr %1, i64 160
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 312
  br label %9

9:                                                ; preds = %.lr.ph, %29
  tail call void @_ZN8graphlab7dc_impl21circular_iovec_buffer11fill_msghdrER6msghdr(ptr noundef nonnull align 8 dereferenceable(72) %4, ptr noundef nonnull align 8 dereferenceable(56) %6)
  %10 = load i32, ptr %7, align 8, !tbaa !20
  %11 = tail call i64 @sendmsg(i32 noundef %10, ptr noundef nonnull %6, i32 noundef 0)
  %12 = icmp slt i64 %11, 0
  br i1 %12, label %13, label %29

13:                                               ; preds = %9
  %14 = tail call ptr @__errno_location() #8
  %15 = load i32, ptr %14, align 4, !tbaa !21
  %16 = icmp eq i32 %15, 11
  br i1 %16, label %.thread, label %17

.thread:                                          ; preds = %13
  store i8 1, ptr %3, align 8, !tbaa !5
  br label %.loopexit

17:                                               ; preds = %13
  %18 = tail call noundef nonnull align 8 dereferenceable(896) ptr @_Z13global_loggerv()
  %19 = tail call noundef i32 @_ZN11file_logger13get_log_levelEv(ptr noundef nonnull align 8 dereferenceable(896) %18)
  %20 = icmp slt i32 %19, 6
  br i1 %20, label %21, label %28

21:                                               ; preds = %17
  %22 = tail call noundef nonnull align 8 dereferenceable(896) ptr @_ZN19log_stream_dispatchILb1EE4execEiPKcS2_ib(i32 noundef 5, ptr noundef nonnull @.str.6, ptr noundef nonnull @__func__._ZN8graphlab7dc_impl11dc_tcp_comm15send_till_blockERNS1_11socket_infoE, i32 noundef 338, i1 noundef zeroext true)
  %23 = tail call noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPKc(ptr noundef nonnull align 8 dereferenceable(896) %22, ptr noundef nonnull @.str.18)
  %24 = load i32, ptr %14, align 4, !tbaa !21
  %25 = tail call ptr @strerror(i32 noundef %24) #9
  %26 = tail call noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsIPcEERS_T_(ptr noundef nonnull align 8 dereferenceable(896) %23, ptr noundef %25)
  %27 = tail call noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsEPFRSoS0_E(ptr noundef nonnull align 8 dereferenceable(896) %26, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %28

28:                                               ; preds = %21, %17
  tail call void @abort() #10
  unreachable

29:                                               ; preds = %9
  %30 = tail call noundef i64 @_ZN8graphlab13graphlab_impl11atomic_implImLb1EE3incEm(ptr noundef nonnull align 8 dereferenceable(8) %8, i64 noundef %11)
  tail call void @_ZN8graphlab7dc_impl21circular_iovec_buffer4sentEm(ptr noundef nonnull align 8 dereferenceable(72) %4, i64 noundef %11)
  %31 = tail call noundef zeroext i1 @_ZNK8graphlab7dc_impl21circular_iovec_buffer5emptyEv(ptr noundef nonnull align 8 dereferenceable(72) %4)
  br i1 %31, label %.loopexit, label %9

.loopexit:                                        ; preds = %29, %2, %.thread
  %32 = phi i1 [ false, %.thread ], [ true, %2 ], [ true, %29 ]
  ret i1 %32
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab7dc_impl21circular_iovec_buffer11fill_msghdrER6msghdr(ptr noundef nonnull align 8 dereferenceable(72), ptr noundef nonnull align 8 dereferenceable(56)) local_unnamed_addr #4 align 2

declare i64 @sendmsg(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(896) ptr @_ZN11file_loggerlsIPcEERS_T_(ptr noundef nonnull align 8 dereferenceable(896), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #6

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #7

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab7dc_impl21circular_iovec_buffer4sentEm(ptr noundef nonnull align 8 dereferenceable(72), i64 noundef) local_unnamed_addr #4 align 2

attributes #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 = { 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 = { 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 = { 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 #5 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 "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 #7 = { noreturn 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 #8 = { nounwind willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { noreturn 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, !12, i64 40}
!6 = !{!"_ZTSN8graphlab7dc_impl11dc_tcp_comm11socket_infoE", !7, i64 0, !10, i64 8, !11, i64 16, !11, i64 20, !10, i64 24, !10, i64 32, !12, i64 40, !13, i64 48, !14, i64 88, !19, i64 160}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"bool", !8, i64 0}
!13 = !{!"_ZTSN8graphlab5mutexE", !8, i64 0}
!14 = !{!"_ZTSN8graphlab7dc_impl21circular_iovec_bufferE", !15, i64 0, !15, i64 24, !7, i64 48, !7, i64 56, !7, i64 64}
!15 = !{!"_ZTSSt6vectorI5iovecSaIS0_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseI5iovecSaIS0_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseI5iovecSaIS0_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseI5iovecSaIS0_EE17_Vector_impl_dataE", !10, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!"_ZTS6msghdr", !10, i64 0, !11, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !11, i64 48}
!20 = !{!6, !11, i64 16}
!21 = !{!11, !11, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass