// File: /workspace/github_c_makefile_star2_O1/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 0x52a2
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
je 0x51b0
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x51a2
movl 0x20(%r14), %esi
movl 0x28(%r14), %edx
leaq 0x86a8(%rip), %rdi      # 0xd867
xorl %eax, %eax
callq 0x20d0
cmpq $0x0, (%r14)
je 0x52a3
testl %ebx, %ebx
je 0x51e4
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x51d6
leaq 0x86ac(%rip), %rdi      # 0xd897
leaq 0x8694(%rip), %rsi      # 0xd886
leaq 0x7e2c(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x18(%r14), %rax
cmpq $0x0, 0x8(%rax)
jne 0x5227
leaq 0x867c(%rip), %rdi      # 0xd88e
leaq 0x7e00(%rip), %rsi      # 0xd019
leaq 0x7e05(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movl $0xa, %edi
callq 0x2040
movq 0x18(%r14), %rdi
movl %ebx, %esi
callq 0x4e8d
testl %ebx, %ebx
je 0x5250
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x5242
leaq 0x8650(%rip), %rdi      # 0xd8a7
leaq 0x8628(%rip), %rsi      # 0xd886
leaq 0x7dc0(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x8(%r14), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x5344
movl $0xa, %edi
callq 0x2040
leal 0x1(%rbx), %ebp
movq (%r14), %rdi
movl %ebp, %esi
callq 0x5187
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x528a
jmp 0x5360
retq
testl %ebx, %ebx
je 0x52b7
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x52a9
leaq 0x85b8(%rip), %rdi      # 0xd876
leaq 0x85c1(%rip), %rsi      # 0xd886
leaq 0x7d59(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x10(%r14), %rax
cmpq $0x0, 0x8(%rax)
jne 0x52fa
leaq 0x85a9(%rip), %rdi      # 0xd88e
leaq 0x7d2d(%rip), %rsi      # 0xd019
leaq 0x7d32(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movl $0xa, %edi
callq 0x2040
movq 0x10(%r14), %r15
testq %r15, %r15
je 0x51d0
cmpq $0x0, 0x8(%r15)
je 0x51d0
movl $0x1, %ebp
xorl %esi, %esi
movq %r15, %rdi
callq 0x6c76
movq %rax, %rdi
movl %ebx, %esi
callq 0x5029
movl %ebp, %esi
incl %ebp
cmpq %rsi, 0x8(%r15)
ja 0x5323
jmp 0x51d0
leaq 0x831a(%rip), %rdi      # 0xd665
leaq 0x7cc7(%rip), %rsi      # 0xd019
leaq 0x7ccc(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
testl %ebx, %ebx
je 0x5372
movl $0x9, %edi
callq 0x2040
decl %ebx
jne 0x5364
leaq 0x853e(%rip), %rdi      # 0xd8b7
leaq 0x8551(%rip), %rsi      # 0xd8d1
leaq 0x7c9e(%rip), %rdx      # 0xd025
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20d0