// File: linuxmao-org[P]VL1-emulator/utils/sources/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>::json_value::destroy(nlohmann::detail::value_t)
void destroy(value_t t) noexcept
        {
            // flatten the current json_value to a heap-allocated stack
            std::vector<basic_json> stack;

            // move the top-level items to stack
            if (t == value_t::array)
            {
                stack.reserve(array->size());
                std::move(array->begin(), array->end(), std::back_inserter(stack));
            }
            else if (t == value_t::object)
            {
                stack.reserve(object->size());
                for (auto&& it : *object)
                {
                    stack.push_back(std::move(it.second));
                }
            }

            while (not stack.empty())
            {
                // move the last item to local variable to be processed
                basic_json current_item(std::move(stack.back()));
                stack.pop_back();

                // if current_item is array/object, move
                // its children to the stack to be processed later
                if (current_item.is_array())
                {
                    std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(),
                              std::back_inserter(stack));

                    current_item.m_value.array->clear();
                }
                else if (current_item.is_object())
                {
                    for (auto&& it : *current_item.m_value.object)
                    {
                        stack.push_back(std::move(it.second));
                    }

                    current_item.m_value.object->clear();
                }

                // it's now safe that current_item get destructed
                // since it doesn't have any children
            }

            switch (t)
            {
                case value_t::object:
                {
                    AllocatorType<object_t> alloc;
                    std::allocator_traits<decltype(alloc)>::destroy(alloc, object);
                    std::allocator_traits<decltype(alloc)>::deallocate(alloc, object, 1);
                    break;
                }

                case value_t::array:
                {
                    AllocatorType<array_t> alloc;
                    std::allocator_traits<decltype(alloc)>::destroy(alloc, array);
                    std::allocator_traits<decltype(alloc)>::deallocate(alloc, array, 1);
                    break;
                }

                case value_t::string:
                {
                    AllocatorType<string_t> alloc;
                    std::allocator_traits<decltype(alloc)>::destroy(alloc, string);
                    std::allocator_traits<decltype(alloc)>::deallocate(alloc, string, 1);
                    break;
                }

                default:
                {
                    break;
                }
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x1d820
cmpb $0x2, -0x9(%rbp)
jne 0x21360
movq -0xc8(%rbp), %rax
movq (%rax), %rdi
callq 0x13070
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x216b0
jmp 0x212f0
movq -0xc8(%rbp), %rax
movq (%rax), %rdi
callq 0x12f20
movq %rax, %rcx
movq -0xc8(%rbp), %rax
movq %rcx, -0x30(%rbp)
movq (%rax), %rdi
callq 0x12da0
movq %rax, -0x38(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x21820
movq %rax, -0xd0(%rbp)
jmp 0x2132b
movq -0xd0(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x217b0
movq %rax, -0xd8(%rbp)
jmp 0x21350
movq -0xd8(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x213f3
cmpb $0x1, -0x9(%rbp)
jne 0x213f1
movq -0xc8(%rbp), %rax
movq (%rax), %rdi
callq 0x21850
movq %rax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x216b0
jmp 0x21387
movq -0xc8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
callq 0x17620
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
callq 0x18430
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x18490
testb $0x1, %al
jne 0x213c2
jmp 0x213ef
leaq -0x58(%rbp), %rdi
callq 0x19290
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rsi
addq $0x20, %rsi
leaq -0x28(%rbp), %rdi
callq 0x12a00
jmp 0x213e2
jmp 0x213e4
leaq -0x58(%rbp), %rdi
callq 0x188f0
jmp 0x213af
jmp 0x213f1
jmp 0x213f3
jmp 0x213f5
leaq -0x28(%rbp), %rdi
callq 0x21870
xorb $-0x1, %al
testb $0x1, %al
jne 0x21409
jmp 0x2155d
leaq -0x28(%rbp), %rdi
callq 0x12a30
movq %rax, %rsi
leaq -0x78(%rbp), %rdi
callq 0x12920
leaq -0x28(%rbp), %rdi
callq 0x19f90
leaq -0x78(%rbp), %rdi
callq 0x129c0
testb $0x1, %al
jne 0x21436
jmp 0x214af
movq -0x70(%rbp), %rdi
callq 0x12f20
movq %rax, -0x80(%rbp)
movq -0x70(%rbp), %rdi
callq 0x12da0
movq %rax, -0x88(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x21820
movq %rax, -0xe0(%rbp)
jmp 0x21465
movq -0xe0(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x80(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x90(%rbp), %rdx
callq 0x217b0
movq %rax, -0xe8(%rbp)
jmp 0x21493
movq -0xe8(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x70(%rbp), %rdi
callq 0x218b0
jmp 0x2154f
leaq -0x78(%rbp), %rdi
callq 0x129e0
testb $0x1, %al
jne 0x214c1
jmp 0x2154d
movq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x17620
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rdi
callq 0x18430
movq %rax, -0xb0(%rbp)
leaq -0xa8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x18490
testb $0x1, %al
jne 0x2150b
jmp 0x21544
leaq -0xa8(%rbp), %rdi
callq 0x19290
movq %rax, -0xb8(%rbp)
movq -0xb8(%rbp), %rsi
addq $0x20, %rsi
leaq -0x28(%rbp), %rdi
callq 0x12a00
jmp 0x21534
jmp 0x21536
leaq -0xa8(%rbp), %rdi
callq 0x188f0
jmp 0x214f2
movq -0x70(%rbp), %rdi
callq 0x218d0
jmp 0x2154f
leaq -0x78(%rbp), %rdi
callq 0x5cd0
jmp 0x213f5
movb -0x9(%rbp), %al
movb %al, -0xe9(%rbp)
subb $0x1, %al
je 0x2158b
jmp 0x2156c
movb -0xe9(%rbp), %al
subb $0x2, %al
je 0x215e2
jmp 0x21578
movb -0xe9(%rbp), %al
subb $0x3, %al
je 0x21636
jmp 0x2168a
leaq -0xb9(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x14a60
movq -0xc8(%rbp), %rax
movq -0xf8(%rbp), %rdi
movq (%rax), %rsi
callq 0x218f0
movq -0xc8(%rbp), %rax
movq -0xf8(%rbp), %rdi
movq (%rax), %rsi
movl $0x1, %edx
callq 0x15d00
jmp 0x215d1
leaq -0xb9(%rbp), %rdi
callq 0x14c00
jmp 0x2168c
leaq -0xba(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x15e70
movq -0xc8(%rbp), %rax
movq -0x100(%rbp), %rdi
movq (%rax), %rsi
callq 0x21920
movq -0xc8(%rbp), %rax
movq -0x100(%rbp), %rdi
movq (%rax), %rsi
movl $0x1, %edx
callq 0x16b30
jmp 0x21628
leaq -0xba(%rbp), %rdi
callq 0x16010
jmp 0x2168c
leaq -0xbb(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x16ca0
movq -0xc8(%rbp), %rax
movq -0x108(%rbp), %rdi
movq (%rax), %rsi
callq 0x18560
movq -0xc8(%rbp), %rax
movq -0x108(%rbp), %rdi
movq (%rax), %rsi
movl $0x1, %edx
callq 0x17310
jmp 0x2167c
leaq -0xbb(%rbp), %rdi
callq 0x16e40
jmp 0x2168c
jmp 0x2168c
leaq -0x28(%rbp), %rdi
callq 0x21950
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq %rax, %rdi
callq 0x60e0
nopw %cs:(%rax,%rax)