// File: /workspace/github_cpp_makefile_star2_O2/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 $0x108, %rsp            # imm = 0x108
movl $0x4100, %edi           # imm = 0x4100
callq 0x30b0
callq 0x3410
movss 0x928c(%rip), %xmm0     # 0xd4d4
movss %xmm0, 0x10(%rsp)
movss 0x9282(%rip), %xmm0     # 0xd4d8
mulss 0x509e(%rip), %xmm0     # 0x92fc
callq 0x3230
cvtss2sd %xmm0, %xmm0
mulsd 0x4fe9(%rip), %xmm0     # 0x9258
addsd 0x4fe9(%rip), %xmm0     # 0x9260
cvtsd2ss %xmm0, %xmm1
movss %xmm1, 0x18(%rsp)
movss 0x924f(%rip), %xmm0     # 0xd4d8
addss %xmm0, %xmm0
movss %xmm0, 0x8(%rsp)
cvtss2sd 0x10(%rsp), %xmm0
cvtss2sd %xmm1, %xmm2
xorps %xmm1, %xmm1
callq 0x3320
cvtss2sd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x4f97(%rip), %xmm1     # 0x9250
movsd 0x4f97(%rip), %xmm2     # 0x9258
movaps %xmm2, %xmm3
callq 0x33d0
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
subss 0x10(%rsp), %xmm1
movss %xmm1, 0x20(%rsp)
subss 0x18(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd 0x4f73(%rip), %xmm0     # 0x9268
divsd 0x4f73(%rip), %xmm0     # 0x9270
movsd %xmm0, 0x8(%rsp)
callq 0x3620
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x3080
movsd 0x4f2f(%rip), %xmm4     # 0x9250
movsd 0x10(%rsp), %xmm9
subsd %xmm9, %xmm4
movsd 0x4f43(%rip), %xmm3     # 0x9278
mulsd %xmm4, %xmm3
addsd %xmm9, %xmm3
movsd 0x4f3a(%rip), %xmm5     # 0x9280
mulsd %xmm0, %xmm5
movsd 0x4f36(%rip), %xmm2     # 0x9288
mulsd %xmm4, %xmm2
movapd %xmm2, %xmm1
subsd %xmm5, %xmm1
addsd %xmm5, %xmm2
mulsd 0x4f26(%rip), %xmm4     # 0x9290
addsd %xmm4, %xmm9
mulsd 0x4f21(%rip), %xmm0     # 0x9298
movapd %xmm4, %xmm6
subsd %xmm0, %xmm6
addsd %xmm4, %xmm0
cvtss2sd 0x20(%rsp), %xmm4
movapd %xmm1, %xmm5
xorpd %xmm8, %xmm8
mulsd %xmm8, %xmm5
mulsd %xmm4, %xmm3
addsd %xmm5, %xmm3
cvtss2sd 0x18(%rsp), %xmm5
movapd %xmm2, %xmm7
mulsd %xmm5, %xmm7
addsd %xmm3, %xmm7
movsd %xmm7, 0x30(%rsp)
movapd %xmm9, %xmm3
mulsd %xmm8, %xmm3
mulsd %xmm4, %xmm2
addsd %xmm3, %xmm2
movapd %xmm9, %xmm3
mulsd %xmm5, %xmm6
addsd %xmm2, %xmm6
xorpd %xmm2, %xmm2
mulsd %xmm2, %xmm0
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm5, %xmm3
addsd %xmm1, %xmm3
cmpb $0x1, 0x90eb(%rip)      # 0xd4e0
jne 0x46a7
movsd %xmm6, 0x18(%rsp)
movsd %xmm3, 0x10(%rsp)
movss 0x90cd(%rip), %xmm0     # 0xd4dc
movss %xmm0, 0x20(%rsp)
cvtss2sd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
movzbl 0x90bb(%rip), %esi      # 0xd4e1
movl $0xb52, %edi            # imm = 0xB52
callq 0x3070
movaps 0x4f39(%rip), %xmm0     # 0x9370
movaps %xmm0, 0x50(%rsp)
movss 0x4ebc(%rip), %xmm0     # 0x9300
mulss 0x20(%rsp), %xmm0
xorl %eax, %eax
cmpq $0x3, %rax
je 0x4467
movss 0x50(%rsp,%rax,4), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x50(%rsp,%rax,4)
incq %rax
jmp 0x444c
leaq 0x50(%rsp), %rsi
movl $0xb53, %edi            # imm = 0xB53
callq 0x3630
movaps 0x4f03(%rip), %xmm0     # 0x9380
movaps %xmm0, 0x90(%rsp)
movss 0x9057(%rip), %xmm0     # 0xd4e4
xorps 0x4eac(%rip), %xmm0     # 0x9340
xorl %eax, %eax
cmpq $0x3, %rax
je 0x44aa
movss %xmm0, 0x90(%rsp,%rax,4)
incq %rax
jmp 0x4496
leaq 0x90(%rsp), %rdx
movl $0x4000, %edi           # imm = 0x4000
movl $0x1203, %esi           # imm = 0x1203
callq 0x35c0
movsd 0x4dd7(%rip), %xmm0     # 0x92a0
mulsd 0x8(%rsp), %xmm0
movsd 0x4d79(%rip), %xmm1     # 0x9250
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0xf0(%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 0x35c0
movsd 0x4d94(%rip), %xmm1     # 0x92a8
mulsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x38(%rsp)
movsd 0x4d28(%rip), %xmm0     # 0x9250
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0xe0(%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 0x35c0
movsd 0x38(%rsp), %xmm0
addsd 0x4d4a(%rip), %xmm0     # 0x92b0
cvtsd2ss %xmm0, %xmm0
leaq 0xd0(%rsp), %rdx
movss %xmm0, (%rdx)
movss %xmm0, 0x4(%rdx)
movss %xmm0, 0x8(%rdx)
andl $0x0, 0xc(%rdx)
movl $0x4000, %edi           # imm = 0x4000
movl $0x1202, %esi           # imm = 0x1202
callq 0x35c0
movsd 0x4db5(%rip), %xmm0     # 0x9350
leaq 0xc0(%rsp), %rdx
movsd %xmm0, (%rdx)
movl $0x3f666666, 0x8(%rdx)  # imm = 0x3F666666
cvtsd2ss 0x8f32(%rip), %xmm0     # 0xd4e8
movss %xmm0, 0xc(%rdx)
movl $0x408, %edi            # imm = 0x408
movl $0x1200, %esi           # imm = 0x1200
callq 0x3660
leaq 0xb0(%rsp), %rdx
andq $0x0, (%rdx)
andl $0x0, 0x8(%rdx)
cvtsd2ss 0x8f06(%rip), %xmm0     # 0xd4e8
movss %xmm0, 0xc(%rdx)
movl $0x405, %edi            # imm = 0x405
movl $0x1201, %esi           # imm = 0x1201
callq 0x3660
movsd 0x8(%rsp), %xmm0
mulsd 0x4cb4(%rip), %xmm0     # 0x92b8
addsd 0x4ca4(%rip), %xmm0     # 0x92b0
cvtsd2ss %xmm0, %xmm0
movsd 0x8ed0(%rip), %xmm1     # 0xd4e8
cvtss2sd %xmm0, %xmm0
mulsd %xmm1, %xmm0
movsd 0x4c30(%rip), %xmm2     # 0x9258
mulsd %xmm0, %xmm2
cvtsd2ss %xmm2, %xmm2
leaq 0xa0(%rsp), %rdx
movss %xmm2, (%rdx)
unpcklpd %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
cvtpd2ps %xmm0, %xmm0
movss %xmm0, 0x4(%rdx)
movlpd %xmm0, 0x8(%rdx)
movl $0x408, %edi            # imm = 0x408
movl $0x1202, %esi           # imm = 0x1202
callq 0x3660
movss 0x20(%rsp), %xmm0
mulss 0x4c99(%rip), %xmm0     # 0x9304
addss 0x4c95(%rip), %xmm0     # 0x9308
leaq 0x8c(%rsp), %rdx
movss %xmm0, (%rdx)
movl $0x408, %edi            # imm = 0x408
movl $0x1601, %esi           # imm = 0x1601
callq 0x3660
movl $0x1d01, %edi           # imm = 0x1D01
callq 0x3590
movsd 0x10(%rsp), %xmm3
movsd 0x18(%rsp), %xmm6
xorps %xmm2, %xmm2
movsd 0x30(%rsp), %xmm0
addsd %xmm2, %xmm0
addsd %xmm2, %xmm6
addsd %xmm2, %xmm3
movq 0x8e08(%rip), %rdi      # 0xd4c8
testq %rdi, %rdi
movsd %xmm3, 0x10(%rsp)
movsd %xmm6, 0x18(%rsp)
movsd %xmm0, 0x30(%rsp)
je 0x476d
movq 0x8e0e(%rip), %rax      # 0xd4f0
movslq 0x8e0f(%rip), %rcx      # 0xd4f8
cqto
cvtsd2ss %xmm0, %xmm0
cvtsd2ss %xmm6, %xmm1
idivq %rcx
cvtsd2ss %xmm3, %xmm2
cvtss2sd %xmm0, %xmm0
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm2, %xmm2
xorl %edx, %edx
testq %rax, %rax
movq %rax, %rsi
cmovgq %rax, %rdx
leaq 0x18(%rdi), %rcx
subq $0x1, %rdx
jb 0x4755
movsd -0x18(%rcx), %xmm3
subsd %xmm0, %xmm3
movsd -0x10(%rcx), %xmm4
subsd %xmm1, %xmm4
mulsd %xmm4, %xmm4
mulsd %xmm3, %xmm3
addsd %xmm4, %xmm3
movsd -0x8(%rcx), %xmm4
subsd %xmm2, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm3, %xmm4
movsd %xmm4, (%rcx)
addq $0x28, %rcx
jmp 0x4716
movq %rsi, %rbx
imulq $0x28, %rsi, %rsi
addq %rdi, %rsi
leaq -0x556(%rip), %rdx      # 0x4210
callq 0x52ba
jmp 0x476f
xorl %ebx, %ebx
pushq $0x7
popq %rdi
callq 0x3090
xorl %ecx, %ecx
testq %rbx, %rbx
cmovleq %rcx, %rbx
movsd 0x10(%rsp), %xmm3
movsd 0x18(%rsp), %xmm4
movq %rbx, 0x68(%rsp)
cmpq %rbx, %rcx
je 0x4b74
movq 0x8d27(%rip), %rax      # 0xd4c8
movq %rcx, 0x70(%rsp)
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
addq $0x20, %rax
movq %rax, 0x78(%rsp)
xorl %eax, %eax
cmpl $0x2, %eax
je 0x4b62
xorl %ecx, %ecx
movl %eax, 0x2c(%rsp)
cmpl 0x8d2b(%rip), %ecx      # 0xd4f8
jge 0x4b5b
movq 0x78(%rsp), %rax
movslq (%rax), %rax
movq %rcx, 0x48(%rsp)
movslq %ecx, %rbp
addq %rax, %rbp
movslq 0x8d0f(%rip), %rax      # 0xd4fc
movslq %ebp, %r14
addq %rax, %r14
movq 0x8cf6(%rip), %rax      # 0xd4f0
decq %rax
cmpq %r14, %rax
jle 0x4b4b
movq 0x8cb3(%rip), %rdx      # 0xd4c0
imulq $0x38, %rbp, %rcx
movb 0x1(%rdx,%rcx), %al
movq %rcx, 0x20(%rsp)
addq %rcx, %rdx
movq %rdx, 0x8(%rsp)
testb %al, %al
jne 0x483f
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x2(%rcx)
jne 0x483f
movq 0x8(%rsp), %rcx
cmpb $0x0, (%rcx)
je 0x4b4b
cmpl $0x0, 0x2c(%rsp)
je 0x4856
movq 0x8(%rsp), %rcx
cmpb $0x0, 0x3(%rcx)
jg 0x48ac
jmp 0x4b4b
movapd %xmm3, %xmm0
movq 0x8(%rsp), %rdx
subsd 0x18(%rdx), %xmm0
movapd %xmm4, %xmm1
subsd 0x10(%rdx), %xmm1
movsd 0x30(%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 0x4b4b
movq 0x8(%rsp), %rdx
movb 0x2(%rdx), %cl
movzbl (%rdx), %edx
movl %eax, %esi
orb %cl, %sil
movzbl %dl, %edi
je 0x48ff
movsd 0x8c1f(%rip), %xmm0     # 0xd4e8
ucomisd 0x497f(%rip), %xmm0     # 0x9250
movzbl %al, %esi
movzbl %cl, %edx
jne 0x4976
jp 0x4976
cvtss2sd 0x8c15(%rip), %xmm0     # 0xd500
mulsd 0x49d5(%rip), %xmm0     # 0x92c8
cvttsd2si %xmm0, %eax
movzbl %al, %ecx
jmp 0x49bb
testb %dl, %dl
je 0x49cc
cvtsi2ss %edx, %xmm0
cvtsi2sd %edi, %xmm1
movaps %xmm0, %xmm2
divss 0x49f2(%rip), %xmm2     # 0x930c
cvtss2sd %xmm2, %xmm2
addsd 0x499a(%rip), %xmm2     # 0x92c0
mulsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
addss %xmm0, %xmm2
mulss 0x49d6(%rip), %xmm2     # 0x9310
movsd 0x8ba6(%rip), %xmm0     # 0xd4e8
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edi
cvtss2sd %xmm2, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %ecx
movl $0xff, %eax
andl %eax, %edi
andl %eax, %ecx
xorl %esi, %esi
xorl %edx, %edx
callq 0x3530
movsd 0x18(%rsp), %xmm4
movsd 0x10(%rsp), %xmm3
jmp 0x49cc
cvtsi2sd %edi, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edi
cvtsi2sd %esi, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %esi
cvtsi2sd %edx, %xmm1
mulsd %xmm0, %xmm1
cvttsd2si %xmm1, %edx
cvtss2sd 0x8b5e(%rip), %xmm0     # 0xd500
mulsd 0x491e(%rip), %xmm0     # 0x92c8
cvttsd2si %xmm0, %ecx
movl $0xff, %eax
andl %eax, %ecx
andl %eax, %edi
andl %eax, %esi
andl %eax, %edx
callq 0x3530
movsd 0x10(%rsp), %xmm3
movsd 0x18(%rsp), %xmm4
cmpb $0x1, 0x8b0d(%rip)      # 0xd4e0
jne 0x49fa
movq 0x8(%rsp), %rax
movsd 0x20(%rax), %xmm0
movsd 0x28(%rax), %xmm1
movsd 0x30(%rax), %xmm2
callq 0x3110
movsd 0x18(%rsp), %xmm4
movsd 0x10(%rsp), %xmm3
movq 0x48(%rsp), %rax
leal 0x1(%rax), %r15d
leal 0x1(%rbp), %eax
movl %eax, 0x38(%rsp)
leal 0x1(%r14), %eax
movl %eax, 0x44(%rsp)
xorl %r12d, %r12d
imulq $0x38, %r14, %rbx
movq %rbx, 0x80(%rsp)
movl $0x1b01, %esi           # imm = 0x1B01
cmpl $0x1, %r12d
je 0x4a3b
cmpl $0x2, %r12d
je 0x4b4b
movl $0x1b02, %esi           # imm = 0x1B02
movl $0x408, %edi            # imm = 0x408
callq 0x3280
movq 0x8a74(%rip), %r14      # 0xd4c0
leaq (%r14,%rbx), %r13
cmpl 0x8aa1(%rip), %r15d     # 0xd4f8
jne 0x4ad1
movl 0x8a9d(%rip), %eax      # 0xd4fc
movl 0x38(%rsp), %ecx
subl %eax, %ecx
movslq %ecx, %rcx
movl %r15d, %ebx
imulq $0x38, %rcx, %r15
movl 0x44(%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 0x3510
movsd 0x8(%r14,%r15), %xmm0
movsd 0x10(%r14,%r15), %xmm1
movsd 0x18(%r14,%r15), %xmm2
movl %ebx, %r15d
movq 0x80(%rsp), %rbx
callq 0x3510
movsd 0x8(%r14,%rbp), %xmm0
movsd 0x10(%r14,%rbp), %xmm1
movsd 0x18(%r14,%rbp), %xmm2
jmp 0x4b1b
movq 0x8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd 0x10(%rax), %xmm1
movsd 0x18(%rax), %xmm2
callq 0x3510
movq 0x20(%rsp), %rax
movsd 0x40(%r14,%rax), %xmm0
movsd 0x48(%r14,%rax), %xmm1
movsd 0x50(%r14,%rax), %xmm2
callq 0x3510
movsd 0x40(%r13), %xmm0
movsd 0x48(%r13), %xmm1
movsd 0x50(%r13), %xmm2
callq 0x3510
movsd 0x8(%r13), %xmm0
movsd 0x10(%r13), %xmm1
movsd 0x18(%r13), %xmm2
callq 0x3510
incl %r12d
movsd 0x10(%rsp), %xmm3
movsd 0x18(%rsp), %xmm4
jmp 0x4a21
movq 0x48(%rsp), %rcx
incl %ecx
movl 0x2c(%rsp), %eax
jmp 0x47c7
incl %eax
jmp 0x47b8
movq 0x70(%rsp), %rcx
incq %rcx
movq 0x68(%rsp), %rbx
jmp 0x4791
callq 0x3420
callq 0x34d0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq