// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fgDisplayMenu
void fgDisplayMenu( void )
{
    SFG_Window* window = fgStructure.CurrentWindow;
    SFG_Menu* menu = NULL;

    FREEGLUT_INTERNAL_ERROR_EXIT ( fgStructure.CurrentWindow, "Displaying menu in nonexistent window",
                                   "fgDisplayMenu" );

    /* Check if there is an active menu attached to this window... */
    menu = window->ActiveMenu;
    freeglut_return_if_fail( menu );

    fgSetWindow( menu->Window );

    glPushAttrib( GL_DEPTH_BUFFER_BIT | GL_TEXTURE_BIT | GL_LIGHTING_BIT |
                  GL_POLYGON_BIT );

    glDisable( GL_DEPTH_TEST );
    glDisable( GL_TEXTURE_2D );
    glDisable( GL_LIGHTING   );
    glDisable( GL_CULL_FACE  );

    glMatrixMode( GL_PROJECTION );
    glPushMatrix( );
    glLoadIdentity( );
    glOrtho(
         0, glutGet( GLUT_WINDOW_WIDTH  ),
         glutGet( GLUT_WINDOW_HEIGHT ), 0,
        -1, 1
    );

    glMatrixMode( GL_MODELVIEW );
    glPushMatrix( );
    glLoadIdentity( );

    fghDisplayMenuBox( menu );

    glPopAttrib( );

    glMatrixMode( GL_PROJECTION );
    glPopMatrix( );
    glMatrixMode( GL_MODELVIEW );
    glPopMatrix( );

    glutSwapBuffers( );

    fgSetWindow ( window );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x75ddf(%rip), %rax     # 0x148870
movq 0x30(%rax), %rbx
testq %rbx, %rbx
jne 0xd2ab6
leaq 0x294bd(%rip), %rdi     # 0xfbf5e
leaq 0x29b7f(%rip), %rsi     # 0xfc627
leaq 0x29b9e(%rip), %rdx     # 0xfc64d
xorl %eax, %eax
callq 0xd1cf7
movq 0x150(%rbx), %r13
testq %r13, %r13
je 0xd2f1c
movq %rbx, 0x10(%rsp)
movq 0x60(%r13), %rdi
callq 0xd5037
movl $0x40148, %edi          # imm = 0x40148
callq 0x21d50
movl $0xb71, %edi            # imm = 0xB71
callq 0x211f0
movl $0xde1, %edi            # imm = 0xDE1
callq 0x211f0
movl $0xb50, %edi            # imm = 0xB50
callq 0x211f0
movl $0xb44, %edi            # imm = 0xB44
callq 0x211f0
movl $0x1701, %edi           # imm = 0x1701
callq 0x21cc0
callq 0x21f60
callq 0x21c50
movl $0x66, %edi
callq 0xd3cc4
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x8(%rsp)
movl $0x67, %edi
callq 0xd3cc4
cvtsi2sd %eax, %xmm2
movsd 0x998c(%rip), %xmm4     # 0xdc4d0
movsd 0x94cc(%rip), %xmm5     # 0xdc018
xorpd %xmm0, %xmm0
xorps %xmm3, %xmm3
movsd 0x8(%rsp), %xmm1
callq 0x221f0
movl $0x1700, %edi           # imm = 0x1700
callq 0x21cc0
callq 0x21f60
callq 0x21c50
movss 0x948a(%rip), %xmm0     # 0xdc004
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm0, %xmm3
callq 0x21740
movl $0x8, %edi
callq 0x21190
movl 0x44(%r13), %edi
xorl %esi, %esi
callq 0x21be0
movl 0x44(%r13), %edi
addl $-0x2, %edi
movl $0x2, %esi
callq 0x21be0
xorl %edi, %edi
xorl %esi, %esi
callq 0x21be0
movl $0x2, %edi
movl $0x2, %esi
callq 0x21be0
movl 0x48(%r13), %esi
xorl %edi, %edi
callq 0x21be0
movl 0x48(%r13), %esi
addl $-0x2, %esi
movl $0x2, %edi
callq 0x21be0
callq 0x21c60
movss 0xd211(%rip), %xmm0     # 0xdfe00
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
movss 0x9405(%rip), %xmm3     # 0xdc004
callq 0x21740
movl $0x8, %edi
callq 0x21190
movl 0x48(%r13), %esi
xorl %edi, %edi
callq 0x21be0
movl 0x48(%r13), %esi
addl $-0x2, %esi
movl $0x2, %edi
callq 0x21be0
movl 0x44(%r13), %edi
movl 0x48(%r13), %esi
callq 0x21be0
movl 0x44(%r13), %edi
movl 0x48(%r13), %esi
addl $-0x2, %edi
addl $-0x2, %esi
callq 0x21be0
movl 0x44(%r13), %edi
xorl %esi, %esi
callq 0x21be0
movl 0x44(%r13), %edi
addl $-0x2, %edi
movl $0x2, %esi
callq 0x21be0
callq 0x21c60
leaq 0x7162e(%rip), %rdi     # 0x1442a0
callq 0x21350
movl $0x7, %edi
callq 0x21190
movl $0x2, %edi
movl $0x2, %esi
callq 0x21be0
movl 0x44(%r13), %edi
addl $-0x2, %edi
movl $0x2, %esi
callq 0x21be0
movl 0x44(%r13), %edi
movl 0x48(%r13), %esi
addl $-0x2, %edi
addl $-0x2, %esi
callq 0x21be0
movl 0x48(%r13), %esi
addl $-0x2, %esi
movl $0x2, %edi
callq 0x21be0
callq 0x21c60
movq 0x20(%r13), %rbx
testq %rbx, %rbx
je 0xd2d91
leaq 0x715d2(%rip), %r14     # 0x1442b0
leaq 0x75ad3(%rip), %r15     # 0x1487b8
cmpb $0x0, 0x28(%rbx)
je 0xd2d85
movl 0x14(%rbx), %r12d
movq %r14, %rdi
callq 0x21350
movl $0x7, %edi
callq 0x21190
movq %r15, %rdi
callq 0xcf8fb
leal 0x2(%rax), %esi
imull %r12d, %esi
addl $0x2, %esi
movl $0x2, %edi
callq 0x21be0
movl 0x44(%r13), %ebp
addl $-0x2, %ebp
movq %r15, %rdi
callq 0xcf8fb
leal 0x2(%rax), %esi
imull %r12d, %esi
addl $0x2, %esi
movl %ebp, %edi
callq 0x21be0
movl 0x44(%r13), %ebp
addl $-0x2, %ebp
incl %r12d
movq %r15, %rdi
callq 0xcf8fb
leal 0x2(%rax), %esi
imull %r12d, %esi
addl $0x2, %esi
movl %ebp, %edi
callq 0x21be0
movq %r15, %rdi
callq 0xcf8fb
leal 0x2(%rax), %esi
imull %r12d, %esi
addl $0x2, %esi
movl $0x2, %edi
callq 0x21be0
callq 0x21c60
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0xd2ce5
leaq 0x71528(%rip), %rdi     # 0x1442c0
callq 0x21350
movq 0x20(%r13), %r15
testq %r15, %r15
je 0xd2edc
xorl %ebx, %ebx
leaq 0x75a05(%rip), %r14     # 0x1487b8
cmpb $0x0, 0x28(%r15)
je 0xd2dc6
leaq 0x7150f(%rip), %rdi     # 0x1442d0
callq 0x21350
leal 0x1(%rbx), %r12d
movq %r14, %rdi
callq 0xcf8fb
leal 0x2(%rax), %ebp
imull %r12d, %ebp
movq %r14, %rdi
callq 0xcf8fb
addl $0x2, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x9725(%rip), %xmm0     # 0xdc518
addsd 0xae25(%rip), %xmm0     # 0xddc20
cvttsd2si %xmm0, %eax
subl %eax, %ebp
movl $0x4, %edi
movl %ebp, %esi
callq 0x212d0
movq 0x18(%r15), %rsi
movq %r14, %rdi
callq 0xcf6c1
cmpq $0x0, 0x20(%r15)
je 0xd2eba
movq %r14, %rdi
movl $0x5f, %esi
callq 0xcf80b
movl 0x44(%r13), %ebp
subl %eax, %ebp
addl $-0x2, %ebp
movq %r14, %rdi
callq 0xcf8fb
movl %r12d, 0x8(%rsp)
movq %r13, %r12
movl %eax, %r13d
addl $0x2, %r13d
imull %ebx, %r13d
movl $0x4, %edi
callq 0x21190
leal 0x6(%r13), %esi
movl %ebp, %edi
callq 0x21be0
movl 0x44(%r12), %ebx
addl $-0x2, %ebx
movq %r14, %rdi
callq 0xcf8fb
movl %eax, %ecx
addl $0x4, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
addl $0x4, %eax
sarl %eax
leal (%rax,%r13), %esi
addl $0x2, %esi
movl %ebx, %edi
callq 0x21be0
movq %r14, %rdi
callq 0xcf8fb
leal (%rax,%r13), %esi
addl $0x2, %esi
movq %r12, %r13
movl 0x8(%rsp), %r12d
movl %ebp, %edi
callq 0x21be0
callq 0x21c60
cmpb $0x0, 0x28(%r15)
je 0xd2ecd
leaq 0x713f8(%rip), %rdi     # 0x1442c0
callq 0x21350
movq (%r15), %r15
movl %r12d, %ebx
testq %r15, %r15
jne 0xd2db3
callq 0x21090
movl $0x1701, %edi           # imm = 0x1701
callq 0x21cc0
callq 0x221d0
movl $0x1700, %edi           # imm = 0x1700
callq 0x21cc0
callq 0x221d0
callq 0xcf464
movq 0x10(%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd5037
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq