// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, %rbx
movl $0x28, %edi
callq 0x63f0
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x8(%rax)
leaq 0x38795(%rip), %r15     # 0x4e458
movq %r15, (%rax)
leaq 0x10(%rax), %rcx
leaq 0x38417(%rip), %r12     # 0x4e0e8
addq $0x10, %r12
movq %r12, 0x10(%rax)
movsd 0x268ef(%rip), %xmm0    # 0x3c5d0
movsd %xmm0, 0x18(%rax)
movl $0x3e99999a, 0x20(%rax) # imm = 0x3E99999A
movq %rax, 0x58(%rsp)
movq %rcx, 0x50(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %r14, 0x8(%rax)
movq %r15, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, 0x10(%rax)
movsd 0x26835(%rip), %xmm0    # 0x3c550
movsd %xmm0, 0x18(%rax)
movl $0x3f666666, 0x20(%rax) # imm = 0x3F666666
leaq 0x20(%rsp), %r8
movq %rax, 0x8(%r8)
movq %rcx, (%r8)
leaq 0x68(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x60(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0x20820
movaps 0x60(%rsp), %xmm0
movaps %xmm0, 0x80(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x15d78
callq 0x7774
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x15d87
callq 0x7774
leaq 0x68(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x26f9e(%rip), %rcx     # 0x3cd39
leaq 0x60(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x209f0
leaq 0x60(%rsp), %rdi
movaps (%rdi), %xmm0
movaps %xmm0, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x32, %esi
callq 0x7616
movsd 0x26809(%rip), %xmm0    # 0x3c5e0
movsd %xmm0, 0x40(%rsp)
movl $0x0, 0x48(%rsp)
movl $0x41200000, 0xc(%rsp)  # imm = 0x41200000
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0x20b4e
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x2172a
movaps 0x10(%rsp), %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x7c1c
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x15e67
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x15e76
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x15e85
callq 0x7774
movsd 0x26763(%rip), %xmm0    # 0x3c5f0
movsd %xmm0, 0x40(%rsp)
movl $0x0, 0x48(%rsp)
movl $0x41200000, 0xc(%rsp)  # imm = 0x41200000
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x80(%rsp), %rcx
callq 0x20b4e
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x30(%rsp), %r9
callq 0x2172a
movaps 0x10(%rsp), %xmm0
leaq 0x20(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x7c1c
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x15f20
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x15f2f
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x15f3e
callq 0x7774
leaq 0x10(%rsp), %r8
movl $0x0, (%r8)
leaq 0x30(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x60(%rsp), %rcx
callq 0x2169c
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rbx)
leaq 0x60(%rsp), %rdi
callq 0x7726
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x15f98
callq 0x7774
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x15faa
callq 0x7774
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x15ffd
jmp 0x15fc4
jmp 0x15fe7
jmp 0x15ffd
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x15fd6
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x15fea
callq 0x7774
jmp 0x15fea
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x16000
callq 0x7774
jmp 0x16000
jmp 0x15ffd
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x7726
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1601e
callq 0x7774
jmp 0x1601e
movq %rax, %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x16030
callq 0x7774
movq %rbx, %rdi
callq 0x66e0
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1604f
callq 0x7774
jmp 0x1604f
movq %rax, %rbx
movq 0x58(%rsp), %rdi
jmp 0x16026