LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: 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:
subq $0x28, %rsp
movl %edi, 0x1c(%rsp)
movb $0x0, 0x8(%rsp)
leaq 0x1c(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x32(%rip), %rdi        # 0x183100
leaq 0x8(%rsp), %rsi
callq 0x182ec0
cmpb $0x0, 0x8(%rsp)
je 0x1830eb
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x1830f4
movq $0x0, 0x20(%rsp)
movq 0x20(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fghcbWindowByID
static void fghcbWindowByID( SFG_Window *window, SFG_Enumerator *enumerator )
{
    /* Make sure we do not overwrite our precious results... */
    if( enumerator->found )
        return;

    /* Check the window's handle. Hope this works. Looks ugly. That's for sure. */
    if( window->ID == *( int *)(enumerator->data) )
    {
        enumerator->found = GL_TRUE;
        enumerator->data = window;

        return;
    }

    /* Otherwise, check this window's children */
    fgEnumSubWindows( window, fghcbWindowByID, enumerator );
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
je 0x18311a
jmp 0x18315d
movq 0x10(%rsp), %rax
movl 0x10(%rax), %eax
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x183147
movq 0x8(%rsp), %rax
movb $0x1, (%rax)
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x18315d
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rdx
leaq -0x58(%rip), %rsi       # 0x183100
callq 0x182f40
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgMenuByID
SFG_Menu* fgMenuByID( int menuID )
{
    SFG_Menu *menu = NULL;

    /* It's enough to check all entries in fgStructure.Menus... */
    for( menu = (SFG_Menu *)fgStructure.Menus.First;
         menu;
         menu = (SFG_Menu *)menu->Node.Next )
        if( menu->ID == menuID )
            return menu;
    return NULL;
}

// Assembly:
movl %edi, -0xc(%rsp)
movq $0x0, -0x18(%rsp)
movq 0x7cd6c(%rip), %rax     # 0x1ffef0
movq %rax, -0x18(%rsp)
cmpq $0x0, -0x18(%rsp)
je 0x1831bc
movq -0x18(%rsp), %rax
movl 0x18(%rax), %eax
cmpl -0xc(%rsp), %eax
jne 0x1831ab
movq -0x18(%rsp), %rax
movq %rax, -0x8(%rsp)
jmp 0x1831c5
jmp 0x1831ad
movq -0x18(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rsp)
jmp 0x183189
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopl (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgListLength
int fgListLength(SFG_List *list)
{
    SFG_Node *node;
    int length = 0;

    for( node =( SFG_Node * )list->First;
         node;
         node = ( SFG_Node * )node->Next )
        ++length;

    return length;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl $0x0, -0x14(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rsp)
cmpq $0x0, -0x10(%rsp)
je 0x18320c
movl -0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rsp)
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rsp)
jmp 0x1831ea
movl -0x14(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_structure.c
// Function: fgListInsert
void fgListInsert(SFG_List *list, SFG_Node *next, SFG_Node *node)
{
    SFG_Node *prev;

    if( (node->Next = next) )
    {
        prev = next->Prev;
        next->Prev = node;
    }
    else
    {
        prev = list->Last;
        list->Last = node;
    }

    if( (node->Prev = prev) )
        prev->Next = node;
    else
        list->First = node;
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq -0x18(%rsp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
je 0x183260
movq -0x10(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
jmp 0x18327c
movq -0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rsp)
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, 0x8(%rax)
movq -0x20(%rsp), %rax
movq -0x18(%rsp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
je 0x18329f
movq -0x18(%rsp), %rcx
movq -0x20(%rsp), %rax
movq %rcx, (%rax)
jmp 0x1832ac
movq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rax
movq %rcx, (%rax)
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: fghNumberOfAuxBuffersRequested
static int fghNumberOfAuxBuffersRequested( void )
{
  if ( fgState.DisplayMode & GLUT_AUX4 ) {
    return 4;
  }
  if ( fgState.DisplayMode & GLUT_AUX3 ) {
    return 3;
  }
  if ( fgState.DisplayMode & GLUT_AUX2 ) {
    return 2;
  }
  if ( fgState.DisplayMode & GLUT_AUX1 ) { /* NOTE: Same as GLUT_AUX! */
    return fgState.AuxiliaryBufferNumber;
  }
  return 0;
}

// Assembly:
leaq 0x76b39(%rip), %rax     # 0x1fa390
movl 0x18(%rax), %eax
andl $0x8000, %eax           # imm = 0x8000
cmpl $0x0, %eax
je 0x18386e
movl $0x4, -0x4(%rsp)
jmp 0x1838d9
leaq 0x76b1b(%rip), %rax     # 0x1fa390
movl 0x18(%rax), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x18388c
movl $0x3, -0x4(%rsp)
jmp 0x1838d9
leaq 0x76afd(%rip), %rax     # 0x1fa390
movl 0x18(%rax), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x1838aa
movl $0x2, -0x4(%rsp)
jmp 0x1838d9
leaq 0x76adf(%rip), %rax     # 0x1fa390
movl 0x18(%rax), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0x1838d1
leaq 0x76acb(%rip), %rax     # 0x1fa390
movl 0xb4(%rax), %eax
movl %eax, -0x4(%rsp)
jmp 0x1838d9
movl $0x0, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nop
// File: 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:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
leaq 0x76170(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18423b
leaq 0x196a5(%rip), %rdi     # 0x19d8d2
leaq 0x2abf5(%rip), %rsi     # 0x1aee29
movb $0x0, %al
callq 0x17de70
movq 0x20(%rsp), %rsi
leaq 0x76149(%rip), %rax     # 0x1fa390
movb 0x8(%rax), %dl
leaq 0x7613f(%rip), %rax     # 0x1fa390
movl (%rax), %ecx
leaq 0x76136(%rip), %rax     # 0x1fa390
movl 0x4(%rax), %r8d
leaq 0x7612b(%rip), %rax     # 0x1fa390
movb 0x14(%rax), %r9b
leaq 0x76120(%rip), %rax     # 0x1fa390
movl 0xc(%rax), %r10d
leaq 0x76115(%rip), %rax     # 0x1fa390
movl 0x10(%rax), %eax
xorl %edi, %edi
xorl %r11d, %r11d
movzbl %dl, %edx
movzbl %r9b, %r9d
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
callq 0x182510
movl 0x10(%rax), %eax
addq $0x28, %rsp
retq
nop
// File: 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:
subq $0x58, %rsp
movl %edi, 0x50(%rsp)
movl %esi, 0x4c(%rsp)
movl %edx, 0x48(%rsp)
movl %ecx, 0x44(%rsp)
movl %r8d, 0x40(%rsp)
movl $0x0, 0x3c(%rsp)
movq $0x0, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
leaq 0x760a6(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x184305
leaq 0x195db(%rip), %rdi     # 0x19d8d2
leaq 0x2ab3c(%rip), %rsi     # 0x1aee3a
movb $0x0, %al
callq 0x17de70
movl 0x50(%rsp), %edi
callq 0x1830b0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x184328
movl $0x0, 0x54(%rsp)
jmp 0x184453
cmpl $0x0, 0x4c(%rsp)
jge 0x184356
movq 0x28(%rsp), %rax
movl 0x38(%rax), %eax
addl 0x4c(%rsp), %eax
movl %eax, 0x4c(%rsp)
cmpl $0x0, 0x44(%rsp)
jl 0x184354
movl 0x44(%rsp), %ecx
movl 0x4c(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x4c(%rsp)
jmp 0x184356
cmpl $0x0, 0x44(%rsp)
jge 0x184371
movq 0x28(%rsp), %rax
movl 0x38(%rax), %eax
subl 0x4c(%rsp), %eax
addl 0x44(%rsp), %eax
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x44(%rsp)
jge 0x18438e
movl 0x44(%rsp), %eax
addl 0x4c(%rsp), %eax
movl %eax, 0x4c(%rsp)
xorl %eax, %eax
subl 0x44(%rsp), %eax
movl %eax, 0x44(%rsp)
cmpl $0x0, 0x48(%rsp)
jge 0x1843bc
movq 0x28(%rsp), %rax
movl 0x3c(%rax), %eax
addl 0x48(%rsp), %eax
movl %eax, 0x48(%rsp)
cmpl $0x0, 0x40(%rsp)
jl 0x1843ba
movl 0x40(%rsp), %ecx
movl 0x48(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x48(%rsp)
jmp 0x1843bc
cmpl $0x0, 0x40(%rsp)
jge 0x1843d7
movq 0x28(%rsp), %rax
movl 0x3c(%rax), %eax
subl 0x48(%rsp), %eax
addl 0x40(%rsp), %eax
movl %eax, 0x40(%rsp)
cmpl $0x0, 0x40(%rsp)
jge 0x1843f4
movl 0x40(%rsp), %eax
addl 0x48(%rsp), %eax
movl %eax, 0x48(%rsp)
xorl %eax, %eax
subl 0x40(%rsp), %eax
movl %eax, 0x40(%rsp)
movq 0x28(%rsp), %rdi
movl 0x4c(%rsp), %ecx
movl 0x48(%rsp), %r8d
movl 0x44(%rsp), %r10d
movl 0x40(%rsp), %eax
leaq 0xab92(%rip), %rsi      # 0x18efa4
movl $0x1, %r9d
xorl %edx, %edx
movl %r9d, %edx
movl %r10d, (%rsp)
movl %eax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
callq 0x182510
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x54(%rsp), %eax
addq $0x58, %rsp
retq
nopl (%rax)
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
leaq 0x75f21(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18448a
leaq 0x19456(%rip), %rdi     # 0x19d8d2
leaq 0x2a9cb(%rip), %rsi     # 0x1aee4e
movb $0x0, %al
callq 0x17de70
movl 0x14(%rsp), %edi
callq 0x1830b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x1844a2
jmp 0x1844ce
leaq 0x75ee7(%rip), %rax     # 0x1fa390
movl 0xa0(%rax), %eax
movl %eax, 0x4(%rsp)
movq 0x8(%rsp), %rdi
callq 0x1828c0
movl 0x4(%rsp), %ecx
leaq 0x75ec8(%rip), %rax     # 0x1fa390
movl %ecx, 0xa0(%rax)
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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:
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
movq $0x0, 0x8(%rsp)
leaq 0x75e98(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x184513
leaq 0x193cd(%rip), %rdi     # 0x19d8d2
leaq 0x2a954(%rip), %rsi     # 0x1aee60
movb $0x0, %al
callq 0x17de70
leaq 0x7b9c6(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
je 0x184539
leaq 0x7b9b8(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movl 0x10(%rax), %eax
cmpl 0x14(%rsp), %eax
jne 0x184537
jmp 0x18456d
jmp 0x184539
movl 0x14(%rsp), %edi
callq 0x1830b0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x184563
movl 0x14(%rsp), %esi
leaq 0x2a914(%rip), %rdi     # 0x1aee6e
movb $0x0, %al
callq 0x17dfa0
jmp 0x18456d
movq 0x8(%rsp), %rdi
callq 0x1838e0
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: 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 0x7b959(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq %rax, -0x10(%rsp)
leaq 0x75df9(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x1845a7
movl $0x0, -0x4(%rsp)
jmp 0x184610
jmp 0x1845a9
xorl %eax, %eax
cmpq $0x0, -0x10(%rsp)
movb %al, -0x11(%rsp)
je 0x1845cd
movq -0x10(%rsp), %rax
movzbl 0x170(%rax), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0x11(%rsp)
movb -0x11(%rsp), %al
testb $0x1, %al
jne 0x1845d7
jmp 0x1845ea
movq -0x10(%rsp), %rax
movq 0x158(%rax), %rax
movq %rax, -0x10(%rsp)
jmp 0x1845a9
cmpq $0x0, -0x10(%rsp)
je 0x184600
movq -0x10(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x18(%rsp)
jmp 0x184608
xorl %eax, %eax
movl %eax, -0x18(%rsp)
jmp 0x184608
movl -0x18(%rsp), %eax
movl %eax, -0x4(%rsp)
movl -0x4(%rsp), %eax
retq
nopw %cs:(%rax,%rax)
// File: 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 %rax
leaq 0x75d68(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x184643
leaq 0x1929d(%rip), %rdi     # 0x19d8d2
leaq 0x2a85b(%rip), %rsi     # 0x1aee97
movb $0x0, %al
callq 0x17de70
leaq 0x7b896(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x184666
leaq 0x195d2(%rip), %rdi     # 0x19dc2a
leaq 0x2a838(%rip), %rsi     # 0x1aee97
movb $0x0, %al
callq 0x17de70
leaq 0x7b7c3(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7b869(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x22b60
leaq 0x7b7a5(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
callq 0x23060
leaq 0x7b846(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movb $0x1, 0x48(%rax)
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: 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 %rax
leaq 0x75cd8(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x1846d3
leaq 0x1920d(%rip), %rdi     # 0x19d8d2
leaq 0x2a7da(%rip), %rsi     # 0x1aeea6
movb $0x0, %al
callq 0x17de70
leaq 0x7b806(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x1846f6
leaq 0x19542(%rip), %rdi     # 0x19dc2a
leaq 0x2a7b7(%rip), %rsi     # 0x1aeea6
movb $0x0, %al
callq 0x17de70
leaq 0x7b7e3(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
cmpq $0x0, 0x158(%rax)
jne 0x184735
leaq 0x7b71e(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7b7c4(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
leaq 0x7b705(%rip), %rax     # 0x1ffe30
movl 0x8(%rax), %edx
callq 0x227c0
jmp 0x184753
leaq 0x7b6f4(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7b79a(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x22fe0
leaq 0x7b6d6(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
callq 0x23060
leaq 0x7b777(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movb $0x0, 0x48(%rax)
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: 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 %rax
leaq 0x75c08(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x1847a3
leaq 0x1913d(%rip), %rdi     # 0x19d8d2
leaq 0x2a719(%rip), %rsi     # 0x1aeeb5
movb $0x0, %al
callq 0x17de70
leaq 0x7b736(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x1847c6
leaq 0x19472(%rip), %rdi     # 0x19dc2a
leaq 0x2a6f6(%rip), %rsi     # 0x1aeeb5
movb $0x0, %al
callq 0x17de70
leaq 0x7b713(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movb $0x0, 0x49(%rax)
leaq 0x7b654(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7b6fa(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
leaq 0x7b63b(%rip), %rax     # 0x1ffe30
movl 0x8(%rax), %edx
callq 0x224a0
leaq 0x7b62c(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
callq 0x23060
leaq 0x7b6cd(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movb $0x0, 0x48(%rax)
popq %rax
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutSetWindowTitle
void FGAPIENTRY glutSetWindowTitle( const char* title )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetWindowTitle" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetWindowTitle" );
    if( ! fgStructure.CurrentWindow->Parent )
    {
#if TARGET_HOST_POSIX_X11

        XTextProperty text;

        text.value = (unsigned char *) title;
        text.encoding = XA_STRING;
        text.format = 8;
        text.nitems = strlen( title );

        XSetWMName(
            fgDisplay.Display,
            fgStructure.CurrentWindow->Window.Handle,
            &text
        );

        XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */

#elif TARGET_HOST_MS_WINDOWS
#    ifdef _WIN32_WCE
        {
            wchar_t* wstr = fghWstrFromStr(title);
            SetWindowText( fgStructure.CurrentWindow->Window.Handle, wstr );
            free(wstr);
        }
#    else
        SetWindowText( fgStructure.CurrentWindow->Window.Handle, title );
#    endif

#endif
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
leaq 0x75b60(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18484b
leaq 0x19095(%rip), %rdi     # 0x19d8d2
leaq 0x2a683(%rip), %rsi     # 0x1aeec7
movb $0x0, %al
callq 0x17de70
leaq 0x7b68e(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x18486e
leaq 0x193ca(%rip), %rdi     # 0x19dc2a
leaq 0x2a660(%rip), %rsi     # 0x1aeec7
movb $0x0, %al
callq 0x17de70
leaq 0x7b66b(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
cmpq $0x0, 0x158(%rax)
jne 0x1848dc
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq $0x1f, 0x8(%rsp)
movl $0x8, 0x10(%rsp)
movq 0x20(%rsp), %rdi
callq 0x223d0
movq %rax, 0x18(%rsp)
leaq 0x7b57d(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7b623(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movq %rsp, %rdx
callq 0x22cb0
leaq 0x7b55c(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
callq 0x23060
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutSetIconTitle
void FGAPIENTRY glutSetIconTitle( const char* title )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetIconTitle" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutSetIconTitle" );

    if( ! fgStructure.CurrentWindow->Parent )
    {
#if TARGET_HOST_POSIX_X11

        XTextProperty text;

        text.value = (unsigned char *) title;
        text.encoding = XA_STRING;
        text.format = 8;
        text.nitems = strlen( title );

        XSetWMIconName(
            fgDisplay.Display,
            fgStructure.CurrentWindow->Window.Handle,
            &text
        );

        XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */

#elif TARGET_HOST_MS_WINDOWS
#    ifdef _WIN32_WCE
        {
            wchar_t* wstr = fghWstrFromStr(title);
            SetWindowText( fgStructure.CurrentWindow->Window.Handle, wstr );
            free(wstr);
        }
#    else
        SetWindowText( fgStructure.CurrentWindow->Window.Handle, title );
#    endif

#endif
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
leaq 0x75a90(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18491b
leaq 0x18fc5(%rip), %rdi     # 0x19d8d2
leaq 0x2a5c6(%rip), %rsi     # 0x1aeeda
movb $0x0, %al
callq 0x17de70
leaq 0x7b5be(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x18493e
leaq 0x192fa(%rip), %rdi     # 0x19dc2a
leaq 0x2a5a3(%rip), %rsi     # 0x1aeeda
movb $0x0, %al
callq 0x17de70
leaq 0x7b59b(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
cmpq $0x0, 0x158(%rax)
jne 0x1849ac
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq $0x1f, 0x8(%rsp)
movl $0x8, 0x10(%rsp)
movq 0x20(%rsp), %rdi
callq 0x223d0
movq %rax, 0x18(%rsp)
leaq 0x7b4ad(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7b553(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movq %rsp, %rdx
callq 0x22af0
leaq 0x7b48c(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
callq 0x23060
addq $0x28, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutReshapeWindow
void FGAPIENTRY glutReshapeWindow( int width, int height )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutReshapeWindow" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutReshapeWindow" );

    if (glutGet(GLUT_FULL_SCREEN))
    {
      /*  Leave full screen state before resizing. */
      glutFullScreenToggle();
    }

    fgStructure.CurrentWindow->State.NeedToResize = GL_TRUE;
    fgStructure.CurrentWindow->State.Width  = width ;
    fgStructure.CurrentWindow->State.Height = height;
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
movl %esi, (%rsp)
leaq 0x759c1(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x1849ea
leaq 0x18ef6(%rip), %rdi     # 0x19d8d2
leaq 0x2a508(%rip), %rsi     # 0x1aeeeb
movb $0x0, %al
callq 0x17de70
leaq 0x7b4ef(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x184a0d
leaq 0x1922b(%rip), %rdi     # 0x19dc2a
leaq 0x2a4e5(%rip), %rsi     # 0x1aeeeb
movb $0x0, %al
callq 0x17de70
movl $0x1ff, %edi            # imm = 0x1FF
callq 0x181410
cmpl $0x0, %eax
je 0x184a21
callq 0x184a60
leaq 0x7b4b8(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movb $0x1, 0x6a(%rax)
movl 0x4(%rsp), %ecx
leaq 0x7b4a5(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movl %ecx, 0x38(%rax)
movl (%rsp), %ecx
leaq 0x7b494(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movl %ecx, 0x3c(%rax)
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutFullScreenToggle
void FGAPIENTRY glutFullScreenToggle( void )
{
    SFG_Window *win;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutFullScreenToggle" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutFullScreenToggle" );

    win = fgStructure.CurrentWindow;

#if TARGET_HOST_POSIX_X11
    if(toggle_fullscreen() != -1) {
        win->State.IsFullscreen = !win->State.IsFullscreen;
    }
#elif TARGET_HOST_MS_WINDOWS
    glutFullScreen();
    win->State.IsFullscreen = !win->State.IsFullscreen;
#endif
}

// Assembly:
pushq %rax
leaq 0x75928(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x184a83
leaq 0x18e5d(%rip), %rdi     # 0x19d8d2
leaq 0x2a4c0(%rip), %rsi     # 0x1aef3c
movb $0x0, %al
callq 0x17de70
leaq 0x7b456(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x184aa6
leaq 0x19192(%rip), %rdi     # 0x19dc2a
leaq 0x2a49d(%rip), %rsi     # 0x1aef3c
movb $0x0, %al
callq 0x17de70
leaq 0x7b433(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq %rax, (%rsp)
callq 0x184ce0
cmpl $-0x1, %eax
je 0x184ada
movq (%rsp), %rax
cmpb $0x0, 0x6b(%rax)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movb %al, %cl
movq (%rsp), %rax
movb %cl, 0x6b(%rax)
popq %rax
retq
nopl (%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: glutPositionWindow
void FGAPIENTRY glutPositionWindow( int x, int y )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutPositionWindow" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutPositionWindow" );

    if (glutGet(GLUT_FULL_SCREEN))
    {
      /*  Leave full screen state before moving. */
      glutFullScreenToggle();
    }

#if TARGET_HOST_POSIX_X11

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

#elif TARGET_HOST_MS_WINDOWS

    {
        RECT winRect;

        /* "GetWindowRect" returns the pixel coordinates of the outside of the window */
        GetWindowRect( fgStructure.CurrentWindow->Window.Handle, &winRect );
        MoveWindow(
            fgStructure.CurrentWindow->Window.Handle,
            x,
            y,
            winRect.right - winRect.left,
            winRect.bottom - winRect.top,
            TRUE
        );
    }

#endif
}

// Assembly:
pushq %rax
movl %edi, 0x4(%rsp)
movl %esi, (%rsp)
leaq 0x758a1(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x184b0a
leaq 0x18dd6(%rip), %rdi     # 0x19d8d2
leaq 0x2a3fa(%rip), %rsi     # 0x1aeefd
movb $0x0, %al
callq 0x17de70
leaq 0x7b3cf(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x184b2d
leaq 0x1910b(%rip), %rdi     # 0x19dc2a
leaq 0x2a3d7(%rip), %rsi     # 0x1aeefd
movb $0x0, %al
callq 0x17de70
movl $0x1ff, %edi            # imm = 0x1FF
callq 0x181410
cmpl $0x0, %eax
je 0x184b41
callq 0x184a60
leaq 0x7b2e8(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7b38e(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
movl 0x4(%rsp), %edx
movl (%rsp), %ecx
callq 0x22830
leaq 0x7b2c3(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
callq 0x23060
popq %rax
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: toggle_fullscreen
static int toggle_fullscreen(void)
{
    /* first try the EWMH (_NET_WM_STATE) method ... */
    if(ewmh_fullscr_toggle() != -1) {
        return 0;
    }

    /* fall back to resizing the window */
    if(resize_fullscr_toogle() != -1) {
        return 0;
    }
    return -1;
}

// Assembly:
pushq %rax
callq 0x1850d0
cmpl $-0x1, %eax
je 0x184cf5
movl $0x0, 0x4(%rsp)
jmp 0x184d11
callq 0x1851d0
cmpl $-0x1, %eax
je 0x184d09
movl $0x0, 0x4(%rsp)
jmp 0x184d11
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movl 0x4(%rsp), %eax
popq %rcx
retq
nopw (%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: ewmh_fullscr_toggle
static int ewmh_fullscr_toggle(void)
{
    XEvent xev;
    long evmask = SubstructureRedirectMask | SubstructureNotifyMask;

    if(!fgDisplay.State || !fgDisplay.StateFullScreen) {
        return -1;
    }

    xev.type = ClientMessage;
    xev.xclient.window = fgStructure.CurrentWindow->Window.Handle;
    xev.xclient.message_type = fgDisplay.State;
    xev.xclient.format = 32;
    xev.xclient.data.l[0] = _NET_WM_STATE_TOGGLE;
    xev.xclient.data.l[1] = fgDisplay.StateFullScreen;
    xev.xclient.data.l[2] = 0;	/* no second property to toggle */
    xev.xclient.data.l[3] = 1;	/* source indication: application */
    xev.xclient.data.l[4] = 0;	/* unused */

    if(!XSendEvent(fgDisplay.Display, fgDisplay.RootWindow, 0, evmask, &xev)) {
        return -1;
    }
    return 0;
}

// Assembly:
subq $0xd8, %rsp
movq $0x180000, 0x8(%rsp)    # imm = 0x180000
leaq 0x7ad49(%rip), %rax     # 0x1ffe30
cmpq $0x0, 0x28(%rax)
je 0x1850fc
leaq 0x7ad3b(%rip), %rax     # 0x1ffe30
cmpq $0x0, 0x30(%rax)
jne 0x18510c
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1851b7
movl $0x21, 0x10(%rsp)
leaq 0x7adc5(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq %rax, 0x30(%rsp)
leaq 0x7ad01(%rip), %rax     # 0x1ffe30
movq 0x28(%rax), %rax
movq %rax, 0x38(%rsp)
movl $0x20, 0x40(%rsp)
movq $0x2, 0x48(%rsp)
leaq 0x7ace0(%rip), %rax     # 0x1ffe30
movq 0x30(%rax), %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x58(%rsp)
movq $0x1, 0x60(%rsp)
movq $0x0, 0x68(%rsp)
leaq 0x7acb5(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7acab(%rip), %rax     # 0x1ffe30
movq 0x10(%rax), %rsi
movq 0x8(%rsp), %rcx
xorl %edx, %edx
leaq 0x10(%rsp), %r8
callq 0x22250
cmpl $0x0, %eax
jne 0x1851ac
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
jmp 0x1851b7
movl $0x0, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: resize_fullscr_toogle
static int resize_fullscr_toogle(void)
{
    XWindowAttributes attributes;

    if(glutGet(GLUT_FULL_SCREEN)) {
        /* restore original window size */
        SFG_Window *win = fgStructure.CurrentWindow;
        fgStructure.CurrentWindow->State.NeedToResize = GL_TRUE;
        fgStructure.CurrentWindow->State.Width  = win->State.OldWidth;
        fgStructure.CurrentWindow->State.Height = win->State.OldHeight;

    } else {
        /* resize the window to cover the entire screen */
        XGetWindowAttributes(fgDisplay.Display,
                fgStructure.CurrentWindow->Window.Handle,
                &attributes);
        
        /*
         * The "x" and "y" members of "attributes" are the window's coordinates
         * relative to its parent, i.e. to the decoration window.
         */
        XMoveResizeWindow(fgDisplay.Display,
                fgStructure.CurrentWindow->Window.Handle,
                -attributes.x,
                -attributes.y,
                fgDisplay.ScreenWidth,
                fgDisplay.ScreenHeight);
    }
    return 0;
}

// Assembly:
subq $0x98, %rsp
movl $0x1ff, %edi            # imm = 0x1FF
callq 0x181410
cmpl $0x0, %eax
je 0x185233
leaq 0x7acf3(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq %rax, 0x8(%rsp)
leaq 0x7ace3(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movb $0x1, 0x6a(%rax)
movq 0x8(%rsp), %rax
movl 0x40(%rax), %ecx
leaq 0x7accc(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movl %ecx, 0x38(%rax)
movq 0x8(%rsp), %rax
movl 0x44(%rax), %ecx
leaq 0x7acb6(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movl %ecx, 0x3c(%rax)
jmp 0x185296
leaq 0x7abf6(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7ac9c(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
leaq 0x10(%rsp), %rdx
callq 0x232c0
leaq 0x7abd3(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
leaq 0x7ac79(%rip), %rax     # 0x1ffee0
movq 0x30(%rax), %rax
movq 0x18(%rax), %rsi
xorl %edx, %edx
subl 0x10(%rsp), %edx
xorl %ecx, %ecx
subl 0x14(%rsp), %ecx
leaq 0x7abae(%rip), %rax     # 0x1ffe30
movl 0x38(%rax), %r8d
leaq 0x7aba3(%rip), %rax     # 0x1ffe30
movl 0x3c(%rax), %r9d
callq 0x228a0
xorl %eax, %eax
addq $0x98, %rsp
retq
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_ext.c
// Function: glutGetProcAddress
GLUTproc FGAPIENTRY
glutGetProcAddress( const char *procName )
{
    GLUTproc p;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGetProcAddress" );

    /* Try GLUT functions first, then core GL functions */
    p = fghGetGLUTProcAddress( procName );
    return ( p != NULL ) ? p : fghGetProcAddress( procName );
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
leaq 0x750d0(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x1852db
leaq 0x18605(%rip), %rdi     # 0x19d8d2
leaq 0x29d4e(%rip), %rsi     # 0x1af022
movb $0x0, %al
callq 0x17de70
movq 0x10(%rsp), %rdi
callq 0x185320
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x1852fd
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
jmp 0x18530b
movq 0x10(%rsp), %rdi
callq 0x1852a0
movq %rax, (%rsp)
movq (%rsp), %rax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_gamemode.c
// Function: glutLeaveGameMode
void FGAPIENTRY glutLeaveGameMode( void )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutLeaveGameMode" );

    freeglut_return_if_fail( fgStructure.GameModeWindow );

    fgAddToWindowDestroyList( fgStructure.GameModeWindow );
    fgStructure.GameModeWindow = NULL;

#if TARGET_HOST_POSIX_X11

    XUngrabPointer( fgDisplay.Display, CurrentTime );
    XUngrabKeyboard( fgDisplay.Display, CurrentTime );

#endif

    fghRestoreState();
}

// Assembly:
pushq %rax
leaq 0x73438(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x186f73
leaq 0x1696d(%rip), %rdi     # 0x19d8d2
leaq 0x28431(%rip), %rsi     # 0x1af39d
movb $0x0, %al
callq 0x17de70
leaq 0x78f66(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x48(%rax)
jne 0x186f83
jmp 0x186fcd
leaq 0x78f56(%rip), %rax     # 0x1ffee0
movq 0x48(%rax), %rdi
callq 0x1828c0
leaq 0x78f46(%rip), %rax     # 0x1ffee0
movq $0x0, 0x48(%rax)
leaq 0x78e87(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22930
leaq 0x78e74(%rip), %rax     # 0x1ffe30
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x22d90
callq 0x186fd0
popq %rax
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_gamemode.c
// Function: glutGameModeGet
int FGAPIENTRY glutGameModeGet( GLenum eWhat )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGameModeGet" );

    switch( eWhat )
    {
    case GLUT_GAME_MODE_ACTIVE:
        return !!fgStructure.GameModeWindow;

    case GLUT_GAME_MODE_POSSIBLE:
        return fghChangeDisplayMode( GL_TRUE );

    case GLUT_GAME_MODE_WIDTH:
        return fgState.GameModeSize.X;

    case GLUT_GAME_MODE_HEIGHT:
        return fgState.GameModeSize.Y;

    case GLUT_GAME_MODE_PIXEL_DEPTH:
        return fgState.GameModeDepth;

    case GLUT_GAME_MODE_REFRESH_RATE:
        return fgState.GameModeRefresh;

    case GLUT_GAME_MODE_DISPLAY_CHANGED:
        /*
         * This is true if the game mode has been activated successfully..
         */
        return !!fgStructure.GameModeWindow;
    }

    fgWarning( "Unknown gamemode get: %d", eWhat );
    return -1;
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
leaq 0x733a1(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18700a
leaq 0x168d6(%rip), %rdi     # 0x19d8d2
leaq 0x283ac(%rip), %rsi     # 0x1af3af
movb $0x0, %al
callq 0x17de70
movl 0x10(%rsp), %eax
movq %rax, 0x8(%rsp)
subq $0x6, %rax
ja 0x1870d3
movq 0x8(%rsp), %rax
leaq 0x2846b(%rip), %rcx     # 0x1af494
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x78ea7(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x48(%rax)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x14(%rsp)
jmp 0x1870ed
movl $0x1, %edi
callq 0x186f30
movzbl %al, %eax
movl %eax, 0x14(%rsp)
jmp 0x1870ed
leaq 0x73320(%rip), %rax     # 0x1fa390
movl 0x88(%rax), %eax
movl %eax, 0x14(%rsp)
jmp 0x1870ed
leaq 0x7330d(%rip), %rax     # 0x1fa390
movl 0x8c(%rax), %eax
movl %eax, 0x14(%rsp)
jmp 0x1870ed
leaq 0x732fa(%rip), %rax     # 0x1fa390
movl 0x94(%rax), %eax
movl %eax, 0x14(%rsp)
jmp 0x1870ed
leaq 0x732e7(%rip), %rax     # 0x1fa390
movl 0x98(%rax), %eax
movl %eax, 0x14(%rsp)
jmp 0x1870ed
leaq 0x78e24(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x48(%rax)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, 0x14(%rsp)
jmp 0x1870ed
movl 0x10(%rsp), %esi
leaq 0x28446(%rip), %rdi     # 0x1af524
movb $0x0, %al
callq 0x17dfa0
movl $0xffffffff, 0x14(%rsp) # imm = 0xFFFFFFFF
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: fghCircleTable
static void fghCircleTable(double **sint,double **cost,const int n)
{
    int i;

    /* Table size, the sign of n flips the circle direction */

    const int size = abs(n);

    /* Determine the angle between samples */

    const double angle = 2*M_PI/(double)( ( n == 0 ) ? 1 : n );

    /* Allocate memory for n samples, plus duplicate of first entry at the end */

    *sint = (double *) calloc(sizeof(double), size+1);
    *cost = (double *) calloc(sizeof(double), size+1);

    /* Bail out if memory allocation fails, fgError never returns */

    if (!(*sint) || !(*cost))
    {
        free(*sint);
        free(*cost);
        fgError("Failed to allocate memory in fghCircleTable");
    }

    /* Compute cos and sin around the circle */

    (*sint)[0] = 0.0;
    (*cost)[0] = 1.0;

    for (i=1; i<size; i++)
    {
        (*sint)[i] = sin(angle*i);
        (*cost)[i] = cos(angle*i);
    }

    /* Last sample is duplicate of the first */

    (*sint)[size] = (*sint)[0];
    (*cost)[size] = (*cost)[0];
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movl %edx, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x24(%rsp)
jne 0x188243
movl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x18824b
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
cvtsi2sd %eax, %xmm1
movsd 0x992d(%rip), %xmm0     # 0x191b88
divsd %xmm1, %xmm0
movsd %xmm0, 0x10(%rsp)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movl $0x8, %edi
callq 0x226a0
movq %rax, %rcx
movq 0x30(%rsp), %rax
movq %rcx, (%rax)
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
movl $0x8, %edi
callq 0x226a0
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1882b9
movq 0x28(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1882e1
movq 0x30(%rsp), %rax
movq (%rax), %rdi
callq 0x22c30
movq 0x28(%rsp), %rax
movq (%rax), %rdi
callq 0x22c30
leaq 0x272be(%rip), %rdi     # 0x1af598
movb $0x0, %al
callq 0x17de70
movq 0x30(%rsp), %rax
movq (%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movsd 0x5d10(%rip), %xmm0     # 0x18e010
movsd %xmm0, (%rax)
movl $0x1, 0x20(%rsp)
movl 0x20(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jge 0x188371
movsd 0x10(%rsp), %xmm0
cvtsi2sdl 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm0
callq 0x22190
movq 0x30(%rsp), %rax
movq (%rax), %rax
movslq 0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movsd 0x10(%rsp), %xmm0
cvtsi2sdl 0x20(%rsp), %xmm1
mulsd %xmm1, %xmm0
callq 0x233b0
movq 0x28(%rsp), %rax
movq (%rax), %rax
movslq 0x20(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
jmp 0x18830c
movq 0x30(%rsp), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
movq 0x30(%rsp), %rax
movq (%rax), %rax
movslq 0x1c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movsd (%rax), %xmm0
movq 0x28(%rsp), %rax
movq (%rax), %rax
movslq 0x1c(%rsp), %rcx
movsd %xmm0, (%rax,%rcx,8)
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutWireRhombicDodecahedron
void FGAPIENTRY glutWireRhombicDodecahedron( void )
{
  int i ;

  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWireRhombicDodecahedron" );

  for ( i = 0; i < 12; i++ )
  {
    glBegin ( GL_LINE_LOOP ) ;
      glNormal3dv ( rdod_n[i] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][0]] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][1]] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][2]] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][3]] ) ;
    glEnd () ;
  }
}

// Assembly:
pushq %rax
leaq 0x6e2e8(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18c0c3
leaq 0x1181d(%rip), %rdi     # 0x19d8d2
leaq 0x23303(%rip), %rsi     # 0x1af3bf
movb $0x0, %al
callq 0x17de70
movl $0x0, 0x4(%rsp)
cmpl $0xc, 0x4(%rsp)
jge 0x18c1b4
movl $0x2, %edi
callq 0x221b0
movslq 0x4(%rsp), %rax
leaq 0x6e754(%rip), %rdi     # 0x1fa840
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x22fb0
movslq 0x4(%rsp), %rcx
leaq 0x6e9ac(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq (%rax), %rax
leaq 0x6e84b(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
movslq 0x4(%rsp), %rcx
leaq 0x6e983(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rax
leaq 0x6e821(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
movslq 0x4(%rsp), %rcx
leaq 0x6e959(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rax
leaq 0x6e7f7(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
movslq 0x4(%rsp), %rcx
leaq 0x6e92f(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0xc(%rax), %rax
leaq 0x6e7cd(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
callq 0x22de0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x18c0cb
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutSolidRhombicDodecahedron
void FGAPIENTRY glutSolidRhombicDodecahedron( void )
{
  int i ;

  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSolidRhombicDodecahedron" );

  glBegin ( GL_QUADS ) ;
  for ( i = 0; i < 12; i++ )
  {
      glNormal3dv ( rdod_n[i] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][0]] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][1]] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][2]] ) ;
      glVertex3dv ( rdod_r[rdod_v[i][3]] ) ;
  }

  glEnd () ;
}

// Assembly:
pushq %rax
leaq 0x6e1c8(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18c1e3
leaq 0x116fd(%rip), %rdi     # 0x19d8d2
leaq 0x231ff(%rip), %rsi     # 0x1af3db
movb $0x0, %al
callq 0x17de70
movl $0x7, %edi
callq 0x221b0
movl $0x0, 0x4(%rsp)
cmpl $0xc, 0x4(%rsp)
jge 0x18c2cf
movslq 0x4(%rsp), %rax
leaq 0x6e634(%rip), %rdi     # 0x1fa840
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x22fb0
movslq 0x4(%rsp), %rcx
leaq 0x6e88c(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq (%rax), %rax
leaq 0x6e72b(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
movslq 0x4(%rsp), %rcx
leaq 0x6e863(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x4(%rax), %rax
leaq 0x6e701(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
movslq 0x4(%rsp), %rcx
leaq 0x6e839(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0x8(%rax), %rax
leaq 0x6e6d7(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
movslq 0x4(%rsp), %rcx
leaq 0x6e80f(%rip), %rax     # 0x1faab0
shlq $0x4, %rcx
addq %rcx, %rax
movslq 0xc(%rax), %rax
leaq 0x6e6ad(%rip), %rdi     # 0x1fa960
imulq $0x18, %rax, %rax
addq %rax, %rdi
callq 0x221d0
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x18c1f5
callq 0x22de0
popq %rax
retq
nopw %cs:(%rax,%rax)
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_misc.c
// Function: glutExtensionSupported
int FGAPIENTRY glutExtensionSupported( const char* extension )
{
  const char *extensions, *start;
  const size_t len = strlen( extension );

  /* Make sure there is a current window, and thus a current context available */
  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutExtensionSupported" );
  freeglut_return_val_if_fail( fgStructure.CurrentWindow != NULL, 0 );

  if (strchr(extension, ' '))
    return 0;
  start = extensions = (const char *) glGetString(GL_EXTENSIONS);

  /* XXX consider printing a warning to stderr that there's no current
   * rendering context.
   */
  freeglut_return_val_if_fail( extensions != NULL, 0 );

  while (1) {
     const char *p = strstr(extensions, extension);
     if (!p)
        return 0;  /* not found */
     /* check that the match isn't a super string */
     if ((p == start || p[-1] == ' ') && (p[len] == ' ' || p[len] == 0))
        return 1;
     /* skip the false match and continue */
     extensions = p + len;
  }

  return 0 ;
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq 0x28(%rsp), %rdi
callq 0x223d0
movq %rax, 0x10(%rsp)
leaq 0x6da11(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18c99a
leaq 0x10f46(%rip), %rdi     # 0x19d8d2
leaq 0x227f0(%rip), %rsi     # 0x1af183
movb $0x0, %al
callq 0x17de70
leaq 0x7353f(%rip), %rax     # 0x1ffee0
cmpq $0x0, 0x30(%rax)
jne 0x18c9b5
movl $0x0, 0x34(%rsp)
jmp 0x18ca86
movq 0x28(%rsp), %rdi
movl $0x20, %esi
callq 0x22350
cmpq $0x0, %rax
je 0x18c9d7
movl $0x0, 0x34(%rsp)
jmp 0x18ca86
movl $0x1f03, %edi           # imm = 0x1F03
callq 0x22600
movq %rax, 0x20(%rsp)
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x20(%rsp)
jne 0x18ca00
movl $0x0, 0x34(%rsp)
jmp 0x18ca86
jmp 0x18ca02
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x221a0
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
jne 0x18ca28
movl $0x0, 0x34(%rsp)
jmp 0x18ca86
movq 0x8(%rsp), %rax
cmpq 0x18(%rsp), %rax
je 0x18ca42
movq 0x8(%rsp), %rax
movsbl -0x1(%rax), %eax
cmpl $0x20, %eax
jne 0x18ca72
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x20, %eax
je 0x18ca68
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x18ca72
movl $0x1, 0x34(%rsp)
jmp 0x18ca86
movq 0x8(%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x18ca02
movl 0x34(%rsp), %eax
addq $0x38, %rsp
retq
nop
// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_misc.c
// Function: glutReportErrors
void FGAPIENTRY glutReportErrors( void )
{
    GLenum error;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutReportErrors" );
    while( ( error = glGetError() ) != GL_NO_ERROR )
        fgWarning( "GL error: %s", fghErrorString( error ) );
}

// Assembly:
pushq %rax
leaq 0x6d8f8(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x18cab3
leaq 0x10e2d(%rip), %rdi     # 0x19d8d2
leaq 0x22880(%rip), %rsi     # 0x1af32c
movb $0x0, %al
callq 0x17de70
jmp 0x18cab5
callq 0x224c0
movl %eax, 0x4(%rsp)
cmpl $0x0, %eax
je 0x18cadf
movl 0x4(%rsp), %edi
callq 0x18caf0
movq %rax, %rsi
leaq 0x22aee(%rip), %rdi     # 0x1af5c4
movb $0x0, %al
callq 0x17dfa0
jmp 0x18cab5
popq %rax
retq
nopw %cs:(%rax,%rax)