// File: DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::readngspcv(char const*, bamboo::pcvs_t*)
static int readngspcv(const char *file, pcvs_t *pcvs)
{
    FILE *fp;
    static const pcv_t pcv0={0};
    pcv_t pcv;
    double neu[3];
    int n=0;
    char buff[256];
    
    if (!(fp=fopen(file,"r"))) {
        trace(2,"ngs pcv file open error: %s\n",file);
        return 0;
    }
    while (fgets(buff,sizeof(buff),fp)) {
        
        if (strlen(buff)>=62&&buff[61]=='|') continue;
        
        if (buff[0]!=' ') n=0; /* start line */
        if (++n==1) {
            pcv=pcv0;
            strncpy(pcv.type,buff,61); pcv.type[61]='\0';
        }
        else if (n==2) {
            if (decodef(buff,3,neu)<3) continue;
            pcv.off[0][0]=neu[1];
            pcv.off[0][1]=neu[0];
            pcv.off[0][2]=neu[2];
        }
        else if (n==3) decodef(buff,10,pcv.var[0]);
        else if (n==4) decodef(buff,9,pcv.var[0]+10);
        else if (n==5) {
            if (decodef(buff,3,neu)<3) continue;;
            pcv.off[1][0]=neu[1];
            pcv.off[1][1]=neu[0];
            pcv.off[1][2]=neu[2];
        }
        else if (n==6) decodef(buff,10,pcv.var[1]);
        else if (n==7) {
            decodef(buff,9,pcv.var[1]+10);
            addpcv(&pcv,pcvs);
        }
    }
    fclose(fp);
    
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x400, %rsp            # imm = 0x400
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x2f4(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x36307(%rip), %rsi     # 0xc7e9f
callq 0x98d0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x91bca
movq -0x10(%rbp), %rdx
movl $0x2, %edi
leaq 0x36642(%rip), %rsi     # 0xc81f9
movb $0x0, %al
callq 0x8b980
movl $0x0, -0x4(%rbp)
jmp 0x91e25
jmp 0x91bcc
leaq -0x400(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x100, %esi            # imm = 0x100
callq 0x9ba0
cmpq $0x0, %rax
je 0x91e15
leaq -0x400(%rbp), %rdi
callq 0x92e0
cmpq $0x3e, %rax
jb 0x91c0b
movsbl -0x3c3(%rbp), %eax
cmpl $0x7c, %eax
jne 0x91c0b
jmp 0x91bcc
movsbl -0x400(%rbp), %eax
cmpl $0x20, %eax
je 0x91c21
movl $0x0, -0x2f4(%rbp)
movl -0x2f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2f4(%rbp)
cmpl $0x1, %eax
jne 0x91c75
leaq -0x2d8(%rbp), %rdi
leaq 0x35335(%rip), %rsi     # 0xc6f78
movl $0x2b8, %edx            # imm = 0x2B8
callq 0x9610
leaq -0x2d8(%rbp), %rdi
addq $0x4, %rdi
leaq -0x400(%rbp), %rsi
movl $0x3d, %edx
callq 0x93b0
movb $0x0, -0x297(%rbp)
jmp 0x91e10
cmpl $0x2, -0x2f4(%rbp)
jne 0x91cd5
leaq -0x400(%rbp), %rdi
leaq -0x2f0(%rbp), %rdx
movl $0x3, %esi
callq 0x998c0
cmpl $0x3, %eax
jge 0x91ca0
jmp 0x91bcc
movsd -0x2e8(%rbp), %xmm0
movsd %xmm0, -0x230(%rbp)
movsd -0x2f0(%rbp), %xmm0
movsd %xmm0, -0x228(%rbp)
movsd -0x2e0(%rbp), %xmm0
movsd %xmm0, -0x220(%rbp)
jmp 0x91e0e
cmpl $0x3, -0x2f4(%rbp)
jne 0x91d02
leaq -0x400(%rbp), %rdi
leaq -0x2d8(%rbp), %rdx
addq $0xf0, %rdx
movl $0xa, %esi
callq 0x998c0
jmp 0x91e0c
cmpl $0x4, -0x2f4(%rbp)
jne 0x91d33
leaq -0x400(%rbp), %rdi
leaq -0x2d8(%rbp), %rdx
addq $0xf0, %rdx
addq $0x50, %rdx
movl $0x9, %esi
callq 0x998c0
jmp 0x91e0a
cmpl $0x5, -0x2f4(%rbp)
jne 0x91d90
leaq -0x400(%rbp), %rdi
leaq -0x2f0(%rbp), %rdx
movl $0x3, %esi
callq 0x998c0
cmpl $0x3, %eax
jge 0x91d5e
jmp 0x91bcc
movsd -0x2e8(%rbp), %xmm0
movsd %xmm0, -0x218(%rbp)
movsd -0x2f0(%rbp), %xmm0
movsd %xmm0, -0x210(%rbp)
movsd -0x2e0(%rbp), %xmm0
movsd %xmm0, -0x208(%rbp)
jmp 0x91e08
cmpl $0x6, -0x2f4(%rbp)
jne 0x91dc1
leaq -0x400(%rbp), %rdi
leaq -0x2d8(%rbp), %rdx
addq $0xf0, %rdx
addq $0x98, %rdx
movl $0xa, %esi
callq 0x998c0
jmp 0x91e06
cmpl $0x7, -0x2f4(%rbp)
jne 0x91e04
leaq -0x400(%rbp), %rdi
leaq -0x2d8(%rbp), %rdx
addq $0xf0, %rdx
addq $0x98, %rdx
addq $0x50, %rdx
movl $0x9, %esi
callq 0x998c0
movq -0x18(%rbp), %rsi
leaq -0x2d8(%rbp), %rdi
callq 0x997e0
jmp 0x91e06
jmp 0x91e08
jmp 0x91e0a
jmp 0x91e0c
jmp 0x91e0e
jmp 0x91e10
jmp 0x91bcc
movq -0x20(%rbp), %rdi
callq 0x9770
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x400, %rsp            # imm = 0x400
popq %rbp
retq
nopw %cs:(%rax,%rax)