Function at 0x140303d80
Capabilities:
Encode data using xor

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x28
lea rbp, [rsp + 0x20]
xor edi, edi
mov rsi, rdx
xor edx, edx
lea r8d, [rdi + 0x58]
mov rbx, rcx
mov r14d, edi
call sub.MSVCR90.dll_memset
mov edx, dword [rsi + 4]
test edx, edx
jle 0x140303dd1
mov rax, qword [rsi + 8]
mov rcx, rdx
nop word [rax + rax]
cmp dword [rax], edi
jle 0x140303dc7
inc r14d
add rax, 4
sub rcx, 1
jne 0x140303dc0
mov dword [rbx + 4], edx
mov dword [rbx + 8], r14d
mov eax, dword [rsi]
mov dword [rbx], eax
test r14d, r14d
jle 0x14030438a
mov edx, dword [rsi + 4]
mov rcx, qword [rsi + 8]
mov r8d, r14d
call fcn.1403032f0
movsxd r12, r14d
movabs r13, 0xffffffffffffff0
lea rcx, [r12*8]
mov r15, rax
lea rax, [rcx + 0xf]
cmp rax, rcx
ja 0x140303e18
mov rax, r13
and rax, 0xfffffffffffffff0
call fcn.1403066b0
sub rsp, rax
lea r10, [rsp + 0x20]
mov qword [rbp + 0x50], r10
test r15, r15
jne 0x140303e8e
mov rcx, qword [rbx + 0x18]
test rcx, rcx
je 0x140303e40
call sub.MSVCR90.dll_free
mov rcx, qword [rbx + 0x20]
test rcx, rcx
je 0x140303e4e
call sub.MSVCR90.dll_free
mov rcx, qword [rbx + 0x28]
test rcx, rcx
je 0x140303e5c
call sub.MSVCR90.dll_free
mov rcx, qword [rbx + 0x30]
test rcx, rcx
je 0x140303e6a
call sub.MSVCR90.dll_free
mov rcx, qword [rbx + 0x38]
test rcx, rcx
je 0x140303e78
call sub.MSVCR90.dll_free
xor edx, edx
mov rcx, rbx
lea r8d, [rdx + 0x58]
call sub.MSVCR90.dll_memset
or eax, 0xffffffff
jmp 0x14030438c
mov r9d, edi
mov r8, rdi
test r14d, r14d
jle 0x140303f26
nop dword [rax]
mov ecx, dword [r15 + r8*4]
inc r8
rol ecx, 0x10
mov eax, ecx
mov edx, ecx
shl ecx, 8
shr edx, 8
shl eax, 8
xor edx, eax
and edx, 0xff00ff
xor edx, ecx
mov ecx, edx
mov eax, edx
shl edx, 4
shr ecx, 4
shl eax, 4
xor ecx, eax
and ecx, 0xf0f0f0f
xor ecx, edx
mov edx, ecx
lea eax, [rcx*4]
shr edx, 2
xor edx, eax
lea eax, [rcx*4]
and edx, 0x33333333
xor edx, eax
mov ecx, edx
shr ecx, 1
lea eax, [rdx + rdx]
xor ecx, eax
lea eax, [rdx + rdx]
and ecx, 0x55555555
xor ecx, eax
movsxd rax, r9d
inc r9d
cmp r8, r12
mov dword [r15 + r8*4 - 4], ecx
lea rcx, [r15 + rax*4]
mov qword [r10 + r8*8 - 8], rcx
jl 0x140303ea0
lea r9, [0x1403030f0]
mov r8d, 8
mov rdx, r12
mov rcx, r10
call qword [sym.imp.MSVCR90.dll_qsort]
lea rcx, [r12*4]
lea rax, [rcx + 0xf]
mov qword [rbp + 0x58], rcx
cmp rax, rcx
ja 0x140303f57
mov rax, r13
and rax, 0xfffffffffffffff0
call fcn.1403066b0
sub rsp, rax
lea r13, [rsp + 0x20]
call sub.MSVCR90.dll_malloc
mov edx, edi
mov rcx, rdi
mov qword [rbx + 0x20], rax
test r14d, r14d
jle 0x140303fc9
mov r8, qword [rbp + 0x50]
nop
mov rax, qword [r8 + rcx*8]
inc rcx
sub rax, r15
sar rax, 2
cdqe
mov dword [r13 + rax*4], edx
inc edx
cmp rcx, r12
jl 0x140303f80
test r14d, r14d
jle 0x140303fc9
mov rdx, r15
mov r9, r13
sub rdx, r13
nop word [rax + rax]
movsxd r8, dword [r9]
mov eax, dword [rdx + r9]
mov rcx, qword [rbx + 0x20]
add r9, 4
sub r12, 1
mov dword [rcx + r8*4], eax
jne 0x140303fb0
mov rcx, r15
call sub.MSVCR90.dll_free
mov r8, r13
mov edx, r14d
mov rcx, rsi
call fcn.140303640
mov rcx, qword [rbp + 0x58]
mov qword [rbx + 0x18], rax
call sub.MSVCR90.dll_malloc
mov edx, edi
mov qword [rbx + 0x28], rax
cmp dword [rsi + 4], edx
mov r10d, edi
jle 0x140304026
mov r8, rdi
mov r9, r13
mov rax, qword [rsi + 8]
cmp dword [r8 + rax], edi
jle 0x14030401b
movsxd rcx, dword [r9]
mov rax, qword [rbx + 0x28]
inc r10d
mov dword [rax + rcx*4], edx
add r9, 4
inc edx
add r8, 4
cmp edx, dword [rsi + 4]
jl 0x140304000
movsxd rcx, r10d
call sub.MSVCR90.dll_malloc
mov r14d, edi
mov r9d, edi
mov qword [rbx + 0x30], rax
cmp dword [rsi + 4], edi
jle 0x14030406e
mov r8, rdi
mov rax, qword [rsi + 8]
cmp dword [rax + r8], edi
jle 0x140304061
movsxd rdx, dword [r13]
mov rcx, qword [rbx + 0x30]
movzx eax, byte [rax + r8]
inc r14d
mov byte [rdx + rcx], al
add r13, 4
inc r9d
add r8, 4
cmp r9d, dword [rsi + 4]
jl 0x140304040
mov eax, dword [rbx + 8]
mov ecx, edi
test eax, eax
je 0x14030407d
inc ecx
shr eax, 1
jne 0x140304077
lea eax, [rcx - 4]
cmp eax, 5
mov dword [rbx + 0x40], eax
jge 0x14030408f
mov dword [rbx + 0x40], 5
cmp dword [rbx + 0x40], 8
jle 0x14030409c
mov dword [rbx + 0x40], 8
mov ecx, dword [rbx + 0x40]
mov eax, 1
mov edx, 4
shl eax, cl
movsxd rcx, eax
mov dword [rbp + 0x58], eax
call qword [sym.imp.MSVCR90.dll_calloc]
mov dword [rbx + 0x44], edi
mov r9, rdi
movsxd r13, r14d
mov qword [rbx + 0x38], rax
test r14d, r14d
jle 0x1403041d7
mov r10d, 1
nop word [rax + rax]
mov rcx, qword [rbx + 0x30]
movsx eax, byte [rcx + r9]
cmp dword [rbx + 0x44], eax
jge 0x1403040f1
mov dword [rbx + 0x44], eax
movsx r12d, byte [rcx + r9]
mov esi, dword [rbx + 0x40]
cmp r12d, esi
jg 0x1403041c8
mov rax, qword [rbx + 0x20]
sub esi, r12d
mov r8d, edi
mov ecx, dword [rax + r9*4]
rol ecx, 0x10
mov edx, ecx
mov eax, ecx
shl ecx, 8
shr edx, 8
shl eax, 8
xor edx, eax
and edx, 0xff00ff
xor edx, ecx
mov ecx, edx
mov eax, edx
shl edx, 4
shl eax, 4
shr ecx, 4
xor ecx, eax
and ecx, 0xf0f0f0f
xor ecx, edx
mov edx, ecx
shr edx, 2
lea eax, [rcx*4]
xor edx, eax
lea eax, [rcx*4]
movzx ecx, sil
and edx, 0x33333333
xor edx, eax
mov r11d, edx
shr r11d, 1
lea eax, [rdx + rdx]
xor r11d, eax
lea eax, [rdx + rdx]
and r11d, 0x55555555
xor r11d, eax
mov eax, 1
shl eax, cl
test eax, eax
jle 0x1403041c8
nop word [rax + rax]
mov rax, qword [rbx + 0x30]
movzx ecx, byte [r9 + rax]
mov eax, r8d
inc r8d
shl eax, cl
mov ecx, eax
mov rax, qword [rbx + 0x38]
or rcx, r11
mov dword [rax + rcx*4], r10d
mov rax, qword [rbx + 0x30]
mov ecx, dword [rbx + 0x40]
movsx edx, byte [rax + r9]
sub ecx, edx
mov edx, 1
shl edx, cl
cmp r8d, edx
jl 0x140304190
inc r9
inc r10d
cmp r9, r13
jl 0x1403040e0
mov edx, edi
mov ecx, 0x1f
mov r15d, 0xfffffffe
sub ecx, dword [rbx + 0x40]
mov r12d, edi
mov rsi, rdi
shl r15d, cl
cmp dword [rbp + 0x58], edx
mov dword [rbp + 0x50], edx
mov r11, rdi
jle 0x14030438a
nop
mov r9, qword [rbx + 0x38]
mov r8d, edx
mov ecx, 0x20
sub ecx, dword [rbx + 0x40]
mov qword [rbp + 0x68], r9
shl r8d, cl
mov edx, r8d
rol edx, 0x10
mov ecx, edx
mov eax, edx
mov dword [rbp + 0x60], edx
shr ecx, 8
shl eax, 8
xor ecx, eax
mov eax, edx
and ecx, 0xff00ff
shl eax, 8
xor ecx, eax
mov edx, ecx
mov eax, ecx
shl ecx, 4
shr edx, 4
shl eax, 4
xor edx, eax
and edx, 0xf0f0f0f
xor edx, ecx
mov ecx, edx
lea eax, [rdx*4]
shr ecx, 2
xor ecx, eax
lea eax, [rdx*4]
and ecx, 0x33333333
xor ecx, eax
mov edx, ecx
shr rdx, 1
lea eax, [rcx + rcx]
add ecx, ecx
xor rdx, rax
and edx, 0x55555555
xor rdx, rcx
cmp dword [r9 + rdx*4], 0
jne 0x140304379
lea ecx, [rdi + 1]
cmp ecx, r14d
jge 0x1403042b5
mov rax, qword [rbx + 0x20]
lea rdx, [rax + rsi*4 + 4]
nop
cmp dword [rdx], r8d
ja 0x1403042b5
inc ecx
inc edi
inc rsi
add rdx, 4
cmp ecx, r14d
jl 0x1403042a0
cmp r11, r13
jge 0x1403042db
mov rax, qword [rbx + 0x20]
lea rcx, [rax + r11*4]
mov eax, dword [rcx]
and eax, r15d
cmp r8d, eax
jb 0x1403042db
inc r11
inc r12d
add rcx, 4
cmp r11, r13
jl 0x1403042c2
mov ecx, dword [rbp + 0x60]
mov eax, 0x7fff
mov r9d, r14d
mov edx, ecx
sub r9d, r12d
cmp edi, eax
mov r10d, edi
cmova r10d, eax
cmp r9d, eax
cmova r9d, eax
mov eax, ecx
shr edx, 8
shl eax, 8
shl ecx, 8
or r10d, 0xffff0000
xor edx, eax
shl r10d, 0xf
and edx, 0xff00ff
or r10d, r9d
xor edx, ecx
mov eax, edx
mov ecx, edx
shl edx, 4
shl eax, 4
shr ecx, 4
xor ecx, eax
and ecx, 0xf0f0f0f
xor ecx, edx
mov r8d, ecx
lea eax, [rcx*4]
shr r8d, 2
xor r8d, eax
lea eax, [rcx*4]
and r8d, 0x33333333
xor r8d, eax
mov edx, r8d
shr rdx, 1
lea eax, [r8 + r8]
lea ecx, [r8 + r8]
xor rdx, rax
mov rax, qword [rbp + 0x68]
and edx, 0x55555555
xor rdx, rcx
mov dword [rax + rdx*4], r10d
mov edx, dword [rbp + 0x50]
inc edx
cmp edx, dword [rbp + 0x58]
mov dword [rbp + 0x50], edx
jl 0x140304200
xor eax, eax
lea rsp, [rbp + 8]
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret