Function at 0x140158c30
Capabilities:
Check if file exists
Get file attributes
Write file on windows

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rdi
push rbp
lea rbp, [rsp - 0x57]
sub rsp, 0xc0
mov rbx, r8
mov rdi, rcx
lea rcx, [rbp - 0x31]
call fcn.140177110
nop
mov r8d, 0x4000
lea rdx, [rbp - 0x31]
lea rcx, [rbp - 0x19]
call fcn.140177aa0
nop
mov rax, qword [rbp + 7]
cmp byte [rax], 0
jne 0x140158ea9
mov r8, rbx
lea rdx, [rbp - 0x19]
mov rcx, rdi
call fcn.140158ee0
xor edi, edi
lea ebx, [rdi - 1]
mov rdx, qword [rbp + 0x1f]
test rdx, rdx
je 0x140158cfc
mov dword [rbp + 0x7f], edi
mov rcx, qword [rbp - 1]
test rcx, rcx
je 0x140158cf5
mov qword [rsp + 0x20], rdi
lea r9, [rbp + 0x7f]
mov r8d, edx
mov rdx, qword [rbp + 0x27]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140158cf5
lea rcx, [rbp + 0x37]
call fcn.14014f920
mov rcx, qword [rbp + 7]
mov rdx, qword [rax]
mov qword [rbp + 7], rdx
mov qword [rax], rcx
mov rcx, qword [rbp + 0x37]
add rcx, 0xfffffffffffffff0
mov eax, dword [rcx]
nop
test eax, 0x30000000
jne 0x140158cf5
mov eax, ebx
lock xadd dword [rcx], eax
dec eax
cmp eax, ebx
jne 0x140158cf5
call fcn.1400daaa8
mov rdx, rdi
mov qword [rbp + 0x1f], rdx
mov rcx, qword [rbp - 1]
test rcx, rcx
je 0x140158d4d
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
jne 0x140158d49
lea rcx, [rbp + 0x3f]
call fcn.14014f920
mov rcx, qword [rbp + 7]
mov rdx, qword [rax]
mov qword [rbp + 7], rdx
mov qword [rax], rcx
mov rcx, qword [rbp + 0x3f]
add rcx, 0xfffffffffffffff0
mov eax, dword [rcx]
nop
test eax, 0x30000000
jne 0x140158d49
mov eax, ebx
lock xadd dword [rcx], eax
dec eax
cmp eax, ebx
jne 0x140158d49
call fcn.1400daaa8
mov rdx, qword [rbp + 0x1f]
mov rax, qword [rbp + 7]
cmp byte [rax], dil
jne 0x140158ea9
lea rax, vtable.juce::FileOutputStream.0
mov qword [rbp - 0x19], rax
test rdx, rdx
je 0x140158dcf
mov dword [rbp - 0x39], edi
mov rcx, qword [rbp - 1]
test rcx, rcx
je 0x140158dcb
mov qword [rsp + 0x20], rdi
lea r9, [rbp - 0x39]
mov r8d, edx
mov rdx, qword [rbp + 0x27]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140158dcb
lea rcx, [rbp + 0x47]
call fcn.14014f920
mov rcx, qword [rbp + 7]
mov rdx, qword [rax]
mov qword [rbp + 7], rdx
mov qword [rax], rcx
mov rcx, qword [rbp + 0x47]
add rcx, 0xfffffffffffffff0
mov eax, dword [rcx]
nop
test eax, 0x30000000
jne 0x140158dcb
mov eax, ebx
lock xadd dword [rcx], eax
dec eax
cmp eax, 0xffffffff
jne 0x140158dcb
call fcn.1400daaa8
mov qword [rbp + 0x1f], rdi
mov rcx, qword [rbp - 1]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp + 0x27]
call fcn.1400e1bf4
mov rcx, qword [rbp + 7]
add rcx, 0xfffffffffffffff0
mov eax, dword [rcx]
nop
test eax, 0x30000000
jne 0x140158e06
mov eax, ebx
lock xadd dword [rcx], eax
dec eax
cmp eax, 0xffffffff
jne 0x140158e06
call fcn.1400daaa8
mov rcx, qword [rbp - 9]
add rcx, 0xfffffffffffffff0
mov eax, dword [rcx]
nop
test eax, 0x30000000
jne 0x140158e2a
mov eax, ebx
lock xadd dword [rcx], eax
dec eax
cmp eax, 0xffffffff
jne 0x140158e2a
call fcn.1400daaa8
lea rax, vtable.juce::OutputStream.0
mov qword [rbp - 0x19], rax
mov rcx, qword [rbp - 0x11]
add rcx, 0xfffffffffffffff0
mov eax, dword [rcx]
nop
test eax, 0x30000000
jne 0x140158e58
lock xadd dword [rcx], ebx
dec ebx
cmp ebx, 0xffffffff
jne 0x140158e58
call fcn.1400daaa8
nop
mov rax, qword [rbp - 0x31]
cmp byte [rax], 0
je 0x140158eb2
lea rdx, [rbp - 0x31]
lea rcx, [rbp + 0x4f]
call fcn.140014d10
mov rcx, qword [rax]
call qword [sym.imp.KERNEL32.dll_GetFileAttributesW]
nop
cmp eax, 0xffffffff
je 0x140158eb2
mov ebx, 4
lea rdx, [rbp - 0x29]
lea rcx, [rbp - 0x31]
call fcn.14017a7a0
test al, al
jne 0x140158ea5
mov ecx, 0x64
call qword [sym.imp.KERNEL32.dll_Sleep]
sub ebx, 1
jns 0x140158e82
jmp 0x140158eb2
mov bl, 1
jmp 0x140158eb4
lea rcx, [rbp - 0x19]
call fcn.1401779d0
xor bl, bl
lea rcx, [rbp - 0x31]
call fcn.140177050
movzx eax, bl
lea r11, [rsp + 0xc0]
mov rbx, qword [r11 + 0x10]
mov rdi, qword [r11 + 0x18]
mov rsp, r11
pop rbp
ret