// File: /workspace/github_c_makefile_star2_O3/heltilda[P]cicada/cmpile.c
// Function: newCompiler
compiler_type *newCompiler(commandTokenType *commandTokens, ccInt numCommands, ccInt *OoOdirections, ccInt numOoOs, ccInt *rtrn)
{
    compiler_type *compiler = (compiler_type *) malloc(sizeof(compiler_type));
    ccInt loopList, loopCmd, loopTokenString, loopOoO, loopArgCmd, loopArgType, loopRtrnType, loopToken = 3;
    ccInt jumpTo[9], jumpMarkers[9], loopJump, loopStartingChar;
    char *oneChar;
    ccFloat theNum;
    ccBool ifFloat;
    
    *rtrn = passed;
    
    if (compiler == NULL)  {  *rtrn = out_of_memory_err;  errPosition = 0;  return compiler;  }
    
    compiler->tokenSpecs.memory = NULL;         // zero our pointers first so we know what we've allocated
    compiler->allCodeWords.memory = NULL;       // (in case we have to bail out before we've finished building arrays)
    compiler->scriptTokens.memory = NULL;
    compiler->bytecode.memory = NULL;
    compiler->opCharNum.memory = NULL;
    compiler->varNames.memory = NULL;
    compiler->numVariables = compiler->anonymousMemberNum = 0;
    
    for (loopArgType = 0; loopArgType < 11; loopArgType++)  {
    for (loopRtrnType = 0; loopRtrnType < 11; loopRtrnType++)  {
        compiler->adapters[loopArgType][loopRtrnType] = 0;
    }}
    
    for (loopTokenString = 0; loopTokenString < 128; loopTokenString++)  {
        compiler->tokens[loopTokenString].memory = NULL;        }
    
    
        // construct the jump tables from the language tokens
    
    compiler->OoOdirections = (ccInt *) malloc((numOoOs+2)*sizeof(ccInt));
    if ((newLinkedList(&(compiler->tokenSpecs), 3, sizeof(tokenSpecType), 1., ccTrue) != passed)
                || (newLinkedList(&(compiler->allCodeWords), 0, sizeof(ccInt), 1., ccFalse) != passed)
                || (compiler->OoOdirections == NULL)
                || (newLinkedList(&(compiler->scriptTokens), 0, sizeof(scriptTokenType), 1., ccFalse) != passed)
                || (newLinkedList(&(compiler->bytecode), 0, sizeof(ccInt), 0, ccFalse) != passed)
                || (newLinkedList(&(compiler->opCharNum), 0, sizeof(ccInt), 0, ccFalse) != passed)
                || (newLinkedList(&(compiler->varNames), 0, sizeof(varNameType), 0, ccFalse) != passed))
        errOut(out_of_memory_err, 0)
    
    for (loopStartingChar = 0; loopStartingChar < 128; loopStartingChar++)  {
        compiler->numLanguageOps[loopStartingChar] = 0;             }
    
    
        // read in miscellaneous information about the language; initialize memory
    
    if ((numCommands < 0) || (numOoOs < 0))  errOut(out_of_range_err, 0)
    
    for (loopOoO = 0; loopOoO < numOoOs; loopOoO++)  {
        compiler->OoOdirections[loopOoO] = OoOdirections[loopOoO];
        if ((OoOdirections[loopOoO] != l_to_r) && (OoOdirections[loopOoO] != r_to_l)) {
            errOut(out_of_range_err, -loopOoO-1)
    }   }
    compiler->OoOdirections[numOoOs] = l_to_r;
    compiler->OoOdirections[numOoOs+1] = l_to_r;
    
    compiler->specialTokens[0] = compiler->specialTokens[1] = compiler->specialTokens[2] = -1;
    
    for (loopList = 0; loopList < 128; loopList++)  {
    if (newLinkedList(compiler->tokens + loopList, 0, sizeof(tokenStringType), 1., ccFalse) != passed)  {
        errOut(out_of_memory_err, 0)
    }}
    
    
        // we start with a null token for comments, constant data and macro args, and the typeXadapter placeholder token
    
        // constant data:  we add an explicit token for this, so that, for example, strings won't feel that there's a
        // missing argument between the two quotation 'operators'
    
    tokenSpec(1)->leftArgType = tokenSpec(1)->rightArgType = -1;
    tokenSpec(1)->precedence = numOoOs+2;
    tokenSpec(1)->firstCodeWord = 1;
    
    
        // typeX adapter
    
    tokenSpec(2)->leftArgType = tokenSpec(2)->rightArgType = -1;
    tokenSpec(2)->precedence = numOoOs+2;
    tokenSpec(2)->firstCodeWord = 1;
    tokenSpec(2)->rtrnTypes[10] = ccTrue;
    compiler->adapters[10][10] = 2;
    
    
        // macro argument -- the idea here is that the code writes the compiler command to load an argument (0, 1, arg #)
        // into the result of the macro 'bytecode'
    
    tokenSpec(3)->leftArgType = -1;
    tokenSpec(3)->rightArgType = constDataArgType;
    tokenSpec(3)->precedence = numOoOs+1;
    tokenSpec(3)->firstCodeWord = 1;
    tokenSpec(3)->numCodeWords = 6;
    for (loopRtrnType = 0; loopRtrnType < 10; loopRtrnType++)
        tokenSpec(3)->rtrnTypes[loopRtrnType] = ccTrue;
    if (addElements(&(compiler->allCodeWords), 6, ccTrue) != passed)  errOut(out_of_memory_err, 1)
    *LL_int(&(compiler->allCodeWords), compiler->allCodeWords.elementNum-3) = 1;
    *LL_int(&(compiler->allCodeWords), compiler->allCodeWords.elementNum-1) = 1;
    *LL_int(&(compiler->allCodeWords), compiler->allCodeWords.elementNum) = 1;
    
    
        // read in each token along with its bytecode expansion
    
    for (loopCmd = 0; loopCmd < numCommands; loopCmd++)  {
        
        char *tokenChar = (char *) commandTokens[loopCmd].cmdString;
        ccInt firstToken = loopToken+1, LHarg = -1, RHarg = -1, firstRtrnType = -1, numJumps = 0, aOrtrn, numArgs = 0;
        ccBool expectLHarg = ccFalse, optionalLHarg;
        ccBool tobeRemoved = ( (*commandTokens[loopCmd].rtrnTypeString == *removedexpression)
                            || (*commandTokens[loopCmd].translation == *removedexpression) );
        
        
            // first we read the text description of an operation (usually a string interspersed with
            // 'typeNarg's, but may be something like 'int_constant', in which case we just mark the token number)
            
            // case 1:  it's a pre-defined object:  a constant, user-defined variable or argument adapter
        
        if ((*tokenChar >= *type0arg_adapter) && (*tokenChar <= *variable_name))  {
            
            loopToken++;
            if (addElements(&(compiler->tokenSpecs), 1, ccTrue) != passed)  errOut(out_of_memory_err, loopCmd+1)
            
            if (*tokenChar >= *int_constant)  {
                compiler->specialTokens[(ccInt) ((*tokenChar)-(*int_constant))] = loopToken;
                nextChar(&tokenChar);        }
            
            numArgs = 1;
            tokenSpec(loopToken)->leftArgType = -1;
            if (*tokenChar <= *noarg_adapter)  tokenSpec(loopToken)->rightArgType = -1;
            else  tokenSpec(loopToken)->rightArgType = constDataArgType;
            tokenSpec(loopToken)->precedence = numOoOs+1;        }
        
        
            // case 2:  it's an ordinary series of tokens and arguments -- read those until we run out
        
        else  {
            
                // first read in the left-hand argument type, if there is one
            
            if ((*tokenChar >= *type0arg) && (*tokenChar <= *type9arg))  {
                LHarg = ((ccInt) *tokenChar) - ((ccInt) *type0arg);
                if (LHarg == (ccInt) (*chararg - *type0arg))  errOut(char_read_err, loopCmd+1)
                if (LHarg == (ccInt) (*stringarg - *type0arg))  errOut(string_read_err, loopCmd+1)
                numArgs = 1;
                expectLHarg = ccTrue;
                do  {  tokenChar++;  }
                while ((lettertype(tokenChar) == unprintable) || (lettertype(tokenChar) == a_space));  }
            
            
                // removable expressions (comments) can happen irrespective of whether there is a left-hand argument
            
            if (tobeRemoved)  optionalLHarg = ccTrue;
            else  optionalLHarg = ccFalse;
            
            
                // now read in each token/argument type
            
            while (*tokenChar != 0)  {
                
                ccBool isOptional = (*tokenChar == *optionalargs);
                
                while ((lettertype(tokenChar) == a_space) || (lettertype(tokenChar) == unprintable))  tokenChar++;
                if (*tokenChar == 0)  break;
                
                loopToken++;
                if (addElements(&(compiler->tokenSpecs), 1, ccTrue) != passed)  errOut(out_of_memory_err, loopCmd+1)
                
                aOrtrn = addTokenSpec(compiler, &tokenChar, &(tokenSpec(loopToken)->name), loopToken, ccFalse,
                                        expectLHarg, optionalLHarg, loopToken-firstToken, 0);
                if (aOrtrn != passed)  errOut(aOrtrn, loopCmd+1)
                
                
                    // if there's a right-hand argument (or an argument in between tokens), mark its type
                
                if ((*tokenChar >= *type0arg) && (*tokenChar <= *commentarg))  {
                    RHarg = ((ccInt) *tokenChar) - ((ccInt) *type0arg);
                    numArgs++;
                    tokenChar++;        }
                else  RHarg = -1;
                
                
                    // store the token information and move on
                
                tokenSpec(loopToken)->isOptional = isOptional;
                tokenSpec(loopToken)->tobeRemoved = tobeRemoved;
                tokenSpec(loopToken)->leftArgType = LHarg;
                tokenSpec(loopToken)->rightArgType = RHarg;
                if (loopToken != firstToken)  {
                    tokenSpec(loopToken)->prevToken = loopToken-1;
                    tokenSpec(loopToken-1)->nextToken = loopToken;   }
                
                LHarg = RHarg;
            }
            
            
                // now store info about the command as a whole -- we use the first token for storing this information
                // first store the precedence level of the command
            
            if ((tokenSpec(firstToken)->leftArgType == -1) && (tokenSpec(loopToken)->rightArgType == -1))  {
                tokenSpec(firstToken)->precedence = numOoOs+2;        }
            else  {
                tokenSpec(firstToken)->precedence = commandTokens[loopCmd].precedence;
                
                if ((commandTokens[loopCmd].precedence < 1) || (commandTokens[loopCmd].precedence > numOoOs))  {
                    errOut(out_of_range_err, loopCmd+1)
        }   }   }
        
        
            // a character or string has to be flanked by opening and closing tokens
        
        if (RHarg == (ccInt) (*chararg - *type0arg))  errOut(char_read_err, loopCmd+1)
        if (RHarg == (ccInt) (*stringarg - *type0arg))  errOut(string_read_err, loopCmd+1)
        
        
            // read in the return types of the command
        
        oneChar = (char *) commandTokens[loopCmd].rtrnTypeString;
        
        if (*oneChar == *argXtype)  {
            tokenSpec(firstToken)->rtrnTypes[10] = ccTrue;       }
        else  {
        while (*oneChar != 0)  {
            if ((*oneChar >= '0') && (*oneChar <= '9'))  {
                tokenSpec(firstToken)->rtrnTypes[(*oneChar)-'0'] = ccTrue;
                if (firstRtrnType == -1)  firstRtrnType = (*oneChar)-'0';
                if ((*tokenChar >= *type0arg_adapter) && (*tokenChar <= *noarg_adapter))  {
                    compiler->adapters[(*tokenChar)-(*type0arg_adapter)][(*oneChar)-'0'] = firstToken;
            }   }
            
            oneChar++;
        }}
        
        
            // parse the string that stores the command's bytecode
        
        tokenSpec(firstToken)->firstCodeWord = compiler->allCodeWords.elementNum+1;
        
        
        for (loopJump = 0; loopJump < 9; loopJump++)  {  jumpMarkers[loopJump] = jumpTo[loopJump] = 0;  }
        
        
            // case #1:  the string is raw bytecode (i.e. it has an 'inbytecode' character at the beginning)
        
        oneChar = (char *) commandTokens[loopCmd].translation;
        if (*oneChar == *inbytecode)  {
            oneChar++;
            while (*oneChar != 0)  {
                while ( (*oneChar == ' ') || (*oneChar == '\t') ||
                        ((lettertype(oneChar) == unprintable) && (*oneChar != anonymousmember[1])) )  {
                    oneChar++;      }
                
                if (*oneChar != 0)  {
                    
                    ccInt intNum = 0, wordsToAdd = 1, wordPosition, wordType = -1;          // an ordinary command word
                    char *holdNumPos = NULL;
                    
                    if (*oneChar == anonymousmember[1])  {
                        oneChar++;
                        wordType = 4;
                        wordsToAdd = 2;         }
                    
                    else  {
                        if ((*oneChar == 'A') || (*oneChar == 'a'))  wordType = 1;        // an argument
                        else if ((*oneChar == 'P') || (*oneChar == 'p'))  wordType = 2;   // a code position marker
                        else if ((*oneChar == 'J') || (*oneChar == 'j'))  wordType = 3;   // a jump offset
                        
                        if (wordType != -1)  {
                            oneChar++;
                            wordsToAdd = 3;     }
                        
                        holdNumPos = oneChar;
                        if (readNum(&oneChar, &theNum, &ifFloat) != passed)
                            errOut(read_number_err, loopCmd+1)
                        else if ((ifFloat) || ((wordType != -1) && ((theNum < 1) || (theNum > 9))))
                            errOut(out_of_range_err, loopCmd+1)
                        intNum = (ccInt) theNum;
                        
                        if ((wordType == 1) && (intNum > numArgs))
                            errOut(out_of_range_err, loopCmd+1)       }
                    
                    if ((wordType == -1) && (intNum == 0))  {  wordType = 0;  wordsToAdd = 2;  }
                    if (wordType == 2)  {
                        numJumps++;
                        jumpMarkers[intNum-1] = 1;
                        if (numJumps > 9)  {
                            errOut(out_of_range_err, loopCmd+1)
                    }   }
                    
                    if (wordType == 3)  jumpTo[intNum-1] = 1;
                    
                    wordPosition = compiler->allCodeWords.elementNum+1;
                    if (addElements(&(compiler->allCodeWords), wordsToAdd, ccFalse) != passed)  errOut(out_of_memory_err, loopCmd+1)
                    
                    if (wordType == -1)  {
                        *LL_int(&(compiler->allCodeWords), wordPosition) = intNum;
                        if (intNum == 0)  *LL_int(&(compiler->allCodeWords), wordPosition+1) = 0;      }
                    else  {
                        *LL_int(&(compiler->allCodeWords), wordPosition) = 0;
                        *LL_int(&(compiler->allCodeWords), wordPosition+1) = wordType;
                        if (wordsToAdd == 3)  {
                            *LL_int(&(compiler->allCodeWords), wordPosition+2) = intNum;
        }   }  }   }   }
        
        
            // case #2:  the string is a macro command -- compile it using the commands we've already encountered
        
        else if (!tobeRemoved)  {
            tokenSpec(firstToken)->numCodeWords = 0;        // temporary patch, to ensure we can compile the macro string
            
            for (loopArgCmd = *arg1; loopArgCmd <= *arg9; loopArgCmd++)  lettertypeArray[loopArgCmd] = a_symbol;  
            *rtrn = tokenize(compiler, oneChar, firstRtrnType);
            for (loopArgCmd = *arg1; loopArgCmd <= *arg9; loopArgCmd++)  lettertypeArray[loopArgCmd] = unprintable;  
            
            if (*rtrn == passed)  *rtrn = reorderTokens(compiler, firstRtrnType, ccFalse);
            if (*rtrn == passed)  *rtrn = addElements(&(compiler->allCodeWords), compiler->bytecode.elementNum, ccFalse);
            if (*rtrn != passed)  errOut(*rtrn, loopCmd+1)
            
            copyElements(&(compiler->bytecode), 1,
                    &(compiler->allCodeWords), tokenSpec(firstToken)->firstCodeWord, compiler->bytecode.elementNum);
        }
        
        for (loopJump = 0; loopJump < 9; loopJump++)  {
        if ((jumpMarkers[loopJump] == 0) && (jumpTo[loopJump] != 0))  {
            errOut(out_of_range_err, loopCmd+1)
        }}
        
        tokenSpec(firstToken)->numCodeWords = compiler->allCodeWords.elementNum - tokenSpec(firstToken)->firstCodeWord + 1;
    }
    
    
        // defragment all the linked lists to make the parsing faster, and count number of operators
    
    if ((defragmentLinkedList(&(compiler->allCodeWords)) != passed)
                || (defragmentLinkedList(&(compiler->tokenSpecs)) != passed))  errOut(out_of_memory_err, 0)
    
    for (loopList = 0; loopList < 128; loopList++)  {
    if (defragmentLinkedList(compiler->tokens + loopList) != passed)  {
        errOut(out_of_memory_err, 0)
    }}
    
    return compiler;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %r8, %rbx
movl %ecx, %r15d
movq %rdx, %rbp
movl %esi, %r12d
movq %rdi, %r13
movl $0x14c0, %edi           # imm = 0x14C0
callq 0x81d0
movl $0x0, (%rbx)
testq %rax, %rax
je 0x972b
movq %rax, %r14
movq %r13, 0x98(%rsp)
movq %r15, 0x68(%rsp)
xorl %eax, %eax
movq %rax, 0x1208(%r14)
movq %rax, 0x1228(%r14)
movq %rax, 0x1448(%r14)
movq %rax, 0x1468(%r14)
movq %rax, 0x1488(%r14)
movq %rax, 0x14a8(%r14)
leaq 0x1254(%r14), %rdi
leaq 0x1200(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x1440(%r14), %r15
leaq 0x1480(%r14), %r13
movl $0x1ec, %edx            # imm = 0x1EC
movq %rdi, 0xa0(%rsp)
xorl %esi, %esi
callq 0x80c0
movl $0x8, %eax
movq $0x0, (%r14,%rax)
addq $0x20, %rax
cmpq $0x1008, %rax           # imm = 0x1008
jne 0x96ab
movslq 0x68(%rsp), %rax
leaq 0x8(,%rax,4), %rdi
callq 0x81d0
movq %rax, 0x1240(%r14)
movq 0x11928(%rip), %xmm0    # 0x1b008
movq 0x10(%rsp), %rdi
movl $0x3, %esi
movl $0x38, %edx
movl $0x1, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x9723
leaq 0x1220(%r14), %rdi
movq 0x118fc(%rip), %xmm0    # 0x1b008
movq %rdi, 0x30(%rsp)
xorl %esi, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
je 0x9753
movq %r14, %rdi
callq 0xa407
movl $0x1, (%rbx)
movl $0x0, 0x1bb6d(%rip)     # 0x252a8
xorl %r14d, %r14d
movq %r14, %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpq $0x0, 0x1240(%r14)
je 0x9723
movq 0x118a3(%rip), %xmm0    # 0x1b008
movq %r15, %rdi
xorl %esi, %esi
movl $0x38, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x9723
leaq 0x1460(%r14), %r15
pxor %xmm0, %xmm0
movq %r15, %rdi
xorl %esi, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x9723
pxor %xmm0, %xmm0
movq %r13, %rdi
xorl %esi, %esi
movl $0x4, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x9723
leaq 0x14a0(%r14), %rdi
pxor %xmm0, %xmm0
xorl %esi, %esi
movl $0x10, %edx
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x9723
leaq 0x1000(%r14), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x80c0
movq 0x68(%rsp), %rsi
movl %esi, %eax
orl %r12d, %eax
js 0x99f6
movq %r15, 0x80(%rsp)
movq 0x1240(%r14), %rax
movl %esi, %ecx
testl %esi, %esi
jle 0x982f
xorl %r15d, %r15d
movl (%rbp,%r15,4), %edx
movl %edx, (%rax,%r15,4)
decl %edx
cmpl $0x2, %edx
jae 0x9a09
incq %r15
cmpq %r15, %rcx
jne 0x9813
leal 0x2(%rsi), %ebp
movl $0x1, %edx
movl %edx, (%rax,%rcx,4)
incl %esi
movl %esi, 0x5c(%rsp)
movl %edx, 0x4(%rax,%rcx,4)
movl $0xffffffff, 0x1250(%r14) # imm = 0xFFFFFFFF
movq $-0x1, 0x1248(%r14)
xorl %r15d, %r15d
leaq (%r14,%r15), %rdi
xorl %esi, %esi
movl $0x18, %edx
movq 0x11798(%rip), %xmm0    # 0x1b008
xorl %ecx, %ecx
callq 0x83e1
testl %eax, %eax
jne 0x9723
addq $0x20, %r15
cmpq $0x1000, %r15           # imm = 0x1000
jne 0x985d
movq 0x10(%rsp), %r13
movq %r13, %rdi
movl $0x1, %esi
callq 0x91d8
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movl %r15d, 0x14(%rax)
movq %r13, %rdi
movl $0x1, %esi
callq 0x91d8
movl %r15d, 0x10(%rax)
movq %r13, %rdi
movl $0x1, %esi
callq 0x91d8
movl %ebp, 0xc(%rax)
movq %r13, %rdi
movl $0x1, %esi
callq 0x91d8
movl $0x1, %ecx
movl %ecx, 0x2c(%rax)
movq %r13, %rdi
movl $0x2, %esi
callq 0x91d8
movl %r15d, 0x14(%rax)
movq %r13, %rdi
movl $0x2, %esi
callq 0x91d8
movl %r15d, 0x10(%rax)
movq %r13, %rdi
movl $0x2, %esi
callq 0x91d8
movl %ebp, 0x74(%rsp)
movl %ebp, 0xc(%rax)
movq %r13, %rdi
movl $0x2, %esi
callq 0x91d8
movl $0x1, %ebp
movl %ebp, 0x2c(%rax)
movq %r13, %rdi
movl $0x2, %esi
callq 0x91d8
movb $0x1, 0x22(%rax)
movl $0x2, 0x1434(%r14)
movq %r13, %rdi
movl $0x3, %esi
callq 0x91d8
movl %r15d, 0x10(%rax)
movq %r13, %rdi
movl $0x3, %esi
callq 0x91d8
movl $0x64, 0x14(%rax)
movq %r13, %rdi
movl $0x3, %esi
callq 0x91d8
movl 0x5c(%rsp), %ecx
movl %ecx, 0xc(%rax)
movq %r13, %rdi
movl $0x3, %esi
callq 0x91d8
movl %ebp, 0x2c(%rax)
movq %r13, %rdi
movl $0x3, %esi
callq 0x91d8
movl $0x6, 0x30(%rax)
xorl %r15d, %r15d
movq %r13, %rdi
movl $0x3, %esi
callq 0x91d8
movb $0x1, 0x18(%rax,%r15)
incq %r15
cmpq $0xa, %r15
jne 0x99a5
movl $0x1, %ebp
movq 0x30(%rsp), %r15
movq %r15, %rdi
movl $0x6, %esi
movl $0x1, %edx
callq 0x8bb3
testl %eax, %eax
je 0x9a26
movq %r14, %rdi
callq 0xa407
movl %ebp, (%rbx)
movl %ebp, 0x1b8b7(%rip)     # 0x252a8
jmp 0x973b
movq %r14, %rdi
callq 0xa407
movl $0x2, (%rbx)
jmp 0x9731
movq %r14, %rdi
callq 0xa407
movl $0x2, (%rbx)
notl %r15d
movl %r15d, 0x1b887(%rip)    # 0x252a8
jmp 0x973b
movl (%r15), %esi
addl $-0x3, %esi
movq %r15, %rdi
callq 0x91d8
movl %ebp, (%rax)
movl (%r15), %esi
decl %esi
movq %r15, %rdi
callq 0x91d8
movl %ebp, (%rax)
movl (%r15), %esi
movq %r15, %rdi
callq 0x91d8
movl %ebp, (%rax)
testl %r12d, %r12d
jle 0xa355
movl %r12d, %eax
movq %rax, 0x88(%rsp)
movl $0x3, %eax
movq %rax, 0x28(%rsp)
pshufd $0xf5, 0x115e7(%rip), %xmm0 # xmm0 = mem[1,1,3,3]
movdqa %xmm0, 0x110(%rsp)
xorl %eax, %eax
movq %rax, 0x78(%rsp)
shlq $0x5, %rax
movq 0x98(%rsp), %rcx
leaq (%rcx,%rax), %rdx
movq %rdx, 0x60(%rsp)
movq (%rcx,%rax), %rbp
movq %rbp, 0x50(%rsp)
movq 0x10(%rcx,%rax), %rax
movb $0x1, 0x20(%rsp)
cmpb $0x1b, (%rax)
je 0x9ac7
movq 0x60(%rsp), %rax
movq 0x18(%rax), %rax
cmpb $0x1b, (%rax)
sete 0x20(%rsp)
movq 0x28(%rsp), %rax
incl %eax
movl %eax, 0xc(%rsp)
movb (%rbp), %al
leal 0x10(%rax), %ecx
cmpb $0xd, %cl
ja 0x9b9f
movq 0x10(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x8bb3
testl %eax, %eax
jne 0xa3af
movsbq (%rbp), %rax
cmpq $-0x5, %rax
jl 0x9b3e
movl 0xc(%rsp), %ecx
movl %ecx, 0x125c(%r14,%rax,4)
movzbl (%rbp), %eax
leaq 0x18661(%rip), %rcx     # 0x22180
cmpl $0x6, (%rcx,%rax,4)
je 0x9b3e
leaq 0x18654(%rip), %rcx     # 0x22180
movzbl 0x1(%rbp), %eax
incq %rbp
cmpl $0x0, (%rcx,%rax,4)
je 0x9b2c
movq %rbp, 0x50(%rsp)
movq 0x10(%rsp), %r13
movq %r13, %rdi
movl 0xc(%rsp), %r12d
movl %r12d, %esi
callq 0x91d8
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
xorl %r15d, %r15d
cmpb $-0x5, (%rbp)
setl %r15b
movq %r13, %rdi
movl %r12d, %esi
callq 0x91d8
negl %r15d
orl $0x64, %r15d
movl %r15d, 0x14(%rax)
movq %r13, %rdi
movl %r12d, %esi
callq 0x91d8
movl 0x5c(%rsp), %ecx
movl %ecx, 0xc(%rax)
movl $0x1, 0x3c(%rsp)
movl %r12d, 0x1c(%rsp)
jmp 0x9dfb
leal -0x10(%rax), %ecx
movl $0x0, 0x3c(%rsp)
cmpb $0x9, %cl
ja 0x9bdf
leaq 0x185ca(%rip), %rdx     # 0x22180
movzbl 0x1(%rbp), %eax
incq %rbp
cmpl $0x2, (%rdx,%rax,4)
jb 0x9bb6
movzbl %cl, %ecx
movl %ecx, 0x4c(%rsp)
movq %rbp, 0x50(%rsp)
movb $0x1, %cl
movl %ecx, 0x58(%rsp)
movl $0x1, 0x3c(%rsp)
jmp 0x9bef
movl $0xffffffff, 0x4c(%rsp) # imm = 0xFFFFFFFF
movl $0x0, 0x58(%rsp)
testb %al, %al
je 0x9d6e
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq 0x28(%rsp), %rcx
movl %ecx, %r12d
leaq 0x18575(%rip), %rdx     # 0x22180
movl %r12d, %r13d
decq %rbp
movzbl 0x1(%rbp), %ecx
incq %rbp
cmpl $0x2, (%rdx,%rcx,4)
jb 0x9c11
cmpb $0x1e, %al
sete %r15b
movq %rbp, 0x50(%rsp)
testb %cl, %cl
je 0x9d7d
movq 0x10(%rsp), %rbp
movq %rbp, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x8bb3
testl %eax, %eax
jne 0xa3af
leal 0x1(%r13), %r12d
movq %rbp, %rdi
movl %r12d, %esi
callq 0x91d8
movq %r13, 0x90(%rsp)
movl %r13d, %r10d
subl 0x28(%rsp), %r10d
subq $0x8, %rsp
movzbl 0x28(%rsp), %r11d
movzbl 0x60(%rsp), %r9d
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
movq %rax, %rdx
movl %r12d, %ecx
xorl %r8d, %r8d
pushq $0x0
pushq %r10
pushq %r11
callq 0xa4f0
addq $0x20, %rsp
testl %eax, %eax
jne 0xa3bf
movq 0x50(%rsp), %rbp
movb (%rbp), %al
addb $-0x10, %al
cmpb $0xd, %al
ja 0x9cca
movzbl %al, %eax
movl %eax, 0x1c(%rsp)
incl 0x3c(%rsp)
incq %rbp
movq %rbp, 0x50(%rsp)
jmp 0x9cd2
movl $0xffffffff, 0x1c(%rsp) # imm = 0xFFFFFFFF
movq 0x10(%rsp), %r13
movq %r13, %rdi
movl %r12d, %esi
callq 0x91d8
movb %r15b, 0x8(%rax)
movq %r13, %rdi
movl %r12d, %esi
callq 0x91d8
movb 0x20(%rsp), %cl
movb %cl, 0x9(%rax)
movq %r13, %rdi
movl %r12d, %esi
callq 0x91d8
movl 0x4c(%rsp), %ecx
movl %ecx, 0x10(%rax)
movq %r13, %rdi
movl %r12d, %esi
callq 0x91d8
movl 0x1c(%rsp), %esi
movl %esi, 0x14(%rax)
movq 0x90(%rsp), %r13
cmpl 0x28(%rsp), %r13d
je 0x9d56
movq 0x10(%rsp), %r15
movq %r15, %rdi
movl %esi, 0x1c(%rsp)
movl %r12d, %esi
callq 0x91d8
movl %r13d, 0x24(%rax)
movq %r15, %rdi
movl %r13d, %esi
callq 0x91d8
movl 0x1c(%rsp), %esi
movl %r12d, 0x28(%rax)
movb (%rbp), %al
movl %esi, 0x4c(%rsp)
testb %al, %al
leaq 0x1841a(%rip), %rdx     # 0x22180
jne 0x9c0b
jmp 0x9d80
movq 0x28(%rsp), %rax
movl %eax, %r12d
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0x9d80
movl %r13d, %r12d
movl %esi, %r13d
movl %r12d, 0x1c(%rsp)
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
cmpl $-0x1, 0x10(%rax)
jne 0x9db4
movq 0x10(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x91d8
cmpl $-0x1, 0x14(%rax)
je 0xa33b
movq 0x60(%rsp), %r12
movl 0x8(%r12), %r15d
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
movl %r15d, 0xc(%rax)
movl 0x8(%r12), %eax
testl %eax, %eax
jle 0xa39f
cmpl 0x68(%rsp), %eax
jg 0xa39f
cmpl $0xc, %r13d
je 0xa3dd
cmpl $0xb, %r13d
je 0xa3dd
movq 0x60(%rsp), %rax
movq 0x10(%rax), %r15
movq %r15, 0x40(%rsp)
movzbl (%r15), %eax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x9e8f
cmpl $0xfe, %eax
jne 0x9e32
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
movb $0x1, 0x22(%rax)
jmp 0x9e8f
addb $-0x30, %al
cmpb $0x9, %al
ja 0x9e84
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
movsbq (%r15), %rcx
movb $0x1, -0x18(%rcx,%rax)
cmpl $-0x1, %r12d
jne 0x9e5d
movsbl (%r15), %r12d
addl $-0x30, %r12d
movb (%rbp), %al
addb $0x10, %al
cmpb $0xa, %al
ja 0x9e84
movzbl %al, %eax
movsbq (%r15), %rcx
imulq $0x2c, %rax, %rax
addq 0xa0(%rsp), %rax
movl 0xc(%rsp), %edx
movl %edx, -0xc0(%rax,%rcx,4)
movb 0x1(%r15), %al
incq %r15
testb %al, %al
jne 0x9e32
movq 0x30(%rsp), %rax
movl (%rax), %ebp
incl %ebp
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
movl %ebp, 0x2c(%rax)
pxor %xmm0, %xmm0
movdqa %xmm0, 0xe0(%rsp)
movdqa %xmm0, 0xf0(%rsp)
xorl %eax, %eax
movl %eax, 0x100(%rsp)
movl %eax, 0xd0(%rsp)
movdqa %xmm0, 0xc0(%rsp)
movdqa %xmm0, 0xb0(%rsp)
movq 0x60(%rsp), %rax
movq 0x18(%rax), %r15
movq %r15, 0x40(%rsp)
cmpb $0x1c, (%r15)
jne 0xa13c
leaq 0x1(%r15), %rax
movq %rax, 0x40(%rsp)
movb 0x1(%r15), %cl
testb %cl, %cl
leaq 0x18271(%rip), %rsi     # 0x22180
je 0xa2c8
movl $0x0, 0x20(%rsp)
incq %rax
cmpb $0x9, %cl
je 0x9f38
movzbl %cl, %edx
cmpl $0x20, %edx
je 0x9f38
cmpb $0x1a, %cl
je 0x9f3c
cmpl $0x0, (%rsi,%rdx,4)
jne 0x9f3c
movb (%rax), %cl
jmp 0x9f1d
leaq -0x1(%rax), %rcx
movq %rcx, 0x40(%rsp)
movl $0x1, %ebp
movb $0x1, %r15b
leal -0x41(%rdx), %ecx
cmpl $0x2f, %ecx
ja 0x9f8c
movabsq $0x100000001, %rsi      # imm = 0x100000001
btq %rcx, %rsi
jb 0x9fbc
movabsq $0x20000000200, %rsi    # imm = 0x20000000200
btq %rcx, %rsi
jb 0x9fb4
movabsq $0x800000008000, %rsi   # imm = 0x800000008000
btq %rcx, %rsi
jae 0x9f8c
movl $0x2, %ebp
jmp 0x9fb9
testl %edx, %edx
je 0xa10e
cmpl $0x1a, %edx
jne 0xa129
movq %rax, 0x40(%rsp)
movl $0x4, %ebp
movl $0x2, %r13d
xorl %ecx, %ecx
jmp 0xa03d
movl $0x3, %ebp
xorl %r15d, %r15d
movq %rax, 0x40(%rsp)
movl %r15d, %r12d
xorl %r15d, %r15d
movl $0x3, %r13d
leaq 0x40(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0x27(%rsp), %rdx
callq 0xa75c
testl %eax, %eax
jne 0xa3cd
cmpb $0x0, 0x27(%rsp)
jne 0xa39f
movsd 0xa8(%rsp), %xmm0
testb %r15b, %r15b
jne 0xa025
movsd 0x10ffb(%rip), %xmm1    # 0x1b008
ucomisd %xmm0, %xmm1
ja 0xa39f
ucomisd 0x10ff1(%rip), %xmm0    # 0x1b010
ja 0xa39f
cvttsd2si %xmm0, %ecx
testb %r12b, %r12b
je 0xa03d
movl $0x1, %ebp
cmpl %ecx, 0x3c(%rsp)
jl 0xa39f
movl %ebp, %eax
notl %eax
orl %ecx, %eax
movl $0x2, %eax
cmovel %eax, %r13d
movl $0x0, %eax
cmovel %eax, %ebp
cmpl $0x3, %ebp
movl %ecx, 0x28(%rsp)
je 0xa081
cmpl $0x2, %ebp
jne 0xa08f
movslq %ecx, %rax
movl $0x1, 0xac(%rsp,%rax,4)
cmpl $0x9, 0x20(%rsp)
jge 0xa39f
incl 0x20(%rsp)
jmp 0xa08f
movslq %ecx, %rax
movl $0x1, 0xdc(%rsp,%rax,4)
movq 0x30(%rsp), %r12
movl (%r12), %r15d
movq %r12, %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x8bb3
testl %eax, %eax
jne 0xa3af
leal 0x1(%r15), %esi
movq %r12, %rdi
callq 0x91d8
cmpl $-0x1, %ebp
je 0xa0e1
movl $0x0, (%rax)
leal 0x2(%r15), %esi
movq 0x30(%rsp), %rdi
callq 0x91d8
movl %ebp, (%rax)
movl $0x3, %eax
cmpl $0x3, %r13d
je 0xa0f8
jmp 0xa10e
movl 0x28(%rsp), %ecx
movl %ecx, (%rax)
testl %ecx, %ecx
jne 0xa10e
movl $0x0, 0x28(%rsp)
movl $0x2, %eax
addl %eax, %r15d
movq 0x30(%rsp), %rdi
movl %r15d, %esi
callq 0x91d8
movl 0x28(%rsp), %ecx
movl %ecx, (%rax)
leaq 0x1806b(%rip), %rsi     # 0x22180
movq 0x40(%rsp), %rax
movb (%rax), %cl
testb %cl, %cl
jne 0x9f1d
jmp 0xa2c8
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r12d, %r12d
movl $0x1, %r13d
jmp 0x9fcd
cmpb $0x0, 0x20(%rsp)
leaq 0x18038(%rip), %r13     # 0x22180
jne 0xa2c8
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
movl $0x0, 0x30(%rax)
xorl %eax, %eax
movdqa 0x10ec3(%rip), %xmm3    # 0x1b030
movdqa 0x10ecb(%rip), %xmm4    # 0x1b040
movdqa 0x10ed3(%rip), %xmm5    # 0x1b050
movdqa 0x10edb(%rip), %xmm6    # 0x1b060
movdqa 0x110(%rsp), %xmm7
movq %rax, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, %xmm1
por %xmm4, %xmm1
pxor %xmm5, %xmm1
movdqa %xmm6, %xmm2
pcmpgtd %xmm1, %xmm2
pshufd $0xf5, %xmm1, %xmm1     # xmm1 = xmm1[1,1,3,3]
pcmpeqd %xmm7, %xmm1
pand %xmm2, %xmm1
movd %xmm1, %ecx
testb $0x1, %cl
je 0xa1cb
movl $0x5, 0x44(%r13,%rax,4)
pextrw $0x4, %xmm1, %ecx
testb $0x1, %cl
je 0xa1de
movl $0x5, 0x48(%r13,%rax,4)
por %xmm3, %xmm0
pxor %xmm5, %xmm0
movdqa %xmm6, %xmm1
pcmpgtd %xmm0, %xmm1
pshufd $0xf5, %xmm0, %xmm0     # xmm0 = xmm0[1,1,3,3]
pcmpeqd %xmm7, %xmm0
pand %xmm1, %xmm0
pextrw $0x0, %xmm0, %ecx
testb $0x1, %cl
je 0xa20e
movl $0x5, 0x4c(%r13,%rax,4)
pextrw $0x4, %xmm0, %ecx
testb $0x1, %cl
je 0xa221
movl $0x5, 0x50(%r13,%rax,4)
addq $0x4, %rax
cmpq $0xc, %rax
jne 0xa18e
movq %r14, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0xa8a2
movl %eax, (%rbx)
pxor %xmm0, %xmm0
movdqu %xmm0, 0x17f79(%rip)    # 0x221c4
movdqu %xmm0, 0x17f81(%rip)    # 0x221d4
movl $0x0, 0x17f87(%rip)     # 0x221e4
cmpl $0x0, (%rbx)
jne 0xa3ed
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
callq 0xb489
movl %eax, (%rbx)
testl %eax, %eax
jne 0xa3ed
movq 0x80(%rsp), %rax
movl (%rax), %esi
movq 0x30(%rsp), %rdi
xorl %edx, %edx
callq 0x8bb3
movl %eax, (%rbx)
testl %eax, %eax
jne 0xa3ed
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
movl 0x2c(%rax), %ecx
movq 0x80(%rsp), %rdi
movl (%rdi), %r8d
movl $0x1, %esi
movq 0x30(%rsp), %rdx
callq 0x8856
xorl %eax, %eax
cmpl $0x0, 0xb0(%rsp,%rax,4)
jne 0xa2e2
cmpl $0x0, 0xe0(%rsp,%rax,4)
jne 0xa39f
incq %rax
cmpq $0x9, %rax
jne 0xa2ca
movq 0x30(%rsp), %rax
movl (%rax), %ebp
movq 0x10(%rsp), %r15
movq %r15, %rdi
movl 0xc(%rsp), %r12d
movl %r12d, %esi
callq 0x91d8
subl 0x2c(%rax), %ebp
incl %ebp
movq %r15, %rdi
movl %r12d, %esi
callq 0x91d8
movl %ebp, 0x30(%rax)
movq 0x78(%rsp), %rax
incq %rax
movl 0x1c(%rsp), %ecx
movq %rcx, 0x28(%rsp)
cmpq 0x88(%rsp), %rax
jne 0x9a84
jmp 0xa355
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x91d8
movl 0x74(%rsp), %ecx
movl %ecx, 0xc(%rax)
jmp 0x9de7
movq 0x30(%rsp), %rdi
callq 0x8c00
testl %eax, %eax
jne 0x9723
movq 0x10(%rsp), %rdi
callq 0x8c00
testl %eax, %eax
jne 0x9723
xorl %r15d, %r15d
leaq (%r14,%r15), %rdi
callq 0x8c00
testl %eax, %eax
jne 0x9723
addq $0x20, %r15
cmpq $0x1000, %r15           # imm = 0x1000
jne 0xa37c
jmp 0x973e
movq %r14, %rdi
callq 0xa407
movl $0x2, (%rbx)
jmp 0xa3f5
movq %r14, %rdi
callq 0xa407
movl $0x1, (%rbx)
jmp 0xa3f5
movl %eax, %ebp
movq %r14, %rdi
callq 0xa407
movl %ebp, (%rbx)
jmp 0xa3f5
movq %r14, %rdi
callq 0xa407
movl $0x6, (%rbx)
jmp 0xa3f5
movq %r14, %rdi
callq 0xa407
movl $0x5, (%rbx)
jmp 0xa3f5
movq %r14, %rdi
callq 0xa407
movq 0x78(%rsp), %rax
incl %eax
movl %eax, 0x1aea6(%rip)     # 0x252a8
jmp 0x973b