// File: Lut99[P]RayTracer/src/lib/materials/Lambertian.cpp
// Function: RayTracer::Lambertian::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>)
Lambertian* Lambertian::from_json(nlohmann::json json_obj) {
    // Check if the object has an object type
    if (!json_obj.is_object()) {
        throw InvalidObjectFormat("Lambertian", json::object().type_name(), json_obj.type_name());
    }

    // Check if there is an albedo field
    if (json_obj["albedo"].is_null()) {
        throw MissingFieldException("Lambertian", "albedo");
    }

    // Parse it with the Vec3 parser
    Vec3 albedo = Vec3::from_json(json_obj["albedo"]);

    return new Lambertian(albedo);
}

// Assembly:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x60(%rsp)
movq %rdi, 0x190(%rsp)
callq 0xd9b20
testb $0x1, %al
jne 0x166699
movb $0x1, 0xee(%rsp)
movl $0x88, %edi
callq 0xd02b0
movq %rax, 0x50(%rsp)
leaq 0x16f(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xd0a20
movq 0x58(%rsp), %rdx
leaq 0x11e6f(%rip), %rsi     # 0x178325
leaq 0x170(%rsp), %rdi
callq 0xd8b80
jmp 0x1664c5
leaq 0x118(%rsp), %rdi
callq 0x155e60
movq 0x118(%rsp), %rsi
movq 0x120(%rsp), %rdx
leaq 0x128(%rsp), %rdi
callq 0x15a2a0
jmp 0x1664f1
leaq 0x128(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x40(%rsp)
leaq 0x117(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xd0a20
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
leaq 0x138(%rsp), %rdi
callq 0xd8b80
jmp 0x16652e
movq 0x60(%rsp), %rdi
callq 0x1302d0
movq %rax, 0x30(%rsp)
leaq 0xef(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xd0a20
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0xf0(%rsp), %rdi
callq 0xd8b80
jmp 0x166568
movq 0x50(%rsp), %rdi
leaq 0x170(%rsp), %rsi
leaq 0x138(%rsp), %rdx
leaq 0xf0(%rsp), %rcx
callq 0x156180
jmp 0x16658c
movq 0x50(%rsp), %rdi
movb $0x0, 0xee(%rsp)
leaq 0x44ed0(%rip), %rsi     # 0x1ab470
leaq -0x10217(%rip), %rdx    # 0x156390
callq 0xd09b0
jmp 0x1668b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x166671
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x166664
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x16664a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x166630
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xd0b38
leaq 0xef(%rsp), %rdi
callq 0xd0630
leaq 0x138(%rsp), %rdi
callq 0xd0b38
leaq 0x117(%rsp), %rdi
callq 0xd0630
leaq 0x128(%rsp), %rdi
callq 0xd9f30
leaq 0x170(%rsp), %rdi
callq 0xd0b38
leaq 0x16f(%rsp), %rdi
callq 0xd0630
testb $0x1, 0xee(%rsp)
jne 0x16668a
jmp 0x166694
movq 0x50(%rsp), %rdi
callq 0xd0430
jmp 0x1668ab
movq 0x60(%rsp), %rdi
leaq 0x11c79(%rip), %rsi     # 0x17831e
callq 0xd9b40
movq %rax, %rdi
callq 0xd9da0
testb $0x1, %al
jne 0x1666bb
jmp 0x1667fc
movb $0x1, 0x9e(%rsp)
movl $0x68, %edi
callq 0xd02b0
movq %rax, 0x20(%rsp)
leaq 0xc7(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xd0a20
movq 0x28(%rsp), %rdx
leaq 0x11c35(%rip), %rsi     # 0x178325
leaq 0xc8(%rsp), %rdi
callq 0xd8b80
jmp 0x1666ff
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xd0a20
movq 0x18(%rsp), %rdx
leaq 0x11c01(%rip), %rsi     # 0x17831e
leaq 0xa0(%rsp), %rdi
callq 0xd8b80
jmp 0x16672c
movq 0x20(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
callq 0x15a2f0
jmp 0x166748
movq 0x20(%rsp), %rdi
movb $0x0, 0x9e(%rsp)
leaq 0x44e64(%rip), %rsi     # 0x1ab5c0
leaq -0xc333(%rip), %rdx     # 0x15a430
callq 0xd09b0
jmp 0x1668b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x1667d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
jmp 0x1667ba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0xd0b38
leaq 0x9f(%rsp), %rdi
callq 0xd0630
leaq 0xc8(%rsp), %rdi
callq 0xd0b38
leaq 0xc7(%rsp), %rdi
callq 0xd0630
testb $0x1, 0x9e(%rsp)
jne 0x1667ed
jmp 0x1667f7
movq 0x20(%rsp), %rdi
callq 0xd0430
jmp 0x1668ab
movq 0x60(%rsp), %rdi
leaq 0x11b16(%rip), %rsi     # 0x17831e
callq 0xd9b40
movq %rax, %rsi
leaq 0x68(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xd9dc0
movq 0x10(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x155110
jmp 0x166830
leaq 0x68(%rsp), %rdi
callq 0xd9f30
movl $0x30, %edi
callq 0xd05d0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
leaq 0x78(%rsp), %rsi
callq 0x1661e0
jmp 0x16685b
movq 0x8(%rsp), %rax
addq $0x198, %rsp            # imm = 0x198
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xd9f30
jmp 0x1668ab
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
movl $0x30, %esi
callq 0xd05e0
movq 0x160(%rsp), %rdi
callq 0xd0a10
nopl (%rax,%rax)