// File: /workspace/github_c_makefile_star2_O0/MuvikLabs[P]runt/runt.c
// Function: runt_atof
runt_float runt_atof(const char *str, runt_uint pos, runt_uint size)
{
    runt_float total = 0.0;
    runt_int sign = 1.0;
    runt_uint i;
    runt_uint mode = 0;
    runt_float place = 1.0;
    runt_float scale = 10.0;

    runt_float num = 0.0;

    if(str[pos] == '-') {
        sign = -1;
        pos++;
        size--;
    }

    for(i = pos; i < pos + size; i++) {
        num = 0.0;
        switch(str[i]) {
            case '0':
                num = 0.0;
                break;
            case '1':
                num = 1.0;
                break;
            case '2':
                num = 2.0;
                break;
            case '3':
                num = 3.0;
                break;
            case '4':
                num = 4.0;
                break;
            case '5':
                num = 5.0;
                break;
            case '6':
                num = 6.0;
                break;
            case '7':
                num = 7.0;
                break;
            case '8':
                num = 8.0;
                break;
            case '9':
                num = 9.0;
                break;
            case '.':
                if(mode == 0) {
                    scale = 0.1;
                    mode = 1;
                    place = 1.0;
                }
                break;
        }

        if(mode == 0) {
            total *= scale;
            total += num;
        } else {
            total += num * place;
            place *= scale;
        }

    }

    return total * sign;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x14(%rbp)
movl $0x1, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movss 0x5a64(%rip), %xmm0     # 0x92e0
movss %xmm0, -0x24(%rbp)
movss 0x5a53(%rip), %xmm0     # 0x92dc
movss %xmm0, -0x28(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x38bf
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0xc(%rbp), %ecx
addl -0x10(%rbp), %ecx
cmpl %ecx, %eax
jae 0x3a35
movl $0x0, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl -0x1c(%rbp), %ecx
movsbl (%rax,%rcx), %eax
addl $-0x2e, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0xb, %eax
ja 0x39d4
movq -0x38(%rbp), %rax
leaq 0x5867(%rip), %rcx      # 0x916c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorps %xmm0, %xmm0
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x59bd(%rip), %xmm0     # 0x92e0
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x59cf(%rip), %xmm0     # 0x9304
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x59b9(%rip), %xmm0     # 0x9300
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x59a3(%rip), %xmm0     # 0x92fc
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x5990(%rip), %xmm0     # 0x92f8
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x597d(%rip), %xmm0     # 0x92f4
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x596a(%rip), %xmm0     # 0x92f0
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x5957(%rip), %xmm0     # 0x92ec
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
movss 0x5944(%rip), %xmm0     # 0x92e8
movss %xmm0, -0x2c(%rbp)
jmp 0x39d4
cmpl $0x0, -0x20(%rbp)
jne 0x39d2
movss 0x592b(%rip), %xmm0     # 0x92e4
movss %xmm0, -0x28(%rbp)
movl $0x1, -0x20(%rbp)
movss 0x5913(%rip), %xmm0     # 0x92e0
movss %xmm0, -0x24(%rbp)
jmp 0x39d4
cmpl $0x0, -0x20(%rbp)
jne 0x39fa
movss -0x28(%rbp), %xmm0
mulss -0x14(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
movss -0x2c(%rbp), %xmm0
addss -0x14(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
jmp 0x3a25
movss -0x2c(%rbp), %xmm0
movss -0x24(%rbp), %xmm2
movss -0x14(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x14(%rbp)
movss -0x28(%rbp), %xmm0
mulss -0x24(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
jmp 0x3a27
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x38c5
movss -0x14(%rbp), %xmm0
cvtsi2ssl -0x18(%rbp), %xmm1
mulss %xmm1, %xmm0
popq %rbp
retq
nopw %cs:(%rax,%rax)