// File: DoubleString[P]RtConverter/src/Rtklib/rtcm.cpp
// Function: bamboo::init_rtcm(bamboo::rtcm_t*)
extern int init_rtcm(rtcm_t *rtcm)
{
    gtime_t time0={0};
    obsd_t data0={{0}};
    eph_t  eph0 ={0,-1,-1};
    geph_t geph0={0,-1};
    ssr_t ssr0={{{0}}};
    int i,j;
    
    trace(3,"init_rtcm:\n");
    
    rtcm->staid=rtcm->stah=rtcm->seqno=rtcm->outtype=0;
    rtcm->time=rtcm->time_s=time0;
    rtcm->sta.name[0]=rtcm->sta.marker[0]='\0';
    rtcm->sta.antdes[0]=rtcm->sta.antsno[0]='\0';
    rtcm->sta.rectype[0]=rtcm->sta.recver[0]=rtcm->sta.recsno[0]='\0';
    rtcm->sta.antsetup=rtcm->sta.itrf=rtcm->sta.deltype=0;
    for (i=0;i<3;i++) {
        rtcm->sta.pos[i]=rtcm->sta.del[i]=0.0;
    }
    rtcm->sta.hgt=0.0;
    rtcm->dgps=NULL;
    for (i=0;i<MAXRTKSAT;i++) {
        rtcm->ssr[i]=ssr0;
        for(j=0;j < 6;j++)
        	rtcm->ssr[i].iod[j] = -999;
    }
    rtcm->msg[0]=rtcm->msgtype[0]=rtcm->opt[0]='\0';
    for (i=0;i<6;i++) rtcm->msmtype[i][0]='\0';
    rtcm->obsflag=rtcm->ephsat=0;
    for (i=0;i<MAXRTKSAT;i++) for (j=0;j<NFREQ+NEXOBS;j++) {
        rtcm->cp[i][j]=0.0;
        rtcm->lock[i][j]=rtcm->loss[i][j]=0;
        rtcm->lltime[i][j]=time0;
    }
    rtcm->nbyte=rtcm->nbit=rtcm->len=0;
    rtcm->word=0;
    for (i=0;i<100;i++) rtcm->nmsg2[i]=0;
    for (i=0;i<400;i++) rtcm->nmsg3[i]=0;
    
    rtcm->obs.data=NULL;
    rtcm->nav.eph =NULL;
    rtcm->nav.geph=NULL;
    
    /* reallocate memory for observation and ephemris buffer */
    if (!(rtcm->obs.data=(obsd_t *)malloc(sizeof(obsd_t)*MAXOBS))||
        !(rtcm->nav.eph =(eph_t  *)malloc(sizeof(eph_t )*MAXRTKSAT))||
        !(rtcm->nav.geph=(geph_t *)malloc(sizeof(geph_t)*MAXPRNGLO))) {
        free_rtcm(rtcm);
        return 0;
    }
    rtcm->obs.n=0;
    rtcm->nav.n=MAXRTKSAT;
    rtcm->nav.ng=MAXPRNGLO;
    for (i=0;i<MAXOBS   ;i++) rtcm->obs.data[i]=data0;
    for (i=0;i<MAXRTKSAT   ;i++) rtcm->nav.eph [i]=eph0;
    for (i=0;i<MAXPRNGLO;i++) rtcm->nav.geph[i]=geph0;
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x6e0, %rsp            # imm = 0x6E0
movq %rdi, -0x10(%rbp)
leaq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x93d0
leaq -0x80(%rbp), %rdi
xorl %esi, %esi
movl $0x60, %edx
callq 0x93d0
leaq -0x1a0(%rbp), %rdi
xorl %esi, %esi
movl $0x120, %edx            # imm = 0x120
callq 0x93d0
movl $0xffffffff, -0x19c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x198(%rbp) # imm = 0xFFFFFFFF
leaq -0x238(%rbp), %rdi
xorl %esi, %esi
movl $0x98, %edx
callq 0x93d0
movl $0xffffffff, -0x234(%rbp) # imm = 0xFFFFFFFF
leaq -0x6d0(%rbp), %rdi
xorl %esi, %esi
movl $0x498, %edx            # imm = 0x498
callq 0x93d0
movl $0x3, %edi
leaq 0x55a7f(%rip), %rsi     # 0xc0431
movb $0x0, %al
callq 0x8b980
movq -0x10(%rbp), %rax
movl $0x0, 0xc(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rax, 0x20(%rcx)
movq -0x18(%rbp), %rax
movq %rax, 0x28(%rcx)
movq -0x10(%rbp), %rax
movq 0x20(%rcx), %rdx
movq %rdx, 0x10(%rax)
movq 0x28(%rcx), %rcx
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6ef78(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6ef38(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6eff8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6efb8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6f0b8(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6f078(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6f038(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x6f100(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x6f0fc(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x6f0f8(%rax)
movl $0x0, -0x6d4(%rbp)
cmpl $0x3, -0x6d4(%rbp)
jge 0x6aad5
movq -0x10(%rbp), %rax
movslq -0x6d4(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, 0x6f120(%rax,%rcx,8)
movq -0x10(%rbp), %rax
movslq -0x6d4(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, 0x6f108(%rax,%rcx,8)
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6aa8d
movq -0x10(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x6f138(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x6f140(%rax)
movl $0x0, -0x6d4(%rbp)
cmpl $0x9b, -0x6d4(%rbp)
jge 0x6aba1
movq -0x10(%rbp), %rdi
addq $0x6f148, %rdi          # imm = 0x6F148
movslq -0x6d4(%rbp), %rax
imulq $0x498, %rax, %rax      # imm = 0x498
addq %rax, %rdi
leaq -0x6d0(%rbp), %rsi
movl $0x498, %edx            # imm = 0x498
callq 0x9610
movl $0x0, -0x6d8(%rbp)
cmpl $0x6, -0x6d8(%rbp)
jge 0x6ab8b
movq -0x10(%rbp), %rax
addq $0x6f148, %rax          # imm = 0x6F148
movslq -0x6d4(%rbp), %rcx
imulq $0x498, %rcx, %rcx      # imm = 0x498
addq %rcx, %rax
movslq -0x6d8(%rbp), %rcx
movl $0xfffffc19, 0x90(%rax,%rcx,4) # imm = 0xFFFFFC19
movl -0x6d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d8(%rbp)
jmp 0x6ab44
jmp 0x6ab8d
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6aafd
movq -0x10(%rbp), %rax
movb $0x0, 0x9fd48(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x9b9d0(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x9b950(%rax)
movl $0x0, -0x6d4(%rbp)
cmpl $0x6, -0x6d4(%rbp)
jge 0x6ac01
movq -0x10(%rbp), %rax
addq $0x9bad0, %rax          # imm = 0x9BAD0
movslq -0x6d4(%rbp), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6abcc
movq -0x10(%rbp), %rax
movl $0x0, 0x9bdd4(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x9bdd0(%rax)
movl $0x0, -0x6d4(%rbp)
cmpl $0x9b, -0x6d4(%rbp)
jge 0x6ad1e
movl $0x0, -0x6d8(%rbp)
cmpl $0x3, -0x6d8(%rbp)
jge 0x6ad08
movq -0x10(%rbp), %rax
addq $0x9bdd8, %rax          # imm = 0x9BDD8
movslq -0x6d4(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movslq -0x6d8(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
addq $0x9d002, %rax          # imm = 0x9D002
movslq -0x6d4(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movslq -0x6d8(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movq -0x10(%rbp), %rax
addq $0x9cc60, %rax          # imm = 0x9CC60
movslq -0x6d4(%rbp), %rcx
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movslq -0x6d8(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movq -0x10(%rbp), %rax
addq $0x9d3a8, %rax          # imm = 0x9D3A8
movslq -0x6d4(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movslq -0x6d8(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x20(%rbp), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl -0x6d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d8(%rbp)
jmp 0x6ac41
jmp 0x6ad0a
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6ac27
movq -0x10(%rbp), %rax
movl $0x0, 0x9f0c0(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x9f0bc(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x9f0b8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x9f574(%rax)
movl $0x0, -0x6d4(%rbp)
cmpl $0x64, -0x6d4(%rbp)
jge 0x6ad90
movq -0x10(%rbp), %rax
movslq -0x6d4(%rbp), %rcx
movl $0x0, 0x9f578(%rax,%rcx,4)
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6ad60
movl $0x0, -0x6d4(%rbp)
cmpl $0x190, -0x6d4(%rbp)    # imm = 0x190
jge 0x6adcd
movq -0x10(%rbp), %rax
movslq -0x6d4(%rbp), %rcx
movl $0x0, 0x9f708(%rax,%rcx,4)
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6ad9a
movq -0x10(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x80(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x88(%rax)
movl $0x1800, %edi           # imm = 0x1800
callq 0x99e0
movq -0x10(%rbp), %rcx
movq %rax, 0x38(%rcx)
cmpq $0x0, %rax
je 0x6ae45
movl $0xae60, %edi           # imm = 0xAE60
callq 0x99e0
movq -0x10(%rbp), %rcx
movq %rax, 0x80(%rcx)
cmpq $0x0, %rax
je 0x6ae45
movl $0x1008, %edi           # imm = 0x1008
callq 0x99e0
movq -0x10(%rbp), %rcx
movq %rax, 0x88(%rcx)
cmpq $0x0, %rax
jne 0x6ae5a
movq -0x10(%rbp), %rdi
callq 0x6af80
movl $0x0, -0x4(%rbp)
jmp 0x6af6f
movq -0x10(%rbp), %rax
movl $0x0, 0x30(%rax)
movq -0x10(%rbp), %rax
movl $0x9b, 0x40(%rax)
movq -0x10(%rbp), %rax
movl $0x1b, 0x48(%rax)
movl $0x0, -0x6d4(%rbp)
cmpl $0x40, -0x6d4(%rbp)
jge 0x6aec3
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movslq -0x6d4(%rbp), %rax
imulq $0x60, %rax, %rax
addq %rax, %rdi
leaq -0x80(%rbp), %rsi
movl $0x60, %edx
callq 0x9610
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6ae85
movl $0x0, -0x6d4(%rbp)
cmpl $0x9b, -0x6d4(%rbp)
jge 0x6af17
movq -0x10(%rbp), %rax
movq 0x80(%rax), %rdi
movslq -0x6d4(%rbp), %rax
imulq $0x120, %rax, %rax      # imm = 0x120
addq %rax, %rdi
leaq -0x1a0(%rbp), %rsi
movl $0x120, %edx            # imm = 0x120
callq 0x9610
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6aecd
movl $0x0, -0x6d4(%rbp)
cmpl $0x1b, -0x6d4(%rbp)
jge 0x6af68
movq -0x10(%rbp), %rax
movq 0x88(%rax), %rdi
movslq -0x6d4(%rbp), %rax
imulq $0x98, %rax, %rax
addq %rax, %rdi
leaq -0x238(%rbp), %rsi
movl $0x98, %edx
callq 0x9610
movl -0x6d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6d4(%rbp)
jmp 0x6af21
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x6e0, %rsp            # imm = 0x6E0
popq %rbp
retq
nopl (%rax,%rax)