// File: /workspace/github_c_makefile_star2_O0/archer1357[P]Offline-Raytracer/utils.c
// Function: renderScene
void renderScene(int updateFrom,int updateTo,
                 int width, int height,
                 float aspect,float yFov,
                 const float *minBound,const float *maxBound,
                 const float *origin,
                 const float *rotMat,
                 struct Ray *rayStack,
                 struct KdTraverseNode *traverseStack,
                 struct KdNode *rootNode,
                 struct Triangle *triangles,int trianglesNum,
                 struct Sphere *spheres,int spheresNum,
                 struct PointLight *pointLights,int pointLightsNum,


                 sobol_state_t *qrnd,


                 float *canvas,

                 int maxBounces,int maxSplits) {

  int denom=maxBounces*maxSplits;
  float glossyRatio=(denom!=0)?(1.0f/(float)denom)*0.2f:0.0f;


  float d;
  int i;

  //
  d=1.0f/tanf(yFov/2.0f);

  //
  int raycastsNum;


  for(i=updateFrom;i<updateTo;i++) {
    int x,y;
    float u,v,px,py;
    float pixelCol[3]={0.0f,0.0f,0.0f};

    raycastsNum=1;

    rayStack[raycastsNum-1].bounces=0;
    rayStack[raycastsNum-1].origin[0]=origin[0];
    rayStack[raycastsNum-1].origin[1]=origin[1];
    rayStack[raycastsNum-1].origin[2]=origin[2];
    rayStack[raycastsNum-1].ratio=1.0f;

    x=i%width;
    y=i/width;
    u=x/(float)width;
    v=1.0f-y/(float)height; //flip
    px=2.0f*u-1.0f;
    py=2.0f*v-1.0f;

    float bla[3]={px*aspect,py,-d};//rhs


    mat3_mulVector(rayStack[raycastsNum-1].vec,rotMat,bla);
    vec3_normal(rayStack[raycastsNum-1].vec,rayStack[raycastsNum-1].vec);

    while(raycastsNum > 0) {
      float curCol[3]={0.0f,0.0f,0.0f};
      float nor[3],colPt[3];
      float illumCol[3]={0.0f,0.0f,0.0f};
      float specCol[3]={0.0f,0.0f,0.0f};
      struct Material *material;

      //
      raycastsNum--;
      struct Ray ray=rayStack[raycastsNum];

      if(!intersectSceneObject(&ray,traverseStack,minBound,maxBound,rootNode,
                               triangles,trianglesNum,spheres,spheresNum,
                               colPt,nor,&material)) {
        // pixelCol[0]=1.0f;
        break;
      }

      // pixelCol[0]=material->col[0];
      // pixelCol[1]=material->col[1];
      // pixelCol[2]=material->col[2];
      ////////////////
      calcLights(&ray,material,colPt,nor,
                 traverseStack,minBound,maxBound,rootNode,
                 triangles,trianglesNum,spheres,spheresNum,
                 pointLights,pointLightsNum,illumCol,specCol);

      //
      curCol[0]=(material->col[0]*illumCol[0]+specCol[0]);
      curCol[1]=material->col[1]*illumCol[1]+specCol[1];
      curCol[2]=material->col[2]*illumCol[2]+specCol[2];

      curCol[0]*=ray.ratio;
      curCol[1]*=ray.ratio;
      curCol[2]*=ray.ratio;

      pixelCol[0]+=curCol[0];
      pixelCol[1]+=curCol[1];
      pixelCol[2]+=curCol[2];

      ///////////////
      // pixelCol[0]+=material->col[0];
      // pixelCol[1]+=material->col[1];
      // pixelCol[2]+=material->col[2];


      // pixelCol[0]=(1.0f+nor[0])/2.0f;
      // pixelCol[1]=(1.0f+nor[1])/2.0f;
      // pixelCol[2]=(1.0f+nor[2])/2.0f;

      // pixelCol[0]+=illumCol[0]*0.1f+specCol[0];
      // pixelCol[1]+=illumCol[1]*0.1f+specCol[1];
      // pixelCol[2]+=illumCol[2]*0.1f+specCol[2];

      //pixelCol[0]+=illumCol[0];
      //pixelCol[1]+=illumCol[1];
      //pixelCol[2]+=illumCol[2];




      if(maxSplits !=0 && ray.bounces<maxBounces) {
        float reflectVec[3];
        reflect(reflectVec,ray.vec,nor);
        vec3_normal(reflectVec,reflectVec);

        if(1==maxSplits) {
          rayStack[raycastsNum].origin[0]=colPt[0];
          rayStack[raycastsNum].origin[1]=colPt[1];
          rayStack[raycastsNum].origin[2]=colPt[2];
          //(float)powi(RAY_MAX_SPLITS,RAY_MAX_BOUNCES);

          rayStack[raycastsNum].ratio=ray.ratio*0.15f;
          rayStack[raycastsNum].bounces=ray.bounces+1;

          rayStack[raycastsNum].vec[0]=reflectVec[0];
          rayStack[raycastsNum].vec[1]=reflectVec[1];
          rayStack[raycastsNum].vec[2]=reflectVec[2];
          raycastsNum++;
        } else if(maxSplits > 1) {
          int j;
          float RN1[3],RN2[3],rotMat[9];

          RN1[0]=reflectVec[2];
          RN1[1]=reflectVec[1];
          RN1[2]=-reflectVec[0];
          vec3_cross(RN2,reflectVec,RN1);
          rotMat[0]=RN1[0];
          rotMat[3]=RN1[1];
          rotMat[6]=RN1[2];

          rotMat[1]=RN2[0];
          rotMat[4]=RN2[1];
          rotMat[7]=RN2[2];

          rotMat[2]=reflectVec[0];
          rotMat[5]=reflectVec[1];
          rotMat[8]=reflectVec[2];
          // int x,y;

          // for(x=-3;x<=3;x++) {
          //   for(y=-3;y<=3;y++) {
          //     if(x==0 && y==0) {
          //       //continue;
          //     }
          //     float v[3];
          //     v[0]=(float)x;
          //     v[1]=(float)y;
          //     v[2]=6.0f;

          //     mat3_mulVector(v,rotMat,v);
          //     vec3_normal(v,v);


          //     rayStack[raycastsNum].origin[0]=colPt[0];
          //     rayStack[raycastsNum].origin[1]=colPt[1];
          //     rayStack[raycastsNum].origin[2]=colPt[2];
          //     rayStack[raycastsNum].ratio=ray.ratio*0.01f;
          //     rayStack[raycastsNum].bounces=ray.bounces+1;

          //     rayStack[raycastsNum].vec[0]=v[0];
          //     rayStack[raycastsNum].vec[1]=v[1];
          //     rayStack[raycastsNum].vec[2]=v[2];

          //     raycastsNum++;
          //   }
          // }
          // reflectVec[0]=nor[0];
          // reflectVec[1]=nor[1];
          // reflectVec[2]=nor[2];
          for(j=0;j<maxSplits;j++) {
            float drefl=material->diffuseRefl;
            float xoffs, yoffs;

            do {
              // xoffs =((float)(rand()%1000))/1000.0f * drefl;
              // yoffs = ((float)(rand()%1000))/1000.0f * drefl;


              double v[2];
              sobol_get(qrnd,2,v);


              xoffs=(float)v[0]* drefl;
              yoffs=(float)v[1]* drefl;

            } while((xoffs*xoffs+yoffs*yoffs)>(drefl*drefl));
            float R[3],Ra[3],Rb[3];
            vec3_mulScalar(Ra,RN1,xoffs);
            vec3_mulScalar(Rb,RN2,yoffs*drefl);
            vec3_add(R,reflectVec,Ra);
            vec3_add(R,R,Rb);
            vec3_normal(R,R);



            rayStack[raycastsNum].origin[0]=colPt[0];
            rayStack[raycastsNum].origin[1]=colPt[1];
            rayStack[raycastsNum].origin[2]=colPt[2];
            //(float)powi(RAY_MAX_SPLITS,RAY_MAX_BOUNCES);

            rayStack[raycastsNum].ratio=ray.ratio*glossyRatio;
            rayStack[raycastsNum].bounces=ray.bounces+1;

            rayStack[raycastsNum].vec[0]=R[0];
            rayStack[raycastsNum].vec[1]=R[1];
            rayStack[raycastsNum].vec[2]=R[2];
            raycastsNum++;

          }

          // for(j=0;j<raycastMaxGlossySplits;j++) {
          //   // float vec[3];
          //   // vec3_sub(vec,colPt,raycast.origin);
          //   // vec3_normal(vec,vec);

          //   raycastStack[raycastsNum].origin[0]=colPt[0];
          //   raycastStack[raycastsNum].origin[1]=colPt[1];
          //   raycastStack[raycastsNum].origin[2]=colPt[2];
          //   raycastStack[raycastsNum].ratio=raycast.ratio*0.1f;
          //   raycastStack[raycastsNum].steps=raycast.steps-1;

          //   raycastStack[raycastsNum].vec[0]=reflectVec[0];
          //   raycastStack[raycastsNum].vec[1]=reflectVec[1];
          //   raycastStack[raycastsNum].vec[2]=reflectVec[2];
          //   // reflectf(raycastStack[raycastsNum].vec,vec,nor);

          //   raycastsNum++;
          // }
        }
      }



    }

    //
    canvas[(i-updateFrom)*3]=pixelCol[0];
    canvas[(i-updateFrom)*3+1]=pixelCol[1];
    canvas[(i-updateFrom)*3+2]=pixelCol[2];
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movl 0x80(%rbp), %eax
movl 0x78(%rbp), %eax
movq 0x70(%rbp), %rax
movq 0x68(%rbp), %rax
movl 0x60(%rbp), %eax
movq 0x58(%rbp), %rax
movl 0x50(%rbp), %eax
movq 0x48(%rbp), %rax
movl 0x40(%rbp), %eax
movq 0x38(%rbp), %rax
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movl %edi, -0x2c(%rbp)
movl %esi, -0x30(%rbp)
movl %edx, -0x34(%rbp)
movl %ecx, -0x38(%rbp)
movss %xmm0, -0x3c(%rbp)
movss %xmm1, -0x40(%rbp)
movq %r8, -0x48(%rbp)
movq %r9, -0x50(%rbp)
movl 0x78(%rbp), %eax
imull 0x80(%rbp), %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
je 0x423366
cvtsi2ssl -0x54(%rbp), %xmm1
movss 0xc0138(%rip), %xmm0    # 0x4e3484
divss %xmm1, %xmm0
movss 0xc15e8(%rip), %xmm1    # 0x4e4940
mulss %xmm1, %xmm0
movss %xmm0, -0x198(%rbp)
jmp 0x423373
xorps %xmm0, %xmm0
movss %xmm0, -0x198(%rbp)
jmp 0x423373
movss -0x198(%rbp), %xmm0
movss %xmm0, -0x58(%rbp)
movss -0x40(%rbp), %xmm0
movss 0xc157f(%rip), %xmm1    # 0x4e490c
divss %xmm1, %xmm0
callq 0x426640
movaps %xmm0, %xmm1
movss 0xc00e3(%rip), %xmm0    # 0x4e3484
divss %xmm1, %xmm0
movss %xmm0, -0x5c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x423d1b
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x4010e0
movl $0x1, -0x64(%rbp)
movq 0x20(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movl $0x0, 0x18(%rax)
movq 0x10(%rbp), %rax
movss (%rax), %xmm0
movq 0x20(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, (%rax)
movq 0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
movq 0x20(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
movq 0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq 0x20(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x8(%rax)
movq 0x20(%rbp), %rax
movl -0x64(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss 0xc0013(%rip), %xmm0    # 0x4e3484
movss %xmm0, 0x1c(%rax)
movl -0x60(%rbp), %eax
cltd
idivl -0x34(%rbp)
movl %edx, -0x68(%rbp)
movl -0x60(%rbp), %eax
cltd
idivl -0x34(%rbp)
movl %eax, -0x6c(%rbp)
cvtsi2ssl -0x68(%rbp), %xmm0
cvtsi2ssl -0x34(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
cvtsi2ssl -0x6c(%rbp), %xmm1
cvtsi2ssl -0x38(%rbp), %xmm0
divss %xmm0, %xmm1
movss 0xbffd1(%rip), %xmm0    # 0x4e3484
subss %xmm1, %xmm0
movss %xmm0, -0x74(%rbp)
movss -0x70(%rbp), %xmm0
addss %xmm0, %xmm0
movss 0xc1737(%rip), %xmm1    # 0x4e4c04
addss %xmm1, %xmm0
movss %xmm0, -0x78(%rbp)
movss -0x74(%rbp), %xmm0
addss %xmm0, %xmm0
movss 0xc171d(%rip), %xmm1    # 0x4e4c04
addss %xmm1, %xmm0
movss %xmm0, -0x7c(%rbp)
movss -0x78(%rbp), %xmm0
mulss -0x3c(%rbp), %xmm0
movss %xmm0, -0x94(%rbp)
movss -0x7c(%rbp), %xmm0
movss %xmm0, -0x90(%rbp)
movss -0x5c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x8c(%rbp)
movq 0x20(%rbp), %rdi
movl -0x64(%rbp), %eax
subl $0x1, %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
addq $0xc, %rdi
movq 0x18(%rbp), %rsi
leaq -0x94(%rbp), %rdx
callq 0x40da30
movq 0x20(%rbp), %rdi
movl -0x64(%rbp), %eax
subl $0x1, %eax
cltq
shlq $0x5, %rax
addq %rax, %rdi
addq $0xc, %rdi
movq 0x20(%rbp), %rsi
movl -0x64(%rbp), %eax
subl $0x1, %eax
cltq
shlq $0x5, %rax
addq %rax, %rsi
addq $0xc, %rsi
callq 0x40ca00
cmpl $0x0, -0x64(%rbp)
jle 0x423cb3
leaq -0xa0(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x4010e0
leaq -0xc4(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x4010e0
leaq -0xd0(%rbp), %rdi
xorl %esi, %esi
movl $0xc, %edx
callq 0x4010e0
movl -0x64(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x64(%rbp)
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0xf8(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0xf0(%rbp)
movq 0x10(%rax), %rcx
movq %rcx, -0xe8(%rbp)
movq 0x18(%rax), %rax
movq %rax, -0xe0(%rbp)
movq 0x28(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq -0x50(%rbp), %rcx
movq 0x30(%rbp), %r8
movq 0x38(%rbp), %r9
movl 0x40(%rbp), %r15d
movq 0x48(%rbp), %r14
movl 0x50(%rbp), %ebx
leaq -0xb8(%rbp), %r11
leaq -0xac(%rbp), %r10
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
movl %r15d, (%rsp)
movq %r14, 0x8(%rsp)
movl %ebx, 0x10(%rsp)
movq %r11, 0x18(%rsp)
movq %r10, 0x20(%rsp)
movq %rax, 0x28(%rsp)
callq 0x422d20
testb $0x1, %al
jne 0x42366e
jmp 0x423cb3
movq -0xd8(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
leaq -0xac(%rbp), %rcx
movq 0x28(%rbp), %r8
movq -0x48(%rbp), %r9
movq -0x50(%rbp), %rax
movq 0x30(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
movq 0x38(%rbp), %r13
movl 0x40(%rbp), %r12d
movq 0x48(%rbp), %r15
movl 0x50(%rbp), %r14d
movq 0x58(%rbp), %rbx
movl 0x60(%rbp), %r11d
leaq -0xc4(%rbp), %r10
leaq -0xd0(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
leaq -0xf8(%rbp), %rdi
movq %rax, (%rsp)
movq -0x1a8(%rbp), %rax
movq %rax, 0x8(%rsp)
movq -0x1a0(%rbp), %rax
movq %r13, 0x10(%rsp)
movl %r12d, 0x18(%rsp)
movq %r15, 0x20(%rsp)
movl %r14d, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
movl %r11d, 0x38(%rsp)
movq %r10, 0x40(%rsp)
movq %rax, 0x48(%rsp)
callq 0x423020
movq -0xd8(%rbp), %rax
movss (%rax), %xmm0
movss -0xc4(%rbp), %xmm2
movss -0xd0(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0xa0(%rbp)
movq -0xd8(%rbp), %rax
movss 0x4(%rax), %xmm0
movss -0xc0(%rbp), %xmm2
movss -0xcc(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x9c(%rbp)
movq -0xd8(%rbp), %rax
movss 0x8(%rax), %xmm0
movss -0xbc(%rbp), %xmm2
movss -0xc8(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x98(%rbp)
movss -0xdc(%rbp), %xmm0
mulss -0xa0(%rbp), %xmm0
movss %xmm0, -0xa0(%rbp)
movss -0xdc(%rbp), %xmm0
mulss -0x9c(%rbp), %xmm0
movss %xmm0, -0x9c(%rbp)
movss -0xdc(%rbp), %xmm0
mulss -0x98(%rbp), %xmm0
movss %xmm0, -0x98(%rbp)
movss -0xa0(%rbp), %xmm0
addss -0x88(%rbp), %xmm0
movss %xmm0, -0x88(%rbp)
movss -0x9c(%rbp), %xmm0
addss -0x84(%rbp), %xmm0
movss %xmm0, -0x84(%rbp)
movss -0x98(%rbp), %xmm0
addss -0x80(%rbp), %xmm0
movss %xmm0, -0x80(%rbp)
cmpl $0x0, 0x80(%rbp)
je 0x423cae
movl -0xe0(%rbp), %eax
cmpl 0x78(%rbp), %eax
jge 0x423cae
leaq -0x104(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
addq $0xc, %rsi
leaq -0xac(%rbp), %rdx
callq 0x40dad0
leaq -0x104(%rbp), %rdi
leaq -0x104(%rbp), %rsi
callq 0x40ca00
movl $0x1, %eax
cmpl 0x80(%rbp), %eax
jne 0x423971
movss -0xb8(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, (%rax)
movss -0xb4(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
movss -0xb0(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x8(%rax)
movss 0xc2640(%rip), %xmm0    # 0x4e5f18
mulss -0xdc(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x1c(%rax)
movl -0xe0(%rbp), %ecx
addl $0x1, %ecx
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movss -0x104(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0xc(%rax)
movss -0x100(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x10(%rax)
movss -0xfc(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x14(%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x423cac
cmpl $0x1, 0x80(%rbp)
jle 0x423caa
movss -0xfc(%rbp), %xmm0
movss %xmm0, -0x114(%rbp)
movss -0x100(%rbp), %xmm0
movss %xmm0, -0x110(%rbp)
movss -0x104(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x10c(%rbp)
leaq -0x120(%rbp), %rdi
leaq -0x104(%rbp), %rsi
leaq -0x114(%rbp), %rdx
callq 0x40c890
movss -0x114(%rbp), %xmm0
movss %xmm0, -0x150(%rbp)
movss -0x110(%rbp), %xmm0
movss %xmm0, -0x144(%rbp)
movss -0x10c(%rbp), %xmm0
movss %xmm0, -0x138(%rbp)
movss -0x120(%rbp), %xmm0
movss %xmm0, -0x14c(%rbp)
movss -0x11c(%rbp), %xmm0
movss %xmm0, -0x140(%rbp)
movss -0x118(%rbp), %xmm0
movss %xmm0, -0x134(%rbp)
movss -0x104(%rbp), %xmm0
movss %xmm0, -0x148(%rbp)
movss -0x100(%rbp), %xmm0
movss %xmm0, -0x13c(%rbp)
movss -0xfc(%rbp), %xmm0
movss %xmm0, -0x130(%rbp)
movl $0x0, -0x108(%rbp)
movl -0x108(%rbp), %eax
cmpl 0x80(%rbp), %eax
jge 0x423ca8
movq -0xd8(%rbp), %rax
movss 0x18(%rax), %xmm0
movss %xmm0, -0x154(%rbp)
movq 0x68(%rbp), %rdi
leaq -0x170(%rbp), %rdx
movl $0x2, %esi
callq 0x410e50
movsd -0x170(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
mulss -0x154(%rbp), %xmm0
movss %xmm0, -0x158(%rbp)
movsd -0x168(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
mulss -0x154(%rbp), %xmm0
movss %xmm0, -0x15c(%rbp)
movss -0x158(%rbp), %xmm0
movss -0x158(%rbp), %xmm2
movss -0x15c(%rbp), %xmm1
mulss -0x15c(%rbp), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss -0x154(%rbp), %xmm1
mulss -0x154(%rbp), %xmm1
ucomiss %xmm1, %xmm0
ja 0x423a95
leaq -0x188(%rbp), %rdi
leaq -0x114(%rbp), %rsi
movss -0x158(%rbp), %xmm0
callq 0x40cb40
leaq -0x194(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movss -0x15c(%rbp), %xmm0
mulss -0x154(%rbp), %xmm0
callq 0x40cb40
leaq -0x17c(%rbp), %rdi
leaq -0x104(%rbp), %rsi
leaq -0x188(%rbp), %rdx
callq 0x40ca80
leaq -0x17c(%rbp), %rdi
leaq -0x17c(%rbp), %rsi
leaq -0x194(%rbp), %rdx
callq 0x40ca80
leaq -0x17c(%rbp), %rdi
leaq -0x17c(%rbp), %rsi
callq 0x40ca00
movss -0xb8(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, (%rax)
movss -0xb4(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x4(%rax)
movss -0xb0(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x8(%rax)
movss -0xdc(%rbp), %xmm0
mulss -0x58(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x1c(%rax)
movl -0xe0(%rbp), %ecx
addl $0x1, %ecx
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rdx
shlq $0x5, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movss -0x17c(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0xc(%rax)
movss -0x178(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x10(%rax)
movss -0x174(%rbp), %xmm0
movq 0x20(%rbp), %rax
movslq -0x64(%rbp), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movss %xmm0, 0x14(%rax)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movl -0x108(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0x423a6f
jmp 0x423caa
jmp 0x423cac
jmp 0x423cae
jmp 0x423583
movss -0x88(%rbp), %xmm0
movq 0x70(%rbp), %rax
movl -0x60(%rbp), %ecx
subl -0x2c(%rbp), %ecx
imull $0x3, %ecx, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movss -0x84(%rbp), %xmm0
movq 0x70(%rbp), %rax
movl -0x60(%rbp), %ecx
subl -0x2c(%rbp), %ecx
imull $0x3, %ecx, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movss -0x80(%rbp), %xmm0
movq 0x70(%rbp), %rax
movl -0x60(%rbp), %ecx
subl -0x2c(%rbp), %ecx
imull $0x3, %ecx, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movss %xmm0, (%rax,%rcx,4)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x4233b0
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)