// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
testq %rsi, %rsi
je 0x2dfbd
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %r12d
leal -0xecb(%r12), %eax
cmpl $0x1, %eax
ja 0x2deb0
cmpl $0x1, 0x44(%rbx)
jne 0x2dfdc
movq 0x48(%rbx), %rax
movq (%rax), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x2f027
movq %r15, %rdi
callq 0x2a37d
testl %eax, %eax
jne 0x2df06
cmpl $0xecb, %r12d           # imm = 0xECB
jne 0x2deca
movups 0x1a844(%rip), %xmm0    # 0x486ca
leaq -0x420(%rbp), %rdx
movups %xmm0, 0x2c(%rdx)
movups 0x1a826(%rip), %xmm0    # 0x486be
movaps %xmm0, 0x20(%rdx)
movups 0x1a80b(%rip), %xmm0    # 0x486ae
movaps %xmm0, 0x10(%rdx)
movups 0x1a7f0(%rip), %xmm0    # 0x4869e
jmp 0x2def9
movq %r14, %rdi
movq %rbx, %rsi
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2f027
movups 0x1a835(%rip), %xmm0    # 0x48706
leaq -0x420(%rbp), %rdx
movups %xmm0, 0x2c(%rdx)
movups 0x1a817(%rip), %xmm0    # 0x486fa
movaps %xmm0, 0x20(%rdx)
movups 0x1a7fc(%rip), %xmm0    # 0x486ea
movaps %xmm0, 0x10(%rdx)
movups 0x1a7e1(%rip), %xmm0    # 0x486da
movaps %xmm0, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq *0x58(%r14)
movq %r15, %rdi
callq 0x2e394
testb %al, %al
jne 0x2df88
cmpl $0xecb, %r12d           # imm = 0xECB
jne 0x2df4c
movups 0x1a7a8(%rip), %xmm0    # 0x486ca
leaq -0x420(%rbp), %rdx
movups %xmm0, 0x2c(%rdx)
movups 0x1a78a(%rip), %xmm0    # 0x486be
movaps %xmm0, 0x20(%rdx)
movups 0x1a76f(%rip), %xmm0    # 0x486ae
movaps %xmm0, 0x10(%rdx)
movups 0x1a754(%rip), %xmm0    # 0x4869e
jmp 0x2df7b
movups 0x1a7b3(%rip), %xmm0    # 0x48706
leaq -0x420(%rbp), %rdx
movups %xmm0, 0x2c(%rdx)
movups 0x1a795(%rip), %xmm0    # 0x486fa
movaps %xmm0, 0x20(%rdx)
movups 0x1a77a(%rip), %xmm0    # 0x486ea
movaps %xmm0, 0x10(%rdx)
movups 0x1a75f(%rip), %xmm0    # 0x486da
movaps %xmm0, (%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq *0x58(%r14)
movups 0x60(%r15), %xmm0
movups 0x70(%r15), %xmm1
movups 0x80(%r15), %xmm2
movups %xmm1, 0x70(%rbx)
movups %xmm2, 0x80(%rbx)
movups %xmm0, 0x60(%rbx)
movb $0x0, 0x70(%rbx)
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11e2e(%rip), %rdi     # 0x3fdf2
leaq 0x1996f(%rip), %rsi     # 0x4793a
leaq 0x1a691(%rip), %rcx     # 0x48663
movl $0xdaf, %edx            # imm = 0xDAF
callq 0x30a0
leaq 0x1a7ed(%rip), %rdi     # 0x487d0
leaq 0x19950(%rip), %rsi     # 0x4793a
leaq 0x1a672(%rip), %rcx     # 0x48663
movl $0xdb6, %edx            # imm = 0xDB6
callq 0x30a0