// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/assembler/ins_enc.c
// Function: ins_enc_POP_Ev
void ins_enc_POP_Ev(
	Instruction *ins,
	InstructionEncoderData *data
) {
	_CHECK_PARAMS(1);

	ParserASTNode *ins_node = data->ins_node;

	ParserASTNode *oprd = ins_node->childs[0];

	EncoderInstruction enc_ins;
	
	ins_init(data->ctx, ins, ins_node, &enc_ins);

	size_t oprd_size = ins_get_oprd_size(data->ctx, oprd);

	switch (ASM_PARSER_CONTEXT_DATA_GET_ARCH(data->ctx)) {
		case ASM_ARCH_BIT16: {
			if (oprd_size == 2
					|| oprd_size == 4) {
				ins_fill_EX(data->ctx, ins, oprd, &enc_ins);
			} else {
				data->ctx->syntax_error_node_msg(
					data->ctx,
					ins_node,
					"instruction not supported in 16-bit mode."
				);
			}
			break;
		}
		case ASM_ARCH_BIT32: {
			if (oprd_size == 2
					|| oprd_size == 4) {
				ins_fill_EX(data->ctx, ins, oprd, &enc_ins);
			} else {
				data->ctx->syntax_error_node_msg(
					data->ctx,
					ins_node,
					"instruction not supported in 32-bit mode."
				);
			}
			break;
		}
		case ASM_ARCH_BIT64: {
			if (oprd_size == 2
					|| oprd_size == 8) {
				ins_fill_EX(data->ctx, ins, oprd, &enc_ins);
			} else {
				data->ctx->syntax_error_node_msg(
					data->ctx,
					ins_node,
					"instruction not supported in 64-bit mode."
				);
			}
			break;
		}
		default: {
			assert(0);
			break;
		}
	}

	_output(data, &enc_ins);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x23b7c
jmp 0x23b9b
leaq 0x25f83(%rip), %rdi     # 0x49b06
leaq 0x27496(%rip), %rsi     # 0x4b020
movl $0x78d, %edx            # imm = 0x78D
leaq 0x28283(%rip), %rcx     # 0x4be19
callq 0xa0b0
cmpq $0x0, -0x10(%rbp)
je 0x23ba4
jmp 0x23bc3
leaq 0x2c444(%rip), %rdi     # 0x4ffef
leaq 0x2746e(%rip), %rsi     # 0x4b020
movl $0x78d, %edx            # imm = 0x78D
leaq 0x2825b(%rip), %rcx     # 0x4be19
callq 0xa0b0
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x23bcf
jmp 0x23bee
leaq 0x274a7(%rip), %rdi     # 0x4b07d
leaq 0x27443(%rip), %rsi     # 0x4b020
movl $0x78d, %edx            # imm = 0x78D
leaq 0x28230(%rip), %rcx     # 0x4be19
callq 0xa0b0
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpl $0x1, 0x44(%rax)
jne 0x23bfd
jmp 0x23c1c
leaq 0x276fa(%rip), %rdi     # 0x4b2fe
leaq 0x27415(%rip), %rsi     # 0x4b020
movl $0x78d, %edx            # imm = 0x78D
leaq 0x28202(%rip), %rcx     # 0x4be19
callq 0xa0b0
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x80(%rbp), %rcx
callq 0x1a9e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1c580
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movl 0xb0(%rax), %eax
movl %eax, -0x8c(%rbp)
subl $0x1, %eax
je 0x23ca3
jmp 0x23c82
movl -0x8c(%rbp), %eax
subl $0x2, %eax
je 0x23cf8
jmp 0x23c8f
movl -0x8c(%rbp), %eax
subl $0x4, %eax
je 0x23d4a
jmp 0x23d9c
cmpq $0x2, -0x88(%rbp)
je 0x23cb7
cmpq $0x4, -0x88(%rbp)
jne 0x23cd2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x80(%rbp), %rcx
callq 0x1ad40
jmp 0x23cf3
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x18(%rbp), %rsi
leaq 0x2753b(%rip), %rdx     # 0x4b22c
callq *%rax
jmp 0x23dbb
cmpq $0x2, -0x88(%rbp)
je 0x23d0c
cmpq $0x4, -0x88(%rbp)
jne 0x23d27
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x80(%rbp), %rcx
callq 0x1ad40
jmp 0x23d48
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x18(%rbp), %rsi
leaq 0x27510(%rip), %rdx     # 0x4b256
callq *%rax
jmp 0x23dbb
cmpq $0x2, -0x88(%rbp)
je 0x23d5e
cmpq $0x8, -0x88(%rbp)
jne 0x23d79
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq -0x80(%rbp), %rcx
callq 0x1ad40
jmp 0x23d9a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
movq -0x18(%rbp), %rsi
leaq 0x275c6(%rip), %rdx     # 0x4b35e
callq *%rax
jmp 0x23dbb
leaq 0x236c2(%rip), %rdi     # 0x47465
leaq 0x27276(%rip), %rsi     # 0x4b020
movl $0x7c2, %edx            # imm = 0x7C2
leaq 0x28063(%rip), %rcx     # 0x4be19
callq 0xa0b0
movq -0x10(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x1e570
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)