// File: /workspace/github_c_makefile_star2_O0/System-Glitch[P]ESGILinter-C/src/test.c
// Function: test_expression
static void test_expression(char *line, unsigned int line_index, scope_t *scope) {
	printf("%sInput: %s\"%s\"%s\n", COLOR_BLUE, COLOR_YELLOW, line, FORMAT_RESET);

	messages_t *messages = malloc(sizeof(messages_t));
	messages->undeclared_functions = arraylist_init(ARRAYLIST_DEFAULT_CAPACITY);
	messages->undeclared_variables = arraylist_init(ARRAYLIST_DEFAULT_CAPACITY);
	messages->invalid_params       = arraylist_init(ARRAYLIST_DEFAULT_CAPACITY);
	messages->invalid_calls        = NULL;
	messages->variables_list       = NULL;
	messages->functions_list       = NULL;
	messages->wrong_assignment     = NULL;
	messages->wrong_return         = NULL;
	messages->ternary_types        = NULL;
	messages->operator_spacing     = NULL;
	type_t type = parse_expression(line, line_index, scope, messages);
	printf("%sOutput: %s\n", COLOR_BLUE, FORMAT_RESET);
	printf("\t%sType:       %s%s\n", COLOR_CYAN, FORMAT_RESET, type.name);
	printf("\t%sIs pointer: %s%d\n", COLOR_CYAN, FORMAT_RESET, type.is_pointer);

	free(type.name);

	for(size_t i = 0 ; i < messages->undeclared_functions->size ; i++) {
		printf("\t%sUndefined function: %s%s\n", COLOR_RED, FORMAT_RESET, ((function_t*)arraylist_get(messages->undeclared_functions, i))->name);
	}

	for(size_t i = 0 ; i < messages->undeclared_variables->size ; i++) {
		printf("\t%sUndefined variable: %s%s\n", COLOR_RED, FORMAT_RESET, (char*)arraylist_get(messages->undeclared_variables, i));
	}

	for(size_t i = 0 ; i < messages->invalid_params->size ; i++) {
		printf("\t%sInvalid param: %s%s\n", COLOR_RED, FORMAT_RESET, ((field_t*)arraylist_get(messages->invalid_params, i))->name);
	}

	function_list_free(messages->undeclared_functions);
	field_list_free(messages->invalid_params);
	arraylist_free(messages->undeclared_variables, 1);
	free(messages);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rcx
leaq 0xe768(%rip), %rdi      # 0x13426
leaq 0xe774(%rip), %rsi      # 0x13439
leaq 0xe353(%rip), %rdx      # 0x1301f
leaq 0xe352(%rip), %r8       # 0x13025
movb $0x0, %al
callq 0x20b0
movl $0x50, %edi
callq 0x2110
movq %rax, -0x20(%rbp)
movl $0xa, %edi
callq 0x8580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0xa, %edi
callq 0x8580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0xa, %edi
callq 0x8580
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x30(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x38(%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x10120
movq %rax, -0x30(%rbp)
movq %rdx, -0x28(%rbp)
leaq 0xe6a2(%rip), %rdi      # 0x1343f
leaq 0xe695(%rip), %rsi      # 0x13439
leaq 0xe27a(%rip), %rdx      # 0x13025
movb $0x0, %al
callq 0x20b0
movq -0x30(%rbp), %rcx
leaq 0xeeba(%rip), %rdi      # 0x13c77
leaq 0xe6c2(%rip), %rsi      # 0x13486
leaq 0xe25a(%rip), %rdx      # 0x13025
movb $0x0, %al
callq 0x20b0
movsbl -0x28(%rbp), %ecx
leaq 0xeeaf(%rip), %rdi      # 0x13c8c
leaq 0xe6a2(%rip), %rsi      # 0x13486
leaq 0xe23a(%rip), %rdx      # 0x13025
movb $0x0, %al
callq 0x20b0
movq -0x30(%rbp), %rdi
callq 0x2030
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4e53
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x38(%rbp), %rsi
callq 0x8890
movq (%rax), %rcx
leaq 0xee71(%rip), %rdi      # 0x13ca1
leaq 0xe1e2(%rip), %rsi      # 0x13019
leaq 0xe1e7(%rip), %rdx      # 0x13025
movb $0x0, %al
callq 0x20b0
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x4e03
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4ea9
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
callq 0x8890
movq %rax, %rcx
leaq 0xee38(%rip), %rdi      # 0x13cbe
leaq 0xe18c(%rip), %rsi      # 0x13019
leaq 0xe191(%rip), %rdx      # 0x13025
movb $0x0, %al
callq 0x20b0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x4e5b
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jae 0x4f01
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x48(%rbp), %rsi
callq 0x8890
movq (%rax), %rcx
leaq 0xedfd(%rip), %rdi      # 0x13cdb
leaq 0xe134(%rip), %rsi      # 0x13019
leaq 0xe139(%rip), %rdx      # 0x13025
movb $0x0, %al
callq 0x20b0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x4eb1
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8230
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x81d0
movq -0x20(%rbp), %rax
movq (%rax), %rdi
movl $0x1, %esi
callq 0x8a00
movq -0x20(%rbp), %rdi
callq 0x2030
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)