Function at 0x5196f0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xb8
vmovups xmmword [rsp + 0xa0], xmm6
mov rdi, qword [rcx + 0x10]
mov rbx, rdx
mov rbp, rcx
mov ecx, 0x28
mov qword [rsp + 0x98], rdi
call sub.msvcrt.dll_malloc
mov qword [rsp + 0x20], rbx
mov ecx, 0x14
vbroadcastsd ymm0, qword [rsp + 0x20]
mov qword [rsp + 0x88], rax
vmovups xmmword [rax], xmm0
vextractf128 xmmword [rax + 0x10], ymm0, 1
mov qword [rax + 0x20], rbx
vzeroupper
call sub.msvcrt.dll_malloc
vmovdqu xmm6, xmmword [0x005ebcc0]
mov ecx, ebx
mov qword [rsp + 0x70], rax
vmovups xmmword [rax], xmm6
mov dword [rax + 0x10], 0
mov eax, 1
shl eax, cl
movsxd r15, eax
test r15, r15
jle 0x5198af
xor esi, esi
nop word [rax + rax]
mov edx, 1
mov ecx, 0x20
call sub.msvcrt.dll_calloc
test rdi, rdi
mov r12, rax
lea rax, [rdi + rdi]
mov rdx, rax
not rdx
cmovs rax, rdx
cmp rax, 0x7f
jbe 0x51a220
xor edx, edx
nop
mov r8d, eax
mov ecx, edx
shr rax, 7
or r8d, 0xffffff80
add edx, 1
mov byte [r12 + rcx], r8b
cmp rax, 0x7f
ja 0x5197c0
add rdx, r12
mov byte [rdx], al
mov ecx, 0x40
add rsi, 1
call sub.msvcrt.dll_malloc
vmovdqu xmm1, xmmword [r12]
mov ecx, 0x20
mov r13, rax
mov rax, qword [rbp + 0x18]
vmovdqu xmm2, xmmword [r12 + 0x10]
vmovdqu xmm5, xmmword [rax]
vmovups xmmword [r13], xmm5
vmovdqu xmm0, xmmword [rax + 0x10]
vmovups xmmword [r13 + 0x20], xmm1
vmovups xmmword [r13 + 0x10], xmm0
vmovups xmmword [r13 + 0x30], xmm2
call sub.msvcrt.dll_malloc
mov r9d, 0x20
mov edx, 0x40
mov rcx, r13
mov r8, rax
mov r14, rax
call fcn.0051bc20
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov rcx, qword [rbp]
not rdx
and rdx, qword [rsp + 0x98]
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 1
mov rcx, r14
mov r8d, 0x20
call sub.msvcrt.dll_fwrite
mov rax, qword [rsp + 0x98]
mov rcx, r14
lea rdi, [rax + 1]
mov qword [rsp + 0x98], rdi
call sub.msvcrt.dll_free
mov rcx, r13
call sub.msvcrt.dll_free
mov rcx, r12
call sub.msvcrt.dll_free
cmp r15, rsi
jne 0x519790
mov byte [rsp + 0x5f], 5
cmp rbx, 1
je 0x51a6d0
nop
movsx rax, byte [rsp + 0x5f]
mov r15, qword [rsp + 0x88]
mov rcx, qword [rsp + 0x70]
mov rbx, rax
mov byte [rsp + 0x20], al
sub ebx, 1
mov rsi, qword [r15 + rax*8 - 8]
movsxd r12, dword [rcx + rax*4 - 4]
mov byte [rsp + 0x5f], bl
test bl, bl
jle 0x519953
movsx rbx, bl
lea r14, [rbx*8]
shl rbx, 2
mov rcx, r14
call sub.msvcrt.dll_malloc
mov r8, r14
mov rdx, r15
mov rcx, rax
mov r13, rax
call sub.msvcrt.dll_memcpy
mov rcx, r15
call sub.msvcrt.dll_free
mov rcx, rbx
call sub.msvcrt.dll_malloc
mov r8, rbx
mov rbx, qword [rsp + 0x70]
mov rcx, rax
mov r14, rax
mov rdx, rbx
call sub.msvcrt.dll_memcpy
mov rcx, rbx
call sub.msvcrt.dll_free
mov qword [rsp + 0x88], r13
mov qword [rsp + 0x70], r14
lea r15, [rsi - 1]
mov ecx, 0x28
call sub.msvcrt.dll_malloc
mov ecx, 0x14
mov qword [rax], r15
mov qword [rax + 8], r15
mov qword [rax + 0x10], r15
mov qword [rax + 0x18], r15
mov qword [rax + 0x20], r15
mov qword [rsp + 0x78], rax
call sub.msvcrt.dll_malloc
mov ecx, esi
mov edx, 1
mov qword [rsp + 0x80], rax
vmovups xmmword [rax], xmm6
mov dword [rax + 0x10], 0
mov eax, 1
shl eax, cl
lea ecx, [rsi - 1]
movsxd r8, eax
shl edx, cl
movsxd rax, edx
mov qword [rsp + 0x50], rax
test r12, r12
je 0x519e10
mov rbx, rdi
cmp r12, 1
je 0x51a268
cmp r12, 2
je 0x51a510
cmp r12, 3
je 0x51a030
lea rax, [rsi + 1]
imul rax, r8
lea rdx, [r8 + rdi]
imul rsi, rax
mov rax, qword [rsp + 0x50]
sub rdx, rsi
test rax, rax
jle 0x519dc1
add rax, rdi
sub rdx, rdi
mov rsi, rdi
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x60], rdx
nop word [rax + rax]
mov rdx, qword [rbp + 0x10]
mov rax, rsi
xor r8d, r8d
mov edi, 0
sub rax, qword [rsp + 0x50]
mov rcx, qword [rbp]
not rdx
and rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r14, rax
call sub.msvcrt.dll_fread
mov r15, qword [rsp + 0x60]
mov rdx, qword [rbp + 0x10]
cmp rax, 0x20
cmovne r14, rdi
mov rcx, qword [rbp]
xor r8d, r8d
lea rax, [r15 + rsi]
not rdx
and rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov rbx, rax
call sub.msvcrt.dll_fread
mov rdx, qword [rbp + 0x10]
cmp rax, 0x20
mov rax, qword [rsp + 0x20]
cmovne rbx, rdi
mov rcx, qword [rbp]
xor r8d, r8d
not rdx
add rax, r15
and rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r15, rax
call sub.msvcrt.dll_fread
mov edx, 1
mov ecx, 0x20
cmp rax, 0x20
cmovne r15, rdi
call sub.msvcrt.dll_calloc
mov r13, rax
lea rax, [rsi + rsi]
test rsi, rsi
jns 0x519b33
mov rax, rsi
neg rax
lea rax, [rax + rax - 1]
cmp rax, 0x7f
jbe 0x519e00
xor edx, edx
nop
mov r8d, eax
mov ecx, edx
shr rax, 7
or r8d, 0xffffff80
add edx, 1
mov byte [r13 + rcx], r8b
cmp rax, 0x7f
ja 0x519b40
add rdx, r13
mov byte [rdx], al
mov ecx, pe_nt_image_headers64
call sub.msvcrt.dll_malloc
vmovdqu xmm3, xmmword [r13]
mov ecx, 0x20
mov r12, rax
mov rax, qword [rbp + 0x18]
vmovdqu xmm4, xmmword [r13 + 0x10]
lea rdi, [r12 + 0x60]
vmovdqu xmm5, xmmword [r14]
lea r11, [r12 + 0x20]
vmovdqu xmm0, xmmword [r14 + 0x10]
lea r10, [r12 + 0x40]
mov qword [rsp + 0x48], r11
vmovdqu xmm1, xmmword [rax]
mov qword [rsp + 0x40], r10
vmovups xmmword [r12], xmm1
vmovdqu xmm2, xmmword [rax + 0x10]
vmovdqu xmm1, xmmword [rbx]
vmovups xmmword [r12 + 0x20], xmm3
vmovups xmmword [r12 + 0x10], xmm2
vmovdqu xmm2, xmmword [rbx + 0x10]
vmovups xmmword [r12 + 0x30], xmm4
vmovups xmmword [r12 + 0x40], xmm5
vmovups xmmword [r12 + 0x50], xmm0
vmovups xmmword [r12 + 0x60], xmm1
vmovups xmmword [rdi + 0x10], xmm2
call sub.msvcrt.dll_malloc
mov rcx, r12
mov r9d, 0x20
mov edx, pe_nt_image_headers64
mov r8, rax
mov qword [rsp + 0x30], rax
call fcn.0051bc20
mov rcx, qword [rsp + 0x20]
mov qword [r13], 0
mov r10, qword [rsp + 0x40]
mov qword [r13 + 8], 0
mov r11, qword [rsp + 0x48]
mov qword [r13 + 0x10], 0
mov qword [r13 + 0x18], 0
lea rax, [rcx + rcx]
test rcx, rcx
jns 0x519c50
mov rax, rcx
neg rax
lea rax, [rax + rax - 1]
cmp rax, 0x7f
jbe 0x519df0
xor edx, edx
nop dword [rax]
mov r8d, eax
mov ecx, edx
shr rax, 7
or r8d, 0xffffff80
add edx, 1
mov byte [r13 + rcx], r8b
cmp rax, 0x7f
ja 0x519c60
add rdx, r13
mov byte [rdx], al
mov rax, qword [rbp + 0x18]
mov ecx, 0x20
vmovdqu xmm5, xmmword [r13]
vmovdqu xmm0, xmmword [r13 + 0x10]
vmovdqu xmm1, xmmword [r14]
vmovdqu xmm3, xmmword [rax]
vmovdqu xmm2, xmmword [r14 + 0x10]
vmovups xmmword [r12], xmm3
vmovdqu xmm4, xmmword [rax + 0x10]
vmovdqu xmm3, xmmword [r15]
vmovups xmmword [r12 + 0x20], xmm5
vmovups xmmword [r12 + 0x10], xmm4
vmovdqu xmm4, xmmword [r15 + 0x10]
vmovups xmmword [r11 + 0x10], xmm0
vmovups xmmword [r12 + 0x40], xmm1
vmovups xmmword [r10 + 0x10], xmm2
vmovups xmmword [r12 + 0x60], xmm3
vmovups xmmword [rdi + 0x10], xmm4
call sub.msvcrt.dll_malloc
mov r9d, 0x20
mov edx, pe_nt_image_headers64
mov rcx, r12
mov r8, rax
mov rdi, rax
call fcn.0051bc20
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov rcx, qword [rbp]
not rdx
and rdx, rsi
add rsi, 1
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_fwrite
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov rcx, qword [rbp]
not rdx
and rdx, qword [rsp + 0x20]
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 1
mov rcx, rdi
mov r8d, 0x20
call sub.msvcrt.dll_fwrite
mov rcx, r14
add qword [rsp + 0x98], 2
call sub.msvcrt.dll_free
mov rcx, rbx
call sub.msvcrt.dll_free
mov rcx, r15
call sub.msvcrt.dll_free
mov rcx, r13
call sub.msvcrt.dll_free
mov rcx, r12
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x30]
call sub.msvcrt.dll_free
mov rcx, rdi
call sub.msvcrt.dll_free
add qword [rsp + 0x20], 1
cmp qword [rsp + 0x68], rsi
jne 0x519a20
mov rcx, qword [rsp + 0x78]
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x80]
call sub.msvcrt.dll_free
cmp byte [rsp + 0x5f], 0
je 0x51a230
mov rdi, qword [rsp + 0x98]
jmp 0x5198c0
mov rdx, r13
jmp 0x519c7e
mov rdx, r13
jmp 0x519b5e
sub rdi, r8
mov rsi, rax
test rax, rax
jle 0x51a1d8
lea r12, [rdi + rax]
mov qword [rsp + 0x30], r15
mov qword [rsp + 0x20], r12
nop dword [rax]
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov ebx, 0
mov rcx, qword [rbp]
not rdx
and rdx, rdi
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r14, rax
call sub.msvcrt.dll_fread
mov rdx, qword [rbp + 0x10]
mov rcx, qword [rbp]
cmp rax, 0x20
cmovne r14, rbx
xor r8d, r8d
not rdx
and rdx, r12
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r13, rax
call sub.msvcrt.dll_fread
mov edx, 1
mov ecx, 0x20
cmp rax, 0x20
cmovne r13, rbx
call sub.msvcrt.dll_calloc
mov rdx, qword [rsp + 0x98]
mov r12, rax
lea rax, [rdx + rdx]
test rdx, rdx
mov rcx, rax
not rcx
cmovs rax, rcx
cmp rax, 0x7f
jbe 0x51a1f0
xor edx, edx
nop word cs:[rax + rax]
mov r8d, eax
mov ecx, edx
shr rax, 7
or r8d, 0xffffff80
add edx, 1
mov byte [r12 + rcx], r8b
cmp rax, 0x7f
ja 0x519f00
add rdx, r12
mov byte [rdx], al
mov ecx, pe_nt_image_headers64
add rdi, 1
call sub.msvcrt.dll_malloc
vmovdqu xmm1, xmmword [r14]
mov ecx, 0x20
mov r15, rax
mov rax, qword [rbp + 0x18]
vmovdqu xmm2, xmmword [r14 + 0x10]
vmovdqu xmm3, xmmword [r13]
vmovdqu xmm4, xmmword [r13 + 0x10]
vmovdqu xmm5, xmmword [rax]
vmovups xmmword [r15], xmm5
vmovdqu xmm0, xmmword [rax + 0x10]
vmovdqu xmm5, xmmword [r12]
vmovups xmmword [r15 + 0x40], xmm1
vmovups xmmword [r15 + 0x10], xmm0
vmovdqu xmm0, xmmword [r12 + 0x10]
vmovups xmmword [r15 + 0x20], xmm5
vmovups xmmword [r15 + 0x30], xmm0
vmovups xmmword [r15 + 0x50], xmm2
vmovups xmmword [r15 + 0x60], xmm3
vmovups xmmword [r15 + 0x70], xmm4
call sub.msvcrt.dll_malloc
mov r9d, 0x20
mov edx, pe_nt_image_headers64
mov rcx, r15
mov r8, rax
mov rbx, rax
call fcn.0051bc20
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov rcx, qword [rbp]
not rdx
and rdx, qword [rsp + 0x98]
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 1
mov rcx, rbx
mov r8d, 0x20
call sub.msvcrt.dll_fwrite
mov rcx, rbx
add qword [rsp + 0x98], 1
call sub.msvcrt.dll_free
mov rcx, r15
call sub.msvcrt.dll_free
mov rcx, r14
call sub.msvcrt.dll_free
mov rcx, r13
call sub.msvcrt.dll_free
mov rcx, r12
call sub.msvcrt.dll_free
cmp rdi, qword [rsp + 0x20]
je 0x51a200
lea r12, [rdi + rsi]
jmp 0x519e30
mov rdi, rax
test rax, rax
jle 0x51a1d8
lea rsi, [rbx + rax]
mov qword [rsp + 0x20], r15
nop dword [rax]
mov rdx, qword [rbp + 0x10]
mov rax, rbx
xor r8d, r8d
mov rcx, qword [rbp]
sub rax, rdi
not rdx
and rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r13, rax
call sub.msvcrt.dll_fread
mov edx, 1
mov ecx, 0x20
cmp rax, 0x20
mov eax, 0
cmovne r13, rax
call sub.msvcrt.dll_calloc
mov r12, rax
lea rax, [rbx + rbx]
test rbx, rbx
jns 0x51a0be
mov rax, rbx
neg rax
lea rax, [rax + rax - 1]
cmp rax, 0x7f
jbe 0x51a210
xor edx, edx
nop word [rax + rax]
mov r8d, eax
mov ecx, edx
shr rax, 7
or r8d, 0xffffff80
add edx, 1
mov byte [r12 + rcx], r8b
cmp rax, 0x7f
ja 0x51a0d0
add rdx, r12
mov byte [rdx], al
mov ecx, 0x60
add rbx, 1
call sub.msvcrt.dll_malloc
vmovdqu xmm1, xmmword [r12]
mov ecx, 0x20
mov r14, rax
mov rax, qword [rbp + 0x18]
vmovdqu xmm2, xmmword [r12 + 0x10]
vmovdqu xmm3, xmmword [r13]
vmovdqu xmm4, xmmword [r13 + 0x10]
vmovdqu xmm5, xmmword [rax]
vmovups xmmword [r14], xmm5
vmovdqu xmm0, xmmword [rax + 0x10]
vmovups xmmword [r14 + 0x20], xmm1
vmovups xmmword [r14 + 0x10], xmm0
vmovups xmmword [r14 + 0x30], xmm2
vmovups xmmword [r14 + 0x40], xmm3
vmovups xmmword [r14 + 0x50], xmm4
call sub.msvcrt.dll_malloc
mov r9d, 0x20
mov edx, 0x60
mov rcx, r14
mov r8, rax
mov r15, rax
call fcn.0051bc20
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov rcx, qword [rbp]
not rdx
and rdx, qword [rsp + 0x98]
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 1
mov rcx, r15
mov r8d, 0x20
call sub.msvcrt.dll_fwrite
mov rcx, r15
add qword [rsp + 0x98], 1
call sub.msvcrt.dll_free
mov rcx, r14
call sub.msvcrt.dll_free
mov rcx, r13
call sub.msvcrt.dll_free
mov rcx, r12
call sub.msvcrt.dll_free
cmp rsi, rbx
jne 0x51a048
mov r15, qword [rsp + 0x20]
lea r8, [rsp + 0x98]
mov rdx, r15
mov rcx, rbp
call fcn.005193b0
jmp 0x519dc1
mov rdx, r12
jmp 0x519f1d
mov r15, qword [rsp + 0x30]
jmp 0x51a1d8
mov rdx, r12
jmp 0x51a0ed
mov rdx, r12
jmp 0x5197dd
mov rcx, qword [rsp + 0x88]
call sub.msvcrt.dll_free
mov rcx, qword [rsp + 0x70]
vmovups xmm6, xmmword [rsp + 0xa0]
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp sub.msvcrt.dll_free
mov rdi, rax
test rax, rax
jle 0x51a419
lea rax, [rbx + rax]
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x30], rax
nop word [rax + rax]
mov rdx, qword [rbp + 0x10]
mov rax, rbx
xor r8d, r8d
mov rcx, qword [rbp]
sub rax, rdi
not rdx
and rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r14, rax
call sub.msvcrt.dll_fread
mov edx, 1
mov ecx, 0x20
cmp rax, 0x20
mov eax, 0
cmovne r14, rax
call sub.msvcrt.dll_calloc
mov r12, rax
lea rax, [rbx + rbx]
test rbx, rbx
jns 0x51a2fe
mov rax, rbx
neg rax
lea rax, [rax + rax - 1]
cmp rax, 0x7f
jbe 0x51a500
xor edx, edx
nop word [rax + rax]
mov r8d, eax
mov ecx, edx
shr rax, 7
or r8d, 0xffffff80
add edx, 1
mov byte [r12 + rcx], r8b
cmp rax, 0x7f
ja 0x51a310
add rdx, r12
mov byte [rdx], al
mov ecx, 0x60
add rbx, 1
call sub.msvcrt.dll_malloc
vmovdqu xmm5, xmmword [r12]
mov ecx, 0x20
mov r15, rax
mov rax, qword [rbp + 0x18]
vmovdqu xmm0, xmmword [r12 + 0x10]
vmovdqu xmm3, xmmword [rax]
vmovups xmmword [r15], xmm3
vmovdqu xmm4, xmmword [rax + 0x10]
vmovdqu xmm3, xmmword [r14]
vmovups xmmword [r15 + 0x20], xmm5
vmovups xmmword [r15 + 0x10], xmm4
vmovdqu xmm4, xmmword [r14 + 0x10]
vmovups xmmword [r15 + 0x30], xmm0
vmovups xmmword [r15 + 0x40], xmm3
vmovups xmmword [r15 + 0x50], xmm4
call sub.msvcrt.dll_malloc
mov r9d, 0x20
mov edx, 0x60
mov rcx, r15
mov r8, rax
mov r13, rax
call fcn.0051bc20
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov rcx, qword [rbp]
not rdx
and rdx, qword [rsp + 0x98]
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 1
mov rcx, r13
mov r8d, 0x20
call sub.msvcrt.dll_fwrite
mov rcx, r13
add qword [rsp + 0x98], 1
call sub.msvcrt.dll_free
mov rcx, r15
call sub.msvcrt.dll_free
mov rcx, r14
call sub.msvcrt.dll_free
mov rcx, r12
call sub.msvcrt.dll_free
cmp rbx, qword [rsp + 0x30]
jne 0x51a288
mov r15, qword [rsp + 0x40]
cmp rsi, 2
je 0x51a1d8
movsx esi, byte [rsp + 0x5f]
add esi, 5
movsxd rsi, esi
lea rdi, [rsi*8]
shl rsi, 2
mov rcx, rdi
sub rdi, 0x28
call sub.msvcrt.dll_malloc
mov r14, qword [rsp + 0x88]
mov r8, rdi
mov rcx, rax
mov rbx, rax
mov rdx, r14
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x78]
lea r8, [rbx + rdi]
mov rcx, r14
vmovdqu xmm1, xmmword [rax]
vmovups xmmword [r8], xmm1
vmovdqu xmm1, xmmword [rax + 0x10]
mov rax, qword [rax + 0x20]
vmovups xmmword [r8 + 0x10], xmm1
vmovups xmmword [rsp + 0x30], xmm1
mov qword [r8 + 0x20], rax
movzx eax, byte [rsp + 0x20]
add eax, 4
mov byte [rsp + 0x5f], al
call sub.msvcrt.dll_free
mov rcx, rsi
sub rsi, 0x14
call sub.msvcrt.dll_malloc
mov r14, qword [rsp + 0x70]
mov r8, rsi
mov rcx, rax
mov rdi, rax
add rsi, rdi
mov rdx, r14
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x80]
mov rcx, r14
vmovdqu xmm1, xmmword [rax]
mov eax, dword [rax + 0x10]
vmovups xmmword [rsi], xmm1
vmovups xmmword [rsp + 0x20], xmm1
mov dword [rsi + 0x10], eax
call sub.msvcrt.dll_free
mov qword [rsp + 0x70], rdi
mov qword [rsp + 0x88], rbx
jmp 0x519dc1
mov rdx, r12
jmp 0x51a32d
mov rdi, rax
test rax, rax
jle 0x51a419
lea rax, [rbx + rax]
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x30], rax
nop word [rax + rax]
mov rdx, qword [rbp + 0x10]
mov rax, rbx
xor r8d, r8d
mov rcx, qword [rbp]
sub rax, rdi
not rdx
and rdx, rax
shl edx, 5
call sub.msvcrt.dll_fseek
mov ecx, 0x20
call sub.msvcrt.dll_malloc
mov r9, qword [rbp]
mov r8d, 0x20
mov edx, 1
mov rcx, rax
mov r14, rax
call sub.msvcrt.dll_fread
mov edx, 1
mov ecx, 0x20
cmp rax, 0x20
mov eax, 0
cmovne r14, rax
call sub.msvcrt.dll_calloc
mov r12, rax
lea rax, [rbx + rbx]
test rbx, rbx
jns 0x51a5a6
mov rax, rbx
neg rax
lea rax, [rax + rax - 1]
cmp rax, 0x7f
jbe 0x51a6c8
xor edx, edx
nop word [rax + rax]
mov r8d, eax
mov ecx, edx
shr rax, 7
or r8d, 0xffffff80
add edx, 1
mov byte [r12 + rcx], r8b
cmp rax, 0x7f
ja 0x51a5b8
add rdx, r12
mov byte [rdx], al
mov ecx, 0x60
add rbx, 1
call sub.msvcrt.dll_malloc
vmovdqu xmm5, xmmword [r12]
mov ecx, 0x20
mov r15, rax
mov rax, qword [rbp + 0x18]
vmovdqu xmm0, xmmword [r12 + 0x10]
vmovdqu xmm3, xmmword [r14]
vmovdqu xmm4, xmmword [r14 + 0x10]
vmovdqu xmm1, xmmword [rax]
vmovups xmmword [r15], xmm1
vmovdqu xmm2, xmmword [rax + 0x10]
vmovups xmmword [r15 + 0x20], xmm5
vmovups xmmword [r15 + 0x10], xmm2
vmovups xmmword [r15 + 0x30], xmm0
vmovups xmmword [r15 + 0x40], xmm3
vmovups xmmword [r15 + 0x50], xmm4
call sub.msvcrt.dll_malloc
mov r9d, 0x20
mov edx, 0x60
mov rcx, r15
mov r8, rax
mov r13, rax
call fcn.0051bc20
mov rdx, qword [rbp + 0x10]
xor r8d, r8d
mov rcx, qword [rbp]
not rdx
and rdx, qword [rsp + 0x98]
shl edx, 5
call sub.msvcrt.dll_fseek
mov r9, qword [rbp]
mov edx, 1
mov rcx, r13
mov r8d, 0x20
call sub.msvcrt.dll_fwrite
mov rcx, r13
add qword [rsp + 0x98], 1
call sub.msvcrt.dll_free
mov rcx, r15
call sub.msvcrt.dll_free
mov rcx, r14
call sub.msvcrt.dll_free
mov rcx, r12
call sub.msvcrt.dll_free
cmp qword [rsp + 0x30], rbx
jne 0x51a530
jmp 0x51a414
mov rdx, r12
jmp 0x51a5d5
lea r8, [rsp + 0x98]
mov edx, 1
mov rcx, rbp
call fcn.005193b0
nop
vmovups xmm6, xmmword [rsp + 0xa0]
add rsp, 0xb8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret