// File: alan0201tw[P]RayTracer/src/util.cpp
// Function: random_scene()
std::shared_ptr<hitable> random_scene()
{
    int n = 500;
    std::vector<std::shared_ptr<hitable>> list;
    list.reserve(n + 1);

    std::shared_ptr<texture> _checker_texture = std::make_shared<checker_texture>(
        std::make_shared<constant_texture>(vec3(0.2f, 0.3f, 0.1f)),
        std::make_shared<constant_texture>(vec3(0.9f, 0.9f, 0.9f))
    );
    std::shared_ptr<texture> _image_texture = std::make_shared<image_texture>("./resources/texture.jpg");

    list.push_back(std::make_shared<sphere>(vec3(0,-1000,0), 1000, std::make_shared<lambertian>(_checker_texture)));

    for (int a = -10; a < 10; a++) {
        for (int b = -10; b < 10; b++) {
            float choose_mat = drand48();
            vec3 center(a + 0.9 * drand48(), 0.2f, b + 0.9 * drand48()); 
            if ((center-vec3(4,0.2,0)).length() > 0.9) { 
                if (choose_mat < 0.8f) 
                {
                    // diffuse
                    //list.push_back(std::make_shared<sphere>(center, 0.2, std::make_shared<lambertian>(vec3(drand48()*drand48(), drand48()*drand48(), drand48()*drand48()))));
                    std::shared_ptr<texture> random_texture = std::make_shared<constant_texture>(
                        vec3(drand48()*drand48(), drand48()*drand48(), drand48()*drand48()));

                    list.push_back(std::make_shared<moving_sphere>(
                        center, center + vec3(0, 0.5f * drand48(), 0.0f), 
                        0.0f, 1.0f, // start and end time
                        0.2f, std::make_shared<lambertian>(random_texture)));
                }
                else if (choose_mat < 0.95f)
                {
                    // metal
                    list.push_back(std::make_shared<sphere>(center, 0.2,
                        std::make_shared<metal>(vec3(0.5*(1 + drand48()), 0.5*(1 + drand48()), 0.5*(1 + drand48())),  0.5*drand48())));
                }
                else
                {
                    // glass
                    list.push_back(std::make_shared<sphere>(center, 0.2, std::make_shared<dielectric>(1.5)));
                }
            }
        }
    }
    std::shared_ptr<texture> _color_texture = std::make_shared<constant_texture>(vec3(4.0f, 4.0f, 4.0f));

    list.push_back(std::make_shared<sphere>(vec3(-4, 1, 2.0f), 1.0, std::make_shared<dielectric>(1.5)));
    //list.push_back(std::make_shared<sphere>(vec3(-4, 1, 0), 1.0, std::make_shared<lambertian>(vec3(0.4, 0.2, 0.1))));
    // list.push_back(std::make_shared<sphere>(vec3(-4, 1, 2.0f), 1.0, std::make_shared<lambertian>(_image_texture)));
    list.push_back(std::make_shared<sphere>(vec3(0, 1, 0), 1.0, std::make_shared<diffuse_light>(_color_texture)));
    list.push_back(std::make_shared<sphere>(vec3(4, 1, 0), 1.0, std::make_shared<metal>(vec3(0.7, 0.6, 0.5), 0.0)));

    //return std::make_shared<hitable_list>(list, list.size());

    // change to bvh
    return std::make_shared<bvh_node>(list, 0.0f, 1.0f);

    // using O(N) search ( hitable_list )
    // real    4m49.214s
    // user    13m57.995s
    // sys     0m7.843s
    //
    // using BVH
    // real    1m21.986s
    // user    4m50.992s
    // sys     0m4.199s
    //
    // using BVH and functors
    // real    1m18.025s
    // user    4m20.477s
    // sys     0m3.869s
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4b0, %rsp            # imm = 0x4B0
movq %rdi, -0x3c8(%rbp)
movq %rdi, %rax
movq %rax, -0x3c0(%rbp)
movq %rdi, -0x8(%rbp)
movl $0x1f4, -0xc(%rbp)      # imm = 0x1F4
leaq -0x28(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x8b80
movq -0x3b8(%rbp), %rdi
movl -0xc(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8ba0
jmp 0x24efd
leaq -0x74(%rbp), %rdi
movss 0x595c3(%rip), %xmm0    # 0x7e4cc
movss 0x595bf(%rip), %xmm1    # 0x7e4d0
movss 0x595bb(%rip), %xmm2    # 0x7e4d4
callq 0xf9b0
jmp 0x24f20
leaq -0x68(%rbp), %rdi
leaq -0x74(%rbp), %rsi
callq 0x2cc80
jmp 0x24f2f
leaq -0x94(%rbp), %rdi
movss 0x5959a(%rip), %xmm2    # 0x7e4d8
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xf9b0
jmp 0x24f4b
leaq -0x88(%rbp), %rdi
leaq -0x94(%rbp), %rsi
callq 0x2cc80
jmp 0x24f60
leaq -0x58(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x2cc00
jmp 0x24f76
leaq -0x48(%rbp), %rdi
leaq -0x58(%rbp), %rsi
movq %rsi, -0x3d0(%rbp)
callq 0x2ccf0
movq -0x3d0(%rbp), %rdi
callq 0x2cd20
leaq -0x88(%rbp), %rdi
callq 0x2cd40
leaq -0x68(%rbp), %rdi
callq 0x2cd40
leaq 0x59b54(%rip), %rsi     # 0x7eb06
leaq -0xb8(%rbp), %rdi
callq 0x2cd60
jmp 0x24fc0
leaq -0xa8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movq %rsi, -0x3d8(%rbp)
callq 0x2cdd0
movq -0x3d8(%rbp), %rdi
callq 0x2ce00
leaq -0xe4(%rbp), %rdi
movss 0x594e7(%rip), %xmm1    # 0x7e4dc
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
callq 0xf9b0
jmp 0x25002
movl $0x3e8, -0xe8(%rbp)     # imm = 0x3E8
leaq -0xf8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2cea0
jmp 0x2501e
leaq -0xd8(%rbp), %rdi
leaq -0xe4(%rbp), %rsi
leaq -0xe8(%rbp), %rdx
leaq -0xf8(%rbp), %rcx
callq 0x2ce20
jmp 0x25041
leaq -0xc8(%rbp), %rdi
movq %rdi, -0x3e0(%rbp)
leaq -0xd8(%rbp), %rsi
callq 0x2cf10
movq -0x3e0(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x8ca0
jmp 0x2506d
leaq -0xc8(%rbp), %rdi
callq 0x8e00
leaq -0xd8(%rbp), %rdi
callq 0x2cf40
leaq -0xf8(%rbp), %rdi
callq 0x2cf60
movl $0xfffffff6, -0xfc(%rbp) # imm = 0xFFFFFFF6
cmpl $0xa, -0xfc(%rbp)
jge 0x2583a
movl $0xfffffff6, -0x100(%rbp) # imm = 0xFFFFFFF6
cmpl $0xa, -0x100(%rbp)
jge 0x25824
callq 0x7480
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x104(%rbp)
cvtsi2sdl -0xfc(%rbp), %xmm0
movsd %xmm0, -0x400(%rbp)
callq 0x7480
movsd -0x400(%rbp), %xmm1
movsd 0x593a3(%rip), %xmm2    # 0x7e498
movsd %xmm2, -0x3f8(%rbp)
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x3e4(%rbp)
cvtsi2sdl -0x100(%rbp), %xmm0
movsd %xmm0, -0x3f0(%rbp)
callq 0x7480
movsd -0x3f8(%rbp), %xmm3
movsd -0x3f0(%rbp), %xmm2
movaps %xmm0, %xmm1
movss -0x3e4(%rbp), %xmm0
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
cvtsd2ss %xmm1, %xmm2
leaq -0x110(%rbp), %rdi
movss 0x59370(%rip), %xmm1    # 0x7e4cc
callq 0xf9b0
jmp 0x25163
leaq -0x12c(%rbp), %rdi
movss 0x5936e(%rip), %xmm0    # 0x7e4e0
movss 0x59352(%rip), %xmm1    # 0x7e4cc
xorps %xmm2, %xmm2
callq 0xf9b0
jmp 0x25184
leaq -0x110(%rbp), %rdi
leaq -0x12c(%rbp), %rsi
callq 0x11890
movss %xmm1, -0x414(%rbp)
movaps %xmm0, -0x410(%rbp)
jmp 0x251a8
movss -0x414(%rbp), %xmm0
movaps -0x410(%rbp), %xmm1
movlpd %xmm1, -0x140(%rbp)
movss %xmm0, -0x138(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x118(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x12130
movss %xmm0, -0x418(%rbp)
jmp 0x251f7
movss -0x418(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x5928d(%rip), %xmm1    # 0x7e498
ucomisd %xmm1, %xmm0
jbe 0x2580e
movss 0x592d3(%rip), %xmm0    # 0x7e4f0
ucomiss -0x104(%rbp), %xmm0
jbe 0x25561
callq 0x7480
movsd %xmm0, -0x438(%rbp)
callq 0x7480
movaps %xmm0, %xmm1
movsd -0x438(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x41c(%rbp)
callq 0x7480
movsd %xmm0, -0x430(%rbp)
callq 0x7480
movaps %xmm0, %xmm1
movsd -0x430(%rbp), %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x420(%rbp)
callq 0x7480
movsd %xmm0, -0x428(%rbp)
callq 0x7480
movsd -0x428(%rbp), %xmm2
movss -0x420(%rbp), %xmm1
movaps %xmm0, %xmm3
movss -0x41c(%rbp), %xmm0
mulsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
leaq -0x16c(%rbp), %rdi
callq 0xf9b0
jmp 0x252c7
leaq -0x160(%rbp), %rdi
leaq -0x16c(%rbp), %rsi
callq 0x2cc80
jmp 0x252dc
leaq -0x150(%rbp), %rdi
leaq -0x160(%rbp), %rsi
movq %rsi, -0x440(%rbp)
callq 0x2cf80
movq -0x440(%rbp), %rdi
callq 0x2cd40
callq 0x7480
movsd 0x59159(%rip), %xmm1    # 0x7e468
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm1
leaq -0x1ac(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
callq 0xf9b0
jmp 0x2532b
leaq -0x110(%rbp), %rdi
leaq -0x1ac(%rbp), %rsi
callq 0xfa30
movss %xmm1, -0x454(%rbp)
movaps %xmm0, -0x450(%rbp)
jmp 0x2534f
movss -0x454(%rbp), %xmm0
movaps -0x450(%rbp), %xmm1
movlpd %xmm1, -0x1c0(%rbp)
movss %xmm0, -0x1b8(%rbp)
movl -0x1b8(%rbp), %eax
movl %eax, -0x198(%rbp)
movq -0x1c0(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movl $0x0, -0x1c4(%rbp)
movl $0x3f800000, -0x1c8(%rbp) # imm = 0x3F800000
movl $0x3e4ccccd, -0x1cc(%rbp) # imm = 0x3E4CCCCD
leaq -0x1e0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x2cea0
jmp 0x253bb
movq %rsp, %rax
leaq -0x1e0(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x190(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x1a0(%rbp), %rdx
leaq -0x1c4(%rbp), %rcx
leaq -0x1c8(%rbp), %r8
leaq -0x1cc(%rbp), %r9
callq 0x2cfb0
jmp 0x253f9
leaq -0x180(%rbp), %rdi
movq %rdi, -0x460(%rbp)
leaq -0x190(%rbp), %rsi
callq 0x2d050
movq -0x460(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x8ca0
jmp 0x25425
leaq -0x180(%rbp), %rdi
callq 0x8e00
leaq -0x190(%rbp), %rdi
callq 0x2d080
leaq -0x1e0(%rbp), %rdi
callq 0x2cf60
leaq -0x150(%rbp), %rdi
callq 0x12a50
jmp 0x2580c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25c85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25491
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x2cd40
leaq -0x68(%rbp), %rdi
callq 0x2cd40
jmp 0x25c85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25c7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25c70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x254f3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x8e00
leaq -0xd8(%rbp), %rdi
callq 0x2cf40
leaq -0xf8(%rbp), %rdi
callq 0x2cf60
jmp 0x25c70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25550
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25544
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x8e00
leaq -0x190(%rbp), %rdi
callq 0x2d080
leaq -0x1e0(%rbp), %rdi
callq 0x2cf60
leaq -0x150(%rbp), %rdi
callq 0x12a50
jmp 0x25c70
movss 0x58f8b(%rip), %xmm0    # 0x7e4f4
ucomiss -0x104(%rbp), %xmm0
jbe 0x2571b
movabsq $0x3fc999999999999a, %rax # imm = 0x3FC999999999999A
movq %rax, -0x208(%rbp)
callq 0x7480
movsd 0x58ee4(%rip), %xmm1    # 0x7e478
movsd %xmm1, -0x478(%rbp)
addsd %xmm1, %xmm0
movsd 0x58ec0(%rip), %xmm1    # 0x7e468
movsd %xmm1, -0x470(%rbp)
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x464(%rbp)
callq 0x7480
movsd -0x478(%rbp), %xmm2
movsd -0x470(%rbp), %xmm1
addsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x468(%rbp)
callq 0x7480
movsd -0x478(%rbp), %xmm4
movsd -0x470(%rbp), %xmm3
movss -0x468(%rbp), %xmm1
movaps %xmm0, %xmm2
movss -0x464(%rbp), %xmm0
addsd %xmm4, %xmm2
mulsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
leaq -0x224(%rbp), %rdi
callq 0xf9b0
jmp 0x2562b
callq 0x7480
movsd 0x58e30(%rip), %xmm1    # 0x7e468
mulsd %xmm1, %xmm0
movsd %xmm0, -0x230(%rbp)
leaq -0x218(%rbp), %rdi
leaq -0x224(%rbp), %rsi
leaq -0x230(%rbp), %rdx
callq 0x2d120
jmp 0x25660
leaq -0x200(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x208(%rbp), %rdx
leaq -0x218(%rbp), %rcx
callq 0x2d0a0
jmp 0x25683
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x480(%rbp)
leaq -0x200(%rbp), %rsi
callq 0x2cf10
movq -0x480(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x8ca0
jmp 0x256af
leaq -0x1f0(%rbp), %rdi
callq 0x8e00
leaq -0x200(%rbp), %rdi
callq 0x2cf40
leaq -0x218(%rbp), %rdi
callq 0x2d1a0
jmp 0x2580a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x2570a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x8e00
leaq -0x200(%rbp), %rdi
callq 0x2cf40
leaq -0x218(%rbp), %rdi
callq 0x2d1a0
jmp 0x25c70
movabsq $0x3fc999999999999a, %rax # imm = 0x3FC999999999999A
movq %rax, -0x258(%rbp)
movabsq $0x3ff8000000000000, %rax # imm = 0x3FF8000000000000
movq %rax, -0x270(%rbp)
leaq -0x268(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x2d240
jmp 0x25752
leaq -0x250(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x258(%rbp), %rdx
leaq -0x268(%rbp), %rcx
callq 0x2d1c0
jmp 0x25775
leaq -0x240(%rbp), %rdi
movq %rdi, -0x488(%rbp)
leaq -0x250(%rbp), %rsi
callq 0x2cf10
movq -0x488(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x8ca0
jmp 0x257a1
leaq -0x240(%rbp), %rdi
callq 0x8e00
leaq -0x250(%rbp), %rdi
callq 0x2cf40
leaq -0x268(%rbp), %rdi
callq 0x2d2b0
jmp 0x2580a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x257f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x8e00
leaq -0x250(%rbp), %rdi
callq 0x2cf40
leaq -0x268(%rbp), %rdi
callq 0x2d2b0
jmp 0x25c70
jmp 0x2580c
jmp 0x2580e
jmp 0x25810
movl -0x100(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x100(%rbp)
jmp 0x250b2
jmp 0x25826
movl -0xfc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xfc(%rbp)
jmp 0x2509b
leaq -0x29c(%rbp), %rdi
movss 0x58c97(%rip), %xmm2    # 0x7e4e0
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0xf9b0
jmp 0x25856
leaq -0x290(%rbp), %rdi
leaq -0x29c(%rbp), %rsi
callq 0x2cc80
jmp 0x2586b
leaq -0x280(%rbp), %rdi
leaq -0x290(%rbp), %rsi
movq %rsi, -0x490(%rbp)
callq 0x2cf80
movq -0x490(%rbp), %rdi
callq 0x2cd40
leaq -0x2cc(%rbp), %rdi
movss 0x58c44(%rip), %xmm0    # 0x7e4e4
movss 0x58954(%rip), %xmm1    # 0x7e1fc
movss 0x58bb4(%rip), %xmm2    # 0x7e464
callq 0xf9b0
jmp 0x258b7
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x2d8(%rbp)
movabsq $0x3ff8000000000000, %rax # imm = 0x3FF8000000000000
movq %rax, -0x2f0(%rbp)
leaq -0x2e8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x2d240
jmp 0x258ee
leaq -0x2c0(%rbp), %rdi
leaq -0x2cc(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
leaq -0x2e8(%rbp), %rcx
callq 0x2d2d0
jmp 0x25911
leaq -0x2b0(%rbp), %rdi
movq %rdi, -0x498(%rbp)
leaq -0x2c0(%rbp), %rsi
callq 0x2cf10
movq -0x498(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x8ca0
jmp 0x2593d
leaq -0x2b0(%rbp), %rdi
callq 0x8e00
leaq -0x2c0(%rbp), %rdi
callq 0x2cf40
leaq -0x2e8(%rbp), %rdi
callq 0x2d2b0
leaq -0x31c(%rbp), %rdi
movss 0x5888c(%rip), %xmm1    # 0x7e1fc
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
callq 0xf9b0
jmp 0x2597d
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x328(%rbp)
leaq -0x338(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x2d3d0
jmp 0x259a3
leaq -0x310(%rbp), %rdi
leaq -0x31c(%rbp), %rsi
leaq -0x328(%rbp), %rdx
leaq -0x338(%rbp), %rcx
callq 0x2d350
jmp 0x259c6
leaq -0x300(%rbp), %rdi
movq %rdi, -0x4a0(%rbp)
leaq -0x310(%rbp), %rsi
callq 0x2cf10
movq -0x4a0(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x8ca0
jmp 0x259f2
leaq -0x300(%rbp), %rdi
callq 0x8e00
leaq -0x310(%rbp), %rdi
callq 0x2cf40
leaq -0x338(%rbp), %rdi
callq 0x2d440
leaq -0x364(%rbp), %rdi
movss 0x58abb(%rip), %xmm0    # 0x7e4e0
movss 0x587cf(%rip), %xmm1    # 0x7e1fc
xorps %xmm2, %xmm2
callq 0xf9b0
jmp 0x25a37
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x370(%rbp)
leaq -0x38c(%rbp), %rdi
movss 0x58a91(%rip), %xmm0    # 0x7e4e8
movss 0x58a8d(%rip), %xmm1    # 0x7e4ec
movss 0x587bd(%rip), %xmm2    # 0x7e224
callq 0xf9b0
jmp 0x25a6e
movq $0x0, -0x398(%rbp)
leaq -0x380(%rbp), %rdi
leaq -0x38c(%rbp), %rsi
leaq -0x398(%rbp), %rdx
callq 0x2d120
jmp 0x25a95
leaq -0x358(%rbp), %rdi
leaq -0x364(%rbp), %rsi
leaq -0x370(%rbp), %rdx
leaq -0x380(%rbp), %rcx
callq 0x2d460
jmp 0x25ab8
leaq -0x348(%rbp), %rdi
movq %rdi, -0x4a8(%rbp)
leaq -0x358(%rbp), %rsi
callq 0x2cf10
movq -0x4a8(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x8ca0
jmp 0x25ae4
leaq -0x348(%rbp), %rdi
callq 0x8e00
leaq -0x358(%rbp), %rdi
callq 0x2cf40
leaq -0x380(%rbp), %rdi
callq 0x2d1a0
movl $0x0, -0x3ac(%rbp)
movl $0x3f800000, -0x3b0(%rbp) # imm = 0x3F800000
leaq -0x3a8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x3ac(%rbp), %rdx
leaq -0x3b0(%rbp), %rcx
callq 0x2d4e0
jmp 0x25b3c
movq -0x3c8(%rbp), %rdi
leaq -0x3a8(%rbp), %rsi
callq 0x2d560
leaq -0x3a8(%rbp), %rdi
callq 0x13be0
leaq -0x280(%rbp), %rdi
callq 0x12a50
leaq -0xa8(%rbp), %rdi
callq 0x12a50
leaq -0x48(%rbp), %rdi
callq 0x12a50
leaq -0x28(%rbp), %rdi
callq 0x92d0
movq -0x3c0(%rbp), %rax
addq $0x4b0, %rsp            # imm = 0x4B0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25c64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25bd8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x8e00
leaq -0x2c0(%rbp), %rdi
callq 0x2cf40
leaq -0x2e8(%rbp), %rdi
callq 0x2d2b0
jmp 0x25c64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25c18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x300(%rbp), %rdi
callq 0x8e00
leaq -0x310(%rbp), %rdi
callq 0x2cf40
leaq -0x338(%rbp), %rdi
callq 0x2d440
jmp 0x25c64
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x25c58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x348(%rbp), %rdi
callq 0x8e00
leaq -0x358(%rbp), %rdi
callq 0x2cf40
leaq -0x380(%rbp), %rdi
callq 0x2d1a0
leaq -0x280(%rbp), %rdi
callq 0x12a50
leaq -0xa8(%rbp), %rdi
callq 0x12a50
leaq -0x48(%rbp), %rdi
callq 0x12a50
leaq -0x28(%rbp), %rdi
callq 0x92d0
movq -0x30(%rbp), %rdi
callq 0x7860
nopw (%rax,%rax)