// File: /workspace/github_cpp_makefile_star2_O3/xelia-it[P]mustache/test/src/../../src/../third-party/json/single_include/nlohmann/json.hpp
// Function: nlohmann::json_abi_v3_11_2::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::json_abi_v3_11_2::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char>>, void>::json_value::destroy(nlohmann::json_abi_v3_11_2::detail::value_t)
void destroy(value_t t)
        {
            if (t == value_t::array || t == value_t::object)
            {
                // 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
                {
                    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())
                    {
                        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;
                }

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

                case value_t::null:
                case value_t::boolean:
                case value_t::number_integer:
                case value_t::number_unsigned:
                case value_t::number_float:
                case value_t::discarded:
                default:
                {
                    break;
                }
            }
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
leal -0x1(%rsi), %eax
cmpb $0x1, %al
ja 0x6b608
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq (%rbx), %rax
movq %rsi, -0x58(%rbp)
cmpb $0x2, %sil
movq %rbx, -0x60(%rbp)
jne 0x6b4a0
movq 0x8(%rax), %rsi
subq (%rax), %rsi
sarq $0x4, %rsi
leaq -0x40(%rbp), %rdi
callq 0x6b69a
movq (%rbx), %rax
movq (%rax), %r15
movq 0x8(%rax), %rbx
subq %r15, %rbx
sarq $0x4, %rbx
testq %rbx, %rbx
jle 0x6b4dd
incq %rbx
leaq -0x40(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x69da8
addq $0x10, %r15
decq %rbx
cmpq $0x1, %rbx
jg 0x6b486
jmp 0x6b4dd
movq 0x28(%rax), %rsi
leaq -0x40(%rbp), %rdi
callq 0x6b69a
movq (%rbx), %rbx
movq 0x18(%rbx), %r15
addq $0x8, %rbx
cmpq %rbx, %r15
je 0x6b4dd
leaq -0x40(%rbp), %r12
leaq 0x40(%r15), %rsi
movq %r12, %rdi
callq 0x69da8
movq %r15, %rdi
callq 0x1b380
movq %rax, %r15
cmpq %rbx, %rax
jne 0x6b4c1
movq -0x38(%rbp), %rbx
cmpq %rbx, -0x40(%rbp)
je 0x6b5f7
leaq -0x50(%rbp), %r14
leaq -0x40(%rbp), %r12
leaq -0x10(%rbx), %rdi
movb -0x10(%rbx), %al
movb %al, -0x50(%rbp)
movq -0x8(%rbx), %rax
movq %rax, -0x48(%rbp)
xorl %esi, %esi
callq 0x65866
movb $0x0, -0x10(%rbx)
movq $0x0, -0x8(%rbx)
movq %r14, %rdi
movl $0x1, %esi
callq 0x65866
movq -0x38(%rbp), %rdi
addq $-0x10, %rdi
movq %rdi, -0x38(%rbp)
callq 0x6503c
movzbl -0x50(%rbp), %eax
cmpl $0x1, %eax
je 0x6b5a7
cmpl $0x2, %eax
jne 0x6b5dd
movq -0x48(%rbp), %r14
movq (%r14), %rbx
movq 0x8(%r14), %r15
movq %r15, %r13
subq %rbx, %r13
sarq $0x4, %r13
testq %r13, %r13
jle 0x6b588
incq %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0x69da8
addq $0x10, %rbx
decq %r13
cmpq $0x1, %r13
jg 0x6b565
movq -0x48(%rbp), %r14
movq (%r14), %rbx
movq 0x8(%r14), %r15
cmpq %rbx, %r15
je 0x6b5dd
movq %rbx, %r13
movq %r13, %rdi
callq 0x6503c
addq $0x10, %r13
cmpq %r15, %r13
jne 0x6b590
movq %rbx, 0x8(%r14)
jmp 0x6b5dd
movq -0x48(%rbp), %rdi
movq 0x18(%rdi), %r13
leaq 0x8(%rdi), %rbx
cmpq %rbx, %r13
je 0x6b5d8
leaq 0x40(%r13), %rsi
movq %r12, %rdi
callq 0x69da8
movq %r13, %rdi
callq 0x1b380
movq %rax, %r13
cmpq %rbx, %rax
jne 0x6b5b8
movq -0x48(%rbp), %rdi
callq 0x6b778
leaq -0x50(%rbp), %r14
movq %r14, %rdi
callq 0x6503c
movq -0x38(%rbp), %rbx
cmpq %rbx, -0x40(%rbp)
jne 0x6b4f3
leaq -0x40(%rbp), %rdi
callq 0x6b728
movq -0x60(%rbp), %rbx
movq -0x58(%rbp), %rsi
movzbl %sil, %eax
decl %eax
cmpl $0x7, %eax
ja 0x6b663
leaq 0x147de(%rip), %rcx     # 0x7fdf8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rbx), %rdi
callq 0x6b7b0
jmp 0x6b65b
movq (%rbx), %rdi
movq (%rdi), %rax
leaq 0x10(%rdi), %rcx
cmpq %rcx, %rax
jne 0x6b653
jmp 0x6b65e
movq (%rbx), %rdi
callq 0x6b728
jmp 0x6b65b
movq (%rbx), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x6b65e
movq %rax, %rdi
callq 0x1b4d0
movq (%rbx), %rdi
callq 0x1b4d0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6b676
jmp 0x6b676
movq %rax, %rbx
jmp 0x6b689
jmp 0x6b67d
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x6503c
leaq -0x40(%rbp), %rdi
callq 0x6b728
movq %rbx, %rdi
callq 0x1b910