// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/assembler/parser.c
// Function: new_node
static ParserASTNode * _new_node(
	ParserContext *ctx,
	int32_t type,
	char *type_name,
	LexerToken *token
) {
	assert(ctx);
	assert(type_name);

	if (type == ASM_NODE_INSTRUCTION) {
		AsmParserInsASTNodeData data;
		memset(&data, 0, sizeof(data));

		return parser_new_node(
			ctx, type, type_name, token, sizeof(AsmParserInsASTNodeData), &data
		);
	} else if (type == ASM_NODE_EXPR) {
		AsmParserExprASTNodeData data;
		data.result.type = ASM_EXPR_EVAL_RESULT_TYPE_NULL;

		return parser_new_node(
			ctx, type, type_name, token, sizeof(AsmParserExprASTNodeData), &data
		);
	} else if (type == ASM_NODE_REG) {
		AsmParserRegASTNodeData data;
		memset(&data, 0, sizeof(data));

		return parser_new_node(
			ctx, type, type_name, token, sizeof(AsmParserRegASTNodeData), &data
		);
	} else if (type == ASM_NODE_MEM) {
		AsmParserMemASTNodeData data;
		memset(&data, 0, sizeof(data));

		return parser_new_node(
			ctx, type, type_name, token, sizeof(AsmParserMemASTNodeData), &data
		);
	} else if (type == ASM_NODE_DIRECT_ADDRESS) {
		AsmParserDirectAddressASTNodeData data;
		memset(&data, 0, sizeof(data));

		return parser_new_node(
			ctx, type, type_name, token, sizeof(AsmParserDirectAddressASTNodeData), &data
		);
	} else {
		return parser_new_node(
			ctx, type, type_name, token, 0, NULL
		);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2ad83
jmp 0x2ada2
leaq 0x22dd7(%rip), %rdi     # 0x4db61
leaq 0x22927(%rip), %rsi     # 0x4d6b8
movl $0x1a, %edx
leaq 0x22e13(%rip), %rcx     # 0x4dbb0
callq 0xa0b0
cmpq $0x0, -0x20(%rbp)
je 0x2adab
jmp 0x2adca
leaq 0x22e47(%rip), %rdi     # 0x4dbf9
leaq 0x228ff(%rip), %rsi     # 0x4d6b8
movl $0x1b, %edx
leaq 0x22deb(%rip), %rcx     # 0x4dbb0
callq 0xa0b0
cmpl $0x400, -0x14(%rbp)     # imm = 0x400
jne 0x2ae0a
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0xa0d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x30, %r8d
leaq -0x58(%rbp), %r9
callq 0xea00
movq %rax, -0x8(%rbp)
jmp 0x2af24
cmpl $0xe00, -0x14(%rbp)     # imm = 0xE00
jne 0x2ae3e
movb $0x0, -0x70(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x18, %r8d
leaq -0x70(%rbp), %r9
callq 0xea00
movq %rax, -0x8(%rbp)
jmp 0x2af24
cmpl $0x500, -0x14(%rbp)     # imm = 0x500
jne 0x2ae7e
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0xa0d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x8, %r8d
leaq -0x78(%rbp), %r9
callq 0xea00
movq %rax, -0x8(%rbp)
jmp 0x2af24
cmpl $0x600, -0x14(%rbp)     # imm = 0x600
jne 0x2aec1
leaq -0xc8(%rbp), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0xa0d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x50, %r8d
leaq -0xc8(%rbp), %r9
callq 0xea00
movq %rax, -0x8(%rbp)
jmp 0x2af24
cmpl $0x700, -0x14(%rbp)     # imm = 0x700
jne 0x2af04
leaq -0xf0(%rbp), %rdi
xorl %esi, %esi
movl $0x28, %edx
callq 0xa0d0
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movl $0x28, %r8d
leaq -0xf0(%rbp), %r9
callq 0xea00
movq %rax, -0x8(%rbp)
jmp 0x2af24
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r9d
movq %r9, %r8
callq 0xea00
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)