Function at 0x410240
Capabilities:
Read file via mapping

Disassembly:
sub esp, 0x3c
cmp byte [0x54e4d9], 0
push ebx
push ebp
push esi
push edi
jne 0x410255
call fcn.00424190
mov esi, dword [sym.imp.SDL2.dll_SDL_PollEvent]
lea eax, [esp + 0x10]
push eax
call esi
add esp, 4
test eax, eax
je 0x4104ba
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 0x4102e1
mov al, byte [esp + 0x1c]
cmp al, 2
jne 0x41029b
mov byte [0x54e384], 1
jmp 0x4102e1
cmp al, 1
jne 0x4102a8
mov byte [0x54e384], 0
jmp 0x4102e1
cmp al, 7
je 0x4102b0
cmp al, 0xd
jne 0x4102e1
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 0x410374
mov ecx, dword [esp + 0x20]
cmp eax, 0x401
je 0x410314
cmp eax, 0x100
je 0x410314
cmp eax, 0x301
jne 0x41031b
cmp ecx, 0x29
jne 0x4104a8
mov byte [0x51d7a7], 1
cmp eax, 0x401
je 0x41035a
cmp eax, 0x300
jne 0x4104a8
cmp ecx, 0x7f
je 0x4104a8
cmp ecx, 0x106
je 0x4104a8
cmp ecx, 0x81
je 0x4104a8
cmp ecx, 0x80
je 0x4104a8
cmp byte [0x54e4ee], 0
je 0x410368
call fcn.00431d50
mov byte [0x54e4dc], 0
jmp 0x4104a8
cmp eax, 0x201
jne 0x410447
mov eax, dword [esp + 0x18]
cmp dword [eax + 4], 1
jne 0x410498
cmp dword [eax + 0xc], 0x401
jne 0x410498
push str.LocalFT2CloneFilename
push 0
push 4
call dword [sym.imp.KERNEL32.dll_OpenFileMappingA]
mov dword [0x50ade4], eax
test eax, eax
je 0x410443
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 0x41042d
mov ecx, dword [0x54e460]
mov byte [0x54e4e8], 1
test ecx, ecx
je 0x410410
cmp byte [0x54e380], 0
jne 0x410410
push ecx
call ebp
add esp, 4
test al, 0x40
je 0x410400
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.004213a0
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 0x4104d7
cmp byte [0x54e4eb], 0
je 0x410498
cmp byte [0x552493], 0
je 0x41046d
mov byte [0x552493], 0
jmp 0x4104a8
xor dl, dl
lea ecx, [esp + 0x1c]
call fcn.004460f0
mov esi, eax
test esi, esi
je 0x410492
mov cl, byte [esi]
test cl, cl
je 0x410489
call fcn.00443b40
push esi
call fcn.00489083
add esp, 4
mov esi, dword [sym.imp.SDL2.dll_SDL_PollEvent]
cmp byte [0x54e4ea], 0
je 0x4104a8
mov byte [0x54e4db], 0
lea eax, [esp + 0x10]
push eax
call esi
add esp, 4
test eax, eax
jne 0x410280
mov eax, dword [0x552480]
sar eax, 9
and al, 0xf
jbe 0x4104cf
or al, 0xa0
mov dl, al
call fcn.0041faa0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
cmp eax, 0x403
jne 0x4104fa
mov eax, dword [esp + 0x24]
test eax, eax
jle 0x4104ef
mov cl, 1
call fcn.00423230
jmp 0x410498
jns 0x410498
xor cl, cl
call fcn.00423230
jmp 0x410498
cmp eax, 0x1000
jne 0x410551
cmp byte [0x54e380], 0
mov byte [0x54e4e8], 0
jne 0x410536
push dword [0x54e460]
call ebp
add esp, 4
test al, 0x40
je 0x41052b
push dword [0x54e460]
call edi
add esp, 4
push dword [0x54e460]
call ebx
add esp, 4
mov ecx, dword [esp + 0x18]
call fcn.004213a0
push dword [esp + 0x18]
call dword [sym.imp.SDL2.dll_SDL_free]
add esp, 4
jmp 0x410498
cmp eax, 0x100
jne 0x4105fc
cmp byte [0x54e624], 0
jne 0x4104a8
cmp byte [0x54e4eb], 0
je 0x410577
call fcn.004427d0
mov al, byte [0x54ef62]
test al, al
jne 0x41058c
mov byte [0x54e4ea], 1
jmp 0x4104a1
cmp byte [0x54e380], 0
jne 0x4105bf
push dword [0x54e460]
call ebp
add esp, 4
test al, 0x40
je 0x4105af
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 0x410498
test al, al
je 0x4105f0
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.00441220
add esp, 0x10
cmp ax, 1
jne 0x410498
mov byte [0x54e4ea], 1
jmp 0x4104a1
cmp eax, 0x301
jne 0x4106a7
cmp byte [0x54e4eb], 0
mov esi, dword [esp + 0x20]
jne 0x410492
cmp byte [0x54e624], 0
jne 0x410492
cmp byte [0x552492], 0
je 0x41063a
mov byte [0x552492], 0
jmp 0x410492
cmp byte [0x54e4b7], 0
jne 0x410688
cmp byte [0x552495], 0
jne 0x410688
cmp esi, 0x39
je 0x410688
cmp esi, 0x64
je 0x410688
lea eax, [esi - 5]
cmp eax, 0x33
ja 0x410688
mov dl, byte [esi + 0x4bdcd3]
test dl, dl
je 0x410688
mov al, byte [0x54e551]
mov cl, al
add al, al
add cl, al
shl cl, 2
add cl, dl
test cl, cl
jle 0x410688
cmp cl, 0x60
jg 0x410688
xor dl, dl
call fcn.0040dba0
movzx eax, byte [0x552494]
xor ecx, ecx
cmp esi, 0x57
mov byte [0x552490], cl
cmove eax, ecx
mov byte [0x552494], al
jmp 0x410492
cmp eax, 0x300
jne 0x4106cf
cmp byte [esp + 0x1d], 0
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
setne al
movzx eax, al
push eax
call fcn.0041afb0
add esp, 4
jmp 0x410498
cmp eax, 0x402
jne 0x4106e4
mov cl, byte [esp + 0x20]
call fcn.00423a30
jmp 0x410498
cmp eax, 0x401
jne 0x410498
mov cl, byte [esp + 0x20]
call fcn.00423de0
jmp 0x410498