// File: /workspace/github_c_makefile_star2_O2/System-Glitch[P]ESGILinter-C/src/test.c
// Function: print_scope
static void print_scope(scope_t *scope, unsigned int level) {

	node_t *current;

	if(scope == NULL) return;

	for(unsigned int i = 0 ; i < level ; i++)
		printf("\t");
	printf("From %d to %d\n", scope->from_line, scope->to_line);

	if(scope->parent == NULL) { //Is root scope
		for(unsigned int i = 0 ; i < level ; i++)
			printf("\t");
		printf("%sFunctions:%s ", COLOR_CYAN_BOLD, FORMAT_RESET);
		if(scope->functions->size == 0) printf("%sNone%s", COLOR_RED, FORMAT_RESET);
		printf("\n");
		print_functions(scope->functions, level);
	}

	for(unsigned int i = 0 ; i < level ; i++)
		printf("\t");
	printf("%sVariables:%s ", COLOR_CYAN_BOLD, FORMAT_RESET);
	if(scope->variables->size == 0) printf("%sNone%s", COLOR_RED, FORMAT_RESET);
	printf("\n");
	print_variables(scope->variables, level);

	for(unsigned int i = 0 ; i < level ; i++)
		printf("\t");
	printf("%sChildren:%s  ", COLOR_CYAN_BOLD, FORMAT_RESET);
	current = scope->children->head;
	if(current != NULL) {
		printf("\n");
		do {
			print_scope(current->val, level + 1);
		} while ((current = current->next) != NULL);
	} else {
		printf("%sNone%s\n", COLOR_RED, FORMAT_RESET);
	}

	for(unsigned int i = 0 ; i < level ; i++)
		printf("\t");
	printf("%s--------------------%s\n", FORMAT_DIM, FORMAT_RESET);
}

// Assembly:
testq %rdi, %rdi
je 0x50ba
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
pushq $0x9
popq %rbp
movl %esi, %r15d
subl $0x1, %r15d
jb 0x5083
movl %ebp, %edi
callq 0x2040
jmp 0x5074
movl 0x20(%r14), %esi
movl 0x28(%r14), %edx
leaq 0x87d2(%rip), %rdi      # 0xd864
xorl %eax, %eax
callq 0x20d0
cmpq $0x0, (%r14)
movl %ebx, %ebp
jne 0x5144
pushq $0x9
popq %rbp
movl %ebx, %r15d
subl $0x1, %r15d
jb 0x50bb
movl %ebp, %edi
callq 0x2040
jmp 0x50ab
retq
leaq 0x87b1(%rip), %rdi      # 0xd873
leaq 0x87ba(%rip), %rsi      # 0xd883
leaq 0x7f55(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x10(%r14), %rax
cmpq $0x0, 0x8(%rax)
jne 0x50fe
leaq 0x87a2(%rip), %rdi      # 0xd88b
leaq 0x7f29(%rip), %rsi      # 0xd019
leaq 0x7f2e(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
pushq $0xa
popq %rdi
callq 0x2040
movq 0x10(%r14), %r15
movl %ebx, %ebp
testq %r15, %r15
je 0x5144
xorl %eax, %eax
movl %eax, %r12d
cmpq %r12, 0x8(%r15)
jbe 0x5138
movq %r15, %rdi
movq %r12, %rsi
callq 0x6978
movq %rax, %rdi
movl %ebx, %esi
callq 0x4ee6
leal 0x1(%r12), %eax
jmp 0x5113
movl %ebx, %ebp
jmp 0x5144
pushq $0x9
popq %rdi
callq 0x2040
subl $0x1, %ebp
jae 0x513c
leaq 0x8744(%rip), %rdi      # 0xd894
leaq 0x872c(%rip), %rsi      # 0xd883
leaq 0x7ec7(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x18(%r14), %rax
cmpq $0x0, 0x8(%rax)
jne 0x518c
leaq 0x8714(%rip), %rdi      # 0xd88b
leaq 0x7e9b(%rip), %rsi      # 0xd019
leaq 0x7ea0(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
pushq $0xa
popq %rdi
callq 0x2040
movq 0x18(%r14), %rdi
movl %ebx, %esi
callq 0x4d58
pushq $0x9
popq %rbp
movl %ebx, %r15d
subl $0x1, %r15d
jb 0x51b4
movl %ebp, %edi
callq 0x2040
jmp 0x51a5
leaq 0x86e9(%rip), %rdi      # 0xd8a4
leaq 0x86c1(%rip), %rsi      # 0xd883
leaq 0x7e5c(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x8(%r14), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x51fd
pushq $0xa
popq %rdi
callq 0x2040
leal 0x1(%rbx), %ebp
movq (%r14), %rdi
movl %ebp, %esi
callq 0x505c
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x51e8
jmp 0x5219
leaq 0x845e(%rip), %rdi      # 0xd662
leaq 0x7e0e(%rip), %rsi      # 0xd019
leaq 0x7e13(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
pushq $0x9
popq %rbp
subl $0x1, %ebx
jb 0x522a
movl %ebp, %edi
callq 0x2040
jmp 0x521c
leaq 0x8683(%rip), %rdi      # 0xd8b4
leaq 0x8696(%rip), %rsi      # 0xd8ce
leaq 0x7de6(%rip), %rdx      # 0xd025
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x20d0