// File: /workspace/github_cpp_makefile_star2_O2/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 0x18bba(%rip), %rsi     # 0x6c7e9
xorl %r15d, %r15d
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movl (%rbx), %eax
testl %eax, %eax
js 0x53e22
jne 0x53c60
pushq $0x1
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x53202
testl %eax, %eax
je 0x53e22
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x53dc8
movl 0x118(%rbx), %edx
leaq 0x18bb7(%rip), %rsi     # 0x6c82d
xorl %r15d, %r15d
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x4acf2
cmpl $0x0, 0x11c(%rbx)
js 0x53e22
je 0x53ca9
callq 0x47c01
subl 0x124(%rbx), %eax
cmpl 0x11c(%rbx), %eax
jl 0x53e22
movl 0x118(%rbx), %r12d
leaq 0x108(%rbx), %r15
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
pushq $0x3
popq %rsi
movl %r12d, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x83b0
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %r12d, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x83b0
pushq $0x10
popq %rdx
movl %r12d, %edi
movq %r15, %rsi
callq 0x8500
cmpl $-0x1, %eax
jne 0x53d8c
callq 0x533ff
movl %eax, %r13d
leal -0x6a(%r13), %eax
cmpl $0x9, %eax
ja 0x53e54
movl $0x301, %ecx            # imm = 0x301
btl %eax, %ecx
jae 0x53e54
xorl %eax, %eax
cmpq $0x10, %rax
je 0x53d31
andq $0x0, -0xc0(%rbp,%rax,8)
incq %rax
jmp 0x53d1d
pushq $0x40
popq %rcx
movl %r12d, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %r12d, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, -0xc0(%rbp,%rdx,8)
pushq $0x10
popq %rcx
leaq -0x140(%rbp), %rdx
leaq -0xc0(%rbp), %rax
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 0x53e37
leaq 0x4(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x85c0
movl 0x118(%rbx), %edx
leaq 0x18adf(%rip), %rsi     # 0x6c887
pushq $0x2
popq %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x4acf2
movl $0x2, (%rbx)
callq 0x47c01
movl %eax, 0x120(%rbx)
movl (%rbx), %eax
pushq $0x1
popq %r15
cmpl $0x2, %eax
jne 0x53e22
cmpl $0x0, 0x128(%rbx)
jle 0x53e22
callq 0x47c01
subl 0x120(%rbx), %eax
cmpl 0x128(%rbx), %eax
jle 0x53e22
movabsq $0x74756f656d6974, %rax # imm = 0x74756F656D6974
movq %rax, (%r14)
movl 0x118(%rbx), %edx
leaq 0x18a00(%rip), %rsi     # 0x6c807
xorl %r15d, %r15d
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movl 0x12c(%rbx), %esi
movq %rbx, %rdi
callq 0x53ac3
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 0x53e22
leaq 0x189e4(%rip), %rsi     # 0x6c83f
xorl %r15d, %r15d
movq %r14, %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x8110
movl 0x118(%rbx), %edx
leaq 0x189da(%rip), %rsi     # 0x6c852
pushq $0x1
popq %rdi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x4acf2
movl 0x118(%rbx), %edi
callq 0x8c70
andl $0x0, (%rbx)
jmp 0x53e22