// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r9, -0x58(%rbp)
movq %r8, %r12
movq %rcx, %r15
movq %rdx, -0x38(%rbp)
leaq -0x78(%rbp), %rbx
leaq -0x29(%rbp), %rdx
movq %rbx, %rdi
callq 0x8260
movq (%rbx), %r13
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
movq %r15, -0x50(%rbp)
je 0x2bbe2
xorl %r15d, %r15d
movsbl (%r13,%r15), %edi
callq 0x8be0
movb %al, (%r13,%r15)
incq %r15
cmpq %r15, %rbx
jne 0x2bbc2
movq -0x78(%rbp), %r13
movq -0x50(%rbp), %r15
leaq 0x400e2(%rip), %rsi     # 0x6bccb
xorl %r14d, %r14d
movq %r12, -0x40(%rbp)
movq %r12, %rdi
movq %r13, %rdx
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x8120
leaq 0x48(%r15), %rax
movl $0x3, %r12d
xorpd %xmm0, %xmm0
movq %rax, %r13
movq %rax, -0x38(%rbp)
movsd -0x18(%r15,%r12,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x2bc41
jp 0x2bc41
movsd (%r15,%r12,8), %xmm1
ucomisd %xmm0, %xmm1
jne 0x2bc37
jnp 0x2bced
leaq 0x3(%r14), %r15
movq -0x40(%rbp), %rbx
jmp 0x2bc82
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
movsd %xmm1, -0x48(%rbp)
callq 0x8290
leaq (%rax,%rbx), %rdi
movq (%r13), %rdx
leaq 0x40070(%rip), %rsi     # 0x6bcd1
movsd -0x48(%rbp), %xmm0
movb $0x1, %al
callq 0x8120
movsd (%r15,%r12,8), %xmm1
ucomisd 0x3ec8d(%rip), %xmm1    # 0x6a908
movq %r12, %r15
jne 0x2bc82
jnp 0x2bcb5
movsd %xmm1, -0x48(%rbp)
movq %rbx, %rdi
callq 0x8290
leaq (%rax,%rbx), %rdi
movq %r15, %rax
shlq $0x5, %rax
movq -0x38(%rbp), %rcx
movq (%rcx,%rax), %rdx
leaq 0x40028(%rip), %rsi     # 0x6bcd1
movsd -0x48(%rbp), %xmm0
movb $0x1, %al
callq 0x8120
movq %rbx, %rdi
callq 0x8290
leaq (%rax,%rbx), %rdi
shlq $0x5, %r15
movq -0x38(%rbp), %rbx
movq (%rbx,%r15), %rdx
incq %rdx
movq -0x50(%rbp), %r15
movsd 0x18(%r15,%r12,8), %xmm0
leaq 0x3fffb(%rip), %rsi     # 0x6bcdd
movb $0x1, %al
callq 0x8120
xorpd %xmm0, %xmm0
incq %r14
incq %r12
addq $0x20, %r13
cmpq $0x6, %r12
jne 0x2bc16
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x8290
movw $0xa0d, (%rbx,%rax)     # imm = 0xA0D
movb $0x0, 0x2(%rbx,%rax)
movq %rbx, %rdi
callq 0x8290
movq -0x58(%rbp), %rcx
movl %eax, (%rcx)
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bd38
callq 0x85d0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop