// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::readpcv(char const*, bamboo::pcvs_t*)
extern int readpcv(const char *file, pcvs_t *pcvs)
{
    pcv_t *pcv;
    char *ext;
    int i,stat;
    
    trace(3,"readpcv: file=%s\n",file);
    char p_file[1024] = {0};
    strcpy(p_file,file);
    if (!(ext=strrchr(p_file,'.'))) ext="";
    
    if (!strcmp(ext,".atx")||!strcmp(ext,".ATX")) {
        stat=readantex(file,pcvs);
    }
    else {
        stat=readngspcv(file,pcvs);
    }
    for (i=0;i<pcvs->n;i++) {
        pcv=pcvs->pcv+i;
        trace(4,"sat=%2d type=%20s code=%s off=%8.4f %8.4f %8.4f  %8.4f %8.4f %8.4f\n",
              pcv->sat,pcv->type,pcv->code,pcv->off[0][0],pcv->off[0][1],
              pcv->off[0][2],pcv->off[1][0],pcv->off[1][1],pcv->off[1][2]);
    }
    return stat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movq %rsi, -0x60(%rbp)
movq %rdi, %r14
leaq -0x830(%rbp), %r12
xorl %r15d, %r15d
movl $0x400, %edx            # imm = 0x400
movq %r12, %rdi
xorl %esi, %esi
callq 0x8390
movq %r12, %rdi
movq %r14, %rsi
callq 0x85c0
movq %r12, %rdi
movl $0x2e, %esi
callq 0x86a0
testq %rax, %rax
leaq 0x18900(%rip), %r12     # 0x6a5f5
cmovneq %rax, %r12
leaq 0x233bb(%rip), %rsi     # 0x750bb
movq %r12, %rdi
callq 0x8890
testl %eax, %eax
je 0x51ee7
leaq 0x233a9(%rip), %rsi     # 0x750c0
movq %r12, %rdi
callq 0x8890
testl %eax, %eax
je 0x51ee7
leaq 0x2365e(%rip), %rsi     # 0x7538c
movq %r14, %rdi
callq 0x8780
testq %rax, %rax
je 0x522ee
movq %rax, %r14
leaq -0x170(%rbp), %r13
leaq 0x1eb84(%rip), %r15     # 0x708d4
xorl %r12d, %r12d
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x89f0
testq %rax, %rax
je 0x522cb
movq %r13, %rdi
callq 0x8290
cmpq $0x3e, %rax
jb 0x51d83
cmpb $0x7c, -0x133(%rbp)
je 0x51d53
cmpb $0x20, -0x170(%rbp)
movl %r12d, %eax
movl $0x0, %ecx
cmovnel %ecx, %eax
leal 0x1(%rax), %ebx
movl %ebx, %r12d
cmpl $0x6, %eax
ja 0x51d53
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movl $0x2b8, %edx            # imm = 0x2B8
leaq -0x428(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
movl $0x3d, %edx
leaq -0x424(%rbp), %rdi
movq %r13, %rsi
callq 0x8350
movb $0x0, -0x3e7(%rbp)
movl %ebx, %r12d
jmp 0x51d53
movq %r13, %rdi
movl $0x3, %esi
leaq -0x50(%rbp), %rdx
callq 0x5682b
movl $0x5, %r12d
cmpl $0x3, %eax
jl 0x51d53
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
movsd %xmm1, -0x368(%rbp)
movsd %xmm0, -0x360(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x358(%rbp)
movl %ebx, %r12d
jmp 0x51d53
movq %r13, %rdi
movl $0xa, %esi
leaq -0x338(%rbp), %rdx
jmp 0x51eae
movq %r13, %rdi
movl $0x9, %esi
leaq -0x2e8(%rbp), %rdx
jmp 0x51eae
movq %r13, %rdi
movl $0x3, %esi
leaq -0x50(%rbp), %rdx
callq 0x5682b
movl $0x2, %r12d
cmpl $0x3, %eax
jl 0x51d53
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
movsd %xmm1, -0x380(%rbp)
movsd %xmm0, -0x378(%rbp)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x370(%rbp)
movl %ebx, %r12d
jmp 0x51d53
movq %r13, %rdi
movl $0xa, %esi
leaq -0x2a0(%rbp), %rdx
callq 0x5682b
movl %ebx, %r12d
jmp 0x51d53
movq %r13, %rdi
movl $0x9, %esi
leaq -0x250(%rbp), %rdx
callq 0x5682b
leaq -0x428(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x567bc
movl %ebx, %r12d
jmp 0x51d53
leaq 0x2349e(%rip), %rsi     # 0x7538c
movq %r14, %rdi
callq 0x8780
testq %rax, %rax
je 0x522d9
movq %rax, %r14
leaq -0x170(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %rax, %rdx
callq 0x89f0
testq %rax, %rax
je 0x522cb
leaq -0x134(%rbp), %r15
leaq -0x338(%rbp), %r13
leaq -0x170(%rbp), %r12
leaq 0x199fe(%rip), %rbx     # 0x6b939
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq %r12, %rdi
callq 0x8290
cmpq $0x3c, %rax
jb 0x51f68
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8160
testq %rax, %rax
je 0x51f82
movq %r12, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x89f0
testq %rax, %rax
jne 0x51f4a
jmp 0x522cb
movq %r15, %rdi
leaq 0x23531(%rip), %rsi     # 0x754bd
callq 0x8160
testq %rax, %rax
je 0x51fb0
movl $0x2b8, %edx            # imm = 0x2B8
leaq -0x428(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
movl $0x1, -0x2c(%rbp)
movq %r15, %rdi
leaq 0x23514(%rip), %rsi     # 0x754ce
callq 0x8160
testq %rax, %rax
movl -0x2c(%rbp), %eax
je 0x51fd9
leaq -0x428(%rbp), %rdi
movq -0x60(%rbp), %rsi
callq 0x567bc
xorl %eax, %eax
testl %eax, %eax
je 0x52080
movq %r15, %rdi
leaq 0x234f2(%rip), %rsi     # 0x754dd
callq 0x8160
testq %rax, %rax
je 0x5208c
movq %r13, %r15
movl $0x14, %edx
leaq -0x424(%rbp), %rdi
movq %r12, %rbx
movq %r12, %rsi
callq 0x8350
xorl %r12d, %r12d
movb %r12b, -0x410(%rbp)
movl $0x14, %edx
leaq -0x3e4(%rbp), %r13
movq %r13, %rdi
leaq -0x15c(%rbp), %rsi
callq 0x8350
movb %r12b, -0x3d0(%rbp)
movl $0x1, -0x2c(%rbp)
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
cmpq %rax, -0x3e1(%rbp)
jne 0x52067
movq %r13, %rdi
callq 0x4dc92
movl %eax, -0x428(%rbp)
movq %r15, %r13
leaq -0x134(%rbp), %r15
movq %rbx, %r12
leaq 0x198be(%rip), %rbx     # 0x6b939
jmp 0x51f68
movl $0x0, -0x2c(%rbp)
jmp 0x51f68
movq %r15, %rdi
leaq 0x23461(%rip), %rsi     # 0x754f7
callq 0x8160
testq %rax, %rax
je 0x520b3
movq %r12, %rdi
xorl %esi, %esi
movl $0x2b, %edx
leaq -0x3a0(%rbp), %rcx
jmp 0x520d8
movq %r15, %rdi
leaq 0x23445(%rip), %rsi     # 0x75502
callq 0x8160
testq %rax, %rax
je 0x520e9
movq %r12, %rdi
xorl %esi, %esi
movl $0x2b, %edx
leaq -0x390(%rbp), %rcx
callq 0x4f876
movl $0x1, -0x2c(%rbp)
jmp 0x51f68
movq %r15, %rdi
leaq 0x2341b(%rip), %rsi     # 0x7550e
callq 0x8160
testq %rax, %rax
je 0x52161
leaq -0x16c(%rbp), %rdi
leaq 0x2409b(%rip), %rsi     # 0x761a6
leaq -0x54(%rbp), %rdx
xorl %eax, %eax
callq 0x8610
testl %eax, %eax
jle 0x520dd
movl -0x54(%rbp), %ecx
movb $0x1, %dl
movl $0x1, -0x2c(%rbp)
movl $0x1, %eax
cmpl $0x1, %ecx
je 0x52227
xorl %eax, %eax
leaq 0x23413(%rip), %rsi     # 0x75550
cmpq $0x2, %rax
je 0x52220
movq %rax, %rdx
incq %rax
cmpl %ecx, 0x4(%rsi,%rdx,4)
jne 0x5213d
cmpq $0x2, %rdx
setb %dl
incl %eax
jmp 0x52227
movq %r15, %rdi
leaq 0x233b6(%rip), %rsi     # 0x75521
callq 0x8160
movl $0x1, -0x2c(%rbp)
testq %rax, %rax
je 0x52189
movq $0x0, -0x38(%rbp)
jmp 0x51f68
movq %r15, %rdi
leaq 0x2339f(%rip), %rsi     # 0x75532
callq 0x8160
testq %rax, %rax
je 0x52239
movq -0x38(%rbp), %rax
addl $-0x4, %eax
cmpl $-0x3, %eax
jb 0x51f68
movq %r12, %rdi
movl $0x3, %esi
leaq -0x50(%rbp), %rdx
callq 0x5682b
cmpl $0x3, %eax
jl 0x51f68
movq -0x38(%rbp), %rax
decl %eax
xorl %ecx, %ecx
xorl %edx, %edx
cmpl $0x0, -0x428(%rbp)
sete %cl
movsd -0x50(%rbp,%rcx,8), %xmm0
cltq
leaq (%rax,%rax,2), %rax
leaq -0x424(%rbp), %rcx
movsd %xmm0, 0xa4(%rcx,%rax,8)
setne %dl
movsd -0x50(%rbp,%rdx,8), %xmm0
movsd %xmm0, 0xac(%rcx,%rax,8)
movsd -0x40(%rbp), %xmm0
movsd %xmm0, 0xb4(%rcx,%rax,8)
jmp 0x51f68
movl $0x4, %eax
xorl %edx, %edx
testb %dl, %dl
movq -0x38(%rbp), %rcx
cmovnel %eax, %ecx
movq %rcx, -0x38(%rbp)
jmp 0x51f68
movq %r12, %rdi
leaq 0x23301(%rip), %rsi     # 0x75544
callq 0x8160
testq %rax, %rax
je 0x51f68
movq -0x38(%rbp), %rcx
leal -0x4(%rcx), %eax
cmpl $-0x3, %eax
jb 0x51f68
leal -0x1(%rcx), %eax
cltq
imulq $0x98, %rax, %rax
movq %rax, -0x68(%rbp)
leaq (%rax,%r13), %rdx
leaq -0x168(%rbp), %rdi
movl $0x13, %esi
movq %rdx, -0x70(%rbp)
callq 0x5682b
leal -0x1(%rax), %ecx
cmpl $0x11, %ecx
ja 0x51f68
movl %eax, %eax
movq -0x68(%rbp), %rcx
leaq (%rcx,%rax,8), %rcx
addq %r13, %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
addq %rdx, %rax
movq -0x70(%rbp), %rsi
movl %eax, %edx
movsd (%rsi,%rdx,8), %xmm0
movsd %xmm0, (%rcx)
incq %rax
addq $0x8, %rcx
cmpl $0x12, %eax
jl 0x522af
jmp 0x51f68
movq %r14, %rdi
callq 0x8630
movl $0x1, %r15d
movl %r15d, %eax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
jmp 0x522d9