Function at 0x4014c7
Capabilities:
Get file size
Read file on windows
Suspend thread

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
push edi
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push ebx
push 1
push str.C:_space_debris.mod
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401505
mov ecx, str.Could_not_open_file._n
call fcn.00401022
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SuspendThread]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
push ebx
push 0x14
push 0x406ae0
push esi
mov dword [esp + 0x28], eax
call ebp
test eax, eax
jne 0x40152c
call fcn.0040145e
push 0x1f
mov edi, 0x406c48
pop ebx
push 0
push 0
push 0x16
lea eax, [edi + 8]
push eax
push esi
call ebp
test eax, eax
jne 0x40154a
call fcn.0040145e
mov ecx, esi
call fcn.00401499
movzx eax, ax
mov ecx, esi
add eax, eax
mov dword [edi - 0xc], eax
call fcn.00401476
mov ecx, esi
mov byte [edi], al
call fcn.00401476
mov ecx, esi
mov byte [edi + 1], al
call fcn.00401499
movzx eax, ax
mov ecx, esi
add eax, eax
mov dword [edi - 8], eax
call fcn.00401499
movzx ecx, ax
mov eax, dword [edi - 8]
lea eax, [eax + ecx*2]
mov dword [edi - 4], eax
cmp eax, 2
jbe 0x401596
mov dword [edi - 0xc], eax
add edi, 0x2c
sub ebx, 1
jne 0x401534
mov ecx, esi
call fcn.00401476
mov ecx, esi
mov byte [0x406b83], al
call fcn.00401476
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
xor edi, edi
push edi
push edi
push 0x80
mov ebp, 0x406b03
mov byte [0x406b85], al
push ebp
push esi
call ebx
test eax, eax
jne 0x4015d7
call fcn.0040145e
push edi
push edi
push 4
mov edi, 0x406af5
push edi
push esi
call ebx
test eax, eax
jne 0x4015ed
call fcn.0040145e
movzx eax, byte [0x406b85]
push eax
push edi
push 0x406ae0
push dword [esp + 0x20]
push esi
push 5
push str.Handle:__i._nSize:__i._nSong:___s__nMagic:___s__nReset_pos:__i_nSamples:_n
call fcn.00401045
add esp, 0x1c
mov ecx, str.NN__Name____________________Vol____FnTune___Length____Lp._Strt__Lp._End___n
call fcn.00401022
xor ebx, ebx
push 0x2c
inc ebx
pop edi
push dword [edi + 0x406c18]
movzx eax, byte [edi + 0x406c1c]
push dword [edi + 0x406c14]
push dword [edi + 0x406c10]
push eax
movzx eax, byte [edi + 0x406c1d]
push eax
lea eax, [edi + 0x406c24]
push eax
push ebx
push 2
push str._0_2i____22s__V:___2i__FTUN:___1X__L:___5i__S:___5i__E:___5i__n
call fcn.00401045
add esp, 0x24
add edi, 0x2c
inc ebx
cmp edi, 0x580
jb 0x40161f
movzx eax, byte [0x406b83]
push eax
push 1
push str.Song_length:__i._nSong_positions:_n
call fcn.00401045
add esp, 0xc
mov dword [esp + 0x10], 8
mov ecx, 0x403ed8
call fcn.00401022
xor edi, edi
mov bl, byte [edi + ebp]
cmp byte [0x406b00], bl
movzx edx, byte [0x406b00]
movzx eax, bl
cmovb edx, eax
movzx eax, bl
push eax
push 1
push str.__3i
mov byte [0x406b00], dl
call fcn.00401045
add esp, 0xc
inc edi
cmp edi, 0x10
jb 0x40168f
mov ecx, 0x403ee4
call fcn.00401022
add ebp, 0x10
sub dword [esp + 0x10], 1
jne 0x401683
mov al, byte [0x406b00]
inc al
mov byte [0x406b00], al
movzx eax, al
push eax
push 1
push str.Pattern_count:__i._n
call fcn.00401045
movzx eax, byte [0x406b00]
add esp, 0xc
shl eax, 0xa
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [0x406afc], eax
test eax, eax
jne 0x401731
mov ecx, str.Could_not_allocate_memory_for_patterns._n
call fcn.00401022
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SuspendThread]
xor ebx, ebx
mov dword [esp + 0x14], ebx
cmp byte [0x406b00], bl
jbe 0x40182b
mov edi, ebx
mov dword [esp + 0x10], 0x40
shl edi, 0xa
push 4
pop ebx
mov ebp, dword [0x406afc]
lea eax, [esp + 0x18]
push 0
push 0
push 4
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401774
call fcn.0040145e
mov ecx, dword [esp + 0x18]
mov edx, ecx
mov eax, ecx
and edx, 0xff0000
shr eax, 0x10
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shr edx, 8
shl eax, 8
or edx, eax
mov eax, edx
mov byte [edi + ebp + 3], dl
shr eax, 0x10
mov ecx, edx
and eax, 0xfff
shr ecx, 0x18
mov dword [esp + 0x1c], eax
mov eax, edx
shr eax, 0xc
xor cl, al
mov eax, edx
shr eax, 0x18
and cl, 0xf
xor cl, al
mov eax, edx
shr eax, 8
mov byte [edi + ebp], cl
and al, 0xf
mov ecx, dword [esp + 0x1c]
mov byte [edi + ebp + 2], al
test cx, cx
je 0x4017f7
xor eax, eax
cmp word [eax*2 + 0x403250], cx
jbe 0x4017ef
inc eax
cmp eax, 0x54
jb 0x4017dd
jmp 0x4017fc
inc al
mov byte [edi + ebp + 1], al
jmp 0x4017fc
mov byte [edi + ebp + 1], 0
add edi, 4
sub ebx, 1
jne 0x401753
sub dword [esp + 0x10], 1
jne 0x401750
mov ebx, dword [esp + 0x14]
movzx eax, byte [0x406b00]
inc ebx
mov dword [esp + 0x14], ebx
cmp ebx, eax
jb 0x401743
push 0x2c
pop edi
mov eax, dword [edi + 0x406c10]
test eax, eax
je 0x401889
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [edi + 0x406c20], eax
test eax, eax
jne 0x401869
mov ecx, str.Could_not_allocate_memory_for_samples._n
call fcn.00401022
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SuspendThread]
push 0
push 0
push dword [edi + 0x406c10]
push dword [edi + 0x406c20]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x401889
call fcn.0040145e
add edi, 0x2c
cmp edi, 0x580
jb 0x40182e
mov ecx, str.EOF_n
call fcn.00401022
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret