Function at 0xa1d4b8
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
lea eax, [ebp - 0x14]
push edi
push esi
push ebx
sub esp, 0x2c
mov ebx, dword [ebp + 8]
mov ecx, dword [ebx + 0x130]
mov dword [ebp - 0x20], ecx
add ecx, 0x7d14
mov dword [ebp - 0x24], ecx
mov dword [esp + 4], eax
mov edx, dword [ebp + 8]
mov dword [esp], edx
call fcn.00a1d358
test eax, eax
js 0xa1d758
mov edx, dword [ebp + 8]
cmp eax, 7
mov edi, eax
mov esi, dword [edx + 0x130]
jg 0xa1d7f1
cmp edi, 0x1f
jg 0xa1d7af
test edi, edi
jle 0xa1d6a7
lea ebx, [edi - 1]
mov edx, dword [esi + 0x1308c]
mov eax, esi
mov ecx, ebx
and ecx, 3
mov dword [ebp - 0x2c], ecx
mov dword [esp], 1
call fcn.00a1cf58
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x60]
test eax, eax
mov eax, dword [esi + 0x1308c]
sete cl
movzx edx, cl
xor edx, eax
test ebx, ebx
mov dword [esi + 0x1308c], edx
jle 0xa1d6a7
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0xa1d5f8
cmp dword [ebp - 0x2c], 1
je 0xa1d5c5
cmp dword [ebp - 0x2c], 2
je 0xa1d59a
mov dword [esp], 1
mov eax, esi
call fcn.00a1cf58
mov ecx, dword [ebp + 8]
xor edx, edx
mov ebx, dword [esi + 0x1308c]
cmp dword [ecx + 0x60], 0
sete dl
xor edx, ebx
mov dword [esi + 0x1308c], edx
lea ebx, [edi - 2]
mov dword [esp], 1
mov eax, esi
call fcn.00a1cf58
mov edx, dword [ebp + 8]
mov edi, dword [esi + 0x1308c]
mov ecx, dword [edx + 0x60]
test ecx, ecx
sete al
movzx edx, al
xor edx, edi
dec ebx
mov dword [esi + 0x1308c], edx
mov dword [esp], 1
mov eax, esi
call fcn.00a1cf58
mov eax, dword [ebp + 8]
xor edx, edx
mov edi, dword [esi + 0x1308c]
cmp dword [eax + 0x60], 0
sete dl
dec ebx
xor edx, edi
test ebx, ebx
mov dword [esi + 0x1308c], edx
jle 0xa1d6a7
nop
mov dword [esp], 1
mov eax, esi
call fcn.00a1cf58
mov edx, dword [ebp + 8]
mov edi, dword [esi + 0x1308c]
mov ecx, dword [edx + 0x60]
test ecx, ecx
sete al
movzx edx, al
xor edx, edi
mov eax, esi
mov dword [esi + 0x1308c], edx
mov dword [esp], 1
call fcn.00a1cf58
mov ecx, dword [ebp + 8]
xor edx, edx
mov eax, dword [esi + 0x1308c]
cmp dword [ecx + 0x60], 0
sete dl
xor edx, eax
mov dword [esi + 0x1308c], edx
mov eax, esi
mov dword [esp], 1
call fcn.00a1cf58
mov edx, dword [ebp + 8]
mov eax, dword [esi + 0x1308c]
mov edi, dword [edx + 0x60]
test edi, edi
sete cl
movzx edx, cl
xor edx, eax
mov eax, esi
mov dword [esi + 0x1308c], edx
mov dword [esp], 1
call fcn.00a1cf58
mov edi, dword [ebp + 8]
xor edx, edx
mov ecx, dword [esi + 0x1308c]
cmp dword [edi + 0x60], 0
sete dl
sub ebx, 4
xor edx, ecx
test ebx, ebx
mov dword [esi + 0x1308c], edx
jg 0xa1d5f8
mov esi, dword [ebp - 0x20]
xor edx, edx
xor ebx, ebx
mov edi, dword [ebp - 0x24]
mov dword [esi + 0x13090], edx
mov dword [edi + 0x5170], ebx
movzx eax, byte [esi + 0x21d30]
test al, 2
jne 0xa1d760
test al, 4
je 0xa1d758
fld qword [0xd7c030]
mov eax, dword [ebp - 0x20]
fmul dword [eax + 0x21d34]
fstp qword [esp]
call fcn.00a5b770
fld dword [0xd7c038]
fmulp st(1)
fstp qword [esp]
call fcn.00a5b718
fnstcw word [ebp - 0x16]
mov edx, dword [ebp - 0x20]
movzx ecx, word [ebp - 0x16]
or cx, 0xc00
mov word [ebp - 0x18], cx
fldcw word [ebp - 0x18]
fistp dword [ebp - 0x1c]
fldcw word [ebp - 0x16]
mov ebx, dword [ebp - 0x1c]
test ebx, ebx
mov dword [edx + 0x21d44], ebx
jle 0xa1d748
mov esi, dword [ebp + 8]
fld dword [esi + 0x10]
fcom dword [0xd7c03c]
fnstsw ax
sahf
je 0xa1d869
fcomp dword [0xd7c040]
fnstsw ax
sahf
je 0xa1d86b
mov edx, dword [ebp - 0x20]
mov ecx, 0xbf800000
mov dword [edx + 0x21d48], ecx
nop
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [esi + 0x21d40]
mov dword [esp], edi
call fcn.00a21bc8
fld dword [0xd7c024]
fmulp st(1)
fadd dword [0xd7c028]
fstp qword [esp]
call fcn.00a5b738
fnstcw word [ebp - 0x16]
mov eax, dword [ebp - 0x20]
movzx esi, word [ebp - 0x16]
or si, 0xc00
mov word [ebp - 0x18], si
fldcw word [ebp - 0x18]
fistp dword [eax + 0x21d38]
fldcw word [ebp - 0x16]
movzx eax, byte [eax + 0x21d30]
jmp 0xa1d6cc
call fcn.00a23308
mov dword [ebp - 0x28], eax
xor ebx, ebx
jmp 0xa1d7dd
cmp edi, 7
jle 0xa1d50d
mov eax, dword [ebp - 0x28]
sub edi, 8
movsx edx, byte [ebx + eax]
mov eax, esi
mov dword [esp], 8
inc ebx
call fcn.00a1cf58
mov ecx, dword [ebp - 0x28]
mov dword [esp], ecx
call fcn.00a5b888
cmp eax, ebx
jg 0xa1d7bb
jmp 0xa1d50d
mov dword [esp], 8
mov edx, 0x4c
mov eax, esi
sub edi, 8
call fcn.00a1cf58
cmp edi, 7
jle 0xa1d504
mov dword [esp], 8
mov edx, 0x41
mov eax, esi
sub edi, 8
call fcn.00a1cf58
cmp edi, 7
jle 0xa1d504
mov dword [esp], 8
mov edx, 0x4d
mov eax, esi
sub edi, 8
call fcn.00a1cf58
cmp edi, 7
jle 0xa1d504
mov dword [esp], 8
mov edx, 0x45
mov eax, esi
call fcn.00a1cf58
sub edi, 8
jmp 0xa1d504
fstp st(0)
fld dword [0xd7c044]
mov ebx, dword [ebp - 0x20]
fdiv dword [ebx + 0x21d34]
fstp qword [esp]
call fcn.00a5b738
fmul qword [0xd7c048]
mov edi, dword [ebp - 0x20]
fstp dword [edi + 0x21d48]
add esp, 0x2c
pop ebx
pop esi
pop edi
pop ebp
ret