// File: Lut99[P]RayTracer/src/lib/objects/RenderObjectCollection.cpp
// Function: RayTracer::RenderObjectCollection::from_json(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>)
RenderObjectCollection* RenderObjectCollection::from_json(json json_obj) {
    // Check if the object has an object type
    if (!json_obj.is_object()) {
        throw InvalidObjectFormat("RenderObjectCollection", json::object().type_name(), json_obj.type_name());
    }

    // Check if the required field exists and is an array
    if (json_obj["objects"].is_null()) {
        throw MissingFieldException("RenderObjectCollection", "objects");
    }
    if (!json_obj["objects"].is_array()) {
        throw InvalidFieldFormat("RenderObjectCollection", "objects", json::array().type_name(), json_obj["objects"].type_name());
    }

    // Parse all the items in this array
    vector<RenderObject*> objects;
    for (std::size_t i = 0; i < json_obj["objects"].size(); i++) {
        objects.push_back(RenderObject::from_json(json_obj["objects"][i]));
    }

    return new RenderObjectCollection(objects);
}

// Assembly:
subq $0x2d8, %rsp            # imm = 0x2D8
movq %rdi, 0xb8(%rsp)
movq %rdi, 0x2d0(%rsp)
callq 0xd9b20
testb $0x1, %al
jne 0x15d129
movb $0x1, 0x22e(%rsp)
movl $0x88, %edi
callq 0xd02b0
movq %rax, 0xa8(%rsp)
leaq 0x2af(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0xd0a20
movq 0xb0(%rsp), %rdx
leaq 0x1af14(%rip), %rsi     # 0x177e36
leaq 0x2b0(%rsp), %rdi
callq 0xd8b80
jmp 0x15cf31
leaq 0x258(%rsp), %rdi
callq 0x155e60
movq 0x258(%rsp), %rsi
movq 0x260(%rsp), %rdx
leaq 0x268(%rsp), %rdi
callq 0x15a2a0
jmp 0x15cf5d
leaq 0x268(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x98(%rsp)
leaq 0x257(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0xd0a20
movq 0x98(%rsp), %rsi
movq 0xa0(%rsp), %rdx
leaq 0x278(%rsp), %rdi
callq 0xd8b80
jmp 0x15cfa6
movq 0xb8(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x88(%rsp)
leaq 0x22f(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0xd0a20
movq 0x88(%rsp), %rsi
movq 0x90(%rsp), %rdx
leaq 0x230(%rsp), %rdi
callq 0xd8b80
jmp 0x15cfef
movq 0xa8(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
leaq 0x278(%rsp), %rdx
leaq 0x230(%rsp), %rcx
callq 0x156180
jmp 0x15d016
movq 0xa8(%rsp), %rdi
movb $0x0, 0x22e(%rsp)
leaq 0x4e443(%rip), %rsi     # 0x1ab470
leaq -0x6ca4(%rip), %rdx     # 0x156390
callq 0xd09b0
jmp 0x15d788
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d0fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d0f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d0d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x230(%rsp), %rdi
callq 0xd0b38
leaq 0x22f(%rsp), %rdi
callq 0xd0630
leaq 0x278(%rsp), %rdi
callq 0xd0b38
leaq 0x257(%rsp), %rdi
callq 0xd0630
leaq 0x268(%rsp), %rdi
callq 0xd9f30
leaq 0x2b0(%rsp), %rdi
callq 0xd0b38
leaq 0x2af(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x22e(%rsp)
jne 0x15d117
jmp 0x15d124
movq 0xa8(%rsp), %rdi
callq 0xd0430
jmp 0x15d77b
movq 0xb8(%rsp), %rdi
leaq 0x1418e(%rip), %rsi     # 0x1712c6
callq 0xd9b40
movq %rax, %rdi
callq 0xd9da0
testb $0x1, %al
jne 0x15d14e
jmp 0x15d295
movb $0x1, 0x1de(%rsp)
movl $0x68, %edi
callq 0xd02b0
movq %rax, 0x78(%rsp)
leaq 0x207(%rsp), %rdi
movq %rdi, 0x80(%rsp)
callq 0xd0a20
movq 0x80(%rsp), %rdx
leaq 0x1acad(%rip), %rsi     # 0x177e36
leaq 0x208(%rsp), %rdi
callq 0xd8b80
jmp 0x15d198
leaq 0x1df(%rsp), %rdi
movq %rdi, 0x70(%rsp)
callq 0xd0a20
movq 0x70(%rsp), %rdx
leaq 0x14110(%rip), %rsi     # 0x1712c6
leaq 0x1e0(%rsp), %rdi
callq 0xd8b80
jmp 0x15d1c5
movq 0x78(%rsp), %rdi
leaq 0x208(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
callq 0x15a2f0
jmp 0x15d1e1
movq 0x78(%rsp), %rdi
movb $0x0, 0x1de(%rsp)
leaq 0x4e3cb(%rip), %rsi     # 0x1ab5c0
leaq -0x2dcc(%rip), %rdx     # 0x15a430
callq 0xd09b0
jmp 0x15d788
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d26d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d253
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x1e0(%rsp), %rdi
callq 0xd0b38
leaq 0x1df(%rsp), %rdi
callq 0xd0630
leaq 0x208(%rsp), %rdi
callq 0xd0b38
leaq 0x207(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x1de(%rsp)
jne 0x15d286
jmp 0x15d290
movq 0x78(%rsp), %rdi
callq 0xd0430
jmp 0x15d77b
movq 0xb8(%rsp), %rdi
leaq 0x14022(%rip), %rsi     # 0x1712c6
callq 0xd9b40
movq %rax, %rdi
callq 0xefa20
testb $0x1, %al
jne 0x15d56a
movb $0x1, 0x11e(%rsp)
movl $0xa8, %edi
callq 0xd02b0
movq %rax, 0x60(%rsp)
leaq 0x1b7(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xd0a20
movq 0x68(%rsp), %rdx
leaq 0x1ab48(%rip), %rsi     # 0x177e36
leaq 0x1b8(%rsp), %rdi
callq 0xd8b80
jmp 0x15d2fd
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xd0a20
movq 0x58(%rsp), %rdx
leaq 0x13fab(%rip), %rsi     # 0x1712c6
leaq 0x190(%rsp), %rdi
callq 0xd8b80
jmp 0x15d32a
leaq 0x148(%rsp), %rdi
callq 0x155e60
movq 0x148(%rsp), %rsi
movq 0x150(%rsp), %rdx
leaq 0x158(%rsp), %rdi
callq 0x155e10
jmp 0x15d356
leaq 0x158(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x48(%rsp)
leaq 0x147(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xd0a20
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x168(%rsp), %rdi
callq 0xd8b80
jmp 0x15d393
movq 0xb8(%rsp), %rdi
leaq 0x13f24(%rip), %rsi     # 0x1712c6
callq 0xd9b40
movq %rax, 0x40(%rsp)
jmp 0x15d3ae
movq 0x40(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x30(%rsp)
leaq 0x11f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xd0a20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x120(%rsp), %rdi
callq 0xd8b80
jmp 0x15d3e8
movq 0x60(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
leaq 0x190(%rsp), %rdx
leaq 0x168(%rsp), %rcx
leaq 0x120(%rsp), %r8
callq 0x15a4a0
jmp 0x15d414
movq 0x60(%rsp), %rdi
movb $0x0, 0x11e(%rsp)
leaq 0x4e1b0(%rip), %rsi     # 0x1ab5d8
leaq -0x2c8f(%rip), %rdx     # 0x15a7a0
callq 0xd09b0
jmp 0x15d788
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d542
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d528
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d51b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d501
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d4f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d4e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0x120(%rsp), %rdi
callq 0xd0b38
leaq 0x11f(%rsp), %rdi
callq 0xd0630
leaq 0x168(%rsp), %rdi
callq 0xd0b38
leaq 0x147(%rsp), %rdi
callq 0xd0630
leaq 0x158(%rsp), %rdi
callq 0xd9f30
leaq 0x190(%rsp), %rdi
callq 0xd0b38
leaq 0x18f(%rsp), %rdi
callq 0xd0630
leaq 0x1b8(%rsp), %rdi
callq 0xd0b38
leaq 0x1b7(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x11e(%rsp)
jne 0x15d55b
jmp 0x15d565
movq 0x60(%rsp), %rdi
callq 0xd0430
jmp 0x15d77b
leaq 0x100(%rsp), %rdi
callq 0x15d930
movq $0x0, 0xf8(%rsp)
movq 0xb8(%rsp), %rdi
movq 0xf8(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x13d27(%rip), %rsi     # 0x1712c6
callq 0xd9b40
movq %rax, 0x28(%rsp)
jmp 0x15d5ab
movq 0x28(%rsp), %rdi
callq 0x12ec20
movq %rax, %rcx
movq 0x20(%rsp), %rax
cmpq %rcx, %rax
jae 0x15d6ab
movq 0xb8(%rsp), %rdi
leaq 0x13cf1(%rip), %rsi     # 0x1712c6
callq 0xd9b40
movq %rax, 0x18(%rsp)
jmp 0x15d5e1
movq 0x18(%rsp), %rdi
movq 0xf8(%rsp), %rsi
callq 0x155ed0
movq %rax, 0x10(%rsp)
jmp 0x15d5fa
movq 0x10(%rsp), %rsi
leaq 0xe0(%rsp), %rdi
callq 0xd9dc0
jmp 0x15d60e
leaq 0xe0(%rsp), %rdi
callq 0x159890
movq %rax, 0x8(%rsp)
jmp 0x15d622
movq 0x8(%rsp), %rax
movq %rax, 0xf0(%rsp)
leaq 0x100(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x15dad0
jmp 0x15d646
leaq 0xe0(%rsp), %rdi
callq 0xd9f30
movq 0xf8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0xf8(%rsp)
jmp 0x15d583
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d76e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0xd9f30
jmp 0x15d76e
movl $0x98, %edi
callq 0xd05d0
movq %rax, (%rsp)
jmp 0x15d6bb
movb $0x1, 0xc7(%rsp)
leaq 0xc8(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x15d7d0
jmp 0x15d6da
movq (%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x15c3c0
jmp 0x15d6ed
movb $0x0, 0xc7(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x15d8d0
leaq 0x100(%rsp), %rdi
callq 0x15d8d0
movq (%rsp), %rax
addq $0x2d8, %rsp            # imm = 0x2D8
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
jmp 0x15d752
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2a0(%rsp)
movl %eax, 0x29c(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0x15d8d0
testb $0x1, 0xc7(%rsp)
jne 0x15d75e
jmp 0x15d76c
movq (%rsp), %rdi
movl $0x98, %esi
callq 0xd05e0
jmp 0x15d76e
leaq 0x100(%rsp), %rdi
callq 0x15d8d0
movq 0x2a0(%rsp), %rdi
callq 0xd0a10
nopl (%rax,%rax)