// File: /workspace/github_c_makefile_star2_O2/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 0x441e
leaq 0x2(%rcx), %rax
movq %rax, (%r12)
movb 0x2(%rcx), %cl
xorl %edx, %edx
leaq 0x3cff(%rip), %rsi      # 0x80d0
leaq 0x3cec(%rip), %rdi      # 0x80c4
xorl %ebp, %ebp
cmpq $0xc, %rdx
je 0x43f0
cmpb (%rdx,%rdi), %cl
jne 0x43e7
movl (%rsi), %ebp
incq %rdx
addq $0x4, %rsi
jmp 0x43da
testl %ebp, %ebp
jne 0x441e
movups 0x454d(%rip), %xmm0     # 0x8948
leaq 0x80de(%rip), %rax      # 0xc4e0
movups %xmm0, 0xe(%rax)
movups 0x452d(%rip), %xmm0     # 0x893a
movaps %xmm0, (%rax)
pushq $0x1
popq %rdi
callq 0x56c5
movq (%r12), %rax
xorl %ebp, %ebp
leaq 0x1(%rax), %rcx
movq %rcx, (%r12)
cmpb $0x27, 0x1(%rax)
je 0x4450
movups 0x4525(%rip), %xmm0     # 0x8958
leaq 0x80a6(%rip), %rax      # 0xc4e0
movaps %xmm0, (%rax)
movl $0xa2720, 0x10(%rax)    # imm = 0xA2720
pushq $0x1
popq %rdi
callq 0x56c5
movq (%r12), %rcx
incq %rcx
movq %rcx, (%r12)
movzbl %r15b, %edi
callq 0x12e0
movq %rax, (%rbx)
movl %edx, 0x8(%rbx)
cmpl $0x1, %eax
je 0x448a
testl %eax, %eax
jne 0x44bb
shrq $0x20, %rax
leaq 0x4123(%rip), %rsi      # 0x859d
movq %r14, %rdi
movl %eax, %edx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x14e8
jmp 0x44bb
leaq 0x43a7(%rip), %rsi      # 0x8838
movq %r14, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x14e8
movq (%rbx), %rdi
movl 0x8(%rbx), %esi
callq 0x1393
leaq 0x4106(%rip), %rsi      # 0x85b5
movq %r14, %rdi
movl %eax, %edx
xorl %eax, %eax
callq 0x14e8
leaq 0x7cbe(%rip), %rax      # 0xc180
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