// File: Lut99[P]RayTracer/src/lib/include/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>::basic_json(std::initializer_list<nlohmann::detail::json_ref<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>>>, bool, nlohmann::detail::value_t)
basic_json(initializer_list_t init,
               bool type_deduction = true,
               value_t manual_type = value_t::array)
    {
        // check if each element is an array with two elements whose first
        // element is a string
        bool is_an_object = std::all_of(init.begin(), init.end(),
                                        [](const detail::json_ref<basic_json>& element_ref)
        {
            return element_ref->is_array() and element_ref->size() == 2 and (*element_ref)[0].is_string();
        });

        // 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 (JSON_HEDLEY_UNLIKELY(manual_type == value_t::object and not is_an_object))
            {
                JSON_THROW(type_error::create(301, "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;

            std::for_each(init.begin(), init.end(), [this](const detail::json_ref<basic_json>& element_ref)
            {
                auto element = element_ref.moved_or_copied();
                m_value.object->emplace(
                    std::move(*((*element.m_value.array)[0].m_value.string)),
                    std::move((*element.m_value.array)[1]));
            });
        }
        else
        {
            // the initializer list describes an array -> create array
            m_type = value_t::array;
            m_value.array = create<array_t>(init.begin(), init.end());
        }

        assert_invariant();
    }

// Assembly:
subq $0xb8, %rsp
movb %r8b, %al
movq %rsi, 0xa8(%rsp)
movq %rdx, 0xb0(%rsp)
movq %rdi, 0xa0(%rsp)
andb $0x1, %cl
movb %cl, 0x9f(%rsp)
movb %al, 0x9e(%rsp)
movq 0xa0(%rsp), %rdi
movq %rdi, 0x28(%rsp)
movb $0x0, (%rdi)
addq $0x8, %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0xd0300
leaq 0xa8(%rsp), %rdi
callq 0x156c90
movq %rax, 0x30(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x156ca0
movq 0x30(%rsp), %rdi
movq %rax, %rsi
callq 0x156c50
andb $0x1, %al
movb %al, 0x9d(%rsp)
testb $0x1, 0x9f(%rsp)
jne 0x156b75
cmpb $0x2, 0x9e(%rsp)
jne 0x156a88
movb $0x0, 0x9d(%rsp)
xorl %eax, %eax
cmpb $0x1, 0x9e(%rsp)
movb %al, 0x27(%rsp)
jne 0x156aa5
movb 0x9d(%rsp), %al
xorb $-0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x156ab6
jmp 0x156b73
movb $0x1, 0x63(%rsp)
movl $0x20, %edi
callq 0xd02b0
movq %rax, 0x10(%rsp)
leaq 0x77(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xd0a20
movq 0x18(%rsp), %rdx
leaq 0x20f07(%rip), %rsi     # 0x1779ec
leaq 0x78(%rsp), %rdi
callq 0xd8b80
jmp 0x156af1
movq 0x10(%rsp), %rdi
movl $0x12d, %esi            # imm = 0x12D
leaq 0x78(%rsp), %rdx
callq 0x130170
jmp 0x156b07
movq 0x10(%rsp), %rdi
movb $0x0, 0x63(%rsp)
leaq 0x54870(%rip), %rsi     # 0x1ab388
leaq -0x267af(%rip), %rdx    # 0x130370
callq 0xd09b0
jmp 0x156c49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
jmp 0x156b51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x78(%rsp), %rdi
callq 0xd0b38
leaq 0x77(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x63(%rsp)
jne 0x156b64
jmp 0x156b6e
movq 0x10(%rsp), %rdi
callq 0xd0430
jmp 0x156c3f
jmp 0x156b75
testb $0x1, 0x9d(%rsp)
je 0x156be6
movq 0x28(%rsp), %rax
movb $0x1, (%rax)
leaq 0x58(%rsp), %rdi
movl $0x1, %esi
callq 0x120e50
movq 0x28(%rsp), %rax
movq 0x58(%rsp), %rcx
movq %rcx, 0x8(%rax)
leaq 0xa8(%rsp), %rdi
callq 0x156c90
movq %rax, 0x8(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x156ca0
movq 0x8(%rsp), %rdi
movq %rax, %rsi
movq 0x28(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x50(%rsp), %rdx
callq 0x156ce0
movq %rax, 0x48(%rsp)
jmp 0x156c2d
movq 0x28(%rsp), %rax
movb $0x2, (%rax)
leaq 0xa8(%rsp), %rdi
callq 0x156c90
movq %rax, 0x40(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x156ca0
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x156d40
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x28(%rsp), %rdi
callq 0xef040
addq $0xb8, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0xd0a10
nopl (%rax)