// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/src/util.cpp
// Function: two_sphere()
std::shared_ptr<hitable> two_sphere()
{
    std::shared_ptr<texture> _checker_texture = std::make_shared<checker_texture>(
        std::make_shared<constant_texture>(vec3(0.1f, 0.2f, 0.3f)),
        std::make_shared<constant_texture>(vec3(0.9f, 0.9f, 0.9f))
    );

    std::shared_ptr<texture> _image_texture = std::make_shared<image_texture>("./resources/texture.jpg");

    std::vector<std::shared_ptr<hitable>> list;
    list.reserve(50);

    list.push_back(std::make_shared<sphere>(vec3(0.0f, -10.0f, 0.0f), 10.0f, std::make_shared<lambertian>(_image_texture)));
    list.push_back(std::make_shared<sphere>(vec3(0.0f,  10.0f, 0.0f), 10.0f, std::make_shared<lambertian>(_checker_texture)));

    return std::make_shared<bvh_node>(list, 0.0f, 1.0f);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rdi, %r15
movsd 0x1dad7(%rip), %xmm0    # 0x305e0
leaq 0x60(%rsp), %rsi
movsd %xmm0, (%rsi)
movl $0x3e99999a, 0x8(%rsi)  # imm = 0x3E99999A
leaq 0x70(%rsp), %rdi
callq 0x16b90
movsd 0x1da35(%rip), %xmm0    # 0x30560
leaq 0x20(%rsp), %rsi
movsd %xmm0, (%rsi)
movl $0x3f666666, 0x8(%rsi)  # imm = 0x3F666666
leaq 0x10(%rsp), %rdi
callq 0x16b90
leaq 0x40(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x16b6f
leaq 0x88(%rsp), %rbx
leaq 0x48(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
movaps %xmm0, -0x8(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%rdi)
callq 0x7426
leaq 0x18(%rsp), %rdi
callq 0x7426
leaq 0x78(%rsp), %rdi
callq 0x7426
leaq 0x1e16c(%rip), %rsi     # 0x30d01
leaq 0x40(%rsp), %rdi
callq 0x16bae
leaq 0x78(%rsp), %r14
leaq 0x48(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r14)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
movq %r12, %rdi
callq 0x7426
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
andq $0x0, 0x8(%r12)
leaq 0x40(%rsp), %rdi
pushq $0x32
popq %rsi
callq 0x71e8
movsd 0x1da07(%rip), %xmm0    # 0x305f0
movsd %xmm0, 0x30(%rsp)
andl $0x0, 0x38(%rsp)
movl $0x41200000, 0xc(%rsp)  # imm = 0x41200000
leaq 0x20(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x16bf0
leaq 0x60(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x16d74
leaq 0x18(%rsp), %r13
leaq 0x68(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x7b8a
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
leaq 0x28(%rsp), %rdi
callq 0x7426
movsd 0x1d98d(%rip), %xmm0    # 0x30600
movsd %xmm0, 0x30(%rsp)
andl $0x0, 0x38(%rsp)
movl $0x41200000, 0xc(%rsp)  # imm = 0x41200000
leaq 0x20(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x16bf0
leaq 0x60(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xc(%rsp), %rdx
leaq 0x20(%rsp), %rcx
callq 0x16d74
leaq 0x18(%rsp), %r13
leaq 0x68(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x7b8a
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x7426
leaq 0x60(%rsp), %rdx
andl $0x0, (%rdx)
movl $0x3f800000, -0x8(%r12) # imm = 0x3F800000
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x20(%rsp), %rcx
callq 0x16d50
leaq 0x18(%rsp), %rdi
movaps -0x8(%rdi), %xmm0
andq $0x0, (%rdi)
movups %xmm0, (%r15)
andq $0x0, -0x8(%rdi)
callq 0x7426
leaq 0x40(%rsp), %rdi
callq 0x7404
movq %r14, %rdi
callq 0x7426
movq %rbx, %rdi
callq 0x7426
movq %r15, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x12d97
jmp 0x12d71
jmp 0x12d86
jmp 0x12d97
movq %rax, %r15
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
jmp 0x12d89
movq %rax, %r15
leaq 0x28(%rsp), %rdi
callq 0x7426
jmp 0x12d9a
jmp 0x12d97
movq %rax, %r15
leaq 0x40(%rsp), %rdi
callq 0x7404
movq %r14, %rdi
callq 0x7426
movq %rbx, %rdi
callq 0x7426
movq %r15, %rdi
callq 0x6710
movq %rax, %r15
jmp 0x12dac
movq %rax, %r15
leaq 0x18(%rsp), %rdi
callq 0x7426
jmp 0x12dd3
movq %rax, %r15
leaq 0x78(%rsp), %rdi
jmp 0x12daf