// File: /workspace/github_c_makefile_star2_O3/been-jamming[P]MinimalCC/expression.c
// Function: compile_global_variable
static void compile_global_variable(value *output, variable *var, unsigned char dereference, unsigned char force_stack, FILE *output_file){
	data_entry data;
	type data_type;

	data_type = var->var_type;
	data = allocate(force_stack);
	if(data.type == data_register){
		fileprint(output_file, "la $s%d, %s\n", data.reg, var->varname);
	} else {
		fileprint(output_file, "la $t0, %s\n", var->varname);
	}
	output->data = data;
	output->is_reference = !dereference;
	if(dereference && !var->leave_as_address){
		if(peek_type(&data_type) == type_list){
			pop_type(&data_type);
			data_type.current_index--;
			add_type_entry(&data_type, type_pointer);
			if(data.type == data_stack){
				fileprint(output_file, "sw $t0, %d($sp)\n", get_stack_pos(data));
			}
		} else {
			if(data.type == data_register){
				fileprint(output_file, "lw $s%d, 0($s%d)\n", data.reg, data.reg);
			} else if(data.type == data_stack){
				fileprint(output_file, "lw $t0, 0($t0)\n");
				fileprint(output_file, "sw $t0, %d($sp)\n", get_stack_pos(data));
			}
		}
	} else {
		add_type_entry(&data_type, type_pointer);
		if(data.type == data_stack){
			fileprint(output_file, "sw $t0, %d($sp)\n", get_stack_pos(data));
		}
	}
	output->data_type = data_type;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, %rbp
movl %edx, 0xc(%rsp)
movq %rsi, %r13
movq %rdi, %rbx
movups 0x8(%rsi), %xmm0
movups 0x18(%rsi), %xmm1
movups 0x28(%rsi), %xmm2
movups 0x38(%rsi), %xmm3
movaps %xmm3, 0x40(%rsp)
movaps %xmm2, 0x30(%rsp)
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movl %ecx, %edi
callq 0x1505
movq %rax, %r15
movl %edx, %r14d
movq %rax, %r12
shrq $0x20, %r12
movq (%r13), %rcx
testl %r15d, %r15d
movq %rbp, (%rsp)
je 0x330b
leaq 0x6819(%rip), %rsi      # 0x9b15
movq %rbp, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x171c
jmp 0x331f
leaq 0x67f6(%rip), %rsi      # 0x9b08
movq %rbp, %rdi
movl %r12d, %edx
xorl %eax, %eax
callq 0x171c
movq %r15, (%rbx)
movl %r14d, %ebp
movl %r14d, 0x8(%rbx)
cmpb $0x0, 0xc(%rsp)
sete 0x50(%rbx)
je 0x333b
cmpb $0x0, 0x48(%r13)
je 0x33a4
leaq 0x10(%rsp), %rdi
movl $0x4, %esi
callq 0x75ac
cmpl $0x1, %r15d
movq (%rsp), %r14
jne 0x3371
movq %r15, %rdi
movl %ebp, %esi
callq 0x15ba
leaq 0x6270(%rip), %rsi      # 0x95d5
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x171c
movaps 0x10(%rsp), %xmm0
movaps 0x20(%rsp), %xmm1
movaps 0x30(%rsp), %xmm2
movaps 0x40(%rsp), %xmm3
movups %xmm3, 0x40(%rbx)
movups %xmm2, 0x30(%rbx)
movups %xmm1, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x10(%rsp), %rdi
callq 0x7a9c
cmpl $0x7, %eax
jne 0x33cc
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x7ab4
decl 0x38(%r14)
movq %r14, %rdi
jmp 0x3340
testl %r15d, %r15d
movq (%rsp), %r14
je 0x33f1
cmpl $0x1, %r15d
jne 0x3371
leaq 0x63ac(%rip), %rsi      # 0x978e
movq %r14, %rdi
xorl %eax, %eax
callq 0x171c
jmp 0x3354
leaq 0x6363(%rip), %rsi      # 0x975b
movq %r14, %rdi
movl %r12d, %edx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x171c
jmp 0x3371