// File: Aries-orz[P]Ari-RayTracing/src/Engine.cpp
// Function: rt::engine::radianceRT(rt::Ray const&, int, rt::Scene*)
Vec3d radianceRT(const Ray &r, int depth, Scene* scene) {
    double tmin = 0;
    int id = 0;
    int objSize = scene->getSize();
    for (int i=0; i<objSize; ++i) {
        double t = scene->getObj(i)->hit(r);
        if (!t) continue;
        if (t < tmin || !tmin) {
            tmin = t;
            id = i;
        }
    }
    if (!tmin) return Vec3d();
        
    Vec3d x = r.o + r.d * tmin;
    RTObject *obj = scene->getObj(id);
    Vec3d n = obj->getNormal(r, tmin);
    Vec3d nl = n.dot(r.d)<0 ? n : n*-1;
    Vec3d f = obj->color;
    double p = f.x>f.y && f.x>f.z ? f.x : f.y>f.z ? f.y : f.z;
        
    if (depth > 100) return obj->emission;
    if (++depth > 5) {
        if (randRT() < p) f = f * (1/p);
        else return obj->emission;
    }
    //Diffuse reflection
    if (obj->mat == RTObject::DIFFUSE) {
            double r1 = 2 * M_PI * randRT();
            double r2 = randRT(), r2s = sqrt(r2);
            Vec3d w = nl, u = ((fabs(w.x)>.1 ? Vec3d(0,1,0) : Vec3d(1,0,0))^w).norm(), v = w^u;
            Vec3d d = (u*cos(r1)*r2s + v*sin(r1)*r2s + w*sqrt(1-r2)).norm();
            return obj->emission + f * (radianceRT(Ray(x,d), depth, scene));
        }
    //Specular reflection
    else if (obj->mat == RTObject::SPECULAR)
        return obj->emission + f * (radianceRT(Ray(x, r.d-n*2*n.dot(r.d)), depth, scene));
    //Refraction
    Ray reflRay(x, r.d-n*2*n.dot(r.d));
    bool into = n.dot(nl)>0;
    double nc=1, nt=1.5, nnt=into?nc/nt:nt/nc, ddn=r.d.dot(nl), cos2t;
    //When total reflection
    if ((cos2t=1-nnt*nnt*(1-ddn*ddn))<0)
        return obj->emission + f * (radianceRT(reflRay,depth,scene));
    //otherwise, choose reflection or refraction
    Vec3d tdir = (r.d*nnt - n*((into?1:-1)*(ddn*nnt+sqrt(cos2t)))).norm();
    double a=nt-nc, b=nt+nc, R0=a*a/(b*b), c = 1-(into?-ddn:tdir.dot(n));
    double Re=R0+(1-R0)*c*c*c*c*c,Tr=1-Re,P=.25+.5*Re,RP=Re/P,TP=Tr/(1-P);
    //Russian roulette method to reduce the variance
    return obj->emission + f * (depth>2 ? (randRT()<P ? radianceRT(reflRay,depth,scene)*RP:radianceRT(Ray(x,tdir),depth, scene)*TP) : radianceRT(reflRay,depth,scene)*Re+radianceRT(Ray(x,tdir),depth,scene)*Tr);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x720, %rsp            # imm = 0x720
movq %rdi, -0x6a8(%rbp)
movq %rdi, %rax
movq %rax, -0x6a0(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x20(%rbp), %rdi
callq 0x8d90
movl %eax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x37f2
movq -0x20(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x8db0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x37b5
jp 0x37b5
jmp 0x37e7
movsd -0x40(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
ucomisd %xmm1, %xmm0
ja 0x37d5
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x37e5
jp 0x37e5
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x37e7
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x377d
movsd -0x28(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x381c
jp 0x381c
movq -0x6a8(%rbp), %rdi
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x3540
jmp 0x43f6
movq -0x10(%rbp), %rax
movq %rax, -0x6b0(%rbp)
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
movsd -0x28(%rbp), %xmm0
leaq -0x70(%rbp), %rdi
callq 0xa000
movq -0x6b0(%rbp), %rsi
leaq -0x58(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x9ee0
movq -0x20(%rbp), %rdi
movl -0x2c(%rbp), %esi
callq 0x8db0
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rsi
movq -0x10(%rbp), %rdx
movsd -0x28(%rbp), %xmm0
movq (%rsi), %rax
leaq -0x90(%rbp), %rdi
callq *0x18(%rax)
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
leaq -0x90(%rbp), %rdi
callq 0xa1f0
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x38b0
leaq -0xa8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x9ea0
jmp 0x38cb
leaq -0xa8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movsd 0x7762(%rip), %xmm0     # 0xb028
callq 0xa000
movq -0x78(%rbp), %rsi
addq $0x28, %rsi
leaq -0xc0(%rbp), %rdi
callq 0x9ea0
movsd -0xc0(%rbp), %xmm0
ucomisd -0xb8(%rbp), %xmm0
jbe 0x3915
movsd -0xc0(%rbp), %xmm0
ucomisd -0xb0(%rbp), %xmm0
jbe 0x3915
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0x6b8(%rbp)
jmp 0x3959
movsd -0xb8(%rbp), %xmm0
ucomisd -0xb0(%rbp), %xmm0
jbe 0x3939
movsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x6c0(%rbp)
jmp 0x3949
movsd -0xb0(%rbp), %xmm0
movsd %xmm0, -0x6c0(%rbp)
movsd -0x6c0(%rbp), %xmm0
movsd %xmm0, -0x6b8(%rbp)
movsd -0x6b8(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
cmpl $0x64, -0x14(%rbp)
jle 0x3988
movq -0x6a8(%rbp), %rdi
movq -0x78(%rbp), %rsi
addq $0x10, %rsi
callq 0x9ea0
jmp 0x43f6
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x5, %eax
jle 0x39ff
callq 0x4bc0
movaps %xmm0, %xmm1
movsd -0xc8(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x39e4
movsd 0x7654(%rip), %xmm0     # 0xb008
divsd -0xc8(%rbp), %xmm0
leaq -0xe0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xa000
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0xa130
jmp 0x39fd
movq -0x6a8(%rbp), %rdi
movq -0x78(%rbp), %rsi
addq $0x10, %rsi
callq 0x9ea0
jmp 0x43f6
jmp 0x39ff
movq -0x78(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x3c90
callq 0x4bc0
movaps %xmm0, %xmm1
movsd 0x7773(%rip), %xmm0     # 0xb190
mulsd %xmm1, %xmm0
movsd %xmm0, -0xe8(%rbp)
callq 0x4bc0
movsd %xmm0, -0xf0(%rbp)
movsd -0xf0(%rbp), %xmm0
callq 0x20d0
movsd %xmm0, -0xf8(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x9ea0
movsd -0x110(%rbp), %xmm0
movaps 0x7763(%rip), %xmm1     # 0xb1d0
pand %xmm1, %xmm0
movsd 0x770f(%rip), %xmm1     # 0xb188
ucomisd %xmm1, %xmm0
jbe 0x3a9b
leaq -0x158(%rbp), %rdi
xorps %xmm2, %xmm2
movsd 0x7577(%rip), %xmm1     # 0xb008
movaps %xmm2, %xmm0
callq 0x3540
jmp 0x3ab5
leaq -0x158(%rbp), %rdi
movsd 0x755e(%rip), %xmm0     # 0xb008
xorps %xmm2, %xmm2
movaps %xmm2, %xmm1
callq 0x3540
leaq -0x140(%rbp), %rdi
leaq -0x158(%rbp), %rsi
leaq -0x110(%rbp), %rdx
callq 0xa050
leaq -0x140(%rbp), %rdi
callq 0xa170
movq %rax, %rsi
leaq -0x128(%rbp), %rdi
callq 0x9ea0
leaq -0x170(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq -0x128(%rbp), %rdx
callq 0xa050
movsd -0xe8(%rbp), %xmm0
callq 0x21d0
leaq -0x1e8(%rbp), %rdi
leaq -0x128(%rbp), %rsi
callq 0xa000
movsd -0xf8(%rbp), %xmm0
leaq -0x1d0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0xa000
movsd -0xe8(%rbp), %xmm0
callq 0x2050
leaq -0x218(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0xa000
movsd -0xf8(%rbp), %xmm0
leaq -0x200(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0xa000
leaq -0x1b8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x200(%rbp), %rdx
callq 0x9ee0
movsd 0x746c(%rip), %xmm0     # 0xb008
subsd -0xf0(%rbp), %xmm0
callq 0x20d0
leaq -0x230(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0xa000
leaq -0x1a0(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x230(%rbp), %rdx
callq 0x9ee0
leaq -0x1a0(%rbp), %rdi
callq 0xa170
movq %rax, %rsi
leaq -0x188(%rbp), %rdi
callq 0x9ea0
movq -0x78(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x6c8(%rbp)
leaq -0x2a8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9ea0
leaq -0x2c0(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x9ea0
leaq -0x290(%rbp), %rdi
leaq -0x2a8(%rbp), %rsi
leaq -0x2c0(%rbp), %rdx
callq 0x8bc0
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x260(%rbp), %rdi
leaq -0x290(%rbp), %rsi
callq 0x3730
leaq -0x248(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x260(%rbp), %rdx
callq 0x9fa0
movq -0x6a8(%rbp), %rdi
movq -0x6c8(%rbp), %rsi
leaq -0x248(%rbp), %rdx
callq 0x9ee0
jmp 0x43f6
movq -0x78(%rbp), %rax
cmpl $0x1, 0x8(%rax)
jne 0x3d95
movq -0x78(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x6d0(%rbp)
leaq -0x338(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9ea0
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x6d8(%rbp)
leaq -0x380(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movsd 0x7496(%rip), %xmm0     # 0xb178
callq 0xa000
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
leaq -0x90(%rbp), %rdi
callq 0xa1f0
leaq -0x368(%rbp), %rdi
leaq -0x380(%rbp), %rsi
callq 0xa000
movq -0x6d8(%rbp), %rsi
leaq -0x350(%rbp), %rdi
leaq -0x368(%rbp), %rdx
callq 0x9f40
leaq -0x320(%rbp), %rdi
leaq -0x338(%rbp), %rsi
leaq -0x350(%rbp), %rdx
callq 0x8bc0
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x2f0(%rbp), %rdi
leaq -0x320(%rbp), %rsi
callq 0x3730
leaq -0x2d8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x2f0(%rbp), %rdx
callq 0x9fa0
movq -0x6a8(%rbp), %rdi
movq -0x6d0(%rbp), %rsi
leaq -0x2d8(%rbp), %rdx
callq 0x9ee0
jmp 0x43f6
jmp 0x3d97
leaq -0x3c8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9ea0
movq -0x10(%rbp), %rax
addq $0x18, %rax
movq %rax, -0x6e0(%rbp)
leaq -0x410(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movsd 0x73ac(%rip), %xmm0     # 0xb178
callq 0xa000
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
leaq -0x90(%rbp), %rdi
callq 0xa1f0
leaq -0x3f8(%rbp), %rdi
leaq -0x410(%rbp), %rsi
callq 0xa000
movq -0x6e0(%rbp), %rsi
leaq -0x3e0(%rbp), %rdi
leaq -0x3f8(%rbp), %rdx
callq 0x9f40
leaq -0x3b0(%rbp), %rdi
leaq -0x3c8(%rbp), %rsi
leaq -0x3e0(%rbp), %rdx
callq 0x8bc0
leaq -0x90(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa1f0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
seta %al
andb $0x1, %al
movb %al, -0x411(%rbp)
movsd 0x71af(%rip), %xmm0     # 0xb008
movsd %xmm0, -0x420(%rbp)
movsd 0x7307(%rip), %xmm0     # 0xb170
movsd %xmm0, -0x428(%rbp)
testb $0x1, -0x411(%rbp)
je 0x3e94
movsd -0x420(%rbp), %xmm0
divsd -0x428(%rbp), %xmm0
movsd %xmm0, -0x6e8(%rbp)
jmp 0x3eac
movsd -0x428(%rbp), %xmm0
divsd -0x420(%rbp), %xmm0
movsd %xmm0, -0x6e8(%rbp)
movsd -0x6e8(%rbp), %xmm0
movsd %xmm0, -0x430(%rbp)
movq -0x10(%rbp), %rdi
addq $0x18, %rdi
leaq -0xa8(%rbp), %rsi
callq 0xa1f0
movsd %xmm0, -0x438(%rbp)
movsd -0x430(%rbp), %xmm1
mulsd -0x430(%rbp), %xmm1
movsd -0x438(%rbp), %xmm0
movsd -0x438(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
movsd 0x70ed(%rip), %xmm2     # 0xb008
addsd %xmm2, %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm0, %xmm1
movsd 0x70c6(%rip), %xmm0     # 0xb008
addsd %xmm0, %xmm1
movsd %xmm1, -0x440(%rbp)
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x3fb9
movq -0x78(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x6f0(%rbp)
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x470(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x3730
leaq -0x458(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x470(%rbp), %rdx
callq 0x9fa0
movq -0x6a8(%rbp), %rdi
movq -0x6f0(%rbp), %rsi
leaq -0x458(%rbp), %rdx
callq 0x9ee0
jmp 0x43f6
movq -0x10(%rbp), %rsi
addq $0x18, %rsi
movsd -0x430(%rbp), %xmm0
leaq -0x4b8(%rbp), %rdi
callq 0xa000
movb -0x411(%rbp), %dl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl $0x1, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x6f8(%rbp)
movsd -0x438(%rbp), %xmm0
movsd %xmm0, -0x708(%rbp)
movsd -0x430(%rbp), %xmm0
movsd %xmm0, -0x700(%rbp)
movsd -0x440(%rbp), %xmm0
callq 0x20d0
movsd -0x708(%rbp), %xmm1
movsd -0x700(%rbp), %xmm3
movaps %xmm0, %xmm2
movsd -0x6f8(%rbp), %xmm0
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
leaq -0x4d0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xa000
leaq -0x4a0(%rbp), %rdi
leaq -0x4b8(%rbp), %rsi
leaq -0x4d0(%rbp), %rdx
callq 0x9f40
leaq -0x4a0(%rbp), %rdi
callq 0xa170
movq %rax, %rsi
leaq -0x488(%rbp), %rdi
callq 0x9ea0
movsd -0x428(%rbp), %xmm0
subsd -0x420(%rbp), %xmm0
movsd %xmm0, -0x4d8(%rbp)
movsd -0x428(%rbp), %xmm0
addsd -0x420(%rbp), %xmm0
movsd %xmm0, -0x4e0(%rbp)
movsd -0x4d8(%rbp), %xmm0
mulsd -0x4d8(%rbp), %xmm0
movsd -0x4e0(%rbp), %xmm1
mulsd -0x4e0(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x4e8(%rbp)
testb $0x1, -0x411(%rbp)
je 0x4121
movsd -0x438(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x710(%rbp)
jmp 0x413c
leaq -0x488(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xa1f0
movsd %xmm0, -0x710(%rbp)
movsd -0x710(%rbp), %xmm1
movsd 0x6ebc(%rip), %xmm0     # 0xb008
subsd %xmm1, %xmm0
movsd %xmm0, -0x4f0(%rbp)
movsd -0x4e8(%rbp), %xmm1
movsd 0x6ea0(%rip), %xmm0     # 0xb008
subsd -0x4e8(%rbp), %xmm0
mulsd -0x4f0(%rbp), %xmm0
mulsd -0x4f0(%rbp), %xmm0
mulsd -0x4f0(%rbp), %xmm0
mulsd -0x4f0(%rbp), %xmm0
movsd -0x4f0(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x4f8(%rbp)
movsd 0x6e58(%rip), %xmm0     # 0xb008
subsd -0x4f8(%rbp), %xmm0
movsd %xmm0, -0x500(%rbp)
movsd -0x4f8(%rbp), %xmm0
movsd 0x6fb0(%rip), %xmm1     # 0xb180
mulsd %xmm1, %xmm0
movsd 0x6e3c(%rip), %xmm1     # 0xb018
addsd %xmm1, %xmm0
movsd %xmm0, -0x508(%rbp)
movsd -0x4f8(%rbp), %xmm0
divsd -0x508(%rbp), %xmm0
movsd %xmm0, -0x510(%rbp)
movsd -0x500(%rbp), %xmm0
movsd 0x6df8(%rip), %xmm1     # 0xb008
subsd -0x508(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x518(%rbp)
movq -0x78(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x718(%rbp)
cmpl $0x2, -0x14(%rbp)
jle 0x4301
callq 0x4bc0
movaps %xmm0, %xmm1
movsd -0x508(%rbp), %xmm0
ucomisd %xmm1, %xmm0
jbe 0x428a
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x560(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x3730
movsd -0x510(%rbp), %xmm0
leaq -0x548(%rbp), %rdi
leaq -0x560(%rbp), %rsi
callq 0xa000
jmp 0x42fc
leaq -0x5c0(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9ea0
leaq -0x5d8(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x9ea0
leaq -0x5a8(%rbp), %rdi
leaq -0x5c0(%rbp), %rsi
leaq -0x5d8(%rbp), %rdx
callq 0x8bc0
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x578(%rbp), %rdi
leaq -0x5a8(%rbp), %rsi
callq 0x3730
movsd -0x518(%rbp), %xmm0
leaq -0x548(%rbp), %rdi
leaq -0x578(%rbp), %rsi
callq 0xa000
jmp 0x43c2
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x608(%rbp), %rdi
leaq -0x3b0(%rbp), %rsi
callq 0x3730
movsd -0x4f8(%rbp), %xmm0
leaq -0x5f0(%rbp), %rdi
leaq -0x608(%rbp), %rsi
callq 0xa000
leaq -0x680(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x9ea0
leaq -0x698(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0x9ea0
leaq -0x668(%rbp), %rdi
leaq -0x680(%rbp), %rsi
leaq -0x698(%rbp), %rdx
callq 0x8bc0
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
leaq -0x638(%rbp), %rdi
leaq -0x668(%rbp), %rsi
callq 0x3730
movsd -0x500(%rbp), %xmm0
leaq -0x620(%rbp), %rdi
leaq -0x638(%rbp), %rsi
callq 0xa000
leaq -0x548(%rbp), %rdi
leaq -0x5f0(%rbp), %rsi
leaq -0x620(%rbp), %rdx
callq 0x9ee0
leaq -0x530(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x548(%rbp), %rdx
callq 0x9fa0
movq -0x6a8(%rbp), %rdi
movq -0x718(%rbp), %rsi
leaq -0x530(%rbp), %rdx
callq 0x9ee0
movq -0x6a0(%rbp), %rax
addq $0x720, %rsp            # imm = 0x720
popq %rbp
retq
nopw %cs:(%rax,%rax)