// File: /workspace/github_c_makefile_star2_O0/System-Glitch[P]ESGILinter-C/src/test.c
// Function: test_parse_expression
static void test_parse_expression() {

	printf("------------------------------%s\n", FORMAT_RESET);
	printf("%sTESTING PARSE EXPRESSION%s\n", COLOR_GREEN_BOLD, FORMAT_RESET);

	arraylist_t *file = arraylist_init(ARRAYLIST_DEFAULT_CAPACITY);
	arraylist_add(file, strduplicate("static int glob = 89;"));
	arraylist_add(file, strduplicate("unsigned int variable = 89;"));
	arraylist_add(file, strduplicate("static unsigned char b = 98;"));
	arraylist_add(file, strduplicate("void function(int param);"));

	arraylist_add(file, strduplicate("char function(int param) {"));
	arraylist_add(file, strduplicate("\tchar c = 'c';"));
	arraylist_add(file, strduplicate("\tprintf(\"%c %d\", c, i);"));
	arraylist_add(file, strduplicate("}"));

	arraylist_add(file, strduplicate("int main() {"));
	arraylist_add(file, strduplicate("\tint i = 42;"));
	arraylist_add(file, strduplicate("}"));

	arraylist_add(file, strduplicate("char* test2(char v) {"));
	arraylist_add(file, strduplicate("\tint i = 42;"));
	arraylist_add(file, strduplicate("}"));

	scope_t *scope = parse_root_scope(file);

	test_expression("(char)c", 0, scope);
	test_expression("(char) ", 0, scope);
	test_expression("(char) c", 0, scope);
	test_expression("(char) test('c')", 0, scope);
	test_expression("b", 5, scope);
	test_expression("(  unsigned char   ) c", 0, scope);
	test_expression("'d'", 0, scope);
	test_expression("\"d\"", 0, scope);
	test_expression("function()", 10, scope);
	test_expression("test2()", 20, scope);
	test_expression("/*comment */test2()", 20, scope);
	test_expression("/*comment */ test2(/* comment */)", 20, scope);
	test_expression("variable", 4, scope);
	test_expression("*& &  variable", 4, scope);
	test_expression("--  variable", 4, scope);
	test_expression("++  variable", 4, scope);
	test_expression("variable++", 4, scope);
	test_expression("variable--", 4, scope);
	test_expression("++variable--", 4, scope);
	test_expression("4", 0, scope);
	test_expression("123456789", 0, scope);
	test_expression("4u", 0, scope);
	test_expression("4l", 0, scope);
	test_expression("4lu", 0, scope);
	test_expression("1.2", 0, scope);
	test_expression("1.2f", 0, scope);
	test_expression(".4", 0, scope);
	test_expression(".4f", 0, scope);
	test_expression(".4l", 0, scope);
	test_expression(".4 l", 0, scope);
	test_expression(". 4", 0, scope);
	test_expression("\"string \\\" quote\"", 0, scope);
	test_expression("\"test * something\"", 0, scope);
	test_expression("\"/* comment */\"", 0, scope);
	test_expression("!function('c')", 20, scope);
	test_expression("!!!function(4)", 20, scope);

	test_expression("!b", 9, scope);
	test_expression("!!b", 9, scope);
	test_expression("!++b", 9, scope);
	test_expression("!*&b", 9, scope);
	test_expression("!&b", 9, scope);

	test_expression("((char)variable )", 9, scope);
	test_expression("a /* test */", 9, scope);
	test_expression("\"a:b\"", 9, scope);

	scope_free(scope);
	arraylist_free(file, 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
leaq 0xe91f(%rip), %rdi      # 0x13031
leaq 0xe90c(%rip), %rsi      # 0x13025
movb $0x0, %al
callq 0x20b0
leaq 0xf35e(%rip), %rdi      # 0x13a85
leaq 0xe94d(%rip), %rsi      # 0x1307b
leaq 0xe8f0(%rip), %rdx      # 0x13025
movb $0x0, %al
callq 0x20b0
movl $0xa, %edi
callq 0x8580
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq 0xef31(%rip), %rdi      # 0x1368a
callq 0xa550
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq 0xf32a(%rip), %rdi      # 0x13aa3
callq 0xa550
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0xebc9(%rip), %rdi      # 0x13362
callq 0xa550
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq 0xf306(%rip), %rdi      # 0x13abf
callq 0xa550
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0xf300(%rip), %rdi      # 0x13ad9
callq 0xa550
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0xeebe(%rip), %rdi      # 0x136b7
callq 0xa550
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0xeead(%rip), %rdi      # 0x136c6
callq 0xa550
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0xfc70(%rip), %rdi      # 0x144a9
callq 0xa550
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
leaq 0xee85(%rip), %rdi      # 0x136de
callq 0xa550
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0xee72(%rip), %rdi      # 0x136eb
callq 0xa550
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq 0xfc10(%rip), %rdi      # 0x144a9
callq 0xa550
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0xf0c8(%rip), %rdi      # 0x13981
callq 0xa550
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0xee12(%rip), %rdi      # 0x136eb
callq 0xa550
movq -0x20(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0xfbb0(%rip), %rdi      # 0x144a9
callq 0xa550
movq -0x18(%rbp), %rdi
movq %rax, %rsi
callq 0x8730
movq -0x8(%rbp), %rdi
callq 0x77a0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdx
leaq 0xf1d2(%rip), %rdi      # 0x13af4
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf1c8(%rip), %rdi      # 0x13afc
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf1be(%rip), %rdi      # 0x13b04
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf1b5(%rip), %rdi      # 0x13b0d
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf440(%rip), %rdi      # 0x13daa
movl $0x5, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf19f(%rip), %rdi      # 0x13b1e
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf1a4(%rip), %rdi      # 0x13b35
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf196(%rip), %rdi      # 0x13b39
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf188(%rip), %rdi      # 0x13b3d
movl $0xa, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf18a(%rip), %rdi      # 0x13b54
movl $0x14, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf169(%rip), %rdi      # 0x13b48
movl $0x14, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf168(%rip), %rdi      # 0x13b5c
movl $0x14, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf17b(%rip), %rdi      # 0x13b84
movl $0x4, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf160(%rip), %rdi      # 0x13b7e
movl $0x4, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf15a(%rip), %rdi      # 0x13b8d
movl $0x4, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf152(%rip), %rdi      # 0x13b9a
movl $0x4, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf14a(%rip), %rdi      # 0x13ba7
movl $0x4, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf142(%rip), %rdi      # 0x13bb4
movl $0x4, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf12b(%rip), %rdi      # 0x13bb2
movl $0x4, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf479(%rip), %rdi      # 0x13f15
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf111(%rip), %rdi      # 0x13bbf
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf109(%rip), %rdi      # 0x13bc9
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf10f(%rip), %rdi      # 0x13be1
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf0e8(%rip), %rdi      # 0x13bcc
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf0da(%rip), %rdi      # 0x13bd0
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf0cc(%rip), %rdi      # 0x13bd4
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf0bf(%rip), %rdi      # 0x13bd9
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf0b0(%rip), %rdi      # 0x13bdc
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf0a2(%rip), %rdi      # 0x13be0
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf094(%rip), %rdi      # 0x13be4
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf087(%rip), %rdi      # 0x13be9
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf079(%rip), %rdi      # 0x13bed
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf079(%rip), %rdi      # 0x13bff
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf07a(%rip), %rdi      # 0x13c12
xorl %esi, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf078(%rip), %rdi      # 0x13c22
movl $0x14, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf072(%rip), %rdi      # 0x13c31
movl $0x14, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf06d(%rip), %rdi      # 0x13c41
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf057(%rip), %rdi      # 0x13c40
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf046(%rip), %rdi      # 0x13c44
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf036(%rip), %rdi      # 0x13c49
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf026(%rip), %rdi      # 0x13c4e
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf015(%rip), %rdi      # 0x13c52
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf012(%rip), %rdi      # 0x13c64
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdx
leaq 0xf00a(%rip), %rdi      # 0x13c71
movl $0x9, %esi
callq 0x4ca0
movq -0x10(%rbp), %rdi
callq 0x7fa0
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x8a00
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)