// File: /workspace/github_cpp_makefile_star2_O2/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 $0xd88, %rsp            # imm = 0xD88
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x2418c(%rip), %rsi     # 0x666bc
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x455bc
subq $0x8, %rsp
leaq -0x1b0(%rbp), %rax
leaq -0x70(%rbp), %r10
leaq -0x3b0(%rbp), %r11
leaq -0x5b0(%rbp), %r13
pushq $0x5
popq %rdi
leaq -0x30(%rbp), %r8
leaq -0x2c(%rbp), %r9
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
pushq %rax
pushq %r10
pushq %r11
pushq %r13
leaq -0x7b0(%rbp), %rax
pushq %rax
leaq -0x9b0(%rbp), %rax
pushq %rax
leaq -0xb0(%rbp), %rax
pushq %rax
leaq -0xbb0(%rbp), %rax
pushq %rax
leaq -0xdb0(%rbp), %rax
pushq %rax
callq 0x43a83
addq $0x50, %rsp
testl %eax, %eax
je 0x4268a
movl -0x30(%rbp), %r14d
leaq -0xdb0(%rbp), %r15
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x44a80
leaq -0xb0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44bdd
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x444ee
leaq -0xbb0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44c39
movl -0x2c(%rbp), %r14d
leaq -0x9b0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44589
leaq -0x7b0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x447b0
leaq -0x3b0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4489a
leaq -0x70(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44a22
leaq -0x1b0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44b6f
leaq -0x5b0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44cf6
movl %eax, 0x9f0bc(%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0xd88, %rsp            # imm = 0xD88
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq