// File: /workspace/github_cpp_makefile_star2_O2/mattn[P]wandbox-run/./json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>::parser::parse_internal(bool)
basic_json parse_internal(bool keep)
        {
            auto result = basic_json(value_t::discarded);

            switch (last_token)
            {
                case lexer::token_type::begin_object:
                {
                    if (keep and (not callback
                                  or ((keep = callback(depth++, parse_event_t::object_start, result)) != 0)))
                    {
                        // explicitly set result to object to cope with {}
                        result.m_type = value_t::object;
                        result.m_value = value_t::object;
                    }

                    // read next token
                    get_token();

                    // closing } -> we are done
                    if (last_token == lexer::token_type::end_object)
                    {
                        get_token();
                        if (keep and callback and not callback(--depth, parse_event_t::object_end, result))
                        {
                            result = basic_json(value_t::discarded);
                        }
                        return result;
                    }

                    // no comma is expected here
                    unexpect(lexer::token_type::value_separator);

                    // otherwise: parse key-value pairs
                    do
                    {
                        // ugly, but could be fixed with loop reorganization
                        if (last_token == lexer::token_type::value_separator)
                        {
                            get_token();
                        }

                        // store key
                        expect(lexer::token_type::value_string);
                        const auto key = m_lexer.get_string();

                        bool keep_tag = false;
                        if (keep)
                        {
                            if (callback)
                            {
                                basic_json k(key);
                                keep_tag = callback(depth, parse_event_t::key, k);
                            }
                            else
                            {
                                keep_tag = true;
                            }
                        }

                        // parse separator (:)
                        get_token();
                        expect(lexer::token_type::name_separator);

                        // parse and add value
                        get_token();
                        auto value = parse_internal(keep);
                        if (keep and keep_tag and not value.is_discarded())
                        {
                            result[key] = std::move(value);
                        }
                    }
                    while (last_token == lexer::token_type::value_separator);

                    // closing }
                    expect(lexer::token_type::end_object);
                    get_token();
                    if (keep and callback and not callback(--depth, parse_event_t::object_end, result))
                    {
                        result = basic_json(value_t::discarded);
                    }

                    return result;
                }

                case lexer::token_type::begin_array:
                {
                    if (keep and (not callback
                                  or ((keep = callback(depth++, parse_event_t::array_start, result)) != 0)))
                    {
                        // explicitly set result to object to cope with []
                        result.m_type = value_t::array;
                        result.m_value = value_t::array;
                    }

                    // read next token
                    get_token();

                    // closing ] -> we are done
                    if (last_token == lexer::token_type::end_array)
                    {
                        get_token();
                        if (callback and not callback(--depth, parse_event_t::array_end, result))
                        {
                            result = basic_json(value_t::discarded);
                        }
                        return result;
                    }

                    // no comma is expected here
                    unexpect(lexer::token_type::value_separator);

                    // otherwise: parse values
                    do
                    {
                        // ugly, but could be fixed with loop reorganization
                        if (last_token == lexer::token_type::value_separator)
                        {
                            get_token();
                        }

                        // parse value
                        auto value = parse_internal(keep);
                        if (keep and not value.is_discarded())
                        {
                            result.push_back(std::move(value));
                        }
                    }
                    while (last_token == lexer::token_type::value_separator);

                    // closing ]
                    expect(lexer::token_type::end_array);
                    get_token();
                    if (keep and callback and not callback(--depth, parse_event_t::array_end, result))
                    {
                        result = basic_json(value_t::discarded);
                    }

                    return result;
                }

                case lexer::token_type::literal_null:
                {
                    get_token();
                    result.m_type = value_t::null;
                    break;
                }

                case lexer::token_type::value_string:
                {
                    const auto s = m_lexer.get_string();
                    get_token();
                    result = basic_json(s);
                    break;
                }

                case lexer::token_type::literal_true:
                {
                    get_token();
                    result.m_type = value_t::boolean;
                    result.m_value = true;
                    break;
                }

                case lexer::token_type::literal_false:
                {
                    get_token();
                    result.m_type = value_t::boolean;
                    result.m_value = false;
                    break;
                }

                case lexer::token_type::value_unsigned:
                case lexer::token_type::value_integer:
                case lexer::token_type::value_float:
                {
                    m_lexer.get_number(result, last_token);
                    get_token();
                    break;
                }

                default:
                {
                    // the last token was unexpected
                    unexpect(last_token);
                }
            }

            if (keep and callback and not callback(depth, parse_event_t::value, result))
            {
                result = basic_json(value_t::discarded);
            }
            return result;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x8
popq %rsi
callq 0x188d6
movl 0x28(%r14), %edx
leal -0x1(%rdx), %eax
cmpl $0x8, %eax
ja 0x176cd
leaq 0xb2a60(%rip), %rcx     # 0xca004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x30(%r14), %rdi
movq %rbx, %rsi
callq 0x18f42
movq %r14, %rdi
callq 0x1755c
jmp 0x176d7
testb %bpl, %bpl
je 0x17732
cmpq $0x0, 0x18(%r14)
je 0x175f6
leaq 0x8(%r14), %rdi
movl (%r14), %esi
leal 0x1(%rsi), %eax
movl %eax, (%r14)
pushq $0x2
popq %rdx
movq %rbx, %rcx
callq 0x188f0
testb %al, %al
je 0x17732
movb $0x2, (%rbx)
callq 0x190b0
movq %rax, 0x8(%rbx)
movb $0x1, %bpl
jmp 0x17734
movq %r14, %rdi
callq 0x1755c
movb $0x0, (%rbx)
jmp 0x176d7
leaq 0x30(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x18a98
movq %r14, %rdi
callq 0x1755c
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x18d8a
leaq 0x40(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x16e8c
movq %r15, %rdi
callq 0x16ecc
leaq 0x10(%rsp), %rdi
callq 0x981a0
jmp 0x176d7
testb %bpl, %bpl
je 0x17783
cmpq $0x0, 0x18(%r14)
je 0x17692
leaq 0x8(%r14), %rdi
movl (%r14), %esi
leal 0x1(%rsi), %eax
movl %eax, (%r14)
xorl %edx, %edx
movq %rbx, %rcx
callq 0x188f0
testb %al, %al
je 0x17783
movb $0x1, (%rbx)
callq 0x19064
movq %rax, 0x8(%rbx)
movb $0x1, %r12b
jmp 0x17786
movq %r14, %rdi
callq 0x1755c
movb $0x4, (%rbx)
movq $0x1, 0x8(%rbx)
jmp 0x176d7
movq %r14, %rdi
callq 0x1755c
movb $0x4, (%rbx)
andq $0x0, 0x8(%rbx)
jmp 0x176d7
movq %r14, %rdi
movl %edx, %esi
callq 0x1895a
testb %bpl, %bpl
je 0x1771f
cmpq $0x0, 0x18(%r14)
je 0x1771f
movl (%r14), %esi
addq $0x8, %r14
pushq $0x5
popq %rdx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x188f0
testb %al, %al
jne 0x1771f
leaq 0x50(%rsp), %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x188d6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x16e8c
movq %r14, %rdi
callq 0x16ecc
movq %rbx, %rax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
movq %r14, %rdi
callq 0x1755c
cmpl $0xa, 0x28(%r14)
jne 0x177e9
movq %r14, %rdi
callq 0x1755c
cmpq $0x0, 0x18(%r14)
je 0x1771f
leaq 0x8(%r14), %rdi
movl (%r14), %esi
decl %esi
movl %esi, (%r14)
pushq $0x3
popq %rdx
movq %rbx, %rcx
callq 0x188f0
testb %al, %al
jne 0x1771f
leaq 0x70(%rsp), %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x188d6
jmp 0x1770c
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x1755c
cmpl $0xb, 0x28(%r14)
jne 0x17804
movq %r14, %rdi
callq 0x1755c
cmpq $0x0, 0x18(%r14)
setne %al
andb %al, %r12b
cmpb $0x1, %r12b
jne 0x1771f
leaq 0x8(%r14), %rdi
movl (%r14), %esi
decl %esi
movl %esi, (%r14)
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x188f0
testb %al, %al
jne 0x1771f
leaq 0x90(%rsp), %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x188d6
jmp 0x1770c
pushq $0xd
popq %rsi
movq %r14, %rdi
callq 0x1895a
cmpl $0xd, 0x28(%r14)
je 0x179aa
jmp 0x179b2
pushq $0xd
popq %rsi
movq %r14, %rdi
callq 0x1895a
cmpl $0xd, 0x28(%r14)
je 0x1782c
jmp 0x17834
jmp 0x17a5d
jmp 0x17a5d
jmp 0x17a5d
jmp 0x17998
movq %r14, %rdi
callq 0x1755c
pushq $0x4
popq %rsi
movq %r14, %rdi
callq 0x17b12
leaq 0x30(%r14), %rsi
leaq 0x10(%rsp), %rdi
callq 0x18a98
movb $0x1, %bpl
testb %r12b, %r12b
je 0x1788b
xorl %ebp, %ebp
cmpq $0x0, 0x18(%r14)
je 0x1788b
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x18d8a
leaq 0x8(%r14), %rdi
movl (%r14), %esi
pushq $0x4
popq %rdx
movq %rsp, %rcx
callq 0x188f0
movl %eax, %ebp
movq %rsp, %rdi
callq 0x16ecc
xorb $0x1, %bpl
movq %r14, %rdi
callq 0x1755c
pushq $0xc
popq %rsi
movq %r14, %rdi
callq 0x17b12
movq %r14, %rdi
callq 0x1755c
movzbl %r12b, %edx
movq %rsp, %rdi
movq %r14, %rsi
callq 0x1756e
movl %r12d, %eax
xorb $0x1, %al
orb %al, %bpl
jne 0x178f7
cmpb $0x8, (%rsp)
je 0x178f7
leaq 0x30(%rsp), %rdi
movq %rsp, %rsi
callq 0x17cac
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x18da4
leaq 0x30(%rsp), %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x16e8c
movq %r15, %rdi
callq 0x16ecc
movq %rsp, %rdi
callq 0x16ecc
leaq 0x10(%rsp), %rdi
callq 0x981a0
cmpl $0xd, 0x28(%r14)
je 0x1782c
pushq $0xb
popq %rsi
movq %r14, %rdi
callq 0x17b12
movq %r14, %rdi
callq 0x1755c
cmpq $0x0, 0x18(%r14)
setne %al
andb %al, %r12b
cmpb $0x1, %r12b
jne 0x1771f
leaq 0x8(%r14), %rdi
movl (%r14), %esi
decl %esi
movl %esi, (%r14)
pushq $0x1
popq %rdx
movq %rbx, %rcx
callq 0x188f0
testb %al, %al
jne 0x1771f
leaq 0x80(%rsp), %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x188d6
jmp 0x1770c
movq %rax, %r14
jmp 0x17987
jmp 0x17998
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x16ecc
movq %rsp, %rdi
callq 0x16ecc
jmp 0x1799b
jmp 0x17998
jmp 0x17a5d
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x981a0
jmp 0x17a60
movq %r14, %rdi
callq 0x1755c
movzbl %bpl, %edx
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x1756e
cmpb $0x8, 0x10(%rsp)
setne %al
andb %bpl, %al
cmpb $0x1, %al
jne 0x179df
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x18e72
leaq 0x10(%rsp), %rdi
callq 0x16ecc
cmpl $0xd, 0x28(%r14)
je 0x179aa
pushq $0xa
popq %rsi
movq %r14, %rdi
callq 0x17b12
movq %r14, %rdi
callq 0x1755c
cmpq $0x0, 0x18(%r14)
setne %al
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x1771f
leaq 0x8(%r14), %rdi
movl (%r14), %esi
decl %esi
movl %esi, (%r14)
pushq $0x3
popq %rdx
movq %rbx, %rcx
callq 0x188f0
testb %al, %al
jne 0x1771f
leaq 0x60(%rsp), %r14
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x188d6
jmp 0x1770c
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x16ecc
jmp 0x17a60
jmp 0x17a5d
movq %rax, %r14
movq %rbx, %rdi
callq 0x16ecc
movq %r14, %rdi
callq 0xc6e00