Function at 0x409510
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push ecx
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 0x10], 0
je 0x4097a9
mov eax, dword [edi + 0x14]
cmp eax, 8
jne 0x4095c3
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x4097a9
mov esi, dword [ebp + 8]
movsd xmm0, qword [esi]
xorps xmm3, xmm3
movsd xmm2, qword [0x4c5b80]
movsd xmm1, qword [0x4c5f50]
dec ebx
comisd xmm3, xmm0
jbe 0x409583
movsd xmm3, qword [0x4c5d68]
comisd xmm3, xmm0
jb 0x409570
xor eax, eax
jmp 0x4095a6
mulsd xmm0, xmm1
subsd xmm0, xmm2
cvttsd2si eax, xmm0
sub al, 0x80
movzx eax, al
jmp 0x4095a6
comisd xmm0, xmmword [0x4c5f48]
jb 0x409594
mov eax, 0xff
jmp 0x4095a6
mulsd xmm0, xmm1
addsd xmm0, xmm2
cvttsd2si ecx, xmm0
sub cl, 0x80
movzx eax, cl
mov edx, dword [edi + 0x10]
push edx
push eax
call fcn.004a8d78
add esp, 8
add esi, 8
test ebx, ebx
jne 0x409540
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp eax, 0x10
jne 0x409678
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x4097a9
mov esi, dword [ebp + 8]
lea ebx, [ebx]
movsd xmm0, qword [esi]
xorps xmm3, xmm3
movsd xmm2, qword [0x4c5f40]
movsd xmm1, qword [0x4c5b80]
dec ebx
comisd xmm3, xmm0
jbe 0x409624
movsd xmm3, qword [0x4c5d68]
comisd xmm3, xmm0
jb 0x409613
mov eax, 0xffff8000
jmp 0x409644
mulsd xmm0, xmm2
subsd xmm0, xmm1
cvttsd2si eax, xmm0
movzx eax, ax
jmp 0x409644
comisd xmm0, xmmword [0x4c5f38]
jb 0x409635
mov eax, 0x7fff
jmp 0x409644
mulsd xmm0, xmm2
addsd xmm0, xmm1
cvttsd2si ecx, xmm0
movzx eax, cx
mov edx, dword [edi + 0x10]
push edx
mov byte [esp + 0x10], al
shr eax, 8
push 2
mov byte [esp + 0x15], al
lea eax, [esp + 0x14]
push 1
push eax
call fcn.004a8063
add esp, 0x10
add esi, 8
test ebx, ebx
jne 0x4095e0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp eax, 0x18
jne 0x409742
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x4097a9
mov esi, dword [ebp + 8]
nop
movsd xmm0, qword [esi]
xorps xmm3, xmm3
movsd xmm2, qword [0x4c5d60]
movsd xmm1, qword [0x4c5b80]
dec ebx
comisd xmm3, xmm0
jbe 0x4096e1
movsd xmm3, qword [0x4c5d68]
comisd xmm3, xmm0
jbe 0x4096ca
mov word [esp + 0xc], 0
mov byte [esp + 0xe], 0x80
jmp 0x409719
mulsd xmm0, xmm2
subsd xmm0, xmm1
cvttsd2si eax, xmm0
mov ecx, eax
sar ecx, 8
mov byte [esp + 0xd], cl
jmp 0x40970e
comisd xmm0, xmmword [0x4c5d58]
jb 0x4096f9
mov word [esp + 0xc], 0xffff
mov byte [esp + 0xe], 0x7f
jmp 0x409719
mulsd xmm0, xmm2
addsd xmm0, xmm1
cvttsd2si eax, xmm0
mov edx, eax
sar edx, 8
mov byte [esp + 0xd], dl
mov byte [esp + 0xc], al
sar eax, 0x10
mov byte [esp + 0xe], al
mov eax, dword [edi + 0x10]
push eax
push 3
lea ecx, [esp + 0x14]
push 1
push ecx
call fcn.004a8063
add esp, 0x10
add esi, 8
test ebx, ebx
jne 0x409690
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp eax, 0x20
jne 0x40977f
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x4097a9
mov ebx, dword [ebp + 8]
movsd xmm0, qword [ebx]
mov edx, dword [edi + 0x10]
cvtpd2ps xmm0, xmm0
movss dword [esp + 0xc], xmm0
mov eax, dword [esp + 0xc]
push edx
push eax
call fcn.004043b0
add esp, 8
add ebx, 8
dec esi
jne 0x409751
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp eax, 0x40
jne 0x4097a9
mov ebx, dword [ebp + 0xc]
test ebx, ebx
je 0x4097a9
mov esi, dword [ebp + 8]
mov edi, edi
mov ecx, dword [edi + 0x10]
mov edx, dword [esi + 4]
mov eax, dword [esi]
push ecx
push edx
push eax
call fcn.004043f0
add esp, 0xc
add esi, 8
dec ebx
jne 0x409790
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8