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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x4, %edi
leaq 0x2186f(%rip), %rsi     # 0xc9a1b
movb $0x0, %al
callq 0x95890
movq -0x8(%rbp), %rax
movq 0x608(%rax), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x608(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0xa4c10
cmpl $0x0, %eax
jne 0xa81e4
jmp 0xa837b
movl $0x0, -0x1c(%rbp)
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jge 0xa837b
movq -0x8(%rbp), %rax
movq 0x608(%rax), %rax
addq $0x128, %rax            # imm = 0x128
movslq -0x1c(%rbp), %rcx
imulq $0x128, %rcx, %rcx      # imm = 0x128
addq %rcx, %rax
cmpl $0x2, (%rax)
jne 0xa8239
movq -0x8(%rbp), %rax
addq $0x610, %rax            # imm = 0x610
movslq -0x1c(%rbp), %rcx
imulq $0x408, %rcx, %rcx      # imm = 0x408
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0xa823e
jmp 0xa836d
movq -0x8(%rbp), %rax
addq $0x610, %rax            # imm = 0x610
movslq -0x1c(%rbp), %rcx
imulq $0x408, %rcx, %rcx      # imm = 0x408
addq %rcx, %rax
addq $0x8, %rax
movq -0x8(%rbp), %rcx
addq $0x610, %rcx            # imm = 0x610
movslq -0x1c(%rbp), %rdx
imulq $0x408, %rdx, %rdx      # imm = 0x408
addq %rdx, %rcx
movslq 0x4(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x610, %rax            # imm = 0x610
movslq -0x1c(%rbp), %rcx
imulq $0x408, %rcx, %rcx      # imm = 0x408
addq %rcx, %rax
movslq 0x4(%rax), %rcx
movl $0x400, %eax            # imm = 0x400
subq %rcx, %rax
subq $0x1, %rax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x608(%rax), %rax
addq $0x128, %rax            # imm = 0x128
movslq -0x1c(%rbp), %rcx
imulq $0x128, %rcx, %rcx      # imm = 0x128
addq %rcx, %rax
movl 0x118(%rax), %edi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0xa4ca0
movl %eax, -0x20(%rbp)
cmpl $-0x1, %eax
jne 0xa8338
callq 0xa43f0
movl %eax, -0x28(%rbp)
cmpl $0x0, %eax
je 0xa832a
movq -0x8(%rbp), %rax
movq 0x608(%rax), %rax
addq $0x128, %rax            # imm = 0x128
movslq -0x1c(%rbp), %rcx
imulq $0x128, %rcx, %rcx      # imm = 0x128
addq %rcx, %rax
movl 0x118(%rax), %edx
movl -0x28(%rbp), %ecx
movl $0x1, %edi
leaq 0x21705(%rip), %rsi     # 0xc9a28
movb $0x0, %al
callq 0x95890
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xa8390
jmp 0xa836d
cmpl $0x0, -0x20(%rbp)
jg 0xa8340
jmp 0xa836d
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rax
addq $0x610, %rax            # imm = 0x610
movslq -0x1c(%rbp), %rdx
imulq $0x408, %rdx, %rdx      # imm = 0x408
addq %rdx, %rax
addl 0x4(%rax), %ecx
movl %ecx, 0x4(%rax)
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0xa8430
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xa81eb
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)