// File: /workspace/github_cpp_makefile_star2_O1/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 0x21d50
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 0x21f60
movsd 0x21e5e(%rip), %xmm0    # 0xfd620
movsd 0x84e(%rip), %xmm1      # 0xdc018
xorps %xmm2, %xmm2
xorpd %xmm3, %xmm3
callq 0x21bd0
movsd 0x8(%rsp), %xmm0
mulsd 0x83c(%rip), %xmm0      # 0xdc020
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x21960
movsd 0x21e2f(%rip), %xmm2    # 0xfd628
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x21970
xorl %r13d, %r13d
leaq 0x320(%rsp), %r14
leaq 0x21e18(%rip), %r15     # 0xfd630
movapd 0xd10(%rip), %xmm4      # 0xdc530
movq %r13, %rax
shlq $0x6, %rax
leaq 0x229f2(%rip), %rcx     # 0xfe220
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), %r14
movsd (%r15,%r14), %xmm2
movapd %xmm2, %xmm0
xorpd %xmm4, %xmm0
movapd %xmm0, %xmm3
cmpq $0x8, %r12
je 0xdb8d6
movapd %xmm2, %xmm3
leaq (%r12,%rbp), %r14
movsd (%r15,%r14), %xmm1
movsd %xmm3, (%rsi,%r12)
cmpq $0x5, %r13
ja 0xdb917
testq %r12, %r12
je 0xdb8f5
movapd %xmm2, %xmm0
jne 0xdb8fb
xorpd %xmm4, %xmm1
movsd %xmm0, (%rdx,%r12)
movsd %xmm1, (%r11,%r12)
cmpq $0x8, %r12
jne 0xdb917
xorpd %xmm4, %xmm1
movlpd %xmm1, (%r11,%r12)
addq $0x8, %r12
cmpq $0x18, %r12
jne 0xdb8b6
incq %rbx
addq $0x18, %rsi
addq $0x18, %rdx
addq $0x18, %r11
cmpq $0x4, %rbx
jne 0xdb877
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 0xdb843
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb4, %edi            # imm = 0xDB4
movsd 0x6a1(%rip), %xmm1      # 0xdc018
movl $0x2, %esi
movl $0x2, %edx
movaps %xmm1, %xmm3
movl $0x4, %ecx
movl $0x2, %r8d
leaq 0x68d3a(%rip), %r9      # 0x1446d0
callq 0x21110
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0x668(%rip), %xmm1      # 0xdc018
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 0x62e(%rip), %xmm1      # 0xdc018
movl %ebp, %esi
movaps %xmm1, %xmm3
callq 0x21e90
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 0x5fb(%rip), %xmm1      # 0xdc018
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 0xdbaf9
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0x5a3(%rip), %xmm1      # 0xdc018
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 0x552(%rip), %xmm1      # 0xdc018
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 0xa28(%rip), %xmm4      # 0xdc530
jne 0xdb820
callq 0x221d0
callq 0x21090
addq $0x628, %rsp            # imm = 0x628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq