// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/cmpile.c
// Function: readNum
ccInt readNum(char **charPtr, ccFloat *returnedNum, ccBool *ifFloat)
{
    ccInt intnum, intnumsread, doublenumsread, cc;
    int intcharsread, doublecharsread;
    ccFloat doublenum;
    char *newCharPtr, *numStart;
    
    while ((lettertype(*charPtr) == a_space) || (lettertype(*charPtr) == unprintable))  (*charPtr)++;
    numStart = *charPtr;
    
    for (cc = 0; cc < numBufferSize; cc++)  {       // super stupid -- sscanf() will copy the whole string up to \x00 into a file stream,
        char *oneChar = numStart + cc;              // so let's make sure it only copies the number we're reading
        if ((lettertype(oneChar) == a_space) || (lettertype(oneChar) == a_eol) || (lettertype(oneChar) == a_null) || (*oneChar == ','))  break;
        numBuffer[cc] = *oneChar;       }
    
    if (cc < numBufferSize)  {
        numBuffer[cc] = '\x00';
        numStart = numBuffer;       }
    
    doublenumsread = sscanf(numStart, readFloatFormatString, &doublenum, &doublecharsread);
    if (doublenumsread == 1)  {
        
        if (ifFloat != NULL)  {
            intnumsread = sscanf(numStart, readIntFormatString, &intnum, &intcharsread);
            *ifFloat = ((intnumsread != 1) || (intcharsread != doublecharsread) || (doublenum != (ccFloat) intnum));    }
        
        errno = 0;
        doublenum = strtod(numStart, &newCharPtr);      // reread to check for over/underflow
        *returnedNum = doublenum;
        *charPtr += doublecharsread;
        
        if (errno == ERANGE)  {
            if ((doublenum > 1) || (doublenum < -1))  return overflow_err;
            else  return underflow_err;     }
        
        return passed;      }
    
    return read_number_err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movl %eax, %edx
movb $0x1, %al
leaq 0x1d637(%rip), %rcx     # 0x29170
cmpl $0x1, (%rcx,%rdx,4)
movb %al, -0x59(%rbp)
je 0xbb5f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d61b(%rip), %rax     # 0x29170
cmpl $0x0, (%rax,%rcx,4)
sete %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0xbb68
jmp 0xbb78
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0xbb24
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x30(%rbp)
cmpl $0x3e7, -0x30(%rbp)     # imm = 0x3E7
jge 0xbc18
movq -0x50(%rbp), %rax
movslq -0x30(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d5ba(%rip), %rax     # 0x29170
cmpl $0x1, (%rax,%rcx,4)
je 0xbbf4
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d5a4(%rip), %rax     # 0x29170
cmpl $0x2, (%rax,%rcx,4)
je 0xbbf4
movq -0x58(%rbp), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1d58e(%rip), %rax     # 0x29170
cmpl $0x6, (%rax,%rcx,4)
je 0xbbf4
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0xbbf6
jmp 0xbc18
movq -0x58(%rbp), %rax
movb (%rax), %dl
movslq -0x30(%rbp), %rcx
leaq 0x206a9(%rip), %rax     # 0x2c2b0
movb %dl, (%rax,%rcx)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xbb8a
cmpl $0x3e7, -0x30(%rbp)     # imm = 0x3E7
jge 0xbc3b
movslq -0x30(%rbp), %rcx
leaq 0x20684(%rip), %rax     # 0x2c2b0
movb $0x0, (%rax,%rcx)
leaq 0x20679(%rip), %rax     # 0x2c2b0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq 0x1d50a(%rip), %rsi     # 0x29150
leaq -0x40(%rbp), %rdx
leaq -0x38(%rbp), %rcx
movb $0x0, %al
callq 0x8170
movl %eax, -0x2c(%rbp)
cmpl $0x1, -0x2c(%rbp)
jne 0xbd47
cmpq $0x0, -0x20(%rbp)
je 0xbcc3
movq -0x50(%rbp), %rdi
movq 0x1d4ec(%rip), %rsi     # 0x29160
leaq -0x24(%rbp), %rdx
leaq -0x34(%rbp), %rcx
movb $0x0, %al
callq 0x8170
movl %eax, -0x28(%rbp)
movb $0x1, %al
cmpl $0x1, -0x28(%rbp)
movb %al, -0x5a(%rbp)
jne 0xbcb7
movl -0x34(%rbp), %ecx
movb $0x1, %al
cmpl -0x38(%rbp), %ecx
movb %al, -0x5a(%rbp)
jne 0xbcb7
movsd -0x40(%rbp), %xmm0
cvtsi2sdl -0x24(%rbp), %xmm1
ucomisd %xmm1, %xmm0
setne %al
setp %cl
orb %cl, %al
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %cl
andb $0x1, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
callq 0x8040
movl $0x0, (%rax)
movq -0x50(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x8100
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, (%rax)
movl -0x38(%rbp), %edx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movslq %edx, %rdx
addq %rdx, %rcx
movq %rcx, (%rax)
callq 0x8040
cmpl $0x22, (%rax)
jne 0xbd3e
movsd -0x40(%rbp), %xmm0
movsd 0x162f1(%rip), %xmm1    # 0x22008
ucomisd %xmm1, %xmm0
ja 0xbd2c
movsd 0x162f3(%rip), %xmm0    # 0x22018
ucomisd -0x40(%rbp), %xmm0
jbe 0xbd35
movl $0x7, -0x4(%rbp)
jmp 0xbd4e
movl $0x8, -0x4(%rbp)
jmp 0xbd4e
movl $0x0, -0x4(%rbp)
jmp 0xbd4e
movl $0x6, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)