// File: /workspace/github_cpp_makefile_star2_O1/alan0201tw[P]RayTracer/src/util.cpp
// Function: two_perlin_sphere()
std::shared_ptr<hitable> two_perlin_sphere()
{
    std::shared_ptr<texture> _perlin_texture = std::make_shared<perlin_noise_texture>(4.0f);

    std::vector<std::shared_ptr<hitable>> list;
    list.reserve(50);

    list.push_back(std::make_shared<sphere>(vec3(0.0f, -1000.0f, 0.0f), 1000.0f, std::make_shared<lambertian>(_perlin_texture)));
    list.push_back(std::make_shared<sphere>(vec3(0.0f,  2.0f, 0.0f), 2.0f, std::make_shared<lambertian>(_perlin_texture)));

    return std::make_shared<bvh_node>(list, 0.0f, 1.0f);
}

// Assembly:
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movl $0x20, %edi
callq 0x63f0
movabsq $0x100000001, %rcx      # imm = 0x100000001
movq %rcx, 0x8(%rax)
leaq 0x37e53(%rip), %rcx     # 0x4e740
movq %rcx, (%rax)
leaq 0x10(%rax), %rcx
leaq 0x37865(%rip), %rdx     # 0x4e160
addq $0x10, %rdx
movq %rdx, 0x10(%rax)
movl $0x40800000, 0x18(%rax) # imm = 0x40800000
movq %rcx, 0x50(%rsp)
movq %rax, 0x58(%rsp)
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0x32, %esi
callq 0x7602
movabsq $-0x3b86000000000000, %rax # imm = 0xC47A000000000000
movq %rax, 0x44(%rsp)
movl $0x0, 0x4c(%rsp)
movl $0x447a0000, 0xc(%rsp)  # imm = 0x447A0000
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0x215a2
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x44(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0x2217e
movups 0x10(%rsp), %xmm0
leaq 0x30(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x7c02
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x169ca
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x169d9
callq 0x7768
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x169e8
callq 0x7768
movabsq $0x4000000000000000, %rax # imm = 0x4000000000000000
movq %rax, 0x44(%rsp)
movl $0x0, 0x4c(%rsp)
movl $0x40000000, 0xc(%rsp)  # imm = 0x40000000
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0x215a2
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0xb(%rsp), %rdx
leaq 0x44(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x20(%rsp), %r9
callq 0x2217e
movups 0x10(%rsp), %xmm0
leaq 0x30(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x7c02
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x16a81
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x16a90
callq 0x7768
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x16a9f
callq 0x7768
leaq 0x10(%rsp), %r8
movl $0x0, (%r8)
leaq 0x20(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rsi
leaq 0x44(%rsp), %rdx
leaq 0x60(%rsp), %rcx
callq 0x220f0
movq 0x30(%rsp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq 0x38(%rsp), %rcx
movq %rax, 0x38(%rsp)
movq %rcx, 0x8(%rbx)
leaq 0x60(%rsp), %rdi
callq 0x7720
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x16b0d
callq 0x7768
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
retq
jmp 0x16b5a
jmp 0x16b21
jmp 0x16b44
jmp 0x16b5a
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x16b33
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x16b47
callq 0x7768
jmp 0x16b47
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x16b5d
callq 0x7768
jmp 0x16b5d
jmp 0x16b5a
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x7720
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x16b76
callq 0x7768
movq %rbx, %rdi
callq 0x66e0