// File: /workspace/github_c_makefile_star2_O3/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 0x5355
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
testl %esi, %esi
je 0x5263
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x5255
movl 0x20(%r14), %esi
movl 0x28(%r14), %edx
leaq 0x85f2(%rip), %rdi      # 0xd864
xorl %eax, %eax
callq 0x20d0
cmpq $0x0, (%r14)
je 0x5356
testl %ebx, %ebx
je 0x5297
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x5289
leaq 0x85f6(%rip), %rdi      # 0xd894
leaq 0x85de(%rip), %rsi      # 0xd883
leaq 0x7d79(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x18(%r14), %rax
cmpq $0x0, 0x8(%rax)
jne 0x52da
leaq 0x85c6(%rip), %rdi      # 0xd88b
leaq 0x7d4d(%rip), %rsi      # 0xd019
leaq 0x7d52(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movl $0xa, %edi
callq 0x2040
movq 0x18(%r14), %rdi
movl %ebx, %esi
callq 0x4e91
testl %ebx, %ebx
je 0x5303
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x52f5
leaq 0x859a(%rip), %rdi      # 0xd8a4
leaq 0x8572(%rip), %rsi      # 0xd883
leaq 0x7d0d(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x8(%r14), %rax
movq 0x8(%rax), %r14
testq %r14, %r14
je 0x53f7
movl $0xa, %edi
callq 0x2040
leal 0x1(%rbx), %ebp
movq (%r14), %rdi
movl %ebp, %esi
callq 0x523a
movq 0x8(%r14), %r14
testq %r14, %r14
jne 0x533d
jmp 0x5413
retq
testl %ebx, %ebx
je 0x536a
movl %ebx, %ebp
movl $0x9, %edi
callq 0x2040
decl %ebp
jne 0x535c
leaq 0x8502(%rip), %rdi      # 0xd873
leaq 0x850b(%rip), %rsi      # 0xd883
leaq 0x7ca6(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movq 0x10(%r14), %rax
cmpq $0x0, 0x8(%rax)
jne 0x53ad
leaq 0x84f3(%rip), %rdi      # 0xd88b
leaq 0x7c7a(%rip), %rsi      # 0xd019
leaq 0x7c7f(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
movl $0xa, %edi
callq 0x2040
movq 0x10(%r14), %r15
testq %r15, %r15
je 0x5283
cmpq $0x0, 0x8(%r15)
je 0x5283
movl $0x1, %ebp
xorl %esi, %esi
movq %r15, %rdi
callq 0x6d0c
movq %rax, %rdi
movl %ebx, %esi
callq 0x5067
movl %ebp, %esi
incl %ebp
cmpq %rsi, 0x8(%r15)
ja 0x53d6
jmp 0x5283
leaq 0x8264(%rip), %rdi      # 0xd662
leaq 0x7c14(%rip), %rsi      # 0xd019
leaq 0x7c19(%rip), %rdx      # 0xd025
xorl %eax, %eax
callq 0x20d0
testl %ebx, %ebx
je 0x5425
movl $0x9, %edi
callq 0x2040
decl %ebx
jne 0x5417
leaq 0x8488(%rip), %rdi      # 0xd8b4
leaq 0x849b(%rip), %rsi      # 0xd8ce
leaq 0x7beb(%rip), %rdx      # 0xd025
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x20d0