// File: /workspace/github_c_makefile_star2_O0/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:
subq $0xa8, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movb %cl, 0x97(%rsp)
movb %al, 0x96(%rsp)
movq %r8, 0x88(%rsp)
movl $0x0, 0x84(%rsp)
movq 0x6f39(%rip), %rax      # 0xd32c
movq %rax, 0x78(%rsp)
movl 0x6f36(%rip), %eax      # 0xd334
movl %eax, 0x80(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x6f2f(%rip), %rsi      # 0xd340
movl $0x30, %edx
callq 0x1120
movq 0x98(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x98(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x64d0
movq 0x98(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movb $0x0, 0x3f(%rsp)
movzbl 0x3f(%rsp), %eax
cmpq $0xc, %rax
jae 0x64a0
movq 0x98(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movzbl 0x3f(%rsp), %ecx
movsbl 0x78(%rsp,%rcx), %ecx
cmpl %ecx, %eax
jne 0x6492
movzbl 0x3f(%rsp), %eax
movl 0x40(%rsp,%rax,4), %eax
movl %eax, 0x84(%rsp)
jmp 0x6494
movb 0x3f(%rsp), %al
addb $0x1, %al
movb %al, 0x3f(%rsp)
jmp 0x645b
cmpl $0x0, 0x84(%rsp)
jne 0x64ce
leaq 0xb07f(%rip), %rdi      # 0x11530
movl $0x100, %esi            # imm = 0x100
leaq 0x76a1(%rip), %rdx      # 0xdb5e
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x87b0
jmp 0x64e5
movq 0x98(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
movl %eax, 0x84(%rsp)
movq 0x98(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x98(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x27, %eax
je 0x652e
leaq 0xb01f(%rip), %rdi      # 0x11530
movl $0x100, %esi            # imm = 0x100
leaq 0x765f(%rip), %rdx      # 0xdb7c
movb $0x0, %al
callq 0x10b0
movl $0x1, %edi
callq 0x87b0
movq 0x98(%rsp), %rax
movq (%rax), %rcx
incq %rcx
movq %rcx, (%rax)
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
movzbl 0x96(%rsp), %edi
callq 0x1300
movq %rax, %rcx
movq 0x8(%rsp), %rax
movl %edx, 0x28(%rsp)
movq %rcx, 0x20(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movl 0x28(%rsp), %ecx
movl %ecx, 0x38(%rsp)
movq 0x30(%rsp), %rcx
movq %rcx, (%rax)
movl 0x38(%rsp), %ecx
movl %ecx, 0x8(%rax)
movq 0xa0(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x65c2
movq 0x88(%rsp), %rdi
movq 0xa0(%rsp), %rax
movl 0x4(%rax), %edx
movl 0x84(%rsp), %ecx
leaq 0x7208(%rip), %rsi      # 0xd7c1
movb $0x0, %al
callq 0x16f0
jmp 0x6633
movq 0xa0(%rsp), %rax
cmpl $0x1, (%rax)
jne 0x6631
movq 0x88(%rsp), %rdi
movl 0x84(%rsp), %edx
leaq 0x7477(%rip), %rsi      # 0xda5c
movb $0x0, %al
callq 0x16f0
movq 0x88(%rsp), %rax
movq %rax, (%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x10(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x18(%rsp)
movq 0x10(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x1490
movq (%rsp), %rdi
movl %eax, %edx
leaq 0x71af(%rip), %rsi      # 0xd7d9
movb $0x0, %al
callq 0x16f0
jmp 0x6633
movq 0xa0(%rsp), %rdi
addq $0x10, %rdi
leaq 0xab82(%rip), %rsi      # 0x111c8
movl $0x40, %edx
callq 0x1120
movq 0xa0(%rsp), %rax
movb $0x0, 0x50(%rax)
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)