// File: /workspace/github_cpp_makefile_star2_O3/Lut99[P]RayTracer/src/lib/objects/Sphere.cpp
// Function: RayTracer::Sphere::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>)
Sphere* Sphere::from_json(json json_obj) {
    // Check if the object has an object type
    if (!json_obj.is_object()) {
        throw InvalidObjectFormat("Sphere", json::object().type_name(), json_obj.type_name());
    }

    // Check for the required fields
    if (json_obj["center"].is_null()) {
        throw MissingFieldException("Sphere", "center");
    }
    if (json_obj["radius"].is_null()) {
        throw MissingFieldException("Sphere", "radius");
    }
    if (json_obj["material"].is_null()) {
        throw MissingFieldException("Sphere", "material");
    }

    // Parse them
    Vec3 center = Vec3::from_json(json_obj["center"]);
    double radius;
    try {
        radius = json_obj["radius"].get<double>();
    } catch (nlohmann::detail::type_error&) {
        throw InvalidFieldFormat("Sphere", "radius", "double", json_obj["radius"].type_name());
    }
    Material* mat = Material::from_json(json_obj["material"]);

    return new Sphere(center, radius, mat);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %r15
cmpb $0x1, (%rdi)
jne 0x766d0
leaq 0x13e6f(%rip), %rsi     # 0x8a3ed
movq %r15, %rdi
callq 0x41392
cmpb $0x0, (%rax)
je 0x76740
leaq 0x13e5e(%rip), %rsi     # 0x8a3f4
movq %r15, %rdi
callq 0x41392
cmpb $0x0, (%rax)
je 0x767d4
leaq 0x13e4d(%rip), %rsi     # 0x8a3fb
movq %r15, %rdi
callq 0x41392
cmpb $0x0, (%rax)
je 0x76862
leaq 0x13e27(%rip), %rsi     # 0x8a3ed
movq %r15, %rdi
callq 0x41392
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4155c
leaq 0x138(%rsp), %rdi
movq %rbx, %rsi
callq 0x725c2
leaq 0x20(%rsp), %rdi
callq 0x4861e
leaq 0x28(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x486c0
leaq 0x13de7(%rip), %rsi     # 0x8a3f4
movq %r15, %rdi
callq 0x41392
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x748f1
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x13dc6(%rip), %rsi     # 0x8a3fb
movq %r15, %rdi
callq 0x41392
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4155c
movq %rbx, %rdi
callq 0x7d016
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4861e
leaq 0x18(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x486c0
movl $0x90, %edi
callq 0x3a470
movq %rax, %r14
leaq 0x138(%rsp), %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x74a4c
leaq 0x2cd0a(%rip), %rax     # 0xa33a0
movq %rax, (%r14)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x80(%r14)
movq %rbx, 0x88(%r14)
movq %r14, %rdi
callq 0x760b0
movb %al, 0x78(%r14)
movq %r14, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x88, %edi
callq 0x3a210
movq %rax, %r14
leaq 0xc8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x13d13(%rip), %rsi     # 0x8a404
leaq 0x13d12(%rip), %rdx     # 0x8a40a
leaq 0xb8(%rsp), %rdi
callq 0x44390
leaq 0x138(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x73c9e
movzbl 0x138(%rsp), %eax
cmpq $0x8, %rax
ja 0x768ed
leaq 0x2cce1(%rip), %rcx     # 0xa3418
movq (%rcx,%rax,8), %rbx
jmp 0x768f4
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0xa8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x13ca4(%rip), %rsi     # 0x8a404
leaq 0x13ca3(%rip), %rdx     # 0x8a40a
leaq 0x98(%rsp), %rdi
callq 0x44390
leaq 0x1a8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x13c65(%rip), %rsi     # 0x8a3ed
leaq 0x13c64(%rip), %rdx     # 0x8a3f3
leaq 0x198(%rsp), %rdi
callq 0x44390
movb $0x1, %bpl
leaq 0x98(%rsp), %rsi
leaq 0x198(%rsp), %rdx
movq %r14, %rdi
callq 0x75298
xorl %ebp, %ebp
leaq 0x2cb10(%rip), %rsi     # 0xa32d0
leaq -0x139b(%rip), %rdx     # 0x7542c
movq %r14, %rdi
callq 0x3a760
jmp 0x76cac
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x13c10(%rip), %rsi     # 0x8a404
leaq 0x13c0f(%rip), %rdx     # 0x8a40a
leaq 0x78(%rsp), %rdi
callq 0x44390
leaq 0x188(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x13bdb(%rip), %rsi     # 0x8a3f4
leaq 0x13bda(%rip), %rdx     # 0x8a3fa
leaq 0x178(%rsp), %rdi
callq 0x44390
movb $0x1, %bpl
leaq 0x78(%rsp), %rsi
leaq 0x178(%rsp), %rdx
movq %r14, %rdi
callq 0x75298
xorl %ebp, %ebp
leaq 0x2ca82(%rip), %rsi     # 0xa32d0
leaq -0x1429(%rip), %rdx     # 0x7542c
movq %r14, %rdi
callq 0x3a760
jmp 0x76cac
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x13b85(%rip), %rsi     # 0x8a404
leaq 0x13b84(%rip), %rdx     # 0x8a40a
leaq 0x58(%rsp), %rdi
callq 0x44390
leaq 0x168(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x13b57(%rip), %rsi     # 0x8a3fb
leaq 0x13b58(%rip), %rdx     # 0x8a403
leaq 0x158(%rsp), %rdi
callq 0x44390
movb $0x1, %bpl
leaq 0x58(%rsp), %rsi
leaq 0x158(%rsp), %rdx
movq %r14, %rdi
callq 0x75298
xorl %ebp, %ebp
leaq 0x2c9f7(%rip), %rsi     # 0xa32d0
leaq -0x14b4(%rip), %rdx     # 0x7542c
movq %r14, %rdi
callq 0x3a760
jmp 0x76cac
leaq 0xf907(%rip), %rbx      # 0x861fb
leaq 0x1e8(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x1d8(%rsp), %rdi
movq %rbx, %rsi
callq 0x44390
movzbl (%r15), %eax
cmpq $0x8, %rax
ja 0x76933
leaq 0x2caeb(%rip), %rcx     # 0xa3418
movq (%rcx,%rax,8), %rbx
jmp 0x7693a
leaq 0xf8c1(%rip), %rbx      # 0x861fb
leaq 0x1c8(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x1b8(%rsp), %rdi
movq %rbx, %rsi
callq 0x44390
movb $0x1, %bpl
leaq 0xb8(%rsp), %rsi
leaq 0x1d8(%rsp), %rdx
leaq 0x1b8(%rsp), %rcx
movq %r14, %rdi
callq 0x72fb0
xorl %ebp, %ebp
leaq 0x2c7aa(%rip), %rsi     # 0xa3138
leaq -0x3711(%rip), %rdx     # 0x73284
movq %r14, %rdi
callq 0x3a760
jmp 0x76cac
movq %rax, %rbx
movq 0x1b8(%rsp), %rdi
cmpq %r15, %rdi
je 0x769ca
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x769ca
movq %rax, %rbx
movb $0x1, %bpl
movq 0x1d8(%rsp), %rdi
cmpq %r13, %rdi
je 0x769ef
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x769ef
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x138(%rsp), %rdi
callq 0x415d4
movq 0xb8(%rsp), %rdi
cmpq %r12, %rdi
je 0x76af9
movq 0xc8(%rsp), %rsi
jmp 0x76af1
movq %rax, %rbx
movq 0x158(%rsp), %rdi
cmpq %r12, %rdi
je 0x76a3a
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x76af9
movq 0x68(%rsp), %rsi
jmp 0x76af1
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x76b48
movq 0x68(%rsp), %rsi
jmp 0x76b35
movq %rax, %rbx
movq 0x178(%rsp), %rdi
cmpq %r12, %rdi
je 0x76a8d
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x76af9
movq 0x88(%rsp), %rsi
jmp 0x76af1
movq %rax, %rbx
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0x76b48
movq 0x88(%rsp), %rsi
jmp 0x76b35
movq %rax, %rbx
movq 0x198(%rsp), %rdi
cmpq %r12, %rdi
je 0x76adc
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0x76af9
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3a480
testb %bpl, %bpl
jne 0x76b48
jmp 0x76d6a
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r15, %rdi
je 0x76b48
movq 0xa8(%rsp), %rsi
jmp 0x76b35
movq %rax, %rbx
movq 0xb8(%rsp), %rdi
cmpq %r12, %rdi
je 0x76b48
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x76b48
jmp 0x76b45
jmp 0x76b45
jmp 0x76b45
movq %rax, %rbx
movq %r14, %rdi
callq 0x3a340
jmp 0x76d6a
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x76b67
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x415d4
jmp 0x76d6a
movq %rax, %rbx
movl $0x90, %esi
movq %r14, %rdi
callq 0x3a480
jmp 0x76d6a
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x76d6a
movq %rbx, %rdi
callq 0x3a1c0
movl $0xa8, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1384c(%rip), %rsi     # 0x8a404
leaq 0x1384b(%rip), %rdx     # 0x8a40a
leaq 0x38(%rsp), %rdi
callq 0x44390
leaq 0x128(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x13818(%rip), %rsi     # 0x8a3f4
leaq 0x13817(%rip), %rdx     # 0x8a3fa
leaq 0x118(%rsp), %rdi
callq 0x44390
leaq 0x108(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x1357e(%rip), %rsi     # 0x8a181
leaq 0x1357d(%rip), %rdx     # 0x8a187
leaq 0xf8(%rsp), %rdi
callq 0x44390
leaq 0x137d6(%rip), %rsi     # 0x8a3f4
movq %r15, %rdi
callq 0x41392
movzbl (%rax), %eax
cmpq $0x8, %rax
ja 0x76c3c
leaq 0x2c7e2(%rip), %rcx     # 0xa3418
movq (%rcx,%rax,8), %rbx
jmp 0x76c43
leaq 0xf5b8(%rip), %rbx      # 0x861fb
leaq 0xe8(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0xd8(%rsp), %rdi
movq %rbx, %rsi
callq 0x44390
movb $0x1, %r15b
leaq 0x38(%rsp), %rsi
leaq 0x118(%rsp), %rdx
leaq 0xf8(%rsp), %rcx
leaq 0xd8(%rsp), %r8
movq %r14, %rdi
callq 0x75496
xorl %r15d, %r15d
leaq 0x2c64b(%rip), %rsi     # 0xa32e8
leaq -0x139e(%rip), %rdx     # 0x75906
movq %r14, %rdi
callq 0x3a760
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
leaq 0xe8(%rsp), %rax
cmpq %rax, %rdi
je 0x76cde
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x76cde
jmp 0x76cd8
movq %rax, %rbx
movb $0x1, %r15b
movq 0xf8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x76d03
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x76d03
movq %rax, %rbx
movb $0x1, %r15b
movq 0x118(%rsp), %rdi
cmpq %r13, %rdi
je 0x76d20
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x76d37
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3a480
testb %r15b, %r15b
jne 0x76d5d
jmp 0x76d65
movq %rax, %rbx
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x76d5d
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x76d5d
movq %rax, %rbx
movq %r14, %rdi
callq 0x3a340
callq 0x3a720
movq %rbx, %rdi
callq 0x3a790
movq %rax, %rdi
callq 0x4116b
nop