// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %rbx
movl (%rdi), %ecx
movl 0x118(%rdi), %edx
leaq 0x19a1b(%rip), %rsi     # 0x767a9
xorl %r15d, %r15d
movl $0x4, %edi
xorl %eax, %eax
callq 0x5342c
movl (%rbx), %eax
testl %eax, %eax
js 0x5cfab
jne 0x5cdc3
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x5c2b4
testl %eax, %eax
je 0x5cfab
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x5cf4d
movl 0x118(%rbx), %edx
leaq 0x19a14(%rip), %rsi     # 0x767ed
xorl %r15d, %r15d
movl $0x4, %edi
xorl %eax, %eax
callq 0x5342c
cmpl $0x0, 0x11c(%rbx)
js 0x5cfab
je 0x5ce0e
callq 0x4fece
subl 0x124(%rbx), %eax
cmpl 0x11c(%rbx), %eax
jl 0x5cfab
movl 0x118(%rbx), %r12d
leaq 0x108(%rbx), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movl %r12d, %edi
movl $0x3, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x83b0
orl $0x800, %eax            # imm = 0x800
movl %r12d, %edi
movl $0x4, %esi
movl %eax, %edx
xorl %eax, %eax
callq 0x83b0
movl %r12d, %edi
movq %r15, %rsi
movl $0x10, %edx
callq 0x8500
cmpl $-0x1, %eax
jne 0x5cf0f
callq 0x8070
movl (%rax), %r13d
leal -0x6a(%r13), %eax
cmpl $0x9, %eax
ja 0x5cfdd
movl $0x301, %ecx            # imm = 0x301
btl %eax, %ecx
jae 0x5cfdd
xorps %xmm0, %xmm0
leaq -0xc0(%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(%r12), %edx
testl %r12d, %r12d
cmovnsl %r12d, %edx
movl %edx, %esi
andl $-0x40, %esi
movl %r12d, %ecx
subl %esi, %ecx
movl $0x1, %esi
shlq %cl, %rsi
sarl $0x6, %edx
movslq %edx, %rcx
orq %rsi, -0xc0(%rbp,%rcx,8)
leaq -0x140(%rbp), %rdx
movl $0x10, %ecx
movq %rdx, %rdi
movq %rax, %rsi
rep  movsq (%rsi), %es:(%rdi)
incl %r12d
xorl %r15d, %r15d
leaq -0x40(%rbp), %r8
movl %r12d, %edi
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x85e0
testl %eax, %eax
je 0x5cfc0
leaq 0x4(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x85c0
movl 0x118(%rbx), %edx
leaq 0x1991c(%rip), %rsi     # 0x76847
movl $0x2, %edi
movq %r15, %rcx
xorl %eax, %eax
callq 0x5342c
movl $0x2, (%rbx)
callq 0x4fece
movl %eax, 0x120(%rbx)
movl (%rbx), %eax
movl $0x1, %r15d
cmpl $0x2, %eax
jne 0x5cfab
cmpl $0x0, 0x128(%rbx)
jle 0x5cfab
callq 0x4fece
subl 0x120(%rbx), %eax
cmpl 0x128(%rbx), %eax
jle 0x5cfab
movabsq $0x74756f656d6974, %rax # imm = 0x74756F656D6974
movq %rax, (%r14)
movl 0x118(%rbx), %edx
leaq 0x19839(%rip), %rsi     # 0x767c7
xorl %r15d, %r15d
movl $0x2, %edi
xorl %eax, %eax
callq 0x5342c
movl 0x12c(%rbx), %esi
movq %rbx, %rdi
callq 0x5cc1d
movl %r15d, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movabsq $0x2e2e2e676e6974, %rax # imm = 0x2E2E2E676E6974
movq %rax, 0x6(%r14)
movabsq $0x697463656e6e6f63, %rax # imm = 0x697463656E6E6F63
movq %rax, (%r14)
jmp 0x5cfab
leaq 0x1981b(%rip), %rsi     # 0x767ff
xorl %r15d, %r15d
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x8120
movl 0x118(%rbx), %edx
leaq 0x19811(%rip), %rsi     # 0x76812
movl $0x1, %edi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x5342c
movl 0x118(%rbx), %edi
callq 0x8c40
movl $0x0, (%rbx)
jmp 0x5cfab