// File: /workspace/github_cpp_makefile_star2_O3/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 0x95e7(%rip), %al       # 0x15cb8
testb %al, %al
je 0xc80a
movl $0x0, 0xc(%rsp)
leaq 0x2405(%rip), %rdi      # 0xeaed
leaq 0x2500(%rip), %rsi      # 0xebef
callq 0x33f0
testq %rax, %rax
je 0xc724
movq %rax, %rbx
leaq 0x2194(%rip), %rsi      # 0xe897
leaq 0xc(%rsp), %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x3620
cmpl $0x1, %eax
jne 0xc724
movq %rbx, %rdi
callq 0x3370
jmp 0xc7d3
movq 0x956d(%rip), %rdi      # 0x15c98
leaq 0x24bd(%rip), %rsi      # 0xebef
callq 0x3100
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
movq $0x0, -0x8(%r12)
movb $0x0, (%r12)
movq %r12, %rdi
testq %rax, %rax
je 0xc7a9
movq %rax, %rbx
movq %rax, %rdi
callq 0x3510
testl %eax, %eax
jne 0xc79c
leaq 0x30(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdi
movl $0x40, %esi
movq %rbx, %rdx
callq 0x3520
testq %rax, %rax
je 0xc790
movq %r15, %rdi
movq %r14, %rsi
callq 0x3630
movq %rbx, %rdi
callq 0x3510
testl %eax, %eax
je 0xc770
movq %rbx, %rdi
callq 0x3480
movq 0x10(%rsp), %rdi
leaq 0x20e7(%rip), %rsi      # 0xe897
leaq 0xc(%rsp), %rdx
xorl %eax, %eax
callq 0x3350
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xc7d3
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movl 0xc(%rsp), %ebx
testl %ebx, %ebx
jle 0xc7fe
callq 0x34d0
cmpl %eax, %ebx
je 0xc7fe
movl 0xc(%rsp), %edi
movl $0x2, %esi
callq 0x3490
leaq 0x22f4(%rip), %rdi      # 0xeaed
callq 0x3600
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x94a7(%rip), %rdi      # 0x15cb8
callq 0x3610
testl %eax, %eax
je 0xc6d9
leaq 0x20(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x22a1(%rip), %rsi      # 0xeacf
leaq 0x22a7(%rip), %rdx      # 0xeadc
leaq 0x10(%rsp), %rdi
callq 0x7dac
movq 0x6792(%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 0xc87a
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0xc881
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 0x93f4(%rip), %rdi      # 0x15c98
leaq 0x2232(%rip), %rdx      # 0xeadd
callq 0xcc53
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xc8c7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xc8de
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movq 0x66bb(%rip), %rdi      # 0x12fa0
leaq 0x93ac(%rip), %rsi      # 0x15c98
leaq 0x6a3d(%rip), %rdx      # 0x13330
callq 0x32d0
leaq 0x93b9(%rip), %rdi      # 0x15cb8
callq 0x3200
jmp 0xc6d9
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xc928
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xc928
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0xc944
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
jmp 0xc944
movq %rax, %rbx
leaq 0x936d(%rip), %rdi      # 0x15cb8
callq 0x31f0
jmp 0xc96c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0xc96c
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x3390
movq %rbx, %rdi
callq 0x35e0