#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 */
struct inotify_event {
  int dummy;
};
struct flock {
  int /*<<< orphan*/ l_whence;
  int /*<<< orphan*/ l_type;
  scalar_t__ l_start;
  scalar_t__ l_len;
};

/* Variables and functions */
scalar_t__ EACCES;
scalar_t__ EAGAIN;
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ LOG_ERR;
int NAME_MAX;
int O_CLOEXEC;
int O_CREAT;
int O_RDWR;
int /*<<< orphan*/ SEEK_SET;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ close(int);
scalar_t__ errno;
scalar_t__ fcntl(int, int /*<<< orphan*/, struct flock *);
scalar_t__ ftruncate(int, int /*<<< orphan*/);
scalar_t__ getpid();
int open(char *, int, int);
int /*<<< orphan*/ snprintf(char *, int, char *, long);
scalar_t__ strlen(char *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
scalar_t__ write(int, char *, scalar_t__);
int lockPidFile() {
  int fd;
  struct flock lock;
  char buf[(4 * (sizeof(struct inotify_event) + NAME_MAX + 1))];
  fd = open("/var/run/smackd.pid", O_RDWR | O_CREAT | O_CLOEXEC,
            S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
  if (fd < 0) {
    syslog(LOG_ERR, "Failed to open (%s) : %m", "/var/run/smackd.pid");
    return -1;
  }
  lock.l_len = 0;
  lock.l_start = 0;
  lock.l_type = F_WRLCK;
  lock.l_whence = SEEK_SET;
  if (fcntl(fd, F_SETLK, &lock) < 0) {
    if (errno == EACCES || errno == EAGAIN) {
      syslog(LOG_ERR, "Daemon is already running (%s) : %m",
             "/var/run/smackd.pid");
    } else
      syslog(LOG_ERR, "Could not lock PID_FILE (%s) : %m",
             "/var/run/smackd.pid");
    close(fd);
    return -1;
  }
  if (ftruncate(fd, 0) < 0) {
    syslog(LOG_ERR, "Could not truncate PID_FILE (%s) : %m",
           "/var/run/smackd.pid");
    close(fd);
    return -1;
  }
  snprintf(buf, (4 * (sizeof(struct inotify_event) + NAME_MAX + 1)), "%ld\n",
           (long)getpid());
  if (write(fd, buf, strlen(buf)) != strlen(buf)) {
    syslog(LOG_ERR, "Could not write to PID_FILE (%s) : %m",
           "/var/run/smackd.pid");
    close(fd);
    return -1;
  }
  return fd;
}


x86 assembly (clang, -O0):
<lockPidFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x2dd1(%rip),%rax
movslq (%rax),%rcx
lea    0x14(,%rcx,4),%rax
mov    %rsp,%rdx
mov    %rdx,-0x28(%rbp)
lea    0x23(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    0x2e0b(%rip),%rax
mov    (%rax),%esi
mov    0x2e1a(%rip),%rax
or     (%rax),%esi
mov    0x2d91(%rip),%rax
or     (%rax),%esi
mov    0x2da8(%rip),%rax
mov    (%rax),%edx
mov    0x2dd7(%rip),%rax
or     (%rax),%edx
mov    0x2da6(%rip),%rax
or     (%rax),%edx
mov    0x2d95(%rip),%rax
or     (%rax),%edx
lea    0xdec(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1255 <lockPidFile+0xc5>
mov    0x2d53(%rip),%rax
mov    (%rax),%edi
lea    0xdde(%rip),%rsi
lea    0xdc3(%rip),%rdx
call   10a0 <syslog@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    1428 <lockPidFile+0x298>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2d24(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2d38(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2d51(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    1328 <lockPidFile+0x198>
mov    0x2d15(%rip),%rax
mov    (%rax),%rax
mov    0x2d1b(%rip),%rcx
cmp    (%rcx),%rax
je     12d0 <lockPidFile+0x140>
mov    0x2cfb(%rip),%rax
mov    (%rax),%rax
mov    0x2ca1(%rip),%rcx
cmp    (%rcx),%rax
jne    12f1 <lockPidFile+0x161>
mov    0x2ca9(%rip),%rax
mov    (%rax),%edi
lea    0xd4d(%rip),%rsi
lea    0xd19(%rip),%rdx
call   10a0 <syslog@plt>
jmp    130d <lockPidFile+0x17d>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
lea    0xd50(%rip),%rsi
lea    0xcf8(%rip),%rdx
call   10a0 <syslog@plt>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    1428 <lockPidFile+0x298>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1080 <ftruncate@plt>
cmp    $0x0,%rax
jge    1373 <lockPidFile+0x1e3>
mov    0x2c3d(%rip),%rax
mov    (%rax),%edi
lea    0xd27(%rip),%rsi
lea    0xcad(%rip),%rdx
call   10a0 <syslog@plt>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    1428 <lockPidFile+0x298>
mov    0x2bf6(%rip),%rax
movslq (%rax),%rax
add    $0x4,%rax
add    $0x1,%rax
shl    $0x2,%rax
mov    %eax,-0x50(%rbp)
mov    $0x0,%al
call   1050 <getpid@plt>
mov    -0x50(%rbp),%esi
mov    -0x40(%rbp),%rdi
mov    %rax,%rcx
lea    0xcf5(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%eax
mov    %eax,-0x4c(%rbp)
call   1060 <strlen@plt>
mov    -0x4c(%rbp),%edi
mov    -0x40(%rbp),%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    -0x40(%rbp),%rdi
mov    %rax,-0x48(%rbp)
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0x48(%rbp),%rax
cmp    %rcx,%rax
je     141b <lockPidFile+0x28b>
mov    0x2b95(%rip),%rax
mov    (%rax),%edi
lea    0xcaa(%rip),%rsi
lea    0xc05(%rip),%rdx
call   10a0 <syslog@plt>
mov    -0x8(%rbp),%edi
call   1090 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
jmp    1428 <lockPidFile+0x298>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
movl   $0x1,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockPidFile>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%r12
mov    0x2dc7(%rip),%r15
movslq (%r15),%rax
mov    %rsp,%rbx
lea    0x23(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    0x2e18(%rip),%rax
mov    0x2e29(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2d9e(%rip),%rax
or     (%rax),%esi
mov    0x2db5(%rip),%rax
mov    0x2de6(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2db3(%rip),%rax
or     (%rax),%edx
mov    0x2da2(%rip),%rax
or     (%rax),%edx
lea    0xdf9(%rip),%rdi
call   10b0 <open@plt>
test   %eax,%eax
js     12ca <lockPidFile+0x13a>
mov    %eax,%r14d
xorps  %xmm0,%xmm0
movups %xmm0,-0x30(%rbp)
mov    0x2d6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    0x2d7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    0x2d9b(%rip),%rax
mov    (%rax),%esi
lea    -0x38(%rbp),%rdx
mov    %r14d,%edi
call   1030 <fcntl@plt>
test   %rax,%rax
js     12e8 <lockPidFile+0x158>
mov    %r14d,%edi
xor    %esi,%esi
call   1080 <ftruncate@plt>
test   %rax,%rax
js     1327 <lockPidFile+0x197>
mov    (%r15),%eax
lea    0x14(,%rax,4),%r15d
xor    %eax,%eax
call   1050 <getpid@plt>
lea    0xe19(%rip),%rdx
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %rax,%rcx
call   1070 <snprintf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
call   1040 <write@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    %rax,%r15
je     1351 <lockPidFile+0x1c1>
mov    0x2cc1(%rip),%rax
mov    (%rax),%edi
lea    0xdd6(%rip),%rsi
jmp    1337 <lockPidFile+0x1a7>
mov    0x2caf(%rip),%rax
mov    (%rax),%edi
lea    0xd3a(%rip),%rsi
lea    0xd1f(%rip),%rdx
call   10a0 <syslog@plt>
jmp    134b <lockPidFile+0x1bb>
mov    0x2cc9(%rip),%rax
mov    (%rax),%rax
mov    0x2ccf(%rip),%rcx
mov    0x2c68(%rip),%rdx
cmp    (%rdx),%rax
lea    0xd23(%rip),%rdx
lea    0xd40(%rip),%rsi
cmove  %rdx,%rsi
cmp    (%rcx),%rax
mov    0x2c61(%rip),%rax
mov    (%rax),%edi
cmove  %rdx,%rsi
jmp    1337 <lockPidFile+0x1a7>
mov    0x2c52(%rip),%rax
mov    (%rax),%edi
lea    0xd3c(%rip),%rsi
lea    0xcc2(%rip),%rdx
call   10a0 <syslog@plt>
mov    %r14d,%edi
call   1090 <close@plt>
mov    $0xffffffff,%r14d
mov    %r12,%rsp
mov    %r14d,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i64, i64 }
@NAME_MAX = global i32 0
@.str = [20 x i8] c"/var/run/smackd.pid\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_CLOEXEC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [25 x i8] c"Failed to open (%s) : %m\00"
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
@errno = global i64 0
@EACCES = global i64 0
@EAGAIN = global i64 0
@.str.2 = [36 x i8] c"Daemon is already running (%s) : %m\00"
@.str.3 = [34 x i8] c"Could not lock PID_FILE (%s) : %m\00"
@.str.4 = [38 x i8] c"Could not truncate PID_FILE (%s) : %m\00"
@.str.5 = [5 x i8] c"%ld\0A\00"
@.str.6 = [38 x i8] c"Could not write to PID_FILE (%s) : %m\00"
define i32 @lockPidFile() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.flock
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = load i32, i32* @NAME_MAX
%8 = sext i32 %7 to i64
%9 = add i64 4, %8
%10 = add i64 %9, 1
%11 = mul i64 4, %10
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %4
%13 = alloca i8, i64 %11
store i64 %11, i64* %5
%14 = load i32, i32* @O_RDWR
%15 = load i32, i32* @O_CREAT
%16 = or i32 %14, %15
%17 = load i32, i32* @O_CLOEXEC
%18 = or i32 %16, %17
%19 = load i32, i32* @S_IRUSR
%20 = load i32, i32* @S_IWUSR
%21 = or i32 %19, %20
%22 = load i32, i32* @S_IRGRP
%23 = or i32 %21, %22
%24 = load i32, i32* @S_IROTH
%25 = or i32 %23, %24
%26 = call i32 @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %18, i32 %25)
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %0
%30 = load i32, i32* @LOG_ERR
%31 = call i32 @syslog(i32 %30, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
store i32 1, i32* %6
br label %90
32: ; preds = %0
%33 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i64 0, i64* %33
%34 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i64 0, i64* %34
%35 = load i32, i32* @F_WRLCK
%36 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i32 %35, i32* %36
%37 = load i32, i32* @SEEK_SET
%38 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i32 %37, i32* %38
%39 = load i32, i32* %2
%40 = load i32, i32* @F_SETLK
%41 = call i64 @fcntl(i32 %39, i32 %40, %struct.flock* %3)
%42 = icmp slt i64 %41, 0
br i1 %42, label %43, label %60
43: ; preds = %32
%44 = load i64, i64* @errno
%45 = load i64, i64* @EACCES
%46 = icmp eq i64 %44, %45
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i64, i64* @errno
%49 = load i64, i64* @EAGAIN
%50 = icmp eq i64 %48, %49
br i1 %50, label %51, label %54
51: ; preds = %47, %43
%52 = load i32, i32* @LOG_ERR
%53 = call i32 @syslog(i32 %52, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %57
54: ; preds = %47
%55 = load i32, i32* @LOG_ERR
%56 = call i32 @syslog(i32 %55, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %57
57: ; preds = %54, %51
%58 = load i32, i32* %2
%59 = call i32 @close(i32 %58)
store i32 -1, i32* %1
store i32 1, i32* %6
br label %90
60: ; preds = %32
%61 = load i32, i32* %2
%62 = call i64 @ftruncate(i32 %61, i32 0)
%63 = icmp slt i64 %62, 0
br i1 %63, label %64, label %69
64: ; preds = %60
%65 = load i32, i32* @LOG_ERR
%66 = call i32 @syslog(i32 %65, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%67 = load i32, i32* %2
%68 = call i32 @close(i32 %67)
store i32 -1, i32* %1
store i32 1, i32* %6
br label %90
69: ; preds = %60
%70 = load i32, i32* @NAME_MAX
%71 = sext i32 %70 to i64
%72 = add i64 4, %71
%73 = add i64 %72, 1
%74 = mul i64 4, %73
%75 = trunc i64 %74 to i32
%76 = call i64 (...) @getpid()
%77 = call i32 @snprintf(i8* %13, i32 %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 %76)
%78 = load i32, i32* %2
%79 = call i64 @strlen(i8* %13)
%80 = call i64 @write(i32 %78, i8* %13, i64 %79)
%81 = call i64 @strlen(i8* %13)
%82 = icmp ne i64 %80, %81
br i1 %82, label %83, label %88
83: ; preds = %69
%84 = load i32, i32* @LOG_ERR
%85 = call i32 @syslog(i32 %84, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%86 = load i32, i32* %2
%87 = call i32 @close(i32 %86)
store i32 -1, i32* %1
store i32 1, i32* %6
br label %90
88: ; preds = %69
%89 = load i32, i32* %2
store i32 %89, i32* %1
store i32 1, i32* %6
br label %90
90: ; preds = %88, %83, %64, %57, %29
%91 = load i8*, i8** %4
%92 = load i32, i32* %1
ret i32 %92
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i64, i64 }
@NAME_MAX = global i32 0
@.str = [20 x i8] c"/var/run/smackd.pid\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_CLOEXEC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [25 x i8] c"Failed to open (%s) : %m\00"
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
@errno = global i64 0
@EACCES = global i64 0
@EAGAIN = global i64 0
@.str.2 = [36 x i8] c"Daemon is already running (%s) : %m\00"
@.str.3 = [34 x i8] c"Could not lock PID_FILE (%s) : %m\00"
@.str.4 = [38 x i8] c"Could not truncate PID_FILE (%s) : %m\00"
@.str.5 = [5 x i8] c"%ld\0A\00"
@.str.6 = [38 x i8] c"Could not write to PID_FILE (%s) : %m\00"
define i32 @lockPidFile() {
%1 = alloca %struct.flock
%2 = bitcast %struct.flock* %1 to i8*
%3 = load i32, i32* @NAME_MAX
%4 = sext i32 %3 to i64
%5 = shl nsw i64 %4, 2
%6 = add nsw i64 %5, 20
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i8, i64 %6
%9 = load i32, i32* @O_RDWR
%10 = load i32, i32* @O_CREAT
%11 = or i32 %10, %9
%12 = load i32, i32* @O_CLOEXEC
%13 = or i32 %11, %12
%14 = load i32, i32* @S_IRUSR
%15 = load i32, i32* @S_IWUSR
%16 = or i32 %15, %14
%17 = load i32, i32* @S_IRGRP
%18 = or i32 %16, %17
%19 = load i32, i32* @S_IROTH
%20 = or i32 %18, %19
%21 = tail call i32 @open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %20)
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %0
%24 = load i32, i32* @LOG_ERR
%25 = tail call i32 @syslog(i32 %24, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %68
26: ; preds = %0
%27 = getelementptr inbounds %struct.flock, %struct.flock* %1, i64 0, i32 2
%28 = bitcast i64* %27 to i8*
%29 = load i32, i32* @F_WRLCK
%30 = getelementptr inbounds %struct.flock, %struct.flock* %1, i64 0, i32 1
store i32 %29, i32* %30
%31 = load i32, i32* @SEEK_SET
%32 = getelementptr inbounds %struct.flock, %struct.flock* %1, i64 0, i32 0
store i32 %31, i32* %32
%33 = load i32, i32* @F_SETLK
%34 = call i64 @fcntl(i32 %21, i32 %33, %struct.flock* %1)
%35 = icmp slt i64 %34, 0
br i1 %35, label %36, label %47
36: ; preds = %26
%37 = load i64, i64* @errno
%38 = load i64, i64* @EACCES
%39 = icmp eq i64 %37, %38
%40 = load i64, i64* @EAGAIN
%41 = icmp eq i64 %37, %40
%42 = select i1 %39, i1 true, i1 %41
%43 = load i32, i32* @LOG_ERR
%44 = select i1 %42, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0)
%45 = call i32 @syslog(i32 %43, i8* %44, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%46 = call i32 @close(i32 %21)
br label %68
47: ; preds = %26
%48 = call i64 @ftruncate(i32 %21, i32 0)
%49 = icmp slt i64 %48, 0
br i1 %49, label %50, label %54
50: ; preds = %47
%51 = load i32, i32* @LOG_ERR
%52 = call i32 @syslog(i32 %51, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%53 = call i32 @close(i32 %21)
br label %68
54: ; preds = %47
%55 = load i32, i32* @NAME_MAX
%56 = shl i32 %55, 2
%57 = add i32 %56, 20
%58 = call i64 (...) @getpid()
%59 = call i32 @snprintf(i8* %8, i32 %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i64 %58)
%60 = call i64 @strlen(i8* %8)
%61 = call i64 @write(i32 %21, i8* %8, i64 %60)
%62 = call i64 @strlen(i8* %8)
%63 = icmp eq i64 %61, %62
br i1 %63, label %68, label %64
64: ; preds = %54
%65 = load i32, i32* @LOG_ERR
%66 = call i32 @syslog(i32 %65, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%67 = call i32 @close(i32 %21)
br label %68
68: ; preds = %54, %64, %50, %36, %23
%69 = phi i32 [ -1, %23 ], [ -1, %36 ], [ -1, %50 ], [ -1, %64 ], [ %21, %54 ]
ret i32 %69
}