// File: /workspace/github_cpp_makefile_star2_O1/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 $0x278, %rsp            # imm = 0x278
movq %rdi, %rbp
xorps %xmm0, %xmm0
leaq 0xe0(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movl $0xbb8, %esi            # imm = 0xBB8
callq 0x7602
movl $0x28, %edi
callq 0x63f0
movabsq $0x100000001, %rbx      # imm = 0x100000001
movq %rbx, 0x8(%rax)
leaq 0x34764(%rip), %r14     # 0x4e470
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x343e3(%rip), %r15     # 0x4e100
addq $0x10, %r15
movq %r15, 0x10(%rax)
movsd 0x22803(%rip), %xmm0    # 0x3c530
movsd %xmm0, 0x18(%rax)
movl $0x3d4ccccd, 0x20(%rax) # imm = 0x3D4CCCCD
movq %rcx, 0x210(%rsp)
movq %rax, 0x218(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, 0x10(%rax)
movsd 0x227d3(%rip), %xmm0    # 0x3c540
movsd %xmm0, 0x18(%rax)
movl $0x3f3ae148, 0x20(%rax) # imm = 0x3F3AE148
movq %rcx, 0x200(%rsp)
movq %rax, 0x208(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %rax, %r13
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %r15, 0x10(%rax)
movsd 0x22817(%rip), %xmm0    # 0x3c5c0
movsd %xmm0, 0x18(%rax)
movl $0x3f800000, 0x20(%rax) # imm = 0x3F800000
movl $0x28, %edi
callq 0x63f0
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, 0x10(%rax)
movsd 0x22777(%rip), %xmm0    # 0x3c550
movsd %xmm0, 0x18(%rax)
movl $0x3e19999a, 0x20(%rax) # imm = 0x3E19999A
movq %rcx, 0x1f0(%rsp)
movq %rax, 0x1f8(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %rbx, 0x8(%rax)
movq %r14, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r15, 0x10(%rax)
movsd 0x22747(%rip), %xmm0    # 0x3c560
movsd %xmm0, 0x18(%rax)
movl $0x41700000, 0x20(%rax) # imm = 0x41700000
movq %rcx, 0x1e0(%rsp)
movq %rax, 0x1e8(%rsp)
leaq 0x258(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x250(%rsp), %r12
leaq 0x140(%rsp), %rdx
leaq 0x210(%rsp), %rcx
movq %r12, %rsi
callq 0x215a2
leaq 0x1d8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x1d0(%rsp), %rsi
leaq 0x140(%rsp), %rdx
leaq 0x200(%rsp), %rcx
callq 0x215a2
movq $0x0, 0x130(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %rbx, 0x8(%rax)
leaq 0x3479d(%rip), %rcx     # 0x4e650
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x34b5c(%rip), %rdx     # 0x4ea20
addq $0x10, %rdx
movq %rdx, 0x10(%rax)
movaps 0x226fd(%rip), %xmm0    # 0x3c5d0
movups %xmm0, 0x18(%rax)
movq %rax, 0x138(%rsp)
movq %rcx, 0x130(%rsp)
leaq 0x248(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x240(%rsp), %rbx
leaq 0x140(%rsp), %rdx
leaq 0x1f0(%rsp), %rcx
movq %rbx, %rsi
callq 0x215a2
movq %rbp, 0x220(%rsp)
movq %r13, 0x8(%rsp)
leaq 0x238(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x230(%rsp), %r13
leaq 0x140(%rsp), %rdx
leaq 0x1e0(%rsp), %rcx
movq %r13, %rsi
callq 0x21da8
xorl %eax, %eax
leaq 0xc0(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0x80(%rsp), %r8
movl %edx, (%r8)
leaq 0x110(%rsp), %rbp
movl %eax, (%rbp)
leaq 0xa0(%rsp), %r15
movl %edx, (%r15)
leaq 0x48(%rsp), %rax
movl %edx, (%rax)
leaq 0x60(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %rbp, %r9
pushq %rbx
pushq %rax
pushq %r15
callq 0x2252c
addq $0x20, %rsp
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x8316
movups 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x7c02
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a010
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a01f
callq 0x7768
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1a02e
callq 0x7768
xorl %eax, %eax
leaq 0x58(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0xc0(%rsp), %r8
movl %edx, (%r8)
leaq 0x80(%rsp), %r9
movl %eax, (%r9)
movl %edx, 0x110(%rsp)
movl %eax, 0xa0(%rsp)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x18(%rsp), %rsi
leaq 0x50(%rsp), %rdx
pushq %r12
pushq %r15
pushq %rbp
callq 0x2252c
addq $0x20, %rsp
movups 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x7c02
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a0c0
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a0cf
callq 0x7768
leaq 0x58(%rsp), %rcx
movl $0xd5, (%rcx)
leaq 0xc0(%rsp), %r8
movl $0x157, (%r8)           # imm = 0x157
leaq 0x80(%rsp), %r9
movl $0xe3, (%r9)
movl $0x14c, 0x110(%rsp) # imm = 0x14C
movl $0x22a, 0xa0(%rsp) # imm = 0x22A
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x18(%rsp), %rsi
leaq 0x50(%rsp), %r14
movq %r14, %rdx
pushq %r13
pushq %r15
pushq %rbp
callq 0x22662
addq $0x20, %rsp
movups 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x7c02
leaq 0x1d0(%rsp), %r12
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a179
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a188
callq 0x7768
xorl %eax, %eax
leaq 0xc0(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0x80(%rsp), %r8
movl %edx, (%r8)
leaq 0x110(%rsp), %rbx
movl %eax, (%rbx)
movl %edx, 0xa0(%rsp)
movl %edx, 0x48(%rsp)
leaq 0x60(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
movq %rbx, %r9
pushq %r12
pushq %r14
pushq %r15
callq 0x22798
addq $0x20, %rsp
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x80a0
movups 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x7c02
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a23e
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a24d
callq 0x7768
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1a25c
callq 0x7768
xorl %eax, %eax
leaq 0x58(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0xc0(%rsp), %r8
movl %edx, (%r8)
leaq 0x80(%rsp), %r9
movl %eax, (%r9)
movl %edx, 0x110(%rsp)
movl %eax, 0xa0(%rsp)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x18(%rsp), %rsi
leaq 0x50(%rsp), %r14
movq %r14, %rdx
pushq %r12
pushq %r15
pushq %rbx
callq 0x22798
addq $0x20, %rsp
movups 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x7c02
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a2f1
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a300
callq 0x7768
xorl %eax, %eax
leaq 0xc0(%rsp), %rcx
movl %eax, (%rcx)
movl $0x22b, %edx            # imm = 0x22B
leaq 0x80(%rsp), %r8
movl %edx, (%r8)
leaq 0x110(%rsp), %r9
movl %eax, (%r9)
movl %edx, 0xa0(%rsp)
movl %edx, 0x48(%rsp)
leaq 0x60(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
pushq %r12
pushq %r14
pushq %r15
callq 0x228ce
addq $0x20, %rsp
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x38(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x7db0
movups 0x10(%rsp), %xmm0
leaq 0x140(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x7c02
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3b4
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3c3
callq 0x7768
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1a3d2
callq 0x7768
leaq 0x140(%rsp), %rbx
xorl %r14d, %r14d
movl $0x90, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6210
leaq 0x80(%rsp), %rsi
movq %r14, 0x10(%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq 0x110(%rsp), %rdx
movq %r14, 0x10(%rdx)
movaps %xmm0, (%rdx)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
leaq 0xd0(%rsp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
subq $0x8, %rsp
movl $0x1, %eax
leaq 0x22786(%rip), %r9      # 0x3cbc6
leaq 0x60(%rsp), %rcx
leaq 0xc8(%rsp), %r8
movq %rbx, %rdi
pushq %rax
pushq %rax
pushq %r14
callq 0xf4cd
addq $0x20, %rsp
movq 0x60(%rsp), %rdx
testq %rdx, %rdx
je 0x1a4a2
movq 0x58(%rsp), %rsi
movq 0x34b35(%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 0xc8(%rsp), %rdx
testq %rdx, %rdx
je 0x1a4ed
movq 0xc0(%rsp), %rsi
movq 0x34b22(%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, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
movq 0x88(%rsp), %rax
cmpq 0x80(%rsp), %rax
je 0x1a6b3
movq 0x140(%rsp), %r13
xorl %ecx, %ecx
leaq 0x48(%rsp), %r12
movss 0x21f8b(%rip), %xmm2    # 0x3c4bc
movq 0x80(%rsp), %rax
movq %rcx, 0x228(%rsp)
imulq $0xe0, %rcx, %rbp
movq 0x38(%rax,%rbp), %rcx
cmpq %rcx, 0x40(%rax,%rbp)
je 0x1a67d
xorl %ebx, %ebx
xorl %r14d, %r14d
movzbl (%rcx,%r14), %r15d
testq %r15, %r15
je 0x1a5d1
addq %rbp, %rax
addq $0x20, %rax
leal (,%r15,4), %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (,%rbx,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
movslq %edi, %r8
movss (%r13,%rdi,4), %xmm0
mulss %xmm2, %xmm0
movss 0x4(%r13,%r8,4), %xmm1
mulss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movss 0x8(%r13,%r8,4), %xmm1
mulss %xmm2, %xmm1
movlps %xmm0, 0x10(%rsp,%rsi)
movss %xmm1, 0x18(%rsp,%rsi)
addq $0xc, %rsi
cmpq %rsi, %rcx
jne 0x1a588
movq $0x0, 0x38(%rsp)
subq $0x8, %rsp
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rsi
leaq 0x108(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x24(%rsp), %r8
leaq 0x30(%rsp), %r9
leaq 0x138(%rsp), %rax
pushq %rax
callq 0x23a56
addq $0x10, %rsp
movups 0x38(%rsp), %xmm0
movups %xmm0, 0x48(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rsp)
leaq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x7c02
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1a642
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a651
callq 0x7768
addq %r15, %rbx
incq %r14
movq 0x80(%rsp), %rax
movq 0x38(%rax,%rbp), %rcx
movq 0x40(%rax,%rbp), %rdx
subq %rcx, %rdx
cmpq %rdx, %r14
movss 0x21e45(%rip), %xmm2    # 0x3c4bc
jb 0x1a55d
movq 0x88(%rsp), %rax
subq 0x80(%rsp), %rax
movq 0x228(%rsp), %rcx
incq %rcx
sarq $0x5, %rax
movabsq $0x6db6db6db6db6db7, %rdx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rdx, %rax
cmpq %rax, %rcx
jb 0x1a531
leaq 0x274(%rsp), %r8
movl $0x0, (%r8)
leaq 0x270(%rsp), %r9
movl $0x1, (%r9)
leaq 0x108(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x100(%rsp), %rsi
leaq 0x260(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0x23bde
leaq 0x26c(%rsp), %r8
movl $0x43340000, (%r8)      # imm = 0x43340000
leaq 0x40(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x38(%rsp), %rsi
leaq 0x260(%rsp), %rdx
leaq 0x100(%rsp), %rcx
movq 0x8(%rsp), %r13
callq 0x23974
movq 0x220(%rsp), %rbx
movabsq $0x41200000436b0000, %rax # imm = 0x41200000436B0000
leaq 0x260(%rsp), %r8
movq %rax, (%r8)
movl $0x438b0000, 0x8(%r8)   # imm = 0x438B0000
leaq 0x50(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x48(%rsp), %rsi
leaq 0x7f(%rsp), %rdx
leaq 0x38(%rsp), %rcx
callq 0x22cea
movups 0x48(%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x48(%rsp)
leaq 0xe0(%rsp), %rdi
callq 0x7c02
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7b0
callq 0x7768
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7bf
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7ce
callq 0x7768
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x1a7e0
callq 0x7768
leaq 0x48(%rsp), %r8
movl $0x0, (%r8)
leaq 0x38(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x100(%rsp), %rdx
leaq 0xe0(%rsp), %rcx
callq 0x220f0
movq 0x10(%rsp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq 0x18(%rsp), %rcx
movq %rax, 0x18(%rsp)
movq %rcx, 0x8(%rbx)
leaq 0xa0(%rsp), %rdi
callq 0x7720
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x1a86d
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x1a889
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0x110(%rsp), %rdi
callq 0x1bb3e
leaq 0x80(%rsp), %rdi
callq 0x1bc08
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0x1a8c0
movq 0x1c8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x1a8dd
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x1a8fa
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x1a917
movq 0x180(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0x1a934
movq 0x168(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x1a951
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x238(%rsp), %rdi
testq %rdi, %rdi
je 0x1a963
callq 0x7768
movq 0x248(%rsp), %rdi
testq %rdi, %rdi
je 0x1a975
callq 0x7768
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x1a987
callq 0x7768
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0x1a999
callq 0x7768
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x1a9ab
callq 0x7768
movq 0x1e8(%rsp), %rdi
testq %rdi, %rdi
je 0x1a9bd
callq 0x7768
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x1a9cf
callq 0x7768
movq %r13, %rdi
callq 0x7768
movq 0x208(%rsp), %rdi
testq %rdi, %rdi
je 0x1a9e9
callq 0x7768
movq 0x218(%rsp), %rdi
testq %rdi, %rdi
je 0x1a9fb
callq 0x7768
leaq 0xe0(%rsp), %rdi
callq 0x7720
movq %rbx, %rax
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
jmp 0x1ac26
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1aa37
callq 0x7768
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1aa4b
callq 0x7768
jmp 0x1aa4b
movq %rax, %r14
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1aa5f
callq 0x7768
jmp 0x1aa5f
movq %rax, %r14
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x1ac21
callq 0x7768
jmp 0x1ac21
jmp 0x1ac1e
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1aa94
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1aaa8
callq 0x7768
jmp 0x1aaa8
movq %rax, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1abae
jmp 0x1aba4
jmp 0x1abab
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1aad5
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1abae
jmp 0x1aba4
jmp 0x1abab
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1ab02
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1ab16
callq 0x7768
jmp 0x1ab16
movq %rax, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1abae
jmp 0x1aba4
jmp 0x1abab
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1ab40
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1abae
jmp 0x1aba4
jmp 0x1abab
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1ab63
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1abae
jmp 0x1aba4
jmp 0x1abab
movq %rax, %r14
movq 0x148(%rsp), %rdi
testq %rdi, %rdi
je 0x1ab86
callq 0x7768
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1ab9a
callq 0x7768
jmp 0x1ab9a
movq %rax, %r14
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x1abae
callq 0x7768
jmp 0x1abae
movq %rax, %r14
movq 0x8(%rsp), %r13
jmp 0x1ad69
movq %rax, %r14
movq 0x8(%rsp), %r13
jmp 0x1ad7b
movq %rax, %r14
jmp 0x1ad8d
movq %rax, %r14
jmp 0x1ad9f
movq %rax, %r14
jmp 0x1adb1
movq %rax, %r14
jmp 0x1adc3
movq %rax, %r14
jmp 0x1add5
movq %rax, %r14
jmp 0x1ade7
movq %rax, %r14
jmp 0x1adef
movq %rax, %r14
jmp 0x1ae01
jmp 0x1ac07
movq %rax, %r14
jmp 0x1ae13
movq %rax, %r14
movq 0x8(%rsp), %r13
leaq 0x68(%rsp), %rbx
jmp 0x1ac65
movq %rax, %r14
movq 0x8(%rsp), %r13
leaq 0x68(%rsp), %rbx
jmp 0x1ac58
movq %rax, %r14
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1ac3f
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
movq 0x8(%rsp), %r13
leaq 0x68(%rsp), %rbx
je 0x1ac58
callq 0x7768
leaq 0xa0(%rsp), %rdi
callq 0x7720
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x1ac8a
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x6400
movq 0x58(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1aca1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x6400
leaq 0x110(%rsp), %rdi
callq 0x1bb3e
leaq 0x80(%rsp), %rdi
callq 0x1bc08
movq 0x1b8(%rsp), %rdi
testq %rdi, %rdi
je 0x1acd8
movq 0x1c8(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x1a0(%rsp), %rdi
testq %rdi, %rdi
je 0x1acf5
movq 0x1b0(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x188(%rsp), %rdi
testq %rdi, %rdi
je 0x1ad12
movq 0x198(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x170(%rsp), %rdi
testq %rdi, %rdi
je 0x1ad2f
movq 0x180(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x158(%rsp), %rdi
testq %rdi, %rdi
je 0x1ad4c
movq 0x168(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x1ad69
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x6400
movq 0x238(%rsp), %rdi
testq %rdi, %rdi
je 0x1ad7b
callq 0x7768
movq 0x248(%rsp), %rdi
testq %rdi, %rdi
je 0x1ad8d
callq 0x7768
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x1ad9f
callq 0x7768
movq 0x1d8(%rsp), %rdi
testq %rdi, %rdi
je 0x1adb1
callq 0x7768
movq 0x258(%rsp), %rdi
testq %rdi, %rdi
je 0x1adc3
callq 0x7768
movq 0x1e8(%rsp), %rdi
testq %rdi, %rdi
je 0x1add5
callq 0x7768
movq 0x1f8(%rsp), %rdi
testq %rdi, %rdi
je 0x1ade7
callq 0x7768
movq %r13, %rdi
callq 0x7768
movq 0x208(%rsp), %rdi
testq %rdi, %rdi
je 0x1ae01
callq 0x7768
movq 0x218(%rsp), %rdi
testq %rdi, %rdi
je 0x1ae13
callq 0x7768
leaq 0xe0(%rsp), %rdi
callq 0x7720
movq %r14, %rdi
callq 0x66e0