// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %r15
cmpb $0x1, (%rdi)
jne 0x7e8fc
leaq 0xd14e(%rip), %rsi      # 0x8b94e
movq %r15, %rdi
callq 0x416d6
cmpb $0x0, (%rax)
je 0x7e966
leaq 0xd161(%rip), %rsi      # 0x8b979
movq %r15, %rdi
callq 0x416d6
cmpb $0x0, (%rax)
je 0x7e9fa
leaq 0xd11e(%rip), %rsi      # 0x8b94e
movq %r15, %rdi
callq 0x416d6
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x41894
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x73118
leaq 0x10(%rsp), %rdi
callq 0x48a06
leaq 0x18(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x48aa8
leaq 0xd105(%rip), %rsi      # 0x8b979
movq %r15, %rdi
callq 0x416d6
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x753fb
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x38, %edi
callq 0x3a460
movq %rax, %r14
movq %rax, %rdi
movl $0x1, %esi
callq 0x7d820
leaq 0x26052(%rip), %rax     # 0xa4908
movq %rax, (%r14)
leaq 0x257c0(%rip), %rax     # 0xa4080
addq $0x10, %rax
movq %rax, 0x10(%r14)
movups 0x50(%rsp), %xmm0
movups %xmm0, 0x18(%r14)
movq 0x60(%rsp), %rax
movq %rax, 0x28(%r14)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x30(%r14)
movq %r14, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x88, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x198(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xd061(%rip), %rsi      # 0x8b97e
leaq 0xd05f(%rip), %rdx      # 0x8b983
leaq 0x188(%rsp), %rdi
callq 0x44728
leaq 0x48(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x747bc
movzbl 0x48(%rsp), %eax
cmpq $0x8, %rax
ja 0x7ea8e
leaq 0x25ffb(%rip), %rcx     # 0xa4958
movq (%rcx,%rax,8), %rbx
jmp 0x7ea95
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x138(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xcff8(%rip), %rsi      # 0x8b97e
leaq 0xcff6(%rip), %rdx      # 0x8b983
leaq 0x128(%rsp), %rdi
callq 0x44728
leaq 0x118(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xcfa0(%rip), %rsi      # 0x8b94e
leaq 0xcf9f(%rip), %rdx      # 0x8b954
leaq 0x108(%rsp), %rdi
callq 0x44728
movb $0x1, %bpl
leaq 0x128(%rsp), %rsi
leaq 0x108(%rsp), %rdx
movq %r14, %rdi
callq 0x75d5a
xorl %ebp, %ebp
leaq 0x258ba(%rip), %rsi     # 0xa42a0
leaq -0x8aff(%rip), %rdx     # 0x75eee
movq %r14, %rdi
callq 0x3a750
jmp 0x7eda5
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xcf64(%rip), %rsi      # 0x8b97e
leaq 0xcf62(%rip), %rdx      # 0x8b983
leaq 0xe8(%rsp), %rdi
callq 0x44728
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xcf37(%rip), %rsi      # 0x8b979
leaq 0xcf34(%rip), %rdx      # 0x8b97d
leaq 0xc8(%rsp), %rdi
callq 0x44728
movb $0x1, %bpl
leaq 0xe8(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
movq %r14, %rdi
callq 0x75d5a
xorl %ebp, %ebp
leaq 0x25826(%rip), %rsi     # 0xa42a0
leaq -0x8b93(%rip), %rdx     # 0x75eee
movq %r14, %rdi
callq 0x3a750
jmp 0x7eda5
leaq 0x8769(%rip), %rbx      # 0x871fe
leaq 0x178(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x168(%rsp), %rdi
movq %rbx, %rsi
callq 0x44728
movzbl (%r15), %eax
cmpq $0x8, %rax
ja 0x7ead4
leaq 0x25e8a(%rip), %rcx     # 0xa4958
movq (%rcx,%rax,8), %rbx
jmp 0x7eadb
leaq 0x8723(%rip), %rbx      # 0x871fe
leaq 0x158(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x148(%rsp), %rdi
movq %rbx, %rsi
callq 0x44728
movb $0x1, %bpl
leaq 0x188(%rsp), %rsi
leaq 0x168(%rsp), %rdx
leaq 0x148(%rsp), %rcx
movq %r14, %rdi
callq 0x73acc
xorl %ebp, %ebp
leaq 0x255d9(%rip), %rsi     # 0xa4108
leaq -0xad96(%rip), %rdx     # 0x73da0
movq %r14, %rdi
callq 0x3a750
jmp 0x7eda5
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r15, %rdi
je 0x7eb6b
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7eb6b
movq %rax, %rbx
movb $0x1, %bpl
movq 0x168(%rsp), %rdi
cmpq %r13, %rdi
je 0x7eb90
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7eb90
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x48(%rsp), %rdi
callq 0x4191c
jmp 0x7ec23
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ebc7
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7ebc7
movq %rax, %rbx
movb $0x1, %bpl
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7ec4c
movq 0xf8(%rsp), %rsi
jmp 0x7ec38
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ec06
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7ec06
movq %rax, %rbx
movb $0x1, %bpl
movq 0x128(%rsp), %rdi
cmpq %r15, %rdi
je 0x7ec4c
movq 0x138(%rsp), %rsi
jmp 0x7ec38
movq %rax, %rbx
movb $0x1, %bpl
movq 0x188(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ec4c
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7ec4c
jmp 0x7ec46
jmp 0x7ec46
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7ee49
movq %r14, %rdi
callq 0x3a330
jmp 0x7ee49
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
callq 0x3a470
jmp 0x7ee49
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4191c
jmp 0x7ee49
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7ee49
movq %rbx, %rdi
callq 0x3a1c0
movl $0xa8, %edi
callq 0x3a210
movq %rax, %r14
leaq 0xb8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xccc0(%rip), %rsi      # 0x8b97e
leaq 0xccbe(%rip), %rdx      # 0x8b983
leaq 0xa8(%rsp), %rdi
callq 0x44728
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xcc94(%rip), %rsi      # 0x8b979
leaq 0xcc91(%rip), %rdx      # 0x8b97d
leaq 0x88(%rsp), %rdi
callq 0x44728
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xc458(%rip), %rsi      # 0x8b161
leaq 0xc457(%rip), %rdx      # 0x8b167
leaq 0x28(%rsp), %rdi
callq 0x44728
leaq 0xcc58(%rip), %rsi      # 0x8b979
movq %r15, %rdi
callq 0x416d6
movzbl (%rax), %eax
cmpq $0x8, %rax
ja 0x7ed3f
leaq 0x25c1f(%rip), %rcx     # 0xa4958
movq (%rcx,%rax,8), %rbx
jmp 0x7ed46
leaq 0x84b8(%rip), %rbx      # 0x871fe
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x68(%rsp), %rdi
movq %rbx, %rsi
callq 0x44728
movb $0x1, %bpl
leaq 0xa8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x68(%rsp), %r8
movq %r14, %rdi
callq 0x75f58
xorl %ebp, %ebp
leaq 0x25522(%rip), %rsi     # 0xa42b8
leaq -0x89d5(%rip), %rdx     # 0x763c8
movq %r14, %rdi
callq 0x3a750
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7edc9
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7edc9
jmp 0x7edc3
movq %rax, %rbx
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7eded
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7eded
movq %rax, %rbx
movb $0x1, %bpl
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x7ee12
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7ee12
movq %rax, %rbx
movb $0x1, %bpl
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7ee37
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7ee37
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7ee44
movq %r14, %rdi
callq 0x3a330
callq 0x3a710
movq %rbx, %rdi
callq 0x3a780
movq %rax, %rdi
callq 0x414b1
nop