Function at 0x140021a60
Capabilities:
Get common file path
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x658]
sub rsp, 0x730
mov qword [rbp - 0x80], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x140053010]
xor rax, rsp
mov qword [rbp + 0x620], rax
mov r12, rcx
xor sil, sil
cmp qword [0x140057788], 0
je 0x140021ac0
cmp qword [0x140057600], 0
je 0x140021ac0
mov al, 1
jmp 0x140021ed0
test rcx, rcx
je 0x140021ecc
mov r14, qword [0x140057718]
test r14, r14
jne 0x140021ae6
xor ecx, ecx
call fcn.140021900
mov r14, rax
mov qword [0x140057718], rax
mov ecx, 0x104
call fcn.140025fd4
mov rbx, rax
xor edx, edx
mov r8d, 0x104
mov rcx, rax
call fcn.140027190
mov rdi, rbx
xor r13d, r13d
test rbx, rbx
je 0x140021b2b
mov rdx, rbx
mov ecx, 0x103
call qword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
jne 0x140021b2b
mov rcx, rbx
call fcn.140023db0
mov edi, r13d
call fcn.140021f00
mov r15, rax
lea rbx, [0x140057610]
cmp byte [0x140057610], r13b
cmove rbx, rdi
test r14, r14
je 0x140021eb2
test rbx, rbx
je 0x140021eb2
test rax, rax
je 0x140021eb2
mov eax, 0x5f
mov word [rsp + 0x70], ax
mov eax, dword [str..log]
mov dword [rbp - 0x50], eax
movzx eax, byte [0x14004785c]
mov byte [rbp - 0x4c], al
mov eax, dword [str..mlk]
mov dword [rbp - 0x58], eax
movzx eax, byte [0x14004787c]
mov byte [rbp - 0x54], al
mov edx, 0x5c
mov rcx, r12
call fcn.1400263f0
mov r12, rax
mov edx, 0x5c
mov rcx, r14
call fcn.1400263f0
mov r14, rax
test r12, r12
je 0x140021eb2
test rax, rax
je 0x140021eb2
inc r12
inc r14
movups xmm0, xmmword [str._s_s_s_s_s_s_s_s_s_s]
movups xmmword [rbp - 0x48], xmm0
mov eax, dword [0x140047870]
mov dword [rbp - 0x38], eax
movzx eax, byte [0x140047874]
mov byte [rbp - 0x34], al
mov byte [rsp + 0x74], r13b
mov byte [rbp - 0x10], r13b
xor edx, edx
mov r8d, 0x207
lea rcx, [rbp - 0xf]
call fcn.140027190
mov byte [rbp + 0x200], r13b
xor edx, edx
mov r8d, 0x207
lea rcx, [rbp + 0x201]
call fcn.140027190
mov byte [rbp + 0x410], r13b
xor edx, edx
mov r8d, 0x207
lea rcx, [rbp + 0x411]
call fcn.140027190
lea rcx, [rbp + 0x410]
call fcn.1400227d0
lea rax, [rsp + 0x74]
mov qword [rsp + 0x60], rax
lea rax, [rbp - 0x58]
mov qword [rsp + 0x58], rax
lea rax, [rbp + 0x410]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0x70]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], r15
lea rax, [rsp + 0x70]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], r12
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r14
mov r9, rbx
lea r8, [rbp - 0x48]
mov edx, 0x208
lea rcx, [rbp + 0x200]
call fcn.140025fb0
cmp eax, 0xffffffff
je 0x140021eb2
lea rax, [rbp - 0x50]
mov qword [rsp + 0x60], rax
lea rax, [rbp - 0x58]
mov qword [rsp + 0x58], rax
lea rax, [rbp + 0x410]
mov qword [rsp + 0x50], rax
lea rax, [rsp + 0x70]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], r15
lea rax, [rsp + 0x70]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], r12
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r14
mov r9, rbx
lea r8, [rbp - 0x48]
mov edx, 0x208
lea rcx, [rbp - 0x10]
call fcn.140025fb0
cmp eax, 0xffffffff
je 0x140021eb2
mov qword [rbp - 0x60], 0xf
mov qword [rbp - 0x68], r13
mov byte [rbp - 0x78], r13b
or rbx, 0xffffffffffffffff
cmp byte [rbp - 0x10], r13b
jne 0x140021d37
mov r8, r13
jmp 0x140021d49
lea rax, [rbp - 0x10]
mov r8, rbx
nop
inc r8
cmp byte [rax + r8], r13b
jne 0x140021d40
lea rdx, [rbp - 0x10]
lea rcx, [rbp - 0x78]
call fcn.14000d070
nop
mov r9d, 2
lea rcx, [rbp - 0x78]
call fcn.1400228d0
cmp rax, 0xffffffffffffffff
jne 0x140021d9e
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [rax + 2]
lea rcx, [rbp - 0x10]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [0x140057600], rax
cmp byte [rbp + 0x200], 0
jne 0x140021dac
mov r8, r13
jmp 0x140021dc0
lea rax, [rbp + 0x200]
mov r8, rbx
inc r8
cmp byte [rax + r8], 0
jne 0x140021db6
lea rdx, [rbp + 0x200]
lea rcx, [rbp - 0x78]
call fcn.14000d070
mov r9d, 2
lea rcx, [rbp - 0x78]
call fcn.1400228d0
cmp rax, 0xffffffffffffffff
jne 0x140021e1a
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
mov edx, 0x40000000
lea r8d, [rax + 2]
lea rcx, [rbp + 0x200]
call qword [sym.imp.KERNEL32.dll_CreateFileA]
mov qword [0x140057788], rax
movups xmm0, xmmword [str._r_n_Leak_Report__r_n]
movups xmmword [rbp - 0x30], xmm0
movups xmm1, xmmword [0x140047928]
movups xmmword [rbp - 0x20], xmm1
lea rax, [rbp - 0x30]
inc rbx
cmp byte [rax + rbx], 0
jne 0x140021e34
mov rcx, qword [0x140057600]
lea rax, [rcx - 1]
cmp rax, 0xfffffffffffffffd
ja 0x140021e71
mov dword [rsp + 0x78], r13d
mov qword [rsp + 0x20], r13
lea r9, [rsp + 0x78]
mov r8d, ebx
lea rdx, [rbp - 0x30]
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, qword [0x140057600]
cmp qword [0x140057720], 0
je 0x140021e8b
lea rcx, [rbp - 0x10]
call fcn.140021100
mov rcx, qword [0x140057600]
cmp qword [0x140057788], 0
je 0x140021e9f
test rcx, rcx
je 0x140021e9f
mov sil, 1
jmp 0x140021ea2
xor sil, sil
cmp qword [rbp - 0x60], 0x10
jb 0x140021eb2
mov rcx, qword [rbp - 0x78]
call fcn.14001ffa0
test rdi, rdi
je 0x140021ebf
mov rcx, rdi
call fcn.140023db0
test r15, r15
je 0x140021ecc
mov rcx, r15
call fcn.140023db0
movzx eax, sil
mov rcx, qword [rbp + 0x620]
xor rcx, rsp
call fcn.140023790
lea r11, [rsp + 0x730]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret