Function at 0x140047238
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x60
xor esi, esi
movsxd r13, ecx
mov r15d, r8d
mov rbx, rdx
test r8d, r8d
je 0x140047495
test rdx, rdx
jne 0x140047287
call fcn.14003e23c
mov dword [rax], esi
call fcn.14003e25c
mov dword [rax], reloc.OLEAUT32.dll_SafeArrayAccessData
call fcn.14003e114
or eax, 0xffffffff
jmp 0x140047497
mov rax, r13
lea rcx, [0x140072ec0]
and eax, 0x3f
mov dl, 1
mov r12, r13
sar r12, 6
lea rdi, [rax + rax*8]
mov rcx, qword [rcx + r12*8]
movsx r14d, byte [rcx + rdi*8 + 0x39]
mov al, r14b
sub al, dl
cmp al, dl
ja 0x1400472bd
mov eax, r15d
not eax
test dl, al
je 0x140047268
test byte [rcx + rdi*8 + 0x38], 0x20
je 0x1400472d2
xor edx, edx
mov ecx, r13d
lea r8d, [rdx + 2]
call fcn.1400496c0
mov ecx, r13d
mov qword [rbp - 0x30], rsi
call fcn.14004942c
test eax, eax
je 0x140047382
lea rax, [0x140072ec0]
mov rax, qword [rax + r12*8]
cmp byte [rax + rdi*8 + 0x38], sil
jge 0x140047382
call fcn.1400420c0
mov rcx, qword [rax + 0x90]
cmp qword [rcx + 0x138], rsi
jne 0x140047323
lea rax, [0x140072ec0]
mov rax, qword [rax + r12*8]
cmp byte [rax + rdi*8 + 0x39], sil
je 0x140047382
lea rax, [0x140072ec0]
mov rcx, qword [rax + r12*8]
lea rdx, [rbp - 0x10]
mov rcx, qword [rcx + rdi*8 + 0x28]
call qword [sym.imp.kernel32.dll_GetConsoleMode]
test eax, eax
je 0x140047382
test r14b, r14b
je 0x14004736e
dec r14b
cmp r14b, 1
ja 0x14004741f
mov r8d, r15d
lea rcx, [rbp - 0x20]
mov rdx, rbx
call fcn.140046c5c
movsd xmm0, qword [rax]
mov esi, dword [rax + 8]
jmp 0x14004741a
mov r9d, r15d
lea rcx, [rbp - 0x20]
mov r8, rbx
mov edx, r13d
call fcn.140046754
jmp 0x140047362
lea rax, [0x140072ec0]
mov rcx, qword [rax + r12*8]
cmp byte [rcx + rdi*8 + 0x38], sil
jge 0x1400473e2
mov ecx, r14d
test r14b, r14b
je 0x1400473ce
sub ecx, 1
je 0x1400473ba
cmp ecx, 1
jne 0x14004741f
mov r9d, r15d
lea rcx, [rbp - 0x20]
mov r8, rbx
mov edx, r13d
call fcn.140046e48
jmp 0x140047362
mov r9d, r15d
lea rcx, [rbp - 0x20]
mov r8, rbx
mov edx, r13d
call fcn.140046f98
jmp 0x140047362
mov r9d, r15d
lea rcx, [rbp - 0x20]
mov r8, rbx
mov edx, r13d
call fcn.140046d10
jmp 0x140047362
mov rcx, qword [rcx + rdi*8 + 0x28]
lea r9, [rbp - 0x1c]
xor eax, eax
mov r8d, r15d
and qword [rsp + 0x20], rax
mov rdx, rbx
mov qword [rbp - 0x20], rax
mov dword [rbp - 0x18], eax
call qword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
jne 0x140047412
call qword [sym.imp.kernel32.dll_GetLastError]
mov dword [rbp - 0x20], eax
movsd xmm0, qword [rbp - 0x20]
mov esi, dword [rbp - 0x18]
movsd qword [rbp - 0x30], xmm0
mov rax, qword [rbp - 0x30]
shr rax, 0x20
test eax, eax
jne 0x14004748e
mov eax, dword [rbp - 0x30]
test eax, eax
je 0x14004745f
cmp eax, 5
jne 0x140047452
call fcn.14003e25c
mov dword [rax], 9
call fcn.14003e23c
mov dword [rax], 5
jmp 0x14004727f
mov ecx, dword [rbp - 0x30]
call fcn.14003e1f4
jmp 0x14004727f
lea rax, [0x140072ec0]
mov rax, qword [rax + r12*8]
test byte [rax + rdi*8 + 0x38], 0x40
je 0x140047476
cmp byte [rbx], 0x1a
je 0x140047495
call fcn.14003e25c
mov dword [rax], 0x1c
call fcn.14003e23c
and dword [rax], 0
jmp 0x14004727f
mov eax, dword [rbp - 0x2c]
sub eax, esi
jmp 0x140047497
xor eax, eax
mov rbx, qword [rsp + 0xb8]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret