// File: /workspace/github_c_makefile_star2_O1/hsjoihs[P]c-compiler/codegen_expression.c
// Function: print_expression
void print_expression(struct PrinterState *ptr_prs, const struct Expr *ref_expr)
{
	const struct Expr expr = *ref_expr;
	switch (expr.category) {
	case FPCALL_EXPR_RETURNING_INTEGER_CLASS:
	case FPCALL_EXPR_RETURNING_MEMORY_CLASS:
	case FUNCCALL_EXPR_RETURNING_INTEGER_CLASS:
	case FUNCCALL_EXPR_RETURNING_MEMORY_CLASS: {
		unsupported("struct/union returned by function used as a pure rvalue");
	}
	case STRUCT_OR_UNION_ASSIGNMENT_EXPR: {
		print_address_of_lvalue(
		    ptr_prs, expr.ptr1, "left hand of struct/union assignment");
		print_address_of_lvalue_or_struct_or_union(
		    ptr_prs, expr.ptr2, "right hand of struct/union assignment");
		int size = expr.size_info_for_struct_or_union_assign;
		gen_copy_1st_struct_or_union_to_2nd_and_discard(size);
		gen_push_int(143253); /* random garbage */
		return;
	}
	case VOID_EXPR: {
		gen_push_int(123); /* random garbage */
		return;
	}
	case NULLPTR: {
		gen_push_nullptr();
		return;
	}
	case PTR_STRUCT_AND_OFFSET: {
		print_address_of_lvalue_or_struct_or_union(
		    ptr_prs, expr.ptr1, "struct/union whose member is to be accessed");
		int offset = expr.struct_offset;
		if (offset) {
			gen_push_int(offset);
			gen_cltq();
			gen_op_8byte("addq");
		}
		return;
	}
	case POINTER_MINUS_POINTER: {
		print_expression(ptr_prs, expr.ptr1);
		print_expression(ptr_prs, expr.ptr2);
		int size = expr.size_info_for_pointer_arith;
		gen_op_8byte("subq");
		gen_div_by_const(size);
		return;
	}
	case POINTER_PLUS_INT:
	case POINTER_MINUS_INT: {
		int size = expr.size_info_for_pointer_arith;
		print_expression(ptr_prs, expr.ptr1);
		print_expression(ptr_prs, expr.ptr2);
		print_op_pointer_plusminus_int(expr.category == POINTER_PLUS_INT, size);
		return;
	}
	case POSTFIX_INCREMENT:
	case POSTFIX_DECREMENT: {
		enum SimpleBinOp opkind2 = expr.category == POSTFIX_INCREMENT
		                               ? SIMPLE_BIN_OP_PLUS
		                               : SIMPLE_BIN_OP_MINUS;

		print_expression_as_lvalue(ptr_prs, expr.ptr1);
		gen_push_int(1);

		print_simple_binary_op(opkind2, &expr.ptr1->details.type,
		                       expr.size_info_for_pointer_arith);

		gen_assign_nbyte(
		    size_of_basic(&expr.ptr1->details.type, "postfix inc/dec"));

		gen_push_int(-1);

		print_simple_binary_op(opkind2, &expr.ptr1->details.type,
		                       expr.size_info_for_pointer_arith);

		return;
	}

	case LOCAL_VAR_: {
		if (expr.details.true_type.type_category == ARRAY) {
			gen_push_address_of_local(expr.local_var_offset);
			return;
		}
		gen_push_from_local_nbyte(
		    size_of_basic(&expr.details.type, "local var as rvalue"),
		    expr.local_var_offset);

		return;
	}

	case GLOBAL_VAR_: {
		printf("//global `%s` as rvalue\n", expr.global_var_name);

		if (expr.details.true_type.type_category == ARRAY) {
			gen_push_address_of_global(expr.global_var_name);
			return;
		}

		gen_push_address_of_global(expr.global_var_name);
		gen_peek_and_dereference_nbyte(
		    size_of_basic(&expr.details.type, "global var as rvalue"));

		return;
	}

	case SIMPLE_BINARY_EXPR: {
		print_expression(ptr_prs, expr.ptr1);
		print_expression(ptr_prs, expr.ptr2);
		print_simple_binary_op(expr.simple_binary_operator,
		                       &expr.ptr1->details.type,
		                       expr.size_info_for_pointer_arith);
		return;
	}

	case COMMA_EXPR: {
		print_expression_or_addr_of_struct_or_union(
		    ptr_prs, expr.ptr1, "struct as the first operand of comma");

		if (is_struct_or_union(&expr.ptr2->details.type)) {
			simple_error("struct/union is used as the right operand of comma "
			             "operator, but the result of comma expression is used "
			             "in a non-struct/non-union manner.\n");

		} else {
			print_expression(ptr_prs, expr.ptr2);
		}

		gen_discard2nd();
		return;
	}

	case LOGICAL_OR_EXPR: {

		int label1 = get_new_label_name(ptr_prs);
		int label2 = get_new_label_name(ptr_prs);
		print_expression(ptr_prs, expr.ptr1);

		gen_if_nonzero_jmp_nbyte(
		    size_of_basic(&expr.ptr1->details.type, "operand of logical or"),
		    label1, 0);
		print_expression(ptr_prs, expr.ptr2);
		gen_discard();
		gen_if_nonzero_jmp_nbyte(
		    size_of_basic(&expr.ptr2->details.type, "operand of logical or"),
		    label1, -8);
		gen_discard();
		gen_push_int(0);
		gen_jump(label2, "logical OR");
		gen_label(label1);
		gen_discard();
		gen_push_int(1);
		gen_label(label2);
		return;
	}
	case LOGICAL_AND_EXPR: {

		int label1 = get_new_label_name(ptr_prs);
		int label2 = get_new_label_name(ptr_prs);
		print_expression(ptr_prs, expr.ptr1);

		gen_if_zero_jmp_nbyte(
		    size_of_basic(&expr.ptr1->details.type, "operand of logical and"),
		    label1, 0);
		print_expression(ptr_prs, expr.ptr2);
		gen_discard();
		gen_if_zero_jmp_nbyte(
		    size_of_basic(&expr.ptr2->details.type, "operand of logical and"),
		    label1, -8);
		gen_discard();
		gen_push_int(1);
		gen_jump(label2, "logical AND");
		printf(".L%d:\n", label1);
		gen_discard();
		gen_push_int(0);
		printf(".L%d:\n", label2);
		return;
	}

	case ASSIGNMENT_EXPR: {

		print_expression_as_lvalue(ptr_prs, expr.ptr1);
		print_expression(ptr_prs, expr.ptr2);

		gen_discard2nd();

		struct Type type = expr.ptr1->details.type;

		gen_assign_nbyte(size_of_basic(&type, "operand of assignment"));

		return;
	}
	case COMPOUND_ASSIGNMENT_EXPR: {

		print_expression_as_lvalue(ptr_prs, expr.ptr1);
		print_expression(ptr_prs, expr.ptr2);

		print_simple_binary_op(expr.simple_binary_operator,
		                       &expr.ptr1->details.type,
		                       expr.size_info_for_pointer_arith);

		struct Type type = expr.ptr1->details.type;

		gen_assign_nbyte(size_of_basic(&type, "operand of assignment"));

		return;
	}
	case INT_VALUE:
		gen_push_int(expr.int_value);
		return;
	case UNARY_OP_EXPR:
		switch (expr.unary_operator) {
		case UNARY_OP_NOT: {
			print_expression(ptr_prs, expr.ptr1);
			if (size_of_basic(&expr.ptr1->details.type,
			                  "operand of logical not") == 8) {
				gen_logical_not_of_pointer();
			} else {
				gen_unary_not();
			}
			return;
		}
		case UNARY_OP_TILDA:
			print_expression(ptr_prs, expr.ptr1);
			gen_unary("notl");
			return;
		case UNARY_OP_PLUS:
			print_expression(ptr_prs, expr.ptr1);
			/* do nothing */
			return;
		case UNARY_OP_MINUS:
			print_expression(ptr_prs, expr.ptr1);
			gen_unary("negl");
			return;

		case UNARY_OP_PLUS_PLUS:
		case UNARY_OP_MINUS_MINUS: {
			print_expression_as_lvalue(ptr_prs, expr.ptr1);

			gen_push_int(1);
			print_simple_binary_op(
			    expr.unary_operator == UNARY_OP_PLUS_PLUS ? SIMPLE_BIN_OP_PLUS
			                                              : SIMPLE_BIN_OP_MINUS,
			    &expr.ptr1->details.type, expr.size_info_for_pointer_arith);

			struct Type type = expr.ptr1->details.type;

			gen_assign_nbyte(size_of_basic(&type, "prefix inc/dec"));
			return;
		}

		case UNARY_OP_AND: {
			struct Type type = expr.ptr1->details.type;
			struct Type true_type = expr.ptr1->details.true_type;
			if (type.type_category == PTR_ &&
			    true_type.type_category == ARRAY) {
				print_expression(ptr_prs, expr.ptr1);
			} else {
				print_address_of_lvalue(
				    ptr_prs, expr.ptr1, "address requested by & operator");
			}
			return;
		}

		case UNARY_OP_ASTERISK: {
			print_expression(ptr_prs, expr.ptr1);
			struct Type type = expr.details.type;
			struct Type true_type = expr.details.true_type;

			if (type.type_category == PTR_ &&
			    true_type.type_category == ARRAY) {
				/* do not dereference, if it is an array */
				return;
			}
			gen_peek_and_dereference_nbyte(
			    size_of_basic(&type, "*expr as rvalue"));

			return;
		}
		}
		return;
	case CONDITIONAL_EXPR: {
		int label1 = get_new_label_name(ptr_prs);
		int label2 = get_new_label_name(ptr_prs);

		print_expression(ptr_prs, expr.ptr1);
		gen_if_zero_jmp_nbyte(
		    size_of_basic(&expr.ptr1->details.type,
		                  "condition of conditional expression"),
		    label1, 0);
		print_expression(ptr_prs, expr.ptr2);
		gen_jump(label2, "ternary operator");
		gen_label(label1);
		print_expression(ptr_prs, expr.ptr3);
		gen_label(label2);
		gen_discard2nd();
		return;
	}
	case FPCALL_EXPR: {
		struct Type ret_type = expr.details.type;

		print_expression(ptr_prs, expr.ptr1);
		pass_args(ptr_prs, &expr.args);
		gen_pop_to_reg_8byte("r11");

		int size = ret_type.type_category == VOID_
		               ? 4 /* for convenience */
		               : size_of_basic(&ret_type, "return value");

		gen_raw_call_partA();
		gen_call_reg_and_push_ret_of_nbyte(size, "r11");

		return;
	}
	case FUNCCALL_EXPR: {
		const char *ident_str = expr.global_var_name;
		struct Type ret_type = expr.details.type;

		int arg_stacksize = count_args(&expr.args) * 8;
		if (arg_stacksize % 16 != 0) {
			unsupported("misaligned stack");
		}
		gen_raw_call_partA();
		pass_args(ptr_prs, &expr.args);

		int size = ret_type.type_category == VOID_
		               ? 4 /* for convenience */
		               : size_of_basic(&ret_type, "return value");

		gen_push_ret_of_nbyte(size, ident_str, arg_stacksize);

		return;
	}
	case BUILTIN_FUNCCALL_EXPR: {
		const char *ident_str = expr.global_var_name;

		for (int counter = expr.args.length - 1; counter >= 0; counter--) {
			const struct Expr *ptr_expr_ = expr.args.vector[counter];

			print_expression(ptr_prs, ptr_expr_);
		}

		handle_builtin(ptr_prs, ident_str);

		for (int counter = expr.args.length - 1; counter >= 0; counter--) {
			gen_discard();
		}
		gen_push_int(5432); /* a dummy value to be discarded */

		return;
	}

	case STRING_LITERAL: {
		const char *str = expr.literal_string;
		push_vector(&ptr_prs->string_constant_pool, str);
		gen_push_address_of_str(ptr_prs->string_constant_pool.length - 1);
	}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x150, %rsp            # imm = 0x150
movq %rsi, %r15
movq %rdi, %rbx
leaq -0x120(%rbp), %r14
movl $0x100, %edx            # imm = 0x100
movq %r14, %rdi
callq 0x1100
movl 0xa0(%r14), %eax
cmpq $0x1b, %rax
ja 0x5402
leaq 0x9f85(%rip), %rcx      # 0xeca4
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl -0x2c(%rbp), %r14d
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movl -0x80(%rbp), %ebx
callq 0xae90
movl %r14d, %edi
callq 0xaf40
cmpl $0x2, %ebx
leaq 0xa3d5(%rip), %rax      # 0xf133
leaq 0xa3d3(%rip), %rdi      # 0xf138
cmoveq %rax, %rdi
jmp 0x4ee5
xorl %r14d, %r14d
cmpl $0xa, %eax
setne %r14b
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x571e
movl $0x1, %edi
callq 0xa783
movq -0x70(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl %r14d, %edi
callq 0x5817
movq -0x70(%rbp), %rdi
leaq 0xa395(%rip), %rsi      # 0xf13d
callq 0x9529
movl %eax, %edi
callq 0xadfd
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xa783
movq -0x70(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl %r14d, %edi
jmp 0x4fd7
movq %rbx, %rdi
callq 0x245c
movl %eax, %r15d
movq %rbx, %rdi
callq 0x245c
movl %eax, %r14d
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq -0x70(%rbp), %rdi
leaq 0xa436(%rip), %r12      # 0xf230
movq %r12, %rsi
callq 0x9529
movl %eax, %edi
movl %r15d, %esi
xorl %edx, %edx
callq 0xaaa9
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
callq 0xad5d
movq -0x68(%rbp), %rdi
movq %r12, %rsi
callq 0x9529
movl %eax, %edi
movl %r15d, %esi
movl $0xfffffff8, %edx       # imm = 0xFFFFFFF8
callq 0xaaa9
callq 0xad5d
movl $0x1, %edi
callq 0xa783
leaq 0xaeb0(%rip), %rsi      # 0xfd00
movl %r14d, %edi
callq 0xaa5b
leaq 0xa3e8(%rip), %rbx      # 0xf247
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x1070
callq 0xad5d
xorl %edi, %edi
callq 0xa783
movq %rbx, %rdi
movl %r14d, %esi
xorl %eax, %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x1070
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x571e
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
callq 0xad85
jmp 0x5310
movq -0x70(%rbp), %rsi
leaq 0xa246(%rip), %rdx      # 0xf107
movq %rbx, %rdi
callq 0x49b8
movl -0x24(%rbp), %edi
testl %edi, %edi
je 0x5402
callq 0xa783
callq 0xae90
leaq 0xa24e(%rip), %rdi      # 0xf133
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xae58
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movl -0x2c(%rbp), %ebx
leaq 0xa21d(%rip), %rdi      # 0xf138
callq 0xae58
movl %ebx, %edi
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xafb7
movl -0x58(%rbp), %edi
jmp 0x53cb
leaq -0x40(%rbp), %r12
movq -0x10(%r12), %r14
leaq -0x170(%rbp), %rdi
movl $0xa, %ecx
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %r12, %rdi
callq 0x55f3
movl %eax, %r15d
testb $0x1, %r15b
jne 0x552e
shll $0x3, %r15d
callq 0xbd16
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5546
movl $0x4, %edi
cmpl $0x7, -0x170(%rbp)
je 0x4fa5
leaq 0x99d4(%rip), %rsi      # 0xe96b
leaq -0x170(%rbp), %rdi
callq 0x9529
movl %eax, %edi
movq %r14, %rsi
movl %r15d, %edx
callq 0xa8e7
jmp 0x5402
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movl -0x7c(%rbp), %edi
movq -0x70(%rbp), %rsi
movl -0x2c(%rbp), %edx
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x5817
movq -0x70(%rbp), %rsi
leaq 0x9f23(%rip), %rdx      # 0xef19
movq %rbx, %rdi
callq 0x566e
movq -0x68(%rbp), %rdi
callq 0x9516
testl %eax, %eax
jne 0x553a
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
jmp 0x5195
movq %rbx, %rdi
callq 0x245c
movl %eax, %r15d
movq %rbx, %rdi
callq 0x245c
movl %eax, %r14d
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq -0x70(%rbp), %rdi
leaq 0xa1cd(%rip), %r12      # 0xf21a
movq %r12, %rsi
callq 0x9529
movl %eax, %edi
movl %r15d, %esi
xorl %edx, %edx
callq 0xab3a
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
callq 0xad5d
movq -0x68(%rbp), %rdi
movq %r12, %rsi
callq 0x9529
movl %eax, %edi
movl %r15d, %esi
movl $0xfffffff8, %edx       # imm = 0xFFFFFFF8
callq 0xab3a
callq 0xad5d
xorl %edi, %edi
callq 0xa783
leaq 0xac77(%rip), %rsi      # 0xfd17
movl %r14d, %edi
callq 0xaa5b
movl %r15d, %edi
callq 0xac08
callq 0xad5d
movl $0x1, %edi
callq 0xa783
movl %r14d, %edi
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xac08
cmpl $0x2, -0xd0(%rbp)
jne 0x53df
movl -0x30(%rbp), %edi
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa7b8
movq -0x48(%rbp), %rsi
leaq 0x10(%rbx), %rdi
callq 0x5ba7
movl 0x10(%rbx), %edi
decl %edi
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa7f9
movq %rbx, %rdi
callq 0x245c
movl %eax, %r15d
movq %rbx, %rdi
callq 0x245c
movl %eax, %r14d
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq -0x70(%rbp), %rdi
leaq 0x9c80(%rip), %rsi      # 0xedcd
callq 0x9529
movl %eax, %edi
movl %r15d, %esi
xorl %edx, %edx
callq 0xaaa9
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
leaq 0x9cdb(%rip), %rsi      # 0xee4c
movl %r14d, %edi
callq 0xaa5b
movl %r15d, %edi
callq 0xac08
movq -0x60(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movl %r14d, %edi
callq 0xac08
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xad85
movl -0x78(%rbp), %eax
cmpq $0x7, %rax
ja 0x5402
leaq 0x9b57(%rip), %rcx      # 0xed14
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x571e
movl $0x1, %edi
callq 0xa783
xorl %edi, %edi
cmpl $0x4, -0x78(%rbp)
setne %dil
movq -0x70(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x5817
movq -0x70(%rbp), %rsi
leaq -0x170(%rbp), %rax
movl $0xa, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0xa076(%rip), %rsi      # 0xf285
jmp 0x532d
movq -0x50(%rbp), %r14
movslq -0x40(%rbp), %r15
testq %r15, %r15
jle 0x523e
incq %r15
movq -0x38(%rbp), %rax
movq -0x10(%rax,%r15,8), %rsi
movq %rbx, %rdi
callq 0x4cdb
decq %r15
cmpq $0x1, %r15
jg 0x5224
movq %rbx, %rdi
movq %r14, %rsi
callq 0x56b4
movl -0x40(%rbp), %ebx
testl %ebx, %ebx
jle 0x525e
incl %ebx
callq 0xad5d
decl %ebx
cmpl $0x1, %ebx
jg 0x5252
movl $0x1538, %edi           # imm = 0x1538
jmp 0x53cb
movq -0x70(%rbp), %rsi
leaq 0x9e49(%rip), %rdx      # 0xf0bc
movq %rbx, %rdi
callq 0x4990
movq -0x68(%rbp), %rsi
leaq 0x9e5b(%rip), %rdx      # 0xf0e1
movq %rbx, %rdi
callq 0x49b8
movl -0x28(%rbp), %edi
callq 0xb4f7
movl $0x22f95, %edi          # imm = 0x22F95
jmp 0x53cb
movq -0x50(%rbp), %rsi
leaq 0x9eb6(%rip), %rdi      # 0xf161
xorl %eax, %eax
callq 0x1070
movl -0xd0(%rbp), %ebx
movq -0x50(%rbp), %rdi
callq 0xa893
cmpl $0x2, %ebx
je 0x5402
leaq 0x9ea9(%rip), %rsi      # 0xf17a
leaq -0x120(%rbp), %rdi
callq 0x9529
movl %eax, %edi
callq 0xb08b
jmp 0x5402
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x571e
movq -0x68(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movl -0x7c(%rbp), %edi
movq -0x70(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x5817
movq -0x70(%rbp), %rsi
leaq -0x170(%rbp), %rax
movl $0xa, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
leaq 0x9f21(%rip), %rsi      # 0xf24e
movq %rax, %rdi
callq 0x9529
movl %eax, %edi
callq 0xadfd
jmp 0x5402
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa96e
leaq -0x170(%rbp), %r14
movl $0xa, %ecx
movq %r14, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
leaq -0x40(%rbp), %r15
movq -0x30(%r15), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5546
leaq 0x9b10(%rip), %rdi      # 0xee9c
callq 0xb1a9
movl $0x4, %ebx
cmpl $0x7, (%r14)
je 0x53b1
leaq 0x95c8(%rip), %rsi      # 0xe96b
leaq -0x170(%rbp), %rdi
callq 0x9529
movl %eax, %ebx
callq 0xbd16
leaq 0x9adf(%rip), %rsi      # 0xee9c
movl %ebx, %edi
callq 0xa996
jmp 0x5402
movl $0x7b, %edi
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa783
leaq 0x9d67(%rip), %rsi      # 0xf14d
leaq -0x120(%rbp), %rbx
movq %rbx, %rdi
callq 0x9529
movl 0xf0(%rbx), %esi
movl %eax, %edi
callq 0xa82e
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq -0x70(%rbp), %rsi
jmp 0x54e0
movq 0xb0(%r14), %rsi
movq %rbx, %rdi
callq 0x4cdb
leaq -0x170(%rbp), %rax
movl $0xa, %ecx
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
cmpl $0x1, (%rax)
jne 0x544d
cmpl $0x2, -0xd0(%rbp)
je 0x5402
leaq 0x9e60(%rip), %rsi      # 0xf2b4
leaq -0x170(%rbp), %rdi
jmp 0x52d8
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
leaq 0x9e0d(%rip), %rdi      # 0xf280
jmp 0x54bd
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
movq -0x70(%rbp), %rdi
leaq 0x9dd8(%rip), %rsi      # 0xf264
callq 0x9529
addq $0x150, %rsp            # imm = 0x150
cmpl $0x8, %eax
jne 0x54f7
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xb065
movq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x4cdb
leaq 0x9dbe(%rip), %rdi      # 0xf27b
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xaee0
movq -0x70(%rbp), %rsi
cmpl $0x1, (%rsi)
jne 0x5504
cmpl $0x2, 0x50(%rsi)
jne 0x5504
movq %rbx, %rdi
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4cdb
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xaeb8
leaq 0x9d89(%rip), %rdx      # 0xf294
movq %rbx, %rdi
addq $0x150, %rsp            # imm = 0x150
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x4990
leaq 0x9b5b(%rip), %rdi      # 0xf084
callq 0x94cd
leaq 0x996b(%rip), %rdi      # 0xeea0
callq 0x94cd
leaq 0x9c4e(%rip), %rdi      # 0xf18f
callq 0x9492