Function at 0x51f890
Capabilities:
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
mov r12, rdx
mov edx, dword [rsp + 0xb0]
mov rbx, r8
mov ebp, r9d
mov qword [rsp + 0x90], rcx
test edx, edx
je 0x51fda0
mov ecx, 2
call qword [fcn.005707a0]
mov byte [rsp + 0x3b], 0
mov rsi, rax
test r12, r12
je 0x51f9dc
mov r15, qword [r12]
lea rdi, [r12 + 8]
lea r14, [0x0059d97f]
cmp byte [r15], 0
jne 0x51fdf8
call fcn.00426640
lea rdx, [0x0059d947]
test eax, eax
je 0x51fe30
mov r8, r14
mov rcx, rsi
lea r14, str.___or:__s
call fcn.00475020
mov r15, qword [r12 + 8]
lea r12, [0x0059d947]
test r15, r15
jne 0x51f95b
jmp 0x51f9f8
call fcn.00426640
mov rdx, r12
test eax, eax
je 0x51f98c
mov r8, r13
mov rcx, rsi
call fcn.00475020
mov r15, qword [rdi]
test r15, r15
je 0x51f9f8
cmp byte [r15], 0
je 0x51fd00
call fcn.00426640
add rdi, 8
mov r13, r12
test eax, eax
jne 0x51f938
mov rcx, r15
call fcn.0056e6a8
mov r13, rax
call fcn.00426640
mov rdx, r12
test eax, eax
jne 0x51f944
mov rcx, r14
call fcn.0056e6a8
mov rdx, rax
jmp 0x51f944
mov rdx, rsi
mov ecx, 0xa
call sub.msvcrt.dll_fputc
cmp byte [rsp + 0x3b], 0
je 0x51f9dc
mov rax, qword [rsp + 0x90]
test byte [rax + 0x29], 1
je 0x51f9dc
mov r9, rsi
mov r8d, 4
mov edx, 1
lea rcx, str.EOF_n
call sub.msvcrt.dll_fwrite
mov eax, 0xfffffffe
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov eax, dword [rbx]
mov edx, 1
lea rdi, [0x0059d97f]
lea r12, [0x0059d947]
test eax, eax
jne 0x51fb87
jmp 0x51f9a0
lea rdx, [0x0059d9cf]
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
mov r8d, dword [rbx + 4]
movsxd r15, eax
test r8d, r8d
je 0x51fa7d
test byte [rbx + 0x28], 0x20
je 0x51fc10
lea rdx, [0x0059d9d4]
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
cdqe
add r15, rax
mov r8, qword [rbx + 8]
test r8, r8
je 0x51fa9a
mov eax, dword [rbx + 4]
test eax, eax
je 0x51fa86
lea rdx, [0x0059d9db]
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
cdqe
add r15, rax
mov r8, qword [rbx + 8]
test r8, r8
je 0x51fa9a
lea rdx, [0x0059d9de]
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
cdqe
add r15, rax
cmp dword [rbx], 3
je 0x51fc90
mov eax, dword [rbx + 0x28]
mov edx, eax
and edx, 0x42
cmp edx, 2
je 0x51fb1b
mov r8d, eax
mov r14, qword [rbx + 0x18]
and r8d, 1
test al, 0x40
je 0x51fc30
lea r13, [0x0059d980]
test r8d, r8d
je 0x51fae9
cmp qword [rbx + 8], 0
lea rax, [0x0059d984]
lea rdx, str.__s_
cmovne rdx, rax
mov r13, rdx
test r14, r14
je 0x51fe6e
cmp byte [r14], 0
mov r8, rdi
je 0x51fb0b
call fcn.00426640
mov r8, r12
test eax, eax
je 0x51feb0
mov rdx, r13
mov rcx, rsi
call fcn.00495a90
cdqe
add r15, rax
cmp r15, 0x18
ja 0x51fbb8
mov r8d, 0x1a
sub r8d, r15d
cmp dword [rbx], 4
mov r15d, r8d
je 0x51fbd4
mov r13, qword [rbx + 0x20]
mov rax, rdi
cmp byte [r13], 0
je 0x51fb5c
call fcn.00426640
mov r9d, eax
mov rax, r12
test r9d, r9d
je 0x51fd90
mov qword [rsp + 0x20], rax
mov r9, rdi
mov r8d, r15d
mov rcx, rsi
lea rdx, [0x0059da06]
call sub.libintl_8.dll_libintl_fprintf
xor edx, edx
mov eax, dword [rbx + 0x50]
add rbx, 0x50
test eax, eax
je 0x51f9a0
cmp eax, 2
je 0x51fcb8
test ebp, ebp
jne 0x51fb9a
test byte [rbx + 0x28], 8
jne 0x51fb78
test edx, edx
je 0x51fa20
mov rdx, rsi
mov ecx, 0xa
call sub.msvcrt.dll_fputc
jmp 0x51fa20
mov rdx, rsi
mov ecx, 0xa
mov r15d, 0x1a
call sub.msvcrt.dll_fputc
cmp dword [rbx], 4
jne 0x51fb3a
lea rdx, [0x0059d9f4]
mov r9, rdi
mov r8d, r15d
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
mov r13, qword [rbx + 0x10]
call fcn.00426640
mov rdx, r12
test eax, eax
je 0x51fef0
mov r8, r13
mov rcx, rsi
call fcn.00475020
xor edx, edx
jmp 0x51fb78
lea rdx, [0x0059d9d7]
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
cdqe
add r15, rax
jmp 0x51fa59
test r14, r14
je 0x51fe48
lea rdx, str.______
mov rcx, r14
mov dword [rsp + 0x3c], r8d
call sub.msvcrt.dll_strpbrk
mov r8d, dword [rsp + 0x3c]
test rax, rax
je 0x51fec0
lea r13, [0x0059d980]
test r8d, r8d
je 0x51faf2
cmp qword [rbx + 8], 0
lea rax, str.__s_
lea rdx, [0x0059d984]
cmove rdx, rax
mov r13, rdx
jmp 0x51faf2
call fcn.00426640
mov rdx, r12
test eax, eax
je 0x51fe98
mov rcx, rsi
call fcn.00495a90
cdqe
add r15, rax
jmp 0x51faa3
mov rdx, rsi
mov ecx, 0xa
call sub.msvcrt.dll_fputc
mov r13, qword [rbx + 0x20]
xor edx, edx
cmp byte [r13], 0
je 0x51fb78
call fcn.00426640
mov r8, r12
test eax, eax
je 0x51ff18
lea rdx, [0x0059d9cb]
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
xor edx, edx
jmp 0x51fb78
mov r15, qword [rdi]
test r15, r15
je 0x51f9f8
lea r12, [0x0059d947]
lea r14, str._____s
jmp 0x51fd54
call fcn.00426640
mov r13, r12
test eax, eax
je 0x51fd80
call fcn.00426640
mov rdx, r12
test eax, eax
je 0x51fd70
mov r8, r13
mov rcx, rsi
call fcn.00475020
mov r15, qword [rdi + 8]
add rdi, 8
test r15, r15
je 0x51f9f8
cmp byte [r15], 0
jne 0x51fd20
mov rdx, rsi
mov ecx, 0xa
call sub.msvcrt.dll_fputc
jmp 0x51fd43
mov rcx, r14
call fcn.0056e6a8
mov rdx, rax
jmp 0x51fd38
mov rcx, r15
call fcn.0056e6a8
mov r13, rax
jmp 0x51fd2c
mov rcx, r13
call fcn.0056e6a8
jmp 0x51fb5c
mov ecx, 1
call qword [fcn.005707a0]
mov rsi, rax
test r12, r12
je 0x51f9dc
cmp qword [rsp + 0x90], 0
je 0x51ff28
mov rax, qword [rsp + 0x90]
mov byte [rsp + 0x3b], 1
test byte [rax + 0x29], 1
je 0x51f8dc
lea rdx, str.cat___EOF_n
mov rcx, rsi
call sub.libintl_8.dll_libintl_fprintf
jmp 0x51f8dc
call fcn.00426640
lea r14, [0x0059d947]
test eax, eax
jne 0x51f8f6
mov rcx, r15
call fcn.0056e6a8
mov r14, rax
call fcn.00426640
lea rdx, [0x0059d947]
test eax, eax
jne 0x51f90a
nop dword [rax + rax]
lea rcx, str.usage:__s
call fcn.0056e6a8
mov rdx, rax
jmp 0x51f90a
lea r13, [0x0059d980]
test r8d, r8d
je 0x51fe6e
cmp qword [rbx + 8], 0
lea rax, str.__s_
lea rdx, [0x0059d984]
cmove rdx, rax
mov r13, rdx
call fcn.00426640
mov r8, r12
test eax, eax
jne 0x51fb0b
lea rcx, [0x0059d9f0]
call fcn.0056e6a8
mov r8, rax
jmp 0x51fb0b
lea rcx, str._NUM
call fcn.0056e6a8
mov rdx, rax
jmp 0x51fca0
mov rcx, r14
call fcn.0056e6a8
mov r8, rax
jmp 0x51fb0b
lea r13, [0x0059d98f]
test r8d, r8d
je 0x51faf2
cmp qword [rbx + 8], 0
lea rax, str.___s__
lea rdx, [0x0059d995]
cmove rdx, rax
mov r13, rdx
jmp 0x51faf2
lea rcx, str.alias_of____s
call fcn.0056e6a8
mov r8, r13
mov rcx, rsi
mov rdx, rax
call fcn.00475020
xor edx, edx
jmp 0x51fb78
mov rcx, r13
call fcn.0056e6a8
mov r8, rax
jmp 0x51fce6
mov byte [rsp + 0x3b], 0
jmp 0x51f8dc