// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/frontend/irgen_c.c
// Function: ir_expr_atom
static bool _ir_expr_atom(
	IRGeneratorCContext *ctx,
	ResizableString *rstr,
	ParserASTNode *node_expr
) {
	assert(ctx);
	assert(rstr);
	assert(node_expr);

	if (node_expr->type != FE_NODE_EXPR_ATOM) {
		return false;
	}

	ParserASTNode *node = node_expr->childs[0];
	
	switch (node->type) {
		case FE_NODE_LITERAL_UINT: {
			_IR_EXPR_AUTO_CAST_BEGIN

			uint64_t val = fe_parser_get_uint_val(ctx->psrctx, node);
			char str[128];
			snprintf(str, sizeof(str), "%llu", val);
			rstr_append_with_cstr(rstr, str);

			_IR_EXPR_AUTO_CAST_END

			return true;
		}
		case FE_NODE_LITERAL_REAL: {
			_IR_EXPR_AUTO_CAST_BEGIN

			double val = fe_parser_get_double_val(ctx->psrctx, node);
			char str[128];
			snprintf(str, sizeof(str), "%lf", val);
			rstr_append_with_cstr(rstr, str);

			_IR_EXPR_AUTO_CAST_END

			return true;
		}
		case FE_NODE_LITERAL_CHAR:
		case FE_NODE_LITERAL_STRING: {
			rstr_append_with_raw(rstr, node->token->content, node->token->len);
			return true;
		}
		case FE_NODE_IDENTIFIER: {
			_ir_expr_identifier(ctx, rstr, node);
			return true;
		}
		default: {
			assert(0);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x22a40
jmp 0x22a5f
leaq 0x59b0f(%rip), %rdi     # 0x7c556
leaq 0x5439a(%rip), %rsi     # 0x76de8
movl $0x1a9, %edx            # imm = 0x1A9
leaq 0x5477e(%rip), %rcx     # 0x771d8
callq 0x30a0
cmpq $0x0, -0x18(%rbp)
je 0x22a68
jmp 0x22a87
leaq 0x5009f(%rip), %rdi     # 0x72b0e
leaq 0x54372(%rip), %rsi     # 0x76de8
movl $0x1aa, %edx            # imm = 0x1AA
leaq 0x54756(%rip), %rcx     # 0x771d8
callq 0x30a0
cmpq $0x0, -0x20(%rbp)
je 0x22a90
jmp 0x22aaf
leaq 0x5465e(%rip), %rdi     # 0x770f5
leaq 0x5434a(%rip), %rsi     # 0x76de8
movl $0x1ab, %edx            # imm = 0x1AB
leaq 0x5472e(%rip), %rcx     # 0x771d8
callq 0x30a0
movq -0x20(%rbp), %rax
cmpl $0xee0, (%rax)          # imm = 0xEE0
je 0x22ac4
movb $0x0, -0x1(%rbp)
jmp 0x22d29
movq -0x20(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x164(%rbp)
subl $0x200, %eax            # imm = 0x200
je 0x22cf3
jmp 0x22aec
movl -0x164(%rbp), %eax
subl $0x300, %eax            # imm = 0x300
je 0x22b27
jmp 0x22afb
movl -0x164(%rbp), %eax
subl $0x301, %eax            # imm = 0x301
je 0x22bf0
jmp 0x22b0e
movl -0x164(%rbp), %eax
addl $0xfffffcfe, %eax       # imm = 0xFFFFFCFE
subl $0x2, %eax
jb 0x22ccd
jmp 0x22d0a
leaq -0x38(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x68(%rax), %rdx
leaq -0x38(%rbp), %rsi
callq 0x216c0
movq -0x18(%rbp), %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x22b67
leaq 0x54d57(%rip), %rax     # 0x778b5
movq %rax, -0x178(%rbp)
jmp 0x22b72
movq -0x30(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x170(%rbp), %rdi
movq -0x178(%rbp), %rdx
leaq 0x545e4(%rip), %rsi     # 0x7716b
movb $0x0, %al
callq 0x94d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x429f0
movq %rax, -0x40(%rbp)
leaq -0xc0(%rbp), %rdi
movq -0x40(%rbp), %rcx
movl $0x80, %esi
leaq 0x545c0(%rip), %rdx     # 0x77179
movb $0x0, %al
callq 0x3090
movq -0x18(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x8d70
leaq -0x38(%rbp), %rdi
callq 0x9310
movq -0x18(%rbp), %rdi
movl $0x29, %esi
callq 0x8ea0
movb $0x1, -0x1(%rbp)
jmp 0x22d29
leaq -0xd0(%rbp), %rdi
callq 0x8c90
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x68(%rax), %rdx
leaq -0xd0(%rbp), %rsi
callq 0x216c0
movq -0x18(%rbp), %rax
movq %rax, -0x180(%rbp)
cmpq $0x0, -0xc8(%rbp)
jne 0x22c39
leaq 0x54c85(%rip), %rax     # 0x778b5
movq %rax, -0x188(%rbp)
jmp 0x22c47
movq -0xc8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x180(%rbp), %rdi
movq -0x188(%rbp), %rdx
leaq 0x5450f(%rip), %rsi     # 0x7716b
movb $0x0, %al
callq 0x94d0
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
callq 0x42ba0
movsd %xmm0, -0xd8(%rbp)
leaq -0x160(%rbp), %rdi
movsd -0xd8(%rbp), %xmm0
movl $0x80, %esi
leaq 0x544eb(%rip), %rdx     # 0x77181
movb $0x1, %al
callq 0x3090
movq -0x18(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0x8d70
leaq -0xd0(%rbp), %rdi
callq 0x9310
movq -0x18(%rbp), %rdi
movl $0x29, %esi
callq 0x8ea0
movb $0x1, -0x1(%rbp)
jmp 0x22d29
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movl 0x4(%rax), %edx
callq 0x8f90
movb $0x1, -0x1(%rbp)
jmp 0x22d29
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x25950
movb $0x1, -0x1(%rbp)
jmp 0x22d29
leaq 0x4f74a(%rip), %rdi     # 0x7245b
leaq 0x540d0(%rip), %rsi     # 0x76de8
movl $0x1d6, %edx            # imm = 0x1D6
leaq 0x544b4(%rip), %rcx     # 0x771d8
callq 0x30a0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw (%rax,%rax)