Function at 0x140021240
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1f]
sub rsp, 0xb8
xor esi, esi
mov rbx, rdx
mov rdi, rcx
test rdx, rdx
jne 0x140021277
cmp byte [rcx + 0x30], sil
jne 0x140021277
xor al, al
jmp 0x1400215c6
cmp byte [rcx + 0x152], sil
je 0x140021295
call fcn.14002086c
cmp dword [rdi + 0x148], eax
jns 0x140021295
mov rcx, rdi
call fcn.140020d1c
lea rax, [rdi + 0x30]
test rbx, rbx
lea rdx, [0x140106ce4]
cmove rbx, rax
mov rcx, rbx
call fcn.1400ea62c
xor r10d, r10d
mov r14, rax
test rax, rax
je 0x140021270
mov r8, qword [rdi]
mov rcx, qword [rdi + 8]
movabs rax, 0x2aaaaaaaaaaaaaab
sub rcx, r8
mov ebx, r10d
mov r12d, r10d
mov qword [rbp + 0x7f], r10
mov r13d, r10d
mov qword [rbp + 7], r10
imul rcx
sar rdx, 3
movzx r9d, r10w
mov word [rbp + 0x6f], r10w
mov rax, rdx
mov qword [rbp - 0x79], rbx
lea ecx, [r10 + 1]
shr rax, 0x3f
add rdx, rax
je 0x1400214b3
lea rsi, [r8 + r13]
cmp byte [rsi + 0x28], r10b
jne 0x140021465
mov dword [rbp - 0x49], 0x4034b50
add r9w, cx
mov eax, 0x14
mov word [rbp - 0x45], ax
mov al, byte [rsi + 0x2a]
mov word [rbp + 0x6f], r9w
neg al
mov r15d, r10d
sbb cx, cx
and cx, 0x800
mov word [rbp - 0x43], cx
movzx eax, word [rsi + 4]
mov word [rbp - 0x41], ax
movzx eax, word [rsi + 8]
mov word [rbp - 0x3f], ax
movzx eax, word [rsi + 0xa]
mov word [rbp - 0x3d], ax
mov eax, dword [rsi + 0xc]
mov dword [rbp - 0x3b], eax
mov eax, dword [rsi + 0x10]
mov dword [rbp - 0x37], eax
mov eax, dword [rsi + 0x14]
mov dword [rbp - 0x33], eax
movzx eax, word [rsi + 6]
mov word [rbp - 0x2d], r10w
mov word [rbp - 0x2f], ax
mov dword [rsi], r12d
cmp word [rdi + 0x150], r10w
jbe 0x1400213bb
cmp word [rbp - 0x41], r10w
jne 0x1400213bb
movzx ebx, word [rsi + 6]
mov rdx, rsi
mov rcx, rdi
add ebx, r12d
call fcn.14002078c
movzx ecx, ax
lea eax, [rbx + 0x1e]
cdq
idiv ecx
test edx, edx
je 0x1400213b2
mov r15d, ecx
sub r15d, edx
mov rbx, qword [rbp - 0x79]
mov word [rbp - 0x2d], r15w
mov edx, 1
lea rcx, [rbp - 0x49]
mov r9, r14
lea r8d, [rdx + 0x1d]
call fcn.1400eb8d4
xor r10d, r10d
add r12, rax
cmp word [rsi + 6], r10w
jbe 0x1400213f8
movzx r8d, word [rsi + 6]
mov rcx, qword [rsi + 0x18]
lea edx, [r10 + 1]
mov r9, r14
call fcn.1400eb8d4
add r12, rax
xor r10d, r10d
test r15d, r15d
jle 0x14002143a
xor ebx, ebx
lea edi, [rbx + 1]
xor eax, eax
lea rcx, [rbp + 0x77]
mov r9, r14
mov r8, rdi
mov rdx, rdi
mov byte [rbp + 0x77], bl
mov word [rbp + 0x78], ax
mov byte [rbp + 0x7a], al
call fcn.1400eb8d4
sub r15d, edi
add r12, rax
test r15d, r15d
jg 0x140021402
mov rdi, qword [rbp + 0x67]
mov rbx, qword [rbp - 0x79]
mov qword [rbp + 0x7f], r12
xor r10d, r10d
cmp dword [rsi + 0x10], r10d
jbe 0x14002145b
mov r8d, dword [rsi + 0x10]
mov rcx, qword [rsi + 0x20]
mov r9, r14
mov edx, 1
call fcn.1400eb8d4
add r12, rax
xor r10d, r10d
movzx r9d, word [rbp + 0x6f]
mov ecx, 1
mov r8, qword [rdi]
add rbx, rcx
mov rcx, qword [rdi + 8]
sub rcx, r8
movabs rax, 0x2aaaaaaaaaaaaaab
add r13, 0x30
mov qword [rbp - 0x79], rbx
imul rcx
sar rdx, 3
mov ecx, 1
mov rax, rdx
shr rax, 0x3f
add rdx, rax
cmp rbx, rdx
jb 0x140021307
mov r13, qword [rbp + 7]
mov qword [rbp + 0x7f], r12
mov qword [rbp + 0x7f], r12
mov qword [rbp + 0x7f], r12
mov r8, qword [rdi]
mov rcx, qword [rdi + 8]
movabs rax, 0x2aaaaaaaaaaaaaab
sub rcx, r8
mov r15, r10
imul rcx
sar rdx, 3
mov rax, rdx
shr rax, 0x3f
add rdx, rax
je 0x140021586
mov rsi, r10
movabs r12, 0x2aaaaaaaaaaaaaab
lea rbx, [rsi + r8]
cmp byte [rbx + 0x28], r10b
jne 0x140021554
xor edx, edx
lea rcx, [rbp - 0x45]
mov dword [rbp - 0x49], r10d
lea r8d, [rdx + 0x42]
call fcn.1400ea1b0
lea rdx, [rbp - 0x49]
mov rcx, rbx
call fcn.140021804
mov edx, 1
lea rcx, [rbp - 0x49]
lea r8d, [rdx + 0x2d]
mov r9, r14
call fcn.1400eb8d4
xor r10d, r10d
add r13, rax
cmp word [rbx + 6], r10w
jbe 0x140021554
movzx r8d, word [rbx + 6]
mov rcx, qword [rbx + 0x18]
lea edx, [r10 + 1]
mov r9, r14
call fcn.1400eb8d4
add r13, rax
xor r10d, r10d
mov r8, qword [rdi]
mov rcx, qword [rdi + 8]
mov rax, r12
sub rcx, r8
inc r15
add rsi, 0x30
imul rcx
sar rdx, 3
mov rax, rdx
shr rax, 0x3f
add rdx, rax
cmp r15, rdx
jb 0x1400214ee
mov r12, qword [rbp + 0x7f]
movzx ecx, word [rbp + 0x6f]
mov edx, 1
mov r9, r14
mov word [rbp - 0x69], cx
mov word [rbp - 0x67], cx
lea rcx, [rbp - 0x71]
lea r8d, [rdx + 0x15]
mov qword [rbp - 0x71], 0x6054b50
mov dword [rbp - 0x65], r13d
mov dword [rbp - 0x61], r12d
mov word [rbp - 0x5d], r10w
call fcn.1400eb8d4
mov rcx, r14
call fcn.1400e988c
mov al, 1
add rsp, 0xb8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret