// File: /workspace/github_cpp_makefile_star2_O2/Lut99[P]RayTracer/src/lib/materials/Metal.cpp
// Function: RayTracer::Metal::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>)
Metal* Metal::from_json(json json_obj) {
    // Check if the object has an object type
    if (!json_obj.is_object()) {
        throw InvalidObjectFormat("Metal", json::object().type_name(), json_obj.type_name());
    }

    // Check if the required fields are there
    if (json_obj["albedo"].is_null()) {
        throw MissingFieldException("Metal", "albedo");
    }
    if (json_obj["fuzz"].is_null()) {
        throw MissingFieldException("Metal", "fuzz");
    }

    // Parse it
    Vec3 albedo = Vec3::from_json(json_obj["albedo"]);
    double fuzz;
    try {
        fuzz = json_obj["fuzz"].get<double>();
    } catch (nlohmann::detail::type_error&) {
        throw InvalidFieldFormat("Metal", "fuzz", "double", json_obj["fuzz"].type_name());
    }

    return new Metal(albedo, fuzz);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %r15
cmpb $0x1, (%rdi)
jne 0x867c7
leaq 0xc5b4(%rip), %rsi      # 0x92cd0
movq %r15, %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x86877
leaq 0xc5f0(%rip), %rsi      # 0x92d24
movq %r15, %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x868ec
leaq 0xc584(%rip), %rsi      # 0x92cd0
movq %r15, %rdi
callq 0x56e34
leaq 0x38(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x56f56
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x7e90c
leaq 0x38(%rsp), %rdi
callq 0x56fca
leaq 0xc5a2(%rip), %rsi      # 0x92d24
movq %r15, %rdi
callq 0x56e34
movq %rax, %rdi
callq 0x7f350
movsd %xmm0, 0x10(%rsp)
pushq $0x38
popq %rdi
callq 0x52470
movq %rax, %r14
leaq 0x18(%rsp), %rsi
movq %rax, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x8645c
movq %r14, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x88, %edi
callq 0x52220
movq %rax, %r14
leaq 0xc54e(%rip), %rsi      # 0x92d29
leaq 0x188(%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 0x168(%rsp), %rdi
leaq 0xe(%rsp), %rdx
movq %rax, %rsi
callq 0x56548
movq %r15, %rdi
callq 0x6f406
leaq 0x148(%rsp), %rdi
leaq 0xd(%rsp), %rdx
movq %rax, %rsi
callq 0x56548
movb $0x1, %bpl
leaq 0x188(%rsp), %rsi
leaq 0x168(%rsp), %rdx
leaq 0x148(%rsp), %rcx
movq %r14, %rdi
callq 0x7f052
xorl %ebp, %ebp
leaq 0x2ac55(%rip), %rsi     # 0xb14b8
leaq -0x76c4(%rip), %rdx     # 0x7f1a6
movq %r14, %rdi
callq 0x52760
jmp 0x86b03
pushq $0x68
popq %rdi
callq 0x52220
movq %rax, %r14
leaq 0xc4a0(%rip), %rsi      # 0x92d29
leaq 0x128(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0xc42e(%rip), %rsi      # 0x92cd0
leaq 0x108(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
movb $0x1, %bpl
leaq 0x128(%rsp), %rsi
leaq 0x108(%rsp), %rdx
movq %r14, %rdi
callq 0x80690
xorl %ebp, %ebp
leaq 0x2ad30(%rip), %rsi     # 0xb1608
leaq -0x617f(%rip), %rdx     # 0x80760
movq %r14, %rdi
callq 0x52760
jmp 0x86b03
pushq $0x68
popq %rdi
callq 0x52220
movq %rax, %r14
leaq 0xc42b(%rip), %rsi      # 0x92d29
leaq 0xe8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0xc40d(%rip), %rsi      # 0x92d24
leaq 0xc8(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
movb $0x1, %bpl
leaq 0xe8(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
movq %r14, %rdi
callq 0x80690
xorl %ebp, %ebp
leaq 0x2acbb(%rip), %rsi     # 0xb1608
leaq -0x61f4(%rip), %rdx     # 0x80760
movq %r14, %rdi
callq 0x52760
jmp 0x86b03
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x52888
jmp 0x86979
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x168(%rsp), %rdi
callq 0x52888
jmp 0x8698e
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x18(%rsp), %rdi
callq 0x56fca
jmp 0x869e4
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x52888
jmp 0x869b2
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xe8(%rsp), %rdi
jmp 0x869ec
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x52888
jmp 0x869d4
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x128(%rsp), %rdi
jmp 0x869ec
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x188(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x86a02
jmp 0x86b65
jmp 0x869ff
jmp 0x869ff
movq %rax, %rbx
movq %r14, %rdi
callq 0x52350
jmp 0x86b65
movq %rax, %rbx
pushq $0x38
popq %rsi
movq %r14, %rdi
callq 0x52480
jmp 0x86b65
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x56fca
jmp 0x86b65
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x86b65
movq %rbx, %rdi
callq 0x521b0
movl $0xa8, %edi
callq 0x52220
movq %rax, %r14
leaq 0xc2cd(%rip), %rsi      # 0x92d29
leaq 0xa8(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
leaq 0xc2af(%rip), %rsi      # 0x92d24
leaq 0x88(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x56548
leaq 0xb793(%rip), %rsi      # 0x92221
leaq 0x68(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x56548
leaq 0xc280(%rip), %rsi      # 0x92d24
movq %r15, %rdi
callq 0x56e34
movq %rax, %rdi
callq 0x6f406
leaq 0x48(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x56548
movb $0x1, %bpl
leaq 0xa8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x68(%rsp), %rcx
leaq 0x48(%rsp), %r8
movq %r14, %rdi
callq 0x8079c
xorl %ebp, %ebp
leaq 0x2ab2c(%rip), %rsi     # 0xb1620
leaq -0x616d(%rip), %rdx     # 0x8098e
movq %r14, %rdi
callq 0x52760
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x52888
jmp 0x86b1a
jmp 0x86b14
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x68(%rsp), %rdi
callq 0x52888
jmp 0x86b2c
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x88(%rsp), %rdi
callq 0x52888
jmp 0x86b41
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xa8(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x86b58
jmp 0x86b60
movq %rax, %rbx
movq %r14, %rdi
callq 0x52350
callq 0x52720
movq %rbx, %rdi
callq 0x527a0
movq %rax, %rdi
callq 0x56ca4
nop