// File: Lut99[P]RayTracer/src/lib/Vec3.cpp
// Function: RayTracer::Vec3::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>)
Vec3 Vec3::from_json(json json_obj) {
    // First, check if the json_obj is an array
    if (!json_obj.is_array()) {
        throw InvalidObjectFormat("Vec3", json::array().type_name(), json_obj.type_name());
    }

    // Next, check for the array length
    if (json_obj.size() != 3) {
        throw InvalidLengthException("Vec3", 3, json_obj.size());
    }

    // Then, try to parse it as three doubles
    Vec3 to_return;
    try {
        to_return.x = json_obj[0].get<double>();
        to_return.y = json_obj[1].get<double>();
        to_return.z = json_obj[2].get<double>();
    } catch (nlohmann::detail::type_error&) {
        throw InvalidObjectFormat("Vec3", "double", json_obj[0].type_name());
    }
    return to_return;
}

// Assembly:
subq $0x218, %rsp            # imm = 0x218
movq %rsi, 0xa0(%rsp)
movq %rdi, %rax
movq 0xa0(%rsp), %rdi
movq %rax, 0xa8(%rsp)
movq %rax, %rcx
movq %rcx, 0xb0(%rsp)
movq %rax, 0x210(%rsp)
movq %rdi, 0x208(%rsp)
callq 0xefa20
testb $0x1, %al
jne 0x155393
movb $0x1, 0x166(%rsp)
movl $0x88, %edi
callq 0xd02b0
movq %rax, 0x90(%rsp)
leaq 0x1e7(%rsp), %rdi
movq %rdi, 0x98(%rsp)
callq 0xd0a20
movq 0x98(%rsp), %rdx
leaq 0x227d4(%rip), %rsi     # 0x17796c
leaq 0x1e8(%rsp), %rdi
callq 0xd8b80
jmp 0x1551a7
leaq 0x190(%rsp), %rdi
callq 0x155e60
movq 0x190(%rsp), %rsi
movq 0x198(%rsp), %rdx
leaq 0x1a0(%rsp), %rdi
callq 0x155e10
jmp 0x1551d3
leaq 0x1a0(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x80(%rsp)
leaq 0x18f(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0xd0a20
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
leaq 0x1b0(%rsp), %rdi
callq 0xd8b80
jmp 0x15521c
movq 0xa0(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x70(%rsp)
leaq 0x167(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0xd0a20
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
leaq 0x168(%rsp), %rdi
callq 0xd8b80
jmp 0x155259
movq 0x90(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
leaq 0x1b0(%rsp), %rdx
leaq 0x168(%rsp), %rcx
callq 0x156180
jmp 0x155280
movq 0x90(%rsp), %rdi
movb $0x0, 0x166(%rsp)
leaq 0x561d9(%rip), %rsi     # 0x1ab470
leaq 0x10f2(%rip), %rdx      # 0x156390
callq 0xd09b0
jmp 0x1557ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x155368
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x15535b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x155341
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x155327
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x168(%rsp), %rdi
callq 0xd0b38
leaq 0x167(%rsp), %rdi
callq 0xd0630
leaq 0x1b0(%rsp), %rdi
callq 0xd0b38
leaq 0x18f(%rsp), %rdi
callq 0xd0630
leaq 0x1a0(%rsp), %rdi
callq 0xd9f30
leaq 0x1e8(%rsp), %rdi
callq 0xd0b38
leaq 0x1e7(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x166(%rsp)
jne 0x155381
jmp 0x15538e
movq 0x90(%rsp), %rdi
callq 0xd0430
jmp 0x155799
movq 0xa0(%rsp), %rdi
callq 0x12ec20
cmpq $0x3, %rax
je 0x15549b
movb $0x1, 0x13e(%rsp)
movl $0x58, %edi
callq 0xd02b0
movq %rax, 0x60(%rsp)
leaq 0x13f(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xd0a20
movq 0x68(%rsp), %rdx
leaq 0x2258d(%rip), %rsi     # 0x17796c
leaq 0x140(%rsp), %rdi
callq 0xd8b80
jmp 0x1553ee
movq 0xa0(%rsp), %rdi
callq 0x12ec20
movq 0x60(%rsp), %rdi
movq %rax, %rcx
leaq 0x140(%rsp), %rsi
movl $0x3, %edx
callq 0x1563a0
jmp 0x155417
movq 0x60(%rsp), %rdi
movb $0x0, 0x13e(%rsp)
leaq 0x5605d(%rip), %rsi     # 0x1ab488
leaq 0x115e(%rip), %rdx      # 0x156590
callq 0xd09b0
jmp 0x1557ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x155473
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x140(%rsp), %rdi
callq 0xd0b38
leaq 0x13f(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x13e(%rsp)
jne 0x15548c
jmp 0x155496
movq 0x60(%rsp), %rdi
callq 0xd0430
jmp 0x155799
movq 0xa8(%rsp), %rdi
callq 0x154710
movq 0xa0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x155ed0
movq %rax, 0x58(%rsp)
jmp 0x1554c0
movq 0x58(%rsp), %rdi
callq 0x1565a0
movsd %xmm0, 0x50(%rsp)
jmp 0x1554d2
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rax
movsd 0x50(%rsp), %xmm0
movsd %xmm0, 0x8(%rax)
movl $0x1, %esi
callq 0x155ed0
movq %rax, 0x48(%rsp)
jmp 0x1554fe
movq 0x48(%rsp), %rdi
callq 0x1565a0
movsd %xmm0, 0x40(%rsp)
jmp 0x155510
movq 0xa0(%rsp), %rdi
movq 0xa8(%rsp), %rax
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
movl $0x2, %esi
callq 0x155ed0
movq %rax, 0x38(%rsp)
jmp 0x15553c
movq 0x38(%rsp), %rdi
callq 0x1565a0
movsd %xmm0, 0x30(%rsp)
jmp 0x15554e
movq 0xa8(%rsp), %rax
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x18(%rax)
jmp 0x155789
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
movl 0x1d4(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x155799
movq 0x1d8(%rsp), %rdi
callq 0xd0210
movq %rax, 0x130(%rsp)
movb $0x1, 0xbe(%rsp)
movl $0x88, %edi
callq 0xd02b0
movq %rax, 0x20(%rsp)
leaq 0x10f(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xd0a20
movq 0x28(%rsp), %rdx
leaq 0x22394(%rip), %rsi     # 0x17796c
leaq 0x110(%rsp), %rdi
callq 0xd8b80
jmp 0x1555e7
leaq 0xe7(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xd0a20
movq 0x18(%rsp), %rdx
leaq 0x2236c(%rip), %rsi     # 0x177971
leaq 0xe8(%rsp), %rdi
callq 0xd8b80
jmp 0x155614
movq 0xa0(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x155ed0
movq %rax, 0x10(%rsp)
jmp 0x15562c
movq 0x10(%rsp), %rdi
callq 0x1302d0
movq %rax, (%rsp)
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xd0a20
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0xc0(%rsp), %rdi
callq 0xd8b80
jmp 0x155664
movq 0x20(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
leaq 0xc0(%rsp), %rcx
callq 0x156180
jmp 0x155688
movq 0x20(%rsp), %rdi
movb $0x0, 0xbe(%rsp)
leaq 0x55dd4(%rip), %rsi     # 0x1ab470
leaq 0xced(%rip), %rdx       # 0x156390
callq 0xd09b0
jmp 0x1557ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x15575d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x155743
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x155736
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0x155729
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0xd0b38
leaq 0xbf(%rsp), %rdi
callq 0xd0630
leaq 0xe8(%rsp), %rdi
callq 0xd0b38
leaq 0xe7(%rsp), %rdi
callq 0xd0630
leaq 0x110(%rsp), %rdi
callq 0xd0b38
leaq 0x10f(%rsp), %rdi
callq 0xd0630
testb $0x1, 0xbe(%rsp)
jne 0x155776
jmp 0x155780
movq 0x20(%rsp), %rdi
callq 0xd0430
callq 0xd0940
jmp 0x155787
jmp 0x155799
movq 0xb0(%rsp), %rax
addq $0x218, %rsp            # imm = 0x218
retq
movq 0x1d8(%rsp), %rdi
callq 0xd0a10
movq %rax, %rdi
callq 0xd9890
nop