// File: /workspace/github_cpp_makefile_star2_O2/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 $0x7f8, %rsp            # imm = 0x7F8
movq %rsi, -0x50(%rbp)
movq %rdi, %r14
leaq -0x820(%rbp), %r15
xorl %ebx, %ebx
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
xorl %esi, %esi
callq 0x8390
movq %r15, %rdi
movq %r14, %rsi
callq 0x85c0
pushq $0x2e
popq %rsi
movq %r15, %rdi
callq 0x8690
testq %rax, %rax
leaq 0x178df(%rip), %r15     # 0x605e5
cmovneq %rax, %r15
leaq 0x223a0(%rip), %rsi     # 0x6b0b1
movq %r15, %rdi
callq 0x8890
testl %eax, %eax
je 0x48eef
leaq 0x2238e(%rip), %rsi     # 0x6b0b6
movq %r15, %rdi
callq 0x8890
testl %eax, %eax
je 0x48eef
leaq 0x22643(%rip), %rsi     # 0x6b382
movq %r14, %rdi
callq 0x8750
testq %rax, %rax
je 0x4927e
movq %rax, %rbx
xorl %r12d, %r12d
leaq -0x420(%rbp), %r15
leaq 0x1db50(%rip), %r13     # 0x668b4
xorl %r14d, %r14d
movq %r15, %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rdx
callq 0x89d0
testq %rax, %rax
je 0x4925f
movq %r15, %rdi
callq 0x8290
cmpq $0x3e, %rax
jb 0x48d97
cmpb $0x7c, -0x3e3(%rbp)
je 0x48d67
cmpb $0x20, -0x420(%rbp)
movl %r14d, %eax
cmovnel %r12d, %eax
leal 0x1(%rax), %r14d
cmpl $0x6, %eax
ja 0x48d67
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movl $0x2b8, %edx            # imm = 0x2B8
leaq -0x318(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
leaq -0x314(%rbp), %rdi
movq %r15, %rsi
pushq $0x3d
popq %rdx
callq 0x8360
pushq $0x1
popq %r14
jmp 0x48d67
movq %r15, %rdi
pushq $0x3
popq %rsi
leaq -0x40(%rbp), %rdx
callq 0x4d26d
pushq $0x5
popq %r14
cmpl $0x3, %eax
jl 0x48d67
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd %xmm1, -0x258(%rbp)
movsd %xmm0, -0x250(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x248(%rbp)
jmp 0x48d67
movq %r15, %rdi
pushq $0xa
popq %rsi
leaq -0x228(%rbp), %rdx
callq 0x4d26d
pushq $0x3
popq %r14
jmp 0x48d67
movq %r15, %rdi
pushq $0x9
popq %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x4d26d
pushq $0x4
popq %r14
jmp 0x48d67
movq %r15, %rdi
pushq $0x3
popq %rsi
leaq -0x40(%rbp), %rdx
callq 0x4d26d
pushq $0x2
popq %r14
cmpl $0x3, %eax
jl 0x48d67
movsd -0x40(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
movsd %xmm1, -0x270(%rbp)
movsd %xmm0, -0x268(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x260(%rbp)
jmp 0x48d67
movq %r15, %rdi
pushq $0xa
popq %rsi
leaq -0x190(%rbp), %rdx
callq 0x4d26d
pushq $0x6
popq %r14
jmp 0x48d67
movq %r15, %rdi
pushq $0x9
popq %rsi
leaq -0x140(%rbp), %rdx
callq 0x4d26d
leaq -0x318(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x4d1f1
pushq $0x7
popq %r14
jmp 0x48d67
leaq 0x2248c(%rip), %rsi     # 0x6b382
movq %r14, %rdi
callq 0x8750
testq %rax, %rax
je 0x4926a
movq %rax, %r14
leaq -0x3e4(%rbp), %r15
leaq -0x420(%rbp), %r13
xorl %ecx, %ecx
xorl %r12d, %r12d
movl %ecx, %ebx
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rdx
callq 0x89d0
testq %rax, %rax
je 0x4925a
movq %r13, %rdi
callq 0x8290
movl %ebx, %ecx
cmpq $0x3c, %rax
jb 0x48f1d
movq %r15, %rdi
leaq 0x189d7(%rip), %rsi     # 0x61929
callq 0x8170
movl %ebx, %ecx
testq %rax, %rax
jne 0x48f1d
movq %r15, %rdi
leaq 0x22545(%rip), %rsi     # 0x6b4ad
callq 0x8170
testq %rax, %rax
je 0x48f89
movl $0x2b8, %edx            # imm = 0x2B8
leaq -0x318(%rbp), %rdi
xorl %esi, %esi
callq 0x8390
pushq $0x1
popq %r12
movq %r15, %rdi
leaq 0x2252b(%rip), %rsi     # 0x6b4be
callq 0x8170
testq %rax, %rax
jne 0x49243
movl %ebx, %ecx
testl %r12d, %r12d
movl $0x0, %r12d
je 0x48f1d
movq %r15, %rdi
leaq 0x22511(%rip), %rsi     # 0x6b4cd
callq 0x8170
testq %rax, %rax
je 0x49042
leaq -0x314(%rbp), %rdi
movq %r13, %rsi
movq %r15, %r12
pushq $0x14
popq %r15
movq %r15, %rdx
callq 0x8360
xorl %eax, %eax
movb %al, -0x300(%rbp)
leaq -0x2d4(%rbp), %rdi
leaq -0x40c(%rbp), %rsi
movq %r15, %rdx
movq %r12, %r15
callq 0x8360
xorl %eax, %eax
movb %al, -0x2c0(%rbp)
movl %ebx, %ecx
pushq $0x1
popq %r12
movabsq $0x2020202020202020, %rax # imm = 0x2020202020202020
leaq -0x314(%rbp), %rdx
cmpq %rax, 0x43(%rdx)
jne 0x48f1d
leaq -0x2d4(%rbp), %rdi
callq 0x453cc
movl %eax, -0x318(%rbp)
movl %ebx, %ecx
jmp 0x48f1d
movq %r15, %rdi
leaq 0x2249b(%rip), %rsi     # 0x6b4e7
callq 0x8170
testq %rax, %rax
je 0x49067
movq %r13, %rdi
xorl %esi, %esi
pushq $0x2b
popq %rdx
leaq -0x290(%rbp), %rcx
jmp 0x4908a
movq %r15, %rdi
leaq 0x22481(%rip), %rsi     # 0x6b4f2
callq 0x8170
testq %rax, %rax
je 0x4909a
movq %r13, %rdi
xorl %esi, %esi
pushq $0x2b
popq %rdx
leaq -0x280(%rbp), %rcx
callq 0x46dd9
movl %ebx, %ecx
pushq $0x1
popq %r12
jmp 0x48f1d
movq %r15, %rdi
leaq 0x2245a(%rip), %rsi     # 0x6b4fe
callq 0x8170
testq %rax, %rax
je 0x490f7
leaq -0x41c(%rbp), %rdi
leaq 0x230af(%rip), %rsi     # 0x6c16b
leaq -0x44(%rbp), %rdx
xorl %eax, %eax
callq 0x8600
movl %ebx, %ecx
pushq $0x1
popq %r12
testl %eax, %eax
jle 0x48f1d
movl -0x44(%rbp), %eax
xorl %edx, %edx
pushq $0x1
popq %rcx
leaq 0x2245c(%rip), %rsi     # 0x6b540
cmpq $0xc, %rdx
je 0x4908f
cmpl %eax, (%rdx,%rsi)
je 0x49091
incl %ecx
addq $0x4, %rdx
jmp 0x490e4
movq %r15, %rdi
leaq 0x22410(%rip), %rsi     # 0x6b511
callq 0x8170
movl $0x0, %ecx
pushq $0x1
popq %r12
testq %rax, %rax
jne 0x48f1d
movq %r15, %rdi
leaq 0x22400(%rip), %rsi     # 0x6b522
callq 0x8170
testq %rax, %rax
je 0x491a6
leal -0x4(%rbx), %eax
movl %ebx, %ecx
cmpl $-0x3, %eax
jb 0x48f1d
movq %r13, %rdi
pushq $0x3
popq %rsi
leaq -0x40(%rbp), %rdx
callq 0x4d26d
movl %ebx, %ecx
cmpl $0x3, %eax
jl 0x48f1d
leal -0x1(%rbx), %eax
imulq $0x18, %rax, %rax
xorl %ecx, %ecx
xorl %edx, %edx
cmpl $0x0, -0x318(%rbp)
sete %cl
movsd -0x40(%rbp,%rcx,8), %xmm0
leaq -0x314(%rbp), %rcx
movsd %xmm0, 0xa4(%rcx,%rax)
setne %dl
movsd -0x40(%rbp,%rdx,8), %xmm0
movsd %xmm0, 0xac(%rcx,%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0xb4(%rcx,%rax)
movl %ebx, %ecx
jmp 0x48f1d
movq %r13, %rdi
leaq 0x22384(%rip), %rsi     # 0x6b534
callq 0x8170
testq %rax, %rax
sete %al
leal -0x4(%rbx), %ecx
cmpl $-0x3, %ecx
setb %cl
orb %al, %cl
movl %ebx, %ecx
jne 0x48f1d
leal -0x1(%rbx), %eax
imulq $0x98, %rax, %rcx
leaq -0x228(%rbp), %rax
movq %rcx, -0x58(%rbp)
leaq (%rax,%rcx), %rdx
leaq -0x418(%rbp), %rdi
pushq $0x13
popq %rsi
movq %rdx, -0x60(%rbp)
callq 0x4d26d
movl %ebx, %ecx
testl %eax, %eax
jle 0x48f1d
movl %eax, %ecx
movq -0x58(%rbp), %rdx
leaq (%rdx,%rcx,8), %rdx
leaq -0x228(%rbp), %rsi
addq %rsi, %rdx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
addq %rsi, %rcx
movq -0x60(%rbp), %rdi
cmpl $0x12, %eax
jg 0x4908f
movl %ecx, %esi
movsd (%rdi,%rsi,8), %xmm0
movsd %xmm0, (%rdx)
addq $0x8, %rdx
incq %rcx
incl %eax
jmp 0x49224
leaq -0x318(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0x4d1f1
movl %ebx, %ecx
jmp 0x48f1a
movq %r14, %rdi
jmp 0x49262
movq %rbx, %rdi
callq 0x8620
pushq $0x1
popq %rbx
movl %ebx, %eax
addq $0x7f8, %rsp            # imm = 0x7F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x4926a