// File: /workspace/github_cpp_makefile_star2_O1/intheswim[P]FractalTubes/infra.cpp
// Function: redrawMethod()
void redrawMethod()
{    
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
    
	glLoadIdentity();
    
    float tX = x_shift;
    
    float tY = 0;
    
    float tZ = -3.0f + 0.5 * cos(rotation * 0.02f);
    
    float angle = 2.0 * rotation;
    float rX = 1.0 ;
    float rY = 0.5;
    float rZ = 0.5 ;
    
#ifdef USE_RUNTIME
    tZ = tX = 0;
    
    tZ = -3.0f + baseZ;
    
    angle = baseY + 2 * rotation;
    rX = 1;
    rY = 0;
    rZ = 0;
    
    float rX2 = 0;
    float rY2 = 1;
    float rZ2 = 0;
    float angle2 = baseX;
#endif
    
    double eye_x = 0, eye_y = 0, eye_z = 0;
    
  	glTranslated ( tX, tY, tZ );
    glRotated ( angle, rX, rY, rZ ); // (angle, x, y, z)
    
#ifdef USE_RUNTIME
    glRotated ( angle2, rX2, rY2, rZ2 );
#endif
    
    getTransformedCoords (0, 0, 0, -tX, -tY, -tZ,
                          -angle, rX, rY, rZ,
                          eye_x, eye_y, eye_z);
    
#ifdef USE_RUNTIME
    getTransformedCoords (eye_x, eye_y, eye_z, 0, 0, 0,
                          -angle2, rX2, rY2, rZ2,
                          eye_x, eye_y, eye_z);
#endif
        
    double shine = shineFactor;
    
    if (USE_LIGHT)
    {
        glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, light2Sides);
        
        GLfloat ambGlobal[] = { 0.2, 0.2, 0.2, 1.0 };
        
        for (int i=0; i < 3; i++)
        {
            ambGlobal[i] += (float)(shine * 0.06f);
        }
        
        glLightModelfv (GL_LIGHT_MODEL_AMBIENT, ambGlobal);
        
        GLfloat light_position[4] = { 0.0, 5.0, 0.0, 1.0 };
            
        for (int i=0; i < 3; i++)
        {
            light_position[i] = -distance2Light;
        }
    
        glLightfv( GL_LIGHT0, GL_POSITION, light_position);
        
        float ambK = (1 - shine * 0.05) ;
        
        GLfloat ambientColor[] = { ambK, ambK, ambK, 1 };
        glLightfv (GL_LIGHT0, GL_AMBIENT, ambientColor);

        float diffK = (1 - shine * 0.09) ;
        
        GLfloat diffuseColor[] = { diffK, diffK, diffK, 1 };
        glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuseColor);

        float specK = (0.1 + shine * 0.09) ;
        
        GLfloat specularColor[] = { specK, specK, specK, 0.0 };
        glLightfv (GL_LIGHT0, GL_SPECULAR, specularColor);
        
        GLfloat mat_ambient_front[] = { 0.1f, 0.1f, 0.9f, (float)image_alpha };
        
        glMaterialfv(GL_FRONT_AND_BACK, GL_AMBIENT, mat_ambient_front);
        
        GLfloat mat_diffuse_back[] = { 0, 0, 0, (float)image_alpha };
        
        glMaterialfv(GL_BACK, GL_DIFFUSE, mat_diffuse_back);
                
        float specMat = 0.1 + shine * 0.08;
        
        GLfloat mat_specular[] = { (float)(image_alpha * specMat * 0.5f), 
                                    (float)(image_alpha * specMat), 
                                    (float)(image_alpha * specMat), 
                                    (float)(image_alpha) };
    
        glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
    
        GLfloat mat_shininess[] = { 7.0 };
        
        mat_shininess[0] += (float)(12.0f * shine);
    
        glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);
    
        glShadeModel ( SHADE_MODE );
        
    } // USE_LIGHT
    
    
    long core_cnt = 0;
    
    // we sort "cores" (centers of the "rings") by distance to the observer, starting from far to near.
    // Then for each core we draw the correspomding "ring", in 2 phases:
    // forst "back/rear" points, then "front".
    // This way we make sure that all points are distplayed from "back" to "front" and
    // correspondingly we can show as many leves of transparency as we want.
    // (See polygon transparency order OpenGL issue for more detail).
    
    // P.S.
    // Original code had no "separate" rings. They were all part of one big spiral.
    // When drawing as points this had no difference; however when drawing as connected
    // "rectangles" it was not possible to guarantee 100% that all points appear from
    // back to front, even with additional hacks I tried there was still part of the
    // "ring" which was showing the split line.
    
    if (corePoints != NULL)
    {
        core_cnt = m3d_pt_count / m3d_pt_cycle;
        
        sortByDistanceToEye (eye_x, eye_y, eye_z, corePoints, core_cnt);
    }
           
    glBegin ( GL_QUADS ); 
    {
        for (int core = 0; core < core_cnt; core++)
        {
            struct corePointData *cpd = &(corePoints[core]);
            
            for (int mode = 0; mode < 2; mode++)
            {
                for (int j = 0; j < m3d_pt_cycle; j++)
                    // for (int i=0, next = grid_step; i < m3d_pt_count - grid_step - 1; i++, next++)
                    // for (int i = m3d_pt_count - grid_step - 2, next = i + grid_step; i >= 0; i--, next--)
                {
                    int i = cpd->index + j;
                    int next = i + grid_step;
                    
                    if (next >= m3d_pt_count - 1)
                    {
                        continue;
                    }
                    
                    struct pointData *pd = pointData + i;
                    
                    bool show = (pd->ucGreen > 0 || pd->ucBlue > 0 || pd->ucRed > 0);
                    
                    if (show == false)
                    {
                        continue;
                    }
                    
                    double vx = eye_x - pd->x;
                    double vy = eye_y - pd->y;
                    double vz = eye_z - pd->z;
                    
                    if (mode==0) { pd->cMult = 0; }
                    
                    if (mode == 0)
                    {
                       // if (mult > 0) continue; // passes back only
                        double mult = vx * pd->normx + vy * pd->normy + vz * pd->normz;
                        pd->cMult = (mult < 0) ? -1 : 1;
                        
                        if (pd->cMult > 0) continue;
                    }
                    else
                    {
                        if (pd->cMult <= 0) continue; // passes front only
                    }
                    
                    float b = pd->ucBlue;
                    float g = pd->ucGreen;
                    float r = pd->ucRed;
                    
                    if (g > 0 || b > 0)
                    {
                        if (image_alpha == 1.0)
                        {
                            glColor4ub( r, g, b, (unsigned char)(stdAlpha * 255.0));                            
                        }
                        else
                        {
                            glColor4ub( r * image_alpha, g * image_alpha , b * image_alpha, (unsigned char)(stdAlpha * 255.0));
                        }
                    }
                    else
                    {
                        if (pd->ucRed > 0)
                        {
                            float alpha = r;
                            
                            float alpha2 = r * (2.0 - r /255.0f);
                                                        
                            alpha = 0.5 * (alpha + alpha2);
                            
                            glColor4ub ( (unsigned char)(r * image_alpha), 0, 0, (unsigned char)(alpha * image_alpha));
                        }
                    }
                    
                    
                    if ( USE_LIGHT )
                    {
                        glNormal3d ( pd->normx, pd->normy, pd->normz );
                    }

                    for (int mode2=0; mode2 < 2; mode2++)
                    {
                        if (mode2==1)
                        {
                            glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
                        }
                        else
                        {
                            glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
                        }
                    
                        struct pointData *pdNext = pointData + next;
                    
                        if (j + 1 == m3d_pt_cycle) // last point connects to first on this "ring"
                        {
                            struct pointData *pd1 = pointData + (i + 1 - grid_step);
                        
                            struct pointData *pdNext1 = pointData + (next + 1 - grid_step);
                        
                            glVertex3d ( pd->x , pd->y , pd->z );
                            glVertex3d ( pd1->x , pd1->y , pd1->z );
                            glVertex3d ( pdNext1->x , pdNext1->y , pdNext1->z );
                            glVertex3d ( pdNext->x , pdNext->y , pdNext->z );
                        }
                        else
                        {
                            struct pointData *pd1 = pointData + (i + 1);
                        
                            struct pointData *pdNext1 = pointData + (next + 1);
                                                
                            glVertex3d ( pd->x , pd->y , pd->z );
                            glVertex3d ( pd1->x , pd1->y , pd1->z );
                            glVertex3d ( pdNext1->x , pdNext1->y , pdNext1->z );
                            glVertex3d ( pdNext->x , pdNext->y , pdNext->z );
                        }

                   }  // mode1
                    
                }
            }
        } // 2nd for

        glEnd();
    }
        
    glFlush();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movl $0x4100, %edi           # imm = 0x4100
callq 0x30b0
callq 0x3400
movss 0x80eb(%rip), %xmm0     # 0xc4c4
movss %xmm0, 0x10(%rsp)
movss 0x80e1(%rip), %xmm0     # 0xc4c8
mulss 0x4f0d(%rip), %xmm0     # 0x92fc
callq 0x3210
cvtss2sd %xmm0, %xmm0
mulsd 0x4e58(%rip), %xmm0     # 0x9258
addsd 0x4e58(%rip), %xmm0     # 0x9260
cvtsd2ss %xmm0, %xmm1
movss %xmm1, 0x1c(%rsp)
movss 0x80ae(%rip), %xmm0     # 0xc4c8
addss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtss2sd 0x10(%rsp), %xmm0
cvtss2sd %xmm1, %xmm2
xorps %xmm1, %xmm1
callq 0x3320
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x4e00(%rip), %xmm1     # 0x9250
movsd 0x4e00(%rip), %xmm2     # 0x9258
movaps %xmm2, %xmm3
callq 0x33d0
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
subss 0x10(%rsp), %xmm1
movss %xmm1, 0x28(%rsp)
subss 0x1c(%rsp), %xmm0
movss %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x4ddc(%rip), %xmm0     # 0x9268
divsd 0x4ddc(%rip), %xmm0     # 0x9270
movsd %xmm0, 0x8(%rsp)
callq 0x3610
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x3080
movsd 0x4d98(%rip), %xmm4     # 0x9250
movsd 0x20(%rsp), %xmm9
subsd %xmm9, %xmm4
movsd 0x4dac(%rip), %xmm3     # 0x9278
mulsd %xmm4, %xmm3
addsd %xmm9, %xmm3
movsd 0x4da3(%rip), %xmm5     # 0x9280
mulsd %xmm0, %xmm5
movsd 0x4d9f(%rip), %xmm2     # 0x9288
mulsd %xmm4, %xmm2
movapd %xmm2, %xmm1
subsd %xmm5, %xmm1
addsd %xmm5, %xmm2
mulsd 0x4d8f(%rip), %xmm4     # 0x9290
addsd %xmm4, %xmm9
mulsd 0x4d8a(%rip), %xmm0     # 0x9298
movapd %xmm4, %xmm6
subsd %xmm0, %xmm6
addsd %xmm4, %xmm0
xorps %xmm4, %xmm4
cvtss2sd 0x28(%rsp), %xmm4
movapd %xmm1, %xmm5
xorpd %xmm8, %xmm8
mulsd %xmm8, %xmm5
mulsd %xmm4, %xmm3
addsd %xmm5, %xmm3
xorps %xmm5, %xmm5
cvtss2sd 0x10(%rsp), %xmm5
movapd %xmm2, %xmm7
mulsd %xmm5, %xmm7
addsd %xmm3, %xmm7
movsd %xmm7, 0x58(%rsp)
movapd %xmm9, %xmm3
mulsd %xmm8, %xmm3
xorpd %xmm7, %xmm7
mulsd %xmm4, %xmm2
addsd %xmm3, %xmm2
mulsd %xmm5, %xmm6
addsd %xmm2, %xmm6
movsd %xmm6, 0x60(%rsp)
mulsd %xmm7, %xmm0
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
movapd %xmm9, %xmm0
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
cmpb $0x1, 0x7f32(%rip)      # 0xc4d0
jne 0x483f
movss 0x7f20(%rip), %xmm0     # 0xc4cc
movss %xmm0, 0x10(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movzbl 0x7f0e(%rip), %esi      # 0xc4d1
movl $0xb52, %edi            # imm = 0xB52
callq 0x3070
movaps 0x4d8c(%rip), %xmm0     # 0x9360
movaps %xmm0, 0x30(%rsp)
movss 0x4d1f(%rip), %xmm0     # 0x9300
mulss 0x10(%rsp), %xmm0
xorl %eax, %eax
movss 0x30(%rsp,%rax,4), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x30(%rsp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x45e9
leaq 0x30(%rsp), %rsi
movl $0xb53, %edi            # imm = 0xB53
callq 0x3620
movaps 0x4d58(%rip), %xmm0     # 0x9370
movaps %xmm0, 0xa0(%rsp)
movss 0x7eac(%rip), %xmm0     # 0xc4d4
xorps 0x4d11(%rip), %xmm0     # 0x9340
xorl %eax, %eax
movss %xmm0, 0xa0(%rsp,%rax,4)
incq %rax
cmpq $0x3, %rax
jne 0x4631
leaq 0xa0(%rsp), %rdx
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
callq 0x35b0
movsd 0x4c3e(%rip), %xmm0     # 0x92a0
mulsd 0x8(%rsp), %xmm0
movsd 0x4be0(%rip), %xmm1     # 0x9250
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0x100(%rsp), %rdx
movss %xmm0, (%rdx)
movss %xmm0, 0x4(%rdx)
movss %xmm0, 0x8(%rdx)
movl $0x3f800000, %ebx       # imm = 0x3F800000
movl %ebx, 0xc(%rdx)
movl $0x4000, %edi           # imm = 0x4000
movl $0x1200, %esi           # imm = 0x1200
callq 0x35b0
movsd 0x4bfb(%rip), %xmm1     # 0x92a8
mulsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
movsd 0x4b8f(%rip), %xmm0     # 0x9250
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0xf0(%rsp), %rdx
movss %xmm0, (%rdx)
movss %xmm0, 0x4(%rdx)
movss %xmm0, 0x8(%rdx)
movl %ebx, 0xc(%rdx)
movl $0x4000, %edi           # imm = 0x4000
movl $0x1201, %esi           # imm = 0x1201
callq 0x35b0
movsd 0x28(%rsp), %xmm0
addsd 0x4bb1(%rip), %xmm0     # 0x92b0
cvtsd2ss %xmm0, %xmm0
leaq 0xe0(%rsp), %rdx
movss %xmm0, (%rdx)
movss %xmm0, 0x4(%rdx)
movss %xmm0, 0x8(%rdx)
xorl %ebx, %ebx
movl %ebx, 0xc(%rdx)
movl $0x4000, %edi           # imm = 0x4000
movl $0x1202, %esi           # imm = 0x1202
callq 0x35b0
movabsq $0x3dcccccd3dcccccd, %rax # imm = 0x3DCCCCCD3DCCCCCD
leaq 0xd0(%rsp), %rdx
movq %rax, (%rdx)
movl $0x3f666666, 0x8(%rdx)  # imm = 0x3F666666
xorps %xmm0, %xmm0
cvtsd2ss 0x7d84(%rip), %xmm0     # 0xc4d8
movss %xmm0, 0xc(%rdx)
movl $0x408, %edi            # imm = 0x408
movl $0x1200, %esi           # imm = 0x1200
callq 0x3650
leaq 0xc0(%rsp), %rdx
movq $0x0, (%rdx)
movl %ebx, 0x8(%rdx)
xorps %xmm0, %xmm0
cvtsd2ss 0x7d53(%rip), %xmm0     # 0xc4d8
movss %xmm0, 0xc(%rdx)
movl $0x405, %edi            # imm = 0x405
movl $0x1201, %esi           # imm = 0x1201
callq 0x3650
movsd 0x8(%rsp), %xmm0
mulsd 0x4b11(%rip), %xmm0     # 0x92b8
addsd 0x4b01(%rip), %xmm0     # 0x92b0
cvtsd2ss %xmm0, %xmm0
movsd 0x7d1d(%rip), %xmm1     # 0xc4d8
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm2
mulsd 0x4a89(%rip), %xmm0     # 0x9258
cvtsd2ss %xmm0, %xmm0
leaq 0xb0(%rsp), %rdx
movss %xmm0, (%rdx)
movss %xmm2, 0x4(%rdx)
movss %xmm2, 0x8(%rdx)
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss %xmm0, 0xc(%rdx)
movl $0x408, %edi            # imm = 0x408
movl $0x1202, %esi           # imm = 0x1202
callq 0x3650
movss 0x10(%rsp), %xmm0
mulss 0x4af2(%rip), %xmm0     # 0x9304
addss 0x4aee(%rip), %xmm0     # 0x9308
leaq 0x9c(%rsp), %rdx
movss %xmm0, (%rdx)
movl $0x408, %edi            # imm = 0x408
movl $0x1601, %esi           # imm = 0x1601
callq 0x3650
movl $0x1d01, %edi           # imm = 0x1D01
callq 0x3580
movsd 0x58(%rsp), %xmm0
xorpd %xmm1, %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsp)
movsd 0x60(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x60(%rsp)
movsd 0x20(%rsp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x7c3e(%rip), %r14      # 0xc4b8
testq %r14, %r14
je 0x4ac1
movq 0x7c56(%rip), %rax      # 0xc4e0
movslq 0x7c57(%rip), %rcx      # 0xc4e8
cqto
idivq %rcx
movq %rax, %rbp
testq %rax, %rax
jle 0x4908
xorps %xmm2, %xmm2
cvtsd2ss 0x20(%rsp), %xmm2
xorps %xmm1, %xmm1
cvtsd2ss 0x60(%rsp), %xmm1
xorps %xmm0, %xmm0
cvtsd2ss 0x58(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
leaq 0x18(%r14), %rax
movq %rbp, %rcx
movsd -0x18(%rax), %xmm3
subsd %xmm0, %xmm3
movsd -0x10(%rax), %xmm4
subsd %xmm1, %xmm4
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
movsd -0x8(%rax), %xmm4
subsd %xmm2, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rax)
addq $0x28, %rax
decq %rcx
jne 0x48cc
testq %rbp, %rbp
je 0x4bb3
leaq (,%rbp,4), %rax
addq %rbp, %rax
leaq (%r14,%rax,8), %r15
bsrq %rbp, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
leaq -0x593(%rip), %rcx      # 0x43a1
movq %r14, %rdi
movq %r15, %rsi
callq 0x577a
cmpq $0x11, %rbp
jl 0x4ac8
leaq 0x28(%r14), %rbx
movl $0x28, %r12d
movq %r14, %rdi
leaq (%r14,%r12), %r13
movsd 0x18(%r14,%r12), %xmm0
ucomisd 0x18(%r14), %xmm0
ja 0x49d6
movq 0x10(%r13), %rax
movq %rax, 0x40(%rsp)
movupd (%r13), %xmm1
movapd %xmm1, 0x30(%rsp)
movq 0x20(%r13), %rax
ucomisd 0x18(%rdi), %xmm0
movq %r13, %rcx
jbe 0x49b8
movq %rbx, %rdx
leaq -0x28(%rdx), %rcx
movq -0x8(%rdx), %rsi
movq %rsi, 0x20(%rdx)
movupd -0x28(%rdx), %xmm1
movupd -0x18(%rdx), %xmm2
movupd %xmm2, 0x10(%rdx)
movupd %xmm1, (%rdx)
ucomisd -0x38(%rdx), %xmm0
movq %rcx, %rdx
ja 0x498f
movq 0x40(%rsp), %rdx
movq %rdx, 0x10(%rcx)
movapd 0x30(%rsp), %xmm1
movupd %xmm1, (%rcx)
movsd %xmm0, 0x18(%rcx)
movq %rax, 0x20(%rcx)
jmp 0x4a25
movq 0x20(%r13), %rax
movq %rax, 0x50(%rsp)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
subq %r12, %rdi
addq $0x50, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x3560
movapd 0x30(%rsp), %xmm0
movapd 0x40(%rsp), %xmm1
movupd %xmm0, (%r14)
movupd %xmm1, 0x10(%r14)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%r14)
addq $0x28, %r12
addq $0x28, %rbx
movq %r13, %rdi
cmpq $0x280, %r12            # imm = 0x280
jne 0x4956
addq $0x280, %r14            # imm = 0x280
movq 0x10(%r14), %rax
movq %rax, 0x40(%rsp)
movups (%r14), %xmm0
movaps %xmm0, 0x30(%rsp)
movsd 0x18(%r14), %xmm0
movq 0x20(%r14), %rax
ucomisd -0x10(%r14), %xmm0
movq %r14, %rcx
jbe 0x4a97
movq %r14, %rdx
leaq -0x28(%rdx), %rcx
movq -0x8(%rdx), %rsi
movq %rsi, 0x20(%rdx)
movupd -0x28(%rdx), %xmm1
movupd -0x18(%rdx), %xmm2
movupd %xmm2, 0x10(%rdx)
movupd %xmm1, (%rdx)
ucomisd -0x38(%rdx), %xmm0
movq %rcx, %rdx
ja 0x4a6e
movq 0x40(%rsp), %rdx
movq %rdx, 0x10(%rcx)
movapd 0x30(%rsp), %xmm1
movupd %xmm1, (%rcx)
movsd %xmm0, 0x18(%rcx)
movq %rax, 0x20(%rcx)
addq $0x28, %r14
cmpq %r15, %r14
jne 0x4a44
jmp 0x4bb3
xorl %ebp, %ebp
jmp 0x4bb3
cmpq $0x1, %rbp
je 0x4bb3
leaq 0x28(%r14), %rax
movq %r14, %rdi
movq %rax, %rbx
movsd 0x18(%rax), %xmm0
ucomisd 0x18(%r14), %xmm0
ja 0x4b54
movq 0x10(%rbx), %rax
movq %rax, 0x40(%rsp)
movupd (%rbx), %xmm1
movapd %xmm1, 0x30(%rsp)
movq 0x20(%rbx), %rax
ucomisd 0x18(%rdi), %xmm0
movq %rbx, %rcx
jbe 0x4b36
movq %rbx, %rdx
leaq -0x28(%rdx), %rcx
movq -0x8(%rdx), %rsi
movq %rsi, 0x20(%rdx)
movupd -0x28(%rdx), %xmm1
movupd -0x18(%rdx), %xmm2
movupd %xmm2, 0x10(%rdx)
movupd %xmm1, (%rdx)
ucomisd -0x38(%rdx), %xmm0
movq %rcx, %rdx
ja 0x4b0d
movq 0x40(%rsp), %rdx
movq %rdx, 0x10(%rcx)
movapd 0x30(%rsp), %xmm1
movupd %xmm1, (%rcx)
movsd %xmm0, 0x18(%rcx)
movq %rax, 0x20(%rcx)
jmp 0x4ba3
movq 0x20(%rbx), %rax
movq %rax, 0x50(%rsp)
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movaps %xmm1, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
movq %rbx, %rdx
subq %r14, %rdx
subq %rdx, %rdi
addq $0x50, %rdi
movq %r14, %rsi
callq 0x3560
movapd 0x30(%rsp), %xmm0
movapd 0x40(%rsp), %xmm1
movupd %xmm0, (%r14)
movupd %xmm1, 0x10(%r14)
movq 0x50(%rsp), %rax
movq %rax, 0x20(%r14)
leaq 0x28(%rbx), %rax
movq %rbx, %rdi
cmpq %r15, %rax
jne 0x4ad9
movl $0x7, %edi
callq 0x3090
testq %rbp, %rbp
jle 0x4fad
xorl %ecx, %ecx
movq %rbp, 0x78(%rsp)
movq 0x78e4(%rip), %rax      # 0xc4b8
movq %rcx, 0x80(%rsp)
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rax
addq $0x20, %rax
movq %rax, 0x88(%rsp)
movq $0x0, 0x68(%rsp)
cmpl $0x0, 0x78e8(%rip)      # 0xc4e8
jle 0x4f7f
xorl %ecx, %ecx
movq 0x88(%rsp), %rax
movslq (%rax), %rax
movq %rcx, 0x70(%rsp)
movslq %ecx, %rbp
addq %rax, %rbp
movslq 0x78c7(%rip), %rax      # 0xc4ec
movslq %ebp, %r14
addq %rax, %r14
movq 0x78ae(%rip), %rax      # 0xc4e0
decq %rax
cmpq %r14, %rax
jle 0x4f6c
movq 0x786b(%rip), %rdx      # 0xc4b0
imulq $0x38, %rbp, %rcx
movb 0x1(%rdx,%rcx), %al
movq %rcx, 0x10(%rsp)
addq %rcx, %rdx
movq %rdx, 0x8(%rsp)
testb %al, %al
jne 0x4c77
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x2(%rcx)
jne 0x4c77
movq 0x8(%rsp), %rcx
cmpb $0x0, (%rcx)
je 0x4f6c
cmpl $0x0, 0x68(%rsp)
je 0x4c8e
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x3(%rcx)
jg 0x4ce8
jmp 0x4f6c
movsd 0x20(%rsp), %xmm0
movq 0x8(%rsp), %rdx
subsd 0x18(%rdx), %xmm0
movsd 0x60(%rsp), %xmm1
subsd 0x10(%rdx), %xmm1
movsd 0x58(%rsp), %xmm2
subsd 0x8(%rdx), %xmm2
mulsd 0x28(%rdx), %xmm1
mulsd 0x20(%rdx), %xmm2
mulsd 0x30(%rdx), %xmm0
addsd %xmm1, %xmm2
addsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
seta %cl
negb %cl
orb $0x1, %cl
ucomisd %xmm0, %xmm1
movb %cl, 0x3(%rdx)
jbe 0x4f6c
movq 0x8(%rsp), %rcx
movb 0x2(%rcx), %dl
movzbl (%rcx), %ecx
movl %eax, %esi
orb %dl, %sil
je 0x4d3e
movsd 0x77d6(%rip), %xmm0     # 0xc4d8
ucomisd 0x4546(%rip), %xmm0     # 0x9250
movzbl %al, %esi
movzbl %dl, %edx
jne 0x4db0
jp 0x4db0
xorps %xmm0, %xmm0
cvtss2sd 0x77c9(%rip), %xmm0     # 0xc4f0
mulsd 0x4599(%rip), %xmm0     # 0x92c8
cvttsd2si %xmm0, %eax
movzbl %cl, %edi
movzbl %al, %ecx
jmp 0x4e04
testb %cl, %cl
je 0x4e09
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movzbl %cl, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movaps %xmm0, %xmm2
divss 0x45aa(%rip), %xmm2     # 0x930c
cvtss2sd %xmm2, %xmm2
addsd 0x4552(%rip), %xmm2     # 0x92c0
mulsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
addss %xmm0, %xmm2
mulss 0x458e(%rip), %xmm2     # 0x9310
movsd 0x774e(%rip), %xmm0     # 0xc4d8
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edi
xorps %xmm1, %xmm1
cvtss2sd %xmm2, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
movl $0xff, %eax
andl %eax, %edi
andl %eax, %ecx
xorl %esi, %esi
xorl %edx, %edx
jmp 0x4e04
movzbl %cl, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edi
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
xorps %xmm0, %xmm0
cvtss2sd 0x7705(%rip), %xmm0     # 0xc4f0
mulsd 0x44d5(%rip), %xmm0     # 0x92c8
cvttsd2si %xmm0, %ecx
movl $0xff, %eax
andl %eax, %ecx
andl %eax, %edi
andl %eax, %esi
andl %eax, %edx
callq 0x3520
cmpb $0x1, 0x76c0(%rip)      # 0xc4d0
jne 0x4e2b
movq 0x8(%rsp), %rax
movsd 0x20(%rax), %xmm0
movsd 0x28(%rax), %xmm1
movsd 0x30(%rax), %xmm2
callq 0x3110
movq 0x70(%rsp), %rax
leal 0x1(%rax), %r15d
leal 0x1(%rbp), %eax
movl %eax, 0x28(%rsp)
leal 0x1(%r14), %eax
movl %eax, 0x1c(%rsp)
movl $0x1, %r13d
imulq $0x38, %r14, %rbx
movq %rbx, 0x90(%rsp)
subl $0x1, %r13d
movl $0x1b02, %esi           # imm = 0x1B02
sbbl $0x0, %esi
movl $0x408, %edi            # imm = 0x408
callq 0x3270
movq 0x763e(%rip), %r14      # 0xc4b0
leaq (%r14,%rbx), %r12
cmpl 0x766b(%rip), %r15d     # 0xc4e8
jne 0x4ef7
movl 0x7667(%rip), %eax      # 0xc4ec
movl 0x28(%rsp), %ecx
subl %eax, %ecx
movslq %ecx, %rcx
movl %r15d, %ebx
imulq $0x38, %rcx, %r15
movl 0x1c(%rsp), %ecx
subl %eax, %ecx
movslq %ecx, %rax
imulq $0x38, %rax, %rbp
movq 0x8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd 0x10(%rax), %xmm1
movsd 0x18(%rax), %xmm2
callq 0x3500
movsd 0x8(%r14,%r15), %xmm0
movsd 0x10(%r14,%r15), %xmm1
movsd 0x18(%r14,%r15), %xmm2
movl %ebx, %r15d
movq 0x90(%rsp), %rbx
callq 0x3500
movsd 0x8(%r14,%rbp), %xmm0
movsd 0x10(%r14,%rbp), %xmm1
movsd 0x18(%r14,%rbp), %xmm2
jmp 0x4f44
movq 0x8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd 0x10(%rax), %xmm1
movsd 0x18(%rax), %xmm2
callq 0x3500
movq 0x10(%rsp), %rax
movsd 0x40(%r14,%rax), %xmm0
movsd 0x48(%r14,%rax), %xmm1
movsd 0x50(%r14,%rax), %xmm2
callq 0x3500
movsd 0x40(%r12), %xmm0
movsd 0x48(%r12), %xmm1
movsd 0x50(%r12), %xmm2
callq 0x3500
movsd 0x8(%r12), %xmm0
movsd 0x10(%r12), %xmm1
movsd 0x18(%r12), %xmm2
callq 0x3500
testl %r13d, %r13d
je 0x4e55
movq 0x70(%rsp), %rcx
incl %ecx
cmpl 0x756f(%rip), %ecx      # 0xc4e8
jl 0x4c08
movq 0x68(%rsp), %rcx
leal 0x1(%rcx), %eax
testl %ecx, %ecx
movq %rax, 0x68(%rsp)
je 0x4bf9
movq 0x80(%rsp), %rcx
incq %rcx
movq 0x78(%rsp), %rbp
cmpq %rbp, %rcx
jne 0x4bcd
callq 0x3410
callq 0x34c0
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq