Function at 0x140046280
Capabilities:
Encrypt data using rc4 ksa
Resolve function by parsing pe exports

Disassembly:
mov qword [rsp + 0x10], rbx
mov dword [rsp + 0x20], r9d
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x90
mov ebp, dword [rsp + 0xf8]
xor r13d, r13d
cmp dword [rsp + 0x100], 0x10
mov r10d, r13d
mov r15, rcx
mov esi, r8d
mov ecx, dword [rsp + 0xf0]
sete r10b
inc r10d
mov dword [rsp + 0x30], ecx
mov edi, r10d
mov r14d, r9d
mov rax, qword [r15]
mov rbx, rdx
imul edi, r9d
mov eax, dword [rax + 8]
mov r12d, eax
imul r12d, r10d
mov r8d, edi
mov dword [rsp + 0x24], eax
imul r8d, ecx
mov dword [rsp + 0x38], r12d
mov dword [rsp + 0x40], r8d
test ecx, ecx
js 0x140047336
test ebp, ebp
js 0x140047336
je 0x140046320
xor edx, edx
mov eax, 0x7fffffff
div ebp
cmp ecx, eax
jg 0x140047336
imul ecx, ebp
test ecx, ecx
js 0x140047336
test edi, edi
js 0x140047336
je 0x140046345
mov eax, 0x7fffffff
cdq
idiv edi
cmp ecx, eax
jg 0x140047336
mov eax, ebp
imul eax, r8d
movsxd rcx, eax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov qword [r15 + 0x18], rax
test rax, rax
je 0x14004733a
movsxd r10, dword [rsp + 0x24]
test r10d, r10d
js 0x14004731a
mov r11d, dword [rsp + 0xf0]
test r11d, r11d
je 0x14004638f
xor edx, edx
mov eax, 0x7fffffff
div r11d
cmp r10d, eax
jg 0x14004731a
mov ecx, r10d
imul ecx, r11d
test ecx, ecx
js 0x14004731a
mov r8d, dword [rsp + 0x100]
test r8d, r8d
js 0x14004731a
je 0x1400463c3
xor edx, edx
mov eax, 0x7fffffff
div r8d
cmp ecx, eax
jg 0x14004731a
mov eax, ecx
imul eax, r8d
cmp eax, 0x7ffffff8
jg 0x14004731a
mov r9d, ecx
imul r9d, r8d
add r9d, 7
shr r9d, 3
mov dword [rsp + 0x3c], r9d
lea eax, [r9 + 1]
imul eax, ebp
cmp esi, eax
jae 0x140046412
mov edx, dword [0x1401f1440]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.not_enough_pixels
jmp 0x140047354
lea rsi, [0x140000000]
mov edx, r13d
mov dword [rsp + 0x34], edx
test ebp, ebp
je 0x140046e7a
movsxd rsi, r12d
movsxd r14, edi
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x88], r14
mov qword [rsp + 0x58], r10
mov dword [rsp + 0x20], ecx
nop dword [rax]
nop dword [rax + rax]
movzx r10d, byte [rbx]
mov ebp, edx
mov ecx, dword [rsp + 0x40]
inc rbx
mov r15, qword [r15 + 0x18]
imul ebp, ecx
add r15, rbp
mov qword [rsp + 0x50], rbp
cmp r10d, 4
ja 0x140046e48
cmp r8d, 8
jge 0x1400464ae
cmp r9d, r11d
ja 0x140046e29
mov eax, dword [rsp + 0xe8]
mov r12d, 1
imul eax, r11d
mov esi, r12d
mov dword [rsp + 0x38], r12d
mov qword [rsp + 0x60], r12
mov dword [rsp + 0x30], r9d
sub eax, r9d
add r15, rax
mov rdi, r15
sub rdi, rcx
lea rcx, [0x140000000]
test edx, edx
jne 0x1400464c8
movzx r10d, byte [r10 + rcx + 0x1adf48]
test rsi, rsi
jle 0x1400465e9
mov r11, rdi
mov r9, r15
sub r11, rbx
mov rdx, rbx
sub r9, rbx
mov r8, rsi
cmp r10d, 6
ja case.default.0x1400464f6
movsxd rax, r10d
mov eax, dword [rcx + rax*4 + 0x4737c]
add rax, rcx
jmp rax
inc rdx
sub r8, 1
je 0x1400465e1
lea rcx, [0x140000000]
jmp 0x1400464e3
movzx eax, byte [rdx]
mov byte [r9 + rdx], al
lea rdx, [rdx + 1]
sub r8, 1
je 0x1400465e1
jmp case.0x1400464f6.0
movzx eax, byte [rdx]
mov byte [r9 + rdx], al
lea rdx, [rdx + 1]
sub r8, 1
je 0x1400465e1
jmp case.0x1400464f6.1
movzx eax, byte [r11 + rdx]
add al, byte [rdx]
mov byte [r9 + rdx], al
lea rdx, [rdx + 1]
sub r8, 1
je 0x1400465e1
jmp case.0x1400464f6.2
movzx eax, byte [r11 + rdx]
lea rdx, [rdx + 1]
shr al, 1
add al, byte [rdx - 1]
mov byte [r9 + rdx - 1], al
sub r8, 1
je 0x1400465e1
jmp case.0x1400464f6.3
movzx eax, byte [r11 + rdx]
lea rdx, [rdx + 1]
test al, al
mov ecx, r13d
cmovne ecx, eax
add cl, byte [rdx - 1]
mov byte [r9 + rdx - 1], cl
sub r8, 1
je 0x1400465e1
jmp case.0x1400464f6.4
movzx eax, byte [rdx]
mov byte [r9 + rdx], al
lea rdx, [rdx + 1]
sub r8, 1
je 0x1400465e1
jmp case.0x1400464f6.5
movzx eax, byte [rdx]
mov byte [r9 + rdx], al
lea rdx, [rdx + 1]
sub r8, 1
jne case.0x1400464f6.6
mov r11d, dword [rsp + 0xf0]
mov eax, dword [rsp + 0x100]
cmp eax, 8
jne 0x140046626
movsxd rax, dword [rsp + 0xe8]
mov rcx, qword [rsp + 0x58]
cmp dword [rsp + 0x24], eax
je 0x14004660d
mov byte [rcx + r15], 0xff
add rbx, rcx
lea rcx, [rax + r15]
add rdi, rax
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x48], rdi
mov r8, rbx
jmp 0x14004667b
cmp eax, 0x10
jne 0x14004665b
mov ecx, dword [rsp + 0x24]
cmp ecx, dword [rsp + 0xe8]
je 0x14004663f
mov word [rsi + r15], 0xffff
movsxd rax, r12d
lea rcx, [r15 + r14]
add rbx, rax
mov qword [rsp + 0x28], rcx
add rdi, r14
mov r8, rbx
mov qword [rsp + 0x48], rdi
jmp 0x14004667b
inc rbx
lea rcx, [r15 + 1]
inc rdi
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x48], rdi
mov r8, rbx
cmp eax, 8
jl 0x140046b23
mov eax, dword [rsp + 0x24]
cmp eax, dword [rsp + 0xe8]
je 0x140046b23
cmp r10d, 6
ja case.default.0x1400466ae
lea r9, [0x140000000]
movsxd rax, r10d
mov rbx, r8
mov edx, dword [r9 + rax*4 + 0x47398]
add rdx, r9
jmp rdx
lea eax, [r11 - 1]
cmp eax, 1
jb case.default.0x1400466ae
movsxd r11, r12d
mov r10d, eax
test rsi, rsi
jle 0x1400466f1
mov r9, rbx
mov rdx, rcx
sub r9, rcx
mov r8, rsi
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [r9 + rdx]
mov byte [rdx], al
lea rdx, [rdx + 1]
sub r8, 1
jne 0x1400466e0
mov byte [rsi + rcx], 0xff
add rbx, r11
add rcx, r14
sub r10, 1
jne 0x1400466c3
jmp case.default.0x1400466ae
lea eax, [r11 - 1]
cmp eax, 1
jb case.default.0x1400466ae
movsxd rdi, r12d
mov r11d, eax
nop dword [rax]
test rsi, rsi
jle 0x140046755
mov r9, rcx
mov r10, rcx
sub r9, r14
mov rdx, rbx
sub r9, rbx
mov r8, rsi
sub r10, rbx
nop word [rax + rax]
movzx eax, byte [r9 + rdx]
add al, byte [rdx]
mov byte [rdx + r10], al
lea rdx, [rdx + 1]
sub r8, 1
jne 0x140046740
mov byte [rsi + rcx], 0xff
add rbx, rdi
add rcx, r14
sub r11, 1
jne 0x140046720
jmp case.default.0x1400466ae
lea eax, [r11 - 1]
cmp eax, 1
jb case.default.0x1400466ae
movsxd r15, r12d
mov ebp, eax
nop dword [rax]
mov r11, r13
test r12d, r12d
jle 0x140046854
cmp r12d, 0x40
jb 0x140046854
lea eax, [r12 - 1]
movsxd rdx, eax
lea rax, [rdx + rbx]
lea r8, [rdx + rcx]
cmp rcx, rax
ja 0x1400467b4
cmp r8, rbx
jae 0x140046854
lea rax, [rdx + rdi]
cmp rcx, rax
ja 0x1400467c6
cmp r8, rdi
jae 0x140046854
mov edx, r12d
and edx, 0x8000003f
jge 0x1400467d8
dec edx
or edx, 0xffffffc0
inc edx
mov eax, r12d
mov r8, rcx
sub eax, edx
mov rdx, rdi
sub rdx, rbx
movsxd r9, eax
sub r8, rbx
lea rax, [rbx + 0x10]
movdqu xmm0, xmmword [rax - 0x10]
add r11, 0x40
movdqu xmm1, xmmword [rdx + rax - 0x10]
movdqu xmm2, xmmword [rdx + rax]
lea rax, [rax + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x40]
movdqu xmmword [r8 + rax - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rax - 0x30]
movdqu xmm1, xmmword [rdx + rax - 0x30]
movdqu xmmword [r8 + rax - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rdx + rax - 0x20]
movdqu xmmword [r8 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r8 + rax - 0x20], xmm2
cmp r11, r9
jl 0x1400467f0
cmp r11, rsi
jge 0x140046885
mov r9, rdi
lea rdx, [r11 + rbx]
mov r10, rcx
sub r9, rbx
sub r10, rbx
mov r8, rsi
sub r8, r11
nop
movzx eax, byte [rdx + r9]
add al, byte [rdx]
mov byte [rdx + r10], al
lea rdx, [rdx + 1]
sub r8, 1
jne 0x140046870
mov byte [rsi + rcx], 0xff
add rbx, r15
add rcx, r14
add rdi, r14
sub rbp, 1
jne 0x140046780
mov rbp, qword [rsp + 0x50]
jmp case.default.0x1400466ae
lea eax, [r11 - 1]
cmp eax, 1
jb case.default.0x1400466ae
movsxd r12, r12d
mov ebp, eax
test rsi, rsi
jle 0x140046901
mov r9, rcx
mov r11, rbx
sub r9, r14
sub r11, rdi
sub r9, rdi
mov r15, rcx
sub r15, rdi
mov r8, rdi
mov r10, rsi
nop dword [rax + rax]
movzx edx, byte [r9 + r8]
movzx eax, byte [r8]
lea r8, [r8 + 1]
add edx, eax
shr edx, 1
add dl, byte [r11 + r8 - 1]
mov byte [r15 + r8 - 1], dl
sub r10, 1
jne 0x1400468e0
mov byte [rsi + rcx], 0xff
add rbx, r12
add rcx, r14
add rdi, r14
sub rbp, 1
jne 0x1400468b8
mov rbp, qword [rsp + 0x50]
jmp case.default.0x1400466ae
lea eax, [r11 - 1]
cmp eax, 1
jb case.default.0x1400466ae
movsxd rdx, r12d
mov qword [rsp + 0x80], rdx
mov qword [rsp + 0x68], rax
nop dword [rax + rax]
test rsi, rsi
jle 0x1400469ef
mov rax, rdi
mov r11, rcx
sub rax, rcx
sub r11, r14
mov qword [rsp + 0x78], rax
mov r12, rsi
mov rax, r14
sub rax, rcx
lea rcx, [rax + rdi]
mov rdi, qword [rsp + 0x78]
add rax, rbx
mov rsi, rax
movzx r10d, byte [r11]
movzx r15d, byte [rdi + r11]
mov r8d, r10d
movzx r13d, byte [rcx + r11]
sub r8d, r15d
lea r9d, [r8 + r13]
mov eax, r9d
sub r9d, r15d
sub eax, r10d
cdq
mov ebp, eax
mov eax, r8d
xor ebp, edx
sub ebp, edx
cdq
mov r8d, eax
mov eax, r9d
xor r8d, edx
sub r8d, edx
cdq
xor eax, edx
sub eax, edx
cmp ebp, r8d
jg 0x1400469b8
cmp ebp, eax
jle 0x1400469c2
cmp r8d, eax
mov r10d, r15d
cmovle r10d, r13d
add r10b, byte [rsi + r11]
mov byte [r11 + r14], r10b
inc r11
sub r12, 1
jne 0x140046972
mov rcx, qword [rsp + 0x28]
mov rdi, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x60]
mov rax, qword [rsp + 0x68]
mov rdx, qword [rsp + 0x80]
add rdi, r14
mov byte [rsi + rcx], 0xff
add rcx, r14
mov qword [rsp + 0x48], rdi
add rbx, rdx
mov qword [rsp + 0x28], rcx
sub rax, 1
mov qword [rsp + 0x68], rax
jne 0x140046940
mov rbp, qword [rsp + 0x50]
jmp case.default.0x1400466ae
lea eax, [r11 - 1]
cmp eax, 1
jb case.default.0x1400466ae
movsxd rdi, r12d
mov r11d, eax
test rsi, rsi
jle 0x140046a69
mov r9, rcx
mov r10, rcx
sub r9, r14
mov rdx, rbx
sub r9, rbx
mov r8, rsi
sub r10, rbx
nop dword [rax]
movzx eax, byte [rdx + r9]
lea rdx, [rdx + 1]
shr al, 1
add al, byte [rdx - 1]
mov byte [rdx + r10 - 1], al
sub r8, 1
jne 0x140046a50
mov byte [rsi + rcx], 0xff
add rbx, rdi
add rcx, r14
sub r11, 1
jne 0x140046a32
jmp case.default.0x1400466ae
lea eax, [r11 - 1]
cmp eax, 1
jb case.default.0x1400466ae
movsxd rdi, r12d
mov r11d, eax
nop word [rax + rax]
test rsi, rsi
jle 0x140046ac5
mov r9, rcx
mov r10, rcx
sub r9, r14
mov rdx, rbx
sub r9, rbx
mov r8, rsi
sub r10, rbx
nop word [rax + rax]
movzx eax, byte [r9 + rdx]
add al, byte [rdx]
mov byte [r10 + rdx], al
lea rdx, [rdx + 1]
sub r8, 1
jne 0x140046ab0
mov byte [rsi + rcx], 0xff
add rbx, rdi
add rcx, r14
sub r11, 1
jne 0x140046a90
mov r8d, dword [rsp + 0x100]
mov r15, qword [rsp + 0xd0]
cmp r8d, 0x10
jne 0x140046dfa
mov rcx, qword [r15 + 0x18]
mov r11d, dword [rsp + 0xf0]
add rcx, rbp
test r11d, r11d
je 0x140046e02
mov eax, r11d
nop word [rax + rax]
mov byte [rsi + rcx + 1], 0xff
add rcx, r14
sub rax, 1
jne 0x140046b10
jmp 0x140046e02
mov r13d, dword [rsp + 0x30]
dec r13d
imul r13d, r12d
mov dword [rsp + 0x28], r13d
cmp r10d, 6
ja case.default.0x140046b56
lea r8, [0x140000000]
movsxd rax, r10d
movsxd r9, r13d
mov edx, dword [r8 + rax*4 + 0x473b4]
add rdx, r8
jmp rdx
mov r8, r9
mov rdx, rbx
call sub.VCRUNTIME140.dll_memcpy
jmp case.default.0x140046b56
test r13d, r13d
jle case.default.0x140046b56
mov r8, rcx
mov rdx, rbx
sub r8, rsi
sub r8, rbx
sub rcx, rbx
movzx eax, byte [r8 + rdx]
add al, byte [rdx]
mov byte [rcx + rdx], al
lea rdx, [rdx + 1]
sub r9, 1
jne 0x140046b80
jmp case.default.0x140046b56
xor eax, eax
mov r8d, eax
test r13d, r13d
jle 0x140046c74
cmp r13d, 0x40
jb 0x140046c74
lea eax, [r13 - 1]
movsxd rdx, eax
lea rax, [rdx + rbx]
lea r10, [rdx + rcx]
cmp rcx, rax
ja 0x140046bce
cmp r10, rbx
jae 0x140046c74
lea rax, [rdx + rdi]
cmp rcx, rax
ja 0x140046be0
cmp r10, rdi
jae 0x140046c74
mov edx, r13d
and edx, 0x8000003f
jge 0x140046bf2
dec edx
or edx, 0xffffffc0
inc edx
mov eax, r13d
mov r10, rcx
sub eax, edx
mov rdx, rdi
sub rdx, rbx
movsxd r11, eax
sub r10, rbx
lea rax, [rbx + 0x10]
nop word [rax + rax]
movdqu xmm0, xmmword [rax - 0x10]
add r8, 0x40
movdqu xmm1, xmmword [rdx + rax - 0x10]
movdqu xmm2, xmmword [rdx + rax]
lea rax, [rax + 0x40]
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x40]
movdqu xmmword [r10 + rax - 0x50], xmm1
paddb xmm2, xmm0
movdqu xmm0, xmmword [rax - 0x30]
movdqu xmm1, xmmword [rdx + rax - 0x30]
movdqu xmmword [r10 + rax - 0x40], xmm2
paddb xmm1, xmm0
movdqu xmm0, xmmword [rax - 0x20]
movdqu xmm2, xmmword [rdx + rax - 0x20]
movdqu xmmword [r10 + rax - 0x30], xmm1
paddb xmm2, xmm0
movdqu xmmword [r10 + rax - 0x20], xmm2
cmp r8, r11
jl 0x140046c10
cmp r8, r9
jge case.default.0x140046b56
sub rdi, rbx
lea rdx, [r8 + rbx]
sub rcx, rbx
sub r9, r8
nop word [rax + rax]
movzx eax, byte [rdx + rdi]
add al, byte [rdx]
mov byte [rdx + rcx], al
lea rdx, [rdx + 1]
sub r9, 1
jne 0x140046c90
jmp case.default.0x140046b56
test r13d, r13d
jle case.default.0x140046b56
mov r8, rcx
mov r10, rbx
sub r8, rsi
sub r10, rdi
sub r8, rdi
sub rcx, rdi
nop dword [rax]
nop word [rax + rax]
movzx edx, byte [r8 + rdi]
movzx eax, byte [rdi]
lea rdi, [rdi + 1]
add edx, eax
shr edx, 1
add dl, byte [r10 + rdi - 1]
mov byte [rcx + rdi - 1], dl
sub r9, 1
jne 0x140046cd0
jmp case.default.0x140046b56
test r13d, r13d
jle case.default.0x140046b56
mov r11, rcx
mov r14, rdi
sub r11, rsi
sub r14, rcx
mov rax, rsi
sub rax, rcx
lea r13, [rax + rdi]
lea r12, [rax + rbx]
nop word [rax + rax]
movzx r10d, byte [r11]
movzx ebp, byte [r11 + r14]
mov ecx, r10d
movzx r15d, byte [r11 + r13]
sub ecx, ebp
lea r8d, [r15 + rcx]
mov eax, r8d
sub r8d, ebp
sub eax, r10d
cdq
mov edi, eax
mov eax, ecx
xor edi, edx
sub edi, edx
cdq
mov ecx, eax
mov eax, r8d
xor ecx, edx
sub ecx, edx
cdq
xor eax, edx
sub eax, edx
cmp edi, ecx
jg 0x140046d60
cmp edi, eax
jle 0x140046d69
cmp ecx, eax
mov r10d, ebp
cmovle r10d, r15d
add r10b, byte [r11 + r12]
mov byte [r11 + rsi], r10b
inc r11
sub r9, 1
jne 0x140046d20
mov r14, qword [rsp + 0x88]
mov r13d, dword [rsp + 0x28]
jmp case.default.0x140046b56
test r13d, r13d
jle case.default.0x140046b56
mov r8, rcx
mov rdx, rbx
sub r8, rsi
sub r8, rbx
sub rcx, rbx
nop dword [rax]
movzx eax, byte [r8 + rdx]
lea rdx, [rdx + 1]
shr al, 1
add al, byte [rdx - 1]
mov byte [rcx + rdx - 1], al
sub r9, 1
jne 0x140046da0
jmp case.default.0x140046b56
test r13d, r13d
jle case.default.0x140046b56
mov r8, rcx
mov rdx, rbx
sub r8, rsi
sub r8, rbx
sub rcx, rbx
nop
movzx eax, byte [r8 + rdx]
add al, byte [rdx]
mov byte [rcx + rdx], al
lea rdx, [rdx + 1]
sub r9, 1
jne 0x140046dd0
mov r8d, dword [rsp + 0x100]
mov r15, qword [rsp + 0xd0]
movsxd rax, r13d
add rbx, rax
mov r11d, dword [rsp + 0xf0]
mov edx, dword [rsp + 0x34]
xor r13d, r13d
mov ebp, dword [rsp + 0xf8]
inc edx
mov r9d, dword [rsp + 0x3c]
mov dword [rsp + 0x34], edx
cmp edx, ebp
jae 0x140046e67
mov r12d, dword [rsp + 0x38]
jmp 0x140046450
mov edx, dword [0x1401f1440]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.invalid_width
jmp 0x140047354
mov edx, dword [0x1401f1440]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.invalid_filter
jmp 0x140047354
mov ecx, dword [rsp + 0x20]
lea rsi, [0x140000000]
mov r14d, dword [rsp + 0xe8]
movsxd rbx, dword [rsp + 0x100]
cmp ebx, 8
jge 0x1400472cf
test ebp, ebp
je 0x140047313
mov r12d, dword [rsp + 0x108]
lea rsi, [rsi + 0xe1ca0]
add rsi, rbx
movsxd rbp, r11d
imul r14d, r11d
mov r15d, r9d
nop
mov rax, qword [rsp + 0xd0]
mov edi, r13d
imul edi, dword [rsp + 0x40]
mov r9, r14
sub r9, r15
mov rax, qword [rax + 0x18]
add r9, rax
add r9, rdi
lea r8, [rax + rdi]
test r12d, r12d
jne 0x140046edf
movzx r10d, byte [rsi]
jmp 0x140046ee2
mov r10b, 1
mov dword [rsp + 0x20], ecx
cmp ebx, 4
jne 0x140046f66
mov ebx, ecx
cmp ecx, 2
jl 0x140046f45
mov r11d, ebx
mov dword [rsp + 0x20], ecx
shr r11, 1
mov eax, r11d
neg eax
lea ebx, [rbx + rax*2]
nop dword [rax]
nop dword [rax + rax]
movzx eax, byte [r9]
shr al, 4
movzx edx, al
movzx ecx, r10b
imul edx, ecx
movzx ecx, r10b
mov byte [r8], dl
movzx eax, byte [r9]
inc r9
and al, 0xf
movzx edx, al
imul edx, ecx
mov byte [r8 + 1], dl
add r8, 2
sub r11, 1
jne 0x140046f10
test ebx, ebx
jle 0x140047220
movzx eax, byte [r9]
shr al, 4
movzx edx, al
movzx ecx, r10b
imul edx, ecx
mov byte [r8], dl
jmp 0x140047220
cmp ebx, 2
jne 0x140047047
mov ebx, ecx
cmp ecx, 4
jl 0x140046ff5
mov r11d, ebx
mov dword [rsp + 0x20], ecx
shr r11, 2
mov eax, r11d
neg eax
lea ebx, [rbx + rax*4]
nop dword [rax]
movzx eax, byte [r9]
shr al, 6
movzx edx, al
movzx ecx, r10b
imul edx, ecx
movzx eax, r10b
mov byte [r8], dl
movzx ecx, byte [r9]
shr cl, 4
and cl, 3
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 1], cl
movzx ecx, byte [r9]
shr cl, 2
and cl, 3
movzx ecx, cl
imul ecx, eax
mov byte [r8 + 2], cl
movzx eax, byte [r9]
inc r9
and al, 3
movzx ecx, r10b
movzx edx, al
imul edx, ecx
mov byte [r8 + 3], dl
add r8, 4
sub r11, 1
jne 0x140046f90
test ebx, ebx
jle 0x140047010
movzx eax, byte [r9]
shr al, 6
movzx edx, al
movzx ecx, r10b
imul edx, ecx
mov byte [r8], dl
inc r8
cmp ebx, 1
jle 0x14004702f
movzx ecx, byte [r9]
shr cl, 4
and cl, 3
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp ebx, 2
jle 0x140047220
movzx ecx, byte [r9]
shr cl, 2
and cl, 3
jmp 0x140047213
cmp ebx, 1
jne 0x140047220
mov r11d, ecx
mov dword [rsp + 0x20], ecx
cmp ecx, 8
jl 0x140047148
mov ebx, r11d
mov dword [rsp + 0x20], ecx
shr rbx, 3
mov eax, ebx
neg eax
lea r11d, [r11 + rax*8]
nop dword [rax]
nop word [rax + rax]
movzx eax, byte [r9]
shr al, 7
movzx edx, al
movzx ecx, r10b
imul edx, ecx
movzx eax, r10b
mov byte [r8], dl
movzx ecx, byte [r9]
shr cl, 6
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 1], cl
movzx ecx, byte [r9]
shr cl, 5
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 2], cl
movzx ecx, byte [r9]
shr cl, 4
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 3], cl
movzx ecx, byte [r9]
shr cl, 3
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 4], cl
movzx ecx, byte [r9]
shr cl, 2
and cl, 1
movzx ecx, cl
imul ecx, eax
movzx eax, r10b
mov byte [r8 + 5], cl
movzx ecx, byte [r9]
shr cl, 1
and cl, 1
movzx ecx, cl
imul ecx, eax
mov byte [r8 + 6], cl
movzx eax, byte [r9]
inc r9
and al, 1
movzx ecx, r10b
movzx edx, al
imul edx, ecx
mov byte [r8 + 7], dl
add r8, 8
sub rbx, 1
jne 0x140047080
test r11d, r11d
jle 0x140047164
movzx eax, byte [r9]
shr al, 7
movzx edx, al
movzx ecx, r10b
imul edx, ecx
mov byte [r8], dl
inc r8
cmp r11d, 1
jle 0x140047184
movzx ecx, byte [r9]
shr cl, 6
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 2
jle 0x1400471a4
movzx ecx, byte [r9]
shr cl, 5
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 3
jle 0x1400471c4
movzx ecx, byte [r9]
shr cl, 4
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 4
jle 0x1400471e4
movzx ecx, byte [r9]
shr cl, 3
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 5
jle 0x140047204
movzx ecx, byte [r9]
shr cl, 2
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
inc r8
cmp r11d, 6
jle 0x140047220
movzx ecx, byte [r9]
shr cl, 1
and cl, 1
movzx eax, r10b
movzx ecx, cl
imul ecx, eax
mov byte [r8], cl
mov r10d, dword [rsp + 0x24]
cmp r10d, dword [rsp + 0xe8]
je 0x1400472a9
mov rax, qword [rsp + 0xd0]
lea rcx, [rbp - 1]
mov rdx, qword [rax + 0x18]
add rdx, rdi
cmp r10d, 1
jne 0x140047264
test rcx, rcx
js 0x1400472a9
nop dword [rax]
mov byte [rdx + rcx*2 + 1], 0xff
movzx eax, byte [rcx + rdx]
mov byte [rdx + rcx*2], al
sub rcx, 1
jns 0x140047250
jmp 0x1400472a9
test rcx, rcx
js 0x1400472a9
lea r8, [rcx*2 + 1]
add r8, rdx
lea rdx, [rdx + rcx*4]
add r8, rcx
add rdx, 2
nop
sub rcx, 1
mov byte [rdx + 1], 0xff
movzx eax, byte [r8 + 1]
lea r8, [r8 - 3]
mov byte [rdx], al
lea rdx, [rdx - 4]
movzx eax, byte [r8 + 3]
mov byte [rdx + 3], al
movzx eax, byte [r8 + 2]
mov byte [rdx + 2], al
jns 0x140047280
mov ecx, dword [rsp + 0x20]
inc r13d
mov ebx, dword [rsp + 0x100]
cmp r13d, dword [rsp + 0xf8]
jb 0x140046eb0
mov eax, 1
jmp 0x14004735f
cmp ebx, 0x10
jne 0x140047313
mov r9, qword [r15 + 0x18]
imul r14d, r11d
mov r8, r9
imul r14d, ebp
test r14d, r14d
je 0x140047313
mov r10d, r14d
nop dword [rax + rax]
movzx edx, byte [r9]
lea r9, [r9 + 2]
movzx ecx, byte [r8 + 1]
lea r8, [r8 + 2]
shl dx, 8
or dx, cx
mov word [r8 - 2], dx
sub r10, 1
jne 0x1400472f0
mov eax, 1
jmp 0x14004735f
mov edx, dword [0x1401f1440]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.too_large
jmp 0x140047354
mov qword [r15 + 0x18], r13
mov edx, dword [0x1401f1440]
mov rax, qword gs:[0x58]
mov rax, qword [rax + rdx*8]
lea rdx, str.outofmem
mov ecx, 0x20
mov qword [rcx + rax], rdx
xor eax, eax
mov rbx, qword [rsp + 0xd8]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret