// File: /workspace/github_cpp_makefile_star2_O1/AshOlogn[P]ash-language-interpreter/src/parser.cpp
// Function: evalLiteralGroup()
AbstractExpressionNode* evalLiteralGroup() {

  AbstractExpressionNode* next;
 
  //if grouped expression
  if(peek()->type == LEFT_PAREN) {

    Token* startGroupToken = consume(); //consume left parenthesis
    Token* endGroupToken;
    
    next = evalExpression();

		//throw error if ')' is not found
    if(peek()->type != RIGHT_PAREN) {
      throw ParseSyntaxError(startGroupToken->line+1, codeLines->at(startGroupToken->line), "(", "The parenthesized expression is missing a ')'");
    } else {
      endGroupToken = consume(); //consume right parenthesis
    }

    return new GroupedExpressionNode(next, startGroupToken->line+1, endGroupToken->line+1);

	} else if(peek()->type == LEFT_BRACKET) {

		//initialized array
		Token* leftBracketToken = consume();

		//insert the initial values into a list
		vector<AbstractExpressionNode*> initValues;

		//keep track of last line for error-handling purposes
		uint32_t currEndLine = leftBracketToken->line+1;

		while(peek()->type != RIGHT_BRACKET) {

			//if code ends without a closing ']', throw an error
			if(peek()->type == END) {
				throw ParseSyntaxError(leftBracketToken->line+1, currEndLine, getCodeLineBlock(leftBracketToken->line, currEndLine-1), "Expected ']' to terminate array initializer list");
			}

			//add element to the array and update end line
			AbstractExpressionNode* arrayElement = evalExpression();
			currEndLine = arrayElement->endLine;
			initValues.push_back(arrayElement);

			if(peek()->type == COMMA) {
				//consume , token and update end line
				Token* commaToken = consume(); 
				currEndLine = commaToken->line+1;
			} else if(peek()->type == RIGHT_BRACKET) {
				//do nothing, deal with it outside the while loop
			} else {
				//throw error if initializer list is not terminated
				throw ParseSyntaxError(leftBracketToken->line+1, peek()->line+1, getCodeLineBlock(leftBracketToken->line, peek()->line), 
																	"Expected ']' to terminate array initializer list");
			}
		}

		Token* rightBracketToken = consume(); //consume ']'

		uint32_t length = (uint32_t) initValues.size();
		AbstractExpressionNode** values = (AbstractExpressionNode**) malloc(sizeof(AbstractExpressionNode*) * length);

		//determine overall type of initialized array
		ParseDataType arrayType = arrayListType(&initValues);

		//copy references out of list into array, casting to overall type
		for(uint32_t i = 0; i < length; i++) {
			values[i] = new CastNode(initValues[i], arrayType, initValues[i]->startLine);
		}

		//convert fixed length into a LiteralNode
		ParseData len;
		len.type = UINT32_T;
		len.value.integer = length;

		return new ArrayNode(arrayType, true, new LiteralNode(len, -1), values, leftBracketToken->line+1, rightBracketToken->line+1);

	} else if(peek()->type == NEW) {

		//array or object instantiation
		Token* newToken = consume();

		if(!isTypeTokenType(peek()->type)) {
			throw ParseSyntaxError(newToken->line+1, getCodeLineBlock(newToken->line, newToken->line), "Expected type specifier as part of array instantiation");
		}

		ParseDataType type = ARRAY_T;
		Token* subtypeToken = consume();
		ParseDataType subtype = typeTokenConversion(subtypeToken->type);

		if(peek()->type != LEFT_BRACKET) {
			throw ParseSyntaxError(newToken->line+1, subtypeToken->line+1, getCodeLineBlock(newToken->line, subtypeToken->line), "Expected '[' as part of array instantiation");
		}

		Token* leftBracketToken = consume();
		AbstractExpressionNode* length = evalExpression();

		//make sure length expression is an integer
		if(!isIntParseDataType(length->evalType)) {

			string message = "Expected integer/char type for array length specifier, not ";
			message.append(toStringParseDataType(length->evalType));

			throw StaticTypeError(leftBracketToken->line+1, length->endLine+1, getCodeLineBlock(leftBracketToken->line, length->endLine), 
														copyString(message.c_str()));
		}


		if(peek()->type != RIGHT_BRACKET) {
			throw ParseSyntaxError(newToken->line+1, length->endLine+1, getCodeLineBlock(newToken->line, length->endLine), "Expected ']' as part of array instantiation");
		}

		Token* rightBracketToken = consume();

		//now return ArrayNode with appropriate information
		return new ArrayNode(subtype, false, length, NULL, newToken->line, rightBracketToken->line);

  } else if(peek()->type == VARIABLE) {

		Token* variable = consume();

		//make sure variable is already declared
		string variableName((char*) variable->lexeme);
		if(!symbolTable->isDeclared(variableName)) {
			throw StaticVariableScopeError(variable->line+1, variable->lexeme, getCodeLineBlock(variable->line, variable->line), false);
		}

		//get variable type
		ParseDataType varType = symbolTable->get(variableName).type;

		if(peek()->type == LEFT_PAREN) {

			//function call case
			Token* leftParenToken = consume(); //consume (

			//make sure this variable is of function type
			if(varType != FUN_T) {
				throw StaticTypeError(variable->line+1, leftParenToken->line+1, getCodeLineBlock(variable->line, leftParenToken->line), "function call", varType);
			}
			
			//get function information
			Function* function = (Function*) (symbolTable->get(variableName).value.allocated);

			uint32_t numArgs = function->numArgs;
			ParseDataType* argTypes = function->argTypes;
			ParseDataType* argSubTypes = function->argSubTypes;

			//read in arguments
			AbstractExpressionNode** arguments = (AbstractExpressionNode**) malloc(sizeof(AbstractExpressionNode*) * numArgs);
			Token* lastCommaToken;

			for(uint32_t i = 0; i < numArgs; i++) {

				//if next item is not an argument, throw error
				if(peek()->type == END) {
					uint32_t startLine = variable->line+1;
					uint32_t endLine = (i > 0) ? arguments[i-1]->endLine+1 : leftParenToken->line+1;
					throw ParseSyntaxError(startLine, endLine, getCodeLineBlock(startLine-1, endLine-1), "Too few arguments provided to this function call");
				}

				//get next argument
				arguments[i] = evalExpression();

				//make sure argument is of the right type
				if(argTypes[i] == ARRAY_T && arguments[i]->evalType == ARRAY_T) {

					//both args are arrays, so check member types
					if(!typecheckImplicitCastExpression(arguments[i]->subType, argSubTypes[i])) {
						
						uint32_t startLine = variable->line+1;
						uint32_t endLine = arguments[i]->endLine+1;

						string message = "Cannot implicitly convert a ";
						message.append(toStringParseDataType(arguments[i]->subType));
						message.append(" array argument to ");
						message.append(toStringParseDataType(argSubTypes[i]));
						message.append(" array type");

						throw StaticTypeError(startLine, endLine, getCodeLineBlock(startLine-1, endLine-1), copyString(message.c_str()));
					}

				} else {

					//regular type check
					if(!typecheckImplicitCastExpression(arguments[i]->evalType, argTypes[i])) {

						uint32_t startLine = variable->line+1;
						uint32_t endLine = arguments[i]->endLine+1;

						string message = "Cannot implicitly convert a ";
						message.append(toStringParseDataType(arguments[i]->evalType));
						message.append(" argument to ");
						message.append(toStringParseDataType(argTypes[i]));
						message.append(" type");

						throw StaticTypeError(startLine, endLine, getCodeLineBlock(startLine-1, endLine-1), copyString(message.c_str()));
					}
				}

				if(i < numArgs-1) {
					if(peek()->type != COMMA) {
						throw ParseSyntaxError(variable->line+1, arguments[i]->endLine+1, getCodeLineBlock(variable->line, arguments[i]->endLine),
																	"Expected comma to separate function arguments");
					}
					lastCommaToken = consume(); //consume ,
				}
			}

			if(peek()->type != RIGHT_PAREN) {
				throw ParseSyntaxError(variable->line+1, lastCommaToken->line+1, getCodeLineBlock(variable->line, lastCommaToken->line),
															"Expected ')' to terminate argument list");
			}
			Token* rightParenToken = consume(); //consume )

			//now return FunctionExpressionNode
			return new FunctionExpressionNode(numArgs, arguments, function, symbolTable, variable->line+1, rightParenToken->line+1);

		} else {

			//simple value substitution case
			return new VariableNode(variableName, symbolTable, variable->line+1);
		}
  
  } else {

    Token* literal = consume();
    ParseData p = {typeTokenConversion(literal->type), literal->value};
    return new LiteralNode(p, literal->line+1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
callq 0x178eb
cmpl $0x0, (%rax)
je 0x1a620
callq 0x178eb
cmpl $0x2, (%rax)
jne 0x1a66f
callq 0x1789c
movq %rax, %rbx
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %r14
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movl 0x10(%rax), %r12d
incl %r12d
leaq -0x88(%rbp), %r15
callq 0x178eb
cmpl $0x3, (%rax)
je 0x1a71f
callq 0x178eb
cmpl $0x4e, (%rax)
je 0x1ab15
callq 0x1ce9f
movq %rax, -0x88(%rbp)
movl 0xc(%rax), %r12d
movq -0x58(%rbp), %rsi
cmpq -0x50(%rbp), %rsi
je 0x1a575
movq %rax, (%rsi)
addq $0x8, -0x58(%rbp)
jmp 0x1a580
movq %r14, %rdi
movq %r15, %rdx
callq 0x1dba8
callq 0x178eb
cmpl $0x2b, (%rax)
jne 0x1a598
callq 0x1789c
movl 0x10(%rax), %r12d
incl %r12d
jmp 0x1a535
callq 0x178eb
cmpl $0x3, (%rax)
je 0x1a535
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movq %rbx, %r13
movl 0x10(%rbx), %r15d
callq 0x178eb
movl 0x10(%rax), %r12d
movl 0x10(%r13), %ebx
callq 0x178eb
movl 0x10(%rax), %esi
movl %ebx, %edi
callq 0x17961
incl %r15d
incl %r12d
leaq 0x10ff1(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
leaq 0x8bb4(%rip), %rax      # 0x231ad
movq %rax, 0x18(%r14)
movl %r15d, 0x20(%r14)
movl %r12d, 0x24(%r14)
leaq 0x10fec(%rip), %rsi     # 0x2b5f8
movq 0x119c5(%rip), %rdx     # 0x2bfd8
movq %r14, %rdi
callq 0x4350
jmp 0x1b202
callq 0x1789c
movq %rax, %rbx
callq 0x1ce9f
movq %rax, %r15
callq 0x178eb
cmpl $0x1, (%rax)
jne 0x1aca7
callq 0x1789c
movq %rax, %r12
movl $0x20, %edi
callq 0x4210
movq %rax, %r14
movl 0x10(%rbx), %edx
incl %edx
movl 0x10(%r12), %ecx
incl %ecx
movq %rax, %rdi
movq %r15, %rsi
callq 0x9714
jmp 0x1ab00
callq 0x178eb
cmpl $0x49, (%rax)
jne 0x1a80b
callq 0x1789c
movq %rax, %r15
callq 0x178eb
movl (%rax), %edi
callq 0x636c
testb %al, %al
je 0x1adfb
callq 0x1789c
movq %rax, %rbx
movl (%rax), %edi
callq 0x8256
movl %eax, %r12d
callq 0x178eb
cmpl $0x2, (%rax)
jne 0x1ae45
callq 0x1789c
movq %rax, %r14
callq 0x1ce9f
movq %rax, %rbx
movl 0x10(%rax), %edi
callq 0x80ff
testb %al, %al
je 0x1ae8e
callq 0x178eb
cmpl $0x3, (%rax)
jne 0x1af38
callq 0x1789c
movq %rax, %r13
movl $0x30, %edi
callq 0x4210
movq %rax, %r14
movl 0x10(%r15), %r9d
movl 0x10(%r13), %eax
movl %eax, (%rsp)
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
movq %rbx, %rcx
xorl %r8d, %r8d
callq 0x9326
jmp 0x1ab00
movq %rbx, -0x38(%rbp)
callq 0x1789c
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %r14
movq 0x8(%r14), %r15
subq (%r14), %r15
movq %r15, %rbx
sarq $0x3, %rbx
movl %ebx, %eax
movq %rax, -0x30(%rbp)
leaq (,%rax,8), %rdi
callq 0x4290
movq %rax, %r12
movq %r14, %rdi
callq 0x177fc
movl %eax, %r13d
shrq $0x3, %r15
testl %r15d, %r15d
je 0x1a79c
movl %ebx, %r15d
xorl %ebx, %ebx
movl $0x28, %edi
callq 0x4210
movq %rax, %r14
movq -0x60(%rbp), %rax
movq (%rax,%rbx,8), %rsi
movl 0x8(%rsi), %ecx
movq %r14, %rdi
movl %r13d, %edx
callq 0x903e
movq %r14, (%r12,%rbx,8)
incq %rbx
cmpq %rbx, %r15
jne 0x1a76d
movl $0x30, %edi
callq 0x4210
movq %rax, %r14
movl $0x28, %edi
callq 0x4210
movq %rax, %r15
movq %rax, %rdi
movl $0x6, %esi
movq -0x30(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x969e
movq -0x38(%rbp), %rax
movl 0x10(%rax), %r9d
incl %r9d
movq -0x68(%rbp), %rax
movl 0x10(%rax), %eax
incl %eax
movl %eax, (%rsp)
movq %r14, %rdi
movl %r13d, %esi
movl $0x1, %edx
movq %r15, %rcx
movq %r12, %r8
callq 0x9326
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
jne 0x1aafb
jmp 0x1ab00
callq 0x178eb
movl (%rax), %ebx
callq 0x1789c
cmpl $0x3b, %ebx
jne 0x1a94f
movq %rax, -0x30(%rbp)
movq 0x18(%rax), %rsi
leaq -0x60(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x40c0
movq 0x11a51(%rip), %r14     # 0x2c290
leaq -0x108(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %rdi
callq 0x8ac2
leaq -0x118(%rbp), %rsi
movq %r14, %rdi
callq 0x16646
movl %eax, %r14d
movq -0x118(%rbp), %rdi
cmpq %r15, %rdi
je 0x1a884
callq 0x41e0
testb %r14b, %r14b
je 0x1b0a7
movq 0x119fc(%rip), %r14     # 0x2c290
leaq -0xe8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %rdi
callq 0x8ac2
leaq -0xf8(%rbp), %rsi
movq %r14, %rdi
callq 0x1669a
movl %eax, %r14d
movq -0xf8(%rbp), %rdi
cmpq %r15, %rdi
je 0x1a8d9
callq 0x41e0
callq 0x178eb
cmpl $0x0, (%rax)
je 0x1a985
movl $0x40, %edi
callq 0x4210
movq %rax, %r14
leaq -0xa8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %rdi
callq 0x8ac2
movq 0x11973(%rip), %rdx     # 0x2c290
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ecx
incl %ecx
leaq -0xb8(%rbp), %rsi
movq %r14, %rdi
callq 0x943a
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x1aaee
callq 0x41e0
jmp 0x1aaee
movl (%rax), %edi
movq %rax, %rbx
callq 0x8256
movl %eax, %r15d
movq 0x8(%rbx), %r12
movl $0x28, %edi
callq 0x4210
movq %rax, %r14
movl 0x10(%rbx), %ecx
incl %ecx
movq %rax, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x969e
jmp 0x1ab00
callq 0x1789c
movq %rax, %r12
cmpl $0xd, %r14d
jne 0x1b11d
movq 0x118f2(%rip), %r14     # 0x2c290
leaq -0xc8(%rbp), %r15
movq %r15, -0x10(%r15)
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %rdi
callq 0x8ac2
leaq -0xd8(%rbp), %rsi
movq %r14, %rdi
callq 0x1669a
movq %rdx, %r14
movq -0xd8(%rbp), %rdi
cmpq %r15, %rdi
je 0x1a9e3
callq 0x41e0
movl (%r14), %r13d
movq 0x8(%r14), %rbx
movq %r14, -0x98(%rbp)
movq 0x10(%r14), %rax
movq %rax, -0x68(%rbp)
leaq (,%r13,8), %rdi
callq 0x4290
movq %rax, -0x38(%rbp)
testq %r13, %r13
je 0x1aa99
movq %r12, -0x90(%rbp)
leal -0x1(%r13), %r15d
xorl %r12d, %r12d
callq 0x178eb
cmpl $0x4e, (%rax)
je 0x1ab7b
callq 0x1ce9f
movq -0x38(%rbp), %rcx
movq %rax, (%rcx,%r12,8)
movl (%rbx,%r12,4), %esi
cmpl $0xc, %esi
jne 0x1aa64
cmpl $0xc, 0x10(%rax)
jne 0x1aa64
movl 0x14(%rax), %edi
movq -0x68(%rbp), %rax
movl (%rax,%r12,4), %esi
callq 0x1607f
testb %al, %al
jne 0x1aa74
jmp 0x1af9e
movl 0x10(%rax), %edi
callq 0x1607f
testb %al, %al
je 0x1ab98
cmpq %r15, %r12
jae 0x1aa8f
callq 0x178eb
cmpl $0x2b, (%rax)
jne 0x1ad00
callq 0x1789c
movq %rax, %r14
incq %r12
cmpq %r12, %r13
jne 0x1aa21
jmp 0x1aa99
callq 0x178eb
cmpl $0x1, (%rax)
jne 0x1b197
callq 0x1789c
movq %rax, %r12
movl $0x48, %edi
callq 0x4210
movq %rax, %r14
movq 0x117cd(%rip), %r8      # 0x2c290
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r9d
incl %r9d
movl 0x10(%r12), %eax
incl %eax
movl %eax, (%rsp)
movq %r14, %rdi
movl %r13d, %esi
movq -0x38(%rbp), %rdx
movq -0x98(%rbp), %rcx
callq 0x9626
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1ab00
callq 0x41e0
movq %r14, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movl 0x10(%rbx), %ebx
leal -0x1(%r12), %esi
movl %ebx, %edi
callq 0x17961
incl %ebx
leaq 0x10a96(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
leaq 0x8659(%rip), %rax      # 0x231ad
movq %rax, 0x18(%r14)
movl %ebx, 0x20(%r14)
movl %r12d, 0x24(%r14)
leaq 0x10a91(%rip), %rsi     # 0x2b5f8
movq 0x1146a(%rip), %rdx     # 0x2bfd8
movq %r14, %rdi
callq 0x4350
jmp 0x1b202
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ebx
testq %r12, %r12
jne 0x1ad77
addq $0x10, -0x90(%rbp)
jmp 0x1ad8d
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r15d
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rax
movl 0xc(%rax), %r14d
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x871f(%rip), %rsi      # 0x232da
leaq 0x8734(%rip), %rdx      # 0x232f6
leaq -0x88(%rbp), %rdi
callq 0x5ce4
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rax
movl 0x10(%rax), %edi
callq 0x82a8
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x43a0
leaq 0x8709(%rip), %rsi      # 0x232fd
leaq -0x88(%rbp), %rdi
callq 0x43a0
movl (%rbx,%r12,4), %edi
callq 0x82a8
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x43a0
leaq 0x8533(%rip), %rsi      # 0x23152
leaq -0x88(%rbp), %rdi
callq 0x43a0
movl $0x38, %edi
callq 0x4110
movq %rax, %r12
movl %r15d, %edi
movl %r14d, %esi
callq 0x17961
movq %rax, %rbx
movq -0x88(%rbp), %rdi
callq 0x176b0
incl %r15d
incl %r14d
leaq 0x109b1(%rip), %rcx     # 0x2b610
addq $0x10, %rcx
movq %rcx, (%r12)
movw $0x100, 0x8(%r12)       # imm = 0x100
movq %rbx, 0x10(%r12)
movq $0x0, 0x18(%r12)
movq %rax, 0x20(%r12)
movl %r15d, 0x28(%r12)
movl %r14d, 0x2c(%r12)
leaq 0x109a5(%rip), %rsi     # 0x2b638
movq 0x1133e(%rip), %rdx     # 0x2bfd8
movq %r12, %rdi
callq 0x4350
jmp 0x1b202
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movl 0x10(%rbx), %ebx
movq 0x115ca(%rip), %rdi     # 0x2c288
movq %rbx, %rsi
callq 0x1d630
incl %ebx
movq (%rax), %rax
leaq 0x108fe(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
leaq 0x3ccc(%rip), %rax      # 0x1e9b0
movq %rax, 0x10(%r14)
leaq 0x8490(%rip), %rax      # 0x2317f
movq %rax, 0x18(%r14)
movl %ebx, 0x20(%r14)
movl %ebx, 0x24(%r14)
jmp 0x1af88
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ebx
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rax
movl 0xc(%rax), %r15d
movl %ebx, %edi
movl %r15d, %esi
callq 0x17961
incl %r15d
incl %ebx
leaq 0x1089a(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
leaq 0x85bb(%rip), %rax      # 0x2330b
movq %rax, 0x18(%r14)
movl %ebx, 0x20(%r14)
movl %r15d, 0x24(%r14)
leaq 0x10895(%rip), %rsi     # 0x2b5f8
movq 0x1126e(%rip), %rdx     # 0x2bfd8
movq %r14, %rdi
callq 0x4350
jmp 0x1b202
decl %r12d
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rax
addq $0xc, %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movl (%rax), %r15d
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movl %ebx, %edi
movl %r15d, %esi
callq 0x17961
incl %ebx
incl %r15d
leaq 0x10816(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
leaq 0x84d5(%rip), %rax      # 0x232a9
movq %rax, 0x18(%r14)
movl %ebx, 0x20(%r14)
movl %r15d, 0x24(%r14)
leaq 0x10811(%rip), %rsi     # 0x2b5f8
movq 0x111ea(%rip), %rdx     # 0x2bfd8
movq %r14, %rdi
callq 0x4350
jmp 0x1b202
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movl 0x10(%r15), %ebx
movl %ebx, %edi
movl %ebx, %esi
callq 0x17961
incl %ebx
leaq 0x107b2(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
leaq 0x83a6(%rip), %rax      # 0x231de
movq %rax, 0x18(%r14)
movl %ebx, 0x20(%r14)
jmp 0x1af84
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movl 0x10(%r15), %r15d
movl 0x10(%rbx), %ebx
movl %r15d, %edi
movl %ebx, %esi
callq 0x17961
incl %ebx
incl %r15d
leaq 0x10761(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
leaq 0x838c(%rip), %rax      # 0x23215
jmp 0x1af7c
leaq -0x50(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x83a4(%rip), %rsi      # 0x23241
leaq 0x83d8(%rip), %rdx      # 0x2327c
leaq -0x60(%rbp), %rdi
callq 0x5ce4
movl 0x10(%rbx), %edi
callq 0x82a8
leaq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x43a0
movl $0x38, %edi
callq 0x4110
movq %rax, %r15
movl 0x10(%r14), %r14d
movl 0xc(%rbx), %ebx
movl %r14d, %edi
movl %ebx, %esi
callq 0x17961
movq %rax, %r12
movq -0x60(%rbp), %rdi
callq 0x176b0
incl %r14d
incl %ebx
leaq 0x10719(%rip), %rcx     # 0x2b610
addq $0x10, %rcx
movq %rcx, (%r15)
movw $0x100, 0x8(%r15)       # imm = 0x100
movq %r12, 0x10(%r15)
movq $0x0, 0x18(%r15)
movq %rax, 0x20(%r15)
movl %r14d, 0x28(%r15)
movl %ebx, 0x2c(%r15)
leaq 0x10714(%rip), %rsi     # 0x2b638
movq 0x110ad(%rip), %rdx     # 0x2bfd8
movq %r15, %rdi
callq 0x4350
jmp 0x1b202
movl $0x28, %edi
callq 0x4110
movq %rax, %r14
movl 0x10(%r15), %r15d
movl 0xc(%rbx), %ebx
movl %r15d, %edi
movl %ebx, %esi
callq 0x17961
incl %ebx
incl %r15d
leaq 0x1066e(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r14)
movq %rax, 0x8(%r14)
movq $0x0, 0x10(%r14)
leaq 0x8301(%rip), %rax      # 0x2327d
movq %rax, 0x18(%r14)
movl %r15d, 0x20(%r14)
movl %ebx, 0x24(%r14)
leaq 0x10669(%rip), %rsi     # 0x2b5f8
movq 0x11042(%rip), %rdx     # 0x2bfd8
movq %r14, %rdi
callq 0x4350
movq -0x30(%rbp), %rax
movl 0x10(%rax), %ebx
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rax
movl 0xc(%rax), %r14d
leaq -0x78(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x831a(%rip), %rsi      # 0x232da
leaq 0x832f(%rip), %rdx      # 0x232f6
leaq -0x88(%rbp), %rdi
callq 0x5ce4
movq -0x38(%rbp), %rax
movq (%rax,%r12,8), %rax
movl 0x14(%rax), %edi
callq 0x82a8
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x43a0
leaq 0x82fe(%rip), %rsi      # 0x232f7
leaq -0x88(%rbp), %rdi
callq 0x43a0
movq -0x68(%rbp), %rax
movl (%rax,%r12,4), %edi
callq 0x82a8
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x43a0
leaq 0x807e(%rip), %rsi      # 0x230a6
leaq -0x88(%rbp), %rdi
callq 0x43a0
movl $0x38, %edi
callq 0x4110
movq %rax, %r15
movl %ebx, %edi
movl %r14d, %esi
callq 0x17961
movq %rax, %r12
movq -0x88(%rbp), %rdi
callq 0x176b0
incl %ebx
incl %r14d
leaq 0x105aa(%rip), %rcx     # 0x2b610
addq $0x10, %rcx
movq %rcx, (%r15)
movw $0x100, 0x8(%r15)       # imm = 0x100
movq %r12, 0x10(%r15)
movq $0x0, 0x18(%r15)
movq %rax, 0x20(%r15)
movl %ebx, 0x28(%r15)
movl %r14d, 0x2c(%r15)
leaq 0x105a5(%rip), %rsi     # 0x2b638
movq 0x10f3e(%rip), %rdx     # 0x2bfd8
movq %r15, %rdi
callq 0x4350
jmp 0x1b202
movl $0x38, %edi
callq 0x4110
movq %rax, %r14
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r15d
movq 0x18(%rax), %rsi
leaq -0x138(%rbp), %rdi
leaq -0x88(%rbp), %rdx
callq 0x40c0
movq -0x30(%rbp), %rax
movl 0x10(%rax), %edi
movb $0x1, %r12b
movl %edi, %esi
callq 0x17961
incl %r15d
leaq -0x138(%rbp), %rdx
movq %r14, %rdi
movl %r15d, %esi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0x1d65a
xorl %r12d, %r12d
leaq 0x1056f(%rip), %rsi     # 0x2b678
leaq -0x1552a(%rip), %rdx    # 0x5be6
movq %r14, %rdi
callq 0x4350
jmp 0x1b202
movl $0x38, %edi
callq 0x4110
movq %rax, %r15
movq -0x30(%rbp), %rax
movq %r12, %rcx
movl 0x10(%rax), %r12d
movl 0x10(%rcx), %ebx
movl %r12d, %edi
movl %ebx, %esi
callq 0x17961
incl %ebx
incl %r12d
leaq 0x104c2(%rip), %rcx     # 0x2b610
addq $0x10, %rcx
movq %rcx, (%r15)
movw $0x0, 0x8(%r15)
movq %rax, 0x10(%r15)
leaq 0x8165(%rip), %rax      # 0x232cc
movq %rax, 0x18(%r15)
movq $0x0, 0x20(%r15)
movl %r12d, 0x28(%r15)
movl %ebx, 0x2c(%r15)
movl %r14d, 0x30(%r15)
leaq 0x104b2(%rip), %rsi     # 0x2b638
movq 0x10e4b(%rip), %rdx     # 0x2bfd8
movq %r15, %rdi
callq 0x4350
jmp 0x1b202
movl $0x28, %edi
callq 0x4110
movq %rax, %r15
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r12d
movl 0x10(%r14), %ebx
movl %r12d, %edi
movl %ebx, %esi
callq 0x17961
incl %ebx
incl %r12d
leaq 0x1040a(%rip), %rcx     # 0x2b5d0
addq $0x10, %rcx
movq %rcx, (%r15)
movq %rax, 0x8(%r15)
movq $0x0, 0x10(%r15)
leaq 0x8159(%rip), %rax      # 0x23339
movq %rax, 0x18(%r15)
movl %r12d, 0x20(%r15)
movl %ebx, 0x24(%r15)
leaq 0x10405(%rip), %rsi     # 0x2b5f8
movq 0x10dde(%rip), %rdx     # 0x2bfd8
movq %r15, %rdi
callq 0x4350
movq %rax, %rbx
movq %r15, %rdi
jmp 0x1b210
movq %rax, %rbx
movq %r12, %rdi
callq 0x4190
jmp 0x1b312
jmp 0x1b21c
movq %rax, %rbx
movq %r15, %rdi
jmp 0x1b32f
movq %rax, %rbx
movq %r15, %rdi
callq 0x4190
jmp 0x1b2a8
jmp 0x1b298
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
jmp 0x1b2e0
jmp 0x1b355
movq %rax, %rbx
leaq -0x128(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1b26a
callq 0x41e0
jmp 0x1b26a
movq %rax, %rbx
movb $0x1, %r12b
testb %r12b, %r12b
jne 0x1b32c
jmp 0x1b358
jmp 0x1b355
jmp 0x1b355
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x1b29b
callq 0x41e0
jmp 0x1b29b
movq %rax, %rbx
movq %r14, %rdi
jmp 0x1b31e
jmp 0x1b355
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r13, %rdi
jne 0x1b397
jmp 0x1b39c
jmp 0x1b30f
jmp 0x1b355
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
jmp 0x1b2e0
jmp 0x1b355
jmp 0x1b2ff
jmp 0x1b2ef
movq %rax, %rbx
movq -0x118(%rbp), %rdi
cmpq %r15, %rdi
jne 0x1b31e
jmp 0x1b358
jmp 0x1b2ff
jmp 0x1b355
jmp 0x1b2ff
jmp 0x1b349
movq %rax, %rbx
jmp 0x1b39c
jmp 0x1b355
jmp 0x1b355
jmp 0x1b329
jmp 0x1b349
movq %rax, %rbx
movq %r14, %rdi
callq 0x4190
jmp 0x1b39c
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r13, %rdi
je 0x1b358
callq 0x41e0
jmp 0x1b358
jmp 0x1b355
jmp 0x1b355
movq %rax, %rbx
movq %r14, %rdi
callq 0x4190
jmp 0x1b358
movq %rax, %rbx
movq %r15, %rdi
callq 0x41e0
jmp 0x1b37f
jmp 0x1b38b
jmp 0x1b38b
jmp 0x1b38b
movq %rax, %rbx
movq %r14, %rdi
jmp 0x1b397
jmp 0x1b38b
jmp 0x1b37c
movq %rax, %rbx
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x1b397
jmp 0x1b39c
jmp 0x1b36b
jmp 0x1b38b
movq %rax, %rbx
movq %r14, %rdi
callq 0x4190
jmp 0x1b38e
jmp 0x1b38b
jmp 0x1b38b
movq %rax, %rbx
movq %r14, %rdi
callq 0x41e0
jmp 0x1b38e
jmp 0x1b38b
movq %rax, %rbx
movq -0x60(%rbp), %rdi
testq %rdi, %rdi
je 0x1b39c
callq 0x41e0
movq %rbx, %rdi
callq 0x4380