// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/scn2img/scn2img.cpp
// Function: DrawNodeWithOpenGL(gaps::R3Camera const&, gaps::R3Scene*, gaps::R3SceneNode*, int, int)
static void 
DrawNodeWithOpenGL(const R3Camera& camera, R3Scene *scene, R3SceneNode *node, int color_scheme, RNBoolean omit_objects = FALSE)
{
  // Check if should omit object
  if (omit_objects && node->Name() && !strncmp(node->Name(), "Object#", 7)) return;

  // Check if has elements and/or references
  if (node->NChildren() > 0) {
    // Recurse to children
    for (int i = 0; i < node->NChildren(); i++) {
      R3SceneNode *child = node->Child(i);
      DrawNodeWithOpenGL(camera, scene, child, color_scheme, omit_objects);
    }
  }
  else {
    // Check color scheme
    if ((color_scheme == RGB_COLOR_SCHEME) || (color_scheme == ALBEDO_COLOR_SCHEME)) {
      // Load lights for node
      if (color_scheme == RGB_COLOR_SCHEME) {
        int max_lights = 8 - headlight;
        if (scene->NLights() > max_lights) {
          scene->LoadLights(node->BBox(), headlight);
        }
      }

      // Draw node with shading
      node->Draw(R3_DEFAULT_DRAW_FLAGS);
    }
    else if ((color_scheme == NODE_COLOR_SCHEME) || (color_scheme == CATEGORY_COLOR_SCHEME) || (color_scheme == ROOM_SURFACE_COLOR_SCHEME)) {
      // Draw integer values per node
      if (color_scheme == NODE_COLOR_SCHEME) {
        LoadInteger(node->SceneIndex() + 1);
      }
      else if (color_scheme == CATEGORY_COLOR_SCHEME) {
        const char *model_index = NULL;
        R3SceneNode *ancestor = node;
        while (!model_index && ancestor) { model_index = ancestor->Info("index"); ancestor = ancestor->Parent(); }
        if (model_index) LoadInteger(atoi(model_index));
        else LoadInteger(0);
      }
      else if (color_scheme == ROOM_SURFACE_COLOR_SCHEME) {
        if (!node->Name()) LoadInteger(0);
        else if (!strncmp(node->Name(), "Wall#", 5)) LoadInteger(1);
        else if (!strncmp(node->Name(), "WallInside#", 11)) LoadInteger(1);
        else if (!strncmp(node->Name(), "WallOutside#", 12)) LoadInteger(1);
        else if (!strncmp(node->Name(), "Ceiling#", 8)) LoadInteger(2);
        else if (!strncmp(node->Name(), "Floor#", 6)) LoadInteger(3);
        else LoadInteger(0);
      }
      node->Draw(R3_SURFACES_DRAW_FLAG);
    }
    else if (color_scheme == MATERIAL_COLOR_SCHEME) {
      // Draw integer values per element
      for (int i = 0; i < node->NElements(); i++) {
        R3SceneElement *element = node->Element(i);
        R3Material *material = element->Material();
        if (!material) LoadInteger(0);
        else LoadInteger(material->SceneIndex() + 1);
        element->Draw(R3_SURFACES_DRAW_FLAG);
      }
    }
    else if (color_scheme == BRDF_COLOR_SCHEME) {
      // Draw color values per element (NOTE: THIS IGNORES TEXTURE)
      for (int i = 0; i < node->NElements(); i++) {
        R3SceneElement *element = node->Element(i);
        const R3Material *material = element->Material();
        const R3Brdf *brdf = (material) ? material->Brdf() : NULL;
        if (!brdf) brdf = &R3default_brdf;
        RNScalar kd = brdf->Diffuse().Luminance();
        RNScalar ks = brdf->Specular().Luminance();
        RNScalar kt = brdf->Transmission().Luminance();
        RNLoadRgb(kd, ks, kt);
        element->Draw(R3_SURFACES_DRAW_FLAG);
      }
    }
    else if (color_scheme == FACE_COLOR_SCHEME) {
      // Draw integer values per triangle
      int face_count = 0;
      for (int i = 0; i < node->NElements(); i++) {
        R3SceneElement *element = node->Element(i);
        for (int j = 0; j < element->NShapes(); j++) {
          R3Shape *shape = element->Shape(j);
          if (shape->ClassID() == R3TriangleArray::CLASS_ID()) {
            R3TriangleArray *triangles = (R3TriangleArray *) shape;
            for (int k = 0; k < triangles->NTriangles(); k++) {
              R3Triangle *triangle = triangles->Triangle(k);
              LoadInteger(face_count + 1);
              triangle->Draw(R3_SURFACES_DRAW_FLAG);
              face_count++;
            }
          }
        }
      }
    }    
    else if ((color_scheme == ANGLE_COLOR_SCHEME) || 
      (color_scheme == XNORMAL_COLOR_SCHEME) || (color_scheme == YNORMAL_COLOR_SCHEME) || (color_scheme == ZNORMAL_COLOR_SCHEME)) {
      // Draw integer values per triangle
      for (int i = 0; i < node->NElements(); i++) {
        R3SceneElement *element = node->Element(i);
        for (int j = 0; j < element->NShapes(); j++) {
          R3Shape *shape = element->Shape(j);
          if (shape->ClassID() == R3TriangleArray::CLASS_ID()) {
            R3TriangleArray *triangles = (R3TriangleArray *) shape;
            for (int k = 0; k < triangles->NTriangles(); k++) {
              R3Triangle *triangle = triangles->Triangle(k);
              R3Vector normal = triangle->Normal();
              if (R3SignedDistance(triangle->Plane(), camera.Origin()) < 0) normal.Flip();
              RNScalar value = 0;
              if (color_scheme == ANGLE_COLOR_SCHEME) value = (RN_PI - acos(normal.Y())) / RN_PI;
              else value = 0.5*normal[color_scheme - XNORMAL_COLOR_SCHEME] + 0.5;
              LoadInteger((int) (65535 * value));
              triangle->Draw(R3_SURFACES_DRAW_FLAG);
            }
          }
        }
      }
    }
    else if ((color_scheme == DEPTH_COLOR_SCHEME) || (color_scheme == NDOTV_COLOR_SCHEME) || (color_scheme == HEIGHT_COLOR_SCHEME)) {
      // Draw scalar values interpolated between triangle vertices
      RNScalar ground_y = (color_scheme == HEIGHT_COLOR_SCHEME) ? EstimateGroundY(camera, scene) : 0;
      RNGrfxBegin(RN_GRFX_TRIANGLES);
      for (int i = 0; i < node->NElements(); i++) {
        R3SceneElement *element = node->Element(i);
        for (int j = 0; j < element->NShapes(); j++) {
          R3Shape *shape = element->Shape(j);
          if (shape->ClassID() == R3TriangleArray::CLASS_ID()) {
            R3TriangleArray *triangles = (R3TriangleArray *) shape;
            for (int k = 0; k < triangles->NTriangles(); k++) {
              R3Triangle *triangle = triangles->Triangle(k);
              for (int m = 0; m < 3; m++) {
                R3TriangleVertex *vertex = triangle->Vertex(m);
                const R3Point& position = vertex->Position();
                if (color_scheme == HEIGHT_COLOR_SCHEME) LoadScalar(position.Y() - ground_y, 6.5535);
                else if (color_scheme == DEPTH_COLOR_SCHEME) LoadScalar((position - camera.Origin()).Dot(camera.Towards()), 6.5535);
                else if (color_scheme == NDOTV_COLOR_SCHEME) {
                  R3Vector v = camera.Origin() - position; v.Normalize();
                  R3Vector normal = (vertex->Flags()[R3_VERTEX_NORMALS_DRAW_FLAG]) ? vertex->Normal() : triangle->Normal();
                  LoadScalar(fabs(normal.Dot(v)), 1.0);
                }
                R3LoadPoint(position);
              }
            }
          }
        }
      }
      RNGrfxEnd();
    }
    else if (color_scheme == VRGB_COLOR_SCHEME) {
      // Draw node with vertex colors
      node->Draw(R3_SURFACES_DRAW_FLAG | R3_VERTEX_COLORS_DRAW_FLAG);
    }
    else {
      // Draw without setting colors
      for (int i = 0; i < node->NElements(); i++) {
        R3SceneElement *element = node->Element(i);
        element->Draw(R3_SURFACES_DRAW_FLAG);
      }
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %r8d, %ebp
movl %ecx, %r14d
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r13
testl %r8d, %r8d
je 0x2a31b
movq 0x1a0(%r12), %rdi
testq %rdi, %rdi
je 0x2a31b
leaq 0xc3ffb(%rip), %rsi     # 0xee308
movl $0x7, %edx
callq 0x223c0
testl %eax, %eax
je 0x2a355
cmpl $0x0, 0x2c(%r12)
jle 0x2a367
cmpl $0x0, 0x2c(%r12)
jle 0x2a355
xorl %r15d, %r15d
movq 0x20(%r12), %rax
movq (%rax,%r15,8), %rdx
movq %r13, %rdi
movq %rbx, %rsi
movl %r14d, %ecx
movl %ebp, %r8d
callq 0x2a2d4
incq %r15
movslq 0x2c(%r12), %rax
cmpq %rax, %r15
jl 0x2a32e
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x9, %r14d
je 0x2a3a5
cmpl $0x1, %r14d
jne 0x2a3c5
movzbl 0x131526(%rip), %eax    # 0x15b8a0
movl $0x8, %ecx
subl %eax, %ecx
cmpl %ecx, 0x24(%rbx)
jle 0x2a3a5
movq %r12, %rdi
callq 0x3f3f0
movzbl 0x13150b(%rip), %edx    # 0x15b8a0
movq %rbx, %rdi
movq %rax, %rsi
movl $0x7, %ecx
callq 0x2c0ae
movl $0x772, %esi            # imm = 0x772
movq %r12, %rdi
xorl %edx, %edx
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x40104
leal -0xd(%r14), %eax
cmpl $0x2, %eax
movq %r12, 0x30(%rsp)
ja 0x2a47e
cmpl $0xd, %r14d
je 0x2a6a2
cmpl $0xf, %r14d
je 0x2a585
cmpl $0xe, %r14d
jne 0x2a99d
testq %r12, %r12
je 0x2a963
leaq 0x10(%rsp), %r13
leaq 0xd377f(%rip), %rbx     # 0xfdb89
leaq 0xd377d(%rip), %r14     # 0xfdb8e
movq %rsp, %r15
movq %r12, %rbp
movq %r13, (%rsp)
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2b0c6
movq 0x50(%rbp), %rdi
movq %r15, %rsi
callq 0x2acfe
movq 0x50(%rbp), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x2a448
movq 0x40(%rax), %r12
jmp 0x2a44b
xorl %r12d, %r12d
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2a461
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x228b0
movq 0x10(%rbp), %rbp
testq %r12, %r12
sete %al
testq %rbp, %rbp
je 0x2a968
testq %r12, %r12
je 0x2a417
jmp 0x2a968
cmpl $0xa, %r14d
je 0x2a6bf
cmpl $0xb, %r14d
je 0x2a633
cmpl $0xc, %r14d
jne 0x2a7a2
cmpl $0x0, 0x3c(%r12)
jle 0x2a355
xorl %ecx, %ecx
movq %rsp, %rbx
xorl %r15d, %r15d
movq 0x30(%r12), %rax
movq %rcx, 0x38(%rsp)
movq (%rax,%rcx,8), %r12
cmpl $0x0, 0x1c(%r12)
jle 0x2a565
xorl %r13d, %r13d
movq %r12, 0x20(%rsp)
movq 0x10(%r12), %rax
movq (%rax,%r13,8), %r14
movq (%r14), %rax
movq %r14, %rdi
callq *0xb8(%rax)
movl %eax, %ebp
callq 0x6b088
cmpl %eax, %ebp
jne 0x2a554
cmpl $0x0, 0x24(%r14)
jle 0x2a554
movl %r15d, 0x28(%rsp)
movl %r15d, %r12d
xorl %ebp, %ebp
movq 0x18(%r14), %rax
movq (%rax,%rbp,8), %r15
leaq (%r12,%rbp), %rax
incq %rax
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, (%rsp)
movb %ah, 0x1(%rsp)
movb %al, 0x2(%rsp)
movq %rbx, %rdi
callq 0x22b90
movq (%r15), %rax
movl $0x2, %esi
movq %r15, %rdi
callq *0xa8(%rax)
incq %rbp
movslq 0x24(%r14), %rax
cmpq %rax, %rbp
jl 0x2a503
movl 0x28(%rsp), %r15d
addl %ebp, %r15d
movq 0x20(%rsp), %r12
incq %r13
movslq 0x1c(%r12), %rax
cmpq %rax, %r13
jl 0x2a4d2
movq 0x38(%rsp), %rcx
incq %rcx
movq 0x30(%rsp), %r12
movslq 0x3c(%r12), %rax
cmpq %rax, %rcx
jl 0x2a4b0
jmp 0x2a355
movq 0x1a0(%r12), %rbx
testq %rbx, %rbx
je 0x2a622
leaq 0xc3d73(%rip), %rsi     # 0xee310
movl $0x5, %edx
movq %rbx, %rdi
callq 0x223c0
testl %eax, %eax
je 0x2a950
leaq 0xc3d5d(%rip), %rsi     # 0xee316
movl $0xb, %edx
movq %rbx, %rdi
callq 0x223c0
testl %eax, %eax
je 0x2a950
leaq 0xc3d4d(%rip), %rsi     # 0xee322
movl $0xc, %edx
movq %rbx, %rdi
callq 0x223c0
testl %eax, %eax
je 0x2a950
leaq 0xc3d3e(%rip), %rsi     # 0xee32f
movl $0x8, %edx
movq %rbx, %rdi
callq 0x223c0
testl %eax, %eax
je 0x2abdf
leaq 0xc3d2b(%rip), %rsi     # 0xee338
movl $0x6, %edx
movq %rbx, %rdi
callq 0x223c0
testl %eax, %eax
je 0x2abf0
movq %rsp, %rdi
movw $0x0, (%rdi)
movb $0x0, 0x2(%rdi)
jmp 0x2a95c
cmpl $0x0, 0x3c(%r12)
jle 0x2a355
xorl %r15d, %r15d
movq %rsp, %rbx
movq 0x30(%r12), %rax
movq (%rax,%r15,8), %r14
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x2a66e
movl 0x8(%rax), %eax
incl %eax
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, (%rsp)
movb %ah, 0x1(%rsp)
movb %al, 0x2(%rsp)
jmp 0x2a679
movw $0x0, (%rsp)
movb $0x0, 0x2(%rsp)
movq %rbx, %rdi
callq 0x22b90
movl $0x2, %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x40aee
incq %r15
movslq 0x3c(%r12), %rax
cmpq %rax, %r15
jl 0x2a645
jmp 0x2a355
movl 0x8(%r12), %eax
incl %eax
movl %eax, %ecx
shrl $0x10, %ecx
movq %rsp, %rdi
movb %cl, (%rdi)
movb %ah, 0x1(%rsp)
movb %al, 0x2(%rdi)
jmp 0x2a95c
cmpl $0x0, 0x3c(%r12)
jle 0x2a355
xorl %r14d, %r14d
leaq 0x131b9b(%rip), %r15    # 0x15c270
movq 0x30(%r12), %rax
movq (%rax,%r14,8), %rbx
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2a6ed
movq 0x18(%rax), %rax
jmp 0x2a6ef
xorl %eax, %eax
testq %rax, %rax
jne 0x2a6f7
movq %r15, %rax
movsd 0x40(%rax), %xmm0
movsd 0xc394c(%rip), %xmm3    # 0xee050
mulsd %xmm3, %xmm0
movsd 0x38(%rax), %xmm1
movsd 0xc3943(%rip), %xmm4    # 0xee058
mulsd %xmm4, %xmm1
addsd %xmm0, %xmm1
movsd 0x48(%rax), %xmm0
movsd 0xc3936(%rip), %xmm5    # 0xee060
mulsd %xmm5, %xmm0
addsd %xmm1, %xmm0
movsd 0x58(%rax), %xmm1
mulsd %xmm3, %xmm1
movsd 0x50(%rax), %xmm2
mulsd %xmm4, %xmm2
addsd %xmm1, %xmm2
movsd 0x60(%rax), %xmm1
mulsd %xmm5, %xmm1
addsd %xmm2, %xmm1
movsd 0x70(%rax), %xmm2
mulsd %xmm3, %xmm2
movsd 0x68(%rax), %xmm3
mulsd %xmm4, %xmm3
addsd %xmm2, %xmm3
movsd 0x78(%rax), %xmm2
mulsd %xmm5, %xmm2
addsd %xmm3, %xmm2
callq 0x22e60
movl $0x2, %esi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x40aee
incq %r14
movslq 0x3c(%r12), %rax
cmpq %rax, %r14
jl 0x2a6d5
jmp 0x2a355
movl %r14d, %eax
andl $-0x4, %eax
cmpl $0x4, %eax
jne 0x2a92d
cmpl $0x0, 0x3c(%r12)
jle 0x2a355
leal -0x5(%r14), %eax
cltq
movq %rax, 0x28(%rsp)
leaq 0xc7fc9(%rip), %rax     # 0xf2798
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
xorl %ecx, %ecx
movq %r13, %rbx
movq 0x30(%r12), %rax
movq %rcx, 0x40(%rsp)
movq (%rax,%rcx,8), %rcx
cmpl $0x0, 0x1c(%rcx)
jle 0x2a90a
xorl %edx, %edx
movq %rcx, 0x48(%rsp)
movq 0x10(%rcx), %rax
movq %rdx, 0x38(%rsp)
movq (%rax,%rdx,8), %r13
movq (%r13), %rax
movq %r13, %rdi
callq *0xb8(%rax)
movl %eax, %ebp
callq 0x6b088
cmpl %eax, %ebp
jne 0x2a8f0
cmpl $0x0, 0x24(%r13)
jle 0x2a8f0
xorl %r15d, %r15d
movq 0x18(%r13), %rax
movq (%rax,%r15,8), %rbp
leaq 0x20(%rbp), %r12
movq %rsp, %rdi
movq %r12, %rsi
callq 0x7976e
movq %r12, %rdi
movq %rbx, %rsi
callq 0x51893
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x2a868
movq %rsp, %rdi
callq 0x79aec
cmpl $0x4, %r14d
jne 0x2a88d
movsd 0x8(%rsp), %xmm0
callq 0x22810
movsd 0x20(%rsp), %xmm2
movapd %xmm2, %xmm1
subsd %xmm0, %xmm1
divsd %xmm2, %xmm1
jmp 0x2a8a7
movq 0x28(%rsp), %rax
movsd (%rsp,%rax,8), %xmm1
movsd 0xc3791(%rip), %xmm0    # 0xee030
mulsd %xmm0, %xmm1
addsd %xmm0, %xmm1
mulsd 0xc3761(%rip), %xmm1    # 0xee010
cvttsd2si %xmm1, %eax
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x70(%rsp)
movb %ah, 0x71(%rsp)
movb %al, 0x72(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x22b90
movq (%rbp), %rax
movl $0x2, %esi
movq %rbp, %rdi
callq *0xa8(%rax)
incq %r15
movslq 0x24(%r13), %rax
cmpq %rax, %r15
jl 0x2a834
movq 0x38(%rsp), %rdx
incq %rdx
movq 0x48(%rsp), %rcx
movslq 0x1c(%rcx), %rax
cmpq %rax, %rdx
jl 0x2a7fd
movq 0x40(%rsp), %rcx
incq %rcx
movq 0x30(%rsp), %r12
movslq 0x3c(%r12), %rax
cmpq %rax, %rcx
movq %rbx, %r13
jl 0x2a7db
jmp 0x2a355
leal -0x2(%r14), %eax
cmpl $0x2, %eax
jb 0x2a9b1
cmpl $0x8, %r14d
je 0x2a9b1
cmpl $0x10, %r14d
jne 0x2abaa
movl $0x402, %esi            # imm = 0x402
jmp 0x2a3aa
movq %rsp, %rdi
movw $0x0, (%rdi)
movb $0x1, 0x2(%rdi)
callq 0x22b90
jmp 0x2a99d
movb $0x1, %al
xorl %r12d, %r12d
testb %al, %al
je 0x2a97a
movq %rsp, %rdi
movw $0x0, (%rdi)
movb $0x0, 0x2(%rdi)
jmp 0x2a993
movq %r12, %rdi
callq 0x22ed0
movl %eax, %ecx
shrl $0x10, %ecx
movq %rsp, %rdi
movb %cl, (%rdi)
movb %ah, 0x1(%rsp)
movb %al, 0x2(%rdi)
callq 0x22b90
movq 0x30(%rsp), %r12
movl $0x2, %esi
movq %r12, %rdi
xorl %edx, %edx
callq 0x40104
jmp 0x2a355
xorpd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
cmpl $0x3, %r14d
jne 0x2a9d2
movq %r13, %rdi
movq %rbx, %rsi
callq 0x2ac22
movsd %xmm0, 0x28(%rsp)
movq %r13, 0x20(%rsp)
movl $0x4, %edi
callq 0x22180
cmpl $0x0, 0x3c(%r12)
jle 0x2aba0
movq 0x20(%rsp), %rax
addq $0x48, %rax
movq %rax, 0x48(%rsp)
xorl %ecx, %ecx
movq %rsp, %r13
movq 0x30(%r12), %rax
movq %rcx, 0x50(%rsp)
movq (%rax,%rcx,8), %rcx
cmpl $0x0, 0x1c(%rcx)
jle 0x2ab85
xorl %edx, %edx
movq %rcx, 0x58(%rsp)
movq 0x10(%rcx), %rax
movq %rdx, 0x60(%rsp)
movq (%rax,%rdx,8), %r15
movq (%r15), %rax
movq %r15, %rdi
callq *0xb8(%rax)
movl %eax, %ebx
callq 0x6b088
cmpl %eax, %ebx
jne 0x2ab6b
cmpl $0x0, 0x24(%r15)
jle 0x2ab6b
xorl %ecx, %ecx
movq %r15, 0x68(%rsp)
movq 0x18(%r15), %rax
movq %rcx, 0x40(%rsp)
movq (%rax,%rcx,8), %r15
leaq 0x20(%r15), %rax
movq %rax, 0x38(%rsp)
movl $0x1, %ebp
movq (%r15,%rbp,8), %rbx
cmpl $0x3, %r14d
jne 0x2aa8b
movsd 0x8(%rbx), %xmm0
subsd 0x28(%rsp), %xmm0
jmp 0x2aac4
cmpl $0x8, %r14d
je 0x2aafc
cmpl $0x2, %r14d
jne 0x2aae5
movq %r13, %rdi
movq %rbx, %rsi
movq 0x20(%rsp), %rdx
callq 0x78f28
leaq 0x70(%rsp), %r12
movq %r12, %rdi
movq 0x48(%rsp), %rsi
callq 0x7a3f4
movq %r13, %rdi
movq %r12, %rsi
callq 0x799f6
movsd 0xc35ec(%rip), %xmm1    # 0xee0b8
movapd %xmm1, %xmm2
minsd %xmm0, %xmm2
divsd %xmm1, %xmm2
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x22e60
movq %rbx, %rdi
callq 0x221a0
incq %rbp
cmpq $0x4, %rbp
jne 0x2aa74
jmp 0x2ab51
movq %r13, %rdi
movq 0x20(%rsp), %rsi
movq %rbx, %rdx
callq 0x78f28
movq %r13, %rdi
callq 0x79a80
leaq 0x18(%rbx), %rsi
btl $0x8, 0x58(%rbx)
cmovaeq 0x38(%rsp), %rsi
leaq 0x70(%rsp), %r12
movq %r12, %rdi
callq 0x7976e
movq %r12, %rdi
movq %r13, %rsi
callq 0x799f6
andpd 0xc35ad(%rip), %xmm0    # 0xee0f0
movsd 0xc3525(%rip), %xmm2    # 0xee070
minsd %xmm0, %xmm2
jmp 0x2aad8
movq 0x40(%rsp), %rcx
incq %rcx
movq 0x68(%rsp), %r15
movslq 0x24(%r15), %rax
cmpq %rax, %rcx
jl 0x2aa59
movq 0x60(%rsp), %rdx
incq %rdx
movq 0x58(%rsp), %rcx
movslq 0x1c(%rcx), %rax
cmpq %rax, %rdx
jl 0x2aa1f
movq 0x50(%rsp), %rcx
incq %rcx
movq 0x30(%rsp), %r12
movslq 0x3c(%r12), %rax
cmpq %rax, %rcx
jl 0x2aa00
callq 0x22c40
jmp 0x2a355
cmpl $0x0, 0x3c(%r12)
jle 0x2a355
xorl %ebx, %ebx
movq 0x30(%r12), %rax
movq (%rax,%rbx,8), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x40aee
incq %rbx
movslq 0x3c(%r12), %rax
cmpq %rax, %rbx
jl 0x2abb8
jmp 0x2a355
movq %rsp, %rdi
movw $0x0, (%rdi)
movb $0x2, 0x2(%rdi)
jmp 0x2a95c
movq %rsp, %rdi
movw $0x0, (%rdi)
movb $0x3, 0x2(%rdi)
jmp 0x2a95c
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x2ac1a
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x228b0
movq %rbx, %rdi
callq 0x230b0