// File: /workspace/github_cpp_makefile_star2_O1/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 $0x28, %rsp
movq %rcx, %rbp
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %r12
movq %rdi, 0x20(%rsp)
movq (%rsi), %r14
cmpq %r15, %r14
je 0x9ffa7
movzbl (%r14), %eax
jmp 0x9ffac
movl $0xff, %eax
movl %eax, %ebx
andl $-0x20, %ebx
movl %eax, %r13d
andl $0x1f, %r13d
shrl $0x5, %eax
movl $0xc3, %ecx
btl %eax, %ecx
jae 0x9fff3
cmpl $0x18, %r13d
jae 0xa0108
cmpq %r15, %r14
setne %bpl
je 0xa0399
movzbl (%r14), %esi
movq %r12, %rdi
movq %rdx, %rbx
callq 0x32ffa
incq (%rbx)
jmp 0xa0399
movl $0xc, %ecx
btl %eax, %ecx
jae 0xa0063
movq %rdx, (%rsp)
cmpl $0x18, %r13d
jae 0xa019a
movq %rbp, 0x8(%rsp)
incl %r13d
movq %r15, %rbx
subq %r14, %rbx
cmpq %r13, %rbx
cmovaeq %r13, %rbx
movq %r14, 0x10(%rsp)
subq %r14, %r15
je 0xa004b
leaq 0x1(%rbx), %rbp
movq 0x10(%rsp), %r14
movzbl (%r14), %esi
movq %r12, %rdi
callq 0x32ffa
incq %r14
decq %rbp
cmpq $0x1, %rbp
jg 0xa0033
movq (%rsp), %rax
addq %rbx, (%rax)
movb $0x1, %bpl
cmpq %r13, %r15
jb 0xa0179
jmp 0xa0399
cmpl $0x18, %r13d
jae 0xa023c
movq %rbp, 0x8(%rsp)
cmpq %r15, %r14
je 0xa0092
movzbl (%r14), %esi
movq %r12, %rdi
movq %r14, %rbp
movq %rdx, %r14
callq 0x32ffa
movq %r14, %rdx
movq %rbp, %r14
incq (%rdx)
testl %r13d, %r13d
sete %bpl
je 0xa0399
movq %r14, 0x10(%rsp)
movq %r12, %rdi
movl %ebx, %esi
movq %rdx, %r14
movq %r15, %rcx
movq 0x8(%rsp), %r8
callq 0xa0570
testb %al, %al
je 0xa00e6
movzbl %bl, %ebx
decl %r13d
sete %bpl
je 0xa0399
movq %r12, %rdi
movl %ebx, %esi
movq %r14, %rdx
movq %r15, %rcx
movq 0x8(%rsp), %r8
callq 0xa0570
testb %al, %al
jne 0xa00c0
movq 0x10(%rsp), %rax
movq %rax, (%r14)
callq 0x31a3a
movq 0x8(%rsp), %r15
movl $0x1, (%r15)
movq %rax, 0x8(%r15)
jmp 0xa0399
leal -0x18(%r13), %eax
cmpl $0x4, %eax
jae 0xa0387
movq %rdx, (%rsp)
movq %rbp, 0x8(%rsp)
addb $-0x18, %r13b
movl $0x1, %ebx
movl %r13d, %ecx
shll %cl, %ebx
incl %ebx
movq %r15, %r13
subq %r14, %r13
cmpq %rbx, %r13
cmovaeq %rbx, %r13
movq %r14, 0x10(%rsp)
subq %r14, %r15
je 0xa0166
leaq 0x1(%r13), %rbp
movq 0x10(%rsp), %r14
movzbl (%r14), %esi
movq %r12, %rdi
callq 0x32ffa
incq %r14
decq %rbp
cmpq $0x1, %rbp
jg 0xa014e
movq (%rsp), %rax
addq %r13, (%rax)
movb $0x1, %bpl
cmpq %rbx, %r15
jae 0xa0399
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
callq 0x31a3a
movq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
movq %rax, 0x8(%rcx)
jmp 0xa0397
leal -0x18(%r13), %eax
cmpl $0x4, %eax
jae 0xa032b
movq %rbp, 0x8(%rsp)
cmpq %r15, %r14
je 0xa021b
movzbl (%r14), %esi
movq %r12, %rdi
callq 0x32ffa
movq (%rsp), %rdx
incq (%rdx)
addb $-0x18, %r13b
movl $0x1, %ebx
movl %r13d, %ecx
shll %cl, %ebx
leaq 0x18(%rsp), %rdi
movl %ebx, %esi
movq %r15, %rcx
callq 0x99c98
testb %al, %al
je 0xa021b
movq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebx, %edx
callq 0xa04c8
testb %al, %al
je 0xa021b
movq 0x20(%rsp), %rdi
movq 0x18(%rsp), %rcx
movq (%rsp), %rsi
movq %r15, %rdx
callq 0xa0462
movb $0x1, %bpl
testb %al, %al
jne 0xa0399
movq (%rsp), %rax
movq %r14, (%rax)
callq 0x31a3a
movq 0x8(%rsp), %r15
movl $0x1, (%r15)
movq %rax, 0x8(%r15)
jmp 0xa0397
leal -0x18(%r13), %eax
cmpl $0x4, %eax
jae 0xa037d
movq %rbp, 0x8(%rsp)
cmpq %r15, %r14
je 0xa03aa
movq %r14, 0x10(%rsp)
movzbl (%r14), %esi
movq %r12, %rdi
movq %rdx, %r14
callq 0x32ffa
incq (%r14)
addb $-0x18, %r13b
movl $0x1, %ebp
movl %r13d, %ecx
shll %cl, %ebp
leaq 0x18(%rsp), %rdi
movl %ebp, %esi
movq %r14, (%rsp)
movq %r14, %rdx
movq %r15, %rcx
callq 0x99c98
testb %al, %al
je 0xa03b1
movq 0x18(%rsp), %rsi
leaq 0x20(%rsp), %rdi
movl %ebp, %edx
callq 0xa04c8
testb %al, %al
movq 0x10(%rsp), %r14
je 0xa0430
cmpq $0x0, 0x18(%rsp)
sete %bpl
je 0xa0399
movq %r12, %rdi
movl %ebx, %esi
movq (%rsp), %rdx
movq %r15, %rcx
movq 0x8(%rsp), %r8
callq 0xa0570
movq (%rsp), %rdx
testb %al, %al
je 0xa0436
movl $0x1, %r13d
movzbl %bl, %ebx
movl %r13d, %eax
cmpq %rax, 0x18(%rsp)
sete %bpl
je 0xa0399
movq %r12, %rdi
movl %ebx, %esi
movq (%rsp), %rdx
movq %r15, %rcx
movq 0x8(%rsp), %r8
callq 0xa0570
movq (%rsp), %rdx
incl %r13d
testb %al, %al
jne 0xa02f3
jmp 0xa0436
addl $-0x1c, %r13d
cmpl $0x3, %r13d
movq (%rsp), %rcx
jb 0xa0387
jmp 0xa0340
cmpb $-0x1, (%rax)
je 0xa0364
movq (%rcx), %rax
cmpq %r15, %rax
je 0xa035c
movq 0x20(%rsp), %rdi
movzbl (%rax), %esi
callq 0x32ffa
movq (%rsp), %rcx
incq (%rcx)
movq (%rcx), %rax
cmpq %r15, %rax
jne 0xa033b
cmpq %r15, %rax
je 0xa045a
movq 0x20(%rsp), %rdi
movzbl (%rax), %esi
movq %rcx, %rbx
jmp 0xa0420
addl $-0x1c, %r13d
cmpl $0x3, %r13d
jae 0xa03be
callq 0x31a3a
movl $0x1, (%rbp)
movq %rax, 0x8(%rbp)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0xa0436
xorl %ebp, %ebp
movq (%rsp), %rdx
movq 0x10(%rsp), %r14
jmp 0xa0436
cmpq %r15, %r14
je 0xa03de
movzbl (%r14), %esi
movq %r12, %rdi
movq %r14, %r13
movq %rdx, %r14
callq 0x32ffa
movq %r14, %rdx
movq %r13, %r14
incq (%rdx)
movzbl %bl, %ebx
movq (%rdx), %rax
cmpq %r15, %rax
je 0xa0410
cmpb $-0x1, (%rax)
je 0xa0410
movq %r12, %rdi
movl %ebx, %esi
movq %r14, %r13
movq %rdx, %r14
movq %r15, %rcx
movq %rbp, %r8
callq 0xa0570
movq %r14, %rdx
movq %r13, %r14
testb %al, %al
jne 0xa03e1
jmp 0xa0452
cmpq %r15, %rax
je 0xa0452
movq 0x20(%rsp), %rdi
movzbl (%rax), %esi
movq %rdx, %rbx
callq 0x32ffa
incq (%rbx)
movb $0x1, %bpl
jmp 0xa0399
xorl %ebp, %ebp
movq (%rsp), %rdx
movq %r14, (%rdx)
callq 0x31a3a
movq 0x8(%rsp), %rcx
movl $0x1, (%rcx)
movq %rax, 0x8(%rcx)
jmp 0xa0399
movq %r14, (%rdx)
jmp 0xa0387
movq %r14, (%rcx)
jmp 0xa0387