// File: DoubleString[P]RtConverter/src/RtConverter/RtConverter.cpp
// Function: bamboo::RtConverter::makeupObsBuffer(char const*, char const*, bamboo::RtSatObs&, char*, int&)
void RtConverter::makeupObsBuffer(const char* sitname, const char* cprn, RtSatObs& obs, char* buffin, int& nbyte) {
	int ifreq, hasobs = false;
	string sit_out = string(sitname);
	transform(sit_out.begin(), sit_out.end(), sit_out.begin(), ::toupper);
	sprintf(buffin, "%s %s", sit_out.c_str(), cprn);
	for (ifreq = 0; ifreq < MAXFREQ; ifreq++) {
		hasobs = false;
		if (obs.obs[ifreq] != 0.0) {
			hasobs = true;
			sprintf(buffin + strlen(buffin), " %s %14.3lf", obs.fob[ifreq].c_str(), obs.obs[ifreq]);
		}
		if (obs.obs[MAXFREQ + ifreq] != 0.0) {
			hasobs = true;
			sprintf(buffin + strlen(buffin), " %s %14.3lf", obs.fob[MAXFREQ + ifreq].c_str(), obs.obs[MAXFREQ + ifreq]);
		}
		if (hasobs) {
			sprintf(buffin + strlen(buffin), " S%s %7.3lf",obs.fob[MAXFREQ + ifreq].c_str() + 1, obs.snr[ifreq]);
		}	
	}
	strcat(buffin, "\r\n");
	nbyte = strlen(buffin);
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl $0x0, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa0(%rbp)
leaq -0x59(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x9d30
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rdx
leaq -0x58(%rbp), %rdi
callq 0x9a30
jmp 0x52aae
leaq -0x59(%rbp), %rdi
callq 0x97e0
leaq -0x58(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0x9660
movq -0xb0(%rbp), %rdi
movq %rax, -0x78(%rbp)
callq 0x9420
movq -0xb0(%rbp), %rdi
movq %rax, -0x80(%rbp)
callq 0x9660
movq %rax, -0x88(%rbp)
movq -0x78(%rbp), %rdi
movq -0x80(%rbp), %rsi
movq -0x88(%rbp), %rdx
movq 0xa44d4(%rip), %rcx     # 0xf6fd8
callq 0x50030
movq %rax, -0xa8(%rbp)
jmp 0x52b12
movq -0xa8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xb8(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x92b0
movq -0xb8(%rbp), %rdi
movq %rax, %rdx
movq -0x18(%rbp), %rcx
leaq 0x6b152(%rip), %rsi     # 0xbdc9b
movb $0x0, %al
callq 0x9150
movl $0x0, -0x34(%rbp)
cmpl $0x3, -0x34(%rbp)
jge 0x52d3f
movl $0x0, -0x38(%rbp)
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x52b85
jp 0x52b85
jmp 0x52c27
movl $0x1, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x92e0
movq %rax, %rcx
movq -0xc8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
movslq -0x34(%rbp), %rax
shlq $0x5, %rax
addq %rax, %rdi
callq 0x92b0
movq -0xc0(%rbp), %rdi
movq %rax, %rdx
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x6b0b7(%rip), %rsi     # 0xbdca1
movb $0x1, %al
callq 0x9150
jmp 0x52c27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x59(%rbp), %rdi
callq 0x97e0
jmp 0x52d72
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x9480
jmp 0x52d72
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x52c46
jp 0x52c46
jmp 0x52cbb
movl $0x1, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x92e0
movq %rax, %rcx
movq -0xd8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
movl -0x34(%rbp), %eax
addl $0x3, %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
callq 0x92b0
movq -0xd0(%rbp), %rdi
movq %rax, %rdx
movq -0x20(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x6afed(%rip), %rsi     # 0xbdca1
movb $0x1, %al
callq 0x9150
cmpl $0x0, -0x38(%rbp)
je 0x52d2f
movq -0x28(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x28(%rbp), %rdi
callq 0x92e0
movq %rax, %rcx
movq -0xe8(%rbp), %rax
addq %rcx, %rax
movq %rax, -0xe0(%rbp)
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
movl -0x34(%rbp), %eax
addl $0x3, %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
callq 0x92b0
movq -0xe0(%rbp), %rdi
movq %rax, %rdx
addq $0x1, %rdx
movq -0x20(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsd 0x30(%rax,%rcx,8), %xmm0
leaq 0x6af85(%rip), %rsi     # 0xbdcad
movb $0x1, %al
callq 0x9150
jmp 0x52d31
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x52b57
movq -0x28(%rbp), %rdi
leaq 0x76ea8(%rip), %rsi     # 0xc9bf2
callq 0x9d40
movq -0x28(%rbp), %rdi
callq 0x92e0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
leaq -0x58(%rbp), %rdi
callq 0x9480
addq $0xf0, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x9d20
nopl (%rax,%rax)