// File: DoubleString[P]RtConverter/src/Rtklib/stream.cpp
// Function: bamboo::reqntrip_c(bamboo::ntrip_t*, char*)
static int reqntrip_c(ntrip_t *ntrip, char *msg)
	{
		char buff[1024], user[512], *p = buff;

		tracet(3, "reqntrip_c: state=%d\n", ntrip->state);

		p += sprintf(p, "GET %s/%s HTTP/1.0\r\n", ntrip->url, ntrip->mntpnt);
		p += sprintf(p, "User-Agent: NTRIP %s\r\n", NTRIP_AGENT);

		if (!*ntrip->user) {
			p += sprintf(p, "Accept: */*\r\n");
			p += sprintf(p, "Connection: close\r\n");
		}
		else {
			sprintf(user, "%s:%s", ntrip->user, ntrip->passwd);
			p += sprintf(p, "Authorization: Basic ");
			p += encbase64(p, (unsigned char *)user, strlen(user));
			p += sprintf(p, "\r\n");
		}
		p += sprintf(p, "\r\n");

		if (writetcpcli(ntrip->tcp, (unsigned char *)buff, p - buff, msg) != p - buff) return 0;

		tracet(2, "reqntrip_c: send request state=%d ns=%d\n", ntrip->state, p - buff);
		tracet(5, "reqntrip_c: n=%d buff=\n%s\n", p - buff, buff);
		ntrip->state = 1;
		return 1;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x640, %rsp            # imm = 0x640
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x420(%rbp), %rax
movq %rax, -0x628(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edx
movl $0x3, %edi
leaq 0x23bdc(%rip), %rsi     # 0xc971f
movb $0x0, %al
callq 0x95890
movq -0x628(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0xc, %rdx
movq -0x10(%rbp), %rcx
addq $0x10c, %rcx            # imm = 0x10C
leaq 0x23bca(%rip), %rsi     # 0xc9735
movb $0x0, %al
callq 0x9150
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rdi
leaq 0x23bb4(%rip), %rsi     # 0xc974a
leaq 0x23b27(%rip), %rdx     # 0xc96c4
movb $0x0, %al
callq 0x9150
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, 0x20c(%rax)
jne 0xa5c22
movq -0x628(%rbp), %rdi
leaq 0x23b8c(%rip), %rsi     # 0xc9761
movb $0x0, %al
callq 0x9150
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rdi
leaq 0x23b6f(%rip), %rsi     # 0xc976f
movb $0x0, %al
callq 0x9150
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
jmp 0xa5cf6
leaq -0x620(%rbp), %rdi
movq -0x10(%rbp), %rdx
addq $0x20c, %rdx            # imm = 0x20C
movq -0x10(%rbp), %rcx
addq $0x30c, %rcx            # imm = 0x30C
leaq 0x2345d(%rip), %rsi     # 0xc90a3
movb $0x0, %al
callq 0x9150
movq -0x628(%rbp), %rdi
leaq 0x23b28(%rip), %rsi     # 0xc9783
movb $0x0, %al
callq 0x9150
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rax
movq %rax, -0x638(%rbp)
leaq -0x620(%rbp), %rax
movq %rax, -0x630(%rbp)
leaq -0x620(%rbp), %rdi
callq 0x92e0
movq -0x638(%rbp), %rdi
movq -0x630(%rbp), %rsi
movl %eax, %edx
callq 0xa64a0
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rdi
leaq 0x23f19(%rip), %rsi     # 0xc9bf2
movb $0x0, %al
callq 0x9150
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
movq -0x628(%rbp), %rdi
leaq 0x23eee(%rip), %rsi     # 0xc9bf2
movb $0x0, %al
callq 0x9150
movl %eax, %ecx
movq -0x628(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x628(%rbp)
movq -0x10(%rbp), %rax
movq 0x8510(%rax), %rdi
leaq -0x420(%rbp), %rsi
movq -0x628(%rbp), %rax
leaq -0x420(%rbp), %rcx
subq %rcx, %rax
movl %eax, %edx
movq -0x18(%rbp), %rcx
callq 0xa1280
cltq
movq -0x628(%rbp), %rcx
leaq -0x420(%rbp), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
je 0xa5d70
movl $0x0, -0x4(%rbp)
jmp 0xa5dd6
movq -0x10(%rbp), %rax
movl (%rax), %edx
movq -0x628(%rbp), %rcx
leaq -0x420(%rbp), %rax
subq %rax, %rcx
movl $0x2, %edi
leaq 0x23a06(%rip), %rsi     # 0xc9799
movb $0x0, %al
callq 0x95890
movq -0x628(%rbp), %rdx
leaq -0x420(%rbp), %rax
subq %rax, %rdx
leaq -0x420(%rbp), %rcx
movl $0x5, %edi
leaq 0x23a04(%rip), %rsi     # 0xc97c2
movb $0x0, %al
callq 0x95890
movq -0x10(%rbp), %rax
movl $0x1, (%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x640, %rsp            # imm = 0x640
popq %rbp
retq
nopw %cs:(%rax,%rax)