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

	uint32_t node_type = node->type;

	switch (node_type) {
		case FE_NODE_EXPR_INC_RIGHT:
		case FE_NODE_EXPR_DEC_RIGHT: {
			assert(node->nchilds == 1);

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

			if (!_expr_is_lvalue(ctx, node_oprd)) {
				switch (node_type) {
					case FE_NODE_EXPR_INC_RIGHT: {
						_SYNERR_NODE(ctx, node, "unary operator postfix '++' need number left value operand.");
						break;
					}
					case FE_NODE_EXPR_DEC_RIGHT: {
						_SYNERR_NODE(ctx, node, "unary operator postfix '--' need number left value operand.");
						break;
					}
					default: {
						assert(0);
					}
				}
			}

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

			FE_EXPR_AST_NODE_COPY(node, node_oprd);

			FE_EXPR_AST_NODE_SET_CONSTANT(node, false);
			break;
		}
		default: {
			_expr_member_arridx_fncall(ctx, node);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1030, %rsp           # imm = 0x1030
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5730c
jmp 0x5732b
leaq 0x25243(%rip), %rdi     # 0x7c556
leaq 0x26f30(%rip), %rsi     # 0x7e24a
movl $0xdae, %edx            # imm = 0xDAE
leaq 0x27c5d(%rip), %rcx     # 0x7ef83
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x57334
jmp 0x57353
leaq 0x1ec98(%rip), %rdi     # 0x75fd3
leaq 0x26f08(%rip), %rsi     # 0x7e24a
movl $0xdaf, %edx            # imm = 0xDAF
leaq 0x27c35(%rip), %rcx     # 0x7ef83
callq 0x30a0
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0xfffff135, %eax       # imm = 0xFFFFF135
subl $0x1, %eax
ja 0x57549
jmp 0x5736f
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x5737b
jmp 0x5739a
leaq 0x27d6e(%rip), %rdi     # 0x7f0f0
leaq 0x26ec1(%rip), %rsi     # 0x7e24a
movl $0xdb6, %edx            # imm = 0xDB6
leaq 0x27bee(%rip), %rcx     # 0x7ef83
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 0x59d60
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x510c0
cmpl $0x0, %eax
jne 0x5746e
movl -0x14(%rbp), %eax
movl %eax, -0x1024(%rbp)
subl $0xecb, %eax            # imm = 0xECB
je 0x573ed
jmp 0x573de
movl -0x1024(%rbp), %eax
subl $0xecc, %eax            # imm = 0xECC
je 0x5741d
jmp 0x5744d
leaq -0x420(%rbp), %rdi
leaq 0x27bc3(%rip), %rsi     # 0x7efbe
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 0x5746c
leaq -0x820(%rbp), %rdi
leaq 0x27bcf(%rip), %rsi     # 0x7effa
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 0x5746c
leaq 0x1b007(%rip), %rdi     # 0x7245b
leaq 0x26def(%rip), %rsi     # 0x7e24a
movl $0xdc6, %edx            # imm = 0xDC6
leaq 0x27b1c(%rip), %rcx     # 0x7ef83
callq 0x30a0
jmp 0x5746e
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x57d20
testb $0x1, %al
jne 0x57525
movl -0x14(%rbp), %eax
movl %eax, -0x1028(%rbp)
subl $0xecb, %eax            # imm = 0xECB
je 0x574a4
jmp 0x57495
movl -0x1028(%rbp), %eax
subl $0xecc, %eax            # imm = 0xECC
je 0x574d4
jmp 0x57504
leaq -0xc20(%rbp), %rdi
leaq 0x27b0c(%rip), %rsi     # 0x7efbe
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0xc20(%rbp), %rdx
callq *%rax
jmp 0x57523
leaq -0x1020(%rbp), %rdi
leaq 0x27b18(%rip), %rsi     # 0x7effa
movb $0x0, %al
callq 0x3160
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x1020(%rbp), %rdx
callq *%rax
jmp 0x57523
leaq 0x1af50(%rip), %rdi     # 0x7245b
leaq 0x26d38(%rip), %rsi     # 0x7e24a
movl $0xdd6, %edx            # imm = 0xDD6
leaq 0x27a65(%rip), %rcx     # 0x7ef83
callq 0x30a0
jmp 0x57525
movq -0x10(%rbp), %rdi
addq $0x60, %rdi
movq -0x20(%rbp), %rsi
addq $0x60, %rsi
movl $0x30, %edx
callq 0x3110
movq -0x10(%rbp), %rax
movb $0x0, 0x70(%rax)
jmp 0x57556
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x59d60
addq $0x1030, %rsp           # imm = 0x1030
popq %rbp
retq
nop