// File: /workspace/github_cpp_makefile_star2_O2/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, %rbx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rcx
andl $0x0, 0x20(%rcx)
movaps %xmm0, 0x10(%rcx)
movaps %xmm0, (%rcx)
movw $0xb, 0x24(%rcx)
xorl %eax, %eax
movb %al, 0x26(%rcx)
andw $0x0, 0x28(%rcx)
movq %rsi, %r12
movq %rdi, 0x50(%rsp)
movb %al, 0x2a(%rcx)
leaq 0x1368a(%rip), %r13     # 0x2d6e0
leaq 0x10(%rsp), %rbp
leaq 0xb(%rsp), %r14
pushq $0x1
popq %r15
testb $0x1, %al
jne 0x1a1fa
cmpb $0x0, 0x4a(%rsp)
jne 0x1a0d5
cmpb $0xf, 0x60(%r12)
je 0x1a0d5
movb $0x22, 0x10(%rsp)
movb $0x3a, 0xa(%rsp)
movb $0x7b, 0xb(%rsp)
movb $0x5b, 0xd(%rsp)
movb $0x7d, 0xc(%rsp)
movb $0x5d, 0xf(%rsp)
movb $0x2f, 0xe(%rsp)
subq $0x8, %rsp
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
leaq 0x12(%rsp), %rcx
movq %r14, %r8
leaq 0x15(%rsp), %r9
leaq 0x16(%rsp), %rax
pushq %rax
leaq 0x1f(%rsp), %rax
pushq %rax
leaq 0x24(%rsp), %rax
pushq %rax
callq 0x12c10
addq $0x20, %rsp
jmp 0x1a115
movb $0x20, 0x10(%rsp)
movb $0x2c, 0xa(%rsp)
movb $0xa, 0xb(%rsp)
movb $0x9, 0xd(%rsp)
movb $0xd, 0xc(%rsp)
subq $0x8, %rsp
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
leaq 0x12(%rsp), %rcx
movq %r14, %r8
leaq 0x15(%rsp), %r9
leaq 0x14(%rsp), %rax
pushq %rax
callq 0x11270
popq %rcx
popq %rdx
movb $0x1, 0xb(%rsp)
movq 0x10(%rbx), %rax
movzbl (%rax), %eax
cmpl $0x7d, %eax
je 0x1a156
cmpl $0x2f, %eax
je 0x1a1a0
cmpl $0x3a, %eax
je 0x1a18e
cmpl $0x5b, %eax
je 0x1a156
cmpl $0x5d, %eax
je 0x1a156
cmpl $0x7b, %eax
je 0x1a156
movq %r12, %rdi
movq %rbx, %rsi
leaq 0x20(%rsp), %rdx
cmpl $0x22, %eax
jne 0x1a17d
callq 0x12830
jmp 0x1a166
movsbl %al, %esi
movq %r12, %rdi
leaq 0x20(%rsp), %rdx
callq 0x11240
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0x12a40
movb 0x48(%rsp), %al
jmp 0x1a064
movq %r14, %rcx
callq 0x11560
testb $0x1, 0xb(%rsp)
jne 0x1a166
jmp 0x1a174
cmpb $0x1, 0x4a(%rsp)
je 0x1a228
movb $0x1, 0x4a(%rsp)
jmp 0x1a166
movq %rbx, %rdi
movq %r15, %rsi
callq 0x112d0
testb %al, %al
je 0x1a166
movq 0x10(%rbx), %rax
movzbl 0x1(%rax), %eax
cmpl $0x2f, %eax
je 0x1a1d8
cmpl $0x2a, %eax
jne 0x1a166
movw $0x2f2a, 0x10(%rsp)     # imm = 0x2F2A
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x12bf0
jmp 0x1a166
movb $0xa, 0x10(%rsp)
movb $0xd, 0xa(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %rbp, %rdx
leaq 0xa(%rsp), %rcx
callq 0x12190
jmp 0x1a166
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 0x75f5(%rip), %rdi      # 0x21824
callq 0x12b90
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movl %edx, 0x8(%rcx)
movw $0x10c, 0xc(%rcx)       # imm = 0x10C
movb $0x0, 0xe(%rcx)
leaq 0x20(%rsp), %rsi
movq %rcx, %rdx
callq 0x11100