LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm2.cpp
// Function: bamboo::obsindex(bamboo::obs_t*, bamboo::gtime_t, int)
static int obsindex(obs_t *obs, gtime_t time, int sat)
{
    int i,j;
    
    for (i=0;i<obs->n;i++) {
        if (obs->data[i].sat==sat) return i; /* field already exists */
    }
    if (i>=MAXOBS) return -1; /* overflow */
    
    /* add new field */
    obs->data[i].time=time;
    obs->data[i].sat=sat;
    for (j=0;j<NFREQ;j++) {
        obs->data[i].L[j]=obs->data[i].P[j]=0.0;
        obs->data[i].D[j]=0.0;
        obs->data[i].SNR[j]=obs->data[i].LLI[j]=obs->data[i].code[j]=0;
    }
    obs->n++;
    return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movslq (%rdi), %rcx
testq %rcx, %rcx
jle 0x3addb
movq 0x8(%rdi), %r8
addq $0x10, %r8
xorl %eax, %eax
movzbl (%r8), %r9d
cmpl %edx, %r9d
je 0x3ae4d
incq %rax
addq $0x60, %r8
cmpq %rax, %rcx
jne 0x3adc0
jmp 0x3addd
xorl %ecx, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x3f, %ecx
ja 0x3ae4d
movq 0x8(%rdi), %r8
movl %ecx, %eax
shlq $0x5, %rax
leaq (%rax,%rax,2), %rax
movq %rsi, (%r8,%rax)
movsd %xmm0, 0x8(%r8,%rax)
movb %dl, 0x10(%r8,%rax)
xorl %edx, %edx
xorl %esi, %esi
movq 0x8(%rdi), %r8
addq %rax, %r8
movq %rdx, 0x38(%r8,%rsi,8)
movq %rdx, 0x20(%r8,%rsi,8)
movl $0x0, 0x50(%r8,%rsi,4)
movb %dl, 0x18(%rsi,%r8)
movq 0x8(%rdi), %r8
addq %rax, %r8
movb %dl, 0x15(%rsi,%r8)
movq 0x8(%rdi), %r8
addq %rax, %r8
movb %dl, 0x12(%rsi,%r8)
incq %rsi
cmpq $0x3, %rsi
jne 0x3ae09
incl (%rdi)
movl %ecx, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_type1007(bamboo::rtcm_t*)
static int decode_type1007(rtcm_t *rtcm)
{
    char des[32]="";
    char *msg;
    int i=24+12,j,staid,n,setup;
    
    n=getbitu(rtcm->buff,i+12,8);
    
    if (i+28+8*n<=rtcm->len*8) {
        staid=getbitu(rtcm->buff,i,12); i+=12+8;
        for (j=0;j<n&&j<31;j++) {
            des[j]=(char)getbitu(rtcm->buff,i,8); i+=8;
        }
        setup=getbitu(rtcm->buff,i, 8);
    }
    else {
        trace(2,"rtcm3 1007 length error: len=%d\n",rtcm->len);
        return -1;
    }
    if (rtcm->outtype) {
        msg=rtcm->msgtype+strlen(rtcm->msgtype);
        sprintf(msg," staid=%4d",staid);
    }
    /* test station id */
    if (!test_staid(rtcm,staid)) return -1;
    
    strncpy(rtcm->sta.antdes,des,n); rtcm->sta.antdes[n]='\0';
    rtcm->sta.antsetup=setup;
    rtcm->sta.antsno[0]='\0';
    return 5;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
leaq 0x9f0c4(%rdi), %r12
movq %r12, %rdi
movl $0x30, %esi
movl $0x8, %edx
callq 0x4e341
movl %eax, %r14d
leal 0x40(,%r14,8), %eax
movl 0x9f0c0(%rbx), %edx
leal (,%rdx,8), %ecx
cmpl %ecx, %eax
jle 0x3c2e8
leaq 0x32dec(%rip), %rsi     # 0x6f0c3
movl $0x2, %edi
xorl %eax, %eax
callq 0x4ded0
jmp 0x3c3d8
movq %r12, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e341
movl %eax, -0x2c(%rbp)
testl %r14d, %r14d
movq %r14, -0x38(%rbp)
jle 0x3c346
leal -0x1(%r14), %eax
cmpl $0x1e, %eax
movl $0x1e, %r15d
cmovbl %eax, %r15d
incl %r15d
movl $0x38, %r13d
xorl %r14d, %r14d
movq %r12, %rdi
movl %r13d, %esi
movl $0x8, %edx
callq 0x4e341
movb %al, -0x60(%rbp,%r14)
addl $0x8, %r13d
incq %r14
cmpq %r14, %r15
jne 0x3c323
jmp 0x3c34c
movl $0x38, %r13d
movq %r12, %rdi
movl %r13d, %esi
movl $0x8, %edx
callq 0x4e341
movl %eax, %r12d
cmpl $0x0, 0xc(%rbx)
movl -0x2c(%rbp), %r14d
je 0x3c391
leaq 0x9b9d0(%rbx), %rdi
callq 0x8290
leaq (%rbx,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
leaq 0x32d5d(%rip), %rsi     # 0x6f0e4
movl %r14d, %edx
xorl %eax, %eax
callq 0x8120
movq %rbx, %rdi
movl %r14d, %esi
callq 0x42f7e
testl %eax, %eax
movq -0x38(%rbp), %rax
je 0x3c3d8
leaq 0x6efb8(%rbx), %rdi
movslq %eax, %r14
leaq -0x60(%rbp), %rsi
movq %r14, %rdx
callq 0x8350
xorl %eax, %eax
movb %al, 0x6efb8(%rbx,%r14)
movl %r12d, 0x6f0f8(%rbx)
movb %al, 0x6eff8(%rbx)
movl $0x5, %eax
jmp 0x3c3dd
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3.cpp
// Function: bamboo::decode_type1029(bamboo::rtcm_t*)
static int decode_type1029(rtcm_t *rtcm)
{
    char *msg;
    int i=24+12,j,staid,mjd,tod,nchar,cunit;
    
    if (i+60<=rtcm->len*8) {
        staid=getbitu(rtcm->buff,i,12); i+=12;
        mjd  =getbitu(rtcm->buff,i,16); i+=16;
        tod  =getbitu(rtcm->buff,i,17); i+=17;
        nchar=getbitu(rtcm->buff,i, 7); i+= 7;
        cunit=getbitu(rtcm->buff,i, 8); i+= 8;
    }
    else {
        trace(2,"rtcm3 1029 length error: len=%d\n",rtcm->len);
        return -1;
    }
    if (i+nchar*8>rtcm->len*8) {
        trace(2,"rtcm3 1029 length error: len=%d nchar=%d\n",rtcm->len,nchar);
        return -1;
    } 
    for (j=0;j<nchar&&j<126;j++) {
        rtcm->msg[j]=getbitu(rtcm->buff,i,8); i+=8;
    }
    rtcm->msg[j]='\0';
    
    if (rtcm->outtype) {
        msg=rtcm->msgtype+strlen(rtcm->msgtype);
        sprintf(msg," staid=%4d text=%s",staid,rtcm->msg);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x9f0c0(%rdi), %edx
cmpl $0xc, %edx
jl 0x3dfa8
movq %rdi, %rbx
leaq 0x9f0c4(%rdi), %r15
movq %r15, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e341
movl %eax, %r14d
movq %r15, %rdi
movl $0x30, %esi
movl $0x10, %edx
callq 0x4e341
movq %r15, %rdi
movl $0x40, %esi
movl $0x11, %edx
callq 0x4e341
movq %r15, %rdi
movl $0x51, %esi
movl $0x7, %edx
callq 0x4e341
movl %eax, %r13d
movq %r15, %rdi
movl $0x58, %esi
movl $0x8, %edx
callq 0x4e341
leal 0x60(,%r13,8), %eax
movl 0x9f0c0(%rbx), %edx
leal (,%rdx,8), %ecx
cmpl %ecx, %eax
jle 0x3dfd3
leaq 0x3147e(%rip), %rsi     # 0x6f415
movl $0x2, %edi
movl %r13d, %ecx
xorl %eax, %eax
callq 0x4ded0
jmp 0x3dfbb
leaq 0x31445(%rip), %rsi     # 0x6f3f4
movl $0x2, %edi
xorl %eax, %eax
callq 0x4ded0
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r14d, -0x2c(%rbp)
testl %r13d, %r13d
jle 0x3e01f
decl %r13d
cmpl $0x7d, %r13d
movl $0x7d, %r14d
cmovbl %r13d, %r14d
incl %r14d
movl $0x60, %r13d
xorl %r12d, %r12d
movq %r15, %rdi
movl %r13d, %esi
movl $0x8, %edx
callq 0x4e341
movb %al, 0x9b950(%rbx,%r12)
addl $0x8, %r13d
incq %r12
cmpq %r12, %r14
jne 0x3dff9
jmp 0x3e022
xorl %r12d, %r12d
movb $0x0, 0x9b950(%rbx,%r12)
cmpl $0x0, 0xc(%rbx)
movl $0x0, %r14d
je 0x3dfc1
leaq 0x9b950(%rbx), %r15
leaq 0x9b9d0(%rbx), %rdi
callq 0x8290
leaq (%rbx,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
leaq 0x313e3(%rip), %rsi     # 0x6f43f
xorl %r14d, %r14d
movl -0x2c(%rbp), %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0x8120
jmp 0x3dfc1
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %r12, %rdi
movl $0x18, %esi
movl $0xc, %edx
callq 0x4e341
movl 0x9f0c0(%r14), %ecx
cmpl $0xb, %ecx
jl 0x42f51
movq %r12, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e341
movl %eax, %r15d
movq %r12, %rdi
movl $0x30, %esi
movl $0x1e, %edx
callq 0x4e341
movl %eax, %r13d
movq %r12, %rdi
movl $0x4e, %esi
movl $0x1, %edx
callq 0x4e341
movl %eax, (%rbx)
movq %r12, %rdi
movl $0x4f, %esi
movl $0x5, %edx
callq 0x4e341
movl %eax, %r12d
movq %r14, %rdi
movl %r15d, %esi
callq 0x42f7e
testl %eax, %eax
je 0x42f66
movl %r13d, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x28ea1(%rip), %xmm0    # 0x6bd78
movq %r14, %rdi
callq 0x4302b
movq 0x10(%r14), %rdi
movsd 0x18(%r14), %xmm0
leaq -0x70(%rbp), %r13
movq %r13, %rsi
movl $0x2, %edx
callq 0x50696
movl (%rbx), %r8d
leaq 0x2c062(%rip), %rsi     # 0x6ef66
movl $0x4, %edi
movq %r13, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x4ded0
cmpl $0x0, 0xc(%r14)
je 0x42f6c
leaq 0x9b9d0(%r14), %rdi
callq 0x8290
leaq (%r14,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
movl (%rbx), %r9d
leaq 0x2c052(%rip), %rsi     # 0x6ef90
leaq -0x70(%rbp), %rcx
movl %r15d, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x8120
jmp 0x42f6c
leaq 0x2bfef(%rip), %rsi     # 0x6ef47
movl $0x2, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x4ded0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
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_O1/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 0x2c013(%rip), %rsi     # 0x6efaf
callq 0x8160
testq %rax, %rax
je 0x42fc9
leaq 0x2c008(%rip), %rsi     # 0x6efb5
xorl %r15d, %r15d
leaq -0x1c(%rbp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x8610
cmpl $0x1, %eax
jne 0x42fc9
cmpl %r14d, -0x1c(%rbp)
jne 0x4301d
movl (%rbx), %eax
movl $0x1, %r15d
testl %eax, %eax
je 0x4301a
cmpl $0x0, 0x9bdd0(%rbx)
jne 0x4301a
cmpl %r14d, %eax
je 0x4301d
leaq 0x9f0c4(%rbx), %rdi
movl $0x18, %esi
movl $0xc, %edx
callq 0x4e341
movl (%rbx), %r8d
leaq 0x2bfba(%rip), %rsi     # 0x6efbd
xorl %r15d, %r15d
movl $0x2, %edi
movl %eax, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x4ded0
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_O1/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
cmpq $0x0, 0x10(%rdi)
jne 0x43059
callq 0x4febe
movq %rax, %rdi
callq 0x5040e
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
movq 0x10(%rbx), %rdi
movsd 0x18(%rbx), %xmm0
leaq -0xc(%rbp), %rsi
callq 0x4fc2d
movsd 0x28d5d(%rip), %xmm1    # 0x6bdd0
addsd %xmm0, %xmm1
movsd -0x18(%rbp), %xmm2
ucomisd %xmm2, %xmm1
movapd %xmm2, %xmm1
jbe 0x43090
addsd 0x28d5a(%rip), %xmm1    # 0x6bde8
jmp 0x430a6
addsd 0x28d40(%rip), %xmm0    # 0x6bdd8
ucomisd %xmm0, %xmm1
jbe 0x430a6
addsd 0x28d3a(%rip), %xmm1    # 0x6bde0
movl -0xc(%rbp), %edi
movapd %xmm1, %xmm0
callq 0x4fbc6
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq %r12, %rdi
movl $0x18, %esi
movl $0xc, %edx
callq 0x4e341
movl 0x9f0c0(%r14), %ecx
cmpl $0xb, %ecx
jl 0x43297
movq %r12, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e341
movl %eax, %r15d
movq %r12, %rdi
movl $0x30, %esi
movl $0x1b, %edx
callq 0x4e341
movl %eax, %r13d
movq %r12, %rdi
movl $0x4b, %esi
movl $0x1, %edx
callq 0x4e341
movl %eax, (%rbx)
movq %r12, %rdi
movl $0x4c, %esi
movl $0x5, %edx
callq 0x4e341
movl %eax, %r12d
movq %r14, %rdi
movl %r15d, %esi
callq 0x42f7e
testl %eax, %eax
je 0x432ac
movl %r13d, %eax
cvtsi2sd %rax, %xmm0
mulsd 0x28b5b(%rip), %xmm0    # 0x6bd78
movq %r14, %rdi
callq 0x432c4
movq 0x10(%r14), %rdi
movsd 0x18(%r14), %xmm0
leaq -0x70(%rbp), %r13
movq %r13, %rsi
movl $0x2, %edx
callq 0x50696
movl (%rbx), %r8d
leaq 0x2bec6(%rip), %rsi     # 0x6f110
movl $0x4, %edi
movq %r13, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x4ded0
cmpl $0x0, 0xc(%r14)
je 0x432b2
leaq 0x9b9d0(%r14), %rdi
callq 0x8290
leaq (%r14,%rax), %rdi
addq $0x9b9d0, %rdi          # imm = 0x9B9D0
movl (%rbx), %r9d
leaq 0x2bd0c(%rip), %rsi     # 0x6ef90
leaq -0x70(%rbp), %rcx
movl %r15d, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x8120
jmp 0x432b2
leaq 0x2bca9(%rip), %rsi     # 0x6ef47
movl $0x2, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x4ded0
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
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_O1/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
cmpq $0x0, 0x10(%rdi)
jne 0x432f2
callq 0x4febe
movq %rax, %rdi
callq 0x5040e
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
movq 0x10(%rbx), %rdi
movsd 0x18(%rbx), %xmm0
callq 0x5034e
movsd 0x277a8(%rip), %xmm1    # 0x6aab0
movq %rax, %rdi
callq 0x4fe63
leaq -0xc(%rbp), %rsi
movq %rax, %rdi
callq 0x4fc2d
movsd 0x275ac(%rip), %xmm1    # 0x6a8d0
movsd %xmm0, -0x18(%rbp)
callq 0x8860
movsd 0x28aba(%rip), %xmm1    # 0x6bdf0
addsd %xmm0, %xmm1
movsd -0x20(%rbp), %xmm2
ucomisd %xmm2, %xmm1
jbe 0x4334f
addsd 0x27583(%rip), %xmm2    # 0x6a8d0
jmp 0x43369
movsd 0x28aa1(%rip), %xmm1    # 0x6bdf8
addsd %xmm0, %xmm1
ucomisd %xmm1, %xmm2
jbe 0x43369
addsd 0x28a97(%rip), %xmm2    # 0x6be00
movsd -0x18(%rbp), %xmm1
subsd %xmm0, %xmm1
addsd %xmm2, %xmm1
movl -0xc(%rbp), %edi
movapd %xmm1, %xmm0
callq 0x4fbc6
movsd 0x28a3e(%rip), %xmm1    # 0x6bdc8
movq %rax, %rdi
callq 0x4fe63
movq %rax, %rdi
callq 0x5040e
movq %rax, 0x10(%rbx)
movsd %xmm0, 0x18(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_type1005(bamboo::rtcm_t*, int)
static int encode_type1005(rtcm_t *rtcm, int sync)
{
    double *p=rtcm->sta.pos;
    int i=24;
    
    trace(3,"encode_type1005: sync=%d\n",sync);
    
    setbitu(rtcm->buff,i,12,1005       ); i+=12; /* message no */
    setbitu(rtcm->buff,i,12,rtcm->staid); i+=12; /* ref station id */
    setbitu(rtcm->buff,i, 6,0          ); i+= 6; /* itrf realization year */
    setbitu(rtcm->buff,i, 1,1          ); i+= 1; /* gps indicator */
    setbitu(rtcm->buff,i, 1,1          ); i+= 1; /* glonass indicator */
    setbitu(rtcm->buff,i, 1,0          ); i+= 1; /* galileo indicator */
    setbitu(rtcm->buff,i, 1,0          ); i+= 1; /* ref station indicator */
    set38bits(rtcm->buff,i,p[0]/0.0001 ); i+=38; /* antenna ref point ecef-x */
    setbitu(rtcm->buff,i, 1,1          ); i+= 1; /* oscillator indicator */
    setbitu(rtcm->buff,i, 1,0          ); i+= 1; /* reserved */
    set38bits(rtcm->buff,i,p[1]/0.0001 ); i+=38; /* antenna ref point ecef-y */
    setbitu(rtcm->buff,i, 2,0          ); i+= 2; /* quarter cycle indicator */
    set38bits(rtcm->buff,i,p[2]/0.0001 ); i+=38; /* antenna ref point ecef-z */
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %edx
movq %rdi, %rbx
leaq 0x2b084(%rip), %rsi     # 0x70354
movl $0x3, %edi
xorl %eax, %eax
callq 0x4ded0
leaq 0x9f0c4(%rbx), %r14
movq %r14, %rdi
movl $0x18, %esi
movl $0xc, %edx
movl $0x3ed, %ecx            # imm = 0x3ED
callq 0x4e403
movl (%rbx), %ecx
movq %r14, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e403
movq %r14, %rdi
movl $0x30, %esi
movl $0x6, %edx
xorl %ecx, %ecx
callq 0x4e403
movq %r14, %rdi
movl $0x36, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x4e403
movq %r14, %rdi
movl $0x37, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x4e403
movq %r14, %rdi
movl $0x38, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4e403
movq %r14, %rdi
movl $0x39, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4e403
movsd 0x6f108(%rbx), %xmm0
divsd 0x25598(%rip), %xmm0    # 0x6a920
movq %r14, %rdi
movl $0x3a, %esi
callq 0x4bb5b
movq %r14, %rdi
movl $0x60, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x4e403
movq %r14, %rdi
movl $0x61, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4e403
movsd 0x6f110(%rbx), %xmm0
divsd 0x25550(%rip), %xmm0    # 0x6a920
movq %r14, %rdi
movl $0x62, %esi
callq 0x4bb5b
movq %r14, %rdi
movl $0x88, %esi
movl $0x2, %edx
xorl %ecx, %ecx
callq 0x4e403
movsd 0x6f118(%rbx), %xmm0
divsd 0x2551f(%rip), %xmm0    # 0x6a920
movq %r14, %rdi
movl $0x8a, %esi
callq 0x4bb5b
movl $0xb0, 0x9f0bc(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_type1007(bamboo::rtcm_t*, int)
static int encode_type1007(rtcm_t *rtcm, int sync)
{
    int i=24,j,antsetup=rtcm->sta.antsetup;
    int n=MIN(strlen(rtcm->sta.antdes),31);
    
    trace(3,"encode_type1007: sync=%d\n",sync);
    
    setbitu(rtcm->buff,i,12,1007       ); i+=12; /* message no */
    setbitu(rtcm->buff,i,12,rtcm->staid); i+=12; /* ref station id */
    
    /* antenna descriptor */
    setbitu(rtcm->buff,i,8,n); i+=8;
    for (j=0;j<n;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.antdes[j]); i+=8;
    }
    setbitu(rtcm->buff,i,8,antsetup); i+=8; /* antetnna setup id */
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r13d
movq %rdi, %rbx
movl 0x6f0f8(%rdi), %eax
movl %eax, -0x2c(%rbp)
leaq 0x6efb8(%rdi), %r15
movq %r15, %rdi
callq 0x8290
movq %rax, %r14
cmpq $0x1f, %rax
movl $0x1f, %r12d
cmovbq %rax, %r12
leaq 0x2ad72(%rip), %rsi     # 0x703a6
movl $0x3, %edi
movl %r13d, %edx
xorl %eax, %eax
callq 0x4ded0
leaq 0x9f0c4(%rbx), %r13
movq %r13, %rdi
movl $0x18, %esi
movl $0xc, %edx
movl $0x3ef, %ecx            # imm = 0x3EF
callq 0x4e403
movq %rbx, -0x38(%rbp)
movl (%rbx), %ecx
movq %r13, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e403
movq %r13, %rdi
movl $0x30, %esi
movl $0x8, %edx
movl %r12d, %ecx
callq 0x4e403
testq %r14, %r14
je 0x456be
movl $0x38, %r14d
xorl %ebx, %ebx
movsbl (%r15,%rbx), %ecx
movq %r13, %rdi
movl %r14d, %esi
movl $0x8, %edx
callq 0x4e403
addl $0x8, %r14d
incq %rbx
cmpq %rbx, %r12
jne 0x4569b
jmp 0x456c4
movl $0x38, %r14d
movq %r13, %rdi
movl %r14d, %esi
movl $0x8, %edx
movl -0x2c(%rbp), %ecx
callq 0x4e403
addl $0x8, %r14d
movq -0x38(%rbp), %rax
movl %r14d, 0x9f0bc(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::encode_type1008(bamboo::rtcm_t*, int)
static int encode_type1008(rtcm_t *rtcm, int sync)
{
    int i=24,j,antsetup=rtcm->sta.antsetup;
    int n=MIN(strlen(rtcm->sta.antdes),31);
    int m=MIN(strlen(rtcm->sta.antsno),31);
    
    trace(3,"encode_type1008: sync=%d\n",sync);
    
    setbitu(rtcm->buff,i,12,1008       ); i+=12; /* message no */
    setbitu(rtcm->buff,i,12,rtcm->staid); i+=12; /* ref station id */
    
    /* antenna descriptor */
    setbitu(rtcm->buff,i,8,n); i+=8;
    for (j=0;j<n;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.antdes[j]); i+=8;
    }
    setbitu(rtcm->buff,i,8,antsetup); i+=8; /* antenna setup id */
    
    /* antenna serial number */
    setbitu(rtcm->buff,i,8,m); i+=8;
    for (j=0;j<m;j++) {
        setbitu(rtcm->buff,i,8,rtcm->sta.antsno[j]); i+=8;
    }
    rtcm->nbit=i;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, -0x30(%rbp)
movq %rdi, %r14
movl 0x6f0f8(%rdi), %eax
movl %eax, -0x34(%rbp)
leaq 0x6efb8(%rdi), %r13
movq %r13, %rdi
callq 0x8290
movq %rax, %rbx
movl $0x1f, %r12d
cmpq %r12, %rax
movl $0x1f, %r15d
cmovbq %rax, %r15
leaq 0x6eff8(%r14), %rdi
movq %rdi, -0x40(%rbp)
callq 0x8290
cmpq $0x1f, %rax
movq %rax, -0x48(%rbp)
cmovbq %rax, %r12
movq %r12, -0x50(%rbp)
leaq 0x2ac5f(%rip), %rsi     # 0x703c0
movl $0x3, %edi
movl -0x30(%rbp), %edx
xorl %eax, %eax
callq 0x4ded0
leaq 0x9f0c4(%r14), %r12
movq %r12, %rdi
movl $0x18, %esi
movl $0xc, %edx
movl $0x3f0, %ecx            # imm = 0x3F0
callq 0x4e403
movq %r14, -0x30(%rbp)
movl (%r14), %ecx
movq %r12, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e403
movq %r12, %rdi
movl $0x30, %esi
movl $0x8, %edx
movl %r15d, %ecx
callq 0x4e403
testq %rbx, %rbx
je 0x457eb
movl $0x38, %ebx
xorl %r14d, %r14d
movsbl (%r13,%r14), %ecx
movq %r12, %rdi
movl %ebx, %esi
movl $0x8, %edx
callq 0x4e403
addl $0x8, %ebx
incq %r14
cmpq %r14, %r15
jne 0x457c9
jmp 0x457f0
movl $0x38, %ebx
movq %r12, %rdi
movl %ebx, %esi
movl $0x8, %edx
movl -0x34(%rbp), %ecx
callq 0x4e403
leal 0x8(%rbx), %esi
movq %r12, %rdi
movl $0x8, %edx
movq -0x50(%rbp), %r15
movl %r15d, %ecx
callq 0x4e403
addl $0x10, %ebx
cmpq $0x0, -0x48(%rbp)
je 0x4584a
xorl %r14d, %r14d
movq -0x40(%rbp), %r13
movsbl (%r13,%r14), %ecx
movq %r12, %rdi
movl %ebx, %esi
movl $0x8, %edx
callq 0x4e403
addl $0x8, %ebx
incq %r14
cmpq %r14, %r15
jne 0x4582a
movq -0x30(%rbp), %rax
movl %ebx, 0x9f0bc(%rax)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x660, %rsp            # imm = 0x660
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x25e72(%rip), %rsi     # 0x705e7
xorl %r14d, %r14d
movl $0x3, %edi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4ded0
movq %r14, 0x40(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
leaq -0x230(%rbp), %rax
movq %rax, 0x18(%rsp)
movq %r14, 0x10(%rsp)
leaq -0x630(%rbp), %rax
movq %rax, 0x8(%rsp)
leaq -0x430(%rbp), %rax
movq %rax, (%rsp)
leaq -0x28(%rbp), %r8
leaq -0x24(%rbp), %r9
movl $0x1, %edi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c289
testl %eax, %eax
je 0x4a817
movl -0x28(%rbp), %ecx
leaq -0x430(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x4cd71
movl -0x24(%rbp), %ecx
leaq -0x230(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x4ce0f
movl %eax, 0x9f0bc(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0x660, %rsp            # imm = 0x660
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x8a8, %rsp            # imm = 0x8A8
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x25de3(%rip), %rsi     # 0x70631
xorl %r14d, %r14d
movl $0x3, %edi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4ded0
movq %r14, 0x40(%rsp)
leaq -0x80(%rbp), %rax
movq %rax, 0x38(%rsp)
leaq -0x280(%rbp), %rax
movq %rax, 0x30(%rsp)
movq %r14, 0x28(%rsp)
leaq -0x480(%rbp), %rax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq -0x880(%rbp), %rax
movq %rax, 0x8(%rsp)
leaq -0x680(%rbp), %rax
movq %rax, (%rsp)
leaq -0x30(%rbp), %r8
leaq -0x2c(%rbp), %r9
movl $0x2, %edi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
callq 0x4c289
testl %eax, %eax
je 0x4a95c
movl -0x30(%rbp), %ecx
leaq -0x680(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x4cd71
movslq -0x2c(%rbp), %r14
leaq -0x480(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d05e
leaq -0x280(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d145
movl %eax, %r15d
testq %r14, %r14
jle 0x4a94f
movq %rbx, -0x38(%rbp)
leaq 0x9f0c4(%rbx), %r12
movl %r15d, %ebx
xorl %r13d, %r13d
leal (%rbx,%r13), %esi
movzbl -0x80(%rbp,%r13), %ecx
movq %r12, %rdi
movl $0x1, %edx
callq 0x4e403
incq %r13
cmpq %r13, %r14
jne 0x4a929
addl %r13d, %r15d
movq -0x38(%rbp), %rbx
movl %r15d, 0x9f0bc(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0x8a8, %rsp            # imm = 0x8A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0xa58, %rsp            # imm = 0xA58
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x25ce6(%rip), %rsi     # 0x7067b
xorl %r14d, %r14d
movl $0x3, %edi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4ded0
subq $0x8, %rsp
leaq -0x80(%rbp), %rax
leaq -0x280(%rbp), %r10
leaq -0x480(%rbp), %r11
leaq -0x680(%rbp), %r13
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
movl $0x3, %edi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
pushq %r14
pushq %rax
pushq %r10
pushq %r14
pushq %r11
pushq %r13
pushq %r14
leaq -0xa80(%rbp), %rax
pushq %rax
leaq -0x880(%rbp), %rax
pushq %rax
callq 0x4c289
addq $0x50, %rsp
testl %eax, %eax
je 0x4aaa5
movl -0x34(%rbp), %ecx
leaq -0x880(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
callq 0x4cd71
movslq -0x30(%rbp), %r14
leaq -0x680(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4ce0f
leaq -0x480(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d05e
leaq -0x280(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d145
testq %r14, %r14
jle 0x4aa99
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 0x4aa74
movl -0x2c(%rbp), %eax
addl %r13d, %eax
movl %eax, 0x9f0bc(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0xa58, %rsp            # imm = 0xA58
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb58, %rsp            # imm = 0xB58
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x25bba(%rip), %rsi     # 0x70698
xorl %r14d, %r14d
movl $0x3, %edi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4ded0
subq $0x8, %rsp
leaq -0x180(%rbp), %rax
leaq -0x80(%rbp), %r10
leaq -0x380(%rbp), %r11
leaq -0x580(%rbp), %r13
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
movl $0x4, %edi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
pushq %rax
pushq %r10
pushq %r11
pushq %r14
pushq %r13
leaq -0x780(%rbp), %rax
pushq %rax
pushq %r14
leaq -0xb80(%rbp), %rax
pushq %rax
leaq -0x980(%rbp), %rax
pushq %rax
callq 0x4c289
addq $0x50, %rsp
testl %eax, %eax
je 0x4ac1f
movl -0x34(%rbp), %r14d
leaq -0x980(%rbp), %r15
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x4d2f0
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x4cd71
movslq -0x30(%rbp), %r14
leaq -0x780(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4ce0f
leaq -0x580(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d05e
leaq -0x380(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d145
testq %r14, %r14
jle 0x4abff
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 0x4abda
movl -0x2c(%rbp), %eax
addl %r13d, %eax
leaq -0x180(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d3e7
movl %eax, 0x9f0bc(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0xb58, %rsp            # imm = 0xB58
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 $0xb58, %rsp            # imm = 0xB58
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
leaq 0x2591e(%rip), %rsi     # 0x7075d
xorl %r14d, %r14d
movl $0x3, %edi
movl %r12d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x4ded0
subq $0x8, %rsp
leaq -0x180(%rbp), %rax
leaq -0x80(%rbp), %r10
leaq -0x380(%rbp), %r11
leaq -0x580(%rbp), %r13
leaq -0x34(%rbp), %r8
leaq -0x30(%rbp), %r9
movl $0x6, %edi
movq %rbx, %rsi
movl %r12d, %edx
movl %r15d, %ecx
pushq %rax
pushq %r10
pushq %r11
pushq %r14
pushq %r13
leaq -0x780(%rbp), %rax
pushq %rax
pushq %r14
leaq -0xb80(%rbp), %rax
pushq %rax
leaq -0x980(%rbp), %rax
pushq %rax
callq 0x4c289
addq $0x50, %rsp
testl %eax, %eax
je 0x4af80
movl -0x34(%rbp), %r14d
leaq -0x980(%rbp), %r15
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x4d2f0
movq %rbx, %rdi
movl %eax, %esi
movq %r15, %rdx
movl %r14d, %ecx
callq 0x4cd71
movslq -0x30(%rbp), %r14
leaq -0x780(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d5ee
leaq -0x580(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d6d5
leaq -0x380(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4d7bc
testq %r14, %r14
jle 0x4af60
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 0x4af3b
movl -0x2c(%rbp), %eax
addl %r13d, %eax
leaq -0x180(%rbp), %rdx
movq %rbx, %rdi
movl %eax, %esi
movl %r14d, %ecx
callq 0x4db43
movl %eax, 0x9f0bc(%rbx)
movl $0x1, %r14d
movl %r14d, %eax
addq $0xb58, %rsp            # imm = 0xB58
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %rax
movl %r8d, %r9d
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %r13
movl %edi, %ebx
leaq 0x24ce8(%rip), %rsi     # 0x702d9
movl $0x4, %edi
movl %ebx, %edx
movl %r12d, %r8d
movl %r9d, -0x2c(%rbp)
xorl %eax, %eax
callq 0x4ded0
leaq 0x9f0c4(%r13), %r14
movq %r14, %rdi
movl $0x18, %esi
movl $0xc, %edx
movl %ebx, %ecx
callq 0x4e403
movl (%r13), %ecx
movq %r14, %rdi
movl $0x24, %esi
movl $0xc, %edx
callq 0x4e403
movq 0x10(%r13), %rdi
movsd 0x18(%r13), %xmm0
cmpl $0x4, %r12d
jne 0x4b683
callq 0x5034e
movsd 0x1f45c(%rip), %xmm1    # 0x6aab0
movq %rax, %rdi
callq 0x4fe63
leaq -0x30(%rbp), %rsi
movq %rax, %rdi
callq 0x4fc2d
movsd 0x1f260(%rip), %xmm1    # 0x6a8d0
callq 0x8860
movl $0x4b, %r12d
movl $0x1b, %r13d
jmp 0x4b698
leaq -0x30(%rbp), %rsi
callq 0x4fc2d
movl $0x4e, %r12d
movl $0x1e, %r13d
divsd 0x206d8(%rip), %xmm0    # 0x6bd78
addsd 0x205d0(%rip), %xmm0    # 0x6bc78
callq 0x8ad0
cvttsd2si %xmm0, %ecx
movq %r14, %rdi
movl $0x30, %esi
movl %r13d, %edx
callq 0x4e403
movq %r14, %rdi
movl %r12d, %esi
movl $0x1, %edx
movl %r15d, %ecx
callq 0x4e403
leal 0x1(%r12), %esi
movq %r14, %rdi
movl $0x5, %edx
movl -0x2c(%rbp), %ecx
callq 0x4e403
leal 0x6(%r12), %esi
movq %r14, %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x4e403
leal 0x7(%r12), %esi
movq %r14, %rdi
movl $0x3, %edx
xorl %ecx, %ecx
callq 0x4e403
addl $0xa, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x4bb07
cmpl $0x18, %edi
jl 0x4bb57
cmpl $0x47, %edi
jg 0x4bb0b
addl $0x18, %edi
shrl %edi
jmp 0x4bb57
xorl %eax, %eax
jmp 0x4bb59
cmpl $0xa7, %edi
jg 0x4bb1b
addl $0x78, %edi
shrl $0x2, %edi
jmp 0x4bb57
cmpl $0x167, %edi            # imm = 0x167
jg 0x4bb2e
addl $0x198, %edi            # imm = 0x198
shrl $0x3, %edi
jmp 0x4bb57
cmpl $0x2e7, %edi            # imm = 0x2E7
jg 0x4bb41
addl $0x498, %edi            # imm = 0x498
shrl $0x4, %edi
jmp 0x4bb57
movl $0x7f, %eax
cmpl $0x3a8, %edi            # imm = 0x3A8
jg 0x4bb59
addl $0xc18, %edi            # imm = 0xC18
shrl $0x5, %edi
movl %edi, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x211a5(%rip), %xmm0    # 0x6cd20
mulsd %xmm1, %xmm0
callq 0x8ad0
cvttsd2si %xmm0, %ecx
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
mulsd 0x24608(%rip), %xmm0    # 0x701a0
addsd -0x20(%rbp), %xmm0
cvttsd2si %xmm0, %r15
movq %r14, %rdi
movl %ebx, %esi
movl $0x20, %edx
callq 0x4e47b
addl $0x20, %ebx
movq %r14, %rdi
movl %ebx, %esi
movl $0x6, %edx
movl %r15d, %ecx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4e403
// File: /workspace/github_cpp_makefile_star2_O1/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 %esi, %ebx
testl %ecx, %ecx
jle 0x4cdfe
movq %rdx, %r14
movq %rdi, %r15
addq $0x9f0c4, %r15          # imm = 0x9F0C4
movl %ecx, %r12d
xorl %r13d, %r13d
movsd (%r14,%r13,8), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
movl $0x0, %ecx
jae 0x4cde4
ucomisd 0x23403(%rip), %xmm0    # 0x701b8
movl $0x0, %ecx
ja 0x4cde4
divsd 0x2203c(%rip), %xmm0    # 0x6ee00
mulsd 0x233dc(%rip), %xmm0    # 0x701a8
addsd 0x1eea4(%rip), %xmm0    # 0x6bc78
callq 0x8ad0
cvttsd2si %xmm0, %rcx
andl $0x3ff, %ecx            # imm = 0x3FF
movq %r15, %rdi
movl %ebx, %esi
movl $0xa, %edx
callq 0x4e403
addl $0xa, %ebx
incq %r13
cmpq %r13, %r12
jne 0x4cd98
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %esi, %ebx
testl %ecx, %ecx
jle 0x4cee5
movq %rdx, %r14
movq %rdi, -0x30(%rbp)
leaq 0x9f0c4(%rdi), %r12
movl %ecx, %eax
movq %rax, -0x38(%rbp)
xorl %r15d, %r15d
movsd (%r14,%r15,8), %xmm0
movl $0xffffc000, %r13d      # imm = 0xFFFFC000
ucomisd 0x1dab3(%rip), %xmm0    # 0x6a908
jne 0x4ce59
jnp 0x4cec3
movapd %xmm0, %xmm1
andpd 0x1cacb(%rip), %xmm1    # 0x69930
ucomisd 0x23353(%rip), %xmm1    # 0x701c0
jbe 0x4cea1
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movsd 0x18(%rax), %xmm0
xorl %esi, %esi
callq 0x5077f
movsd (%r14,%r15,8), %xmm0
movl $0x2, %edi
leaq 0x2376f(%rip), %rsi     # 0x70604
movq %rax, %rdx
movb $0x1, %al
callq 0x4ded0
jmp 0x4cec3
divsd 0x21f57(%rip), %xmm0    # 0x6ee00
mulsd 0x23317(%rip), %xmm0    # 0x701c8
addsd 0x1edbf(%rip), %xmm0    # 0x6bc78
callq 0x8ad0
cvttsd2si %xmm0, %r13d
movq %r12, %rdi
movl %ebx, %esi
movl $0xf, %edx
movl %r13d, %ecx
callq 0x4e47b
addl $0xf, %ebx
incq %r15
cmpq %r15, -0x38(%rbp)
jne 0x4ce41
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtcm3e.cpp
// Function: bamboo::to_satid(int, int)
static int to_satid(int sys, int sat)
{
    int prn;
    
    if (satsys(sat,&prn)!=sys) return 0;
    
    if      (sys==SYS_QZS) prn-=MINPRNQZS-1;
    else if (sys==SYS_SBS) prn-=MINPRNSBS-1;
    
    return prn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %esi, %eax
movl %edi, %ebx
leaq -0xc(%rbp), %rsi
movl %eax, %edi
callq 0x4dc2a
movl %eax, %ecx
xorl %eax, %eax
cmpl %ebx, %ecx
jne 0x4cf29
cmpl $0x2, %ebx
je 0x4cf22
cmpl $0x10, %ebx
jne 0x4cf26
incl -0xc(%rbp)
jmp 0x4cf26
addl $-0x77, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq