// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/cmpile.c
// Function: readTextString
ccInt readTextString(char **scanPtr, char *closingString, ccInt **stringBuffer, ccInt *stringSizeInInts, ccBool isChar)
{
    ccInt chars_num = 0, numPriorSlashes;
    char *startPtr = *scanPtr, *endPtr, *charPtr;
    
    
        // First, count the number of characters in the string.
    
    endPtr = startPtr-1;
    do  {
        endPtr = strstr(endPtr+1, closingString);
        if (endPtr == NULL)  {
            errPosition = 1;
            return string_read_err;     }
        
        numPriorSlashes = 0;
        charPtr = endPtr-1;
        while (*charPtr == '\\')  {  numPriorSlashes++;  charPtr--;  }
    }  while (numPriorSlashes % 2 == 1);
    
    while (*scanPtr < endPtr)   {
        if (**scanPtr == '\\')  {      // deal with special characters
            nextChar(scanPtr);
            if ((lettertype(*scanPtr) == a_number) ||
                        ((**scanPtr >= 'A') && (**scanPtr <= 'F')) || ((**scanPtr >= 'a') && (**scanPtr <= 'f')))   {
                nextChar(scanPtr);
                nextChar(scanPtr);    }
            else if ((**scanPtr == '\\') || (**scanPtr == 'r') || (**scanPtr == 'n') || (**scanPtr == 't')
                                            || (**scanPtr == closingString[0]))
                nextChar(scanPtr);
            else    {
                errPosition = (ccInt) (*scanPtr-startPtr) + 1;
                return string_read_err;   }    }
        else    {
            nextChar(scanPtr);    }
        chars_num++;    }
    
    if ((isChar) && (chars_num != 1))  return char_read_err;
    
    
        // get a buffer to store the string in
    
    *stringSizeInInts = ceil(1.*chars_num/sizeof(ccInt));    // align along a ccInt boundary
    if (!isChar)  (*stringSizeInInts)++;
    *stringBuffer = (ccInt *) malloc((size_t) (*stringSizeInInts)*sizeof(ccInt));
    if (*stringBuffer == NULL)   {
        errPosition = (ccInt) (*scanPtr-startPtr) + 1;
        return out_of_memory_err;     }
    
    if (!isChar)  **stringBuffer = chars_num;
    (*stringBuffer)[(*stringSizeInInts)-1] = 0;         // in case the final int isn't completely overwritten
    
    charPtr = ((char *) *stringBuffer);
    if (!isChar)  charPtr += sizeof(ccInt);
    *scanPtr = startPtr;
    
    
        // Now re-read the string, this time storing the characters in the buffer as we go.
    
    while (*scanPtr < endPtr)   {
        if (**scanPtr == '\\')  {
            nextChar(scanPtr);
            
                // general special character:  \xy where x, y are hexadecimal
            
            if ((lettertype(*scanPtr) == a_number) ||
                        ((**scanPtr >= 'A') && (**scanPtr <= 'F')) || ((**scanPtr >= 'a') && (**scanPtr <= 'f')))   {
                
                if (lettertype(*scanPtr) == a_number)  *charPtr = **scanPtr - '0';
                else if ((**scanPtr >= 'A') && (**scanPtr <= 'F'))  *charPtr = **scanPtr - 'A' + 10;
                else if ((**scanPtr >= 'a') && (**scanPtr <= 'f'))  *charPtr = **scanPtr - 'a' + 10;
                else  {
                    errPosition = (ccInt) (*scanPtr - startPtr) + 1;
                    free((void *) *stringBuffer);
                    return string_read_err;         }
                
                *charPtr *= 16;
                nextChar(scanPtr);
                
                if (lettertype(*scanPtr) == a_number)  *charPtr += **scanPtr - '0';
                else if ((**scanPtr >= 'A') && (**scanPtr <= 'F'))  *charPtr += **scanPtr - 'A' + 10;
                else if ((**scanPtr >= 'a') && (**scanPtr <= 'f'))  *charPtr += **scanPtr - 'a' + 10;
                else  {
                    errPosition = (ccInt) (*scanPtr - startPtr) + 1;
                    free((void *) *stringBuffer);
                    return string_read_err;     }     }
            
            else if (**scanPtr == '\\')     // backslash
                    *charPtr = '\\';
            else if (**scanPtr == 'n')      // end-of-line
                    *charPtr = '\n';
            else if (**scanPtr == 'r')      // carriage return
                    *charPtr = '\r';
            else if (**scanPtr == 't')      // tab
                    *charPtr = '\t';
            else if (**scanPtr == closingString[0])      // quote
                    *charPtr = closingString[0];        }
        
        else    {
            *charPtr = **scanPtr;    }       // if it's a normal character, just copy it over
        
        nextChar(scanPtr);
        charPtr++;    }
    
    
        // characters are just stored as ints -- do the conversion
    
    if (isChar)  (*stringBuffer)[0] = (ccInt) *(charPtr-1);
    
    return passed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %r8b, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movb %al, -0x29(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
addq $0x1, %rdi
movq -0x18(%rbp), %rsi
callq 0x80a0
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0xd67e
movl $0x1, 0x1ec26(%rip)     # 0x2c298
movl $0x5, -0x4(%rbp)
jmp 0xdc18
movl $0x0, -0x34(%rbp)
movq -0x48(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0xd6b4
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x50(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xd691
jmp 0xd6b6
movl -0x34(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
je 0xd64c
jmp 0xd6c8
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq -0x48(%rbp), %rax
jae 0xd7fb
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0xd7e4
movq -0x10(%rbp), %rdi
callq 0xb6c0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1ba68(%rip), %rax     # 0x29170
cmpl $0x4, (%rax,%rcx,4)
je 0xd74a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0xd72c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jle 0xd74a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0xd761
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jg 0xd761
movq -0x10(%rbp), %rdi
callq 0xb6c0
movq -0x10(%rbp), %rdi
callq 0xb6c0
jmp 0xd7e2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
je 0xd7b2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
je 0xd7b2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x6e, %eax
je 0xd7b2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
je 0xd7b2
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movq -0x18(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xd7bd
movq -0x10(%rbp), %rdi
callq 0xb6c0
jmp 0xd7e0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
addl $0x1, %eax
movl %eax, 0x1eac4(%rip)     # 0x2c298
movl $0x5, -0x4(%rbp)
jmp 0xdc18
jmp 0xd7e2
jmp 0xd7ed
movq -0x10(%rbp), %rdi
callq 0xb6c0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xd6c8
cmpb $0x0, -0x29(%rbp)
je 0xd813
cmpl $0x1, -0x30(%rbp)
je 0xd813
movl $0x5, -0x4(%rbp)
jmp 0xdc18
cvtsi2sdl -0x30(%rbp), %xmm1
movsd 0x147e8(%rip), %xmm0    # 0x22008
mulsd %xmm1, %xmm0
movsd 0x147fc(%rip), %xmm1    # 0x22028
divsd %xmm1, %xmm0
callq 0x8070
cvttsd2si %xmm0, %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
cmpb $0x0, -0x29(%rbp)
jne 0xd850
movq -0x28(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movslq (%rax), %rdi
shlq $0x2, %rdi
callq 0x81d0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xd897
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
addl $0x1, %eax
movl %eax, 0x1ea0d(%rip)     # 0x2c298
movl $0x1, -0x4(%rbp)
jmp 0xdc18
cmpb $0x0, -0x29(%rbp)
jne 0xd8a9
movl -0x30(%rbp), %ecx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl %ecx, (%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
cmpb $0x0, -0x29(%rbp)
jne 0xd8e0
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq -0x48(%rbp), %rax
jae 0xdbfa
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0xdbd1
movq -0x10(%rbp), %rdi
callq 0xb6c0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1b845(%rip), %rax     # 0x29170
cmpl $0x4, (%rax,%rcx,4)
je 0xd975
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0xd94f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jle 0xd975
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0xdb44
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jg 0xdb44
movq -0x10(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1b7e8(%rip), %rax     # 0x29170
cmpl $0x4, (%rax,%rcx,4)
jne 0xd9a8
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movb %al, %cl
movq -0x50(%rbp), %rax
movb %cl, (%rax)
jmp 0xda4b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0xd9e0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jg 0xd9e0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
subl $0x41, %eax
addl $0xa, %eax
movb %al, %cl
movq -0x50(%rbp), %rax
movb %cl, (%rax)
jmp 0xda49
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0xda18
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jg 0xda18
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
subl $0x61, %eax
addl $0xa, %eax
movb %al, %cl
movq -0x50(%rbp), %rax
movb %cl, (%rax)
jmp 0xda47
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
addl $0x1, %eax
movl %eax, 0x1e869(%rip)     # 0x2c298
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x81c0
movl $0x5, -0x4(%rbp)
jmp 0xdc18
jmp 0xda49
jmp 0xda4b
movq -0x50(%rbp), %rax
movsbl (%rax), %ecx
shll $0x4, %ecx
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
callq 0xb6c0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movzbl (%rax), %eax
movl %eax, %ecx
leaq 0x1b6fd(%rip), %rax     # 0x29170
cmpl $0x4, (%rax,%rcx,4)
jne 0xda96
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %edx
subl $0x30, %edx
movq -0x50(%rbp), %rax
movsbl (%rax), %ecx
addl %edx, %ecx
movb %cl, (%rax)
jmp 0xdb3f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0xdad1
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x46, %eax
jg 0xdad1
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %edx
subl $0x41, %edx
addl $0xa, %edx
movq -0x50(%rbp), %rax
movsbl (%rax), %ecx
addl %edx, %ecx
movb %cl, (%rax)
jmp 0xdb3d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0xdb0c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x66, %eax
jg 0xdb0c
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %edx
subl $0x61, %edx
addl $0xa, %edx
movq -0x50(%rbp), %rax
movsbl (%rax), %ecx
addl %edx, %ecx
movb %cl, (%rax)
jmp 0xdb3b
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x40(%rbp), %rcx
subq %rcx, %rax
addl $0x1, %eax
movl %eax, 0x1e775(%rip)     # 0x2c298
movq -0x20(%rbp), %rax
movq (%rax), %rdi
callq 0x81c0
movl $0x5, -0x4(%rbp)
jmp 0xdc18
jmp 0xdb3d
jmp 0xdb3f
jmp 0xdbcf
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0xdb5c
movq -0x50(%rbp), %rax
movb $0x5c, (%rax)
jmp 0xdbcd
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x6e, %eax
jne 0xdb74
movq -0x50(%rbp), %rax
movb $0xa, (%rax)
jmp 0xdbcb
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x72, %eax
jne 0xdb8c
movq -0x50(%rbp), %rax
movb $0xd, (%rax)
jmp 0xdbc9
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x74, %eax
jne 0xdba4
movq -0x50(%rbp), %rax
movb $0x9, (%rax)
jmp 0xdbc7
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movq -0x18(%rbp), %rcx
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xdbc5
movq -0x18(%rbp), %rax
movb (%rax), %cl
movq -0x50(%rbp), %rax
movb %cl, (%rax)
jmp 0xdbc7
jmp 0xdbc9
jmp 0xdbcb
jmp 0xdbcd
jmp 0xdbcf
jmp 0xdbe0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movb (%rax), %cl
movq -0x50(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
callq 0xb6c0
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xd8eb
cmpb $0x0, -0x29(%rbp)
je 0xdc11
movq -0x50(%rbp), %rax
movsbl -0x1(%rax), %ecx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)