Function at 0x409ea0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x78
mov eax, dword [0x4ade78]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x60], ebx
mov dword [ebp - 0x70], edi
call fcn.0040cee0
test al, al
jne 0x409f29
mov eax, dword [0x4af2c0]
cdq
sub eax, edx
sar eax, 1
mov dword [ebp - 0x74], eax
mov eax, 0x55555556
imul dword [0x4af2c0]
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [ebp - 0x78], eax
mov dword [ebp - 0x5c], 0
lea ecx, [ebp - 0x57]
xor eax, eax
mov edx, dword [0x4af2c0]
mov bl, dl
sub bl, al
mov esi, 1
mov edi, 0xe
lea ebx, [ebx]
add ecx, 3
inc esi
dec edi
jne 0x409f10
mov eax, dword [ebp - 0x5c]
inc eax
mov dword [ebp - 0x5c], eax
cmp eax, 2
jl 0x409ef6
mov edi, dword [ebp - 0x70]
mov ebx, dword [ebp - 0x60]
test edi, edi
je 0x40a0b5
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x60]
push ebx
push eax
mov dword [ebp - 0x6c], 0
mov dword [ebp - 0x68], 0
mov dword [ebp - 0x64], 0
call fcn.00452c50
add esp, 8
push eax
call fcn.0045b6a0
mov edx, dword [ebp - 0x60]
add esp, 8
test al, al
sete bl
add edx, 0xfffffff0
or eax, 0xffffffff
lea ecx, [edx + 0xc]
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x409f82
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test bl, bl
jne 0x40a078
lea eax, [ebp - 0x6c]
push eax
lea eax, [ebp - 0x5c]
push eax
call fcn.00455b50
mov eax, dword [ebp - 0x5c]
add esp, 4
add eax, 0xfffffff0
mov esi, esp
push eax
call fcn.00403ee0
add eax, 0x10
add esp, 4
mov dword [esi], eax
call fcn.00452960
mov dword [edi], eax
mov esi, dword [0x4af2c0]
mov eax, esi
imul eax, esi
cdq
mov ecx, 0x17
idiv ecx
add esp, 4
cmp edx, 0x15
jne 0x40a05b
xor edx, edx
mov ecx, edx
and ecx, 1
dec ecx
not ecx
and ecx, esi
mov eax, edx
sar eax, 1
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, esi
sar ecx, 1
xor eax, ecx
mov ecx, eax
and ecx, 1
dec ecx
sar eax, 1
not ecx
and ecx, esi
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, esi
sar ecx, 1
xor eax, ecx
mov ecx, eax
and ecx, 1
dec ecx
sar eax, 1
not ecx
and ecx, esi
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, esi
sar ecx, 1
xor eax, ecx
mov ecx, eax
and ecx, 1
dec ecx
sar eax, 1
not ecx
and ecx, esi
xor ecx, eax
mov eax, ecx
and eax, 1
dec eax
not eax
and eax, esi
sar ecx, 1
xor eax, ecx
inc edx
add esi, eax
cmp edx, 0x100
jl 0x409fd8
mov dword [0x4af2c0], esi
mov edx, dword [ebp - 0x5c]
add edx, 0xfffffff0
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40a078
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x6c]
test esi, esi
je 0x40a0b5
mov edi, dword [ebp - 0x68]
cmp esi, edi
je 0x40a0ac
mov edx, dword [esi]
sub edx, 0x10
or ecx, 0xffffffff
lea eax, [edx + 0xc]
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40a0a2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 4
cmp esi, edi
jne 0x40a086
mov esi, dword [ebp - 0x6c]
push esi
call fcn.00460a34
add esp, 4
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
xor eax, eax
pop ebx
call fcn.00461234
mov esp, ebp
pop ebp
ret 0xc