Function at 0x4158b0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x14
mov eax, dword [0x81cfec]
push ebx
xor ebx, ebx
push ebp
push esi
cmp eax, ebx
push edi
mov dword [esp + 0x14], eax
je 0x415b28
mov eax, dword [esp + 0x14]
mov ebp, dword [eax + 4]
mov dword [esp + 0x1c], ebp
cmp byte [ebp + 0x7bd], 1
jne 0x415b16
mov eax, dword [ebp + 0x76c]
cmp eax, 0xffffffff
je 0x415b0b
push eax
call fcn.0045c0b0
add esp, 4
cmp eax, ebx
je 0x415b0b
mov ecx, dword [0x829488]
push ebx
add eax, 0x14
push 4
lea edx, [ecx*4 + 0x82948c]
push eax
push edx
call fcn.0045cba0
mov eax, dword [0x829488]
add esp, 0x10
lea edi, [eax*4 + 0x82948c]
inc eax
cmp eax, 8
mov dword [esp + 0x20], edi
mov dword [0x829488], eax
jl 0x415940
mov dword [0x829488], ebx
push ebx
call fcn.0045d120
mov eax, dword [0x81c700]
add esp, 4
inc eax
cmp eax, 0x186a0
mov dword [0x81c700], eax
jb 0x415b03
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, eax
mov dword [0x81c700], ebx
sub edx, ecx
cmp edx, eax
jne 0x415988
call fcn.00406630
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, ecx
sub edx, eax
cmp edx, ecx
jne 0x415995
call fcn.00406630
mov ecx, 0x83f450
call fcn.004065e0
mov ecx, dword [0x829468]
cmp eax, ecx
jb 0x4159bf
mov edx, ecx
or edx, eax
je 0x4159bf
mov edx, eax
sub edx, ecx
cmp edx, 0x3a98
jbe 0x415b03
mov cl, byte [0x81c6fc]
test cl, cl
jne 0x415b03
mov esi, dword [0x829478]
mov dword [0x829468], eax
mov eax, dword [0x8294e8]
mov byte [0x81c6fc], 1
cmp eax, ebx
mov dword [esp + 0x18], ebx
not esi
jle 0x415a6a
mov dword [esp + 0x10], 0x820e44
mov eax, dword [esp + 0x10]
mov eax, dword [eax]
cmp eax, ebx
je 0x415a44
mov ecx, dword [eax + 4]
cmp ecx, ebx
jle 0x415a44
mov edi, dword [eax]
mov ebp, dword [edi + 0xc]
sar ebp, 2
cmp edi, ebx
je 0x415a44
test ecx, ecx
jle 0x415a42
mov ecx, edi
call fcn.00406620
xor esi, eax
lea eax, [edi + 0x14]
test ebp, ebp
jle 0x415a33
mov ecx, ebp
mov edx, dword [eax]
add eax, 4
xor esi, edx
dec ecx
jne 0x415a29
mov ecx, dword [esp + 0x10]
mov edi, dword [edi + 4]
inc ebx
mov edx, dword [ecx]
cmp ebx, dword [edx + 4]
jl 0x415a17
xor ebx, ebx
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
mov ecx, dword [0x8294e8]
inc eax
add edx, 4
cmp eax, ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], edx
jl 0x4159f6
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
cmp esi, dword [0x8294d8]
je 0x415a77
call fcn.00406630
cmp dword [0x8294e8], ebx
je 0x415afc
mov ecx, 0x829464
mov dword [esp + 0x10], ebx
call fcn.00406620
test eax, eax
je 0x415abe
mov ecx, dword [0x829464]
lea eax, [esp + 0x10]
push eax
push ecx
call fcn.00407b70
add esp, 8
test al, al
je 0x415ab9
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x415ab9
cmp dword [eax], 0x29874362
je 0x415abe
call fcn.00406630
mov ecx, 0x8294b0
mov dword [esp + 0x10], ebx
call fcn.00406620
test eax, eax
je 0x415afc
mov eax, dword [0x8294b0]
lea edx, [esp + 0x10]
push edx
push eax
call fcn.00407b70
add esp, 8
test al, al
je 0x415af7
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x415af7
cmp dword [eax], 0xbad0bad
je 0x415afc
call fcn.00406630
mov byte [0x81c6fc], 0
cmp edi, ebx
je 0x415b0b
mov eax, dword [edi]
jmp 0x415b10
mov eax, dword [0x89fe34]
cmp eax, dword [esp + 0x28]
je 0x415b32
mov ecx, dword [esp + 0x14]
mov eax, dword [ecx]
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x4158ca
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x14
ret
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x14
ret