// File: /workspace/github_cpp_makefile_star2_O3/roberty65[P]bServer/frame/main/Connector.cpp
// Function: beyondy::Async::Connector::sendMessage(beyondy::Async::Message*)
int Connector::sendMessage(Message *msg)
{
	if (status == CONN_CLOSE) {
		if (open() < 0) {
			SYSLOG_WARN("when sendMessage, open connector to %s failed", address);
			return -1;
		}

		SYSLOG_DEBUG("connector(%s) open OK when sendMessage", address);
	}

	if (status == CONN_OPENNING) {
		if (outQueue->size() >= (size_t)emgr->getConnectionOutQueueSize()) {
			SYSLOG_ERROR("connector fd=%d flow=%d sendMessge over-flow, out-queue-size=%ld", fd, flow, (long)outQueue->size());
			proc->onSent(msg, SS_QUEUE_FULL);
		}
		else {
			SYSLOG_DEBUG("connector(%s) is openning when sendMessage", address);
			outQueue->push_back(msg);
		}

		return 0;
	}

	assert(status == CONN_ESTABLISHED);
	SYSLOG_DEBUG("connector(%s) is established when sendMessage", address);

	return Connection::sendMessage(msg);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, (%rsp)
movl 0xb4(%rdi), %eax
testl %eax, %eax
jne 0x6bd0
movq %r14, %rdi
callq 0x6958
leaq 0x996b(%rip), %rcx      # 0x10508
movq (%rcx), %rdi
movl (%rdi), %ecx
testl %eax, %eax
js 0x6cf9
cmpl $0x5, %ecx
jl 0x6bc9
leaq 0xb8(%r14), %rcx
leaq 0x4515(%rip), %rdx      # 0xb0d2
movl $0x5, %esi
xorl %eax, %eax
callq 0x71fc
movl 0xb4(%r14), %eax
cmpl $0x2, %eax
je 0x6c87
cmpl $0x1, %eax
jne 0x6d36
movq 0x68(%r14), %rdi
movq 0x70(%r14), %rax
movq 0x48(%rdi), %rcx
movq %rcx, %rdx
subq 0x28(%rdi), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
shlq $0x6, %rdx
movq 0x30(%rdi), %rcx
movq %rcx, %rsi
subq 0x38(%rdi), %rsi
movq 0x20(%rdi), %r9
sarq $0x3, %rsi
subq 0x10(%rdi), %r9
sarq $0x3, %r9
addq %rsi, %r9
addq %rdx, %r9
movslq 0x64(%rax), %rsi
leaq 0x98d7(%rip), %rax      # 0x10508
movq (%rax), %rax
movl (%rax), %edx
cmpq %rsi, %r9
jae 0x6cc2
cmpl $0x5, %edx
jl 0x6c69
leaq 0xb8(%r14), %rcx
leaq 0x44e8(%rip), %rdx      # 0xb13a
movq %rax, %rdi
movl $0x5, %esi
xorl %eax, %eax
callq 0x71fc
movq 0x68(%r14), %rdi
movq 0x30(%rdi), %rcx
movq 0x40(%rdi), %rax
addq $-0x8, %rax
cmpq %rax, %rcx
je 0x6d22
movq %rbx, (%rcx)
addq $0x8, 0x30(%rdi)
jmp 0x6d2a
leaq 0x987a(%rip), %rax      # 0x10508
movq (%rax), %rdi
cmpl $0x5, (%rdi)
jl 0x6cb0
leaq 0xb8(%r14), %rcx
leaq 0x451a(%rip), %rdx      # 0xb1be
movl $0x5, %esi
xorl %eax, %eax
callq 0x71fc
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6376
cmpl $0x2, %edx
jl 0x6ce5
movl 0x8(%r14), %ecx
movl 0x10(%r14), %r8d
leaq 0x4423(%rip), %rdx      # 0xb0f9
movq %rax, %rdi
movl $0x2, %esi
xorl %eax, %eax
callq 0x71fc
movq 0x78(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
movl $0x3, %edx
callq *0x38(%rax)
jmp 0x6d2a
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $0x3, %ecx
jl 0x6d2c
addq $0xb8, %r14
leaq 0x4393(%rip), %rdx      # 0xb0a4
movl $0x3, %esi
movq %r14, %rcx
xorl %eax, %eax
callq 0x71fc
jmp 0x6d2c
movq %rsp, %rsi
callq 0x5952
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4428(%rip), %rdi      # 0xb165
leaq 0x41f4(%rip), %rsi      # 0xaf38
leaq 0x4435(%rip), %rcx      # 0xb180
movl $0x95, %edx
callq 0x31f0
nop