// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/deps/lua/src/lua_cjson.c
// Function: json_next_string_token
static void json_next_string_token(json_parse_t *json, json_token_t *token)
{
    char *escape2char = json->cfg->escape2char;
    char ch;

    /* Caller must ensure a string is next */
    assert(*json->ptr == '"');

    /* Skip " */
    json->ptr++;

    /* json->tmp is the temporary strbuf used to accumulate the
     * decoded string value.
     * json->tmp is sized to handle JSON containing only a string value.
     */
    strbuf_reset(json->tmp);

    while ((ch = *json->ptr) != '"') {
        if (!ch) {
            /* Premature end of the string */
            json_set_token_error(token, json, "unexpected end of string");
            return;
        }

        /* Handle escapes */
        if (ch == '\\') {
            /* Fetch escape character */
            ch = *(json->ptr + 1);

            /* Translate escape code and append to tmp string */
            ch = escape2char[(unsigned char)ch];
            if (ch == 'u') {
                if (json_append_unicode_escape(json) == 0)
                    continue;

                json_set_token_error(token, json,
                                     "invalid unicode escape code");
                return;
            }
            if (!ch) {
                json_set_token_error(token, json, "invalid escape code");
                return;
            }

            /* Skip '\' */
            json->ptr++;
        }
        /* Append normal character or translated single character
         * Unicode escapes are handled above */
        strbuf_append_char_unsafe(json->tmp, ch);
        json->ptr++;
    }
    json->ptr++;    /* Eat final quote (") */

    strbuf_ensure_null(json->tmp);

    token->type = T_STRING;
    token->value.string = strbuf_string(json->tmp, &token->string_len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
addq $0x400, %rax            # imm = 0x400
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0xca3a4
jmp 0xca3c3
leaq 0x8157f(%rip), %rdi     # 0x14b92a
leaq 0x8158a(%rip), %rsi     # 0x14b93c
movl $0x37b, %edx            # imm = 0x37B
leaq 0x8158a(%rip), %rcx     # 0x14b948
callq 0x262e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xc9550
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movb (%rax), %al
movb %al, -0x19(%rbp)
movsbl %al, %eax
cmpl $0x22, %eax
je 0xca4c1
cmpb $0x0, -0x19(%rbp)
jne 0xca418
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x81576(%rip), %rdx     # 0x14b984
callq 0xca320
jmp 0xca508
movsbl -0x19(%rbp), %eax
cmpl $0x5c, %eax
jne 0xca49b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movb 0x1(%rax), %al
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
movzbl -0x19(%rbp), %ecx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x75, %eax
jne 0xca46f
movq -0x8(%rbp), %rdi
callq 0xca680
cmpl $0x0, %eax
jne 0xca456
jmp 0xca3e0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x81538(%rip), %rdx     # 0x14b99d
callq 0xca320
jmp 0xca508
cmpb $0x0, -0x19(%rbp)
jne 0xca48b
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x81535(%rip), %rdx     # 0x14b9b9
callq 0xca320
jmp 0xca508
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movsbl -0x19(%rbp), %esi
callq 0xc9e90
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
jmp 0xca3e0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xca7f0
movq -0x10(%rbp), %rax
movl $0x4, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0xc9700
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop