// File: openflightmaps[P]ofm2xplane/main.cpp
// Function: my_stod(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
double my_stod(string s, int d)
{
    if(s.length()==0)
        return 0.0;
    double out=0.0;
    double add=1.0;
    int l1;
    int l2;
    size_t p1=s.find_first_of("1234567890.");
    s=s.substr(p1);
    p1=s.find_first_not_of("1234567890.");
    s=s.substr(0,p1);
    
    l1=s.find(".");
    if(l1==s.npos)
        l1=s.length();
    l2=s.length();
    
    for(int i=l1-1;i>=0;i--)
    {
        out+=add*(int(s.at(i))-48);
        add=add*10;
    }
    int j=0;
    add=0.1;
    for(int i=l1+1;i<l2;i++)
    {
        out+=add*(int(s.at(i))-48);
        add=add*0.1;
        j++;
/*         cout << "add: " << add << endl;
        cout << "out: " << out << endl << endl;
        system("pause"); */
        if(j==d)
            break;
    }
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x90(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
callq 0x3360
cmpq $0x0, %rax
jne 0x8d81
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x8f94
movq -0x90(%rbp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x8290(%rip), %xmm0     # 0x11028
movsd %xmm0, -0x28(%rbp)
leaq 0x8777(%rip), %rsi      # 0x1151b
xorl %eax, %eax
movl %eax, %edx
callq 0x3120
movq -0x90(%rbp), %rsi
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdx
leaq -0x58(%rbp), %rdi
movq $-0x1, %rcx
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x32c0
leaq -0x58(%rbp), %rdi
callq 0x3160
movq -0x90(%rbp), %rdi
leaq 0x8728(%rip), %rsi      # 0x1151b
xorl %eax, %eax
movl %eax, %edx
callq 0x3150
movq -0x90(%rbp), %rsi
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
leaq -0x78(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x3230
movq -0x90(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x32c0
leaq -0x78(%rbp), %rdi
callq 0x3160
movq -0x90(%rbp), %rdi
leaq 0x8239(%rip), %rsi      # 0x11078
xorl %eax, %eax
movl %eax, %edx
callq 0x34d0
movl %eax, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
cmpq $-0x1, %rax
jne 0x8e64
movq -0x90(%rbp), %rdi
callq 0x3360
movl %eax, -0x2c(%rbp)
movq -0x90(%rbp), %rdi
callq 0x3360
movl %eax, -0x30(%rbp)
movl -0x2c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
jl 0x8ee0
movq -0x90(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x98(%rbp)
movslq -0x7c(%rbp), %rsi
callq 0x34a0
movsd -0x98(%rbp), %xmm0
movsbl (%rax), %eax
subl $0x30, %eax
cvtsi2sd %eax, %xmm2
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x8165(%rip), %xmm0     # 0x11030
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0x7c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x8e7c
movl $0x0, -0x80(%rbp)
movsd 0x8131(%rip), %xmm0     # 0x11020
movsd %xmm0, -0x28(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x8f8a
movq -0x90(%rbp), %rdi
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0xa0(%rbp)
movslq -0x84(%rbp), %rsi
callq 0x34a0
movsd -0xa0(%rbp), %xmm0
movsbl (%rax), %eax
subl $0x30, %eax
cvtsi2sd %eax, %xmm2
movsd -0x20(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x80c9(%rip), %xmm0     # 0x11020
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0x80(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x8f74
jmp 0x8f8a
jmp 0x8f76
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x8f00
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0xa0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)