// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %r14
cmpb $0x1, (%rdi)
jne 0x812a4
leaq 0x1151c(%rip), %rsi     # 0x926c4
movq %r14, %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x81354
leaq 0x1150b(%rip), %rsi     # 0x926cb
movq %r14, %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x813c9
leaq 0x114fa(%rip), %rsi     # 0x926d2
movq %r14, %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x8143e
leaq 0x114d4(%rip), %rsi     # 0x926c4
movq %r14, %rdi
callq 0x56e34
leaq 0x48(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x56f56
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x7e90c
leaq 0x48(%rsp), %rdi
callq 0x56fca
leaq 0x114a5(%rip), %rsi     # 0x926cb
movq %r14, %rdi
callq 0x56e34
movq %rax, %rdi
callq 0x7f350
movsd %xmm0, 0x10(%rsp)
leaq 0x1148f(%rip), %rsi     # 0x926d2
movq %r14, %rdi
callq 0x56e34
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x56f56
movq %rbx, %rdi
callq 0x85bda
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x56fca
movl $0x90, %edi
callq 0x52470
movq %rax, %r14
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
movq %rbx, %rdx
callq 0x80be0
movq %r14, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x88, %edi
callq 0x52220
movq %rax, %r15
leaq 0x11423(%rip), %rsi     # 0x926db
leaq 0x1d8(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
leaq 0x18(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x8067c
leaq 0x18(%rsp), %rdi
callq 0x6f406
leaq 0x1b8(%rsp), %rdi
leaq 0xe(%rsp), %rdx
movq %rax, %rsi
callq 0x56548
movq %r14, %rdi
callq 0x6f406
leaq 0x198(%rsp), %rdi
leaq 0xd(%rsp), %rdx
movq %rax, %rsi
callq 0x56548
movb $0x1, %bpl
leaq 0x1d8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
leaq 0x198(%rsp), %rcx
movq %r15, %rdi
callq 0x7f052
xorl %ebp, %ebp
leaq 0x30178(%rip), %rsi     # 0xb14b8
leaq -0x21a1(%rip), %rdx     # 0x7f1a6
movq %r15, %rdi
callq 0x52760
jmp 0x81698
pushq $0x68
popq %rdi
callq 0x52220
movq %rax, %r14
leaq 0x11375(%rip), %rsi     # 0x926db
leaq 0x178(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x11345(%rip), %rsi     # 0x926c4
leaq 0x158(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
movb $0x1, %bpl
leaq 0x178(%rsp), %rsi
leaq 0x158(%rsp), %rdx
movq %r14, %rdi
callq 0x80690
xorl %ebp, %ebp
leaq 0x30253(%rip), %rsi     # 0xb1608
leaq -0xc5c(%rip), %rdx      # 0x80760
movq %r14, %rdi
callq 0x52760
jmp 0x81698
pushq $0x68
popq %rdi
callq 0x52220
movq %rax, %r14
leaq 0x11300(%rip), %rsi     # 0x926db
leaq 0x138(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x112d7(%rip), %rsi     # 0x926cb
leaq 0x118(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
movb $0x1, %bpl
leaq 0x138(%rsp), %rsi
leaq 0x118(%rsp), %rdx
movq %r14, %rdi
callq 0x80690
xorl %ebp, %ebp
leaq 0x301de(%rip), %rsi     # 0xb1608
leaq -0xcd1(%rip), %rdx      # 0x80760
movq %r14, %rdi
callq 0x52760
jmp 0x81698
pushq $0x68
popq %rdi
callq 0x52220
movq %rax, %r14
leaq 0x1128b(%rip), %rsi     # 0x926db
leaq 0xf8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0x11269(%rip), %rsi     # 0x926d2
leaq 0xd8(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
movb $0x1, %bpl
leaq 0xf8(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movq %r14, %rdi
callq 0x80690
xorl %ebp, %ebp
leaq 0x30169(%rip), %rsi     # 0xb1608
leaq -0xd46(%rip), %rdx      # 0x80760
movq %r14, %rdi
callq 0x52760
jmp 0x81698
movq %rax, %rbx
leaq 0x198(%rsp), %rdi
callq 0x52888
jmp 0x814cb
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x1b8(%rsp), %rdi
callq 0x52888
jmp 0x814e0
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x18(%rsp), %rdi
callq 0x56fca
jmp 0x81565
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x52888
jmp 0x81504
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xf8(%rsp), %rdi
jmp 0x81550
movq %rax, %rbx
leaq 0x118(%rsp), %rdi
callq 0x52888
jmp 0x81526
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x138(%rsp), %rdi
jmp 0x81550
movq %rax, %rbx
leaq 0x158(%rsp), %rdi
callq 0x52888
jmp 0x81548
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x178(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x81583
jmp 0x816fa
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x1d8(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x8158b
jmp 0x816fa
jmp 0x81580
jmp 0x81580
movq %rax, %rbx
movq %r14, %rdi
jmp 0x8158e
movq %rax, %rbx
movq %r15, %rdi
callq 0x52350
jmp 0x816fa
movq %rax, %rbx
movl $0x90, %esi
movq %r14, %rdi
callq 0x52480
jmp 0x816fa
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x815bf
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x56fca
jmp 0x816fa
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x816fa
movq %rbx, %rdi
callq 0x521b0
movl $0xa8, %edi
callq 0x52220
movq %rax, %r15
leaq 0x110ea(%rip), %rsi     # 0x926db
leaq 0xb8(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
leaq 0x110c1(%rip), %rsi     # 0x926cb
leaq 0x98(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x56548
leaq 0x10bfe(%rip), %rsi     # 0x92221
leaq 0x78(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x56548
leaq 0x11092(%rip), %rsi     # 0x926cb
movq %r14, %rdi
callq 0x56e34
movq %rax, %rdi
callq 0x6f406
leaq 0x58(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x56548
movb $0x1, %bpl
leaq 0xb8(%rsp), %rsi
leaq 0x98(%rsp), %rdx
leaq 0x78(%rsp), %rcx
leaq 0x58(%rsp), %r8
movq %r15, %rdi
callq 0x8079c
xorl %ebp, %ebp
leaq 0x2ff97(%rip), %rsi     # 0xb1620
leaq -0xd02(%rip), %rdx      # 0x8098e
movq %r15, %rdi
callq 0x52760
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x52888
jmp 0x816af
jmp 0x816a9
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x78(%rsp), %rdi
callq 0x52888
jmp 0x816c1
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x98(%rsp), %rdi
callq 0x52888
jmp 0x816d6
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xb8(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x816ed
jmp 0x816f5
movq %rax, %rbx
movq %r15, %rdi
callq 0x52350
callq 0x52720
movq %rbx, %rdi
callq 0x527a0
movq %rax, %rdi
callq 0x56ca4