// File: tomfunkhouser[P]gaps/pkgs/R3Shapes/R3Draw.cpp
// Function: gaps::R3Triangle::Draw(gaps::RNFlags) const
void R3Triangle::
Draw(const R3DrawFlags draw_flags) const
{
    // Ammend draw flags
    R3DrawFlags flags(Flags() & draw_flags);
    RNDimension dim = 0, dim1 = 0, dim2 = 0;

    // Unroll flags/loops for efficiency 
    switch (flags) {
    case R3_SURFACES_DRAW_FLAG:
      // No shading
      R3BeginPolygon();
      R3LoadPoint(v[0]->Position());
      R3LoadPoint(v[1]->Position());
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    case R3_SURFACES_DRAW_FLAG | R3_SURFACE_NORMALS_DRAW_FLAG:
      // Flat shading
      R3BeginPolygon();
      R3LoadNormal(Normal());
      R3LoadPoint(v[0]->Position());
      R3LoadPoint(v[1]->Position());
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    case R3_SURFACES_DRAW_FLAG | R3_VERTEX_COLORS_DRAW_FLAG:
      // Color interpolation
      R3BeginPolygon();
      RNLoadRgb(v[0]->Color());
      R3LoadPoint(v[0]->Position());
      RNLoadRgb(v[1]->Color());
      R3LoadPoint(v[1]->Position());
      RNLoadRgb(v[2]->Color());
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    case R3_SURFACES_DRAW_FLAG | R3_SURFACE_NORMALS_DRAW_FLAG | R3_VERTEX_NORMALS_DRAW_FLAG:
      // Gouraud shading
      R3BeginPolygon();
      R3LoadNormal(v[0]->Normal());
      R3LoadPoint(v[0]->Position());
      R3LoadNormal(v[1]->Normal());
      R3LoadPoint(v[1]->Position());
      R3LoadNormal(v[2]->Normal());
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    case R3_SURFACES_DRAW_FLAG | R3_SURFACE_NORMALS_DRAW_FLAG | 
         R3_SURFACE_TEXTURE_DRAW_FLAG | R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG: 
      // Flat shading with texture coordinates
      R3BeginPolygon();
      R3LoadNormal(Normal());
      R3LoadTextureCoords(v[0]->TextureCoords());
      R3LoadPoint(v[0]->Position());
      R3LoadTextureCoords(v[1]->TextureCoords());
      R3LoadPoint(v[1]->Position());
      R3LoadTextureCoords(v[2]->TextureCoords());
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    case R3_SURFACES_DRAW_FLAG | R3_SURFACE_NORMALS_DRAW_FLAG | 
         R3_SURFACE_TEXTURE_DRAW_FLAG: 
      // Flat shading with texture coordinate generation
      dim = Normal().MaxDimension();
      dim1 = (dim + 1) % 3;
      dim2 = (dim + 2) % 3;
      R3BeginPolygon();
      R3LoadNormal(Normal());
      R3LoadTextureCoords(v[0]->Position()[dim1], v[0]->Position()[dim2]);
      R3LoadPoint(v[0]->Position());
      R3LoadTextureCoords(v[1]->Position()[dim1], v[1]->Position()[dim2]);
      R3LoadPoint(v[1]->Position());
      R3LoadTextureCoords(v[2]->Position()[dim1], v[2]->Position()[dim2]);
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    case R3_SURFACES_DRAW_FLAG | R3_SURFACE_NORMALS_DRAW_FLAG | R3_VERTEX_NORMALS_DRAW_FLAG | 
         R3_SURFACE_TEXTURE_DRAW_FLAG | R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG: 
      // Gouraud shading with texture coordinates
      R3BeginPolygon();
      R3LoadTextureCoords(v[0]->TextureCoords());
      R3LoadNormal(v[0]->Normal());
      R3LoadPoint(v[0]->Position());
      R3LoadTextureCoords(v[1]->TextureCoords());
      R3LoadNormal(v[1]->Normal());
      R3LoadPoint(v[1]->Position());
      R3LoadTextureCoords(v[2]->TextureCoords());
      R3LoadNormal(v[2]->Normal());
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    case R3_SURFACES_DRAW_FLAG | R3_SURFACE_NORMALS_DRAW_FLAG | R3_VERTEX_NORMALS_DRAW_FLAG | 
         R3_SURFACE_TEXTURE_DRAW_FLAG: 
      // Gouraud shading with texture coordinate generation
      dim = Normal().MaxDimension();
      dim1 = (dim + 1) % 3;
      dim2 = (dim + 2) % 3;
      R3BeginPolygon();
      R3LoadTextureCoords(v[0]->Position()[dim1], v[0]->Position()[dim2]);
      R3LoadNormal(v[0]->Normal());
      R3LoadPoint(v[0]->Position());
      R3LoadTextureCoords(v[1]->Position()[dim1], v[1]->Position()[dim2]);
      R3LoadNormal(v[1]->Normal());
      R3LoadPoint(v[1]->Position());
      R3LoadTextureCoords(v[2]->Position()[dim1], v[2]->Position()[dim2]);
      R3LoadNormal(v[2]->Normal());
      R3LoadPoint(v[2]->Position());
      R3EndPolygon();
      break;

    default:
        // Draw surface
        if (flags[R3_SURFACES_DRAW_FLAG]) {
	    // Begin polygon
	    R3BeginPolygon();

            // Load polygon normal
	    if ((flags[R3_SURFACE_NORMALS_DRAW_FLAG]) &&
		(!flags[R3_VERTEX_NORMALS_DRAW_FLAG]))
	        R3LoadNormal(Normal());

	    // Compute stuff for texture coordinates
	    if ((draw_flags[R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG]) &&
		(!flags[R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG])) {
	        dim = Normal().MaxDimension();
		dim1 = (dim + 1) % 3;
		dim2 = (dim + 2) % 3;
	    }

	    // Load triangle vertices
	    for (int i = 0; i < 3; i++) {
		// Load vertex color
  		if (flags[R3_VERTEX_COLORS_DRAW_FLAG]) {
                    RNLoadRgb(v[i]->Color());
 		}

		// Load vertex normal
		if (flags[R3_VERTEX_NORMALS_DRAW_FLAG]) {
                  const R3Vector& normal = (v[i]->HasNormal()) ? v[i]->Normal() : Normal();
                  RNScalar dot = normal.Dot(Normal());
                  if (dot > 0.25) R3LoadNormal(normal);
                  else if (dot < -0.25) R3LoadNormal(-normal);
                  else R3LoadNormal(Normal());
                }

		// Load vertex texture coordinates 
		if (draw_flags[R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG]) {
		    if (flags[R3_VERTEX_TEXTURE_COORDS_DRAW_FLAG]) R3LoadTextureCoords(v[i]->TextureCoords());
		    else R3LoadTextureCoords(v[i]->Position()[dim1], v[i]->Position()[dim2]);
		}

		// Load vertex
		R3LoadPoint(v[i]->Position());
	    }

	    // End polygon 
	    R3EndPolygon();
	}
	
	// Draw edges
	if (flags[R3_EDGES_DRAW_FLAG]) {
	    R3BeginLoop();
            R3LoadPoint(v[0]->Position());
            R3LoadPoint(v[1]->Position());
            R3LoadPoint(v[2]->Position());
	    R3EndLoop();
	}
	break;
    }
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movq %rsi, 0x110(%rsp)
movq %rdi, 0x108(%rsp)
movq 0x108(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x78930
movq %rax, 0xf8(%rsp)
leaq 0xf8(%rsp), %rdi
callq 0x13de0
movq %rax, 0x50(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x13de0
movq 0x50(%rsp), %rsi
andq %rax, %rsi
leaq 0x100(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x13d80
movq 0x58(%rsp), %rdi
movl $0x0, 0xf4(%rsp)
movl $0x0, 0xf0(%rsp)
movl $0x0, 0xec(%rsp)
callq 0x13de0
movq %rax, %rcx
movq %rcx, 0x60(%rsp)
subq $0x2, %rax
je 0x7620d
jmp 0x76189
movq 0x60(%rsp), %rax
subq $0x22, %rax
je 0x7625e
jmp 0x7619a
movq 0x60(%rsp), %rax
subq $0x32, %rax
je 0x7648c
jmp 0x761ab
movq 0x60(%rsp), %rax
subq $0x122, %rax            # imm = 0x122
je 0x76354
jmp 0x761be
movq 0x60(%rsp), %rax
subq $0x132, %rax            # imm = 0x132
je 0x766f9
jmp 0x761d1
movq 0x60(%rsp), %rax
subq $0x232, %rax            # imm = 0x232
je 0x763e7
jmp 0x761e4
movq 0x60(%rsp), %rax
subq $0x332, %rax            # imm = 0x332
je 0x76624
jmp 0x761f7
movq 0x60(%rsp), %rax
subq $0x402, %rax            # imm = 0x402
je 0x762c1
jmp 0x768c1
callq 0x38e90
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
callq 0x38e90
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
callq 0x38e90
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x789d0
movq %rax, %rdi
callq 0x78980
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x789d0
movq %rax, %rdi
callq 0x78980
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x789d0
movq %rax, %rdi
callq 0x78980
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
callq 0x38e90
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
callq 0x38e90
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78a10
movq %rax, %rdi
callq 0x789f0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78a10
movq %rax, %rdi
callq 0x789f0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78a10
movq %rax, %rdi
callq 0x789f0
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x6ffd0
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0xf0(%rsp)
movl 0xf4(%rsp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0xec(%rsp)
callq 0x38e90
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xf0(%rsp), %esi
callq 0x13af0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x30(%rsp)
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xec(%rsp), %esi
callq 0x13af0
movaps %xmm0, %xmm1
movsd 0x30(%rsp), %xmm0
callq 0x6bf90
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xf0(%rsp), %esi
callq 0x13af0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x38(%rsp)
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xec(%rsp), %esi
callq 0x13af0
movaps %xmm0, %xmm1
movsd 0x38(%rsp), %xmm0
callq 0x6bf90
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xf0(%rsp), %esi
callq 0x13af0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x40(%rsp)
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xec(%rsp), %esi
callq 0x13af0
movaps %xmm0, %xmm1
movsd 0x40(%rsp), %xmm0
callq 0x6bf90
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
callq 0x38e90
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78a10
movq %rax, %rdi
callq 0x789f0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78a10
movq %rax, %rdi
callq 0x789f0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78a10
movq %rax, %rdi
callq 0x789f0
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x6ffd0
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0xf0(%rsp)
movl 0xf4(%rsp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0xec(%rsp)
callq 0x38e90
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xf0(%rsp), %esi
callq 0x13af0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x18(%rsp)
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xec(%rsp), %esi
callq 0x13af0
movaps %xmm0, %xmm1
movsd 0x18(%rsp), %xmm0
callq 0x6bf90
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xf0(%rsp), %esi
callq 0x13af0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x20(%rsp)
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xec(%rsp), %esi
callq 0x13af0
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
callq 0x6bf90
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xf0(%rsp), %esi
callq 0x13af0
movq 0x48(%rsp), %rax
movsd %xmm0, 0x28(%rsp)
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xec(%rsp), %esi
callq 0x13af0
movaps %xmm0, %xmm1
movsd 0x28(%rsp), %xmm0
callq 0x6bf90
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x789e0
movq %rax, %rdi
callq 0x38ea0
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x38ec0
jmp 0x76d0c
leaq 0xe0(%rsp), %rdi
movl $0x2, %esi
callq 0x13d80
movq 0xe0(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76c98
callq 0x38e90
leaq 0xd8(%rsp), %rdi
movl $0x20, %esi
callq 0x13d80
movq 0xd8(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76960
leaq 0xd0(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x13d80
movq 0xd0(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
jne 0x76960
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x38ea0
leaq 0xc8(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x13d80
movq 0xc8(%rsp), %rsi
leaq 0x110(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76a03
leaq 0xc0(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x13d80
movq 0xc0(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
jne 0x76a03
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x6ffd0
movl %eax, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0xf0(%rsp)
movl 0xf4(%rsp), %eax
addl $0x2, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0xec(%rsp)
movl $0x0, 0xbc(%rsp)
cmpl $0x3, 0xbc(%rsp)
jge 0x76c93
leaq 0xb0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x13d80
movq 0xb0(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76a67
movq 0x48(%rsp), %rax
movslq 0xbc(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x789d0
movq %rax, %rdi
callq 0x78980
leaq 0xa8(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x13d80
movq 0xa8(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76b8d
movq 0x48(%rsp), %rax
movslq 0xbc(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x78a20
cmpl $0x0, %eax
je 0x76ad1
movq 0x48(%rsp), %rax
movslq 0xbc(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x789e0
movq %rax, 0x10(%rsp)
jmp 0x76ae0
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rdi
movq 0x10(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0x78960
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0x702c0
movsd %xmm0, 0x98(%rsp)
movsd 0x98(%rsp), %xmm0
movsd 0xbee1d(%rip), %xmm1    # 0x135948
ucomisd %xmm1, %xmm0
jbe 0x76b40
movq 0xa0(%rsp), %rdi
callq 0x38ea0
jmp 0x76b8b
movsd 0xbee08(%rip), %xmm0    # 0x135950
ucomisd 0x98(%rsp), %xmm0
jbe 0x76b77
movq 0xa0(%rsp), %rsi
leaq 0x80(%rsp), %rdi
callq 0x70fa0
leaq 0x80(%rsp), %rdi
callq 0x38ea0
jmp 0x76b89
movq 0x48(%rsp), %rdi
callq 0x78960
movq %rax, %rdi
callq 0x38ea0
jmp 0x76b8b
jmp 0x76b8d
leaq 0x78(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x13d80
movq 0x78(%rsp), %rsi
leaq 0x110(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76c5e
leaq 0x70(%rsp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0x13d80
movq 0x70(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76bfe
movq 0x48(%rsp), %rax
movslq 0xbc(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x78a10
movq %rax, %rdi
callq 0x789f0
jmp 0x76c5c
movq 0x48(%rsp), %rax
movslq 0xbc(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xf0(%rsp), %esi
callq 0x13af0
movq 0x48(%rsp), %rax
movsd %xmm0, (%rsp)
movslq 0xbc(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x78950
movq %rax, %rdi
movl 0xec(%rsp), %esi
callq 0x13af0
movaps %xmm0, %xmm1
movsd (%rsp), %xmm0
callq 0x6bf90
jmp 0x76c5e
movq 0x48(%rsp), %rax
movslq 0xbc(%rsp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0x76a0e
callq 0x38ec0
leaq 0x68(%rsp), %rdi
movl $0x1, %esi
callq 0x13d80
movq 0x68(%rsp), %rsi
leaq 0x100(%rsp), %rdi
callq 0x13d50
cmpl $0x0, %eax
je 0x76d0a
callq 0x78a60
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x10(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
movq 0x48(%rsp), %rax
movq 0x18(%rax), %rdi
callq 0x78950
movq %rax, %rdi
callq 0x38e40
callq 0x78a70
jmp 0x76d0c
addq $0x118, %rsp            # imm = 0x118
retq
nopw %cs:(%rax,%rax)