// File: /workspace/github_cpp_makefile_star2_O3/oknenavin[P]cxon/test/../src/cxon/lang/cbor/common/sink.hxx
// Function: bool cxon::cbor::imp::sink_reader_<cxon::CBOR<cxon::cbor::format_traits>, cxon::cbor::sink<std::__cxx11::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char>>>>::read<unsigned char const*, cxon::context<cxon::CBOR<cxon::cbor::format_traits>>, cxon::CBOR<cxon::cbor::format_traits>>(cxon::cbor::sink<std::__cxx11::basic_string<unsigned char, std::char_traits<unsigned char>, std::allocator<unsigned char>>>&, unsigned char const*&, unsigned char const*, cxon::context<cxon::CBOR<cxon::cbor::format_traits>>&)
static bool read(S& s, II& i, II e, Cx& cx) {
                    auto t = std::back_inserter(s);
                    auto const b = bio::peek(i, e);
                    unsigned const mjr = b & Y::mjr;
                    unsigned const mnr = b & Y::mnr;
                    switch (mjr) {
                        case Y::pint: case Y::nint: case Y::tag: case Y::svn: {
                            II const o = i;
                            switch (mnr) {
                                case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
                                case 0x08: case 0x09: case 0x0A: case 0x0B: case 0x0C: case 0x0D: case 0x0E: case 0x0F:
                                case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
                                    return  (bio::get(t, i, e));
                                case 0x18: case 0x19: case 0x1A: case 0x1B:
                                    return  (bio::get(t, i, e, 1 + (1 << (mnr - 0x18)))) ||
                                            (bio::rewind(i, o), cx/cbor::read_error::unexpected)
                                    ;
                                case 0x1C: case 0x1D: case 0x1E: case 0x1F:
                                    return  (bio::rewind(i, o), cx/cbor::read_error::unexpected);
                                default:                                            // LCOV_EXCL_LINE
                                    return  CXON_ASSERT(0, "unexpected"), false;    // LCOV_EXCL_LINE
                            }
                        }
                        case Y::bstr: case Y::tstr: {
                            II const o = i;
                            switch (mnr) {
                                case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
                                case 0x08: case 0x09: case 0x0A: case 0x0B: case 0x0C: case 0x0D: case 0x0E: case 0x0F:
                                case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
                                    return  (bio::get(t, i, e, 1 + mnr)) ||
                                            (bio::rewind(i, o), cx/cbor::read_error::unexpected)
                                    ;
                                case 0x18: case 0x19: case 0x1A: case 0x1B: {
                                    std::size_t n;
                                    return  (
                                                bio::get(t, i, e) &&
                                                bio::get(n, 1U << (mnr - 0x18), i, e) &&
                                                bio::poke(t, n, 1U << (mnr - 0x18)) &&
                                                bio::get(t, i, e, n)
                                            )   ||
                                            (   bio::rewind(i, o), cx/cbor::read_error::unexpected
                                            )
                                    ;
                                }
                                case 0x1F:
                                    do      (bio::get(t, i, e)); // should not fail
                                    while   (bio::peek(i, e) != Y::brk);
                                    return  (bio::get(t, i, e) || (bio::rewind(i, o), cx/cbor::read_error::unexpected));
                                case 0x1C: case 0x1D: case 0x1E:
                                    return  (bio::rewind(i, o), cx/cbor::read_error::unexpected);
                                default:                                            // LCOV_EXCL_LINE
                                    return  CXON_ASSERT(0, "unexpected"), false;    // LCOV_EXCL_LINE
                            }
                        }
                        case Y::arr: case Y::map: {
                            II const o = i;
                            switch (mnr) {
                                case 0x00: case 0x01: case 0x02: case 0x03: case 0x04: case 0x05: case 0x06: case 0x07:
                                case 0x08: case 0x09: case 0x0A: case 0x0B: case 0x0C: case 0x0D: case 0x0E: case 0x0F:
                                case 0x10: case 0x11: case 0x12: case 0x13: case 0x14: case 0x15: case 0x16: case 0x17:
                                    bio::get(t, i, e); // should not fail
                                    for (unsigned j = 0; j != mnr; ++j)
                                        if (!read_element(s, mjr, i, e, cx))
                                            return (bio::rewind(i, o), cx/cbor::read_error::unexpected);
                                    return  true;
                                case 0x18: case 0x19: case 0x1A: case 0x1B: {
                                    std::size_t n;
                                    if (!bio::get(t, i, e) || !bio::get(n, 1U << (mnr - 0x18), i, e) || !bio::poke(t, n, 1U << (mnr - 0x18)))
                                        return (bio::rewind(i, o), cx/cbor::read_error::unexpected);
                                    for (unsigned j = 0; j != n; ++j)
                                        if (!read_element(s, mjr, i, e, cx))
                                            return (bio::rewind(i, o), cx/cbor::read_error::unexpected);
                                    return  true;
                                }
                                case 0x1F:
                                    bio::get(t, i, e); // should not fail
                                    while (bio::peek(i, e) != Y::brk)
                                        if (!read_element(s, mjr, i, e, cx))
                                            return (bio::rewind(i, o), cx/cbor::read_error::unexpected);
                                    return  (bio::get(t, i, e) || (bio::rewind(i, o), cx/cbor::read_error::unexpected));
                                case 0x1C: case 0x1D: case 0x1E:
                                    return  (bio::rewind(i, o), cx/cbor::read_error::unexpected);
                                default:                                            // LCOV_EXCL_LINE
                                    return  CXON_ASSERT(0, "unexpected"), false;    // LCOV_EXCL_LINE
                            }
                        }
                        default:                                        // LCOV_EXCL_LINE
                            return CXON_ASSERT(0, "unexpected"), false; // LCOV_EXCL_LINE
                    }
                }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbp
movq %rdi, 0x30(%rsp)
movq (%rsi), %r15
cmpq %rdx, %r15
je 0xa1ab2
movq %rdi, %r12
movzbl (%r15), %eax
movl %eax, %edi
andl $-0x20, %edi
movl %eax, %ebx
andl $0x1f, %ebx
movl %eax, %ecx
shrl $0x5, %ecx
movq %rsi, %r13
movl $0xc3, %esi
btl %ecx, %esi
jae 0xa17b8
cmpl $0x18, %ebx
jae 0xa1882
movzbl %al, %esi
movq %r12, %rdi
callq 0x313ae
incq (%r13)
movb $0x1, %cl
jmp 0xa1ac4
movl $0xc, %esi
btl %ecx, %esi
jae 0xa1823
cmpl $0x18, %ebx
jae 0xa190d
movq %r13, 0x10(%rsp)
movq %rbp, 0x8(%rsp)
incq %rbx
subq %r15, %rdx
cmpq %rbx, %rdx
movq %rbx, %r13
movq %rdx, 0x28(%rsp)
cmovbq %rdx, %r13
leaq 0x1(%r13), %rbp
movq %r15, %r14
movzbl (%r14), %esi
movq %r12, %rdi
callq 0x313ae
incq %r14
decq %rbp
cmpq $0x1, %rbp
ja 0xa17f1
movq 0x10(%rsp), %rax
addq %r13, (%rax)
movb $0x1, %cl
cmpq %rbx, 0x28(%rsp)
jae 0xa1ac4
jmp 0xa1ada
cmpl $0x18, %ebx
jae 0xa1993
movl %edi, 0x1c(%rsp)
movq %rdx, %r14
movq %r15, 0x10(%rsp)
movq %rbp, %r15
movzbl %al, %esi
movq %r12, %rdi
callq 0x313ae
incq (%r13)
movb $0x1, %cl
testl %ebx, %ebx
je 0xa1ac4
movq %r13, %rbp
movzbl 0x1c(%rsp), %r13d
movq %r12, %rdi
movl %r13d, %esi
movq %rbp, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0xa1c72
testb %al, %al
je 0xa1a4c
decl %ebx
jne 0xa185d
jmp 0xa17b1
leal -0x18(%rbx), %eax
cmpl $0x4, %eax
jae 0xa1ab2
movq %rbp, 0x8(%rsp)
movq %r13, 0x10(%rsp)
leal -0x18(%rbx), %ecx
movl $0x1, %ebx
shll %cl, %ebx
incl %ebx
subq %r15, %rdx
cmpq %rbx, %rdx
movq %rbx, %rcx
movq %rdx, 0x28(%rsp)
cmovbq %rdx, %rcx
movq %rcx, %r14
leaq 0x1(%rcx), %rbp
movq %r15, %r13
movzbl (%r13), %esi
movq %r12, %rdi
callq 0x313ae
incq %r13
decq %rbp
cmpq $0x1, %rbp
ja 0xa18c0
movq 0x8(%rsp), %r12
movq 0x10(%rsp), %rax
addq %r14, (%rax)
movb $0x1, %cl
cmpq %rbx, 0x28(%rsp)
jae 0xa1ac4
movq %r15, (%rax)
callq 0x2fe02
movl $0x1, (%r12)
movq %rax, 0x8(%r12)
jmp 0xa1ac2
leal -0x18(%rbx), %ecx
cmpl $0x4, %ecx
jae 0xa1a67
movq %r15, %r14
movq %rbp, %r15
movzbl %al, %esi
movq %r12, %rdi
movq %rdx, %r12
callq 0x313ae
incq (%r13)
leal -0x18(%rbx), %ecx
movq %r13, %rbx
movl $0x1, %ebp
shll %cl, %ebp
leaq 0x20(%rsp), %rdi
movl %ebp, %esi
movq %r13, %rdx
movq %r12, %r13
movq %r12, %rcx
callq 0x9b4e6
testb %al, %al
je 0xa198b
movq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdi
movl %ebp, %edx
callq 0xa1bcc
testb %al, %al
je 0xa198b
movq 0x30(%rsp), %rdi
movq 0x20(%rsp), %rcx
movq %rbx, %rsi
movq %r13, %rdx
callq 0xa1b66
movb $0x1, %cl
testb %al, %al
jne 0xa1ac4
movq %r14, (%rbx)
jmp 0xa1a55
leal -0x18(%rbx), %ecx
cmpl $0x4, %ecx
jae 0xa1aaa
movl %edi, 0x1c(%rsp)
movq %rbp, 0x8(%rsp)
movzbl %al, %esi
movq %r12, %rdi
movq %rdx, %r14
callq 0x313ae
incq (%r13)
leal -0x18(%rbx), %ecx
movl $0x1, %ebp
shll %cl, %ebp
leaq 0x20(%rsp), %rdi
movl %ebp, %esi
movq %r13, 0x10(%rsp)
movq %r13, %rdx
movq %r14, 0x28(%rsp)
movq %r14, %rcx
callq 0x9b4e6
testb %al, %al
je 0xa1ad5
movq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdi
movl %ebp, %edx
callq 0xa1bcc
testb %al, %al
je 0xa1ad5
movb $0x1, %cl
cmpq $0x0, 0x20(%rsp)
je 0xa1ac4
movl $0x1, %ebx
movzbl 0x1c(%rsp), %r13d
movq %r12, %rdi
movl %r13d, %esi
movq 0x10(%rsp), %rdx
movq 0x28(%rsp), %rcx
movq 0x8(%rsp), %r8
callq 0xa1c72
testb %al, %al
je 0xa1ad5
movl %ebx, %eax
incl %ebx
cmpq %rax, 0x20(%rsp)
jne 0xa1a1a
jmp 0xa17b1
movq 0x10(%rsp), %rax
movq %rax, (%rbp)
callq 0x2fe02
movl $0x1, (%r15)
movq %rax, 0x8(%r15)
jmp 0xa1ac2
leal -0x1c(%rbx), %ecx
cmpl $0x3, %ecx
jb 0xa1ab2
movq %r15, %rcx
cmpq %rdx, %rcx
je 0xa1a93
movzbl %al, %esi
movq %r12, %rdi
movq %rdx, %rbx
callq 0x313ae
movq %rbx, %rdx
movq (%r13), %rcx
incq %rcx
movq %rcx, (%r13)
cmpq %rdx, %rcx
je 0xa1b45
movb (%rcx), %al
cmpb $-0x1, %al
jne 0xa1a72
movzbl (%rcx), %esi
jmp 0xa17a5
leal -0x1c(%rbx), %ecx
cmpl $0x3, %ecx
jae 0xa1af3
callq 0x2fe02
movl $0x1, (%rbp)
movq %rax, 0x8(%rbp)
xorl %ecx, %ecx
movl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movq %r15, (%rax)
callq 0x2fe02
movq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
movq %rax, 0x8(%rcx)
jmp 0xa1ac2
movq %rbp, 0x8(%rsp)
movzbl %al, %esi
movl %edi, %ebx
movq %r12, %rdi
movq %rdx, %rbp
callq 0x313ae
incq (%r13)
movq %r13, %r14
movzbl %bl, %r13d
movq %r14, %rbx
movq (%r14), %rax
cmpq %rbp, %rax
je 0xa1b4e
cmpb $-0x1, (%rax)
je 0xa1b53
movq %r12, %rdi
movl %r13d, %esi
movq %rbx, %r14
movq %rbx, %rdx
movq %rbp, %rcx
movq 0x8(%rsp), %r8
callq 0xa1c72
testb %al, %al
jne 0xa1b13
movq %r15, (%r14)
jmp 0xa1add
movq %r15, (%r13)
jmp 0xa1ab2
movq %r15, (%rbx)
jmp 0xa1add
movzbl (%rax), %esi
movq %r12, %rdi
callq 0x313ae
incq (%rbx)
jmp 0xa17b1