// File: /workspace/github_cpp_makefile_star2_O2/Konano[P]UselessDatabase/./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 (!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())
                {
                    stack.reserve(stack.size() + current_item.m_value.array->size());

                    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())
                {
                    stack.reserve(stack.size() + current_item.m_value.object->size());

                    for (auto&& it : *current_item.m_value.object)
                    {
                        stack.push_back(std::move(it.second));
                    }
                }

                // current_item is destroyed here
            }

            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 0xbf32
cmpl $0x2, %ebp
jne 0xbe30
movq (%rbx), %rax
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x4, %rsi
movq %rsp, %rdi
callq 0xbfb6
movq (%rbx), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq %rsp, %rdx
callq 0xc176
leaq 0x18(%rsp), %r14
movq %rsp, %r15
movq 0x8(%rsp), %rsi
cmpq %rsi, (%rsp)
je 0xbf12
addq $-0x10, %rsi
movq %r14, %rdi
callq 0xc05e
movq 0x8(%rsp), %rdi
addq $-0x10, %rdi
movq %rdi, 0x8(%rsp)
callq 0x7de0
movzbl 0x18(%rsp), %eax
cmpl $0x1, %eax
je 0xbec8
cmpl $0x2, %eax
jne 0xbebb
movq 0x8(%rsp), %rax
subq (%rsp), %rax
sarq $0x4, %rax
movq 0x20(%rsp), %rcx
movq 0x8(%rcx), %rsi
subq (%rcx), %rsi
sarq $0x4, %rsi
addq %rax, %rsi
movq %r15, %rdi
callq 0xbfb6
movq 0x20(%rsp), %rax
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq %r15, %rdx
callq 0xc176
movq 0x20(%rsp), %rdi
callq 0xc0a8
movq %r14, %rdi
callq 0x7de0
jmp 0xbe38
movq 0x8(%rsp), %rsi
subq (%rsp), %rsi
sarq $0x4, %rsi
movq 0x20(%rsp), %rax
addq 0x28(%rax), %rsi
movq %r15, %rdi
callq 0xbfb6
movq 0x20(%rsp), %r13
movq 0x18(%r13), %r12
addq $0x8, %r13
cmpq %r13, %r12
je 0xbebb
leaq 0x40(%r12), %rsi
movq %r15, %rdi
callq 0xc1ae
movq %r12, %rdi
callq 0x52e0
movq %rax, %r12
jmp 0xbef3
cmpb $0x3, %bpl
je 0xbf7e
movzbl %bpl, %eax
cmpl $0x2, %eax
je 0xbf72
cmpl $0x1, %eax
jne 0xbf91
movq (%rbx), %rdi
callq 0xc33e
pushq $0x30
jmp 0xbf88
movq (%rbx), %rax
movq 0x28(%rax), %rsi
movq %rsp, %rdi
callq 0xbfb6
movq (%rbx), %r12
movq 0x18(%r12), %r15
addq $0x8, %r12
movq %rsp, %r14
cmpq %r12, %r15
je 0xbe30
leaq 0x40(%r15), %rsi
movq %r14, %rdi
callq 0xc1ae
movq %r15, %rdi
callq 0x52e0
movq %rax, %r15
jmp 0xbf50
movq (%rbx), %rdi
callq 0xc0b0
pushq $0x18
jmp 0xbf88
movq (%rbx), %rdi
callq 0x5200
pushq $0x20
popq %rsi
movq (%rbx), %rdi
callq 0x53f0
movq %rsp, %rdi
callq 0xc0b0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xbfae
jmp 0xbfae
jmp 0xbfae
movq %rax, %rdi
callq 0x5e9c