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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %r15
cmpb $0x1, (%rdi)
jne 0x87183
leaq 0xbbf8(%rip), %rsi      # 0x92cd0
movq %r15, %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x87233
leaq 0xbc80(%rip), %rsi      # 0x92d70
movq %r15, %rdi
callq 0x56e34
cmpb $0x0, (%rax)
je 0x872a8
leaq 0xbbc8(%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 0xbc32(%rip), %rsi      # 0x92d70
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 0x86b80
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 0xbbe1(%rip), %rsi      # 0x92d78
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 0x2a299(%rip), %rsi     # 0xb14b8
leaq -0x8080(%rip), %rdx     # 0x7f1a6
movq %r14, %rdi
callq 0x52760
jmp 0x874bf
pushq $0x68
popq %rdi
callq 0x52220
movq %rax, %r14
leaq 0xbb33(%rip), %rsi      # 0x92d78
leaq 0x128(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0xba72(%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 0x2a374(%rip), %rsi     # 0xb1608
leaq -0x6b3b(%rip), %rdx     # 0x80760
movq %r14, %rdi
callq 0x52760
jmp 0x874bf
pushq $0x68
popq %rdi
callq 0x52220
movq %rax, %r14
leaq 0xbabe(%rip), %rsi      # 0x92d78
leaq 0xe8(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0x56548
leaq 0xba9d(%rip), %rsi      # 0x92d70
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 0x2a2ff(%rip), %rsi     # 0xb1608
leaq -0x6bb0(%rip), %rdx     # 0x80760
movq %r14, %rdi
callq 0x52760
jmp 0x874bf
movq %rax, %rbx
leaq 0x148(%rsp), %rdi
callq 0x52888
jmp 0x87335
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x168(%rsp), %rdi
callq 0x52888
jmp 0x8734a
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x18(%rsp), %rdi
callq 0x56fca
jmp 0x873a0
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0x52888
jmp 0x8736e
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xe8(%rsp), %rdi
jmp 0x873a8
movq %rax, %rbx
leaq 0x108(%rsp), %rdi
callq 0x52888
jmp 0x87390
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x128(%rsp), %rdi
jmp 0x873a8
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x188(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x873be
jmp 0x87521
jmp 0x873bb
jmp 0x873bb
movq %rax, %rbx
movq %r14, %rdi
callq 0x52350
jmp 0x87521
movq %rax, %rbx
pushq $0x38
popq %rsi
movq %r14, %rdi
callq 0x52480
jmp 0x87521
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x56fca
jmp 0x87521
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x87521
movq %rbx, %rdi
callq 0x521b0
movl $0xa8, %edi
callq 0x52220
movq %rax, %r14
leaq 0xb960(%rip), %rsi      # 0x92d78
leaq 0xa8(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x56548
leaq 0xb93f(%rip), %rsi      # 0x92d70
leaq 0x88(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x56548
leaq 0xadd7(%rip), %rsi      # 0x92221
leaq 0x68(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x56548
leaq 0xb910(%rip), %rsi      # 0x92d70
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 0x2a170(%rip), %rsi     # 0xb1620
leaq -0x6b29(%rip), %rdx     # 0x8098e
movq %r14, %rdi
callq 0x52760
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x52888
jmp 0x874d6
jmp 0x874d0
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x68(%rsp), %rdi
callq 0x52888
jmp 0x874e8
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x88(%rsp), %rdi
callq 0x52888
jmp 0x874fd
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xa8(%rsp), %rdi
callq 0x52888
testb %bpl, %bpl
jne 0x87514
jmp 0x8751c
movq %rax, %rbx
movq %r14, %rdi
callq 0x52350
callq 0x52720
movq %rbx, %rdi
callq 0x527a0
movq %rax, %rdi
callq 0x56ca4
nop