// File: /workspace/github_c_makefile_star2_O2/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, %r13d
movq %rsi, %r12
movq %rdi, %r14
addq $0x1440, %rdi           # imm = 0x1440
movq %rdi, 0x88(%rsp)
xorl %esi, %esi
xorl %edx, %edx
callq 0x8b23
leaq -0x1(%r12), %rbp
leaq 0x16d2b(%rip), %rcx     # 0x21180
movzbl 0x1(%rbp), %eax
incq %rbp
cmpl $0x0, (%rcx,%rax,4)
je 0xa455
movq %rbp, 0x18(%rsp)
leaq 0x48(%rsp), %rdi
pushq $0x10
popq %rdx
movsd 0xeb91(%rip), %xmm0     # 0x19008
xorl %esi, %esi
xorl %ecx, %ecx
callq 0x83d5
movl %eax, %ebx
testl %eax, %eax
je 0xa49a
movl %ebx, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1200(%r14), %r15
movq %r12, 0xa8(%rsp)
negl %r12d
movq %r12, 0xb0(%rsp)
pushq $0x1
popq %rax
leaq 0x48(%rsp), %r12
movq $0x0, 0x10(%rsp)
movq $0x0, 0x28(%rsp)
movl %r13d, 0x44(%rsp)
movl %r13d, %edx
movl %eax, %r13d
xorl %eax, %eax
movq %r14, 0x30(%rsp)
movq %r15, 0x90(%rsp)
xorl %ecx, %ecx
movq %rdx, 0x78(%rsp)
cmpb $0x0, (%rbp)
je 0xaca6
movl %r13d, 0x74(%rsp)
movl %ecx, 0x8(%rsp)
andl $0x0, 0x24(%rsp)
andq $0x0, 0x68(%rsp)
movq 0xb0(%rsp), %rax
leal (%rax,%rbp), %r13d
leaq 0x16c60(%rip), %rax     # 0x21180
movzbl (%rbp), %ebx
incq %rbp
incl %r13d
cmpl $0x2, (%rax,%rbx,4)
jb 0xa520
leaq -0x1(%rbp), %r14
movq %r14, 0x18(%rsp)
testl %ebx, %ebx
je 0xacaf
leal -0x30(%rbx), %eax
cmpb $0xa, %al
setae %al
leal -0x2d(%rbx), %ecx
cmpb $0x2, %cl
setae %cl
testb %cl, %al
jne 0xa5a8
leaq 0x18(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0xf(%rsp), %rdx
callq 0xa2e3
cmpl $0x7, %eax
setne %cl
testb $0x7, %al
setne %dl
movb $0x1, %sil
testb %dl, %cl
jne 0xa605
testl %eax, %eax
je 0xa594
movl %eax, 0x19d1f(%rip)     # 0x242ac
movl %r13d, 0x19d14(%rip)    # 0x242a8
cmpb $0x0, 0x10(%rsp)
je 0xa7ee
movq %r14, 0x18(%rsp)
xorl %esi, %esi
jmp 0xa605
leal -0x11(%rbx), %eax
movb $0x1, %sil
cmpb $0x8, %al
ja 0xa605
pushq $0x4
popq %rdi
callq 0x81d0
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0xadd0
addl $-0x10, %ebx
movl %ebx, (%rax)
movl $0x1, 0x24(%rsp)
movq %rbp, 0x18(%rsp)
pushq $0x3
popq %rax
movl %eax, %esi
movq 0x78(%rsp), %rbx
movq %r15, %rdi
movq %rsi, 0x38(%rsp)
callq 0x9088
movq %rax, %rbp
movq $0x0, 0x80(%rsp)
jmp 0xaa6c
movl %esi, 0x70(%rsp)
movq 0x18(%rsp), %rax
movsbq (%rax), %rbx
shlq $0x5, %rbx
movq 0x30(%rsp), %rdi
addq %rdi, %rbx
movq %rbx, %rsi
leaq 0x18(%rsp), %rdx
leaq 0x9c(%rsp), %rcx
xorl %r8d, %r8d
pushq $0x1
popq %r9
callq 0xaf9e
testl %eax, %eax
je 0xa74a
movl 0x9c(%rsp), %esi
movq %rbx, %rdi
callq 0x9088
movq %rax, %rbx
movb $0x1, 0x7(%rsp)
cmpl $0x0, 0x8(%rax)
jne 0xa668
cmpl $0x0, 0xc(%rbx)
setne 0x7(%rsp)
movl 0x10(%rbx), %eax
movq %rax, 0x80(%rsp)
xorl %r14d, %r14d
movl 0x48(%rsp), %ebp
testl %ebp, %ebp
jle 0xa71c
movq (%rbx), %r15
movq %r12, %rdi
movl %ebp, %esi
callq 0x9088
cmpq (%rax), %r15
je 0xa69e
movq 0x90(%rsp), %r15
jmp 0xa6fb
testl %r14d, %r14d
movq 0x90(%rsp), %r15
je 0xa6c6
movq %r12, %rdi
movl %ebp, %esi
callq 0x9088
movl 0x8(%rax), %esi
movq %r15, %rdi
callq 0x9088
cmpb $0x0, 0x8(%rax)
jne 0xa6fb
movl %ebp, %r14d
cmpl 0x48(%rsp), %r14d
jge 0xa6f8
incl %r14d
movq %r12, %rdi
movl %r14d, %esi
callq 0x9088
movl 0xc(%rax), %esi
testl %esi, %esi
jle 0xa6c9
movq 0x88(%rsp), %rdi
callq 0x9088
andl $0x0, 0x14(%rax)
jmp 0xa6c9
movl %ebp, %r14d
movq %r12, %rdi
movl %ebp, %esi
callq 0x9088
movl 0x8(%rax), %esi
movq %r15, %rdi
callq 0x9088
decl %ebp
cmpb $0x0, 0x8(%rax)
jne 0xa67a
testl %r14d, %r14d
je 0xa7e2
movq %r12, %rdi
movl %r14d, %esi
callq 0x9088
movl 0x8(%rax), %ebp
movl 0x48(%rsp), %edx
movq %r12, %rdi
movl %r14d, %esi
callq 0x864f
movq %rbp, %rcx
jmp 0xa83f
movzbl (%r14), %eax
leaq 0x16a2b(%rip), %rcx     # 0x21180
cmpl $0x3, (%rcx,%rax,4)
movq 0x30(%rsp), %r15
jne 0xade8
movl 0x1250(%r15), %ecx
testl %ecx, %ecx
js 0xade8
movl 0x1438(%r15), %eax
incl %eax
movl %eax, 0x1438(%r15)
movq %r14, 0x18(%rsp)
subq $0x8, %rsp
movsbl 0x18(%rsp), %r9d
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
xorl %edx, %edx
pushq $0x1
popq %r8
movq %rax, 0x88(%rsp)
pushq %rax
pushq $0x0
pushq $0x0
callq 0xa0a9
addq $0x20, %rsp
testl %eax, %eax
jne 0xac8e
movl 0x1250(%r15), %esi
movq 0x90(%rsp), %r15
movq %r15, %rdi
movq %rsi, 0x38(%rsp)
callq 0x9088
movq %rax, %r14
jmp 0xaa64
cmpb $0x0, 0x10(%rsp)
je 0xa83c
movl 0x8(%rbx), %ecx
jmp 0xa83f
cmpb $0x0, 0xf(%rsp)
je 0xac2e
movq 0x30(%rsp), %rax
movl 0x124c(%rax), %ebx
testl %ebx, %ebx
js 0xa5a4
movl $0x2, 0x24(%rsp)
pushq $0x8
popq %rdi
callq 0x81d0
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0xadd0
movsd 0xa0(%rsp), %xmm0
movsd %xmm0, (%rax)
jmp 0xac6f
movl 0xc(%rbx), %ecx
testl %ecx, %ecx
jle 0xa858
movq %r15, %rdi
movq %rcx, %rbp
movl %ebp, %esi
callq 0x9088
movq %rbp, %rcx
movq %rax, 0x28(%rsp)
cmpb $0x0, 0x10(%rsp)
jne 0xa8cd
testl %r14d, %r14d
je 0xa8cd
movq 0x28(%rsp), %rax
movl 0x10(%rax), %ebp
cmpl $0xa, %ebp
jg 0xa8cd
movq %rcx, 0x38(%rsp)
movl 0x8(%rsp), %ebx
testl %ebx, %ebx
jle 0xa985
movq %r15, %rdi
movl %ebx, %esi
callq 0x9088
movl 0xc(%rax), %eax
movq 0x28(%rsp), %r14
cmpl 0xc(%r14), %eax
movq 0x30(%rsp), %rdi
jle 0xa98f
movq %rdi, %rbp
movq %r15, %rdi
movl %ebx, %esi
callq 0x9088
movq %rbp, %rdi
movl 0x14(%rax), %ebp
movq $0x0, 0x10(%rsp)
cmpl $0x64, %ebp
jne 0xa98f
jmp 0xa9cf
testl %ecx, %ecx
sete %al
xorl %ebp, %ebp
cmpb $0x0, 0x10(%rsp)
jne 0xa97e
andb 0x7(%rsp), %al
movq 0x28(%rsp), %r14
je 0xa9d6
movl 0x8(%rbx), %ebp
movq %r15, %rdi
movl %ebp, %esi
callq 0x9088
movl 0x10(%rax), %ebx
movl 0x8(%rsp), %esi
testl %esi, %esi
jle 0xa931
movq %r15, %rdi
callq 0x9088
movl 0xc(%rax), %r14d
movq %r15, %rdi
movl %ebp, %esi
callq 0x9088
cmpl 0xc(%rax), %r14d
jle 0xa931
movq %r15, %rdi
movl 0x8(%rsp), %esi
callq 0x9088
movl 0x14(%rax), %ebx
cmpl $0x64, %ebx
je 0xae07
movslq %ebx, %rax
movq 0x30(%rsp), %rdi
movl 0x140c(%rdi,%rax,4), %esi
testl %esi, %esi
je 0xae07
movl %r13d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb2eb
testl %eax, %eax
jne 0xac8e
movq %r15, %rdi
movl %ebp, %esi
callq 0x9088
movq %rax, %r14
movb $0x1, %al
movq %rax, 0x10(%rsp)
movl %ebp, %ecx
jmp 0xa9d6
movq 0x28(%rsp), %r14
jmp 0xa9d6
movq 0x30(%rsp), %rdi
movq 0x28(%rsp), %r14
movslq %ebp, %rax
movl 0x140c(%rdi,%rax,4), %esi
testl %esi, %esi
je 0xa9c6
movq $0x0, 0x10(%rsp)
movl %r13d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb2eb
movl $0x0, %ebp
testl %eax, %eax
movq 0x38(%rsp), %rcx
je 0xa9d6
jmp 0xac8e
movq $0x0, 0x10(%rsp)
xorl %ebp, %ebp
movq 0x38(%rsp), %rcx
testl %ecx, %ecx
jle 0xae10
movq %rcx, 0x38(%rsp)
cmpl $0x0, 0x28(%r14)
je 0xaa64
movq %r12, %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x8b0f
testl %eax, %eax
jne 0xac8e
movl 0x28(%r14), %esi
movq %r15, %rdi
callq 0x9088
movq (%rax), %rbx
movl 0x48(%rsp), %esi
movq %r12, %rdi
callq 0x9088
movq %rbx, (%rax)
movl 0x28(%r14), %ebx
movl 0x48(%rsp), %esi
movq %r12, %rdi
callq 0x9088
movl %ebx, 0x8(%rax)
cmpb $0x0, 0x9(%r14)
je 0xaa49
movl 0x48(%rsp), %esi
movq %r12, %rdi
callq 0x9088
andl $0x0, 0xc(%rax)
jmp 0xaa64
movq 0x88(%rsp), %rax
movl (%rax), %ebx
incl %ebx
movl 0x48(%rsp), %esi
movq %r12, %rdi
callq 0x9088
movl %ebx, 0xc(%rax)
movq %r14, %rbp
movq 0x78(%rsp), %rbx
cmpl $0xd, %ebx
movl 0x44(%rsp), %eax
cmovnel %ebx, %eax
movl %eax, 0x44(%rsp)
movl 0x14(%rbp), %ebx
cmpl $0x0, 0x80(%rsp)
jle 0xaab4
movl $0x1, 0x24(%rsp)
pushq $0x4
popq %rdi
callq 0x81d0
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0xadd0
movq %rbx, %r14
movq 0x80(%rsp), %rcx
movl %ecx, (%rax)
jmp 0xaaf5
movq %rbx, %r14
leal -0xb(%rbx), %eax
cmpl $0x1, %eax
ja 0xaaf5
xorl %ebx, %ebx
cmpl $0xb, %r14d
sete %bl
movl 0x28(%rbp), %esi
movq %r15, %rdi
callq 0x9088
movq (%rax), %rsi
leaq 0x18(%rsp), %rdi
leaq 0x68(%rsp), %rdx
leaq 0x24(%rsp), %rcx
movl %ebx, %r8d
callq 0xb3a5
testl %eax, %eax
jne 0xac8e
cmpb $0x0, 0x9(%rbp)
jne 0xab41
movq 0x30(%rsp), %rdi
movq 0x38(%rsp), %rsi
movl %r13d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb2eb
testl %eax, %eax
jne 0xac8e
movq 0x68(%rsp), %rcx
testq %rcx, %rcx
je 0xab41
movl 0x24(%rsp), %r8d
movq 0x30(%rsp), %rdi
pushq $0x1
popq %rsi
movl %r13d, %edx
callq 0xb2eb
testl %eax, %eax
jne 0xac8e
movq %r14, %rdx
cmpl $0xd, %edx
jne 0xabc7
cmpb $0x0, 0x9(%rbp)
jne 0xab6c
movq 0x30(%rsp), %rdi
pushq $0x1
popq %rsi
movl %r13d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb2eb
testl %eax, %eax
jne 0xac8e
movl 0x28(%rbp), %ebx
movq %r15, %rdi
movl %ebx, %esi
callq 0x9088
movq %rbx, %rcx
movq %rax, %r14
movq 0x18(%rsp), %rbx
movq %rbx, %rax
testl %ecx, %ecx
js 0xaba5
movq %rcx, 0x38(%rsp)
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x80a0
movq 0x38(%rsp), %rcx
movq %rax, 0x18(%rsp)
testq %rax, %rax
movq %r14, 0x28(%rsp)
je 0xac09
cmpl $-0x1, 0x10(%rbp)
jne 0xabbc
cmpl $-0x1, 0x14(%r14)
je 0xac1b
movq $0x0, 0x10(%rsp)
jmp 0xac1b
cmpl $0xd, 0x10(%rbp)
movl 0x8(%rsp), %eax
jne 0xabe3
movq %rbp, 0x28(%rsp)
movl 0x44(%rsp), %ecx
movl %ecx, %edx
movq 0x38(%rsp), %rcx
jmp 0xac24
movb $0x1, %cl
movq %rcx, 0x10(%rsp)
cmpl $-0x1, %edx
movq 0x38(%rsp), %rcx
je 0xac02
cmpl $0x64, %edx
je 0xac02
movq $0x0, 0x10(%rsp)
movq %rbp, 0x28(%rsp)
jmp 0xac24
decq %rbx
cmpb $0x0, 0x1(%rbx)
leaq 0x1(%rbx), %rbx
jne 0xac0c
movq %rbx, 0x18(%rsp)
pushq $0xd
popq %rax
movl %eax, %edx
movl 0x8(%rsp), %eax
movq 0x18(%rsp), %rbp
jmp 0xa4ea
movq 0x30(%rsp), %rax
movl 0x1248(%rax), %ebx
cmpl $-0x1, %ebx
je 0xac84
testl %ebx, %ebx
js 0xa5a4
movl $0x1, 0x24(%rsp)
pushq $0x4
popq %rdi
callq 0x81d0
movq %rax, 0x68(%rsp)
testq %rax, %rax
je 0xadd0
cvttsd2si 0xa0(%rsp), %ecx
movl %ecx, (%rax)
movq %rbx, %rsi
testl %esi, %esi
movq 0x78(%rsp), %rbx
jne 0xa5e4
jmp 0xa5a4
movb $0x1, 0xf(%rsp)
jmp 0xa7f9
movl %eax, %ebx
movl %r13d, 0x19611(%rip)    # 0x242a8
leaq 0x48(%rsp), %rdi
callq 0x846b
jmp 0xa486
movq %rbp, %r14
movl %eax, 0x8(%rsp)
jmp 0xacb4
movl 0x74(%rsp), %r13d
subl 0xa8(%rsp), %r14d
incl %r14d
movl %r14d, 0x195f2(%rip)    # 0x242b8
leaq 0x48(%rsp), %rbx
movl (%rbx), %ebp
movq 0x30(%rsp), %r14
testl %ebp, %ebp
jle 0xad21
movq %rbx, %rdi
movl %ebp, %esi
callq 0x9088
movl 0x8(%rax), %esi
movq %r15, %rdi
callq 0x9088
cmpb $0x1, 0x8(%rax)
jne 0xad1d
movq %rbx, %rdi
movl %ebp, %esi
callq 0x9088
movl 0xc(%rax), %esi
testl %esi, %esi
jle 0xad13
movq 0x88(%rsp), %rdi
callq 0x9088
andl $0x0, 0x14(%rax)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x8b1c
decl %ebp
jmp 0xacd2
cmpb $0x0, 0x10(%rsp)
je 0xad33
cmpl $0x0, 0x48(%rsp)
jle 0xadbf
xorl %eax, %eax
cmpb $0x0, 0x10(%rsp)
sete %al
movq 0x88(%rsp), %rcx
cmpl $0x0, (%rcx)
leal 0xb(%rax,%rax,2), %eax
pushq $0xc
popq %rbx
cmovnel %eax, %ebx
movq 0x78(%rsp), %rax
cmpl $0xd, %eax
jne 0xad6b
movq %r15, %rdi
movl 0x8(%rsp), %esi
callq 0x9088
movl 0x14(%rax), %eax
cmpl $0x64, %eax
je 0xad90
cltq
movl 0x140c(%r14,%rax,4), %esi
testl %esi, %esi
je 0xad90
movq %r14, %rdi
movl %r13d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0xb2eb
movl %eax, %ebx
testl %ebx, %ebx
je 0xadbf
cmpl $0xb, %ebx
jne 0xac90
movl 0x19514(%rip), %r13d    # 0x242b8
leaq 0x48(%rsp), %rdi
movl (%rdi), %esi
callq 0x9088
movq (%rax), %rax
movq %rax, 0x194f6(%rip)     # 0x242b0
jmp 0xac90
leaq 0x48(%rsp), %rdi
callq 0x846b
xorl %ebx, %ebx
jmp 0xa486
movl %r13d, 0x194d1(%rip)    # 0x242a8
leaq 0x48(%rsp), %rdi
callq 0x846b
pushq $0x1
jmp 0xae96
cmpb $0x0, 0x70(%rsp)
je 0xae6e
movl %r13d, 0x194b2(%rip)    # 0x242a8
leaq 0x48(%rsp), %rdi
callq 0x846b
pushq $0x9
jmp 0xae96
movq $0x0, 0x10(%rsp)
movl 0x8(%rsp), %esi
cmpb $0x0, 0x70(%rsp)
je 0xae6e
cmpb $0x0, 0x7(%rsp)
je 0xae83
testl %esi, %esi
jle 0xae9c
testl %ebp, %ebp
je 0xae9c
movq %r15, %rdi
callq 0x9088
movl 0xc(%rax), %ebx
movq %r15, %rdi
movl %ebp, %esi
callq 0x9088
cmpl 0xc(%rax), %ebx
jle 0xae9c
xorl %ebx, %ebx
cmpb $0x0, 0x10(%rsp)
setne %bl
movl 0x74(%rsp), %eax
movl %eax, 0x19450(%rip)     # 0x242a8
leaq 0x48(%rsp), %rdi
callq 0x846b
leal 0xe(,%rbx,2), %ebx
jmp 0xa486
movl %r13d, 0x19433(%rip)    # 0x242a8
leaq 0x48(%rsp), %rdi
callq 0x846b
pushq $0xf
jmp 0xae96
movl %r13d, 0x1941e(%rip)    # 0x242a8
leaq 0x48(%rsp), %rdi
callq 0x846b
pushq $0xa
popq %rbx
jmp 0xa486
xorl %ebx, %ebx
cmpb $0x0, 0x10(%rsp)
setne %bl
movl %r13d, 0x193fb(%rip)    # 0x242a8
leaq 0x48(%rsp), %rdi
callq 0x846b
leal 0xd(,%rbx,2), %ebx
jmp 0xa486