// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutWireCylinder
void FGAPIENTRY glutWireCylinder(GLdouble radius, GLdouble height, GLint slices, GLint stacks)
{
    int i,j;

    /* Step in z and radius as stacks are drawn. */

          double z = 0.0;
    const double zStep = height / ( ( stacks > 0 ) ? stacks : 1 );

    /* Pre-computed circle */

    double *sint,*cost;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWireCylinder" );

    fghCircleTable(&sint,&cost,-slices);

    /* Draw the stacks... */

    for (i=0; i<=stacks; i++)
    {
        if (i==stacks)
            z = height;

        glBegin(GL_LINE_LOOP);

            for( j=0; j<slices; j++ )
            {
                glNormal3d(cost[j],        sint[j],        0.0);
                glVertex3d(cost[j]*radius, sint[j]*radius, z  );
            }

        glEnd();

        z += zStep;
    }

    /* Draw the slices */

    glBegin(GL_LINES);

        for (j=0; j<slices; j++)
        {
            glNormal3d(cost[j],        sint[j],        0.0   );
            glVertex3d(cost[j]*radius, sint[j]*radius, 0.0   );
            glVertex3d(cost[j]*radius, sint[j]*radius, height);
        }

    glEnd();

    /* Release sin and cos tables */

    free(sint);
    free(cost);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r15d
movl %edi, %ebp
movsd %xmm1, (%rsp)
cmpl $0x2, %esi
movl $0x1, %r13d
cmovgel %esi, %r13d
movsd %xmm0, 0x8(%rsp)
leaq 0x6b2f7(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd6ee4
leaq 0x126e0(%rip), %rdi     # 0xe95b6
leaq 0x2433a(%rip), %rsi     # 0xfb217
xorl %eax, %eax
callq 0xcfe73
movl %ebp, %edx
negl %edx
leaq 0x30(%rsp), %rbx
leaq 0x28(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xd62bb
movq (%rbx), %r14
movq (%r12), %rbx
movl %ebp, %r12d
testl %r15d, %r15d
js 0xd6fc4
movl %r15d, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %r13d, %xmm0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x20(%rsp)
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
movl %r15d, 0x14(%rsp)
movsd (%rsp), %xmm1
cmpl %ecx, %r13d
je 0xd6f44
movapd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movl $0x2, %edi
callq 0x21190
movl %ebp, %r15d
testl %ebp, %ebp
jle 0xd6f9c
xorl %ebp, %ebp
movsd (%rbx,%rbp,8), %xmm0
movsd (%r14,%rbp,8), %xmm1
xorps %xmm2, %xmm2
callq 0x21310
movsd (%rbx,%rbp,8), %xmm0
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r14,%rbp,8), %xmm1
mulsd %xmm2, %xmm1
movsd 0x18(%rsp), %xmm2
callq 0x21e60
incq %rbp
cmpq %rbp, %r12
jne 0xd6f5d
callq 0x21c50
movsd 0x18(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
leal 0x1(%r13), %eax
movl 0x14(%rsp), %ecx
cmpl %ecx, %r13d
movl %eax, %r13d
movl %r15d, %ebp
jne 0xd6f36
movl $0x1, %edi
callq 0x21190
testl %ebp, %ebp
jle 0xd7038
xorl %r15d, %r15d
movsd (%rbx,%r15,8), %xmm0
movsd (%r14,%r15,8), %xmm1
xorps %xmm2, %xmm2
callq 0x21310
movsd (%rbx,%r15,8), %xmm0
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r14,%r15,8), %xmm1
mulsd %xmm2, %xmm1
xorpd %xmm2, %xmm2
callq 0x21e60
movsd (%rbx,%r15,8), %xmm0
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r14,%r15,8), %xmm1
mulsd %xmm2, %xmm1
movsd (%rsp), %xmm2
callq 0x21e60
incq %r15
cmpq %r15, %r12
jne 0xd6fd5
callq 0x21c50
movq %r14, %rdi
callq 0x21ad0
movq %rbx, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21ad0