Function at 0x470580
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55fb51
mov eax, dword fs:[0]
push eax
sub esp, 0x134
mov eax, dword [0x61308c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, edx
mov esi, ecx
mov eax, dword [ebp + 0xc]
push 0x5a85c8
push dword [ebp + 8]
mov dword [ebp - 0x13c], eax
mov byte [ebp - 0x119], 1
call fcn.0052e763
add esp, 8
mov dword [ebp - 0x138], eax
test eax, eax
jne 0x470612
test edi, edi
je 0x47060b
lea ecx, [ebp - 0x118]
call fcn.00471470
mov dword [ebp - 4], 0
mov ecx, edi
push eax
call fcn.00407b60
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x118]
call fcn.00404780
xor al, al
jmp 0x47088d
mov eax, dword [ebp - 0x13c]
test eax, eax
je 0x470626
mov edx, dword [eax]
mov dword [ebp - 0x140], edx
jmp 0x470630
mov dword [ebp - 0x140], 0
mov eax, dword [esi + 0x10]
xorps xmm0, xmm0
xor ecx, ecx
movq qword [ebp - 0x18], xmm0
mov dword [ebp - 0x12c], eax
mov dword [ebp - 0x120], 0
mov dword [ebp - 0x128], ecx
movups xmmword [ebp - 0x38], xmm0
movups xmmword [ebp - 0x28], xmm0
test eax, eax
je 0x4707bc
cmp dword [esi + 0x14], 8
mov edx, 0xfde9
push ecx
mov dword [ebp - 0x130], edx
mov ecx, esp
jb 0x47067b
mov eax, dword [esi]
jmp 0x47067d
mov eax, esi
mov dword [ecx], eax
lea ecx, [ebp - 0x118]
call fcn.00470fc0
add esp, 4
mov dword [ebp - 4], 1
cmp dword [ebp - 0x108], 0
je 0x4706d4
cmp dword [ebp - 0x104], 8
lea ecx, [ebp - 0x118]
push 5
cmovae ecx, dword [ebp - 0x118]
mov edx, str.UTF_8
call fcn.00474980
xor edx, edx
add esp, 4
test eax, eax
mov ecx, 0xfde9
cmovne ecx, edx
mov dword [ebp - 0x130], ecx
jmp 0x4706d9
mov ecx, 0xfde9
cmp dword [esi + 0x14], 8
jb 0x4706e3
mov eax, dword [esi]
jmp 0x4706e5
mov eax, esi
push 0
push 0
push 0
push 0
push dword [ebp - 0x12c]
push eax
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x120], eax
inc eax
push eax
mov dword [ebp - 0x124], eax
call fcn.00512116
add esp, 4
mov dword [ebp - 0x134], eax
cmp dword [esi + 0x14], 8
jb 0x470721
mov esi, dword [esi]
mov edx, dword [ebp - 0x130]
lea eax, [ebp - 0x128]
xor ecx, ecx
mov dword [ebp - 0x128], 0
cmp dword [ebp - 0x120], ecx
cmovne ecx, dword [ebp - 0x124]
cmp edx, 0xfde9
mov dword [ebp - 0x124], 0
cmove eax, dword [ebp - 0x124]
push eax
push 0
push ecx
push dword [ebp - 0x134]
push dword [ebp - 0x12c]
push esi
push 0
push edx
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push dword [ebp - 0x138]
mov esi, dword [ebp - 0x134]
push 1
push dword [ebp - 0x120]
push esi
call fcn.0052edd8
cmp eax, 1
push esi
sete byte [ebp - 0x119]
call fcn.0051211f
add esp, 0x14
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x118]
call fcn.00404780
mov ecx, dword [ebp - 0x128]
test ecx, ecx
mov edx, 0x5a8618
mov eax, str.__chars_lost_in_conversion__
cmove eax, edx
push eax
push dword [ebp - 0x120]
lea eax, [ebp - 0x38]
push eax
push dword [ebp - 0x12c]
lea eax, [ebp - 0x100]
push str._d_wide_chars_to__s_d_bytes_s
push eax
call fcn.00415840
add esp, 0x18
test edi, edi
je 0x47082e
cmp word [ebp - 0x100], 0
jne 0x470802
xor ecx, ecx
jmp 0x47081f
lea ecx, [ebp - 0x100]
lea edx, [ecx + 2]
nop dword [eax + eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x470810
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [ebp - 0x100]
mov ecx, edi
push eax
call fcn.00404d30
cmp byte [ebp - 0x119], 0
jne 0x470867
test edi, edi
je 0x470867
lea ecx, [ebp - 0x118]
call fcn.00471470
mov dword [ebp - 4], 2
mov ecx, edi
push eax
call fcn.00407b60
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x118]
call fcn.00404780
push dword [ebp - 0x138]
call fcn.0052e84e
mov eax, dword [ebp - 0x13c]
add esp, 4
test eax, eax
je 0x470887
mov ecx, dword [ebp - 0x140]
mov dword [eax], ecx
mov al, byte [ebp - 0x119]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005120a1
mov esp, ebp
pop ebp
ret