// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_teapot.c
// Function: fghTeapot
static void fghTeapot( GLint grid, GLdouble scale, GLenum type )
{
#if defined(_WIN32_WCE)
		int i, numV=sizeof(strip_vertices)/4, numI=sizeof(strip_normals)/4;
#else
    double p[4][4][3], q[4][4][3], r[4][4][3], s[4][4][3];
    long i, j, k, l;
#endif

    glPushAttrib( GL_ENABLE_BIT | GL_EVAL_BIT );
    glEnable( GL_AUTO_NORMAL );
    glEnable( GL_NORMALIZE );
    glEnable( GL_MAP2_VERTEX_3 );
    glEnable( GL_MAP2_TEXTURE_COORD_2 );

    glPushMatrix();
    glRotated( 270.0, 1.0, 0.0, 0.0 );
    glScaled( 0.5 * scale, 0.5 * scale, 0.5 * scale );
    glTranslated( 0.0, 0.0, -1.5 );

#if defined(_WIN32_WCE)
    glRotated( 90.0, 1.0, 0.0, 0.0 );
    glBegin( GL_TRIANGLE_STRIP );

    for( i = 0; i < numV-1; i++ )
    {
        int vidx = strip_vertices[i],
            nidx = strip_normals[i];

        if( vidx != -1 )
        {
            glNormal3fv( normals[nidx]  );
            glVertex3fv( vertices[vidx] );
        }
        else
        {
            glEnd();
            glBegin( GL_TRIANGLE_STRIP );
        }
    }

    glEnd();
#else
    for (i = 0; i < 10; i++) {
      for (j = 0; j < 4; j++) {
        for (k = 0; k < 4; k++) {
          for (l = 0; l < 3; l++) {
            p[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
            q[j][k][l] = cpdata[patchdata[i][j * 4 + (3 - k)]][l];
            if (l == 1)
              q[j][k][l] *= -1.0;
            if (i < 6) {
              r[j][k][l] =
                cpdata[patchdata[i][j * 4 + (3 - k)]][l];
              if (l == 0)
                r[j][k][l] *= -1.0;
              s[j][k][l] = cpdata[patchdata[i][j * 4 + k]][l];
              if (l == 0)
                s[j][k][l] *= -1.0;
              if (l == 1)
                s[j][k][l] *= -1.0;
            }
          }
        }
      }

      glMap2d(GL_MAP2_TEXTURE_COORD_2, 0.0, 1.0, 2, 2, 0.0, 1.0, 4, 2,
        &tex[0][0][0]);
      glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
        &p[0][0][0]);
      glMapGrid2d(grid, 0.0, 1.0, grid, 0.0, 1.0);
      glEvalMesh2(type, 0, grid, 0, grid);
      glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
        &q[0][0][0]);
      glEvalMesh2(type, 0, grid, 0, grid);
      if (i < 6) {
        glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
          &r[0][0][0]);
        glEvalMesh2(type, 0, grid, 0, grid);
        glMap2d(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, 4, 0.0, 1.0, 12, 4,
          &s[0][0][0]);
        glEvalMesh2(type, 0, grid, 0, grid);
      }
    }
#endif  /* defined(_WIN32_WCE) */

    glPopMatrix();
    glPopAttrib();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x628, %rsp            # imm = 0x628
