// File: /workspace/github_cpp_makefile_star2_O1/alfanick[P]rest-cpp/src/rest/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::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))))
                    {
                        // explicitly set result to object to cope with {}
                        result.m_type = value_t::object;
                        result.m_value = json_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))))
                    {
                        // explicitly set result to object to cope with []
                        result.m_type = value_t::array;
                        result.m_value = json_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_number:
                {
                    result.m_value = m_lexer.get_number();

                    // NAN is returned if token could not be translated
                    // completely
                    if (std::isnan(result.m_value.number_float))
                    {
                        throw std::invalid_argument(std::string("parse error - ") +
                                                    m_lexer.get_token() + " is not a number");
                    }

                    get_token();

                    // check if conversion loses precision (special case -0.0 always loses precision)
                    const auto int_val = static_cast<number_integer_t>(result.m_value.number_float);
                    if (result.m_value.number_float == static_cast<number_float_t>(int_val) and
                            result.m_value.number_integer != json_value(-0.0f).number_integer)
                    {
                        // we would not lose precision -> return int
                        result.m_type = value_t::number_integer;
                        result.m_value = int_val;
                    }
                    else
                    {
                        // we would lose precision -> return float
                        result.m_type = value_t::number_float;
                    }
                    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 %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r12
movb $0x7, (%rdi)
movl 0x28(%rsi), %esi
leal -0x1(%rsi), %eax
cmpl $0x6, %eax
ja 0x25932
leaq 0x187fc(%rip), %rcx     # 0x3e000
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x30(%r14), %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movb $0x4, (%r12)
movq $0x1, 0x8(%r12)
jmp 0x25da2
leaq 0x30(%r14), %rbx
movq %rbx, %rdi
callq 0x23370
vmovsd %xmm0, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%r12)
vmovq %rax, %xmm0
vucomisd %xmm0, %xmm0
jp 0x25e16
movq %rbx, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
vmovq 0x8(%r12), %xmm0
vmovq %xmm0, %rcx
vcvttsd2si %xmm0, %rax
vcvtsi2sd %rax, %xmm1, %xmm1
vucomisd %xmm0, %xmm1
setp %dl
setne %sil
orb %dl, %sil
negq %rcx
seto %cl
orb %sil, %cl
je 0x25d98
movb $0x6, (%r12)
jmp 0x25da2
leaq 0x30(%r14), %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movb $0x0, (%r12)
jmp 0x25da2
leaq 0x30(%r14), %rbx
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x22210
movq %rbx, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movb $0x3, 0xa8(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x234d0
leaq 0xa8(%rsp), %rdi
movq %rax, 0x8(%rdi)
movb (%r12), %al
movb (%rdi), %cl
movb %cl, (%r12)
movb %al, (%rdi)
movq 0x8(%r12), %rax
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%r12)
movq %rax, 0x8(%rdi)
callq 0x21a10
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25da2
callq 0x22130
jmp 0x25da2
movq %r14, %rdi
callq 0x233b0
jmp 0x25da2
leaq 0x30(%r14), %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movb $0x4, (%r12)
movq $0x0, 0x8(%r12)
jmp 0x25da2
testb %bpl, %bpl
je 0x259b8
cmpq $0x0, 0x18(%r14)
je 0x25994
leaq 0x8(%r14), %rdi
movl (%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x30(%rsp), %rdx
movb $0x2, (%rdx)
movq %r12, %rcx
callq *0x20(%r14)
movl %eax, %ebp
testb %al, %al
je 0x259b8
movb $0x2, (%r12)
movl $0x18, %edi
callq 0x22250
vxorpd %xmm0, %xmm0, %xmm0
vmovupd %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rax, 0x8(%r12)
leaq 0x30(%r14), %rbx
movq %rbx, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
cmpl $0x8, %eax
jne 0x25afb
movq %rbx, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
cmpq $0x0, 0x18(%r14)
je 0x25dfc
leaq 0x8(%r14), %rdi
movl (%r14), %eax
decl %eax
movl %eax, (%r14)
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x30(%rsp), %rdx
movb $0x3, (%rdx)
movq %r12, %rcx
callq *0x20(%r14)
testb %al, %al
jne 0x25dfc
movb $0x7, %al
leaq 0xd8(%rsp), %rdi
jmp 0x25dd9
testb %bpl, %bpl
je 0x25a8e
cmpq $0x0, 0x18(%r14)
je 0x25a56
leaq 0x8(%r14), %rdi
movl (%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x30(%rsp), %rdx
movb $0x0, (%rdx)
movq %r12, %rcx
callq *0x20(%r14)
movl %eax, %ebp
testb %al, %al
je 0x25a8e
movb $0x1, (%r12)
movl $0x30, %edi
callq 0x22250
movq %rax, %rcx
addq $0x8, %rcx
vxorpd %xmm0, %xmm0, %xmm0
vmovupd %ymm0, 0x10(%rax)
vmovupd %ymm0, (%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq %rax, 0x8(%r12)
leaq 0x30(%r14), %r15
movq %r15, %rdi
vzeroupper
callq 0x22c50
movl %eax, 0x28(%r14)
cmpl $0x9, %eax
jne 0x25bc5
movq %r15, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
cmpq $0x0, 0x18(%r14)
setne %al
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x25dfc
leaq 0x8(%r14), %rdi
movl (%r14), %esi
decl %esi
movl %esi, (%r14)
movl $0x1, %edx
movq %r12, %rcx
callq 0x22d60
testb %al, %al
jne 0x25dfc
movb $0x7, %al
leaq 0xf8(%rsp), %rdi
jmp 0x25dd9
movq %r14, %rdi
movl $0xb, %esi
callq 0x233b0
movq %r12, 0x8(%rsp)
movzbl %bpl, %r15d
leaq 0x10(%rsp), %r12
cmpl $0xb, 0x28(%r14)
jne 0x25b29
movq %rbx, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movq %r12, %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x224d0
cmpb $0x7, 0x10(%rsp)
setne %al
andb %bpl, %al
cmpb $0x1, %al
jne 0x25b53
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x21fc0
movq %r12, %rdi
callq 0x21a10
cmpl $0xb, 0x28(%r14)
je 0x25b16
movq %r14, %rdi
movl $0x8, %esi
movq 0x8(%rsp), %r12
callq 0x21980
movq %rbx, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
cmpq $0x0, 0x18(%r14)
setne %al
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x25dfc
leaq 0x8(%r14), %rdi
movl (%r14), %esi
decl %esi
movl %esi, (%r14)
movl $0x3, %edx
movq %r12, %rcx
callq 0x22d60
testb %al, %al
jne 0x25dfc
movb $0x7, %al
leaq 0xc8(%rsp), %rdi
jmp 0x25dd9
movq %r14, %rdi
movl $0xb, %esi
callq 0x233b0
movq %r12, 0x8(%rsp)
leaq 0x8(%r14), %rax
movq %rax, 0x60(%rsp)
leaq 0x30(%rsp), %r12
movzbl %bpl, %ebx
cmpl $0xb, 0x28(%r14)
jne 0x25bfc
movq %r15, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movq %r14, %rdi
movl $0x4, %esi
callq 0x21980
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x22210
testb %bpl, %bpl
je 0x25c76
cmpq $0x0, 0x18(%r14)
je 0x25c7b
movb $0x3, 0x30(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x234d0
movq %rax, 0x38(%rsp)
movl (%r14), %eax
movl %eax, 0x68(%rsp)
movb $0x4, 0x88(%rsp)
cmpq $0x0, 0x18(%r14)
je 0x25e11
movq 0x60(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x88(%rsp), %rdx
movq %r12, %rcx
callq *0x20(%r14)
movl %eax, %r13d
movq %r12, %rdi
callq 0x21a10
jmp 0x25c7e
xorl %r13d, %r13d
jmp 0x25c7e
movb $0x1, %r13b
movq %r15, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movq %r14, %rdi
movl $0xa, %esi
callq 0x21980
movq %r15, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
movq %r12, %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x224d0
andb %bpl, %r13b
cmpb $0x1, %r13b
jne 0x25d14
movb 0x30(%rsp), %al
cmpb $0x7, %al
je 0x25d14
movb %al, 0x50(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x58(%rsp)
movb $0x0, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x224a0
movb (%rax), %cl
movb 0x50(%rsp), %dl
movb %dl, (%rax)
movb %cl, 0x50(%rsp)
movq 0x8(%rax), %rcx
movq 0x58(%rsp), %rdx
movq %rdx, 0x8(%rax)
movq %rcx, 0x58(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x21a10
movq %r12, %rdi
callq 0x21a10
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x25d30
callq 0x22130
cmpl $0xb, 0x28(%r14)
je 0x25be9
movq %r14, %rdi
movl $0x9, %esi
movq 0x8(%rsp), %r12
callq 0x21980
movq %r15, %rdi
callq 0x22c50
movl %eax, 0x28(%r14)
cmpq $0x0, 0x18(%r14)
setne %al
andb %al, %bpl
cmpb $0x1, %bpl
jne 0x25dfc
movl (%r14), %esi
decl %esi
movl %esi, (%r14)
movq 0x60(%rsp), %rdi
movl $0x1, %edx
movq %r12, %rcx
callq 0x22d60
testb %al, %al
jne 0x25dfc
movb $0x7, %al
leaq 0xe8(%rsp), %rdi
jmp 0x25dd9
movb $0x5, (%r12)
movq %rax, 0x8(%r12)
testb %bpl, %bpl
je 0x25dfc
cmpq $0x0, 0x18(%r14)
je 0x25dfc
leaq 0x8(%r14), %rdi
movl (%r14), %eax
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x30(%rsp), %rdx
movb $0x5, (%rdx)
movq %r12, %rcx
callq *0x20(%r14)
testb %al, %al
jne 0x25dfc
movb $0x7, %al
leaq 0xb8(%rsp), %rdi
movb %al, (%rdi)
movb (%r12), %cl
movb %al, (%r12)
movb %cl, (%rdi)
movq 0x8(%r12), %rax
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%r12)
movq %rax, 0x8(%rdi)
callq 0x21a10
movq %r12, %rax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x21570
movq %r12, 0x8(%rsp)
movl $0x10, %edi
callq 0x217b0
movq %rax, %r15
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18714(%rip), %rsi     # 0x3e54d
leaq 0x1871b(%rip), %rdx     # 0x3e55b
leaq 0x68(%rsp), %rdi
callq 0x215e0
leaq 0x88(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x229e0
leaq 0x30(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %r14, %rdx
callq 0x21ee0
leaq 0x186e6(%rip), %rsi     # 0x3e55c
leaq 0x30(%rsp), %rdi
callq 0x233d0
leaq 0x20(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x25ea4
vmovupd (%rcx), %xmm0
vmovupd %xmm0, (%r13)
jmp 0x25eb1
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
movq 0x8(%rax), %rdx
leaq 0x10(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bl
movq %r15, %rdi
callq 0x23110
xorl %ebx, %ebx
movq 0x280a8(%rip), %rsi     # 0x4df88
movq 0x28051(%rip), %rdx     # 0x4df38
movq %r15, %rdi
callq 0x230a0
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r13, %rdi
je 0x25f08
callq 0x22130
jmp 0x25f08
movq %rax, %r14
movb $0x1, %bl
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25f22
callq 0x22130
jmp 0x25f22
movq %rax, %r14
movb $0x1, %bl
leaq 0x98(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25f38
callq 0x22130
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x25f52
callq 0x22130
jmp 0x25f52
jmp 0x25f99
jmp 0x25f99
movq %rax, %r14
movb $0x1, %bl
testb %bl, %bl
je 0x25fd1
movq %r15, %rdi
callq 0x21c50
jmp 0x25fd1
movq %r12, 0x8(%rsp)
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x25fc2
jmp 0x25f99
jmp 0x25f99
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x21a10
jmp 0x25f8b
jmp 0x25f88
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x21a10
jmp 0x25fb8
jmp 0x25fb5
movq %r12, 0x8(%rsp)
jmp 0x25fce
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x21a10
jmp 0x25fd1
jmp 0x25fce
jmp 0x25fce
jmp 0x25fb5
movq %rax, %r14
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x25fd1
callq 0x22130
jmp 0x25fd1
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x21a10
movq %r14, %rdi
callq 0x23170
nop