// File: /workspace/github_c_makefile_star2_O1/Ihsoh[P]ilang/compiler/frontend/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 (FE_IS_EXPR_NODE(type)) {
		FeParserExprASTNodeData data;
		data.type = FE_TYPE_UNKNOWN;
		data.type_node = NULL;

		data.constant = false;
		data.constant_type = FE_TYPE_UNKNOWN;

		data.has_conststr = false;
		data.conststr.str = NULL;
		data.conststr.len = 0;

		return parser_new_node(
			ctx, type, type_name, token, sizeof(FeParserExprASTNodeData), &data
		);
	} else if (type == FE_NODE_VAR) {
		FeParserVarASTNodeData data;
		data.type = FE_VAR_TYPE_UNKNOWN;
		data.align_node = NULL;
		data.align = 0;
		return parser_new_node(
			ctx, type, type_name, token, sizeof(FeParserVarASTNodeData), &data
		);
	} else if (type == FE_NODE_VAR_ITEM) {
		FeParserVarItemASTNodeData data;
		data.symbol = NULL;
		return parser_new_node(
			ctx, type, type_name, token, sizeof(FeParserVarItemASTNodeData), &data
		);
	} else if (type == FE_NODE_FUNC) {
		FeParserFuncASTNodeData data;
		data.symbol = NULL;
		return parser_new_node(
			ctx, type, type_name, token, sizeof(FeParserFuncASTNodeData), &data
		);
	} else if (type == FE_NODE_FUNC_PARAMS_ITEM) {
		FeParserFuncParamASTNodeData data;
		data.symbol = NULL;
		return parser_new_node(
			ctx, type, type_name, token, sizeof(FeParserFuncParamASTNodeData), &data
		);
	} else if (type == FE_NODE_STAT_WHILE
			|| type == FE_NODE_STAT_DO
			|| type == FE_NODE_STAT_FOR) {
		FeParserLoopASTNodeData data;
		rstr_init(&(data.label_repeat));
		rstr_init(&(data.label_end));

		ParserASTNode *node = parser_new_node(
			ctx, type, type_name, token, sizeof(FeParserLoopASTNodeData), &data
		);
		node->releaser = _loop_ast_node_releaser;

		return node;
	} else if (type == FE_NODE_STRUCT) {
		FeParserStructASTNodeData data;

		data.packed_node = NULL;
		data.packed = false;

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
testq %rdi, %rdi
je 0x24575
movq %rdx, %r14
testq %rdx, %rdx
je 0x24594
movq %rcx, %rbx
movl %esi, %r12d
movq %rdi, %r15
movl %esi, %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x2440d
leaq -0x58(%rbp), %r9
movb $0x0, (%r9)
movq $0x0, 0x8(%r9)
movl $0x0, 0xf(%r9)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r9)
movl $0x30, %r8d
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x6721
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0xbff, %r12d           # imm = 0xBFF
jg 0x24477
leal -0xb20(%r12), %eax
cmpl $0x20, %eax
ja 0x244c1
movabsq $0x100010001, %rcx      # imm = 0x100010001
btq %rax, %rcx
jae 0x244c1
leaq -0x58(%rbp), %r13
movq %r13, %rdi
callq 0x7548
leaq -0x48(%rbp), %rdi
callq 0x7548
movl $0x20, %r8d
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rdx
movq %rbx, %rcx
movq %r13, %r9
callq 0x6721
leaq -0x171(%rip), %rcx      # 0x24300
movq %rcx, 0x50(%rax)
jmp 0x243fe
cmpl $0xd00, %r12d           # imm = 0xD00
je 0x244f1
cmpl $0xc01, %r12d           # imm = 0xC01
je 0x24557
cmpl $0xc00, %r12d           # imm = 0xC00
jne 0x24514
leaq -0x58(%rbp), %r9
movb $0x0, (%r9)
movq $0x0, 0x8(%r9)
movl $0x0, 0x10(%r9)
movl $0x18, %r8d
movq %r15, %rdi
movl $0xc00, %esi            # imm = 0xC00
jmp 0x243f3
cmpl $0xa00, %r12d           # imm = 0xA00
je 0x24539
cmpl $0xa02, %r12d           # imm = 0xA02
jne 0x24514
leaq -0x58(%rbp), %r9
movq $0x0, (%r9)
movl $0x8, %r8d
movq %r15, %rdi
movl $0xa02, %esi            # imm = 0xA02
jmp 0x243f3
leaq -0x58(%rbp), %r9
movq $0x0, (%r9)
movb $0x0, 0x8(%r9)
movl $0x10, %r8d
movq %r15, %rdi
movl $0xd00, %esi            # imm = 0xD00
jmp 0x243f3
movq %r15, %rdi
movl %r12d, %esi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6721
leaq -0x58(%rbp), %r9
movq $0x0, (%r9)
movl $0x8, %r8d
movq %r15, %rdi
movl $0xa00, %esi            # imm = 0xA00
jmp 0x243f3
leaq -0x58(%rbp), %r9
movq $0x0, (%r9)
movl $0x8, %r8d
movq %r15, %rdi
movl $0xc01, %esi            # imm = 0xC01
jmp 0x243f3
leaq 0x2a3ea(%rip), %rdi     # 0x4e966
leaq 0x24d99(%rip), %rsi     # 0x4931c
leaq 0x25467(%rip), %rcx     # 0x499f1
movl $0x25, %edx
callq 0x30a0
leaq 0x2549f(%rip), %rdi     # 0x49a3a
leaq 0x24d7a(%rip), %rsi     # 0x4931c
leaq 0x25448(%rip), %rcx     # 0x499f1
movl $0x26, %edx
callq 0x30a0