// File: /workspace/github_c_makefile_star2_O3/been-jamming[P]MinimalCC/expression.c
// Function: compile_character
void compile_character(value *output, char **c, unsigned char dereference, unsigned char force_stack, FILE *output_file){
	int char_constant = 0;
	char escape_sequences[] = {'a', 'b', 'e', 'f', 'n', 'r', 't', 'v', '\\', '\'', '\"', '\?'};
	int escape_values[] = {0x07, 0x08, 0x1B, 0x0C, 0x0A, 0x0D, 0x09, 0x0B, 0x5C, 0x27, 0x22, 0x3F};
	unsigned char i;

	++*c;

	if(**c == '\\'){
		++*c;
		for(i = 0; i < sizeof(escape_sequences)/sizeof(char); i++){
			if(**c == escape_sequences[i]){
				char_constant = escape_values[i];
			}
		}
		if(!char_constant){
			snprintf(error_message, sizeof(error_message), "Unrecognized escape sequence\n");
			do_error(1);
		}
	} else {
		char_constant = **c;
	}
	++*c;
	if(**c != '\''){
		snprintf(error_message, sizeof(error_message), "Expected closing '\n");
		do_error(1);
	}
	++*c;

	output->data = allocate(force_stack);
	if(output->data.type == data_register){
		fileprint(output_file, "li $s%d, %d\n", output->data.reg, char_constant);
	} else if(output->data.type == data_stack){
		fileprint(output_file, "li $t0, %d\n", char_constant);
		fileprint(output_file, "sw $t0, %d($sp)\n", get_stack_pos(output->data));
	}
	output->data_type = INT_TYPE;
	output->is_reference = 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %r8, %r14
movl %ecx, %r15d
movq %rsi, %r12
movq %rdi, %rbx
movq (%rsi), %rcx
leaq 0x1(%rcx), %rax
movq %rax, (%rsi)
movsbl 0x1(%rcx), %ebp
cmpl $0x5c, %ebp
jne 0x47cf
leaq 0x2(%rcx), %rax
movq %rax, (%r12)
movb 0x2(%rcx), %cl
xorl %edx, %edx
leaq 0x496e(%rip), %rsi      # 0x90f0
leaq 0x4953(%rip), %rdi      # 0x90dc
xorl %ebp, %ebp
cmpb (%rdx,%rdi), %cl
jne 0x4792
movl (%rsi), %ebp
incq %rdx
addq $0x4, %rsi
cmpq $0xc, %rdx
jne 0x478b
testl %ebp, %ebp
jne 0x47cf
movups 0x51be(%rip), %xmm0     # 0x9968
leaq 0x8d2f(%rip), %rax      # 0xd4e0
movups %xmm0, 0xe(%rax)
movups 0x519e(%rip), %xmm0     # 0x995a
movaps %xmm0, (%rax)
movl $0x1, %edi
callq 0x5b10
movq (%r12), %rax
xorl %ebp, %ebp
leaq 0x1(%rax), %rcx
movq %rcx, (%r12)
cmpb $0x27, 0x1(%rax)
je 0x4803
movups 0x5194(%rip), %xmm0     # 0x9978
leaq 0x8cf5(%rip), %rax      # 0xd4e0
movaps %xmm0, (%rax)
movl $0xa2720, 0x10(%rax)    # imm = 0xA2720
movl $0x1, %edi
callq 0x5b10
movq (%r12), %rcx
incq %rcx
movq %rcx, (%r12)
movzbl %r15b, %edi
callq 0x1505
movq %rax, (%rbx)
movl %edx, 0x8(%rbx)
cmpl $0x1, %eax
je 0x483d
testl %eax, %eax
jne 0x486e
shrq $0x20, %rax
leaq 0x4d90(%rip), %rsi      # 0x95bd
movq %r14, %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x171c
jmp 0x486e
leaq 0x5014(%rip), %rsi      # 0x9858
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x171c
movq (%rbx), %rdi
movl 0x8(%rbx), %esi
callq 0x15ba
leaq 0x4d73(%rip), %rsi      # 0x95d5
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x171c
leaq 0x890b(%rip), %rax      # 0xd180
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movups %xmm3, 0x40(%rbx)
movups %xmm2, 0x30(%rbx)
movups %xmm1, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movb $0x0, 0x50(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq