// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/solid_dynamics.c
// Function: IntegrateSurfaceForce
void IntegrateSurfaceForce(Space *space, const Model *model)
{
    const Partition *const part = &(space->part);
    const Node *const node = space->node;
    Geometry *const geo = &(space->geo);
    const IntVec nMin = {part->ns[PIN][X][MIN], part->ns[PIN][Y][MIN], part->ns[PIN][Z][MIN]};
    const IntVec nMax = {part->ns[PIN][X][MAX], part->ns[PIN][Y][MAX], part->ns[PIN][Z][MAX]};
    const RealVec sMin = {part->domain[X][MIN], part->domain[Y][MIN], part->domain[Z][MIN]};
    const RealVec d = {part->d[X], part->d[Y], part->d[Z]};
    const RealVec dd = {part->dd[X], part->dd[Y], part->dd[Z]};
    const IntVec ng = {part->ng[X], part->ng[Y], part->ng[Z]};
    const Real zero = 0.0;
    const Real percent = FLT_EPSILON * FLT_EPSILON;
    Polyhedron *poly = NULL;
    int idx = 0; /* linear array index math variable */
    int box[DIMS][LIMIT] = {{0}}; /* bounding box in node space */
    int lidN = 0; /* count total number of interfacial nodes */
    int gstN = 0; /* count total number of ghost nodes */
    RealVec pG = {zero}; /* ghost point */
    RealVec pO = {zero}; /* boundary point */
    RealVec pI = {zero}; /* image point */
    RealVec N = {zero}; /* normal */
    Real Uo[DIMUo] = {zero};
    RealVec V = {zero}; /* velocity vector */
    RealVec r = {zero}; /* position vector */
    RealVec Fp = {zero}; /* pressure force */
    RealVec Fv = {zero}; /* viscous force */
    RealVec Fs = {zero}; /* surface force */
    RealVec Tt = {zero}; /* torque */
    RealVec fvar = {zero}; /* force offset, mean, variance */
    Real Vn = zero; /* velocity projection */
    Real mu = zero; /* viscosity */
    Real ds = zero; /* infinitesimal area for integration */
    for (int n = 0; n < geo->totN; ++n) {
        poly = geo->poly + n;
        if (0 < poly->state) { /* surface force negligible */
            continue;
        }
        /* reset some non accumulative information to zero */
        memset(poly->Fp, 0, DIMS * sizeof(*poly->Fp));
        memset(poly->Fv, 0, DIMS * sizeof(*poly->Fv));
        memset(poly->Tt, 0, DIMS * sizeof(*poly->Tt));
        memset(fvar, 0, DIMS * sizeof(*fvar));
        lidN = 0;
        gstN = 0;
        /* determine search range according to bounding box of polyhedron and valid node space */
        for (int s = 0; s < DIMS; ++s) {
            box[s][MIN] = ConfineSpace(MapNode(poly->box[s][MIN], sMin[s], dd[s], ng[s]), nMin[s], nMax[s]);
            box[s][MAX] = ConfineSpace(MapNode(poly->box[s][MAX], sMin[s], dd[s], ng[s]), nMin[s], nMax[s]) + 1;
        }
        for (int k = box[Z][MIN]; k < box[Z][MAX]; ++k) {
            for (int j = box[Y][MIN]; j < box[Y][MAX]; ++j) {
                for (int i = box[X][MIN]; i < box[X][MAX]; ++i) {
                    idx = IndexNode(k, j, i, part->n[Y], part->n[X]);
                    if ((2 == node[idx].lid) && (n + 1 == node[idx].did)) {
                        ++lidN; /* an interfacial node of current geometry */
                    }
                    if ((2 != node[idx].gst) || (n + 1 != node[idx].did)) {
                        continue;
                    }
                    ++gstN; /* a ghost node of current geometry */
                    /* surface force exerted by fluid (pressure + shear force) */
                    pG[X] = MapPoint(i, sMin[X], d[X], ng[X]);
                    pG[Y] = MapPoint(j, sMin[Y], d[Y], ng[Y]);
                    pG[Z] = MapPoint(k, sMin[Z], d[Z], ng[Z]);
                    ComputeGeometricData(pG, node[idx].fid, poly, pO, pI, N);
                    r[X] = pO[X] - poly->O[X];
                    r[Y] = pO[Y] - poly->O[Y];
                    r[Z] = pO[Z] - poly->O[Z];
                    MapPrimitive(model->gamma, model->gasR, node[idx].U[TO], Uo);
                    Fp[X] = Uo[4] * N[X];
                    Fp[Y] = Uo[4] * N[Y];
                    Fp[Z] = Uo[4] * N[Z];
                    if (1 == gstN) {
                        fvar[0] = Uo[4];
                    }
                    fvar[1] = fvar[1] + Uo[4] - fvar[0];
                    fvar[2] = fvar[2] + (Uo[4] - fvar[0]) * (Uo[4] - fvar[0]);
                    if ((zero < model->refMu) && (zero < poly->cf)) {
                        mu = model->refMu * Viscosity(Uo[5] * model->refT);
                        Cross(poly->W[TO], r, V);
                        V[X] = Uo[1] - (poly->V[TO][X] + V[X]);
                        V[Y] = Uo[2] - (poly->V[TO][Y] + V[Y]);
                        V[Z] = Uo[3] - (poly->V[TO][Z] + V[Z]);
                        Vn = Dot(V, N);
                        Fv[X] = mu * (V[X] - Vn * N[X]) / Dist(pG, pO);
                        Fv[Y] = mu * (V[Y] - Vn * N[Y]) / Dist(pG, pO);
                        Fv[Z] = mu * (V[Z] - Vn * N[Z]) / Dist(pG, pO);
                    } else {
                        memset(Fv, 0, DIMS * sizeof(*Fv));
                    }
                    Fs[X] = Fp[X] + Fv[X];
                    Fs[Y] = Fp[Y] + Fv[Y];
                    Fs[Z] = Fp[Z] + Fv[Z];
                    Cross(r, Fs, Tt);
                    /* integration sum */
                    for (int s = 0; s < DIMS; ++s) {
                        poly->Fp[s] = poly->Fp[s] + Fp[s];
                        poly->Fv[s] = poly->Fv[s] + Fv[s];
                        poly->Tt[s] = poly->Tt[s] + Tt[s];
                    }
                }
            }
        }
        /* calibrate the sum of discrete forces into integration */
        if ((0 == lidN) || (0 == gstN)) { /* no surface force exerted */
            continue;
        }
        ds = poly->area / lidN;
        fvar[2] = (fvar[2] - fvar[1] * fvar[1] / gstN) / gstN; /* variance */
        fvar[1] = fvar[1] / gstN + fvar[0]; /* mean */
        if (percent * fvar[1] * fvar[1] > fvar[2]) { /* recover equilibrium state and ignore integration error */
            ds = zero;
        }
        for (int s = 0; s < DIMS; ++s) {
            poly->Fp[s] = -poly->Fp[s] * ds;
            poly->Fv[s] = -poly->Fv[s] * ds;
            poly->Tt[s] = -poly->Tt[s] * ds;
        }
    }
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2e0, %rsp            # imm = 0x2E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl 0x68(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
movl 0x70(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl 0x78(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl 0x6c(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movl 0x74(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movl 0x7c(%rax), %eax
movl %eax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movsd 0x3c8(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movq -0x18(%rbp), %rax
movsd 0x3d8(%rax), %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x18(%rbp), %rax
movsd 0x3e8(%rax), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x18(%rbp), %rax
movsd 0x30(%rax), %xmm0
movsd %xmm0, -0x80(%rbp)
movq -0x18(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x18(%rbp), %rax
movsd 0x40(%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x18(%rbp), %rax
movsd 0x48(%rax), %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x18(%rbp), %rax
movsd 0x50(%rax), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x18(%rbp), %rax
movsd 0x58(%rax), %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0xac(%rbp)
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0xa4(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd 0xae2c(%rip), %xmm0     # 0x2ad48
movsd %xmm0, -0xc0(%rbp)
movq $0x0, -0xc8(%rbp)
movl $0x0, -0xcc(%rbp)
leaq -0xf0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
movl $0x0, -0xf4(%rbp)
movl $0x0, -0xf8(%rbp)
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x130(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x150(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x170(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x1a0(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x20d0
leaq -0x1c0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x1e0(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x200(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x240(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x260(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x280(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
xorps %xmm0, %xmm0
movsd %xmm0, -0x288(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x290(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x298(%rbp)
movl $0x0, -0x29c(%rbp)
movl -0x29c(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x20b87
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x29c(%rbp), %rcx
imulq $0x238, %rcx, %rcx      # imm = 0x238
addq %rcx, %rax
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rcx
xorl %eax, %eax
cmpl 0xc(%rcx), %eax
jge 0x200b4
jmp 0x20b73
movq -0xc8(%rbp), %rdi
addq $0x158, %rdi            # imm = 0x158
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
movq -0xc8(%rbp), %rdi
addq $0x170, %rdi            # imm = 0x170
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
movq -0xc8(%rbp), %rdi
addq $0x188, %rdi            # imm = 0x188
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
leaq -0x280(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
movl $0x0, -0xf4(%rbp)
movl $0x0, -0xf8(%rbp)
movl $0x0, -0x2a0(%rbp)
cmpl $0x3, -0x2a0(%rbp)
jge 0x20250
movq -0xc8(%rbp), %rax
addq $0x1d0, %rax            # imm = 0x1D0
movslq -0x2a0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movslq -0x2a0(%rbp), %rax
movsd -0x60(%rbp,%rax,8), %xmm1
movslq -0x2a0(%rbp), %rax
movsd -0xa0(%rbp,%rax,8), %xmm2
movslq -0x2a0(%rbp), %rax
movl -0xac(%rbp,%rax,4), %edi
callq 0x95b0
movl %eax, %edi
movslq -0x2a0(%rbp), %rax
movl -0x34(%rbp,%rax,4), %esi
movslq -0x2a0(%rbp), %rax
movl -0x40(%rbp,%rax,4), %edx
callq 0x95f0
movl %eax, %ecx
movslq -0x2a0(%rbp), %rax
movl %ecx, -0xf0(%rbp,%rax,8)
movq -0xc8(%rbp), %rax
addq $0x1d0, %rax            # imm = 0x1D0
movslq -0x2a0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movslq -0x2a0(%rbp), %rax
movsd -0x60(%rbp,%rax,8), %xmm1
movslq -0x2a0(%rbp), %rax
movsd -0xa0(%rbp,%rax,8), %xmm2
movslq -0x2a0(%rbp), %rax
movl -0xac(%rbp,%rax,4), %edi
callq 0x95b0
movl %eax, %edi
movslq -0x2a0(%rbp), %rax
movl -0x34(%rbp,%rax,4), %esi
movslq -0x2a0(%rbp), %rax
movl -0x40(%rbp,%rax,4), %edx
callq 0x95f0
movl %eax, %ecx
addl $0x1, %ecx
movslq -0x2a0(%rbp), %rax
movl %ecx, -0xec(%rbp,%rax,8)
movl -0x2a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a0(%rbp)
jmp 0x20133
movl -0xe0(%rbp), %eax
movl %eax, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jge 0x20996
movl -0xe8(%rbp), %eax
movl %eax, -0x2a8(%rbp)
movl -0x2a8(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x20980
movl -0xf0(%rbp), %eax
movl %eax, -0x2ac(%rbp)
movl -0x2ac(%rbp), %eax
cmpl -0xec(%rbp), %eax
jge 0x2096a
movl -0x2a4(%rbp), %edi
movl -0x2a8(%rbp), %esi
movl -0x2ac(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0xc(%rax), %r8d
callq 0x9500
movl %eax, -0xcc(%rbp)
movq -0x20(%rbp), %rcx
movslq -0xcc(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rcx
movl $0x2, %eax
cmpl 0x8(%rcx), %eax
jne 0x20326
movl -0x29c(%rbp), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
movslq -0xcc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
jne 0x20326
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
movq -0x20(%rbp), %rcx
movslq -0xcc(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rcx
movl $0x2, %eax
cmpl 0xc(%rcx), %eax
jne 0x20367
movl -0x29c(%rbp), %eax
addl $0x1, %eax
movq -0x20(%rbp), %rcx
movslq -0xcc(%rbp), %rdx
imulq $0x88, %rdx, %rdx
addq %rdx, %rcx
cmpl (%rcx), %eax
je 0x2036c
jmp 0x20956
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
movl -0x2ac(%rbp), %edi
movsd -0x60(%rbp), %xmm0
movsd -0x80(%rbp), %xmm1
movl -0xac(%rbp), %esi
callq 0x9690
movsd %xmm0, -0x110(%rbp)
movl -0x2a8(%rbp), %edi
movsd -0x58(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movl -0xa8(%rbp), %esi
callq 0x9690
movsd %xmm0, -0x108(%rbp)
movl -0x2a4(%rbp), %edi
movsd -0x50(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0xa4(%rbp), %esi
callq 0x9690
movsd %xmm0, -0x100(%rbp)
leaq -0x110(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0xcc(%rbp), %rcx
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl 0x4(%rax), %esi
movq -0xc8(%rbp), %rdx
leaq -0x130(%rbp), %rcx
leaq -0x150(%rbp), %r8
leaq -0x170(%rbp), %r9
callq 0x104e0
movsd -0x130(%rbp), %xmm0
movq -0xc8(%rbp), %rax
subsd 0x20(%rax), %xmm0
movsd %xmm0, -0x1e0(%rbp)
movsd -0x128(%rbp), %xmm0
movq -0xc8(%rbp), %rax
subsd 0x28(%rax), %xmm0
movsd %xmm0, -0x1d8(%rbp)
movsd -0x120(%rbp), %xmm0
movq -0xc8(%rbp), %rax
subsd 0x30(%rax), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movq -0x10(%rbp), %rax
movsd 0x40(%rax), %xmm0
movq -0x10(%rbp), %rax
movsd 0x48(%rax), %xmm1
movq -0x20(%rbp), %rdi
movslq -0xcc(%rbp), %rax
imulq $0x88, %rax, %rax
addq %rax, %rdi
addq $0x10, %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x9250
movsd -0x180(%rbp), %xmm0
mulsd -0x170(%rbp), %xmm0
movsd %xmm0, -0x200(%rbp)
movsd -0x180(%rbp), %xmm0
mulsd -0x168(%rbp), %xmm0
movsd %xmm0, -0x1f8(%rbp)
movsd -0x180(%rbp), %xmm0
mulsd -0x160(%rbp), %xmm0
movsd %xmm0, -0x1f0(%rbp)
movl $0x1, %eax
cmpl -0xf8(%rbp), %eax
jne 0x20514
movsd -0x180(%rbp), %xmm0
movsd %xmm0, -0x280(%rbp)
movsd -0x278(%rbp), %xmm0
addsd -0x180(%rbp), %xmm0
subsd -0x280(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
movsd -0x270(%rbp), %xmm1
movsd -0x180(%rbp), %xmm0
subsd -0x280(%rbp), %xmm0
movsd -0x180(%rbp), %xmm2
subsd -0x280(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x270(%rbp)
movq -0x10(%rbp), %rax
movsd 0x38(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x207fa
movq -0xc8(%rbp), %rax
movsd 0x1b8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x207fa
movq -0x10(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd %xmm0, -0x2d8(%rbp)
movsd -0x178(%rbp), %xmm0
movq -0x10(%rbp), %rax
mulsd 0x70(%rax), %xmm0
callq 0x91f0
movaps %xmm0, %xmm1
movsd -0x2d8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, -0x290(%rbp)
movq -0xc8(%rbp), %rdi
addq $0xb0, %rdi
leaq -0x1e0(%rbp), %rsi
leaq -0x1c0(%rbp), %rdx
callq 0x99b0
movsd -0x198(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movsd 0x80(%rax), %xmm1
addsd -0x1c0(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x1c0(%rbp)
movsd -0x190(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movsd 0x88(%rax), %xmm1
addsd -0x1b8(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x1b8(%rbp)
movsd -0x188(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movsd 0x90(%rax), %xmm1
addsd -0x1b0(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x1b0(%rbp)
leaq -0x1c0(%rbp), %rdi
leaq -0x170(%rbp), %rsi
callq 0x9880
movsd %xmm0, -0x288(%rbp)
movsd -0x290(%rbp), %xmm0
movsd -0x1c0(%rbp), %xmm2
movsd -0x288(%rbp), %xmm1
movsd -0x170(%rbp), %xmm3
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x2d0(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x9980
movaps %xmm0, %xmm1
movsd -0x2d0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x220(%rbp)
movsd -0x290(%rbp), %xmm0
movsd -0x1b8(%rbp), %xmm2
movsd -0x288(%rbp), %xmm1
movsd -0x168(%rbp), %xmm3
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x2c8(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x9980
movaps %xmm0, %xmm1
movsd -0x2c8(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x218(%rbp)
movsd -0x290(%rbp), %xmm0
movsd -0x1b0(%rbp), %xmm2
movsd -0x288(%rbp), %xmm1
movsd -0x160(%rbp), %xmm3
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm3, %xmm1
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x2c0(%rbp)
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x9980
movaps %xmm0, %xmm1
movsd -0x2c0(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x210(%rbp)
jmp 0x2080d
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x20d0
movsd -0x200(%rbp), %xmm0
addsd -0x220(%rbp), %xmm0
movsd %xmm0, -0x240(%rbp)
movsd -0x1f8(%rbp), %xmm0
addsd -0x218(%rbp), %xmm0
movsd %xmm0, -0x238(%rbp)
movsd -0x1f0(%rbp), %xmm0
addsd -0x210(%rbp), %xmm0
movsd %xmm0, -0x230(%rbp)
leaq -0x1e0(%rbp), %rdi
leaq -0x240(%rbp), %rsi
leaq -0x260(%rbp), %rdx
callq 0x99b0
movl $0x0, -0x2b0(%rbp)
cmpl $0x3, -0x2b0(%rbp)
jge 0x20954
movq -0xc8(%rbp), %rax
movslq -0x2b0(%rbp), %rcx
movsd 0x158(%rax,%rcx,8), %xmm0
movslq -0x2b0(%rbp), %rax
addsd -0x200(%rbp,%rax,8), %xmm0
movq -0xc8(%rbp), %rax
movslq -0x2b0(%rbp), %rcx
movsd %xmm0, 0x158(%rax,%rcx,8)
movq -0xc8(%rbp), %rax
movslq -0x2b0(%rbp), %rcx
movsd 0x170(%rax,%rcx,8), %xmm0
movslq -0x2b0(%rbp), %rax
addsd -0x220(%rbp,%rax,8), %xmm0
movq -0xc8(%rbp), %rax
movslq -0x2b0(%rbp), %rcx
movsd %xmm0, 0x170(%rax,%rcx,8)
movq -0xc8(%rbp), %rax
movslq -0x2b0(%rbp), %rcx
movsd 0x188(%rax,%rcx,8), %xmm0
movslq -0x2b0(%rbp), %rax
addsd -0x260(%rbp,%rax,8), %xmm0
movq -0xc8(%rbp), %rax
movslq -0x2b0(%rbp), %rcx
movsd %xmm0, 0x188(%rax,%rcx,8)
movl -0x2b0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b0(%rbp)
jmp 0x20879
jmp 0x20956
movl -0x2ac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2ac(%rbp)
jmp 0x20298
jmp 0x2096c
movl -0x2a8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a8(%rbp)
jmp 0x2027a
jmp 0x20982
movl -0x2a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a4(%rbp)
jmp 0x2025c
xorl %eax, %eax
cmpl -0xf4(%rbp), %eax
je 0x209aa
xorl %eax, %eax
cmpl -0xf8(%rbp), %eax
jne 0x209af
jmp 0x20b73
movq -0xc8(%rbp), %rax
movsd 0x1c0(%rax), %xmm0
cvtsi2sdl -0xf4(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x298(%rbp)
movsd -0x270(%rbp), %xmm0
movsd -0x278(%rbp), %xmm1
mulsd -0x278(%rbp), %xmm1
cvtsi2sdl -0xf8(%rbp), %xmm2
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
cvtsi2sdl -0xf8(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x270(%rbp)
movsd -0x278(%rbp), %xmm0
cvtsi2sdl -0xf8(%rbp), %xmm1
divsd %xmm1, %xmm0
addsd -0x280(%rbp), %xmm0
movsd %xmm0, -0x278(%rbp)
movsd 0xa30e(%rip), %xmm0     # 0x2ad48
mulsd -0x278(%rbp), %xmm0
mulsd -0x278(%rbp), %xmm0
ucomisd -0x270(%rbp), %xmm0
jbe 0x20a5f
xorps %xmm0, %xmm0
movsd %xmm0, -0x298(%rbp)
movl $0x0, -0x2b4(%rbp)
cmpl $0x3, -0x2b4(%rbp)
jge 0x20b71
movq -0xc8(%rbp), %rax
movslq -0x2b4(%rbp), %rcx
movsd 0x158(%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd -0x298(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movslq -0x2b4(%rbp), %rcx
movsd %xmm0, 0x158(%rax,%rcx,8)
movq -0xc8(%rbp), %rax
movslq -0x2b4(%rbp), %rcx
movsd 0x170(%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd -0x298(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movslq -0x2b4(%rbp), %rcx
movsd %xmm0, 0x170(%rax,%rcx,8)
movq -0xc8(%rbp), %rax
movslq -0x2b4(%rbp), %rcx
movsd 0x188(%rax,%rcx,8), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd -0x298(%rbp), %xmm0
movq -0xc8(%rbp), %rax
movslq -0x2b4(%rbp), %rcx
movsd %xmm0, 0x188(%rax,%rcx,8)
movl -0x2b4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2b4(%rbp)
jmp 0x20a69
jmp 0x20b73
movl -0x29c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x29c(%rbp)
jmp 0x2006f
addq $0x2e0, %rsp            # imm = 0x2E0
popq %rbp
retq