// File: alfanick[P]rest-cpp/src/rest/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::basic_json(std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>>, bool, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::value_t)
basic_json(std::initializer_list<basic_json> init,
               bool type_deduction = true,
               value_t manual_type = value_t::array)
    {
        // the initializer list could describe an object
        bool is_an_object = true;

        // check if each element is an array with two elements whose first
        // element is a string
        for (const auto& element : init)
        {
            if (not element.is_array() or element.size() != 2
                    or not element[0].is_string())
            {
                // we found an element that makes it impossible to use the
                // initializer list as object
                is_an_object = false;
                break;
            }
        }

        // adjust type if type deduction is not wanted
        if (not type_deduction)
        {
            // if array is wanted, do not create an object though possible
            if (manual_type == value_t::array)
            {
                is_an_object = false;
            }

            // if object is wanted but impossible, throw an exception
            if (manual_type == value_t::object and not is_an_object)
            {
                throw std::domain_error("cannot create object from initializer list");
            }
        }

        if (is_an_object)
        {
            // the initializer list is a list of pairs -> create object
            m_type = value_t::object;
            m_value = value_t::object;

            assert(m_value.object != nullptr);

            for (auto& element : init)
            {
                m_value.object->emplace(std::move(*(element[0].m_value.string)), std::move(element[1]));
            }
        }
        else
        {
            // the initializer list describes an array -> create array
            m_type = value_t::array;
            m_value.array = create<array_t>(std::move(init));
        }
    }

// Assembly:
subq $0xa8, %rsp
movb %r8b, %al
movq %rsi, 0x98(%rsp)
movq %rdx, 0xa0(%rsp)
movq %rdi, 0x90(%rsp)
andb $0x1, %cl
movb %cl, 0x8f(%rsp)
movb %al, 0x8e(%rsp)
movq 0x90(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movb $0x0, (%rdi)
addq $0x8, %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x8ffc0
movb $0x1, 0x8d(%rsp)
leaq 0x98(%rsp), %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0x95920
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rdi
callq 0x92be0
movq %rax, 0x70(%rsp)
movq 0x78(%rsp), %rax
cmpq 0x70(%rsp), %rax
je 0xde52b
movq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x68(%rsp), %rdi
callq 0x960f0
testb $0x1, %al
jne 0xde4e5
jmp 0xde50f
movq 0x68(%rsp), %rdi
callq 0x8f2f0
cmpq $0x2, %rax
jne 0xde50f
movq 0x68(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8ee60
movq %rax, %rdi
callq 0x92770
testb $0x1, %al
jne 0xde519
movb $0x0, 0x8d(%rsp)
jmp 0xde52b
jmp 0xde51b
movq 0x78(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x78(%rsp)
jmp 0xde4bf
testb $0x1, 0x8f(%rsp)
jne 0xde5b9
cmpb $0x2, 0x8e(%rsp)
jne 0xde54b
movb $0x0, 0x8d(%rsp)
cmpb $0x1, 0x8e(%rsp)
jne 0xde5b7
testb $0x1, 0x8d(%rsp)
jne 0xde5b7
movl $0x10, %edi
callq 0x8f970
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0x8914(%rip), %rsi      # 0xe6e8f
callq 0x90b80
jmp 0xde582
movq 0x10(%rsp), %rdi
movq 0x2769a(%rip), %rsi     # 0x105c28
movq 0x277ab(%rip), %rdx     # 0x105d40
callq 0x97c60
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
callq 0x911a0
jmp 0xde6dd
jmp 0xde5b9
testb $0x1, 0x8d(%rsp)
je 0xde6b4
movq 0x18(%rsp), %rax
movb $0x1, (%rax)
leaq 0x50(%rsp), %rdi
movl $0x1, %esi
callq 0x93130
movq 0x18(%rsp), %rax
movq 0x50(%rsp), %rcx
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
je 0xde5f5
jmp 0xde614
leaq 0x66bd(%rip), %rdi      # 0xe4cb9
leaq 0x5d84(%rip), %rsi      # 0xe4387
movl $0x596, %edx            # imm = 0x596
leaq 0x88ab(%rip), %rcx      # 0xe6eba
callq 0x90c40
leaq 0x98(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rdi
callq 0x95920
movq %rax, 0x40(%rsp)
movq 0x48(%rsp), %rdi
callq 0x92be0
movq %rax, 0x38(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x38(%rsp), %rax
je 0xde6b2
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
movq %rcx, 0x30(%rsp)
movq 0x8(%rax), %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8ee60
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
movl $0x1, %esi
callq 0x8ee60
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
movq %rax, %rdx
callq 0x926e0
movq %rax, 0x20(%rsp)
movb %dl, 0x28(%rsp)
movq 0x40(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x40(%rsp)
jmp 0xde63f
jmp 0xde6d5
movq 0x18(%rsp), %rax
movb $0x2, (%rax)
leaq 0x98(%rsp), %rdi
callq 0x97460
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x8(%rax)
addq $0xa8, %rsp
retq
movq 0x60(%rsp), %rdi
callq 0x981c0
nopw (%rax,%rax)