// File: /workspace/github_cpp_makefile_star2_O3/DoubleString[P]RtConverter/src/VrsObs/VrsNtripClient.cpp
// Function: bamboo::VrsNtripClient::m_routine()
void VrsNtripClient::m_routine() {
	time_t tt;
	bool lcheck;
	int nread = 0, i;
	char cmd[1024] = { 0 }, buff[1024] = { 0 }, strbuf[1024] = { 0 };
	list<VrsStaItem>::iterator staItr;
	list<RtConverter*>::iterator rtItr;
	map<string, list<VrsStaItem>>::iterator mapItr;
	map<string, stream_t*>::iterator streamItr;
	map<string, rtcm_t*>::iterator rtcmItr;
	map<string, VrsStaItem>::iterator vrsItr;
	for (mapItr = configs_sav.rt_mounts.begin(); mapItr != configs_sav.rt_mounts.end(); ++mapItr) {
		for (staItr = (*mapItr).second.begin(); staItr != (*mapItr).second.end(); ++staItr) {
			m_newConnection((*staItr));
		}
	}
	while (lcont) {
		lcheck = false;
		time(&tt);
		if (tt - lastCheck > 5) {
			lcheck = true;
			lastCheck = tt;
			m_adaptConfigures();
		}
		for (streamItr = m_streams.begin(); streamItr != m_streams.end(); ++streamItr) {
			if (m_stas[(*streamItr).first].type == VrsStaItem::stream_type::vrs && lcheck) {
				//// sending GGA here
				m_sendGGAReq((*streamItr).second, m_stas[(*streamItr).first]);
			}
			nread = strread((*streamItr).second, (unsigned char*)buff, 1024);
			for (i = 0; i < nread; i++) {
				if (input_rtcm3(m_rtcms[(*streamItr).first], buff[i]) == 1) {
					RtConvItem curitem = m_makeupItems((*streamItr).first, m_rtcms[(*streamItr).first]);
					if (curitem.obslist.size() > 0) {
						for (rtItr = m_svrs.begin(); rtItr != m_svrs.end(); ++rtItr) {
							(*rtItr)->inputObs(curitem);
						}
					}
				}
			}
		}
		sleepms(50);
	}
	/// will delete memory here
	for (streamItr = m_streams.begin(); streamItr != m_streams.end(); ++streamItr) {
		strclose((*streamItr).second);
		free((*streamItr).second);
	}
	for (rtcmItr = m_rtcms.begin(); rtcmItr != m_rtcms.end(); ++rtcmItr) {
		free_rtcm((*rtcmItr).second);
		free((*rtcmItr).second);
	}
	m_streams.clear();
	m_rtcms.clear();
	m_stas.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4a8, %rsp            # imm = 0x4A8
movq %rdi, %r13
leaq -0x4d0(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x8390
movq 0x1c38(%r13), %rbx
leaq 0x1c28(%r13), %r14
cmpq %r14, %rbx
je 0x623a7
leaq 0x40(%rbx), %r15
movq 0x40(%rbx), %r12
cmpq %r15, %r12
je 0x62397
leaq 0x10(%r12), %rsi
movq %r13, %rdi
callq 0x62644
movq (%r12), %r12
jmp 0x6237f
movq %rbx, %rdi
callq 0x8460
movq %rax, %rbx
cmpq %r14, %rax
jne 0x62377
cmpb $0x1, (%r13)
jne 0x6256f
leaq 0x2070(%r13), %rax
movq %rax, -0x38(%rbp)
leaq 0x20c8(%r13), %rax
movq %rax, -0x40(%rbp)
leaq 0x2098(%r13), %rbx
leaq 0x2050(%r13), %r12
movq %rbx, -0x50(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x85b0
movq -0x88(%rbp), %rax
movq %rax, %rcx
subq 0x8(%r13), %rcx
movq %rcx, -0x48(%rbp)
cmpq $0x6, %rcx
jl 0x6240a
movq %rax, 0x8(%r13)
movq %r13, %rdi
callq 0x62736
movq 0x2080(%r13), %r15
cmpq -0x38(%rbp), %r15
je 0x6255a
leaq 0x20(%r15), %rsi
movq -0x40(%rbp), %rdi
movq %rsi, -0x30(%rbp)
callq 0x633be
cmpq $0x6, -0x48(%rbp)
jl 0x62454
cmpl $0x0, (%rax)
jne 0x62454
movq 0x40(%r15), %r14
movq -0x40(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x633be
movq %r14, %rsi
movq %rax, %rdx
callq 0x62b22
movq 0x40(%r15), %rdi
leaq -0x4d0(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x592c8
testl %eax, %eax
jle 0x62545
movl %eax, %eax
movq %rax, -0x60(%rbp)
xorl %r14d, %r14d
movq %r15, -0x58(%rbp)
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x6343e
movq (%rax), %rdi
movzbl -0x4d0(%rbp,%r14), %esi
callq 0x38e40
cmpl $0x1, %eax
jne 0x62538
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
addq %rsi, %rdx
movq %rbx, %r15
movq %r13, %rbx
leaq -0x80(%rbp), %rdi
callq 0x111e0
movq %r15, %rdi
leaq -0xd0(%rbp), %r15
movq -0x30(%rbp), %rsi
callq 0x6343e
movq (%rax), %rcx
movq %r15, %rdi
movq %rbx, %rsi
leaq -0x80(%rbp), %rdx
callq 0x62d12
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x624fd
callq 0x85d0
cmpq $0x0, -0x90(%rbp)
je 0x62521
movq %r12, %r13
movq (%r13), %r13
cmpq %r12, %r13
je 0x62521
movq 0x10(%r13), %rdi
movq %r15, %rsi
callq 0x2b524
jmp 0x6250a
leaq -0xb8(%rbp), %rdi
callq 0x284ba
movq %rbx, %r13
movq -0x50(%rbp), %rbx
movq -0x58(%rbp), %r15
incq %r14
cmpq -0x60(%rbp), %r14
jne 0x6247e
movq %r15, %rdi
callq 0x8460
movq %rax, %r15
cmpq -0x38(%rbp), %rax
jne 0x6241b
movl $0x32, %edi
callq 0x4ff28
cmpb $0x0, (%r13)
jne 0x623da
movq 0x2080(%r13), %rbx
leaq 0x2070(%r13), %r14
cmpq %r14, %rbx
je 0x625a4
movq 0x40(%rbx), %rdi
callq 0x58f13
movq 0x40(%rbx), %rdi
callq 0x87a0
movq %rbx, %rdi
callq 0x8460
movq %rax, %rbx
cmpq %r14, %rax
jne 0x62582
movq 0x20b0(%r13), %rbx
leaq 0x20a0(%r13), %r14
cmpq %r14, %rbx
je 0x625d9
movq 0x40(%rbx), %rdi
callq 0x38c6c
movq 0x40(%rbx), %rdi
callq 0x87a0
movq %rbx, %rdi
callq 0x8460
movq %rax, %rbx
cmpq %r14, %rax
jne 0x625b7
leaq 0x2098(%r13), %rbx
leaq 0x2068(%r13), %rdi
callq 0x63ec4
movq %rbx, %rdi
callq 0x63efc
addq $0x20c8, %r13           # imm = 0x20C8
movq %r13, %rdi
callq 0x63f34
addq $0x4a8, %rsp            # imm = 0x4A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x6263b
callq 0x85d0
jmp 0x6263b
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x284ba
movq %rbx, %rdi
callq 0x8b30
nop