LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_head1001(bamboo::rtcm_t*, int*)
static int decode_head1001(rtcm_t *rtcm, int *sync)
{
    double tow;
    char *msg,tstr[64];
    int i=24,staid,nsat,type;
    
    type=getbitu(rtcm->buff,i,12); i+=12;
    
    if (i+52<=rtcm->len*8) {
        staid=getbitu(rtcm->buff,i,12);       i+=12;
        tow  =getbitu(rtcm->buff,i,30)*0.001; i+=30;
        *sync=getbitu(rtcm->buff,i, 1);       i+= 1;
        nsat =getbitu(rtcm->buff,i, 5);
    }
    else {
        trace(2,"rtcm3 %d length error: len=%d\n",type,rtcm->len);
        return -1;
    }
    /* test station id */
    if (!test_staid(rtcm,staid)) return -1;
    
    adjweek(rtcm,tow);
    
    time2str(rtcm->time,tstr,2);
    trace(4,"decode_head1001: time=%s nsat=%d sync=%d\n",tstr,nsat,*sync);
    
    if (rtcm->outtype) {
        msg=rtcm->msgtype+strlen(rtcm->msgtype);
        sprintf(msg," staid=%4d %s nsat=%2d sync=%d",staid,tstr,nsat,*sync);
    }
    return nsat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x9f0c4(%rdi), %r12
pushq $0x18
popq %rsi
pushq $0xc
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl 0x9f0c0(%r14), %ecx
cmpl $0xb, %ecx
jl 0x3b1bb
pushq $0x24
popq %rsi
pushq $0xc
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, %r15d
pushq $0x30
popq %rsi
pushq $0x1e
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, %r13d
pushq $0x4e
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, (%rbx)
pushq $0x4f
popq %rsi
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, %r12d
movq %r14, %rdi
movl %r15d, %esi
callq 0x3b1e4
testl %eax, %eax
je 0x3b1ce
movl %r13d, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x26c33(%rip), %xmm0    # 0x61d78
movq %r14, %rdi
callq 0x3b289
movq 0x10(%r14), %rdi
movsd 0x18(%r14), %xmm0
leaq -0x70(%rbp), %r13
pushq $0x2
popq %rdx
movq %r13, %rsi
callq 0x47a48
movl (%rbx), %r8d
leaq 0x29df2(%rip), %rsi     # 0x64f62
pushq $0x4
popq %rdi
movq %r13, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x455bc
cmpl $0x0, 0xc(%r14)
je 0x3b1d2
leaq 0x9b9d0(%r14), %rdi
callq 0x8290
leaq (%r14,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
movl (%rbx), %r9d
leaq 0x29de4(%rip), %rsi     # 0x64f8c
leaq -0x70(%rbp), %rcx
movl %r15d, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x8110
jmp 0x3b1d2
leaq 0x29d81(%rip), %rsi     # 0x64f43
pushq $0x2
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x455bc
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::test_staid(bamboo::rtcm_t*, int)
static int test_staid(rtcm_t *rtcm, int staid)
{
    char *p;
    int type,id;
    
    /* test station id option */
    if ((p=strstr(rtcm->opt,"-STA="))&&sscanf(p,"-STA=%d",&id)==1) {
        if (staid!=id) return 0;
    }
    /* save station id */
    if (rtcm->staid==0||rtcm->obsflag) {
        rtcm->staid=staid;
    }
    else if (staid!=rtcm->staid) {
        type=getbitu(rtcm->buff,24,12);
        trace(2,"rtcm3 %d staid invalid id=%d %d\n",type,staid,rtcm->staid);
        
        /* reset station id if station id error */
        rtcm->staid=0;
        return 0;
    }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
addq $0x9fd48, %rdi          # imm = 0x9FD48
leaq 0x29da9(%rip), %rsi     # 0x64fab
callq 0x8170
testq %rax, %rax
je 0x3b22f
leaq 0x29d9e(%rip), %rsi     # 0x64fb1
xorl %r15d, %r15d
leaq -0x1c(%rbp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x8600
cmpl $0x1, %eax
jne 0x3b22f
cmpl %r14d, -0x1c(%rbp)
jne 0x3b27b
movl (%rbx), %eax
pushq $0x1
popq %r15
testl %eax, %eax
je 0x3b278
cmpl $0x0, 0x9bdd0(%rbx)
jne 0x3b278
cmpl %r14d, %eax
je 0x3b27b
leaq 0x9f0c4(%rbx), %rdi
pushq $0x18
popq %rsi
pushq $0xc
popq %rdx
callq 0x459f7
movl (%rbx), %r8d
leaq 0x29d56(%rip), %rsi     # 0x64fb9
xorl %r15d, %r15d
pushq $0x2
popq %rdi
movl %eax, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x455bc
xorl %r14d, %r14d
movl %r14d, (%rbx)
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::adjweek(bamboo::rtcm_t*, double)
static void adjweek(rtcm_t *rtcm, double tow)
{
    double tow_p;
    int week;
    
    /* if no time, get cpu time */
    if (rtcm->time.time==0) rtcm->time=utc2gpst(timeget());
    tow_p=time2gpst(rtcm->time,&week);
    if      (tow<tow_p-302400.0) tow+=604800.0;
    else if (tow>tow_p+302400.0) tow-=604800.0;
    rtcm->time=gpst2time(week,tow);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, -0x18(%rbp)
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x3b2aa
movsd 0x18(%rbx), %xmm0
jmp 0x3b2c3
callq 0x47349
movq %rax, %rdi
callq 0x477da
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
leaq -0xc(%rbp), %rsi
callq 0x470f1
movsd 0x26aec(%rip), %xmm1    # 0x61dc0
addsd %xmm0, %xmm1
movsd -0x18(%rbp), %xmm2
ucomisd %xmm2, %xmm1
movapd %xmm2, %xmm1
jbe 0x3b2f1
addsd 0x26ae9(%rip), %xmm1    # 0x61dd8
jmp 0x3b307
addsd 0x26acf(%rip), %xmm0    # 0x61dc8
ucomisd %xmm0, %xmm1
jbe 0x3b307
addsd 0x26ac9(%rip), %xmm1    # 0x61dd0
movl -0xc(%rbp), %edi
movapd %xmm1, %xmm0
callq 0x4708a
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::adjcp(bamboo::rtcm_t*, int, int, double)
static double adjcp(rtcm_t *rtcm, int sat, int freq, double cp)
{
    if (rtcm->cp[sat-1][freq]==0.0) ;
    else if (cp<rtcm->cp[sat-1][freq]-750.0) cp+=1500.0;
    else if (cp>rtcm->cp[sat-1][freq]+750.0) cp-=1500.0;
    rtcm->cp[sat-1][freq]=cp;
    return cp;
}

// Assembly:
decl %esi
movslq %esi, %rax
imulq $0x18, %rax, %rax
addq %rdi, %rax
movl %edx, %ecx
leaq (%rax,%rcx,8), %rax
addq $0x9bdd8, %rax          # imm = 0x9BDD8
movsd (%rax), %xmm1
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm1
jne 0x3b3f6
jnp 0x3b42d
pushq %rbp
movq %rsp, %rbp
movsd 0x29346(%rip), %xmm2    # 0x64748
addsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
jbe 0x3b416
addsd 0x2934c(%rip), %xmm0    # 0x64760
jmp 0x3b42c
addsd 0x29332(%rip), %xmm1    # 0x64750
ucomisd %xmm1, %xmm0
jbe 0x3b42c
addsd 0x2932c(%rip), %xmm0    # 0x64758
popq %rbp
movsd %xmm0, (%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_head1009(bamboo::rtcm_t*, int*)
static int decode_head1009(rtcm_t *rtcm, int *sync)
{
    double tod;
    char *msg,tstr[64];
    int i=24,staid,nsat,type;
    
    type=getbitu(rtcm->buff,i,12); i+=12;
    
    if (i+49<=rtcm->len*8) {
        staid=getbitu(rtcm->buff,i,12);       i+=12;
        tod  =getbitu(rtcm->buff,i,27)*0.001; i+=27; /* sec in a day */
        *sync=getbitu(rtcm->buff,i, 1);       i+= 1;
        nsat =getbitu(rtcm->buff,i, 5);
    }
    else {
        trace(2,"rtcm3 %d length error: len=%d\n",type,rtcm->len);
        return -1;
    }
    /* test station id */
    if (!test_staid(rtcm,staid)) return -1;
    
    adjday_glot(rtcm,tod);
    
    time2str(rtcm->time,tstr,2);
    trace(4,"decode_head1009: time=%s nsat=%d sync=%d\n",tstr,nsat,*sync);
    
    if (rtcm->outtype) {
        msg=rtcm->msgtype+strlen(rtcm->msgtype);
        sprintf(msg," staid=%4d %s nsat=%2d sync=%d",staid,tstr,nsat,*sync);
    }
    return nsat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x9f0c4(%rdi), %r12
pushq $0x18
popq %rsi
pushq $0xc
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl 0x9f0c0(%r14), %ecx
cmpl $0xb, %ecx
jl 0x3b5f3
pushq $0x24
popq %rsi
pushq $0xc
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, %r15d
pushq $0x30
popq %rsi
pushq $0x1b
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, %r13d
pushq $0x4b
popq %rsi
pushq $0x1
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, (%rbx)
pushq $0x4c
popq %rsi
pushq $0x5
popq %rdx
movq %r12, %rdi
callq 0x459f7
movl %eax, %r12d
movq %r14, %rdi
movl %r15d, %esi
callq 0x3b1e4
testl %eax, %eax
je 0x3b606
movl %r13d, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x267fb(%rip), %xmm0    # 0x61d78
movq %r14, %rdi
callq 0x3b61c
movq 0x10(%r14), %rdi
movsd 0x18(%r14), %xmm0
leaq -0x70(%rbp), %r13
pushq $0x2
popq %rdx
movq %r13, %rsi
callq 0x47a48
movl (%rbx), %r8d
leaq 0x29b64(%rip), %rsi     # 0x6510c
pushq $0x4
popq %rdi
movq %r13, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x455bc
cmpl $0x0, 0xc(%r14)
je 0x3b60a
leaq 0x9b9d0(%r14), %rdi
callq 0x8290
leaq (%r14,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
movl (%rbx), %r9d
leaq 0x299ac(%rip), %rsi     # 0x64f8c
leaq -0x70(%rbp), %rcx
movl %r15d, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x8110
jmp 0x3b60a
leaq 0x29949(%rip), %rsi     # 0x64f43
pushq $0x2
popq %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x455bc
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::adjday_glot(bamboo::rtcm_t*, double)
static void adjday_glot(rtcm_t *rtcm, double tod)
{
    gtime_t time;
    double tow,tod_p;
    int week;
    
    if (rtcm->time.time==0) rtcm->time=utc2gpst(timeget());
    time=timeadd(gpst2utc(rtcm->time),10800.0); /* glonass time */
    tow=time2gpst(time,&week);
    tod_p=fmod(tow,86400.0); tow-=tod_p;
    if      (tod<tod_p-43200.0) tod+=86400.0;
    else if (tod>tod_p+43200.0) tod-=86400.0;
    time=gpst2time(week,tow+tod);
    rtcm->time=utc2gpst(timeadd(time,-10800.0));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, -0x20(%rbp)
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x3b63d
movsd 0x18(%rbx), %xmm0
jmp 0x3b656
callq 0x47349
movq %rax, %rdi
callq 0x477da
movq %rax, %rdi
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
callq 0x47732
movsd 0x2543d(%rip), %xmm1    # 0x60aa0
movq %rax, %rdi
callq 0x472ee
leaq -0xc(%rbp), %rsi
movq %rax, %rdi
callq 0x470f1
movsd 0x25241(%rip), %xmm1    # 0x608c0
movsd %xmm0, -0x18(%rbp)
callq 0x8840
movsd 0x2674f(%rip), %xmm1    # 0x61de0
addsd %xmm0, %xmm1
movsd -0x20(%rbp), %xmm2
ucomisd %xmm2, %xmm1
jbe 0x3b6aa
addsd 0x25218(%rip), %xmm2    # 0x608c0
jmp 0x3b6c4
movsd 0x26736(%rip), %xmm1    # 0x61de8
addsd %xmm0, %xmm1
ucomisd %xmm1, %xmm2
jbe 0x3b6c4
addsd 0x2672c(%rip), %xmm2    # 0x61df0
movsd -0x18(%rbp), %xmm1
subsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movl -0xc(%rbp), %edi
movapd %xmm1, %xmm0
callq 0x4708a
movsd 0x266d3(%rip), %xmm1    # 0x61db8
movq %rax, %rdi
callq 0x472ee
movq %rax, %rdi
callq 0x477da
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm1(bamboo::rtcm_t*, int, int)
static int encode_msm1(rtcm_t *rtcm, int sys, int sync)
{
    double rrng[64],rrate[64],psrng[64];
    int i,nsat,ncell;
    
    trace(3,"encode_msm1: sys=%d sync=%d\n",sys,sync);
    
    /* encode msm header */
    if (!(i=encode_msm_head(1,rtcm,sys,sync,&nsat,&ncell,rrng,rrate,NULL,psrng,
                            NULL,NULL,NULL,NULL,NULL))) {
        return 0;
    }
    /* encode msm satellite data */
    i=encode_msm_mod_rrng(rtcm,i,rrng ,nsat ); /* rough range modulo 1 ms */
    
    /* encode msm signal data */
    i=encode_msm_psrng   (rtcm,i,psrng,ncell); /* fine pseudorange */
    
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x658, %rsp            # imm = 0x658
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %rbx
leaq 0x244e1(%rip), %rsi     # 0x665c7
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %r13d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x455bc
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
leaq -0x230(%rbp), %rax
movq %rax, 0x18(%rsp)
leaq -0x630(%rbp), %rax
movq %rax, 0x8(%rsp)
leaq -0x430(%rbp), %rax
movq %rax, (%rsp)
andq $0x0, 0x40(%rsp)
andq $0x0, 0x10(%rsp)
pushq $0x1
popq %r15
leaq -0x30(%rbp), %r8
leaq -0x2c(%rbp), %r9
movl %r15d, %edi
movq %rbx, %rsi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x43a83
testl %eax, %eax
je 0x42187
movl -0x30(%rbp), %ecx
leaq -0x430(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x444ee
movl -0x2c(%rbp), %ecx
leaq -0x230(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x44589
movl %eax, 0x9f0bc(%rbx)
movl %r15d, %r14d
movl %r14d, %eax
addq $0x658, %rsp            # imm = 0x658
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm2(bamboo::rtcm_t*, int, int)
static int encode_msm2(rtcm_t *rtcm, int sys, int sync)
{
    double rrng[64],rrate[64],phrng[64],lock[64];
    unsigned char half[64];
    int i,nsat,ncell;
    
    trace(3,"encode_msm2: sys=%d sync=%d\n",sys,sync);
    
    /* encode msm header */
    if (!(i=encode_msm_head(2,rtcm,sys,sync,&nsat,&ncell,rrng,rrate,NULL,NULL,
                            phrng,NULL,lock,half,NULL))) {
        return 0;
    }
    /* encode msm satellite data */
    i=encode_msm_mod_rrng(rtcm,i,rrng ,nsat ); /* rough range modulo 1 ms */
    
    /* encode msm signal data */
    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 */
    
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x8a0, %rsp            # imm = 0x8A0
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x24453(%rip), %rsi     # 0x66611
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x455bc
leaq -0x70(%rbp), %rax
movq %rax, 0x38(%rsp)
leaq -0x270(%rbp), %rax
movq %rax, 0x30(%rsp)
leaq -0x470(%rbp), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq -0x870(%rbp), %rax
movq %rax, 0x8(%rsp)
leaq -0x670(%rbp), %rax
movq %rax, (%rsp)
andq $0x0, 0x40(%rsp)
andq $0x0, 0x28(%rsp)
pushq $0x2
popq %rdi
leaq -0x28(%rbp), %r8
leaq -0x24(%rbp), %r9
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x43a83
testl %eax, %eax
je 0x42295
movl -0x28(%rbp), %ecx
leaq -0x670(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x444ee
movl -0x24(%rbp), %r14d
leaq -0x470(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x447b0
leaq -0x270(%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
movl %eax, 0x9f0bc(%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0x8a0, %rsp            # imm = 0x8A0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm3(bamboo::rtcm_t*, int, int)
static int encode_msm3(rtcm_t *rtcm, int sys, int sync)
{
    double rrng[64],rrate[64],psrng[64],phrng[64],lock[64];
    unsigned char half[64];
    int i,nsat,ncell;
    
    trace(3,"encode_msm3: sys=%d sync=%d\n",sys,sync);
    
    /* encode msm header */
    if (!(i=encode_msm_head(3,rtcm,sys,sync,&nsat,&ncell,rrng,rrate,NULL,psrng,
                            phrng,NULL,lock,half,NULL))) {
        return 0;
    }
    /* encode msm satellite data */
    i=encode_msm_mod_rrng(rtcm,i,rrng ,nsat ); /* rough range modulo 1 ms */
    
    /* 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 */
    
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa48, %rsp            # imm = 0xA48
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x2438f(%rip), %rsi     # 0x6665b
xorl %r14d, %r14d
pushq $0x3
popq %r13
movl %r13d, %edi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x455bc
subq $0x8, %rsp
leaq -0x70(%rbp), %rax
leaq -0x270(%rbp), %r10
leaq -0x470(%rbp), %r11
leaq -0x30(%rbp), %r8
leaq -0x2c(%rbp), %r9
movl %r13d, %edi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
pushq $0x0
pushq %rax
pushq %r10
pushq $0x0
pushq %r11
leaq -0x670(%rbp), %rax
pushq %rax
pushq $0x0
leaq -0xa70(%rbp), %rax
pushq %rax
leaq -0x870(%rbp), %rax
pushq %rax
callq 0x43a83
addq $0x50, %rsp
testl %eax, %eax
je 0x423ac
movl -0x30(%rbp), %ecx
leaq -0x870(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x444ee
movl -0x2c(%rbp), %r14d
leaq -0x670(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44589
leaq -0x470(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x447b0
leaq -0x270(%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
movl %eax, 0x9f0bc(%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0xa48, %rsp            # imm = 0xA48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm4(bamboo::rtcm_t*, int, int)
static int encode_msm4(rtcm_t *rtcm, int sys, int sync)
{
    double rrng[64],rrate[64],psrng[64],phrng[64],lock[64];
    float cnr[64];
    unsigned char half[64];
    int i,nsat,ncell;
    
    trace(3,"encode_msm4: sys=%d sync=%d\n",sys,sync);
    
    /* encode msm header */
    if (!(i=encode_msm_head(4,rtcm,sys,sync,&nsat,&ncell,rrng,rrate,NULL,psrng,
                            phrng,NULL,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_mod_rrng(rtcm,i,rrng ,nsat ); /* rough range modulo 1 ms */
    
    /* 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 */
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb48, %rsp            # imm = 0xB48
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x24293(%rip), %rsi     # 0x66678
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x455bc
subq $0x8, %rsp
leaq -0x170(%rbp), %rax
leaq -0x70(%rbp), %r10
leaq -0x370(%rbp), %r11
leaq -0x570(%rbp), %r13
pushq $0x4
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 $0x0
pushq %r13
leaq -0x770(%rbp), %rax
pushq %rax
pushq $0x0
leaq -0xb70(%rbp), %rax
pushq %rax
leaq -0x970(%rbp), %rax
pushq %rax
callq 0x43a83
addq $0x50, %rsp
testl %eax, %eax
je 0x424f7
movl -0x30(%rbp), %r14d
leaq -0x970(%rbp), %r15
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x44a80
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x444ee
movl -0x2c(%rbp), %r14d
leaq -0x770(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44589
leaq -0x570(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x447b0
leaq -0x370(%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 -0x170(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44b6f
movl %eax, 0x9f0bc(%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0xb48, %rsp            # imm = 0xB48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm6(bamboo::rtcm_t*, int, int)
static int encode_msm6(rtcm_t *rtcm, int sys, int sync)
{
    double rrng[64],rrate[64],psrng[64],phrng[64],lock[64];
    float cnr[64];
    unsigned char half[64];
    int i,nsat,ncell;
    
    trace(3,"encode_msm6: sys=%d sync=%d\n",sys,sync);
    
    /* encode msm header */
    if (!(i=encode_msm_head(6,rtcm,sys,sync,&nsat,&ncell,rrng,rrate,NULL,psrng,
                            phrng,NULL,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_mod_rrng(rtcm,i,rrng ,nsat ); /* rough range modulo 1 ms */
    
    /* 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 */
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb48, %rsp            # imm = 0xB48
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x2407a(%rip), %rsi     # 0x6673d
xorl %r14d, %r14d
pushq $0x3
popq %rdi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x455bc
subq $0x8, %rsp
leaq -0x170(%rbp), %rax
leaq -0x70(%rbp), %r10
leaq -0x370(%rbp), %r11
leaq -0x570(%rbp), %r13
pushq $0x6
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 $0x0
pushq %r13
leaq -0x770(%rbp), %rax
pushq %rax
pushq $0x0
leaq -0xb70(%rbp), %rax
pushq %rax
leaq -0x970(%rbp), %rax
pushq %rax
callq 0x43a83
addq $0x50, %rsp
testl %eax, %eax
je 0x427d5
movl -0x30(%rbp), %r14d
leaq -0x970(%rbp), %r15
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x44a80
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x444ee
movl -0x2c(%rbp), %r14d
leaq -0x770(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44dd8
leaq -0x570(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44ec2
leaq -0x370(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44fac
leaq -0x70(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x44a22
leaq -0x170(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x45277
movl %eax, 0x9f0bc(%rbx)
pushq $0x1
popq %r14
movl %r14d, %eax
addq $0xb48, %rsp            # imm = 0xB48
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_head(int, bamboo::rtcm_t*, int, int, int)
static int encode_head(int type, rtcm_t *rtcm, int sys, int sync, int nsat)
{
    double tow;
    int i=24,week,epoch;
    
    trace(4,"encode_head: type=%d sync=%d sys=%d nsat=%d\n",type,sync,sys,nsat);
    
    setbitu(rtcm->buff,i,12,type       ); i+=12; /* message no */
    setbitu(rtcm->buff,i,12,rtcm->staid); i+=12; /* ref station id */
    
    if (sys==SYS_GLO) {
        tow=time2gpst(timeadd(gpst2utc(rtcm->time),10800.0),&week);
        epoch=ROUND(fmod(tow,86400.0)/0.001);
        setbitu(rtcm->buff,i,27,epoch); i+=27; /* glonass epoch time */
    }
    else {
        tow=time2gpst(rtcm->time,&week);
        epoch=ROUND(tow/0.001);
        setbitu(rtcm->buff,i,30,epoch); i+=30; /* gps epoch time */
    }
    setbitu(rtcm->buff,i, 1,sync); i+= 1; /* synchronous gnss flag */
    setbitu(rtcm->buff,i, 5,nsat); i+= 5; /* no of satellites */
    setbitu(rtcm->buff,i, 1,0   ); i+= 1; /* smoothing indicator */
    setbitu(rtcm->buff,i, 3,0   ); i+= 3; /* smoothing interval */
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r9d
movl %edx, %r12d
movq %rsi, %r13
movl %edi, %ebx
leaq 0x23494(%rip), %rsi     # 0x662b9
pushq $0x4
popq %rdi
movl %ebx, %edx
movl %ecx, -0x2c(%rbp)
movl %r12d, %r8d
movl %r9d, -0x30(%rbp)
xorl %eax, %eax
callq 0x455bc
leaq 0x9f0c4(%r13), %r14
pushq $0x18
popq %rsi
pushq $0xc
popq %r15
movq %r14, %rdi
movl %r15d, %edx
movl %ebx, %ecx
callq 0x45a69
movl (%r13), %ecx
pushq $0x24
popq %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x45a69
movq 0x10(%r13), %rdi
movsd 0x18(%r13), %xmm0
cmpl $0x4, %r12d
jne 0x42eae
callq 0x47732
movsd 0x1dc1b(%rip), %xmm1    # 0x60aa0
movq %rax, %rdi
callq 0x472ee
leaq -0x34(%rbp), %rsi
movq %rax, %rdi
callq 0x470f1
movsd 0x1da1f(%rip), %xmm1    # 0x608c0
callq 0x8840
pushq $0x4b
popq %r12
pushq $0x1b
jmp 0x42ebd
leaq -0x34(%rbp), %rsi
callq 0x470f1
pushq $0x4e
popq %r12
pushq $0x1e
popq %r13
divsd 0x1eeb1(%rip), %xmm0    # 0x61d78
addsd 0x1eda9(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %ecx
pushq $0x30
popq %rsi
movq %r14, %rdi
movl %r13d, %edx
callq 0x45a69
pushq $0x1
popq %rbx
movq %r14, %rdi
movl %r12d, %esi
movl %ebx, %edx
movl -0x2c(%rbp), %ecx
callq 0x45a69
leal 0x1(%r12), %esi
pushq $0x5
popq %rdx
movq %r14, %rdi
movl -0x30(%rbp), %ecx
callq 0x45a69
leal 0x6(%r12), %esi
movq %r14, %rdi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x45a69
leal 0x7(%r12), %esi
pushq $0x3
popq %rdx
movq %r14, %rdi
xorl %ecx, %ecx
callq 0x45a69
addl $0xa, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::to_lock(int)
static int to_lock(int lock)
{
    if (lock<0  ) return 0;
    if (lock<24 ) return lock;
    if (lock<72 ) return (lock+24  )/2;
    if (lock<168) return (lock+120 )/4;
    if (lock<360) return (lock+408 )/8;
    if (lock<744) return (lock+1176)/16;
    if (lock<937) return (lock+3096)/32;
    return 127;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testl %edi, %edi
js 0x4330a
movl %edi, %eax
cmpl $0x18, %edi
jb 0x4330c
cmpl $0x47, %eax
ja 0x4330e
addl $0x18, %eax
shrl %eax
jmp 0x4330c
xorl %eax, %eax
popq %rbp
retq
cmpl $0xa7, %eax
ja 0x4331d
addl $0x78, %eax
shrl $0x2, %eax
jmp 0x4330c
cmpl $0x167, %eax            # imm = 0x167
ja 0x4332e
addl $0x198, %eax            # imm = 0x198
shrl $0x3, %eax
jmp 0x4330c
cmpl $0x2e7, %eax            # imm = 0x2E7
ja 0x4333f
addl $0x498, %eax            # imm = 0x498
shrl $0x4, %eax
jmp 0x4330c
cmpl $0x3a8, %eax            # imm = 0x3A8
ja 0x43350
addl $0xc18, %eax            # imm = 0xC18
shrl $0x5, %eax
jmp 0x4330c
movl $0x7f, %eax
jmp 0x4330c
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::set38bits(unsigned char*, int, double)
static void set38bits(unsigned char *buff, int pos, double value)
{
    int word_h=(int)floor(value/64.0);
    unsigned int word_l=(unsigned int)(value-word_h*64.0);
    setbits(buff,pos  ,32,word_h);
    setbitu(buff,pos+32,6,word_l);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movapd %xmm0, %xmm1
movsd %xmm0, -0x20(%rbp)
movl %esi, %ebx
movq %rdi, %r14
movsd 0x1f9a9(%rip), %xmm0    # 0x62d20
mulsd %xmm1, %xmm0
callq 0x8ac0
cvttsd2si %xmm0, %ecx
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
mulsd 0x228a4(%rip), %xmm0    # 0x65c38
addsd -0x20(%rbp), %xmm0
cvttsd2si %xmm0, %r15
pushq $0x20
popq %rdx
movq %r14, %rdi
movl %ebx, %esi
callq 0x45ae0
addl $0x20, %ebx
pushq $0x6
popq %rdx
movq %r14, %rdi
movl %ebx, %esi
movl %r15d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x45a69
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_mod_rrng(bamboo::rtcm_t*, int, double const*, int)
static int encode_msm_mod_rrng(rtcm_t *rtcm, int i, const double *rrng,
                               int nsat)
{
    unsigned int mod_ms;
    int j;
    
    for (j=0;j<nsat;j++) {
        if (rrng[j]<=0.0||rrng[j]>RANGE_MS*255.0) {
            mod_ms=0;
        }
        else {
            mod_ms=ROUND_U(rrng[j]/RANGE_MS/P2_10)&0x3FFu;
        }
        setbitu(rtcm->buff,i,10,mod_ms); i+=10;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %r12
addq $0x9f0c4, %r12          # imm = 0x9F0C4
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x44577
movsd (%r15,%r13,8), %xmm0
xorl %ecx, %ecx
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jae 0x44560
ucomisd 0x2171a(%rip), %xmm0    # 0x65c50
ja 0x44560
divsd 0x201b8(%rip), %xmm0    # 0x646f8
mulsd 0x21700(%rip), %xmm0    # 0x65c48
addsd 0x1d728(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %rcx
andl $0x3ff, %ecx            # imm = 0x3FF
movq %r12, %rdi
movl %r14d, %esi
pushq $0xa
popq %rdx
callq 0x45a69
addl $0xa, %r14d
incq %r13
jmp 0x44517
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_psrng(bamboo::rtcm_t*, int, double const*, int)
static int encode_msm_psrng(rtcm_t *rtcm, int i, const double *psrng, int ncell)
{
    int j,psrng_val;
    
    for (j=0;j<ncell;j++) {
        if (psrng[j]==0.0) {
            psrng_val=-16384;
        }
        else if (fabs(psrng[j])>292.7) {
            trace(2,"msm fine pseudorange overflow %s psrng=%.3f\n",
                 time_str(rtcm->time,0),psrng[j]);
            psrng_val=-16384;
        }
        else {
            psrng_val=ROUND(psrng[j]/RANGE_MS/P2_24);
        }
        setbits(rtcm->buff,i,15,psrng_val); i+=15;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, -0x30(%rbp)
leaq 0x9f0c4(%rdi), %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x44661
movsd (%r15,%r13,8), %xmm0
movl $0xffffc000, %r12d      # imm = 0xFFFFC000
ucomisd 0x1c321(%rip), %xmm0    # 0x608f8
jne 0x445db
jnp 0x44643
movapd %xmm0, %xmm1
andpd 0x1b349(%rip), %xmm1    # 0x5f930
ucomisd 0x21669(%rip), %xmm1    # 0x65c58
jbe 0x44621
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movsd 0x18(%rax), %xmm0
xorl %esi, %esi
callq 0x47b0e
movsd (%r15,%r13,8), %xmm0
pushq $0x2
popq %rdi
leaq 0x21fcf(%rip), %rsi     # 0x665e4
movq %rax, %rdx
movb $0x1, %al
callq 0x455bc
jmp 0x44643
divsd 0x200cf(%rip), %xmm0    # 0x646f8
mulsd 0x2162f(%rip), %xmm0    # 0x65c60
addsd 0x1d63f(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %r12d
movq -0x38(%rbp), %rdi
movl %r14d, %esi
pushq $0xf
popq %rdx
movl %r12d, %ecx
callq 0x45ae0
addl $0xf, %r14d
incq %r13
jmp 0x445ba
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::to_sigid(int, unsigned char, int*)
static int to_sigid(int sys, unsigned char code, int *freq)
{
    const char **msm_sig;
    char *sig;
    int i;
    
    /* signal conversion for undefined signal by rtcm */
    if (sys==SYS_GPS) {
        if      (code==CODE_L1Y) code=CODE_L1P;
        else if (code==CODE_L1M) code=CODE_L1P;
        else if (code==CODE_L1N) code=CODE_L1P;
        else if (code==CODE_L2D) code=CODE_L2P;
        else if (code==CODE_L2Y) code=CODE_L2P;
        else if (code==CODE_L2M) code=CODE_L2P;
        else if (code==CODE_L2N) code=CODE_L2P;
    }
    if (!*(sig=code2obs(code,freq))) return 0;
    
    switch (sys) {
        case SYS_GPS: msm_sig=msm_sig_gps; break;
        case SYS_GLO: msm_sig=msm_sig_glo; break;
        case SYS_GAL: msm_sig=msm_sig_gal; break;
        case SYS_QZS: msm_sig=msm_sig_qzs; break;
        case SYS_SBS: msm_sig=msm_sig_sbs; break;
        case SYS_CMP: msm_sig=msm_sig_cmp; break;
        default: return 0;
    }
    /* freqency index for beidou and galileo */
    if (sys==SYS_CMP) {
        if      (*freq==5) *freq=2; /* B2 */
        else if (*freq==4) *freq=3; /* B3 */
    }
    else if (sys==SYS_GAL) {
        if (*freq==5) *freq=2; /* E5b */
    }
    for (i=0;i<32;i++) {
        if (!strcmp(sig,msm_sig[i])) return i+1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %edi, %r15d
cmpl $0x1, %edi
jne 0x446ec
movzbl %sil, %eax
movb $0x2, %sil
leal -0x4(%rax), %ecx
cmpl $0x3, %ecx
jb 0x446ec
cmpl $0x16, %eax
je 0x446df
cmpl $0x15, %eax
je 0x446df
cmpl $0xf, %eax
jne 0x446e4
movb $0x13, %sil
jmp 0x446ec
cmpb $0x17, %al
pushq $0x13
popq %rsi
cmovnel %eax, %esi
movzbl %sil, %edi
movq %rbx, %rsi
callq 0x456f5
xorl %r12d, %r12d
cmpb $0x0, (%rax)
je 0x447a4
movq %rax, %r14
leal -0x1(%r15), %eax
cmpl $0x7, %eax
ja 0x44729
leaq 0x21975(%rip), %rcx     # 0x6608c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x41f39(%rip), %r15     # 0x86660
jmp 0x4477f
cmpl $0x10, %r15d
je 0x44770
cmpl $0x20, %r15d
jne 0x447a4
movl (%rbx), %eax
leaq 0x42422(%rip), %r15     # 0x86b60
cmpl $0x4, %eax
je 0x44779
cmpl $0x5, %eax
je 0x44756
jmp 0x4477f
leaq 0x4210f(%rip), %r15     # 0x86860
cmpl $0x5, (%rbx)
jne 0x4477f
movl $0x2, (%rbx)
jmp 0x4477f
leaq 0x422fb(%rip), %r15     # 0x86a60
jmp 0x4477f
leaq 0x41ff2(%rip), %r15     # 0x86760
jmp 0x4477f
leaq 0x421e9(%rip), %r15     # 0x86960
jmp 0x4477f
movl $0x3, (%rbx)
xorl %r12d, %r12d
xorl %ebx, %ebx
cmpq $0x20, %rbx
je 0x447a4
movq (%r15,%rbx,8), %rsi
movq %r14, %rdi
callq 0x8890
testl %eax, %eax
je 0x4479f
incq %rbx
jmp 0x44784
incl %ebx
movl %ebx, %r12d
movl %r12d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_phrng(bamboo::rtcm_t*, int, double const*, int)
static int encode_msm_phrng(rtcm_t *rtcm, int i, const double *phrng, int ncell)
{
    int j,phrng_val;
    
    for (j=0;j<ncell;j++) {
        if (phrng[j]==0.0) {
            phrng_val=-2097152;
        }
        else if (fabs(phrng[j])>1171.0) {
            trace(2,"msm fine phase-range overflow %s phrng=%.3f\n",
                 time_str(rtcm->time,0),phrng[j]);
            phrng_val=-2097152;
        }
        else {
            phrng_val=ROUND(phrng[j]/RANGE_MS/P2_29);
        }
        setbits(rtcm->buff,i,22,phrng_val); i+=22;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, -0x30(%rbp)
leaq 0x9f0c4(%rdi), %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x44888
movsd (%r15,%r13,8), %xmm0
movl $0xffe00000, %r12d      # imm = 0xFFE00000
ucomisd 0x1c0fa(%rip), %xmm0    # 0x608f8
jne 0x44802
jnp 0x4486a
movapd %xmm0, %xmm1
andpd 0x1b122(%rip), %xmm1    # 0x5f930
ucomisd 0x2142a(%rip), %xmm1    # 0x65c40
jbe 0x44848
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movsd 0x18(%rax), %xmm0
xorl %esi, %esi
callq 0x47b0e
movsd (%r15,%r13,8), %xmm0
pushq $0x2
popq %rdi
leaq 0x21df2(%rip), %rsi     # 0x6662e
movq %rax, %rdx
movb $0x1, %al
callq 0x455bc
jmp 0x4486a
divsd 0x1fea8(%rip), %xmm0    # 0x646f8
mulsd 0x21390(%rip), %xmm0    # 0x65be8
addsd 0x1d418(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %r12d
movq -0x38(%rbp), %rdi
movl %r14d, %esi
pushq $0x16
popq %rdx
movl %r12d, %ecx
callq 0x45ae0
addl $0x16, %r14d
incq %r13
jmp 0x447e1
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_lock(bamboo::rtcm_t*, int, double const*, int)
static int encode_msm_lock(rtcm_t *rtcm, int i, const double *lock, int ncell)
{
    int j,lock_val;
    
    for (j=0;j<ncell;j++) {
        lock_val=to_msm_lock(lock[j]);
        setbitu(rtcm->buff,i,4,lock_val); i+=4;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %r15
movq %rdi, %r12
addq $0x9f0c4, %r12          # imm = 0x9F0C4
xorl %ebx, %ebx
testl %ecx, %ecx
cmovlel %ebx, %r14d
shlq $0x2, %r14
movl %esi, -0x2c(%rbp)
movl %esi, %r13d
cmpq %rbx, %r14
je 0x44a0e
movsd (%r15,%rbx,2), %xmm0
xorl %ecx, %ecx
movsd 0x21385(%rip), %xmm1    # 0x65c68
ucomisd %xmm0, %xmm1
ja 0x449f6
movsd 0x1d49b(%rip), %xmm1    # 0x61d90
ucomisd %xmm0, %xmm1
pushq $0x1
popq %rcx
ja 0x449f6
movsd 0x21366(%rip), %xmm1    # 0x65c70
ucomisd %xmm0, %xmm1
pushq $0x2
popq %rcx
ja 0x449f6
movsd 0x21359(%rip), %xmm1    # 0x65c78
ucomisd %xmm0, %xmm1
pushq $0x3
popq %rcx
ja 0x449f6
movsd 0x2134c(%rip), %xmm1    # 0x65c80
ucomisd %xmm0, %xmm1
pushq $0x4
popq %rcx
ja 0x449f6
movsd 0x2133f(%rip), %xmm1    # 0x65c88
ucomisd %xmm0, %xmm1
pushq $0x5
popq %rcx
ja 0x449f6
movsd 0x21332(%rip), %xmm1    # 0x65c90
ucomisd %xmm0, %xmm1
pushq $0x6
popq %rcx
ja 0x449f6
movsd 0x21325(%rip), %xmm1    # 0x65c98
ucomisd %xmm0, %xmm1
pushq $0x7
popq %rcx
ja 0x449f6
movsd 0x2131c(%rip), %xmm1    # 0x65ca0
ucomisd %xmm0, %xmm1
pushq $0x8
popq %rcx
ja 0x449f6
movsd 0x21313(%rip), %xmm1    # 0x65ca8
ucomisd %xmm0, %xmm1
pushq $0x9
popq %rcx
ja 0x449f6
movsd 0x2130a(%rip), %xmm1    # 0x65cb0
ucomisd %xmm0, %xmm1
pushq $0xa
popq %rcx
ja 0x449f6
movsd 0x21301(%rip), %xmm1    # 0x65cb8
ucomisd %xmm0, %xmm1
pushq $0xb
popq %rcx
ja 0x449f6
movsd 0x212f8(%rip), %xmm1    # 0x65cc0
ucomisd %xmm0, %xmm1
pushq $0xc
popq %rcx
ja 0x449f6
movsd 0x212ef(%rip), %xmm1    # 0x65cc8
ucomisd %xmm0, %xmm1
pushq $0xd
popq %rcx
ja 0x449f6
xorl %ecx, %ecx
movsd 0x212e4(%rip), %xmm1    # 0x65cd0
ucomisd %xmm0, %xmm1
seta %cl
xorl $0xf, %ecx
leaq (%rbx,%r13), %rsi
movq %r12, %rdi
pushq $0x4
popq %rdx
callq 0x45a69
addq $0x4, %rbx
jmp 0x448ca
movl -0x2c(%rbp), %eax
addl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_half_amb(bamboo::rtcm_t*, int, unsigned char const*, int)
static int encode_msm_half_amb(rtcm_t *rtcm, int i, const unsigned char *half,
                               int ncell)
{
    int j;
    
    for (j=0;j<ncell;j++) {
        setbitu(rtcm->buff,i,1,half[j]); i+=1;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r14d
movq %rdx, %r15
movq %rdi, %r12
addq $0x9f0c4, %r12          # imm = 0x9F0C4
xorl %ebx, %ebx
testl %ecx, %ecx
cmovlel %ebx, %r14d
movl %esi, -0x2c(%rbp)
movl %esi, %r13d
cmpq %rbx, %r14
je 0x44a6c
leaq (%rbx,%r13), %rsi
movzbl (%r15,%rbx), %ecx
movq %r12, %rdi
pushq $0x1
popq %rdx
callq 0x45a69
incq %rbx
jmp 0x44a4e
movl -0x2c(%rbp), %eax
addl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_int_rrng(bamboo::rtcm_t*, int, double const*, int)
static int encode_msm_int_rrng(rtcm_t *rtcm, int i, const double *rrng,
                               int nsat)
{
    unsigned int int_ms;
    int j;
    
    for (j=0;j<nsat;j++) {
        if (rrng[j]==0.0) {
            int_ms=255;
        }
        else if (rrng[j]<0.0||rrng[j]>RANGE_MS*255.0) {
            trace(2,"msm rough range overflow %s rrng=%.3f\n",
                 time_str(rtcm->time,0),rrng[j]);
            int_ms=255;
        }
        else {
            int_ms=ROUND_U(rrng[j]/RANGE_MS/P2_10)>>10;
        }
        setbitu(rtcm->buff,i,8,int_ms); i+=8;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r14d
movq %rdx, %r15
movq %rdi, -0x38(%rbp)
leaq 0x9f0c4(%rdi), %rax
movq %rax, -0x40(%rbp)
xorl %ebx, %ebx
testl %ecx, %ecx
cmovlel %ebx, %r14d
shlq $0x3, %r14
movl %esi, -0x2c(%rbp)
movl %esi, %r13d
xorpd %xmm1, %xmm1
cmpq %rbx, %r14
je 0x44b5b
movsd (%r15,%rbx), %xmm0
movl $0xff, %r12d
ucomisd %xmm1, %xmm0
jne 0x44ad9
jnp 0x44b3f
ucomisd %xmm0, %xmm1
ja 0x44b11
ucomisd 0x21169(%rip), %xmm0    # 0x65c50
ja 0x44b11
divsd 0x1fc07(%rip), %xmm0    # 0x646f8
mulsd 0x2114f(%rip), %xmm0    # 0x65c48
addsd 0x1d177(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %r12
shrl $0xa, %r12d
jmp 0x44b3f
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rdi
movsd 0x18(%rax), %xmm0
xorl %esi, %esi
callq 0x47b0e
movsd (%r15,%rbx), %xmm0
pushq $0x2
popq %rdi
leaq 0x21b60(%rip), %rsi     # 0x66695
movq %rax, %rdx
movb $0x1, %al
callq 0x455bc
leaq (%rbx,%r13), %rsi
movq -0x40(%rbp), %rdi
pushq $0x8
popq %rdx
movl %r12d, %ecx
callq 0x45a69
addq $0x8, %rbx
jmp 0x44ab8
movl -0x2c(%rbp), %eax
addl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_cnr(bamboo::rtcm_t*, int, float const*, int)
static int encode_msm_cnr(rtcm_t *rtcm, int i, const float *cnr, int ncell)
{
    int j,cnr_val;
    
    for (j=0;j<ncell;j++) {
        cnr_val=ROUND(cnr[j]/1.0);
        setbitu(rtcm->buff,i,6,cnr_val); i+=6;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %r12
addq $0x9f0c4, %r12          # imm = 0x9F0C4
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x44bcb
cvtss2sd (%r15,%r13,4), %xmm0
addsd 0x1d0cd(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %ecx
movq %r12, %rdi
movl %r14d, %esi
pushq $0x6
popq %rdx
callq 0x45a69
addl $0x6, %r14d
incq %r13
jmp 0x44b98
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_info(bamboo::rtcm_t*, int, unsigned char const*, int)
static int encode_msm_info(rtcm_t *rtcm, int i, const unsigned char *info,
                           int nsat)
{
    int j;
    
    for (j=0;j<nsat;j++) {
        setbitu(rtcm->buff,i,4,info[j]); i+=4;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %r12
addq $0x9f0c4, %r12          # imm = 0x9F0C4
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x44c27
movzbl (%r15,%r13), %ecx
movq %r12, %rdi
movl %r14d, %esi
pushq $0x4
popq %rdx
callq 0x45a69
addl $0x4, %r14d
incq %r13
jmp 0x44c06
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_rrate(bamboo::rtcm_t*, int, double const*, int)
static int encode_msm_rrate(rtcm_t *rtcm, int i, const double *rrate, int nsat)
{
    int j,rrate_val;
    
    for (j=0;j<nsat;j++) {
        if (fabs(rrate[j])>8191.0) {
            trace(2,"msm rough phase-range-rate overflow %s rrate=%.4f\n",
                 time_str(rtcm->time,0),rrate[j]);
            rrate_val=-8192;
        }
        else {
            rrate_val=ROUND(rrate[j]/1.0);
        }
        setbits(rtcm->buff,i,14,rrate_val); i+=14;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, %r12
leaq 0x9f0c4(%rdi), %rax
movq %rax, -0x30(%rbp)
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x44ce4
movsd (%r15,%r13,8), %xmm0
movapd %xmm0, %xmm1
andpd 0x1acb3(%rip), %xmm1    # 0x5f930
ucomisd 0x21053(%rip), %xmm1    # 0x65cd8
jbe 0x44cbb
movq 0x10(%r12), %rdi
movsd 0x18(%r12), %xmm0
xorl %esi, %esi
callq 0x47b0e
movsd (%r15,%r13,8), %xmm0
pushq $0x2
popq %rdi
leaq 0x21a2f(%rip), %rsi     # 0x666d9
movq %rax, %rdx
movb $0x1, %al
callq 0x455bc
movl $0xffffe000, %ecx       # imm = 0xFFFFE000
jmp 0x44ccc
addsd 0x1cfb5(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %ecx
movq -0x30(%rbp), %rdi
movl %r14d, %esi
pushq $0xe
popq %rdx
callq 0x45ae0
addl $0xe, %r14d
incq %r13
jmp 0x44c66
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_msm_rate(bamboo::rtcm_t*, int, double const*, int)
static int encode_msm_rate(rtcm_t *rtcm, int i, const double *rate, int ncell)
{
    int j,rate_val;
    
    for (j=0;j<ncell;j++) {
        if (rate[j]==0.0) {
            rate_val=-16384;
        }
        else if (fabs(rate[j])>1.6384) {
            trace(2,"msm fine phase-range-rate overflow %s rate=%.3f\n",
                 time_str(rtcm->time,0),rate[j]);
            rate_val=-16384;
        }
        else {
            rate_val=ROUND(rate[j]/0.0001);
        }
        setbitu(rtcm->buff,i,15,rate_val); i+=15;
    }
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %ebx
movq %rdx, %r15
movl %esi, %r14d
movq %rdi, -0x30(%rbp)
leaq 0x9f0c4(%rdi), %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
testl %ecx, %ecx
cmovlel %r13d, %ebx
cmpq %r13, %rbx
je 0x44dc6
movsd (%r15,%r13,8), %xmm0
movl $0xffffc000, %r12d      # imm = 0xFFFFC000
ucomisd 0x1bbb4(%rip), %xmm0    # 0x608f8
jne 0x44d48
jnp 0x44da8
movapd %xmm0, %xmm1
andpd 0x1abdc(%rip), %xmm1    # 0x5f930
ucomisd 0x20f84(%rip), %xmm1    # 0x65ce0
jbe 0x44d8e
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movsd 0x18(%rax), %xmm0
xorl %esi, %esi
callq 0x47b0e
movsd (%r15,%r13,8), %xmm0
pushq $0x2
popq %rdi
leaq 0x2198a(%rip), %rsi     # 0x6670c
movq %rax, %rdx
movb $0x1, %al
callq 0x455bc
jmp 0x44da8
divsd 0x1bb7a(%rip), %xmm0    # 0x60910
addsd 0x1ceda(%rip), %xmm0    # 0x61c78
callq 0x8ac0
cvttsd2si %xmm0, %r12d
movq -0x38(%rbp), %rdi
movl %r14d, %esi
pushq $0xf
popq %rdx
movl %r12d, %ecx
callq 0x45a69
addl $0xf, %r14d
incq %r13
jmp 0x44d27
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq