LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 %r14
pushq %rbx
pushq %rax
leaq 0x6e4ba(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd3d21
leaq 0x158a3(%rip), %rdi     # 0xe95b6
leaq 0x2700e(%rip), %rsi     # 0xfad28
xorl %eax, %eax
callq 0xcfe73
leaq 0x72b48(%rip), %rbx     # 0x146870
movq 0x30(%rbx), %r14
testq %r14, %r14
jne 0xd3d4a
leaq 0x15bd6(%rip), %rdi     # 0xe990e
leaq 0x26fe9(%rip), %rsi     # 0xfad28
xorl %eax, %eax
callq 0xcfe73
movq 0x30(%rbx), %r14
callq 0xd3f1f
cmpb $0x0, 0x6b(%r14)
sete 0x6b(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %ebp
leaq 0x6e44d(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd3d8e
leaq 0x15836(%rip), %rdi     # 0xe95b6
leaq 0x26f62(%rip), %rsi     # 0xface9
xorl %eax, %eax
callq 0xcfe73
leaq 0x72adb(%rip), %r14     # 0x146870
cmpq $0x0, 0x30(%r14)
jne 0xd3db1
leaq 0x15b6b(%rip), %rdi     # 0xe990e
leaq 0x26f3f(%rip), %rsi     # 0xface9
xorl %eax, %eax
callq 0xcfe73
movl $0x1ff, %edi            # imm = 0x1FF
callq 0xd1dc4
testl %eax, %eax
je 0xd3dc4
callq 0xd3cfb
leaq 0x72a05(%rip), %r15     # 0x1467d0
movq (%r15), %rdi
movq 0x30(%r14), %rax
movq 0x18(%rax), %rsi
movl %ebp, %edx
movl %ebx, %ecx
callq 0x21750
movq (%r15), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21ea0
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_window.c
// Function: toggle_fullscreen
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:
pushq %r15
pushq %r14
pushq %rbx
subq $0xc0, %rsp
leaq 0x7289e(%rip), %r14     # 0x1467d0
movq 0x28(%r14), %rcx
movq 0x30(%r14), %rax
testq %rcx, %rcx
setne %dl
testq %rax, %rax
setne %sil
testb %sil, %dl
je 0xd3faa
movq %rsp, %r8
movl $0x21, (%r8)
leaq 0x72913(%rip), %rdx     # 0x146870
movq 0x30(%rdx), %rdx
movq 0x18(%rdx), %rdx
movq %rdx, 0x20(%r8)
movq %rcx, 0x28(%r8)
movl $0x20, 0x30(%r8)
movq $0x2, 0x38(%r8)
movq %rax, 0x40(%r8)
xorl %eax, %eax
movq %rax, 0x48(%r8)
movq $0x1, 0x50(%r8)
movq %rax, 0x58(%r8)
movq (%r14), %rdi
movq 0x10(%r14), %rsi
movl $0x180000, %ecx         # imm = 0x180000
xorl %edx, %edx
callq 0x21210
testl %eax, %eax
jne 0xd400f
movl $0x1ff, %edi            # imm = 0x1FF
callq 0xd1dc4
testl %eax, %eax
je 0xd3fd1
leaq 0x728b1(%rip), %rax     # 0x146870
movq 0x30(%rax), %rax
movb $0x1, 0x6a(%rax)
movq 0x40(%rax), %rcx
movq %rcx, 0x38(%rax)
jmp 0xd400f
movq (%r14), %rdi
leaq 0x72895(%rip), %r15     # 0x146870
movq 0x30(%r15), %rax
movq 0x18(%rax), %rsi
movq %rsp, %rbx
movq %rbx, %rdx
callq 0x220e0
movq (%r14), %rdi
movq 0x30(%r15), %rax
movq 0x18(%rax), %rsi
xorl %ecx, %ecx
xorl %edx, %edx
subl (%rbx), %edx
subl 0x4(%rbx), %ecx
movl 0x38(%r14), %r8d
movl 0x3c(%r14), %r9d
callq 0x217c0
addq $0xc0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
leaq 0x6c8a2(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd5939
leaq 0x13c8b(%rip), %rdi     # 0xe95b6
leaq 0x25857(%rip), %rsi     # 0xfb189
xorl %eax, %eax
callq 0xcfe73
leaq 0x70f30(%rip), %rbx     # 0x146870
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0xd5972
callq 0xd2861
movq $0x0, 0x48(%rbx)
leaq 0x70e73(%rip), %rbx     # 0x1467d0
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x21830
movq (%rbx), %rdi
xorl %esi, %esi
popq %rbx
jmp 0x21c10
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x6c83f(%rip), %r14     # 0x1421c0
cmpb $0x0, 0x1c(%r14)
jne 0xd599d
leaq 0x13c27(%rip), %rdi     # 0xe95b6
leaq 0x25805(%rip), %rsi     # 0xfb19b
xorl %eax, %eax
callq 0xcfe73
cmpl $0x6, %ebx
ja 0xd59d9
movl %ebx, %eax
leaq 0x258d5(%rip), %rcx     # 0xfb280
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x70eb5(%rip), %rax     # 0x146870
xorl %ebx, %ebx
cmpq $0x0, 0x48(%rax)
setne %bl
jmp 0xd5a00
movl 0x8c(%r14), %ebx
jmp 0xd5a00
movl 0x88(%r14), %ebx
jmp 0xd5a00
leaq 0x2590f(%rip), %rdi     # 0xfb2ef
movl %ebx, %esi
xorl %eax, %eax
callq 0x22a74
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0xd5a00
movl 0x94(%r14), %ebx
jmp 0xd5a00
movl 0x98(%r14), %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %r12d
negl %r12d
cmovsl %edx, %r12d
cmpl $0x1, %edx
adcl $0x0, %ebp
leal 0x1(%r12), %r15d
movl $0x8, %edi
movq %r15, %rsi
callq 0x21600
movq %rax, (%rbx)
movl $0x8, %edi
movq %r15, %rsi
callq 0x21600
movq %rax, (%r14)
movq (%rbx), %rdi
testq %rdi, %rdi
setne %cl
testq %rax, %rax
setne %dl
testb %cl, %dl
jne 0xd6338
callq 0x21ad0
movq (%r14), %rdi
callq 0x21ad0
leaq 0x2502d(%rip), %rdi     # 0xfb358
xorl %eax, %eax
callq 0xcfe73
movq (%rbx), %rdi
movq (%r14), %rax
movq $0x0, (%rdi)
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, (%rax)
movl %r12d, %r15d
cmpl $0x2, %r12d
jb 0xd63b0
cvtsi2sd %ebp, %xmm0
movsd 0x7a4f(%rip), %xmm1     # 0xdddb0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movl $0x1, %r12d
xorps %xmm0, %xmm0
cvtsi2sd %r12d, %xmm0
mulsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x21170
movq (%rbx), %rax
movsd %xmm0, (%rax,%r12,8)
movsd 0x8(%rsp), %xmm0
callq 0x221d0
movq (%r14), %rax
movsd %xmm0, (%rax,%r12,8)
incq %r12
cmpq %r12, %r15
jne 0xd6370
movq (%rbx), %rdi
movsd (%rdi), %xmm0
movsd %xmm0, (%rdi,%r15,8)
movsd (%rax), %xmm0
movsd %xmm0, (%rax,%r15,8)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutWireTetrahedron
void FGAPIENTRY glutWireTetrahedron( void )
{
  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWireTetrahedron" );

  glBegin( GL_LINE_LOOP ) ;
    glNormal3d ( -tet_r[0][0], -tet_r[0][1], -tet_r[0][2] ) ; glVertex3dv ( tet_r[1] ) ; glVertex3dv ( tet_r[3] ) ; glVertex3dv ( tet_r[2] ) ;
    glNormal3d ( -tet_r[1][0], -tet_r[1][1], -tet_r[1][2] ) ; glVertex3dv ( tet_r[0] ) ; glVertex3dv ( tet_r[2] ) ; glVertex3dv ( tet_r[3] ) ;
    glNormal3d ( -tet_r[2][0], -tet_r[2][1], -tet_r[2][2] ) ; glVertex3dv ( tet_r[0] ) ; glVertex3dv ( tet_r[3] ) ; glVertex3dv ( tet_r[1] ) ;
    glNormal3d ( -tet_r[3][0], -tet_r[3][1], -tet_r[3][2] ) ; glVertex3dv ( tet_r[0] ) ; glVertex3dv ( tet_r[1] ) ; glVertex3dv ( tet_r[2] ) ;
  glEnd() ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x69778(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd8a63
leaq 0x10b61(%rip), %rdi     # 0xe95b6
leaq 0x2260d(%rip), %rsi     # 0xfb069
xorl %eax, %eax
callq 0xcfe73
movl $0x2, %edi
callq 0x21190
leaq 0x6986c(%rip), %rbx     # 0x1422e0
movsd 0x69864(%rip), %xmm0    # 0x1422e0
movaps 0x1abd(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
movsd 0x6985a(%rip), %xmm1    # 0x1422e8
xorps %xmm3, %xmm1
movsd 0x69857(%rip), %xmm2    # 0x1422f0
xorps %xmm3, %xmm2
callq 0x21310
leaq 0x69850(%rip), %r14     # 0x1422f8
movq %r14, %rdi
callq 0x211b0
leaq 0x69871(%rip), %r12     # 0x142328
movq %r12, %rdi
callq 0x211b0
leaq 0x6984a(%rip), %r15     # 0x142310
movq %r15, %rdi
callq 0x211b0
movsd 0x69822(%rip), %xmm0    # 0x1422f8
movaps 0x1a63(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
movsd 0x69818(%rip), %xmm1    # 0x142300
xorps %xmm3, %xmm1
movsd 0x69815(%rip), %xmm2    # 0x142308
xorps %xmm3, %xmm2
callq 0x21310
movq %rbx, %rdi
callq 0x211b0
movq %r15, %rdi
callq 0x211b0
movq %r12, %rdi
callq 0x211b0
movsd 0x697f5(%rip), %xmm0    # 0x142310
movaps 0x1a1e(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
movsd 0x697eb(%rip), %xmm1    # 0x142318
xorps %xmm3, %xmm1
movsd 0x697e8(%rip), %xmm2    # 0x142320
xorps %xmm3, %xmm2
callq 0x21310
movq %rbx, %rdi
callq 0x211b0
movq %r12, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
movsd 0x697c8(%rip), %xmm0    # 0x142328
movaps 0x19d9(%rip), %xmm2     # 0xda540
xorps %xmm2, %xmm0
movsd 0x697be(%rip), %xmm1    # 0x142330
xorps %xmm2, %xmm1
movaps %xmm2, %xmm3
movsd 0x697b8(%rip), %xmm2    # 0x142338
xorps %xmm3, %xmm2
callq 0x21310
movq %rbx, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
movq %r15, %rdi
callq 0x211b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21c50
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutSolidTetrahedron
void FGAPIENTRY glutSolidTetrahedron( void )
{
  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSolidTetrahedron" );

  glBegin( GL_TRIANGLES ) ;
    glNormal3d ( -tet_r[0][0], -tet_r[0][1], -tet_r[0][2] ) ; glVertex3dv ( tet_r[1] ) ; glVertex3dv ( tet_r[3] ) ; glVertex3dv ( tet_r[2] ) ;
    glNormal3d ( -tet_r[1][0], -tet_r[1][1], -tet_r[1][2] ) ; glVertex3dv ( tet_r[0] ) ; glVertex3dv ( tet_r[2] ) ; glVertex3dv ( tet_r[3] ) ;
    glNormal3d ( -tet_r[2][0], -tet_r[2][1], -tet_r[2][2] ) ; glVertex3dv ( tet_r[0] ) ; glVertex3dv ( tet_r[3] ) ; glVertex3dv ( tet_r[1] ) ;
    glNormal3d ( -tet_r[3][0], -tet_r[3][1], -tet_r[3][2] ) ; glVertex3dv ( tet_r[0] ) ; glVertex3dv ( tet_r[1] ) ; glVertex3dv ( tet_r[2] ) ;
  glEnd() ;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x69601(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd8bda
leaq 0x109ea(%rip), %rdi     # 0xe95b6
leaq 0x224aa(%rip), %rsi     # 0xfb07d
xorl %eax, %eax
callq 0xcfe73
movl $0x4, %edi
callq 0x21190
leaq 0x696f5(%rip), %rbx     # 0x1422e0
movsd 0x696ed(%rip), %xmm0    # 0x1422e0
movaps 0x1946(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
movsd 0x696e3(%rip), %xmm1    # 0x1422e8
xorps %xmm3, %xmm1
movsd 0x696e0(%rip), %xmm2    # 0x1422f0
xorps %xmm3, %xmm2
callq 0x21310
leaq 0x696d9(%rip), %r14     # 0x1422f8
movq %r14, %rdi
callq 0x211b0
leaq 0x696fa(%rip), %r12     # 0x142328
movq %r12, %rdi
callq 0x211b0
leaq 0x696d3(%rip), %r15     # 0x142310
movq %r15, %rdi
callq 0x211b0
movsd 0x696ab(%rip), %xmm0    # 0x1422f8
movaps 0x18ec(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
movsd 0x696a1(%rip), %xmm1    # 0x142300
xorps %xmm3, %xmm1
movsd 0x6969e(%rip), %xmm2    # 0x142308
xorps %xmm3, %xmm2
callq 0x21310
movq %rbx, %rdi
callq 0x211b0
movq %r15, %rdi
callq 0x211b0
movq %r12, %rdi
callq 0x211b0
movsd 0x6967e(%rip), %xmm0    # 0x142310
movaps 0x18a7(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
movsd 0x69674(%rip), %xmm1    # 0x142318
xorps %xmm3, %xmm1
movsd 0x69671(%rip), %xmm2    # 0x142320
xorps %xmm3, %xmm2
callq 0x21310
movq %rbx, %rdi
callq 0x211b0
movq %r12, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
movsd 0x69651(%rip), %xmm0    # 0x142328
movaps 0x1862(%rip), %xmm2     # 0xda540
xorps %xmm2, %xmm0
movsd 0x69647(%rip), %xmm1    # 0x142330
xorps %xmm2, %xmm1
movaps %xmm2, %xmm3
movsd 0x69641(%rip), %xmm2    # 0x142338
xorps %xmm3, %xmm2
callq 0x21310
movq %rbx, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
movq %r15, %rdi
callq 0x211b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21c50
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutWireIcosahedron
void FGAPIENTRY glutWireIcosahedron( void )
{
  int i ;

  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWireIcosahedron" );

  for ( i = 0; i < 20; i++ )
  {
    double normal[3] ;
    normal[0] = ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) - ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) ;
    normal[1] = ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) - ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) ;
    normal[2] = ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) - ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) ;
    glBegin ( GL_LINE_LOOP ) ;
      glNormal3dv ( normal ) ;
      glVertex3dv ( icos_r[icos_v[i][0]] ) ;
      glVertex3dv ( icos_r[icos_v[i][1]] ) ;
      glVertex3dv ( icos_r[icos_v[i][2]] ) ;
    glEnd () ;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x69484(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd8d57
leaq 0x1086d(%rip), %rdi     # 0xe95b6
leaq 0x22342(%rip), %rsi     # 0xfb092
xorl %eax, %eax
callq 0xcfe73
movl $0x8, %r13d
leaq 0x2262c(%rip), %rbp     # 0xfb390
leaq 0x695d5(%rip), %rbx     # 0x142340
movslq -0x4(%r13,%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq (%rbx,%rax,8), %r14
movslq -0x8(%r13,%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq (%rbx,%rax,8), %r12
movslq (%r13,%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq (%rbx,%rax,8), %r15
movsd 0x8(%r15), %xmm1
movsd (%r12), %xmm2
movsd (%r14), %xmm0
subsd %xmm2, %xmm0
movupd 0x8(%r12), %xmm3
movupd 0x8(%r14), %xmm4
subpd %xmm3, %xmm4
movsd 0x10(%r15), %xmm5
movhpd (%r15), %xmm5           # xmm5 = xmm5[0],mem[0]
subsd %xmm3, %xmm1
shufpd $0x1, %xmm2, %xmm3      # xmm3 = xmm3[1],xmm2[0]
subpd %xmm3, %xmm5
movapd %xmm4, %xmm2
shufpd $0x1, %xmm0, %xmm2      # xmm2 = xmm2[1],xmm0[0]
mulsd %xmm1, %xmm0
unpcklpd %xmm5, %xmm1            # xmm1 = xmm1[0],xmm5[0]
mulpd %xmm2, %xmm1
movapd %xmm4, %xmm2
mulpd %xmm5, %xmm2
subpd %xmm1, %xmm2
movapd %xmm2, (%rsp)
unpckhpd %xmm5, %xmm5            # xmm5 = xmm5[1,1]
mulsd %xmm4, %xmm5
subsd %xmm5, %xmm0
movsd %xmm0, 0x10(%rsp)
movl $0x2, %edi
callq 0x21190
movq %rsp, %rdi
callq 0x21e00
movq %r12, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
movq %r15, %rdi
callq 0x211b0
callq 0x21c50
addq $0xc, %r13
cmpq $0xf8, %r13
jne 0xd8d6b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutSolidIcosahedron
void FGAPIENTRY glutSolidIcosahedron( void )
{
  int i ;

  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSolidIcosahedron" );

  glBegin ( GL_TRIANGLES ) ;
  for ( i = 0; i < 20; i++ )
  {
    double normal[3] ;
    normal[0] = ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) - ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) ;
    normal[1] = ( icos_r[icos_v[i][1]][2] - icos_r[icos_v[i][0]][2] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) - ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][2] - icos_r[icos_v[i][0]][2] ) ;
    normal[2] = ( icos_r[icos_v[i][1]][0] - icos_r[icos_v[i][0]][0] ) * ( icos_r[icos_v[i][2]][1] - icos_r[icos_v[i][0]][1] ) - ( icos_r[icos_v[i][1]][1] - icos_r[icos_v[i][0]][1] ) * ( icos_r[icos_v[i][2]][0] - icos_r[icos_v[i][0]][0] ) ;
      glNormal3dv ( normal ) ;
      glVertex3dv ( icos_r[icos_v[i][0]] ) ;
      glVertex3dv ( icos_r[icos_v[i][1]] ) ;
      glVertex3dv ( icos_r[icos_v[i][2]] ) ;
  }

  glEnd () ;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x69354(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd8e87
leaq 0x1073d(%rip), %rdi     # 0xe95b6
leaq 0x22226(%rip), %rsi     # 0xfb0a6
xorl %eax, %eax
callq 0xcfe73
movl $0x4, %edi
callq 0x21190
movl $0x8, %r13d
leaq 0x224f2(%rip), %rbp     # 0xfb390
leaq 0x6949b(%rip), %rbx     # 0x142340
movslq -0x4(%r13,%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq (%rbx,%rax,8), %r14
movslq -0x8(%r13,%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq (%rbx,%rax,8), %r12
movslq (%r13,%rbp), %rax
leaq (%rax,%rax,2), %rax
leaq (%rbx,%rax,8), %r15
movsd 0x8(%r15), %xmm1
movsd (%r12), %xmm2
movsd (%r14), %xmm0
subsd %xmm2, %xmm0
movupd 0x8(%r12), %xmm3
movupd 0x8(%r14), %xmm4
subpd %xmm3, %xmm4
movsd 0x10(%r15), %xmm5
movhpd (%r15), %xmm5           # xmm5 = xmm5[0],mem[0]
subsd %xmm3, %xmm1
shufpd $0x1, %xmm2, %xmm3      # xmm3 = xmm3[1],xmm2[0]
subpd %xmm3, %xmm5
movapd %xmm4, %xmm2
shufpd $0x1, %xmm0, %xmm2      # xmm2 = xmm2[1],xmm0[0]
mulsd %xmm1, %xmm0
unpcklpd %xmm5, %xmm1            # xmm1 = xmm1[0],xmm5[0]
mulpd %xmm2, %xmm1
movapd %xmm4, %xmm2
mulpd %xmm5, %xmm2
subpd %xmm1, %xmm2
movapd %xmm2, (%rsp)
unpckhpd %xmm5, %xmm5            # xmm5 = xmm5[1,1]
mulsd %xmm4, %xmm5
subsd %xmm5, %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rsp, %rdi
callq 0x21e00
movq %r12, %rdi
callq 0x211b0
movq %r14, %rdi
callq 0x211b0
movq %r15, %rdi
callq 0x211b0
addq $0xc, %r13
cmpq $0xf8, %r13
jne 0xd8ea5
callq 0x21c50
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x6922a(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd8fb1
leaq 0x10613(%rip), %rdi     # 0xe95b6
leaq 0x22201(%rip), %rsi     # 0xfb1ab
xorl %eax, %eax
callq 0xcfe73
movl $0xc, %r14d
leaq 0x694a2(%rip), %rbx     # 0x142460
leaq 0x224bb(%rip), %r15     # 0xfb480
leaq 0x695b4(%rip), %r12     # 0x142580
movl $0x2, %edi
callq 0x21190
movq %rbx, %rdi
callq 0x21e00
movslq -0xc(%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
movslq -0x8(%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
movslq -0x4(%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
movslq (%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
callq 0x21c50
addq $0x10, %r14
addq $0x18, %rbx
cmpq $0xcc, %r14
jne 0xd8fcc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x6916a(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd9071
leaq 0x10553(%rip), %rdi     # 0xe95b6
leaq 0x2215d(%rip), %rsi     # 0xfb1c7
xorl %eax, %eax
callq 0xcfe73
movl $0x7, %edi
callq 0x21190
movl $0xc, %r14d
leaq 0x693d8(%rip), %rbx     # 0x142460
leaq 0x223f1(%rip), %r15     # 0xfb480
leaq 0x694ea(%rip), %r12     # 0x142580
movq %rbx, %rdi
callq 0x21e00
movslq -0xc(%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
movslq -0x8(%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
movslq -0x4(%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
movslq (%r14,%r15), %rax
leaq (%rax,%rax,2), %rax
leaq (%r12,%rax,8), %rdi
callq 0x211b0
addq $0x10, %r14
addq $0x18, %rbx
cmpq $0xcc, %r14
jne 0xd9096
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x21c50
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutWireSierpinskiSponge
void FGAPIENTRY glutWireSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale )
{
  int i, j ;

  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWireSierpinskiSponge" );

  if ( num_levels == 0 )
  {

    for ( i = 0 ; i < NUM_TETR_FACES ; i++ )
    {
      glBegin ( GL_LINE_LOOP ) ;
      glNormal3d ( -tet_r[i][0], -tet_r[i][1], -tet_r[i][2] ) ;
      for ( j = 0; j < 3; j++ )
      {
        double x = offset[0] + scale * tet_r[tet_i[i][j]][0] ;
        double y = offset[1] + scale * tet_r[tet_i[i][j]][1] ;
        double z = offset[2] + scale * tet_r[tet_i[i][j]][2] ;
        glVertex3d ( x, y, z ) ;
      }

      glEnd () ;
    }
  }
  else if ( num_levels > 0 )
  {
    GLdouble local_offset[3] ;  /* Use a local variable to avoid buildup of roundoff errors */
    num_levels -- ;
    scale /= 2.0 ;
    for ( i = 0 ; i < NUM_TETR_FACES ; i++ )
    {
      local_offset[0] = offset[0] + scale * tet_r[i][0] ;
      local_offset[1] = offset[1] + scale * tet_r[i][1] ;
      local_offset[2] = offset[2] + scale * tet_r[i][2] ;
      glutWireSierpinskiSponge ( num_levels, local_offset, scale ) ;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movapd %xmm0, (%rsp)
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x6909b(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd9140
leaq 0x10484(%rip), %rdi     # 0xe95b6
leaq 0x220ab(%rip), %rsi     # 0xfb1e4
xorl %eax, %eax
callq 0xcfe73
testl %ebp, %ebp
je 0xd91d0
jle 0xd927a
decl %ebp
movapd (%rsp), %xmm0
mulsd 0xec3(%rip), %xmm0      # 0xda020
movapd %xmm0, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movapd %xmm1, 0x10(%rsp)
movl $0x10, %r15d
leaq 0x69168(%rip), %r12     # 0x1422e0
leaq 0x20(%rsp), %r14
movapd %xmm0, (%rsp)
movupd (%rbx), %xmm2
movupd -0x10(%r15,%r12), %xmm1
mulpd 0x10(%rsp), %xmm1
addpd %xmm2, %xmm1
movapd %xmm1, 0x20(%rsp)
movsd (%r15,%r12), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rbx), %xmm1
movsd %xmm1, 0x30(%rsp)
movl %ebp, %edi
movq %r14, %rsi
callq 0xd9106
movapd (%rsp), %xmm0
addq $0x18, %r15
cmpq $0x70, %r15
jne 0xd9182
jmp 0xd927a
leaq 0x22369(%rip), %r14     # 0xfb540
xorl %r15d, %r15d
leaq 0x690ff(%rip), %r12     # 0x1422e0
movl $0x2, %edi
callq 0x21190
leaq (%r15,%r15,2), %rax
movsd (%r12,%rax,8), %xmm0
movsd 0x8(%r12,%rax,8), %xmm1
movsd 0x10(%r12,%rax,8), %xmm2
movaps 0x1336(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
xorps %xmm3, %xmm1
xorps %xmm3, %xmm2
callq 0x21310
xorl %r13d, %r13d
movslq (%r14,%r13,4), %rax
leaq (%rax,%rax,2), %rax
movsd (%r12,%rax,8), %xmm0
movapd (%rsp), %xmm3
mulsd %xmm3, %xmm0
addsd (%rbx), %xmm0
movsd 0x8(%r12,%rax,8), %xmm1
mulsd %xmm3, %xmm1
addsd 0x8(%rbx), %xmm1
movsd 0x10(%r12,%rax,8), %xmm2
mulsd %xmm3, %xmm2
addsd 0x10(%rbx), %xmm2
callq 0x21e60
incq %r13
cmpq $0x3, %r13
jne 0xd921b
callq 0x21c50
incq %r15
addq $0xc, %r14
cmpq $0x4, %r15
jne 0xd91e1
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_geometry.c
// Function: glutSolidSierpinskiSponge
void FGAPIENTRY glutSolidSierpinskiSponge ( int num_levels, GLdouble offset[3], GLdouble scale )
{
  int i, j ;

  FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSolidSierpinskiSponge" );

  if ( num_levels == 0 )
  {
    glBegin ( GL_TRIANGLES ) ;

    for ( i = 0 ; i < NUM_TETR_FACES ; i++ )
    {
      glNormal3d ( -tet_r[i][0], -tet_r[i][1], -tet_r[i][2] ) ;
      for ( j = 0; j < 3; j++ )
      {
        double x = offset[0] + scale * tet_r[tet_i[i][j]][0] ;
        double y = offset[1] + scale * tet_r[tet_i[i][j]][1] ;
        double z = offset[2] + scale * tet_r[tet_i[i][j]][2] ;
        glVertex3d ( x, y, z ) ;
      }
    }

    glEnd () ;
  }
  else if ( num_levels > 0 )
  {
    GLdouble local_offset[3] ;  /* Use a local variable to avoid buildup of roundoff errors */
    num_levels -- ;
    scale /= 2.0 ;
    for ( i = 0 ; i < NUM_TETR_FACES ; i++ )
    {
      local_offset[0] = offset[0] + scale * tet_r[i][0] ;
      local_offset[1] = offset[1] + scale * tet_r[i][1] ;
      local_offset[2] = offset[2] + scale * tet_r[i][2] ;
      glutSolidSierpinskiSponge ( num_levels, local_offset, scale ) ;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x68f1d(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
movapd %xmm0, (%rsp)
jne 0xd92c8
leaq 0x10301(%rip), %rdi     # 0xe95b6
leaq 0x21f41(%rip), %rsi     # 0xfb1fd
xorl %eax, %eax
callq 0xcfe73
movapd (%rsp), %xmm0
testl %ebp, %ebp
je 0xd9359
jle 0xd934a
decl %ebp
mulsd 0xd44(%rip), %xmm0      # 0xda020
movapd %xmm0, %xmm1
unpcklpd %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
movapd %xmm1, 0x10(%rsp)
movl $0x10, %r15d
leaq 0x68fe9(%rip), %r12     # 0x1422e0
leaq 0x20(%rsp), %r14
movapd %xmm0, (%rsp)
movupd (%rbx), %xmm2
movupd -0x10(%r15,%r12), %xmm1
mulpd 0x10(%rsp), %xmm1
addpd %xmm2, %xmm1
movapd %xmm1, 0x20(%rsp)
movsd (%r15,%r12), %xmm1
mulsd %xmm0, %xmm1
addsd 0x10(%rbx), %xmm1
movsd %xmm1, 0x30(%rsp)
movl %ebp, %edi
movq %r14, %rsi
callq 0xd9289
movapd (%rsp), %xmm0
addq $0x18, %r15
cmpq $0x70, %r15
jne 0xd9301
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x4, %edi
callq 0x21190
leaq 0x221d6(%rip), %r14     # 0xfb540
xorl %r15d, %r15d
leaq 0x68f6c(%rip), %r12     # 0x1422e0
leaq (%r15,%r15,2), %rax
movsd (%r12,%rax,8), %xmm0
movsd 0x8(%r12,%rax,8), %xmm1
movsd 0x10(%r12,%rax,8), %xmm2
movaps 0x11ad(%rip), %xmm3     # 0xda540
xorps %xmm3, %xmm0
xorps %xmm3, %xmm1
xorps %xmm3, %xmm2
callq 0x21310
xorl %r13d, %r13d
movslq (%r14,%r13,4), %rax
leaq (%rax,%rax,2), %rax
movsd (%r12,%rax,8), %xmm0
movapd (%rsp), %xmm3
mulsd %xmm3, %xmm0
addsd (%rbx), %xmm0
movsd 0x8(%r12,%rax,8), %xmm1
mulsd %xmm3, %xmm1
addsd 0x8(%rbx), %xmm1
movsd 0x10(%r12,%rax,8), %xmm2
mulsd %xmm3, %xmm2
addsd 0x10(%rbx), %xmm2
callq 0x21e60
incq %r13
cmpq $0x3, %r13
jne 0xd93a4
incq %r15
addq $0xc, %r14
cmpq $0x4, %r15
jne 0xd9374
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21c50
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x21380
movq %rax, %r14
leaq 0x68d93(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd9448
leaq 0x1017c(%rip), %rdi     # 0xe95b6
leaq 0x21b2e(%rip), %rsi     # 0xfaf6f
xorl %eax, %eax
callq 0xcfe73
leaq 0x6d421(%rip), %rax     # 0x146870
xorl %ebp, %ebp
cmpq $0x0, 0x30(%rax)
je 0xd946a
movq %rbx, %rdi
movl $0x20, %esi
callq 0x21330
testq %rax, %rax
je 0xd9477
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1f03, %edi           # imm = 0x1F03
callq 0x21570
testq %rax, %rax
je 0xd946a
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21180
testq %rax, %rax
je 0xd946a
cmpq %r15, %rax
je 0xd94a4
cmpb $0x20, -0x1(%rax)
jne 0xd94ae
movzbl (%rax,%r14), %ecx
testb $-0x21, %cl
je 0xd94b6
addq %r14, %rax
movq %rax, %rdi
jmp 0xd948c
movl $0x1, %ebp
jmp 0xd946a
// File: /workspace/github_cpp_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x68cf1(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd94ea
leaq 0x100da(%rip), %rdi     # 0xe95b6
leaq 0x21c35(%rip), %rsi     # 0xfb118
xorl %eax, %eax
callq 0xcfe73
leaq 0x220ca(%rip), %r14     # 0xfb5bb
leaq 0x22078(%rip), %r15     # 0xfb570
leaq 0x2215b(%rip), %r12     # 0xfb65a
leaq 0x22086(%rip), %rbx     # 0xfb58c
leaq 0x2210d(%rip), %r13     # 0xfb61a
leaq 0x22134(%rip), %rbp     # 0xfb648
callq 0x21440
cmpl $0x8030, %eax           # imm = 0x8030
jg 0xd9540
leal -0x500(%rax), %ecx
cmpl $0x6, %ecx
ja 0xd9585
movslq (%r15,%rcx,4), %rax
addq %r15, %rax
movq %r14, %rsi
jmpq *%rax
leaq 0x2208f(%rip), %rsi     # 0xfb5cd
jmp 0xd958c
cmpl $0x8031, %eax           # imm = 0x8031
je 0xd956e
cmpl $0x8065, %eax           # imm = 0x8065
jne 0xd9589
movq %rbp, %rsi
jmp 0xd958c
leaq 0x220a2(%rip), %rsi     # 0xfb5fc
jmp 0xd958c
leaq 0x22078(%rip), %rsi     # 0xfb5db
jmp 0xd958c
leaq 0x22081(%rip), %rsi     # 0xfb5ed
jmp 0xd958c
movq %r13, %rsi
jmp 0xd958c
leaq 0x22092(%rip), %rsi     # 0xfb60c
jmp 0xd958c
leaq 0x220a7(%rip), %rsi     # 0xfb62a
jmp 0xd958c
testl %eax, %eax
je 0xd959b
movq %r12, %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x22a74
jmp 0xd9514
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_misc.c
// Function: glutSetKeyRepeat
void FGAPIENTRY glutSetKeyRepeat( int repeatMode )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetKeyRepeat" );

    switch( repeatMode )
    {
    case GLUT_KEY_REPEAT_OFF:
    case GLUT_KEY_REPEAT_ON:
     fgState.KeyRepeat = repeatMode;
     break;

    case GLUT_KEY_REPEAT_DEFAULT:
     fgState.KeyRepeat = GLUT_KEY_REPEAT_ON;
     break;

    default:
        fgError ("Invalid glutSetKeyRepeat mode: %d", repeatMode);
        break;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x68baa(%rip), %r14     # 0x1421c0
cmpb $0x0, 0x1c(%r14)
jne 0xd9632
leaq 0xff92(%rip), %rdi      # 0xe95b6
leaq 0x21b12(%rip), %rsi     # 0xfb13d
xorl %eax, %eax
callq 0xcfe73
cmpl $0x2, %ebx
jae 0xd963d
movl %ebx, 0x28(%r14)
jmp 0xd9647
jne 0xd964f
movl $0x1, 0x28(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x21f43(%rip), %rdi     # 0xfb599
movl %ebx, %esi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xcfe73
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_misc.c
// Function: glutForceJoystickFunc
void FGAPIENTRY glutForceJoystickFunc( void )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutForceJoystickFunc" );
#if !defined(_WIN32_WCE)
    freeglut_return_if_fail( fgStructure.CurrentWindow != NULL );
    freeglut_return_if_fail( FETCH_WCB( *( fgStructure.CurrentWindow ), Joystick ) );
    fgJoystickPollWindow( fgStructure.CurrentWindow );
#endif /* !defined(_WIN32_WCE) */
}

// Assembly:
pushq %rax
leaq 0x68b52(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd9689
leaq 0xff3b(%rip), %rdi      # 0xe95b6
leaq 0x21acc(%rip), %rsi     # 0xfb14e
xorl %eax, %eax
callq 0xcfe73
leaq 0x6d1e0(%rip), %rax     # 0x146870
movq 0x30(%rax), %rdi
testq %rdi, %rdi
je 0xd96a9
cmpq $0x0, 0xd8(%rdi)
je 0xd96a9
popq %rax
jmp 0xcf50c
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_cursor.c
// Function: glutWarpPointer
void FGAPIENTRY glutWarpPointer( int x, int y )
{
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutWarpPointer" );
    FREEGLUT_EXIT_IF_NO_WINDOW ( "glutWarpPointer" );

#if TARGET_HOST_POSIX_X11

    XWarpPointer(
        fgDisplay.Display,
        None,
        fgStructure.CurrentWindow->Window.Handle,
        0, 0, 0, 0,
        x, y
    );
    /* Make the warp visible immediately. */
    XFlush( fgDisplay.Display );

#elif TARGET_HOST_MS_WINDOWS

    {
        POINT coords;
        coords.x = x;
        coords.y = y;

        /* ClientToScreen() translates {coords} for us. */
        ClientToScreen( fgStructure.CurrentWindow->Window.Handle, &coords );
        SetCursorPos( coords.x, coords.y );
    }

#endif
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movl %edi, %ebx
leaq 0x68487(%rip), %rax     # 0x1421c0
cmpb $0x0, 0x1c(%rax)
jne 0xd9d54
leaq 0xf870(%rip), %rdi      # 0xe95b6
leaq 0x2115b(%rip), %rsi     # 0xfaea8
xorl %eax, %eax
callq 0xcfe73
leaq 0x6cb15(%rip), %r15     # 0x146870
movq 0x30(%r15), %rax
testq %rax, %rax
jne 0xd9d7d
leaq 0xfba3(%rip), %rdi      # 0xe990e
leaq 0x21136(%rip), %rsi     # 0xfaea8
xorl %eax, %eax
callq 0xcfe73
movq 0x30(%r15), %rax
leaq 0x6ca4c(%rip), %r15     # 0x1467d0
movq (%r15), %rdi
movq 0x18(%rax), %rdx
subq $0x8, %rsp
xorl %esi, %esi
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r14
pushq %rbx
pushq $0x0
callq 0x21e50
addq $0x20, %rsp
movq (%r15), %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x21ea0
// File: /workspace/github_cpp_makefile_star2_O3/AbraaoHonorio[P]Page-Replacement-Algorithms/PageReplacement.cpp
// Function: findIndex(std::vector<int, std::allocator<int>>, std::vector<int, std::allocator<int>>, int)
int findIndex(std::vector<int> myQueue, std::vector<int> myPages, int nPages)
{
	int index = 0;


	// erase the first nPages elements
	myPages.erase(myPages.begin(), myPages.begin() + nPages);

	// initialize an vector Priority with 1000
	std::vector<int> arrayPriority(myQueue.size(),1000);

	if (!myPages.empty())
	{
		for (unsigned int i = 0; i < myQueue.size(); i++)
		{
			for (unsigned int j = 0; j < myPages.size(); j++)
			{
				if (myQueue[i] == myPages[j])
				{
					arrayPriority[i] = j;
					break;
				}

			}
		}
		/*					DEBUG                             */
		/*std::cout << "\n ***  arrayPriority *** " << std::endl; //DEBUG
		for each (int element in arrayPriority)
		{
		std::cout << index << " *** " << element << " " << std::endl; //DEBUG
		}*/


		/* return o index with highest priority*/
		int winner = arrayPriority[0];
		for (unsigned int i = 0; i < arrayPriority.size(); i++)
		{
			if (winner < arrayPriority[i])
			{
				winner = arrayPriority[i];
				index = i;
			}
		}
	}


	return (index);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
testl %edx, %edx
je 0x1633
movq (%r14), %r15
movslq %edx, %rax
leaq (%r15,%rax,4), %r12
movq 0x8(%r14), %rdx
subq %r12, %rdx
je 0x161e
movq %r15, %rdi
movq %r12, %rsi
callq 0x1150
movq 0x8(%r14), %rax
movq %rax, %rcx
jmp 0x1624
movq %r12, %rax
movq %r12, %rcx
subq %r12, %rax
addq %rax, %r15
cmpq %r15, %rcx
je 0x1633
movq %r15, 0x8(%r14)
movq 0x8(%rbx), %rsi
subq (%rbx), %rsi
sarq $0x2, %rsi
leaq 0xc(%rsp), %rdx
movl $0x3e8, (%rdx)          # imm = 0x3E8
leaq 0x10(%rsp), %r15
leaq 0xb(%rsp), %rcx
movq %r15, %rdi
callq 0x1cbe
movq (%r14), %rax
movq 0x8(%r14), %rcx
movq (%r15), %rdi
cmpq %rcx, %rax
je 0x16db
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
subq %rdx, %rsi
je 0x16b0
sarq $0x2, %rsi
subq %rax, %rcx
sarq $0x2, %rcx
xorl %r8d, %r8d
movl (%rdx,%r8,4), %r9d
xorl %r11d, %r11d
xorl %r10d, %r10d
cmpl (%rax,%r11,4), %r9d
je 0x16a1
incl %r10d
movq %r10, %r11
cmpq %r10, %rcx
ja 0x168e
jmp 0x16a5
movl %r10d, (%rdi,%r8,4)
incq %r8
movl %r8d, %r9d
cmpq %r9, %rsi
ja 0x1684
movq 0x18(%rsp), %rax
subq %rdi, %rax
je 0x16db
sarq $0x2, %rax
movl (%rdi), %ecx
xorl %edx, %edx
xorl %ebx, %ebx
movl (%rdi,%rdx,4), %esi
cmpl %esi, %ecx
cmovll %edx, %ebx
cmovlel %esi, %ecx
incq %rdx
movl %edx, %esi
cmpq %rsi, %rax
ja 0x16c4
jmp 0x16e2
xorl %ebx, %ebx
testq %rdi, %rdi
je 0x16e7
callq 0x10f0
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/AbraaoHonorio[P]Page-Replacement-Algorithms/PageReplacement.cpp
// Function: PageReplacement::readFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void PageReplacement::readFile(std::string filename)
{

	std::ifstream myfile(filename);
	int element = 0;


	if (myfile.is_open())
	{
		myfile >> element; // get first value
		sizeRam_m = element;

		while (myfile >> element) // read the referenced strings
		{
			myPages.push_back(element);
		}
	}
	else
	{
		std::cout << "Unable to open file" << std::endl;
	}

	myfile.close();


}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
leaq 0x10(%rsp), %rdi
movl $0x8, %edx
callq 0x1140
movl $0x0, 0xc(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x1050
testb %al, %al
je 0x1c3e
leaq 0x10(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x1090
leaq 0xc(%rsp), %r14
movl (%r14), %eax
movl %eax, 0xc(%rbx)
leaq 0x28(%rbx), %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x1090
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1c84
movq 0x30(%rbx), %rsi
cmpq 0x38(%rbx), %rsi
je 0x1c31
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x30(%rbx)
jmp 0x1bfe
movq %r15, %rdi
movq %r14, %rdx
callq 0x1fda
jmp 0x1bfe
movq 0x3393(%rip), %rbx      # 0x4fd8
leaq 0x1435(%rip), %rsi      # 0x3081
movl $0x13, %edx
movq %rbx, %rdi
callq 0x1120
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq 0x3361(%rip), %rdi      # 0x4fd8
callq 0x1030
movq %rax, %rdi
callq 0x10a0
leaq 0x10(%rsp), %rdi
callq 0x1040
leaq 0x10(%rsp), %rdi
callq 0x1060
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x1ca9
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x1060
movq %rbx, %rdi
callq 0x1170
// File: /workspace/github_cpp_makefile_star2_O3/AbraaoHonorio[P]Page-Replacement-Algorithms/main.cpp
// Function: main
int main(void)
{
	PageReplacement *pageReplacement = new PageReplacement();

	pageReplacement->readFile("input/input.txt"); 
	pageReplacement->fifo();
	pageReplacement->otm();
	pageReplacement->lru();


	std::cout<<std::endl;
	delete pageReplacement;


	return 0;

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl $0x40, %edi
callq 0x1110
movq %rax, %rbx
movq %rax, %rdi
callq 0x12ec
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0xfb4(%rip), %rsi       # 0x30f2
leaq 0xfbc(%rip), %rdx       # 0x3101
movq %rsp, %r14
movq %r14, %rdi
callq 0x21e6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ba2
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2169
callq 0x10f0
movq %rbx, %rdi
callq 0x1368
movq %rbx, %rdi
callq 0x16f6
movq %rbx, %rdi
callq 0x194a
movq 0x2e50(%rip), %r14      # 0x4fd8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x1100
movsbl %al, %esi
movq %r14, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x10a0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
jne 0x21d8
jmp 0x21dd
movq %rax, %r14
movq %rbx, %rdi
callq 0x10f0
movq %r14, %rdi
callq 0x1170
nop
// File: /workspace/github_cpp_makefile_star2_O3/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: LMF_IO::write_times(MyFILE*, long, long)
void LMF_IO::write_times(MyFILE * out_file,time_t _Starttime,time_t _Stoptime) {
	unsigned __int32 dummy;
	if (CTime_version_output > 2003) {
		dummy = INT_MIN_+10; *out_file << dummy;
		dummy = (unsigned __int32)_Starttime; *out_file << dummy;
		dummy =0;			*out_file << dummy;
		dummy =INT_MIN_+10;	*out_file << dummy;
		dummy = (unsigned __int32)_Stoptime;	*out_file << dummy;
		dummy = 0;			*out_file << dummy;
	} else {
		dummy = (unsigned __int32)_Starttime;	*out_file << dummy;
		dummy = (unsigned __int32)_Stoptime;	*out_file << dummy;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rbx
cmpl $0x7d4, 0x278(%rdi)     # imm = 0x7D4
jl 0x23d4
movq %rbx, %rdi
movl $0x8000000a, %esi       # imm = 0x8000000A
callq 0x13378
movq %rbx, %rdi
movl %r15d, %esi
callq 0x13378
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x13378
movq %rbx, %rdi
movl $0x8000000a, %esi       # imm = 0x8000000A
callq 0x13378
movq %rbx, %rdi
movl %r14d, %esi
callq 0x13378
jmp 0x23e2
movq %rbx, %rdi
movl %r15d, %esi
callq 0x13378
movl %r14d, %ebp
movq %rbx, %rdi
movl %ebp, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x13378
// File: /workspace/github_cpp_makefile_star2_O3/NichtJens[P]lmf2txt/LMF_IO.cpp
// Function: ReadCStringLength(MyFILE&)
unsigned __int32 ReadCStringLength(MyFILE &in_file)
{
	unsigned __int64 qwLength;
	unsigned __int32 dwLength;
	unsigned __int16 wLength;
	unsigned __int8  bLength;

//	__int32 nCharSize = sizeof(__int8);

	// First, try to read a one-byte length
	in_file >> bLength;

	if (bLength < 0xff) 
		return bLength;

	// Try a two-byte length
	in_file >> wLength;
	if (wLength == 0xfffe)
	{
//		// Unicode string.  Start over at 1-byte length
//		nCharSize = sizeof(wchar_t);

		in_file >> bLength;
		if (bLength < 0xff)
			return bLength;

		// Two-byte length
		in_file >> wLength;
		// Fall through to continue on same branch as ANSI string
	}
	if (wLength < 0xffff)
		return wLength;

	// 4-byte length
	in_file >> dwLength;
	if (dwLength < 0xffffffff)
		return dwLength;

	// 8-byte length
	in_file >> qwLength;

	return (unsigned __int32)qwLength;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x9(%rsp), %r14
movq %r14, %rsi
movl $0x1, %edx
callq 0x133bc
movzbl (%r14), %eax
cmpl $0xff, %eax
jne 0x24b9
leaq 0xa(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x133bc
movzwl (%r14), %eax
cmpw $-0x2, %ax
jne 0x2479
leaq 0x9(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0x133bc
movzbl (%r14), %eax
cmpl $0xff, %eax
jne 0x24b9
leaq 0xa(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x2, %edx
callq 0x133bc
movzwl (%r14), %eax
cmpw $-0x1, %ax
je 0x2484
movzwl %ax, %eax
jmp 0x24b9
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x4, %edx
callq 0x133bc
movl (%r14), %eax
cmpl $-0x1, %eax
jne 0x24b9
leaq 0x10(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x133bc
movl (%r14), %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq