// File: /workspace/github_c_makefile_star2_O0/nilyang[P]redis-tdd-annotation/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->data[json->index] == '"');

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

    /* json->tmp is the temporary strbuf used to accumulate the
     * decoded string value. */
    strbuf_reset(json->tmp);
    while ((ch = json->data[json->index]) != '"') {
        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->data[json->index + 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->index++;
        }
        /* Append normal character or translated single character
         * Unicode escapes are handled above */
        strbuf_append_char_unsafe(json->tmp, ch);
        json->index++;
    }
    json->index++;  /* 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 (%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x22, %eax
jne 0xa93fc
jmp 0xa941b
leaq 0x4332e(%rip), %rdi     # 0xec731
leaq 0x43346(%rip), %rsi     # 0xec750
movl $0x36a, %edx            # imm = 0x36A
leaq 0x43346(%rip), %rcx     # 0xec75c
callq 0x1f2d0
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa8590
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movb (%rax,%rcx), %al
movb %al, -0x19(%rbp)
movsbl %al, %eax
cmpl $0x22, %eax
je 0xa952b
cmpb $0x0, -0x19(%rbp)
jne 0xa9475
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x4332d(%rip), %rdx     # 0xec798
callq 0xa9380
jmp 0xa956f
movsbl -0x19(%rbp), %eax
cmpl $0x5c, %eax
jne 0xa9508
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x8(%rcx), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %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 0xa94df
movq -0x8(%rbp), %rdi
callq 0xa9760
cmpl $0x0, %eax
jne 0xa94c6
jmp 0xa9435
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x432dc(%rip), %rdx     # 0xec7b1
callq 0xa9380
jmp 0xa956f
cmpb $0x0, -0x19(%rbp)
jne 0xa94fb
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq 0x432d9(%rip), %rdx     # 0xec7cd
callq 0xa9380
jmp 0xa956f
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movsbl -0x19(%rbp), %esi
callq 0xa8d90
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
jmp 0xa9435
movq -0x8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa98e0
movq -0x10(%rbp), %rax
movl $0x4, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x10, %rsi
callq 0xa8710
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)