// File: /workspace/github_cpp_makefile_star2_O2/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 0x7bdfb(%rip), %rax     # 0x137890
movq 0x30(%rax), %rbx
testq %rbx, %rbx
jne 0xbbaba
leaq 0x291b9(%rip), %rdi     # 0xe4c5e
leaq 0x29843(%rip), %rsi     # 0xe52ef
leaq 0x29862(%rip), %rdx     # 0xe5315
xorl %eax, %eax
callq 0xbad73
movq 0x150(%rbx), %r15
testq %r15, %r15
je 0xbbeee
movq %rbx, 0x10(%rsp)
movq 0x60(%r15), %rdi
callq 0xbde17
movl $0x40148, %edi          # imm = 0x40148
callq 0x21d70
movl $0xb71, %edi            # imm = 0xB71
callq 0x21210
movl $0xde1, %edi            # imm = 0xDE1
callq 0x21210
movl $0xb50, %edi            # imm = 0xB50
callq 0x21210
movl $0xb44, %edi            # imm = 0xB44
callq 0x21210
movl $0x1701, %edi           # imm = 0x1701
callq 0x21cc0
callq 0x21f70
callq 0x21c50
pushq $0x66
popq %rdi
callq 0xbcc17
cvtsi2sd %eax, %xmm0
movsd %xmm0, (%rsp)
pushq $0x67
popq %rdi
callq 0xbcc17
cvtsi2sd %eax, %xmm2
movsd 0x998d(%rip), %xmm4     # 0xc54d0
movsd 0x94cd(%rip), %xmm5     # 0xc5018
xorpd %xmm0, %xmm0
xorps %xmm3, %xmm3
movsd (%rsp), %xmm1
callq 0x22200
movl $0x1700, %edi           # imm = 0x1700
callq 0x21cc0
callq 0x21f70
callq 0x21c50
movss 0x948c(%rip), %xmm0     # 0xc5004
movaps %xmm0, %xmm1
movaps %xmm0, %xmm2
movaps %xmm0, %xmm3
callq 0x21740
pushq $0x8
popq %r14
movl %r14d, %edi
callq 0x21190
movl 0x44(%r15), %edi
xorl %esi, %esi
callq 0x21bd0
movl 0x44(%r15), %edi
addl $-0x2, %edi
pushq $0x2
popq %rbx
movl %ebx, %esi
callq 0x21bd0
xorl %edi, %edi
xorl %esi, %esi
callq 0x21bd0
movl %ebx, %edi
movl %ebx, %esi
callq 0x21bd0
movl 0x48(%r15), %esi
xorl %edi, %edi
callq 0x21bd0
movl 0x48(%r15), %esi
addl $-0x2, %esi
movl %ebx, %edi
callq 0x21bd0
callq 0x21c60
movss 0xd1c2(%rip), %xmm0     # 0xc8da8
movapd %xmm0, %xmm1
movapd %xmm0, %xmm2
movss 0x940e(%rip), %xmm3     # 0xc5004
callq 0x21740
movl %r14d, %edi
callq 0x21190
movl 0x48(%r15), %esi
xorl %edi, %edi
callq 0x21bd0
movl 0x48(%r15), %esi
addl $-0x2, %esi
movl %ebx, %edi
callq 0x21bd0
movl 0x44(%r15), %edi
movl 0x48(%r15), %esi
callq 0x21bd0
movl 0x44(%r15), %edi
movl 0x48(%r15), %esi
addl $-0x2, %edi
addl $-0x2, %esi
callq 0x21bd0
movl 0x44(%r15), %edi
xorl %esi, %esi
callq 0x21bd0
movl 0x44(%r15), %edi
addl $-0x2, %edi
movl %ebx, %esi
callq 0x21bd0
callq 0x21c60
leaq 0x7765f(%rip), %rdi     # 0x1332c0
callq 0x21340
pushq $0x7
popq %rdi
callq 0x21190
movl %ebx, %edi
movl %ebx, %esi
callq 0x21bd0
movl 0x44(%r15), %edi
addl $-0x2, %edi
movl %ebx, %esi
callq 0x21bd0
movl 0x44(%r15), %edi
movl 0x48(%r15), %esi
addl $-0x2, %edi
addl $-0x2, %esi
callq 0x21bd0
movl 0x48(%r15), %esi
addl $-0x2, %esi
movl %ebx, %edi
callq 0x21bd0
callq 0x21c60
movq %r15, (%rsp)
leaq 0x20(%r15), %rbp
movq %rbp, %r13
movq (%rsp), %r15
movq (%r13), %r13
testq %r13, %r13
je 0xbbd72
cmpb $0x0, 0x28(%r13)
je 0xbbcba
movl 0x14(%r13), %r14d
leaq 0x775f7(%rip), %rdi     # 0x1332d0
callq 0x21340
pushq $0x7
popq %rdi
callq 0x21190
leaq 0x7baeb(%rip), %rdi     # 0x1377d8
callq 0xb8cb3
leal 0x2(%rax), %esi
imull %r14d, %esi
addl $0x2, %esi
pushq $0x2
popq %rdi
callq 0x21bd0
movl 0x44(%r15), %ebx
addl $-0x2, %ebx
leaq 0x7bac6(%rip), %r12     # 0x1377d8
movq %r12, %rdi
callq 0xb8cb3
leal 0x2(%rax), %esi
imull %r14d, %esi
addl $0x2, %esi
movl %ebx, %edi
callq 0x21bd0
movl 0x44(%r15), %ebx
addl $-0x2, %ebx
incl %r14d
movq %r12, %rdi
callq 0xb8cb3
leal 0x2(%rax), %esi
imull %r14d, %esi
addl $0x2, %esi
movl %ebx, %edi
callq 0x21bd0
movq %r12, %rdi
callq 0xb8cb3
leal 0x2(%rax), %esi
imull %r14d, %esi
addl $0x2, %esi
pushq $0x2
popq %rdi
callq 0x21bd0
callq 0x21c60
jmp 0xbbcba
xorl %r13d, %r13d
leaq 0x7ba5c(%rip), %r15     # 0x1377d8
pushq $0x4
popq %r12
leaq 0x77559(%rip), %rdi     # 0x1332e0
callq 0x21340
movl %r13d, %r14d
movq (%rbp), %rbp
testq %rbp, %rbp
je 0xbbeae
cmpb $0x0, 0x28(%rbp)
je 0xbbdae
leaq 0x77547(%rip), %rdi     # 0x1332f0
callq 0x21340
leal 0x1(%r14), %r13d
movq %r15, %rdi
callq 0xb8cb3
leal 0x2(%rax), %ebx
imull %r13d, %ebx
movq %r15, %rdi
callq 0xb8cb3
addl $0x2, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x9738(%rip), %xmm0     # 0xc5510
addsd 0xae10(%rip), %xmm0     # 0xc6bf0
cvttsd2si %xmm0, %eax
subl %eax, %ebx
movl %r12d, %edi
movl %ebx, %esi
callq 0x212c0
movq 0x18(%rbp), %rsi
movq %r15, %rdi
callq 0xb8a7c
cmpq $0x0, 0x20(%rbp)
je 0xbbe9c
movq %r15, %rdi
pushq $0x5f
popq %rsi
callq 0xb8bba
movq %r15, %r12
movq (%rsp), %r15
movl 0x44(%r15), %ebx
subl %eax, %ebx
addl $-0x2, %ebx
movq %r12, %rdi
callq 0xb8cb3
movl %r13d, 0xc(%rsp)
movl %eax, %r13d
addl $0x2, %r13d
imull %r14d, %r13d
pushq $0x4
popq %rdi
callq 0x21190
leal 0x6(%r13), %esi
movl %ebx, %edi
callq 0x21bd0
movl 0x44(%r15), %r14d
movq %r12, %r15
pushq $0x4
popq %r12
addl $-0x2, %r14d
movq %r15, %rdi
callq 0xb8cb3
addl $0x4, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
leal (%rax,%r13), %esi
addl $0x2, %esi
movl %r14d, %edi
callq 0x21bd0
movq %r15, %rdi
callq 0xb8cb3
leal (%rax,%r13), %esi
addl $0x2, %esi
movl 0xc(%rsp), %r13d
movl %ebx, %edi
callq 0x21bd0
callq 0x21c60
cmpb $0x0, 0x28(%rbp)
movl %r13d, %r14d
je 0xbbd8f
jmp 0xbbd80
callq 0x21090
movl $0x1701, %edi           # imm = 0x1701
callq 0x21cc0
callq 0x221e0
movl $0x1700, %edi           # imm = 0x1700
callq 0x21cc0
callq 0x221e0
callq 0xb87de
movq 0x10(%rsp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbde17
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq