// File: /workspace/github_cpp_makefile_star2_O3/tomfunkhouser[P]gaps/pkgs/fglut/freeglut_joystick.c
// Function: fgJoystickPollWindow
void fgJoystickPollWindow( SFG_Window* window )
{
    float axes[ _JS_MAX_AXES ];
    int buttons;
    int ident;

    freeglut_return_if_fail( window );
    freeglut_return_if_fail( FETCH_WCB( *window, Joystick ) );

    for( ident = 0; ident < MAX_NUM_JOYSTICKS; ident++ )
    {
        if( fgJoystick[ident] )
        {
            fghJoystickRead( fgJoystick[ident], &buttons, axes );

            if( !fgJoystick[ident]->error )
                INVOKE_WCB( *window, Joystick,
                            ( buttons,
                              (int) ( axes[ 0 ] * 1000.0f ),
                              (int) ( axes[ 1 ] * 1000.0f ),
                              (int) ( axes[ 2 ] * 1000.0f ) )
                );
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, 0x8(%rsp)
testq %rdi, %rdi
je 0xcf96e
movq 0x8(%rsp), %rax
cmpq $0x0, 0xd8(%rax)
je 0xcf96e
movb $0x1, %r13b
leaq 0x77318(%rip), %rsi     # 0x146860
movdqa 0xc7a0(%rip), %xmm6     # 0xdbcf0
pcmpeqd %xmm7, %xmm7
movdqa 0x108a3(%rip), %xmm8    # 0xdfe00
movss 0xc8da(%rip), %xmm9     # 0xdbe40
movss 0xaa95(%rip), %xmm10    # 0xda004
xorl %ebx, %ebx
movq (%rsi,%rbx,8), %rbp
testq %rbp, %rbp
je 0xcf925
movb 0xd4(%rbp), %r12b
movl 0x158(%rbp), %r14d
testb %r12b, %r12b
je 0xcf5de
testl %r14d, %r14d
jle 0xcf88c
leaq (,%r14,4), %rdx
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
callq 0x21490
movss 0xaa4d(%rip), %xmm10    # 0xda004
movss 0xc880(%rip), %xmm9     # 0xdbe40
movdqa 0x10837(%rip), %xmm8    # 0xdfe00
pcmpeqd %xmm7, %xmm7
movdqa 0xc71b(%rip), %xmm6     # 0xdbcf0
leaq 0x77284(%rip), %rsi     # 0x146860
jmp 0xcf5e7
testl %r14d, %r14d
jle 0xcf6d2
leal 0x3(%r14), %eax
andl $-0x4, %eax
leaq -0x1(%r14), %rcx
movq %rcx, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
pxor %xmm6, %xmm0
xorl %ecx, %ecx
movdqa 0xca36(%rip), %xmm1     # 0xdc040
movdqa 0x101be(%rip), %xmm2    # 0xdf7d0
movdqa %xmm1, %xmm3
pxor %xmm6, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
movd %xmm3, %edx
notl %edx
testb $0x1, %dl
je 0xcf64b
movl $0x44bb8000, 0x10(%rsp,%rcx,4) # imm = 0x44BB8000
pxor %xmm7, %xmm3
pextrw $0x4, %xmm3, %edx
testb $0x1, %dl
je 0xcf661
movl $0x44bb8000, 0x14(%rsp,%rcx,4) # imm = 0x44BB8000
movdqa %xmm2, %xmm3
pxor %xmm6, %xmm3
movdqa %xmm3, %xmm4
pcmpgtd %xmm0, %xmm4
pcmpeqd %xmm0, %xmm3
pshufd $0xf5, %xmm3, %xmm5     # xmm5 = xmm3[1,1,3,3]
pand %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm3     # xmm3 = xmm4[1,1,3,3]
por %xmm5, %xmm3
pxor %xmm7, %xmm3
pextrw $0x0, %xmm3, %edx
testb $0x1, %dl
je 0xcf69d
movl $0x44bb8000, 0x18(%rsp,%rcx,4) # imm = 0x44BB8000
pextrw $0x4, %xmm3, %edx
testb $0x1, %dl
je 0xcf6af
movl $0x44bb8000, 0x1c(%rsp,%rcx,4) # imm = 0x44BB8000
addq $0x4, %rcx
paddq %xmm8, %xmm1
paddq %xmm8, %xmm2
cmpq %rcx, %rax
jne 0xcf612
xorl %r15d, %r15d
testb %r12b, %r12b
jne 0xcf7c1
movl 0xcc(%rbp), %edi
movl $0x8, %edx
movq %rbp, %rsi
callq 0x21dc0
xorl %r15d, %r15d
cmpl $0x8, %eax
jne 0xcf773
leaq 0xc(%rbp), %r12
movzbl 0x6(%rbp), %eax
andl $0x7f, %eax
cmpl $0x2, %eax
je 0xcf720
cmpl $0x1, %eax
jne 0xcf93c
movb 0x7(%rbp), %cl
movl $0x1, %eax
shll %cl, %eax
cmpw $0x0, 0x4(%rbp)
je 0xcf752
orl %eax, 0x8(%rbp)
jmp 0xcf757
movzbl 0x7(%rbp), %eax
movl 0x158(%rbp), %edx
cmpl %eax, %edx
jle 0xcf757
movswl 0x4(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movss %xmm0, 0xc(%rbp,%rax,4)
shlq $0x2, %rdx
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x21720
jmp 0xcf757
notl %eax
andl %eax, 0x8(%rbp)
movl 0x8(%rbp), %r15d
movl 0xcc(%rbp), %edi
movl $0x8, %edx
movq %rbp, %rsi
callq 0x21dc0
cmpl $0x8, %eax
je 0xcf6f5
leaq 0x4c(%rbp), %rsi
leaq 0x2a82d(%rip), %rdi     # 0xf9fab
xorl %eax, %eax
callq 0x22a74
movb $0x1, 0xd4(%rbp)
movl 0x158(%rbp), %r14d
leaq 0x770c6(%rip), %rsi     # 0x146860
movdqa 0xc54e(%rip), %xmm6     # 0xdbcf0
pcmpeqd %xmm7, %xmm7
movdqa 0x10651(%rip), %xmm8    # 0xdfe00
movss 0xc688(%rip), %xmm9     # 0xdbe40
movss 0xa843(%rip), %xmm10    # 0xda004
testl %r14d, %r14d
jle 0xcf88f
movl %r14d, %eax
xorl %ecx, %ecx
movss 0x10(%rsp,%rcx,4), %xmm0
movss 0x1a0(%rbp,%rcx,4), %xmm1
movss 0x1e0(%rbp,%rcx,4), %xmm2
ucomiss %xmm0, %xmm2
subss %xmm2, %xmm0
jbe 0xcf839
subss 0x260(%rbp,%rcx,4), %xmm2
divss %xmm2, %xmm0
movaps %xmm1, %xmm2
xorps %xmm6, %xmm2
ucomiss %xmm0, %xmm2
movaps %xmm9, %xmm2
ja 0xcf878
movss 0x160(%rbp,%rcx,4), %xmm3
movaps %xmm3, %xmm4
xorps %xmm6, %xmm4
xorps %xmm2, %xmm2
ucomiss %xmm4, %xmm0
ja 0xcf878
addss %xmm3, %xmm0
subss %xmm3, %xmm1
divss %xmm1, %xmm0
movaps %xmm9, %xmm2
maxss %xmm0, %xmm2
jmp 0xcf878
movss 0x220(%rbp,%rcx,4), %xmm3
subss %xmm2, %xmm3
divss %xmm3, %xmm0
ucomiss %xmm1, %xmm0
movaps %xmm10, %xmm2
ja 0xcf878
movss 0x160(%rbp,%rcx,4), %xmm3
xorps %xmm2, %xmm2
ucomiss %xmm0, %xmm3
ja 0xcf878
subss %xmm3, %xmm0
subss %xmm3, %xmm1
divss %xmm1, %xmm0
movaps %xmm10, %xmm2
minss %xmm0, %xmm2
movss %xmm2, 0x50(%rsp,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0xcf7cf
jmp 0xcf88f
xorl %r15d, %r15d
movq (%rsi,%rbx,8), %rax
cmpb $0x0, 0xd4(%rax)
jne 0xcf925
movq 0x8(%rsp), %rax
cmpq $0x0, 0xd8(%rax)
je 0xcf925
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0xd314d
movss 0x50(%rsp), %xmm0
movss 0x2a9d6(%rip), %xmm1    # 0xfa2a0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %esi
movss 0x54(%rsp), %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %edx
movss 0x58(%rsp), %xmm0
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movl %r15d, %edi
callq *0xd8(%rbx)
movss 0xa704(%rip), %xmm10    # 0xda004
movss 0xc537(%rip), %xmm9     # 0xdbe40
movdqa 0x104ee(%rip), %xmm8    # 0xdfe00
pcmpeqd %xmm7, %xmm7
movdqa 0xc3d2(%rip), %xmm6     # 0xdbcf0
leaq 0x76f3b(%rip), %rsi     # 0x146860
movl $0x1, %ebx
testb $0x1, %r13b
movl $0x0, %r13d
jne 0xcf571
jmp 0xcf96e
leaq 0x2aae7(%rip), %rdi     # 0xfa42a
xorl %eax, %eax
callq 0x22a74
movl 0x8(%rbp), %r15d
movslq 0x158(%rbp), %r14
movq %r14, %rdx
shlq $0x2, %rdx
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x21720
jmp 0xcf793
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq