Function at 0x440820
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x44
mov ebp, dword [esp + 0x58]
movapd xmm0, xmmword [0x4f41d0]
movupd xmmword [esp + 0x30], xmm0
lea eax, [esp + 0x30]
push eax
call dbg.ffDetectGamepad
add esp, 4
test eax, eax
je 0x44088e
add ebp, 0x20
push eax
push 0x4f41f8
push 0
push ebp
push 0
push str.Gamepad
call dbg.ffPrintError
add esp, 0x18
mov eax, dword [esp + 0x30]
test eax, eax
je 0x440886
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0
push eax
call sym._free
add esp, 4
add esp, 0x44
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [esp + 0x38]
test eax, eax
je 0x440c19
jle 0x440865
mov esi, dword [esp + 0x30]
lea ecx, [ebp + 0x20]
mov dword [esp + 0x20], ecx
lea ecx, [ebp + 0x48]
mov dword [esp + 0x1c], ecx
xor ecx, ecx
jmp 0x4408e1
mov dword [esi + 0x14], eax
add esi, 0x1c
mov eax, esi
sub eax, dword [esp + 0x30]
sar eax, 2
imul edx, eax, 0xb6db6db7
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x40]
cmp edx, eax
jge 0x440865
movzx edx, cl
inc cl
cmp eax, 2
movzx ebx, cl
cmovae edx, ebx
mov eax, 0
cmovb ebx, eax
cmp dword [ebp + 0x3c], 0
mov dword [esp + 0x40], edx
je 0x4409d0
mov edi, ebp
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
mov eax, dword [0x5052b0]
mov dword [esp + 0x2c], eax
movzx eax, byte [esi + 0x18]
xorps xmm0, xmm0
cvtsi2sd xmm0, eax
sub esp, 0x14
mov eax, dword [esp + 0x30]
movzx eax, word [eax]
mov word [esp + 0xc], ax
movsd qword [esp + 4], xmm0
lea ebp, [esp + 0x38]
mov dword [esp], ebp
mov dword [esp + 0x10], 0
call dbg.ffPercentAppendNum
add esp, 0x14
mov dword [esp], 7
lea eax, [esi + 0xc]
mov dword [esp + 4], eax
mov dword [esp + 8], 7
mov dword [esp + 0xc], esi
mov dword [esp + 0x10], 7
mov dword [esp + 0x14], ebp
movzx eax, bl
mov ecx, esp
push ecx
push 3
push 0
push dword [esp + 0x2c]
push eax
push str.Gamepad
call dbg.ffPrintFormat
add esp, 0x18
cmp dword [esp + 0x24], 0
mov dword [esp + 0x28], 0
je 0x4409bc
mov dword [esp + 0x24], 0
push dword [esp + 0x2c]
call sym._free
add esp, 4
mov ebp, edi
jmp 0x440bc7
movzx eax, bl
push 0
push dword [esp + 0x24]
push eax
push str.Gamepad
call dbg.ffPrintLogoAndKey
add esp, 0x10
mov edi, dword [esi + 0xc]
mov dword [esp], edi
test edi, edi
je 0x4409ff
push edi
call sym._malloc
add esp, 4
mov byte [eax], 0
jmp 0x440a04
mov eax, dword [0x5052b0]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov ebx, dword [esi + 0x10]
test ebx, ebx
je 0x440a96
mov ecx, dword [esi + 0x14]
test ecx, ecx
je 0x440a96
mov dword [esp + 0x18], ecx
mov edx, edi
sub edx, 1
jb 0x440a2f
xor ecx, ecx
cmp edx, ebx
jae 0x440a75
cmp edi, 2
mov ecx, edi
mov edx, 0x20
cmovb ecx, edx
lea edx, [ebx + 1]
nop
mov ebp, ecx
add ecx, ecx
cmp edx, ebp
ja 0x440a40
test edi, edi
je 0x440a5c
push ebp
push eax
call sym._realloc
add esp, 8
mov ecx, dword [esp + 4]
jmp 0x440a6a
push ebp
call sym._malloc
add esp, 4
mov byte [eax], 0
xor ecx, ecx
mov dword [esp + 8], eax
mov dword [esp], ebp
mov ebp, dword [esp + 0x58]
mov edx, dword [esp + 0x18]
add ecx, eax
push ebx
push edx
push ecx
call sym._memcpy
add esp, 0xc
add ebx, dword [esp + 4]
mov dword [esp + 4], ebx
mov eax, dword [esp + 8]
mov byte [eax + ebx], 0
movzx eax, byte [esi + 0x18]
mov ecx, eax
dec cl
cmp cl, 0x63
ja 0x440b7b
mov ebp, dword [esp + 4]
test ebp, ebp
je 0x440af2
mov eax, dword [esp]
test eax, eax
je 0x440abd
lea ebx, [ebp + 1]
cmp eax, ebx
jne 0x440af6
cmp eax, 2
mov ecx, eax
mov edx, 0x20
cmovb ecx, edx
lea edx, [ebp + 2]
nop dword [eax]
mov edi, ecx
add ecx, ecx
cmp edx, edi
ja 0x440ad0
test eax, eax
je 0x440afc
push edi
push dword [esp + 0xc]
call sym._realloc
add esp, 8
mov ebp, dword [esp + 4]
lea ebx, [ebp + 1]
jmp 0x440b1e
xor ecx, ecx
jmp 0x440b45
mov eax, dword [esp + 8]
jmp 0x440b25
push edi
call sym._malloc
add esp, 4
mov dword [esp + 0x18], eax
lea ebx, [ebp + 1]
push ebx
push dword [esp + 0xc]
push eax
call sym._memcpy
mov eax, dword [esp + 0x24]
add esp, 0xc
mov dword [esp + 8], eax
mov dword [esp], edi
mov dword [esp + 4], ebx
mov byte [eax + ebp], 0x20
mov eax, dword [esp + 4]
mov ecx, dword [esp + 8]
mov byte [ecx + eax], 0
movzx eax, byte [esi + 0x18]
cmp dword [esp + 4], 0
setne cl
movzx eax, al
cvtsi2sd xmm0, eax
sub esp, 0x14
mov eax, dword [esp + 0x30]
movzx eax, word [eax]
mov word [esp + 0xc], ax
movzx eax, cl
mov dword [esp + 0x10], eax
lea eax, [esp + 0x14]
mov dword [esp], eax
movsd qword [esp + 4], xmm0
call dbg.ffPercentAppendNum
add esp, 0x14
mov ebp, dword [esp + 0x58]
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
mov edi, eax
push eax
push dword [esp + 8]
push 1
push dword [esp + 0x14]
call sym._fwrite
add esp, 0x10
push edi
push 0xa
call sym._fputc
add esp, 8
cmp dword [esp], 0
mov dword [esp + 4], 0
je 0x440bc7
mov dword [esp], 0
push dword [esp + 8]
call sym._free
add esp, 4
cmp dword [esi], 0
mov dword [esi + 4], 0
je 0x440be4
mov dword [esi], 0
push dword [esi + 8]
call sym._free
add esp, 4
mov eax, dword [0x5052b0]
mov dword [esi + 8], eax
cmp dword [esi + 0xc], 0
mov dword [esi + 0x10], 0
je 0x4408c0
mov dword [esi + 0xc], 0
push dword [esi + 0x14]
call sym._free
add esp, 4
mov eax, dword [0x5052b0]
jmp 0x4408c0
add ebp, 0x20
push str.No_devices_detected
push 0
push ebp
push 0
push str.Gamepad
call dbg.ffPrintError
add esp, 0x14
jmp 0x440865