// File: oknenavin[P]cxon/test/../src/cxon/lang/cbor/common/tag.hxx
// Function: std::enable_if<std::is_unsigned<unsigned long>::value, bool>::type cxon::cbor::tag::read<cxon::CBOR<cxon::cbor::format_traits>, unsigned long, char const*, cxon::context<cxon::CBOR<cxon::cbor::format_traits>, cxon::napa::imp::var<cxon::node::recursion_guard, unsigned int>>>(unsigned long&, char const*&, char const*, cxon::context<cxon::CBOR<cxon::cbor::format_traits>, cxon::napa::imp::var<cxon::node::recursion_guard, unsigned int>>&)
inline auto read(T& t, II& i, II e, Cx& cx) -> enable_if_t<std::is_unsigned<T>::value, bool> {
                auto b = bio::peek(i, e);
                switch (b & X::mjr) {
                    case X::tag: {
                        II const o = i;
                        switch (b = b & X::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(i, e), t = std::size_t(b), true);
                            case 0x18: case 0x19: case 0x1A: case 0x1B:
                                return  (bio::get(i, e), bio::get(t, 1 << (b - 0x18), i, e)) ||
                                        (bio::rewind(i, o), cx/cbor::read_error::integer_invalid)
                                ;
                            case 0x1C: case 0x1D: case 0x1E: case 0x1F:
                                return  (bio::rewind(i, o), cx/cbor::read_error::tag_invalid);
                            default:                                            // LCOV_EXCL_LINE
                                return  CXON_ASSERT(0, "unexpected"), false;    // LCOV_EXCL_LINE
                        }
                    }
                    default:
                                return  (t = T(-1), true);
                }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0xff, %edx
callq 0x309a0
movb %al, -0x29(%rbp)
movzbl -0x29(%rbp), %eax
andl $-0x20, %eax
subl $0xc0, %eax
jne 0x32855
jmp 0x32761
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movzbl -0x29(%rbp), %eax
andl $0x1f, %eax
movl %eax, -0x3c(%rbp)
movb %al, -0x29(%rbp)
subb $0x18, %al
jb 0x327a0
jmp 0x3277f
movl -0x3c(%rbp), %eax
addl $-0x18, %eax
subl $0x4, %eax
jb 0x327c8
jmp 0x3278c
movl -0x3c(%rbp), %eax
addl $-0x1c, %eax
subl $0x4, %eax
jb 0x3282d
jmp 0x3284f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0xff, %edx
callq 0x310f0
movzbl -0x29(%rbp), %eax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x32864
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0xff, %edx
callq 0x310f0
movq -0x10(%rbp), %rdi
movzbl -0x29(%rbp), %ecx
subl $0x18, %ecx
movl $0x1, %esi
shll %cl, %esi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x328b0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x3d(%rbp)
jne 0x32823
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x31170
movq -0x28(%rbp), %rdi
movl $0x4, %esi
callq 0x31190
movb %al, -0x3d(%rbp)
movb -0x3d(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x32864
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x31170
movq -0x28(%rbp), %rdi
movl $0x8, %esi
callq 0x31190
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x32864
movb $0x0, -0x1(%rbp)
jmp 0x32864
movq -0x10(%rbp), %rax
movq $-0x1, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nop