// File: /workspace/github_cpp_makefile_star2_O2/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 $0x638, %rsp            # imm = 0x638
movl %esi, 0xc(%rsp)
movsd %xmm0, 0x10(%rsp)
movl %edi, 0x8(%rsp)
movl $0x12000, %edi          # imm = 0x12000
callq 0x21d70
movl $0xd80, %edi            # imm = 0xD80
callq 0x21820
movl $0xba1, %edi            # imm = 0xBA1
callq 0x21820
movl $0xdb7, %edi            # imm = 0xDB7
callq 0x21820
movl $0xdb4, %edi            # imm = 0xDB4
callq 0x21820
callq 0x21f70
movsd 0x2205b(%rip), %xmm0    # 0xe62e0
movsd 0xd8b(%rip), %xmm1      # 0xc5018
xorps %xmm2, %xmm2
xorpd %xmm3, %xmm3
callq 0x21bc0
movsd 0x10(%rsp), %xmm0
mulsd 0xd99(%rip), %xmm0      # 0xc5040
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
callq 0x21970
movsd 0x2202c(%rip), %xmm2    # 0xe62e8
xorpd %xmm0, %xmm0
xorpd %xmm1, %xmm1
callq 0x21980
xorl %r15d, %r15d
leaq 0x22c0d(%rip), %r12     # 0xe6ee0
leaq 0x22016(%rip), %r13     # 0xe62f0
movapd 0x124e(%rip), %xmm4     # 0xc5530
cmpq $0xa, %r15
je 0xc458f
leaq 0x4b0(%rsp), %r10
leaq 0x330(%rsp), %r11
leaq 0x1b0(%rsp), %rdx
leaq 0x30(%rsp), %rsi
xorl %edi, %edi
cmpq $0x4, %rdi
je 0xc4417
leaq (,%rdi,4), %r8
leaq 0x3(,%rdi,4), %r9
movq %r10, 0x10(%rsp)
movq %r11, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
xorl %ebp, %ebp
cmpq $0x4, %rbp
je 0xc43eb
movq %rbp, %rax
orq %r8, %rax
movq %r15, %rcx
shlq $0x6, %rcx
addq %r12, %rcx
movslq (%rcx,%rax,4), %rbx
movq %r9, %rax
subq %rbp, %rax
movslq (%rcx,%rax,4), %rax
imulq $0x18, %rax, %rax
imulq $0x18, %rbx, %rcx
xorl %ebx, %ebx
cmpq $0x3, %rbx
je 0xc43d3
leaq (%rax,%rbx,8), %r14
movsd (%r13,%r14), %xmm1
movapd %xmm1, %xmm2
xorpd %xmm4, %xmm2
movapd %xmm2, %xmm3
cmpq $0x1, %rbx
je 0xc4394
movapd %xmm1, %xmm3
leaq (%rcx,%rbx,8), %r14
movsd (%r13,%r14), %xmm0
movsd %xmm0, (%r10,%rbx,8)
movsd %xmm3, (%r11,%rbx,8)
cmpq $0x5, %r15
ja 0xc43ce
testq %rbx, %rbx
je 0xc43ba
movapd %xmm1, %xmm2
movsd %xmm2, (%rdx,%rbx,8)
cmpq $0x2, %rbx
jae 0xc43c9
xorpd %xmm4, %xmm0
movsd %xmm0, (%rsi,%rbx,8)
incq %rbx
jmp 0xc436d
incq %rbp
addq $0x18, %rsi
addq $0x18, %rdx
addq $0x18, %r11
addq $0x18, %r10
jmp 0xc433b
incq %rdi
movq 0x18(%rsp), %rsi
addq $0x60, %rsi
movq 0x20(%rsp), %rdx
addq $0x60, %rdx
movq 0x28(%rsp), %r11
addq $0x60, %r11
movq 0x10(%rsp), %r10
addq $0x60, %r10
jmp 0xc430b
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb4, %edi            # imm = 0xDB4
movsd 0xbec(%rip), %xmm1      # 0xc5018
pushq $0x2
popq %rdx
movl %edx, %esi
movaps %xmm1, %xmm3
pushq $0x4
popq %r14
movl %r14d, %ecx
movl %edx, %r8d
leaq 0x6f2ab(%rip), %r9      # 0x1336f0
callq 0x21110
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0xbb9(%rip), %xmm1      # 0xc5018
pushq $0x3
popq %rsi
movl %r14d, %edx
movaps %xmm1, %xmm3
pushq $0xc
popq %rcx
movl %r14d, %r8d
leaq 0x4b0(%rsp), %r9
callq 0x21110
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl 0x8(%rsp), %ebp
movl %ebp, %edi
movsd 0xb87(%rip), %xmm1      # 0xc5018
movl %ebp, %esi
movaps %xmm1, %xmm3
callq 0x21ea0
movl 0xc(%rsp), %ebx
movl %ebx, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21470
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0xb54(%rip), %xmm1      # 0xc5018
pushq $0x3
popq %rsi
movl %r14d, %edx
movapd %xmm1, %xmm3
pushq $0xc
popq %rcx
movl %r14d, %r8d
leaq 0x330(%rsp), %r9
callq 0x21110
movl %ebx, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21470
cmpq $0x5, %r15
ja 0xc4587
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0xb08(%rip), %xmm1      # 0xc5018
pushq $0x3
popq %rsi
pushq $0x4
popq %r14
movl %r14d, %edx
movaps %xmm1, %xmm3
pushq $0xc
popq %rcx
movl %r14d, %r8d
leaq 0x1b0(%rsp), %r9
callq 0x21110
movl 0xc(%rsp), %ebx
movl %ebx, %edi
xorl %esi, %esi
movl 0x8(%rsp), %ebp
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21470
xorpd %xmm0, %xmm0
xorpd %xmm2, %xmm2
movl $0xdb7, %edi            # imm = 0xDB7
movsd 0xabb(%rip), %xmm1      # 0xc5018
pushq $0x3
popq %rsi
movl %r14d, %edx
movapd %xmm1, %xmm3
pushq $0xc
popq %rcx
movl %r14d, %r8d
leaq 0x30(%rsp), %r9
callq 0x21110
movl %ebx, %edi
xorl %esi, %esi
movl %ebp, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
callq 0x21470
incq %r15
jmp 0xc42da
callq 0x221e0
callq 0x21090
addq $0x638, %rsp            # imm = 0x638
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq