Function at 0x410180
Capabilities:
Read file via mapping

Disassembly:
sub esp, 0x3c
cmp byte [0x54e4d9], 0
push ebx
push ebp
push esi
push edi
jne 0x410195
call fcn.00423fb0
mov esi, dword [sym.imp.SDL2.dll_SDL_PollEvent]
lea eax, [esp + 0x10]
push eax
call esi
add esp, 4
test eax, eax
je 0x4103fa
mov ebp, dword [sym.imp.SDL2.dll_SDL_GetWindowFlags]
mov edi, dword [sym.imp.SDL2.dll_SDL_RestoreWindow]
mov ebx, dword [sym.imp.SDL2.dll_SDL_RaiseWindow]
nop
cmp dword [esp + 0x10], 0x200
jne 0x410221
mov al, byte [esp + 0x1c]
cmp al, 2
jne 0x4101db
mov byte [0x54e384], 1
jmp 0x410221
cmp al, 1
jne 0x4101e8
mov byte [0x54e384], 0
jmp 0x410221
cmp al, 7
je 0x4101f0
cmp al, 0xd
jne 0x410221
call dword [sym.imp.SDL2.dll_SDL_GetPerformanceCounter]
add eax, dword [0x54e430]
mov dword [0x54e440], eax
mov eax, dword [0x54e438]
adc edx, dword [0x54e434]
mov dword [0x54e448], eax
mov eax, dword [0x54e43c]
mov dword [0x54e444], edx
mov dword [0x54e44c], eax
cmp byte [0x54e4d9], 0
mov eax, dword [esp + 0x10]
je 0x4102b4
mov ecx, dword [esp + 0x20]
cmp eax, 0x401
je 0x410254
cmp eax, 0x100
je 0x410254
cmp eax, 0x301
jne 0x41025b
cmp ecx, 0x29
jne 0x4103e8
mov byte [0x51d7a7], 1
cmp eax, 0x401
je 0x41029a
cmp eax, 0x300
jne 0x4103e8
cmp ecx, 0x7f
je 0x4103e8
cmp ecx, 0x106
je 0x4103e8
cmp ecx, 0x81
je 0x4103e8
cmp ecx, 0x80
je 0x4103e8
cmp byte [0x54e4ee], 0
je 0x4102a8
call fcn.00431b70
mov byte [0x54e4dc], 0
jmp 0x4103e8
cmp eax, 0x201
jne 0x410387
mov eax, dword [esp + 0x18]
cmp dword [eax + 4], 1
jne 0x4103d8
cmp dword [eax + 0xc], 0x401
jne 0x4103d8
push str.LocalFT2CloneFilename
push 0
push 4
call dword [sym.imp.KERNEL32.dll_OpenFileMappingA]
mov dword [0x50ade4], eax
test eax, eax
je 0x410383
push 0x20a
push 0
push 0
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x50ade0], eax
test eax, eax
je 0x41036d
mov ecx, dword [0x54e460]
mov byte [0x54e4e8], 1
test ecx, ecx
je 0x410350
cmp byte [0x54e380], 0
jne 0x410350
push ecx
call ebp
add esp, 4
test al, 0x40
je 0x410340
push dword [0x54e460]
call edi
add esp, 4
push dword [0x54e460]
call ebx
mov eax, dword [0x50ade0]
add esp, 4
mov ecx, eax
call fcn.004211c0
push dword [0x50ade0]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [0x50ade0], 0
push dword [0x50ade4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x50ade4], 0
mov eax, dword [esp + 0x10]
cmp eax, 0x303
jne 0x410417
cmp byte [0x54e4eb], 0
je 0x4103d8
cmp byte [0x552483], 0
je 0x4103ad
mov byte [0x552483], 0
jmp 0x4103e8
xor dl, dl
lea ecx, [esp + 0x1c]
call fcn.00445e80
mov esi, eax
test esi, esi
je 0x4103d2
mov cl, byte [esi]
test cl, cl
je 0x4103c9
call fcn.004438d0
push esi
call fcn.00488d73
add esp, 4
mov esi, dword [sym.imp.SDL2.dll_SDL_PollEvent]
cmp byte [0x54e4ea], 0
je 0x4103e8
mov byte [0x54e4db], 0
lea eax, [esp + 0x10]
push eax
call esi
add esp, 4
test eax, eax
jne 0x4101c0
mov eax, dword [0x55247c]
sar eax, 9
and al, 0xf
jbe 0x41040f
or al, 0xa0
mov dl, al
call fcn.0041f930
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
cmp eax, 0x403
jne 0x41043a
mov eax, dword [esp + 0x24]
test eax, eax
jle 0x41042f
mov cl, 1
call fcn.00423050
jmp 0x4103d8
jns 0x4103d8
xor cl, cl
call fcn.00423050
jmp 0x4103d8
cmp eax, 0x1000
jne 0x410491
cmp byte [0x54e380], 0
mov byte [0x54e4e8], 0
jne 0x410476
push dword [0x54e460]
call ebp
add esp, 4
test al, 0x40
je 0x41046b
push dword [0x54e460]
call edi
add esp, 4
push dword [0x54e460]
call ebx
add esp, 4
mov ecx, dword [esp + 0x18]
call fcn.004211c0
push dword [esp + 0x18]
call dword [sym.imp.SDL2.dll_SDL_free]
add esp, 4
jmp 0x4103d8
cmp eax, 0x100
jne 0x41053c
cmp byte [0x54e624], 0
jne 0x4103e8
cmp byte [0x54e4eb], 0
je 0x4104b7
call fcn.00442560
mov al, byte [0x54ef62]
test al, al
jne 0x4104cc
mov byte [0x54e4ea], 1
jmp 0x4103e1
cmp byte [0x54e380], 0
jne 0x4104ff
push dword [0x54e460]
call ebp
add esp, 4
test al, 0x40
je 0x4104ef
push dword [0x54e460]
call edi
add esp, 4
push dword [0x54e460]
call ebx
mov al, byte [0x54ef62]
add esp, 4
cmp byte [0x54e624], 0
jne 0x4103d8
test al, al
je 0x410530
push 0
push str.You_have_unsaved_changes_in_your_song._Do_you_still_want_to_quit_and_lose_ALL_changes_
push str.System_request
push 2
call fcn.00440fc0
add esp, 0x10
cmp ax, 1
jne 0x4103d8
mov byte [0x54e4ea], 1
jmp 0x4103e1
cmp eax, 0x301
jne 0x4105e7
cmp byte [0x54e4eb], 0
mov esi, dword [esp + 0x20]
jne 0x4103d2
cmp byte [0x54e624], 0
jne 0x4103d2
cmp byte [0x552482], 0
je 0x41057a
mov byte [0x552482], 0
jmp 0x4103d2
cmp byte [0x54e4b7], 0
jne 0x4105c8
cmp byte [0x552485], 0
jne 0x4105c8
cmp esi, 0x39
je 0x4105c8
cmp esi, 0x64
je 0x4105c8
lea eax, [esi - 5]
cmp eax, 0x33
ja 0x4105c8
mov dl, byte [esi + 0x4bdcc3]
test dl, dl
je 0x4105c8
mov al, byte [0x54e551]
mov cl, al
add al, al
add cl, al
shl cl, 2
add cl, dl
test cl, cl
jle 0x4105c8
cmp cl, 0x60
jg 0x4105c8
xor dl, dl
call fcn.0040dae0
movzx eax, byte [0x552484]
xor ecx, ecx
cmp esi, 0x57
mov byte [0x552480], cl
cmove eax, ecx
mov byte [0x552484], al
jmp 0x4103d2
cmp eax, 0x300
jne 0x41060f
cmp byte [esp + 0x1d], 0
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
setne al
movzx eax, al
push eax
call fcn.0041af00
add esp, 4
jmp 0x4103d8
cmp eax, 0x402
jne 0x410624
mov cl, byte [esp + 0x20]
call fcn.00423850
jmp 0x4103d8
cmp eax, 0x401
jne 0x4103d8
mov cl, byte [esp + 0x20]
call fcn.00423c00
jmp 0x4103d8