Function at 0x4be640
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x34
call fcn.00435360
mov eax, dword [0x55d574]
push ebx
push ebp
push esi
test eax, eax
push edi
je 0x4be709
push 0xdc
push 0x5203d8
push 0x13
push 5
call fcn.004af5c0
call fcn.004af590
mov ebp, dword [0x55d578]
xor ecx, ecx
cmp ebp, eax
push 0xde
sete cl
push 0x5203d8
mov esi, ecx
push 0x13
push 6
mov dword [esp + 0x30], esi
call fcn.004af5c0
add esp, 0x20
test esi, esi
jne 0x4be6b6
push 0xe3
push 0x5203d8
push 0x12
push 9
call fcn.004af5c0
add esp, 0x10
mov eax, dword [0x55d55c]
mov edx, dword [0x55d560]
mov ebx, dword [0x55d564]
mov ecx, 5
mov esi, 0x55d544
lea edi, [esp + 0x30]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x4c]
mov ebp, eax
add eax, esi
mov dword [esp + 0x18], edx
cmp eax, 0x3ff
mov dword [esp + 0x1c], ebx
mov dword [0x55d55c], eax
jl 0x4be713
cdq
mov ecx, 0x3ff
idiv ecx
mov dword [0x55d558], ecx
mov dword [0x55d55c], edx
jmp 0x4be72a
mov dword [esp + 0x10], 0
jmp 0x4be6a0
mov ecx, dword [0x55d558]
cmp ecx, 0x3ff
jge 0x4be72a
cmp eax, ecx
jle 0x4be72a
mov dword [0x55d558], eax
mov eax, esi
mov ecx, 0x14
cdq
idiv ecx
xor ecx, ecx
mov eax, 0x66666667
mov edi, dword [esp + 0x10]
test edx, edx
setg cl
imul esi
sar edx, 3
mov eax, edx
shr eax, 0x1f
add edx, eax
add edx, ebx
add edx, ecx
test edi, edi
mov dword [0x55d564], edx
jne 0x4be774
push 0x103
push 0x5203d8
push 0x12
push 0xa
call fcn.004af5c0
add esp, 0x10
lea ecx, [esp + 0x20]
push ecx
call fcn.004ad870
add esp, 4
test esi, esi
jle 0x4be8a9
mov ecx, esi
add esi, 0x13
mov eax, 0xcccccccd
mov ebx, dword [esp + 0x48]
mul esi
shr edx, 4
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x14], edx
jmp 0x4be7aa
mov ecx, dword [esp + 0x4c]
cmp ecx, 0x14
mov esi, ecx
jle 0x4be7b6
mov esi, 0x14
push 0
call fcn.004ae050
lea edx, [esp + 0x24]
push eax
push edx
call fcn.004ad8f0
lea eax, [esp + 0x3c]
push 0x14
lea ecx, [esp + 0x30]
push eax
push ecx
call fcn.004ada60
lea edi, [esi + ebp - 0x3ff]
add esp, 0x18
test edi, edi
jle 0x4be812
mov edx, esi
lea eax, [ebp + 0x55d130]
sub edx, edi
lea ecx, [esp + 0x20]
push edx
push eax
push ecx
call fcn.004ada60
push edi
lea edx, [esp + 0x30]
push 0x55d130
push edx
call fcn.004ada60
add esp, 0x18
jmp 0x4be827
lea eax, [ebp + 0x55d130]
push esi
lea ecx, [esp + 0x24]
push eax
push ecx
call fcn.004ada60
add esp, 0xc
push esi
lea edx, [esp + 0x24]
push ebx
push edx
call fcn.004ada60
lea eax, [esp + 0x24]
push 8
lea ecx, [esp + 0x30]
push eax
push ecx
call fcn.004ada60
lea edx, [esp + 0x48]
push 0
lea eax, [esp + 0x3c]
push edx
push eax
call fcn.004adb60
mov edi, dword [esp + 0x40]
add esp, 0x24
inc edi
add ebx, esi
xor eax, eax
mov dword [esp + 0x1c], edi
test esi, esi
jle 0x4be88b
mov cl, byte [esp + eax + 0x30]
mov dl, byte [ebp + 0x55d130]
xor dl, cl
mov byte [ebp + 0x55d130], dl
inc ebp
cmp ebp, 0x3ff
jl 0x4be886
xor ebp, ebp
inc eax
cmp eax, esi
jl 0x4be869
mov ecx, dword [esp + 0x4c]
mov eax, dword [esp + 0x14]
sub ecx, 0x14
dec eax
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x14], eax
jne 0x4be7a6
mov edi, dword [esp + 0x10]
lea edx, [esp + 0x20]
push edx
call fcn.004adf80
add esp, 4
test edi, edi
jne 0x4be8d0
push 0x12e
push 0x5203d8
push 0x12
push 9
call fcn.004af5c0
add esp, 0x10
xor eax, eax
mov cl, byte [esp + eax + 0x30]
mov bl, byte [eax + 0x55d544]
xor bl, cl
mov byte [eax + 0x55d544], bl
inc eax
cmp eax, 0x14
jl 0x4be8d2
fld qword [0x55d568]
fcomp qword [0x5203d0]
fnstsw ax
test ah, 1
je 0x4be90d
fld qword [0x55d568]
fadd qword [esp + 0x50]
fstp qword [0x55d568]
test edi, edi
pop edi
pop esi
pop ebp
pop ebx
jne 0x4be92b
push 0x139
push 0x5203d8
push 0x12
push 0xa
call fcn.004af5c0
add esp, 0x10
add esp, 0x34
ret