Function at 0x10040240
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x108
mov eax, dword [0x10101040]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
mov edx, ecx
mov dword [ebp - 0x9c], edx
mov eax, dword [0x10103540]
mov dword [ebp - 0xa0], eax
mov eax, dword [edx + 0x168]
xor edi, edi
mov dword [ebp - 0x7c], eax
movzx eax, word [edx + 0x1dc]
mov ecx, eax
mov dword [ebp - 0xa4], eax
movzx eax, word [edx + 0x1e0]
mov dword [ebp - 0xe8], ecx
mov ecx, eax
mov dword [ebp - 0xe4], ecx
lea ecx, [edi + 4]
mov dword [ebp - 0xb8], eax
lea eax, [ebp - 0x64]
mov dword [ebp - 0x74], edi
nop dword [eax]
mov dword [eax - 4], edi
lea eax, [eax + 0x18]
mov dword [eax - 0x18], edi
mov dword [eax - 0x14], edi
mov dword [eax - 0x10], edi
mov dword [eax - 0xc], edi
mov dword [eax - 8], edi
sub ecx, 1
jne 0x100402c0
mov eax, dword [edx + 0x40]
mov ecx, dword [ebp - 0xa0]
lea eax, [eax*2 + 0x23]
sar eax, 3
lea ecx, [ecx + 0x60e4]
and eax, 0xfffffffc
mov dword [ebp - 0x90], eax
movd xmm0, eax
lea esi, [eax + eax*4]
pshufd xmm0, xmm0, 0
push esi
movaps xmmword [ebp - 0x100], xmm0
call fcn.1002bed0
push esi
mov esi, dword [ebp - 0xa0]
push 0
push dword [esi + 0x60ec]
call fcn.10065d90
mov eax, dword [esi + 0x60ec]
add esp, 0xc
cmp dword [0x10102c90], 2
jl 0x10040381
movaps xmm1, xmmword [0x100f9070]
pmulld xmm1, xmmword [ebp - 0x100]
movd xmm0, dword [esi + 0x60ec]
pshufd xmm0, xmm0, 0
paddd xmm1, xmm0
movd dword [ebp - 0x54], xmm1
psrldq xmm1, 4
movd dword [ebp - 0x3c], xmm1
psrldq xmm1, 4
movd dword [ebp - 0x24], xmm1
psrldq xmm1, 4
movd dword [ebp - 0xc], xmm1
jmp 0x100403ab
xor ecx, ecx
lea edx, [ebp - 0x54]
mov edi, eax
lea esi, [ecx + 4]
nop dword [eax + eax]
lea eax, [edi + ecx]
add ecx, dword [ebp - 0x90]
mov dword [edx], eax
lea edx, [edx + 0x18]
sub esi, 1
jne 0x10040390
mov esi, dword [ebp - 0xa0]
xor edi, edi
mov eax, dword [esi + 0x60ec]
mov ecx, dword [ebp - 0x90]
mov esi, dword [ebp - 0x9c]
lea eax, [eax + ecx*4]
mov dword [ebp - 0x6c], eax
xor eax, eax
mov dword [ebp - 0x88], eax
cmp dword [esi + 0x40], eax
jle 0x10040bfb
mov dword [ebp - 0x8c], eax
nop word [eax + eax]
mov ecx, eax
mov edx, 1
and ecx, 0x1f
shl edx, cl
mov ecx, eax
mov eax, dword [esi + 0x30]
sar ecx, 5
test dword [eax + ecx*4], edx
je 0x1004064d
mov esi, dword [esi + 0x10]
xor eax, eax
add esi, dword [ebp - 0x8c]
cmp word [ebp - 0xa4], ax
mov dword [ebp - 0xb4], esi
setg al
inc eax
xor edx, edx
mov dword [ebp - 0x98], eax
mov dword [ebp - 0x84], edx
test edx, edx
jne 0x10040431
movzx eax, word [esi + 0x5e]
jmp 0x10040435
movzx eax, word [esi + 0x60]
mov ecx, dword [ebp - 0x7c]
movzx eax, ax
mov dword [ebp - 0xb0], eax
mov ecx, dword [ecx + 0x10]
lea eax, [eax + eax*2]
mov dword [ebp - 0x78], ecx
mov dword [ebp - 0x80], eax
mov eax, dword [ecx + eax*8]
mov ecx, eax
mov dword [ebp - 0x94], eax
test eax, eax
jle 0x100404ac
mov esi, dword [ebp - 0x80]
lea edi, [eax + eax*4]
mov eax, dword [ebp - 0x78]
mov edx, dword [eax + esi*8 + 8]
mov eax, ecx
mov esi, dword [ebp - 0xb4]
cmp dword [edx + edi*8 - 0xc], 0
mov edx, dword [ebp - 0x84]
jne 0x100404a9
mov esi, dword [ebp - 0x80]
mov eax, dword [ebp - 0x78]
mov edx, dword [eax + esi*8 + 8]
mov eax, ecx
mov esi, dword [ebp - 0xb4]
cmp dword [edx + edi*8 - 8], 0
mov edx, dword [ebp - 0x84]
jne 0x100404a9
mov edi, dword [ebp - 0x78]
lea ecx, [eax - 1]
mov eax, dword [ebp - 0x80]
mov dword [edi + eax*8], ecx
mov edi, dword [ebp - 0x74]
cmp ecx, 1
jne 0x1004062b
test dword [esi], 0x100
jne 0x100404f2
cmp word [ebp - 0xa4], 0
jg 0x100404d3
movss xmm0, dword [esi + 0x44]
maxss xmm0, dword [esi + 0x48]
jmp 0x100404e8
test edx, edx
jne 0x100404e3
movss xmm0, dword [esi + 0x40]
maxss xmm0, dword [esi + 0x48]
jmp 0x100404e8
movss xmm0, dword [esi + 0x44]
comiss xmm0, dword [esi + 0x28]
ja 0x1004062b
cmp word [ebp - 0xb8], 0
jle 0x10040515
mov eax, dword [ebp - 0x9c]
movsx eax, word [eax + 0x1e0]
cmp dword [ebp - 0x88], eax
jge 0x10040515
xor ecx, ecx
jmp 0x1004051a
mov ecx, 1
cmp word [ebp - 0xa4], 0
jle 0x1004052c
test edx, edx
jne 0x1004052c
xor eax, eax
jmp 0x10040531
mov eax, 2
add eax, ecx
mov dword [ebp - 0xa8], eax
lea edi, [eax + eax*2]
cmp dword [ebp + edi*8 - 0x58], 0
lea eax, [ebp + edi*8 - 0x64]
lea ecx, [ebp + edi*8 - 0x60]
mov dword [ebp - 0x94], eax
lea edx, [ebp + edi*8 - 0x5c]
mov dword [ebp - 0xac], ecx
mov dword [ebp - 0x70], edx
jne 0x1004057a
mov dword [ebp + edi*8 - 0x68], 0x7f7fffff
mov dword [eax], 0x7f7fffff
mov dword [ecx], 0xff7fffff
mov dword [edx], 0xff7fffff
jmp 0x10040589
mov dword [ebp - 0x94], eax
mov dword [ebp - 0xac], ecx
mov dword [ebp - 0x70], edx
mov eax, dword [ebp - 0xb0]
mov ecx, eax
mov edx, dword [ebp + edi*8 - 0x54]
and eax, 0x1f
shr ecx, 5
mov dword [ebp - 0xb0], eax
mov esi, dword [ebp - 0xb0]
mov eax, dword [edx + ecx*4]
bts eax, esi
mov esi, dword [ebp - 0xb4]
mov dword [edx + ecx*4], eax
inc dword [ebp + edi*8 - 0x58]
mov eax, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x78]
movss xmm0, dword [ebp + edi*8 - 0x68]
mov eax, dword [ecx + eax*8 + 8]
movss xmm4, dword [eax]
comiss xmm0, xmm4
movss xmm1, dword [eax + 4]
movss xmm2, dword [eax + 8]
movss xmm3, dword [eax + 0xc]
jbe 0x100405e8
movss dword [ebp + edi*8 - 0x68], xmm4
mov eax, dword [ebp - 0x94]
movss xmm0, dword [eax]
comiss xmm0, xmm1
jbe 0x100405fb
movss dword [eax], xmm1
mov eax, dword [ebp - 0xac]
comiss xmm2, dword [eax]
jbe 0x1004060a
movss dword [eax], xmm2
mov eax, dword [ebp - 0x70]
comiss xmm3, dword [eax]
jbe 0x10040616
movss dword [eax], xmm3
mov edi, dword [ebp - 0x74]
mov eax, dword [ebp - 0xa8]
bts edi, eax
mov edx, dword [ebp - 0x84]
mov dword [ebp - 0x74], edi
inc edx
mov dword [ebp - 0x84], edx
cmp edx, dword [ebp - 0x98]
jl 0x10040427
mov eax, 0xffff
mov word [esi + 0x5c], ax
mov esi, dword [ebp - 0x9c]
mov eax, dword [ebp - 0x88]
add dword [ebp - 0x8c], 0x70
inc eax
mov dword [ebp - 0x88], eax
cmp eax, dword [esi + 0x40]
jl 0x100403e0
test edi, edi
je 0x10040bfb
mov ecx, dword [ebp - 0x7c]
mov eax, dword [ebp - 0xa0]
add eax, 0x4df4
mov dword [ebp - 0x70], eax
mov esi, dword [ecx + 4]
sub esi, 2
mov edi, dword [eax + 4]
cmp esi, edi
jle 0x100406bc
test edi, edi
je 0x100406a1
mov eax, edi
cdq
sub eax, edx
mov ecx, eax
sar ecx, 1
add ecx, edi
jmp 0x100406a6
mov ecx, 8
cmp ecx, esi
mov eax, esi
cmovg eax, ecx
mov ecx, dword [ebp - 0x70]
push eax
call fcn.1003c4f0
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x7c]
mov dword [eax], esi
mov eax, dword [ebp - 0xa0]
mov edx, dword [ecx + 4]
dec edx
mov dword [ebp - 0xa8], edx
mov edi, dword [eax + 0x4dfc]
mov eax, 2
mov dword [ebp - 0x80], edi
mov dword [ebp - 0x70], eax
cmp edx, eax
jl 0x1004074b
mov ecx, edx
and ecx, 0x1f
mov dword [ebp - 0x98], ecx
nop
mov esi, eax
mov edi, eax
or eax, 0x1f
sar edi, 5
and esi, 0x1f
mov ecx, 0x1f
cmp edx, eax
cmovle ecx, dword [ebp - 0x98]
xor edx, edx
inc ecx
xor eax, eax
bts edx, ecx
cmp ecx, 0x20
cmovae eax, edx
xor ecx, ecx
xor edx, eax
bts ecx, esi
xor eax, eax
dec edx
cmp esi, 0x20
cmovae eax, ecx
xor ecx, eax
mov eax, dword [ebp - 0x6c]
neg ecx
and edx, ecx
or dword [eax + edi*4], edx
mov eax, dword [ebp - 0x70]
mov edx, dword [ebp - 0xa8]
add eax, 0x20
and eax, 0xffffffe0
mov dword [ebp - 0x70], eax
cmp eax, edx
jle 0x100406f0
mov edi, dword [ebp - 0x9c]
mov eax, dword [ebp - 0x6c]
movaps xmm2, xmmword [0x100f93b0]
movzx edx, word [edi + 0x1e8]
mov ecx, edx
and edx, 0x1f
shr ecx, 5
mov eax, dword [eax + ecx*4]
btr eax, edx
mov edx, dword [ebp - 0x6c]
mov dword [edx + ecx*4], eax
xor eax, eax
cmp word [ebp - 0xa4], ax
mov ecx, dword [ebp - 0x7c]
movups xmm0, xmmword [edi + 0x134]
setg al
add eax, 2
mov esi, dword [ecx + 4]
sub esi, eax
xor edi, edi
movups xmmword [ebp - 0xe0], xmm0
mov dword [ebp - 0x74], esi
movss xmm1, dword [ebp - 0xd4]
movss xmm3, dword [ebp - 0xd8]
movss xmm7, dword [ebp - 0xe0]
mov dword [ebp - 0x84], edi
nop
lea eax, [edi + edi*2]
shl eax, 3
mov dword [ebp - 0x78], eax
mov ecx, dword [ebp + eax - 0x58]
mov dword [ebp - 0x8c], ecx
test ecx, ecx
je 0x10040b0a
movups xmm0, xmmword [ebp + eax - 0x68]
mov ecx, edi
movups xmmword [ebp - 0xd0], xmm0
and ecx, 1
je 0x10040802
cmp word [ebp - 0xe4], 0
jle 0x10040802
movss xmm6, dword [ebp - 0xd0]
jmp 0x10040812
movss xmm6, dword [ebp - 0xd0]
comiss xmm7, xmm6
ja 0x10040812
movaps xmm6, xmm7
and edi, 2
je 0x1004082b
cmp word [ebp - 0xa4], 0
jle 0x1004082b
movss xmm5, dword [ebp - 0xcc]
jmp 0x10040843
movss xmm5, dword [ebp - 0xcc]
movss xmm0, dword [ebp - 0xdc]
comiss xmm0, xmm5
ja 0x10040843
movaps xmm5, xmm0
movss xmm4, dword [ebp - 0xc8]
test ecx, ecx
je 0x10040857
comiss xmm4, xmm3
jae 0x10040857
movaps xmm4, xmm3
test edi, edi
je 0x1004087c
mov ecx, dword [ebp - 0x9c]
test dword [ecx + 4], 0x20000
jne 0x1004087c
movss xmm3, dword [ebp - 0xc4]
comiss xmm3, xmm1
jae 0x10040884
movaps xmm3, xmm1
jmp 0x10040884
movss xmm3, dword [ebp - 0xc4]
sub esi, dword [ebp + eax - 0x58]
xor ecx, ecx
mov dword [ebp - 0x74], esi
mov esi, dword [ebp - 0x90]
sar esi, 2
mov dword [ebp - 0xac], esi
test esi, esi
jle 0x10040a24
cmp esi, 2
jb 0x10040a10
mov edi, dword [ebp + eax - 0x54]
lea edx, [ebp + eax - 0x54]
mov eax, dword [ebp - 0x6c]
mov dword [ebp - 0x94], edx
lea eax, [eax + esi*4]
add eax, 0xfffffffc
mov dword [ebp - 0x70], eax
lea eax, [esi - 1]
lea eax, [edi + eax*4]
cmp dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x70]
ja 0x100408dd
cmp eax, edi
jae 0x10040a07
cmp dword [ebp - 0x6c], edx
ja 0x100408ea
cmp eax, edx
jae 0x10040a07
cmp esi, 0x10
jb 0x100409c9
mov eax, esi
and eax, 0x8000000f
jns 0x10040901
dec eax
or eax, 0xfffffff0
inc eax
mov edx, esi
mov esi, 0x20
sub edx, eax
mov eax, 0xfffffff0
sub eax, dword [ebp - 0x6c]
mov dword [ebp - 0x98], eax
mov eax, 0x10
sub eax, dword [ebp - 0x6c]
mov dword [ebp - 0xb8], edx
mov edx, dword [ebp - 0x6c]
mov dword [ebp - 0xa8], eax
add edx, esi
mov eax, 0xffffffe0
sub eax, dword [ebp - 0x6c]
mov dword [ebp - 0x70], eax
nop dword [eax]
movups xmm0, xmmword [edx - 0x20]
add eax, edx
lea esi, [esi + 0x40]
add ecx, 0x10
movups xmm1, xmmword [eax + edi]
mov eax, dword [ebp - 0x98]
add eax, edx
pandn xmm1, xmm2
pand xmm1, xmm0
movups xmmword [edx - 0x20], xmm1
movups xmm1, xmmword [eax + edi]
mov eax, dword [ebp - 0xa8]
movups xmm0, xmmword [edx - 0x10]
add eax, edx
pandn xmm1, xmm2
pand xmm1, xmm0
movups xmmword [edx - 0x10], xmm1
movups xmm0, xmmword [edx]
movups xmm1, xmmword [esi + edi - 0x40]
pandn xmm1, xmm2
pand xmm1, xmm0
movups xmmword [edx], xmm1
movups xmm1, xmmword [eax + edi]
mov eax, dword [ebp - 0x70]
movups xmm0, xmmword [edx + 0x10]
pandn xmm1, xmm2
pand xmm1, xmm0
movups xmmword [edx + 0x10], xmm1
add edx, 0x40
cmp ecx, dword [ebp - 0xb8]
jl 0x10040940
mov esi, dword [ebp - 0xac]
mov eax, esi
and al, 0xf
cmp al, 2
jb 0x100409fe
mov edx, dword [ebp - 0x94]
mov edi, dword [edx]
mov eax, esi
and eax, 0x80000001
jns 0x100409d9
dec eax
or eax, 0xfffffffe
inc eax
mov edx, esi
sub edx, eax
mov eax, dword [ebp - 0x6c]
movq xmm1, qword [edi + ecx*4]
movq xmm0, qword [eax + ecx*4]
pandn xmm1, xmm2
pand xmm1, xmm0
movq qword [eax + ecx*4], xmm1
add ecx, 2
cmp ecx, edx
jl 0x100409e0
mov eax, dword [ebp - 0x78]
cmp ecx, esi
jge 0x10040a24
jmp 0x10040a0a
mov eax, dword [ebp - 0x78]
mov edx, dword [ebp - 0x6c]
nop dword [eax]
mov eax, dword [ebp + eax - 0x54]
mov eax, dword [eax + ecx*4]
not eax
and dword [edx + ecx*4], eax
inc ecx
mov eax, dword [ebp - 0x78]
cmp ecx, esi
jl 0x10040a10
mov ecx, dword [ebp - 0x7c]
xor edx, edx
cmp dword [ecx + 4], edx
jle 0x10040aec
mov dword [ebp - 0x88], edx
nop dword [eax + eax]
cmp dword [ebp - 0x8c], 0
je 0x10040aec
mov eax, dword [ebp + eax - 0x54]
mov esi, edx
sar esi, 5
mov ecx, edx
mov dword [ebp - 0x98], eax
and ecx, 0x1f
mov edi, dword [eax + esi*4]
mov eax, 1
shl eax, cl
test edi, eax
je 0x10040ad5
mov eax, dword [ebp - 0x98]
btr edi, ecx
dec dword [ebp - 0x8c]
movss dword [ebp - 0x100], xmm6
movss dword [ebp - 0xfc], xmm5
mov dword [eax + esi*4], edi
mov eax, dword [ebp - 0x7c]
mov esi, dword [ebp - 0x80]
movss dword [ebp - 0xf8], xmm4
movss dword [ebp - 0xf4], xmm3
mov ecx, dword [eax + 0x10]
add ecx, dword [ebp - 0x88]
movups xmm0, xmmword [ebp - 0x100]
mov eax, dword [ecx + 8]
movups xmmword [eax], xmm0
mov eax, esi
add esi, 0x18
movups xmm0, xmmword [ecx]
mov dword [ebp - 0x80], esi
movups xmmword [eax], xmm0
movq xmm0, qword [ecx + 0x10]
movq qword [eax + 0x10], xmm0
mov ecx, dword [ebp - 0x7c]
inc edx
add dword [ebp - 0x88], 0x18
mov eax, dword [ebp - 0x78]
cmp edx, dword [ecx + 4]
jl 0x10040a40
movss xmm1, dword [ebp - 0xd4]
movss xmm3, dword [ebp - 0xd8]
mov edi, dword [ebp - 0x84]
mov edx, dword [ebp - 0x6c]
mov esi, dword [ebp - 0x74]
jmp 0x10040b0d
mov ecx, dword [ebp - 0x7c]
cmp edi, 1
jne 0x10040b5b
cmp word [ebp - 0xe8], 0
jle 0x10040b5b
mov eax, dword [ebp - 0x9c]
mov esi, dword [ebp - 0x80]
mov edx, esi
add esi, 0x18
inc edi
mov dword [ebp - 0x80], esi
movzx eax, word [eax + 0x1e8]
mov esi, dword [ebp - 0x74]
lea ecx, [eax + eax*2]
mov eax, dword [ebp - 0x7c]
mov eax, dword [eax + 0x10]
movups xmm0, xmmword [eax + ecx*8]
movups xmmword [edx], xmm0
movq xmm0, qword [eax + ecx*8 + 0x10]
movq qword [edx + 0x10], xmm0
mov edx, dword [ebp - 0x6c]
jmp 0x100407b8
inc edi
mov dword [ebp - 0x84], edi
cmp edi, 4
jl 0x100407c0
mov eax, dword [ecx + 4]
xor esi, esi
test eax, eax
jle 0x10040bd5
mov edi, dword [ebp - 0x80]
mov dword [ebp - 0x90], esi
nop dword [eax]
cmp dword [ebp - 0x74], 0
je 0x10040bd5
mov ecx, esi
mov edx, 1
and ecx, 0x1f
mov eax, esi
shl edx, cl
mov ecx, dword [ebp - 0x6c]
sar eax, 5
test dword [ecx + eax*4], edx
je 0x10040bc3
mov eax, dword [ebp - 0x7c]
mov ecx, edi
add edi, 0x18
mov eax, dword [eax + 0x10]
add eax, dword [ebp - 0x90]
dec dword [ebp - 0x74]
movups xmm0, xmmword [eax]
movups xmmword [ecx], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ecx + 0x10], xmm0
mov ecx, dword [ebp - 0x7c]
inc esi
add dword [ebp - 0x90], 0x18
mov eax, dword [ecx + 4]
cmp esi, eax
jl 0x10040b80
lea eax, [eax + eax*2]
lea eax, [eax*8 - 0x30]
push eax
mov eax, dword [ebp - 0xa0]
push dword [eax + 0x4dfc]
mov eax, dword [ecx + 0x10]
add eax, 0x30
push eax
call fcn.10065810
add esp, 0xc
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.1006399c
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret