// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/frontend/semantics.c
// Function: print_ast
static void _print_ast(ParserASTNode *node, FILE *file, int level, char padchr) {
	assert(node);
	assert(file);
	assert(level >= 0);

	for (int i = 0; i < level; i++) {
		fputc(padchr, file);
	}
	fprintf(
		file,
		"@%s#%x#%p#%p",
		node->type_name != NULL ? node->type_name : "N/A",
		node->type,
		node->parent,
		node
	);
	if (node->token != NULL) {
		fputc('(', file);
		for (int i = 0; i < node->token->len; i++) {
			fputc(*(node->token->content + i), file);
		}
		fprintf(file, "#%x)", node->token->type);
	}
	fputc('\n', file);

	if (FE_IS_EXPR_NODE(node->type)) {
		for (int i = 0; i < level; i++) {
			fputc(padchr, file);
		}
		fputs("|ExprNodeType: ", file);
		ParserASTNode *node_t = FE_EXPR_AST_NODE_GET_TYPE_NODE(node);
		if (node_t != NULL) {
			_print_type_node(node_t, file);
		}
		fputc('\n', file);
	}

	for (int i = 0; i < node->nchilds; i++) {
		_print_ast(node->childs[i], file, level + 1, padchr);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movb %al, -0x15(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x4ddb1
jmp 0x4ddd0
leaq 0x2821b(%rip), %rdi     # 0x75fd3
leaq 0x3048b(%rip), %rsi     # 0x7e24a
movl $0x16af, %edx           # imm = 0x16AF
leaq 0x2f9b2(%rip), %rcx     # 0x7d77d
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x4ddd9
jmp 0x4ddf8
leaq 0x23c84(%rip), %rdi     # 0x71a64
leaq 0x30463(%rip), %rsi     # 0x7e24a
movl $0x16b0, %edx           # imm = 0x16B0
leaq 0x2f98a(%rip), %rcx     # 0x7d77d
callq 0x30a0
cmpl $0x0, -0x14(%rbp)
jl 0x4de00
jmp 0x4de1f
leaq 0x2f9aa(%rip), %rdi     # 0x7d7b1
leaq 0x3043c(%rip), %rsi     # 0x7e24a
movl $0x16b1, %edx           # imm = 0x16B1
leaq 0x2f963(%rip), %rcx     # 0x7d77d
callq 0x30a0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4de46
movsbl -0x15(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x30d0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4de26
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x4de67
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x4de74
leaq 0x2f95b(%rip), %rax     # 0x7d7c9
movq %rax, -0x48(%rbp)
jmp 0x4de74
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rdx
movq -0x8(%rbp), %rax
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movq 0x30(%rax), %r8
movq -0x8(%rbp), %r9
leaq 0x2f927(%rip), %rsi     # 0x7d7bc
movb $0x0, %al
callq 0x30f0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4df10
movq -0x10(%rbp), %rsi
movl $0x28, %edi
callq 0x30d0
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpl 0x4(%rcx), %eax
jge 0x4def4
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x20(%rbp), %rcx
movsbl (%rax,%rcx), %edi
movq -0x10(%rbp), %rsi
callq 0x30d0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4debc
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %edx
leaq 0x2f8c4(%rip), %rsi     # 0x7d7cd
movb $0x0, %al
callq 0x30f0
movq -0x10(%rbp), %rsi
movl $0xa, %edi
callq 0x30d0
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0xe00, %eax            # imm = 0xE00
jne 0x4df95
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4df57
movsbl -0x15(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x30d0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4df37
movq -0x10(%rbp), %rsi
leaq 0x33571(%rip), %rdi     # 0x814d3
callq 0x30b0
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x4df87
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x5f8a0
movq -0x10(%rbp), %rsi
movl $0xa, %edi
callq 0x30d0
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x4dfd6
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
movsbl -0x15(%rbp), %ecx
callq 0x4dd90
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4df9c
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)