Function at 0x1002f9fc0
Capabilities:
Allocate or change rwx memory
Encode data using xor

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xc0
mov rax, qword [0x1003fe1f8]
xor rax, rsp
mov qword [rsp + 0xb8], rax
mov qword [rsp + 0x78], rdx
lea r12, [rcx + 0x18]
lea r15, [0x100000000]
mov r14, qword [r12]
mov qword [rsp + 0x90], rcx
mov ebp, dword [r14 + 5]
mov eax, 0xfffffff
lea r11, [0x100000000]
mov edx, dword [r14 + 1]
and rbp, rax
shr rdx, 2
and rdx, rax
mov qword [rsp + 0x98], r12
add rbp, r15
mov eax, dword [0x100015b94]
mov rcx, rax
lea rsi, [rax + rdx - 1]
mov qword [rsp + 0x88], rbp
xor edx, edx
mov rax, rsi
div rcx
sub rsi, rdx
mov eax, dword [0x100015b94]
mov eax, dword [0x100015b94]
mov eax, dword [0x10028bffc]
test eax, eax
mov r10d, dword [0x10028bffc]
je 0x1002fa101
mov edi, dword [0x10028bffc]
xor r8d, r8d
xor eax, eax
dec edi
inc rdi
mov r9, rdi
je 0x1002fa0bb
mov rcx, qword [0x1003feeb8]
imul rcx, rcx, 0x343fd
shl rax, 0x10
shr r9, 0x10
add rcx, 0x269ec3
mov rdx, rcx
shr rdx, 0x10
movzx edx, dx
or rax, rdx
test r9, r9
jne 0x1002fa08c
mov qword [0x1003feeb8], rcx
xor edx, edx
div rdi
test r10, r10
je 0x1002fa0f6
mov eax, 0xef0b
mov ecx, 0xffff10f4
inc r8
lock cmpxchg dword [r11 + rdx*4 + 0x41a130], ecx
je 0x1002fa3a5
lea rax, [rdx + 1]
xor edx, edx
mov ecx, dword [0x10028bffc]
div rcx
cmp r8, r10
jb 0x1002fa0c5
xor ebx, ebx
test rbx, rbx
jne 0x1002fa22e
call qword [sym.imp.KERNEL32.dll_GetLastError]
xor edi, edi
mov r13d, eax
mov rcx, qword [0x10041aa98]
mov r8, rcx
inc rdi
mov r9, rcx
xor eax, eax
test rcx, rcx
je 0x1002fa159
mov rcx, qword [0x1003feeb8]
imul rcx, rcx, 0x343fd
shl rax, 0x10
shr r9, 0x10
add rcx, 0x269ec3
mov rdx, rcx
shr rdx, 0x10
movzx edx, dx
or rax, rdx
test r9, r9
jne 0x1002fa12a
mov qword [0x1003feeb8], rcx
mov r9d, 0x40
xor edx, edx
div r8
mov rcx, rdx
mov rdx, rsi
shl rcx, 0x10
mov r8d, 0x3000
add rcx, qword [0x10041cce0]
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
test rax, rax
mov rbx, rax
je 0x1002fa1c4
mov rcx, rax
and qword [rsp + 0x28], 0
mov rdx, rax
lea r9, [0x100363f08]
and qword [rsp + 0x20], 0
or rcx, 3
mov r8d, esi
call qword [sym.imp.ntdll.dll_RtlInstallFunctionTableCallback]
test al, al
jne 0x1002fa1d8
mov r8d, 0x8000
xor edx, edx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_Sleep]
cmp rdi, 0x11
jb 0x1002fa10c
xor ebx, ebx
cmp rbx, 0x10000
jb 0x1002fa1e6
test bl, 3
je 0x1002fa20b
test rbx, rbx
je 0x1002fa209
mov rcx, rbx
or rcx, 3
call qword [sym.imp.ntdll.dll_RtlDeleteFunctionTable]
mov r8d, 0x8000
mov rcx, rbx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_VirtualFree]
xor ebx, ebx
mov ecx, r13d
call qword [sym.imp.KERNEL32.dll_SetLastError]
lea r11, [0x100000000]
test rbx, rbx
je 0x1002fa055
mov rcx, rsi
mov rdi, rbx
xor eax, eax
rep stosb byte [rdi], al
mov eax, 0xf178a6e4
mov esi, ebp
add qword [r12], 9
mov r8d, dword [0x100015b94]
mov r14d, dword [r14 + 1]
shr r14, 2
and r14d, 0xfffffff
sub esi, r15d
mov qword [rsp + 0xa0], r14
xor eax, eax
mov dword [rsp + 0x38], esi
sub r8, r14
inc r8
mov rdi, r8
je 0x1002fa2a2
mov rcx, qword [0x1003feeb8]
imul rcx, rcx, 0x343fd
shl rax, 0x10
shr rdi, 0x10
add rcx, 0x269ec3
mov rdx, rcx
shr rdx, 0x10
movzx edx, dx
or rax, rdx
test rdi, rdi
jne 0x1002fa273
mov qword [0x1003feeb8], rcx
xor edx, edx
mov ecx, esi
div r8
lea r13, [rdx + rbx]
mov rdx, r14
mov r8, r13
mov qword [rsp + 0x80], r13
mov eax, 0x4ecb9451
xor dil, dil
mov rdx, qword [r14 + rbp]
mov qword [rsp + 0x70], rdx
lea rcx, [rsp + 0x70]
mov eax, 0x7cfa46b5
mov ebx, 4
mov r10, qword [rsp + 0x70]
mov r9d, dword [rsp + 0x74]
and qword [rsp + 0x40], 0
mov rcx, r15
mov eax, 0xfffffff
and r10, rax
and r9, rax
mov rax, qword [0x10014d838]
add r10, r15
sub rcx, rax
mov qword [rsp + 0x30], rcx
jne 0x1002fa3bc
xor r11d, r11d
test r9, r9
je 0x1002fa727
mov ecx, dword [rsp + 0x44]
mov ebx, 0xb0d52e05
mov r8d, dword [rsp + 0x40]
movzx eax, byte [r11 + r10]
inc r11
sub eax, 0x4f2ad1fb
add r8d, eax
add eax, ecx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov ecx, dword [rsp + 0x30]
shr rax, 0x20
add eax, ecx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov ecx, dword [rsp + 0x30]
shr rax, 0x20
lea edx, [rcx + rax*2 - 0x7fffffff]
sar ecx, 0x1f
btr ecx, 0x1f
sub edx, ecx
mov eax, edx
sar eax, 0x1f
btr eax, 0x1f
add eax, edx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov ecx, dword [rsp + 0x30]
shr rax, 0x20
add ecx, eax
add r8d, ecx
cmp r11, r9
jb 0x1002fa32b
mov dword [rsp + 0x44], ecx
mov dword [rsp + 0x40], r8d
jmp 0x1002fa722
mov ecx, dword [0x100015b94]
imul rcx, rdx
lea rbx, [rcx + r11 + 0x3df000]
jmp 0x1002fa0f8
lea rax, [r10 + r9]
movsxd rcx, dword [0x10000003c]
mov edx, dword [rcx + r15 + 0xb4]
mov r8d, dword [rcx + r15 + 0xb0]
add r8, r15
mov qword [rsp + 0x68], rax
mov eax, r10d
sub eax, r15d
mov r11d, eax
mov ecx, eax
mov rax, 0xfffffffffffff000
and r11, rax
lea r13, [rcx + r9]
mov rbx, rcx
sub rbx, r11
lea rcx, [rdx + r8]
mov qword [rsp + 0x48], rcx
mov r15, r13
and r15, rax
sub r13, r15
mov qword [rsp + 0x58], r13
jmp 0x1002fa426
mov eax, dword [r8]
cmp rax, r11
jae 0x1002fa42b
mov eax, dword [r8 + 4]
add r8, rax
cmp r8, rcx
jne 0x1002fa417
xor esi, esi
cmp r8, rcx
je 0x1002fa469
mov eax, dword [r8]
cmp rax, r11
jne 0x1002fa469
mov ecx, dword [r8 + 4]
sub rcx, 8
shr rcx, 1
je 0x1002fa464
lea rdx, [r8 + 8]
movzx eax, word [rdx]
and eax, 0xfff
cmp rax, rbx
jae 0x1002fa464
inc rsi
add rdx, 2
cmp rsi, rcx
jne 0x1002fa44b
mov rcx, qword [rsp + 0x48]
mov edx, dword [rsp + 0x44]
mov ebx, 0xb0d52e05
mov r14, qword [rsp + 0x30]
mov r9d, dword [rsp + 0x40]
lea rdi, [0x100000000]
cmp r8, rcx
je 0x1002fa679
mov eax, dword [r8]
cmp rax, r15
ja 0x1002fa679
mov r11d, dword [r8 + 4]
lea rax, [r11 - 8]
shr rax, 1
cmp rsi, rax
jne 0x1002fa4c4
add r8, r11
cmp r8, rcx
je 0x1002fa679
mov eax, dword [r8]
cmp rax, r15
ja 0x1002fa679
xor esi, esi
jmp 0x1002fa498
mov eax, dword [r8]
cmp rax, r15
jne 0x1002fa4e0
movzx eax, word [r8 + rsi*2 + 8]
and eax, 0xfff
cmp rax, r13
jae 0x1002fa679
mov r11d, 0xf000
mov rax, rsi
inc rsi
test word [r8 + rax*2 + 8], r11w
je 0x1002fa483
xor r12d, r12d
movzx r11d, word [r8 + rax*2 + 8]
mov r13d, r11d
and r13d, 0xfff
add r13d, dword [r8]
add r13, rdi
mov rax, r13
sub rax, r10
je 0x1002fa58d
mov rbp, rax
movzx eax, byte [r12 + r10]
inc r12
sub eax, 0x4f2ad1fb
add r9d, eax
add eax, edx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov ecx, dword [rsp + 0x30]
shr rax, 0x20
add eax, ecx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov ecx, dword [rsp + 0x30]
shr rax, 0x20
lea edx, [rcx + rax*2 - 0x7fffffff]
sar ecx, 0x1f
btr ecx, 0x1f
sub edx, ecx
mov eax, edx
sar eax, 0x1f
btr eax, 0x1f
add eax, edx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov edx, dword [rsp + 0x30]
shr rax, 0x20
add edx, eax
add r9d, edx
cmp r12, rbp
jb 0x1002fa518
mov dword [rsp + 0x44], edx
mov dword [rsp + 0x40], r9d
mov rax, qword [r13]
shr r11d, 0xc
mov qword [rsp + 0x60], rax
cmp r11d, 3
je 0x1002fa5b0
sub r11d, 0xa
neg r11d
sbb r10d, r10d
add r10d, 3
jmp 0x1002fa5b6
mov r10d, 2
mov r11, r14
neg r11
sub r10d, 2
je 0x1002fa5de
cmp r10d, 1
je 0x1002fa5ce
or r10, 0xffffffffffffffff
jmp 0x1002fa5e9
mov r10d, 8
add rax, r11
mov qword [rsp + 0x60], rax
jmp 0x1002fa5e9
mov r10d, 4
add dword [rsp + 0x60], r11d
xor r11d, r11d
test r10, r10
je 0x1002fa667
movzx eax, byte [rsp + r11 + 0x60]
inc r11
sub eax, 0x4f2ad1fb
add r9d, eax
add eax, edx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov ecx, dword [rsp + 0x30]
shr rax, 0x20
add eax, ecx
imul rax, rbx
mov qword [rsp + 0x30], rax
shr rax, 0x20
mov ecx, dword [rsp + 0x30]
lea edx, [rcx + rax*2 - 0x7fffffff]
sar ecx, 0x1f
btr ecx, 0x1f
sub edx, ecx
mov eax, edx
sar eax, 0x1f
btr eax, 0x1f
add eax, edx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov edx, dword [rsp + 0x30]
shr rax, 0x20
add edx, eax
add r9d, edx
cmp r11, r10
jb 0x1002fa5f1
mov dword [rsp + 0x44], edx
mov dword [rsp + 0x40], r9d
mov rcx, qword [rsp + 0x48]
add r10, r13
mov r13, qword [rsp + 0x58]
jmp 0x1002fa483
mov r14, qword [rsp + 0xa0]
mov rbp, qword [rsp + 0x88]
mov r11, qword [rsp + 0x68]
xor r8d, r8d
sub r11, r10
mov dil, r8b
mov r12, qword [rsp + 0x98]
je 0x1002fa716
movzx eax, byte [r8 + r10]
inc r8
sub eax, 0x4f2ad1fb
add r9d, eax
add eax, edx
imul rax, rbx
mov qword [rsp + 0x30], rax
shr rax, 0x20
mov ecx, dword [rsp + 0x30]
add eax, ecx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov ecx, dword [rsp + 0x30]
shr rax, 0x20
lea edx, [rcx + rax*2 - 0x7fffffff]
sar ecx, 0x1f
btr ecx, 0x1f
sub edx, ecx
mov eax, edx
sar eax, 0x1f
btr eax, 0x1f
add eax, edx
imul rax, rbx
mov qword [rsp + 0x30], rax
mov edx, dword [rsp + 0x30]
shr rax, 0x20
add edx, eax
add r9d, edx
cmp r8, r11
jb 0x1002fa6a1
mov dword [rsp + 0x44], edx
mov dword [rsp + 0x40], r9d
mov r13, qword [rsp + 0x80]
mov esi, dword [rsp + 0x38]
mov ebx, 4
xor ecx, ecx
mov rax, rcx
inc rcx
and eax, 7
cmp rcx, 8
mov al, byte [rsp + rax + 0x40]
mov byte [rsp + rcx + 0xaf], al
jb 0x1002fa729
mov eax, 0x9e69d931
mov r15, r14
mov r10, rbp
xor r11d, r11d
and r15d, 7
mov rax, qword [rsp + 0xb0]
mov qword [rsp + 0x48], rbp
mov qword [rsp + 0x30], r13
je 0x1002fac5e
mov r13d, esi
xor r8d, r8d
not r13d
and dword [rsp + 0x50], r8d
mov dword [rsp + 0x58], r8d
test r15d, r15d
jle 0x1002fa7bf
lea r9d, [r11 + 0x38]
movzx edx, byte [r10]
cmp r11d, ebx
jge 0x1002fa79e
lea ecx, [r9 - 0x20]
shl edx, cl
or dword [rsp + 0x50], edx
jmp 0x1002fa7a6
mov ecx, r9d
shl edx, cl
or r8d, edx
inc r11d
inc r10
sub r9d, 8
cmp r11d, r15d
jl 0x1002fa789
mov dword [rsp + 0x58], r8d
mov qword [rsp + 0x48], r10
mov r10d, dword [rsp + 0xb4]
movzx r9d, word [rsp + 0xb2]
mov edx, esi
movzx ebx, r10w
mov r8d, ebx
xor r8d, esi
rol r8d, 4
ror edx, 8
movzx r11d, word [rsp + 0xb6]
mov ecx, r11d
imul ecx, r8d
sub ecx, edx
xor r13d, ecx
mov esi, r13d
mov edx, r13d
sub edx, eax
mov ecx, ebx
rol edx, 8
rol esi, 3
imul ecx, edx
add esi, ecx
xor esi, dword [rsp + 0x38]
mov ecx, r9d
lea r8d, [r10 + rsi]
mov edx, esi
ror r8d, 4
ror edx, 0xf
imul ecx, r8d
sub ecx, edx
mov r8d, r10d
movzx r10d, ax
xor r13d, ecx
mov ecx, r10d
mov edx, r13d
sub r8d, r13d
ror r8d, 2
rol edx, 7
imul ecx, r8d
xor edx, ecx
mov r8d, dword [rsp + 0xb4]
xor esi, edx
mov edx, eax
sub edx, esi
mov ecx, esi
rol edx, 0xc
ror ecx, 4
imul edx, r11d
add ecx, edx
xor r13d, ecx
mov ecx, r13d
mov edx, eax
xor edx, r13d
rol edx, 0xb
ror ecx, 8
imul edx, ebx
xor ecx, edx
xor esi, ecx
mov ecx, r10d
xor ecx, esi
mov edx, esi
ror edx, 4
imul ecx, r9d
sub ecx, edx
mov edx, eax
xor r13d, ecx
mov ecx, r13d
sub ecx, r8d
sub ecx, r10d
xor esi, ecx
mov ecx, esi
sub edx, esi
ror edx, 1
ror ecx, 6
imul edx, r11d
sub edx, ecx
xor r13d, edx
mov ecx, r13d
not ecx
ror ecx, 0xe
mov edx, r8d
add ecx, ebx
imul ecx, r11d
mov ebx, dword [rsp + 0x58]
xor esi, ecx
mov r11d, r8d
xor r11d, eax
xor r11d, r13d
xor r11d, esi
xor edx, r11d
mov ecx, r11d
xor r11d, ebx
rol edx, 0xf
mov r9d, r11d
ror ecx, 8
imul edx, r10d
add ecx, edx
xor r10d, r10d
xor ecx, dword [rsp + 0x50]
xor esi, ecx
lea edx, [r10 + 4]
test r15d, r15d
mov r8d, esi
jle 0x1002fa930
mov rcx, qword [rsp + 0x30]
cmp r10d, edx
jge 0x1002fa916
rol r8d, 8
mov byte [rcx], r8b
inc rcx
xor dil, r8b
jmp 0x1002fa923
rol r9d, 8
mov byte [rcx], r9b
inc rcx
xor dil, r9b
inc r10d
cmp r10d, r15d
jl 0x1002fa902
mov qword [rsp + 0x30], rcx
lea ecx, [r15 - 4]
test ecx, ecx
jle 0x1002fac45
sub edx, ecx
shl edx, 3
mov ecx, edx
shr r11d, cl
shl r11d, cl
mov r10, qword [rsp + 0x48]
mov r13, qword [rsp + 0x30]
mov rcx, r14
shr rcx, 3
mov qword [rsp + 0xa8], rcx
test rcx, rcx
je 0x1002fab8d
mov r12, qword [rsp + 0xa8]
mov r15d, dword [rsp + 0xb4]
movzx ecx, word [rsp + 0xb2]
movzx edx, r15w
mov ebp, dword [rsp + 0x50]
mov dword [rsp + 0x48], ecx
movzx ecx, word [rsp + 0xb6]
mov dword [rsp + 0x58], ecx
mov ecx, r15d
mov dword [rsp + 0x38], edx
xor ecx, eax
mov dword [rsp + 0x30], ecx
movzx ecx, ax
mov r14d, dword [rsp + 0x30]
mov dword [rsp + 0x68], ecx
movzx r8d, byte [r10 + 4]
movzx ecx, byte [r10]
shl ecx, 8
movzx r9d, byte [r10 + 1]
shl r8d, 8
add r10, 8
or r9d, ecx
shl r9d, 8
movzx ecx, byte [r10 - 6]
or r9d, ecx
shl r9d, 8
movzx ecx, byte [r10 - 5]
or r9d, ecx
movzx ecx, byte [r10 - 3]
or r8d, ecx
movzx ecx, byte [r10 - 2]
xor esi, r9d
xor edx, esi
shl r8d, 8
or r8d, ecx
shl r8d, 8
movzx ecx, byte [r10 - 1]
or r8d, ecx
mov ecx, esi
rol edx, 4
ror ecx, 8
imul edx, dword [rsp + 0x58]
sub edx, ecx
xor edx, r8d
xor r11d, edx
mov ecx, r11d
mov edx, r11d
sub edx, eax
rol edx, 8
rol ecx, 3
imul edx, dword [rsp + 0x38]
add ecx, edx
xor esi, ecx
mov ecx, esi
lea edx, [r15 + rsi]
ror edx, 4
ror ecx, 0xf
imul edx, dword [rsp + 0x48]
sub edx, ecx
xor r11d, edx
mov ecx, r11d
mov edx, r15d
sub edx, r11d
ror edx, 2
rol ecx, 7
imul edx, dword [rsp + 0x68]
xor ecx, edx
mov edx, eax
xor esi, ecx
mov ecx, esi
sub edx, esi
rol edx, 0xc
ror ecx, 4
imul edx, dword [rsp + 0x58]
add ecx, edx
xor r11d, ecx
mov edx, eax
mov ecx, r11d
xor edx, r11d
rol edx, 0xb
ror ecx, 8
imul edx, dword [rsp + 0x38]
xor ecx, edx
xor esi, ecx
mov edx, esi
mov ecx, dword [rsp + 0x68]
xor ecx, esi
ror edx, 4
imul ecx, dword [rsp + 0x48]
sub ecx, edx
mov edx, eax
xor r11d, ecx
mov ecx, r11d
sub ecx, r15d
sub ecx, dword [rsp + 0x68]
xor esi, ecx
sub edx, esi
mov ecx, esi
ror edx, 1
ror ecx, 6
imul edx, dword [rsp + 0x58]
sub edx, ecx
xor r11d, edx
mov ecx, r11d
movzx edx, word [rsp + 0xb6]
xor r11d, r14d
not ecx
ror ecx, 0xe
add ecx, dword [rsp + 0x38]
imul ecx, edx
xor esi, ecx
xor r11d, esi
mov ecx, r11d
mov edx, r15d
xor edx, r11d
xor r11d, ebx
rol edx, 0xf
mov byte [r13 + 7], r11b
ror ecx, 8
mov ebx, r8d
imul edx, dword [rsp + 0x68]
add ecx, edx
mov edx, dword [rsp + 0x38]
xor ecx, ebp
xor esi, ecx
mov byte [r13 + 3], sil
mov ebp, r9d
xor dil, sil
ror esi, 8
mov byte [r13 + 2], sil
xor dil, r11b
ror r11d, 8
xor dil, sil
ror esi, 8
mov byte [r13 + 6], r11b
mov byte [r13 + 1], sil
xor dil, r11b
ror r11d, 8
xor dil, sil
mov byte [r13 + 5], r11b
ror esi, 8
mov byte [r13], sil
xor dil, r11b
ror r11d, 8
mov byte [r13 + 4], r11b
add r13, 8
mov cl, r11b
xor cl, sil
xor dil, cl
ror esi, 8
ror r11d, 8
sub r12, 1
jne 0x1002fa9b4
mov r14, qword [rsp + 0xa0]
mov rbp, qword [rsp + 0x88]
mov r12, qword [rsp + 0x98]
mov al, byte [r14 + rbp + 8]
xor al, dil
je 0x1002fac84
call fcn.1000024bc
mov r11, qword [rsp + 0x90]
and r12, 0xfffffffffffffff8
lea r13, [0x100059e28]
mov r10, rax
mov qword [r11 + 0x10], r13
lea r8, [r12 + 0xfff]
mov rax, 0xfffffffffffff000
mov r9d, 0xffff
and r10, rax
and r8, rax
xor edi, edi
mov rcx, qword [0x1003feeb8]
imul rcx, rcx, 0x343fd
shl rdi, 0x10
shr r9, 0x10
add rcx, 0x269ec3
mov rax, rcx
shr rax, 0x10
movzx edx, ax
or rdi, rdx
test r9, r9
jne 0x1002fabde
movabs rax, 0x8000800080008001
mov qword [0x1003feeb8], rcx
mul rdi
shr rdx, 0xf
mov rax, qword [rsp + 0x78]
mov qword [rax + 0x98], r10
imul rdx, rdx, 0xffff
sub rdi, rdx
inc rdi
mov qword [rax + 0xb0], rdi
mov qword [rsp + 0x78], r9
jmp 0x1002fac7a
xor r11d, r11d
test ecx, ecx
jns 0x1002fa949
neg ecx
shl ecx, 3
shr esi, cl
shl esi, cl
jmp 0x1002fa949
mov dword [rsp + 0x50], esi
mov ebx, esi
not ebx
xor esi, esi
jmp 0x1002fa953
mov rax, qword [rsp + 0x78]
mov qword [r12], rax
add r12, 8
cmp r12, r8
jb 0x1002fac6d
jmp 0x1002fad9d
mov rbx, rbp
lea r15, [0x100000000]
mov rsi, r15
mov r13, qword [rsp + 0x80]
mov rax, qword [0x10014d838]
sub rbx, r13
sub rsi, rax
jne 0x1002facb1
test rbx, rbx
je 0x1002fad8a
mov rcx, qword [0x1000199f8]
mov r11, r13
xor edi, edi
sub r11, rbp
lea r8d, [rcx - 1]
sub ebp, r15d
test r8d, r8d
lea r12d, [r14 + rbp]
lea r14, [0x100000000]
js 0x1002fad07
lea eax, [r8 + rdi]
cdq
sub eax, edx
sar eax, 1
movsxd rdx, eax
mov r9d, dword [r14 + rdx*4 + 0x199fc]
and r9d, 0xfffffff
cmp ebp, r9d
jae 0x1002facfd
lea r8d, [rax - 1]
jmp 0x1002fad02
jbe 0x1002fad0c
lea edi, [rax + 1]
cmp r8d, edi
jge 0x1002facd7
movsxd r10, edi
jmp 0x1002fad83
movsxd r10, eax
jmp 0x1002fad83
mov edx, dword [r14 + r10*4 + 0x199fc]
mov eax, edx
and eax, 0xfffffff
cmp eax, r12d
jae 0x1002fad8a
mov edi, edx
mov r8, rdx
sar edx, 0x1e
shl edi, 2
and r8d, 0xfffffff
and edx, 3
sar edi, 0x1e
add r8, r15
xor r9d, r9d
and edi, 3
sub edi, 1
je 0x1002fad5f
sub edi, 1
je 0x1002fad5a
cmp edi, 1
jne 0x1002fad65
mov r9, rsi
jmp 0x1002fad65
mov r9, rbx
jmp 0x1002fad65
mov r9, rsi
sub r9, rbx
sub edx, 2
je 0x1002fad75
cmp edx, 1
jne 0x1002fad80
add qword [r8 + r11], r9
jmp 0x1002fad79
add dword [r8 + r11], r9d
mov rcx, qword [0x1000199f8]
inc r10
mov eax, ecx
cmp r10, rax
jb 0x1002fad11
mov eax, dword [0x100015b94]
mov eax, 0x4fd1df3a
mov r11, qword [rsp + 0x90]
mov qword [r11 + 0x10], r13
mov rcx, qword [rsp + 0xb8]
xor rcx, rsp
call fcn.1002d7828
mov rbx, qword [rsp + 0x110]
add rsp, 0xc0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret