Function at 0x4f99a0
Capabilities:
Encode data using xor
Hash data using fnv

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
sub esp, 0x188
push esi
push edi
mov edi, ecx
mov dword [esp + 8], ecx
mov eax, dword [edi + 0x70]
cmp byte [eax + 0x27bb], 2
je 0x4fa3ae
mov eax, dword [edi + 0x70]
cmp dword [eax + 0x268], 0
jne 0x4fa3dc
movzx edx, byte [eax + 0x27bb]
lea esi, [edi + 0x208]
mov ecx, dword [esi + 4]
inc edx
mov edi, dword [esi]
mov eax, ecx
sub eax, edi
sar eax, 2
imul eax, eax, 0xb6db6db7
cmp eax, edx
jae 0x4f9a35
mov eax, ecx
sub eax, edi
sar eax, 2
imul eax, eax, 0xb6db6db7
push ecx
mov dword [esp + 0x10], eax
mov eax, dword [esi + 8]
sub eax, edi
sar eax, 2
imul eax, eax, 0xb6db6db7
cmp edx, eax
jbe 0x4f9a26
push edx
mov ecx, esi
call fcn.004fd4c0
jmp 0x4f9a35
sub edx, dword [esp + 0x10]
call fcn.004fd6d0
add esp, 4
mov dword [esi + 4], eax
mov eax, dword [esp + 8]
mov ecx, dword [esi]
mov dword [esp + 0x20], ecx
mov eax, dword [eax + 0x70]
movzx eax, byte [eax + 0x27bb]
lea edi, [eax*8]
sub edi, eax
mov dword [esp + 0x18], edi
cmp dword [ecx + edi*4], 0
jne 0x4fa2f0
mov esi, dword [esp + 8]
push ecx
lea ecx, [esp + 0x9c]
mov dword [esp + 0x10], 0
mov eax, dword [esi + 0x15c]
add eax, 0x40
mov dword [esp + 0x28], eax
lea eax, [esp + 0x10]
push eax
call fcn.00428e90
mov edx, dword [esi + 0x15c]
mov edi, 0xf
mov eax, dword [esi + 0x70]
add edx, 0x60
xorps xmm0, xmm0
mov dword [esp + 0x40], 0
add eax, 0x2924
movaps xmmword [esp + 0x30], xmm0
mov dword [esp + 0x44], edi
mov byte [esp + 0x30], 0
mov dword [esp + 0x14], eax
cmp dword [edx + 0x14], edi
jbe 0x4f9ac5
mov edx, dword [edx]
mov ecx, edx
movaps xmmword [esp + 0x50], xmm0
mov dword [esp + 0x60], 0
mov dword [esp + 0x64], 0
lea esi, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4f9ae0
sub ecx, esi
push ecx
push edx
lea ecx, [esp + 0x58]
call fcn.00414570
cmp dword [esp + 0x64], edi
lea esi, [esp + 0x50]
mov eax, dword [esp + 0x50]
mov edx, 0x811c9dc5
cmova esi, eax
mov dword [esp + 0xc], eax
xor ecx, ecx
cmp dword [esp + 0x60], ecx
jbe 0x4f9b27
movzx eax, byte [esi + ecx]
inc ecx
xor eax, edx
imul edx, eax, 0x1000193
cmp ecx, dword [esp + 0x60]
jb 0x4f9b14
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x50]
push edx
push eax
lea eax, [esp + 0x190]
push eax
call fcn.004100f0
mov esi, dword [eax + 4]
test esi, esi
jne 0x4f9b4c
mov eax, dword [esp + 0x14]
mov esi, dword [eax + 4]
mov eax, dword [esp + 0x64]
cmp eax, 0xf
jbe 0x4f9b84
mov edx, dword [esp + 0xc]
lea ecx, [eax + 1]
mov eax, edx
cmp ecx, 0x1000
jb 0x4f9b7a
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4fa52d
push ecx
push edx
call fcn.005ab85c
add esp, 8
mov eax, dword [esp + 0x14]
cmp esi, dword [eax + 4]
je 0x4f9bbc
lea eax, [esi + 0x60]
lea ecx, [esp + 0x30]
cmp ecx, eax
je 0x4f9bbc
mov ecx, dword [eax + 0x10]
cmp dword [eax + 0x14], edi
jbe 0x4f9ba2
mov eax, dword [eax]
push ecx
push eax
lea ecx, [esp + 0x38]
call fcn.0040c060
cmp dword [esp + 0x40], 0
jne 0x4f9c88
mov edi, dword [esp + 0x44]
cmp edi, 0xc
jb 0x4f9bee
cmp edi, 0xf
mov dword [esp + 0x40], 0xc
push 0xc
lea esi, [esp + 0x34]
cmova esi, dword [esp + 0x34]
push str.shadowcaster
push esi
call fcn.005c3580
add esp, 0xc
mov byte [esi + 0xc], 0
jmp 0x4f9c88
mov ecx, edi
mov eax, 0x7fffffff
shr ecx, 1
sub eax, ecx
cmp edi, eax
jbe 0x4f9c04
mov ecx, 0x7fffffff
jmp 0x4f9c11
lea eax, [edi + ecx]
mov ecx, 0xf
cmp eax, ecx
cmova ecx, eax
lea eax, [esp + 0x10]
mov dword [esp + 0x10], ecx
push eax
lea eax, [esp + 0x34]
push eax
call fcn.00414510
movq xmm0, qword [str.shadowcaster]
mov esi, eax
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [esp + 0x44], ecx
mov dword [esp + 0x40], 0xc
movq qword [esi], xmm0
mov ecx, dword [0x734dfc]
mov dword [esi + 8], ecx
mov byte [esi + 0xc], 0
cmp edi, 0xf
jbe 0x4f9c84
mov ecx, dword [esp + 0x30]
inc edi
mov eax, ecx
cmp edi, 0x1000
jb 0x4f9c7a
mov ecx, dword [eax - 4]
add edi, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4fa52d
push edi
push ecx
call fcn.005ab85c
add esp, 8
mov dword [esp + 0x30], esi
mov eax, dword [esp + 8]
lea edx, [esp + 0x10]
push edx
lea edx, [esp + 0x10]
mov dword [esp + 0x10], 0
push edx
mov ecx, dword [eax + 0x70]
lea eax, [esp + 0x38]
add ecx, 0x2924
mov dword [esp + 0x18], 0
cmp dword [esp + 0x4c], 0xf
cmova eax, dword [esp + 0x38]
push eax
call fcn.0052a740
mov edi, dword [esp + 0x10]
mov edi, dword [edi + 4]
mov esi, dword [edi]
cmp esi, edi
je 0x4f9d1f
mov ecx, dword [esp + 0x24]
lea eax, [esi + 8]
push eax
lea eax, [esp + 0x80]
push eax
call fcn.00429d10
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x7c]
cmp eax, dword [ecx + 4]
je 0x4f9cfb
mov eax, dword [eax + 0x20]
mov dword [esp + 0x10], eax
jmp 0x4f9d03
mov dword [esp + 0x10], 0
lea eax, [esi + 8]
push eax
lea ecx, [esp + 0x9c]
call fcn.004dde00
mov ecx, dword [esp + 0x10]
mov dword [eax], ecx
mov esi, dword [esi]
cmp esi, edi
jne 0x4f9cd0
mov esi, dword [esp + 8]
cmp byte [esi + 0x164], 3
jne 0x4f9d8c
mov eax, dword [0x734d74]
lea ecx, [esp + 0x98]
movq xmm0, qword [str.ALPHATOCOVERAGE]
mov dword [esp + 0x58], eax
mov ax, word [0x734d78]
mov word [esp + 0x5c], ax
mov al, byte [0x734d7a]
mov byte [esp + 0x5e], al
lea eax, [esp + 0x50]
push eax
mov dword [esp + 0x64], 0xf
mov dword [esp + 0x68], 0xf
movq qword [esp + 0x54], xmm0
mov byte [esp + 0x63], 0
call fcn.004be2e0
lea ecx, [esp + 0x50]
mov dword [eax], 1
call fcn.004143d0
mov ecx, dword [esi + 0x70]
lea eax, [esp + 0x30]
add ecx, 0x2968
cmp dword [esp + 0x44], 0xf
cmova eax, dword [esp + 0x30]
push eax
lea eax, [esp + 0x9c]
push eax
push str.materials_util_shadowcaster.json
call fcn.004f59e0
mov ecx, dword [esp + 8]
mov edx, eax
mov dword [esp + 0xc], edx
cmp byte [ecx + 0x164], 3
jne 0x4f9dd0
mov byte [edx + 0x164], 3
mov eax, dword [edx + 0x15c]
mov esi, dword [ecx + 0x15c]
mov dword [esp + 0x78], esi
mov eax, dword [eax + 0x24]
mov dword [esp + 0x28], eax
mov edi, dword [eax]
mov dword [esp + 0x10], edi
cmp edi, eax
je 0x4fa0f9
mov eax, dword [edi + 8]
lea ecx, [esp + 0x128]
mov dword [esp + 0x120], eax
mov eax, dword [edi + 0xc]
mov dword [esp + 0x124], eax
lea eax, [edi + 0x10]
push eax
call fcn.004141c0
lea eax, [edi + 0x28]
push eax
lea ecx, [esp + 0x144]
call fcn.004141c0
lea eax, [edi + 0x40]
push eax
lea ecx, [esp + 0x15c]
call fcn.004141c0
mov al, byte [edi + 0x58]
mov byte [esp + 0x170], al
mov eax, dword [edi + 0x5c]
mov dword [esp + 0x174], eax
mov eax, dword [edi + 0x64]
sub eax, dword [edi + 0x60]
sar eax, 4
imul eax, eax, 0xaaaaaaab
mov dword [esp + 0x178], 0
mov dword [esp + 0x17c], 0
mov dword [esp + 0x180], 0
test eax, eax
je 0x4f9ee7
cmp eax, 0x5555555
ja 0x4fa528
push eax
lea ecx, [esp + 0x17c]
call fcn.004fd160
mov ecx, dword [edi + 0x64]
mov esi, dword [edi + 0x60]
mov eax, dword [esp + 0x178]
mov dword [esp + 0x24], ecx
cmp esi, ecx
je 0x4f9edc
mov edi, eax
push esi
mov ecx, edi
call fcn.004141c0
lea eax, [esi + 0x18]
push eax
lea ecx, [edi + 0x18]
call fcn.004141c0
add esi, 0x30
add edi, 0x30
cmp esi, dword [esp + 0x24]
jne 0x4f9eb0
mov dword [esp + 0x14], edi
mov edi, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
mov esi, dword [esp + 0x78]
mov dword [esp + 0x17c], eax
cmp dword [esp + 0x168], 0
je 0x4fa0d1
mov eax, dword [esi + 0x24]
mov dword [esp + 0x88], eax
mov esi, dword [eax]
mov dword [esp + 0x24], esi
cmp esi, eax
je 0x4fa0d1
nop dword [eax]
mov eax, dword [esi + 8]
lea ecx, [esp + 0xc0]
mov dword [esp + 0xb8], eax
mov eax, dword [esi + 0xc]
mov dword [esp + 0xbc], eax
lea eax, [esi + 0x10]
push eax
call fcn.004141c0
lea eax, [esi + 0x28]
push eax
lea ecx, [esp + 0xdc]
call fcn.004141c0
lea eax, [esi + 0x40]
push eax
lea ecx, [esp + 0xf4]
call fcn.004141c0
mov al, byte [esi + 0x58]
mov byte [esp + 0x108], al
mov eax, dword [esi + 0x5c]
mov dword [esp + 0x10c], eax
mov eax, dword [esi + 0x64]
sub eax, dword [esi + 0x60]
sar eax, 4
imul eax, eax, 0xaaaaaaab
mov dword [esp + 0x110], 0
mov dword [esp + 0x114], 0
mov dword [esp + 0x118], 0
test eax, eax
je 0x4fa011
cmp eax, 0x5555555
ja 0x4fa528
push eax
lea ecx, [esp + 0x114]
call fcn.004fd160
mov edx, dword [esi + 0x64]
mov eax, dword [esi + 0x60]
mov ecx, dword [esp + 0x110]
mov dword [esp + 0x84], edx
mov dword [esp + 0x80], eax
cmp eax, edx
je 0x4fa00a
mov edi, eax
mov esi, ecx
push edi
mov ecx, esi
call fcn.004141c0
lea eax, [edi + 0x18]
push eax
lea ecx, [esi + 0x18]
call fcn.004141c0
add edi, 0x30
add esi, 0x30
cmp edi, dword [esp + 0x84]
jne 0x4f9fd7
mov edi, dword [esp + 0x10]
mov dword [esp + 0x14], esi
mov esi, dword [esp + 0x24]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x114], ecx
cmp dword [esp + 0x16c], 0xf
lea eax, [esp + 0x158]
push dword [esp + 0x168]
cmova eax, dword [esp + 0x15c]
lea ecx, [esp + 0xf4]
cmp dword [esp + 0x108], 0xf
mov edx, dword [esp + 0x104]
cmova ecx, dword [esp + 0xf4]
push eax
call fcn.004108e0
add esp, 8
test al, al
jne 0x4fa07b
lea ecx, [esp + 0xbc]
call fcn.004fa620
mov esi, dword [esi]
mov dword [esp + 0x24], esi
cmp esi, dword [esp + 0x88]
jne 0x4f9f10
jmp 0x4fa0d1
mov al, byte [esp + 0xbc]
mov edx, dword [esp + 0x18]
mov esi, dword [esp + 0x20]
mov byte [esp + 0x1c], al
mov al, byte [esp + 0x124]
mov byte [esp + 0x1d], al
lea eax, [edx + 1]
mov ecx, dword [esi + edx*4 + 8]
lea eax, [esi + eax*4]
cmp ecx, dword [esi + edx*4 + 0xc]
je 0x4fa0b8
mov ax, word [esp + 0x1c]
mov word [ecx], ax
add dword [esi + edx*4 + 8], 2
jmp 0x4fa0c5
lea edx, [esp + 0x1c]
push edx
push ecx
mov ecx, eax
call fcn.004fd1f0
lea ecx, [esp + 0xbc]
call fcn.004fa620
lea ecx, [esp + 0x124]
call fcn.004fa620
mov edi, dword [edi]
mov esi, dword [esp + 0x78]
mov dword [esp + 0x10], edi
cmp edi, dword [esp + 0x28]
jne 0x4f9df5
mov ecx, dword [esp + 8]
mov edx, dword [esp + 0xc]
mov esi, dword [edx + 0x15c]
cmp dword [esi + 0x1c], 0
jne 0x4fa115
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov dword [ecx + edi*4], edx
jmp 0x4fa28d
or dword [ecx + 0x16c], 2
lea eax, [esp + 0x30]
mov ecx, dword [ecx + 0x70]
add ecx, 0x2968
cmp dword [esp + 0x44], 0xf
cmova eax, dword [esp + 0x30]
push eax
lea eax, [esp + 0x9c]
push eax
push ecx
call fcn.004f6190
mov ecx, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
mov dword [ecx + edi*4], eax
mov ecx, dword [esp + 0xc]
mov cl, byte [ecx + 0x164]
mov byte [eax + 0x164], cl
mov esi, dword [esi + 0x18]
mov eax, dword [esp + 8]
mov esi, dword [esi]
mov eax, dword [eax + 0x15c]
add eax, 0x18
mov dword [esp + 0xc], eax
cmp byte [esi + 0xd], 0
jne 0x4fa28d
nop dword [eax]
lea edi, [esi + 0x10]
push edi
lea ecx, [esp + 0x90]
push ecx
mov ecx, eax
call fcn.00443290
mov eax, dword [esp + 0x94]
cmp byte [eax + 0xd], 0
jne 0x4fa241
mov edx, dword [eax + 0x20]
add eax, 0x10
cmp dword [eax + 0x14], 0xf
jbe 0x4fa1b2
mov eax, dword [eax]
cmp dword [edi + 0x14], 0xf
mov ecx, edi
jbe 0x4fa1bc
mov ecx, dword [edi]
push edx
mov edx, dword [edi + 0x10]
push eax
call fcn.00411640
add esp, 8
test eax, eax
je 0x4fa1cf
js 0x4fa241
mov eax, dword [esp + 0xc]
mov ecx, dword [esp + 0x94]
cmp ecx, dword [eax]
je 0x4fa241
mov eax, dword [ecx + 0x78]
cmp eax, dword [edi + 0x68]
jne 0x4fa241
mov al, byte [ecx + 0x2d]
mov dl, byte [edi + 0x1c]
mov byte [esp + 0x2c], al
mov al, byte [edi + 0x1d]
mov edi, dword [esp + 0x18]
mov byte [esp + 0x2d], al
mov eax, dword [esp + 0x20]
shl dl, 2
lea ecx, [edi + 4]
mov byte [esp + 0x2e], dl
lea ecx, [eax + ecx*4]
mov dword [esp + 0x28], ecx
mov ecx, dword [eax + edi*4 + 0x14]
cmp ecx, dword [eax + edi*4 + 0x18]
je 0x4fa230
mov ax, word [esp + 0x2c]
mov word [ecx], ax
mov byte [ecx + 2], dl
mov ecx, dword [esp + 0x20]
add dword [ecx + edi*4 + 0x14], 3
jmp 0x4fa245
lea eax, [esp + 0x2c]
push eax
push ecx
mov ecx, dword [esp + 0x30]
call fcn.004fd340
jmp 0x4fa245
mov edi, dword [esp + 0x18]
mov eax, dword [esi + 8]
cmp byte [eax + 0xd], 0
je 0x4fa26b
mov eax, dword [esi + 4]
cmp byte [eax + 0xd], 0
jne 0x4fa267
cmp esi, dword [eax + 8]
jne 0x4fa267
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0xd], 0
je 0x4fa257
mov esi, eax
jmp 0x4fa27f
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
jne 0x4fa27f
mov esi, eax
mov eax, dword [esi]
cmp byte [eax + 0xd], 0
je 0x4fa275
cmp byte [esi + 0xd], 0
mov eax, dword [esp + 0xc]
je 0x4fa180
mov ecx, dword [esp + 0x44]
cmp ecx, 0xf
jbe 0x4fa2c3
mov edx, dword [esp + 0x30]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x4fa2b9
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x4fa52d
push ecx
push edx
call fcn.005ab85c
add esp, 8
lea ecx, [esp + 0xa4]
call fcn.0040aea0
mov edx, dword [esp + 0x9c]
call fcn.0042b120
push 0x24
push dword [esp + 0xa0]
call fcn.005ab85c
mov ecx, dword [esp + 0x28]
add esp, 8
mov eax, dword [esp + 8]
mov esi, dword [esp + 0x18]
mov edi, dword [ecx + edi*4]
mov eax, dword [eax + 0x70]
mov dword [eax + 0x268], edi
mov eax, dword [ecx + esi*4 + 8]
mov edx, dword [ecx + esi*4 + 4]
mov dword [esp + 0x28], eax
cmp edx, eax
je 0x4fa338
movzx eax, byte [edx]
movzx ecx, byte [edx + 1]
add edx, 2
mov esi, dword [esp + 8]
mov eax, dword [esi + eax*4 + 0x74]
mov dword [edi + ecx*4 + 0x74], eax
cmp edx, dword [esp + 0x28]
jne 0x4fa314
mov esi, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx + esi*4 + 0x10]
cmp eax, dword [ecx + esi*4 + 0x14]
je 0x4fa3a2
mov edx, dword [esp + 8]
mov eax, dword [edx + 0x16c]
test al, 2
je 0x4fa3a2
and eax, 0xfffffffd
mov dword [edx + 0x16c], eax
or dword [edi + 0x16c], 3
mov eax, dword [ecx + esi*4 + 0x14]
mov esi, dword [ecx + esi*4 + 0x10]
mov dword [esp + 0x28], eax
cmp esi, eax
je 0x4fa3a2
movzx eax, byte [esi + 2]
lea edx, [edx + 0x9c]
push eax
movzx eax, byte [esi]
lea eax, [edx + eax*4]
push eax
movzx eax, byte [esi + 1]
add eax, 0x27
lea eax, [edi + eax*4]
push eax
call fcn.005c3580
mov edx, dword [esp + 0x14]
add esi, 3
add esp, 0xc
cmp esi, dword [esp + 0x28]
jne 0x4fa370
mov eax, dword [edi + 0x70]
mov dword [esp + 8], edi
jmp 0x4f99b7
mov ecx, dword [edi + 0x15c]
mov eax, dword [ecx]
mov eax, dword [eax + 0xc]
call eax
test al, 0x20
je 0x4fa3dc
mov eax, dword [edi + 0x70]
mov ecx, dword [eax + 0x28dc]
mov eax, dword [ecx]
mov edx, dword [eax + 0x8c]
mov eax, dword [edi + 0x15c]
mov al, byte [eax + 0x17]
push eax
call edx
test byte [edi + 0x16c], 1
je 0x4fa407
mov ecx, dword [edi + 0x15c]
mov eax, dword [ecx]
mov edx, dword [eax + 8]
lea eax, [edi + 0x160]
push eax
lea eax, [edi + 0x9c]
push eax
call edx
and dword [edi + 0x16c], 0xfffffffe
mov al, byte [edi + 0x164]
mov dl, al
movzx eax, al
jmp dword [eax*4 + 0x4fa534]
call fcn.00410570
call fcn.005c695f
nop
sub esp, dword [edi + ecx*2 + 0x4fa41900]
add byte [ecx], bl
movsb byte es:[edi], byte [esi]
dec edi
add byte [ecx], bl
movsb byte es:[edi], byte [esi]
dec edi
add ah, cl
int3