// File: /workspace/github_cpp_makefile_star2_O3/night-shift[P]Srl/src/lib/PJson.cpp
// Function: Srl::PJson::read(Srl::Lib::In&)
pair<Lib::MemBlock, Value> PJson::read(In& source)
{
    State state;
    while(!state.complete) {

        /* literals can be 'un-quoted', values in 'square-brackets' don't have a name */
        if(!state.reading_value && this->scope_type != Type::Array) {

            source.move_until(error, '\"', ':', '{', '[', '}', ']', '/');

        } else {
            source.move_while(error, ' ', ',', '\n', '\t', '\r');
        }

        bool move = true;
        char c = *source.pointer();
        switch(c) {
            case '\"': this->process_quote(source, state);
                       break;

            case ':' : if(state.reading_value) {
                           this->throw_exception(state, "Redundant colon.");
                        }
                        state.reading_value = true;
                        break;
            case '{' :
            case '}' :
            case '[' :
            case ']' : this->process_bracket(c, state);
                       break;
            case '/' : skip_comment(source);
                       break;

            default  : this->process_char(source, state, move);
        }

        if(move) {
            source.move(1, error);
        }
    }

    return { state.name, state.value };
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, 0x50(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
movaps %xmm0, 0x10(%rcx)
movaps %xmm0, (%rcx)
movl $0x0, 0x20(%rcx)
movw $0xb, 0x24(%rcx)
xorl %eax, %eax
movb %al, 0x26(%rcx)
movw $0x0, 0x28(%rcx)
movb %al, 0x2a(%rcx)
leaq 0x12e94(%rip), %r13     # 0x280a0
leaq 0x10(%rsp), %rbp
leaq 0xd(%rsp), %rbx
leaq 0xa(%rsp), %r12
cmpb $0x0, 0x4a(%rsp)
jne 0x15281
cmpb $0xf, 0x60(%r15)
je 0x15281
movb $0x22, 0x10(%rsp)
movb $0x3a, 0xd(%rsp)
movb $0x7b, 0xa(%rsp)
movb $0x5b, 0xc(%rsp)
movb $0x7d, 0xb(%rsp)
movb $0x5d, 0xf(%rsp)
movb $0x2f, 0xe(%rsp)
subq $0x8, %rsp
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq %r12, %r8
leaq 0x14(%rsp), %r9
leaq 0x16(%rsp), %rax
pushq %rax
leaq 0x1f(%rsp), %rax
pushq %rax
leaq 0x23(%rsp), %rax
pushq %rax
callq 0xbff0
addq $0x20, %rsp
jmp 0x152c1
movb $0x20, 0x10(%rsp)
movb $0x2c, 0xd(%rsp)
movb $0xa, 0xa(%rsp)
movb $0x9, 0xc(%rsp)
movb $0xd, 0xb(%rsp)
subq $0x8, %rsp
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
movq %r12, %r8
leaq 0x14(%rsp), %r9
leaq 0x13(%rsp), %rax
pushq %rax
callq 0xb1a0
addq $0x10, %rsp
movb $0x1, 0xa(%rsp)
movq 0x10(%r14), %rdx
movb (%rdx), %cl
movzbl %cl, %eax
cmpl $0x5a, %eax
jle 0x152e8
cmpl $0x7a, %eax
jg 0x1530d
cmpl $0x5b, %eax
je 0x15317
cmpl $0x5d, %eax
je 0x15317
jmp 0x15372
cmpl $0x22, %eax
je 0x15360
cmpl $0x2f, %eax
je 0x1538e
cmpl $0x3a, %eax
jne 0x15372
cmpb $0x1, 0x4a(%rsp)
je 0x15430
movb $0x1, 0x4a(%rsp)
jmp 0x15327
cmpl $0x7b, %eax
je 0x15317
cmpl $0x7d, %eax
jne 0x15372
movsbl %cl, %esi
movq %r15, %rdi
leaq 0x20(%rsp), %rdx
callq 0xb180
movq 0x10(%r14), %rax
leaq 0x1(%rax), %rcx
cmpq 0x8(%r14), %rcx
jb 0x15349
movl $0x1, %esi
movq %r14, %rdi
movq %r13, %rdx
callq 0xb210
movq 0x10(%r14), %rax
incq %rax
movq %rax, 0x10(%r14)
cmpb $0x1, 0x48(%rsp)
jne 0x1521b
jmp 0x15402
movq %r15, %rdi
movq %r14, %rsi
leaq 0x20(%rsp), %rdx
callq 0xbdc0
jmp 0x15327
movq %r15, %rdi
movq %r14, %rsi
leaq 0x20(%rsp), %rdx
movq %r12, %rcx
callq 0xb360
testb $0x1, 0xa(%rsp)
jne 0x15327
jmp 0x15350
leaq 0x1(%rdx), %rax
cmpq 0x8(%r14), %rax
jb 0x153b6
movl $0x1, %esi
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
callq 0xb190
testb %al, %al
je 0x15327
movq 0x10(%r14), %rdx
movzbl 0x1(%rdx), %eax
cmpl $0x2f, %eax
je 0x153e2
cmpl $0x2a, %eax
jne 0x15327
movw $0x2f2a, 0x10(%rsp)     # imm = 0x2F2A
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0xbfe0
jmp 0x15327
movb $0xa, 0x10(%rsp)
movb $0xd, 0xd(%rsp)
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0xbac0
jmp 0x15327
movaps 0x20(%rsp), %xmm0
movq 0x50(%rsp), %rax
movups %xmm0, (%rax)
movaps 0x30(%rsp), %xmm0
movups %xmm0, 0x10(%rax)
movq 0x40(%rsp), %rcx
movq %rcx, 0x20(%rax)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x93cd(%rip), %rax      # 0x1e804
leaq 0x10(%rsp), %rdx
movq %rax, (%rdx)
movl $0x10, 0x8(%rdx)
movw $0x10c, 0xc(%rdx)       # imm = 0x10C
movb $0x0, 0xe(%rdx)
leaq 0x20(%rsp), %rsi
callq 0xb0b0