// File: /workspace/github_c_makefile_star2_O0/anuwu[P]ERPLAG-Compiler/ast.c
// Function: inorderAST
void inorderAST (astNode *node, int space)
{	
	if (node == NULL)
		return ;

	astNode *sib = node->child ;

	if (sib != NULL)
	{
		while (sib->next != NULL)
		{
			//inorderAST (sib, space + 1) ;
			sib = sib->next ;
		}

		
		while (sib != NULL)
		{
			inorderAST (sib, space+1) ;
			sib = sib->prev ;
		}
	}

	for (int i = 0 ; i < 2*space ; i++)
		printf (" ") ;

	
	if (node->tok == NULL)
	{
		if (node->dt == NULL)
			printf ("|(%s,%s)\n", tokenIDToString(node->id) , (node->parent == NULL)?"NULL":tokenIDToString(node->parent->id)) ;
		else
		{
			printf ("|(%s,%s) ---> ", tokenIDToString(node->id) , (node->parent == NULL)?"NULL":tokenIDToString(node->parent->id)) ;
			if (node->dtTag == PRIMITIVE)
				printf ("%s", tokenIDToString(node->dt->pType)) ;
			else
				printf ("%s[%s .. %s]", tokenIDToString(node->dt->arrType->type), node->dt->arrType->tokLeft->lexeme, node->dt->arrType->tokRight->lexeme) ;
			printf ("\n") ;
		}
	}
	else	
		printf ("|(%s,%s,%s)\n", tokenIDToString(node->id), node->tok->lexeme, (node->parent == NULL)?"NULL":tokenIDToString(node->parent->id)) ;

	//printf ("|(%s,%s)\n", (node->tok==NULL)?tokenIDToString(node->id):node->tok->lexeme, (node->parent == NULL)?"NULL":tokenIDToString(node->parent->id)) ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x6bfb
jmp 0x6e25
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x6c51
jmp 0x6c10
movq -0x18(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x6c29
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x6c10
jmp 0x6c2b
cmpq $0x0, -0x18(%rbp)
je 0x6c4f
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
addl $0x1, %esi
callq 0x6be0
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x6c2b
jmp 0x6c51
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl -0xc(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x6c7d
leaq 0x10cd9(%rip), %rdi     # 0x17944
movb $0x0, %al
callq 0x1090
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6c58
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x6dc1
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x6cec
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x6cbe
leaq 0x100ae(%rip), %rax     # 0x16d66
movq %rax, -0x30(%rbp)
jmp 0x6cd1
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
leaq 0x1007c(%rip), %rdi     # 0x16d5c
movb $0x0, %al
callq 0x1090
jmp 0x6dbf
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x6d13
leaq 0x10059(%rip), %rax     # 0x16d66
movq %rax, -0x40(%rbp)
jmp 0x6d26
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq 0x10036(%rip), %rdi     # 0x16d6b
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x6d68
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, %rsi
leaq 0x10adc(%rip), %rdi     # 0x1783b
movb $0x0, %al
callq 0x1090
jmp 0x6db1
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, %rsi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rcx
leaq 0xffd0(%rip), %rdi      # 0x16d7a
movb $0x0, %al
callq 0x1090
leaq 0xf049(%rip), %rdi      # 0x15e01
movb $0x0, %al
callq 0x1090
jmp 0x6e25
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x6df8
leaq 0xff74(%rip), %rax      # 0x16d66
movq %rax, -0x58(%rbp)
jmp 0x6e0b
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movl (%rax), %edi
callq 0xc8a0
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rcx
leaq 0xff69(%rip), %rdi      # 0x16d87
movb $0x0, %al
callq 0x1090
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)