// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, %r15
cmpb $0x1, (%rdi)
jne 0x7ed21
leaq 0xbd52(%rip), %rsi      # 0x8a96e
movq %r15, %rdi
callq 0x41392
cmpb $0x0, (%rax)
je 0x7ed91
leaq 0xbd8c(%rip), %rsi      # 0x8a9c0
movq %r15, %rdi
callq 0x41392
cmpb $0x0, (%rax)
je 0x7ee1c
leaq 0xbd22(%rip), %rsi      # 0x8a96e
movq %r15, %rdi
callq 0x41392
leaq 0x10(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x4155c
leaq 0xc8(%rsp), %rdi
movq %rbx, %rsi
callq 0x725c2
leaq 0x10(%rsp), %rdi
callq 0x4861e
leaq 0x18(%rsp), %rdi
movzbl -0x8(%rdi), %esi
callq 0x486c0
leaq 0xbd2d(%rip), %rsi      # 0x8a9c0
movq %r15, %rdi
callq 0x41392
leaq 0x20(%rsp), %rsi
movq %rax, %rdi
callq 0x748f1
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x38, %edi
callq 0x3a470
movq %rax, %r14
movq %rax, %rdi
movl $0x2, %esi
callq 0x7cf68
leaq 0x24d0b(%rip), %rax     # 0xa39e0
movq %rax, (%r14)
leaq 0x243d1(%rip), %rax     # 0xa30b0
addq $0x10, %rax
movq %rax, 0x10(%r14)
movups 0xd0(%rsp), %xmm0
movups %xmm0, 0x18(%r14)
movq 0xe0(%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 0x98(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xbc86(%rip), %rsi      # 0x8a9c8
leaq 0xbc89(%rip), %rdx      # 0x8a9d2
leaq 0x88(%rsp), %rdi
callq 0x44390
leaq 0xc8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl $0x1, %r8d
callq 0x73c9e
movzbl 0xc8(%rsp), %eax
cmpq $0x8, %rax
ja 0x7eea7
leaq 0x24cb8(%rip), %rcx     # 0xa3a40
movq (%rcx,%rax,8), %rbx
jmp 0x7eeae
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x78(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xbc1a(%rip), %rsi      # 0x8a9c8
leaq 0xbc1d(%rip), %rdx      # 0x8a9d2
leaq 0x68(%rsp), %rdi
callq 0x44390
leaq 0x158(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xbb9b(%rip), %rsi      # 0x8a96e
leaq 0xbb9a(%rip), %rdx      # 0x8a974
leaq 0x148(%rsp), %rdi
callq 0x44390
movb $0x1, %bpl
leaq 0x68(%rsp), %rsi
leaq 0x148(%rsp), %rdx
movq %r14, %rdi
callq 0x75298
xorl %ebp, %ebp
leaq 0x244c8(%rip), %rsi     # 0xa32d0
leaq -0x99e3(%rip), %rdx     # 0x7542c
movq %r14, %rdi
callq 0x3a760
jmp 0x7f1f2
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xbb8f(%rip), %rsi      # 0x8a9c8
leaq 0xbb92(%rip), %rdx      # 0x8a9d2
leaq 0x48(%rsp), %rdi
callq 0x44390
leaq 0x138(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xbb62(%rip), %rsi      # 0x8a9c0
leaq 0xbb62(%rip), %rdx      # 0x8a9c7
leaq 0x128(%rsp), %rdi
callq 0x44390
movb $0x1, %bpl
leaq 0x48(%rsp), %rsi
leaq 0x128(%rsp), %rdx
movq %r14, %rdi
callq 0x75298
xorl %ebp, %ebp
leaq 0x2443d(%rip), %rsi     # 0xa32d0
leaq -0x9a6e(%rip), %rdx     # 0x7542c
movq %r14, %rdi
callq 0x3a760
jmp 0x7f1f2
leaq 0x734d(%rip), %rbx      # 0x861fb
leaq 0x198(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x188(%rsp), %rdi
movq %rbx, %rsi
callq 0x44390
movzbl (%r15), %eax
cmpq $0x8, %rax
ja 0x7eeed
leaq 0x24b59(%rip), %rcx     # 0xa3a40
movq (%rcx,%rax,8), %rbx
jmp 0x7eef4
leaq 0x7307(%rip), %rbx      # 0x861fb
leaq 0x178(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0x168(%rsp), %rdi
movq %rbx, %rsi
callq 0x44390
movb $0x1, %bpl
leaq 0x88(%rsp), %rsi
leaq 0x188(%rsp), %rdx
leaq 0x168(%rsp), %rcx
movq %r14, %rdi
callq 0x72fb0
xorl %ebp, %ebp
leaq 0x241f0(%rip), %rsi     # 0xa3138
leaq -0xbccb(%rip), %rdx     # 0x73284
movq %r14, %rdi
callq 0x3a760
jmp 0x7f1f2
movq %rax, %rbx
movq 0x168(%rsp), %rdi
cmpq %r15, %rdi
je 0x7ef84
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7ef84
movq %rax, %rbx
movb $0x1, %bpl
movq 0x188(%rsp), %rdi
cmpq %r13, %rdi
je 0x7efa9
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7efa9
movq %rax, %rbx
movb $0x1, %bpl
leaq 0xc8(%rsp), %rdi
callq 0x415d4
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f051
movq 0x98(%rsp), %rsi
jmp 0x7f049
movq %rax, %rbx
movq 0x128(%rsp), %rdi
cmpq %r12, %rdi
je 0x7eff1
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f051
movq 0x58(%rsp), %rsi
jmp 0x7f049
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f098
movq 0x58(%rsp), %rsi
jmp 0x7f087
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f03a
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f051
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3a480
testb %bpl, %bpl
jne 0x7f098
jmp 0x7f2b0
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f098
movq 0x78(%rsp), %rsi
jmp 0x7f087
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f098
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7f098
jmp 0x7f095
jmp 0x7f095
movq %rax, %rbx
movq %r14, %rdi
callq 0x3a340
jmp 0x7f2b0
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
callq 0x3a480
jmp 0x7f2b0
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x415d4
jmp 0x7f2b0
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7f2b0
movq %rbx, %rdi
callq 0x3a1c0
movl $0xa8, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x38(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xb8ca(%rip), %rsi      # 0x8a9c8
leaq 0xb8cd(%rip), %rdx      # 0x8a9d2
leaq 0x28(%rsp), %rdi
callq 0x44390
leaq 0x118(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xb89e(%rip), %rsi      # 0x8a9c0
leaq 0xb89e(%rip), %rdx      # 0x8a9c7
leaq 0x108(%rsp), %rdi
callq 0x44390
leaq 0xf8(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0xb038(%rip), %rsi      # 0x8a181
leaq 0xb037(%rip), %rdx      # 0x8a187
leaq 0xe8(%rsp), %rdi
callq 0x44390
leaq 0xb85c(%rip), %rsi      # 0x8a9c0
movq %r15, %rdi
callq 0x41392
movzbl (%rax), %eax
cmpq $0x8, %rax
ja 0x7f182
leaq 0x248c4(%rip), %rcx     # 0xa3a40
movq (%rcx,%rax,8), %rbx
jmp 0x7f189
leaq 0x7072(%rip), %rbx      # 0x861fb
leaq 0xb8(%rsp), %rax
movq %rax, -0x10(%rax)
movq %rbx, %rdi
callq 0x3a1f0
leaq (%rax,%rbx), %rdx
leaq 0xa8(%rsp), %rdi
movq %rbx, %rsi
callq 0x44390
movb $0x1, %r15b
leaq 0x28(%rsp), %rsi
leaq 0x108(%rsp), %rdx
leaq 0xe8(%rsp), %rcx
leaq 0xa8(%rsp), %r8
movq %r14, %rdi
callq 0x75496
xorl %r15d, %r15d
leaq 0x24105(%rip), %rsi     # 0xa32e8
leaq -0x98e4(%rip), %rdx     # 0x75906
movq %r14, %rdi
callq 0x3a760
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x7f224
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7f224
jmp 0x7f21e
movq %rax, %rbx
movb $0x1, %r15b
movq 0xe8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x7f249
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7f249
movq %rax, %rbx
movb $0x1, %r15b
movq 0x108(%rsp), %rdi
cmpq %r13, %rdi
je 0x7f266
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3a480
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f27d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a480
testb %r15b, %r15b
jne 0x7f2a3
jmp 0x7f2ab
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f2a3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a480
jmp 0x7f2a3
movq %rax, %rbx
movq %r14, %rdi
callq 0x3a340
callq 0x3a720
movq %rbx, %rdi
callq 0x3a790
movq %rax, %rdi
callq 0x4116b