// File: /workspace/github_cpp_makefile_star2_O3/alan0201tw[P]RayTracer/src/util.cpp
// Function: triangle_test()
std::shared_ptr<hitable> triangle_test()
{
    std::vector<std::shared_ptr<hitable>> list;
    list.reserve(3000);

    std::shared_ptr<texture> red_texture = std::make_shared<constant_texture>(vec3(0.65f, 0.05f, 0.05f));
    std::shared_ptr<texture> white_texture = std::make_shared<constant_texture>(vec3(0.73f, 0.73f, 0.73f));
    std::shared_ptr<texture> white1_texture = std::make_shared<constant_texture>(vec3(1.0f, 1.0f, 1.0f));
    std::shared_ptr<texture> green_texture = std::make_shared<constant_texture>(vec3(0.12f, 0.45f, 0.15f));
    std::shared_ptr<texture> light_texture = std::make_shared<constant_texture>(vec3(15.0f, 15.0f, 15.0f));

    auto red_material = std::make_shared<lambertian>(red_texture);
    auto white_material = std::make_shared<lambertian>(white_texture);
    //auto metal_material = std::make_shared<metal>(vec3(1,1,1), 0.0f);
    // auto bunny_material = std::make_shared<lambertian>(white1_texture);
    auto bunny_material = std::make_shared<metal>(vec3(1,1,1), 0.0f);
    auto green_material = std::make_shared<lambertian>(green_texture);
    auto light = std::make_shared<diffuse_light>(light_texture);

    list.push_back(std::make_shared<flip_normals>(std::make_shared<yz_rect>(0, 555, 0, 555, 555, green_material)));
    list.push_back(std::make_shared<yz_rect>(0, 555, 0, 555, 0, red_material));
    list.push_back(std::make_shared<xz_rect>(213, 343, 227, 332, 554, light));
    list.push_back(std::make_shared<flip_normals>(std::make_shared<xz_rect>(0, 555, 0, 555, 555, white_material)));
    list.push_back(std::make_shared<xz_rect>(0, 555, 0, 555, 0, white_material));
    list.push_back(std::make_shared<flip_normals>(std::make_shared<xy_rect>(0, 555, 0, 555, 555, white_material)));

    tinyobj::attrib_t attrib;
    std::vector<tinyobj::shape_t> shapes;
    std::vector<tinyobj::material_t> materials;
    std::string warn;
    std::string err;

    tinyobj::LoadObj(&attrib, &shapes, &materials, &warn, &err, "./resources/bunny_full.obj");
    if (!warn.empty())
    {
        std::cout << warn << std::endl;
    }
    if (!err.empty())
    {
        std::cerr << err << std::endl;
    }

    std::vector<std::shared_ptr<hitable>> bunny_list;
    // Loop over shapes
    for (size_t s = 0; s < shapes.size(); s++)
    {
        // Loop over faces(polygon)
        size_t index_offset = 0;
        for (size_t f = 0; f < shapes[s].mesh.num_face_vertices.size(); f++)
        {
            size_t fv = shapes[s].mesh.num_face_vertices[f];

            vec3 vertices[3];
            // Loop over vertices in the face.
            for (size_t v = 0; v < fv; v++)
            {
                // access to vertex
                tinyobj::index_t idx = shapes[s].mesh.indices[index_offset + v];
                tinyobj::real_t vx = attrib.vertices[3 * idx.vertex_index+0];
                tinyobj::real_t vy = attrib.vertices[3 * idx.vertex_index+1];
                tinyobj::real_t vz = attrib.vertices[3 * idx.vertex_index+2];
                // tinyobj::real_t nx = attrib.normals[3*idx.normal_index+0];
                // tinyobj::real_t ny = attrib.normals[3*idx.normal_index+1];
                // tinyobj::real_t nz = attrib.normals[3*idx.normal_index+2];
                // tinyobj::real_t tx = attrib.texcoords[2*idx.texcoord_index+0];
                // tinyobj::real_t ty = attrib.texcoords[2*idx.texcoord_index+1];
                vertices[v] = vec3(vx, vy, vz) * 150.0f;
            }
            
            bunny_list.push_back(std::make_shared<triangle>(
                vertices[0], vertices[1], vertices[2], bunny_material));

            index_offset += fv;

            // per-face material
            shapes[s].mesh.material_ids[f];
        }
    }

    //list.push_back(std::make_shared<bvh_node>(bunny_list, 0, 1));
    list.push_back( std::make_shared<translate>(
        std::make_shared<rotate_y>( 
            std::make_shared<bvh_node>(bunny_list, 0, 1),     
        180.0f ), vec3(235, 10, 278)
        ));

    // list.push_back(std::make_shared<xz_rect>(213, 343, 227, 332, 554, light));
    //list.push_back(std::make_shared<xy_rect>(253, 303, 10, 60, 50, light));
    //list.push_back(std::make_shared<sphere>(vec3(275, 150, 0), 50, light));
    //list.push_back(std::make_shared<sphere>(vec3(275, 50, 0), 30, light));

    // int ns = 100;
    // for(int j = 0; j < ns; j++)
    // {
    //     float tmp_x = 400.0f * drand48() - 100;
    //     float tmp_y = 400.0f * drand48() + 270;
    //     float tmp_z = 400.0f * drand48() + 395;
    //     vec3 random_pos = vec3(tmp_x, tmp_y, tmp_z);
    //     vec3 random_v0v1 = random_in_unit_sphere() * 35.0f;
    //     vec3 random_v0v2 = random_in_unit_sphere() * 35.0f;

    //     list.push_back(std::make_shared<triangle>(
    //         random_pos, random_pos + random_v0v1, random_pos + random_v0v2, white_material));
    // }

    return std::make_shared<bvh_node>(list, 0.0f, 1.0f);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %r12
xorps %xmm0, %xmm0
leaq 0xf0(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0xbb8, %esi            # imm = 0xBB8
callq 0x7616
movl $0x28, %edi
callq 0x63f0
movabsq $0x100000001, %rbx      # imm = 0x100000001
movq %rbx, 0x8(%rax)
leaq 0x3504c(%rip), %r14     # 0x4e458
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x34ccb(%rip), %r15     # 0x4e0e8
addq $0x10, %r15
movq %r15, 0x10(%rax)
movsd 0x231f3(%rip), %xmm0    # 0x3c620
movsd %xmm0, 0x18(%rax)
movl $0x3d4ccccd, 0x20(%rax) # imm = 0x3D4CCCCD
movq %rcx, 0x228(%rsp)
movq %rax, 0x230(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, 0x10(%rax)
movsd 0x231c3(%rip), %xmm0    # 0x3c630
movsd %xmm0, 0x18(%rax)
movl $0x3f3ae148, 0x20(%rax) # imm = 0x3F3AE148
movq %rcx, 0x218(%rsp)
movq %rax, 0x220(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %rax, %r13
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %r15, 0x10(%rax)
movsd 0x23077(%rip), %xmm0    # 0x3c520
movsd %xmm0, 0x18(%rax)
movl $0x3f800000, 0x20(%rax) # imm = 0x3F800000
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x238(%rsp)
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, 0x10(%rax)
movsd 0x2315f(%rip), %xmm0    # 0x3c640
movsd %xmm0, 0x18(%rax)
movl $0x3e19999a, 0x20(%rax) # imm = 0x3E19999A
movq %rcx, 0x208(%rsp)
movq %rax, 0x210(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, 0x10(%rax)
movsd 0x2312f(%rip), %xmm0    # 0x3c650
movsd %xmm0, 0x18(%rax)
movl $0x41700000, 0x20(%rax) # imm = 0x41700000
movq %rcx, 0x1f8(%rsp)
movq %rax, 0x200(%rsp)
leaq 0x280(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x278(%rsp), %r12
leaq 0x140(%rsp), %rdx
leaq 0x228(%rsp), %rcx
movq %r12, %rsi
callq 0x20b4e
leaq 0x1f0(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x1e8(%rsp), %rsi
leaq 0x140(%rsp), %rdx
leaq 0x218(%rsp), %rcx
callq 0x20b4e
movl $0x28, %edi
callq 0x63f0
movq %r13, 0x8(%rsp)
movq %rbx, 0x8(%rax)
leaq 0x35084(%rip), %rcx     # 0x4e638
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x35443(%rip), %rdx     # 0x4ea08
addq $0x10, %rdx
movq %rdx, 0x10(%rax)
movaps 0x2317c(%rip), %xmm0    # 0x3c750
movups %xmm0, 0x18(%rax)
movq %rax, 0x1e0(%rsp)
movq %rcx, 0x1d8(%rsp)
leaq 0x270(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x268(%rsp), %rbx
leaq 0x140(%rsp), %rdx
leaq 0x208(%rsp), %rcx
movq %rbx, %rsi
callq 0x20b4e
leaq 0x260(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x258(%rsp), %r13
leaq 0x140(%rsp), %rdx
leaq 0x1f8(%rsp), %rcx
movq %r13, %rsi
callq 0x21348
xorl %eax, %eax
leaq 0xd0(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0x90(%rsp), %r8
movl %edx, (%r8)
leaq 0x120(%rsp), %rbp
movl %eax, (%rbp)
leaq 0xb0(%rsp), %r15
movl %edx, (%r15)
leaq 0x50(%rsp), %rax
movl %edx, (%rax)
leaq 0x70(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbp, %r9
pushq %rbx
pushq %rax
pushq %r15
callq 0x21afe
addq $0x20, %rsp
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x68(%rsp), %rcx
callq 0x8306
movaps 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7c1c
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x19704
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x19713
callq 0x7774
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19722
callq 0x7774
xorl %eax, %eax
leaq 0x68(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0xd0(%rsp), %r8
movl %edx, (%r8)
leaq 0x90(%rsp), %r9
movl %eax, (%r9)
movl %edx, 0x120(%rsp)
movl %eax, 0xb0(%rsp)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %rdx
pushq %r12
pushq %r15
pushq %rbp
callq 0x21afe
addq $0x20, %rsp
movaps 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7c1c
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x197b4
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x197c3
callq 0x7774
leaq 0x68(%rsp), %rcx
movl $0xd5, (%rcx)
leaq 0xd0(%rsp), %r8
movl $0x157, (%r8)           # imm = 0x157
leaq 0x90(%rsp), %r9
movl $0xe3, (%r9)
movl $0x14c, 0x120(%rsp) # imm = 0x14C
movl $0x22a, 0xb0(%rsp) # imm = 0x22A
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %r14
movq %r14, %rdx
pushq %r13
pushq %r15
pushq %rbp
callq 0x21c4c
addq $0x20, %rsp
movaps 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7c1c
leaq 0x1e8(%rsp), %r12
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1986d
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1987c
callq 0x7774
xorl %eax, %eax
leaq 0xd0(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0x90(%rsp), %r8
movl %edx, (%r8)
leaq 0x120(%rsp), %rbx
movl %eax, (%rbx)
movl %edx, 0xb0(%rsp)
movl %edx, 0x50(%rsp)
leaq 0x70(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %r9
pushq %r12
pushq %r14
pushq %r15
callq 0x21d9a
addq $0x20, %rsp
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x68(%rsp), %rcx
callq 0x8098
movaps 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7c1c
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x19932
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x19941
callq 0x7774
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19950
callq 0x7774
xorl %eax, %eax
leaq 0x68(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0xd0(%rsp), %r8
movl %edx, (%r8)
leaq 0x90(%rsp), %r9
movl %eax, (%r9)
movl %edx, 0x120(%rsp)
movl %eax, 0xb0(%rsp)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %r14
movq %r14, %rdx
pushq %r12
pushq %r15
pushq %rbx
callq 0x21d9a
addq $0x20, %rsp
movaps 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7c1c
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x199e5
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x199f4
callq 0x7774
xorl %eax, %eax
leaq 0xd0(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0x90(%rsp), %r8
movl %edx, (%r8)
leaq 0x120(%rsp), %r9
movl %eax, (%r9)
movl %edx, 0xb0(%rsp)
movl %edx, 0x50(%rsp)
leaq 0x70(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x70(%rsp), %rsi
leaq 0x48(%rsp), %rdx
pushq %r12
pushq %r14
pushq %r15
callq 0x21ee8
addq $0x20, %rsp
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x68(%rsp), %rcx
callq 0x7db6
movaps 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7c1c
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x19aa8
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x19ab7
callq 0x7774
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19ac6
callq 0x7774
leaq 0x140(%rsp), %rbx
xorl %r14d, %r14d
movl $0x90, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6210
leaq 0x90(%rsp), %rsi
movq %r14, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0x120(%rsp), %rdx
movq %r14, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
leaq 0xe0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
subq $0x8, %rsp
movl $0x1, %eax
leaq 0x2321d(%rip), %r9      # 0x3cd51
leaq 0x70(%rsp), %rcx
leaq 0xd8(%rsp), %r8
movq %rbx, %rdi
pushq %rax
pushq %rax
pushq %r14
callq 0xf16b
addq $0x20, %rsp
movq 0x70(%rsp), %rdx
testq %rdx, %rdx
je 0x19b96
movq 0x68(%rsp), %rsi
movq 0x35441(%rip), %rdi     # 0x4efa8
callq 0x6470
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x63d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6280
movq 0xd8(%rsp), %rdx
testq %rdx, %rdx
je 0x19be1
movq 0xd0(%rsp), %rsi
movq 0x3542e(%rip), %rdi     # 0x4efe0
callq 0x6470
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x63d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x6040
movq %rax, %rdi
callq 0x6280
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movq $0x0, 0xc0(%rsp)
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
cmpq %rax, %rcx
je 0x19d9c
movq 0x140(%rsp), %r13
xorl %esi, %esi
leaq 0x50(%rsp), %r12
movaps 0x22b39(%rip), %xmm2    # 0x3c760
movss 0x228c1(%rip), %xmm3    # 0x3c4f0
imulq $0xe0, %rsi, %rbp
movq 0x38(%rax,%rbp), %rdx
cmpq %rdx, 0x40(%rax,%rbp)
je 0x19d78
movq %rsi, 0x240(%rsp)
xorl %r14d, %r14d
xorl %ebx, %ebx
movzbl (%rdx,%rbx), %r15d
testq %r15, %r15
je 0x19cb5
addq %rbp, %rax
addq $0x20, %rax
leal (,%r15,4), %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (,%r14,4), %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movq (%rax), %rdi
addq %rdx, %rdi
movslq (%rsi,%rdi), %rdi
leaq (%rdi,%rdi,2), %rdi
movsd (%r13,%rdi,4), %xmm0
mulps %xmm2, %xmm0
movss 0x8(%r13,%rdi,4), %xmm1
mulss %xmm3, %xmm1
movlps %xmm0, 0x10(%rsp,%rsi)
movss %xmm1, 0x18(%rsp,%rsi)
addq $0xc, %rsi
cmpq %rsi, %rcx
jne 0x19c7e
movq $0x0, 0x40(%rsp)
subq $0x8, %rsp
leaq 0x50(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0x118(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x24(%rsp), %r8
leaq 0x30(%rsp), %r9
leaq 0x1e0(%rsp), %rax
pushq %rax
callq 0x23086
addq $0x10, %rsp
movaps 0x40(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
leaq 0xb0(%rsp), %rdi
movq %r12, %rsi
callq 0x7c1c
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x19d26
callq 0x7774
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x19d35
callq 0x7774
addq %r15, %r14
incq %rbx
movq 0x90(%rsp), %rax
movq 0x38(%rax,%rbp), %rdx
movq 0x40(%rax,%rbp), %rcx
subq %rdx, %rcx
cmpq %rcx, %rbx
movaps 0x22a06(%rip), %xmm2    # 0x3c760
movss 0x2278e(%rip), %xmm3    # 0x3c4f0
jb 0x19c53
movq 0x98(%rsp), %rcx
movq 0x240(%rsp), %rsi
incq %rsi
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
movabsq $0x6db6db6db6db6db7, %rdi # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdi, %rdx
cmpq %rdx, %rsi
jb 0x19c2f
leaq 0x294(%rsp), %r8
movl $0x0, (%r8)
leaq 0x290(%rsp), %r9
movl $0x1, (%r9)
leaq 0x118(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x110(%rsp), %rsi
leaq 0x248(%rsp), %rdx
leaq 0xb0(%rsp), %rcx
callq 0x23208
leaq 0x28c(%rsp), %r8
movl $0x43340000, (%r8)      # imm = 0x43340000
leaq 0x48(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x40(%rsp), %rsi
leaq 0x248(%rsp), %rdx
leaq 0x110(%rsp), %rcx
movq 0x8(%rsp), %r13
callq 0x22fb0
movq 0x238(%rsp), %rbx
movsd 0x2293e(%rip), %xmm0    # 0x3c770
leaq 0x248(%rsp), %r8
movsd %xmm0, (%r8)
movl $0x438b0000, 0x8(%r8)   # imm = 0x438B0000
leaq 0x58(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x50(%rsp), %rsi
leaq 0x8f(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x22304
movaps 0x50(%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x7c1c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x19e9c
callq 0x7774
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x19eab
callq 0x7774
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x19eba
callq 0x7774
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x19ecc
callq 0x7774
leaq 0x50(%rsp), %r8
movl $0x0, (%r8)
leaq 0x40(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x110(%rsp), %rdx
leaq 0xf0(%rsp), %rcx
callq 0x2169c
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rbx)
leaq 0xb0(%rsp), %rdi
callq 0x7726
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x19f45
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x19f61
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0x120(%rsp), %rdi
callq 0x1b1d0
leaq 0x90(%rsp), %rdi
callq 0x1b2a6
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0x19f98
movq 0x1c8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x19fb5
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x19fd2
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x19fef
movq 0x180(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0x1a00c
movq 0x168(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x1a029
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x260(%rsp), %rdi
testq %rdi, %rdi
je 0x1a03b
callq 0x7774
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x1a04d
callq 0x7774
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a05f
callq 0x7774
movq 0x1f0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a071
callq 0x7774
movq 0x280(%rsp), %rdi
testq %rdi, %rdi
je 0x1a083
callq 0x7774
movq 0x200(%rsp), %rdi
testq %rdi, %rdi
je 0x1a095
callq 0x7774
movq 0x210(%rsp), %rdi
testq %rdi, %rdi
je 0x1a0a7
callq 0x7774
movq %r13, %rdi
callq 0x7774
movq 0x220(%rsp), %rdi
testq %rdi, %rdi
je 0x1a0c1
callq 0x7774
movq 0x230(%rsp), %rdi
testq %rdi, %rdi
je 0x1a0d3
callq 0x7774
leaq 0xf0(%rsp), %rdi
callq 0x7726
movq %rbx, %rax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x1a303
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a10f
callq 0x7774
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1a123
callq 0x7774
jmp 0x1a123
movq %rax, %r14
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x1a137
callq 0x7774
jmp 0x1a137
movq %rax, %r14
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2fe
callq 0x7774
jmp 0x1a2fe
jmp 0x1a2fb
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a16c
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a180
callq 0x7774
jmp 0x1a180
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a286
jmp 0x1a27c
jmp 0x1a283
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a1ad
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a286
jmp 0x1a27c
jmp 0x1a283
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a1da
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a1ee
callq 0x7774
jmp 0x1a1ee
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a286
jmp 0x1a27c
jmp 0x1a283
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a218
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a286
jmp 0x1a27c
jmp 0x1a283
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a23b
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a286
jmp 0x1a27c
jmp 0x1a283
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a25e
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a272
callq 0x7774
jmp 0x1a272
movq %rax, %r14
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x1a286
callq 0x7774
jmp 0x1a286
movq %rax, %r14
movq 0x8(%rsp), %r13
jmp 0x1a446
movq %rax, %r14
movq 0x8(%rsp), %r13
jmp 0x1a458
movq %rax, %r14
movq 0x8(%rsp), %r13
jmp 0x1a46a
movq %rax, %r14
jmp 0x1a47c
movq %rax, %r14
jmp 0x1a48e
movq %rax, %r14
jmp 0x1a4a0
movq %rax, %r14
jmp 0x1a4b2
movq %rax, %r14
jmp 0x1a4c4
movq %rax, %r14
jmp 0x1a4cc
movq %rax, %r14
jmp 0x1a4de
jmp 0x1a2e4
movq %rax, %r14
jmp 0x1a4f0
movq %rax, %r14
movq 0x8(%rsp), %r13
leaq 0x78(%rsp), %rbx
jmp 0x1a342
movq %rax, %r14
movq 0x8(%rsp), %r13
leaq 0x78(%rsp), %rbx
jmp 0x1a335
movq %rax, %r14
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x1a31c
callq 0x7774
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %r13
leaq 0x78(%rsp), %rbx
je 0x1a335
callq 0x7774
leaq 0xb0(%rsp), %rdi
callq 0x7726
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x1a367
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1a37e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0x120(%rsp), %rdi
callq 0x1b1d0
leaq 0x90(%rsp), %rdi
callq 0x1b2a6
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3b5
movq 0x1c8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3d2
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3ef
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x1a40c
movq 0x180(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0x1a429
movq 0x168(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x1a446
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x260(%rsp), %rdi
testq %rdi, %rdi
je 0x1a458
callq 0x7774
movq 0x270(%rsp), %rdi
testq %rdi, %rdi
je 0x1a46a
callq 0x7774
movq 0x1e0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a47c
callq 0x7774
movq 0x1f0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a48e
callq 0x7774
movq 0x280(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4a0
callq 0x7774
movq 0x200(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4b2
callq 0x7774
movq 0x210(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4c4
callq 0x7774
movq %r13, %rdi
callq 0x7774
movq 0x220(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4de
callq 0x7774
movq 0x230(%rsp), %rdi
testq %rdi, %rdi
je 0x1a4f0
callq 0x7774
leaq 0xf0(%rsp), %rdi
callq 0x7726
movq %r14, %rdi
callq 0x66e0