// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm7(bamboo::rtcm_t*, int, int)
static int encode_msm7(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_msm7: sys=%d sync=%d\n",sys,sync);
    
    /* encode msm header */
    if (!(i=encode_msm_head(7,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_ex(rtcm,i,psrng,ncell); /* fine pseudorange ext */
    i=encode_msm_phrng_ex(rtcm,i,phrng,ncell); /* fine phase-range ext */
    i=encode_msm_lock_ex (rtcm,i,lock ,ncell); /* lock-time indicator ext */
    i=encode_msm_half_amb(rtcm,i,half ,ncell); /* half-cycle-amb indicator */
    i=encode_msm_cnr_ex  (rtcm,i,cnr  ,ncell); /* signal cnr ext */
    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 0x25823(%rip), %rsi     # 0x707dc
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 $0x7, %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 0x4b167
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 0x4b090
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 0x4b06b
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 0x4d5ee
leaq -0x9c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d6d5
leaq -0x5c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d7bc
testq %r14, %r14
jle 0x4b133
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 0x4b10e
movl -0x2c(%rbp), %eax
addl %r13d, %eax
leaq -0x1c0(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4db43
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