Function at 0x413990
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x5c
movzx eax, word [0x466040]
mov dword [esp + 0x4c], eax
neg eax
push 3
mov dword [esp + 0x4c], 1
mov dword [esp + 0x54], 0xffffffff
mov dword [esp + 0x58], eax
mov dword [esp + 0x5c], 1
call fcn.00412b90
add esp, 4
cmp dword [0x464a9c], 0
je 0x4139e5
push str.PPG_interpolation..._n
call fcn.00434a96
add eax, 0x40
push eax
call fcn.00435780
add esp, 8
movzx eax, word [0x4ac486]
push ebx
push ebp
push esi
push edi
mov edi, 3
lea ecx, [eax - 3]
cmp ecx, edi
mov dword [esp + 0x10], edi
jle 0x413c32
movzx esi, word [0x466040]
lea eax, [esi + esi*2]
mov dword [esp + 0x24], eax
mov ebx, dword [0x466120]
mov edx, edi
and edx, 7
lea ecx, [edx*4 + 2]
mov eax, ebx
shr eax, cl
add esi, 0xfffffffd
and eax, 1
add eax, 3
mov ecx, eax
and ecx, 1
lea ecx, [ecx + edx*2]
add ecx, ecx
mov edx, ebx
shr edx, cl
and edx, 3
cmp eax, esi
mov dword [esp + 0x18], edx
jge 0x413c0e
mov ecx, dword [esp + 0x24]
mov edi, dword [0x4ac418]
sub esi, eax
dec esi
add ecx, eax
shr esi, 1
inc esi
lea ecx, [edi + ecx*8]
mov dword [esp + 0x34], esi
jmp 0x413a74
mov edx, dword [esp + 0x18]
movzx edx, word [ecx + edx*2]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], 0
mov eax, 1
xor edx, edx
jmp 0x413a90
movzx ebp, word [ecx + eax*8 + 2]
lea esi, [eax*8]
mov edi, esi
mov dword [esp + 0x20], ebp
mov ebp, dword [esp + 0x18]
add esi, ebp
movzx esi, word [ecx + esi*2]
neg edi
movzx ebx, word [ecx + edi + 2]
add edi, ebp
movzx edi, word [ecx + edi*2]
mov dword [esp + 0x30], esi
mov esi, dword [esp + 0x20]
mov ebp, dword [esp + 0x30]
add esi, ebx
add esi, dword [esp + 0x1c]
lea eax, [eax + eax*2]
add esi, esi
sub esi, ebp
sub esi, edi
mov dword [esp + edx + 0x48], esi
mov esi, edi
sub esi, dword [esp + 0x1c]
add eax, eax
mov edi, esi
sar edi, 0x1f
mov dword [esp + 0x30], edi
mov edi, ebp
sub edi, dword [esp + 0x1c]
add eax, eax
mov dword [esp + 0x38], edi
sar edi, 0x1f
mov dword [esp + 0x2c], edi
add eax, eax
mov edi, ebx
sub edi, dword [esp + 0x20]
mov ebp, edi
sar ebp, 0x1f
mov dword [esp + 0x28], ebp
mov ebp, ecx
sub ebp, eax
movzx eax, word [ecx + eax + 2]
sub eax, dword [esp + 0x20]
movzx ebp, word [ebp + 2]
mov dword [esp + 0x3c], eax
sar eax, 0x1f
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x28]
xor eax, edi
mov edi, dword [esp + 0x2c]
xor edi, dword [esp + 0x38]
sub ebp, ebx
add eax, edi
mov edi, dword [esp + 0x30]
xor edi, esi
mov esi, dword [esp + 0x20]
xor esi, dword [esp + 0x3c]
add eax, edi
sub eax, dword [esp + 0x28]
mov ebx, ebp
sub eax, dword [esp + 0x2c]
sar ebx, 0x1f
sub eax, dword [esp + 0x30]
mov edi, ebx
xor edi, ebp
add esi, edi
sub esi, dword [esp + 0x20]
lea eax, [eax + eax*2]
sub esi, ebx
lea eax, [eax + esi*2]
mov dword [esp + edx + 0x50], eax
mov eax, dword [esp + 0x14]
inc eax
lea edx, [eax*4]
mov dword [esp + 0x14], eax
mov eax, dword [esp + edx + 0x58]
test eax, eax
jg 0x413a90
mov edx, dword [esp + 0x54]
xor eax, eax
cmp dword [esp + 0x50], edx
mov edi, ecx
setg al
mov edx, dword [esp + eax*4 + 0x58]
mov eax, dword [esp + eax*4 + 0x48]
add edx, edx
add edx, edx
add edx, edx
movzx esi, word [ecx + edx + 2]
sub edi, edx
movzx edx, word [edi + 2]
sar eax, 2
mov edi, eax
cmp si, dx
jae 0x413bd8
movzx edx, dx
cmp eax, edx
jl 0x413bc9
mov edi, edx
movzx esi, si
cmp esi, edi
jg 0x413bf0
cmp eax, edx
jl 0x413bf2
mov eax, edx
jmp 0x413bf2
movzx esi, si
cmp eax, esi
jl 0x413be1
mov edi, esi
movzx edx, dx
cmp edx, edi
jle 0x413bec
mov eax, edx
jmp 0x413bf2
cmp eax, esi
jl 0x413bf2
mov eax, esi
mov word [ecx + 2], ax
add ecx, 0x10
sub dword [esp + 0x34], 1
jne 0x413a70
mov edi, dword [esp + 0x10]
mov ebx, dword [0x466120]
movzx eax, word [0x4ac486]
movzx esi, word [0x466040]
add dword [esp + 0x24], esi
inc edi
lea ecx, [eax - 3]
cmp edi, ecx
mov dword [esp + 0x10], edi
jl 0x413a12
jmp 0x413c38
mov ebx, dword [0x466120]
mov ebp, 1
lea edi, [eax - 1]
cmp edi, ebp
mov dword [esp + 0x10], ebp
mov dword [esp + 0x20], edi
jle 0x413d5f
movzx edi, word [0x466040]
mov dword [esp + 0x24], edi
jmp 0x413c60
mov eax, ebp
and eax, 7
lea ecx, [eax*4]
mov esi, ebx
shr esi, cl
mov edx, ebx
lea ebx, [edi - 1]
and esi, 1
inc esi
lea ecx, [esi - 1]
and ecx, 1
lea ecx, [ecx + eax*2]
add ecx, ecx
shr edx, cl
and edx, 3
cmp esi, ebx
jge 0x413d3b
mov eax, dword [esp + 0x24]
mov ecx, dword [0x4ac418]
sub ebx, esi
dec ebx
add eax, esi
shr ebx, 1
lea eax, [ecx + eax*8]
inc ebx
jmp 0x413cb0
mov ecx, 1
lea edi, [esp + 0x58]
lea esp, [esp]
lea esi, [ecx*4]
add ecx, ecx
mov ebp, edx
sub ebp, esi
movzx ebp, word [eax + ebp*2]
add esi, edx
movzx esi, word [eax + esi*2]
add ecx, ecx
add ebp, esi
add ecx, ecx
mov esi, eax
sub esi, ecx
movzx ecx, word [eax + ecx + 2]
movzx esi, word [esi + 2]
sub ebp, esi
sub ebp, ecx
movzx ecx, word [eax + 2]
lea ecx, [ebp + ecx*2]
sar ecx, 1
cmp ecx, 0xffff
jge 0x413d10
test ecx, ecx
jge 0x413d08
xor ecx, ecx
jmp 0x413d15
cmp ecx, 0xffff
jl 0x413d15
mov ecx, 0xffff
mov word [eax + edx*2], cx
mov ecx, 2
sub ecx, edx
add edi, 4
mov edx, ecx
mov ecx, dword [edi]
test ecx, ecx
jg 0x413cc0
add eax, 0x10
sub ebx, 1
jne 0x413cb0
mov ebp, dword [esp + 0x10]
movzx edi, word [0x466040]
add dword [esp + 0x24], edi
mov ebx, dword [0x466120]
inc ebp
cmp ebp, dword [esp + 0x20]
mov dword [esp + 0x10], ebp
jl 0x413c60
mov edi, dword [esp + 0x20]
mov esi, 1
cmp edi, esi
mov dword [esp + 0x10], esi
jle 0x413f30
movzx ebp, word [0x466040]
mov dword [esp + 0x44], ebp
mov dword [esp + 0x24], ebp
jmp 0x413d87
mov ebx, dword [0x466120]
mov edx, esi
and edx, 7
lea ecx, [edx*4 + 2]
mov eax, ebx
shr eax, cl
and eax, 1
inc eax
mov ecx, eax
and ecx, 1
lea ecx, [ecx + edx*2]
add ecx, ecx
mov edx, ebx
shr edx, cl
mov ebx, 2
lea ecx, [ebp - 1]
and edx, 3
sub ebx, edx
cmp eax, ecx
mov dword [esp + 0x18], ebx
jge 0x413f1f
mov edx, dword [esp + 0x24]
mov esi, dword [0x4ac418]
sub ecx, eax
dec ecx
add edx, eax
shr ecx, 1
inc ecx
lea esi, [esi + edx*8]
mov dword [esp + 0x30], ecx
jmp 0x413de0
mov edx, dword [esp + 0x5c]
inc edx
mov dword [esp + 0x14], 0
test edx, edx
jle 0x413ebc
movzx eax, word [esi + 2]
add eax, eax
mov dword [esp + 0x40], eax
xor ecx, ecx
movzx ebp, word [esi + 2]
lea eax, [edx*4]
mov edi, ebx
sub edi, eax
movzx edi, word [esi + edi*2]
add eax, ebx
movzx eax, word [esi + eax*2]
add edx, edx
add edx, edx
mov dword [esp + 0x1c], edi
sub edi, eax
add edx, edx
mov ebx, edi
sar ebx, 0x1f
mov dword [esp + 0x3c], ebx
mov ebx, esi
sub ebx, edx
movzx ebx, word [ebx + 2]
movzx edx, word [edx + esi + 2]
mov dword [esp + 0x28], ebx
sub ebx, ebp
mov ebp, ebx
sar ebp, 0x1f
mov dword [esp + 0x34], ebp
movzx ebp, word [esi + 2]
mov dword [esp + 0x2c], edx
sub eax, dword [esp + 0x2c]
sub edx, ebp
sub eax, dword [esp + 0x28]
mov ebp, edx
add eax, dword [esp + 0x1c]
sar ebp, 0x1f
add eax, dword [esp + 0x40]
mov dword [esp + 0x38], ebp
xor ebp, edx
mov edx, dword [esp + 0x34]
xor edx, ebx
add ebp, edx
mov edx, dword [esp + 0x3c]
mov ebx, edx
xor ebx, edi
add ebp, ebx
sub ebp, dword [esp + 0x38]
mov ebx, dword [esp + 0x18]
sub ebp, dword [esp + 0x34]
mov dword [esp + ecx + 0x48], eax
mov eax, dword [esp + 0x14]
sub ebp, edx
inc eax
mov dword [esp + ecx + 0x50], ebp
lea ecx, [eax*4]
mov edx, dword [esp + ecx + 0x5c]
add edx, dword [esp + ecx + 0x58]
mov dword [esp + 0x14], eax
test edx, edx
jg 0x413e01
mov ecx, dword [esp + 0x30]
mov ebp, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
cmp ebp, edi
je 0x413ed7
xor eax, eax
cmp ebp, edi
setg al
mov eax, dword [esp + eax*4 + 0x48]
sar eax, 1
jmp 0x413ee4
mov edx, dword [esp + 0x48]
mov eax, dword [esp + 0x4c]
add eax, edx
sar eax, 2
cmp eax, 0xffff
jge 0x413efa
test eax, eax
jge 0x413ef3
xor eax, eax
jmp 0x413eff
cmp eax, 0xffff
jl 0x413eff
mov eax, 0xffff
mov word [esi + ebx*2], ax
add esi, 0x10
sub ecx, 1
mov dword [esp + 0x30], ecx
jne 0x413de0
mov edi, dword [esp + 0x20]
mov ebp, dword [esp + 0x44]
mov esi, dword [esp + 0x10]
add dword [esp + 0x24], ebp
inc esi
cmp esi, edi
mov dword [esp + 0x10], esi
jl 0x413d81
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c
ret