// File: /workspace/github_cpp_makefile_star2_O1/fgheng[P]keysound/src/main.cc
// Function: kill_exists_process()
static void kill_exists_process() {
    static std::string cmd =
        std::string("ps ax | grep ") +
        program_invocation_short_name +
        " | grep -v grep";

    pid_t pid = 0;

    FILE *tmp = fopen(PID_FILE, "r");

    // 文件存在，读取文件		If the file exists, read the file
    if (tmp != NULL && fscanf(tmp, "%d", &pid) ==1) {
        fclose(tmp);
    } else {
        // 文件不存在，使用命令获取	File does not exist, use command to get
        // 成功获取pid			the PID successfully
        sscanf(execute(cmd).c_str(), "%d", &pid);
    }

    if (pid > 0 && pid != getpid() /*&& pid_is_real(pid)*/) {
        kill(pid, SIGINT);
        remove(PID_FILE);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x78, %rsp
movb 0x944e(%rip), %al       # 0x15cb8
testb %al, %al
je 0xc9a0
movl $0x0, 0xc(%rsp)
leaq 0x227c(%rip), %rdi      # 0xeafd
leaq 0x2377(%rip), %rsi      # 0xebff
callq 0x33f0
testq %rax, %rax
je 0xc8bd
movq %rax, %rbx
leaq 0x200b(%rip), %rsi      # 0xe8a7
leaq 0xc(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x3620
cmpl $0x1, %eax
jne 0xc8bd
movq %rbx, %rdi
callq 0x3370
jmp 0xc969
movq 0x93d4(%rip), %rdi      # 0x15c98
leaq 0x2334(%rip), %rsi      # 0xebff
callq 0x3100
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
testq %rax, %rax
je 0xc93a
movq %rax, %rbx
movq %rax, %rdi
callq 0x3510
testl %eax, %eax
jne 0xc932
leaq 0x30(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movl $0x40, %esi
movq %rbx, %rdx
callq 0x3520
testq %rax, %rax
je 0xc926
movq %r15, %rdi
movq %r14, %rsi
callq 0x3630
movq %rbx, %rdi
callq 0x3510
testl %eax, %eax
je 0xc906
movq %rbx, %rdi
callq 0x3480
movq 0x10(%rsp), %rdi
leaq 0x1f61(%rip), %rsi      # 0xe8a7
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x3350
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xc969
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movl 0xc(%rsp), %ebx
testl %ebx, %ebx
jle 0xc994
callq 0x34d0
cmpl %eax, %ebx
je 0xc994
movl 0xc(%rsp), %edi
movl $0x2, %esi
callq 0x3490
leaq 0x216e(%rip), %rdi      # 0xeafd
callq 0x3600
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x9311(%rip), %rdi      # 0x15cb8
callq 0x3610
testl %eax, %eax
je 0xc872
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x211b(%rip), %rsi      # 0xeadf
leaq 0x2121(%rip), %rdx      # 0xeaec
leaq 0x10(%rsp), %rdi
callq 0x7e16
movq 0x65fc(%rip), %rax      # 0x12fd8
movq (%rax), %rsi
leaq 0x10(%rsp), %rdi
callq 0x3630
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0xca10
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0xca17
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x30(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x925e(%rip), %rdi      # 0x15c98
leaq 0x20ac(%rip), %rdx      # 0xeaed
callq 0xce09
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xca5d
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xca74
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x6525(%rip), %rdi      # 0x12fa0
leaq 0x9216(%rip), %rsi      # 0x15c98
leaq 0x68a7(%rip), %rdx      # 0x13330
callq 0x32d0
leaq 0x9223(%rip), %rdi      # 0x15cb8
callq 0x3200
jmp 0xc872
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xcabe
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xcabe
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xcada
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xcada
movq %rax, %rbx
leaq 0x91d7(%rip), %rdi      # 0x15cb8
callq 0x31f0
jmp 0xcb02
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xcb02
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x35e0