// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::waittcpcli(bamboo::tcpcli_t*, char*)
static int waittcpcli(tcpcli_t *tcpcli, char *msg)
	{
		tracet(4, "waittcpcli: sock=%d state=%d\n", tcpcli->svr.sock, tcpcli->svr.state);

		if (tcpcli->svr.state < 0) return 0;

		if (tcpcli->svr.state == 0) { /* close */
			if (!gentcp(&tcpcli->svr, 1, msg)) return 0;
		}
		if (tcpcli->svr.state == 1) { /* wait */
			if (!consock(tcpcli, msg)) return 0;
		}
		if (tcpcli->svr.state == 2) { /* connect */
			if (tcpcli->toinact > 0 &&
				(int)(tickget() - tcpcli->svr.tact) > tcpcli->toinact) {
				sprintf(msg, "timeout");
				tracet(2, "waittcpcli: inactive timeout sock=%d\n", tcpcli->svr.sock);
				discontcp(&tcpcli->svr, tcpcli->tirecon);
				return 0;
			}
		}
		return 1;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %ecx
movl 0x118(%rdi), %edx
leaq 0x18f54(%rip), %rsi     # 0x76824
xorl %r15d, %r15d
movl $0x4, %edi
xorl %eax, %eax
callq 0x53ec4
cmpl $0x0, (%rbx)
js 0x5db6c
jne 0x5d902
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x5cdef
testl %eax, %eax
je 0x5db6c
cmpl $0x1, (%rbx)
jne 0x5db0e
movl 0x118(%rbx), %edx
leaq 0x18f50(%rip), %rsi     # 0x76868
xorl %r15d, %r15d
movl $0x4, %edi
xorl %eax, %eax
callq 0x53ec4
cmpl $0x0, 0x11c(%rbx)
js 0x5db6c
je 0x5d94d
callq 0x5088f
subl 0x124(%rbx), %eax
cmpl 0x11c(%rbx), %eax
jl 0x5db6c
movl 0x118(%rbx), %r15d
leaq 0x108(%rbx), %r12
xorps %xmm0, %xmm0
movaps %xmm0, -0x30(%rbp)
movl %r15d, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x83b0
orl $0x800, %eax            # imm = 0x800
movl %r15d, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x83b0
movl %r15d, %edi
movq %r12, %rsi
movl $0x10, %edx
callq 0x8500
cmpl $-0x1, %eax
jne 0x5da4d
callq 0x8070
movl (%rax), %eax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
addl $-0x6a, %eax
cmpl $0x9, %eax
ja 0x5da53
movl $0x301, %ecx            # imm = 0x301
btl %eax, %ecx
jae 0x5da53
xorps %xmm0, %xmm0
leaq -0xb0(%rbp), %rax
movaps %xmm0, 0x70(%rax)
movaps %xmm0, 0x60(%rax)
movaps %xmm0, 0x50(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, (%rax)
leal 0x3f(%r15), %edx
testl %r15d, %r15d
cmovnsl %r15d, %edx
movl %edx, %esi
andl $-0x40, %esi
movl %r15d, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
sarl $0x6, %edx
movslq %edx, %rcx
orq %rsi, -0xb0(%rbp,%rcx,8)
leaq -0x130(%rbp), %rdx
movl $0x10, %ecx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
incl %r15d
xorl %r12d, %r12d
leaq -0x30(%rbp), %r8
movl %r15d, %edi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x85e0
testl %eax, %eax
je 0x5da53
movl $0x1, %r12d
testl %r12d, %r12d
je 0x5daaf
cmpl $-0x1, %r12d
jne 0x5dad2
callq 0x8070
movl (%rax), %r12d
leaq 0x18e0d(%rip), %rsi     # 0x7687a
xorl %r15d, %r15d
movq %r14, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x8120
movl 0x118(%rbx), %edx
leaq 0x18e03(%rip), %rsi     # 0x7688d
movl $0x1, %edi
movl %r12d, %ecx
xorl %eax, %eax
callq 0x53ec4
movl 0x118(%rbx), %edi
callq 0x8c50
movl $0x0, (%rbx)
jmp 0x5db6c
movabsq $0x2e2e2e676e6974, %rax # imm = 0x2E2E2E676E6974
movq %rax, 0x6(%r14)
movabsq $0x697463656e6e6f63, %rax # imm = 0x697463656E6E6F63
movq %rax, (%r14)
xorl %r15d, %r15d
jmp 0x5db6c
leaq 0x4(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x85c0
movl 0x118(%rbx), %edx
leaq 0x18dd4(%rip), %rsi     # 0x768c2
movl $0x2, %edi
movq %r15, %rcx
xorl %eax, %eax
callq 0x53ec4
movl $0x2, (%rbx)
callq 0x5088f
movl %eax, 0x120(%rbx)
movl $0x1, %r15d
cmpl $0x2, (%rbx)
jne 0x5db6c
cmpl $0x0, 0x128(%rbx)
jle 0x5db6c
callq 0x5088f
subl 0x120(%rbx), %eax
cmpl 0x128(%rbx), %eax
jle 0x5db6c
movabsq $0x74756f656d6974, %rax # imm = 0x74756F656D6974
movq %rax, (%r14)
movl 0x118(%rbx), %edx
leaq 0x18cf3(%rip), %rsi     # 0x76842
xorl %r15d, %r15d
movl $0x2, %edi
xorl %eax, %eax
callq 0x53ec4
movl 0x12c(%rbx), %esi
movq %rbx, %rdi
callq 0x5d761
movl %r15d, %eax
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq