// File: /workspace/github_c_makefile_star2_O3/heltilda[P]cicada/cmpile.c
// Function: tokenize
ccInt tokenize(compiler_type *compiler, char *charPtr, ccInt scriptType)
{
    linkedlist nextTokenStack;
    ccInt prevTokenType = 0, theTokenType = 0, tokenErrPosition = 1, prevErrPosition, rtrn;
    ccInt nextRightArgType = scriptType, lastRightArgType = scriptType, loopSkippedToken, expectedArgType;
    ccFloat theNum;
    char *tokenCharStartPtr = charPtr, *scriptStartPtr = charPtr;
    ccBool expectLHarg = ccFalse, ifFloat;
    tokenSpecType *theTokenSpec = NULL;
    
    typedef struct {
        char *name;
        ccInt tokenID;
        ccInt prevScriptToken;    } tokenStackElementType;
    
    resizeLinkedList(&(compiler->scriptTokens), 0, ccFalse);
    
    while (lettertype(charPtr) == unprintable)  charPtr++;
    
    rtrn = newLinkedList(&nextTokenStack, 0, sizeof(tokenStackElementType), 1., ccFalse);
    if (rtrn != passed)  return rtrn;
    
    while (*charPtr != 0)  {
        
        ccInt constDataSize = 0, *constData = NULL, otherTokenType = 0, varID = 0;
        ccBool isNumber = ccFalse;
        
        prevTokenType = theTokenType;
        prevErrPosition = tokenErrPosition;
        
        theTokenType = 0;
        
            // read to the end of the longest token that matches our starting point
            // theTokenType > 0 means it's a known operator; theTokenType < 0 means that it's a user-defined variable
            // if the token wasn't found, then theTokenType == 0
        
        while ((lettertype(charPtr) == a_space) || (lettertype(charPtr) == unprintable))  charPtr++;
        if (*charPtr == 0)  break;
        
        tokenCharStartPtr = charPtr;
        tokenErrPosition = (ccInt) (tokenCharStartPtr-scriptStartPtr+1);
        
        
            // if it's a numeric constant, read it and store the number
        
        if ( ((*charPtr >= '0') && (*charPtr <= '9')) || (*charPtr == '-') || (*charPtr == '.')) {
            
            rtrn = readNum(&charPtr, &theNum, &ifFloat);
            if ((rtrn == passed) || (rtrn == overflow_err) || (rtrn == underflow_err))  {
                if (rtrn != passed)  {  compilerWarning = rtrn;  errPosition = tokenErrPosition;  }
                
                isNumber = ccTrue;
                
                if (expectLHarg)  charPtr = tokenCharStartPtr;
                else  {
                    if ((!ifFloat) && (compiler->specialTokens[0] == -1))  ifFloat = ccTrue;
                    
                    if ((!ifFloat) && (compiler->specialTokens[0] > -1))  {
                        theTokenType = compiler->specialTokens[0];
                        constDataSize = 1;
                        constData = (ccInt *) malloc(constDataSize*sizeof(ccInt));
                        if (constData == NULL)  errOut(out_of_memory_err)
                        *constData = (ccInt) theNum;          }
                    
                    else if ((ifFloat) && (compiler->specialTokens[1] > -1))  {
                        theTokenType = compiler->specialTokens[1];
                        constDataSize = (ccInt) ceil(1.*sizeof(ccFloat)/sizeof(ccInt));
                        constData = (ccInt *) malloc(constDataSize*sizeof(ccInt));
                        if (constData == NULL)  errOut(out_of_memory_err)
                        *((ccFloat *) constData) = theNum;
        }   }  }    }
        
        
            // if we're reading a macro-command and it's an argument, store the arg-command and argument number
        
        else if ((*charPtr >= *arg1) && (*charPtr <= *arg9))  {
            
            theTokenType = 3;
            
            constData = (ccInt *) malloc(sizeof(ccInt));
            if (constData == NULL)  errOut(out_of_memory_err)
            *((ccInt *) constData) = (*charPtr) - (*arg1) + 1;
            constDataSize = 1;
            
            charPtr++;          }
        
        
            // otherwise we assume it's an operator and use the token tables to find out which one it is
        
        if (theTokenType == 0)  {
            
            linkedlist *theList = compiler->tokens + ((ccInt) *charPtr);
            ccInt tokenListElement, ifFound;
            tokenStringType *theTokenString = NULL;
            ccBool followingToken = ccFalse;
            
            ifFound = findToken(compiler, theList, &charPtr, &tokenListElement, ccFalse, ccTrue);
            if (ifFound)  {
                
                ccInt loopNextToken, nextTokenID = 0;
                
                theTokenString = (tokenStringType *) element(theList, tokenListElement);
                if ((theTokenString->tokenID_LHarg == 0) && (theTokenString->tokenID_noLHarg == 0))  followingToken = ccTrue;
                varID = theTokenString->varID;
                
                
                    // it might be a 'next' token we are expecting ('in' after 'for' for example)...
                    
                    // if we skipped an optional argument or two, mark their nextScriptToken fields as 0
                
                for (loopNextToken = nextTokenStack.elementNum; loopNextToken >= 1; loopNextToken--)  {
                    if ( (theTokenString->name == tokenStackElement(loopNextToken)->name) && ((nextTokenID == 0)
                                    || (tokenSpec(tokenStackElement(loopNextToken)->tokenID)->isOptional == ccFalse)) )  {
                        nextTokenID = loopNextToken;
                        for (loopSkippedToken = loopNextToken+1; loopSkippedToken <= nextTokenStack.elementNum; loopSkippedToken++)  {
                            ccInt pST = tokenStackElement(loopSkippedToken)->prevScriptToken;
                            if (pST > 0)  scriptToken(pST)->nextScriptToken = 0;
                    }   }
                    if (tokenSpec(tokenStackElement(loopNextToken)->tokenID)->isOptional == ccFalse)  break;         }
                
                if (nextTokenID != 0)  {
                    theTokenType = tokenStackElement(nextTokenID)->tokenID;
                    deleteElements(&nextTokenStack, nextTokenID, nextTokenStack.elementNum);      }
                
                
                    // otherwise, it's probably a stored token with or without a left-hand argument
                
                else if (!expectLHarg)  {
                    theTokenType = theTokenString->tokenID_noLHarg;   }
                else  {
                    theTokenType = theTokenString->tokenID_LHarg;   }
                
                if (theTokenType > 0)  theTokenSpec = tokenSpec(theTokenType);
                
                
                    // if we expect a token without, and only have a token with, a left argument,
                    // then try to fix this problem with a nothing-adapter
                    
                    // case 1:  we hit the end of a block and expect an argument (such as '(a +)' or '{x =}')
                
                if ((!expectLHarg) && (nextTokenID != 0) && (theTokenSpec->leftArgType <= (*typeXarg-*type0arg)))  {
                    
                    expectedArgType = theTokenSpec->leftArgType;
                    if (prevTokenType > 0)  {
                    if (tokenSpec(prevTokenType)->precedence > theTokenSpec->precedence)  {
                        expectedArgType = tokenSpec(prevTokenType)->rightArgType;
                    }}
                    
                    if (expectedArgType != constDataArgType)  {
                    if (compiler->adapters[10][expectedArgType] != 0)  {
                        rtrn = addScriptToken(compiler, compiler->adapters[10][expectedArgType], tokenErrPosition, NULL, 0);
                        if (rtrn != passed)  errOut(rtrn)
                }}  }
                
                    // case 2:  we aren't expecting a left-hand argument and we only have an operator that takes one (e.g. '+2')
                
                else if ((!expectLHarg) && (theTokenType == 0) && (!followingToken))  {
                    
                    otherTokenType = theTokenString->tokenID_LHarg;
                    expectedArgType = tokenSpec(otherTokenType)->leftArgType;
                    if (prevTokenType > 0)  {
                    if (tokenSpec(prevTokenType)->precedence > tokenSpec(otherTokenType)->precedence)  {
                        expectedArgType = tokenSpec(prevTokenType)->rightArgType;
                    }}
                    
                    if (expectedArgType != constDataArgType)  {
                    if (compiler->adapters[10][expectedArgType] != 0)  {
                        rtrn = addScriptToken(compiler, compiler->adapters[10][expectedArgType], tokenErrPosition, NULL, 0);
                        if (rtrn != passed)  errOut(rtrn)
                        theTokenType = otherTokenType;
                        theTokenSpec = tokenSpec(theTokenType);
                        expectLHarg = !expectLHarg;
            }   }   }}
            
            
            if (theTokenType > 0)  {
            if (theTokenSpec->nextToken != 0)  {
                rtrn = addElements(&nextTokenStack, 1, ccFalse);
                if (rtrn != passed)  errOut(rtrn)
                tokenStackElement(nextTokenStack.elementNum)->name = tokenSpec(theTokenSpec->nextToken)->name;
                tokenStackElement(nextTokenStack.elementNum)->tokenID = theTokenSpec->nextToken;
                if (theTokenSpec->tobeRemoved)  {
                    tokenStackElement(nextTokenStack.elementNum)->prevScriptToken = 0;  }
                else  {
                    tokenStackElement(nextTokenStack.elementNum)->prevScriptToken = compiler->scriptTokens.elementNum+1;
            }}  }
            
            
                // alternatively, add a new variable name if it's a word that we haven't seen before
            
            else  {
                
                if ((!ifFound) && (lettertype(tokenCharStartPtr) == a_letter) && (compiler->specialTokens[2] > -1))  {
                    
                    compiler->numVariables++;
                    varID = compiler->numVariables;
                    
                    charPtr = tokenCharStartPtr;
                    rtrn = addTokenSpec(compiler, &charPtr, NULL, compiler->specialTokens[2], ccTrue, expectLHarg, ccFalse, 0, varID);
                    if (rtrn != passed)  errOut(rtrn)
                    
                    theTokenType = compiler->specialTokens[2];
                    theTokenSpec = tokenSpec(theTokenType);             }
                
                
                    // if it's none of the above throw some sort of error
                
                else  {
                    if (isNumber)  errOut(no_left_arg_allowed_err)
                    else if (!ifFound)  errOut(unknown_command_err)
                    else if (followingToken)  errOut(unexpected_token_err)
                    
                    if ((prevTokenType > 0) && (otherTokenType != 0))  {
                    if (tokenSpec(prevTokenType)->precedence > tokenSpec(otherTokenType)->precedence)  {
                        tokenErrPosition = prevErrPosition;
                        if (expectLHarg)  errOut(no_right_arg_allowed_err)
                        else  errOut(right_arg_expected_err);           }}
                    
                    if (expectLHarg)  errOut(no_left_arg_allowed_err)
                    else  errOut(left_arg_expected_err);
        }   }   }
        
        else  theTokenSpec = tokenSpec(theTokenType);
        
        if (nextRightArgType != (*commentarg - *type0arg))  lastRightArgType = nextRightArgType;
        nextRightArgType = theTokenSpec->rightArgType;
        
        
            // if it's a variable, make room for the variable ID
        
        if (varID > 0)  {
            constDataSize = 1;
            constData = (ccInt *) malloc(constDataSize*sizeof(ccInt));
            if (constData == NULL)  errOut(out_of_memory_err)
            *((ccInt *) constData) = varID;         }
        
        
            // if it's a string constant, read in the string
        
        else if ((nextRightArgType == (ccInt) (*chararg - *type0arg)) || (nextRightArgType == (ccInt) (*stringarg - *type0arg)))  {
            
            char *closingStr = tokenSpec(theTokenSpec->nextToken)->name;
            
            rtrn = readTextString(&charPtr, closingStr, &constData, &constDataSize, nextRightArgType == (ccInt) (*chararg - *type0arg));
            if (rtrn != passed)  errOut(rtrn)        }
        
        
            // store the token if it's a known symbol, or a known variable name ending at the last allowable name character,
            // and expand constants as separate tokens (as they appear as arguments in the bytecode string)
        
        if (!theTokenSpec->tobeRemoved)  {
            rtrn = addScriptToken(compiler, theTokenType, tokenErrPosition, NULL, 0);
            if (rtrn != passed)  errOut(rtrn)
            if (constData != NULL)  {
                rtrn = addScriptToken(compiler, 1, tokenErrPosition, constData, constDataSize);
                if (rtrn != passed)  errOut(rtrn)
        }   }
        
        
            // deal with the right-hand argument of the token, if it has one;
            // if it's a comment argument, skip over it
        
        if (nextRightArgType == (ccInt) (*commentarg - *type0arg))  {
            
            char *holdCharPtr;
            tokenSpecType *LHtokenSpec = theTokenSpec;
            
            
                // if this comment is contributing to the bytecode (i.e. via its flanking arguments),
                // represent the comment literal with a blank token
            
            if (!theTokenSpec->tobeRemoved)  {
                rtrn = addScriptToken(compiler, 1, tokenErrPosition, NULL, 0);
                if (rtrn != passed)  errOut(rtrn)       }
            
            theTokenType = theTokenSpec->nextToken;
            theTokenSpec = tokenSpec(theTokenType);
            
            holdCharPtr = charPtr;
            if (theTokenType >= 0)  charPtr = strstr(charPtr, theTokenSpec->name);
            if (charPtr == NULL)  {
                charPtr = holdCharPtr;
                while (*charPtr != 0)  charPtr++;   }
            
            
                // we don't expect a left-hand argument if this comment has flanking arguments (think 'type0arg | ... \n type0arg')
            
            else if ((LHtokenSpec->leftArgType != -1) || (theTokenSpec->rightArgType != -1))  {
                expectLHarg = ccFalse;
        }   }
        
        
            // move on to the next token; don't update expectLHarg if we're passing over a comment
        
        else if (theTokenSpec->leftArgType != (ccInt) (*commentarg - *type0arg))  {
            if ((nextRightArgType == -1) || (nextRightArgType == constDataArgType))  expectLHarg = ccTrue;
            else  expectLHarg = ccFalse;        }
        
        else  nextRightArgType = lastRightArgType;                  // in case this is the last thing we read
    }
    
    lastScriptChar = (ccInt) (charPtr-scriptStartPtr+1);
    
    
        // we should not be missing an argument at the end of the code block
    
    for (loopSkippedToken = nextTokenStack.elementNum; loopSkippedToken >= 1; loopSkippedToken--)  {
    if (tokenSpec(tokenStackElement(loopSkippedToken)->tokenID)->isOptional == ccTrue)  {
        ccInt pST = tokenStackElement(loopSkippedToken)->prevScriptToken;
        if (pST > 0)  scriptToken(pST)->nextScriptToken = 0;
        deleteElement(&nextTokenStack, loopSkippedToken);
    }}
    
    if ((!expectLHarg) || (nextTokenStack.elementNum > 0))  {
        
        if (compiler->scriptTokens.elementNum == 0)  rtrn = arg_expected_err;
        else if (!expectLHarg)  rtrn = right_arg_expected_err;
        else  rtrn = token_expected_err;
        
        
            // if the last operator was a comment, look back at what the previous operator wanted
        
        if (nextRightArgType != *commentarg - *type0arg)  expectedArgType = nextRightArgType;
        else  expectedArgType = tokenSpec(prevTokenType)->rightArgType;
        
        if (expectedArgType != constDataArgType)  {
        if (compiler->adapters[10][expectedArgType] != 0)  {
            rtrn = addScriptToken(compiler, compiler->adapters[10][expectedArgType], tokenErrPosition, NULL, 0);   }}
        
        if (rtrn != passed)  {
            if (rtrn == token_expected_err)  {
                tokenErrPosition = lastScriptChar;
                expectedTokenName = tokenStackElement(nextTokenStack.elementNum)->name;        }
            errOut(rtrn)
    }   }
    
    deleteLinkedList(&nextTokenStack);
    
    return passed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, 0x38(%rsp)
leaq 0x1440(%rdi), %rbp
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8bc7
leaq -0x1(%rbx), %r13
leaq 0x178a4(%rip), %r15     # 0x22180
movzbl 0x1(%r13), %eax
incq %r13
cmpl $0x0, (%r15,%rax,4)
je 0xa8dc
movq %r13, 0x28(%rsp)
leaq 0x50(%rsp), %rdi
movsd 0x1070b(%rip), %xmm0    # 0x1b008
xorl %esi, %esi
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x83e1
movl %eax, %r12d
testl %eax, %eax
je 0xa927
movl %r12d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, (%r13)
movq %r14, 0x18(%rsp)
movq %rbx, 0xa8(%rsp)
je 0xb1f6
movq 0x38(%rsp), %rax
addq $0x1200, %rax           # imm = 0x1200
movq %rax, 0x48(%rsp)
negl %ebx
movq %rbx, 0xb0(%rsp)
movl $0x1, %ebx
movl $0x0, 0x8(%rsp)
movl %r14d, 0x44(%rsp)
xorl %edx, %edx
movq $0x0, 0x10(%rsp)
movq %rbp, 0x88(%rsp)
movl %ebx, 0x84(%rsp)
movl 0x8(%rsp), %eax
movl %eax, 0x24(%rsp)
movl $0x0, 0x34(%rsp)
movq $0x0, 0x70(%rsp)
movq 0xb0(%rsp), %rax
leal (%rax,%r13), %ebx
movzbl (%r13), %r14d
incq %r13
incl %ebx
cmpl $0x2, (%r15,%r14,4)
jb 0xa9aa
leaq -0x1(%r13), %r12
movq %r12, 0x28(%rsp)
testl %r14d, %r14d
je 0xb216
leal -0x30(%r14), %eax
cmpb $0xa, %al
setae %al
leal -0x2d(%r14), %ecx
cmpb $0x2, %cl
setae %cl
testb %cl, %al
movq %rdx, 0x78(%rsp)
jne 0xaa44
leaq 0x28(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xf(%rsp), %rdx
callq 0xa75c
cmpl $0x7, %eax
setne %cl
testb $0x7, %al
setne %dl
movb $0x1, %sil
movl %esi, 0x8(%rsp)
testb %dl, %cl
jne 0xaab2
testl %eax, %eax
je 0xaa2a
movl %eax, 0x1a888(%rip)     # 0x252ac
movl %ebx, 0x1a87e(%rip)     # 0x252a8
cmpb $0x0, 0x10(%rsp)
je 0xae1f
movq %r12, 0x28(%rsp)
movl $0x0, 0x8(%rsp)
jmp 0xaab2
leal -0x11(%r14), %eax
movb $0x1, %cl
movl %ecx, 0x8(%rsp)
cmpb $0x8, %al
ja 0xaab2
movl $0x4, %edi
callq 0x81d0
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0xb36e
addl $-0x10, %r14d
movl %r14d, (%rax)
movl $0x1, 0x34(%rsp)
movq %r13, 0x28(%rsp)
movl $0x3, %r13d
movq 0x18(%rsp), %r14
movq 0x48(%rsp), %rdi
movl %r13d, %esi
callq 0x91d8
movq %rax, %rdx
cmpl $0xd, %r14d
movl 0x44(%rsp), %eax
cmovnel %r14d, %eax
movl %eax, 0x44(%rsp)
movl 0x14(%rdx), %r14d
jmp 0xafe7
movq 0x28(%rsp), %rax
movsbq (%rax), %r14
shlq $0x5, %r14
movq 0x38(%rsp), %r13
addq %r13, %r14
movq %r13, %rdi
movq %r14, %rsi
leaq 0x28(%rsp), %rdx
leaq 0x9c(%rsp), %rcx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0xb567
testl %eax, %eax
je 0xac42
movl 0x9c(%rsp), %esi
movq %r14, %rdi
callq 0x91d8
movq %rax, %r12
movb $0x1, 0xe(%rsp)
cmpl $0x0, 0x8(%rax)
movq 0x48(%rsp), %rbp
jne 0xab1d
cmpl $0x0, 0xc(%r12)
setne 0xe(%rsp)
movl 0x10(%r12), %eax
movq %rax, 0x90(%rsp)
movl 0x50(%rsp), %r14d
testl %r14d, %r14d
jle 0xac2d
xorl %r13d, %r13d
movq (%r12), %rbp
leaq 0x50(%rsp), %rdi
movl %r14d, %esi
callq 0x91d8
cmpq (%rax), %rbp
je 0xab87
leaq 0x50(%rsp), %rdi
movl %r14d, %esi
callq 0x91d8
movl 0x8(%rax), %esi
movq 0x48(%rsp), %rbp
movq %rbp, %rdi
callq 0x91d8
cmpb $0x0, 0x8(%rax)
je 0xabfb
leal -0x1(%r14), %eax
cmpl $0x1, %r14d
movl %eax, %r14d
jg 0xab3b
jmp 0xabfb
testl %r13d, %r13d
movq 0x88(%rsp), %rbp
leaq 0x50(%rsp), %rdi
je 0xabb9
movl %r14d, %esi
callq 0x91d8
movl 0x8(%rax), %esi
movq 0x48(%rsp), %rdi
callq 0x91d8
cmpb $0x0, 0x8(%rax)
leaq 0x50(%rsp), %rdi
jne 0xab56
movl %r14d, %r13d
cmpl 0x50(%rsp), %r14d
jge 0xab56
movl %r14d, %r13d
incl %r13d
movl %r13d, %esi
callq 0x91d8
movl 0xc(%rax), %esi
testl %esi, %esi
jle 0xabe7
movq %rbp, %rdi
callq 0x91d8
movl $0x0, 0x14(%rax)
cmpl 0x50(%rsp), %r13d
leaq 0x50(%rsp), %rdi
jl 0xabc6
movl %r14d, %r13d
jmp 0xab56
testl %r13d, %r13d
je 0xac2d
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl %r13d, %esi
callq 0x91d8
movl 0x8(%rax), %eax
movl 0x50(%rsp), %edx
movq %r14, %rdi
movl %r13d, %esi
movl %eax, %r13d
callq 0x868b
movb $0x1, %r14b
jmp 0xacd2
cmpb $0x0, 0x10(%rsp)
je 0xacca
movl 0x8(%r12), %r13d
jmp 0xaccf
movzbl (%r12), %eax
cmpl $0x3, (%r15,%rax,4)
movq 0x48(%rsp), %r14
jne 0xb389
movl 0x1250(%r13), %ecx
testl %ecx, %ecx
js 0xb389
movl 0x1438(%r13), %ebp
incl %ebp
movl %ebp, 0x1438(%r13)
movq %r12, 0x28(%rsp)
subq $0x8, %rsp
movsbl 0x18(%rsp), %r9d
movq %r13, %rdi
leaq 0x30(%rsp), %rsi
xorl %edx, %edx
movl $0x1, %r8d
pushq %rbp
xorl %eax, %eax
pushq %rax
pushq %rax
callq 0xa4f0
addq $0x20, %rsp
testl %eax, %eax
jne 0xb20e
movl 0x1250(%r13), %r13d
movq %r14, %rdi
movl %r13d, %esi
callq 0x91d8
movq %rax, %rdx
movq 0x18(%rsp), %rax
jmp 0xaf92
movl 0xc(%r12), %r13d
xorl %r14d, %r14d
movq 0x78(%rsp), %rdx
testl %r13d, %r13d
jle 0xacea
movq %rbp, %rdi
movl %r13d, %esi
callq 0x91d8
movq %rax, %rdx
cmpb $0x0, 0x10(%rsp)
setne %al
xorb $0x1, %r14b
orb %al, %r14b
jne 0xada0
movl 0x10(%rdx), %r14d
cmpl $0xa, %r14d
jg 0xada0
movl 0x24(%rsp), %esi
testl %esi, %esi
jle 0xad53
movq %rbp, %rdi
movq %rdx, %r12
callq 0x91d8
movq %r12, %rdx
movl 0xc(%rax), %eax
cmpl 0xc(%r12), %eax
jle 0xad53
movq %rbp, %rdi
movl 0x24(%rsp), %esi
callq 0x91d8
movq %r12, %rdx
movl 0x14(%rax), %r14d
movq $0x0, 0x10(%rsp)
cmpl $0x64, %r14d
je 0xaed0
movslq %r14d, %rax
movq 0x38(%rsp), %rdi
movl 0x140c(%rdi,%rax,4), %esi
testl %esi, %esi
je 0xaec7
movq $0x0, 0x10(%rsp)
movq %rdx, %r14
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb846
movq %r14, %rdx
movl %eax, %r12d
movl $0x0, %r14d
testl %eax, %eax
movq 0x18(%rsp), %rax
je 0xaed8
jmp 0xb347
testl %r13d, %r13d
sete %al
xorl %r14d, %r14d
cmpb $0x0, 0x10(%rsp)
jne 0xaed3
andb 0xe(%rsp), %al
movq 0x18(%rsp), %rax
je 0xaed8
movl 0x8(%r12), %r12d
movq %rbp, %rdi
movl %r12d, %esi
callq 0x91d8
movl 0x10(%rax), %r14d
movl 0x24(%rsp), %esi
testl %esi, %esi
jle 0xae71
movq %rbp, %rdi
callq 0x91d8
movl 0xc(%rax), %ebp
movq 0x48(%rsp), %rdi
movl %r12d, %r13d
movl %r12d, %esi
callq 0x91d8
cmpl 0xc(%rax), %ebp
movq 0x48(%rsp), %rbp
movq 0x38(%rsp), %r12
jle 0xae79
movq %rbp, %rdi
movl 0x24(%rsp), %esi
callq 0x91d8
movl 0x14(%rax), %r14d
jmp 0xae79
cmpb $0x0, 0xf(%rsp)
movq 0x38(%rsp), %rax
je 0xb198
movl 0x124c(%rax), %r13d
testl %r13d, %r13d
js 0xaa3a
movl $0x2, 0x34(%rsp)
movl $0x8, %edi
callq 0x81d0
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0xb36e
movsd 0xa0(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0xb1d9
movl %r12d, %r13d
movq 0x38(%rsp), %r12
cmpl $0x64, %r14d
je 0xb3af
movslq %r14d, %rax
movl 0x140c(%r12,%rax,4), %esi
testl %esi, %esi
je 0xb3af
movq %r12, %rdi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb846
testl %eax, %eax
jne 0xb20e
movl %r13d, %r14d
movq %rbp, %rdi
movl %r13d, %esi
callq 0x91d8
movq %rax, %rdx
movb $0x1, %al
movq %rax, 0x10(%rsp)
jmp 0xaed3
movq $0x0, 0x10(%rsp)
xorl %r14d, %r14d
movq 0x18(%rsp), %rax
testl %r13d, %r13d
jle 0xb3bb
cmpl $0x0, 0x28(%rdx)
je 0xaf8a
movl %r13d, 0x8(%rsp)
movq %rdx, %r13
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x8bb3
testl %eax, %eax
jne 0xb20e
movl 0x28(%r13), %esi
movq %rbp, %rdi
callq 0x91d8
movq %r14, %rbp
movq (%rax), %r14
movl 0x50(%rsp), %esi
movq %rbp, %rdi
callq 0x91d8
movq %r14, (%rax)
movq %rbp, %r14
movl 0x28(%r13), %ebp
movl 0x50(%rsp), %esi
movq %r14, %rdi
callq 0x91d8
movl %ebp, 0x8(%rax)
cmpb $0x0, 0x9(%r13)
je 0xaf62
movl 0x50(%rsp), %esi
movq %r14, %rdi
callq 0x91d8
movl $0x0, 0xc(%rax)
jmp 0xaf7d
movq 0x88(%rsp), %rax
movl (%rax), %ebp
incl %ebp
movl 0x50(%rsp), %esi
movq %r14, %rdi
callq 0x91d8
movl %ebp, 0xc(%rax)
movq 0x18(%rsp), %rax
movq %r13, %rdx
movl 0x8(%rsp), %r13d
movq 0x90(%rsp), %rbp
cmpl $0xd, %eax
movl 0x44(%rsp), %ecx
cmovnel %eax, %ecx
movl %ecx, 0x44(%rsp)
movl 0x14(%rdx), %r14d
testl %ebp, %ebp
jle 0xafdf
movq %rdx, %r12
movl $0x1, 0x34(%rsp)
movl $0x4, %edi
callq 0x81d0
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0xb36e
movl %r13d, 0x8(%rsp)
movl %ebp, (%rax)
movq 0x88(%rsp), %rbp
movq %r12, %rdx
jmp 0xb03b
movq 0x88(%rsp), %rbp
movl %r13d, 0x8(%rsp)
leal -0xb(%r14), %eax
cmpl $0x1, %eax
ja 0xb03b
movq %r14, %r12
xorl %r14d, %r14d
cmpl $0xb, %r12d
sete %r14b
movl 0x28(%rdx), %esi
movq 0x48(%rsp), %rdi
movq %rdx, %r13
callq 0x91d8
movq (%rax), %rsi
leaq 0x28(%rsp), %rdi
leaq 0x70(%rsp), %rdx
leaq 0x34(%rsp), %rcx
movl %r14d, %r8d
movq %r12, %r14
callq 0xb905
movq %r13, %rdx
testl %eax, %eax
jne 0xb20e
cmpb $0x0, 0x9(%rdx)
jne 0xb08f
movq %rdx, %r13
movq 0x38(%rsp), %rdi
movl 0x8(%rsp), %esi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb846
testl %eax, %eax
jne 0xb20e
movq 0x70(%rsp), %rcx
testq %rcx, %rcx
movq %r13, %rdx
je 0xb08f
movl 0x34(%rsp), %r8d
movq 0x38(%rsp), %rdi
movl $0x1, %esi
movl %ebx, %edx
callq 0xb846
movq %r13, %rdx
testl %eax, %eax
jne 0xb20e
cmpl $0xd, %r14d
jne 0xb12c
cmpb $0x0, 0x9(%rdx)
jne 0xb0c3
movq 0x38(%rsp), %rdi
movl $0x1, %esi
movq %rdx, %r14
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb846
movq %r14, %rdx
testl %eax, %eax
jne 0xb20e
movq %rbp, %r13
movq %rdx, 0x78(%rsp)
movl 0x28(%rdx), %ebp
movq 0x48(%rsp), %rdi
movl %ebp, %esi
callq 0x91d8
movq %rax, %r14
movq 0x28(%rsp), %r12
movq %r12, %rax
movl %ebp, 0x8(%rsp)
testl %ebp, %ebp
js 0xb0fd
movq (%r14), %rsi
movq %r12, %rdi
callq 0x80a0
movq %rax, 0x28(%rsp)
testq %rax, %rax
movq %r13, %rbp
je 0xb161
movq 0x78(%rsp), %rax
cmpl $-0x1, 0x10(%rax)
jne 0xb117
cmpl $-0x1, 0x14(%r14)
je 0xb176
movl $0xd, %eax
movq %rax, 0x18(%rsp)
movq $0x0, 0x10(%rsp)
jmp 0xb180
cmpl $0xd, 0x10(%rdx)
jne 0xb13b
movq %rdx, %r14
movl 0x44(%rsp), %eax
jmp 0xb17b
movb $0x1, %al
movq %rax, 0x10(%rsp)
cmpl $-0x1, %r14d
movq %r14, 0x18(%rsp)
je 0xb15c
cmpl $0x64, %r14d
je 0xb15c
movq $0x0, 0x10(%rsp)
movq %rdx, %r14
jmp 0xb180
decq %r12
cmpb $0x0, 0x1(%r12)
leaq 0x1(%r12), %r12
jne 0xb164
movq %r12, 0x28(%rsp)
movl $0xd, %eax
movq %rax, 0x18(%rsp)
movq 0x28(%rsp), %r13
cmpb $0x0, (%r13)
movq %r14, %rdx
jne 0xa97e
jmp 0xb220
movl 0x1248(%rax), %r13d
cmpl $-0x1, %r13d
je 0xb1ec
testl %r13d, %r13d
js 0xaa3a
movl $0x1, 0x34(%rsp)
movl $0x4, %edi
callq 0x81d0
movq %rax, 0x70(%rsp)
testq %rax, %rax
je 0xb36e
cvttsd2si 0xa0(%rsp), %ecx
movl %ecx, (%rax)
testl %r13d, %r13d
movq 0x18(%rsp), %r14
jne 0xaa89
jmp 0xaa3a
movb $0x1, 0xf(%rsp)
jmp 0xae2f
movl $0x0, 0x24(%rsp)
movl $0x1, %ebx
movq $0x0, 0x10(%rsp)
jmp 0xb220
movl %eax, %r12d
jmp 0xb347
movq %r12, %r13
movl 0x84(%rsp), %ebx
subl 0xa8(%rsp), %r13d
incl %r13d
movl %r13d, 0x1a086(%rip)    # 0x252b8
movl 0x50(%rsp), %r14d
testl %r14d, %r14d
jle 0xb2ac
movq 0x38(%rsp), %rax
leaq 0x1200(%rax), %r12
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movl %r14d, %esi
callq 0x91d8
movl 0x8(%rax), %esi
movq %r12, %rdi
callq 0x91d8
cmpb $0x1, 0x8(%rax)
jne 0xb295
movq %r13, %rdi
movl %r14d, %esi
callq 0x91d8
movl 0xc(%rax), %esi
testl %esi, %esi
jle 0xb28a
movq %rbp, %rdi
callq 0x91d8
movl $0x0, 0x14(%rax)
movq %r13, %rdi
movl %r14d, %esi
callq 0x8bc0
leal -0x1(%r14), %eax
cmpl $0x1, %r14d
movl %eax, %r14d
jg 0xb24d
cmpl $0x0, 0x50(%rsp)
setg %al
jmp 0xb2ae
xorl %eax, %eax
movq 0x38(%rsp), %r14
cmpb $0x0, 0x10(%rsp)
je 0xb2c2
testb %al, %al
je 0xb35c
xorl %eax, %eax
cmpb $0x0, 0x10(%rsp)
sete %al
cmpl $0x0, (%rbp)
leal 0xb(%rax,%rax,2), %eax
movl $0xc, %r12d
cmovnel %eax, %r12d
movq 0x18(%rsp), %rax
cmpl $0xd, %eax
jne 0xb2fb
leaq 0x1200(%r14), %rdi
movl 0x24(%rsp), %esi
callq 0x91d8
movl 0x14(%rax), %eax
cmpl $0x64, %eax
je 0xb320
cltq
movl 0x140c(%r14,%rax,4), %esi
testl %esi, %esi
je 0xb320
movq %r14, %rdi
movl %ebx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb846
movl %eax, %r12d
testl %r12d, %r12d
je 0xb35c
cmpl $0xb, %r12d
jne 0xb347
movl 0x19f87(%rip), %ebx     # 0x252b8
leaq 0x50(%rsp), %rdi
movl (%rdi), %esi
callq 0x91d8
movq (%rax), %rax
movq %rax, 0x19f69(%rip)     # 0x252b0
movl %ebx, 0x19f5b(%rip)     # 0x252a8
leaq 0x50(%rsp), %rdi
callq 0x847e
jmp 0xa912
leaq 0x50(%rsp), %rdi
callq 0x847e
xorl %r12d, %r12d
jmp 0xa912
movl %ebx, 0x19f34(%rip)     # 0x252a8
leaq 0x50(%rsp), %rdi
callq 0x847e
movl $0x1, %r12d
jmp 0xa912
cmpb $0x0, 0x8(%rsp)
je 0xb42a
movl %ebx, 0x19f0e(%rip)     # 0x252a8
leaq 0x50(%rsp), %rdi
callq 0x847e
movl $0x9, %r12d
jmp 0xa912
movq $0x0, 0x10(%rsp)
movl %r13d, %r14d
cmpb $0x0, 0x8(%rsp)
je 0xb42a
cmpb $0x0, 0xe(%rsp)
je 0xb445
cmpl $0x0, 0x24(%rsp)
jle 0xb460
testl %r14d, %r14d
je 0xb460
movq %rbp, %rdi
movl 0x24(%rsp), %esi
callq 0x91d8
movq %rbp, %rdi
movl 0xc(%rax), %ebp
movl %r14d, %esi
callq 0x91d8
cmpl 0xc(%rax), %ebp
jle 0xb460
xorl %ebx, %ebx
cmpb $0x0, 0x10(%rsp)
setne %bl
movl 0x84(%rsp), %eax
movl %eax, 0x19e95(%rip)     # 0x252a8
leaq 0x50(%rsp), %rdi
callq 0x847e
leal 0xe(,%rbx,2), %r12d
jmp 0xa912
movl %ebx, 0x19e78(%rip)     # 0x252a8
leaq 0x50(%rsp), %rdi
callq 0x847e
movl $0xf, %r12d
jmp 0xa912
movl %ebx, 0x19e5d(%rip)     # 0x252a8
leaq 0x50(%rsp), %rdi
callq 0x847e
movl $0xa, %r12d
jmp 0xa912
xorl %r14d, %r14d
cmpb $0x0, 0x10(%rsp)
setne %r14b
movl %ebx, 0x19e36(%rip)     # 0x252a8
leaq 0x50(%rsp), %rdi
callq 0x847e
leal 0xd(,%r14,2), %r12d
jmp 0xa912