// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::wait_ntripc(bamboo::ntripc_t*, char*)
static void wait_ntripc(ntripc_t *ntripc, char *msg)
	{
		unsigned char *buff;
		int i, n, nmax, err;

		tracet(4, "wait_ntripc\n");

		ntripc->state = ntripc->tcp->svr.state;

		if (!waittcpsvr(ntripc->tcp, msg)) return;

		for (i = 0; i < MAXCLI; i++) {
			if (ntripc->tcp->cli[i].state != 2 || ntripc->con[i].state) continue;

			/* receive ntrip-caster request */
			buff = ntripc->con[i].buff + ntripc->con[i].nb;
			nmax = NTRIP_MAXRSP - ntripc->con[i].nb - 1;

			if ((n = recv_nb(ntripc->tcp->cli[i].sock, buff, nmax)) == -1) {
				if ((err = errsock())) {
					tracet(1, "accept_ntripc: recv error sock=%d err=%d\n",
						ntripc->tcp->cli[i].sock, err);
				}
				discon_ntripc(ntripc, i);
				continue;
			}
			if (n <= 0) continue;

			/* test ntrip-caster request */
			ntripc->con[i].nb += n;
			if (ntripc->type) {
				rsp_ntripc_c(ntripc, i);
			}
			else {
				rsp_ntripc_s(ntripc, i);
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x938, %rsp            # imm = 0x938
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x185fc(%rip), %rsi     # 0x6cc80
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x4acf2
movq 0x338(%rbx), %rdi
movl (%rdi), %eax
movl %eax, (%rbx)
movq %r14, %rsi
callq 0x53819
testl %eax, %eax
je 0x54ed2
leaq 0x340(%rbx), %r14
leaq 0x208(%rbx), %rcx
leaq 0x108(%rbx), %rax
movq %rax, -0x50(%rbp)
leaq 0x310(%rbx), %rax
movq %rax, -0x48(%rbp)
leaq 0x344(%rbx), %rax
movq %rax, -0x58(%rbp)
xorl %r12d, %r12d
movq %r14, -0x30(%rbp)
movq %rcx, -0x40(%rbp)
cmpq $0x100, %r12            # imm = 0x100
je 0x54ed2
movq 0x338(%rbx), %rax
imulq $0x128, %r12, %r15      # imm = 0x128
cmpl $0x2, 0x128(%rax,%r15)
jne 0x54b21
imulq $0x820c, %r12, %r13     # imm = 0x820C
cmpl $0x0, (%r14,%r13)
jne 0x54b21
movl $0x128, %ecx            # imm = 0x128
addq %r15, %rcx
addq %rcx, %rax
addq %r14, %r13
movslq 0x204(%r13), %rcx
leaq (%rcx,%r13), %rsi
addq $0x208, %rsi            # imm = 0x208
movl $0x7fff, %edx           # imm = 0x7FFF
subl %ecx, %edx
movl 0x118(%rax), %edi
callq 0x53a26
cmpl $-0x1, %eax
je 0x54817
testl %eax, %eax
jle 0x54b21
addl %eax, 0x204(%r13)
leaq 0x208(%r13), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, 0x4(%rbx)
je 0x5484b
movl $0x100, %edx            # imm = 0x100
leaq -0x160(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
movl $0x100, %edx            # imm = 0x100
leaq -0x260(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
movl $0x100, %edx            # imm = 0x100
leaq -0x860(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
pushq $0x3
popq %rdi
leaq 0x18512(%rip), %rsi     # 0x6ccd3
movl %r12d, %edx
xorl %eax, %eax
callq 0x4acf2
movslq 0x204(%r13), %rax
movb $0x0, 0x208(%r13,%rax)
movl 0x204(%r13), %edx
pushq $0x5
popq %rdi
leaq 0x184f9(%rip), %rsi     # 0x6cce5
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x4acf2
cmpl $0x7fff, 0x204(%r13) # imm = 0x7FFF
jl 0x548f6
pushq $0x1
popq %rdi
leaq 0x184ef(%rip), %rsi     # 0x6cd01
jmp 0x548df
callq 0x533ff
testl %eax, %eax
je 0x548e6
movq 0x338(%rbx), %rcx
movl 0x240(%rcx,%r15), %edx
pushq $0x1
popq %rdi
leaq 0x18450(%rip), %rsi     # 0x6cc8d
movl %eax, %ecx
xorl %eax, %eax
callq 0x4acf2
jmp 0x548e6
movl $0x100, %edx            # imm = 0x100
leaq -0x760(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
movl $0x100, %edx            # imm = 0x100
leaq -0x160(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
movl $0x100, %edx            # imm = 0x100
leaq -0x260(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
pushq $0x3
popq %rdi
leaq 0x185fb(%rip), %rsi     # 0x6ce89
movl %r12d, %edx
xorl %eax, %eax
callq 0x4acf2
movslq 0x204(%r13), %rax
movb $0x0, 0x208(%r13,%rax)
movl 0x204(%r13), %edx
pushq $0x5
popq %rdi
leaq 0x185e2(%rip), %rsi     # 0x6ce9b
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x4acf2
cmpl $0x7fff, 0x204(%r13) # imm = 0x7FFF
jl 0x549a1
pushq $0x1
popq %rdi
leaq 0x185d9(%rip), %rsi     # 0x6ceb8
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
movl %r12d, %esi
callq 0x54ee4
jmp 0x54b21
movq -0x38(%rbp), %rdi
leaq 0x18427(%rip), %rsi     # 0x6cd28
callq 0x8170
testq %rax, %rax
je 0x54992
movq %rax, %r14
movq %rax, %rdi
leaq 0x1853b(%rip), %rsi     # 0x6ce57
callq 0x8170
testq %rax, %rax
je 0x54992
movq %rax, %rdi
leaq 0x183fc(%rip), %rsi     # 0x6cd2c
callq 0x8170
testq %rax, %rax
je 0x54992
movq %rax, %rdi
leaq 0x18513(%rip), %rsi     # 0x6ce57
callq 0x8170
testq %rax, %rax
je 0x54992
movq %r14, %rdi
leaq 0x18403(%rip), %rsi     # 0x6cd5b
leaq -0x160(%rbp), %rdx
leaq -0x860(%rbp), %r14
movq %r14, %rcx
xorl %eax, %eax
callq 0x8600
cmpl $0x1, %eax
jg 0x54b29
pushq $0x2
popq %rdi
leaq 0x183e8(%rip), %rsi     # 0x6cd6b
movq %r14, %rdx
xorl %eax, %eax
callq 0x4acf2
jmp 0x54b12
pushq $0x2
popq %rdi
leaq 0x1839c(%rip), %rsi     # 0x6cd38
jmp 0x54b0b
movq -0x38(%rbp), %rdi
leaq 0x18532(%rip), %rsi     # 0x6cede
callq 0x8170
testq %rax, %rax
je 0x54b01
movq %rax, %r14
movq %rax, %rdi
leaq 0x18490(%rip), %rsi     # 0x6ce57
callq 0x8170
testq %rax, %rax
je 0x54b01
movq %rax, %rdi
leaq 0x18506(%rip), %rsi     # 0x6cee5
callq 0x8170
testq %rax, %rax
je 0x54b01
movq %rax, %rdi
leaq 0x1845e(%rip), %rsi     # 0x6ce55
callq 0x8170
testq %rax, %rax
je 0x54b01
movq %r14, %rdi
leaq 0x18507(%rip), %rsi     # 0x6cf16
leaq -0x760(%rbp), %rdx
leaq -0x160(%rbp), %rcx
xorl %eax, %eax
callq 0x8600
movq -0x38(%rbp), %rdi
leaq 0x184fa(%rip), %rsi     # 0x6cf29
callq 0x8170
testq %rax, %rax
je 0x54a83
movq %rax, %r14
movq %rax, %rdi
leaq 0x18411(%rip), %rsi     # 0x6ce57
callq 0x8170
testq %rax, %rax
je 0x54a83
addq $0x5, %r14
subq %r14, %rax
movl $0xff, %ecx
cmpq %rcx, %rax
cmovgeq %rcx, %rax
cltq
leaq -0x260(%rbp), %rdi
movq %r14, %rsi
movq %rax, %r14
movq %rax, %rdx
callq 0x8360
movb $0x0, -0x260(%rbp,%r14)
cmpb $0x0, -0x160(%rbp)
movq -0x30(%rbp), %r14
je 0x54d83
movq %rbx, %rdi
leaq -0x160(%rbp), %rsi
callq 0x54f4d
testl %eax, %eax
je 0x54d83
movq -0x40(%rbp), %rsi
cmpb $0x0, (%rsi)
je 0x54db7
leaq -0x760(%rbp), %rdi
callq 0x8890
testl %eax, %eax
je 0x54db7
pushq $0x2
popq %rdi
leaq 0x18476(%rip), %rsi     # 0x6cf4c
leaq -0x760(%rbp), %rdx
xorl %eax, %eax
callq 0x4acf2
movq 0x338(%rbx), %rax
movl 0x240(%rax,%r15), %edi
leaq 0x18379(%rip), %rsi     # 0x6ce73
pushq $0x15
jmp 0x54dac
pushq $0x2
popq %rdi
leaq 0x183e8(%rip), %rsi     # 0x6cef3
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
movl %r12d, %esi
callq 0x54ee4
movq -0x30(%rbp), %r14
incq %r12
jmp 0x546e3
leaq -0x160(%rbp), %rdi
pushq $0x2f
popq %rsi
callq 0x8250
testq %rax, %rax
leaq -0x260(%rbp), %r14
je 0x54c47
incq %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x85c0
cmpb $0x0, -0x260(%rbp)
je 0x54c47
movq %rbx, %rdi
movq %r14, %rsi
callq 0x54f4d
testl %eax, %eax
je 0x54c47
movq -0x40(%rbp), %rax
cmpb $0x0, (%rax)
je 0x54e4c
leaq -0x960(%rbp), %r14
movq %r14, %rdi
leaq 0x17780(%rip), %rsi     # 0x6c314
movq -0x50(%rbp), %rdx
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x8110
movabsq $0x20636973614220, %rax # imm = 0x20636973614220
movq %rax, -0x352(%rbp)
movups 0x17e2d(%rip), %xmm0    # 0x6c9e8
movaps %xmm0, -0x360(%rbp)
movq %r14, %rdi
callq 0x8290
leaq -0x34b(%rbp), %rdi
movq %r14, %rsi
movl %eax, %edx
callq 0x545a0
movq -0x38(%rbp), %rdi
leaq 0x181d1(%rip), %rsi     # 0x6cdb7
callq 0x8170
testq %rax, %rax
je 0x54c19
movq %rax, %r14
leaq -0x360(%rbp), %rdi
callq 0x8290
movq %r14, %rdi
leaq -0x360(%rbp), %rsi
movq %rax, %rdx
callq 0x8300
testl %eax, %eax
je 0x54e4c
pushq $0x2
popq %rdi
leaq 0x181a3(%rip), %rsi     # 0x6cdc6
xorl %eax, %eax
callq 0x4acf2
movq 0x338(%rbx), %rax
movl 0x240(%rax,%r15), %edi
leaq 0x18077(%rip), %rsi     # 0x6ccb7
pushq $0x1b
jmp 0x54ec7
xorl %r13d, %r13d
pushq $0x2
popq %rdi
leaq 0x18143(%rip), %rsi     # 0x6cd97
movq %r14, %rdx
xorl %eax, %eax
callq 0x4acf2
movq 0x338(%rbx), %rax
movl 0x240(%rax,%r15), %eax
movl %eax, -0x38(%rbp)
movq -0x48(%rbp), %rdi
callq 0x8900
movq 0x308(%rbx), %rdi
testq %rdi, %rdi
je 0x54c8d
callq 0x8290
movq %rax, %r13
movups 0x17eff(%rip), %xmm0    # 0x6cb93
movaps %xmm0, -0x760(%rbp)
movabsq $0xa0d4b4f203030, %rax  # imm = 0xA0D4B4F203030
movq %rax, -0x753(%rbp)
leaq -0x74c(%rbp), %r15
movq %r15, %rdi
leaq 0x1813e(%rip), %rsi     # 0x6cdfb
leaq 0x18147(%rip), %rdx     # 0x6ce0b
leaq 0x18147(%rip), %rcx     # 0x6ce12
xorl %eax, %eax
callq 0x8110
movslq %eax, %r14
addq %r15, %r14
callq 0x47349
movq %rax, %rdi
xorl %esi, %esi
callq 0x47b0e
movq %r14, %rdi
leaq 0x18128(%rip), %rsi     # 0x6ce19
movq %rax, %rdx
xorl %eax, %eax
callq 0x8110
cltq
movups 0x17cd0(%rip), %xmm0    # 0x6c9d4
leaq (%rax,%r14), %rdi
addq $0x2d, %rdi
movups %xmm0, -0x2d(%rdi)
movl $0xa0d6573, -0x1e(%rdi) # imm = 0xA0D6573
movups 0x1810a(%rip), %xmm0    # 0x6ce28
movups %xmm0, -0x1a(%rdi)
movups 0x1810a(%rip), %xmm0    # 0x6ce33
movups %xmm0, -0xf(%rdi)
leaq 0x1810f(%rip), %rsi     # 0x6ce43
movl %r13d, %edx
xorl %eax, %eax
callq 0x8110
leaq -0x760(%rbp), %r14
movq %r14, %rdi
callq 0x8290
movl -0x38(%rbp), %r15d
movl %r15d, %edi
movq %r14, %rsi
movl %eax, %edx
callq 0x55008
testl %r13d, %r13d
jle 0x54d75
movq 0x308(%rbx), %rsi
movl %r15d, %edi
movl %r13d, %edx
callq 0x55008
movq -0x48(%rbp), %rdi
callq 0x84b0
jmp 0x54b12
pushq $0x2
popq %rdi
leaq 0x181a2(%rip), %rsi     # 0x6cf2f
xorl %eax, %eax
callq 0x4acf2
movq 0x338(%rbx), %rax
movl 0x240(%rax,%r15), %edi
leaq 0x180b0(%rip), %rsi     # 0x6ce5a
pushq $0x18
popq %rdx
callq 0x55008
jmp 0x548e6
xorl %r14d, %r14d
cmpq $0x820c00, %r14         # imm = 0x820C00
je 0x54df3
cmpl $0x0, 0x340(%rbx,%r14)
je 0x54dea
movq -0x58(%rbp), %rax
leaq (%rax,%r14), %rsi
leaq -0x160(%rbp), %rdi
callq 0x8890
testl %eax, %eax
je 0x54e97
addq $0x820c, %r14           # imm = 0x820C
jmp 0x54dba
movq 0x338(%rbx), %rax
movl 0x240(%rax,%r15), %edi
leaq 0x17d5e(%rip), %rsi     # 0x6cb67
pushq $0xc
popq %rdx
callq 0x55008
movl $0x1, (%r13)
orl $-0x1, 0x8208(%r13)
leaq 0x4(%r13), %rdi
leaq -0x160(%rbp), %rsi
callq 0x85c0
addq $0x104, %r13            # imm = 0x104
movq %r13, %rdi
leaq -0x260(%rbp), %rsi
callq 0x85c0
jmp 0x54b1d
movq 0x338(%rbx), %rax
movl 0x240(%rax,%r15), %edi
leaq 0x17d05(%rip), %rsi     # 0x6cb67
pushq $0xc
popq %rdx
callq 0x55008
movl $0x1, (%r13)
leaq 0x4(%r13), %rdi
leaq -0x260(%rbp), %rsi
callq 0x85c0
orl $-0x1, 0x8208(%r13)
andl $0x0, 0x204(%r13)
jmp 0x54b1d
pushq $0x2
popq %rdi
leaq 0x180ab(%rip), %rsi     # 0x6cf4c
leaq -0x760(%rbp), %rdx
xorl %eax, %eax
callq 0x4acf2
movq 0x338(%rbx), %rax
movl 0x240(%rax,%r15), %edi
leaq 0x17f95(%rip), %rsi     # 0x6ce5a
pushq $0x18
popq %rdx
callq 0x55008
jmp 0x54b12
addq $0x938, %rsp            # imm = 0x938
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq