// File: /workspace/github_cpp_makefile_star2_O3/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 $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0xb0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0xa0(%rsp)
movq %rax, 0x170(%rsp)
movapd %xmm0, 0x160(%rsp)
movq %rax, 0x150(%rsp)
movapd %xmm0, 0x140(%rsp)
movl $0x28, %edi
callq 0x63f0
movabsq $0x100000001, %r14      # imm = 0x100000001
movq %r14, 0x8(%rax)
leaq 0x3634d(%rip), %r15     # 0x4e458
movq %r15, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x35fcc(%rip), %r12     # 0x4e0e8
addq $0x10, %r12
movq %r12, 0x10(%rax)
movsd 0x24504(%rip), %xmm0    # 0x3c630
movsd %xmm0, 0x18(%rax)
movl $0x3f3ae148, 0x20(%rax) # imm = 0x3F3AE148
movq %rcx, 0x100(%rsp)
movq %rax, 0x108(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %r14, 0x8(%rax)
movq %r15, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %r12, 0x10(%rax)
movsd 0x24514(%rip), %xmm0    # 0x3c680
movsd %xmm0, 0x18(%rax)
movl $0x3f07ae14, 0x20(%rax) # imm = 0x3F07AE14
movq %rcx, 0x130(%rsp)
movq %rax, 0x138(%rsp)
leaq 0x128(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x120(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
leaq 0x100(%rsp), %rcx
callq 0x20b4e
leaq 0xf8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0xf0(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
leaq 0x130(%rsp), %rcx
callq 0x20b4e
movq %r12, 0x1a8(%rsp)
movq %rbx, 0x1a0(%rsp)
leaq 0xa0(%rsp), %rdi
movl $0x1e, %esi
callq 0x7616
leaq 0x160(%rsp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x7616
leaq 0x140(%rsp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x7616
xorl %eax, %eax
leaq 0x80(%rsp), %r13
leaq 0x30(%rsp), %rbp
leaq 0xf0(%rsp), %rbx
leaq 0x160(%rsp), %r14
leaq 0xc0(%rsp), %r15
movl %eax, 0xe8(%rsp)
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
movss 0x2427f(%rip), %xmm0    # 0x3c4e4
mulss %xmm0, %xmm1
addss 0x24277(%rip), %xmm1    # 0x3c4e8
movss %xmm1, 0x180(%rsp)
addss %xmm0, %xmm1
movss %xmm1, 0xec(%rsp)
xorl %r12d, %r12d
xorps %xmm1, %xmm1
cvtsi2ss %r12d, %xmm1
movss 0x2424a(%rip), %xmm0    # 0x3c4e4
mulss %xmm0, %xmm1
addss 0x24242(%rip), %xmm1    # 0x3c4e8
movss %xmm1, 0x190(%rsp)
callq 0x63a0
addsd 0x2450c(%rip), %xmm0    # 0x3c7c8
mulsd 0x2450c(%rip), %xmm0    # 0x3c7d0
cvtsd2ss %xmm0, %xmm0
movss 0x180(%rsp), %xmm1
movss %xmm1, 0x80(%rsp)
movl $0x0, 0x84(%rsp)
movss 0x190(%rsp), %xmm1
movss %xmm1, 0x88(%rsp)
addss 0x241e5(%rip), %xmm1    # 0x3c4e4
movaps %xmm1, %xmm2
movss 0xec(%rsp), %xmm1
movss %xmm1, 0x30(%rsp)
movss %xmm0, 0x34(%rsp)
movss %xmm2, 0x38(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movq %rsp, %rdx
movq %r13, %rcx
movq %rbp, %r8
movq %rbx, %r9
callq 0x22036
movapd 0x60(%rsp), %xmm0
movapd %xmm0, 0xc0(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x7c1c
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x18377
callq 0x7774
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x18386
callq 0x7774
incl %r12d
cmpl $0x14, %r12d
jne 0x1828a
movl 0xe8(%rsp), %eax
incl %eax
cmpl $0x14, %eax
jne 0x1824f
leaq 0x80(%rsp), %r8
movl $0x0, (%r8)
leaq 0x30(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x68(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x60(%rsp), %rsi
movq %rsp, %rdx
leaq 0x160(%rsp), %rcx
callq 0x2169c
movapd 0x60(%rsp), %xmm0
leaq 0xc0(%rsp), %rsi
movapd %xmm0, (%rsi)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x60(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movabsq $0x100000001, %r12      # imm = 0x100000001
leaq 0x3603c(%rip), %r13     # 0x4e458
movq 0x1a8(%rsp), %rbp
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x18436
callq 0x7774
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x18445
callq 0x7774
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
movq %rbp, 0x10(%rax)
movsd 0x24227(%rip), %xmm0    # 0x3c690
movsd %xmm0, 0x18(%rax)
movl $0x40e00000, 0x20(%rax) # imm = 0x40E00000
leaq 0xc0(%rsp), %rcx
movq %rdx, (%rcx)
movq %rax, 0x8(%rcx)
leaq 0x68(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x60(%rsp), %rbx
leaq 0x80(%rsp), %rdx
movq %rbx, %rsi
callq 0x21348
movq %rsp, %rcx
movl $0x7b, (%rcx)
leaq 0x10(%rsp), %r8
movl $0x1a7, (%r8)           # imm = 0x1A7
leaq 0x20(%rsp), %r9
movl $0x93, (%r9)
leaq 0x40(%rsp), %r14
movl $0x19c, (%r14)          # imm = 0x19C
leaq 0x50(%rsp), %r15
movl $0x22a, (%r15)          # imm = 0x22A
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x38(%rsp), %rsi
leaq 0x118(%rsp), %rdx
pushq %rbx
pushq %r15
pushq %r14
callq 0x21c4c
addq $0x20, %rsp
movapd 0x30(%rsp), %xmm0
leaq 0x80(%rsp), %rsi
movapd %xmm0, (%rsi)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x18546
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18555
callq 0x7774
movsd 0x24143(%rip), %xmm0    # 0x3c6a0
movsd %xmm0, 0x110(%rsp)
movl $0x43480000, 0x118(%rsp) # imm = 0x43480000
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
movq %rbp, 0x10(%rax)
movsd 0x2411b(%rip), %xmm0    # 0x3c6b0
movsd %xmm0, 0x18(%rax)
movl $0x3dcccccd, 0x20(%rax) # imm = 0x3DCCCCCD
leaq 0x30(%rsp), %rcx
movq %rax, 0x8(%rcx)
movq %rdx, (%rcx)
leaq 0x88(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x80(%rsp), %rbx
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x2263e
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x185df
callq 0x7774
leaq 0x110(%rsp), %rcx
movsd (%rcx), %xmm0
movss 0x23ef9(%rip), %xmm1    # 0x3c4ec
addps %xmm0, %xmm1
xorps %xmm0, %xmm0
addss 0x8(%rcx), %xmm0
leaq 0x10(%rsp), %r8
movlps %xmm1, (%r8)
movss %xmm0, 0x8(%r8)
leaq 0x20(%rsp), %r9
movl $0x0, (%r9)
movl $0x1, 0x40(%rsp)
movl $0x32, 0x50(%rsp)
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
subq $0x8, %rsp
leaq 0x8(%rsp), %rsi
leaq 0xe0(%rsp), %rdx
pushq %rbx
pushq %r15
pushq %r14
callq 0x22702
addq $0x20, %rsp
movapd (%rsp), %xmm0
leaq 0x30(%rsp), %rsi
movapd %xmm0, (%rsi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18688
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18697
callq 0x7774
movsd 0x24021(%rip), %xmm0    # 0x3c6c0
movsd %xmm0, 0x20(%rsp)
movl $0x42340000, 0x28(%rsp) # imm = 0x42340000
movl $0x32, 0x40(%rsp)
movl $0x20, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
leaq 0x35fbe(%rip), %rbx     # 0x4e688
movq %rbx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x36365(%rip), %r14     # 0x4ea40
addq $0x10, %r14
movq %r14, 0x10(%rax)
movl $0x3fc00000, 0x18(%rax) # imm = 0x3FC00000
leaq 0x10(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rsp, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %r8
callq 0x22844
movaps (%rsp), %xmm0
leaq 0x30(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18749
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18758
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18767
callq 0x7774
movsd 0x23f61(%rip), %xmm0    # 0x3c6d0
movsd %xmm0, 0x20(%rsp)
movl $0x43110000, 0x28(%rsp) # imm = 0x43110000
movl $0x32, 0x40(%rsp)
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
leaq 0x35e9e(%rip), %rcx     # 0x4e638
movq %rcx, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
leaq 0x3625d(%rip), %rdx     # 0x4ea08
addq $0x10, %rdx
movq %rdx, 0x10(%rax)
movapd 0x23f25(%rip), %xmm0    # 0x3c6e0
movupd %xmm0, 0x18(%rax)
leaq 0x10(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rsp, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %r8
callq 0x22936
movapd (%rsp), %xmm0
leaq 0x30(%rsp), %rsi
movapd %xmm0, (%rsi)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18823
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18832
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18841
callq 0x7774
movsd 0x23ea7(%rip), %xmm0    # 0x3c6f0
movsd %xmm0, 0x20(%rsp)
movl $0x43110000, 0x28(%rsp) # imm = 0x43110000
movl $0x46, 0x40(%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 0x10(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rsp, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %r8
callq 0x22844
movaps (%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x188d1
callq 0x7774
movl $0x28, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
movq %r13, (%rax)
movq %rax, %rcx
addq $0x10, %rcx
movq %rbp, 0x10(%rax)
movsd 0x23e0b(%rip), %xmm0    # 0x3c700
movsd %xmm0, 0x18(%rax)
movl $0x3f666666, 0x20(%rax) # imm = 0x3F666666
movq %rax, 0x8(%rsp)
movq %rcx, (%rsp)
leaq 0xa0(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x1b260
leaq 0x40(%rsp), %r8
movl $0x3e4ccccd, (%r8)      # imm = 0x3E4CCCCD
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x30(%rsp), %rcx
movq %rsp, %r9
callq 0x22b4c
movaps 0x20(%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1897d
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1898c
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1899b
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x189aa
callq 0x7774
movq $0x0, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movl $0x1388, 0x40(%rsp)     # imm = 0x1388
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 0x10(%rsp), %r9
movq %rax, 0x8(%r9)
movq %rcx, (%r9)
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
movq %rsp, %rsi
leaq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %r8
callq 0x22844
movaps (%rsp), %xmm0
movaps %xmm0, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18a35
callq 0x7774
leaq 0x20(%rsp), %r8
movl $0x38d1b717, (%r8)      # imm = 0x38D1B717
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
leaq 0x30(%rsp), %rcx
leaq 0x100(%rsp), %r9
callq 0x2245a
movaps 0x10(%rsp), %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18a99
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18aa8
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18ab7
callq 0x7774
leaq 0x8(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x2426e(%rip), %rcx     # 0x3cd39
movq %rsp, %rsi
leaq 0x10(%rsp), %rdx
callq 0x209f0
leaq 0x38(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x30(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %rsp, %rcx
callq 0x22c9c
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18b06
callq 0x7774
movsd 0x23c02(%rip), %xmm0    # 0x3c710
leaq 0x20(%rsp), %rcx
movsd %xmm0, (%rcx)
movl $0x43c80000, 0x8(%rcx)  # imm = 0x43C80000
leaq 0x40(%rsp), %r8
movl $0x64, (%r8)
leaq 0x18(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x10(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0x30(%rsp), %r9
callq 0x22d60
movapd 0x10(%rsp), %xmm0
movq %rsp, %rsi
movapd %xmm0, (%rsi)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x10(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18b7e
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18b8d
callq 0x7774
movl $0x20, %edi
callq 0x63f0
movq %r12, 0x8(%rax)
leaq 0x35b86(%rip), %rcx     # 0x4e728
movq %rcx, (%rax)
movq %rax, %rdx
addq $0x10, %rdx
leaq 0x35595(%rip), %rcx     # 0x4e148
addq $0x10, %rcx
movq %rcx, 0x10(%rax)
movl $0x3dcccccd, 0x18(%rax) # imm = 0x3DCCCCCD
movq %rsp, %rcx
movq %rax, 0x8(%rcx)
movq %rdx, (%rcx)
movsd 0x23b4c(%rip), %xmm0    # 0x3c720
movsd %xmm0, 0x50(%rsp)
movl $0x43960000, 0x58(%rsp) # imm = 0x43960000
movl $0x50, 0xd8(%rsp)
leaq 0x48(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x40(%rsp), %rsi
leaq 0x9c(%rsp), %rdx
callq 0x22eb4
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %rsi
leaq 0x9c(%rsp), %rdx
leaq 0x50(%rsp), %rcx
leaq 0xd8(%rsp), %r8
leaq 0x40(%rsp), %r9
callq 0x20cbe
movapd 0x20(%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movapd %xmm0, (%rsi)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18c72
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18c81
callq 0x7774
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x18c90
callq 0x7774
movl $0x3e8, %r15d           # imm = 0x3E8
leaq 0x40(%rsp), %r12
leaq 0x50(%rsp), %r13
leaq 0x120(%rsp), %rbp
leaq 0x140(%rsp), %rbx
leaq 0x10(%rsp), %r14
callq 0x63a0
movapd %xmm0, 0x190(%rsp)
callq 0x63a0
movapd %xmm0, 0x180(%rsp)
callq 0x63a0
mulsd 0x23afa(%rip), %xmm0    # 0x3c7d8
cvtsd2ss %xmm0, %xmm0
movapd 0x190(%rsp), %xmm1
unpcklpd 0x180(%rsp), %xmm1      # xmm1 = xmm1[0],mem[0]
mulpd 0x23a34(%rip), %xmm1    # 0x3c730
cvtpd2ps %xmm1, %xmm1
movlpd %xmm1, 0x40(%rsp)
movss %xmm0, 0x48(%rsp)
movl $0xa, 0x50(%rsp)
movq $0x0, 0x20(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
movq %r12, %rcx
movq %r13, %r8
movq %rbp, %r9
callq 0x22d60
movapd 0x20(%rsp), %xmm0
movapd %xmm0, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7c1c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18d6d
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18d7c
callq 0x7774
decl %r15d
jne 0x18cb5
leaq 0x9c(%rsp), %r8
movl $0x0, (%r8)
leaq 0x1b4(%rsp), %r9
movl $0x3f800000, (%r9)      # imm = 0x3F800000
leaq 0x58(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x50(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
leaq 0x140(%rsp), %rcx
callq 0x2169c
leaq 0x1b0(%rsp), %r8
movl $0x41700000, (%r8)      # imm = 0x41700000
leaq 0x48(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x40(%rsp), %rsi
leaq 0xd8(%rsp), %rdx
leaq 0x50(%rsp), %rcx
callq 0x22fb0
movq 0x1a0(%rsp), %rbx
movsd 0x23933(%rip), %xmm0    # 0x3c740
leaq 0xd8(%rsp), %r8
movsd %xmm0, (%r8)
movl $0x43c58000, 0x8(%r8)   # imm = 0x43C58000
leaq 0x28(%rsp), %rdi
movq $0x0, -0x8(%rdi)
leaq 0x20(%rsp), %rsi
leaq 0x7f(%rsp), %rdx
leaq 0x40(%rsp), %rcx
callq 0x22304
movapd 0x20(%rsp), %xmm0
leaq 0x10(%rsp), %rsi
movapd %xmm0, (%rsi)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
leaq 0xa0(%rsp), %rdi
callq 0x7c1c
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18e78
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18e87
callq 0x7774
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x18e96
callq 0x7774
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x18ea5
callq 0x7774
leaq 0x20(%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 0x50(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0x2169c
movaps 0x10(%rsp), %xmm0
movups %xmm0, (%rbx)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18ef8
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x18f07
callq 0x7774
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x18f19
callq 0x7774
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x18f28
callq 0x7774
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x18f3a
callq 0x7774
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x18f4c
callq 0x7774
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x18f5e
callq 0x7774
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x18f70
callq 0x7774
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x18f82
callq 0x7774
leaq 0x140(%rsp), %rdi
callq 0x7726
leaq 0x160(%rsp), %rdi
callq 0x7726
leaq 0xa0(%rsp), %rdi
callq 0x7726
movq %rbx, %rax
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x192a5
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18fd5
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x18fe9
callq 0x7774
jmp 0x18fe9
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x18ffd
callq 0x7774
jmp 0x18ffd
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x192cb
jmp 0x192c6
jmp 0x192a5
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x19027
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x1903b
callq 0x7774
jmp 0x1903b
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x192cb
jmp 0x192c6
jmp 0x192a5
jmp 0x1907a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x19067
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x192da
jmp 0x192d5
movq %rax, %rbx
jmp 0x192da
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
jmp 0x191f6
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x190af
callq 0x7774
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x190c3
callq 0x7774
jmp 0x190c3
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
jmp 0x191f6
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x19103
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x19119
callq 0x7774
jmp 0x19119
jmp 0x19116
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1912d
callq 0x7774
jmp 0x1912d
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
jmp 0x191f6
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1916d
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x19181
callq 0x7774
jmp 0x19181
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
jmp 0x191f6
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x191a8
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x191bc
callq 0x7774
jmp 0x191bc
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
jmp 0x191f6
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x191e3
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
jmp 0x192e4
movq %rax, %rbx
jmp 0x192e9
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x192fb
jmp 0x192f6
jmp 0x1923e
movq %rax, %rbx
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x1922b
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x192fb
jmp 0x192f6
movq %rax, %rbx
jmp 0x192fb
movq %rax, %rbx
jmp 0x1930a
jmp 0x1933f
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x19268
callq 0x7774
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x19342
jmp 0x19338
jmp 0x1933f
movq %rax, %rbx
jmp 0x19354
movq %rax, %rbx
jmp 0x19366
movq %rax, %rbx
jmp 0x19378
movq %rax, %rbx
jmp 0x1938a
jmp 0x1933f
movq %rax, %rbx
jmp 0x192cb
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x192bc
callq 0x7774
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x192cb
callq 0x7774
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x192da
callq 0x7774
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x192e9
callq 0x7774
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x192fb
callq 0x7774
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x1930a
callq 0x7774
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x19342
jmp 0x19338
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
testq %rdi, %rdi
je 0x1932e
callq 0x7774
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x19342
callq 0x7774
jmp 0x19342
movq %rax, %rbx
movq 0xf8(%rsp), %rdi
testq %rdi, %rdi
je 0x19354
callq 0x7774
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x19366
callq 0x7774
movq 0x138(%rsp), %rdi
testq %rdi, %rdi
je 0x19378
callq 0x7774
movq 0x108(%rsp), %rdi
testq %rdi, %rdi
je 0x1938a
callq 0x7774
leaq 0x140(%rsp), %rdi
callq 0x7726
leaq 0x160(%rsp), %rdi
callq 0x7726
leaq 0xa0(%rsp), %rdi
callq 0x7726
movq %rbx, %rdi
callq 0x66e0