// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm5(bamboo::rtcm_t*, int, int)
static int encode_msm5(rtcm_t *rtcm, int sys, int sync)
{
    double rrng[64],rrate[64],psrng[64],phrng[64],rate[64],lock[64];
    float cnr[64];
    unsigned char info[64],half[64];
    int i,nsat,ncell;
    
    trace(3,"encode_msm5: sys=%d sync=%d\n",sys,sync);
    
    /* encode msm header */
    if (!(i=encode_msm_head(5,rtcm,sys,sync,&nsat,&ncell,rrng,rrate,info,psrng,
                            phrng,rate,lock,half,cnr))) {
        return 0;
    }
    /* encode msm satellite data */
    i=encode_msm_int_rrng(rtcm,i,rrng ,nsat ); /* rough range integer ms */
    i=encode_msm_info    (rtcm,i,info ,nsat ); /* extended satellite info */
    i=encode_msm_mod_rrng(rtcm,i,rrng ,nsat ); /* rough range modulo 1 ms */
    i=encode_msm_rrate   (rtcm,i,rrate,nsat ); /* rough phase-range-rate */
    
    /* encode msm signal data */
    i=encode_msm_psrng   (rtcm,i,psrng,ncell); /* fine pseudorange */
    i=encode_msm_phrng   (rtcm,i,phrng,ncell); /* fine phase-range */
    i=encode_msm_lock    (rtcm,i,lock ,ncell); /* lock-time indicator */
    i=encode_msm_half_amb(rtcm,i,half ,ncell); /* half-cycle-amb indicator */
    i=encode_msm_cnr     (rtcm,i,cnr  ,ncell); /* signal cnr */
    i=encode_msm_rate    (rtcm,i,rate ,ncell); /* fine phase-range-rate */
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd98, %rsp            # imm = 0xD98
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x25a84(%rip), %rsi     # 0x706dc
xorl %r14d, %r14d
movl $0x3, %edi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4ded0
subq $0x8, %rsp
leaq -0x1c0(%rbp), %rax
leaq -0x80(%rbp), %r10
leaq -0x5c0(%rbp), %r11
leaq -0x7c0(%rbp), %r13
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
movl $0x5, %edi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
pushq %rax
pushq %r10
pushq %r11
pushq %r13
leaq -0x9c0(%rbp), %rax
pushq %rax
leaq -0xbc0(%rbp), %rax
pushq %rax
leaq -0xc0(%rbp), %rax
pushq %rax
leaq -0xdc0(%rbp), %rax
pushq %rax
leaq -0x3c0(%rbp), %rax
pushq %rax
callq 0x4c289
addq $0x50, %rsp
testl %eax, %eax
je 0x4ae06
movslq -0x34(%rbp), %r14
leaq -0x3c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d2f0
movl %eax, %r15d
testq %r14, %r14
jle 0x4ad2f
leaq 0x9f0c4(%rbx), %r12
xorl %r13d, %r13d
movzbl -0xc0(%rbp,%r13), %ecx
movq %r12, %rdi
movl %r15d, %esi
movl $0x4, %edx
callq 0x4e403
addl $0x4, %r15d
incq %r13
cmpq %r13, %r14
jne 0x4ad0a
leaq -0x3c0(%rbp), %rdx
movq %rbx, %rdi
movl %r15d, %esi
movl %r14d, %ecx
callq 0x4cd71
leaq -0xdc0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d453
movslq -0x30(%rbp), %r14
leaq -0xbc0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4ce0f
leaq -0x9c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d05e
leaq -0x5c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d145
testq %r14, %r14
jle 0x4add2
leaq 0x9f0c4(%rbx), %r12
movl %eax, -0x2c(%rbp)
movl %eax, %r15d
xorl %r13d, %r13d
leal (%r15,%r13), %esi
movzbl -0x80(%rbp,%r13), %ecx
movq %r12, %rdi
movl $0x1, %edx
callq 0x4e403
incq %r13
cmpq %r13, %r14
jne 0x4adad
movl -0x2c(%rbp), %eax
addl %r13d, %eax
leaq -0x1c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d3e7
leaq -0x7c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d50f
movl %eax, 0x9f0bc(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0xd98, %rsp            # imm = 0xD98
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq