// File: /workspace/github_cpp_makefile_star2_O1/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 0x7f59a
leaq 0xc4b0(%rip), %rsi      # 0x8b94e
movq %r15, %rdi
callq 0x416d6
cmpb $0x0, (%rax)
je 0x7f604
leaq 0xc4ea(%rip), %rsi      # 0x8b9a0
movq %r15, %rdi
callq 0x416d6
cmpb $0x0, (%rax)
je 0x7f698
leaq 0xc480(%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 0xc48e(%rip), %rsi      # 0x8b9a0
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 $0x2, %esi
callq 0x7d820
leaq 0x2545c(%rip), %rax     # 0xa49b0
movq %rax, (%r14)
leaq 0x24b22(%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 0xc3ed(%rip), %rsi      # 0x8b9a8
leaq 0xc3f0(%rip), %rdx      # 0x8b9b2
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 0x7f72c
leaq 0x25415(%rip), %rcx     # 0xa4a10
movq (%rcx,%rax,8), %rbx
jmp 0x7f733
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0x138(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xc384(%rip), %rsi      # 0x8b9a8
leaq 0xc387(%rip), %rdx      # 0x8b9b2
leaq 0x128(%rsp), %rdi
callq 0x44728
leaq 0x118(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc302(%rip), %rsi      # 0x8b94e
leaq 0xc301(%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 0x24c1c(%rip), %rsi     # 0xa42a0
leaq -0x979d(%rip), %rdx     # 0x75eee
movq %r14, %rdi
callq 0x3a750
jmp 0x7fa43
movl $0x68, %edi
callq 0x3a210
movq %rax, %r14
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xc2f0(%rip), %rsi      # 0x8b9a8
leaq 0xc2f3(%rip), %rdx      # 0x8b9b2
leaq 0xe8(%rsp), %rdi
callq 0x44728
leaq 0xd8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc2c0(%rip), %rsi      # 0x8b9a0
leaq 0xc2c0(%rip), %rdx      # 0x8b9a7
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 0x24b88(%rip), %rsi     # 0xa42a0
leaq -0x9831(%rip), %rdx     # 0x75eee
movq %r14, %rdi
callq 0x3a750
jmp 0x7fa43
leaq 0x7acb(%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 0x7f772
leaq 0x252a4(%rip), %rcx     # 0xa4a10
movq (%rcx,%rax,8), %rbx
jmp 0x7f779
leaq 0x7a85(%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 0x2493b(%rip), %rsi     # 0xa4108
leaq -0xba34(%rip), %rdx     # 0x73da0
movq %r14, %rdi
callq 0x3a750
jmp 0x7fa43
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f809
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7f809
movq %rax, %rbx
movb $0x1, %bpl
movq 0x168(%rsp), %rdi
cmpq %r13, %rdi
je 0x7f82e
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7f82e
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x48(%rsp), %rdi
callq 0x4191c
jmp 0x7f8c1
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f865
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7f865
movq %rax, %rbx
movb $0x1, %bpl
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f8ea
movq 0xf8(%rsp), %rsi
jmp 0x7f8d6
movq %rax, %rbx
movq 0x108(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f8a4
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7f8a4
movq %rax, %rbx
movb $0x1, %bpl
movq 0x128(%rsp), %rdi
cmpq %r15, %rdi
je 0x7f8ea
movq 0x138(%rsp), %rsi
jmp 0x7f8d6
movq %rax, %rbx
movb $0x1, %bpl
movq 0x188(%rsp), %rdi
cmpq %r12, %rdi
je 0x7f8ea
movq 0x198(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7f8ea
jmp 0x7f8e4
jmp 0x7f8e4
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7fae7
movq %r14, %rdi
callq 0x3a330
jmp 0x7fae7
movq %rax, %rbx
movl $0x38, %esi
movq %r14, %rdi
callq 0x3a470
jmp 0x7fae7
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4191c
jmp 0x7fae7
movq %rax, %rbx
cmpl $0x1, %edx
jne 0x7fae7
movq %rbx, %rdi
callq 0x3a1c0
movl $0xa8, %edi
callq 0x3a210
movq %rax, %r14
leaq 0xb8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc04c(%rip), %rsi      # 0x8b9a8
leaq 0xc04f(%rip), %rdx      # 0x8b9b2
leaq 0xa8(%rsp), %rdi
callq 0x44728
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0xc01d(%rip), %rsi      # 0x8b9a0
leaq 0xc01d(%rip), %rdx      # 0x8b9a7
leaq 0x88(%rsp), %rdi
callq 0x44728
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0xb7ba(%rip), %rsi      # 0x8b161
leaq 0xb7b9(%rip), %rdx      # 0x8b167
leaq 0x28(%rsp), %rdi
callq 0x44728
leaq 0xbfe1(%rip), %rsi      # 0x8b9a0
movq %r15, %rdi
callq 0x416d6
movzbl (%rax), %eax
cmpq $0x8, %rax
ja 0x7f9dd
leaq 0x25039(%rip), %rcx     # 0xa4a10
movq (%rcx,%rax,8), %rbx
jmp 0x7f9e4
leaq 0x781a(%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 0x24884(%rip), %rsi     # 0xa42b8
leaq -0x9673(%rip), %rdx     # 0x763c8
movq %r14, %rdi
callq 0x3a750
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r15, %rdi
je 0x7fa67
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7fa67
jmp 0x7fa61
movq %rax, %rbx
movb $0x1, %bpl
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x7fa8b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7fa8b
movq %rax, %rbx
movb $0x1, %bpl
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x7fab0
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7fab0
movq %rax, %rbx
movb $0x1, %bpl
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x7fad5
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x3a470
jmp 0x7fad5
movq %rax, %rbx
movb $0x1, %bpl
testb %bpl, %bpl
je 0x7fae2
movq %r14, %rdi
callq 0x3a330
callq 0x3a710
movq %rbx, %rdi
callq 0x3a780
movq %rax, %rdi
callq 0x414b1
nop