// File: /workspace/github_cpp_makefile_star2_O2/alan0201tw[P]RayTracer/src/box.cpp
// Function: box::box(vec3 const&, vec3 const&, std::shared_ptr<material>)
box::box(const vec3& _min, const vec3& _max, std::shared_ptr<material> _material)
    : min_point(_min), max_point(_max)
{
    std::vector<std::shared_ptr<hitable>> list;
    list.reserve(6);

    //std::cout << min_point << " , " << max_point << std::endl;

    list.push_back(std::make_shared<xy_rect>(
            min_point.x(), max_point.x(), min_point.y(), max_point.y(), max_point.z(), _material));
    list.push_back(std::make_shared<flip_normals>(std::make_shared<xy_rect>(
            min_point.x(), max_point.x(), min_point.y(), max_point.y(), min_point.z(), _material)));

    list.push_back(std::make_shared<xz_rect>(
            min_point.x(), max_point.x(), min_point.z(), max_point.z(), max_point.y(), _material));
    list.push_back(std::make_shared<flip_normals>(std::make_shared<xz_rect>(
            min_point.x(), max_point.x(), min_point.z(), max_point.z(), min_point.y(), _material)));

    list.push_back(std::make_shared<yz_rect>(
            min_point.y(), max_point.y(), min_point.z(), max_point.z(), max_point.x(), _material));
    list.push_back(std::make_shared<flip_normals>(std::make_shared<yz_rect>(
            min_point.y(), max_point.y(), min_point.z(), max_point.z(), min_point.x(), _material)));

    rect_list = hitable_list(list);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rcx, %r14
movq %rdi, %r15
leaq 0x401ff(%rip), %rax     # 0x46ea8
movq %rax, (%rdi)
movq (%rsi), %rax
movq %rax, 0x8(%rdi)
movl 0x8(%rsi), %eax
movl %eax, 0x10(%rdi)
movq (%rdx), %rax
movq %rax, 0x14(%rdi)
movl 0x8(%rdx), %eax
movl %eax, 0x1c(%rdi)
leaq 0x20(%rdi), %rbx
leaq 0x404ff(%rip), %rax     # 0x471d0
addq $0x10, %rax
movq %rax, 0x20(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rdi)
andq $0x0, 0x38(%rdi)
leaq 0x50(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
pushq $0x6
popq %rsi
callq 0x71e8
movss 0x8(%r15), %xmm0
leaq 0x20(%rsp), %rsi
movss %xmm0, (%rsi)
movss 0x14(%r15), %xmm0
leaq 0x1c(%rsp), %rdx
movss %xmm0, (%rdx)
movss 0xc(%r15), %xmm0
leaq 0x18(%rsp), %rcx
movss %xmm0, (%rcx)
movss 0x18(%r15), %xmm0
leaq 0x14(%rsp), %r8
movss %xmm0, (%r8)
movss 0x1c(%r15), %xmm0
leaq 0x10(%rsp), %r9
movss %xmm0, (%r9)
movq %r14, (%rsp)
leaq 0x30(%rsp), %rdi
callq 0x727c
leaq 0x78(%rsp), %r13
leaq 0x38(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x7b8a
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
movss 0x8(%r15), %xmm0
leaq 0x1c(%rsp), %rsi
movss %xmm0, (%rsi)
movss 0x14(%r15), %xmm0
leaq 0x18(%rsp), %rdx
movss %xmm0, (%rdx)
movss 0xc(%r15), %xmm0
leaq 0x14(%rsp), %rcx
movss %xmm0, (%rcx)
movss 0x18(%r15), %xmm0
leaq 0x10(%rsp), %r8
movss %xmm0, (%r8)
movss 0x10(%r15), %xmm0
leaq 0x4c(%rsp), %r9
movss %xmm0, (%r9)
movq %r14, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x727c
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x72ad
leaq 0x78(%rsp), %r13
leaq 0x38(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x7b8a
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x7426
movss 0x8(%r15), %xmm0
movss %xmm0, -0x8(%r12)
movss 0x14(%r15), %xmm0
leaq 0x1c(%rsp), %rdx
movss %xmm0, (%rdx)
movss 0x10(%r15), %xmm0
leaq 0x18(%rsp), %rcx
movss %xmm0, (%rcx)
movss 0x1c(%r15), %xmm0
leaq 0x14(%rsp), %r8
movss %xmm0, (%r8)
movss 0x18(%r15), %xmm0
leaq 0x10(%rsp), %r9
movss %xmm0, (%r9)
movq %r14, (%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x72cb
leaq 0x78(%rsp), %r13
leaq 0x38(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x7b8a
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
movss 0x8(%r15), %xmm0
leaq 0x1c(%rsp), %rsi
movss %xmm0, (%rsi)
movss 0x14(%r15), %xmm0
leaq 0x18(%rsp), %rdx
movss %xmm0, (%rdx)
movss 0x10(%r15), %xmm0
leaq 0x14(%rsp), %rcx
movss %xmm0, (%rcx)
movss 0x1c(%r15), %xmm0
leaq 0x10(%rsp), %r8
movss %xmm0, (%r8)
movss 0xc(%r15), %xmm0
leaq 0x4c(%rsp), %r9
movss %xmm0, (%r9)
movq %r14, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x72cb
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x72fc
leaq 0x78(%rsp), %r13
leaq 0x38(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x7b8a
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
leaq 0x28(%rsp), %r12
movq %r12, %rdi
callq 0x7426
movss 0xc(%r15), %xmm0
movss %xmm0, -0x8(%r12)
movss 0x18(%r15), %xmm0
leaq 0x1c(%rsp), %rdx
movss %xmm0, (%rdx)
movss 0x10(%r15), %xmm0
leaq 0x18(%rsp), %rcx
movss %xmm0, (%rcx)
movss 0x1c(%r15), %xmm0
leaq 0x14(%rsp), %r8
movss %xmm0, (%r8)
movss 0x14(%r15), %xmm0
leaq 0x10(%rsp), %r9
movss %xmm0, (%r9)
movq %r14, (%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x731a
leaq 0x78(%rsp), %r13
leaq 0x38(%rsp), %r12
movaps -0x8(%r12), %xmm0
movaps %xmm0, -0x8(%r13)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r12)
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x7b8a
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
movss 0xc(%r15), %xmm0
leaq 0x1c(%rsp), %rsi
movss %xmm0, (%rsi)
movss 0x18(%r15), %xmm0
leaq 0x18(%rsp), %rdx
movss %xmm0, (%rdx)
movss 0x10(%r15), %xmm0
leaq 0x14(%rsp), %rcx
movss %xmm0, (%rcx)
movss 0x1c(%r15), %xmm0
leaq 0x10(%rsp), %r8
movss %xmm0, (%r8)
movss 0x8(%r15), %xmm0
leaq 0x4c(%rsp), %r9
movss %xmm0, (%r9)
movq %r14, (%rsp)
leaq 0x20(%rsp), %rdi
callq 0x731a
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x734b
leaq 0x78(%rsp), %r12
leaq 0x38(%rsp), %r15
movaps -0x8(%r15), %xmm0
movaps %xmm0, -0x8(%r12)
xorps %xmm0, %xmm0
movaps %xmm0, -0x8(%r15)
leaq 0x50(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x7b8a
movq %r12, %rdi
callq 0x7426
movq %r15, %rdi
callq 0x7426
leaq 0x28(%rsp), %rdi
callq 0x7426
leaq 0x70(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x736a
leaq 0x70(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x73c2
movq %r14, %rdi
callq 0x73ec
leaq 0x50(%rsp), %rdi
callq 0x7404
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x717e
movq %rax, %r14
movq %r12, %rdi
callq 0x7426
movq %r15, %rdi
jmp 0x7154
jmp 0x715b
jmp 0x717e
jmp 0x7167
jmp 0x717e
jmp 0x7146
jmp 0x715b
jmp 0x717e
jmp 0x7167
jmp 0x717e
movq %rax, %r14
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
jmp 0x715e
movq %rax, %r14
leaq 0x28(%rsp), %rdi
jmp 0x7175
jmp 0x717e
movq %rax, %r14
movq %r13, %rdi
callq 0x7426
movq %r12, %rdi
callq 0x7426
jmp 0x7181
jmp 0x717e
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x7404
movq %rbx, %rdi
callq 0x73ec
movq %r14, %rdi
callq 0x6710
nop