// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/json.c
// Function: json_escape_str
char *
json_escape_str(const char *str)
{
	char *p, *buf;

	if ((buf = malloc(strlen(str) * 2 + 1)) == NULL)
		return (NULL);
	for (p = buf; str != NULL && *str != '\0'; str++) {
		switch (*str) {
		case '\r':
			*p++ = '\\'; *p++ = 'r';
			break;
		case '\b':
			*p++ = '\\'; *p++ = 'b';
			break;
		case '\f':
			*p++ = '\\'; *p++ = 'f';
			break;
		case '\n':
			*p++ = '\\'; *p++ = 'n';
			break;
		case '\t':
			*p++ = '\\'; *p++ = 't';
			break;
		case '\v':
			*p++ = '\\'; *p++ = 'v';
			break;
		case '\\':
			*p++ = '\\'; *p++ = '\\';
			break;
		case '/':
			*p++ = '\\'; *p++ = '/';
			break;
		case '"':
			*p++ = '\\'; *p++ = '"';
			break;
		default:
			*p++ = *str;
		}
	}
	*p = '\0';
	return (buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
movq %rax, %rdi
shlq %rdi
addq $0x1, %rdi
callq 0x2430
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0xc58b
movq $0x0, -0x8(%rbp)
jmp 0xc789
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x10(%rbp)
movb %al, -0x21(%rbp)
je 0xc5af
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xc5bb
jmp 0xc77a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
addl $-0x8, %eax
movl %eax, %ecx
movq %rcx, -0x30(%rbp)
subl $0x54, %eax
ja 0xc750
movq -0x30(%rbp), %rax
leaq 0x3431(%rip), %rcx      # 0xfa10
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x72, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x62, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x66, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x6e, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x74, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x76, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x2f, (%rax)
jmp 0xc767
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x5c, (%rax)
movq -0x18(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x18(%rbp)
movb $0x22, (%rax)
jmp 0xc767
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq -0x18(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x18(%rbp)
movb %cl, (%rax)
jmp 0xc769
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xc593
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)