// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/semantics.c
// Function: expr_unary
static void _expr_unary(
	ParserContext *ctx,
	ParserASTNode *node
) {
	assert(ctx);
	assert(node);

	uint32_t node_type = node->type;

	switch (node_type) {
		case BE_NODE_EXPR_NOT:
		case BE_NODE_EXPR_BNOT: {
			assert(node->nchilds == 1);

			ParserASTNode *node_oprd = node->childs[0];
			_expr_parenthesis(ctx, node_oprd);

			if (!_is_integer_type_node(ctx, node_oprd)) {
				switch (node_type) {
					case BE_NODE_EXPR_NOT: {
						_SYNERR_NODE(ctx, node, "unary operator '!' need integer operand.");
						break;
					}
					case BE_NODE_EXPR_BNOT: {
						_SYNERR_NODE(ctx, node, "unary operator '~' need integer operand.");
						break;
					}
					default: {
						assert(0);
					}
				}
			}

			BE_EXPR_AST_NODE_COPY(node, node_oprd);

			if (BE_EXPR_AST_NODE_GET_CONSTANT(node_oprd)) {
				_calc_unary_constexpr(ctx, node_type, node, node_oprd);
			}
			break;
		}
		case BE_NODE_EXPR_POSITIVE:
		case BE_NODE_EXPR_NEGATIVE: {
			assert(node->nchilds == 1);

			ParserASTNode *node_oprd = node->childs[0];
			_expr_parenthesis(ctx, node_oprd);

			if (!_is_number_type_node(ctx, node_oprd)) {
				switch (node_type) {
					case BE_NODE_EXPR_POSITIVE: {
						_SYNERR_NODE(ctx, node, "unary operator '+' need number operand.");
						break;
					}
					case BE_NODE_EXPR_NEGATIVE: {
						_SYNERR_NODE(ctx, node, "unary operator '-' need number operand.");
						break;
					}
					default: {
						assert(0);
					}
				}
			}

			BE_EXPR_AST_NODE_COPY(node, node_oprd);

			if (BE_EXPR_AST_NODE_GET_CONSTANT(node_oprd)) {
				BE_EXPR_AST_NODE_COPY_CONSTANT(node, node_oprd);
				_calc_unary_constexpr(ctx, node_type, node, node_oprd);
			}
			break;
		}
		case BE_NODE_EXPR_SIZEOF: {
			assert(node->nchilds == 1);

			ParserASTNode *node_oprd = node->childs[0];
			ParserASTNode *type_node = NULL;
			switch (_get_node_catagory(node_oprd->type)) {
				case BE_SEM_NODE_CATEGORY_TYPE: {
					_type(ctx, node_oprd, NULL);
					type_node = node_oprd;
					break;
				}
				case BE_SEM_NODE_CATAGORY_EXPR: {
					_expr(ctx, node_oprd);
					type_node = BE_EXPR_AST_NODE_GET_TYPE_NODE(node_oprd);
					break;
				}
				default: {
					assert(0);
					break;
				}
			}

			if (ctx->arch == BE_ARCH_32) {
				BE_EXPR_AST_NODE_SET_TYPE(node, BE_TYPE_UINT32);
				BE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_UINT32);

				BE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_UINT32_VAL(
					node, (uint32_t) _calc_type_size(ctx, node, type_node)
				);
			} else if (ctx->arch == BE_ARCH_64) {
				BE_EXPR_AST_NODE_SET_TYPE(node, BE_TYPE_UINT64);
				BE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_UINT64);
			
				BE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_UINT64_VAL(
					node, (uint64_t) _calc_type_size(ctx, node, type_node)
				);
			} else {
				assert(0);
			}

			BE_EXPR_AST_NODE_SET_CONSTANT(node, true);

			break;
		}
		case BE_NODE_EXPR_ALIGNOF: {
			assert(node->nchilds == 1);

			ParserASTNode *node_oprd = node->childs[0];
			ParserASTNode *type_node = NULL;
			switch (_get_node_catagory(node_oprd->type)) {
				case BE_SEM_NODE_CATEGORY_TYPE: {
					_type(ctx, node_oprd, NULL);
					type_node = node_oprd;
					break;
				}
				case BE_SEM_NODE_CATAGORY_EXPR: {
					_expr(ctx, node_oprd);
					type_node = BE_EXPR_AST_NODE_GET_TYPE_NODE(node_oprd);
					break;
				}
				default: {
					assert(0);
					break;
				}
			}

			size_t align = 0;
			if (node_oprd->type == BE_NODE_EXPR_ATOM
					&& node_oprd->childs[0]->type == BE_NODE_IDENTIFIER) {
				ParserSymbol *symbol = parser_get_symbol_from_node(
					ctx, node, BE_SYM_VAR, node_oprd->childs[0]->token
				);
				if (symbol != NULL) {
					align = BE_VAR_SYMBOL_GET_ALIGN(symbol);
				} else {
					align = _calc_type_align(ctx, node, type_node);
				}
			} else {
				align = _calc_type_align(ctx, node, type_node);
			}

			if (ctx->arch == BE_ARCH_32) {
				BE_EXPR_AST_NODE_SET_TYPE(node, BE_TYPE_UINT32);
				BE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_UINT32);

				BE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_UINT32_VAL(
					node, (uint32_t) align
				);
			} else if (ctx->arch == BE_ARCH_64) {
				BE_EXPR_AST_NODE_SET_TYPE(node, BE_TYPE_UINT64);
				BE_EXPR_AST_NODE_SET_TYPE_NODE(node, _NODE_TYPE_UINT64);
			
				BE_EXPR_AST_NODE_SET_CONSTEXPR_RESULT_UINT64_VAL(
					node, (uint64_t) align
				);
			} else {
				assert(0);
			}

			BE_EXPR_AST_NODE_SET_CONSTANT(node, true);
			break;
		}
		case BE_NODE_EXPR_CAST: {
			assert(node->nchilds == 2);

			ParserASTNode *node_type = node->childs[0];
			ParserASTNode *node_expr = node->childs[1];

			_type(ctx, node_type, NULL);
			_expr(ctx, node_expr);

			BE_EXPR_AST_NODE_COPY(node, node_expr);

			uint8_t node_type_type = _get_type_by_type_node(ctx, node_type);
			if (node_type_type == BE_TYPE_STRUCT
					|| node_type_type == BE_TYPE_ARRAY
					|| node_type_type == BE_TYPE_FUNC) {
				_SYNERR_NODE(
					ctx, node, "operator cast cannot cast operand to struct type or array type or function type."
				);
			}

			ParserASTNode *node_expr_type = BE_EXPR_AST_NODE_GET_TYPE_NODE(node_expr);
			uint8_t node_expr_type_type = _get_type_by_type_node(ctx, node_expr_type);
			if (node_expr_type_type == BE_TYPE_STRUCT
					|| node_expr_type_type == BE_TYPE_ARRAY
					|| node_expr_type_type == BE_TYPE_FUNC) {
				_SYNERR_NODE(
					ctx, node, "operator cast cannot cast struct type or array type or function type operand."
				);
			}

			BE_EXPR_AST_NODE_SET_TYPE(node, _get_type_by_type_node(ctx, node_type));
			BE_EXPR_AST_NODE_SET_TYPE_NODE(node, node_type);

			if (BE_EXPR_AST_NODE_GET_CONSTANT(node_expr)) {
				BE_EXPR_AST_NODE_SET_CONSTANT(node, true);
				_calc_cast_constexpr(ctx, node_type_type, node, node_expr);
			}
			break;
		}
		default: {
			_expr_parenthesis(ctx, node);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x18b0, %rsp           # imm = 0x18B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x54ccc
jmp 0x54ceb
leaq 0x2b48e(%rip), %rdi     # 0x80161
leaq 0x2dba6(%rip), %rsi     # 0x82880
movl $0xa07, %edx            # imm = 0xA07
leaq 0x2e650(%rip), %rcx     # 0x83336
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x54cf4
jmp 0x54d13
leaq 0x21861(%rip), %rdi     # 0x7655c
leaq 0x2db7e(%rip), %rsi     # 0x82880
movl $0xa08, %edx            # imm = 0xA08
leaq 0x2e628(%rip), %rcx     # 0x83336
callq 0x30a0
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0xfffff140, %eax       # imm = 0xFFFFF140
movl %eax, %ecx
movq %rcx, -0x1898(%rbp)
subl $0x8, %eax
ja 0x5558a
movq -0x1898(%rbp), %rax
leaq 0x2d104(%rip), %rcx     # 0x81e48
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x54d59
jmp 0x54d78
leaq 0x226ae(%rip), %rdi     # 0x7740e
leaq 0x2db19(%rip), %rsi     # 0x82880
movl $0xa0f, %edx            # imm = 0xA0F
leaq 0x2e5c3(%rip), %rcx     # 0x83336
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x55c60
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x50a80
testb $0x1, %al
jne 0x54e4b
movl -0x14(%rbp), %eax
movl %eax, -0x189c(%rbp)
subl $0xec0, %eax            # imm = 0xEC0
je 0x54dca
jmp 0x54dbb
movl -0x189c(%rbp), %eax
subl $0xec3, %eax            # imm = 0xEC3
je 0x54dfa
jmp 0x54e2a
leaq -0x420(%rbp), %rdi
leaq 0x2e591(%rip), %rsi     # 0x83369
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x420(%rbp), %rdx
callq *%rax
jmp 0x54e49
leaq -0x820(%rbp), %rdi
leaq 0x2e58a(%rip), %rsi     # 0x83392
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x820(%rbp), %rdx
callq *%rax
jmp 0x54e49
leaq 0x1e629(%rip), %rdi     # 0x7345a
leaq 0x2da48(%rip), %rsi     # 0x82880
movl $0xa1f, %edx            # imm = 0xA1F
leaq 0x2e4f2(%rip), %rcx     # 0x83336
callq 0x30a0
jmp 0x54e4b
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x20(%rbp), %rsi
addq $0x60, %rsi
movl $0x30, %edx
callq 0x3110
movq -0x20(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x54e83
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x55cf0
jmp 0x55597
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x54e94
jmp 0x54eb3
leaq 0x22573(%rip), %rdi     # 0x7740e
leaq 0x2d9de(%rip), %rsi     # 0x82880
movl $0xa2d, %edx            # imm = 0xA2D
leaq 0x2e488(%rip), %rcx     # 0x83336
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x828(%rbp)
movq -0x8(%rbp), %rdi
movq -0x828(%rbp), %rsi
callq 0x55c60
movq -0x8(%rbp), %rdi
movq -0x828(%rbp), %rsi
callq 0x564b0
testb $0x1, %al
jne 0x54f8f
movl -0x14(%rbp), %eax
movl %eax, -0x18a0(%rbp)
subl $0xec1, %eax            # imm = 0xEC1
je 0x54f0e
jmp 0x54eff
movl -0x18a0(%rbp), %eax
subl $0xec2, %eax            # imm = 0xEC2
je 0x54f3e
jmp 0x54f6e
leaq -0xc30(%rbp), %rdi
leaq 0x2e49f(%rip), %rsi     # 0x833bb
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0xc30(%rbp), %rdx
callq *%rax
jmp 0x54f8d
leaq -0x1030(%rbp), %rdi
leaq 0x2e497(%rip), %rsi     # 0x833e3
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x1030(%rbp), %rdx
callq *%rax
jmp 0x54f8d
leaq 0x1e4e5(%rip), %rdi     # 0x7345a
leaq 0x2d904(%rip), %rsi     # 0x82880
movl $0xa3d, %edx            # imm = 0xA3D
leaq 0x2e3ae(%rip), %rcx     # 0x83336
callq 0x30a0
jmp 0x54f8f
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x828(%rbp), %rsi
addq $0x60, %rsi
movl $0x30, %edx
callq 0x3110
movq -0x828(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x54fe4
movq -0x828(%rbp), %rax
movb 0x70(%rax), %cl
movq -0x10(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x70(%rax)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x828(%rbp), %rcx
callq 0x55cf0
jmp 0x55597
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x54ff5
jmp 0x55014
leaq 0x22412(%rip), %rdi     # 0x7740e
leaq 0x2d87d(%rip), %rsi     # 0x82880
movl $0xa4b, %edx            # imm = 0xA4B
leaq 0x2e327(%rip), %rcx     # 0x83336
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x1038(%rbp)
movq $0x0, -0x1040(%rbp)
movq -0x1038(%rbp), %rax
movl (%rax), %edi
callq 0x4efd0
movl %eax, %ecx
movl %ecx, -0x18a4(%rbp)
subl $0x1, %eax
je 0x5505b
jmp 0x5504e
movl -0x18a4(%rbp), %eax
subl $0x2, %eax
je 0x5507f
jmp 0x550a3
movq -0x8(%rbp), %rdi
movq -0x1038(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x4f020
movq -0x1038(%rbp), %rax
movq %rax, -0x1040(%rbp)
jmp 0x550c2
movq -0x8(%rbp), %rdi
movq -0x1038(%rbp), %rsi
callq 0x4f400
movq -0x1038(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x1040(%rbp)
jmp 0x550c2
leaq 0x1e3b0(%rip), %rdi     # 0x7345a
leaq 0x2d7cf(%rip), %rsi     # 0x82880
movl $0xa5b, %edx            # imm = 0xA5B
leaq 0x2e279(%rip), %rcx     # 0x83336
callq 0x30a0
movq -0x8(%rbp), %rax
cmpl $0x1, 0x30(%rax)
jne 0x5510d
movq -0x10(%rbp), %rax
movb $0x8, 0x60(%rax)
movq -0x10(%rbp), %rax
leaq 0x3f951(%rip), %rcx     # 0x94a30
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x1040(%rbp), %rdx
callq 0x4d5a0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x88(%rax)
movq -0x10(%rbp), %rax
movb $0x8, 0x71(%rax)
jmp 0x5517b
movq -0x8(%rbp), %rax
cmpl $0x2, 0x30(%rax)
jne 0x5515a
movq -0x10(%rbp), %rax
movb $0x9, 0x60(%rax)
movq -0x10(%rbp), %rax
leaq 0x3f966(%rip), %rcx     # 0x94a90
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x1040(%rbp), %rdx
callq 0x4d5a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x10(%rbp), %rax
movb $0x9, 0x71(%rax)
jmp 0x55179
leaq 0x1e2f9(%rip), %rdi     # 0x7345a
leaq 0x2d718(%rip), %rsi     # 0x82880
movl $0xa6f, %edx            # imm = 0xA6F
leaq 0x2e1c2(%rip), %rcx     # 0x83336
callq 0x30a0
jmp 0x5517b
movq -0x10(%rbp), %rax
movb $0x1, 0x70(%rax)
jmp 0x55597
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x55194
jmp 0x551b3
leaq 0x22273(%rip), %rdi     # 0x7740e
leaq 0x2d6de(%rip), %rsi     # 0x82880
movl $0xa77, %edx            # imm = 0xA77
leaq 0x2e188(%rip), %rcx     # 0x83336
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x1048(%rbp)
movq $0x0, -0x1050(%rbp)
movq -0x1048(%rbp), %rax
movl (%rax), %edi
callq 0x4efd0
movl %eax, %ecx
movl %ecx, -0x18a8(%rbp)
subl $0x1, %eax
je 0x551fa
jmp 0x551ed
movl -0x18a8(%rbp), %eax
subl $0x2, %eax
je 0x5521e
jmp 0x55242
movq -0x8(%rbp), %rdi
movq -0x1048(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x4f020
movq -0x1048(%rbp), %rax
movq %rax, -0x1050(%rbp)
jmp 0x55261
movq -0x8(%rbp), %rdi
movq -0x1048(%rbp), %rsi
callq 0x4f400
movq -0x1048(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x1050(%rbp)
jmp 0x55261
leaq 0x1e211(%rip), %rdi     # 0x7345a
leaq 0x2d630(%rip), %rsi     # 0x82880
movl $0xa87, %edx            # imm = 0xA87
leaq 0x2e0da(%rip), %rcx     # 0x83336
callq 0x30a0
movq $0x0, -0x1058(%rbp)
movq -0x1048(%rbp), %rax
cmpl $0xee0, (%rax)          # imm = 0xEE0
jne 0x552f7
movq -0x1048(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
cmpl $0x200, (%rax)          # imm = 0x200
jne 0x552f7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x1048(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rcx
movl $0x1, %edx
callq 0x82f0
movq %rax, -0x1060(%rbp)
cmpq $0x0, -0x1060(%rbp)
je 0x552da
movq -0x1060(%rbp), %rax
movslq 0x60(%rax), %rax
movq %rax, -0x1058(%rbp)
jmp 0x552f5
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x1050(%rbp), %rdx
callq 0x4f0a0
movq %rax, -0x1058(%rbp)
jmp 0x55312
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x1050(%rbp), %rdx
callq 0x4f0a0
movq %rax, -0x1058(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, 0x30(%rax)
jne 0x55350
movq -0x10(%rbp), %rax
movb $0x8, 0x60(%rax)
movq -0x10(%rbp), %rax
leaq 0x3f701(%rip), %rcx     # 0x94a30
movq %rcx, 0x68(%rax)
movq -0x1058(%rbp), %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x88(%rax)
movq -0x10(%rbp), %rax
movb $0x8, 0x71(%rax)
jmp 0x553ae
movq -0x8(%rbp), %rax
cmpl $0x2, 0x30(%rax)
jne 0x5538d
movq -0x10(%rbp), %rax
movb $0x9, 0x60(%rax)
movq -0x10(%rbp), %rax
leaq 0x3f723(%rip), %rcx     # 0x94a90
movq %rcx, 0x68(%rax)
movq -0x1058(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x88(%rax)
movq -0x10(%rbp), %rax
movb $0x9, 0x71(%rax)
jmp 0x553ac
leaq 0x1e0c6(%rip), %rdi     # 0x7345a
leaq 0x2d4e5(%rip), %rsi     # 0x82880
movl $0xaaa, %edx            # imm = 0xAAA
leaq 0x2df8f(%rip), %rcx     # 0x83336
callq 0x30a0
jmp 0x553ae
movq -0x10(%rbp), %rax
movb $0x1, 0x70(%rax)
jmp 0x55597
movq -0x10(%rbp), %rax
cmpl $0x2, 0x44(%rax)
jne 0x553c7
jmp 0x553e6
leaq 0x2d976(%rip), %rdi     # 0x82d44
leaq 0x2d4ab(%rip), %rsi     # 0x82880
movl $0xab1, %edx            # imm = 0xAB1
leaq 0x2df55(%rip), %rcx     # 0x83336
callq 0x30a0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x1068(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1070(%rbp)
movq -0x8(%rbp), %rdi
movq -0x1068(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x4f020
movq -0x8(%rbp), %rdi
movq -0x1070(%rbp), %rsi
callq 0x4f400
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x1070(%rbp), %rsi
addq $0x60, %rsi
movl $0x30, %edx
callq 0x3110
movq -0x8(%rbp), %rdi
movq -0x1068(%rbp), %rsi
callq 0x56560
movb %al, -0x1071(%rbp)
movzbl -0x1071(%rbp), %eax
cmpl $0xd, %eax
je 0x55486
movzbl -0x1071(%rbp), %eax
cmpl $0xe, %eax
je 0x55486
movzbl -0x1071(%rbp), %eax
cmpl $0xf, %eax
jne 0x554b4
leaq -0x1480(%rbp), %rdi
leaq 0x2df77(%rip), %rsi     # 0x8340b
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x1480(%rbp), %rdx
callq *%rax
movq -0x1070(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x1488(%rbp)
movq -0x8(%rbp), %rdi
movq -0x1488(%rbp), %rsi
callq 0x56560
movb %al, -0x1489(%rbp)
movzbl -0x1489(%rbp), %eax
cmpl $0xd, %eax
je 0x55500
movzbl -0x1489(%rbp), %eax
cmpl $0xe, %eax
je 0x55500
movzbl -0x1489(%rbp), %eax
cmpl $0xf, %eax
jne 0x5552e
leaq -0x1890(%rbp), %rdi
leaq 0x2df4e(%rip), %rsi     # 0x8345c
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x1890(%rbp), %rdx
callq *%rax
movq -0x8(%rbp), %rdi
movq -0x1068(%rbp), %rsi
callq 0x56560
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x60(%rax)
movq -0x1068(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x1070(%rbp), %rax
testb $0x1, 0x70(%rax)
je 0x55588
movq -0x10(%rbp), %rax
movb $0x1, 0x70(%rax)
movq -0x8(%rbp), %rdi
movb -0x1071(%rbp), %al
movq -0x10(%rbp), %rdx
movq -0x1070(%rbp), %rcx
movzbl %al, %esi
callq 0x56750
jmp 0x55597
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x55c60
addq $0x18b0, %rsp           # imm = 0x18B0
popq %rbp
retq