// File: /workspace/github_cpp_makefile_star2_O1/DoubleString[P]RtConverter/src/Rtklib/rtkcmn.cpp
// Function: bamboo::readpos(char const*, char const*, double*)
extern void readpos(const char *file, const char *rcv, double *pos)
{
    static double poss[2048][3];
    static char stas[2048][16];
    FILE *fp;
    int i,j,len,np=0;
    char buff[256],str[256];
    
    trace(3,"readpos: file=%s\n",file);
    
    if (!(fp=fopen(file,"r"))) {
        fprintf(stderr,"reference position file open error : %s\n",file);
        return;
    }
    while (np<2048&&fgets(buff,sizeof(buff),fp)) {
        if (buff[0]=='%'||buff[0]=='#') continue;
        if (sscanf(buff,"%lf %lf %lf %s",&poss[np][0],&poss[np][1],&poss[np][2],
                   str)<4) continue;
        strncpy(stas[np],str,15); stas[np++][15]='\0';
    }
    fclose(fp);
    len=(int)strlen(rcv);
    for (i=0;i<np;i++) {
        if (strncmp(stas[i],rcv,len)) continue;
        for (j=0;j<3;j++) pos[j]=poss[i][j];
        pos[0]*=D2R; pos[1]*=D2R;
        return;
    }
    pos[0]=pos[1]=pos[2]=0.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x238, %rsp            # imm = 0x238
movq %rdx, %r14
movq %rsi, -0x40(%rbp)
movq %rdi, %rbx
leaq 0x22e68(%rip), %rsi     # 0x7538c
callq 0x8780
testq %rax, %rax
je 0x526d6
movq %rax, %r12
movq %r14, -0x38(%rbp)
movb $0x1, %bl
leaq 0x3fb4e(%rip), %r14     # 0x92090
leaq -0x260(%rbp), %r13
leaq 0x4bb40(%rip), %r15     # 0x9e090
xorl %ecx, %ecx
movq %rcx, -0x30(%rbp)
leaq (%rcx,%rcx,2), %rax
leaq (%r14,%rax,8), %rcx
movq %rcx, -0x58(%rbp)
leaq (%r14,%rax,8), %rcx
addq $0x8, %rcx
movq %rcx, -0x50(%rbp)
leaq (%r14,%rax,8), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
movq %r13, %rdi
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdx
callq 0x89f0
testq %rax, %rax
je 0x52620
movzbl -0x260(%rbp), %eax
cmpl $0x23, %eax
je 0x525cd
cmpl $0x25, %eax
je 0x525cd
movq %r13, %rdi
leaq 0x22b40(%rip), %rsi     # 0x750ee
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
leaq -0x160(%rbp), %r9
xorl %eax, %eax
callq 0x8610
cmpl $0x3, %eax
jg 0x525d4
testb $0x1, %bl
jne 0x5257a
jmp 0x52620
movq -0x30(%rbp), %rbx
shlq $0x4, %rbx
leaq (%r15,%rbx), %rdi
movl $0xf, %edx
leaq -0x160(%rbp), %rsi
callq 0x8350
movq -0x30(%rbp), %rax
cmpq $0x7ff, %rax            # imm = 0x7FF
leaq 0x1(%rax), %rax
movb $0x0, 0xf(%rbx,%r15)
setb %bl
movq %rax, %rcx
cmpq $0x800, %rax            # imm = 0x800
jne 0x52552
movl $0x800, %eax            # imm = 0x800
movq %rax, -0x30(%rbp)
movq %r12, %rdi
callq 0x8630
movq -0x30(%rbp), %rax
testl %eax, %eax
jle 0x52670
movq -0x40(%rbp), %rdi
movq %rax, %r12
callq 0x8290
movslq %eax, %rbx
movl %r12d, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %r13
xorl %r12d, %r12d
movq %r15, %rdi
movq -0x40(%rbp), %rsi
movq %rbx, %rdx
callq 0x82f0
testl %eax, %eax
je 0x52686
addq $-0x18, %r12
addq $0x10, %r15
movq %r13, %rax
addq %r12, %rax
jne 0x5264d
xorpd %xmm0, %xmm0
movq -0x38(%rbp), %rax
movupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
jmp 0x526c4
subq %r12, %r14
xorl %eax, %eax
movq -0x38(%rbp), %rcx
movsd (%r14), %xmm0
movsd %xmm0, (%rcx,%rax,8)
incq %rax
addq $0x8, %r14
cmpq $0x3, %rax
jne 0x5268f
movsd 0x225f2(%rip), %xmm0    # 0x74ca0
movsd (%rcx), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%rcx)
mulsd 0x8(%rcx), %xmm0
movsd %xmm0, 0x8(%rcx)
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3b8f3(%rip), %rax     # 0x8dfd0
movq (%rax), %rdi
leaq 0x229de(%rip), %rsi     # 0x750c5
movq %rbx, %rdx
xorl %eax, %eax
addq $0x238, %rsp            # imm = 0x238
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x88d0