// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: resolve_type_tags
static void resolve_type_tags(script_t* script, void* vexp)
{
	expr_t* exp = vexp;
	
	// NOTE: Pathetic attempt at providing proper
	// line information for type warnings
	g_file = exp->ctx.file;
	g_line = exp->ctx.line;
	
	switch(exp->type)
	{
		case EXP_ATOMIC:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			resolve_type_tags(script, exp->atomx);
		} break;

		case EXP_DOT: case EXP_COLON:
		{
			resolve_type_tags(script, exp->dotx.value);
			if (exp->dotx.value->tag->type != TAG_STRUCT)
				error_defer_e(exp->dotx.value, "Attempted to access members in non-struct type\n");
			else
			{
				char found = 0;

				type_tag_t* tag = exp->dotx.value->tag;
				for (int i = 0; i < tag->ds.members.length; ++i)
				{
					type_tag_member_t* mem = vec_get(&tag->ds.members, i);
					if (strcmp(mem->name, exp->dotx.name) == 0)
					{
						exp->tag = mem->type;
						found = 1;

						if (exp->type == EXP_COLON) error_defer_e(exp, "Attempted to use ':' operator to access member value; use '.' instead\n");
						break;
					}
				}

				if (!found)
				{
					func_decl_t* decl = get_struct_member_function(script, exp->dotx.value->tag->ds.name, exp->dotx.name);
					if (decl) found = 1;
					if (exp->type == EXP_DOT) error_defer_e(exp, "Attempted to use '.' operator to access member function; use ':' instead\n");

					if (!found)
						error_exit_e(exp, "Attempted to access non-existent member '%s' in struct %s\n", exp->dotx.name, tag->ds.name);
					else
						exp->tag = decl->tag;
				}
			}
		} break;
		
		case EXP_NULL:
		{
			exp->tag = create_type_tag(script, TAG_DYNAMIC);
		} break;
		
		case EXP_STRUCT_DECL:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			
			for(int i = 0; i < exp->struct_tag->ds.members.length; ++i)
			{
				type_tag_member_t* mem = vec_get(&exp->struct_tag->ds.members, i);
				if(mem->default_value)
				{	
					resolve_type_tags(script, mem->default_value);
					if(!compare_type_tags(mem->type, mem->default_value->tag))
						error_defer_e(mem->default_value, "Type of default value does not match type of member variable '%s'\n", mem->name);
				}
			}
		} break;
		
		case EXP_STRUCT_NEW:
		{
			exp->tag = exp->newx.type;
			
			for(int i = 0; i < exp->newx.init.length; ++i)
			{
				expr_t* init = vec_get_value(&exp->newx.init, i, expr_t*);
				
				int member_index = get_struct_type_member_index(exp->newx.type, init->binx.lhs->varx.name);
				resolve_type_tags(script, init->binx.rhs);
					
				type_tag_member_t* mem = vec_get(&exp->newx.type->ds.members, member_index);
				if(!compare_type_tags(init->binx.rhs->tag, mem->type))
					error_defer_e(init->binx.rhs, "Type of initializer does not match type of member '%s' being initialized\n", mem->name);
			}
		} break;
			
		case EXP_NUMBER:
		{
			exp->tag = create_type_tag(script, TAG_NUMBER);
		} break;
		
		case EXP_STRING:
		{
			exp->tag = create_type_tag(script, TAG_STRING);
		} break;
		
		case EXP_BOOL:
		{
			exp->tag = create_type_tag(script, TAG_BOOL);
		} break;
		
		case EXP_CHAR:
		{
			exp->tag = create_type_tag(script, TAG_CHAR);
		} break;
		
		case EXP_VAR:
		{
			if(!exp->varx.decl)
			{
				func_decl_t* decl = reference_function(script, exp->varx.name);
				if(decl) exp->tag = decl->tag;
				else error_exit_e(exp, "Referencing undeclared function/variable '%s'\n", exp->varx.name); 
			}
			else
				exp->tag = exp->varx.decl->tag;
		} break;
		
		case EXP_WRITE:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			resolve_type_tags(script, exp->write);
		} break;
		
		case EXP_UNARY:
		{
			resolve_type_tags(script, exp->unaryx.rhs);
			switch(exp->unaryx.op)
			{
				case TOK_NOT:
				{
					if(exp->unaryx.rhs->tag->type != TAG_BOOL)
						error_defer_e(exp->unaryx.rhs, "Attempted to use unary ! operator on non-boolean value\n");
					exp->tag = create_type_tag(script, TAG_BOOL);
				} break;
				
				case TOK_MINUS:
				{
					if(exp->unaryx.rhs->tag->type != TAG_NUMBER)
						error_defer_e(exp->unaryx.rhs, "Attempted to use unary - operator on non-numerical value\n");
					exp->tag = create_type_tag(script, TAG_NUMBER);
				} break;
				
				default:
					error_exit_e(exp, "No type resolution for %s operator\n", g_token_names[exp->unaryx.op]);
					break;
			}
		} break;
		
		case EXP_BINARY:
		{
			resolve_type_tags(script, exp->binx.lhs);
			resolve_type_tags(script, exp->binx.rhs);
		
			// NOTE: assignment operation lhs does not need to be
			// number
			if(exp->binx.op != TOK_ASSIGN)
			{ 
				if(!compare_type_tags(exp->binx.lhs->tag, exp->binx.rhs->tag) || !is_type_tag(exp->binx.lhs->tag, TAG_NUMBER))
				{	
					if(exp->binx.op != TOK_EQUALS && exp->binx.op != TOK_NOTEQUAL && 
						exp->binx.op != TOK_LAND && exp->binx.op != TOK_LOR)
						error_defer_e(exp->binx.lhs, "Invalid types in binary %s operation\n", g_token_names[exp->binx.op]);
				}
			}
			else
			{
				// NOTE: If the type of the lhs is unknown, set it to the type of the rhs
				// (since this is an assignment, after all)
				if (exp->binx.lhs->tag->type == TAG_UNKNOWN)
				{
					exp->binx.lhs->tag = exp->binx.rhs->tag;

					var_decl_t* decl = get_root_var_decl(exp->binx.lhs);
					if(decl)
						decl->tag = exp->binx.lhs->tag;
				}
				else if (!are_assignment_types_valid(exp->binx.lhs, exp->binx.rhs))
					error_defer_e(exp->binx.lhs, "Type of lhs in assignment operation does not match the type of rhs\n");
			}

			switch(exp->binx.op)
			{
				case TOK_PLUS:
				case TOK_MINUS:
				case TOK_MUL:
				case TOK_DIV: 
				case TOK_MOD: exp->tag = create_type_tag(script, TAG_NUMBER); break;
				
				case TOK_LTE:
				case TOK_GTE:
				case TOK_LT:
				case TOK_GT:
				case TOK_EQUALS:
				case TOK_NOTEQUAL:
				case TOK_LAND:
				case TOK_LOR: exp->tag = create_type_tag(script, TAG_BOOL); break;
				
				default: exp->tag = create_type_tag(script, TAG_VOID); break;
			}
		} break;
		
		case EXP_CALL:
		{
			resolve_type_tags(script, exp->callx.func);
			if(exp->callx.func->tag->type == TAG_DYNAMIC)
				warn_e(exp, WARN_CALL_DYNAMIC);
			
			if(exp->callx.func->tag->type != TAG_FUNC && exp->callx.func->tag->type != TAG_DYNAMIC)
				error_defer_e(exp, "Attempting to call something that is not a function\n");
			
			if(exp->callx.func->tag->type != TAG_DYNAMIC && exp->callx.args.length != exp->callx.func->tag->func.arg_types.length)
				error_defer_e(exp, "Passed %d argument(s) into function expecting %d argument(s)\n", 
				exp->callx.args.length, exp->callx.func->tag->func.arg_types.length);
			else
			{
				for(int i = 0; i < exp->callx.args.length; ++i)
				{
					expr_t* arg = vec_get_value(&exp->callx.args, i, expr_t*);
					resolve_type_tags(script, arg);
					
					if(exp->callx.func->tag->type != TAG_DYNAMIC)
					{
						type_tag_t* expected_tag = vec_get_value(&exp->callx.func->tag->func.arg_types, i, type_tag_t*);
						if(!compare_type_tags(arg->tag, expected_tag)) 
							error_defer_e(arg, "Type of argument %i does not match expected type\n", i + 1);
					}
				}
			}
			
			exp->tag = exp->callx.func->tag->func.return_type;
		} break;
		
		case EXP_PAREN:
		{
			resolve_type_tags(script, exp->paren);
			exp->tag = exp->paren->tag;
		} break;
		
		case EXP_BLOCK:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			for(int i = 0; i < exp->block.length; ++i)
			{
				expr_t* e = vec_get_value(&exp->block, i, expr_t*);
				resolve_type_tags(script, e);
			}
		} break;
		
		case EXP_ARRAY_INDEX:
		{
			resolve_type_tags(script, exp->array_index.array);
			resolve_type_tags(script, exp->array_index.index);

			if(!is_type_tag(exp->array_index.index->tag, TAG_NUMBER))
				error_defer_e(exp->array_index.index, "Attempting to index array with non-number value\n");
			
			switch(exp->array_index.array->tag->type)
			{
				case TAG_STRING: exp->tag = create_type_tag(script, TAG_CHAR); break;
				case TAG_ARRAY: exp->tag = exp->array_index.array->tag->contained; break;
				default:
					error_defer_e(exp->array_index.array, "Attempting to index non-indexable type\n");
					break;
			}
		} break;
		
		case EXP_EXTERN:
		case EXP_EXTERN_LIST: break;
		
		case EXP_ARRAY_LITERAL:
		{
			for(int i = 0; i < exp->array_literal.values.length; ++i)
				resolve_type_tags(script, vec_get_value(&exp->array_literal.values, i, expr_t*));
			
			type_tag_t* tag = create_type_tag(script, TAG_ARRAY);
			if(exp->array_literal.contained) tag->contained = exp->array_literal.contained;
			else
			{
				expr_t* first = vec_get_value(&exp->array_literal.values, 0, expr_t*);
				tag->contained = first->tag;
				
				for(int i = 1; i < exp->array_literal.values.length; ++i)
				{
					expr_t* e = vec_get_value(&exp->array_literal.values, i, expr_t*);
					if(!compare_type_tags(e->tag, tag->contained))
					{
						warn_e(e, WARN_DYNAMIC_ARRAY_LITERAL);
						tag = create_type_tag(script, TAG_DYNAMIC);			// NOTE: okay, so it must be a dynamic literal
						break;										// NOTE: also, we don't care about the types anymore
					}
					// error_defer_e(e, "Array literal value type does not match the array's contained type\n");
				}
			}
			
			exp->tag = tag;
		} break;
		
		case EXP_LEN:
		{
			exp->tag = create_type_tag(script, TAG_NUMBER);
			resolve_type_tags(script, exp->len);
			
			if(exp->len->tag->type != TAG_STRING && exp->len->tag->type != TAG_ARRAY)
				error_defer_e(exp->len, "Attempted to find the length of non-measurable type\n");
		} break;
		
		case EXP_IF:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			resolve_type_tags(script, exp->ifx.cond);
			
			if(!is_type_tag(exp->ifx.cond->tag, TAG_BOOL))
				error_defer_e(exp->ifx.cond, "Condition does not evaluate to a boolean value\n");
			
			resolve_type_tags(script, exp->ifx.body);
			if(exp->ifx.alt)
				resolve_type_tags(script, exp->ifx.alt);
		} break;
		
		case EXP_WHILE:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			resolve_type_tags(script, exp->whilex.cond);
			
			if(!is_type_tag(exp->whilex.cond->tag, TAG_BOOL)) 
				error_defer_e(exp->whilex.cond, "Condition does not evaluate to a boolean value\n");
			
			resolve_type_tags(script, exp->whilex.body);
		} break;

		case EXP_FOR:
		{
			exp->tag = create_type_tag(script, TAG_VOID);

			resolve_type_tags(script, exp->forx.init);
			resolve_type_tags(script, exp->forx.cond);
			resolve_type_tags(script, exp->forx.step);

			if (!is_type_tag(exp->forx.cond->tag, TAG_BOOL))
				error_defer_e(exp->forx.cond, "Condition does not evaluate to a boolean value\n");

			resolve_type_tags(script, exp->forx.body);
		} break;
		
		case EXP_RETURN:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			resolve_type_tags(script, exp->retx.value);
	
			if(!compare_type_tags(exp->retx.value->tag, exp->retx.parent->tag->func.return_type))
				error_defer_e(exp, "Returned value's type does not match the return type of the enclosing function.\n");
		} break;
		
		case EXP_FUNC:
		{
			exp->tag = create_type_tag(script, TAG_VOID);
			resolve_type_tags(script, exp->funcx.body);
		} break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, 0xf6ce(%rip)      # 0x1a138
