// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/assembler/enc.c
// Function: eval_expr_atom
static void _eval_expr_atom(
	ParserContext *ctx,
	ParserASTNode *node,
	AsmExprEvalResult *result
) {
	assert(ctx);
	assert(node);
	assert(node->type == ASM_NODE_EXPR_ATOM);
	assert(node->nchilds == 1);
	assert(result);

	ParserASTNode *child = node->childs[0];

	LexerToken *token = child->token;

	switch (token->type) {
		case ASM_TOKEN_IDENTIFIER: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_UINT64;
			result->value.u64 = asm_parser_get_symbol_by_token_key(ctx, token);
			break;
		}
		case ASM_TOKEN_LITERAL_UINT_BIN: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_UINT64;
			result->value.u64 = util_get_uint64_bin_val(token->content, token->len);
			break;
		}
		case ASM_TOKEN_LITERAL_UINT_OCT: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_UINT64;
			result->value.u64 = util_get_uint64_oct_val(token->content, token->len);
			break;
		}
		case ASM_TOKEN_LITERAL_UINT_DEC: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_UINT64;
			result->value.u64 = util_get_uint64_dec_val(token->content, token->len);
			break;
		}
		case ASM_TOKEN_LITERAL_UINT_HEX: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_UINT64;
			result->value.u64 = util_get_uint64_hex_val(token->content, token->len);
			break;
		}
		case ASM_TOKEN_LITERAL_CHAR: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_UINT64;
			result->value.u64 = util_get_uint64_char_val(token->content, token->len);
			break;
		}
		case ASM_TOKEN_LITERAL_REAL: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_DOUBLE;
			result->value.d = util_get_double_val(token->content, token->len);
			break;
		}
		case ASM_TOKEN_LITERAL_STRING: {
			result->type = ASM_EXPR_EVAL_RESULT_TYPE_STRING;
			result->value.str.ptr = token->content + 1;
			result->value.str.len = token->len - 2;
			break;
		}
		default: {
			assert(0);
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x18f2d
jmp 0x18f4c
leaq 0x34c2d(%rip), %rdi     # 0x4db61
leaq 0x30665(%rip), %rsi     # 0x495a0
movl $0x15, %edx
leaq 0x3084b(%rip), %rcx     # 0x49792
callq 0xa0b0
cmpq $0x0, -0x10(%rbp)
je 0x18f55
jmp 0x18f74
leaq 0x3212b(%rip), %rdi     # 0x4b087
leaq 0x3063d(%rip), %rsi     # 0x495a0
movl $0x16, %edx
leaq 0x30823(%rip), %rcx     # 0x49792
callq 0xa0b0
movq -0x10(%rbp), %rax
cmpl $0xee0, (%rax)          # imm = 0xEE0
jne 0x18f82
jmp 0x18fa1
leaq 0x30855(%rip), %rdi     # 0x497de
leaq 0x30610(%rip), %rsi     # 0x495a0
movl $0x17, %edx
leaq 0x307f6(%rip), %rcx     # 0x49792
callq 0xa0b0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x44(%rax)
jne 0x18fad
jmp 0x18fcc
leaq 0x31ac2(%rip), %rdi     # 0x4aa76
leaq 0x305e5(%rip), %rsi     # 0x495a0
movl $0x18, %edx
leaq 0x307cb(%rip), %rcx     # 0x49792
callq 0xa0b0
cmpq $0x0, -0x18(%rbp)
je 0x18fd5
jmp 0x18ff4
leaq 0x3064a(%rip), %rdi     # 0x49626
leaq 0x305bd(%rip), %rsi     # 0x495a0
movl $0x19, %edx
leaq 0x307a3(%rip), %rcx     # 0x49792
callq 0xa0b0
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
subl $0x1000, %eax           # imm = 0x1000
je 0x190b9
jmp 0x19025
movl -0x2c(%rbp), %eax
subl $0x1001, %eax           # imm = 0x1001
je 0x190e4
jmp 0x19035
movl -0x2c(%rbp), %eax
subl $0x1002, %eax           # imm = 0x1002
je 0x1910f
jmp 0x19045
movl -0x2c(%rbp), %eax
subl $0x1003, %eax           # imm = 0x1003
je 0x1913a
jmp 0x19055
movl -0x2c(%rbp), %eax
subl $0x1004, %eax           # imm = 0x1004
je 0x1918d
jmp 0x19065
movl -0x2c(%rbp), %eax
subl $0x1005, %eax           # imm = 0x1005
je 0x19165
jmp 0x19075
movl -0x2c(%rbp), %eax
subl $0x1006, %eax           # imm = 0x1006
je 0x191b3
jmp 0x19085
movl -0x2c(%rbp), %eax
subl $0x2000, %eax           # imm = 0x2000
jne 0x191e5
jmp 0x19095
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2a7f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x19204
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x13960
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x19204
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x13c10
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x19204
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x13ec0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x19204
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x14150
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x19204
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x135f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x19204
movq -0x18(%rbp), %rax
movb $0x2, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x144c0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x8(%rax)
jmp 0x19204
movq -0x18(%rbp), %rax
movb $0x3, (%rax)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
subl $0x2, %eax
movslq %eax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x19204
leaq 0x2e279(%rip), %rdi     # 0x47465
leaq 0x303ad(%rip), %rsi     # 0x495a0
movl $0x4a, %edx
leaq 0x30593(%rip), %rcx     # 0x49792
callq 0xa0b0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)