// File: /workspace/github_c_makefile_star2_O1/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 $0x9e8, %rsp            # imm = 0x9E8
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq %rdi, %r13
movq (%rdx), %rax
movq %rax, -0x30(%rbp)
movl (%rax), %ecx
cmpl $0x2b, %ecx
jle 0x3abc
leal -0x2c(%rcx), %edx
cmpl $0x15, %edx
ja 0x43f2
leaq 0xad30(%rip), %rcx      # 0xe7d0
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x3961
jmp 0x45cb
cmpl $0x18, %ecx
je 0x3b39
cmpl $0x19, %ecx
je 0x3ae2
cmpl $0x1e, %ecx
jne 0x445d
movq %r14, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x45e0
jmp 0x45cb
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movq %rax, (%r15)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x6, (%r14)
movq -0x30(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x406f
addq $0x20, %rax
movq %rax, -0x30(%rbp)
movl $0x13, 0xb8(%r14)
movl $0x7, %eax
movl %eax, 0x18(%r14)
movl %eax, 0x68(%r14)
jmp 0x412f
cmpl $0x1d, 0x20(%rax)
je 0x3aa9
cmpl $0x2b, %ecx
jle 0x3ac1
leal -0x2c(%rcx), %edx
cmpl $0x8, %edx
ja 0x43e9
leaq 0xacc9(%rip), %rcx      # 0xe828
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq %r13, -0x38(%rbp)
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq 0xad03(%rip), %rdx      # 0xe881
movq %rbx, %rdi
movl $0x6, %esi
callq 0x94af
leaq -0x278(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x89f1
leaq -0x178(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6573
leaq 0xacf0(%rip), %rsi      # 0xe8a9
movq %rbx, %rdi
callq 0x5f65
leaq 0xacf0(%rip), %rdx      # 0xe8b8
leaq -0x30(%rbp), %rdi
movl $0x7, %esi
callq 0x94af
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
leaq -0x608(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
leaq -0x30(%rbp), %rdx
callq 0x3a5f
movl $0x390, %edx            # imm = 0x390
movq %rbx, -0x40(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1100
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x178(%rbp), %rsi
callq 0x1100
leaq -0x30(%rbp), %rax
movq (%rax), %rax
cmpl $0x2d, (%rax)
jne 0x3fee
addq $0x20, %rax
leaq -0x30(%rbp), %rcx
movq %rax, (%rcx)
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
movq %r13, %rdi
movq %r12, %rsi
leaq -0x30(%rbp), %r12
movq %r12, %rdx
callq 0x3a5f
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 0x5af4
movq %rax, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %r15, %rdi
movq -0x40(%rbp), %rsi
callq 0x5ba7
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5ba7
jmp 0x45c7
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq -0x608(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3a5f
leaq 0xacb0(%rip), %rdx      # 0xe998
movq %rbx, %rdi
movl $0x2f, %esi
callq 0x94af
leaq 0xacb0(%rip), %rdx      # 0xe9ac
movq %rbx, %rdi
movl $0x6, %esi
callq 0x94af
leaq -0x278(%rbp), %rdi
movq %rbx, %rsi
callq 0x89f1
leaq -0x178(%rbp), %rdi
movq %r12, %rsi
leaq -0x278(%rbp), %rdx
callq 0x6573
leaq 0xac94(%rip), %rsi      # 0xe9c9
leaq -0x178(%rbp), %rdi
callq 0x5f65
leaq 0xac96(%rip), %rdx      # 0xe9de
movq %rbx, %rdi
movl $0x7, %esi
callq 0x94af
leaq 0xaca0(%rip), %rdx      # 0xe9fc
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x94af
movq (%rbx), %rax
movq %rax, (%r15)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x5, (%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x178(%rbp), %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 -0x608(%rbp), %rsi
jmp 0x3ea6
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq 0xac3f(%rip), %rdx      # 0xea15
movq %rbx, %rdi
movl $0x6, %esi
callq 0x94af
movq %r15, -0x38(%rbp)
movq %r12, %r15
movq %r13, %r12
leaq -0x278(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x89f1
leaq -0x178(%rbp), %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %r12, %r13
callq 0x6573
leaq 0xac14(%rip), %rsi      # 0xea2f
leaq -0x178(%rbp), %rdi
callq 0x5f65
movq %rbx, %rdi
movl $0x7, %esi
leaq 0xabdf(%rip), %rdx      # 0xea15
callq 0x94af
leaq -0x608(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x3a5f
movq (%rbx), %rax
movq -0x38(%rbp), %rcx
movq %rax, (%rcx)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x4, (%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x178(%rbp), %rsi
callq 0x1100
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
movl $0x390, %edx            # imm = 0x390
movq %rax, %rdi
movq %r12, %rsi
callq 0x1100
movq %rbx, 0x318(%r14)
jmp 0x45cb
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq 0xab90(%rip), %rdx      # 0xea59
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x94af
movq (%rbx), %rax
movq %rax, (%r15)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x8, (%r14)
jmp 0x45cb
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq 0xab34(%rip), %rdx      # 0xea41
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x94af
movq (%rbx), %rax
movq %rax, (%r15)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x7, (%r14)
jmp 0x45cb
movq %r13, -0x38(%rbp)
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq 0xab59(%rip), %rdx      # 0xeaae
movq %rbx, %rdi
movl $0x6, %esi
callq 0x94af
movl $0x0, (%r14)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
callq 0x5af4
movq %rax, 0x8(%r14)
movq %rdx, 0x10(%r14)
movups (%r12), %xmm0
leaq -0x60(%rbp), %r13
movaps %xmm0, (%r13)
callq 0xa39e
movq %rax, (%r12)
movq %r13, 0x8(%r12)
movq (%rbx), %rdi
cmpl $0x1a, (%rdi)
jne 0x4008
leaq -0x608(%rbp), %rbx
movq %rbx, %rdi
callq 0x94f8
movl $0x1, 0xc8(%rbx)
movl $0x9, 0xa0(%rbx)
leaq -0x278(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rsi
callq 0x1100
addq $0x20, -0x30(%rbp)
jmp 0x41b0
movq %rax, (%r15)
movl $0x1, (%r14)
movq -0x40(%rbp), %rax
movq %rax, 0x318(%r14)
jmp 0x45c7
callq 0x9d5f
testl %eax, %eax
je 0x413b
leaq -0x178(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x708(%rbp), %r13
leaq -0x808(%rbp), %rbx
movq %r13, %rdx
movq %rbx, %rcx
callq 0x9d86
movq (%r13), %rdx
movq (%rbx), %rcx
movq %r12, %rdi
leaq -0x178(%rbp), %rsi
movq %r14, %r8
callq 0x485a
testq %rax, %rax
je 0x4179
leaq -0x278(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
jmp 0x41ab
movq %r13, -0x38(%rbp)
leaq -0x178(%rbp), %rbx
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x89f1
leaq -0x608(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6573
leaq 0x20(%r12), %rbx
cmpl $0x1, 0x20(%r12)
jne 0x40e6
leaq -0x278(%rbp), %rax
movl $0xa, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x228(%rbp), %rdi
movl $0xa, %ecx
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x608(%rbp), %r13
movq %r13, %rdi
movq %rax, %rsi
callq 0x5fc0
movq %r13, %rdi
callq 0x5fed
leaq 0xa867(%rip), %rcx      # 0xe954
leaq -0x608(%rbp), %r13
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x5d65
leaq 0xa86f(%rip), %rdx      # 0xe978
leaq -0x30(%rbp), %rdi
movl $0x1a, %esi
callq 0x94af
addq $0x18, %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
movq %r13, %rsi
callq 0x1100
movq -0x38(%rbp), %r13
movq -0x30(%rbp), %rax
movq %rax, (%r15)
jmp 0x45cb
leaq -0x608(%rbp), %rbx
leaq -0x30(%rbp), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0x89f1
leaq -0x278(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6573
leaq 0xa95e(%rip), %rdx      # 0xeac8
movq %r13, %rdi
movl $0x1a, %esi
callq 0x94af
jmp 0x41b0
leaq -0x608(%rbp), %rbx
movq %rbx, %rdi
callq 0x94f8
movl $0x1, 0xc8(%rbx)
movl $0x9, 0xa0(%rbx)
leaq -0x278(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rsi
callq 0x1100
movq -0x30(%rbp), %rax
cmpl $0x1a, (%rax)
jne 0x41f2
leaq -0x608(%rbp), %rbx
movq %rbx, %rdi
callq 0x94f8
movl $0x1, 0xc8(%rbx)
movl $0x9, 0xa0(%rbx)
leaq -0x708(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rsi
callq 0x1100
jmp 0x4217
leaq -0x608(%rbp), %rbx
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x89f1
leaq -0x708(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6573
addq $0x8, %r14
leaq 0xa8bf(%rip), %rsi      # 0xeae1
leaq -0x708(%rbp), %rdi
callq 0x5f65
leaq 0xa8bc(%rip), %rdx      # 0xeaf1
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x94af
movq (%rbx), %rax
cmpl $0x7, (%rax)
jne 0x4287
leaq -0x608(%rbp), %rbx
movq %rbx, %rdi
callq 0x94f8
movl $0x1, 0xc8(%rbx)
movl $0x9, 0xa0(%rbx)
leaq -0x808(%rbp), %rdi
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rsi
callq 0x1100
jmp 0x42ac
leaq -0x608(%rbp), %rbx
leaq -0x30(%rbp), %rsi
movq %rbx, %rdi
callq 0x89f1
leaq -0x808(%rbp), %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x6573
leaq 0xa858(%rip), %rdx      # 0xeb0b
leaq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x7, %esi
callq 0x94af
callq 0x5af4
movq %rax, -0x40(%rbp)
movq %rdx, -0x48(%rbp)
leaq -0x164(%rbp), %rdi
leaq -0x278(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1100
leaq -0xa08(%rbp), %rdi
leaq -0x708(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1100
leaq -0x908(%rbp), %rdi
leaq -0x808(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x1100
leaq -0x608(%rbp), %r13
movq %r13, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x3a5f
movq (%rbx), %rax
movq %rax, (%r15)
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %rbx
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, %r15
movl $0x3, (%rax)
leaq 0x4(%rax), %rdi
leaq -0x178(%rbp), %rsi
movl $0x114, %edx            # imm = 0x114
callq 0x1100
leaq 0x118(%r15), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0xa08(%rbp), %rsi
callq 0x1100
leaq 0x218(%r15), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x908(%rbp), %rsi
callq 0x1100
movq %rbx, 0x318(%r15)
movq -0x40(%rbp), %rax
movq %rax, 0x378(%r15)
movq -0x48(%rbp), %rax
movq %rax, 0x380(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x5ba7
movaps -0x60(%rbp), %xmm0
movups %xmm0, (%r12)
jmp 0x45c7
cmpl $0x3f, %ecx
je 0x44e1
cmpl $0x49, %ecx
jne 0x445d
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq 0xa66b(%rip), %rdx      # 0xea74
movq %rbx, %rdi
movl $0x18, %esi
callq 0x94af
movq (%rbx), %rax
movq -0x18(%rax), %r12
leaq 0xa668(%rip), %rdx      # 0xea8c
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x94af
movq (%rbx), %rax
movq %rax, (%r15)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0xc, (%r14)
movq %r12, 0x388(%r14)
jmp 0x45cb
movq %r15, -0x38(%rbp)
movq %r12, %r15
leaq -0x178(%rbp), %r12
leaq -0x30(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x89f1
leaq -0x608(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x6573
leaq 0xa693(%rip), %rdx      # 0xeb26
movq %rbx, %rdi
movl $0x1a, %esi
callq 0x94af
movq (%rbx), %rax
movq -0x38(%rbp), %rcx
movq %rax, (%rcx)
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
movl $0x9, (%r14)
addq $0x18, %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
leaq -0x608(%rbp), %rsi
callq 0x1100
jmp 0x45cb
addq $0x20, %rax
leaq -0x30(%rbp), %rbx
movq %rax, (%rbx)
leaq 0xa3df(%rip), %rdx      # 0xe8d2
movq %rbx, %rdi
movl $0x6, %esi
callq 0x94af
movq %r13, -0x38(%rbp)
leaq -0x278(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x89f1
leaq -0x178(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x6573
leaq 0xa3cf(%rip), %rdx      # 0xe8fe
movq %rbx, %rdi
movl $0x7, %esi
callq 0x94af
leaq 0xa3d9(%rip), %rsi      # 0xe91c
leaq -0x178(%rbp), %rdi
callq 0x5f80
movl $0x1, %edi
movl $0x390, %esi            # imm = 0x390
callq 0x10d0
movq %rax, %r13
leaq -0x608(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rsi
leaq -0x30(%rbp), %rdx
callq 0x3a5f
movl $0x390, %edx            # imm = 0x390
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1100
callq 0x5af4
movq %rax, 0x378(%r14)
movq %rdx, 0x380(%r14)
leaq 0x18(%r14), %rdi
movl $0x100, %edx            # imm = 0x100
leaq -0x178(%rbp), %rsi
callq 0x1100
leaq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, (%r15)
movl $0xb, (%r14)
movq %r13, 0x318(%r14)
movq -0x38(%rbp), %r13
movq %r13, %rax
addq $0x9e8, %rsp            # imm = 0x9E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq