// File: /workspace/github_c_makefile_star2_O3/hsjoihs[P]c-compiler/parse_analyze_statement.c
// Function: parse_statement
struct Statement parse_statement(struct AnalyzerState *ptr_ps,
                                 const struct Token **ptr_tokvec)
{
	const struct Token *tokvec = *ptr_tokvec;
	if (tokvec[0].kind == RES_CASE || tokvec[0].kind == RES_DEFAULT ||
	    (tokvec[0].kind == IDENT_OR_RESERVED && tokvec[1].kind == COLON)) {
		return parse_labeled_statement(ptr_ps, ptr_tokvec);
	}

	switch (tokvec[0].kind) {
	case LEFT_BRACE: {
		return parse_compound_statement(ptr_ps, ptr_tokvec);
	}

	case RES_IF: {
		++tokvec;
		expect_and_consume(&tokvec, LEFT_PAREN,
		                   "left parenthesis immediately after `if`");

		const struct UntypedExpr u = parse_expression(&tokvec);
		struct Expr expr = typecheck_expression(ptr_ps, &u);
		expect_scalar(&expr.details.type, "`if` statement");

		expect_and_consume(&tokvec, RIGHT_PAREN, "right parenthesis of `if`");

		struct Statement *ptr_inner_s = calloc(1, sizeof(struct Statement));
		*ptr_inner_s = parse_statement(ptr_ps, &tokvec);

		struct Statement s;
		s.labels = init_vector();
		s.expr1 = expr;
		if (tokvec[0].kind == RES_ELSE) { /* must bind to the most inner one */
			++tokvec;
			struct Statement *ptr_inner_s2 =
			    calloc(1, sizeof(struct Statement));
			*ptr_inner_s2 = parse_statement(ptr_ps, &tokvec);

			*ptr_tokvec = tokvec;

			s.category = IF_ELSE_STATEMENT;
			s.statement_vector = init_vector();
			push_vector(&s.statement_vector, ptr_inner_s);
			push_vector(&s.statement_vector, ptr_inner_s2);
			return s;
		}

		*ptr_tokvec = tokvec;
		s.category = IF_STATEMENT;
		s.inner_statement = ptr_inner_s;
		return s;
	}

	case RES_SWITCH: {
		++tokvec;
		expect_and_consume(&tokvec, LEFT_PAREN,
		                   "left parenthesis immediately after `switch`");

		const struct UntypedExpr u = parse_expression(&tokvec);

		struct Expr expr = typecheck_expression(ptr_ps, &u);
		expect_and_consume(&tokvec, RIGHT_PAREN,
		                   "right parenthesis of `switch`");

		expect_integral(
		    &expr.details.type,
		    "controlling expression of `switch` must be integer type");

		struct Statement *ptr_inner_s = calloc(1, sizeof(struct Statement));
		*ptr_inner_s = parse_statement(ptr_ps, &tokvec);

		struct Statement s;
		s.labels = init_vector();
		s.expr1 = expr;
		*ptr_tokvec = tokvec;
		s.category = SWITCH_STATEMENT;
		s.inner_statement = ptr_inner_s;
		return s;
	}

	case RES_RETURN: {
		++tokvec;
		*ptr_tokvec = tokvec;
		struct Statement s;
		s.labels = init_vector();
		s.category = RETURN_STATEMENT;

		if (tokvec[0].kind == SEMICOLON) {
			++tokvec;
			s.expr1.category = VOID_EXPR;
			s.expr1.details.type.type_category = VOID_;
			s.expr1.details.true_type.type_category = VOID_;
		} else {
			const struct UntypedExpr u = parse_expression(&tokvec);
			struct Expr expr = typecheck_expression(ptr_ps, &u);

			if (ptr_ps->func_ret_type.type_category == PTR_) {
				struct TypePair details;
				details.type = ptr_ps->func_ret_type;
				details.true_type = ptr_ps->func_ret_type;
				cast_to_null_pointer_if_possible(&expr, &details);
				if_function_cast_to_pointer(&expr);
			}

			expect_type(ptr_ps, &expr.details.type, &ptr_ps->func_ret_type,
			            "mismatched type in the return value");
			expect_and_consume(&tokvec, SEMICOLON,
			                   "semicolon (after `return expr`)");
			s.expr1 = expr;
		}

		*ptr_tokvec = tokvec;
		return s;
	}

	case RES_DO: {
		++tokvec;

		struct Statement inner_s = parse_statement(ptr_ps, &tokvec);

		expect_and_consume(&tokvec, RES_WHILE, "`while` of do-while");
		expect_and_consume(&tokvec, LEFT_PAREN, "left parenthesis of do-while");

		const struct UntypedExpr u = parse_expression(&tokvec);

		struct Expr expr = typecheck_expression(ptr_ps, &u);
		expect_scalar(&expr.details.type, "`do-while` statement");

		expect_and_consume(&tokvec, RIGHT_PAREN,
		                   "right parenthesis of do-while");
		expect_and_consume(&tokvec, SEMICOLON, "semicolon after do-while");
		*ptr_tokvec = tokvec;

		struct Statement s;
		s.labels = init_vector();
		s.category = DO_WHILE_STATEMENT;
		s.expr1 = expr;

		struct Statement *ptr_inner_s = calloc(1, sizeof(struct Statement));
		*ptr_inner_s = inner_s;
		s.inner_statement = ptr_inner_s;
		return s;
	}

	case RES_WHILE: {
		++tokvec;

		expect_and_consume(&tokvec, LEFT_PAREN, "left parenthesis of while");

		const struct UntypedExpr u = parse_expression(&tokvec);

		struct Expr expr = typecheck_expression(ptr_ps, &u);
		expect_scalar(&expr.details.type, "`while` statement");

		expect_and_consume(&tokvec, RIGHT_PAREN, "left parenthesis of while");

		struct Statement inner_s = parse_statement(ptr_ps, &tokvec);

		*ptr_tokvec = tokvec;

		struct Statement s;
		s.labels = init_vector();
		s.category = WHILE_STATEMENT;
		s.expr1 = expr;

		struct Statement *ptr_inner_s = calloc(1, sizeof(struct Statement));
		*ptr_inner_s = inner_s;
		s.inner_statement = ptr_inner_s;
		return s;
	}

	case RES_BREAK: {
		++tokvec;
		expect_and_consume(&tokvec, SEMICOLON, "semicolon after `break`");
		*ptr_tokvec = tokvec;

		struct Statement s;
		s.labels = init_vector();
		s.category = BREAK_STATEMENT;
		return s;
	}

	case RES_CONTINUE: {
		++tokvec;
		expect_and_consume(&tokvec, SEMICOLON, "semicolon after `continue`");
		*ptr_tokvec = tokvec;

		struct Statement s;
		s.labels = init_vector();
		s.category = CONTINUE_STATEMENT;
		return s;
	}

	case RES_GOTO: {
		++tokvec;
		expect_and_consume(&tokvec, IDENT_OR_RESERVED,
		                   "identifier after `goto`");
		const char *ident = tokvec[-1].ident_str;
		expect_and_consume(&tokvec, SEMICOLON,
		                   "semicolon after `goto identifier`");
		*ptr_tokvec = tokvec;

		struct Statement s;
		s.labels = init_vector();
		s.category = GOTO_STATEMENT;
		s.destination = ident;
		return s;
	}

	case RES_FOR: {

		++tokvec;
		expect_and_consume(&tokvec, LEFT_PAREN, "left parenthesis of `for`");

		/* make the whole thing into a block*/
		struct Statement statement;
		statement.category = COMPOUND_STATEMENT;
		statement.labels = init_vector();
		statement.statement_vector = init_vector();

		/* block scope begins */
		struct ScopeChain current_table = ptr_ps->scope_chain;
		struct ScopeChain new_table;
		new_table.var_table = init_map();
		new_table.outer = &current_table;
		ptr_ps->scope_chain = new_table;

		struct Expr expr1;
		struct Expr expr2;
		struct Expr expr3;

		if (tokvec[0].kind == SEMICOLON) { /* expression1 is missing */
			expr1 = integer_1();
			++tokvec;
		} else if (can_start_a_type(tokvec)) {
			const char *str;
			struct UntypedExpr *ptr_uexpr;
			const struct Type vartype =
			    parse_declaration(&tokvec, &str, &ptr_uexpr);

			struct Expr *ptr_expr = declare_var_and_return_initializer(
			    ptr_ps, &vartype, str, ptr_uexpr, &statement);

			expr1 = ptr_expr ? *ptr_expr : integer_1();
		} else {
			const struct UntypedExpr u = parse_expression(&tokvec);
			expr1 = typecheck_expression(ptr_ps, &u);
			expect_and_consume(&tokvec, SEMICOLON, "first semicolon of `for`");
		}

		if (tokvec[0].kind == SEMICOLON) { /* expression2 is missing */
			expr2 = integer_1();
		} else {
			const struct UntypedExpr u = parse_expression(&tokvec);
			expr2 = typecheck_expression(ptr_ps, &u);
		}
		expect_scalar(&expr2.details.type, "`for` statement");
		expect_and_consume(&tokvec, SEMICOLON, "second semicolon of `for`");

		if (tokvec[0].kind == RIGHT_PAREN) { /* expression3 is missing */
			expr3 = integer_1();
		} else {
			const struct UntypedExpr u = parse_expression(&tokvec);
			expr3 = typecheck_expression(ptr_ps, &u);
		}
		expect_and_consume(&tokvec, RIGHT_PAREN, "right parenthesis of `for`");
		struct Statement s;
		s.labels = init_vector();
		s.category = FOR_STATEMENT;
		s.expr1 = expr1;
		s.expr2 = expr2;
		s.expr3 = expr3;

		struct Statement inner_s = parse_statement(ptr_ps, &tokvec);
		*ptr_tokvec = tokvec;
		struct Statement *ptr_inner_s = calloc(1, sizeof(struct Statement));
		*ptr_inner_s = inner_s;
		s.inner_statement = ptr_inner_s;

		struct Statement *ptr_s = calloc(1, sizeof(struct Statement));
		*ptr_s = s;
		push_vector(&statement.statement_vector, ptr_s);

		/* block scope ends */
		ptr_ps->scope_chain = current_table;
		return statement;
	}

	default: {
		const struct UntypedExpr uexpr = parse_expression(&tokvec);
		struct Expr expr = typecheck_expression(ptr_ps, &uexpr);

		expect_and_consume(&tokvec, SEMICOLON, "semicolon after an expression");

		*ptr_tokvec = tokvec;

		struct Statement s;
		s.labels = init_vector();
		s.category = EXPRESSION_STATEMENT;
		s.expr1 = expr;
		return s;
	}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x958, %rsp            # imm = 0x958
movq %rdx, %r15
movq %rsi, -0x38(%rbp)
movq %rdi, %r14
movq %rdi, %rbx
movq (%rdx), %r13
movq %r13, -0x30(%rbp)
movl (%r13), %eax
cmpl $0x2b, %eax
jle 0x3aac
leal -0x2c(%rax), %ecx
cmpl $0x15, %ecx
ja 0x3adb
leaq 0xad41(%rip), %rax      # 0xe7d0
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %r14, %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x3955
jmp 0x477b
cmpl $0x18, %eax
je 0x4097
cmpl $0x19, %eax
je 0x4126
cmpl $0x1e, %eax
jne 0x40a2
movq %r14, %rdi
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x47a1
jmp 0x477b
cmpl $0x49, %eax
jne 0x40a2
addq $0x20, %r13
movq %rbx, -0x40(%rbp)
leaq -0x30(%rbp), %rbx
movq %r13, (%rbx)
leaq 0xaf56(%rip), %rdx      # 0xea50
movq %rbx, %rdi
movl $0x18, %esi
callq 0x9563
movq (%rbx), %rax
movq -0x18(%rax), %r12
leaq 0xaf53(%rip), %rdx      # 0xea68
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x9563
movq (%rbx), %rax
movq -0x40(%rbp), %rbx
movq %rax, (%r15)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0xc, (%r14)
movq %r12, 0x388(%r14)
jmp 0x477b
addq $0x20, %r13
movq %rbx, -0x40(%rbp)
leaq -0x30(%rbp), %rbx
movq %r13, (%rbx)
leaq 0xae89(%rip), %rdx      # 0xe9f1
movq %rbx, %rdi
movl $0x6, %esi
callq 0x9563
leaq -0x350(%rbp), %rdi
movq %rbx, %rsi
callq 0x8ae5
leaq -0x250(%rbp), %r13
movq %r13, %rdi
movq -0x38(%rbp), %r12
movq %r12, %rsi
leaq -0x350(%rbp), %rdx
callq 0x673b
leaq 0xae63(%rip), %rsi      # 0xea0b
movq %r13, %rdi
callq 0x6130
movq %rbx, %rdi
movl $0x7, %esi
leaq 0xae32(%rip), %rdx      # 0xe9f1
callq 0x9563
leaq -0x820(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3a4f
movq (%rbx), %rax
movq %rax, (%r15)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x4, (%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
movq %r13, %rsi
jmp 0x3f24
movq %rbx, -0x40(%rbp)
addq $0x20, %r13
leaq -0x30(%rbp), %rbx
movq %r13, (%rbx)
leaq 0xac40(%rip), %rdx      # 0xe85d
movq %rbx, %rdi
movl $0x6, %esi
callq 0x9563
leaq -0x350(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x8ae5
leaq -0x250(%rbp), %rbx
movq %rbx, %rdi
movq -0x38(%rbp), %r12
movq %r12, %rsi
movq %r13, %rdx
callq 0x673b
leaq 0xac29(%rip), %rsi      # 0xe885
movq %rbx, %rdi
callq 0x6130
leaq 0xac29(%rip), %rdx      # 0xe894
leaq -0x30(%rbp), %rdi
movl $0x7, %esi
callq 0x9563
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
leaq -0x820(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
leaq -0x30(%rbp), %rdx
callq 0x3a4f
movl $0x390, %edx            # imm = 0x390
movq %rbx, -0x50(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1100
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x250(%rbp), %rsi
callq 0x1100
leaq -0x30(%rbp), %rax
movq (%rax), %rax
cmpl $0x2d, (%rax)
jne 0x4177
addq $0x20, %rax
leaq -0x30(%rbp), %r12
movq %rax, (%r12)
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
callq 0x3a4f
movl $0x390, %edx            # imm = 0x390
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1100
movq (%r12), %rax
movq %rax, (%r15)
movl $0x2, (%r14)
leaq 0x8(%r14), %r15
callq 0x5cf8
movq %rax, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %r15, %rdi
movq -0x50(%rbp), %rsi
callq 0x5d9b
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5d9b
jmp 0x4777
movq %rbx, -0x40(%rbp)
addq $0x20, %r13
leaq -0x30(%rbp), %rbx
movq %r13, (%rbx)
leaq 0xad0f(%rip), %rdx      # 0xea8a
movq %rbx, %rdi
movl $0x6, %esi
callq 0x9563
movl $0x0, (%r14)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
callq 0x5cf8
movq %rax, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq -0x38(%rbp), %r12
movups (%r12), %xmm0
leaq -0x150(%rbp), %r13
movaps %xmm0, (%r13)
callq 0xa40d
movq %rax, (%r12)
movq %r13, 0x8(%r12)
movq (%rbx), %rdi
cmpl $0x1a, (%rdi)
jne 0x4191
leaq -0x3f0(%rbp), %rdi
callq 0x95ac
addq $0x20, -0x30(%rbp)
movl $0x1, -0x44(%rbp)
movl $0x9, -0x50(%rbp)
jmp 0x43fe
addq $0x20, %r13
movq %rbx, %r12
leaq -0x30(%rbp), %rbx
movq %r13, (%rbx)
leaq 0xac06(%rip), %rdx      # 0xea1d
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x9563
movq (%rbx), %rax
movq %r12, %rbx
movq %rax, (%r15)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x7, (%r14)
jmp 0x477b
addq $0x20, %r13
movq %rbx, -0x40(%rbp)
leaq -0x30(%rbp), %rbx
movq %r13, (%rbx)
leaq -0x820(%rbp), %rdi
movq -0x38(%rbp), %r13
movq %r13, %rsi
movq %rbx, %rdx
callq 0x3a4f
leaq 0xaafc(%rip), %rdx      # 0xe974
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x9563
leaq 0xaafc(%rip), %rdx      # 0xe988
movq %rbx, %rdi
movl $0x6, %esi
callq 0x9563
leaq -0x350(%rbp), %rdi
movq %rbx, %rsi
callq 0x8ae5
leaq -0x250(%rbp), %r12
movq %r12, %rdi
movq %r13, %rsi
leaq -0x350(%rbp), %rdx
callq 0x673b
leaq 0xaadd(%rip), %rsi      # 0xe9a5
movq %r12, %rdi
callq 0x6130
leaq 0xaae3(%rip), %rdx      # 0xe9ba
movq %rbx, %rdi
movl $0x7, %esi
callq 0x9563
leaq 0xaaed(%rip), %rdx      # 0xe9d8
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x9563
movq (%rbx), %rax
movq %rax, (%r15)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x5, (%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
movq %r12, %rsi
callq 0x1100
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
movl $0x390, %edx            # imm = 0x390
movq %rax, %rdi
leaq -0x820(%rbp), %rsi
callq 0x1100
movq %rbx, 0x318(%r14)
jmp 0x4777
addq $0x20, %r13
movq %rbx, %r12
leaq -0x30(%rbp), %rbx
movq %r13, (%rbx)
leaq 0xaac5(%rip), %rdx      # 0xea35
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x9563
movq (%rbx), %rax
movq %r12, %rbx
movq %rax, (%r15)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x8, (%r14)
jmp 0x477b
addq $0x20, %r13
leaq -0x30(%rbp), %rdi
movq %r13, (%rdi)
leaq 0xa8f7(%rip), %rdx      # 0xe8ae
movq %rdi, %r13
movl $0x6, %esi
callq 0x9563
leaq -0x350(%rbp), %rdi
movq %r13, %rsi
callq 0x8ae5
leaq -0x250(%rbp), %rdi
movq -0x38(%rbp), %r12
movq %r12, %rsi
leaq -0x350(%rbp), %rdx
callq 0x673b
leaq 0xa8e6(%rip), %rdx      # 0xe8da
movq %r13, %rdi
movl $0x7, %esi
callq 0x9563
leaq 0xa8f0(%rip), %rsi      # 0xe8f8
leaq -0x250(%rbp), %rdi
callq 0x614b
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %r13
movq %r12, %rsi
movq %rbx, %r12
leaq -0x820(%rbp), %rbx
movq %rbx, %rdi
leaq -0x30(%rbp), %rdx
callq 0x3a4f
movl $0x390, %edx            # imm = 0x390
movq %r13, %rdi
movq %rbx, %rsi
movq %r12, %rbx
callq 0x1100
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x250(%rbp), %rsi
callq 0x1100
leaq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, (%r15)
movl $0xb, (%r14)
movq %r13, 0x318(%r14)
jmp 0x477b
cmpl $0x1d, 0x20(%r13)
je 0x3a98
leaq -0x250(%rbp), %r12
movq %r15, %r13
movq %rbx, %r15
leaq -0x30(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x8ae5
leaq -0x820(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %r12, %rdx
callq 0x673b
leaq 0xaa2a(%rip), %rdx      # 0xeb02
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x9563
movq (%rbx), %rax
movq %r15, %rbx
movq %rax, (%r13)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x9, (%r14)
addq $0x18, %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
leaq -0x820(%rbp), %rsi
callq 0x1100
jmp 0x477b
leaq 0x20(%r13), %rax
movq %rax, -0x30(%rbp)
movq %rax, (%r15)
callq 0x5cf8
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x6, (%r14)
cmpl $0x1a, 0x20(%r13)
jne 0x4267
addq $0x40, %r13
movl $0x13, 0xb8(%r14)
movl $0x7, %eax
movl %eax, 0x18(%r14)
movl %eax, 0x68(%r14)
jmp 0x4332
movq %rax, (%r15)
movl $0x1, (%r14)
movq -0x50(%rbp), %rax
movq %rax, 0x318(%r14)
jmp 0x4777
callq 0x9dc2
testl %eax, %eax
je 0x433a
leaq -0x820(%rbp), %r12
leaq -0x30(%rbp), %rsi
leaq -0x250(%rbp), %r13
leaq -0x350(%rbp), %rbx
movq %r12, %rdi
movq %r13, %rdx
movq %rbx, %rcx
callq 0x9de9
movq (%r13), %rdx
movq (%rbx), %rcx
movq -0x38(%rbp), %rdi
movq %r12, %rsi
movq %r14, %r8
callq 0x4a0d
testq %rax, %rax
je 0x4790
movq %rax, %rbx
leaq -0x3f0(%rbp), %rdi
movl $0xa0, %edx
movq %rax, %rsi
callq 0x1100
movl 0xa0(%rbx), %eax
movl %eax, -0x50(%rbp)
movups 0xa4(%rbx), %xmm0
movaps %xmm0, -0x80(%rbp)
movups 0xb4(%rbx), %xmm0
movaps %xmm0, -0x70(%rbp)
movl 0xc4(%rbx), %eax
movl %eax, -0x60(%rbp)
movl 0xc8(%rbx), %eax
movl %eax, -0x44(%rbp)
movl 0xfc(%rbx), %eax
movl %eax, -0xa0(%rbp)
movups 0xdc(%rbx), %xmm0
movaps %xmm0, -0xc0(%rbp)
movups 0xec(%rbx), %xmm0
movaps %xmm0, -0xb0(%rbp)
movups 0xcc(%rbx), %xmm0
movaps %xmm0, -0xd0(%rbp)
jmp 0x43fe
movq %rbx, -0x40(%rbp)
leaq -0x250(%rbp), %rbx
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x8ae5
leaq -0x820(%rbp), %rdi
movq -0x38(%rbp), %r12
movq %r12, %rsi
movq %rbx, %rdx
callq 0x673b
leaq 0x20(%r12), %rbx
cmpl $0x1, 0x20(%r12)
jne 0x42e2
leaq -0x350(%rbp), %rax
movl $0xa, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x300(%rbp), %rdi
movl $0xa, %ecx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x820(%rbp), %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x618b
movq %r13, %rdi
callq 0x61b8
leaq 0xa647(%rip), %rcx      # 0xe930
leaq -0x820(%rbp), %r13
movq -0x38(%rbp), %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x5f2a
leaq 0xa64e(%rip), %rdx      # 0xe954
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x9563
addq $0x18, %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movq %r13, %rsi
callq 0x1100
movq (%rbx), %r13
movq -0x40(%rbp), %rbx
movq %r13, (%r15)
jmp 0x477b
leaq -0x250(%rbp), %rbx
leaq -0x30(%rbp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x8ae5
leaq -0x820(%rbp), %r13
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq %rbx, %rdx
callq 0x673b
leaq -0x3f0(%rbp), %rdi
movl $0xa0, %edx
movq %r13, %rsi
callq 0x1100
movl 0xa0(%r13), %eax
movl %eax, -0x50(%rbp)
movups 0xa4(%r13), %xmm0
movaps %xmm0, -0x80(%rbp)
movups 0xb4(%r13), %xmm0
movaps %xmm0, -0x70(%rbp)
movl 0xc4(%r13), %eax
movl %eax, -0x60(%rbp)
movl 0xc8(%r13), %eax
movl %eax, -0x44(%rbp)
movups 0xcc(%r13), %xmm0
movaps %xmm0, -0xd0(%rbp)
movups 0xdc(%r13), %xmm0
movaps %xmm0, -0xc0(%rbp)
movups 0xec(%r13), %xmm0
movaps %xmm0, -0xb0(%rbp)
movl 0xfc(%r13), %eax
movl %eax, -0xa0(%rbp)
leaq 0xa6b3(%rip), %rdx      # 0xeaa4
movq %r12, %rdi
movl $0x1a, %esi
callq 0x9563
movq -0x30(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x442c
leaq -0x250(%rbp), %rbx
movq %rbx, %rdi
callq 0x95ac
movl $0x9, 0xa0(%rbx)
movl $0x1, 0xc8(%rbx)
jmp 0x4452
leaq -0x820(%rbp), %rbx
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x8ae5
leaq -0x250(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rbx, %rdx
callq 0x673b
addq $0x8, %r14
leaq 0xa660(%rip), %rsi      # 0xeabd
leaq -0x250(%rbp), %rdi
callq 0x6130
leaq 0xa65d(%rip), %rdx      # 0xeacd
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x9563
movq (%rbx), %rax
cmpl $0x7, (%rax)
jne 0x44a8
leaq -0x490(%rbp), %rdi
callq 0x95ac
movl $0x1, -0x58(%rbp)
movl $0x9, -0x54(%rbp)
jmp 0x4555
leaq -0x350(%rbp), %r13
leaq -0x30(%rbp), %rsi
movq %r13, %rdi
callq 0x8ae5
leaq -0x820(%rbp), %rbx
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r13, %rdx
callq 0x673b
leaq -0x490(%rbp), %rdi
movl $0xa0, %edx
movq %rbx, %rsi
callq 0x1100
movl 0xa0(%rbx), %eax
movl %eax, -0x54(%rbp)
movups 0xa4(%rbx), %xmm0
movaps %xmm0, -0x100(%rbp)
movups 0xb4(%rbx), %xmm0
movaps %xmm0, -0xf0(%rbp)
movl 0xc4(%rbx), %eax
movl %eax, -0xe0(%rbp)
movl 0xc8(%rbx), %eax
movl %eax, -0x58(%rbp)
movups 0xcc(%rbx), %xmm0
movaps %xmm0, -0x140(%rbp)
movups 0xdc(%rbx), %xmm0
movaps %xmm0, -0x130(%rbp)
movups 0xec(%rbx), %xmm0
movaps %xmm0, -0x120(%rbp)
movl 0xfc(%rbx), %eax
movl %eax, -0x110(%rbp)
leaq 0xa58b(%rip), %rdx      # 0xeae7
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x9563
callq 0x5cf8
movq %rax, -0x90(%rbp)
movq %rdx, -0x88(%rbp)
leaq -0x960(%rbp), %rdi
leaq -0x3f0(%rbp), %rsi
movl $0xa0, %edx
callq 0x1100
leaq -0x350(%rbp), %rdi
leaq -0x250(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1100
leaq -0x8c0(%rbp), %rdi
leaq -0x490(%rbp), %rsi
movl $0xa0, %edx
callq 0x1100
leaq -0x820(%rbp), %r13
movq %r13, %rdi
movq -0x38(%rbp), %r12
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3a4f
movq (%rbx), %rax
movq %rax, (%r15)
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %r15
movl $0x390, %edx            # imm = 0x390
movq %rax, %rdi
movq %r13, %rsi
callq 0x1100
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
movl $0x3, (%rax)
leaq 0x4(%rax), %rdi
leaq -0x974(%rbp), %rsi
movl $0xb4, %edx
callq 0x1100
movl -0x50(%rbp), %eax
movl %eax, 0xb8(%rbx)
movaps -0x80(%rbp), %xmm0
movaps -0x70(%rbp), %xmm1
movups %xmm0, 0xbc(%rbx)
movups %xmm1, 0xcc(%rbx)
movl -0x60(%rbp), %eax
movl %eax, 0xdc(%rbx)
movl -0x44(%rbp), %eax
movl %eax, 0xe0(%rbx)
movaps -0xd0(%rbp), %xmm0
movaps -0xc0(%rbp), %xmm1
movaps -0xb0(%rbp), %xmm2
movups %xmm0, 0xe4(%rbx)
movups %xmm1, 0xf4(%rbx)
movups %xmm2, 0x104(%rbx)
movl -0xa0(%rbp), %eax
movl %eax, 0x114(%rbx)
leaq 0x118(%rbx), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x350(%rbp), %rsi
callq 0x1100
leaq 0x218(%rbx), %rdi
movl $0xa0, %edx
leaq -0x8c0(%rbp), %rsi
callq 0x1100
movl -0x54(%rbp), %eax
movl %eax, 0x2b8(%rbx)
movaps -0x100(%rbp), %xmm0
movaps -0xf0(%rbp), %xmm1
movups %xmm0, 0x2bc(%rbx)
movups %xmm1, 0x2cc(%rbx)
movl -0xe0(%rbp), %eax
movl %eax, 0x2dc(%rbx)
movl -0x58(%rbp), %eax
movl %eax, 0x2e0(%rbx)
movaps -0x140(%rbp), %xmm0
movaps -0x130(%rbp), %xmm1
movaps -0x120(%rbp), %xmm2
movups %xmm0, 0x2e4(%rbx)
movups %xmm1, 0x2f4(%rbx)
movups %xmm2, 0x304(%rbx)
movl -0x110(%rbp), %eax
movl %eax, 0x314(%rbx)
movq %r15, 0x318(%rbx)
movq -0x90(%rbp), %rax
movq %rax, 0x378(%rbx)
movq -0x88(%rbp), %rax
movq %rax, 0x380(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5d9b
movaps -0x150(%rbp), %xmm0
movups %xmm0, (%r12)
movq -0x40(%rbp), %rbx
movq %rbx, %rax
addq $0x958, %rsp            # imm = 0x958
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x3f0(%rbp), %rdi
callq 0x95ac
jmp 0x3def