Function at 0x409b80
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, esp
and esp, 0xfffffff0
push ebp
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push esi
push edi
sub esp, 0x20
push 0
push 1
push 0x7078a0
push dword [ebx + 0xc]
push dword [ebx + 8]
call fcn.005cda20
add esp, 0x14
test eax, eax
jle 0x409da1
movdqu xmm0, xmmword [0x707890]
pxor xmm1, xmm1
cmp eax, dword [ebx + 0xc]
jg 0x409da1
mov edx, dword [ebx + 0xc]
sub edx, eax
inc edx
cmp edx, 8
jl 0x409dbe
mov edi, dword [ebx + 8]
mov ecx, edx
movdqu xmm4, xmmword [0x707890]
and ecx, 0xfffffff8
pxor xmm1, xmm1
pcmpeqd xmm0, xmm0
xor esi, esi
add edi, eax
pxor xmm5, xmm5
movd xmm2, dword [edi - 1]
add esi, 8
movd xmm3, dword [edi + 3]
add edi, 8
punpcklbw xmm2, xmm5
punpcklwd xmm2, xmm5
punpcklbw xmm3, xmm5
pcmpeqd xmm2, xmm4
punpcklwd xmm3, xmm5
pxor xmm2, xmm0
pcmpeqd xmm3, xmm4
psubd xmm1, xmm2
pxor xmm3, xmm0
psubd xmm1, xmm3
cmp esi, ecx
jb 0x409bf9
movdqa xmm0, xmm1
lea edi, [ecx + 1]
psrldq xmm0, 8
paddd xmm1, xmm0
movdqa xmm2, xmm1
psrlq xmm2, 0x20
paddd xmm1, xmm2
movd esi, xmm1
cmp edx, edi
jb 0x409cf5
sub edx, ecx
cmp edx, 4
jl 0x409dab
movd xmm1, esi
mov edi, edx
mov esi, dword [ebx + 8]
and edi, 0xfffffffc
mov dword [ebp - 0x1c], edi
xor edi, edi
mov dword [ebp - 0x20], eax
pcmpeqd xmm0, xmm0
movdqu xmm3, xmmword [0x707890]
add esi, eax
mov eax, dword [ebp - 0x1c]
add esi, ecx
pxor xmm4, xmm4
movd xmm2, dword [edi + esi - 1]
add edi, 4
punpcklbw xmm2, xmm4
punpcklwd xmm2, xmm4
pcmpeqd xmm2, xmm3
pxor xmm2, xmm0
psubd xmm1, xmm2
cmp edi, eax
jb 0x409c94
movdqa xmm0, xmm1
psrldq xmm0, 8
paddd xmm1, xmm0
movdqa xmm2, xmm1
psrlq xmm2, 0x20
paddd xmm1, xmm2
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
movd esi, xmm1
cmp edx, dword [ebp - 0x1c]
jbe 0x409cf5
mov edi, dword [ebx + 8]
add edi, eax
add ecx, edi
mov edi, dword [ebp - 0x1c]
cmp byte [edi + ecx - 1], 0x20
je 0x409cf0
inc esi
inc edi
cmp edi, edx
jb 0x409ce8
test esi, esi
jle 0x409da1
lea edx, [eax + 1]
cmp eax, dword [ebx + 0xc]
jge 0x409d82
mov ecx, dword [ebx + 0xc]
sub ecx, edx
inc ecx
mov esi, ecx
shr esi, 1
mov dword [ebp - 0x18], esi
je 0x409db7
mov edi, dword [ebx + 8]
xor esi, esi
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x28], edx
lea edi, [edi + eax + 1]
mov ecx, edi
mov edi, dword [ebx + 8]
movzx edx, byte [ecx + esi*2 - 1]
cmp edx, 0x20
je 0x409d40
mov byte [eax + edi - 1], dl
inc eax
mov byte [ecx + esi*2 - 1], 0x20
movzx edx, byte [ecx + esi*2]
cmp edx, 0x20
je 0x409d52
mov byte [eax + edi - 1], dl
inc eax
mov byte [ecx + esi*2], 0x20
inc esi
cmp esi, dword [ebp - 0x18]
jb 0x409d2c
mov edx, dword [ebp - 0x28]
lea esi, [esi + esi + 1]
mov ecx, dword [ebp - 0x24]
lea edi, [esi - 1]
cmp ecx, edi
jbe 0x409d82
add edx, dword [ebx + 8]
movzx ecx, byte [edx + esi - 2]
cmp ecx, 0x20
je 0x409d82
mov edi, dword [ebx + 8]
mov byte [eax + edi - 1], cl
mov byte [edx + esi - 2], 0x20
push 0
push 1
push 0x7078a0
push dword [ebx + 0xc]
push dword [ebx + 8]
call fcn.005cda20
add esp, 0x14
test eax, eax
jg 0x409bc1
lea esp, [ebp - 8]
pop edi
pop esi
pop ebp
mov esp, ebx
pop ebx
ret
mov dword [ebp - 0x1c], 0
jmp 0x409cd9
mov esi, 1
jmp 0x409d62
cmp edx, 1
jb 0x409da1
xor esi, esi
xor ecx, ecx
jmp 0x409c5e