Function at 0x416870
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
call fcn.00477ca0
mov cl, byte [eax + 0xf]
test cl, cl
je 0x416c97
push ebx
push ebp
push esi
push edi
xor edi, edi
push edi
call fcn.00417830
add esp, 4
call fcn.00477ca0
mov eax, dword [eax + 0x230]
mov ebx, dword [esp + 0x38]
mov esi, 0x81c7cc
lea eax, [eax + eax*2]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea eax, [eax + eax*4]
lea ecx, [eax + eax*4]
shl ecx, 5
mov dword [esp + 0x10], ecx
xor ebp, ebp
jmp 0x4168c4
mov ecx, dword [esp + 0x10]
mov eax, dword [esi]
cmp eax, edi
je 0x41690b
cmp dword [eax + 0x788], ecx
jb 0x41690b
mov ecx, dword [eax + 0x76c]
mov dword [esp + 0x38], edi
cmp ecx, 0xffffffff
je 0x416901
mov edx, dword [eax + 0x76c]
lea ecx, [esp + 0x38]
push ecx
push edx
call fcn.00407b70
mov eax, dword [esp + 0x40]
add esp, 8
cmp eax, edi
je 0x416901
mov eax, dword [eax]
jmp 0x416906
mov eax, dword [0x89fe34]
cmp eax, ebx
jne 0x41690b
inc ebp
add esi, 4
cmp esi, 0x81cbc8
jl 0x4168c0
mov edi, 1
mov esi, 0x81c7cc
mov eax, dword [esi]
test eax, eax
je 0x4169a0
mov ecx, dword [esp + 0x10]
mov edx, dword [eax + 0x788]
cmp edx, ecx
jb 0x4169a0
mov ecx, dword [eax + 0x76c]
mov dword [esp + 0x38], 0
cmp ecx, 0xffffffff
je 0x416963
lea edx, [esp + 0x38]
mov eax, ecx
push edx
push eax
call fcn.00407b70
mov eax, dword [esp + 0x40]
add esp, 8
test eax, eax
je 0x416963
mov eax, dword [eax]
jmp 0x416968
mov eax, dword [0x89fe34]
cmp eax, ebx
jne 0x416986
xor ecx, ecx
xor eax, eax
test ebp, ebp
jle 0x41697b
add ecx, eax
inc eax
cmp eax, ebp
jl 0x416974
push ecx
mov ecx, dword [esi]
call fcn.0040fc90
dec ebp
jmp 0x4169a0
xor eax, eax
xor ecx, ecx
test edi, edi
jle 0x416995
add eax, ecx
inc ecx
cmp ecx, edi
jl 0x41698e
mov ecx, dword [esi]
neg eax
push eax
call fcn.0040fc90
inc edi
add esi, 4
cmp esi, 0x81cbc8
jl 0x416920
call fcn.00477ca0
mov ecx, dword [eax + 0x25c]
xor ebx, ebx
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], ebx
fild qword [esp + 0x24]
fst dword [esp + 0x14]
fcomp dword [0x7cd7b4]
fnstsw ax
test ah, 0x40
je 0x4169e1
mov dword [esp + 0x14], 0x3f800000
mov ebp, 0x81c7cc
mov dword [esp + 0x1c], ebp
mov eax, dword [ebp]
cmp eax, ebx
je 0x416c77
mov ecx, dword [eax + 0x788]
mov edx, dword [esp + 0x10]
cmp ecx, edx
jb 0x416c77
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x30], ebx
fild qword [esp + 0x2c]
mov eax, dword [eax + 0x760]
cmp eax, 0xffffffff
fmul qword [0x7cdb28]
fdiv dword [esp + 0x14]
fstp dword [esp + 0x24]
je 0x416c4e
push eax
call fcn.0045c0b0
add esp, 4
cmp eax, ebx
je 0x416c4e
mov edx, dword [0x829488]
push ebx
add eax, 0x14
push 4
push eax
lea eax, [edx*4 + 0x82948c]
push eax
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 0x416a7f
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 0x416c42
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, eax
mov dword [0x81c700], ebx
sub edx, ecx
cmp edx, eax
jne 0x416ac7
call fcn.00406630
mov eax, dword [0x820dd0]
mov ecx, dword [0x829478]
mov edx, ecx
sub edx, eax
cmp edx, ecx
jne 0x416ad4
call fcn.00406630
mov ecx, 0x83f450
call fcn.004065e0
mov ecx, dword [0x829468]
cmp eax, ecx
jb 0x416afe
mov edx, eax
or edx, ecx
je 0x416afe
mov edx, eax
sub edx, ecx
cmp edx, 0x3a98
jbe 0x416c42
mov cl, byte [0x81c6fc]
test cl, cl
jne 0x416c42
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 0x416ba9
mov dword [esp + 0x38], 0x820e44
mov eax, dword [esp + 0x38]
mov eax, dword [eax]
cmp eax, ebx
je 0x416b83
mov ecx, dword [eax + 4]
cmp ecx, ebx
jle 0x416b83
mov edi, dword [eax]
mov ebp, dword [edi + 0xc]
sar ebp, 2
cmp edi, ebx
je 0x416b83
test ecx, ecx
jle 0x416b81
mov ecx, edi
call fcn.00406620
xor esi, eax
lea eax, [edi + 0x14]
test ebp, ebp
jle 0x416b72
mov ecx, ebp
mov edx, dword [eax]
add eax, 4
xor esi, edx
dec ecx
jne 0x416b68
mov ecx, dword [esp + 0x38]
mov edi, dword [edi + 4]
inc ebx
mov edx, dword [ecx]
cmp ebx, dword [edx + 4]
jl 0x416b56
xor ebx, ebx
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x38]
mov ecx, dword [0x8294e8]
inc eax
add edx, 4
cmp eax, ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x38], edx
jl 0x416b35
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x20]
cmp esi, dword [0x8294d8]
je 0x416bb6
call fcn.00406630
cmp dword [0x8294e8], ebx
je 0x416c3b
mov ecx, 0x829464
mov dword [esp + 0x38], ebx
call fcn.00406620
test eax, eax
je 0x416bfd
mov ecx, dword [0x829464]
lea eax, [esp + 0x38]
push eax
push ecx
call fcn.00407b70
add esp, 8
test al, al
je 0x416bf8
mov eax, dword [esp + 0x38]
cmp eax, ebx
je 0x416bf8
cmp dword [eax], 0x29874362
je 0x416bfd
call fcn.00406630
mov ecx, 0x8294b0
mov dword [esp + 0x38], ebx
call fcn.00406620
test eax, eax
je 0x416c3b
mov eax, dword [0x8294b0]
lea edx, [esp + 0x38]
push edx
push eax
call fcn.00407b70
add esp, 8
test al, al
je 0x416c36
mov eax, dword [esp + 0x38]
cmp eax, ebx
je 0x416c36
cmp dword [eax], 0xbad0bad
je 0x416c3b
call fcn.00406630
mov byte [0x81c6fc], 0
cmp edi, ebx
je 0x416c4e
mov ecx, dword [edi]
mov dword [esp + 0x38], ecx
jmp 0x416c58
mov edx, dword [0x89fe34]
mov dword [esp + 0x38], edx
fild dword [esp + 0x38]
sub esp, 8
fmul dword [esp + 0x2c]
fstp qword [esp]
call fcn.0066e890
mov ecx, dword [ebp]
add esp, 8
push eax
call fcn.0040fc90
add ebp, 4
cmp ebp, 0x81cbc8
mov dword [esp + 0x1c], ebp
jl 0x4169ea
push ebx
call fcn.00417830
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret