// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutBitmapString
void FGAPIENTRY glutBitmapString( void* fontID, const unsigned char *string )
{
    unsigned char c;
    float x = 0.0f ;
    SFG_Font* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutBitmapString" );
    font = fghFontByID( fontID );
    freeglut_return_if_fail( font );
    if ( !string || ! *string )
        return;

    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        );

    /*
     * Step through the string, drawing each character.
     * A newline will simply translate the next character's insertion
     * point back to the start of the line and down one line.
     */
    while( ( c = *string++) )
        if( c == '\n' )
        {
            glBitmap ( 0, 0, 0, 0, -x, (float) -font->Height, NULL );
            x = 0.0f;
        }
        else  /* Not an EOL, draw the bitmap character */
        {
            const GLubyte* face = font->Characters[ c ];

            glBitmap(
                face[ 0 ], font->Height,     /* 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...    */
            );

            x += ( float )( face[ 0 ] );
        }

    glPopClientAttrib( );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x7a74d(%rip), %rax     # 0x1331e0
cmpb $0x0, 0x1c(%rax)
jne 0xb8aae
leaq 0x1b7c6(%rip), %rdi     # 0xd4266
leaq 0x1bbc1(%rip), %rsi     # 0xd4668
xorl %eax, %eax
callq 0xbad73
movq %r14, %rdi
callq 0xb89e5
movq %rax, %r14
testq %rax, %rax
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0xb8ba0
cmpb $0x0, (%rbx)
je 0xb8ba0
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
xorps %xmm2, %xmm2
movzbl (%rbx), %eax
incq %rbx
cmpl $0xa, %eax
je 0xb8b7c
testl %eax, %eax
je 0xb8bab
movq 0x10(%r14), %rcx
movq (%rcx,%rax,8), %r15
movzbl (%r15), %edi
movl 0xc(%r14), %esi
movss 0x18(%r14), %xmm0
movss 0x1c(%r14), %xmm1
movaps %xmm2, (%rsp)
cvtsi2ss %edi, %xmm2
leaq 0x1(%r15), %rdx
xorps %xmm3, %xmm3
callq 0x21860
movaps (%rsp), %xmm2
movzbl (%r15), %eax
cvtsi2ss %eax, %xmm0
addss %xmm0, %xmm2
jmp 0xb8b2b
xorl %eax, %eax
subl 0xc(%r14), %eax
xorps 0xe117(%rip), %xmm2     # 0xc6ca0
cvtsi2ss %eax, %xmm3
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21860
jmp 0xb8b28
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21ac0