// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
andq $0x0, 0x10(%rsp)
cmpl $0x1, %esi
je 0xc47a
cmpl $0x2, %ebp
jne 0xc3b2
movq (%rbx), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x4, %rsi
movq %rsp, %rdi
callq 0xc4fe
movq (%rbx), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq %rsp, %rdx
callq 0xc5bc
leaq 0x18(%rsp), %r14
movq %rsp, %r15
movq 0x8(%rsp), %rsi
cmpq %rsi, (%rsp)
je 0xc45a
addq $-0x10, %rsi
movq %r14, %rdi
callq 0x849e
movq 0x8(%rsp), %rdi
addq $-0x10, %rdi
movq %rdi, 0x8(%rsp)
callq 0x3ffc
movzbl 0x18(%rsp), %eax
cmpl $0x1, %eax
je 0xc417
cmpl $0x2, %eax
jne 0xc44d
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq %r15, %rdx
callq 0xc5bc
movq 0x20(%rsp), %rdi
callq 0xc592
jmp 0xc44d
movq 0x20(%rsp), %r13
movq 0x18(%r13), %r12
addq $0x8, %r13
cmpq %r13, %r12
je 0xc443
leaq 0x40(%r12), %rsi
movq %r15, %rdi
callq 0x84d4
movq %r12, %rdi
callq 0x31a0
movq %rax, %r12
jmp 0xc424
movq 0x20(%rsp), %rdi
callq 0xc624
movq %r14, %rdi
callq 0x3ffc
jmp 0xc3ba
cmpb $0x3, %bpl
je 0xc4c6
movzbl %bpl, %eax
cmpl $0x2, %eax
je 0xc4ba
cmpl $0x1, %eax
jne 0xc4d9
movq (%rbx), %rdi
callq 0xc652
pushq $0x30
jmp 0xc4d0
movq (%rbx), %rax
movq 0x28(%rax), %rsi
movq %rsp, %rdi
callq 0xc4fe
movq (%rbx), %r12
movq 0x18(%r12), %r15
addq $0x8, %r12
movq %rsp, %r14
cmpq %r12, %r15
je 0xc3b2
leaq 0x40(%r15), %rsi
movq %r14, %rdi
callq 0x84d4
movq %r15, %rdi
callq 0x31a0
movq %rax, %r15
jmp 0xc498
movq (%rbx), %rdi
callq 0xc59a
pushq $0x18
jmp 0xc4d0
movq (%rbx), %rdi
callq 0x3120
pushq $0x20
popq %rsi
movq (%rbx), %rdi
callq 0x3230
movq %rsp, %rdi
callq 0xc59a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc4f6
jmp 0xc4f6
jmp 0xc4f6
movq %rax, %rdi
callq 0x4186