Function at 0x14007b820
Capabilities:
Check mutex on windows

Disassembly:
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
push rbp
sub rsp, 0x38
mov rsi, rcx
lea r15, [0x140000000]
mov r14, qword [rsi + 0xb8]
cmp dword [rsi + 0x208], 1
jne 0x14007b85d
mov rcx, r14
lea rdx, [0x1400b98d8]
call fcn.14002da1c
test eax, eax
je 0x14007b89c
mov rcx, r14
lea rdx, [0x1400b2c80]
call fcn.14002da1c
test eax, eax
jne 0x14007b8a3
mov rcx, qword [rsi + 0x178]
call qword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
je 0x14007b89c
cmp dword [0x1400fc280], 0
je 0x14007b8a3
mov rcx, qword [rsi + 0x178]
call qword [sym.imp.KERNEL32.dll_GetFileType]
test eax, eax
jne 0x14007b8a3
lea r14, str.CONOUT_
mov rdx, r14
mov rbx, r14
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x14007b8d1
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
lea ecx, [rax - 0x10]
test ecx, ecx
jle 0x14007b8eb
mov edx, 8
cmp ecx, 8
cmovg ecx, edx
movsxd rbx, ecx
sub eax, ecx
add rbx, r14
movsxd rdx, eax
cmp rdx, 8
mov rcx, qword [rbx]
ja 0x14007b907
movsxd rax, eax
mov rdx, qword [r15 + rax*8 + 0xbcbe0]
and rcx, rdx
jmp 0x14007b90f
mov rax, qword [rdx + rbx - 8]
xor rcx, rax
mov r13d, ecx
mov eax, 0x3ee4f99d
shr rcx, 0x20
xor r13d, ecx
imul r13d
mov ebx, r13d
sar edx, 7
sar ebx, 0x1f
sub edx, ebx
imul ebp, edx, 0x209
sub r13d, ebp
mov eax, r13d
cdq
xor r13d, edx
sub r13d, edx
movsxd r13, r13d
mov edx, dword [0x1400ce448]
lea r12, [r13 + r13*2]
shl r12, 4
cmp edx, 2
jge 0x14007b970
mov eax, dword [r15 + r12 + 0xf5990]
test eax, eax
jne 0x14007b9be
mov dword [r15 + r12 + 0xf5990], 1
jmp 0x14007b9be
lea rax, [0x1400f5980]
lea rbx, [rax + r12 + 0x10]
mov rcx, rbx
call fcn.14007a450
test eax, eax
jne 0x14007b9b8
mov rcx, qword [r15 + r12 + 0xf5988]
test rcx, rcx
je 0x14007bcd6
mov dword [r15 + r12 + 0xf5990], 0
mov edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, rbx
call fcn.14007a450
mov edx, dword [0x1400ce448]
cmp edx, 1
je 0x14007bcc0
mov rbx, qword [r15 + r12 + 0xf5980]
xor ebp, ebp
test rbx, rbx
je 0x14007ba21
mov qword [rsp + 0x20], rsi
mov rdi, r14
mov rsi, qword [rbx + 0x10]
mov dl, byte [rdi]
cmp dl, byte [rsi]
jne 0x14007ba04
test dl, dl
je 0x14007ba00
mov dl, byte [rdi + 1]
cmp dl, byte [rsi + 1]
jne 0x14007ba04
add rdi, 2
add rsi, 2
test dl, dl
jne 0x14007b9e2
xor eax, eax
jmp 0x14007ba09
sbb eax, eax
or eax, 1
test eax, eax
jle 0x14007bcb0
mov rbp, rbx
mov rbx, qword [rbx]
test rbx, rbx
jne 0x14007b9db
mov rsi, qword [rsp + 0x20]
mov ecx, Ordinal_59
xor edx, edx
lea r8, [rsp + 0x30]
call fcn.140071900
mov edi, eax
test edi, edi
je 0x14007ba87
mov eax, dword [0x1400ce448]
cmp eax, 1
je 0x14007bc1a
cmp eax, 2
jge 0x14007ba5a
mov dword [r15 + r12 + 0xf5990], 0
jmp 0x14007ba74
mov rcx, qword [r15 + r12 + 0xf5988]
mov dword [r15 + r12 + 0xf5990], 0
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, edi
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
mov rdx, r14
mov rcx, rdx
and rdx, 0xfffffffffffffff0
pxor xmm0, xmm0
pcmpeqb xmm0, xmmword [rdx]
pmovmskb eax, xmm0
and ecx, 0xf
shr eax, cl
bsf eax, eax
jne 0x14007bab2
mov rax, rdx
add rdx, rcx
call fcn.14009ef90
inc rax
xor edx, edx
mov r8, qword [rsp + 0x30]
mov rcx, rax
add r8, 0x10
call fcn.140071900
mov edi, eax
test edi, edi
je 0x14007bb27
mov rcx, qword [rsp + 0x30]
call fcn.1400719c0
mov eax, dword [0x1400ce448]
cmp eax, 1
je 0x14007bc46
cmp eax, 2
jge 0x14007bafa
mov dword [r15 + r12 + 0xf5990], 0
jmp 0x14007bb14
mov rcx, qword [r15 + r12 + 0xf5988]
mov dword [r15 + r12 + 0xf5990], 0
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, edi
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
mov rdi, qword [rsp + 0x30]
mov rcx, r14
mov rdx, qword [rdi + 0x10]
test cl, 3
je 0x14007bb4b
mov al, byte [rcx]
inc rcx
test al, al
mov byte [rdx], al
je 0x14007bb50
inc rdx
test cl, 3
jne 0x14007bb38
call fcn.14009efc0
mov qword [rdi], rbx
test rbx, rbx
je 0x14007bb61
mov rax, qword [rsp + 0x30]
mov qword [rbx + 8], rax
mov rax, qword [rsp + 0x30]
test rbp, rbp
mov qword [rax + 8], rbp
je 0x14007bc9e
mov rax, qword [rsp + 0x30]
mov qword [rbp], rax
mov rax, qword [rsp + 0x30]
xor ebp, ebp
mov dword [rax + 0x2c], ebp
mov rax, qword [rsp + 0x30]
mov byte [rax + 0x30], bpl
mov rdx, qword [rsp + 0x30]
mov byte [rdx + 0x31], bpl
mov rcx, qword [rsp + 0x30]
mov byte [rcx + 0x32], bpl
mov rbx, qword [rsp + 0x30]
mov byte [rbx + 0x33], bpl
mov rdi, qword [rsp + 0x30]
mov byte [rdi + 0x34], bpl
mov r8, qword [rsp + 0x30]
mov dword [r8 + 0x28], r13d
mov rbx, qword [rsp + 0x30]
mov qword [rsi + 0xf0], rbx
inc dword [rbx + 0x2c]
mov eax, dword [0x1400ce448]
cmp eax, 1
je 0x14007bc72
cmp eax, 2
jge 0x14007bbed
mov dword [r15 + r12 + 0xf5990], 0
jmp 0x14007bc07
mov rcx, qword [r15 + r12 + 0xf5988]
mov dword [r15 + r12 + 0xf5990], 0
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
xor eax, eax
add rsp, 0x38
pop rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
ret
mov rax, qword [r15 + r12 + 0xf59a0]
lea rcx, [rsp + 0x20]
mov rdx, qword [r15 + r12 + 0xf59a8]
mov qword [rcx], rax
mov qword [rcx + 8], rdx
call fcn.14007a420
mov eax, dword [0x1400ce448]
jmp 0x14007ba47
mov rax, qword [r15 + r12 + 0xf59a0]
lea rcx, [rsp + 0x20]
mov rdx, qword [r15 + r12 + 0xf59a8]
mov qword [rcx], rax
mov qword [rcx + 8], rdx
call fcn.14007a420
mov eax, dword [0x1400ce448]
jmp 0x14007bae7
mov rax, qword [r15 + r12 + 0xf59a0]
lea rcx, [rsp + 0x20]
mov rdx, qword [r15 + r12 + 0xf59a8]
mov qword [rcx], rax
mov qword [rcx + 8], rdx
call fcn.14007a420
mov eax, dword [0x1400ce448]
jmp 0x14007bbda
mov rax, qword [rsp + 0x30]
mov qword [r15 + r12 + 0xf5980], rax
jmp 0x14007bb81
mov rsi, qword [rsp + 0x20]
jne 0x14007ba21
jmp 0x14007bbc1
lea rax, [0x1400f5980]
lea rcx, [rax + r12 + 0x20]
call fcn.14007a3e0
jmp 0x14007b9c7
xor ecx, ecx
xor edx, edx
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_CreateMutexA]
mov qword [r15 + r12 + 0xf5988], rax
mov dword [r15 + r12 + 0xf5990], 0
mov rcx, qword [r15 + r12 + 0xf5988]
jmp 0x14007b9a5