// File: tomfunkhouser[P]gaps/pkgs/fglut/freeglut_font.c
// Function: glutStrokeString
void FGAPIENTRY glutStrokeString( void* fontID, const unsigned char *string )
{
    unsigned char c;
    int i, j;
    float length = 0.0;
    SFG_StrokeFont* font;
    FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutStrokeString" );
    font = fghStrokeByID( fontID );
    freeglut_return_if_fail( font );
    if ( !string || ! *string )
        return;

    /*
     * 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 < font->Quantity )
        {
            if( c == '\n' )
            {
                glTranslatef ( -length, -( float )( font->Height ), 0.0 );
                length = 0.0;
            }
            else  /* Not an EOL, draw the bitmap character */
            {
                const SFG_StrokeChar *schar = font->Characters[ c ];
                if( schar )
                {
                    const SFG_StrokeStrip *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( );
                    }

                    length += schar->Right;
                    glTranslatef( schar->Right, 0.0, 0.0 );
                }
            }
        }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
leaq 0x7f9f2(%rip), %rax     # 0x1fa390
cmpb $0x0, 0x1c(%rax)
jne 0x17a9b9
leaq 0x22f27(%rip), %rdi     # 0x19d8d2
leaq 0x23379(%rip), %rsi     # 0x19dd2b
movb $0x0, %al
callq 0x17de70
movq 0x30(%rsp), %rdi
callq 0x17a910
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jne 0x17a9d5
jmp 0x17ab58
cmpq $0x0, 0x28(%rsp)
je 0x17a9e7
movq 0x28(%rsp), %rax
cmpb $0x0, (%rax)
jne 0x17a9ec
jmp 0x17ab58
jmp 0x17a9ee
movq 0x28(%rsp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rsp)
movb (%rax), %al
movb %al, 0x27(%rsp)
cmpb $0x0, %al
je 0x17ab58
movzbl 0x27(%rsp), %eax
movq 0x10(%rsp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x17ab53
movzbl 0x27(%rsp), %eax
cmpl $0xa, %eax
jne 0x17aa6a
movss 0x18(%rsp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movq 0x10(%rsp), %rax
movss 0xc(%rax), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
xorps %xmm2, %xmm2
callq 0x23070
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rsp)
jmp 0x17ab51
movq 0x10(%rsp), %rax
movq 0x10(%rax), %rax
movzbl 0x27(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsp)
je 0x17ab4f
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, (%rsp)
movl $0x0, 0x20(%rsp)
movl 0x20(%rsp), %eax
movq 0x8(%rsp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x17ab26
movl $0x3, %edi
callq 0x221b0
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
movq (%rsp), %rcx
cmpl (%rcx), %eax
jge 0x17ab05
movq (%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x1c(%rsp), %rcx
movss (%rax,%rcx,8), %xmm0
movq (%rsp), %rax
movq 0x8(%rax), %rax
movslq 0x1c(%rsp), %rcx
movss 0x4(%rax,%rcx,8), %xmm1
callq 0x22c50
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x17aac2
callq 0x22de0
movl 0x20(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x20(%rsp)
movq (%rsp), %rax
addq $0x10, %rax
movq %rax, (%rsp)
jmp 0x17aaa2
movq 0x8(%rsp), %rax
movss (%rax), %xmm0
addss 0x18(%rsp), %xmm0
movss %xmm0, 0x18(%rsp)
movq 0x8(%rsp), %rax
movss (%rax), %xmm0
xorps %xmm2, %xmm2
movaps %xmm2, %xmm1
callq 0x23070
jmp 0x17ab51
jmp 0x17ab53
jmp 0x17a9ee
addq $0x38, %rsp
retq
nopl (%rax)