#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*/ __pid_path();
int /*<<< orphan*/ abort_report(char *, ...);
int pidfile(int /*<<< orphan*/, char *);
void pumpd_stat(void) {
  int pid;
  if (pid = pidfile((__pid_path()), "r"), !pid)
    (1 == 1) ? abort_report("pumpd is not running.", "")
             : abort_report("pumpd is not running.");
  else
    (2 == 1) ? abort_report("pumpd is running with pid %d.", pid, "")
             : abort_report("pumpd is running with pid %d.", pid);
}


x86 assembly (clang, -O0):
<pumpd_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__pid_path@plt>
mov    %eax,%edi
lea    0xeb8(%rip),%rsi
call   1040 <pidfile@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1166 <pumpd_stat+0x36>
jmp    1180 <pumpd_stat+0x50>
lea    0xe95(%rip),%rdi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1050 <abort_report@plt>
jmp    1191 <pumpd_stat+0x61>
mov    -0x4(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <abort_report@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pumpd_stat>:
push   %rax
xor    %eax,%eax
call   1030 <__pid_path@plt>
lea    0xec1(%rip),%rsi
mov    %eax,%edi
call   1040 <pidfile@plt>
test   %eax,%eax
je     115b <pumpd_stat+0x2b>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <abort_report@plt>
lea    0xea0(%rip),%rdi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1050 <abort_report@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 = [30 x i8] c"pumpd is running with pid %d.\00"
define void @pumpd_stat() {
%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 %12
9: ; preds = %0
%10 = load i32, i32* %1
%11 = call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %7
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 = [30 x i8] c"pumpd is running with pid %d.\00"
define void @pumpd_stat() {
%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 %8
6: ; preds = %0
%7 = tail call i32 (i8*, ...) @abort_report(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %2)
br label %8
8: ; preds = %6, %4
ret void
}