LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_joystick.c
// Function: fgInitialiseJoysticks
void fgInitialiseJoysticks ( void )
{
    if( !fgState.JoysticksInitialised )
    {
        int ident ;
        for ( ident = 0; ident < MAX_NUM_JOYSTICKS; ident++ )
            fghJoystickInit( ident );

        fgState.JoysticksInitialised = GL_TRUE;
    }
}

// Assembly:
leaq 0x73059(%rip), %rax     # 0x1441c0
cmpb $0x0, 0xb0(%rax)
je 0xd1171
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x80016a11, %eax       # imm = 0x80016A11
leaq 0x776d5(%rip), %rbx     # 0x148860
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x7f0002(%rax), %r12
xorl %r13d, %r13d
cmpq $0x0, (%rbx,%r13,8)
je 0xd11b3
leaq 0x2b1e0(%rip), %rdi     # 0xfc38c
xorl %eax, %eax
callq 0xd1cf7
movl $0x2a0, %edi            # imm = 0x2A0
movl $0x1, %esi
callq 0x21600
movq %rax, (%rbx,%r13,8)
movq $0x0, 0x158(%rax)
movl %r13d, 0xd0(%rax)
movb $0x0, 0xd4(%rax)
leaq 0x4c(%rax), %rdi
movl $0x80, %esi
leaq 0x2b1d1(%rip), %rdx     # 0xfc3c0
movl %r13d, %ecx
xorl %eax, %eax
callq 0x21fb0
movq (%rbx,%r13,8), %rdi
addq $0x4c, %rdi
xorl %esi, %esi
callq 0x22030
testl %eax, %eax
je 0xd122a
movq (%rbx,%r13,8), %rdi
addq $0x4c, %rdi
movl $0x80, %esi
leaq 0x2b1b0(%rip), %rdx     # 0xfc3d0
movl %r13d, %ecx
xorl %eax, %eax
callq 0x21fb0
movq (%rbx,%r13,8), %r14
movw $0x1, 0xd4(%r14)
movabsq $0x2000000000, %rax     # imm = 0x2000000000
movq %rax, 0x158(%r14)
movl $0x2, 0x158(%r14)
leaq 0x4c(%r14), %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movups %xmm0, 0x18(%r14)
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x38(%r14)
movl $0x0, 0x48(%r14)
xorl %esi, %esi
xorl %eax, %eax
callq 0x21670
movl %eax, 0xcc(%r14)
movl %eax, %ecx
shrl $0x1f, %ecx
movb %cl, 0xd4(%r14)
testl %eax, %eax
js 0xd137b
leaq 0xd5(%r14), %rbp
movl $0x80016a11, %esi       # imm = 0x80016A11
movl %eax, %edi
leaq 0xf(%rsp), %r15
movq %r15, %rdx
xorl %eax, %eax
callq 0x21d30
movzbl 0xf(%rsp), %eax
movl %eax, 0x158(%r14)
movl 0xcc(%r14), %edi
movq 0x10(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21d30
movzbl 0xf(%rsp), %eax
movl %eax, 0x15c(%r14)
movl 0xcc(%r14), %edi
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x21d30
movl 0xcc(%r14), %edi
movl $0x4, %esi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x214f0
movaps 0x2af27(%rip), %xmm3    # 0xfc240
movaps 0x2af10(%rip), %xmm2    # 0xfc230
movaps 0x2aef9(%rip), %xmm1    # 0xfc220
xorps %xmm0, %xmm0
movups %xmm0, 0x160(%r14)
movups %xmm0, 0x170(%r14)
movups %xmm0, 0x180(%r14)
movups %xmm0, 0x190(%r14)
movq $-0x10, %rax
movups %xmm1, 0x260(%r14,%rax,4)
movups %xmm0, 0x220(%r14,%rax,4)
movups %xmm2, 0x2a0(%r14,%rax,4)
movups %xmm3, 0x1e0(%r14,%rax,4)
addq $0x4, %rax
jne 0xd1351
leaq 0x1(%r13), %rax
testq %r13, %r13
movq %rax, %r13
je 0xd119e
leaq 0x72e2e(%rip), %rax     # 0x1441c0
movb $0x1, 0xb0(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_joystick.c
// Function: fgJoystickDetect
int fgJoystickDetect( void )
{
    int ident;

    fgInitialiseJoysticks ();

    if ( !fgState.JoysticksInitialised )
        return 0;

    for( ident=0; ident<MAX_NUM_JOYSTICKS; ident++ )
        if( fgJoystick[ident] && !fgJoystick[ident]->error )
            return 1;

    return 0;
}

// Assembly:
pushq %rax
callq 0xd1160
leaq 0x7298b(%rip), %rax     # 0x1441c0
cmpb $0x0, 0xb0(%rax)
je 0xd1863
xorl %eax, %eax
leaq 0x77019(%rip), %rcx     # 0x148860
movq (%rax,%rcx), %rdx
testq %rdx, %rdx
je 0xd1859
cmpb $0x0, 0xd4(%rdx)
je 0xd1867
addq $0x8, %rax
cmpq $0x8, %rax
je 0xd1847
xorl %eax, %eax
jmp 0xd186c
movl $0x1, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fgError
void fgError( const char *fmt, ... )
{
    va_list ap;

    va_start( ap, fmt );

    fprintf( stderr, "freeglut ");
    if( fgState.ProgramName )
        fprintf( stderr, "(%s): ", fgState.ProgramName );
    VFPRINTF( stderr, fmt, ap );
    fprintf( stderr, "\n" );

    va_end( ap );

    if ( fgState.Initialised )
        fgDeinitialize ();

    exit( 1 );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xd1d5a
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movq 0x6d227(%rip), %r14     # 0x13efa8
movq (%r14), %rcx
leaq 0x2a821(%rip), %rdi     # 0xfc5ac
movl $0x9, %esi
movl $0x1, %edx
callq 0x222a0
leaq 0x7241f(%rip), %r15     # 0x1441c0
movq 0xa8(%r15), %rdx
testq %rdx, %rdx
je 0xd1dbe
movq (%r14), %rdi
leaq 0x2a7ff(%rip), %rsi     # 0xfc5b6
xorl %eax, %eax
callq 0x21d90
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x21c80
movq (%r14), %rsi
movl $0xa, %edi
callq 0x21bc0
cmpb $0x0, 0x1c(%r15)
je 0xd1de5
callq 0xcfee7
movl $0x1, %edi
callq 0x21b10
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fghcbCheckJoystickPolls
static void fghcbCheckJoystickPolls( SFG_Window *window,
                                     SFG_Enumerator *enumerator )
{
    long int checkTime = fgElapsedTime( );

    if( window->State.JoystickLastPoll + window->State.JoystickPollRate <=
        checkTime )
    {
#if !defined(_WIN32_WCE)
        fgJoystickPollWindow( window );
#endif /* !defined(_WIN32_WCE) */
        window->State.JoystickLastPoll = checkTime;
    }

    fgEnumSubWindows( window, fghcbCheckJoystickPolls, enumerator );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x21fc0
movabsq $0x20c49ba5e353f7cf, %rax # imm = 0x20C49BA5E353F7CF
imulq 0x8(%r15)
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
imulq $0x3e8, (%r15), %r15    # imm = 0x3E8
addq %rdx, %r15
leaq 0x718d2(%rip), %rax     # 0x1441c0
subq 0x40(%rax), %r15
movq 0x50(%r14), %rax
addq 0x58(%r14), %rax
cmpq %r15, %rax
jg 0xd290b
movq %r14, %rdi
callq 0xd13f5
movq %r15, 0x58(%r14)
leaq -0x6d(%rip), %rsi       # 0xd28a5
movq %r14, %rdi
movq %rbx, %rdx
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0xd4bff
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fghcbDisplayWindow
static void fghcbDisplayWindow( SFG_Window *window,
                                SFG_Enumerator *enumerator )
{
    if( window->State.Redisplay &&
        window->State.Visible )
    {
        window->State.Redisplay = GL_FALSE;

#if TARGET_HOST_POSIX_X11
        fghRedrawWindow ( window ) ;
#elif TARGET_HOST_MS_WINDOWS
        RedrawWindow(
            window->Window.Handle, NULL, NULL,
            RDW_NOERASE | RDW_INTERNALPAINT | RDW_INVALIDATE | RDW_UPDATENOW
        );
#endif
    }

    fgEnumSubWindows( window, fghcbDisplayWindow, enumerator );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x48(%rdi)
je 0xd2a1a
cmpb $0x0, 0x49(%r14)
je 0xd2a1a
movb $0x0, 0x48(%r14)
testq %r14, %r14
je 0xd2a1a
cmpq $0x0, 0x70(%r14)
je 0xd2a1a
leaq 0x75f04(%rip), %r12     # 0x148870
movq 0x30(%r12), %r15
movb $0x0, 0x48(%r14)
movq %r14, %rdi
callq 0xd5037
cmpb $0x0, 0x6a(%r14)
je 0xd29ff
movl 0x38(%r14), %r13d
movl 0x3c(%r14), %ebp
movq 0x30(%r12), %rax
movq %rax, (%rsp)
leaq 0x75e33(%rip), %r12     # 0x1487d0
movq (%r12), %rdi
movq 0x18(%r14), %rsi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x21e20
movq (%r12), %rdi
callq 0x21eb0
movq 0x78(%r14), %r12
movq %r14, %rdi
callq 0xd5037
testq %r12, %r12
je 0xd29d4
movl %r13d, %edi
movl %ebp, %esi
callq *0x78(%r14)
jmp 0xd29e2
xorl %edi, %edi
xorl %esi, %esi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x21200
movb $0x1, 0x48(%r14)
cmpb $0x0, 0x170(%r14)
je 0xd29fa
movq (%rsp), %rdi
callq 0xd5037
movb $0x0, 0x6a(%r14)
cmpq $0x0, 0x70(%r14)
je 0xd2a12
movq %r14, %rdi
callq 0xd5037
callq *0x70(%r14)
movq %r15, %rdi
callq 0xd5037
leaq -0xfb(%rip), %rsi       # 0xd2926
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xd4bff
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fghHavePendingRedisplaysCallback
static void fghHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e)
{
    if( w->State.Redisplay && w->State.Visible )
    {
        e->found = GL_TRUE;
        e->data = w;
    }
    fgEnumSubWindows( w, fghHavePendingRedisplaysCallback, e );
}

// Assembly:
movq %rsi, %rdx
cmpb $0x0, 0x48(%rdi)
je 0xd2a50
cmpb $0x0, 0x49(%rdi)
je 0xd2a50
movb $0x1, (%rdx)
movq %rdi, 0x8(%rdx)
leaq -0x1d(%rip), %rsi       # 0xd2a3a
jmp 0xd4bff
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fghExecuteMenuCallback
static void fghExecuteMenuCallback( SFG_Menu* menu )
{
    SFG_MenuEntry *menuEntry;

    /* First of all check any of the active sub menus... */
    for( menuEntry = (SFG_MenuEntry *)menu->Entries.First;
         menuEntry;
         menuEntry = (SFG_MenuEntry *)menuEntry->Node.Next)
    {
        if( menuEntry->IsActive )
        {
            if( menuEntry->SubMenu )
                fghExecuteMenuCallback( menuEntry->SubMenu );
            else
                if( menu->Callback )
                {
                    SFG_Menu *save_menu = fgStructure.CurrentMenu;
                    fgStructure.CurrentMenu = menu;
                    menu->Callback( menuEntry->ID );
                    fgStructure.CurrentMenu = save_menu;
                }

            return;
        }
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rax
leaq 0x20(%rdi), %rcx
movq (%rcx), %rcx
testq %rcx, %rcx
je 0xd346b
cmpb $0x0, 0x28(%rcx)
je 0xd3433
movq 0x20(%rcx), %rdi
testq %rdi, %rdi
jne 0xd342c
movq 0x30(%rax), %rdx
testq %rdx, %rdx
je 0xd346b
leaq 0x75416(%rip), %rbx     # 0x148870
movq 0x38(%rbx), %r14
movq %rax, 0x38(%rbx)
movl 0x10(%rcx), %edi
callq *%rdx
movq %r14, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fgDeactivateMenu
void fgDeactivateMenu( SFG_Window *window )
{
    SFG_Window *parent_window = NULL;

    /* Check if there is an active menu attached to this window... */
    SFG_Menu* menu = window->ActiveMenu;
    SFG_MenuEntry *menuEntry;

    /* Did we find an active window? */
    freeglut_return_if_fail( menu );

    parent_window = menu->ParentWindow;

    /* Hide the present menu's window */
    fgSetWindow( menu->Window );
    glutHideWindow( );

    /* Forget about having that menu active anymore, now: */
    menu->Window->ActiveMenu = NULL;
    menu->ParentWindow->ActiveMenu = NULL;
    fghSetMenuParentWindow ( NULL, menu );
    menu->IsActive = GL_FALSE;
    menu->ActiveEntry = NULL;

    fgState.ActiveMenus--;

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

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

    fgSetWindow ( parent_window ) ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x150(%rdi), %r14
testq %r14, %r14
je 0xd34fb
movq 0x60(%r14), %rdi
movq 0x68(%r14), %rbx
callq 0xd5037
callq 0xd58ee
movq 0x60(%r14), %rax
xorl %r15d, %r15d
movq %r15, 0x150(%rax)
movq 0x68(%r14), %rax
movq %r15, 0x150(%rax)
xorl %edi, %edi
movq %r14, %rsi
callq 0xd3501
movb $0x0, 0x40(%r14)
movq %r15, 0x58(%r14)
leaq 0x70cf7(%rip), %rax     # 0x1441c0
decl 0x70(%rax)
movq 0x20(%r14), %r14
testq %r14, %r14
je 0xd34ee
movb $0x0, 0x28(%r14)
cmpq $0x0, 0x20(%r14)
je 0xd34e9
movq %r14, %rdi
callq 0xd3536
movq (%r14), %r14
jmp 0xd34d0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xd5037
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fghSetMenuParentWindow
static void fghSetMenuParentWindow( SFG_Window *window, SFG_Menu *menu )
{
    SFG_MenuEntry *menuEntry;

    menu->ParentWindow = window;

    for( menuEntry = ( SFG_MenuEntry * )menu->Entries.First;
         menuEntry;
         menuEntry = ( SFG_MenuEntry * )menuEntry->Node.Next )
        if( menuEntry->SubMenu )
            fghSetMenuParentWindow( window, menuEntry->SubMenu );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, 0x68(%rsi)
movq 0x20(%rsi), %r14
testq %r14, %r14
je 0xd352e
movq %rdi, %rbx
movq 0x20(%r14), %rsi
testq %rsi, %rsi
je 0xd3526
movq %rbx, %rdi
callq 0xd3501
movq (%r14), %r14
testq %r14, %r14
jne 0xd3515
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd5037
callq 0xd58ee
movq 0x20(%rbx), %rax
movq 0x60(%rax), %rcx
xorl %edx, %edx
movq %rdx, 0x150(%rcx)
movb $0x0, 0x40(%rax)
movq %rdx, 0x58(%rax)
movq 0x20(%rax), %r14
testq %r14, %r14
je 0xd358a
movb $0x0, 0x28(%r14)
cmpq $0x0, 0x20(%r14)
je 0xd3585
movq %r14, %rdi
callq 0xd3536
movq (%r14), %r14
jmp 0xd356c
movq 0x20(%rbx), %rax
movq 0x68(%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd5037
// File: /workspace/github_cpp_makefile_star2_O1/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 0x752c0(%rip), %r15     # 0x148870
movq 0x38(%r15), %rax
testq %rax, %rax
je 0xd363f
movq 0x20(%rax), %r13
testq %r13, %r13
je 0xd3629
xorl %r12d, %r12d
leaq 0x751e8(%rip), %rbx     # 0x1487b8
leaq 0x29084(%rip), %r14     # 0xfc65b
xorl %ebp, %ebp
movq 0x18(%r13), %rsi
movq %rbx, %rdi
callq 0xcf872
movl %eax, 0x2c(%r13)
cmpq $0x0, 0x20(%r13)
je 0xd35ff
movq %rbx, %rdi
movq %r14, %rsi
callq 0xcf872
addl %eax, 0x2c(%r13)
movl 0x2c(%r13), %eax
cmpl %ebp, %eax
cmovgl %eax, %ebp
movq %rbx, %rdi
callq 0xcf8fb
addl %eax, %r12d
addl $0x2, %r12d
movq (%r13), %r13
testq %r13, %r13
jne 0xd35d9
addl $0x4, %r12d
addl $0x8, %ebp
jmp 0xd3634
movl $0x4, %r12d
movl $0x8, %ebp
movq 0x38(%r15), %rax
movl %r12d, 0x48(%rax)
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_O1/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 0x70b35(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd36a6
leaq 0x17ece(%rip), %rdi     # 0xeb566
leaq 0x28fcd(%rip), %rsi     # 0xfc66c
xorl %eax, %eax
callq 0xd1cf7
movl %ebx, %edi
callq 0xd4d68
testq %rax, %rax
je 0xd36bb
movq %rax, %rdi
popq %rbx
jmp 0xd49ca
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x70abd(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd371e
leaq 0x17e56(%rip), %rdi     # 0xeb566
leaq 0x28f71(%rip), %rsi     # 0xfc688
xorl %eax, %eax
callq 0xd1cf7
movl %ebx, %edi
callq 0xd4d68
testq %rax, %rax
je 0xd3735
leaq 0x7513f(%rip), %rcx     # 0x148870
movq %rax, 0x38(%rcx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x70a75(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd3766
leaq 0x17e0e(%rip), %rdi     # 0xeb566
leaq 0x28f35(%rip), %rsi     # 0xfc694
xorl %eax, %eax
callq 0xd1cf7
movl $0x30, %edi
movl $0x1, %esi
callq 0x21600
movq %rax, %r15
leaq 0x750f1(%rip), %rax     # 0x148870
movq 0x38(%rax), %r12
testq %r12, %r12
je 0xd37b7
movq %r14, %rdi
callq 0x22170
movq %rax, 0x18(%r15)
movl %ebx, 0x10(%r15)
addq $0x20, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0xd46d5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0xd359e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x709e9(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd37f2
leaq 0x17d82(%rip), %rdi     # 0xeb566
leaq 0x28eba(%rip), %rsi     # 0xfc6a5
xorl %eax, %eax
callq 0xd1cf7
movl $0x30, %edi
movl $0x1, %esi
callq 0x21600
movq %rax, %r14
movl %ebp, %edi
callq 0xd4d68
movq %rax, %r12
leaq 0x7505b(%rip), %rax     # 0x148870
movq 0x38(%rax), %r15
testq %r15, %r15
sete %al
testq %r12, %r12
sete %cl
orb %al, %cl
je 0xd3832
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x22170
movq %rax, 0x18(%r14)
movq %r12, 0x20(%r14)
movl $0xffffffff, 0x10(%r14) # imm = 0xFFFFFFFF
addq $0x20, %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0xd46d5
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xd359e
// File: /workspace/github_cpp_makefile_star2_O1/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 0x70945(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd3896
leaq 0x17cde(%rip), %rdi     # 0xeb566
leaq 0x28e25(%rip), %rsi     # 0xfc6b4
xorl %eax, %eax
callq 0xd1cf7
leaq 0x74fd3(%rip), %rax     # 0x148870
movq 0x38(%rax), %r15
testq %r15, %r15
je 0xd38f8
addq $0x20, %r15
decl %ebp
movq (%r15), %r15
subl $0x1, %ebp
setb %al
testq %r15, %r15
je 0xd38be
testb %al, %al
je 0xd38ac
testq %r15, %r15
je 0xd38f8
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0xd38d1
callq 0x21ae0
movq %r14, %rdi
callq 0x22170
movq %rax, 0x18(%r15)
movl %ebx, 0x10(%r15)
movq $0x0, 0x20(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd359e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x708a7(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd3934
leaq 0x17c40(%rip), %rdi     # 0xeb566
leaq 0x28d9d(%rip), %rsi     # 0xfc6ca
xorl %eax, %eax
callq 0xd1cf7
movl %r14d, %edi
callq 0xd4d68
movq %rax, %r14
leaq 0x74f2a(%rip), %rax     # 0x148870
movq 0x38(%rax), %r15
testq %r15, %r15
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0xd39ac
addq $0x20, %r15
decl %ebp
movq (%r15), %r15
subl $0x1, %ebp
setb %al
testq %r15, %r15
je 0xd3972
testb %al, %al
je 0xd3960
testq %r15, %r15
je 0xd39ac
movq 0x18(%r15), %rdi
testq %rdi, %rdi
je 0xd3985
callq 0x21ae0
movq %rbx, %rdi
callq 0x22170
movq %rax, 0x18(%r15)
movq %r14, 0x20(%r15)
movl $0xffffffff, 0x10(%r15) # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xd359e
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x707fc(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd39df
leaq 0x17b95(%rip), %rdi     # 0xeb566
leaq 0x28d06(%rip), %rsi     # 0xfc6de
xorl %eax, %eax
callq 0xd1cf7
leaq 0x74e8a(%rip), %rax     # 0x148870
movq 0x38(%rax), %rdi
testq %rdi, %rdi
je 0xd3a39
addq $0x20, %rdi
decl %ebx
movq %rdi, %r14
movq (%r14), %r14
subl $0x1, %ebx
setb %al
testq %r14, %r14
je 0xd3a0a
testb %al, %al
je 0xd39f8
testq %r14, %r14
je 0xd3a39
movq %r14, %rsi
callq 0xd4997
movq 0x18(%r14), %rdi
testq %rdi, %rdi
je 0xd3a25
callq 0x21ae0
movq %r14, %rdi
callq 0x21ae0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd359e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x70775(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd3a66
leaq 0x17b0e(%rip), %rdi     # 0xeb566
leaq 0x28c92(%rip), %rsi     # 0xfc6f1
xorl %eax, %eax
callq 0xd1cf7
cmpl $0x2, %ebx
ja 0xd3a8e
leaq 0x74dfe(%rip), %rcx     # 0x148870
movq 0x30(%rcx), %rax
testq %rax, %rax
je 0xd3a8e
movq 0x38(%rcx), %rcx
testq %rcx, %rcx
je 0xd3a8e
movl %ebx, %edx
movq %rcx, 0x138(%rax,%rdx,8)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x70726(%rip), %rax     # 0x1441c0
cmpb $0x0, 0x1c(%rax)
jne 0xd3ab5
leaq 0x17abf(%rip), %rdi     # 0xeb566
leaq 0x28c52(%rip), %rsi     # 0xfc700
xorl %eax, %eax
callq 0xd1cf7
cmpl $0x2, %ebx
ja 0xd3adf
leaq 0x74daf(%rip), %rcx     # 0x148870
movq 0x30(%rcx), %rax
testq %rax, %rax
je 0xd3adf
cmpq $0x0, 0x38(%rcx)
je 0xd3adf
movl %ebx, %ecx
movq $0x0, 0x138(%rax,%rcx,8)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0x74d0c(%rip), %rax     # 0x148870
cmpq $0x0, 0x48(%rax)
je 0xd3bc1
leaq 0x74c5e(%rip), %rax     # 0x1487d0
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 0x21fd0
addq $0x10, %rsp
leaq 0x70619(%rip), %rax     # 0x1441c0
movl (%r15), %ecx
addl 0x88(%rax), %ecx
movl %ecx, (%r14)
movl (%r12), %ecx
addl 0x8c(%rax), %ecx
movl %ecx, (%rbx)
jmp 0xd3bd3
leaq 0x74c08(%rip), %rax     # 0x1487d0
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
nop
// File: /workspace/github_cpp_makefile_star2_O1/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 0x705cf(%rip), %r15     # 0x1441c0
cmpb $0x0, 0x1c(%r15)
jne 0xd3c0d
leaq 0x17967(%rip), %rdi     # 0xeb566
leaq 0x28cba(%rip), %rsi     # 0xfc8c0
xorl %eax, %eax
callq 0xd1cf7
cmpl $0x1f3, %r14d           # imm = 0x1F3
jle 0xd3c3a
leal -0x1f4(%r14), %eax
cmpl $0xa, %eax
ja 0xd3c52
leaq 0x28b33(%rip), %rcx     # 0xfc75c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %ebx, (%r15)
jmp 0xd3cbe
cmpl $0x7a, %r14d
je 0xd3cab
cmpl $0x80, %r14d
jne 0xd3c64
movl %ebx, 0xb8(%r15)
jmp 0xd3cbe
cmpl $0x1000, %r14d          # imm = 0x1000
jne 0xd3c64
movl %ebx, 0xb4(%r15)
jmp 0xd3cbe
leaq 0x28c63(%rip), %rdi     # 0xfc8ce
movl %r14d, %esi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x22aab
movl %ebx, 0x18(%r15)
jmp 0xd3cbe
cmpl $0x1, %ebx
sete 0x25(%r15)
jmp 0xd3cbe
movl %ebx, 0xc(%r15)
jmp 0xd3cbe
movl %ebx, 0x4(%r15)
jmp 0xd3cbe
movl %ebx, 0x10(%r15)
jmp 0xd3cbe
movl %ebx, 0x20(%r15)
jmp 0xd3cbe
movl %ebx, 0x9c(%r15)
jmp 0xd3cbe
leaq 0x74bbe(%rip), %rax     # 0x148870
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xd3cbe
movl %ebx, 0x4c(%rax)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %rax
movl $0x0, 0x4(%rsp)
leaq 0x74671(%rip), %rax     # 0x148870
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xd4225
movl %edi, %edx
leaq 0x745bf(%rip), %rcx     # 0x1487d0
movq (%rcx), %rdi
movq 0x28(%rax), %rax
movq (%rax), %rsi
leaq 0x4(%rsp), %rcx
callq 0x21270
movl 0x4(%rsp), %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/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, %r14d
movl %edx, %r13d
movq %rsi, %r12
movq %rdi, %rbp
movl $0x178, %edi            # imm = 0x178
movl $0x1, %esi
callq 0x21600
movq %rax, %rbx
testq %rax, %rax
je 0xd45cd
movq %rbx, %rdi
addq $0x70, %rdi
movl $0xc0, %edx
xorl %esi, %esi
callq 0x21490
movb 0x58(%rsp), %dl
movb 0x50(%rsp), %cl
movl 0x48(%rsp), %r10d
movl 0x40(%rsp), %eax
movl 0x742dc(%rip), %esi     # 0x1488c0
incl %esi
movl %esi, 0x742d4(%rip)     # 0x1488c0
movl %esi, 0x10(%rbx)
movq $-0x1, 0x40(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x160(%rbx)
testq %rbp, %rbp
je 0xd461b
movq 0x168(%rbp), %rsi
testq %rsi, %rsi
je 0xd4630
movq %rbx, (%rsi)
movq %rsi, 0x8(%rbx)
jmp 0xd463f
movq 0x74256(%rip), %rsi     # 0x148878
testq %rsi, %rsi
je 0xd4656
movq %rbx, (%rsi)
movq %rsi, 0x8(%rbx)
jmp 0xd4665
movq $0x0, 0x8(%rbx)
movq %rbx, 0x160(%rbp)
movq $0x0, (%rbx)
movq %rbx, 0x168(%rbp)
movq %rbp, 0x158(%rbx)
jmp 0xd4673
movq $0x0, 0x8(%rbx)
movq %rbx, 0x7420b(%rip)     # 0x148870
movq $0x0, (%rbx)
movq %rbx, 0x74205(%rip)     # 0x148878
xorl %r11d, %r11d
testq %rbp, %rbp
setne %r11b
movl $0x64, 0x4c(%rbx)
movb %dl, 0x170(%rbx)
movw $0x0, 0x68(%rbx)
movb $0x0, 0x6b(%rbx)
movzbl %cl, %ebp
movzbl %r13b, %edx
movzbl %r15b, %r9d
movq %rbx, %rdi
movq %r12, %rsi
movl %r14d, %ecx
movl 0x4(%rsp), %r8d
pushq %r11
pushq %rbp
pushq %r10
pushq %rax
callq 0xd506f
addq $0x20, %rsp
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0x74190(%rip), %r15     # 0x1488a0
movl $0x70, %edi
movl $0x1, %esi
callq 0x21600
movq %rax, %rbx
xorl %r12d, %r12d
movq %r12, 0x68(%rax)
movl $0x64, %eax
leaq 0x282ac(%rip), %rsi     # 0xfc9e1
xorl %edi, %edi
movl $0x1, %edx
movl $0x64, %ecx
movl $0x64, %r8d
movl $0x1, %r9d
pushq $0x1
pushq $0x0
pushq %rax
pushq %rax
callq 0xd4584
addq $0x20, %rsp
movq 0x7413d(%rip), %rax     # 0x1488a0
movq %rax, 0x60(%rbx)
leaq -0x1cf2(%rip), %rdi     # 0xd2a7c
callq 0xceb10
callq 0xd58ee
movq %r15, %rdi
callq 0xd5037
movl 0x7413e(%rip), %eax     # 0x1488c4
incl %eax
movl %eax, 0x74136(%rip)     # 0x1488c4
movl %eax, 0x18(%rbx)
movq %r14, 0x30(%rbx)
movq %r12, 0x58(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movq 0x740e1(%rip), %rax     # 0x148888
testq %rax, %rax
je 0xd47b5
movq %rbx, (%rax)
movq %rax, 0x8(%rbx)
jmp 0xd47c4
movq $0x0, 0x8(%rbx)
movq %rbx, 0x740bc(%rip)     # 0x148880
movq $0x0, (%rbx)
movq %rbx, 0x740b6(%rip)     # 0x148888
movq %rbx, 0x740cf(%rip)     # 0x1488a8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x18, %edi
callq 0x21c70
movq %rbx, 0x10(%rax)
movq 0x74094(%rip), %rcx     # 0x148898
testq %rcx, %rcx
je 0xd4812
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
jmp 0xd4821
movq $0x0, 0x8(%rax)
movq %rax, 0x7406f(%rip)     # 0x148890
movq $0x0, (%rax)
movq %rax, 0x74069(%rip)     # 0x148898
cmpq %rbx, 0x7406a(%rip)     # 0x1488a0
jne 0xd4843
movq $0x0, 0x7405d(%rip) # 0x1488a0
movq 0xe0(%rbx), %r14
testq %rbx, %rbx
je 0xd485f
leaq 0x70(%rbx), %rdi
movl $0xc0, %edx
xorl %esi, %esi
callq 0x21490
cmpq %r14, 0xe0(%rbx)
je 0xd486f
movq %r14, 0xe0(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
movq 0x7400e(%rip), %rbx     # 0x148890
testq %rbx, %rbx
je 0xd48b6
leaq 0x74002(%rip), %r14     # 0x148890
movq 0x10(%rbx), %rdi
callq 0xd48be
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd4997
movq %rbx, %rdi
callq 0x21ae0
movq 0x73fdf(%rip), %rbx     # 0x148890
testq %rbx, %rbx
jne 0xd488e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd48ed
leaq 0x2768d(%rip), %rdi     # 0xfbf5e
leaq 0x28117(%rip), %rsi     # 0xfc9ef
leaq 0x28140(%rip), %rdx     # 0xfca1f
xorl %eax, %eax
callq 0xd1cf7
jmp 0xd48ed
callq 0xd48be
movq 0x160(%rbx), %rdi
testq %rdi, %rdi
jne 0xd48e8
movq 0x73fa0(%rip), %r14     # 0x1488a0
cmpq $0x0, 0xe0(%rbx)
je 0xd4918
movq %rbx, %rdi
callq 0xd5037
callq *0xe0(%rbx)
movq %r14, %rdi
callq 0xd5037
movq 0x158(%rbx), %rax
leaq 0x160(%rax), %rcx
testq %rax, %rax
leaq 0x73f38(%rip), %rdi     # 0x148870
cmovneq %rcx, %rdi
movq %rbx, %rsi
callq 0xd4997
cmpq $0x0, 0x150(%rbx)
je 0xd4956
movq %rbx, %rdi
callq 0xd3473
testq %rbx, %rbx
je 0xd496b
leaq 0x70(%rbx), %rdi
movl $0xc0, %edx
xorl %esi, %esi
callq 0x21490
movq %rbx, %rdi
callq 0xd55cf
movq %rbx, %rdi
callq 0x21ae0
cmpq %rbx, 0x73f1e(%rip)     # 0x1488a0
jne 0xd498f
movq $0x0, 0x73f11(%rip) # 0x1488a0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
testq %rcx, %rcx
je 0xd49a7
movq 0x8(%rsi), %rax
movq %rax, 0x8(%rcx)
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0xd49b3
movq %rcx, (%rax)
cmpq %rsi, (%rdi)
jne 0xd49be
movq (%rsi), %rcx
movq %rcx, (%rdi)
cmpq %rsi, 0x8(%rdi)
je 0xd49c5
retq
movq %rax, 0x8(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/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
cmpq %rsi, 0x150(%rdi)
jne 0xd4b02
movq $0x0, 0x150(%rdi)
xorl %eax, %eax
cmpq %rbx, 0x138(%rdi,%rax,8)
jne 0xd4b1a
movq $0x0, 0x138(%rdi,%rax,8)
incq %rax
cmpq $0x3, %rax
jne 0xd4b04
movq 0x160(%rdi), %r14
testq %r14, %r14
je 0xd4b3f
movq %r14, %rdi
movq %rbx, %rsi
callq 0xd4ae7
movq (%r14), %r14
jmp 0xd4b2a
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd4877
movq 0x73cfa(%rip), %rdi     # 0x148880
testq %rdi, %rdi
je 0xd4b97
callq 0xd49ca
jmp 0xd4b7f
callq 0xd48be
movq 0x73cd2(%rip), %rdi     # 0x148870
testq %rdi, %rdi
jne 0xd4b92
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O1/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 0xd4bdc
leaq 0x27397(%rip), %rdi     # 0xfbf5e
leaq 0x27e9b(%rip), %rsi     # 0xfca69
leaq 0x27ecf(%rip), %rdx     # 0xfcaa4
xorl %eax, %eax
callq 0xd1cf7
leaq 0x73c8d(%rip), %r15     # 0x148870
movq (%r15), %r15
testq %r15, %r15
je 0xd4bf9
movq %r15, %rdi
movq %rbx, %rsi
callq *%r14
cmpb $0x0, (%rbx)
je 0xd4be3
popq %rbx
popq %r14
popq %r15
retq