// File: /workspace/github_cpp_makefile_star2_O1/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, %ebp
movl %edi, %ebx
movsd %xmm1, (%rsp)
cmpl $0x2, %esi
movl $0x1, %r15d
cmovgel %esi, %r15d
movsd %xmm0, 0x8(%rsp)
leaq 0x6b304(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd8ed7
leaq 0x1269d(%rip), %rdi     # 0xeb566
leaq 0x242f7(%rip), %rsi     # 0xfd1c7
xorl %eax, %eax
callq 0xd1cf7
movl %ebx, %edx
negl %edx
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0xd81be
movl %ebx, %r14d
testl %ebp, %ebp
js 0xd8fb1
movl %ebp, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
movq 0x10(%rsp), %r15
movq 0x18(%rsp), %r12
xorpd %xmm0, %xmm0
xorl %r13d, %r13d
movl %ebp, 0x24(%rsp)
movsd (%rsp), %xmm1
cmpl %ecx, %r13d
je 0xd8f31
movapd %xmm0, %xmm1
movsd %xmm1, 0x28(%rsp)
movl $0x2, %edi
callq 0x21190
movl %ebx, %ebp
testl %ebx, %ebx
jle 0xd8f8a
xorl %ebx, %ebx
movsd (%r15,%rbx,8), %xmm0
movsd (%r12,%rbx,8), %xmm1
xorps %xmm2, %xmm2
callq 0x21310
movsd (%r15,%rbx,8), %xmm0
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r12,%rbx,8), %xmm1
mulsd %xmm2, %xmm1
movsd 0x28(%rsp), %xmm2
callq 0x21e70
incq %rbx
cmpq %rbx, %r14
jne 0xd8f49
callq 0x21c60
movsd 0x28(%rsp), %xmm0
addsd 0x30(%rsp), %xmm0
leal 0x1(%r13), %eax
movl 0x24(%rsp), %ecx
cmpl %ecx, %r13d
movl %eax, %r13d
movl %ebp, %ebx
jne 0xd8f23
movl $0x1, %edi
callq 0x21190
testl %ebx, %ebx
jle 0xd902f
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
xorl %r12d, %r12d
movsd (%rbx,%r12,8), %xmm0
movsd (%r15,%r12,8), %xmm1
xorps %xmm2, %xmm2
callq 0x21310
movsd (%rbx,%r12,8), %xmm0
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r15,%r12,8), %xmm1
mulsd %xmm2, %xmm1
xorpd %xmm2, %xmm2
callq 0x21e70
movsd (%rbx,%r12,8), %xmm0
movsd 0x8(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r15,%r12,8), %xmm1
mulsd %xmm2, %xmm1
movsd (%rsp), %xmm2
callq 0x21e70
incq %r12
cmpq %r12, %r14
jne 0xd8fcc
callq 0x21c60
movq 0x18(%rsp), %rdi
callq 0x21ae0
movq 0x10(%rsp), %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21ae0