// File: /workspace/github_cpp_makefile_star2_O1/alan0201tw[P]RayTracer/src/util.cpp
// Function: next_week_final()
std::shared_ptr<hitable> next_week_final()
{
    int nb = 20;
    std::vector<std::shared_ptr<hitable>> list;
    std::vector<std::shared_ptr<hitable>> box_list;
    std::vector<std::shared_ptr<hitable>> box_list2;

    std::shared_ptr<texture> white_texture = std::make_shared<constant_texture>(vec3(0.73f, 0.73f, 0.73f));
    std::shared_ptr<texture> ground_texture = std::make_shared<constant_texture>(vec3(0.48f, 0.83f, 0.53f));
    auto white_material = std::make_shared<lambertian>(white_texture);
    auto ground_material = std::make_shared<lambertian>(ground_texture);

    list.reserve(30);
    box_list.reserve(10000);
    box_list2.reserve(10000);

    static const float w = 100;
    for(int i = 0; i < nb; i++)
    {
        for(int j = 0; j < nb; j++)
        {
            float x0 = -1000 + i * w;
            float z0 = -1000 + j * w;
            float y0 = 0;
            float x1 = x0 + w;
            float y1 = 100 * (drand48() + 0.01f);
            float z1 = z0 + w;
            box_list.push_back(std::make_shared<box>(vec3(x0, y0, z0), vec3(x1, y1, z1), ground_material));
        }
    }

    list.push_back( std::make_shared<bvh_node>(box_list, 0.0f, 1.0f) );
    
    std::shared_ptr<texture> light_texture = std::make_shared<constant_texture>(vec3(7.0f, 7.0f, 7.0f));
    auto light = std::make_shared<diffuse_light>(light_texture);

    list.push_back(std::make_shared<xz_rect>(123, 423, 147, 412, 554, light));
    vec3 center(400, 400, 200);
    auto moving_sphere_mat = std::make_shared<lambertian>(std::make_shared<constant_texture>(vec3(0.7, 0.3, 0.1)));
    list.push_back(std::make_shared<moving_sphere>(center, center + vec3(30, 0, 0), 0, 1, 50, moving_sphere_mat));
    
    list.push_back(std::make_shared<sphere>(vec3(260, 150, 45), 50, std::make_shared<dielectric>(1.5f)));
    list.push_back(std::make_shared<sphere>(vec3(0, 150, 145), 50, std::make_shared<metal>(vec3(0.8, 0.8, 0.9), 10.0f)));
    {
        std::shared_ptr<hitable> boundary = std::make_shared<sphere>(vec3(360, 150, 145), 70, std::make_shared<dielectric>(1.5f));
        auto texture1 = std::make_shared<constant_texture>(vec3(0.2, 0.4, 0.9));
        list.push_back(boundary);
        list.push_back(std::make_shared<constant_medium>(boundary, 0.2f, texture1));
    }
    {
        std::shared_ptr<hitable> boundary1 = std::make_shared<sphere>(vec3(0, 0, 0), 5000, std::make_shared<dielectric>(1.5f));
        list.push_back(std::make_shared<constant_medium>(boundary1, 0.0001f, white_texture));
    }

    auto emat = std::make_shared<lambertian>(std::make_shared<image_texture>("./resources/texture.jpg"));
    list.push_back(std::make_shared<sphere>(vec3(400, 200, 400), 100, emat));

    auto perlin_texture = std::make_shared<perlin_noise_texture>(0.1f);
    list.push_back(std::make_shared<sphere>(vec3(220, 280, 300), 80, std::make_shared<lambertian>(perlin_texture)));

    int ns = 1000;
    for(int j = 0; j < ns; j++)
    {
        float tmp_x = 165.0f * drand48();
        float tmp_y = 165.0f * drand48();
        float tmp_z = 165.0f * drand48();
        box_list2.push_back(std::make_shared<sphere>(vec3(tmp_x, tmp_y, tmp_z), 10, white_material));
    }

    list.push_back(std::make_shared<translate>(
        std::make_shared<rotate_y>(
            std::make_shared<bvh_node>(box_list2, 0.0f, 1.0f), 
            15.0f), 
        vec3(-100, 270, 395)));

    return std::make_shared<bvh_node>(list, 0.0f, 1.0f);

    // using BVH, with 1920*1080 image. 10 sample per pixel
    // real    0m49.472s
    // user    4m14.656s
    // sys     0m39.828s

    // without
    // real    5m28.462s
    // user    40m24.922s
    // sys     0m27.766s

    // 3000 spp 1920x1080 benchmark
    // real    274m12.543s
    // user    1075m47.013s
    // sys     0m36.908s
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x188, %rsp            # imm = 0x188
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0xb0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xa0(%rsp)
movq %rax, 0x160(%rsp)
movaps %xmm0, 0x150(%rsp)
movq %rax, 0x140(%rsp)
movaps %xmm0, 0x130(%rsp)
movl $0x28, %edi
callq 0x63f0
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x8(%rax)
leaq 0x35acf(%rip), %r15     # 0x4e470
movq %r15, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x3574e(%rip), %r12     # 0x4e100
addq $0x10, %r12
movq %r12, 0x10(%rax)
movsd 0x23b7e(%rip), %xmm0    # 0x3c540
movsd %xmm0, 0x18(%rax)
movl $0x3f3ae148, 0x20(%rax) # imm = 0x3F3AE148
movq %rcx, 0xf0(%rsp)
movq %rax, 0xf8(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %r14, 0x8(%rax)
movq %r15, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, 0x10(%rax)
movsd 0x23b6e(%rip), %xmm0    # 0x3c570
movsd %xmm0, 0x18(%rax)
movl $0x3f07ae14, 0x20(%rax) # imm = 0x3F07AE14
movq %rcx, 0x120(%rsp)
movq %rax, 0x128(%rsp)
leaq 0x118(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x110(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
leaq 0xf0(%rsp), %rcx
callq 0x215a2
leaq 0xe8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0xe0(%rsp), %rsi
leaq 0xb8(%rsp), %rdx
leaq 0x120(%rsp), %rcx
callq 0x215a2
movq %r12, 0x178(%rsp)
movq %rbx, 0x170(%rsp)
leaq 0xa0(%rsp), %rdi
movl $0x1e, %esi
callq 0x7602
leaq 0x150(%rsp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x7602
leaq 0x130(%rsp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x7602
xorl %eax, %eax
leaq 0x88(%rsp), %r13
leaq 0x38(%rsp), %rbp
leaq 0xe0(%rsp), %rbx
leaq 0x150(%rsp), %r14
leaq 0xb8(%rsp), %r15
movl %eax, 0xd8(%rsp)
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movss 0x239b5(%rip), %xmm0    # 0x3c4b0
mulss %xmm0, %xmm1
addss 0x239ad(%rip), %xmm1    # 0x3c4b4
movss %xmm1, 0x7c(%rsp)
addss %xmm0, %xmm1
movss %xmm1, 0xdc(%rsp)
xorl %r12d, %r12d
xorps %xmm1, %xmm1
cvtsi2ss %r12d, %xmm1
movss 0x23983(%rip), %xmm0    # 0x3c4b0
mulss %xmm0, %xmm1
addss 0x2397b(%rip), %xmm1    # 0x3c4b4
movss %xmm1, 0x80(%rsp)
callq 0x63a0
addsd 0x23ad9(%rip), %xmm0    # 0x3c628
mulsd 0x23ad9(%rip), %xmm0    # 0x3c630
cvtsd2ss %xmm0, %xmm0
movss 0x7c(%rsp), %xmm1
movss %xmm1, 0x88(%rsp)
movl $0x0, 0x8c(%rsp)
movss 0x80(%rsp), %xmm1
movss %xmm1, 0x90(%rsp)
addss 0x23921(%rip), %xmm1    # 0x3c4b0
movaps %xmm1, %xmm2
movss 0xdc(%rsp), %xmm1
movss %xmm1, 0x38(%rsp)
movss %xmm0, 0x3c(%rsp)
movss %xmm2, 0x40(%rsp)
movq $0x0, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
movq %r13, %rcx
movq %rbp, %r8
movq %rbx, %r9
callq 0x22a04
movups 0x68(%rsp), %xmm0
movups %xmm0, 0xb8(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7c02
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x18c05
callq 0x7768
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x18c14
callq 0x7768
incl %r12d
cmpl $0x14, %r12d
jne 0x18b1d
movl 0xd8(%rsp), %eax
incl %eax
cmpl $0x14, %eax
jne 0x18ae5
leaq 0x88(%rsp), %r8
movl $0x0, (%r8)
leaq 0x38(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x70(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x68(%rsp), %rsi
leaq 0x8(%rsp), %rdx
leaq 0x150(%rsp), %rcx
callq 0x220f0
movups 0x68(%rsp), %xmm0
leaq 0xb8(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movabsq $0x100000001, %r12      # imm = 0x100000001
leaq 0x357c8(%rip), %r13     # 0x4e470
movq 0x178(%rsp), %rbp
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x18cc2
callq 0x7768
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x18cd1
callq 0x7768
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
movq %rbp, 0x10(%rax)
movsd 0x2388b(%rip), %xmm0    # 0x3c580
movsd %xmm0, 0x18(%rax)
movl $0x40e00000, 0x20(%rax) # imm = 0x40E00000
leaq 0xb8(%rsp), %rcx
movq %rdx, (%rcx)
movq %rax, 0x8(%rcx)
leaq 0x70(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x68(%rsp), %rbx
leaq 0x88(%rsp), %rdx
movq %rbx, %rsi
callq 0x21da8
leaq 0x8(%rsp), %rcx
movl $0x7b, (%rcx)
leaq 0x18(%rsp), %r8
movl $0x1a7, (%r8)           # imm = 0x1A7
leaq 0x28(%rsp), %r9
movl $0x93, (%r9)
leaq 0x48(%rsp), %r14
movl $0x19c, (%r14)          # imm = 0x19C
leaq 0x58(%rsp), %r15
movl $0x22a, (%r15)          # imm = 0x22A
leaq 0x40(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x40(%rsp), %rsi
leaq 0x10c(%rsp), %rdx
pushq %rbx
pushq %r15
pushq %r14
callq 0x22662
addq $0x20, %rsp
movups 0x38(%rsp), %xmm0
leaq 0x88(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x18dd0
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x18ddf
callq 0x7768
movabsq $0x43c8000043c80000, %rax # imm = 0x43C8000043C80000
movq %rax, 0x104(%rsp)
movl $0x43480000, 0x10c(%rsp) # imm = 0x43480000
movq $0x0, 0x38(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
movq %rbp, 0x10(%rax)
movsd 0x23767(%rip), %xmm0    # 0x3c590
movsd %xmm0, 0x18(%rax)
movl $0x3dcccccd, 0x20(%rax) # imm = 0x3DCCCCCD
leaq 0x38(%rsp), %rcx
movq %rax, 0x8(%rcx)
movq %rdx, (%rcx)
leaq 0x90(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x88(%rsp), %rbx
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x23036
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x18e75
callq 0x7768
leaq 0x104(%rsp), %rcx
movss (%rcx), %xmm0
addss 0x2362f(%rip), %xmm0    # 0x3c4b8
xorps %xmm1, %xmm1
movss 0x4(%rcx), %xmm2
addss %xmm1, %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
addss 0x8(%rcx), %xmm1
leaq 0x18(%rsp), %r8
movlps %xmm0, (%r8)
movss %xmm1, 0x8(%r8)
leaq 0x28(%rsp), %r9
movl $0x0, (%r9)
movl $0x1, 0x48(%rsp)
movl $0x32, 0x58(%rsp)
leaq 0x10(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x10(%rsp), %rsi
leaq 0xd4(%rsp), %rdx
pushq %rbx
pushq %r15
pushq %r14
callq 0x230fc
addq $0x20, %rsp
movups 0x8(%rsp), %xmm0
leaq 0x38(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x18f25
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x18f34
callq 0x7768
movabsq $0x4316000043820000, %rax # imm = 0x4316000043820000
movq %rax, 0x28(%rsp)
movl $0x42340000, 0x30(%rsp) # imm = 0x42340000
movl $0x32, 0x48(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x20, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
leaq 0x3572f(%rip), %rbx     # 0x4e6a0
movq %rbx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x35ad6(%rip), %r14     # 0x4ea58
addq $0x10, %r14
movq %r14, 0x10(%rax)
movl $0x3fc00000, 0x18(%rax) # imm = 0x3FC00000
leaq 0x18(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x10(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x48(%rsp), %r8
callq 0x2323c
movups 0x8(%rsp), %xmm0
leaq 0x38(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x18ff4
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19003
callq 0x7768
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19012
callq 0x7768
movabsq $0x4316000000000000, %rax # imm = 0x4316000000000000
movq %rax, 0x28(%rsp)
movl $0x43110000, 0x30(%rsp) # imm = 0x43110000
movl $0x32, 0x48(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
leaq 0x35601(%rip), %rcx     # 0x4e650
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x359c0(%rip), %rdx     # 0x4ea20
addq $0x10, %rdx
movq %rdx, 0x10(%rax)
movaps 0x23531(%rip), %xmm0    # 0x3c5a0
movups %xmm0, 0x18(%rax)
leaq 0x18(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x10(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x48(%rsp), %r8
callq 0x2332e
movups 0x8(%rsp), %xmm0
leaq 0x38(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x190d6
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x190e5
callq 0x7768
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x190f4
callq 0x7768
movabsq $0x4316000043b40000, %rax # imm = 0x4316000043B40000
movq %rax, 0x28(%rsp)
movl $0x43110000, 0x30(%rsp) # imm = 0x43110000
movl $0x46, 0x48(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x20, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %rbx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r14, 0x10(%rax)
movl $0x3fc00000, 0x18(%rax) # imm = 0x3FC00000
leaq 0x18(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x10(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x48(%rsp), %r8
callq 0x2323c
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19192
callq 0x7768
movq $0x0, 0x8(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, 0x10(%rax)
movsd 0x233f1(%rip), %xmm0    # 0x3c5b0
movsd %xmm0, 0x18(%rax)
movl $0x3f666666, 0x20(%rax) # imm = 0x3F666666
movq %rax, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x1bbc8
leaq 0x48(%rsp), %r8
movl $0x3e4ccccd, (%r8)      # imm = 0x3E4CCCCD
leaq 0x30(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x28(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0x8(%rsp), %r9
callq 0x2354c
movups 0x28(%rsp), %xmm0
leaq 0x18(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1924a
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x19259
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19268
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19277
callq 0x7768
xorl %eax, %eax
movq %rax, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
movl $0x1388, 0x48(%rsp)     # imm = 0x1388
movq %rax, 0x18(%rsp)
movl $0x20, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %rbx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r14, 0x10(%rax)
movl $0x3fc00000, 0x18(%rax) # imm = 0x3FC00000
leaq 0x18(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x10(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x48(%rsp), %r8
callq 0x2323c
movups 0x8(%rsp), %xmm0
movups %xmm0, 0x38(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rsp)
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19309
callq 0x7768
leaq 0x28(%rsp), %r8
movl $0x38d1b717, (%r8)      # imm = 0x38D1B717
leaq 0x20(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x18(%rsp), %rsi
leaq 0x48(%rsp), %rdx
leaq 0x38(%rsp), %rcx
leaq 0xf0(%rsp), %r9
callq 0x22e4c
movups 0x18(%rsp), %xmm0
leaq 0x8(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x1936f
callq 0x7768
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1937e
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x1938d
callq 0x7768
leaq 0x10(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x2380d(%rip), %rcx     # 0x3cbae
leaq 0x8(%rsp), %rsi
leaq 0x18(%rsp), %rdx
callq 0x2143e
leaq 0x40(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x38(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x8(%rsp), %rcx
callq 0x2369c
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x193e0
callq 0x7768
movabsq $0x4348000043c80000, %rax # imm = 0x4348000043C80000
leaq 0x28(%rsp), %rcx
movq %rax, (%rcx)
movl $0x43c80000, 0x8(%rcx)  # imm = 0x43C80000
leaq 0x48(%rsp), %r8
movl $0x64, (%r8)
leaq 0x20(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0x38(%rsp), %r9
callq 0x23762
movups 0x18(%rsp), %xmm0
leaq 0x8(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19457
callq 0x7768
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19466
callq 0x7768
movq $0x0, 0x8(%rsp)
movl $0x20, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
leaq 0x352bc(%rip), %rcx     # 0x4e740
movq %rcx, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
leaq 0x34ccb(%rip), %rcx     # 0x4e160
addq $0x10, %rcx
movq %rcx, 0x10(%rax)
movl $0x3dcccccd, 0x18(%rax) # imm = 0x3DCCCCCD
leaq 0x8(%rsp), %rcx
movq %rax, 0x8(%rcx)
movq %rdx, (%rcx)
movabsq $0x438c0000435c0000, %rax # imm = 0x438C0000435C0000
movq %rax, 0x58(%rsp)
movl $0x43960000, 0x60(%rsp) # imm = 0x43960000
movl $0x50, 0xcc(%rsp)
leaq 0x50(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x48(%rsp), %rsi
leaq 0x9c(%rsp), %rdx
callq 0x2388a
leaq 0x30(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x28(%rsp), %rsi
leaq 0x9c(%rsp), %rdx
leaq 0x58(%rsp), %rcx
leaq 0xcc(%rsp), %r8
leaq 0x48(%rsp), %r9
callq 0x21706
movups 0x28(%rsp), %xmm0
leaq 0x18(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19553
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x19562
callq 0x7768
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x19571
callq 0x7768
movl $0x3e8, %r15d           # imm = 0x3E8
leaq 0x48(%rsp), %r12
leaq 0x58(%rsp), %r13
leaq 0x110(%rsp), %rbp
leaq 0x130(%rsp), %rbx
leaq 0x18(%rsp), %r14
callq 0x63a0
movsd 0x23095(%rip), %xmm1    # 0x3c638
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x80(%rsp)
callq 0x63a0
mulsd 0x23077(%rip), %xmm0    # 0x3c638
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x7c(%rsp)
callq 0x63a0
mulsd 0x23060(%rip), %xmm0    # 0x3c638
cvtsd2ss %xmm0, %xmm0
movss 0x80(%rsp), %xmm1
movss %xmm1, 0x48(%rsp)
movss 0x7c(%rsp), %xmm1
movss %xmm1, 0x4c(%rsp)
movss %xmm0, 0x50(%rsp)
movl $0xa, 0x58(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0xcc(%rsp), %rdx
movq %r12, %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x23762
movups 0x28(%rsp), %xmm0
movups %xmm0, 0x18(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7c02
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1965a
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x19669
callq 0x7768
decl %r15d
jne 0x19596
leaq 0x9c(%rsp), %r8
movl $0x0, (%r8)
leaq 0x184(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x60(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x58(%rsp), %rsi
leaq 0xcc(%rsp), %rdx
leaq 0x130(%rsp), %rcx
callq 0x220f0
leaq 0x180(%rsp), %r8
movl $0x41700000, (%r8)      # imm = 0x41700000
leaq 0x50(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x48(%rsp), %rsi
leaq 0xcc(%rsp), %rdx
leaq 0x58(%rsp), %rcx
callq 0x23974
movq 0x170(%rsp), %rbx
movabsq $0x43870000c2c80000, %rax # imm = 0x43870000C2C80000
leaq 0xcc(%rsp), %r8
movq %rax, (%r8)
movl $0x43c58000, 0x8(%r8)   # imm = 0x43C58000
leaq 0x30(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x28(%rsp), %rsi
leaq 0x87(%rsp), %rdx
leaq 0x48(%rsp), %rcx
callq 0x22cea
movups 0x28(%rsp), %xmm0
leaq 0x18(%rsp), %rsi
movups %xmm0, (%rsi)
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c02
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19764
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x19773
callq 0x7768
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x19782
callq 0x7768
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x19791
callq 0x7768
leaq 0x28(%rsp), %r8
movl $0x0, (%r8)
leaq 0x48(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x20(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x18(%rsp), %rsi
leaq 0x58(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0x220f0
movq 0x18(%rsp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq 0x20(%rsp), %rcx
movq %rax, 0x20(%rsp)
movq %rcx, 0x8(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x197f8
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19807
callq 0x7768
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x19819
callq 0x7768
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19828
callq 0x7768
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x1983a
callq 0x7768
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x1984c
callq 0x7768
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x1985e
callq 0x7768
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x19870
callq 0x7768
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x19882
callq 0x7768
leaq 0x130(%rsp), %rdi
callq 0x7720
leaq 0x150(%rsp), %rdi
callq 0x7720
leaq 0xa0(%rsp), %rdi
callq 0x7720
movq %rbx, %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x19ba5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x198d5
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x198e9
callq 0x7768
jmp 0x198e9
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x198fd
callq 0x7768
jmp 0x198fd
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x19bcb
jmp 0x19bc6
jmp 0x19ba5
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19927
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x1993b
callq 0x7768
jmp 0x1993b
movq %rax, %rbx
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x19bcb
jmp 0x19bc6
jmp 0x19ba5
jmp 0x1997a
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19967
callq 0x7768
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19bda
jmp 0x19bd5
movq %rax, %rbx
jmp 0x19bda
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
jmp 0x19af6
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x199af
callq 0x7768
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x199c3
callq 0x7768
jmp 0x199c3
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
jmp 0x19af6
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19a03
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x19a19
callq 0x7768
jmp 0x19a19
jmp 0x19a16
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19a2d
callq 0x7768
jmp 0x19a2d
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
jmp 0x19af6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19a6d
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19a81
callq 0x7768
jmp 0x19a81
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
jmp 0x19af6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19aa8
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19abc
callq 0x7768
jmp 0x19abc
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
jmp 0x19af6
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19ae3
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
jmp 0x19be4
movq %rax, %rbx
jmp 0x19be9
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19bfb
jmp 0x19bf6
jmp 0x19b3e
movq %rax, %rbx
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x19b2b
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19bfb
jmp 0x19bf6
movq %rax, %rbx
jmp 0x19bfb
movq %rax, %rbx
jmp 0x19c0a
jmp 0x19c3f
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x19b68
callq 0x7768
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19c42
jmp 0x19c38
jmp 0x19c3f
movq %rax, %rbx
jmp 0x19c54
movq %rax, %rbx
jmp 0x19c66
movq %rax, %rbx
jmp 0x19c78
movq %rax, %rbx
jmp 0x19c8a
jmp 0x19c3f
movq %rax, %rbx
jmp 0x19bcb
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x19bbc
callq 0x7768
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x19bcb
callq 0x7768
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x19bda
callq 0x7768
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x19be9
callq 0x7768
movq 0x90(%rsp), %rdi
testq %rdi, %rdi
je 0x19bfb
callq 0x7768
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19c0a
callq 0x7768
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x19c42
jmp 0x19c38
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
testq %rdi, %rdi
je 0x19c2e
callq 0x7768
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x19c42
callq 0x7768
jmp 0x19c42
movq %rax, %rbx
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x19c54
callq 0x7768
movq 0x118(%rsp), %rdi
testq %rdi, %rdi
je 0x19c66
callq 0x7768
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x19c78
callq 0x7768
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x19c8a
callq 0x7768
leaq 0x130(%rsp), %rdi
callq 0x7720
leaq 0x150(%rsp), %rdi
callq 0x7720
leaq 0xa0(%rsp), %rdi
callq 0x7720
movq %rbx, %rdi
callq 0x66e0