// File: /workspace/github_c_makefile_star2_O1/been-jamming[P]MinimalCC/expression.c
// Function: compile_value
void compile_value(value *output, char **c, unsigned char dereference, unsigned char force_stack, FILE *output_file){
	char *temp_c;
	type cast_type;

	skip_whitespace(c);

	if(**c == '*'){
		++*c;
		compile_value(output, c, 1, force_stack, output_file);
		if(dereference){
			compile_dereference(output, output_file);
		}
		output->is_reference = !dereference;
		return;
	} else if(**c == '&'){
		++*c;
		if(dereference){
			compile_value(output, c, 0, force_stack, output_file);
		} else {
			snprintf(error_message, sizeof(error_message), "Can't get address of r-value");
			do_error(1);
		}
		output->is_reference = 0;
		return;
	} else if(**c == '!'){
		++*c;
		if(dereference){
			compile_value(output, c, 1, force_stack, output_file);
			compile_logical_not(output, output_file);
		} else {
			snprintf(error_message, sizeof(error_message), "Can't get address of r-value");
			do_error(1);
		}
		output->is_reference = 0;
		return;
	} else if(**c == '~'){
		++*c;
		if(dereference){
			compile_value(output, c, 1, force_stack, output_file);
			compile_not(output, output_file);
		} else {
			snprintf(error_message, sizeof(error_message), "Can't get address of r-value");
			do_error(1);
		}
		output->is_reference = 0;
		return;
	} else if(**c == '-' && !digit((*c)[1])){
		++*c;
		if(dereference){
			compile_value(output, c, 1, force_stack, output_file);
			compile_negate(output, output_file);
		} else {
			snprintf(error_message, sizeof(error_message), "Can't get address of r-value");
			do_error(1);
		}
		output->is_reference = 0;
		return;
	}

	if(**c == '('){
		++*c;
		skip_whitespace(c);
		temp_c = *c;
		//Type casting
		if(parse_datatype(NULL, &temp_c)){
			cast_type = EMPTY_TYPE;
			parse_type(&cast_type, c, NULL, NULL, 0, 0);
			if(**c != ')'){
				snprintf(error_message, sizeof(error_message), "Expected ')'");
				do_error(1);
			}
			++*c;
			compile_value(output, c, 1, force_stack, output_file);
			cast(output, cast_type, 0, output_file);
		//Associative parentheses
		} else {
			compile_expression(output, c, dereference, force_stack, output_file);
			if(**c == ')'){
				++*c;
			} else {
				snprintf(error_message, sizeof(error_message), "Expected closing ')'");
				do_error(1);
			}
		}
	} else if(**c == '-' || digit(**c)){
		compile_integer(output, c, dereference, force_stack, output_file);
	} else if(alpha(**c)){
		compile_variable(output, c, dereference, force_stack, output_file);
	} else if(**c == '\"'){
		compile_string(output, c, dereference, force_stack, output_file);
	} else if(**c == '\''){
		compile_character(output, c, dereference, force_stack, output_file);
	} else {
		snprintf(error_message, sizeof(error_message), "Unrecognized expression value");
		do_error(1);
	}

	skip_whitespace(c);
	while(**c == '[' || **c == '('){
		if(**c == '['){
			if(output->is_reference){
				compile_dereference(output, output_file);
			}
			compile_list_index(c, output, dereference, output_file);
		} else if(**c == '('){
			++*c;
			if(output->is_reference){
				compile_dereference(output, output_file);
			}
			compile_function_call(c, output, output_file);
		}

		skip_whitespace(c);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %r8, %r14
movl %ecx, %r12d
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x799f
movq (%r15), %rax
movzbl (%rax), %ecx
cmpl $0x29, %ecx
jle 0x4c26
cmpl $0x7e, %ecx
je 0x4c5e
cmpl $0x2d, %ecx
je 0x4c94
cmpl $0x2a, %ecx
jne 0x4ca5
incq %rax
movq %rax, (%r15)
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %r14, %r8
callq 0x4ba2
testb %bpl, %bpl
je 0x4c1a
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36d2
testb %bpl, %bpl
sete %bpl
jmp 0x4e5b
cmpl $0x21, %ecx
je 0x4daf
cmpl $0x26, %ecx
jne 0x4ca5
incq %rax
movq %rax, (%r15)
testb %bpl, %bpl
je 0x4e33
movzbl %r12b, %ecx
xorl %ebp, %ebp
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %r8
callq 0x4ba2
jmp 0x4e5b
incq %rax
movq %rax, (%r15)
testb %bpl, %bpl
je 0x4e33
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %r14, %r8
callq 0x4ba2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x493c
jmp 0x4e59
movsbl 0x1(%rax), %edi
callq 0x755c
testb %al, %al
je 0x4e07
movq (%r15), %rax
movzbl (%rax), %ecx
movzbl %bpl, %ebp
cmpl $0x2d, %ecx
je 0x4dee
cmpl $0x28, %ecx
jne 0x4dde
incq %rax
movq %rax, (%r15)
movq %r15, %rdi
callq 0x799f
movq (%r15), %rax
leaq 0x48(%rsp), %rsi
movq %rax, (%rsi)
xorl %edi, %edi
callq 0x7853
testb %al, %al
je 0x4e64
leaq 0x8a68(%rip), %rax      # 0xd758
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
leaq 0x50(%rsp), %rdi
movaps %xmm3, 0x30(%rdi)
movaps %xmm2, 0x20(%rdi)
movaps %xmm1, 0x10(%rdi)
movaps %xmm0, (%rdi)
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x7e04
movq (%r15), %rax
cmpb $0x29, (%rax)
je 0x4d59
leaq 0x87ac(%rip), %rax      # 0xd4e0
movabsq $0x27292720646574, %rcx # imm = 0x27292720646574
movq %rcx, 0x5(%rax)
movabsq $0x6465746365707845, %rcx # imm = 0x6465746365707845
movq %rcx, (%rax)
movl $0x1, %edi
callq 0x5ae0
incq (%r15)
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %r14, %r8
callq 0x4ba2
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movaps 0x70(%rsp), %xmm2
movaps 0x80(%rsp), %xmm3
movups %xmm3, 0x30(%rsp)
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x33e8
jmp 0x4f69
incq %rax
movq %rax, (%r15)
testb %bpl, %bpl
je 0x4e33
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %r14, %r8
callq 0x4ba2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4870
jmp 0x4e59
movsbl %cl, %edi
callq 0x755c
testb %al, %al
je 0x4e8b
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %r8
callq 0x2d20
jmp 0x4f69
incq (%r15)
testb %bpl, %bpl
je 0x4e33
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
movq %r14, %r8
callq 0x4ba2
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4a76
jmp 0x4e59
movups 0x4c30(%rip), %xmm0     # 0x9a6a
leaq 0x869f(%rip), %rax      # 0xd4e0
movups %xmm0, 0xd(%rax)
movups 0x4c11(%rip), %xmm0     # 0x9a5d
movaps %xmm0, (%rax)
movl $0x1, %edi
callq 0x5ae0
xorl %ebp, %ebp
movb %bpl, 0x50(%rbx)
jmp 0x4f81
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %r8
callq 0x3d08
movq (%r15), %rax
cmpb $0x29, (%rax)
jne 0x4eb3
incq %rax
movq %rax, (%r15)
jmp 0x4f69
movq (%r15), %rax
movsbl (%rax), %edi
callq 0x7528
testb %al, %al
je 0x4ee1
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
movl %ebp, %edx
movq %r14, %r8
callq 0x2db9
jmp 0x4f69
movups 0x4bc0(%rip), %xmm0     # 0x9a7a
leaq 0x861f(%rip), %rax      # 0xd4e0
movaps %xmm0, (%rax)
movabsq $0x27292720676e69, %rcx # imm = 0x27292720676E69
movq %rcx, 0xd(%rax)
movl $0x1, %edi
callq 0x5ae0
jmp 0x4f69
movq (%r15), %rax
movzbl (%rax), %eax
cmpl $0x27, %eax
je 0x4f0b
cmpl $0x22, %eax
jne 0x4f91
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %r8
callq 0x4630
jmp 0x4f69
movzbl %r12b, %ecx
movq %rbx, %rdi
movq %r15, %rsi
xorl %edx, %edx
movq %r14, %r8
callq 0x4720
jmp 0x4f69
cmpb $0x0, 0x50(%rbx)
je 0x4f32
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36d2
movq %r15, %rdi
movq %rbx, %rsi
movl %ebp, %edx
movq %r14, %rcx
callq 0x3db9
jmp 0x4f69
incq %rax
movq %rax, (%r15)
cmpb $0x0, 0x50(%rbx)
je 0x4f5b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36d2
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x38b5
movq %r15, %rdi
callq 0x799f
movq (%r15), %rax
movzbl (%rax), %ecx
cmpl $0x28, %ecx
je 0x4f44
cmpl $0x5b, %ecx
je 0x4f21
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movups 0x4b05(%rip), %xmm0     # 0x9a9d
leaq 0x8541(%rip), %rax      # 0xd4e0
movups %xmm0, 0xe(%rax)
movups 0x4ae5(%rip), %xmm0     # 0x9a8f
movaps %xmm0, (%rax)
jmp 0x4ed2