// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xe8, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, 0xe0(%rsp)
movq %rsi, 0xd8(%rsp)
movb %cl, 0xd7(%rsp)
movb %al, 0xd6(%rsp)
movq %r8, 0xc8(%rsp)
movq 0xd8(%rsp), %rax
movups 0x8(%rax), %xmm0
movups 0x18(%rax), %xmm1
movups 0x28(%rax), %xmm2
movups 0x38(%rax), %xmm3
movaps %xmm3, 0xa0(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm0, 0x70(%rsp)
movzbl 0xd6(%rsp), %edi
callq 0x1300
movl %edx, 0x58(%rsp)
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x64(%rsp)
movl 0x58(%rsp), %eax
movl %eax, 0x6c(%rsp)
movq 0x64(%rsp), %rax
movq %rax, 0xbc(%rsp)
movl 0x6c(%rsp), %eax
movl %eax, 0xc4(%rsp)
cmpl $0x0, 0xbc(%rsp)
jne 0x36ea
movq 0xc8(%rsp), %rdi
movl 0xc0(%rsp), %edx
movq 0xd8(%rsp), %rax
movq (%rax), %rcx
leaq 0xa62b(%rip), %rsi      # 0xdd0c
movb $0x0, %al
callq 0x16f0
jmp 0x370b
movq 0xc8(%rsp), %rdi
movq 0xd8(%rsp), %rax
movq (%rax), %rdx
leaq 0xa615(%rip), %rsi      # 0xdd19
movb $0x0, %al
callq 0x16f0
movq 0xe0(%rsp), %rax
movq 0xbc(%rsp), %rcx
movq %rcx, (%rax)
movl 0xc4(%rsp), %ecx
movl %ecx, 0x8(%rax)
cmpb $0x0, 0xd7(%rsp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movq 0xe0(%rsp), %rax
movb %cl, 0x50(%rax)
movzbl 0xd7(%rsp), %eax
cmpl $0x0, %eax
je 0x389c
movq 0xd8(%rsp), %rax
cmpb $0x0, 0x48(%rax)
jne 0x389c
leaq 0x70(%rsp), %rdi
callq 0xbdb0
cmpl $0x7, %eax
jne 0x37fe
leaq 0x70(%rsp), %rdi
callq 0xbe20
movl 0xa8(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0xa8(%rsp)
leaq 0x70(%rsp), %rdi
movl $0x4, %esi
callq 0xb510
cmpl $0x1, 0xbc(%rsp)
jne 0x37f9
movq 0xc8(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0xbc(%rsp), %rax
movq %rax, 0x40(%rsp)
movl 0xc4(%rsp), %eax
movl %eax, 0x48(%rsp)
movq 0x40(%rsp), %rdi
movl 0x48(%rsp), %esi
callq 0x1490
movq 0x18(%rsp), %rdi
movl %eax, %edx
leaq 0x9fe7(%rip), %rsi      # 0xd7d9
movb $0x0, %al
callq 0x16f0
jmp 0x389a
cmpl $0x0, 0xbc(%rsp)
jne 0x382e
movq 0xc8(%rsp), %rdi
movl 0xc0(%rsp), %edx
movl 0xc0(%rsp), %ecx
leaq 0xa13a(%rip), %rsi      # 0xd95f
movb $0x0, %al
callq 0x16f0
jmp 0x3898
cmpl $0x1, 0xbc(%rsp)
jne 0x3896
movq 0xc8(%rsp), %rdi
leaq 0xa14b(%rip), %rsi      # 0xd992
movb $0x0, %al
callq 0x16f0
movq 0xc8(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0xbc(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0xc4(%rsp), %eax
movl %eax, 0x38(%rsp)
movq 0x30(%rsp), %rdi
movl 0x38(%rsp), %esi
callq 0x1490
movq 0x10(%rsp), %rdi
movl %eax, %edx
leaq 0x9f4a(%rip), %rsi      # 0xd7d9
movb $0x0, %al
callq 0x16f0
jmp 0x3898
jmp 0x389a
jmp 0x38ff
leaq 0x70(%rsp), %rdi
movl $0x4, %esi
callq 0xb510
cmpl $0x1, 0xbc(%rsp)
jne 0x38fd
movq 0xc8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0xbc(%rsp), %rax
movq %rax, 0x20(%rsp)
movl 0xc4(%rsp), %eax
movl %eax, 0x28(%rsp)
movq 0x20(%rsp), %rdi
movl 0x28(%rsp), %esi
callq 0x1490
movq 0x8(%rsp), %rdi
movl %eax, %edx
leaq 0x9ee3(%rip), %rsi      # 0xd7d9
movb $0x0, %al
callq 0x16f0
jmp 0x38ff
movq 0xe0(%rsp), %rdi
addq $0x10, %rdi
leaq 0x70(%rsp), %rsi
movl $0x40, %edx
callq 0x1120
addq $0xe8, %rsp
retq
nopw %cs:(%rax,%rax)