Function at 0x140003650
Capabilities:
Write file on windows

Disassembly:
push rbp
push rdi
mov rbp, rsp
sub rsp, 0x58
cmp qword [rcx + 0x68], 0
mov rdi, rcx
je 0x1400038a4
cmp byte [rcx + 0x71], 0
je 0x1400038a4
mov rax, qword [rcx]
or edx, 0xffffffff
call qword [rax + 0x18]
cmp eax, 0xffffffff
jne 0x140003689
xor al, al
add rsp, 0x58
pop rdi
pop rbp
ret
xor ecx, ecx
mov qword [rsp + 0x80], rsi
mov edx, 0xf
mov byte [rbp - 0x28], 0
cmp rdx, 0x10
mov qword [rsp + 0x50], r14
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rdx
cmovae rax, rcx
mov qword [rbp - 0x28], rcx
mov qword [rbp - 0x18], 8
xor r14d, r14d
mov qword [rsp + 0x78], rbx
mov byte [rax + 8], cl
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
cmp r9, 0x10
lea rax, [rbp + 0x18]
mov r9, qword [rbp - 0x18]
lea rdx, [rbp - 0x28]
cmovae rdx, rcx
mov qword [rsp + 0x20], rax
lea r8, [rbp - 0x28]
cmovae r8, rcx
mov rcx, qword [rdi + 0x68]
add r9, rdx
lea rdx, [rdi + 0x74]
call qword [sym.imp.MSVCP140.dll_public:_int___cdecl_std::codecvt_char__char__struct__Mbstatet_::unshift_struct__Mbstatet____ptr64__char____ptr64__char____ptr64__char____ptr64____ptr64_const___ptr64]
test eax, eax
je 0x140003723
sub eax, 1
je 0x140003727
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
sub eax, 2
je 0x140003832
xor bl, bl
jmp 0x140003834
mov byte [rdi + 0x71], r14b
mov r9, qword [rbp - 0x10]
lea rax, [rbp - 0x28]
mov rcx, qword [rbp - 0x28]
cmp r9, 0x10
mov rbx, qword [rbp + 0x18]
cmovae rax, rcx
sub rbx, rax
je 0x140003775
cmp r9, 0x10
lea rax, [rbp - 0x28]
mov r9, qword [rdi + 0x80]
mov r8, rbx
cmovae rax, rcx
mov edx, 1
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
cmp rbx, rax
jne 0x14000371c
cmp byte [rdi + 0x71], r14b
je 0x140003832
test rbx, rbx
jne 0x1400036d0
mov r8, qword [rbp - 0x18]
or rax, 0xffffffffffffffff
sub rax, r8
cmp rax, 8
jbe 0x140003824
lea rbx, [r8 + 8]
cmp rbx, 0xfffffffffffffffe
ja 0x140003816
cmp r9, rbx
jae 0x1400037f9
mov rdx, rbx
lea rcx, [rbp - 0x28]
call fcn.1400034c0
mov r9, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x28]
test rbx, rbx
je 0x1400036d0
mov rax, qword [rbp - 0x18]
lea rdx, [rbp - 0x28]
cmp r9, 0x10
cmovae rdx, rcx
xor ecx, ecx
mov qword [rdx + rax], rcx
lea rax, [rbp - 0x28]
cmp qword [rbp - 0x10], 0x10
mov qword [rbp - 0x18], rbx
cmovae rax, qword [rbp - 0x28]
mov byte [rax + rbx], cl
jmp 0x1400036c8
test rbx, rbx
jne 0x1400037c9
cmp r9, 0x10
mov qword [rbp - 0x18], r14
lea rax, [rbp - 0x28]
cmovae rax, rcx
mov byte [rax], r14b
jmp 0x1400036c8
lea rcx, str.string_too_long
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_]
int3
lea rcx, str.string_too_long
call qword [sym.imp.MSVCP140.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_]
int3
mov bl, 1
cmp r9, 0x10
jb 0x140003888
lea rax, [r9 + 1]
cmp rax, 0x1000
jb 0x140003883
test byte [rbp - 0x28], 0x1f
je 0x140003853
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rax, qword [rcx - 8]
cmp rax, rcx
jb 0x140003863
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
sub rcx, rax
cmp rcx, 8
jae 0x140003873
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
cmp rcx, 0x27
jbe 0x140003880
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rcx, rax
call fcn.14003ea5c
mov rsi, qword [rsp + 0x80]
movzx eax, bl
mov rbx, qword [rsp + 0x78]
mov r14, qword [rsp + 0x50]
add rsp, 0x58
pop rdi
pop rbp
ret
mov al, 1
add rsp, 0x58
pop rdi
pop rbp
ret