// File: /workspace/github_cpp_makefile_star2_O2/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
cmpl $0x2, %esi
pushq $0x1
popq %rax
cmovgel %esi, %eax
cvtsi2sd %eax, %xmm2
movsd %xmm0, 0x18(%rsp)
leaq 0x717d8(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
movsd %xmm1, 0x10(%rsp)
jne 0xc1a3b
leaq 0x1284b(%rip), %rdi     # 0xd4266
leaq 0x24465(%rip), %rsi     # 0xe5e87
xorl %eax, %eax
movsd %xmm2, 0x8(%rsp)
callq 0xbad73
movsd 0x8(%rsp), %xmm2
movsd 0x10(%rsp), %xmm1
divsd %xmm2, %xmm1
movsd %xmm1, 0x20(%rsp)
movl %ebx, %edx
negl %edx
leaq 0x30(%rsp), %r15
leaq 0x28(%rsp), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0xc0eee
movq (%r14), %r14
movq (%r15), %r15
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
xorpd %xmm0, %xmm0
cmpl %ebp, %r13d
jg 0xc1aef
movsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x8(%rsp)
je 0xc1a8a
movsd %xmm0, 0x8(%rsp)
pushq $0x2
popq %rdi
callq 0x21190
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0xc1ad9
movsd (%r14,%r12,8), %xmm0
movsd (%r15,%r12,8), %xmm1
xorpd %xmm2, %xmm2
callq 0x21300
movsd (%r14,%r12,8), %xmm0
movsd 0x18(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r15,%r12,8), %xmm1
mulsd %xmm2, %xmm1
movsd 0x8(%rsp), %xmm2
callq 0x21e80
incq %r12
jmp 0xc1a95
callq 0x21c60
movsd 0x8(%rsp), %xmm0
addsd 0x20(%rsp), %xmm0
incl %r13d
jmp 0xc1a71
pushq $0x1
popq %rdi
callq 0x21190
xorl %r12d, %r12d
cmpq %r12, %rbx
je 0xc1b61
movsd (%r14,%r12,8), %xmm0
movsd (%r15,%r12,8), %xmm1
xorpd %xmm2, %xmm2
callq 0x21300
movsd (%r14,%r12,8), %xmm0
movsd 0x18(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r15,%r12,8), %xmm1
mulsd %xmm2, %xmm1
xorpd %xmm2, %xmm2
callq 0x21e80
movsd (%r14,%r12,8), %xmm0
movsd 0x18(%rsp), %xmm2
mulsd %xmm2, %xmm0
movsd (%r15,%r12,8), %xmm1
mulsd %xmm2, %xmm1
movsd 0x10(%rsp), %xmm2
callq 0x21e80
incq %r12
jmp 0xc1afa
callq 0x21c60
movq %r15, %rdi
callq 0x21ad0
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21ad0