Function at 0x1400216c0
Capabilities:
Write file on windows

Disassembly:
push rbp
sub rsp, 0x150
lea rbp, [rsp + 0x30]
mov qword [rbp + 0x78], rdi
mov rdi, rcx
vmovups xmmword [rbp + 0x50], xmm9
mov qword [rbp + 0x68], r15
mov qword [rbp + 0x70], r12
mov qword [rbp + 0x80], rsi
lea rsi, [rdi + 8]
mov qword [rbp + 0x88], rbx
mov rax, qword [0x140050bc0]
xor rax, rbp
mov qword [rbp + 0x110], rax
mov qword [rbp + 0x60], 0xfffffffffffffffe
cmp qword [rsi + 0x80], 0
jne 0x140021720
xor ebx, ebx
xor r12d, r12d
jmp 0x1400217f2
mov rdx, qword [rsi + 0x18]
lea rax, [rdi + 0x78]
cmp rax, qword [rdx]
je 0x140021ece
mov rbx, rsi
cmp qword [rsi + 0x68], 0
je 0x140021741
cmp byte [rsi + 0x71], 0
jne 0x140021749
xor r12d, r12d
jmp 0x1400217df
mov rax, qword [rsi]
mov rcx, rsi
mov edx, 0xffffffff
call qword [rax + 0x18]
cmp eax, 0xffffffff
je 0x1400217da
mov rcx, qword [rsi + 0x68]
mov r10, rsp
lea rdx, [rdi + 0x7c]
lea r8, [rbp + 0xf0]
mov r11, qword [rcx]
lea r9, [rbp + 0x110]
lea rax, [rbp + 0x28]
mov qword [r10 + 0x20], rax
call qword [r11 + 0x40]
test eax, eax
je 0x14002179b
cmp eax, 1
je 0x14002179f
cmp eax, 3
jne 0x1400217da
mov byte [rsi + 0x71], 0
xor r12d, r12d
jmp 0x1400217df
mov byte [rsi + 0x71], 0
mov r12, qword [rbp + 0x28]
lea rax, [rbp + 0xf0]
sub r12, rax
je 0x1400217d0
mov r9, qword [rsi + 0x80]
lea rcx, [rbp + 0xf0]
mov edx, 1
mov r8, r12
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
cmp r12, rax
jne 0x1400217da
cmp byte [rsi + 0x71], 0
je 0x140021741
xor ebx, ebx
xor r12d, r12d
mov rcx, qword [rsi + 0x80]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
test eax, eax
cmovne rbx, r12
xor eax, eax
lea r10, [rdi + 0x10]
mov byte [rsi + 0x7c], al
lea rdx, [rdi + 0x18]
mov byte [rsi + 0x71], al
lea r11, [rdi + 0x30]
mov qword [rsi + 0x18], r10
lea r8, [rdi + 0x38]
mov qword [rsi + 0x20], rdx
lea r15, [rdi + 0x50]
mov qword [rsi + 0x38], r11
lea r9, [rdi + 0x54]
mov qword [rsi + 0x40], r8
mov qword [rdx], r12
mov qword [r8], r12
mov dword [r9], eax
mov qword [r10], r12
mov qword [r11], r12
mov dword [r15], eax
mov rdx, qword [0x140056cc0]
mov qword [rsi + 0x50], r15
mov qword [rsi + 0x58], r9
mov qword [rsi + 0x80], r12
mov qword [rdi + 0x7c], rdx
mov qword [rsi + 0x68], r12
test rbx, rbx
je 0x1400218a2
mov rcx, qword [rbp + 0x110]
mov qword [rbp + 0x110], 0
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x14002189d
vmovups xmm9, xmmword [rbp + 0x50]
mov rbx, qword [rbp + 0x88]
mov rsi, qword [rbp + 0x80]
mov rdi, qword [rbp + 0x78]
mov r12, qword [rbp + 0x70]
mov r15, qword [rbp + 0x68]
lea rsp, [rbp + 0x120]
pop rbp
ret
call fcn.140039fc0
mov rdx, qword [rdi]
mov ecx, 4
movsxd rbx, dword [rdx + 4]
cmp qword [rbx + rdi + 0x48], 0
mov edx, dword [rbx + rdi + 0x10]
cmove eax, ecx
or edx, 0xffffffe2
or edx, eax
and edx, 0x17
mov esi, dword [rbx + rdi + 0x14]
mov dword [rbx + rdi + 0x10], edx
and edx, esi
je 0x140021857
test dl, 4
je 0x1400218dd
lea r15, str.ios_base::badbit_set
jmp 0x1400218f2
test dl, 2
lea rax, str.ios_base::failbit_set
lea r15, str.ios_base::eofbit_set
cmovne r15, rax
mov rcx, qword gs:[0x58]
mov eax, 4
movsxd rbx, dword [0x140055930]
mov esi, dword [0x140056cd0]
mov rdi, qword [rcx + rbx*8]
cmp esi, dword [rdi + rax]
jg 0x140021e88
lea rax, [0x140056ce0]
vpxor xmm9, xmm9, xmm9
mov dword [rbp + 0x30], 1
mov qword [rbp + 0x38], rax
vmovdqu xmmword [rbp + 0xb0], xmm9
mov rdx, r15
mov qword [rbp + 0xc0], r12
mov qword [rbp + 0xc8], r12
mov rcx, rdx
and rdx, 0xfffffffffffffff0
vpxor xmm0, xmm0, xmm0
vpcmpeqb xmm0, xmm0, xmmword [rdx]
vpmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x140021972
mov rax, rdx
add rdx, rcx
call fcn.140033d30
mov rdi, rax
movabs rax, 0x7fffffffffffffff
cmp rdi, rax
ja 0x140021e64
cmp rdi, 0xf
ja 0x140021d37
mov rdx, r15
lea rcx, [rbp + 0xb0]
mov r8, rdi
mov qword [rcx + 0x10], rdi
mov qword [rcx + 0x18], 0xf
call fcn.140034140
mov byte [rbp + rdi + 0xb0], 0
vmovdqu xmmword [rbp + 0xd0], xmm9
cmp qword [rbp + 0xc8], 0xf
movabs rax, 0x7fffffffffffffff
mov rsi, qword [rbp + 0xc0]
lea rdi, [rbp + 0xb0]
cmova rdi, qword [rdi]
cmp rsi, rax
ja 0x140021d05
cmp rsi, 0xf
ja 0x140021bbf
mov qword [rbp + 0xe0], rsi
mov qword [rbp + 0xe8], 0xf
vmovups xmm0, xmmword [rdi]
vmovups xmmword [rbp + 0xd0], xmm0
vmovups xmm0, xmmword [rbp + 0x30]
lea rdx, [rbp]
vmovups xmmword [rdx], xmm0
lea rcx, [rbp + 0x90]
lea r8, [rbp + 0xd0]
call fcn.140014dd0
lea rax, vtable.std::exception.0
mov rdx, qword [rbp + 0xa8]
mov rbx, qword [rbp + 0x90]
mov qword [rbp], rax
vmovdqu xmmword [rbp + 8], xmm9
cmp rdx, 0xf
lea rcx, [rbp + 0x40]
vmovups xmm0, xmmword [0x1400405f0]
lea rdx, [rbp + 0x90]
vmovups xmmword [rcx], xmm0
cmova rdx, rbx
mov qword [rcx], rdx
lea rdx, [rbp + 8]
call sub.VCRUNTIME140.dll___std_exception_copy
mov rbx, qword [rbp + 0xa8]
cmp rbx, 0xf
ja 0x140021b5d
vmovups xmm0, xmmword [rbp + 0x30]
mov rbx, qword [rbp + 0xc8]
mov qword [rbp + 0xa0], 0
mov qword [rbp + 0xa8], 0xf
mov byte [rbp + 0x90], 0
vmovups xmmword [rbp + 0x18], xmm0
cmp rbx, 0xf
ja 0x140021aff
lea rdx, [0x140060c40]
lea rcx, [rbp]
lea rax, vtable.std::ios_base::failure.0
mov qword [rbp + 0xc0], 0
mov qword [rbp + 0xc8], 0xf
mov byte [rbp + 0xb0], 0
mov qword [rcx], rax
call sub.VCRUNTIME140.dll__CxxThrowException
jmp 0x140021857
lea rax, vtable.std::_System_error.0
lea rdx, [rbx + 1]
mov qword [rbp], rax
mov rax, qword [rbp + 0xb0]
mov rcx, rax
cmp rdx, 0x1000
jb 0x140021b38
lea rdx, [rbx + 0x28]
mov rcx, qword [rax - 8]
sub rax, rcx
cmp rax, 8
jb 0x140021b3f
cmp rax, 0x27
ja 0x140021b3f
call fcn.140039fe0
jmp 0x140021ac3
mov rcx, qword [rbp + 0x110]
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x14002189d
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
nop
lea rax, vtable.std::runtime_error.0
lea rdx, [rbx + 1]
mov qword [rbp], rax
mov rax, qword [rbp + 0x90]
mov rcx, rax
cmp rdx, 0x1000
jb 0x140021b96
lea rdx, [rbx + 0x28]
mov rcx, qword [rax - 8]
sub rax, rcx
cmp rax, 8
jb 0x140021ba0
cmp rax, 0x27
ja 0x140021ba0
call fcn.140039fe0
jmp 0x140021a8f
mov rcx, qword [rbp + 0x110]
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x140021bb9
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
call fcn.140039fc0
nop
mov rbx, rsi
or rbx, 0xf
cmp rbx, rax
ja 0x140021bda
mov eax, 0x16
cmp rbx, 0x16
cmovb rbx, rax
jmp 0x140021be4
movabs rbx, 0x7fffffffffffffff
lea rcx, [rbx + 1]
cmp rcx, 0x1000
jae 0x140021c39
test rcx, rcx
jne 0x140021c21
mov qword [rbp + 0xe0], rsi
inc rsi
mov rcx, r12
mov rdx, rdi
mov r8, rsi
mov qword [rbp + 0xd0], r12
mov qword [rbp + 0xe8], rbx
call fcn.140034140
jmp 0x140021a15
mov qword [rbp + 0xe8], r12
mov qword [rbp + 0xe0], r12
call fcn.14003a38c
mov r12, rax
jmp 0x140021bf6
mov qword [rbp + 0xe8], r12
lea rax, [rbx + 0x28]
mov qword [rbp + 0xe0], r12
cmp rax, rcx
jbe 0x140021c8a
mov rcx, rax
call fcn.14003a38c
test rax, rax
je 0x140021c6c
lea r12, [rax + 0x27]
and r12, 0xffffffffffffffe0
mov qword [r12 - 8], rax
jmp 0x140021bf6
mov rcx, qword [rbp + 0x110]
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x140021c85
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
call fcn.140039fc0
lea rax, vtable.std::exception.0
mov qword [rbp], rax
vmovdqu xmmword [rbp + 8], xmm9
lea rdx, vtable.std::bad_array_new_length.0
lea rcx, [rbp]
mov qword [rcx], rdx
lea rdx, [0x140060ca0]
lea rax, [0x14003ec7c]
mov qword [rbp + 8], rax
call sub.VCRUNTIME140.dll__CxxThrowException
mov rcx, qword [rbp + 0x110]
mov qword [rbp + 0x110], 0
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x140021c85
vmovups xmm9, xmmword [rbp + 0x50]
mov rbx, qword [rbp + 0x88]
mov rsi, qword [rbp + 0x80]
mov rdi, qword [rbp + 0x78]
mov r12, qword [rbp + 0x70]
mov r15, qword [rbp + 0x68]
lea rsp, [rbp + 0x120]
pop rbp
ret
mov qword [rbp + 0xe8], r12
mov qword [rbp + 0xe0], r12
mov rcx, qword [rbp + 0x110]
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x140021c85
lea rcx, str.string_too_long
call sub.MSVCP140.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_
nop
mov rsi, rdi
or rsi, 0xf
cmp rsi, rax
ja 0x140021d52
mov eax, 0x16
cmp rsi, 0x16
cmovb rsi, rax
jmp 0x140021d5c
movabs rsi, 0x7fffffffffffffff
lea rcx, [rsi + 1]
cmp rcx, 0x1000
jae 0x140021da7
test rcx, rcx
jne 0x140021d9d
mov rbx, r12
mov rcx, rbx
mov rdx, r15
mov r8, rdi
mov qword [rbp + 0xb0], rbx
mov qword [rbp + 0xc0], rdi
mov qword [rbp + 0xc8], rsi
call fcn.140034140
mov byte [rbx + rdi], 0
jmp 0x1400219b8
call fcn.14003a38c
mov rbx, rax
jmp 0x140021d71
lea rax, [rsi + 0x28]
cmp rax, rcx
jbe 0x140021de9
mov rcx, rax
call fcn.14003a38c
test rax, rax
je 0x140021dcb
lea rbx, [rax + 0x27]
and rbx, 0xffffffffffffffe0
mov qword [rbx - 8], rax
jmp 0x140021d71
mov rcx, qword [rbp + 0x110]
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x140021de4
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
call fcn.140039fc0
lea rax, vtable.std::exception.0
mov qword [rbp], rax
vmovdqu xmmword [rbp + 8], xmm9
lea rdx, vtable.std::bad_array_new_length.0
lea rcx, [rbp]
mov qword [rcx], rdx
lea rdx, [0x140060ca0]
lea rax, [0x14003ec7c]
mov qword [rbp + 8], rax
call sub.VCRUNTIME140.dll__CxxThrowException
mov rcx, qword [rbp + 0x110]
mov qword [rbp + 0x110], 0
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x140021de4
vmovups xmm9, xmmword [rbp + 0x50]
mov rbx, qword [rbp + 0x88]
mov rsi, qword [rbp + 0x80]
mov rdi, qword [rbp + 0x78]
mov r12, qword [rbp + 0x70]
mov r15, qword [rbp + 0x68]
lea rsp, [rbp + 0x120]
pop rbp
ret
mov rcx, qword [rbp + 0x110]
xor rcx, rbp
cmp rcx, qword [0x140050bc0]
jne 0x140021de4
lea rcx, str.string_too_long
call sub.MSVCP140.dll_void___cdecl_std::_Xlength_error_char_const____ptr64_
nop
lea rcx, [0x140056cd0]
call fcn.14003a0d4
cmp dword [0x140056cd0], 0xffffffff
jne 0x14002191a
vmovups xmm0, xmmword [0x140040600]
lea rcx, [0x140004da0]
vmovups xmmword [0x140056ce0], xmm0
call fcn.14003a374
lea rcx, [0x140056cd0]
call fcn.14003a068
jmp 0x14002191a
mov rax, qword [rsi + 0x88]
mov rbx, qword [rsi + 0x90]
mov qword [rdx], rax
sub rbx, rax
mov rdx, qword [rsi + 0x38]
mov qword [rdx], rax
mov r8, qword [rsi + 0x50]
mov dword [r8], ebx
jmp 0x140021731