movq -0x18(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, 0xf6b9(%rip)      # 0x1a130
movq -0x18(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0xd8(%rbp)
subq $0x1a, %rax
ja 0xb8d4
movq -0xd8(%rbp), %rax
leaq 0x894b(%rip), %rcx      # 0x133e8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0xa, 0x20(%rax)
je 0xab10
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x9d61(%rip), %rsi      # 0x14865
movb $0x0, %al
callq 0xa8e0
jmp 0xac3e
movb $0x0, -0x19(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
movq -0x28(%rbp), %rcx
cmpq 0x70(%rcx), %rax
jae 0xabaa
movq -0x28(%rbp), %rdi
addq $0x28, %rdi
addq $0x38, %rdi
movslq -0x2c(%rbp), %rsi
callq 0x11890
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x2130
cmpl $0x0, %eax
jne 0xab9d
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movb $0x1, -0x19(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x3, 0x28(%rax)
jne 0xab9b
movq -0x18(%rbp), %rdi
leaq 0x9d01(%rip), %rsi      # 0x14895
movb $0x0, %al
callq 0xa8e0
jmp 0xabaa
jmp 0xab9f
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xab2b
cmpb $0x0, -0x19(%rbp)
jne 0xac3c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
movq 0x30(%rax), %rsi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
callq 0xb8e0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xabe4
movb $0x1, -0x19(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x4, 0x28(%rax)
jne 0xac00
movq -0x18(%rbp), %rdi
leaq 0x9ce3(%rip), %rsi      # 0x148dc
movb $0x0, %al
callq 0xa8e0
cmpb $0x0, -0x19(%rbp)
jne 0xac2a
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdx
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rcx
leaq 0x9d05(%rip), %rsi      # 0x14926
movb $0x0, %al
callq 0xba00
jmp 0xac3a
movq -0x40(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xac3c
jmp 0xac3e
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x44(%rbp)
movslq -0x44(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x38(%rcx), %rcx
cmpq 0x70(%rcx), %rax
jae 0xad19
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
addq $0x28, %rdi
addq $0x38, %rdi
movslq -0x44(%rbp), %rsi
callq 0x11890
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0xad09
movq -0x8(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0xaa40
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x30(%rax), %rsi
callq 0x99a0
cmpb $0x0, %al
jne 0xad07
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x50(%rbp), %rax
movq (%rax), %rdx
leaq 0x9c61(%rip), %rsi      # 0x14961
movb $0x0, %al
callq 0xa8e0
jmp 0xad09
jmp 0xad0b
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xac7e
jmp 0xb8d4
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x54(%rbp)
movslq -0x54(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xadf7
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0x54(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x60(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x38(%rax), %rsi
callq 0xbad0
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
addq $0x28, %rdi
addq $0x38, %rdi
movslq -0x64(%rbp), %rsi
callq 0x11890
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x30(%rax), %rdi
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x99a0
cmpb $0x0, %al
jne 0xade7
movq -0x60(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x70(%rbp), %rax
movq (%rax), %rdx
leaq 0x9bc4(%rip), %rsi      # 0x149a4
movb $0x0, %al
callq 0xa8e0
jmp 0xade9
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xad35
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x18(%rbp), %rax
cmpq $0x0, 0x40(%rax)
jne 0xaec9
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x9cb0
movq %rax, -0x78(%rbp)
cmpq $0x0, -0x78(%rbp)
je 0xaead
movq -0x78(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xaec7
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdx
leaq 0x9b2e(%rip), %rsi      # 0x149ee
movb $0x0, %al
callq 0xba00
jmp 0xaedd
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movl 0x40(%rax), %eax
movl %eax, -0xdc(%rbp)
subl $0x23, %eax
je 0xaf43
jmp 0xaf33
movl -0xdc(%rbp), %eax
subl $0x26, %eax
je 0xaf86
jmp 0xafc9
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x2, 0x20(%rax)
je 0xaf6b
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x9ab9(%rip), %rsi      # 0x14a1d
movb $0x0, %al
callq 0xa8e0
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xafee
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x4, 0x20(%rax)
je 0xafae
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x9aae(%rip), %rsi      # 0x14a55
movb $0x0, %al
callq 0xa8e0
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xafee
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movslq 0x40(%rax), %rcx
leaq 0xf244(%rip), %rax      # 0x1a220
movq (%rax,%rcx,8), %rdx
leaq 0x9aa8(%rip), %rsi      # 0x14a8f
movb $0x0, %al
callq 0xba00
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
cmpl $0x24, 0x48(%rax)
je 0xb0b6
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x30(%rax), %rsi
callq 0x99a0
cmpb $0x0, %al
je 0xb05e
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rdi
movl $0x4, %esi
callq 0xbb60
cmpb $0x0, %al
jne 0xb0b1
movq -0x18(%rbp), %rax
cmpl $0x30, 0x48(%rax)
je 0xb0af
movq -0x18(%rbp), %rax
cmpl $0x31, 0x48(%rax)
je 0xb0af
movq -0x18(%rbp), %rax
cmpl $0x2e, 0x48(%rax)
je 0xb0af
movq -0x18(%rbp), %rax
cmpl $0x2f, 0x48(%rax)
je 0xb0af
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rax
movslq 0x48(%rax), %rcx
leaq 0xf183(%rip), %rax      # 0x1a220
movq (%rax,%rcx,8), %rdx
leaq 0x9a0b(%rip), %rsi      # 0x14ab3
movb $0x0, %al
callq 0xa8e0
jmp 0xb0b1
jmp 0xb141
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0xb, 0x20(%rax)
jne 0xb10e
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xbbb0
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0xb10c
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0xb13f
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xbc30
cmpb $0x0, %al
jne 0xb13d
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x99a3(%rip), %rsi      # 0x14ad9
movb $0x0, %al
callq 0xa8e0
jmp 0xb13f
jmp 0xb141
movq -0x18(%rbp), %rax
movl 0x48(%rax), %eax
movl %eax, -0xe0(%rbp)
addl $-0x25, %eax
subl $0x5, %eax
jb 0xb168
jmp 0xb158
movl -0xe0(%rbp), %eax
addl $-0x2a, %eax
subl $0x8, %eax
jb 0xb183
jmp 0xb19e
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb1b4
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb1b4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x1, 0x20(%rax)
jne 0xb1ec
movq -0x18(%rbp), %rdi
movl $0x2, %esi
movb $0x0, %al
callq 0xbc60
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x6, 0x20(%rax)
je 0xb222
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x1, 0x20(%rax)
je 0xb222
movq -0x18(%rbp), %rdi
leaq 0x9902(%rip), %rsi      # 0x14b1d
movb $0x0, %al
callq 0xa8e0
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x1, 0x20(%rax)
je 0xb27d
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq -0x18(%rbp), %rcx
movq 0x38(%rcx), %rcx
movq 0x30(%rcx), %rcx
cmpq 0x38(%rcx), %rax
je 0xb27d
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
movq 0x38(%rax), %rcx
leaq 0x98e1(%rip), %rsi      # 0x14b52
movb $0x0, %al
callq 0xa8e0
jmp 0xb359
movl $0x0, -0x84(%rbp)
movslq -0x84(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xb357
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0x84(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x90(%rbp)
movq -0x8(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x1, 0x20(%rax)
je 0xb341
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rdi
addq $0x28, %rdi
movslq -0x84(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x90(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x98(%rbp), %rsi
callq 0x99a0
cmpb $0x0, %al
jne 0xb33f
movq -0x90(%rbp), %rdi
movl -0x84(%rbp), %edx
addl $0x1, %edx
leaq 0x9858(%rip), %rsi      # 0x14b90
movb $0x0, %al
callq 0xa8e0
jmp 0xb341
jmp 0xb343
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0xb287
jmp 0xb359
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
movq 0x48(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x9c(%rbp)
movslq -0x9c(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0xb410
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
movslq -0x9c(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
movq -0x8(%rbp), %rdi
movq -0xa8(%rbp), %rsi
callq 0xaa40
movl -0x9c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x9c(%rbp)
jmp 0xb3c0
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x30(%rax), %rdi
movl $0x4, %esi
callq 0xbb60
cmpb $0x0, %al
jne 0xb467
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0x9762(%rip), %rsi      # 0x14bc2
movb $0x0, %al
callq 0xa8e0
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
movl 0x20(%rax), %eax
movl %eax, -0xe4(%rbp)
subl $0x5, %eax
je 0xb490
jmp 0xb483
movl -0xe4(%rbp), %eax
subl $0x7, %eax
je 0xb4ab
jmp 0xb4c5
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb4db
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
movq 0x28(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb4db
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x971f(%rip), %rsi      # 0x14bf3
movb $0x0, %al
callq 0xa8e0
jmp 0xb8d4
jmp 0xb8d4
movl $0x0, -0xac(%rbp)
movslq -0xac(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xb543
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0xac(%rbp), %rsi
callq 0x11890
movq -0xf0(%rbp), %rdi
movq (%rax), %rsi
callq 0xaa40
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0xb4ef
movq -0x8(%rbp), %rdi
movl $0x7, %esi
callq 0x9860
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0xb57b
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rcx
movq -0xb8(%rbp), %rax
movq %rcx, 0x28(%rax)
jmp 0xb64b
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x11890
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
movq -0xc0(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0xb8(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x1, -0xc4(%rbp)
movslq -0xc4(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0xb649
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0xc4(%rbp), %rsi
callq 0x11890
movq (%rax), %rax
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0xb8(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x99a0
cmpb $0x0, %al
jne 0xb633
movq -0xd0(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0xbc60
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x9860
movq %rax, -0xb8(%rbp)
jmp 0xb649
jmp 0xb635
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0xb5ba
jmp 0xb64b
movq -0xb8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0xb8d4
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x5, 0x20(%rax)
je 0xb6c3
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rax
cmpl $0x7, 0x20(%rax)
je 0xb6c3
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x955f(%rip), %rsi      # 0x14c1b
movb $0x0, %al
callq 0xa8e0
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rdi
movl $0x2, %esi
callq 0xbb60
cmpb $0x0, %al
jne 0xb71f
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x9538(%rip), %rsi      # 0x14c50
movb $0x0, %al
callq 0xa8e0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xb74c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0xaa40
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x30(%rax), %rdi
movl $0x2, %esi
callq 0xbb60
cmpb $0x0, %al
jne 0xb7a8
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rdi
leaq 0x94af(%rip), %rsi      # 0x14c50
movb $0x0, %al
callq 0xa8e0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0xaa40
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x30(%rax), %rdi
movl $0x2, %esi
callq 0xbb60
cmpb $0x0, %al
jne 0xb837
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rdi
leaq 0x9420(%rip), %rsi      # 0x14c50
movb $0x0, %al
callq 0xa8e0
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0xaa40
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x30(%rax), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq 0x10(%rax), %rax
movq 0x48(%rax), %rsi
callq 0x99a0
cmpb $0x0, %al
jne 0xb8ab
movq -0x18(%rbp), %rdi
leaq 0x93dc(%rip), %rsi      # 0x14c80
movb $0x0, %al
callq 0xa8e0
jmp 0xb8d4
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x9860
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0xaa40
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)