// File: /workspace/github_c_makefile_star2_O0/hsjoihs[P]c-compiler/lexer.c
// Function: unescape
char *unescape(const char *str)
{
	char *ans = calloc(strlen(str) + 1, sizeof(char));
	int j = 0;
	for (int i = 0; str[i];) {
		if (str[i] != 92) {
			ans[j] = str[i];
			i++;
			j++;
		} else {
			switch (str[i + 1]) {
			case 92:
				ans[j] = 92;
				break;
			case 't':
				ans[j] = 9;
				break;
			case 'n':
				ans[j] = 10;
				break;
			case 'v':
				ans[j] = 11;
				break;
			case 'f':
				ans[j] = 12;
				break;
			case 'r':
				ans[j] = 13;
				break;
			case '"':
				ans[j] = '"';
				break;
			case 'e': {
				if (global_flag_pedantic) {
					fprintf(stderr, "escape sequence `\\e` is not in ISO C\n");
					exit(EXIT_FAILURE);
				} else {
					ans[j] = 0x1b;
					break;
				}
			}
			case 39:
				ans[j] = 39;
				break;
			default:
				fprintf(stderr, "unsupported: escape sequence `\\%c`\n",
				        str[i + 1]);
				exit(EXIT_FAILURE);
			}
			i += 2;
			j++;
		}
	}
	/* calloc means automatically null terminated */
	return ans;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x1060
movq %rax, %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x10b0
movq %rax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0xf223
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
je 0xf0e8
movq -0x8(%rbp), %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %dl
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xf21e
movq -0x8(%rbp), %rcx
movslq -0x18(%rbp), %rax
movsbl 0x1(%rax,%rcx), %eax
addl $-0x22, %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x54, %eax
ja 0xf1d9
movq -0x20(%rbp), %rax
leaq 0x819a(%rip), %rcx      # 0x172ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x5c, (%rax,%rcx)
jmp 0xf20c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x9, (%rax,%rcx)
jmp 0xf20c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0xa, (%rax,%rcx)
jmp 0xf20c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0xb, (%rax,%rcx)
jmp 0xf20c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0xc, (%rax,%rcx)
jmp 0xf20c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0xd, (%rax,%rcx)
jmp 0xf20c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x22, (%rax,%rcx)
jmp 0xf20c
leaq 0xcf2e(%rip), %rax      # 0x1c0c4
cmpl $0x0, (%rax)
je 0xf1bd
movq 0xce56(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
leaq 0x8254(%rip), %rsi      # 0x17400
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x1b, (%rax,%rcx)
jmp 0xf20c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x27, (%rax,%rcx)
jmp 0xf20c
movq 0xce18(%rip), %rax      # 0x1bff8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edx
leaq 0x822b(%rip), %rsi      # 0x17426
movb $0x0, %al
callq 0x10d0
movl $0x1, %edi
callq 0x1150
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xf098
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)