// File: /workspace/github_cpp_makefile_star2_O1/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 0x7719a
leaq 0x14385(%rip), %rsi     # 0x8b3cd
movq %r15, %rdi
callq 0x416d6
cmpb $0x0, (%rax)
je 0x7720a
leaq 0x14374(%rip), %rsi     # 0x8b3d4
movq %r15, %rdi
callq 0x416d6
cmpb $0x0, (%rax)
je 0x7729e
leaq 0x14363(%rip), %rsi     # 0x8b3db
movq %r15, %rdi
callq 0x416d6
cmpb $0x0, (%rax)
je 0x77332
leaq 0x1433d(%rip), %rsi     # 0x8b3cd
movq %r15, %rdi
callq 0x416d6
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x41894
leaq 0xb8(%rsp), %rdi
movq %rbx, %rsi
callq 0x73118
leaq 0x20(%rsp), %rdi
callq 0x48a06
leaq 0x28(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x48aa8
leaq 0x142fd(%rip), %rsi     # 0x8b3d4
movq %r15, %rdi
callq 0x416d6
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x753fb
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x142dc(%rip), %rsi     # 0x8b3db
movq %r15, %rdi
callq 0x416d6
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x41894
movq %rbx, %rdi
callq 0x7d8ce
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x48a06
leaq 0x18(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x48aa8
movl $0x90, %edi
callq 0x3a460
movq %rax, %r14
leaq 0xb8(%rsp), %rsi
movq %rax, %rdi
xorl %edx, %edx
callq 0x75544
leaq 0x2d210(%rip), %rax     # 0xa4370
movq %rax, (%r14)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x80(%r14)
movq %rbx, 0x88(%r14)
movq %r14, %rdi
callq 0x76b60
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 0x1e8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x14229(%rip), %rsi     # 0x8b3e4
leaq 0x14228(%rip), %rdx     # 0x8b3ea
leaq 0x1d8(%rsp), %rdi
callq 0x44728
leaq 0xb8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x747bc
movzbl 0xb8(%rsp), %eax
cmpq $0x8, %rax
ja 0x773c6
leaq 0x2d1e7(%rip), %rcx     # 0xa43e8
movq (%rcx,%rax,8), %rbx
jmp 0x773cd
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x188(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x141ba(%rip), %rsi     # 0x8b3e4
leaq 0x141b9(%rip), %rdx     # 0x8b3ea
leaq 0x178(%rsp), %rdi
callq 0x44728
leaq 0x168(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1417b(%rip), %rsi     # 0x8b3cd
leaq 0x1417a(%rip), %rdx     # 0x8b3d3
leaq 0x158(%rsp), %rdi
callq 0x44728
movb $0x1, %bpl
leaq 0x178(%rsp), %rsi
leaq 0x158(%rsp), %rdx
movq %r14, %rdi
callq 0x75d5a
xorl %ebp, %ebp
leaq 0x2d016(%rip), %rsi     # 0xa42a0
leaq -0x13a3(%rip), %rdx     # 0x75eee
movq %r14, %rdi
callq 0x3a750
jmp 0x7772c
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x148(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14126(%rip), %rsi     # 0x8b3e4
leaq 0x14125(%rip), %rdx     # 0x8b3ea
leaq 0x138(%rsp), %rdi
callq 0x44728
leaq 0x128(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x140ee(%rip), %rsi     # 0x8b3d4
leaq 0x140ed(%rip), %rdx     # 0x8b3da
leaq 0x118(%rsp), %rdi
callq 0x44728
movb $0x1, %bpl
leaq 0x138(%rsp), %rsi
leaq 0x118(%rsp), %rdx
movq %r14, %rdi
callq 0x75d5a
xorl %ebp, %ebp
leaq 0x2cf82(%rip), %rsi     # 0xa42a0
leaq -0x1437(%rip), %rdx     # 0x75eee
movq %r14, %rdi
callq 0x3a750
jmp 0x7772c
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x108(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x14092(%rip), %rsi     # 0x8b3e4
leaq 0x14091(%rip), %rdx     # 0x8b3ea
leaq 0xf8(%rsp), %rdi
callq 0x44728
leaq 0xe8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x14061(%rip), %rsi     # 0x8b3db
leaq 0x14062(%rip), %rdx     # 0x8b3e3
leaq 0xd8(%rsp), %rdi
callq 0x44728
movb $0x1, %bpl
leaq 0xf8(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movq %r14, %rdi
callq 0x75d5a
xorl %ebp, %ebp
leaq 0x2ceee(%rip), %rsi     # 0xa42a0
leaq -0x14cb(%rip), %rdx     # 0x75eee
movq %r14, %rdi
callq 0x3a750
jmp 0x7772c
leaq 0xfe31(%rip), %rbx      # 0x871fe
leaq 0x1c8(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x1b8(%rsp), %rdi
movq %rbx, %rsi
callq 0x44728
movzbl (%r15), %eax
cmpq $0x8, %rax
ja 0x7740c
leaq 0x2cfe2(%rip), %rcx     # 0xa43e8
movq (%rcx,%rax,8), %rbx
jmp 0x77413
leaq 0xfdeb(%rip), %rbx      # 0x871fe
leaq 0x1a8(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x198(%rsp), %rdi
movq %rbx, %rsi
callq 0x44728
movb $0x1, %bpl
leaq 0x1d8(%rsp), %rsi
leaq 0x1b8(%rsp), %rdx
leaq 0x198(%rsp), %rcx
movq %r14, %rdi
callq 0x73acc
xorl %ebp, %ebp
leaq 0x2cca1(%rip), %rsi     # 0xa4108
leaq -0x36ce(%rip), %rdx     # 0x73da0
movq %r14, %rdi
callq 0x3a750
jmp 0x7772c
movq %rax, %rbx
movq 0x198(%rsp), %rdi
cmpq %r15, %rdi
je 0x774a3
movq 0x1a8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x774a3
movq %rax, %rbx
movb $0x1, %bpl
movq 0x1b8(%rsp), %rdi
cmpq %r13, %rdi
je 0x774c8
movq 0x1c8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x774c8
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xb8(%rsp), %rdi
callq 0x4191c
jmp 0x775a4
movq %rax, %rbx
movq 0xd8(%rsp), %rdi
cmpq %r12, %rdi
je 0x77502
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x77502
movq %rax, %rbx
movb $0x1, %bpl
movq 0xf8(%rsp), %rdi
cmpq %r15, %rdi
je 0x775cf
movq 0x108(%rsp), %rsi
jmp 0x775b9
movq %rax, %rbx
movq 0x118(%rsp), %rdi
cmpq %r12, %rdi
je 0x77548
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x77548
movq %rax, %rbx
movb $0x1, %bpl
movq 0x138(%rsp), %rdi
cmpq %r15, %rdi
je 0x775cf
movq 0x148(%rsp), %rsi
jmp 0x775b9
movq %rax, %rbx
movq 0x158(%rsp), %rdi
cmpq %r12, %rdi
je 0x77587
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x77587
movq %rax, %rbx
movb $0x1, %bpl
movq 0x178(%rsp), %rdi
cmpq %r15, %rdi
je 0x775cf
movq 0x188(%rsp), %rsi
jmp 0x775b9
movq %rax, %rbx
movb $0x1, %bpl
movq 0x1d8(%rsp), %rdi
cmpq %r12, %rdi
je 0x775cf
movq 0x1e8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x775cf
jmp 0x775c9
jmp 0x775c9
jmp 0x775c9
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x777cd
movq %r14, %rdi
callq 0x3a330
jmp 0x777cd
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x775f7
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4191c
jmp 0x777cd
movq %rax, %rbx
movl $0x90, %esi
movq %r14, %rdi
callq 0x3a470
jmp 0x777cd
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x777cd
movq %rbx, %rdi
callq 0x3a1c0
movl $0xa8, %edi
callq 0x3a210
movq %rax, %r14
leaq 0xa8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x13d99(%rip), %rsi     # 0x8b3e4
leaq 0x13d98(%rip), %rdx     # 0x8b3ea
leaq 0x98(%rsp), %rdi
callq 0x44728
leaq 0x88(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x13d62(%rip), %rsi     # 0x8b3d4
leaq 0x13d61(%rip), %rdx     # 0x8b3da
leaq 0x78(%rsp), %rdi
callq 0x44728
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x13ace(%rip), %rsi     # 0x8b161
leaq 0x13acd(%rip), %rdx     # 0x8b167
leaq 0x38(%rsp), %rdi
callq 0x44728
leaq 0x13d29(%rip), %rsi     # 0x8b3d4
movq %r15, %rdi
callq 0x416d6
movzbl (%rax), %eax
cmpq $0x8, %rax
ja 0x776c9
leaq 0x2cd25(%rip), %rcx     # 0xa43e8
movq (%rcx,%rax,8), %rbx
jmp 0x776d0
leaq 0xfb2e(%rip), %rbx      # 0x871fe
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x58(%rsp), %rdi
movq %rbx, %rsi
callq 0x44728
movb $0x1, %bpl
leaq 0x98(%rsp), %rsi
leaq 0x78(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x58(%rsp), %r8
movq %r14, %rdi
callq 0x75f58
xorl %ebp, %ebp
leaq 0x2cb9b(%rip), %rsi     # 0xa42b8
leaq -0x135c(%rip), %rdx     # 0x763c8
movq %r14, %rdi
callq 0x3a750
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x77750
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x77750
jmp 0x7774a
movq %rax, %rbx
movb $0x1, %bpl
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x77774
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x77774
movq %rax, %rbx
movb $0x1, %bpl
movq 0x78(%rsp), %rdi
cmpq %r13, %rdi
je 0x77796
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x77796
movq %rax, %rbx
movb $0x1, %bpl
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0x777bb
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x777bb
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x777c8
movq %r14, %rdi
callq 0x3a330
callq 0x3a710
movq %rbx, %rdi
callq 0x3a780
movq %rax, %rdi
callq 0x414b1
nopl (%rax)