Function at 0x4103c0
Capabilities:
Read file via mapping

Disassembly:
sub esp, 0x3c
cmp byte [0x54e4d9], 0
push ebx
push ebp
push esi
push edi
jne 0x4103d5
call fcn.00424060
mov esi, dword [sym.imp.SDL2.dll_SDL_PollEvent]
lea eax, [esp + 0x10]
push eax
call esi
add esp, 4
test eax, eax
je 0x41063a
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 0x410461
mov al, byte [esp + 0x1c]
cmp al, 2
jne 0x41041b
mov byte [0x54e384], 1
jmp 0x410461
cmp al, 1
jne 0x410428
mov byte [0x54e384], 0
jmp 0x410461
cmp al, 7
je 0x410430
cmp al, 0xd
jne 0x410461
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 0x4104f4
mov ecx, dword [esp + 0x20]
cmp eax, 0x401
je 0x410494
cmp eax, 0x100
je 0x410494
cmp eax, 0x301
jne 0x41049b
cmp ecx, 0x29
jne 0x410628
mov byte [0x51d7a7], 1
cmp eax, 0x401
je 0x4104da
cmp eax, 0x300
jne 0x410628
cmp ecx, 0x7f
je 0x410628
cmp ecx, 0x106
je 0x410628
cmp ecx, 0x81
je 0x410628
cmp ecx, 0x80
je 0x410628
cmp byte [0x54e4ee], 0
je 0x4104e8
call fcn.00431cc0
mov byte [0x54e4dc], 0
jmp 0x410628
cmp eax, 0x201
jne 0x4105c7
mov eax, dword [esp + 0x18]
cmp dword [eax + 4], 1
jne 0x410618
cmp dword [eax + 0xc], 0x401
jne 0x410618
push str.LocalFT2CloneFilename
push 0
push 4
call dword [sym.imp.KERNEL32.dll_OpenFileMappingA]
mov dword [0x50ade4], eax
test eax, eax
je 0x4105c3
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 0x4105ad
mov ecx, dword [0x54e460]
mov byte [0x54e4e8], 1
test ecx, ecx
je 0x410590
cmp byte [0x54e380], 0
jne 0x410590
push ecx
call ebp
add esp, 4
test al, 0x40
je 0x410580
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.00421270
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 0x410657
cmp byte [0x54e4eb], 0
je 0x410618
cmp byte [0x552483], 0
je 0x4105ed
mov byte [0x552483], 0
jmp 0x410628
xor dl, dl
lea ecx, [esp + 0x1c]
call fcn.00446050
mov esi, eax
test esi, esi
je 0x410612
mov cl, byte [esi]
test cl, cl
je 0x410609
call fcn.00443aa0
push esi
call fcn.00488f53
add esp, 4
mov esi, dword [sym.imp.SDL2.dll_SDL_PollEvent]
cmp byte [0x54e4ea], 0
je 0x410628
mov byte [0x54e4db], 0
lea eax, [esp + 0x10]
push eax
call esi
add esp, 4
test eax, eax
jne 0x410400
mov eax, dword [0x55247c]
sar eax, 9
and al, 0xf
jbe 0x41064f
or al, 0xa0
mov dl, al
call fcn.0041f9e0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
cmp eax, 0x403
jne 0x41067a
mov eax, dword [esp + 0x24]
test eax, eax
jle 0x41066f
mov cl, 1
call fcn.004230f0
jmp 0x410618
jns 0x410618
xor cl, cl
call fcn.004230f0
jmp 0x410618
cmp eax, 0x1000
jne 0x4106d1
cmp byte [0x54e380], 0
mov byte [0x54e4e8], 0
jne 0x4106b6
push dword [0x54e460]
call ebp
add esp, 4
test al, 0x40
je 0x4106ab
push dword [0x54e460]
call edi
add esp, 4
push dword [0x54e460]
call ebx
add esp, 4
mov ecx, dword [esp + 0x18]
call fcn.00421270
push dword [esp + 0x18]
call dword [sym.imp.SDL2.dll_SDL_free]
add esp, 4
jmp 0x410618
cmp eax, 0x100
jne 0x41077c
cmp byte [0x54e624], 0
jne 0x410628
cmp byte [0x54e4eb], 0
je 0x4106f7
call fcn.00442730
mov al, byte [0x54ef62]
test al, al
jne 0x41070c
mov byte [0x54e4ea], 1
jmp 0x410621
cmp byte [0x54e380], 0
jne 0x41073f
push dword [0x54e460]
call ebp
add esp, 4
test al, 0x40
je 0x41072f
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 0x410618
test al, al
je 0x410770
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.00441180
add esp, 0x10
cmp ax, 1
jne 0x410618
mov byte [0x54e4ea], 1
jmp 0x410621
cmp eax, 0x301
jne 0x410827
cmp byte [0x54e4eb], 0
mov esi, dword [esp + 0x20]
jne 0x410612
cmp byte [0x54e624], 0
jne 0x410612
cmp byte [0x552482], 0
je 0x4107ba
mov byte [0x552482], 0
jmp 0x410612
cmp byte [0x54e4b7], 0
jne 0x410808
cmp byte [0x552485], 0
jne 0x410808
cmp esi, 0x39
je 0x410808
cmp esi, 0x64
je 0x410808
lea eax, [esi - 5]
cmp eax, 0x33
ja 0x410808
mov dl, byte [esi + 0x4bdd67]
test dl, dl
je 0x410808
mov al, byte [0x54e551]
mov cl, al
add al, al
add cl, al
shl cl, 2
add cl, dl
test cl, cl
jle 0x410808
cmp cl, 0x60
jg 0x410808
xor dl, dl
call fcn.0040db00
movzx eax, byte [0x552484]
xor ecx, ecx
cmp esi, 0x57
mov byte [0x552480], cl
cmove eax, ecx
mov byte [0x552484], al
jmp 0x410612
cmp eax, 0x300
jne 0x41084f
cmp byte [esp + 0x1d], 0
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x20]
setne al
movzx eax, al
push eax
call fcn.0041b1b0
add esp, 4
jmp 0x410618
cmp eax, 0x402
jne 0x410864
mov cl, byte [esp + 0x20]
call fcn.004238f0
jmp 0x410618
cmp eax, 0x401
jne 0x410618
mov cl, byte [esp + 0x20]
call fcn.00423cb0
jmp 0x410618