Function at 0x14009d930
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x48
mov r13, rdx
mov r12, rcx
mov ecx, 1
mov edx, 0x28
xor r8d, r8d
call fcn.14003f680
mov rsi, rax
mov qword [rax], r13
mov rax, r13
sub rax, 1
mov qword [rsi + 8], rax
pxor xmm0, xmm0
movdqu xmmword [rsi + 0x10], xmm0
mov qword [rsi + 0x20], 0
jae 0x14009d995
lea rcx, str.n___0
lea rdx, str._home_simon_mem_.build_workdirs_bob_qvbm9mtj_putty_crypto_ntru.c
mov r8d, 0x273
call fcn.1400ca0ec
mov r15, rsi
add r15, 0x18
mov edx, 4
mov rcx, r13
xor r8d, r8d
call fcn.14003f680
mov rdi, rax
mov edx, 4
mov rcx, r13
xor r8d, r8d
call fcn.14003f680
mov qword [rsp + 0x38], rax
test r13, r13
je 0x14009dcd6
cmp r13, 8
jb 0x14009d9e5
lea rax, [r12 + r13*2]
cmp rdi, rax
jae 0x14009da54
lea rax, [rdi + r13*4]
cmp rax, r12
jbe 0x14009da54
xor eax, eax
mov rcx, rax
not rcx
add rcx, r13
mov rdx, r13
and rdx, 3
je 0x14009da12
nop dword [rax]
movzx ebp, word [r12 + rax*2]
mov dword [rdi + rax*4], ebp
add rax, 1
add rdx, 0xffffffffffffffff
jne 0x14009da00
cmp rcx, 3
jb 0x14009daff
nop dword [rax]
movzx ecx, word [r12 + rax*2]
mov dword [rdi + rax*4], ecx
movzx ecx, word [r12 + rax*2 + 2]
mov dword [rdi + rax*4 + 4], ecx
movzx ecx, word [r12 + rax*2 + 4]
mov dword [rdi + rax*4 + 8], ecx
movzx ecx, word [r12 + rax*2 + 6]
mov dword [rdi + rax*4 + 0xc], ecx
add rax, 4
cmp r13, rax
jne 0x14009da20
jmp 0x14009daff
mov rax, r13
and rax, 0xfffffffffffffff8
lea rcx, [rax - 8]
mov rbp, rcx
shr rbp, 3
add rbp, 1
test rcx, rcx
je 0x14009dd76
mov rdx, rbp
and rdx, 0xfffffffffffffffe
xor ecx, ecx
pxor xmm0, xmm0
movq xmm1, qword [r12 + rcx*2]
movq xmm2, qword [r12 + rcx*2 + 8]
punpcklwd xmm1, xmm0
punpcklwd xmm2, xmm0
movdqu xmmword [rdi + rcx*4], xmm1
movdqu xmmword [rdi + rcx*4 + 0x10], xmm2
movq xmm1, qword [r12 + rcx*2 + 0x10]
movq xmm2, qword [r12 + rcx*2 + 0x18]
punpcklwd xmm1, xmm0
punpcklwd xmm2, xmm0
movdqu xmmword [rdi + rcx*4 + 0x20], xmm1
movdqu xmmword [rdi + rcx*4 + 0x30], xmm2
add rcx, 0x10
add rdx, 0xfffffffffffffffe
jne 0x14009da80
test bpl, 1
je 0x14009daf6
movq xmm0, qword [r12 + rcx*2]
movq xmm1, qword [r12 + rcx*2 + 8]
pxor xmm2, xmm2
punpcklwd xmm0, xmm2
punpcklwd xmm1, xmm2
movdqu xmmword [rdi + rcx*4], xmm0
movdqu xmmword [rdi + rcx*4 + 0x10], xmm1
cmp rax, r13
jne 0x14009d9e7
cmp r13, 2
jb 0x14009dcd0
mov rcx, r13
mov rax, rdi
jmp 0x14009db39
xor edx, edx
div ecx
mov qword [rsi + 8], rdx
mov rax, qword [rsp + 0x38]
mov eax, dword [rax + rbx*4]
mov dword [rdi + r13*4], eax
add r13, 1
mov rcx, r13
mov rax, rdi
cmp r13, 1
jbe 0x14009dcd0
mov rdi, qword [rsp + 0x38]
mov qword [rsp + 0x38], rax
xor ebx, ebx
xor r13d, r13d
mov qword [rsp + 0x40], rcx
jmp 0x14009db68
mov eax, ebp
mov dword [rdi + r13*4], eax
add r13, 1
add rbx, 2
mov rcx, qword [rsp + 0x40]
cmp rbx, rcx
jae 0x14009db29
mov rax, rbx
or rax, 1
cmp rax, rcx
je 0x14009dc70
mov r12, rdi
mov rcx, qword [rsp + 0x38]
mov r14d, dword [rcx + rbx*4]
mov ebp, dword [rcx + rax*4]
imul ebp, r14d
add r14d, 2
mov r9, qword [rsi + 0x10]
mov rcx, qword [rsi + 0x20]
mov byte [rsp + 0x28], 0
mov qword [rsp + 0x20], 1
mov r8d, 4
mov rdx, r15
call fcn.14003f730
mov qword [rsi + 0x20], rax
movzx ecx, r14w
mov rdx, qword [rsi + 0x10]
lea rdi, [rdx + 1]
mov qword [rsi + 0x10], rdi
mov dword [rax + rdx*4], ecx
cmp cx, 1
je 0x14009dbf6
mov rcx, qword [rsi]
mov rax, qword [rsi + 8]
add rax, 1
mov rdx, rax
or rdx, rcx
shr rdx, 0x20
je 0x14009dbee
xor edx, edx
div rcx
jmp 0x14009dbf2
xor edx, edx
div ecx
mov qword [rsi + 8], rdx
cmp ebp, 0x4000
mov rdi, r12
jb 0x14009db50
nop word cs:[rax + rax]
nop
mov r9, qword [rsi + 0x10]
mov rcx, qword [rsi + 0x20]
mov byte [rsp + 0x28], 0
mov qword [rsp + 0x20], 1
mov r8d, 4
mov rdx, r15
call fcn.14003f730
mov qword [rsi + 0x20], rax
mov rcx, qword [rsi + 0x10]
lea rdx, [rcx + 1]
mov qword [rsi + 0x10], rdx
mov dword [rax + rcx*4], 1
add ebp, 0xff
mov eax, ebp
shr eax, 8
cmp ebp, 0x3fffff
mov ebp, eax
ja 0x14009dc10
jmp 0x14009db52
mov r9, qword [rsi + 0x10]
mov rcx, qword [rsi + 0x20]
mov byte [rsp + 0x28], 0
mov qword [rsp + 0x20], 1
mov r8d, 4
mov rdx, r15
call fcn.14003f730
mov qword [rsi + 0x20], rax
mov rcx, qword [rsi + 0x10]
lea rdx, [rcx + 1]
mov qword [rsi + 0x10], rdx
mov dword [rax + rcx*4], 0
mov rcx, qword [rsi]
mov rax, qword [rsi + 8]
add rax, 1
mov rdx, rax
or rdx, rcx
shr rdx, 0x20
je 0x14009db11
xor edx, edx
div rcx
jmp 0x14009db15
cmp r13, 1
je 0x14009dcef
lea rcx, str.n__1
lea rdx, str._home_simon_mem_.build_workdirs_bob_qvbm9mtj_putty_crypto_ntru.c
mov r8d, 0x2b5
call fcn.1400ca0ec
mov ebx, dword [rdi]
cmp ebx, 2
jb 0x14009dd50
nop word cs:[rax + rax]
mov r9, qword [rsi + 0x10]
mov rcx, qword [rsi + 0x20]
mov byte [rsp + 0x28], 0
mov qword [rsp + 0x20], 1
mov r8d, 4
mov rdx, r15
call fcn.14003f730
mov qword [rsi + 0x20], rax
mov rcx, qword [rsi + 0x10]
lea rdx, [rcx + 1]
mov qword [rsi + 0x10], rdx
mov dword [rax + rcx*4], 1
add ebx, 0xff
mov eax, ebx
shr eax, 8
cmp ebx, 0x1ff
mov ebx, eax
ja 0x14009dd00
mov rcx, rdi
call fcn.14003f720
mov rcx, qword [rsp + 0x38]
call fcn.14003f720
mov rax, rsi
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
xor ecx, ecx
test bpl, 1
jne 0x14009dad2
jmp 0x14009daf6