Function at 0x4db900
Capabilities:
Encode data using xor
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x444
mov eax, dword [0x5c4008]
xor eax, esp
mov dword [esp + 0x440], eax
push ebx
mov ebx, dword [0x5cdf08]
mov ecx, 0x70a6a4
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x14]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x28], ebx
call fcn.0056b0a5
cmp byte [ebp + 0xc], 0
lea eax, [esp + 0x60]
push esi
push 0x5cdf70
push str._s__s.sav
push 0x3e8
lea edi, [ebx + 0x14]
mov byte [esp + 0x30], 0
push eax
cmove edi, ebx
call fcn.004dc4f0
add esp, 0x14
lea eax, [esp + 0x60]
push 0x5b1140
push eax
call fcn.00556c35
add esp, 8
mov dword [esp + 0x18], eax
test eax, eax
jne 0x4db99a
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x440]
xor ecx, esp
call fcn.00551170
mov esp, ebp
pop ebp
ret 0x14
push 0xc
call fcn.0055144c
add esp, 4
mov esi, eax
mov dword [esp + 0x24], esi
push 0x3e8
call fcn.00555564
add esp, 4
mov dword [esi + 8], eax
mov dword [esi], 0x3e8
mov dword [esi + 4], 0
push 0xc
call fcn.0055144c
add esp, 4
mov ebx, eax
mov dword [esp + 0x10], ebx
push 0x3e8
call fcn.00555564
add esp, 4
mov dword [ebx + 8], eax
mov ecx, edi
mov dword [ebx], 0x3e8
mov dword [ebx + 4], 0
call fcn.004ea700
mov ebx, eax
test ebx, ebx
je 0x4dbb0e
nop word [eax + eax]
mov edi, dword [ebx]
cmp edi, vtable.CSounds.0
jne 0x4dbda5
jmp 0x4dbafc
mov eax, dword [esp + 0x10]
mov edi, dword [ebx + 0x20]
mov ecx, dword [eax + 4]
mov dword [esp + 0x14], ecx
lea edx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x4dba34
lea eax, [ecx + 1]
sub edi, edx
add eax, edi
mov ecx, esi
push eax
call fcn.004db3e0
mov eax, dword [ebx + 0x20]
inc edi
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov dword [esp + 0xc], eax
mov eax, ecx
sub eax, edx
cmp eax, edi
ja 0x4dba84
lea eax, [ecx + 0x3e8]
cmp edi, 0x3e8
jb 0x4dba70
lea eax, [ecx + edi]
push eax
push dword [esi + 8]
mov dword [esi], eax
call fcn.00556af6
mov edx, dword [esi + 4]
add esp, 8
mov dword [esi + 8], eax
mov eax, dword [esi + 8]
push edi
push dword [esp + 0x10]
add eax, edx
push eax
call fcn.00554b70
mov eax, dword [esp + 0x1c]
add esp, 0xc
add dword [esi + 4], edi
mov ecx, dword [esi]
mov edx, dword [esi + 4]
mov eax, dword [eax + 8]
mov edi, dword [esp + 0x14]
mov dword [esp + 0xc], eax
mov eax, ecx
sub eax, edx
cmp eax, edi
ja 0x4dbadb
lea eax, [ecx + 0x3e8]
cmp edi, 0x3e8
jb 0x4dbac7
lea eax, [ecx + edi]
push eax
push dword [esi + 8]
mov dword [esi], eax
call fcn.00556af6
mov edx, dword [esi + 4]
add esp, 8
mov dword [esi + 8], eax
mov eax, dword [esi + 8]
push edi
push dword [esp + 0x10]
add eax, edx
push eax
call fcn.00554b70
mov eax, dword [esp + 0x1c]
add esp, 0xc
add dword [esi + 4], edi
mov dword [eax + 4], 0
lea ecx, [ebx + 4]
call fcn.004ea7b0
mov ebx, eax
test ebx, ebx
jne 0x4dba10
mov ebx, dword [esi + 4]
xor ecx, ecx
mov edx, dword [esi + 8]
mov dword [esp + 0x24], edx
test ebx, ebx
jle 0x4dbb99
cmp ebx, 0x40
jb 0x4dbb86
mov eax, ebx
and eax, 0x8000003f
jns 0x4dbb31
dec eax
or eax, 0xffffffc0
inc eax
movaps xmm2, xmmword [0x5b4910]
mov edi, ebx
sub edi, eax
nop dword [eax]
movups xmm0, xmmword [edx + ecx]
movaps xmm1, xmm2
pxor xmm1, xmm0
movups xmmword [edx + ecx], xmm1
movups xmm0, xmmword [edx + ecx + 0x10]
movaps xmm1, xmm2
pxor xmm0, xmm2
movups xmmword [edx + ecx + 0x10], xmm0
movups xmm0, xmmword [edx + ecx + 0x20]
pxor xmm1, xmm0
movups xmmword [edx + ecx + 0x20], xmm1
movups xmm0, xmmword [edx + ecx + 0x30]
movaps xmm1, xmm2
pxor xmm1, xmm0
movups xmmword [edx + ecx + 0x30], xmm1
add ecx, 0x40
cmp ecx, edi
jl 0x4dbb40
cmp ecx, ebx
jge 0x4dbb99
nop word [eax + eax]
xor byte [ecx + edx], 0x6a
inc ecx
cmp ecx, ebx
jl 0x4dbb90
lea edi, [ebx + 0x64]
lea edi, [edi + edi*2]
push edi
call fcn.00555564
push ebx
push dword [esp + 0x2c]
lea edx, [esp + 0x18]
mov dword [esp + 0x20], eax
mov ecx, eax
mov dword [esp + 0x18], edi
call fcn.0054a250
mov eax, dword [0x5b114c]
add esp, 0xc
movq xmm0, qword [str.PSE_savegame]
mov edx, 0x30
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x58], ebx
mov ebx, dword [esp + 0xc]
movq qword [esp + 0x30], xmm0
mov eax, dword [eax + 0x28]
mov dword [esp + 0x40], eax
mov eax, dword [ebp + 0x18]
mov dword [esp + 0x3c], 0xab57c8af
mov dword [esp + 0x44], 0
mov byte [esp + 0x48], 0
mov dword [esp + 0x4c], 0xffffffff
mov dword [esp + 0x50], 0xffffffff
mov dword [esp + 0x54], edx
mov dword [esp + 0x5c], ebx
cmp eax, 0xffffffff
jne 0x4dbc7b
lea eax, [esp + 0x28]
push eax
call fcn.00556cd0
add esp, 4
lea eax, [esp + 0x28]
push eax
call fcn.00556f9c
mov ecx, dword [esp + 0x48]
mov edi, eax
add esp, 4
or ecx, dword [edi + 4]
mov dword [esp + 0x44], ecx
mov edx, dword [edi + 8]
shl edx, 6
or edx, ecx
mov dword [esp + 0x44], edx
mov eax, dword [edi + 0xc]
shl eax, 0xb
or eax, edx
mov edx, dword [esp + 0x54]
mov dword [esp + 0x44], eax
mov ecx, dword [edi + 0x10]
shl ecx, 0x10
or ecx, eax
mov dword [esp + 0x44], ecx
mov eax, dword [edi + 0x14]
shl eax, 0x14
or eax, ecx
mov dword [esp + 0x44], eax
xor edi, edi
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4dbcb3
mov edi, eax
xor ecx, ecx
cmp word [edi], cx
je 0x4dbc9c
lea eax, [eax + 2]
inc ecx
cmp word [eax], 0
jne 0x4dbc92
lea edx, [edx + ecx*2]
add edx, 2
lea edi, [ecx*2 + 2]
mov dword [esp + 0x54], edx
mov dword [esp + 0x4c], edi
jmp 0x4dbcc4
mov eax, dword [ebp + 0x10]
cmp eax, 0xffffffff
je 0x4dbcc4
mov byte [esp + 0x48], 1
mov dword [esp + 0x4c], eax
push dword [esp + 0x18]
lea eax, [esp + 0x34]
push 0x30
push 1
push eax
call fcn.005571d5
add esp, 0x10
cmp eax, 0x30
jne 0x4dbd25
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x4dbcfa
push dword [esp + 0x18]
push edi
push 1
push eax
call fcn.005571d5
add esp, 0x10
cmp eax, edi
jne 0x4dbd25
push dword [esp + 0x18]
mov edi, dword [esp + 0x18]
push ebx
push 1
push edi
call fcn.005571d5
mov ecx, dword [esp + 0x30]
add esp, 0x10
cmp eax, ebx
movzx ecx, cl
mov edx, 1
cmove ecx, edx
mov dword [esp + 0x20], ecx
jmp 0x4dbd29
mov edi, dword [esp + 0x14]
push dword [esp + 0x18]
call fcn.005572b0
mov eax, dword [esi + 8]
add esp, 4
test eax, eax
je 0x4dbd4c
push eax
call fcn.005550e4
add esp, 4
mov dword [esi + 8], 0
push 0xc
push esi
call fcn.0055143e
mov ebx, dword [esp + 0x18]
add esp, 8
mov eax, dword [ebx + 8]
test eax, eax
je 0x4dbd72
push eax
call fcn.005550e4
add esp, 4
mov dword [ebx + 8], 0
push 0xc
push ebx
call fcn.0055143e
add esp, 8
test edi, edi
je 0x4dbd8a
push edi
call fcn.005550e4
add esp, 4
mov ecx, dword [esp + 0x44c]
mov al, byte [esp + 0x20]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00551170
mov esp, ebp
pop ebp
ret 0x14
mov edi, dword [edi]
mov ecx, edi
call dword [0x579378]
mov ecx, ebx
call edi
test al, al
jne 0x4dbafc
mov edi, dword [ebx]
cmp edi, vtable.CSounds.0
je 0x4dba23
push dword [esp + 0x10]
mov edi, dword [edi + 8]
mov ecx, edi
call dword [0x579378]
mov ecx, ebx
call edi
jmp 0x4dba23