// File: openflightmaps[P]ofm2xplane/main.cpp
// Function: my_stof(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
float my_stof(string s, int d)
{
    if(s.length()==0)
        return 0.0;
    float out=0.0;
    float 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;
    }
    
    add=0.1;
    int j=0;
    for(int i=l1+1;i<l2;i++)
    {
        out+=add*(int(s.at(i))-48);
        add=add*0.1;
        j++;
        if(j==d)
            break;
    }
    return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
callq 0x3360
cmpq $0x0, %rax
jne 0x8681
xorps %xmm0, %xmm0
movss %xmm0, -0x4(%rbp)
jmp 0x8895
movq -0x88(%rbp), %rdi
xorps %xmm0, %xmm0
movss %xmm0, -0x18(%rbp)
movss 0x89a8(%rip), %xmm0     # 0x11040
movss %xmm0, -0x1c(%rbp)
leaq 0x8e77(%rip), %rsi      # 0x1151b
xorl %eax, %eax
movl %eax, %edx
callq 0x3120
movq -0x88(%rbp), %rsi
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdx
leaq -0x50(%rbp), %rdi
movq $-0x1, %rcx
callq 0x3230
movq -0x88(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x32c0
leaq -0x50(%rbp), %rdi
callq 0x3160
movq -0x88(%rbp), %rdi
leaq 0x8e28(%rip), %rsi      # 0x1151b
xorl %eax, %eax
movl %eax, %edx
callq 0x3150
movq -0x88(%rbp), %rsi
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
leaq -0x70(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0x3230
movq -0x88(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x32c0
leaq -0x70(%rbp), %rdi
callq 0x3160
movq -0x88(%rbp), %rdi
leaq 0x8939(%rip), %rsi      # 0x11078
xorl %eax, %eax
movl %eax, %edx
callq 0x34d0
movl %eax, -0x20(%rbp)
movslq -0x20(%rbp), %rax
cmpq $-0x1, %rax
jne 0x8764
movq -0x88(%rbp), %rdi
callq 0x3360
movl %eax, -0x20(%rbp)
movq -0x88(%rbp), %rdi
callq 0x3360
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x74(%rbp)
cmpl $0x0, -0x74(%rbp)
jl 0x87e0
movq -0x88(%rbp), %rdi
movss -0x1c(%rbp), %xmm0
movss %xmm0, -0x8c(%rbp)
movslq -0x74(%rbp), %rsi
callq 0x34a0
movss -0x8c(%rbp), %xmm0
movsbl (%rax), %eax
subl $0x30, %eax
cvtsi2ss %eax, %xmm2
movss -0x18(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x18(%rbp)
movss 0x887d(%rip), %xmm0     # 0x11048
mulss -0x1c(%rbp), %xmm0
movss %xmm0, -0x1c(%rbp)
movl -0x74(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x877c
movss 0x885c(%rip), %xmm0     # 0x11044
movss %xmm0, -0x1c(%rbp)
movl $0x0, -0x78(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x888b
movq -0x88(%rbp), %rdi
movss -0x1c(%rbp), %xmm0
movss %xmm0, -0x90(%rbp)
movslq -0x7c(%rbp), %rsi
callq 0x34a0
movss -0x90(%rbp), %xmm0
movsbl (%rax), %eax
subl $0x30, %eax
cvtsi2ss %eax, %xmm2
movss -0x18(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x18(%rbp)
movss -0x1c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x87c5(%rip), %xmm1     # 0x11020
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
movl -0x78(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x887b
jmp 0x888b
jmp 0x887d
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x87fd
movss -0x18(%rbp), %xmm0
movss %xmm0, -0x4(%rbp)
movss -0x4(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)