LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_display.c
// Function: glutPostWindowRedisplay
void FGAPIENTRY glutPostWindowRedisplay( int windowID )
{
    SFG_Window* window;

    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutPostWindowRedisplay" );
    window = fgWindowByID( windowID );
    freeglut_return_if_fail( window );
    window->State.Redisplay = GL_TRUE;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
leaq 0x7a908(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb88f3
leaq 0x1b981(%rip), %rdi     # 0xd4266
leaq 0x1bd50(%rip), %rsi     # 0xd463c
xorl %eax, %eax
callq 0xbad73
movl %ebx, %edi
callq 0xbdaf3
testq %rax, %rax
je 0xb8903
movb $0x1, 0x48(%rax)
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutBitmapCharacter
void FGAPIENTRY glutBitmapCharacter( void* fontID, int character )
{
    const GLubyte* face;
    SFG_Font* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutBitmapCharacter" );
    font = fghFontByID( fontID );
    freeglut_return_if_fail( ( character >= 1 )&&( character < 256 ) );
    freeglut_return_if_fail( font );

    /*
     * Find the character we want to draw (???)
     */
    face = font->Characters[ character ];

    glPushClientAttrib( GL_CLIENT_PIXEL_STORE_BIT );
    glPixelStorei( GL_UNPACK_SWAP_BYTES,  GL_FALSE );
    glPixelStorei( GL_UNPACK_LSB_FIRST,   GL_FALSE );
    glPixelStorei( GL_UNPACK_ROW_LENGTH,  0        );
    glPixelStorei( GL_UNPACK_SKIP_ROWS,   0        );
    glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0        );
    glPixelStorei( GL_UNPACK_ALIGNMENT,   1        );
    glBitmap(
        face[ 0 ], font->Height,      /* The bitmap's width and height  */
        font->xorig, font->yorig,     /* The origin in the font glyph   */
        ( float )( face[ 0 ] ), 0.0,  /* The raster advance -- inc. x,y */
        ( face + 1 )                  /* The packed bitmap data...      */
    );
    glPopClientAttrib( );
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x7a8c8(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8933
leaq 0x1b941(%rip), %rdi     # 0xd4266
leaq 0x1bd28(%rip), %rsi     # 0xd4654
xorl %eax, %eax
callq 0xbad73
movq %r14, %rdi
callq 0xb89e5
movq %rax, %r14
leal -0x100(%rbx), %eax
cmpl $0xffffff01, %eax       # imm = 0xFFFFFF01
setb %al
testq %r14, %r14
sete %cl
orb %al, %cl
je 0xb895b
popq %rbx
popq %r14
popq %rbp
retq
movq 0x10(%r14), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rbx
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0x21620
movl $0xcf0, %edi            # imm = 0xCF0
xorl %esi, %esi
callq 0x21420
movl $0xcf1, %edi            # imm = 0xCF1
xorl %esi, %esi
callq 0x21420
movl $0xcf2, %edi            # imm = 0xCF2
xorl %esi, %esi
callq 0x21420
movl $0xcf3, %edi            # imm = 0xCF3
xorl %esi, %esi
callq 0x21420
movl $0xcf4, %edi            # imm = 0xCF4
xorl %esi, %esi
callq 0x21420
movl $0xcf5, %edi            # imm = 0xCF5
movl %ebp, %esi
callq 0x21420
movzbl (%rbx), %edi
movl 0xc(%r14), %esi
movss 0x18(%r14), %xmm0
movss 0x1c(%r14), %xmm1
cvtsi2ss %edi, %xmm2
incq %rbx
xorps %xmm3, %xmm3
movq %rbx, %rdx
callq 0x21860
popq %rbx
popq %r14
popq %rbp
jmp 0x21ac0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: fghFontByID
static SFG_Font* fghFontByID( void* font )
{
    if( font == GLUT_BITMAP_8_BY_13        )
        return &fgFontFixed8x13;
    if( font == GLUT_BITMAP_9_BY_15        )
        return &fgFontFixed9x15;
    if( font == GLUT_BITMAP_HELVETICA_10   )
        return &fgFontHelvetica10;
    if( font == GLUT_BITMAP_HELVETICA_12   )
        return &fgFontHelvetica12;
    if( font == GLUT_BITMAP_HELVETICA_18   )
        return &fgFontHelvetica18;
    if( font == GLUT_BITMAP_TIMES_ROMAN_10 )
        return &fgFontTimesRoman10;
    if( font == GLUT_BITMAP_TIMES_ROMAN_24 )
        return &fgFontTimesRoman24;

    fgWarning( "font 0x%08x not found", font );
    return 0;
}

// Assembly:
pushq %rbx
cmpq 0x755a3(%rip), %rdi     # 0x12df90
je 0xb8a3a
movq %rdi, %rsi
cmpq 0x755f7(%rip), %rdi     # 0x12dff0
je 0xb8a43
cmpq 0x75556(%rip), %rsi     # 0x12df58
je 0xb8a4c
cmpq 0x755c5(%rip), %rsi     # 0x12dfd0
je 0xb8a55
cmpq 0x75534(%rip), %rsi     # 0x12df48
je 0xb8a5e
cmpq 0x7555b(%rip), %rsi     # 0x12df78
je 0xb8a67
cmpq 0x7554a(%rip), %rsi     # 0x12df70
je 0xb8a70
leaq 0x1bcda(%rip), %rdi     # 0xd4709
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xbae63
jmp 0xb8a77
leaq 0x72e0f(%rip), %rbx     # 0x12b850
jmp 0xb8a77
leaq 0x72e26(%rip), %rbx     # 0x12b870
jmp 0xb8a77
leaq 0x72e3d(%rip), %rbx     # 0x12b890
jmp 0xb8a77
leaq 0x72e54(%rip), %rbx     # 0x12b8b0
jmp 0xb8a77
leaq 0x72e6b(%rip), %rbx     # 0x12b8d0
jmp 0xb8a77
leaq 0x72e82(%rip), %rbx     # 0x12b8f0
jmp 0xb8a77
leaq 0x72e99(%rip), %rbx     # 0x12b910
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutBitmapWidth
int FGAPIENTRY glutBitmapWidth( void* fontID, int character )
{
    SFG_Font* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutBitmapWidth" );
    font = fghFontByID( fontID );
    freeglut_return_val_if_fail( character > 0 && character < 256, 0 );
    freeglut_return_val_if_fail( font, 0 );
    return *( font->Characters[ character ] );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x7a616(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8be5
leaq 0x1b68f(%rip), %rdi     # 0xd4266
leaq 0x1ba9b(%rip), %rsi     # 0xd4679
xorl %eax, %eax
callq 0xbad73
movq %r14, %rdi
callq 0xb89e5
leal -0x100(%rbx), %ecx
cmpl $0xffffff01, %ecx       # imm = 0xFFFFFF01
setb %dl
testq %rax, %rax
sete %sil
xorl %ecx, %ecx
orb %dl, %sil
jne 0xb8c17
movq 0x10(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %rax
movzbl (%rax), %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutBitmapLength
int FGAPIENTRY glutBitmapLength( void* fontID, const unsigned char* string )
{
    unsigned char c;
    int length = 0, this_line_length = 0;
    SFG_Font* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutBitmapLength" );
    font = fghFontByID( fontID );
    freeglut_return_val_if_fail( font, 0 );
    if ( !string || ! *string )
        return 0;

    while( ( c = *string++) )
    {
        if( c != '\n' )/* Not an EOL, increment length of line */
            this_line_length += *( font->Characters[ c ]);
        else  /* EOL; reset the length of this line */
        {
            if( length < this_line_length )
                length = this_line_length;
            this_line_length = 0;
        }
    }
    if ( length < this_line_length )
        length = this_line_length;

    return length;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7a5ae(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8c4d
leaq 0x1b627(%rip), %rdi     # 0xd4266
leaq 0x1ba43(%rip), %rsi     # 0xd4689
xorl %eax, %eax
callq 0xbad73
movq %r14, %rdi
callq 0xb89e5
testq %rax, %rax
sete %cl
testq %rbx, %rbx
sete %dl
orb %cl, %dl
jne 0xb8ca0
movb (%rbx), %sil
testb %sil, %sil
je 0xb8ca0
incq %rbx
xorl %edx, %edx
xorl %ecx, %ecx
cmpb $0xa, %sil
je 0xb8c91
movzbl %sil, %esi
testl %esi, %esi
je 0xb8ca4
movq 0x10(%rax), %rdi
movq (%rdi,%rsi,8), %rsi
movzbl (%rsi), %esi
addl %esi, %ecx
jmp 0xb8c98
cmpl %ecx, %edx
cmovlel %ecx, %edx
xorl %ecx, %ecx
movb (%rbx), %sil
incq %rbx
jmp 0xb8c74
xorl %eax, %eax
jmp 0xb8cab
cmpl %ecx, %edx
cmovgl %edx, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutBitmapHeight
int FGAPIENTRY glutBitmapHeight( void* fontID )
{
    SFG_Font* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutBitmapHeight" );
    font = fghFontByID( fontID );
    freeglut_return_val_if_fail( font, 0 );
    return font->Height;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7a522(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8cd9
leaq 0x1b59b(%rip), %rdi     # 0xd4266
leaq 0x1b9c8(%rip), %rsi     # 0xd469a
xorl %eax, %eax
callq 0xbad73
movq %rbx, %rdi
callq 0xb89e5
testq %rax, %rax
je 0xb8ceb
movl 0xc(%rax), %eax
jmp 0xb8ced
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutStrokeCharacter
void FGAPIENTRY glutStrokeCharacter( void* fontID, int character )
{
    const SFG_StrokeChar *schar;
    const SFG_StrokeStrip *strip;
    int i, j;
    SFG_StrokeFont* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutStrokeCharacter" );
    font = fghStrokeByID( fontID );
    freeglut_return_if_fail( character >= 0 );
    freeglut_return_if_fail( character < font->Quantity );
    freeglut_return_if_fail( font );

    schar = font->Characters[ character ];
    freeglut_return_if_fail( schar );
    strip = schar->Strips;

    for( i = 0; i < schar->Number; i++, strip++ )
    {
        glBegin( GL_LINE_STRIP );
        for( j = 0; j < strip->Number; j++ )
            glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y );
        glEnd( );
				glBegin( GL_POINTS );
        for( j = 0; j < strip->Number; j++ )
            glVertex2f( strip->Vertices[ j ].X, strip->Vertices[ j ].Y );
				glEnd( );
    }
    glTranslatef( schar->Right, 0.0, 0.0 );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x7a4dc(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8d1f
leaq 0x1b555(%rip), %rdi     # 0xd4266
leaq 0x1b993(%rip), %rsi     # 0xd46ab
xorl %eax, %eax
callq 0xbad73
movq %r14, %rdi
callq 0xb8df0
testl %ebx, %ebx
js 0xb8dcd
testq %rax, %rax
je 0xb8dcd
cmpl %ebx, 0x8(%rax)
jle 0xb8dcd
movq 0x10(%rax), %rax
movl %ebx, %ecx
movq (%rax,%rcx,8), %r14
testq %r14, %r14
je 0xb8dcd
movq 0x8(%r14), %r15
xorl %r12d, %r12d
pushq $0x3
popq %rbx
cmpl 0x4(%r14), %r12d
jge 0xb8dd7
movl %ebx, %edi
callq 0x21190
xorl %r13d, %r13d
movslq (%r15), %rax
cmpq %rax, %r13
jge 0xb8d8d
movq 0x8(%r15), %rax
movss (%rax,%r13,8), %xmm0
movss 0x4(%rax,%r13,8), %xmm1
callq 0x21af0
incq %r13
jmp 0xb8d6a
callq 0x21c60
xorl %edi, %edi
callq 0x21190
xorl %r13d, %r13d
movslq (%r15), %rax
cmpq %rax, %r13
jge 0xb8dbf
movq 0x8(%r15), %rax
movss (%rax,%r13,8), %xmm0
movss 0x4(%rax,%r13,8), %xmm1
callq 0x21af0
incq %r13
jmp 0xb8d9c
callq 0x21c60
incl %r12d
addq $0x10, %r15
jmp 0xb8d5a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movss (%r14), %xmm0
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21ed0
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutStrokeWidth
int FGAPIENTRY glutStrokeWidth( void* fontID, int character )
{
    const SFG_StrokeChar *schar;
    SFG_StrokeFont* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutStrokeWidth" );
    font = fghStrokeByID( fontID );
    freeglut_return_val_if_fail( ( character >= 0 ) &&
                                 ( character < font->Quantity ),
                                 0
    );
    freeglut_return_val_if_fail( font, 0 );
    schar = font->Characters[ character ];
    freeglut_return_val_if_fail( schar, 0 );

    return ( int )( schar->Right + 0.5 );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
leaq 0x7a263(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8f98
leaq 0x1b2dc(%rip), %rdi     # 0xd4266
leaq 0x1b73f(%rip), %rsi     # 0xd46d0
xorl %eax, %eax
callq 0xbad73
movq %r14, %rdi
callq 0xb8df0
movq %rax, %rcx
xorl %eax, %eax
testl %ebx, %ebx
js 0xb8fd2
testq %rcx, %rcx
je 0xb8fd2
cmpl %ebx, 0x8(%rcx)
jle 0xb8fd2
movq 0x10(%rcx), %rcx
movl %ebx, %edx
movq (%rcx,%rdx,8), %rcx
testq %rcx, %rcx
je 0xb8fd2
cvtss2sd (%rcx), %xmm0
addsd 0xc072(%rip), %xmm0     # 0xc5040
cvttsd2si %xmm0, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutStrokeLength
int FGAPIENTRY glutStrokeLength( void* fontID, const unsigned char* string )
{
    unsigned char c;
    float length = 0.0;
    float this_line_length = 0.0;
    SFG_StrokeFont* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutStrokeLength" );
    font = fghStrokeByID( fontID );
    freeglut_return_val_if_fail( font, 0 );
    if ( !string || ! *string )
        return 0;

    while( ( c = *string++) )
        if( c < font->Quantity )
        {
            if( c == '\n' ) /* EOL; reset the length of this line */
            {
                if( length < this_line_length )
                    length = this_line_length;
                this_line_length = 0.0;
            }
            else  /* Not an EOL, increment the length of this line */
            {
                const SFG_StrokeChar *schar = font->Characters[ c ];
                if( schar )
                    this_line_length += schar->Right;
            }
        }
    if( length < this_line_length )
        length = this_line_length;
    return( int )( length + 0.5 );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7a1f5(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb9006
leaq 0x1b26e(%rip), %rdi     # 0xd4266
leaq 0x1b6e1(%rip), %rsi     # 0xd46e0
xorl %eax, %eax
callq 0xbad73
movq %r14, %rdi
callq 0xb8df0
testq %rax, %rax
sete %dl
testq %rbx, %rbx
sete %sil
xorl %ecx, %ecx
orb %dl, %sil
jne 0xb907c
movb (%rbx), %dl
testb %dl, %dl
je 0xb907c
movl 0x8(%rax), %ecx
incq %rbx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
testb %dl, %dl
je 0xb9068
movzbl %dl, %esi
cmpl %esi, %ecx
jle 0xb9061
cmpb $0xa, %dl
jne 0xb9050
maxss %xmm0, %xmm1
movaps %xmm1, %xmm0
xorps %xmm1, %xmm1
jmp 0xb9061
movq 0x10(%rax), %rdx
movq (%rdx,%rsi,8), %rdx
testq %rdx, %rdx
je 0xb9061
addss (%rdx), %xmm1
movb (%rbx), %dl
incq %rbx
jmp 0xb9034
maxss %xmm0, %xmm1
cvtss2sd %xmm1, %xmm0
addsd 0xbfc8(%rip), %xmm0     # 0xc5040
cvttsd2si %xmm0, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutStrokeHeight
GLfloat FGAPIENTRY glutStrokeHeight( void* fontID )
{
    SFG_StrokeFont* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutStrokeHeight" );
    font = fghStrokeByID( fontID );
    freeglut_return_val_if_fail( font, 0.0 );
    return font->Height;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x7a14f(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb90ac
leaq 0x1b1c8(%rip), %rdi     # 0xd4266
leaq 0x1b64c(%rip), %rsi     # 0xd46f1
xorl %eax, %eax
callq 0xbad73
movq %rbx, %rdi
callq 0xb8df0
testq %rax, %rax
je 0xb90c0
movss 0xc(%rax), %xmm0
jmp 0xb90c3
xorps %xmm0, %xmm0
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_init.c
// Function: fgHintPresent
int fgHintPresent(Window window, Atom property, Atom hint)
{
  Atom ** atoms_ptr;
  int number_of_atoms;
  int supported;
  int i;

  supported = 0;

  atoms_ptr = malloc(sizeof(Atom *));
  number_of_atoms = fghGetWindowProperty(window,
					 property,
					 XA_ATOM,
					 (unsigned char **) atoms_ptr);
  for (i = 0; i < number_of_atoms; i++)
    {
      if ((*atoms_ptr)[i] == hint)
      {
          supported = 1;
          break;
      }
    }

  return supported;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
pushq $0x8
popq %rdi
callq 0x21c70
movq %rax, %r14
pushq $0x4
popq %rdx
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rcx
callq 0xb9126
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
cmovlel %eax, %ecx
pushq $0x1
popq %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0xb911a
movq (%r14), %rdi
leaq 0x1(%rsi), %r8
cmpq %rbx, (%rdi,%rsi,8)
movq %r8, %rsi
jne 0xb9103
movl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_init.c
// Function: fghGetWindowProperty
static int fghGetWindowProperty(Window window,
				Atom property,
				Atom type,
				unsigned char ** data)
{
  /*
   * Caller always has to use "Xfree()" to free "data", since
   * "XGetWindowProperty() always allocates one extra byte in prop_return
   * [i.e. "data"] (even if the property is zero length) [..]".
   */

  int status;  /*  Returned by "XGetWindowProperty". */

  Atom          type_returned;
  int           temp_format;             /*  Not used. */
  unsigned long number_of_elements;
  unsigned long temp_bytes_after;        /*  Not used. */


  status = XGetWindowProperty(fgDisplay.Display,
			      window,
			      property,
			      0,
			      LONG_MAX,
			      False,
			      type,
			      &type_returned,
			      &temp_format,
			      &number_of_elements,
			      &temp_bytes_after,
			      data);

  FREEGLUT_INTERNAL_ERROR_EXIT(status == Success,
			       "XGetWindowProperty failled",
			       "fghGetWindowProperty");

  if (type_returned != type)
    {
      number_of_elements = 0;
    }

  return number_of_elements;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %rax
movq %rdx, %rbx
movq %rsi, %rdx
movq %rdi, %rsi
movq 0x7e6ac(%rip), %rdi     # 0x1377f0
leaq 0x20(%rsp), %r10
leaq 0x8(%rsp), %r11
leaq 0x1c(%rsp), %r15
leaq 0x10(%rsp), %r12
xorl %r14d, %r14d
movabsq $0x7fffffffffffffff, %r8 # imm = 0x7FFFFFFFFFFFFFFF
xorl %ecx, %ecx
xorl %r9d, %r9d
pushq %rax
pushq %r10
pushq %r11
pushq %r15
pushq %r12
pushq %rbx
callq 0x21280
addq $0x30, %rsp
testl %eax, %eax
je 0xb919d
leaq 0x2bad6(%rip), %rdi     # 0xe4c5e
leaq 0x2bafb(%rip), %rsi     # 0xe4c8a
leaq 0x2bb0f(%rip), %rdx     # 0xe4ca5
xorl %eax, %eax
callq 0xbad73
cmpq %rbx, 0x10(%rsp)
jne 0xb91a9
movl 0x8(%rsp), %r14d
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_input_devices.c
// Function: fgInitialiseInputDevices
void fgInitialiseInputDevices ( void )
{
    if( !fgState.InputDevsInitialised )
    {
      /* will return true for VC8 (VC2005) and higher */
#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
        char *dial_device=NULL;
        size_t sLen;
        errno_t err = _dupenv_s( &dial_device, &sLen, "GLUT_DIALS_SERIAL" );
        if (err)
            fgError("Error getting GLUT_DIALS_SERIAL environment variable");
#else
        const char *dial_device=NULL;
        dial_device = getenv ( "GLUT_DIALS_SERIAL" );
#endif
#if TARGET_HOST_MS_WINDOWS
        if (!dial_device){
            static char devname[256];
            DWORD size=sizeof(devname);
            DWORD type = REG_SZ;
            HKEY key;
            if (RegOpenKeyA(HKEY_LOCAL_MACHINE,"SOFTWARE\\FreeGLUT",&key)==ERROR_SUCCESS) {
                if (RegQueryValueExA(key,"DialboxSerialPort",NULL,&type,(LPBYTE)devname,&size)==ERROR_SUCCESS){
                    dial_device=devname;
                }
                RegCloseKey(key);
            }
        }
#endif
        if ( !dial_device ) return;
        if ( !( dialbox_port = serial_open ( dial_device ) ) ) return;
      /* will return true for VC8 (VC2005) and higher */
#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
        free ( dial_device );  dial_device = NULL;  /* dupenv_s allocates a string that we must free */
#endif
        serial_putchar(dialbox_port,DIAL_INITIALIZE);
        glutTimerFunc ( 10, poll_dials, 0 );
        fgState.InputDevsInitialised = GL_TRUE;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x7976a(%rip), %r12     # 0x1331e0
cmpb $0x0, 0xb1(%r12)
jne 0xb9b59
leaq 0x2b3f0(%rip), %rdi     # 0xe4e7c
callq 0x21b10
testq %rax, %rax
je 0xb9b59
movq %rax, %r14
movq %rax, %rdi
movl $0x802, %esi            # imm = 0x802
xorl %eax, %eax
callq 0x21670
testl %eax, %eax
js 0xb9b68
movl %eax, %ebx
pushq $0x1
popq %rdi
pushq $0x7c
popq %rsi
callq 0x21600
movq %rax, %r14
movl %ebx, (%rax)
leaq 0x40(%rax), %rsi
movl %ebx, %edi
callq 0x219f0
xorps %xmm0, %xmm0
leaq 0xc(%rsp), %r15
movups %xmm0, 0x4(%r15)
movups %xmm0, 0x14(%r15)
movups %xmm0, 0x24(%r15)
andq $0x0, 0x34(%r15)
movl $0x4b0, 0x8(%r15)       # imm = 0x4B0
movl $0x5, (%r15)
movb $0x1, %r13b
movb %r13b, 0x17(%r15)
pushq $0xd
popq %rbp
movq %r15, %rdi
movl %ebp, %esi
callq 0x21530
movq %r15, %rdi
movl %ebp, %esi
callq 0x21990
movl %ebx, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x21c00
movq %r14, %rdi
callq 0xb9d7d
movq %r14, 0x7dd03(%rip)     # 0x137838
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0xb9b7a
leaq 0x4f(%rip), %rsi        # 0xb9b96
pushq $0xa
popq %rdi
xorl %edx, %edx
callq 0xb7fe9
movb %r13b, 0xb1(%r12)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x21760
andq $0x0, 0x7dcc0(%rip)     # 0x137838
jmp 0xb9b59
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_input_devices.c
// Function: fgInputDeviceClose
void fgInputDeviceClose( void )
{
    if ( fgState.InputDevsInitialised )
    {
        serial_close ( dialbox_port );
        dialbox_port = NULL;
        fgState.InputDevsInitialised = GL_FALSE;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x794ad(%rip), %r14     # 0x1331e0
cmpb $0x0, 0xb1(%r14)
je 0xb9d75
movq 0x7daf4(%rip), %rbx     # 0x137838
testq %rbx, %rbx
je 0xb9d65
movl (%rbx), %edi
leaq 0x40(%rbx), %rdx
xorl %esi, %esi
callq 0x21c00
movl (%rbx), %edi
callq 0x22300
movq %rbx, %rdi
callq 0x21ad0
andq $0x0, 0x7dacb(%rip)     # 0x137838
movb $0x0, 0xb1(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: fgInitialiseSpaceball
void fgInitialiseSpaceball(void)
{
    if(sball_initialized) {
        return;
    }

#if TARGET_HOST_POSIX_X11
    {
        Window w;

        if(!fgStructure.CurrentWindow)
            return;

        w = fgStructure.CurrentWindow->Window.Handle;
        if(spnav_x11_open(fgDisplay.Display, w) == -1) {
            return;
        }
    }
#endif

    sball_initialized = 1;
}

// Assembly:
cmpb $0x0, 0x7da75(%rip)     # 0x137848
jne 0xb9ed4
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x7daad(%rip), %rax     # 0x137890
movq 0x30(%rax), %rax
testq %rax, %rax
je 0xb9ece
cmpq $0x0, 0x7da60(%rip)     # 0x137858
jne 0xb9ece
movq 0x18(%rax), %rbx
leaq 0x7d9e7(%rip), %rax     # 0x1377f0
movq (%rax), %rdi
movq %rdi, 0x7da45(%rip)     # 0x137858
leaq 0x2b092(%rip), %rsi     # 0xe4eac
pushq $0x1
popq %rbp
movl %ebp, %edx
callq 0x21680
movq %rax, 0x7da35(%rip)     # 0x137860
movq 0x7da26(%rip), %rdi     # 0x137858
leaq 0x2b07f(%rip), %rsi     # 0xe4eb8
movl %ebp, %edx
callq 0x21680
movq %rax, 0x7da21(%rip)     # 0x137868
movq 0x7da0a(%rip), %rdi     # 0x137858
leaq 0x2b074(%rip), %rsi     # 0xe4ec9
movl %ebp, %edx
callq 0x21680
movq %rax, 0x7da0d(%rip)     # 0x137870
movq 0x7d9ee(%rip), %rdi     # 0x137858
leaq 0x2b06b(%rip), %rsi     # 0xe4edc
movl %ebp, %edx
callq 0x21680
movq %rax, 0x7d9f9(%rip)     # 0x137878
cmpq $0x0, 0x7d9d9(%rip)     # 0x137860
setne %cl
cmpq $0x0, 0x7d9d6(%rip)     # 0x137868
setne %dl
andb %cl, %dl
cmpq $0x0, 0x7d9d1(%rip)     # 0x137870
setne %cl
andb %dl, %cl
testq %rax, %rax
setne %al
andb %cl, %al
cmpb $0x1, %al
jne 0xb9ec6
movq %rbx, %rdi
callq 0xb9fb3
cmpl $-0x1, %eax
je 0xb9ec6
movb $0x1, 0x7d984(%rip)     # 0x137848
jmp 0xb9ece
andq $0x0, 0x7d98a(%rip)     # 0x137858
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: fgHasSpaceball
int fgHasSpaceball(void)
{
    if(!sball_initialized) {
        fgInitialiseSpaceball();
        if(!sball_initialized) {
            fgWarning("fgInitialiseSpaceball failed\n");
            return 0;
        }
    }

#if TARGET_HOST_POSIX_X11
    /* XXX this function should somehow query the driver if there's a device
     * plugged in, as opposed to just checking if there's a driver to talk to.
     */
    return spnav_fd() == -1 ? 0 : 1;
#else
    return 0;
#endif
}

// Assembly:
pushq %rbx
cmpb $0x0, 0x7d935(%rip)     # 0x137848
jne 0xb9f23
callq 0xb9dcc
cmpb $0x0, 0x7d927(%rip)     # 0x137848
je 0xb9f3a
movq 0x7d92e(%rip), %rax     # 0x137858
xorl %ebx, %ebx
testq %rax, %rax
je 0xb9f4a
cmpl $-0x1, 0x10(%rax)
setne %bl
jmp 0xb9f4a
leaq 0x2af4d(%rip), %rdi     # 0xe4e8e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xbae63
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: fgSpaceballNumButtons
int fgSpaceballNumButtons(void)
{
    if(!sball_initialized) {
        fgInitialiseSpaceball();
        if(!sball_initialized) {
            fgWarning("fgInitialiseSpaceball failed\n");
            return 0;
        }
    }

#if TARGET_HOST_POSIX_X11
    return 2;  /* TODO implement this properly */
#else
    return 0;
#endif
}

// Assembly:
pushq %rbx
pushq $0x2
popq %rbx
cmpb $0x0, 0x7d8ef(%rip)     # 0x137848
jne 0xb9f79
callq 0xb9dcc
cmpb $0x0, 0x7d8e1(%rip)     # 0x137848
jne 0xb9f79
leaq 0x2af1e(%rip), %rdi     # 0xe4e8e
xorl %ebx, %ebx
xorl %eax, %eax
callq 0xbae63
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: spnav_x11_window
static int spnav_x11_window(Window win)
{
  int (*prev_xerr_handler)(Display*, XErrorEvent*);
  XEvent xev;
  Window daemon_win;

  if(!IS_OPEN) {
    return -1;
  }

  if(!(daemon_win = get_daemon_window(dpy))) {
    return -1;
  }

  prev_xerr_handler = XSetErrorHandler(catch_badwin);

  xev.type = ClientMessage;
  xev.xclient.send_event = False;
  xev.xclient.display = dpy;
  xev.xclient.window = win;
  xev.xclient.message_type = command_event;
  xev.xclient.format = 16;
  xev.xclient.data.s[0] = ((unsigned int)win & 0xffff0000) >> 16;
  xev.xclient.data.s[1] = (unsigned int)win & 0xffff;
  xev.xclient.data.s[2] = CMD_APP_WINDOW;

  XSendEvent(dpy, daemon_win, False, 0, &xev);
  XSync(dpy, False);

  XSetErrorHandler(prev_xerr_handler);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq 0x7d890(%rip), %r12     # 0x137858
pushq $-0x1
popq %rbx
testq %r12, %r12
je 0xba106
movq %rdi, %r14
movq 0xe8(%r12), %rax
movslq 0xe0(%r12), %rcx
shlq $0x7, %rcx
movq 0x10(%rax,%rcx), %rsi
movq 0x7d881(%rip), %rdx     # 0x137878
leaq 0x38(%rsp), %r15
movq %r15, 0x28(%rsp)
leaq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x48(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x34(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x50(%rsp), %rax
andq $0x0, (%rsp)
movq %rax, 0x8(%rsp)
pushq $0x1
popq %r8
movq %r12, %rdi
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x21280
movq (%r15), %rdi
testq %rdi, %rdi
je 0xba106
movq (%rdi), %r15
callq 0x21bf0
leaq 0x58(%rsp), %rdx
movq %r12, %rdi
movq %r15, %rsi
callq 0x21390
testl %eax, %eax
je 0xba106
movq 0x58(%rsp), %rsi
leaq 0x2ae72(%rip), %rdi     # 0xe4ee9
callq 0x21d30
testl %eax, %eax
jne 0xba106
testq %r15, %r15
je 0xba106
leaq 0x286(%rip), %rdi       # 0xba316
callq 0x212a0
leaq 0x58(%rsp), %r8
movl $0x21, (%r8)
andl $0x0, 0x10(%r8)
movq %rax, %r12
movq 0x7d7a8(%rip), %rdi     # 0x137858
movq %rdi, 0x18(%r8)
movq %r14, 0x20(%r8)
movq 0x7d7b9(%rip), %rax     # 0x137878
movq %rax, 0x28(%r8)
movl $0x10, 0x30(%r8)
movl %r14d, %eax
shrl $0x10, %eax
movw %ax, 0x38(%r8)
movw %r14w, 0x3a(%r8)
movw $0x6c2f, 0x3c(%r8)      # imm = 0x6C2F
xorl %ebx, %ebx
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x21230
movq 0x7d761(%rip), %rdi     # 0x137858
xorl %esi, %esi
callq 0x22270
movq %r12, %rdi
callq 0x212a0
movl %ebx, %eax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: fgIsSpaceballXEvent
int fgIsSpaceballXEvent(const XEvent *xev)
{
    spnav_event sev;

    if(!sball_initialized) {
        fgInitialiseSpaceball();
        if(!sball_initialized) {
            return 0;
        }
    }

    return spnav_x11_event(xev, &sev);
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x7d722(%rip)     # 0x137848
jne 0xba138
callq 0xb9dcc
xorl %eax, %eax
cmpb $0x1, 0x7d712(%rip)     # 0x137848
jne 0xba145
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xba14b
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: spnav_x11_event
static int spnav_x11_event(const XEvent *xev, spnav_event *event)
{
  int i;
  int xmsg_type;

  if(xev->type != ClientMessage) {
    return 0;
  }

  xmsg_type = xev->xclient.message_type;

  if(xmsg_type != motion_event && xmsg_type != button_press_event &&
      xmsg_type != button_release_event) {
    return 0;
  }

  if(xmsg_type == motion_event) {
    event->type = SPNAV_EVENT_MOTION;
    event->motion.data = &event->motion.x;

    for(i=0; i<6; i++) {
      event->motion.data[i] = xev->xclient.data.s[i + 2];
    }
    event->motion.period = xev->xclient.data.s[8];
  } else {
    event->type = SPNAV_EVENT_BUTTON;
    event->button.press = xmsg_type == button_press_event ? 1 : 0;
    event->button.bnum = xev->xclient.data.s[2];
  }
  return event->type;
}

// Assembly:
xorl %eax, %eax
cmpl $0x21, (%rdi)
jne 0xba177
movslq 0x28(%rdi), %rcx
movq 0x7d703(%rip), %r8      # 0x137860
movq 0x7d704(%rip), %rdx     # 0x137868
cmpq %r8, %rcx
je 0xba178
cmpq %rdx, %rcx
je 0xba178
cmpq 0x7d6fb(%rip), %rcx     # 0x137870
je 0xba178
retq
cmpq %r8, %rcx
jne 0xba1a4
movl $0x1, (%rsi)
leaq 0x4(%rsi), %rax
movq %rax, 0x20(%rsi)
xorl %eax, %eax
cmpq $0x6, %rax
je 0xba1c0
movswl 0x3c(%rdi,%rax,2), %ecx
movq 0x20(%rsi), %rdx
movl %ecx, (%rdx,%rax,4)
incq %rax
jmp 0xba18d
xorl %eax, %eax
cmpq %rdx, %rcx
sete %al
movl $0x2, (%rsi)
movl %eax, 0x4(%rsi)
movswl 0x3c(%rdi), %eax
movl %eax, 0x8(%rsi)
pushq $0x2
popq %rax
retq
movswl 0x48(%rdi), %eax
movl %eax, 0x1c(%rsi)
movl (%rsi), %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: fgSpaceballHandleXEvent
void fgSpaceballHandleXEvent(const XEvent *xev)
{
    spnav_event sev;

    if(!sball_initialized) {
        fgInitialiseSpaceball();
        if(!sball_initialized) {
            return;
        }
    }

    if(spnav_x11_event(xev, &sev)) {
        switch(sev.type) {
        case SPNAV_EVENT_MOTION:
            if(sev.motion.x | sev.motion.y | sev.motion.z) {
                INVOKE_WCB(*spnav_win, SpaceMotion, (sev.motion.x, sev.motion.y, sev.motion.z));
            }
            if(sev.motion.rx | sev.motion.ry | sev.motion.rz) {
                INVOKE_WCB(*spnav_win, SpaceRotation, (sev.motion.rx, sev.motion.ry, sev.motion.rz));
            }
            spnav_remove_events(SPNAV_EVENT_MOTION);
            break;

        case SPNAV_EVENT_BUTTON:
            INVOKE_WCB(*spnav_win, SpaceButton, (sev.button.bnum, sev.button.press ? GLUT_DOWN : GLUT_UP));
            break;

        default:
            break;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xf0, %rsp
movq %rdi, %rbx
cmpb $0x0, 0x7d668(%rip)     # 0x137848
jne 0xba1f4
callq 0xb9dcc
cmpb $0x1, 0x7d65a(%rip)     # 0x137848
jne 0xba309
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0xba14b
testl %eax, %eax
je 0xba309
movl 0x8(%rsp), %eax
cmpl $0x2, %eax
je 0xba2d7
cmpl $0x1, %eax
jne 0xba309
movl 0x10(%rsp), %eax
orl 0xc(%rsp), %eax
orl 0x14(%rsp), %eax
je 0xba25c
movq 0x7d61c(%rip), %rdi     # 0x137850
cmpq $0x0, 0xf8(%rdi)
je 0xba25c
callq 0xbde17
movq 0x7d606(%rip), %rax     # 0x137850
movl 0xc(%rsp), %edi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
callq *0xf8(%rax)
movl 0x1c(%rsp), %eax
orl 0x18(%rsp), %eax
orl 0x20(%rsp), %eax
je 0xba299
movq 0x7d5df(%rip), %rdi     # 0x137850
cmpq $0x0, 0x100(%rdi)
je 0xba299
callq 0xbde17
movq 0x7d5c9(%rip), %rax     # 0x137850
movl 0x18(%rsp), %edi
movl 0x1c(%rsp), %esi
movl 0x20(%rsp), %edx
callq *0x100(%rax)
movl $0x1, 0x4(%rsp)
cmpq $0x0, 0x7d5af(%rip)     # 0x137858
je 0xba309
leaq 0xad(%rip), %rbx        # 0xba35f
leaq 0x30(%rsp), %r14
leaq 0x4(%rsp), %r15
movq 0x7d595(%rip), %rdi     # 0x137858
movq %r14, %rsi
movq %rbx, %rdx
movq %r15, %rcx
callq 0x22340
testl %eax, %eax
jne 0xba2bc
jmp 0xba309
movq 0x7d572(%rip), %rdi     # 0x137850
cmpq $0x0, 0x108(%rdi)
je 0xba309
callq 0xbde17
movq 0x7d55c(%rip), %rax     # 0x137850
movl 0x10(%rsp), %edi
xorl %esi, %esi
cmpl $0x0, 0xc(%rsp)
sete %sil
callq *0x108(%rax)
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: catch_badwin
static int catch_badwin(Display *dpy, XErrorEvent *err)
{
  char buf[256];

  if(err->error_code == BadWindow) {
    /* do nothing? */
  } else {
    XGetErrorText(dpy, err->error_code, buf, sizeof buf);
    fprintf(stderr, "Caught unexpected X error: %s\n", buf);
  }
  return 0;
}

// Assembly:
movzbl 0x20(%rsi), %esi
cmpl $0x3, %esi
jne 0xba322
xorl %eax, %eax
retq
pushq %rbx
subq $0x100, %rsp            # imm = 0x100
movq %rsp, %rbx
movq %rbx, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x21dd0
movq 0x73c6f(%rip), %rax     # 0x12dfb0
movq (%rax), %rdi
leaq 0x2abae(%rip), %rsi     # 0xe4ef9
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21da0
addq $0x100, %rsp            # imm = 0x100
popq %rbx
jmp 0xba31f
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_spaceball.c
// Function: match_events
static Bool match_events(Display *dpy, XEvent *xev, char *arg)
{
  int evtype = *(int*)arg;

  if(xev->type != ClientMessage) {
    return False;
  }

  if(xev->xclient.message_type == motion_event) {
    return !evtype || evtype == SPNAV_EVENT_MOTION ? True : False;
  }
  if(xev->xclient.message_type == button_press_event ||
      xev->xclient.message_type == button_release_event) {
    return !evtype || evtype == SPNAV_EVENT_BUTTON ? True : False;
  }
  return False;
}

// Assembly:
cmpl $0x21, (%rsi)
jne 0xba38d
movl (%rdx), %eax
movq 0x28(%rsi), %rcx
cmpq 0x7d4ef(%rip), %rcx     # 0x137860
jne 0xba37b
cmpl $0x2, %eax
setb %al
jmp 0xba38f
cmpq 0x7d4e6(%rip), %rcx     # 0x137868
je 0xba393
cmpq 0x7d4e5(%rip), %rcx     # 0x137870
je 0xba393
xorl %eax, %eax
movzbl %al, %eax
retq
testl $0xfffffffd, %eax       # imm = 0xFFFFFFFD
sete %al
jmp 0xba38f
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_joystick.c
// Function: fgInitialiseJoysticks
void fgInitialiseJoysticks ( void )
{
    if( !fgState.JoysticksInitialised )
    {
        int ident ;
        for ( ident = 0; ident < MAX_NUM_JOYSTICKS; ident++ )
            fghJoystickInit( ident );

        fgState.JoysticksInitialised = GL_TRUE;
    }
}

// Assembly:
leaq 0x78e39(%rip), %rax     # 0x1331e0
cmpb $0x0, 0xb0(%rax)
je 0xba3b1
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x80016a11, %eax       # imm = 0x80016A11
leaq 0x7d4b5(%rip), %r14     # 0x137880
leaq 0x1(%rax), %rcx
movq %rcx, 0x10(%rsp)
leaq 0x7f0002(%rax), %r13
xorl %ebp, %ebp
cmpq $0x2, %rbp
je 0xba57b
cmpq $0x0, (%r14,%rbp,8)
je 0xba3fc
leaq 0x2ac5f(%rip), %rdi     # 0xe5054
xorl %eax, %eax
callq 0xbad73
movl $0x2a0, %edi            # imm = 0x2A0
pushq $0x1
popq %rsi
callq 0x21600
movq %rax, (%r14,%rbp,8)
movl %ebp, 0xd0(%rax)
leaq 0x4c(%rax), %rdi
movl $0x80, %esi
leaq 0x2ac65(%rip), %rdx     # 0xe5088
movl %ebp, %ecx
xorl %eax, %eax
callq 0x21fc0
movq (%r14,%rbp,8), %rdi
addq $0x4c, %rdi
xorl %esi, %esi
callq 0x22040
testl %eax, %eax
je 0xba45c
movq (%r14,%rbp,8), %rdi
addq $0x4c, %rdi
movl $0x80, %esi
leaq 0x2ac45(%rip), %rdx     # 0xe5098
movl %ebp, %ecx
xorl %eax, %eax
callq 0x21fc0
movq (%r14,%rbp,8), %r15
movw $0x1, 0xd4(%r15)
leaq 0xd5(%r15), %rbx
movabsq $0x2000000002, %rax     # imm = 0x2000000002
movq %rax, 0x158(%r15)
xorl %eax, %eax
cmpq $0x10, %rax
je 0xba495
andl $0x0, 0xc(%r15,%rax,4)
incq %rax
jmp 0xba484
andl $0x0, 0x8(%r15)
leaq 0x4c(%r15), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x21670
movl %eax, 0xcc(%r15)
movl %eax, %ecx
shrl $0x1f, %ecx
movb %cl, 0xd4(%r15)
testl %eax, %eax
js 0xba573
movl $0x80016a11, %esi       # imm = 0x80016A11
movl %eax, %edi
leaq 0xf(%rsp), %r12
movq %r12, %rdx
xorl %eax, %eax
callq 0x21d50
movzbl 0xf(%rsp), %eax
movl %eax, 0x158(%r15)
movl 0xcc(%r15), %edi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x21d50
movzbl 0xf(%rsp), %eax
movl %eax, 0x15c(%r15)
movl 0xcc(%r15), %edi
movq %r13, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21d50
movl 0xcc(%r15), %edi
pushq $0x4
popq %rsi
movl $0x800, %edx            # imm = 0x800
xorl %eax, %eax
callq 0x214f0
pushq $-0x10
popq %rax
testq %rax, %rax
je 0xba573
movl $0x46fffe00, 0x260(%r15,%rax,4) # imm = 0x46FFFE00
andl $0x0, 0x220(%r15,%rax,4)
movl $0xc6fffe00, 0x2a0(%r15,%rax,4) # imm = 0xC6FFFE00
andl $0x0, 0x1a0(%r15,%rax,4)
movl $0x3f800000, 0x1e0(%r15,%rax,4) # imm = 0x3F800000
incq %rax
jmp 0xba533
incq %rbp
jmp 0xba3dd
leaq 0x78c5e(%rip), %rax     # 0x1331e0
movb $0x1, 0xb0(%rax)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_joystick.c
// Function: fgJoystickDetect
int fgJoystickDetect( void )
{
    int ident;

    fgInitialiseJoysticks ();

    if ( !fgState.JoysticksInitialised )
        return 0;

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

    return 0;
}

// Assembly:
pushq %rax
callq 0xba3a0
leaq 0x788ef(%rip), %rax     # 0x1331e0
cmpb $0x0, 0xb0(%rax)
je 0xba926
xorl %eax, %eax
leaq 0x7cf7d(%rip), %rdx     # 0x137880
pushq $0x1
popq %rcx
xorl %esi, %esi
cmpq $0x10, %rsi
je 0xba92c
movq (%rsi,%rdx), %rdi
testq %rdi, %rdi
je 0xba920
cmpb $0x0, 0xd4(%rdi)
je 0xba92a
addq $0x8, %rsi
jmp 0xba908
xorl %eax, %eax
jmp 0xba92c
movl %ecx, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fgError
void fgError( const char *fmt, ... )
{
    va_list ap;

    va_start( ap, fmt );

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

    va_end( ap );

    if ( fgState.Initialised )
        fgDeinitialize ();

    exit( 1 );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xbadd6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movq 0x731b3(%rip), %r14     # 0x12dfb0
movq (%r14), %rcx
leaq 0x2a46d(%rip), %rdi     # 0xe5274
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x222c0
leaq 0x783c7(%rip), %r15     # 0x1331e0
movq 0xa8(%r15), %rdx
testq %rdx, %rdx
je 0xbae36
movq (%r14), %rdi
leaq 0x2a44f(%rip), %rsi     # 0xe527e
xorl %eax, %eax
callq 0x21da0
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x21c80
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x21bb0
cmpb $0x0, 0x1c(%r15)
je 0xbae5b
callq 0xb91b8
pushq $0x1
popq %rdi
callq 0x21b00
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fgWarning
void fgWarning( const char *fmt, ... )
{
    va_list ap;

    va_start( ap, fmt );

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

    va_end( ap );
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xbaec4
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rsp)
movq 0x730c5(%rip), %r14     # 0x12dfb0
movq (%r14), %rcx
leaq 0x2a37f(%rip), %rdi     # 0xe5274
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
callq 0x222c0
leaq 0x782d9(%rip), %rax     # 0x1331e0
movq 0xa8(%rax), %rdx
testq %rdx, %rdx
je 0xbaf24
movq (%r14), %rdi
leaq 0x2a361(%rip), %rsi     # 0xe527e
xorl %eax, %eax
callq 0x21da0
movq (%r14), %rdi
movq %rsp, %rdx
movq %rbx, %rsi
callq 0x21c80
movq (%r14), %rsi
pushq $0xa
popq %rdi
callq 0x21bb0
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fghcbCheckJoystickPolls
static void fghcbCheckJoystickPolls( SFG_Window *window,
                                     SFG_Enumerator *enumerator )
{
    long int checkTime = fgElapsedTime( );

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

    fgEnumSubWindows( window, fghcbCheckJoystickPolls, enumerator );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0xbad60
movq %rax, %r15
movq 0x50(%r14), %rax
addq 0x58(%r14), %rax
cmpq %r15, %rax
jg 0xbb921
movq %r14, %rdi
callq 0xba5e4
movq %r15, 0x58(%r14)
leaq -0x33(%rip), %rsi       # 0xbb8f5
movq %r14, %rdi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0xbda1b
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fghcbDisplayWindow
static void fghcbDisplayWindow( SFG_Window *window,
                                SFG_Enumerator *enumerator )
{
    if( window->State.Redisplay &&
        window->State.Visible )
    {
        window->State.Redisplay = GL_FALSE;

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

    fgEnumSubWindows( window, fghcbDisplayWindow, enumerator );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
cmpb $0x0, 0x48(%rdi)
je 0xbba1e
cmpb $0x0, 0x49(%r14)
je 0xbba1e
movb $0x0, 0x48(%r14)
cmpq $0x0, 0x70(%r14)
je 0xbba1e
leaq 0x7bf1b(%rip), %r12     # 0x137890
movq 0x30(%r12), %r15
movq %r14, %rdi
callq 0xbde17
cmpb $0x0, 0x6a(%r14)
je 0xbba03
movl 0x38(%r14), %r13d
movl 0x3c(%r14), %ebp
movq 0x30(%r12), %rax
movq %rax, (%rsp)
leaq 0x7be4f(%rip), %r12     # 0x1377f0
movq (%r12), %rdi
movq 0x18(%r14), %rsi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x21e30
movq (%r12), %rdi
callq 0x21ec0
movq 0x78(%r14), %r12
movq %r14, %rdi
callq 0xbde17
testq %r12, %r12
je 0xbb9d8
movl %r13d, %edi
movl %ebp, %esi
callq *0x78(%r14)
jmp 0xbb9e6
xorl %edi, %edi
xorl %esi, %esi
movl %r13d, %edx
movl %ebp, %ecx
callq 0x21220
movb $0x1, 0x48(%r14)
cmpb $0x0, 0x170(%r14)
je 0xbb9fe
movq (%rsp), %rdi
callq 0xbde17
movb $0x0, 0x6a(%r14)
cmpq $0x0, 0x70(%r14)
je 0xbba16
movq %r14, %rdi
callq 0xbde17
callq *0x70(%r14)
movq %r15, %rdi
callq 0xbde17
leaq -0xed(%rip), %rsi       # 0xbb938
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbda1b
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_main.c
// Function: fghHavePendingRedisplaysCallback
static void fghHavePendingRedisplaysCallback( SFG_Window* w, SFG_Enumerator* e)
{
    if( w->State.Redisplay && w->State.Visible )
    {
        e->found = GL_TRUE;
        e->data = w;
    }
    fgEnumSubWindows( w, fghHavePendingRedisplaysCallback, e );
}

// Assembly:
movq %rsi, %rdx
cmpb $0x0, 0x48(%rdi)
je 0xbba54
cmpb $0x0, 0x49(%rdi)
je 0xbba54
movb $0x1, (%rdx)
movq %rdi, 0x8(%rdx)
leaq -0x1d(%rip), %rsi       # 0xbba3e
jmp 0xbda1b
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fgDeactivateMenu
void fgDeactivateMenu( SFG_Window *window )
{
    SFG_Window *parent_window = NULL;

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

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

    parent_window = menu->ParentWindow;

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

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

    fgState.ActiveMenus--;

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

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

    fgSetWindow ( parent_window ) ;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x150(%rdi), %rbx
testq %rbx, %rbx
je 0xbc48f
movq 0x60(%rbx), %rdi
movq 0x68(%rbx), %r14
callq 0xbde17
callq 0xbe678
movq 0x60(%rbx), %rax
andq $0x0, 0x150(%rax)
movq 0x68(%rbx), %rax
andq $0x0, 0x150(%rax)
xorl %edi, %edi
movq %rbx, %rsi
callq 0xbc497
movb $0x0, 0x40(%rbx)
andq $0x0, 0x58(%rbx)
leaq 0x76d84(%rip), %rax     # 0x1331e0
decl 0x70(%rax)
addq $0x20, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xbc480
movb $0x0, 0x28(%rbx)
cmpq $0x0, 0x20(%rbx)
je 0xbc463
movq %rbx, %rdi
callq 0xbc4cc
jmp 0xbc463
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xbde17
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_menu.c
// Function: fghSetMenuParentWindow
static void fghSetMenuParentWindow( SFG_Window *window, SFG_Menu *menu )
{
    SFG_MenuEntry *menuEntry;

    menu->ParentWindow = window;

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rdi, 0x68(%rsi)
addq $0x20, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0xbc4c4
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0xbc4a9
movq %r14, %rdi
callq 0xbc497
jmp 0xbc4a9
addq $0x8, %rsp
popq %rbx
popq %r14
retq