movl %esi, 0x4(%rsp)
movsd %xmm0, 0x8(%rsp)
movl %edi, (%rsp)
movl $0x12000, %edi          # imm = 0x12000
callq 0x21d40
movl $0xd80, %edi            # imm = 0xD80
callq 0x21810
movl $0xba1, %edi            # imm = 0xBA1
callq 0x21810
movl $0xdb7, %edi            # imm = 0xDB7
callq 0x21810
movl $0xdb4, %edi            # imm = 0xDB4
callq 0x21810
callq 0x21f50
movsd 0x21eb2(%rip), %xmm0    # 0xfb670
movsd 0x852(%rip), %xmm1      # 0xda018
xorps %xmm2, %xmm2
xorpd %xmm3, %xmm3
callq 0x21bc0
movsd 0x8(%rsp), %xmm0
mulsd 0x840(%rip), %xmm0      # 0xda020
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x21960
movsd 0x21e83(%rip), %xmm2    # 0xfb678
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x21970
xorl %r13d, %r13d
leaq 0x320(%rsp), %r14
leaq 0x21e6c(%rip), %r15     # 0xfb680
movapd 0xd24(%rip), %xmm4      # 0xda540
movq %r13, %rax
shlq $0x6, %rax
leaq 0x22a46(%rip), %rcx     # 0xfc270
addq %rcx, %rax
leaq 0x20(%rsp), %r11
leaq 0x1a0(%rsp), %rdx
movq %r14, %rsi
xorl %edi, %edi
leaq (%rdi,%rdi,2), %rcx
shlq $0x5, %rcx
leaq (,%rdi,4), %r8
leaq 0x3(,%rdi,4), %r9
leaq (%rsp,%rcx), %r10
addq $0x4a0, %r10            # imm = 0x4A0
movq %r11, 0x8(%rsp)
movq %rdx, 0x18(%rsp)
movq %rsi, 0x10(%rsp)
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %rcx
movq %rbx, %r12
orq %r8, %r12
movslq (%rax,%r12,4), %r12
movq %r9, %rbp
subq %rbx, %rbp
movslq (%rax,%rbp,4), %r14
shlq $0x3, %r12
leaq (%r12,%r12,2), %rbp
movq 0x10(%r15,%rbp), %r12
movq %r12, 0x10(%r10,%rcx,8)
movups (%r15,%rbp), %xmm0
movups %xmm0, (%r10,%rcx,8)
shlq $0x3, %r14
leaq (%r14,%r14,2), %rcx
xorl %r12d, %r12d
leaq (%rcx,%r12,8), %r14
movsd (%r15,%r14), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm4, %xmm2
movapd %xmm2, %xmm3
cmpq $0x1, %r12
je 0xd98d2
movapd %xmm1, %xmm3
leaq (,%r12,8), %r14
addq %rbp, %r14
movsd (%r15,%r14), %xmm0
movsd %xmm3, (%rsi,%r12,8)
cmpq $0x5, %r13
ja 0xd990e
testq %r12, %r12
je 0xd98f8
movapd %xmm1, %xmm2
movsd %xmm2, (%rdx,%r12,8)
cmpq $0x2, %r12
jae 0xd9908
xorpd %xmm4, %xmm0
movsd %xmm0, (%r11,%r12,8)
incq %r12
cmpq $0x3, %r12
jne 0xd98b2
incq %rbx
addq $0x18, %rsi
addq $0x18, %rdx
addq $0x18, %r11
cmpq $0x4, %rbx
jne 0xd9873
incq %rdi
movq 0x10(%rsp), %rsi
addq $0x60, %rsi
movq 0x18(%rsp), %rdx
addq $0x60, %rdx
movq 0x8(%rsp), %r11
addq $0x60, %r11
cmpq $0x4, %rdi
jne 0xd983f
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb4, %edi            # imm = 0xDB4
movsd 0x6ab(%rip), %xmm1      # 0xda018
movl $0x2, %esi
movl $0x2, %edx
movaps %xmm1, %xmm3
movl $0x4, %ecx
movl $0x2, %r8d
leaq 0x68d44(%rip), %r9      # 0x1426d0
callq 0x21110
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0x672(%rip), %xmm1      # 0xda018
movl $0x3, %esi
movl $0x4, %edx
movaps %xmm1, %xmm3
movl $0xc, %ecx
movl $0x4, %r8d
leaq 0x4a0(%rsp), %r9
callq 0x21110
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl (%rsp), %ebp
movl %ebp, %edi
movsd 0x638(%rip), %xmm1      # 0xda018
movl %ebp, %esi
movaps %xmm1, %xmm3
callq 0x21e80
movl 0x4(%rsp), %ebx
movl %ebx, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21460
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0x605(%rip), %xmm1      # 0xda018
movl $0x3, %esi
movl $0x4, %edx
movapd %xmm1, %xmm3
movl $0xc, %ecx
movl $0x4, %r8d
leaq 0x320(%rsp), %r14
movq %r14, %r9
callq 0x21110
movl %ebx, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21460
cmpq $0x5, %r13
ja 0xd9aef
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0x5ad(%rip), %xmm1      # 0xda018
movl $0x3, %esi
movl $0x4, %edx
movaps %xmm1, %xmm3
movl $0xc, %ecx
movl $0x4, %r8d
leaq 0x1a0(%rsp), %r9
callq 0x21110
movl 0x4(%rsp), %ebx
movl %ebx, %edi
xorl %esi, %esi
movl (%rsp), %ebp
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21460
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0x55c(%rip), %xmm1      # 0xda018
movl $0x3, %esi
movl $0x4, %edx
movapd %xmm1, %xmm3
movl $0xc, %ecx
movl $0x4, %r8d
leaq 0x20(%rsp), %r9
callq 0x21110
movl %ebx, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21460
incq %r13
cmpq $0xa, %r13
movapd 0xa42(%rip), %xmm4      # 0xda540
jne 0xd981c
callq 0x221c0
callq 0x21090
addq $0x628, %rsp            # imm = 0x628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq