Function at 0x409c40
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x18
mov ecx, dword [esp + 0x28]
push ebx
push ebp
mov ebp, dword [esp + 0x28]
add eax, ebp
mov dword [esp + 0x28], eax
shr eax, cl
mov ebx, 1
shl ebx, cl
push esi
mov esi, eax
xor ecx, ecx
shr esi, 1
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], ebx
mov edx, esi
je 0x409c75
nop
inc ecx
shr edx, 1
jne 0x409c70
mov edx, dword [esp + 0x38]
add ecx, edx
cmp ecx, 0x20
jae 0x409ca5
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
mov eax, dword [esp + 0x2c]
push ecx
mov ecx, dword [esp + 0x2c]
push edx
push ebp
push eax
push edi
push ecx
call fcn.00562b10
add esp, 0x18
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
neg ebp
xor ecx, ecx
test esi, esi
je 0x409cb5
lea ecx, [ecx]
inc ecx
shr esi, 1
jne 0x409cb0
add ecx, edx
xor esi, esi
cmp ecx, 0x20
jae 0x409d64
xor edx, edx
mov dword [esp + 0x2c], edx
test ebx, ebx
jbe 0x409e1a
add ebp, eax
xor ecx, ecx
mov dword [esp + 0x38], 0
mov dword [esp + 0xc], 0
cmp esi, ebp
jae 0x409d47
mov edx, ebp
sub edx, esi
cmp edx, 2
jl 0x409d1c
mov ebx, dword [esp + 0x28]
mov eax, dword [ebx + esi*4]
cdq
xor eax, edx
sub eax, edx
add dword [esp + 0x38], eax
mov eax, dword [ebx + esi*4 + 4]
cdq
xor eax, edx
sub eax, edx
add dword [esp + 0xc], eax
add esi, 2
lea eax, [ebp - 1]
cmp esi, eax
jb 0x409cf1
mov eax, dword [esp + 0x14]
cmp esi, ebp
jae 0x409d33
mov eax, dword [esp + 0x28]
mov eax, dword [eax + esi*4]
cdq
mov ecx, eax
mov eax, dword [esp + 0x14]
xor ecx, edx
sub ecx, edx
inc esi
mov ebx, dword [esp + 0xc]
mov edx, dword [esp + 0x38]
add edx, ebx
mov ebx, dword [esp + 0x18]
add ecx, edx
mov edx, dword [esp + 0x2c]
mov dword [edi + edx*8], ecx
mov dword [edi + edx*8 + 4], 0
inc edx
mov dword [esp + 0x2c], edx
cmp edx, ebx
jb 0x409cd0
jmp 0x409e1a
mov dword [esp + 0x2c], esi
cmp ebx, esi
jbe 0x409e1a
jmp 0x409d76
mov eax, dword [esp + 0x14]
add ebp, eax
xor ecx, ecx
xor eax, eax
xor edx, edx
xor ebx, ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x38], ebp
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], edx
cmp esi, ebp
jae 0x409dfc
mov edx, ebp
sub edx, esi
cmp edx, 2
jl 0x409dda
mov eax, dword [esp + 0x28]
mov eax, dword [eax + esi*4]
cdq
xor eax, edx
sub eax, edx
mov ebp, dword [esp + 0x38]
cdq
add dword [esp + 0xc], eax
adc dword [esp + 0x10], edx
mov edx, dword [esp + 0x28]
mov eax, dword [edx + esi*4 + 4]
cdq
xor eax, edx
sub eax, edx
cdq
add ebx, eax
adc ecx, edx
add esi, 2
lea eax, [ebp - 1]
cmp esi, eax
jb 0x409da1
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
cmp esi, ebp
jae 0x409df0
mov eax, dword [esp + 0x28]
mov eax, dword [eax + esi*4]
cdq
xor eax, edx
sub eax, edx
cdq
inc esi
add ebx, dword [esp + 0xc]
adc ecx, dword [esp + 0x10]
add eax, ebx
adc edx, ecx
mov ecx, dword [esp + 0x2c]
mov dword [edi + ecx*8], eax
mov dword [edi + ecx*8 + 4], edx
inc ecx
mov dword [esp + 0x2c], ecx
cmp ecx, dword [esp + 0x18]
jb 0x409d72
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
dec ecx
xor eax, eax
cmp ecx, edx
mov esi, ebx
jl 0x409e66
sub ecx, edx
inc ecx
mov dword [esp + 0x34], ecx
shr ebx, 1
je 0x409e5f
mov edx, ebx
jmp 0x409e40
mov ecx, dword [edi + eax*8 + 8]
add ecx, dword [edi + eax*8]
mov ebp, dword [edi + eax*8 + 0xc]
adc ebp, dword [edi + eax*8 + 4]
mov dword [edi + esi*8], ecx
mov dword [edi + esi*8 + 4], ebp
inc esi
add eax, 2
sub edx, 1
jne 0x409e40
sub dword [esp + 0x34], 1
jne 0x409e32
pop esi
pop ebp
pop ebx
add esp, 0x18
ret