Function at 0x140005850
Capabilities:
Write file on windows

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0x90
mov qword [rbp - 0x11], 0xfffffffffffffffe
mov qword [rsp + 0xe0], rbx
mov rax, qword [0x14017c430]
xor rax, rsp
mov qword [rbp + 0x1f], rax
movzx r13d, dx
mov rdi, rcx
mov r12d, 0xffff
cmp r12w, dx
jne 0x1400058a3
xor esi, esi
movzx eax, si
jmp 0x140005b96
mov rdx, qword [rcx + 0x48]
cmp qword [rdx], 0
je 0x1400058de
mov rdx, qword [rdx]
mov r8, qword [rcx + 0x60]
movsxd rax, dword [r8]
lea rcx, [rdx + rax*2]
cmp rdx, rcx
jae 0x1400058de
dec dword [r8]
mov rcx, qword [rdi + 0x48]
mov rdx, qword [rcx]
lea rax, [rdx + 2]
mov qword [rcx], rax
mov word [rdx], r13w
movzx eax, r13w
jmp 0x140005b96
cmp qword [rdi + 0x98], 0
je 0x140005b92
mov rdx, qword [rdi + 0x20]
lea rax, [rdi + 0x88]
cmp qword [rdx], rax
jne 0x14000591a
mov rcx, qword [rdi + 0x78]
mov rax, qword [rdi + 0x70]
mov qword [rdx], rax
mov rax, qword [rdi + 0x40]
mov qword [rax], rcx
sub rcx, rcx
sar rcx, 1
mov rax, qword [rdi + 0x58]
mov dword [rax], ecx
cmp qword [rdi + 0x80], 0
jne 0x140005947
mov rdx, qword [rdi + 0x98]
movzx ecx, r13w
call fcn.1400d6588
cmp ax, r12w
je 0x140005b92
movzx r12d, r13w
jmp 0x140005b92
mov word [rbp - 0x29], r13w
mov r15d, send
mov qword [rbp + 0xf], r15
xor esi, esi
mov qword [rbp + 7], rsi
mov byte [rbp - 9], sil
xor ecx, ecx
mov qword [rbp - 9], rcx
mov qword [rbp + 7], 8
lea rax, [rbp - 9]
cmp r15, 0x10
cmovae rax, rcx
mov byte [rax + 8], cl
mov r9, qword [rbp + 0xf]
mov r8, qword [rbp + 7]
mov r10, qword [rbp - 9]
nop dword [rax]
lea rax, [rbp - 9]
cmp r9, 0x10
cmovae rax, r10
lea rdx, [rbp - 9]
cmovae rdx, r10
mov rcx, qword [rdi + 0x80]
mov r10, qword [rcx]
add rax, r8
lea r8, [rbp - 0x19]
mov qword [rsp + 0x38], r8
mov qword [rsp + 0x30], rax
mov qword [rsp + 0x28], rdx
lea rax, [rbp - 0x21]
mov qword [rsp + 0x20], rax
lea r9, [rbp - 0x27]
lea r8, [rbp - 0x29]
lea rdx, [rdi + 0x8c]
call qword [r10 + 0x28]
test eax, eax
js 0x140005b76
cmp eax, 1
jg 0x140005b36
lea rax, [rbp - 9]
mov r10, qword [rbp - 9]
mov r9, qword [rbp + 0xf]
cmp r9, 0x10
cmovae rax, r10
mov rbx, qword [rbp - 0x19]
sub rbx, rax
je 0x140005a3f
lea rcx, [rbp - 9]
cmp r9, 0x10
cmovae rcx, r10
mov r9, qword [rdi + 0x98]
mov r8, rbx
mov edx, 1
call fcn.1400d6c94
cmp rbx, rax
jne 0x140005af6
mov r9, qword [rbp + 0xf]
mov r10, qword [rbp - 9]
mov byte [rdi + 0x8a], 1
lea rax, [rbp - 0x29]
cmp qword [rbp - 0x21], rax
jne 0x140005b14
mov r8, qword [rbp + 7]
test rbx, rbx
jne 0x140005990
cmp r8, 0x20
jae 0x140005b12
or rax, 0xffffffffffffffff
sub rax, r8
cmp rax, 8
jbe 0x140005b05
lea rbx, [r8 + 8]
cmp rbx, 0xfffffffffffffffe
ja 0x140005af8
cmp r9, rbx
jae 0x140005aa5
mov rdx, rbx
lea rcx, [rbp - 9]
call fcn.1400117b0
mov r9, qword [rbp + 0xf]
mov r8, qword [rbp + 7]
mov r10, qword [rbp - 9]
jmp 0x140005ac1
test rbx, rbx
jne 0x140005aca
mov qword [rbp + 7], rsi
lea rax, [rbp - 9]
cmp r9, 0x10
cmovae rax, r10
mov byte [rax], bl
jmp 0x14000597d
test rbx, rbx
je 0x140005990
lea rax, [rbp - 9]
cmp r9, 0x10
cmovae rax, r10
xor ecx, ecx
mov qword [r8 + rax], rcx
mov qword [rbp + 7], rbx
lea rax, [rbp - 9]
cmp qword [rbp + 0xf], 0x10
cmovae rax, qword [rbp - 9]
mov byte [rbx + rax], cl
jmp 0x14000597d
jmp 0x140005b76
lea rcx, str.string_too_long
call fcn.1400aeff0
int3
lea rcx, str.string_too_long
call fcn.1400aeff0
nop
jmp 0x140005b76
cmp qword [rbp + 0xf], 0x10
jb 0x140005b24
mov rcx, qword [rbp - 9]
call fcn.1400d4d78
mov qword [rbp + 0xf], r15
mov qword [rbp + 7], rsi
mov byte [rbp - 9], 0
movzx eax, r13w
jmp 0x140005b96
cmp eax, 3
jne 0x140005b76
mov rdx, qword [rdi + 0x98]
movzx ecx, word [rbp - 0x29]
call fcn.1400d6588
cmp ax, r12w
jne 0x140005b54
mov r13d, r12d
cmp qword [rbp + 0xf], 0x10
jb 0x140005b24
mov rcx, qword [rbp - 9]
call fcn.1400d4d78
mov qword [rbp + 0xf], r15
mov qword [rbp + 7], rsi
mov byte [rbp - 9], 0
movzx eax, r13w
jmp 0x140005b96
cmp qword [rbp + 0xf], 0x10
jb 0x140005b86
mov rcx, qword [rbp - 9]
call fcn.1400d4d78
mov qword [rbp + 0xf], r15
mov qword [rbp + 7], rsi
mov byte [rbp - 9], 0
movzx eax, r12w
mov rcx, qword [rbp + 0x1f]
xor rcx, rsp
call fcn.1400d4d90
mov rbx, qword [rsp + 0xe0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret