// File: /workspace/github_c_makefile_star2_O0/tomka[P]cliaspora/json.c
// Function: get_string
static char *
get_string(const char *str, bool *error, int *curpos)
{
	u_short	    hs, ls;
	static int  n, quote, quoted, buflen = 0;
	const  char *start;
	static char *p, num[8], *buf = NULL;

	if (buflen < strlen(str)) {
		if ((p = realloc(buf, strlen(str))) == NULL) {
			*error = true;
			return (NULL);
		}
		buflen = strlen(str);
		buf = p;
	}
	start = str;
	while (*str != '\0' && isspace(*str))
		str++;
	if (*str == '"') {
		str++; quote = 1; quoted = 1;
	} else
		quote = quoted = 0;
	if (*str == '\0') {
		if (quote == 1) {
			warnx("Syntax error: Unterminated quoted string:");
			*error = true;
		} else
			*error = false;
		return (NULL);
	}
	*error = true;
	for (p = buf; *str != '\0'; str++) {
		if (*str == '\\') {
			if (*(str + 1) == '\0') {
				warnx("Syntax error: " \
				    "Incomplete escape sequence:");
				return (NULL);
			}
			switch (*++str) {
			case '\\':
				*p++ = '\\';
				break;
			case 'n':
				*p++ = '\n';
				break;
			case 't':
				*p++ = '\t';
				break;
			case 'v':
				*p++ = '\v';
				break;
			case 'r':
				*p++ = '\r';
				break;
			case 'u':
				if (strlen(++str) < 4) {
					*error = true;
					return (NULL);
				}
				(void)memcpy(num, str, 4); num[5] = '\0';
				if ((strtol(num, NULL, 16) >> 8) == 0xd8) {
					hs = (u_short)strtol(num, NULL, 16);
					str += 4;
					if (str[0] != '\\' || str[1] != 'u') {
						*error = true;
						return (NULL);
					}
					if (strlen(str) < 4) {
						*error = true;
						return (NULL);
					}
					str += 2;
					(void)memcpy(num, str, 4);
					ls = (u_short)strtol(num, NULL, 16);
					n = uctoutf8(utf16touc(hs, ls),
					    (u_char *)p);
				} else {
					n = uctoutf8(strtol(num, NULL, 16),
					    (u_char *)p);
				}
				p += n; str += 3;
				break;
			default:
				*p++ = *str;
			}
		} else if (strchr(",:{}[]\" \n\t", *str) != NULL) {
			if (*str == '"')
				quote ^= 1;
			if (quote == 0) {
				*p++ = '\0'; 
				if (!quoted)
					*curpos = str - start;
				else
					*curpos = str - start + 1;
				*error = false;
				return (buf);
			} else
				*p++ = *str;
		} else
			*p++ = *str;
	}
	*p = '\0'; *curpos = str - start;
	if (quote == 1) {
		warnx("Syntax error: Unterminated quoted string:");
		return (NULL);
	}
	*error = false;
	return (buf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movslq 0x6dc9(%rip), %rax      # 0x12c74
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
movq %rax, %rcx
movq -0x38(%rbp), %rax
cmpq %rcx, %rax
jae 0xbf25
movq 0x6dbd(%rip), %rax      # 0x12c88
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2160
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x2550
movq %rax, 0x6d8d(%rip)      # 0x12c78
cmpq $0x0, %rax
jne 0xbf08
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xc421
movq -0x10(%rbp), %rdi
callq 0x2160
movl %eax, 0x6d5d(%rip)      # 0x12c74
movq 0x6d5a(%rip), %rax      # 0x12c78
movq %rax, 0x6d63(%rip)      # 0x12c88
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x41(%rbp)
je 0xbf62
callq 0x2300
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
setne %al
movb %al, -0x41(%rbp)
movb -0x41(%rbp), %al
testb $0x1, %al
jne 0xbf6b
jmp 0xbf79
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xbf2d
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xbfa7
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movl $0x1, 0x6cd1(%rip)      # 0x12c6c
movl $0x1, 0x6ccb(%rip)      # 0x12c70
jmp 0xbfbb
movl $0x0, 0x6cbf(%rip)      # 0x12c70
movl $0x0, 0x6cb1(%rip)      # 0x12c6c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0xc001
cmpl $0x1, 0x6c9e(%rip)      # 0x12c6c
jne 0xbfea
leaq 0x3656(%rip), %rdi      # 0xf62d
movb $0x0, %al
callq 0x22f0
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
jmp 0xbff4
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xc421
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq 0x6c76(%rip), %rax      # 0x12c88
movq %rax, 0x6c5f(%rip)      # 0x12c78
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0xc3ce
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0xc2d5
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0xc061
leaq 0x360a(%rip), %rdi      # 0xf657
movb $0x0, %al
callq 0x22f0
movq $0x0, -0x8(%rbp)
jmp 0xc421
movq -0x10(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x10(%rbp)
movsbl 0x1(%rax), %eax
addl $-0x5c, %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x1a, %eax
ja 0xc2b3
movq -0x50(%rbp), %rax
leaq 0x3914(%rip), %rcx      # 0xf9a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x6bd8(%rip), %rax      # 0x12c78
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x6bca(%rip)      # 0x12c78
movb $0x5c, (%rax)
jmp 0xc2d0
movq 0x6bbb(%rip), %rax      # 0x12c78
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x6bad(%rip)      # 0x12c78
movb $0xa, (%rax)
jmp 0xc2d0
movq 0x6b9e(%rip), %rax      # 0x12c78
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x6b90(%rip)      # 0x12c78
movb $0x9, (%rax)
jmp 0xc2d0
movq 0x6b81(%rip), %rax      # 0x12c78
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x6b73(%rip)      # 0x12c78
movb $0xb, (%rax)
jmp 0xc2d0
movq 0x6b64(%rip), %rax      # 0x12c78
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x6b56(%rip)      # 0x12c78
movb $0xd, (%rax)
jmp 0xc2d0
movq -0x10(%rbp), %rdi
addq $0x1, %rdi
movq %rdi, -0x10(%rbp)
callq 0x2160
cmpq $0x4, %rax
jae 0xc158
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xc421
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x6b1c(%rip)      # 0x12c80
movb $0x0, 0x6b1a(%rip)      # 0x12c85
leaq 0x6b0e(%rip), %rdi      # 0x12c80
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x2470
sarq $0x8, %rax
cmpq $0xd8, %rax
jne 0xc262
leaq 0x6ae9(%rip), %rdi      # 0x12c80
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x2470
movw %ax, -0x22(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0xc1ce
movq -0x10(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x75, %eax
je 0xc1e5
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xc421
movq -0x10(%rbp), %rdi
callq 0x2160
cmpq $0x4, %rax
jae 0xc20b
movq -0x18(%rbp), %rax
movl $0x1, (%rax)
movq $0x0, -0x8(%rbp)
jmp 0xc421
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, 0x6a5d(%rip)      # 0x12c80
leaq 0x6a56(%rip), %rdi      # 0x12c80
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x2470
movw %ax, -0x24(%rbp)
movw -0x22(%rbp), %ax
movzwl %ax, %edi
movzwl -0x24(%rbp), %esi
callq 0xc8c0
movl %eax, %edi
movq 0x6a23(%rip), %rsi      # 0x12c78
callq 0xc7a0
movl %eax, 0x6a08(%rip)      # 0x12c68
jmp 0xc28b
leaq 0x6a17(%rip), %rdi      # 0x12c80
xorl %eax, %eax
movl %eax, %esi
movl $0x10, %edx
callq 0x2470
movl %eax, %edi
movq 0x69f8(%rip), %rsi      # 0x12c78
callq 0xc7a0
movl %eax, 0x69dd(%rip)      # 0x12c68
movl 0x69d7(%rip), %ecx      # 0x12c68
movq 0x69e0(%rip), %rax      # 0x12c78
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x69d3(%rip)      # 0x12c78
movq -0x10(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x10(%rbp)
jmp 0xc2d0
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq 0x69b8(%rip), %rax      # 0x12c78
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x69aa(%rip)      # 0x12c78
movb %cl, (%rax)
jmp 0xc3bb
movq -0x10(%rbp), %rax
movsbl (%rax), %esi
leaq 0x38a3(%rip), %rdi      # 0xfb86
callq 0x2130
cmpq $0x0, %rax
je 0xc39c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xc30d
movl 0x6968(%rip), %eax      # 0x12c6c
xorl $0x1, %eax
movl %eax, 0x695f(%rip)      # 0x12c6c
cmpl $0x0, 0x6958(%rip)      # 0x12c6c
jne 0xc37d
movq 0x695b(%rip), %rax      # 0x12c78
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x694d(%rip)      # 0x12c78
movb $0x0, (%rax)
cmpl $0x0, 0x693b(%rip)      # 0x12c70
jne 0xc34c
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xc363
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq 0x6914(%rip), %rax      # 0x12c88
movq %rax, -0x8(%rbp)
jmp 0xc421
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq 0x68ee(%rip), %rax      # 0x12c78
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x68e0(%rip)      # 0x12c78
movb %cl, (%rax)
jmp 0xc3b9
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq 0x68cf(%rip), %rax      # 0x12c78
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, 0x68c1(%rip)      # 0x12c78
movb %cl, (%rax)
jmp 0xc3bb
jmp 0xc3bd
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0xc019
movq 0x68a3(%rip), %rax      # 0x12c78
movb $0x0, (%rax)
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x1, 0x687a(%rip)      # 0x12c6c
jne 0xc40c
leaq 0x3232(%rip), %rdi      # 0xf62d
movb $0x0, %al
callq 0x22f0
movq $0x0, -0x8(%rbp)
jmp 0xc421
movq -0x18(%rbp), %rax
movl $0x0, (%rax)
movq 0x686b(%rip), %rax      # 0x12c88
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)