LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fghDeactivateSubMenu
static void fghDeactivateSubMenu( SFG_MenuEntry *menuEntry )
{
    SFG_MenuEntry *subMenuIter;
    /* Hide the present menu's window */
    fgSetWindow( menuEntry->SubMenu->Window );
    glutHideWindow( );

    /* Forget about having that menu active anymore, now: */
    menuEntry->SubMenu->Window->ActiveMenu = NULL;
    menuEntry->SubMenu->IsActive = GL_FALSE;
    menuEntry->SubMenu->ActiveEntry = NULL;

    /* Hide all submenu windows, and the root menu's window. */
    for ( subMenuIter = (SFG_MenuEntry *)menuEntry->SubMenu->Entries.First;
          subMenuIter;
          subMenuIter = (SFG_MenuEntry *)subMenuIter->Node.Next )
    {
        subMenuIter->IsActive = GL_FALSE;

        /* Is that an active submenu by any case? */
        if( subMenuIter->SubMenu )
            fghDeactivateSubMenu( subMenuIter );
    }

    fgSetWindow ( menuEntry->SubMenu->ParentWindow ) ;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rax
movq 0x60(%rax), %rdi
callq 0xbde17
callq 0xbe678
movq 0x20(%rbx), %r14
movq 0x60(%r14), %rax
andq $0x0, 0x150(%rax)
movb $0x0, 0x40(%r14)
andq $0x0, 0x58(%r14)
addq $0x20, %r14
movq (%r14), %r14
testq %r14, %r14
je 0xbc521
movb $0x0, 0x28(%r14)
cmpq $0x0, 0x20(%r14)
je 0xbc503
movq %r14, %rdi
callq 0xbc4cc
jmp 0xbc503
movq 0x20(%rbx), %rax
movq 0x68(%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xbde17
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fghCalculateMenuBoxSize
void fghCalculateMenuBoxSize( void )
{
    SFG_MenuEntry* menuEntry;
    int width = 0, height = 0;

    /* Make sure there is a current menu set */
    freeglut_return_if_fail( fgStructure.CurrentMenu );

    /* The menu's box size depends on the menu entries: */
    for( menuEntry = ( SFG_MenuEntry * )fgStructure.CurrentMenu->Entries.First;
         menuEntry;
         menuEntry = ( SFG_MenuEntry * )menuEntry->Node.Next )
    {
        /* Update the menu entry's width value */
        menuEntry->Width = glutBitmapLength(
            FREEGLUT_MENU_FONT,
            (unsigned char *)menuEntry->Text
        );

        /*
         * If the entry is a submenu, then it needs to be wider to
         * accomodate the arrow. JCJ 31 July 2003
         */
        if (menuEntry->SubMenu )
            menuEntry->Width += glutBitmapLength(
                FREEGLUT_MENU_FONT,
                (unsigned char *)"_"
            );

        /* Check if it's the biggest we've found */
        if( menuEntry->Width > width )
            width = menuEntry->Width;

        height += FREEGLUT_MENU_HEIGHT;
    }

    /* Store the menu's box size now: */
    fgStructure.CurrentMenu->Height = height + 2 * FREEGLUT_MENU_BORDER;
    fgStructure.CurrentMenu->Width  = width  + 4 * FREEGLUT_MENU_BORDER;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x7b349(%rip), %r15     # 0x137890
movq 0x38(%r15), %r12
testq %r12, %r12
je 0xbc5c7
addq $0x20, %r12
xorl %ebp, %ebp
leaq 0x7b27b(%rip), %rbx     # 0x1377d8
leaq 0x28dbf(%rip), %r14     # 0xe5323
xorl %r13d, %r13d
movq (%r12), %r12
testq %r12, %r12
je 0xbc5b5
movq 0x18(%r12), %rsi
movq %rbx, %rdi
callq 0xb8c21
movl %eax, 0x2c(%r12)
cmpq $0x0, 0x20(%r12)
je 0xbc59f
movq %rbx, %rdi
movq %r14, %rsi
callq 0xb8c21
addl 0x2c(%r12), %eax
movl %eax, 0x2c(%r12)
cmpl %ebp, %eax
cmovgl %eax, %ebp
movq %rbx, %rdi
callq 0xb8cb3
addl %eax, %r13d
addl $0x2, %r13d
jmp 0xbc567
addl $0x4, %r13d
movq 0x38(%r15), %rax
movl %r13d, 0x48(%rax)
addl $0x8, %ebp
movl %ebp, 0x44(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutDestroyMenu
void FGAPIENTRY glutDestroyMenu( int menuID )
{
    SFG_Menu* menu;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutDestroyMenu" );
    menu = fgMenuByID( menuID );

    freeglut_return_if_fail( menu );

    /* The menu object destruction code resides in freeglut_structure.c */
    fgDestroyMenu( menu );
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x76bcd(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc62e
leaq 0x17c46(%rip), %rdi     # 0xd4266
leaq 0x28d0d(%rip), %rsi     # 0xe5334
xorl %eax, %eax
callq 0xbad73
movl %ebx, %edi
callq 0xbdb56
testq %rax, %rax
je 0xbc643
movq %rax, %rdi
popq %rbx
jmp 0xbd806
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutSetMenu
void FGAPIENTRY glutSetMenu( int menuID )
{
    SFG_Menu* menu;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetMenu" );
    menu = fgMenuByID( menuID );

    freeglut_return_if_fail( menu );

    fgStructure.CurrentMenu = menu;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x76b55(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc6a6
leaq 0x17bce(%rip), %rdi     # 0xd4266
leaq 0x28cb1(%rip), %rsi     # 0xe5350
xorl %eax, %eax
callq 0xbad73
movl %ebx, %edi
callq 0xbdb56
testq %rax, %rax
je 0xbc6bd
leaq 0x7b1d7(%rip), %rcx     # 0x137890
movq %rax, 0x38(%rcx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutAddMenuEntry
void FGAPIENTRY glutAddMenuEntry( const char* label, int value )
{
    SFG_MenuEntry* menuEntry;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutAddMenuEntry" );
    menuEntry = (SFG_MenuEntry *)calloc( sizeof(SFG_MenuEntry), 1 );
    freeglut_return_if_fail( fgStructure.CurrentMenu );

    menuEntry->Text = strdup( label );
    menuEntry->ID   = value;

    /* Have the new menu entry attached to the current menu */
    fgListAppend( &fgStructure.CurrentMenu->Entries, &menuEntry->Node );

    fghCalculateMenuBoxSize( );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x76b0d(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc6ee
leaq 0x17b86(%rip), %rdi     # 0xd4266
leaq 0x28c75(%rip), %rsi     # 0xe535c
xorl %eax, %eax
callq 0xbad73
pushq $0x30
popq %rdi
pushq $0x1
popq %rsi
callq 0x21600
movq %rax, %r15
leaq 0x7b18d(%rip), %rax     # 0x137890
movq 0x38(%rax), %r12
testq %r12, %r12
je 0xbc73b
movq %r14, %rdi
callq 0x22180
movq %rax, 0x18(%r15)
movl %ebx, 0x10(%r15)
addq $0x20, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xbd582
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xbc535
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutAddSubMenu
void FGAPIENTRY glutAddSubMenu( const char *label, int subMenuID )
{
    SFG_MenuEntry *menuEntry;
    SFG_Menu *subMenu;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutAddSubMenu" );
    menuEntry = ( SFG_MenuEntry * )calloc( sizeof( SFG_MenuEntry ), 1 );
    subMenu = fgMenuByID( subMenuID );

    freeglut_return_if_fail( fgStructure.CurrentMenu );
    freeglut_return_if_fail( subMenu );

    menuEntry->Text    = strdup( label );
    menuEntry->SubMenu = subMenu;
    menuEntry->ID      = -1;

    fgListAppend( &fgStructure.CurrentMenu->Entries, &menuEntry->Node );
    fghCalculateMenuBoxSize( );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x76a85(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc776
leaq 0x17afe(%rip), %rdi     # 0xd4266
leaq 0x28bfe(%rip), %rsi     # 0xe536d
xorl %eax, %eax
callq 0xbad73
pushq $0x30
popq %rdi
pushq $0x1
popq %rsi
callq 0x21600
movq %rax, %r14
movl %ebp, %edi
callq 0xbdb56
movq %rax, %r12
leaq 0x7b0fb(%rip), %rax     # 0x137890
movq 0x38(%rax), %r15
testq %r15, %r15
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
je 0xbc7b2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x22180
movq %rax, 0x18(%r14)
movq %r12, 0x20(%r14)
orl $-0x1, 0x10(%r14)
addq $0x20, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xbd582
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xbc535
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutChangeToMenuEntry
void FGAPIENTRY glutChangeToMenuEntry( int item, const char* label, int value )
{
    SFG_MenuEntry* menuEntry = NULL;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutChangeToMenuEntry" );
    freeglut_return_if_fail( fgStructure.CurrentMenu );

    /* Get n-th menu entry in the current menu, starting from one: */
    menuEntry = fghFindMenuEntry( fgStructure.CurrentMenu, item );

    freeglut_return_if_fail( menuEntry );

    /* We want it to become a normal menu entry, so: */
    if( menuEntry->Text )
        free( menuEntry->Text );

    menuEntry->Text    = strdup( label );
    menuEntry->ID      = value;
    menuEntry->SubMenu = NULL;
    fghCalculateMenuBoxSize( );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x769e8(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc813
leaq 0x17a61(%rip), %rdi     # 0xd4266
leaq 0x28b70(%rip), %rsi     # 0xe537c
xorl %eax, %eax
callq 0xbad73
leaq 0x7b076(%rip), %rax     # 0x137890
movq 0x38(%rax), %rdi
testq %rdi, %rdi
je 0xbc85f
movl %ebp, %esi
callq 0xbc86a
testq %rax, %rax
je 0xbc85f
movq %rax, %r15
movq 0x18(%rax), %rdi
callq 0x21ad0
movq %r14, %rdi
callq 0x22180
movq %rax, 0x18(%r15)
movl %ebx, 0x10(%r15)
andq $0x0, 0x20(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbc535
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutChangeToSubMenu
void FGAPIENTRY glutChangeToSubMenu( int item, const char* label,
                                     int subMenuID )
{
    SFG_Menu*      subMenu;
    SFG_MenuEntry* menuEntry;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutChangeToSubMenu" );
    subMenu = fgMenuByID( subMenuID );
    menuEntry = NULL;

    freeglut_return_if_fail( fgStructure.CurrentMenu );
    freeglut_return_if_fail( subMenu );

    /* Get n-th menu entry in the current menu, starting from one: */
    menuEntry = fghFindMenuEntry( fgStructure.CurrentMenu, item );

    freeglut_return_if_fail( menuEntry );

    /* We want it to become a sub menu entry, so: */
    if( menuEntry->Text )
        free( menuEntry->Text );

    menuEntry->Text    = strdup( label );
    menuEntry->SubMenu = subMenu;
    menuEntry->ID      = -1;
    fghCalculateMenuBoxSize( );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x76944(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc8b7
leaq 0x179bd(%rip), %rdi     # 0xd4266
leaq 0x28ae2(%rip), %rsi     # 0xe5392
xorl %eax, %eax
callq 0xbad73
movl %r14d, %edi
callq 0xbdb56
movq %rax, %r14
leaq 0x7afc7(%rip), %rax     # 0x137890
movq 0x38(%rax), %rdi
testq %rdi, %rdi
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0xbc919
movl %ebp, %esi
callq 0xbc86a
testq %rax, %rax
je 0xbc919
movq %rax, %r15
movq 0x18(%rax), %rdi
callq 0x21ad0
movq %rbx, %rdi
callq 0x22180
movq %rax, 0x18(%r15)
movq %r14, 0x20(%r15)
orl $-0x1, 0x10(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xbc535
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutRemoveMenuItem
void FGAPIENTRY glutRemoveMenuItem( int item )
{
    SFG_MenuEntry* menuEntry;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutRemoveMenuItem" );
    freeglut_return_if_fail( fgStructure.CurrentMenu );

    /* Get n-th menu entry in the current menu, starting from one: */
    menuEntry = fghFindMenuEntry( fgStructure.CurrentMenu, item );

    freeglut_return_if_fail( menuEntry );

    fgListRemove( &fgStructure.CurrentMenu->Entries, &menuEntry->Node );
    if ( menuEntry->Text )
      free( menuEntry->Text );

    free( menuEntry );
    fghCalculateMenuBoxSize( );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x768af(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc94c
leaq 0x17928(%rip), %rdi     # 0xd4266
leaq 0x28a61(%rip), %rsi     # 0xe53a6
xorl %eax, %eax
callq 0xbad73
leaq 0x7af3d(%rip), %rax     # 0x137890
movq 0x38(%rax), %r14
testq %r14, %r14
je 0xbc99a
movq %r14, %rdi
movl %ebx, %esi
callq 0xbc86a
testq %rax, %rax
je 0xbc99a
movq %rax, %rbx
addq $0x20, %r14
movq %r14, %rdi
movq %rax, %rsi
callq 0xbd7d7
movq 0x18(%rbx), %rdi
callq 0x21ad0
movq %rbx, %rdi
callq 0x21ad0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xbc535
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutAttachMenu
void FGAPIENTRY glutAttachMenu( int button )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutAttachMenu" );

    freeglut_return_if_fail( fgStructure.CurrentWindow );
    freeglut_return_if_fail( fgStructure.CurrentMenu );

    freeglut_return_if_fail( button >= 0 );
    freeglut_return_if_fail( button < FREEGLUT_MAX_MENUS );

    fgStructure.CurrentWindow->Menu[ button ] = fgStructure.CurrentMenu;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x76834(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbc9c7
leaq 0x178ad(%rip), %rdi     # 0xd4266
leaq 0x289f9(%rip), %rsi     # 0xe53b9
xorl %eax, %eax
callq 0xbad73
cmpl $0x2, %ebx
ja 0xbc9ef
leaq 0x7aebd(%rip), %rcx     # 0x137890
movq 0x30(%rcx), %rax
testq %rax, %rax
je 0xbc9ef
movq 0x38(%rcx), %rcx
testq %rcx, %rcx
je 0xbc9ef
movl %ebx, %edx
movq %rcx, 0x138(%rax,%rdx,8)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: glutDetachMenu
void FGAPIENTRY glutDetachMenu( int button )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutDetachMenu" );

    freeglut_return_if_fail( fgStructure.CurrentWindow );
    freeglut_return_if_fail( fgStructure.CurrentMenu );

    freeglut_return_if_fail( button >= 0 );
    freeglut_return_if_fail( button < FREEGLUT_MAX_MENUS );

    fgStructure.CurrentWindow->Menu[ button ] = NULL;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x767e5(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbca16
leaq 0x1785e(%rip), %rdi     # 0xd4266
leaq 0x289b9(%rip), %rsi     # 0xe53c8
xorl %eax, %eax
callq 0xbad73
cmpl $0x2, %ebx
ja 0xbca3d
leaq 0x7ae6e(%rip), %rcx     # 0x137890
movq 0x30(%rcx), %rax
testq %rax, %rax
je 0xbca3d
cmpq $0x0, 0x38(%rcx)
je 0xbca3d
movl %ebx, %ecx
andq $0x0, 0x138(%rax,%rcx,8)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fghGetVMaxExtent
static GLvoid fghGetVMaxExtent( SFG_Window* window, int* x, int* y )
{
    if( fgStructure.GameModeWindow )
    {
#if TARGET_HOST_POSIX_X11
        int wx, wy;
        Window w;

        XTranslateCoordinates(
            fgDisplay.Display,
            window->Window.Handle,
            fgDisplay.RootWindow,
            0, 0, &wx, &wy, &w);

        *x = fgState.GameModeSize.X + wx;
        *y = fgState.GameModeSize.Y + wy;
#else
        *x = glutGet ( GLUT_SCREEN_WIDTH );
        *y = glutGet ( GLUT_SCREEN_HEIGHT );
#endif
    }
    else
    {
        *x = fgDisplay.ScreenWidth;
        *y = fgDisplay.ScreenHeight;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
leaq 0x7adce(%rip), %rax     # 0x137890
cmpq $0x0, 0x48(%rax)
je 0xbcb1b
leaq 0x7ad20(%rip), %rax     # 0x1377f0
movq 0x18(%rdi), %rsi
movq (%rax), %rdi
movq 0x10(%rax), %rdx
leaq 0x10(%rsp), %rax
leaq 0x8(%rsp), %r12
leaq 0xc(%rsp), %r15
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %r15, %r9
pushq %rax
pushq %r12
callq 0x21fe0
popq %rcx
popq %rdx
leaq 0x766dd(%rip), %rcx     # 0x1331e0
movl (%r15), %eax
addl 0x88(%rcx), %eax
movl %eax, (%r14)
movl (%r12), %eax
addl 0x8c(%rcx), %eax
jmp 0xbcb2b
leaq 0x7acce(%rip), %rax     # 0x1377f0
movl 0x38(%rax), %ecx
movl %ecx, (%r14)
movl 0x3c(%rax), %eax
movl %eax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_state.c
// Function: glutSetOption
void FGAPIENTRY glutSetOption( GLenum eWhat, int value )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetOption" );

    /*
     * XXX In chronological code add order.  (WHY in that order?)
     */
    switch( eWhat )
    {
    case GLUT_INIT_WINDOW_X:
        fgState.Position.X = (GLint)value;
        break;

    case GLUT_INIT_WINDOW_Y:
        fgState.Position.Y = (GLint)value;
        break;

    case GLUT_INIT_WINDOW_WIDTH:
        fgState.Size.X = (GLint)value;
        break;

    case GLUT_INIT_WINDOW_HEIGHT:
        fgState.Size.Y = (GLint)value;
        break;

    case GLUT_INIT_DISPLAY_MODE:
        fgState.DisplayMode = (unsigned int)value;
        break;

    case GLUT_ACTION_ON_WINDOW_CLOSE:
        fgState.ActionOnWindowClose = value;
        break;

    case GLUT_RENDERING_CONTEXT:
        fgState.UseCurrentContext =
            ( value == GLUT_USE_CURRENT_CONTEXT ) ? GL_TRUE : GL_FALSE;
        break;

    case GLUT_DIRECT_RENDERING:
        fgState.DirectContext = value;
        break;

    case GLUT_WINDOW_CURSOR:
        if( fgStructure.CurrentWindow != NULL )
            fgStructure.CurrentWindow->State.Cursor = value;
        break;

    case GLUT_AUX:
      fgState.AuxiliaryBufferNumber = value;
      break;

    case GLUT_MULTISAMPLE:
      fgState.SampleNumber = value;
      break;

    default:
        fgWarning( "glutSetOption(): missing enum handle %d", eWhat );
        break;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movl %edi, %r14d
leaq 0x76693(%rip), %r15     # 0x1331e0
cmpb $0x0, 0x1c(%r15)
jne 0xbcb69
leaq 0x1770b(%rip), %rdi     # 0xd4266
leaq 0x28a1e(%rip), %rsi     # 0xe5580
xorl %eax, %eax
callq 0xbad73
leal -0x1f4(%r14), %eax
cmpl $0xa, %eax
ja 0xbcb8d
leaq 0x288a8(%rip), %rcx     # 0xe5424
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %ebx, (%r15)
jmp 0xbcc11
cmpl $0x7a, %r14d
je 0xbcbf5
cmpl $0x80, %r14d
je 0xbcc0a
cmpl $0x1000, %r14d          # imm = 0x1000
jne 0xbcbae
movl %ebx, 0xb4(%r15)
jmp 0xbcc11
leaq 0x289d9(%rip), %rdi     # 0xe558e
movl %r14d, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0xbae63
movl %ebx, 0x18(%r15)
jmp 0xbcc11
movl %ebx, 0x4(%r15)
jmp 0xbcc11
movl %ebx, 0x20(%r15)
jmp 0xbcc11
movl %ebx, 0x9c(%r15)
jmp 0xbcc11
movl %ebx, 0xc(%r15)
jmp 0xbcc11
movl %ebx, 0x10(%r15)
jmp 0xbcc11
cmpl $0x1, %ebx
sete 0x25(%r15)
jmp 0xbcc11
leaq 0x7ac94(%rip), %rax     # 0x137890
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xbcc11
movl %ebx, 0x4c(%rax)
jmp 0xbcc11
movl %ebx, 0xb8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_state.c
// Function: fghGetConfig
static int fghGetConfig( int attribute )
{
  int returnValue = 0;

  if( fgStructure.CurrentWindow )
      glXGetFBConfigAttrib( fgDisplay.Display,
                                     *(fgStructure.CurrentWindow->Window.FBConfig),
                                     attribute,
                                     &returnValue );

  return returnValue;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
andl $0x0, 0xc(%rsp)
leaq 0x7a7c7(%rip), %rax     # 0x137890
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xbd0f6
movl %edi, %edx
leaq 0x7a715(%rip), %rcx     # 0x1377f0
movq (%rcx), %rdi
movq 0x28(%rax), %rax
movq (%rax), %rsi
leaq 0xc(%rsp), %rbx
movq %rbx, %rcx
callq 0x21290
movl (%rbx), %eax
jmp 0xbd0f8
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgCreateWindow
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
                            GLboolean positionUse, int x, int y,
                            GLboolean sizeUse, int w, int h,
                            GLboolean gameMode, GLboolean isMenu )
{
    /* Have the window object created */
    SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );

#if TARGET_HOST_UNIX_X11
    window->Window.FBConfig = NULL;
#endif
    fghClearCallBacks( window );

    /* Initialize the object properties */
    window->ID = ++fgStructure.WindowID;
    window->State.OldHeight = window->State.OldWidth = -1;

    fgListInit( &window->Children );
    if( parent )
    {
        fgListAppend( &parent->Children, &window->Node );
        window->Parent = parent;
    }
    else
        fgListAppend( &fgStructure.Windows, &window->Node );

    /* Set the default mouse cursor and reset the modifiers value */
    window->State.Cursor    = GLUT_CURSOR_INHERIT;

    window->IsMenu = isMenu;

    window->State.IgnoreKeyRepeat = GL_FALSE;
    window->State.KeyRepeating    = GL_FALSE;
    window->State.IsFullscreen    = GL_FALSE;

    /*
     * Open the window now. The fgOpenWindow() function is system
     * dependant, and resides in freeglut_window.c. Uses fgState.
     */
    fgOpenWindow( window, title, positionUse, x, y, sizeUse, w, h, gameMode,
                  (GLboolean)(parent ? GL_TRUE : GL_FALSE) );

    return window;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %r15d
movl %r8d, 0x4(%rsp)
movl %ecx, %ebp
movl %edx, %r13d
movq %rsi, %r12
movq %rdi, %rbx
pushq $0x1
popq %rsi
movl $0x178, %edi            # imm = 0x178
callq 0x21600
movq %rax, %r14
movq %rax, %rdi
callq 0xbd562
movl 0x7a458(%rip), %eax     # 0x1378e0
incl %eax
movl %eax, 0x10(%r14)
orq $-0x1, 0x40(%r14)
movl %eax, 0x7a447(%rip)     # 0x1378e0
xorps %xmm0, %xmm0
movups %xmm0, 0x160(%r14)
testq %rbx, %rbx
je 0xbd4d1
leaq 0x160(%rbx), %rcx
movq 0x168(%rbx), %rax
testq %rax, %rax
cmovneq %rax, %rcx
movq %r14, (%rcx)
movq %r14, 0x168(%rbx)
movq %rbx, 0x158(%r14)
jmp 0xbd4f0
movq 0x7a3c0(%rip), %rax     # 0x137898
leaq 0x7a3b1(%rip), %rcx     # 0x137890
testq %rax, %rax
cmovneq %rax, %rcx
movq %r14, (%rcx)
movq %r14, 0x7a3a8(%rip)     # 0x137898
xorl %r10d, %r10d
testq %rbx, %rbx
setne %r10b
movq %rax, 0x8(%r14)
andq $0x0, (%r14)
movl $0x64, 0x4c(%r14)
movb 0x58(%rsp), %al
movb %al, 0x170(%r14)
andw $0x0, 0x68(%r14)
movb $0x0, 0x6b(%r14)
movzbl 0x50(%rsp), %eax
movzbl %r13b, %edx
movzbl %r15b, %r9d
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %ecx
movl 0x4(%rsp), %r8d
pushq %r10
pushq %rax
movl 0x58(%rsp), %eax
pushq %rax
movl 0x58(%rsp), %eax
pushq %rax
callq 0xbde4f
addq $0x20, %rsp
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fghClearCallBacks
static void fghClearCallBacks( SFG_Window *window )
{
    if( window )
    {
        int i;
        for( i = 0; i < TOTAL_CALLBACKS; ++i )
            window->CallBacks[ i ] = NULL;
    }
}

// Assembly:
testq %rdi, %rdi
je 0xbd57a
xorl %eax, %eax
cmpq $0x18, %rax
je 0xbd57a
andq $0x0, 0x70(%rdi,%rax,8)
incq %rax
jmp 0xbd569
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgCreateMenu
SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
{
    int x = 100, y = 100, w = 100, h = 100;
    SFG_Window *current_window = fgStructure.CurrentWindow;

    /* Have the menu object created */
    SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );

    menu->ParentWindow = NULL;

    /* Create a window for the menu to reside in. */

    fgCreateWindow( NULL, "freeglut menu", GL_TRUE, x, y, GL_TRUE, w, h,
                    GL_FALSE, GL_TRUE );
    menu->Window = fgStructure.CurrentWindow;
    glutDisplayFunc( fgDisplayMenu );

    glutHideWindow( );  /* Hide the window for now */
    fgSetWindow( current_window );

    /* Initialize the object properties: */
    menu->ID       = ++fgStructure.MenuID;
    menu->Callback = menuCallback;
    menu->ActiveEntry = NULL;

    fgListInit( &menu->Entries );
    fgListAppend( &fgStructure.Menus, &menu->Node );

    /* Newly created menus implicitly become current ones */
    fgStructure.CurrentMenu = menu;

    return menu;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
movq 0x7a30d(%rip), %r15     # 0x1378c0
pushq $0x70
popq %rdi
pushq $0x1
popq %rsi
callq 0x21600
movq %rax, %rbx
pushq $0x64
popq %rcx
movl %ecx, 0x8(%rsp)
movl %ecx, (%rsp)
movl $0x1, 0x18(%rsp)
andl $0x0, 0x10(%rsp)
leaq 0x280c2(%rip), %rsi     # 0xe56a1
pushq $0x1
popq %rdx
xorl %edi, %edi
movl %ecx, %r8d
movl %edx, %r9d
callq 0xbd44c
movq 0x7a2ca(%rip), %rax     # 0x1378c0
movq %rax, 0x60(%rbx)
leaq -0x1b81(%rip), %rdi     # 0xbba80
callq 0xb7e8c
callq 0xbe678
movq %r15, %rdi
callq 0xbde17
movl 0x7a2cb(%rip), %eax     # 0x1378e4
incl %eax
movl %eax, 0x7a2c3(%rip)     # 0x1378e4
movl %eax, 0x18(%rbx)
movq %r14, 0x30(%rbx)
movq 0x7a279(%rip), %rax     # 0x1378a8
testq %rax, %rax
leaq 0x7a267(%rip), %rcx     # 0x1378a0
cmovneq %rax, %rcx
movq %rbx, (%rcx)
movq %rax, 0x8(%rbx)
movq %rbx, 0x7a25d(%rip)     # 0x1378a8
movq %rbx, 0x7a276(%rip)     # 0x1378c8
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgAddToWindowDestroyList
void fgAddToWindowDestroyList( SFG_Window* window )
{
    SFG_WindowList *new_list_entry =
        ( SFG_WindowList* )malloc( sizeof(SFG_WindowList ) );
    new_list_entry->window = window;
    fgListAppend( &fgStructure.WindowsToDestroy, &new_list_entry->node );

    /* Check if the window is the current one... */
    if( fgStructure.CurrentWindow == window )
        fgStructure.CurrentWindow = NULL;

    /*
     * Clear all window callbacks except Destroy, which will
     * be invoked later.  Right now, we are potentially carrying
     * out a freeglut operation at the behest of a client callback,
     * so we are reluctant to re-enter the client with the Destroy
     * callback, right now.  The others are all wiped out, however,
     * to ensure that they are no longer called after this point.
     */
    {
        FGCBDestroy destroy = (FGCBDestroy)FETCH_WCB( *window, Destroy );
        fghClearCallBacks( window );
        SET_WCB( *window, Destroy, destroy );
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x21c70
movq %rbx, 0x10(%rax)
movq 0x7a23f(%rip), %rcx     # 0x1378b8
testq %rcx, %rcx
leaq 0x7a22d(%rip), %rdx     # 0x1378b0
cmovneq %rcx, %rdx
movq %rax, (%rdx)
movq %rcx, 0x8(%rax)
andq $0x0, (%rax)
movq %rax, 0x7a21f(%rip)     # 0x1378b8
cmpq %rbx, 0x7a220(%rip)     # 0x1378c0
jne 0xbd6aa
andq $0x0, 0x7a216(%rip)     # 0x1378c0
movq 0xe0(%rbx), %r14
movq %rbx, %rdi
callq 0xbd562
cmpq %r14, 0xe0(%rbx)
je 0xbd6c9
movq %r14, 0xe0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgCloseWindows
void fgCloseWindows( )
{
    while( fgStructure.WindowsToDestroy.First )
    {
        SFG_WindowList *window_ptr = fgStructure.WindowsToDestroy.First;
        fgDestroyWindow( window_ptr->window );
        fgListRemove( &fgStructure.WindowsToDestroy, &window_ptr->node );
        free( window_ptr );
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x7a1d4(%rip), %rbx     # 0x1378b0
movq 0x7a1cd(%rip), %r14     # 0x1378b0
testq %r14, %r14
je 0xbd706
movq 0x10(%r14), %rdi
callq 0xbd70e
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbd7d7
movq %r14, %rdi
callq 0x21ad0
jmp 0xbd6dc
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgDestroyWindow
void fgDestroyWindow( SFG_Window* window )
{
    FREEGLUT_INTERNAL_ERROR_EXIT ( window, "Window destroy function called with null window",
                                   "fgDestroyWindow" );

    while( window->Children.First )
        fgDestroyWindow( ( SFG_Window * )window->Children.First );

    {
        SFG_Window *activeWindow = fgStructure.CurrentWindow;
        INVOKE_WCB( *window, Destroy, ( ) );
        fgSetWindow( activeWindow );
    }

    if( window->Parent )
        fgListRemove( &window->Parent->Children, &window->Node );
    else
        fgListRemove( &fgStructure.Windows, &window->Node );

    if( window->ActiveMenu )
      fgDeactivateMenu( window );

    fghClearCallBacks( window );
    fgCloseWindow( window );
    free( window );
    if( fgStructure.CurrentWindow == window )
        fgStructure.CurrentWindow = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rdi, %rdi
jne 0xbd73d
leaq 0x2753d(%rip), %rdi     # 0xe4c5e
leaq 0x27f87(%rip), %rsi     # 0xe56af
leaq 0x27fb0(%rip), %rdx     # 0xe56df
xorl %eax, %eax
callq 0xbad73
jmp 0xbd73d
callq 0xbd70e
movq 0x160(%rbx), %rdi
testq %rdi, %rdi
jne 0xbd738
movq 0x7a170(%rip), %r14     # 0x1378c0
cmpq $0x0, 0xe0(%rbx)
je 0xbd768
movq %rbx, %rdi
callq 0xbde17
callq *0xe0(%rbx)
movq %r14, %rdi
callq 0xbde17
movq 0x158(%rbx), %rax
leaq 0x160(%rax), %rcx
testq %rax, %rax
leaq 0x7a108(%rip), %rdi     # 0x137890
cmovneq %rcx, %rdi
movq %rbx, %rsi
callq 0xbd7d7
cmpq $0x0, 0x150(%rbx)
je 0xbd7a6
movq %rbx, %rdi
callq 0xbc408
movq %rbx, %rdi
callq 0xbd562
movq %rbx, %rdi
callq 0xbe38b
movq %rbx, %rdi
callq 0x21ad0
cmpq %rbx, 0x7a0fb(%rip)     # 0x1378c0
jne 0xbd7cf
andq $0x0, 0x7a0f1(%rip)     # 0x1378c0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgListRemove
void fgListRemove(SFG_List *list, SFG_Node *node)
{
    if( node->Next )
        ( ( SFG_Node * )node->Next )->Prev = node->Prev;
    if( node->Prev )
        ( ( SFG_Node * )node->Prev )->Next = node->Next;
    if( ( ( SFG_Node * )list->First ) == node )
        list->First = node->Next;
    if( ( ( SFG_Node * )list->Last ) == node )
        list->Last = node->Prev;
}

// Assembly:
movq (%rsi), %rcx
movq 0x8(%rsi), %rax
testq %rcx, %rcx
je 0xbd7e7
movq %rax, 0x8(%rcx)
testq %rax, %rax
je 0xbd7ef
movq %rcx, (%rax)
cmpq %rsi, (%rdi)
jne 0xbd7fa
movq (%rsi), %rcx
movq %rcx, (%rdi)
cmpq %rsi, 0x8(%rdi)
je 0xbd801
retq
movq %rax, 0x8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fghRemoveMenuFromWindow
static void fghRemoveMenuFromWindow( SFG_Window* window, SFG_Menu* menu )
{
    SFG_Window *subWindow;
    int i;

    /* Check whether this is the active menu in the window */
    if ( menu == window->ActiveMenu )
        window->ActiveMenu = NULL ;

    /*
     * Check if the menu is attached to the current window,
     * if so, have it detached (by overwriting with a NULL):
     */
    for( i = 0; i < FREEGLUT_MAX_MENUS; i++ )
        if( window->Menu[ i ] == menu )
            window->Menu[ i ] = NULL;

    /* Call this function for all of the window's children recursively: */
    for( subWindow = (SFG_Window *)window->Children.First;
         subWindow;
         subWindow = (SFG_Window *)subWindow->Node.Next)
        fghRemoveMenuFromWindow( subWindow, menu );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rsi, 0x150(%rdi)
jne 0xbd922
andq $0x0, 0x150(%r14)
xorl %eax, %eax
cmpq $0x3, %rax
je 0xbd942
cmpq %rbx, 0x138(%r14,%rax,8)
jne 0xbd93d
andq $0x0, 0x138(%r14,%rax,8)
incq %rax
jmp 0xbd924
addq $0x160, %r14            # imm = 0x160
movq (%r14), %r14
testq %r14, %r14
je 0xbd95e
movq %r14, %rdi
movq %rbx, %rsi
callq 0xbd907
jmp 0xbd949
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgDestroyStructure
void fgDestroyStructure( void )
{
    /* Clean up the WindowsToDestroy list. */
    fgCloseWindows( );

    /* Make sure all windows and menus have been deallocated */
    while( fgStructure.Menus.First )
        fgDestroyMenu( ( SFG_Menu * )fgStructure.Menus.First );

    while( fgStructure.Windows.First )
        fgDestroyWindow( ( SFG_Window * )fgStructure.Windows.First );
}

// Assembly:
pushq %rax
callq 0xbd6d1
movq 0x79efe(%rip), %rdi     # 0x1378a0
testq %rdi, %rdi
je 0xbd9b3
callq 0xbd806
jmp 0xbd99b
callq 0xbd70e
movq 0x79ed6(%rip), %rdi     # 0x137890
testq %rdi, %rdi
jne 0xbd9ae
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgEnumWindows
void fgEnumWindows( FGCBenumerator enumCallback, SFG_Enumerator* enumerator )
{
    SFG_Window *window;

    FREEGLUT_INTERNAL_ERROR_EXIT ( enumCallback && enumerator,
                                   "Enumerator or callback missing from window enumerator call",
                                   "fgEnumWindows" );

    /* Check every of the top-level windows */
    for( window = ( SFG_Window * )fgStructure.Windows.First;
         window;
         window = ( SFG_Window * )window->Node.Next )
    {
        enumCallback( window, enumerator );
        if( enumerator->found )
            return;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
jne 0xbd9f8
leaq 0x2727b(%rip), %rdi     # 0xe4c5e
leaq 0x27d3f(%rip), %rsi     # 0xe5729
leaq 0x27d73(%rip), %rdx     # 0xe5764
xorl %eax, %eax
callq 0xbad73
leaq 0x79e91(%rip), %r15     # 0x137890
movq (%r15), %r15
testq %r15, %r15
je 0xbda15
movq %r15, %rdi
movq %rbx, %rsi
callq *%r14
cmpb $0x0, (%rbx)
je 0xbd9ff
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgEnumSubWindows
void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback,
                       SFG_Enumerator* enumerator )
{
    SFG_Window *child;

    FREEGLUT_INTERNAL_ERROR_EXIT ( enumCallback && enumerator,
                                   "Enumerator or callback missing from subwindow enumerator call",
                                   "fgEnumSubWindows" );
    FREEGLUT_INTERNAL_ERROR_EXIT_IF_NOT_INITIALISED ( "Window Enumeration" );

    for( child = ( SFG_Window * )window->Children.First;
         child;
         child = ( SFG_Window * )child->Node.Next )
    {
        enumCallback( child, enumerator );
        if( enumerator->found )
            return;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
setne %al
testq %rdx, %rdx
setne %cl
testb %cl, %al
jne 0xbda55
leaq 0x2721e(%rip), %rdi     # 0xe4c5e
leaq 0x27d2b(%rip), %rsi     # 0xe5772
leaq 0x27d62(%rip), %rdx     # 0xe57b0
xorl %eax, %eax
callq 0xbad73
leaq 0x75784(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbda77
leaq 0x16ae2(%rip), %rdi     # 0xd454b
leaq 0x27d51(%rip), %rsi     # 0xe57c1
xorl %eax, %eax
callq 0xbad73
addq $0x160, %r15            # imm = 0x160
movq (%r15), %r15
testq %r15, %r15
je 0xbda94
movq %r15, %rdi
movq %rbx, %rsi
callq *%r14
cmpb $0x0, (%rbx)
je 0xbda7e
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgWindowByHandle
SFG_Window* fgWindowByHandle ( SFG_WindowHandleType hWindow )
{
    SFG_Enumerator enumerator;

    /* This is easy and makes use of the windows enumeration defined above */
    enumerator.found = GL_FALSE;
    enumerator.data = (void *)hWindow;
    fgEnumWindows( fghcbWindowByHandle, &enumerator );

    if( enumerator.found )
        return( SFG_Window *) enumerator.data;
    return NULL;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsp, %rbx
movb $0x0, (%rbx)
movq %rdi, 0x8(%rbx)
leaq 0x1c(%rip), %rdi        # 0xbdacc
movq %rbx, %rsi
callq 0xbd9c1
cmpb $0x0, (%rbx)
je 0xbdac4
movq 0x8(%rsp), %rax
jmp 0xbdac6
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgWindowByID
SFG_Window* fgWindowByID( int windowID )
{
    SFG_Enumerator enumerator;

    /* Uses a method very similiar for fgWindowByHandle... */
    enumerator.found = GL_FALSE;
    enumerator.data = ( void * )&windowID;
    fgEnumWindows( fghcbWindowByID, &enumerator );
    if( enumerator.found )
        return ( SFG_Window * )enumerator.data;
    return NULL;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0xc(%rsp), %rax
movl %edi, (%rax)
leaq 0x10(%rsp), %rbx
movb $0x0, (%rbx)
movq %rax, 0x8(%rbx)
leaq 0x1c(%rip), %rdi        # 0xbdb2e
movq %rbx, %rsi
callq 0xbd9c1
cmpb $0x0, (%rbx)
je 0xbdb26
movq 0x18(%rsp), %rax
jmp 0xbdb28
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutCreateWindow
int FGAPIENTRY glutCreateWindow( const char* title )
{
    /* XXX GLUT does not exit; it simply calls "glutInit" quietly if the
     * XXX application has not already done so.  The "freeglut" community
     * XXX decided not to go this route (freeglut-developer e-mail from
     * XXX Steve Baker, 12/16/04, 4:22 PM CST, "Re: [Freeglut-developer]
     * XXX Desired 'freeglut' behaviour when there is no current window"
     */
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutCreateWindow" );

    return fgCreateWindow( NULL, title, fgState.Position.Use,
                           fgState.Position.X, fgState.Position.Y,
                           fgState.Size.Use, fgState.Size.X, fgState.Size.Y,
                           GL_FALSE, GL_FALSE )->ID;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x74e0b(%rip), %r14     # 0x1331e0
cmpb $0x0, 0x1c(%r14)
jne 0xbe3f1
leaq 0x15e83(%rip), %rdi     # 0xd4266
leaq 0x2749b(%rip), %rsi     # 0xe5885
xorl %eax, %eax
callq 0xbad73
movzbl 0x8(%r14), %edx
movl (%r14), %ecx
movl 0x4(%r14), %r8d
movzbl 0x14(%r14), %r9d
movl 0xc(%r14), %eax
movl 0x10(%r14), %esi
andl $0x0, 0x18(%rsp)
andl $0x0, 0x10(%rsp)
movl %esi, 0x8(%rsp)
movl %eax, (%rsp)
xorl %edi, %edi
movq %rbx, %rsi
callq 0xbd44c
movl 0x10(%rax), %eax
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutCreateSubWindow
int FGAPIENTRY glutCreateSubWindow( int parentID, int x, int y, int w, int h )
{
    int ret = 0;
    SFG_Window* window = NULL;
    SFG_Window* parent = NULL;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutCreateSubWindow" );
    parent = fgWindowByID( parentID );
    freeglut_return_val_if_fail( parent != NULL, 0 );
    if ( x < 0 )
    {
        x = parent->State.Width + x ;
        if ( w >= 0 ) x -= w ;
    }

    if ( w < 0 ) w = parent->State.Width - x + w ;
    if ( w < 0 )
    {
        x += w ;
        w = -w ;
    }

    if ( y < 0 )
    {
        y = parent->State.Height + y ;
        if ( h >= 0 ) y -= h ;
    }

    if ( h < 0 ) h = parent->State.Height - y + h ;
    if ( h < 0 )
    {
        y += h ;
        h = -h ;
    }

    window = fgCreateWindow( parent, "", GL_TRUE, x, y, GL_TRUE, w, h, GL_FALSE, GL_FALSE );
    ret = window->ID;

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebx
movl %ecx, %r15d
movl %edx, %ebp
movl %esi, %r14d
movl %edi, %r12d
leaq 0x74d93(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbe468
leaq 0x15e0c(%rip), %rdi     # 0xd4266
leaq 0x27435(%rip), %rsi     # 0xe5896
xorl %eax, %eax
callq 0xbad73
movl %r12d, %edi
callq 0xbdaf3
testq %rax, %rax
je 0xbe506
testl %r14d, %r14d
jns 0xbe48e
xorl %ecx, %ecx
testl %r15d, %r15d
cmovgl %r15d, %ecx
subl %ecx, %r14d
addl 0x38(%rax), %r14d
testl %r15d, %r15d
jns 0xbe49a
subl %r14d, %r15d
addl 0x38(%rax), %r15d
movl %r15d, %ecx
sarl $0x1f, %ecx
andl %r15d, %ecx
movl %r15d, %r10d
negl %r10d
cmovsl %r15d, %r10d
testl %ebp, %ebp
jns 0xbe4bd
xorl %edx, %edx
testl %ebx, %ebx
cmovgl %ebx, %edx
subl %edx, %ebp
addl 0x3c(%rax), %ebp
addl %r14d, %ecx
testl %ebx, %ebx
jns 0xbe4c9
subl %ebp, %ebx
addl 0x3c(%rax), %ebx
movl %ebx, %r8d
sarl $0x1f, %r8d
andl %ebx, %r8d
addl %ebp, %r8d
movl %ebx, %r11d
negl %r11d
cmovsl %ebx, %r11d
leaq 0x79e0(%rip), %rsi      # 0xc5ec7
pushq $0x1
popq %rdx
movq %rax, %rdi
movl %edx, %r9d
pushq $0x0
pushq $0x0
pushq %r11
pushq %r10
callq 0xbd44c
addq $0x20, %rsp
movl 0x10(%rax), %eax
jmp 0xbe508
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutDestroyWindow
void FGAPIENTRY glutDestroyWindow( int windowID )
{
    SFG_Window* window;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutDestroyWindow" );
    window = fgWindowByID( windowID );
    freeglut_return_if_fail( window != NULL );
    {
        fgExecutionState ExecState = fgState.ExecState;
        fgAddToWindowDestroyList( window );
        fgState.ExecState = ExecState;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x74cc2(%rip), %r14     # 0x1331e0
cmpb $0x0, 0x1c(%r14)
jne 0xbe53a
leaq 0x15d3a(%rip), %rdi     # 0xd4266
leaq 0x27377(%rip), %rsi     # 0xe58aa
xorl %eax, %eax
callq 0xbad73
movl %ebx, %edi
callq 0xbdaf3
testq %rax, %rax
je 0xbe55c
movl 0xa0(%r14), %ebx
movq %rax, %rdi
callq 0xbd65f
movl %ebx, 0xa0(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutSetWindow
void FGAPIENTRY glutSetWindow( int ID )
{
    SFG_Window* window = NULL;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetWindow" );
    if( fgStructure.CurrentWindow != NULL )
        if( fgStructure.CurrentWindow->ID == ID )
            return;

    window = fgWindowByID( ID );
    if( window == NULL )
    {
        fgWarning( "glutSetWindow(): window ID %d not found!", ID );
        return;
    }

    fgSetWindow( window );
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x74c72(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbe589
leaq 0x15ceb(%rip), %rdi     # 0xd4266
leaq 0x2733a(%rip), %rsi     # 0xe58bc
xorl %eax, %eax
callq 0xbad73
leaq 0x79300(%rip), %rax     # 0x137890
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xbe5a0
cmpl %ebx, 0x10(%rax)
jne 0xbe5a0
popq %rbx
retq
movl %ebx, %edi
callq 0xbdaf3
testq %rax, %rax
je 0xbe5b5
movq %rax, %rdi
popq %rbx
jmp 0xbde17
leaq 0x2730e(%rip), %rdi     # 0xe58ca
movl %ebx, %esi
xorl %eax, %eax
popq %rbx
jmp 0xbae63
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutGetWindow
int FGAPIENTRY glutGetWindow( void )
{
    SFG_Window *win = fgStructure.CurrentWindow;
    /*
     * Since GLUT did not throw an error if this function was called without a prior call to
     * "glutInit", this function shouldn't do so here.  Instead let us return a zero.
     * See Feature Request "[ 1307049 ] glutInit check".
     */
    if ( ! fgState.Initialised )
        return 0;

    while ( win && win->IsMenu )
        win = win->Parent;
    return win ? win->ID : 0;
}

// Assembly:
leaq 0x74c13(%rip), %rcx     # 0x1331e0
xorl %eax, %eax
cmpb $0x0, 0x1c(%rcx)
je 0xbe5fd
leaq 0x792b4(%rip), %rcx     # 0x137890
addq $0x30, %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xbe5fd
cmpb $0x0, 0x170(%rcx)
je 0xbe5fa
addq $0x158, %rcx            # imm = 0x158
jmp 0xbe5e0
movl 0x10(%rcx), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutShowWindow
void FGAPIENTRY glutShowWindow( void )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutShowWindow" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutShowWindow" );

#if TARGET_HOST_POSIX_X11

    XMapWindow( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle );
    XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */

#elif TARGET_HOST_MS_WINDOWS

    ShowWindow( fgStructure.CurrentWindow->Window.Handle, SW_SHOW );

#endif

    fgStructure.CurrentWindow->State.Redisplay = GL_TRUE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x74bd7(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbe624
leaq 0x15c50(%rip), %rdi     # 0xd4266
leaq 0x272d6(%rip), %rsi     # 0xe58f3
xorl %eax, %eax
callq 0xbad73
leaq 0x79265(%rip), %rbx     # 0x137890
movq 0x30(%rbx), %rax
testq %rax, %rax
jne 0xbe64d
leaq 0x15f83(%rip), %rdi     # 0xd45be
leaq 0x272b1(%rip), %rsi     # 0xe58f3
xorl %eax, %eax
callq 0xbad73
movq 0x30(%rbx), %rax
leaq 0x7919c(%rip), %r14     # 0x1377f0
movq (%r14), %rdi
movq 0x18(%rax), %rsi
callq 0x21a10
movq (%r14), %rdi
callq 0x21ec0
movq 0x30(%rbx), %rax
movb $0x1, 0x48(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutHideWindow
void FGAPIENTRY glutHideWindow( void )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutHideWindow" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutHideWindow" );

#if TARGET_HOST_POSIX_X11

    if( fgStructure.CurrentWindow->Parent == NULL )
        XWithdrawWindow( fgDisplay.Display,
                         fgStructure.CurrentWindow->Window.Handle,
                         fgDisplay.Screen );
    else
        XUnmapWindow( fgDisplay.Display,
                      fgStructure.CurrentWindow->Window.Handle );
    XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */

#elif TARGET_HOST_MS_WINDOWS

    ShowWindow( fgStructure.CurrentWindow->Window.Handle, SW_HIDE );

#endif

    fgStructure.CurrentWindow->State.Redisplay = GL_FALSE;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x74b5d(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbe69e
leaq 0x15bd6(%rip), %rdi     # 0xd4266
leaq 0x2726b(%rip), %rsi     # 0xe5902
xorl %eax, %eax
callq 0xbad73
leaq 0x791eb(%rip), %rbx     # 0x137890
movq 0x30(%rbx), %rax
testq %rax, %rax
jne 0xbe6c7
leaq 0x15f09(%rip), %rdi     # 0xd45be
leaq 0x27246(%rip), %rsi     # 0xe5902
xorl %eax, %eax
callq 0xbad73
movq 0x30(%rbx), %rax
cmpq $0x0, 0x158(%rax)
leaq 0x7911a(%rip), %r14     # 0x1377f0
movq (%r14), %rdi
movq 0x18(%rax), %rsi
je 0xbe6e6
callq 0x21e50
jmp 0xbe6ef
movl 0x8(%r14), %edx
callq 0x216f0
movq (%r14), %rdi
callq 0x21ec0
movq 0x30(%rbx), %rax
movb $0x0, 0x48(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutIconifyWindow
void FGAPIENTRY glutIconifyWindow( void )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutIconifyWindow" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutIconifyWindow" );

    fgStructure.CurrentWindow->State.Visible   = GL_FALSE;
#if TARGET_HOST_POSIX_X11

    XIconifyWindow( fgDisplay.Display, fgStructure.CurrentWindow->Window.Handle,
                    fgDisplay.Screen );
    XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */

#elif TARGET_HOST_MS_WINDOWS

    ShowWindow( fgStructure.CurrentWindow->Window.Handle, SW_MINIMIZE );

#endif

    fgStructure.CurrentWindow->State.Redisplay = GL_FALSE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x74ace(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xbe72d
leaq 0x15b47(%rip), %rdi     # 0xd4266
leaq 0x271eb(%rip), %rsi     # 0xe5911
xorl %eax, %eax
callq 0xbad73
leaq 0x7915c(%rip), %rbx     # 0x137890
movq 0x30(%rbx), %rax
testq %rax, %rax
jne 0xbe756
leaq 0x15e7a(%rip), %rdi     # 0xd45be
leaq 0x271c6(%rip), %rsi     # 0xe5911
xorl %eax, %eax
callq 0xbad73
movq 0x30(%rbx), %rax
xorl %ebp, %ebp
movb %bpl, 0x49(%rax)
leaq 0x7908d(%rip), %r14     # 0x1377f0
movq (%r14), %rdi
movq 0x18(%rax), %rsi
movl 0x8(%r14), %edx
callq 0x21430
movq (%r14), %rdi
callq 0x21ec0
movq 0x30(%rbx), %rax
movb %bpl, 0x48(%rax)
popq %rbx
popq %r14
popq %rbp
retq