Function at 0x18002a850
Capabilities:
Encode data using xor

Disassembly:
push rbp
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbx
sub rsp, 0xc8
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x40], 0xfffffffffffffffe
mov eax, dword [rdx + 0x20]
mov r12d, dword [rdx + 0x24]
movdqu xmm0, xmmword [rdx]
movdqu xmm1, xmmword [rdx + 0x10]
movdqa xmmword [rbp - 0x20], xmm1
movdqa xmmword [rbp - 0x30], xmm0
cmp byte [rdx + 0x2c], 0
je 0x18002a963
mov rsi, rcx
mov dword [rbp - 0x40], eax
mov r13d, dword [rdx + 0x28]
mov byte [rbp + 0x3c], 1
lea rcx, [rbp - 0x30]
call fcn.18005e330
mov r14, rax
mov qword [rbp - 0x50], rax
cmp qword [rsi + 0x18], 0
je 0x18002a994
lea rcx, [rsi + 0x20]
lea rdx, [rbp - 0x50]
call fcn.18005c9e0
mov rcx, qword [rsi]
mov rdx, qword [rsi + 8]
mov r8, rdx
and r8, rax
shr rax, 0x39
movd xmm0, eax
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
pshufd xmm0, xmm0, 0
lea rax, [rcx - 0x18]
xor r9d, r9d
pcmpeqd xmm1, xmm1
movdqu xmm2, xmmword [rcx + r8]
movdqa xmm3, xmm2
pcmpeqb xmm3, xmm0
pmovmskb r10d, xmm3
test r10d, r10d
je 0x18002a945
nop word cs:[rax + rax]
tzcnt r11d, r10d
add r11, r8
and r11, rdx
neg r11
lea r11, [r11 + r11*2]
cmp r14, qword [rax + r11*8]
je 0x18002a982
lea r11d, [r10 - 1]
and r11w, r10w
mov r10d, r11d
jne 0x18002a920
pcmpeqb xmm2, xmm1
pmovmskb r10d, xmm2
test r10d, r10d
jne 0x18002a994
add r8, r9
add r8, 0x10
add r9, 0x10
and r8, rdx
jmp 0x18002a8fb
mov rdx, qword [rbp - 0x30]
test rdx, rdx
je 0x18002a97b
mov rcx, qword [rbp - 0x28]
mov r8d, 1
call fcn.18006a580
xor eax, eax
jmp 0x18002ad7b
mov rbx, qword [rcx + r11*8 - 0x10]
mov edi, dword [rcx + r11*8 - 8]
mov r15b, 1
jmp 0x18002ac5f
movzx edi, byte [rbp - 0x15]
movzx edx, byte [rbp - 0x14]
movzx r8d, byte [rbp - 0x13]
test edi, edi
je 0x18002a9c0
cmp edi, 0xa0
jne 0x18002a9c7
mov eax, edx
xor al, 0xa0
mov ecx, r8d
xor cl, 0xa0
or cl, al
jne 0x18002a9c7
xor r9d, r9d
jmp 0x18002a9cd
mov eax, edx
or al, r8b
je 0x18002a9bb
mov r9d, 1
mov dword [rbp - 0x3c], r12d
movzx ebx, byte [rbp - 0x16]
movzx r10d, word [rbp - 0x18]
mov rax, qword [rbp - 0x30]
mov qword [rbp - 0x38], rax
mov rax, qword [rbp - 0x28]
mov qword [rbp - 0x48], rax
mov r11, qword [rbp - 0x20]
mov rax, qword [0x180277178]
movzx eax, byte [rax]
mov ecx, 0x20000001
test al, al
je 0x18002aa28
mov eax, 1
lock cmpxchg dword [0x18028ec38], ecx
mov r12d, 1
lea r14, [0x18028ec38]
jne 0x18002aa53
mov r15d, 1
jmp 0x18002abb1
mov eax, 1
lock cmpxchg dword [0x18028ec38], ecx
mov r15d, 1
lea r14, [0x18028ec38]
jne 0x18002aace
mov r12d, 1
jmp 0x18002ab40
mov r15d, eax
cmp eax, 0x100
jae 0x18002aa7a
mov ecx, r15d
or ecx, 0x20000000
mov eax, r15d
lock cmpxchg dword [0x18028ec38], ecx
mov r12d, r15d
je 0x18002abb1
mov qword [rbp + 0x10], r11
mov dword [rbp + 0x34], r10d
mov dword [rbp + 0x30], r9d
mov byte [rbp + 0x3e], r8b
mov byte [rbp + 0x3d], dl
mov byte [rbp + 0x3f], 1
lea rdx, [0x18028ec38]
lea rcx, [rbp + 0x18]
lea r8, [rbp + 0x3a]
mov r9, r8
call fcn.180184750
mov r14, qword [rbp + 0x20]
mov r15d, dword [rbp + 0x28]
mov r12d, dword [rbp + 0x2c]
movzx edx, byte [rbp + 0x3d]
movzx r8d, byte [rbp + 0x3e]
mov r9d, dword [rbp + 0x30]
mov r10d, dword [rbp + 0x34]
mov r11, qword [rbp + 0x10]
jmp 0x18002abb1
mov r12d, eax
cmp eax, 0x100
jae 0x18002aaf1
mov ecx, r12d
or ecx, 0x20000000
mov eax, r12d
lock cmpxchg dword [0x18028ec38], ecx
mov r15d, r12d
je 0x18002ab40
mov qword [rbp + 0x10], r11
mov dword [rbp + 0x34], r10d
mov dword [rbp + 0x30], r9d
mov byte [rbp + 0x3e], r8b
mov byte [rbp + 0x3d], dl
mov byte [rbp + 0x3f], 1
lea rdx, [0x18028ec38]
lea rcx, [rbp + 0x18]
lea r8, [rbp + 0x3a]
mov r9, r8
call fcn.180184750
mov r14, qword [rbp + 0x20]
mov r15d, dword [rbp + 0x28]
mov r12d, dword [rbp + 0x2c]
movzx edx, byte [rbp + 0x3d]
movzx r8d, byte [rbp + 0x3e]
mov r9d, dword [rbp + 0x30]
mov r10d, dword [rbp + 0x34]
mov r11, qword [rbp + 0x10]
test r12b, 1
jne 0x18002abb1
mov qword [rbp + 0x10], r11
mov dword [rbp + 0x34], r10d
mov dword [rbp + 0x30], r9d
mov byte [rbp + 0x3e], r8b
mov byte [rbp + 0x3d], dl
lea rax, [0x18028eb58]
mov qword [rbp + 0x18], rax
mov qword [rbp + 0x20], r14
mov dword [rbp + 0x28], r15d
mov dword [rbp + 0x2c], r12d
mov byte [rbp + 0x3f], 1
lea rcx, [rbp - 8]
lea rdx, [rbp + 0x18]
call fcn.18018caa0
mov rcx, qword [rbp - 8]
mov r14, qword [rbp]
test rcx, rcx
movzx edx, byte [rbp + 0x3d]
movzx r8d, byte [rbp + 0x3e]
mov r9d, dword [rbp + 0x30]
mov r10d, dword [rbp + 0x34]
mov r11, qword [rbp + 0x10]
je 0x18002ad8f
mov r15d, dword [rbp + 8]
mov r12d, dword [rbp + 0xc]
jmp 0x18002abb8
lea rcx, [0x18028eb58]
shl ebx, 0x10
or r10d, ebx
movzx eax, dl
movzx edx, r8b
mov qword [rbp - 8], rcx
mov qword [rbp], r14
mov dword [rbp + 8], r15d
mov dword [rbp + 0xc], r12d
mov r8, qword [rbp - 0x38]
mov qword [rbp + 0x18], r8
mov r8, qword [rbp - 0x48]
mov qword [rbp + 0x20], r8
mov qword [rbp + 0x28], r11
shl edx, 0x18
shl eax, 0x10
shl edi, 8
or edi, eax
or edi, edx
or edi, r9d
mov byte [rbp + 0x3b], 1
lea rdx, [rbp + 0x18]
mov r8d, r10d
mov r9d, edi
call fcn.180068820
mov rbx, rax
mov edi, edx
mov eax, r15d
or eax, 0x20000000
lock cmpxchg dword [r14], r12d
je 0x18002ac54
xor r15d, r12d
or r15d, 0x20000000
mov eax, dword [r14]
nop dword [rax]
mov ecx, eax
xor ecx, r15d
lock cmpxchg dword [r14], ecx
jne 0x18002ac30
cmp eax, 0x40000000
jb 0x18002ac54
xor eax, r15d
mov byte [rbp + 0x3b], 0
mov rcx, r14
mov edx, eax
call fcn.18018c540
mov r14, qword [rbp - 0x50]
xor r15d, r15d
mov r12d, dword [rbp - 0x3c]
lea rdx, [rsi + 0x30]
mov byte [rbp + 0x3c], r15b
mov dword [rsp + 0x20], edi
lea rcx, [rbp + 0x18]
mov r8, r14
mov r9, rbx
call fcn.180019240
cmp edi, 0x3fffffff
mov eax, 0x3fffffff
mov ecx, 0x3fffffff
cmovb ecx, edi
test edi, edi
mov edx, 1
cmovne edx, ecx
mov qword [rbp - 8], 0
add r13d, dword [rbp - 0x40]
cmp r13d, 0xc0000001
mov ecx, 0xc0000000
cmovl r13d, ecx
mov dword [rbp], edx
cmp r13d, 0x3fffffff
cmovge r13d, eax
mov dword [rbp + 4], 0x18
cmp r12d, 0xc0000001
cmovge ecx, r12d
cmp ecx, 0x3fffffff
cmovge ecx, eax
mov dword [rbp + 0x18], r13d
mov dword [rbp + 0x1c], ecx
mov dword [rbp + 0x20], edx
mov dword [rbp + 0x24], 0x18
mov r8, qword [rsi + 0x68]
lea rdx, [rbp - 8]
lea r9, [rbp + 0x18]
mov rcx, rbx
call sub.SDL2.dll_SDL_UpperBlit
mov eax, edi
xorps xmm0, xmm0
cvtsi2ss xmm0, rax
mulss xmm0, dword [0x1801a13d8]
call sub.api_ms_win_crt_math_l1_1_0.dll_ceilf
cvttss2si rax, xmm0
mov rcx, rax
sar rcx, 0x3f
movaps xmm1, xmm0
subss xmm1, dword [0x1801a13dc]
cvttss2si rdx, xmm1
and rdx, rcx
or rdx, rax
xor ecx, ecx
xorps xmm1, xmm1
ucomiss xmm0, xmm1
cmovae rcx, rdx
ucomiss xmm0, dword [0x1801a13e0]
mov rax, 0xffffffffffffffff
cmovbe rax, rcx
test r15b, r15b
je 0x18002ad7b
mov rdx, qword [rbp - 0x30]
test rdx, rdx
je 0x18002ad7b
mov rcx, qword [rbp - 0x28]
mov r8d, 1
mov rsi, rax
call fcn.18006a580
mov rax, rsi
add rsp, 0xc8
pop rbx
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
pop rbp
ret
mov dword [rbp + 0x18], r14d
mov byte [rbp + 0x3f], 1
lea rax, [0x1801a1620]
mov qword [rsp + 0x20], rax
lea rcx, [0x1801a1a88]
lea r9, [0x1801a1a68]
lea r8, [rbp + 0x18]
mov edx, 0x2b
call fcn.18019e500
ud2