#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ __channel_path(char *);
int /*<<< orphan*/ __pid_path();
int /*<<< orphan*/ abort_report(char *, ...);
int /*<<< orphan*/ dpx_remove(int /*<<< orphan*/);
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
int pidfile(int /*<<< orphan*/, char *);
int /*<<< orphan*/ remove(int /*<<< orphan*/);
void pumpd_stop(void) {
  int pid;
  if (pid = pidfile((__pid_path()), "r"), !pid)
    (1 == 1) ? abort_report("pumpd is not running.", "")
             : abort_report("pumpd is not running.");
  remove((__pid_path()));
  dpx_remove((__channel_path("control")));
  kill(pid, SIGTERM);
}


x86 assembly (clang, -O0):
<pumpd_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <__pid_path@plt>
mov    %eax,%edi
lea    0xe78(%rip),%rsi
call   1070 <pidfile@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11a6 <pumpd_stop+0x36>
jmp    11bb <pumpd_stop+0x4b>
lea    0xe55(%rip),%rdi
lea    0xe63(%rip),%rsi
mov    $0x0,%al
call   1080 <abort_report@plt>
mov    $0x0,%al
call   1060 <__pid_path@plt>
mov    %eax,%edi
call   1030 <remove@plt>
lea    0xe48(%rip),%rdi
call   1040 <__channel_path@plt>
mov    %eax,%edi
call   1050 <dpx_remove@plt>
mov    -0x4(%rbp),%edi
mov    0x2e02(%rip),%rax
mov    (%rax),%esi
call   1090 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pumpd_stop>:
push   %rbx
xor    %eax,%eax
call   1060 <__pid_path@plt>
lea    0xe81(%rip),%rsi
mov    %eax,%edi
call   1070 <pidfile@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    11a1 <pumpd_stop+0x31>
lea    0xe6f(%rip),%rdi
lea    0xe7d(%rip),%rsi
xor    %eax,%eax
call   1080 <abort_report@plt>
xor    %eax,%eax
call   1060 <__pid_path@plt>
mov    %eax,%edi
call   1030 <remove@plt>
lea    0xe62(%rip),%rdi
call   1040 <__channel_path@plt>
mov    %eax,%edi
call   1050 <dpx_remove@plt>
mov    0x2e1f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1090 <kill@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [22 x i8] c"pumpd is not running.\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [8 x i8] c"control\00"
@SIGTERM = global i32 0
define void @pumpd_stop() {
%1 = alloca i32
%2 = call i32 (...) @__pid_path()
%3 = call i32 @pidfile(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 (...) @__pid_path()
%11 = call i32 @remove(i32 %10)
%12 = call i32 @__channel_path(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @dpx_remove(i32 %12)
%14 = load i32, i32* %1
%15 = load i32, i32* @SIGTERM
%16 = call i32 @kill(i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [22 x i8] c"pumpd is not running.\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [8 x i8] c"control\00"
@SIGTERM = global i32 0
define void @pumpd_stop() {
%1 = tail call i32 (...) @__pid_path()
%2 = tail call i32 @pidfile(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = tail call i32 (...) @__pid_path()
%8 = tail call i32 @remove(i32 %7)
%9 = tail call i32 @__channel_path(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 @dpx_remove(i32 %9)
%11 = load i32, i32* @SIGTERM
%12 = tail call i32 @kill(i32 %2, i32 %11)
ret void
}