LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::input_bnx(bamboo::raw_t*, unsigned char)
extern int input_bnx(raw_t *raw, unsigned char data)
{
    unsigned int len;
    int len_h,len_c;
    
    trace(5,"input_bnx: data=%02x\n",data);
    
    /* synchronize binex message */
    if (raw->nbyte==0) {
        if (!sync_bnx(raw->buff,data)) return 0;
        raw->nbyte=2;
        return 0;
    }
    raw->buff[raw->nbyte++]=data;
    if (raw->nbyte<4) return 0;
    
    len_h=getbnxi(raw->buff+2,&len);
    
    raw->len=len+len_h+2; /* length without crc */
    
    if (raw->len-1>4096) {
        trace(2,"binex length error: len=%d\n",raw->len-1);
        raw->nbyte=0;
        return -1;
    }
    len_c=raw->len-1<128?1:2;
    
    if (raw->nbyte<(int)(raw->len+len_c)) return 0;
    raw->nbyte=0;
    
    /* decode binex message */
    return decode_bnx(raw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x38a70(%rip), %rsi     # 0x62028
xorl %r14d, %r14d
pushq $0x5
popq %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x455bc
movslq 0x81a74(%rbx), %rax
testq %rax, %rax
je 0x29642
leal 0x1(%rax), %ecx
movl %ecx, 0x81a74(%rbx)
movb %r15b, 0x81a90(%rbx,%rax)
movl 0x81a74(%rbx), %r12d
cmpl $0x4, %r12d
jl 0x29677
leaq 0x81a92(%rbx), %rdi
leaq -0x24(%rbp), %r15
movq %r15, %rsi
callq 0x296d5
movl (%r15), %edx
leal (%rdx,%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x81a78(%rbx)
addl %eax, %edx
incl %edx
cmpl $0x1001, %edx           # imm = 0x1001
jl 0x29662
leaq 0x38a13(%rip), %rsi     # 0x6203e
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x455bc
andl $0x0, 0x81a74(%rbx)
pushq $-0x1
popq %r14
jmp 0x29677
leaq 0x81a90(%rbx), %rdi
movzbl %r15b, %esi
callq 0x2969f
testl %eax, %eax
je 0x29677
movl $0x2, 0x81a74(%rbx)
jmp 0x29677
xorl %eax, %eax
cmpl $0x80, %edx
setl %al
subl %eax, %ecx
addl $0x2, %ecx
cmpl %ecx, %r12d
jge 0x29687
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
andl $0x0, 0x81a74(%rbx)
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x29717
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::sync_bnx(unsigned char*, unsigned char)
static int sync_bnx(unsigned char *buff, unsigned char data)
{
    buff[0]=buff[1]; buff[1]=data;
    
    return buff[0]==BNXSYNC2&&
           (buff[1]==0x00||buff[1]==0x01||buff[1]==0x02||buff[1]==0x03||
            buff[1]==0x7D||buff[1]==0x7E||buff[1]==0x7F);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb 0x1(%rdi), %cl
movb %cl, (%rdi)
movb %sil, 0x1(%rdi)
xorl %eax, %eax
cmpb $-0x1e, %cl
jne 0x296d3
movl $0x1, %eax
cmpb $0x4, %sil
jb 0x296d3
movzbl %sil, %ecx
addl $-0x7d, %ecx
cmpl $0x2, %ecx
jb 0x296d3
xorl %eax, %eax
cmpb $0x7f, %sil
sete %al
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::getbnxi(unsigned char*, unsigned int*)
static int getbnxi(unsigned char *p, unsigned int *val)
{
    int i;
    
    for (*val=0,i=0;i<3;i++) {
        *val=(*val<<7)+(p[i]&0x7F);
        if (!(p[i]&0x80)) return i+1;
    }
    *val=(*val<<8)+p[i];
    return 4;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andl $0x0, (%rsi)
xorl %eax, %eax
xorl %ecx, %ecx
cmpq $0x3, %rax
je 0x29701
movl %ecx, %edx
shll $0x7, %edx
movzbl (%rdi,%rax), %ecx
andl $0x7f, %ecx
orl %edx, %ecx
movl %ecx, (%rsi)
cmpb $0x0, (%rdi,%rax)
jns 0x29713
incq %rax
jmp 0x296e0
shll $0x8, %ecx
movzbl 0x3(%rdi), %eax
orl %ecx, %eax
movl %eax, (%rsi)
movl $0x4, %eax
jmp 0x29715
incl %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::input_bnxf(bamboo::raw_t*, _IO_FILE*)
extern int input_bnxf(raw_t *raw, FILE *fp)
{
    unsigned int len;
    int i,data,len_h,len_c;
    
    trace(4,"input_bnxf\n");
    
    if (raw->nbyte==0) {
        for (i=0;;i++) {
            if ((data=fgetc(fp))==EOF) return -2;
            if (sync_bnx(raw->buff,(unsigned char)data)) break;
            if (i>=4096) return 0;
        }
    }
    if (fread(raw->buff+2,1,4,fp)<4) return -2;
    
    len_h=getbnxi(raw->buff+2,&len);
    
    raw->len=len+len_h+2;
    
    if (raw->len-1>4096) {
        trace(2,"binex length error: len=%d\n",raw->len-1);
        raw->nbyte=0;
        return -1;
    }
    len_c=raw->len-1<128?1:2;
    
    if (fread(raw->buff+6,1,raw->len+len_c-6,fp)<(size_t)(raw->len+len_c-6)) {
        return -2;
    }
    raw->nbyte=0;
    
    /* decode binex message */
    return decode_bnx(raw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x356f5(%rip), %rsi     # 0x6205a
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x455bc
cmpl $0x0, 0x81a74(%rbx)
pushq $-0x2
popq %r14
je 0x2c9e8
leaq 0x81a92(%rbx), %r12
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %r12, %rdi
movq %r15, %rcx
callq 0x8920
cmpq $0x4, %rax
jb 0x2ca5e
leaq -0x2c(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x296d5
movl (%r13), %ecx
leal (%rcx,%rax), %edx
addl $0x2, %edx
movl %edx, 0x81a78(%rbx)
leal (%rcx,%rax), %edx
incl %edx
cmpl $0x1001, %edx           # imm = 0x1001
jl 0x2ca1f
leaq 0x3566d(%rip), %rsi     # 0x6203e
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x455bc
andl $0x0, 0x81a74(%rbx)
pushq $-0x1
popq %r14
jmp 0x2ca5e
leaq 0x81a90(%rbx), %r12
movl $0x1001, %r13d          # imm = 0x1001
movq %r15, %rdi
callq 0x89b0
cmpl $-0x1, %eax
je 0x2ca5e
movzbl %al, %esi
movq %r12, %rdi
callq 0x2969f
testl %eax, %eax
jne 0x2c97c
decl %r13d
jne 0x2c9f5
xorl %r14d, %r14d
jmp 0x2ca5e
addl %eax, %ecx
xorl %r12d, %r12d
cmpl $0x80, %edx
setge %r12b
leaq 0x81a96(%rbx), %rdi
leal (%rcx,%r12), %eax
addl $-0x3, %eax
movslq %eax, %rdx
pushq $0x1
popq %rsi
movq %r15, %rcx
callq 0x8920
movl 0x81a78(%rbx), %ecx
addl %r12d, %ecx
addl $-0x5, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x2ca70
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andl $0x0, 0x81a74(%rbx)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x29717
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::adjweek(bamboo::gtime_t, double)
static gtime_t adjweek(gtime_t time, double tow)
{
    double tow_p;
    int week;
    tow_p=time2gpst(time,&week);
    if      (tow<tow_p-302400.0) tow+=604800.0;
    else if (tow>tow_p+302400.0) tow-=604800.0;
    return gpst2time(week,tow);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movsd %xmm1, -0x10(%rbp)
leaq -0x4(%rbp), %rsi
callq 0x470f1
movsd 0x3529f(%rip), %xmm1    # 0x61dc0
addsd %xmm0, %xmm1
movsd -0x10(%rbp), %xmm2
ucomisd %xmm2, %xmm1
movapd %xmm2, %xmm1
jbe 0x2cb3e
addsd 0x3529c(%rip), %xmm1    # 0x61dd8
jmp 0x2cb54
addsd 0x35282(%rip), %xmm0    # 0x61dc8
ucomisd %xmm0, %xmm1
jbe 0x2cb54
addsd 0x3527c(%rip), %xmm1    # 0x61dd0
movl -0x4(%rbp), %edi
movapd %xmm1, %xmm0
callq 0x4708a
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::adjday(bamboo::gtime_t, double)
static gtime_t adjday(gtime_t time, double tod)
{
    double ep[6],tod_p;
    time2epoch(time,ep);
    tod_p=ep[3]*3600.0+ep[4]*60.0+ep[5];
    if      (tod<tod_p-43200.0) tod+=86400.0;
    else if (tod>tod_p+43200.0) tod-=86400.0;
    ep[3]=ep[4]=ep[5]=0.0;
    return timeadd(epoch2time(ep),tod);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x38, %rsp
movsd %xmm1, -0x10(%rbp)
leaq -0x40(%rbp), %rbx
movq %rbx, %rsi
callq 0x46fbf
movsd 0x18(%rbx), %xmm0
movsd 0x20(%rbx), %xmm1
mulsd 0x33ce7(%rip), %xmm1    # 0x608a8
mulsd 0x33ce7(%rip), %xmm0    # 0x608b0
addsd %xmm1, %xmm0
addsd 0x28(%rbx), %xmm0
movsd 0x35206(%rip), %xmm1    # 0x61de0
addsd %xmm0, %xmm1
movsd -0x10(%rbp), %xmm2
ucomisd %xmm2, %xmm1
movapd %xmm2, %xmm1
jbe 0x2cbf7
addsd 0x33ccb(%rip), %xmm1    # 0x608c0
jmp 0x2cc0d
addsd 0x351e9(%rip), %xmm0    # 0x61de8
ucomisd %xmm0, %xmm1
jbe 0x2cc12
addsd 0x351e3(%rip), %xmm1    # 0x61df0
movsd %xmm1, -0x10(%rbp)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rbx)
andq $0x0, 0x28(%rbx)
leaq -0x40(%rbp), %rdi
callq 0x46ee2
movq %rax, %rdi
movsd -0x10(%rbp), %xmm1
callq 0x472ee
addq $0x38, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/binex.cpp
// Function: bamboo::sisaindex(double)
static int sisaindex(double value)
{
    if (value< 0.5) return (int)((value    )/0.01);
    if (value< 1.0) return (int)((value-0.5)/0.02)+ 50;
    if (value< 2.0) return (int)((value-1.0)/0.04)+ 75;
    if (value<=6.0) return (int)((value-2.0)/0.16)+100;
    return 255; /* NAPA */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movsd 0x3502f(%rip), %xmm1    # 0x61c78
ucomisd %xmm0, %xmm1
jbe 0x2cc5d
divsd 0x34b61(%rip), %xmm0    # 0x617b8
cvttsd2si %xmm0, %eax
jmp 0x2ccd5
movsd 0x32cbb(%rip), %xmm1    # 0x5f920
ucomisd %xmm0, %xmm1
jbe 0x2cc84
addsd 0x33d6d(%rip), %xmm0    # 0x609e0
divsd 0x35195(%rip), %xmm0    # 0x61e10
cvttsd2si %xmm0, %eax
addl $0x32, %eax
jmp 0x2ccd5
movsd 0x35124(%rip), %xmm1    # 0x61db0
ucomisd %xmm0, %xmm1
jbe 0x2ccab
addsd 0x33d06(%rip), %xmm0    # 0x609a0
divsd 0x35166(%rip), %xmm0    # 0x61e08
cvttsd2si %xmm0, %eax
addl $0x4b, %eax
jmp 0x2ccd5
movl $0xff, %eax
movsd 0x33d70(%rip), %xmm1    # 0x60a28
ucomisd %xmm0, %xmm1
jb 0x2ccd5
addsd 0x35132(%rip), %xmm0    # 0x61df8
divsd 0x35132(%rip), %xmm0    # 0x61e00
cvttsd2si %xmm0, %eax
addl $0x64, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/lambda.cpp
// Function: bamboo::lambda(int, int, double const*, double const*, double*, double*)
extern int lambda(int n, int m, const double *a, const double *Q, double *F,
                  double *s)
{
    int info;
    double *L,*D,*Z,*z,*E;
    
    if (n<=0||m<=0) return -1;
    L=zeros(n,n); D=mat(n,1); Z=eye(n); z=mat(n,1); E=mat(n,m);
    
    /* LD factorization */
    if (!(info=LD(n,Q,L,D))) {
        
        /* lambda reduction */
        reduction(n,L,D,Z);
        matmul("TN",n,1,n,1.0,Z,a,0.0,z); /* z=Z'*a */
        
        /* mlambda search */
        if (!(info=search(n,m,L,D,z,E,s))) {
            
            info=solve("T",Z,E,n,m,F); /* F=Z'\E */
        }
    }
    free(L); free(D); free(Z); free(z); free(E);
    return info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %rbx
testl %edi, %edi
setle %al
testl %esi, %esi
setle %cl
orb %al, %cl
je 0x2cd2e
pushq $-0x1
popq %rbx
jmp 0x2ce65
movl %esi, %r14d
movl %edi, %r12d
movq %rdx, -0x60(%rbp)
movq %r9, -0x68(%rbp)
movq %r8, -0x58(%rbp)
movl %edi, %esi
callq 0x45d86
movq %rax, %r15
pushq $0x1
popq %rsi
movl %r12d, %edi
callq 0x45c3a
movq %rax, %r13
movl %r12d, %edi
callq 0x45dcc
movq %rax, -0x30(%rbp)
movl %r12d, %edi
pushq $0x1
popq %rsi
callq 0x45c3a
movq %rax, -0x50(%rbp)
movl %r12d, %edi
movl %r14d, %esi
callq 0x45c3a
movq %rax, -0x40(%rbp)
movl %r12d, %edi
movq %rbx, %rsi
movq %r15, -0x48(%rbp)
movq %r15, %rdx
movq %r13, -0x38(%rbp)
movq %r13, %rcx
callq 0x2ce76
pushq $-0x1
popq %rbx
testl %eax, %eax
je 0x2cdab
movq -0x40(%rbp), %r15
jmp 0x2ce39
movl %r12d, %edi
movq -0x48(%rbp), %r13
movq %r13, %rsi
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x2d034
movq -0x50(%rbp), %r15
movq %r15, (%rsp)
leaq 0x35e8f(%rip), %rdi     # 0x62c60
pushq $0x1
popq %rdx
movsd 0x32b44(%rip), %xmm0    # 0x5f920
xorps %xmm1, %xmm1
movl %r12d, %esi
movl %r12d, %ecx
movq -0x30(%rbp), %r8
movq -0x60(%rbp), %r9
callq 0x45f19
movq -0x68(%rbp), %rax
movq %rax, (%rsp)
movl %r12d, %edi
movl %r14d, %esi
movq %r13, %rdx
movq -0x38(%rbp), %rcx
movq %r15, %r8
movq -0x40(%rbp), %r15
movq %r15, %r9
callq 0x2d3be
testl %eax, %eax
jne 0x2ce39
leaq 0x41c17(%rip), %rdi     # 0x6ea38
movq -0x30(%rbp), %rsi
movq %r15, %rdx
movl %r12d, %ecx
movl %r14d, %r8d
movq -0x58(%rbp), %r9
callq 0x46504
movl %eax, %ebx
movq -0x48(%rbp), %rdi
callq 0x8780
movq -0x38(%rbp), %rdi
callq 0x8780
movq -0x30(%rbp), %rdi
callq 0x8780
movq -0x50(%rbp), %rdi
callq 0x8780
movq %r15, %rdi
callq 0x8780
movl %ebx, %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/lambda.cpp
// Function: bamboo::LD(int, double const*, double*, double*)
static int LD(int n, const double *Q, double *L, double *D)
{
    int i,j,k,info=0;
    double a,*A=mat(n,n);
    
    memcpy(A,Q,sizeof(double)*n*n);
    for (i=n-1;i>=0;i--) {
        if ((D[i]=A[i+i*n])<=0.0) {info=-1; break;}
        a=sqrt(D[i]);
        for (j=0;j<=i;j++) L[i+j*n]=A[i+j*n]/a;
        for (j=0;j<=i-1;j++) for (k=0;k<=j;k++) A[j+k*n]-=L[i+k*n]*L[i+j*n];
        for (j=0;j<=i;j++) L[i+j*n]/=L[i+i*n];
    }
    free(A);
    if (info) fprintf(stderr,"%s : LD factorization error\n",__FILE__);
    return info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, -0x50(%rbp)
movq %rdx, %r14
movq %rsi, %r12
movl %edi, %r15d
movl %edi, %esi
callq 0x45c3a
movq %rax, %rbx
movl %r15d, %edx
imulq %rdx, %rdx
shlq $0x3, %rdx
movq %rax, %rdi
movq %r12, %rsi
callq 0x84f0
movq %r14, %rsi
movslq %r15d, %r12
incl %r15d
movl %r15d, -0x34(%rbp)
leaq (,%r12,8), %r14
movq %rbx, -0x30(%rbp)
leaq (%rbx,%r12,8), %r13
addq $-0x8, %r13
leaq -0x8(%rsi,%r12,8), %rbx
xorpd %xmm2, %xmm2
movq %r12, -0x58(%rbp)
movq %rsi, -0x40(%rbp)
testq %r12, %r12
jle 0x2cfeb
leaq -0x1(%r12), %r8
movl -0x34(%rbp), %eax
movl %eax, %r15d
imull %r8d, %r15d
movq -0x30(%rbp), %rax
movsd (%rax,%r15,8), %xmm0
movq -0x50(%rbp), %rax
movsd %xmm0, (%rax,%r8,8)
ucomisd %xmm0, %xmm2
jae 0x2cfef
ucomisd %xmm2, %xmm0
jb 0x2cf28
sqrtsd %xmm0, %xmm0
jmp 0x2cf3d
movq %r8, -0x48(%rbp)
callq 0x84e0
movq -0x48(%rbp), %r8
xorpd %xmm2, %xmm2
movq -0x40(%rbp), %rsi
movl %r12d, %eax
xorl %ecx, %ecx
movq %rax, %rdx
subq $0x1, %rdx
jb 0x2cf60
movsd (%r13,%rcx), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rbx,%rcx)
addq %r14, %rcx
jmp 0x2cf45
addq $-0x2, %r12
movq %r8, %rdi
leaq (%rsi,%r8,8), %rcx
movq -0x30(%rbp), %rdx
xorl %esi, %esi
pushq $0x1
popq %r11
cmpq %r12, %rsi
jg 0x2cfbb
movq %rsi, %r8
imulq -0x58(%rbp), %r8
xorl %r9d, %r9d
movq %r11, %r10
subq $0x1, %r10
jb 0x2cfaf
movsd (%rbx,%r9), %xmm0
mulsd (%rcx,%r8,8), %xmm0
movsd (%rdx,%r9), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rdx,%r9)
addq %r14, %r9
jmp 0x2cf88
incq %rsi
incq %r11
addq $0x8, %rdx
jmp 0x2cf75
movq %rbx, %rcx
movq -0x40(%rbp), %rsi
subq $0x1, %rax
jb 0x2cfdb
movsd (%rcx), %xmm0
divsd (%rsi,%r15,8), %xmm0
movsd %xmm0, (%rcx)
addq %r14, %rcx
jmp 0x2cfc2
addq $-0x8, %r13
addq $-0x8, %rbx
movq %rdi, %r12
jmp 0x2cee6
xorl %ebx, %ebx
jmp 0x2cff4
pushq $-0x1
popq %rax
movl %eax, %ebx
movq -0x30(%rbp), %rdi
callq 0x8780
testq %r12, %r12
jg 0x2d013
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x58fb6(%rip), %rax     # 0x85fd0
movq (%rax), %rdi
leaq 0x35c3f(%rip), %rsi     # 0x62c63
leaq 0x35c55(%rip), %rdx     # 0x62c80
xorl %eax, %eax
callq 0x88c0
jmp 0x2d002
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/lambda.cpp
// Function: bamboo::lambda_reduction(int, double const*, double*)
extern int lambda_reduction(int n, const double *Q, double *Z)
{
    double *L,*D;
    int i,j,info;
    
    if (n<=0) return -1;
    
    L=zeros(n,n); D=mat(n,1);
    
    for (i=0;i<n;i++) for (j=0;j<n;j++) {
        Z[i+j*n]=i==j?1.0:0.0;
    }
    /* LD factorization */
    if ((info=LD(n,Q,L,D))) {
        free(L); free(D);
        return info;
    }
    /* lambda reduction */
    reduction(n,L,D,Z);
     
    free(L); free(D);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testl %edi, %edi
jle 0x2d948
movq %rdx, %r14
movq %rsi, %r13
movl %edi, %r12d
movl %edi, %esi
callq 0x45d86
movq %rax, %rbx
pushq $0x1
popq %rsi
movl %r12d, %edi
callq 0x45c3a
movq %rax, %r15
movl %r12d, %eax
leaq (,%rax,8), %rcx
xorl %edx, %edx
movsd 0x32026(%rip), %xmm0    # 0x5f920
movq %r14, %rsi
cmpq %rax, %rdx
je 0x2d92d
movq %rsi, %rdi
xorl %r8d, %r8d
cmpq %r8, %rax
je 0x2d924
movaps %xmm0, %xmm1
cmpq %r8, %rdx
je 0x2d918
xorps %xmm1, %xmm1
movsd %xmm1, (%rdi)
incq %r8
addq %rcx, %rdi
jmp 0x2d908
incq %rdx
addq $0x8, %rsi
jmp 0x2d8fd
movl %r12d, %edi
movq %r13, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x2ce76
testl %eax, %eax
je 0x2d94e
pushq $-0x1
popq %r14
jmp 0x2d962
pushq $-0x1
popq %r14
jmp 0x2d972
movl %r12d, %edi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2d034
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x8780
movq %r15, %rdi
callq 0x8780
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/lambda.cpp
// Function: bamboo::lambda_search(int, int, double const*, double const*, double*, double*)
extern int lambda_search(int n, int m, const double *a, const double *Q,
                         double *F, double *s)
{
    double *L,*D;
    int info;
    
    if (n<=0||m<=0) return -1;
    
    L=zeros(n,n); D=mat(n,1);
    
    /* LD factorization */
    if ((info=LD(n,Q,L,D))) {
        free(L); free(D);
        return info;
    }
    /* mlambda search */
    info=search(n,m,L,D,a,F,s);
    
    free(L); free(D);
    return info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r12
testl %edi, %edi
setle %al
testl %esi, %esi
setle %cl
orb %al, %cl
je 0x2d9ac
pushq $-0x1
popq %r14
jmp 0x2da25
movl %esi, %r13d
movl %edi, %r14d
movq %r9, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movl %edi, %esi
callq 0x45d86
movq %rax, %r15
pushq $0x1
popq %rsi
movl %r14d, %edi
callq 0x45c3a
movq %rax, %rbx
movl %r14d, %edi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %rcx
callq 0x2ce76
testl %eax, %eax
je 0x2d9f1
pushq $-0x1
popq %r14
jmp 0x2da15
movq -0x30(%rbp), %rax
movq %rax, (%rsp)
movl %r14d, %edi
movl %r13d, %esi
movq %r15, %rdx
movq %rbx, %rcx
movq -0x38(%rbp), %r8
movq -0x40(%rbp), %r9
callq 0x2d3be
movl %eax, %r14d
movq %r15, %rdi
callq 0x8780
movq %rbx, %rdi
callq 0x8780
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::getbits3(unsigned char const*, int, int, int, int, int, int)
static int getbits3(const unsigned char *buff, int p1, int l1, int p2, int l2,
                    int p3, int l3)
{
    if (getbitu(buff,p1,1))
        return (int)((getbits(buff,p1,l1)<<(l2+l3))+
                   (getbitu(buff,p2,l2)<<l3)+getbitu(buff,p3,l3));
    else
        return (int)getbitu3(buff,p1,l1,p2,l2,p3,l3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %r8d, -0x2c(%rbp)
movl %ecx, %r12d
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %r15
pushq $0x1
popq %rdx
callq 0x459f7
testl %eax, %eax
je 0x2f21e
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x45a39
movl %eax, %r14d
leal 0x16(%rbx), %ecx
shll %cl, %r14d
pushq $0x16
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
callq 0x459f7
movl %eax, %r12d
movl %ebx, %ecx
shll %cl, %r12d
movq %r15, %rdi
movl -0x2c(%rbp), %esi
movl %ebx, %edx
callq 0x459f7
addl %r14d, %eax
addl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
movl %r14d, %esi
movl %r13d, %edx
movl %r12d, %ecx
movl -0x2c(%rbp), %r8d
movl %ebx, %r9d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2f241
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::test_glostr(unsigned char const*)
extern int test_glostr(const unsigned char *buff)
{
    static const unsigned char xor_8bit[256]={ /* xor of 8 bits */
        0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
        1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
        1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
        0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
        1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,
        0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
        0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,
        1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0
    };
    static const unsigned char mask_hamming[][12]={ /* mask of hamming codes */
        {0x55,0x55,0x5A,0xAA,0xAA,0xAA,0xB5,0x55,0x6A,0xD8,0x08},
        {0x66,0x66,0x6C,0xCC,0xCC,0xCC,0xD9,0x99,0xB3,0x68,0x10},
        {0x87,0x87,0x8F,0x0F,0x0F,0x0F,0x1E,0x1E,0x3C,0x70,0x20},
        {0x07,0xF8,0x0F,0xF0,0x0F,0xF0,0x1F,0xE0,0x3F,0x80,0x40},
        {0xF8,0x00,0x0F,0xFF,0xF0,0x00,0x1F,0xFF,0xC0,0x00,0x80},
        {0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x01,0x00},
        {0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00},
        {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF8}
    };
    unsigned char cs;
    int i,j,n=0;
    
    for (i=0;i<8;i++) {
        for (j=0,cs=0;j<11;j++) {
            cs^=xor_8bit[buff[j]&mask_hamming[i][j]];
        }
        if (cs) n++;
    }
    return n==0||(n==2&&cs);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorl %eax, %eax
leaq 0x33c62(%rip), %rcx     # 0x62f10
leaq 0x33b5b(%rip), %rdx     # 0x62e10
xorl %esi, %esi
cmpq $0x8, %rax
je 0x2f2ef
xorl %r9d, %r9d
xorl %r8d, %r8d
cmpq $0xb, %r9
je 0x2f2df
movzbl (%rdi,%r9), %r10d
movzbl (%rcx,%r9), %r11d
andl %r10d, %r11d
xorb (%r11,%rdx), %r8b
incq %r9
jmp 0x2f2c3
cmpb $0x1, %r8b
sbbl $-0x1, %esi
incq %rax
addq $0xc, %rcx
jmp 0x2f2b7
testl %esi, %esi
sete %al
cmpl $0x2, %esi
sete %cl
testb %r8b, %r8b
setne %dl
andb %cl, %dl
orb %al, %dl
movzbl %dl, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::free_raw(bamboo::raw_t*)
extern void free_raw(raw_t *raw)
{
    half_cyc_t *p,*next;
    
    trace(3,"free_raw:\n");
    
    free(raw->obs.data ); raw->obs.data =NULL; raw->obs.n =0;
    free(raw->obuf.data); raw->obuf.data=NULL; raw->obuf.n=0;
    free(raw->nav.eph  ); raw->nav.eph  =NULL; raw->nav.n =0;
    free(raw->nav.alm  ); raw->nav.alm  =NULL; raw->nav.na=0;
    free(raw->nav.geph ); raw->nav.geph =NULL; raw->nav.ng=0;
    free(raw->nav.seph ); raw->nav.seph =NULL; raw->nav.ns=0;
    
    /* free half-cycle correction list */
    for (p=raw->half_cyc;p;p=next) {
        next=p->next;
        free(p);
    }
    raw->half_cyc=NULL;
    
    /* free receiver dependent data */
    switch (raw->format) {
       // case STRFMT_CMR : free_cmr (raw); break;
        case STRFMT_RT17: free_rt17(raw); break;
    }
    raw->rcv_data=NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x32948(%rip), %rsi     # 0x631ca
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x455bc
movq 0x1d28(%rbx), %rdi
callq 0x8780
andq $0x0, 0x1d28(%rbx)
andl $0x0, 0x1d20(%rbx)
movq 0x1d38(%rbx), %rdi
callq 0x8780
andq $0x0, 0x1d38(%rbx)
andl $0x0, 0x1d30(%rbx)
movq 0x1d80(%rbx), %rdi
callq 0x8780
andq $0x0, 0x1d80(%rbx)
andl $0x0, 0x1d40(%rbx)
movq 0x1da8(%rbx), %rdi
callq 0x8780
andq $0x0, 0x1da8(%rbx)
andl $0x0, 0x1d68(%rbx)
movq 0x1d88(%rbx), %rdi
callq 0x8780
andq $0x0, 0x1d88(%rbx)
andl $0x0, 0x1d48(%rbx)
movq 0x1d90(%rbx), %rdi
callq 0x8780
andq $0x0, 0x1d90(%rbx)
andl $0x0, 0x1d50(%rbx)
movq 0x82b90(%rbx), %rdi
testq %rdi, %rdi
je 0x30948
movq 0x28(%rdi), %r14
callq 0x8780
movq %r14, %rdi
jmp 0x30935
andq $0x0, 0x82b90(%rbx)
cmpl $0xc, 0x82b98(%rbx)
jne 0x30961
movq %rbx, %rdi
callq 0x31020
andq $0x0, 0x82ba0(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rcvraw.cpp
// Function: bamboo::input_raw(bamboo::raw_t*, int, unsigned char)
extern int input_raw(raw_t *raw, int format, unsigned char data)
{
    trace(5,"input_raw: format=%d data=0x%02x\n",format,data);
    
    switch (format) {
//        case STRFMT_OEM4 : return input_oem4 (raw,data);
//        case STRFMT_OEM3 : return input_oem3 (raw,data);
        case STRFMT_UBX  : return input_ubx  (raw,data);
//        case STRFMT_SS2  : return input_ss2  (raw,data);
//        case STRFMT_CRES : return input_cres (raw,data);
        case STRFMT_STQ  : return input_stq  (raw,data);
//        case STRFMT_GW10 : return input_gw10 (raw,data);
//        case STRFMT_JAVAD: return input_javad(raw,data);
//        case STRFMT_NVS  : return input_nvs  (raw,data);
        case STRFMT_BINEX: return input_bnx  (raw,data);
        case STRFMT_RT17 : return input_rt17 (raw,data);
//        case STRFMT_SEPT : return input_sbf  (raw,data);
//        case STRFMT_CMR  : return input_cmr  (raw,data);
//        case STRFMT_TERSUS: return input_tersus(raw,data);
//        case STRFMT_LEXR : return input_lexr (raw,data);
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x3284d(%rip), %rsi     # 0x631d5
pushq $0x5
popq %rdi
movl %r15d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x455bc
addl $-0x4, %r15d
cmpl $0x8, %r15d
ja 0x30a0a
leaq 0x3241b(%rip), %rax     # 0x62dc4
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movzbl %r14b, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x5581c
movzbl %r14b, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2959c
movzbl %r14b, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4d438
movzbl %r14b, %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x31138
xorl %eax, %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/rcvraw.cpp
// Function: bamboo::input_rawf(bamboo::raw_t*, int, _IO_FILE*)
extern int input_rawf(raw_t *raw, int format, FILE *fp)
{
    trace(4,"input_rawf: format=%d\n",format);
    
    switch (format) {
//        case STRFMT_OEM4 : return input_oem4f (raw,fp);
//        case STRFMT_OEM3 : return input_oem3f (raw,fp);
        case STRFMT_UBX  : return input_ubxf  (raw,fp);
//        case STRFMT_SS2  : return input_ss2f  (raw,fp);
//        case STRFMT_CRES : return input_cresf (raw,fp);
        case STRFMT_STQ  : return input_stqf  (raw,fp);
//        case STRFMT_GW10 : return input_gw10f (raw,fp);
//        case STRFMT_JAVAD: return input_javadf(raw,fp);
//        case STRFMT_NVS  : return input_nvsf  (raw,fp);
        case STRFMT_BINEX: return input_bnxf  (raw,fp);
        case STRFMT_RT17 : return input_rt17f (raw,fp);
//        case STRFMT_SEPT : return input_sbff  (raw,fp);
//        case STRFMT_CMR  : return input_cmrf  (raw,fp);
//        case STRFMT_TERSUS: return input_tersusf(raw,fp);
//        case STRFMT_LEXR : return input_lexrf (raw,fp);
    }
    return -2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %r15d
movq %rdi, %r14
leaq 0x327c6(%rip), %rsi     # 0x631f7
pushq $0x4
popq %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x455bc
addl $-0x4, %r15d
cmpl $0x8, %r15d
ja 0x30aac
leaq 0x32399(%rip), %rax     # 0x62de8
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x57650
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2c94a
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4e4b5
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x325a2
pushq $-0x2
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rt17.cpp
// Function: bamboo::free_rt17(bamboo::raw_t*)
EXPORT void free_rt17(raw_t *Raw)
{
    rt17_t *rt17 = NULL;
    
    if (Raw->format != STRFMT_RT17)
        return;
 
    if ((rt17 = (rt17_t*) Raw->rcv_data))
    {
        if (rt17->MessageBuffer)
        {
            memset(rt17->MessageBuffer, 0, MBUFF_LENGTH);
            free(rt17->MessageBuffer);
            rt17->MessageBuffer = NULL;
        }

        if (rt17->PacketBuffer)
        {
            memset(rt17->PacketBuffer, 0, PBUFF_LENGTH);
            free(rt17->PacketBuffer);
            rt17->PacketBuffer = NULL;
        }

        memset(rt17, 0, sizeof(rt17_t));
        free(rt17);
        Raw->rcv_data = NULL;
    }
}

// Assembly:
cmpl $0xc, 0x82b98(%rdi)
jne 0x31091
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x82ba0(%rdi), %r14
testq %r14, %r14
je 0x3108d
movq (%r14), %rdi
testq %rdi, %rdi
je 0x3105f
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x8390
movq (%r14), %rdi
callq 0x8780
andq $0x0, (%r14)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x3107d
movl $0x105, %edx            # imm = 0x105
xorl %esi, %esi
callq 0x8390
movq 0x8(%r14), %rdi
callq 0x8780
movq %r14, %rdi
callq 0x8780
andq $0x0, 0x82ba0(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rt17.cpp
// Function: bamboo::init_rt17(bamboo::raw_t*)
EXPORT int init_rt17(raw_t *Raw)
{
	rt17_t *rt17 = NULL;
    unsigned char *MessageBuffer = NULL, *PacketBuffer = NULL;

    if (Raw->format != STRFMT_RT17)
       return 0;
 
    if (!(rt17 = (rt17_t*) calloc(1, sizeof(rt17_t))))
    {
        tracet(0, "RT17: unable to allocate RT17 dependent private data structure.\n");
        return 0;
    }
    Raw->rcv_data = (void*) rt17;
    
    if (!(MessageBuffer = (unsigned char*) calloc(MBUFF_LENGTH, sizeof(unsigned char))))
    {
        tracet(0, "RT17: unable to allocate RT17 message buffer.\n");
        free_rt17(Raw);
        return 0;
    }
    rt17->MessageBuffer = MessageBuffer;

    if (!(PacketBuffer = (unsigned char*) calloc(PBUFF_LENGTH, sizeof(unsigned char))))
    {
        tracet(0, "RT17: unable to allocate RT17 packet buffer.\n");
        free_rt17(Raw);
        return 0;
    }
    rt17->PacketBuffer = PacketBuffer;

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
xorl %r14d, %r14d
cmpl $0xc, 0x82b98(%rdi)
jne 0x31130
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x8440
testq %rax, %rax
je 0x310f7
movq %rax, %r14
movq %rax, 0x82ba0(%rbx)
pushq $0x1
popq %rsi
movl $0x2000, %edi           # imm = 0x2000
callq 0x8440
testq %rax, %rax
je 0x3110c
movq %rax, (%r14)
pushq $0x1
popq %rsi
movl $0x105, %edi            # imm = 0x105
callq 0x8440
testq %rax, %rax
je 0x31115
movq %rax, 0x8(%r14)
pushq $0x1
popq %r14
jmp 0x31130
leaq 0x3223a(%rip), %rsi     # 0x63338
xorl %r14d, %r14d
xorl %edi, %edi
xorl %eax, %eax
callq 0x4acf2
jmp 0x31130
leaq 0x32266(%rip), %rsi     # 0x63379
jmp 0x3111c
leaq 0x3228c(%rip), %rsi     # 0x633a8
xorl %r14d, %r14d
xorl %edi, %edi
xorl %eax, %eax
callq 0x4acf2
movq %rbx, %rdi
callq 0x31020
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rt17.cpp
// Function: bamboo::ClearPacketBuffer(bamboo::rt17_t*)
static void ClearPacketBuffer(rt17_t *rt17)
{
    unsigned char *PacketBuffer = rt17->PacketBuffer;
    int i;

    for (i = 0; i < 4; i++)
        PacketBuffer[i] = 0;

    rt17->PacketLength = rt17->PacketBytes = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rax
xorl %ecx, %ecx
cmpq $0x4, %rcx
je 0x32578
movb $0x0, (%rax,%rcx)
incq %rcx
jmp 0x32569
andq $0x0, 0x24(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rt17.cpp
// Function: bamboo::ClearMessageBuffer(bamboo::rt17_t*)
static void ClearMessageBuffer(rt17_t *rt17)
{
   unsigned char *MessageBuffer = rt17->MessageBuffer;
   int i;
   
   for (i = 0; i < 4; i++)
       MessageBuffer[i] = 0;

    rt17->MessageLength = rt17->MessageBytes = 0;
    rt17->Reply = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
xorl %ecx, %ecx
cmpq $0x4, %rcx
je 0x32597
movb $0x0, (%rax,%rcx)
incq %rcx
jmp 0x32588
andq $0x0, 0x1c(%rdi)
andl $0x0, 0x30(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rt17.cpp
// Function: bamboo::SetWeek(bamboo::raw_t*, int, double)
static void SetWeek(raw_t *Raw, int Week, double Tow)
{
    rt17_t *rt17 = (rt17_t*) Raw->rcv_data;

    if (!(rt17->Flags & M_WEEK_OPTION))
    {
        if (rt17->Week)
        {
            if (Week != rt17->Week)
            {
                if (Week == (rt17->Week + 1))
                    tracet(2, "RT17: GPS WEEK rolled over from %d to %d.\n", rt17->Week, Week);
                else
                    tracet(2, "RT17: GPS WEEK changed from %d to %d.\n", rt17->Week, Week);
            }
        }
        else
            tracet(2, "RT17: GPS WEEK initially set to %d.\n", Week);

        rt17->Week = Week;
    }

    /* Also update the time if we can */
    if (Week && (Tow != 0.0))
        Raw->time = gpst2time(Week, Tow);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movq %rdi, %rbx
movq 0x82ba0(%rdi), %r15
testb $0x1, 0x18(%r15)
jne 0x32667
movl 0x34(%r15), %edx
testl %edx, %edx
je 0x3262f
cmpl %r14d, %edx
je 0x32663
movsd %xmm0, -0x20(%rbp)
leal 0x1(%rdx), %eax
cmpl %r14d, %eax
jne 0x3264a
leaq 0x312e4(%rip), %rsi     # 0x63911
jmp 0x32651
leaq 0x3132d(%rip), %rsi     # 0x63963
pushq $0x2
popq %rdi
movl %r14d, %edx
xorl %eax, %eax
movsd %xmm0, -0x20(%rbp)
callq 0x4acf2
jmp 0x3265e
leaq 0x312eb(%rip), %rsi     # 0x6393c
pushq $0x2
popq %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x4acf2
movsd -0x20(%rbp), %xmm0
movl %r14d, 0x34(%r15)
testl %r14d, %r14d
je 0x32688
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x32678
jnp 0x32688
movl %r14d, %edi
callq 0x4708a
movq %rax, (%rbx)
movsd %xmm0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm.cpp
// Function: bamboo::free_rtcm(bamboo::rtcm_t*)
extern void free_rtcm(rtcm_t *rtcm)
{
    trace(3,"free_rtcm:\n");
    
    /* free memory for observation and ephemeris buffer */
    free(rtcm->obs.data); rtcm->obs.data=NULL; rtcm->obs.n=0;
    free(rtcm->nav.eph ); rtcm->nav.eph =NULL; rtcm->nav.n=0;
    free(rtcm->nav.geph); rtcm->nav.geph=NULL; rtcm->nav.ng=0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x316b3(%rip), %rsi     # 0x641ed
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x455bc
movq 0x38(%rbx), %rdi
callq 0x8780
andq $0x0, 0x38(%rbx)
andl $0x0, 0x30(%rbx)
movq 0x80(%rbx), %rdi
callq 0x8780
andq $0x0, 0x80(%rbx)
andl $0x0, 0x40(%rbx)
movq 0x88(%rbx), %rdi
callq 0x8780
andq $0x0, 0x88(%rbx)
andl $0x0, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm.cpp
// Function: bamboo::input_rtcm3(bamboo::rtcm_t*, unsigned char)
extern int input_rtcm3(rtcm_t *rtcm, unsigned char data)
{
    trace(5,"input_rtcm3: data=%02x\n",data);
    
    /* synchronize frame */
    if (rtcm->nbyte==0) {
        if (data!=RTCM3PREAMB) return 0;
        rtcm->buff[rtcm->nbyte++]=data;
        return 0;
    }
    rtcm->buff[rtcm->nbyte++]=data;
    
    if (rtcm->nbyte==3) {
        rtcm->len=getbitu(rtcm->buff,14,10)+3; /* length without parity */
    }
    if (rtcm->nbyte<3||rtcm->nbyte<rtcm->len+3) return 0;
    rtcm->nbyte=0;
    
    /* check parity */
    if (rtk_crc24q(rtcm->buff,rtcm->len)!=getbitu(rtcm->buff,rtcm->len*8,24)) {
        trace(2,"rtcm3 parity error: len=%d\n",rtcm->len);
        return 0;
    }
    /* decode rtcm3 message */
    return decode_rtcm3(rtcm);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r15d
movq %rdi, %rbx
leaq 0x31529(%rip), %rsi     # 0x64236
pushq $0x5
popq %rdi
movl %r15d, %edx
xorl %eax, %eax
callq 0x455bc
movslq 0x9f0b8(%rbx), %rax
testq %rax, %rax
je 0x32db9
leaq 0x9f0c4(%rbx), %r14
leal 0x1(%rax), %ecx
movl %ecx, 0x9f0b8(%rbx)
movb %r15b, 0x9f0c4(%rbx,%rax)
movl 0x9f0b8(%rbx), %eax
cmpl $0x3, %eax
jne 0x32d6a
pushq $0xe
popq %rsi
pushq $0xa
popq %rdx
movq %r14, %rdi
callq 0x459f7
addl $0x3, %eax
movl %eax, 0x9f0c0(%rbx)
movl 0x9f0b8(%rbx), %eax
cmpl $0x3, %eax
jl 0x32de9
movl 0x9f0c0(%rbx), %esi
leal 0x3(%rsi), %ecx
cmpl %ecx, %eax
jl 0x32de9
andl $0x0, 0x9f0b8(%rbx)
movq %r14, %rdi
callq 0x45b4d
movl %eax, %r15d
movl 0x9f0c0(%rbx), %esi
shll $0x3, %esi
pushq $0x18
popq %rdx
movq %r14, %rdi
callq 0x459f7
cmpl %eax, %r15d
jne 0x32dd2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x34488
cmpb $-0x2d, %r15b
jne 0x32de9
movl $0x1, 0x9f0b8(%rbx)
movb $-0x2d, 0x9f0c4(%rbx)
jmp 0x32de9
movl 0x9f0c0(%rbx), %edx
leaq 0x3146f(%rip), %rsi     # 0x6424e
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x455bc
xorl %eax, %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/rtcm.cpp
// Function: bamboo::input_rtcm2f(bamboo::rtcm_t*, _IO_FILE*)
extern int input_rtcm2f(rtcm_t *rtcm, FILE *fp)
{
    int i,data=0,ret;
    
    trace(4,"input_rtcm2f: data=%02x\n",data);
    
    for (i=0;i<4096;i++) {
        if ((data=fgetc(fp))==EOF) return -2;
        if ((ret=input_rtcm2(rtcm,(unsigned char)data))) return ret;
    }
    return 0; /* return at every 4k bytes */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
leaq 0x31459(%rip), %rsi     # 0x6426a
xorl %ebx, %ebx
pushq $0x4
popq %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x455bc
movl $0x1001, %r13d          # imm = 0x1001
pushq $-0x2
popq %r12
decl %r13d
je 0x32e51
movq %r14, %rdi
callq 0x89b0
cmpl $-0x1, %eax
je 0x32e4e
movzbl %al, %esi
movq %r15, %rdi
callq 0x32b8d
testl %eax, %eax
je 0x32e29
movl %eax, %ebx
jmp 0x32e51
movl %r12d, %ebx
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_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm.cpp
// Function: bamboo::input_rtcm3f(bamboo::rtcm_t*, _IO_FILE*)
extern int input_rtcm3f(rtcm_t *rtcm, FILE *fp)
{
    int i,data=0,ret;
    
    trace(4,"input_rtcm3f: data=%02x\n",data);
    
    for (i=0;i<4096;i++) {
        if ((data=fgetc(fp))==EOF) return -2;
        if ((ret=input_rtcm3(rtcm,(unsigned char)data))) return ret;
    }
    return 0; /* return at every 4k bytes */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
leaq 0x31406(%rip), %rsi     # 0x64283
xorl %ebx, %ebx
pushq $0x4
popq %rdi
xorl %edx, %edx
xorl %eax, %eax
callq 0x455bc
movl $0x1001, %r13d          # imm = 0x1001
pushq $-0x2
popq %r12
decl %r13d
je 0x32ebd
movq %r14, %rdi
callq 0x89b0
cmpl $-0x1, %eax
je 0x32eba
movzbl %al, %esi
movq %r15, %rdi
callq 0x32cf6
testl %eax, %eax
je 0x32e95
movl %eax, %ebx
jmp 0x32ebd
movl %r12d, %ebx
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_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm.cpp
// Function: bamboo::gen_rtcm3(bamboo::rtcm_t*, int, int)
extern int gen_rtcm3(rtcm_t *rtcm, int type, int sync)
{
    unsigned int crc;
    int i=0;
    
    trace(4,"gen_rtcm3: type=%d sync=%d\n",type,sync);
    
    rtcm->nbit=rtcm->len=rtcm->nbyte=0;
    
    /* set preamble and reserved */
    setbitu(rtcm->buff,i, 8,RTCM3PREAMB); i+= 8;
    setbitu(rtcm->buff,i, 6,0          ); i+= 6;
    setbitu(rtcm->buff,i,10,0          ); i+=10;
    
    /* encode rtcm 3 message body */
    if (!encode_rtcm3(rtcm,type,sync)) return 0;
    
    /* padding to align 8 bit boundary */
    for (i=rtcm->nbit;i%8;i++) {
        setbitu(rtcm->buff,i,1,0);
    }
    /* message length (header+data) (bytes) */
    if ((rtcm->len=i/8)>=3+1024) {
        trace(2,"generate rtcm 3 message length error len=%d\n",rtcm->len-3);
        rtcm->nbit=rtcm->len=0;
        return 0;
    }
    /* message length without header and parity */
    setbitu(rtcm->buff,14,10,rtcm->len-3);
    
    /* crc-24q */
    crc=rtk_crc24q(rtcm->buff,rtcm->len);
    setbitu(rtcm->buff,i,24,crc);
    
    /* length total (bytes) */
    rtcm->nbyte=rtcm->len+3;
    
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ecx
movl %edx, -0x2c(%rbp)
movl %esi, %r13d
movq %rdi, %rbx
leaq 0x31394(%rip), %rsi     # 0x642b8
xorl %r14d, %r14d
pushq $0x4
popq %rdi
movl %r13d, %edx
xorl %eax, %eax
callq 0x455bc
andq $0x0, 0x9f0b8(%rbx)
andl $0x0, 0x9f0c0(%rbx)
leaq 0x9f0c4(%rbx), %r15
pushq $0x8
popq %r12
movq %r15, %rdi
xorl %esi, %esi
movl %r12d, %edx
movl $0xd3, %ecx
callq 0x45a69
pushq $0x6
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
xorl %ecx, %ecx
callq 0x45a69
pushq $0xe
popq %rsi
pushq $0xa
popq %rdx
movq %r15, %rdi
xorl %ecx, %ecx
callq 0x45a69
movq %rbx, %rdi
movl %r13d, %esi
movl -0x2c(%rbp), %edx
callq 0x3c704
testl %eax, %eax
je 0x3302d
movl 0x9f0bc(%rbx), %r12d
pushq $0x1
popq %r14
testb $0x7, %r12b
je 0x32fbc
movq %r15, %rdi
movl %r12d, %esi
movl %r14d, %edx
xorl %ecx, %ecx
callq 0x45a69
incl %r12d
jmp 0x32fa1
movl %r12d, %eax
sarl $0x3, %eax
movl %eax, 0x9f0c0(%rbx)
leal -0x3(%rax), %ecx
cmpl $0x403, %eax            # imm = 0x403
jl 0x32ff2
leaq 0x312fb(%rip), %rsi     # 0x642d4
xorl %r14d, %r14d
pushq $0x2
popq %rdi
movl %ecx, %edx
xorl %eax, %eax
callq 0x455bc
andq $0x0, 0x9f0bc(%rbx)
jmp 0x3302d
pushq $0xe
popq %rsi
pushq $0xa
popq %rdx
movq %r15, %rdi
callq 0x45a69
movl 0x9f0c0(%rbx), %esi
movq %r15, %rdi
callq 0x45b4d
pushq $0x18
popq %rdx
movq %r15, %rdi
movl %r12d, %esi
movl %eax, %ecx
callq 0x45a69
movl 0x9f0c0(%rbx), %eax
addl $0x3, %eax
movl %eax, 0x9f0b8(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/DoubleString[P]RtConverter/src/Rtklib/rtcm2.cpp
// Function: bamboo::decode_type1(bamboo::rtcm_t*)
static int decode_type1(rtcm_t *rtcm)
{
    int i=48,fact,udre,prn,sat,iod;
    double prc,rrc;
    
    trace(4,"decode_type1: len=%d\n",rtcm->len);
    
    while (i+40<=rtcm->len*8) {
        fact=getbitu(rtcm->buff,i, 1); i+= 1;
        udre=getbitu(rtcm->buff,i, 2); i+= 2;
        prn =getbitu(rtcm->buff,i, 5); i+= 5;
        prc =getbits(rtcm->buff,i,16); i+=16;
        rrc =getbits(rtcm->buff,i, 8); i+= 8;
        iod =getbits(rtcm->buff,i, 8); i+= 8;
        if (prn==0) prn=32;
        if (prc==0x80000000||rrc==0xFFFF8000) {
            trace(2,"rtcm2 1 prc/rrc indicates satellite problem: prn=%d\n",prn);
            continue;
        }
        if (rtcm->dgps) {
            sat=satno(SYS_GPS,prn);
            rtcm->dgps[sat-1].t0=rtcm->time;
            rtcm->dgps[sat-1].prc=prc*(fact?0.32:0.02);
            rtcm->dgps[sat-1].rrc=rrc*(fact?0.032:0.002);
            rtcm->dgps[sat-1].iod=iod;
            rtcm->dgps[sat-1].udre=udre;
        }
    }
    return 7;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl 0x9f0c0(%rdi), %edx
leaq 0x3022d(%rip), %rsi     # 0x64495
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x455bc
movq %rbx, %rdi
leaq 0x9f0c4(%rbx), %r14
leaq 0x10(%rbx), %rax
movq %rax, -0x50(%rbp)
pushq $0x58
popq %r12
pushq $0x1
popq %rbx
movq %rdi, -0x48(%rbp)
movl 0x9f0c0(%rdi), %eax
shll $0x3, %eax
cmpl %eax, %r12d
jg 0x343cd
leal -0x28(%r12), %esi
movq %r14, %rdi
movl %ebx, %edx
callq 0x459f7
movl %eax, -0x3c(%rbp)
leal -0x27(%r12), %esi
movq %r14, %rdi
pushq $0x2
popq %rdx
callq 0x459f7
movl %eax, -0x40(%rbp)
leal -0x25(%r12), %esi
movq %r14, %rdi
pushq $0x5
popq %rdx
callq 0x459f7
movl %eax, %r13d
leal -0x20(%r12), %esi
movq %r14, %rdi
pushq $0x10
popq %rdx
callq 0x45a39
movl %eax, -0x38(%rbp)
leal -0x10(%r12), %esi
movq %r14, %rdi
pushq $0x8
popq %r15
movl %r15d, %edx
callq 0x45a39
movl %eax, -0x30(%rbp)
leal -0x8(%r12), %esi
movq %r14, %rdi
movl %r15d, %edx
movl %ebx, %r15d
callq 0x45a39
movq -0x48(%rbp), %rdi
cmpq $0x0, 0x6f140(%rdi)
je 0x343c1
movl %eax, %ebx
testl %r13d, %r13d
pushq $0x20
popq %rax
cmovel %eax, %r13d
cvtsi2sdl -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
cvtsi2sdl -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movl %r15d, %edi
movl %r13d, %esi
callq 0x452fd
movq -0x48(%rbp), %rdi
movq 0x6f140(%rdi), %rcx
decl %eax
cltq
imulq $0x30, %rax, %rax
movq -0x50(%rbp), %rdx
movups (%rdx), %xmm0
movups %xmm0, (%rcx,%rax)
xorl %ecx, %ecx
cmpl $0x0, -0x3c(%rbp)
sete %cl
shll $0x3, %ecx
leaq 0x2ffbc(%rip), %rdx     # 0x64340
movsd -0x38(%rbp), %xmm0
mulsd (%rcx,%rdx), %xmm0
movq 0x6f140(%rdi), %rdx
movsd %xmm0, 0x10(%rdx,%rax)
leaq 0x2ffae(%rip), %rsi     # 0x64350
movsd -0x30(%rbp), %xmm0
mulsd (%rcx,%rsi), %xmm0
movsd %xmm0, 0x18(%rdx,%rax)
movl %ebx, 0x20(%rdx,%rax)
cvtsi2sdl -0x40(%rbp), %xmm0
movsd %xmm0, 0x28(%rdx,%rax)
addl $0x28, %r12d
movl %r15d, %ebx
jmp 0x3428f
addq $0x28, %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/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
movl (%rdi), %ecx
xorl %r8d, %r8d
testl %ecx, %ecx
movl $0x0, %eax
cmovgl %ecx, %eax
movabsq $0x10, %r9
cmpq %r8, %rax
je 0x34415
movq 0x8(%rdi), %r10
movzbl (%r10,%r9), %r10d
cmpl %edx, %r10d
je 0x34421
incq %r8
addq $0x60, %r9
jmp 0x343f9
cmpl $0x3f, %ecx
jle 0x34426
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x34485
movl %r8d, %eax
jmp 0x34485
movq 0x8(%rdi), %r8
imulq $0x60, %rax, %rcx
movq %rsi, (%r8,%rcx)
movsd %xmm0, 0x8(%r8,%rcx)
movb %dl, 0x10(%r8,%rcx)
xorl %edx, %edx
xorl %esi, %esi
cmpq $0x3, %rsi
je 0x34483
movq 0x8(%rdi), %r8
addq %rcx, %r8
andq $0x0, 0x38(%r8,%rsi,8)
andq $0x0, 0x20(%r8,%rsi,8)
andl $0x0, 0x50(%r8,%rsi,4)
movb %dl, 0x18(%rsi,%r8)
movq 0x8(%rdi), %r8
addq %rcx, %r8
movb %dl, 0x15(%rsi,%r8)
movq 0x8(%rdi), %r8
addq %rcx, %r8
movb %dl, 0x12(%rsi,%r8)
incq %rsi
jmp 0x34442
incl (%rdi)
popq %rbp
retq
nop