// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/compiler/backend/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 (BE_IS_EXPR_NODE(node->type)) {
		for (int i = 0; i < level; i++) {
			fputc(padchr, file);
		}
		fputs("|ExprNodeType: ", file);
		ParserASTNode *node_t = BE_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 0x4d2c1
jmp 0x4d2e0
leaq 0x29294(%rip), %rdi     # 0x7655c
leaq 0x355b1(%rip), %rsi     # 0x82880
movl $0x191c, %edx           # imm = 0x191C
leaq 0x3473e(%rip), %rcx     # 0x81a19
callq 0x30a0
cmpq $0x0, -0x10(%rbp)
je 0x4d2e9
jmp 0x4d308
leaq 0x25773(%rip), %rdi     # 0x72a63
leaq 0x35589(%rip), %rsi     # 0x82880
movl $0x191d, %edx           # imm = 0x191D
leaq 0x34716(%rip), %rcx     # 0x81a19
callq 0x30a0
cmpl $0x0, -0x14(%rbp)
jl 0x4d310
jmp 0x4d32f
leaq 0x34736(%rip), %rdi     # 0x81a4d
leaq 0x35562(%rip), %rsi     # 0x82880
movl $0x191e, %edx           # imm = 0x191E
leaq 0x346ef(%rip), %rcx     # 0x81a19
callq 0x30a0
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4d356
movsbl -0x15(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x30d0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4d336
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x4d377
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x4d384
leaq 0x346e7(%rip), %rax     # 0x81a65
movq %rax, -0x48(%rbp)
jmp 0x4d384
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 0x346b3(%rip), %rsi     # 0x81a58
movb $0x0, %al
callq 0x30f0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x4d420
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 0x4d404
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 0x4d3cc
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl (%rax), %edx
leaq 0x34650(%rip), %rsi     # 0x81a69
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 0x4d4a5
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x4d467
movsbl -0x15(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x30d0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4d447
movq -0x10(%rbp), %rsi
leaq 0x3846c(%rip), %rdi     # 0x858de
callq 0x30b0
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x4d497
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x60360
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 0x4d4e6
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 0x4d2a0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x4d4ac
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)