// File: /workspace/github_c_makefile_star2_O0/been-jamming[P]MinimalCC/expression.c
// Function: compile_expression_recursive
static void compile_expression_recursive(value *first_value, char **c, FILE *output_file){
	operation current_operation;
	operation next_operation;
	unsigned int label_num = 0;
	value next_value;
	char *temp_c;
	type cast_to;
	int current_line_temp;

	skip_whitespace(c);
	current_operation = get_operation(c);
	if(current_operation == operation_none){
		snprintf(error_message, sizeof(error_message), "Unrecognized operation");
		do_error(1);
	} else if(current_operation == operation_logical_or){
		label_num = num_labels;
		num_labels++;
		cast(first_value, INT_TYPE, 0, output_file);
		if(first_value->data.type == data_register){
			fileprint(output_file, "sne $s%d, $s%d, $zero\n", first_value->data.reg, first_value->data.reg);
			fileprint(output_file, "bne $s%d, $zero, __L%d\n", first_value->data.reg, label_num);
		} else if(first_value->data.type == data_stack){
			fileprint(output_file, "lw $t0, %d($sp)\n", get_stack_pos(first_value->data));
			fileprint(output_file, "sne $t0, $t0, $zero\n");
			fileprint(output_file, "sw $t0, %d($sp)\n", get_stack_pos(first_value->data));
			fileprint(output_file, "bne $t0, $zero, __L%d\n", label_num);
		}
	} else if(current_operation == operation_logical_and){
		label_num = num_labels;
		num_labels++;
		cast(first_value, INT_TYPE, 0, output_file);
		if(first_value->data.type == data_register){
			fileprint(output_file, "beq $s%d, $zero, __L%d\n", first_value->data.reg, label_num);
		} else if(first_value->data.type == data_stack){
			fileprint(output_file, "lw $t0, %d($sp)\n", get_stack_pos(first_value->data));
			fileprint(output_file, "beq $t0, $zero, __L%d\n", label_num);
		}
	}

	temp_c = *c;
	current_line_temp = current_line;
	skip_value(&temp_c);
	current_line = current_line_temp;
	next_operation = peek_operation(temp_c);
	if(next_operation == operation_assign && order_of_operations[operation_assign] > order_of_operations[current_operation]){
		compile_value(&next_value, c, 0, 0, output_file);
	} else {
		compile_value(&next_value, c, 1, 0, output_file);
	}
	skip_whitespace(c);
	while(order_of_operations[next_operation] > order_of_operations[current_operation]){
		compile_expression_recursive(&next_value, c, output_file);
		skip_whitespace(c);
		next_operation = peek_operation(*c);
	}
	if(current_operation == operation_assign){
		cast_to = first_value->data_type;
		pop_type(&cast_to);
		cast(&next_value, cast_to, 1, output_file);
		compile_operation(first_value, &next_value, current_operation, output_file);
	} else if(current_operation == operation_logical_or || current_operation == operation_logical_and){
		cast(&next_value, INT_TYPE, 0, output_file);
		if(next_value.data.type == data_register){
			fileprint(output_file, "sne $s%d, $s%d, $zero\n", next_value.data.reg, next_value.data.reg);
			if(first_value->data.type == data_register){
				fileprint(output_file, "move $s%d, $s%d\n", first_value->data.reg, next_value.data.reg);
			} else if(first_value->data.type == data_stack){
				fileprint(output_file, "sw $s%d, %d($sp)\n", next_value.data.reg, get_stack_pos(first_value->data));
			}
		} else if(next_value.data.type == data_stack){
			if(first_value->data.type == data_register){
				fileprint(output_file, "lw $s%d, %d($sp)\n", first_value->data.reg, get_stack_pos(next_value.data));
				fileprint(output_file, "sne $s%d, $s%d, $zero\n", first_value->data.reg, first_value->data.reg);
			} else if(first_value->data.type == data_stack){
				fileprint(output_file, "lw $t0, %d($sp)\n", get_stack_pos(next_value.data));
				fileprint(output_file, "sne $t0, $t0, $zero\n");
				fileprint(output_file, "sw $t0, %d($sp)\n", get_stack_pos(first_value->data));
			}
		}
		deallocate(next_value.data);
		fileprint(output_file, "\n__L%d:\n", label_num);
	} else {
		compile_operation(first_value, &next_value, current_operation, output_file);
	}
	skip_whitespace(c);
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdi, 0x1d0(%rsp)
movq %rsi, 0x1c8(%rsp)
movq %rdx, 0x1c0(%rsp)
movl $0x0, 0x1b4(%rsp)
movq 0x1c8(%rsp), %rdi
callq 0xbb70
movq 0x1c8(%rsp), %rdi
callq 0x7520
movl %eax, 0x1bc(%rsp)
cmpl $0x0, 0x1bc(%rsp)
jne 0x7d4e
leaq 0x9804(%rip), %rdi      # 0x11530
movl $0x100, %esi            # imm = 0x100
leaq 0x5638(%rip), %rdx      # 0xd370
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x87b0
jmp 0x803d
cmpl $0x10, 0x1bc(%rsp)
jne 0x7f16
movl 0x955e(%rip), %eax      # 0x112c0
movl %eax, 0x1b4(%rsp)
movl 0x9551(%rip), %eax      # 0x112c0
addl $0x1, %eax
movl %eax, 0x9548(%rip)      # 0x112c0
movq 0x1d0(%rsp), %rdi
movq 0x1c0(%rsp), %rdx
xorl %eax, %eax
leaq 0x9437(%rip), %rax      # 0x111c8
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movq %rsp, %rax
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorl %esi, %esi
callq 0x3fd0
movq 0x1d0(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x7e1f
movq 0x1c0(%rsp), %rdi
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %edx
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %ecx
leaq 0x5f73(%rip), %rsi      # 0xdd5e
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rdi
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %edx
movl 0x1b4(%rsp), %ecx
leaq 0x5f62(%rip), %rsi      # 0xdd75
movb $0x0, %al
callq 0x16f0
jmp 0x7f11
movq 0x1d0(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x7f0f
movq 0x1c0(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x1d0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0xf8(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x100(%rsp)
movq 0xf8(%rsp), %rdi
movl 0x100(%rsp), %esi
callq 0x1490
movq 0x78(%rsp), %rdi
movl %eax, %edx
leaq 0x59ee(%rip), %rsi      # 0xd86a
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rdi
leaq 0x5efb(%rip), %rsi      # 0xdd8d
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x1d0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0xe8(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0xf0(%rsp)
movq 0xe8(%rsp), %rdi
movl 0xf0(%rsp), %esi
callq 0x1490
movq 0x80(%rsp), %rdi
movl %eax, %edx
leaq 0x58ee(%rip), %rsi      # 0xd7d9
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rdi
movl 0x1b4(%rsp), %edx
leaq 0x5e9a(%rip), %rsi      # 0xdda2
movb $0x0, %al
callq 0x16f0
jmp 0x7f11
jmp 0x803b
cmpl $0xf, 0x1bc(%rsp)
jne 0x8039
movl 0x9396(%rip), %eax      # 0x112c0
movl %eax, 0x1b4(%rsp)
movl 0x9389(%rip), %eax      # 0x112c0
addl $0x1, %eax
movl %eax, 0x9380(%rip)      # 0x112c0
movq 0x1d0(%rsp), %rdi
movq 0x1c0(%rsp), %rdx
xorl %eax, %eax
leaq 0x926f(%rip), %rax      # 0x111c8
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movq %rsp, %rax
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
xorl %esi, %esi
callq 0x3fd0
movq 0x1d0(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x7fb8
movq 0x1c0(%rsp), %rdi
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %edx
movl 0x1b4(%rsp), %ecx
leaq 0x5e0a(%rip), %rsi      # 0xddb9
movb $0x0, %al
callq 0x16f0
jmp 0x8037
movq 0x1d0(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x8035
movq 0x1c0(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x1d0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0xd8(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0xe0(%rsp)
movq 0xd8(%rsp), %rdi
movl 0xe0(%rsp), %esi
callq 0x1490
movq 0x70(%rsp), %rdi
movl %eax, %edx
leaq 0x5859(%rip), %rsi      # 0xd86a
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rdi
movl 0x1b4(%rsp), %edx
leaq 0x5da3(%rip), %rsi      # 0xddd1
movb $0x0, %al
callq 0x16f0
jmp 0x8037
jmp 0x8039
jmp 0x803b
jmp 0x803d
movq 0x1c8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x150(%rsp)
leaq 0x95f9(%rip), %rax      # 0x11650
movl (%rax), %eax
movl %eax, 0x10c(%rsp)
leaq 0x150(%rsp), %rdi
callq 0x5ed0
movl 0x10c(%rsp), %ecx
leaq 0x95d5(%rip), %rax      # 0x11650
movl %ecx, (%rax)
movq 0x150(%rsp), %rdi
callq 0x7380
movl %eax, 0x1b8(%rsp)
cmpl $0x5, 0x1b8(%rsp)
jne 0x80d9
movl 0x90e3(%rip), %eax      # 0x11184
movl 0x1bc(%rsp), %ecx
movl %ecx, %edx
leaq 0x90bf(%rip), %rcx      # 0x11170
cmpl (%rcx,%rdx,4), %eax
jbe 0x80d9
movq 0x1c8(%rsp), %rsi
movq 0x1c0(%rsp), %r8
leaq 0x158(%rsp), %rdi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x6b80
jmp 0x80fd
movq 0x1c8(%rsp), %rsi
movq 0x1c0(%rsp), %r8
leaq 0x158(%rsp), %rdi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x6b80
movq 0x1c8(%rsp), %rdi
callq 0xbb70
movl 0x1b8(%rsp), %eax
movl %eax, %ecx
leaq 0x9056(%rip), %rax      # 0x11170
movl (%rax,%rcx,4), %eax
movl 0x1bc(%rsp), %ecx
movl %ecx, %edx
leaq 0x9043(%rip), %rcx      # 0x11170
cmpl (%rcx,%rdx,4), %eax
jbe 0x8175
movq 0x1c8(%rsp), %rsi
movq 0x1c0(%rsp), %rdx
leaq 0x158(%rsp), %rdi
callq 0x7cd0
movq 0x1c8(%rsp), %rdi
callq 0xbb70
movq 0x1c8(%rsp), %rax
movq (%rax), %rdi
callq 0x7380
movl %eax, 0x1b8(%rsp)
jmp 0x810a
cmpl $0x5, 0x1bc(%rsp)
jne 0x8223
movq 0x1d0(%rsp), %rsi
addq $0x10, %rsi
leaq 0x110(%rsp), %rdi
movl $0x40, %edx
callq 0x1120
leaq 0x110(%rsp), %rdi
callq 0xbe20
movq 0x1c0(%rsp), %rdx
movups 0x110(%rsp), %xmm0
movups 0x120(%rsp), %xmm1
movups 0x130(%rsp), %xmm2
movups 0x140(%rsp), %xmm3
movq %rsp, %rax
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x158(%rsp), %rdi
movl $0x1, %esi
callq 0x3fd0
movq 0x1d0(%rsp), %rdi
movl 0x1bc(%rsp), %edx
movq 0x1c0(%rsp), %rcx
leaq 0x158(%rsp), %rsi
callq 0x7760
jmp 0x855d
cmpl $0x10, 0x1bc(%rsp)
je 0x823b
cmpl $0xf, 0x1bc(%rsp)
jne 0x8537
movq 0x1c0(%rsp), %rdx
xorl %eax, %eax
leaq 0x8f7c(%rip), %rax      # 0x111c8
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movq %rsp, %rax
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
leaq 0x158(%rsp), %rdi
xorl %esi, %esi
callq 0x3fd0
cmpl $0x0, 0x158(%rsp)
jne 0x835b
movq 0x1c0(%rsp), %rdi
movl 0x15c(%rsp), %edx
movl 0x15c(%rsp), %ecx
leaq 0x5ab7(%rip), %rsi      # 0xdd5e
movb $0x0, %al
callq 0x16f0
movq 0x1d0(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x82e5
movq 0x1c0(%rsp), %rdi
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %edx
movl 0x15c(%rsp), %ecx
leaq 0x5b0c(%rip), %rsi      # 0xdde8
movb $0x0, %al
callq 0x16f0
jmp 0x8356
movq 0x1d0(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x8354
movq 0x1c0(%rsp), %rax
movq %rax, 0x60(%rsp)
movl 0x15c(%rsp), %eax
movl %eax, 0x6c(%rsp)
movq 0x1d0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0xc8(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0xd0(%rsp)
movq 0xc8(%rsp), %rdi
movl 0xd0(%rsp), %esi
callq 0x1490
movq 0x60(%rsp), %rdi
movl 0x6c(%rsp), %edx
movl %eax, %ecx
leaq 0x4cb7(%rip), %rsi      # 0xd004
movb $0x0, %al
callq 0x16f0
jmp 0x8356
jmp 0x84e6
cmpl $0x1, 0x158(%rsp)
jne 0x84e4
movq 0x1d0(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x8412
movq 0x1c0(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %eax
movl %eax, 0x5c(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0xb8(%rsp)
movl 0x160(%rsp), %eax
movl %eax, 0xc0(%rsp)
movq 0xb8(%rsp), %rdi
movl 0xc0(%rsp), %esi
callq 0x1490
movq 0x50(%rsp), %rdi
movl 0x5c(%rsp), %edx
movl %eax, %ecx
leaq 0x4c3c(%rip), %rsi      # 0xd016
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rdi
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %edx
movq 0x1d0(%rsp), %rax
movl 0x4(%rax), %ecx
leaq 0x5958(%rip), %rsi      # 0xdd5e
movb $0x0, %al
callq 0x16f0
jmp 0x84e2
movq 0x1d0(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x84e0
movq 0x1c0(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x158(%rsp), %rax
movq %rax, 0xa8(%rsp)
movl 0x160(%rsp), %eax
movl %eax, 0xb0(%rsp)
movq 0xa8(%rsp), %rdi
movl 0xb0(%rsp), %esi
callq 0x1490
movq 0x40(%rsp), %rdi
movl %eax, %edx
leaq 0x53fa(%rip), %rsi      # 0xd86a
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rdi
leaq 0x5907(%rip), %rsi      # 0xdd8d
movb $0x0, %al
callq 0x16f0
movq 0x1c0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x1d0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x98(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0xa0(%rsp)
movq 0x98(%rsp), %rdi
movl 0xa0(%rsp), %esi
callq 0x1490
movq 0x48(%rsp), %rdi
movl %eax, %edx
leaq 0x5300(%rip), %rsi      # 0xd7d9
movb $0x0, %al
callq 0x16f0
jmp 0x84e2
jmp 0x84e4
jmp 0x84e6
movq 0x158(%rsp), %rax
movq %rax, 0x88(%rsp)
movl 0x160(%rsp), %eax
movl %eax, 0x90(%rsp)
movq 0x88(%rsp), %rdi
movl 0x90(%rsp), %esi
callq 0x13b0
movq 0x1c0(%rsp), %rdi
movl 0x1b4(%rsp), %edx
leaq 0x5a73(%rip), %rsi      # 0xdfa1
movb $0x0, %al
callq 0x16f0
jmp 0x855b
movq 0x1d0(%rsp), %rdi
movl 0x1bc(%rsp), %edx
movq 0x1c0(%rsp), %rcx
leaq 0x158(%rsp), %rsi
callq 0x7760
jmp 0x855d
movq 0x1c8(%rsp), %rdi
callq 0xbb70
addq $0x1d8, %rsp            # imm = 0x1D8
retq
nopw %cs:(%rax,%rax)