#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 */
typedef scalar_t__ ssize_t;
typedef int pid_t;
typedef int mode_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EACCES;
scalar_t__ EAGAIN;
int EXIT_FAILURE;
int O_CREAT;
int O_NOCTTY;
int O_WRONLY;
int S_IRGRP;
int S_IROTH;
int S_IRUSR;
int S_IWUSR;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int ftruncate(int, int /*<<< orphan*/);
int /*<<< orphan*/ mperror(int /*<<< orphan*/ *, scalar_t__, char *);
int open(char const *, int, int);
int snprintf(char *, int, char *, int);
int /*<<< orphan*/ stderr;
int wlock_file(int);
scalar_t__ write(int, char *, int);
int make_pidfile(const char *fpath, pid_t pid, FILE *log) {
  int fd = -1, rc = 0, n = -1;
  ssize_t nwr = -1;
  char buf[21 + 1];
  mode_t fmode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
  assert((NULL != fpath) && pid);
  errno = 0;
  do {
    fd = open(fpath, O_CREAT | O_WRONLY | O_NOCTTY, fmode);
    if (-1 == fd) {
      mperror(log, errno, "make_pidfile - open");
      rc = EXIT_FAILURE;
      break;
    }
    rc = wlock_file(fd);
    if (0 != rc) {
      if ((EACCES == errno) || (EAGAIN == errno)) {
        (void)fprintf(stderr,
                      "File [%s] is locked "
                      "(another instance of daemon must be running)\n",
                      fpath);
        exit(EXIT_FAILURE);
      }
      mperror(log, errno, "wlock_file");
      break;
    }
    rc = ftruncate(fd, 0);
    if (0 != rc) {
      mperror(log, errno, "make_pidfile - ftruncate");
      break;
    }
    n = snprintf(buf, sizeof(buf) - 1, "%d", pid);
    if (n < 0) {
      mperror(log, errno, "make_pidfile - snprintf");
      rc = EXIT_FAILURE;
      break;
    }
    nwr = write(fd, buf, n);
    if ((ssize_t)n != nwr) {
      mperror(log, errno, "make_pidfile - write");
      rc = EXIT_FAILURE;
      break;
    }
  } while (0);
  if ((0 != rc) && (fd > 0)) {
    (void)close(fd);
  }
  return rc;
}


x86 assembly (clang, -O0):
<make_pidfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0xffffffff,-0x24(%rbp)
movq   $0xffffffffffffffff,-0x30(%rbp)
ff
mov    0x2dc1(%rip),%rax
mov    (%rax),%eax
mov    0x2e00(%rip),%rcx
or     (%rcx),%eax
mov    0x2dc7(%rip),%rcx
or     (%rcx),%eax
mov    0x2db6(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x54(%rbp)
xor    %eax,%eax
xor    %ecx,%ecx
cmp    -0x8(%rbp),%rcx
mov    %al,-0x55(%rbp)
je     1212 <make_pidfile+0x72>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x55(%rbp)
mov    -0x55(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1070 <assert@plt>
mov    0x2d92(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    0x2dc0(%rip),%rax
mov    (%rax),%esi
mov    0x2d47(%rip),%rax
or     (%rax),%esi
mov    0x2d7e(%rip),%rax
or     (%rax),%esi
mov    -0x54(%rbp),%edx
call   10b0 <open@plt>
mov    %eax,-0x1c(%rbp)
mov    $0xffffffff,%eax
cmp    -0x1c(%rbp),%eax
jne    1290 <make_pidfile+0xf0>
mov    -0x18(%rbp),%rdi
mov    0x2d48(%rip),%rax
mov    (%rax),%rsi
lea    0xd86(%rip),%rdx
call   10a0 <mperror@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
jmp    13f8 <make_pidfile+0x258>
mov    -0x1c(%rbp),%edi
call   1090 <wlock_file@plt>
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%eax
je     1320 <make_pidfile+0x180>
mov    0x2d2b(%rip),%rax
mov    (%rax),%rax
mov    0x2d01(%rip),%rcx
cmp    (%rcx),%rax
je     12da <make_pidfile+0x13a>
mov    0x2cb9(%rip),%rax
mov    (%rax),%rax
mov    0x2ce7(%rip),%rcx
cmp    (%rcx),%rax
jne    1301 <make_pidfile+0x161>
mov    0x2cdf(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xd26(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2ca6(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    0x2cac(%rip),%rax
mov    (%rax),%rsi
lea    0xd40(%rip),%rdx
call   10a0 <mperror@plt>
jmp    13f8 <make_pidfile+0x258>
mov    -0x1c(%rbp),%edi
xor    %esi,%esi
call   1050 <ftruncate@plt>
mov    %eax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%eax
je     1357 <make_pidfile+0x1b7>
mov    -0x18(%rbp),%rdi
mov    0x2c75(%rip),%rax
mov    (%rax),%rsi
lea    0xd14(%rip),%rdx
call   10a0 <mperror@plt>
jmp    13f8 <make_pidfile+0x258>
lea    -0x50(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x15,%esi
lea    0xd10(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    13a7 <make_pidfile+0x207>
mov    -0x18(%rbp),%rdi
mov    0x2c31(%rip),%rax
mov    (%rax),%rsi
lea    0xcec(%rip),%rdx
call   10a0 <mperror@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
jmp    13f8 <make_pidfile+0x258>
mov    -0x1c(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x24(%rbp),%edx
call   1030 <write@plt>
mov    %rax,-0x30(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x30(%rbp),%rax
je     13f3 <make_pidfile+0x253>
mov    -0x18(%rbp),%rdi
mov    0x2be5(%rip),%rax
mov    (%rax),%rsi
lea    0xcb8(%rip),%rdx
call   10a0 <mperror@plt>
mov    0x2bb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
jmp    13f8 <make_pidfile+0x258>
jmp    13f8 <make_pidfile+0x258>
xor    %eax,%eax
cmp    -0x20(%rbp),%eax
je     1415 <make_pidfile+0x275>
cmpl   $0x0,-0x1c(%rbp)
jle    1415 <make_pidfile+0x275>
mov    -0x1c(%rbp),%edi
call   1060 <close@plt>
mov    -0x20(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_pidfile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rbp
mov    0x2dda(%rip),%rax
mov    0x2e1b(%rip),%rcx
mov    (%rcx),%ebx
or     (%rax),%ebx
mov    0x2de0(%rip),%rax
or     (%rax),%ebx
mov    0x2dcf(%rip),%rax
or     (%rax),%ebx
test   %rdi,%rdi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%edi
call   1070 <assert@plt>
mov    0x2dc1(%rip),%r13
mov    0x2dfa(%rip),%rax
mov    0x2d83(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
movq   $0x0,0x0(%r13)
mov    0x2db0(%rip),%rax
or     (%rax),%esi
mov    %rbp,%rdi
mov    %ebx,%edx
call   10b0 <open@plt>
cmp    $0xffffffff,%eax
je     1266 <make_pidfile+0xc6>
mov    %eax,%r12d
mov    %eax,%edi
call   1090 <wlock_file@plt>
test   %eax,%eax
je     1284 <make_pidfile+0xe4>
mov    %eax,%ebx
mov    0x2d98(%rip),%rax
mov    0x0(%r13),%rsi
cmp    %rsi,(%rax)
je     132c <make_pidfile+0x18c>
mov    0x2d2c(%rip),%rax
cmp    %rsi,(%rax)
je     132c <make_pidfile+0x18c>
lea    0xdf2(%rip),%rdx
jmp    129f <make_pidfile+0xff>
mov    0x0(%r13),%rsi
lea    0xd8f(%rip),%rdx
mov    %r14,%rdi
call   10a0 <mperror@plt>
mov    0x2d20(%rip),%rax
mov    (%rax),%ebx
jmp    12b8 <make_pidfile+0x118>
mov    %r12d,%edi
xor    %esi,%esi
call   1050 <ftruncate@plt>
test   %eax,%eax
je     12c9 <make_pidfile+0x129>
mov    %eax,%ebx
mov    0x0(%r13),%rsi
lea    0xdc2(%rip),%rdx
mov    %r14,%rdi
call   10a0 <mperror@plt>
test   %r12d,%r12d
jle    12b8 <make_pidfile+0x118>
test   %ebx,%ebx
je     12b8 <make_pidfile+0x118>
mov    %r12d,%edi
call   1060 <close@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdaa(%rip),%rdx
mov    %rsp,%rdi
mov    $0x15,%esi
mov    %r15d,%ecx
call   1040 <snprintf@plt>
test   %eax,%eax
js     1309 <make_pidfile+0x169>
mov    %eax,%ebx
mov    %rsp,%rsi
mov    %r12d,%edi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebx,%ecx
xor    %ebx,%ebx
cmp    %rcx,%rax
je     12b8 <make_pidfile+0x118>
mov    0x0(%r13),%rsi
lea    0xd8e(%rip),%rdx
jmp    1314 <make_pidfile+0x174>
mov    0x0(%r13),%rsi
lea    0xd69(%rip),%rdx
mov    %r14,%rdi
call   10a0 <mperror@plt>
mov    0x2c7d(%rip),%rax
mov    (%rax),%ebx
test   %r12d,%r12d
jg     12ac <make_pidfile+0x10c>
jmp    12b8 <make_pidfile+0x118>
mov    0x2c8d(%rip),%rax
mov    (%rax),%edi
lea    0xcd8(%rip),%rsi
mov    %rbp,%rdx
call   1080 <fprintf@plt>
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@errno = global i64 0
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_NOCTTY = global i32 0
@.str = [20 x i8] c"make_pidfile - open\00"
@EXIT_FAILURE = global i32 0
@EACCES = global i64 0
@EAGAIN = global i64 0
@stderr = global i32 0
@.str.1 = [66 x i8] c"File [%s] is locked (another instance of daemon must be running)\0A\00"
@.str.2 = [11 x i8] c"wlock_file\00"
@.str.3 = [25 x i8] c"make_pidfile - ftruncate\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [24 x i8] c"make_pidfile - snprintf\00"
@.str.6 = [21 x i8] c"make_pidfile - write\00"
define i32 @make_pidfile(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca [22 x i8]
%12 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 -1, i32* %7
store i32 0, i32* %8
store i32 -1, i32* %9
store i64 -1, i64* %10
%13 = load i32, i32* @S_IRUSR
%14 = load i32, i32* @S_IWUSR
%15 = or i32 %13, %14
%16 = load i32, i32* @S_IRGRP
%17 = or i32 %15, %16
%18 = load i32, i32* @S_IROTH
%19 = or i32 %17, %18
store i32 %19, i32* %12
%20 = load i8*, i8** %4
%21 = icmp ne i8* null, %20
br i1 %21, label %22, label %25
22: ; preds = %3
%23 = load i32, i32* %5
%24 = icmp ne i32 %23, 0
br label %25
25: ; preds = %22, %3
%26 = phi i1 [ false, %3 ], [ %24, %22 ]
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
store i64 0, i64* @errno
br label %29
29: ; preds = %25
%30 = load i8*, i8** %4
%31 = load i32, i32* @O_CREAT
%32 = load i32, i32* @O_WRONLY
%33 = or i32 %31, %32
%34 = load i32, i32* @O_NOCTTY
%35 = or i32 %33, %34
%36 = load i32, i32* %12
%37 = call i32 @open(i8* %30, i32 %35, i32 %36)
store i32 %37, i32* %7
%38 = load i32, i32* %7
%39 = icmp eq i32 -1, %38
br i1 %39, label %40, label %45
40: ; preds = %29
%41 = load i32*, i32** %6
%42 = load i64, i64* @errno
%43 = call i32 @mperror(i32* %41, i64 %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%44 = load i32, i32* @EXIT_FAILURE
store i32 %44, i32* %8
br label %103
45: ; preds = %29
%46 = load i32, i32* %7
%47 = call i32 @wlock_file(i32 %46)
store i32 %47, i32* %8
%48 = load i32, i32* %8
%49 = icmp ne i32 0, %48
br i1 %49, label %50, label %68
50: ; preds = %45
%51 = load i64, i64* @EACCES
%52 = load i64, i64* @errno
%53 = icmp eq i64 %51, %52
br i1 %53, label %58, label %54
54: ; preds = %50
%55 = load i64, i64* @EAGAIN
%56 = load i64, i64* @errno
%57 = icmp eq i64 %55, %56
br i1 %57, label %58, label %64
58: ; preds = %54, %50
%59 = load i32, i32* @stderr
%60 = load i8*, i8** %4
%61 = call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i8* %60)
%62 = load i32, i32* @EXIT_FAILURE
%63 = call i32 @exit(i32 %62)
unreachable
64: ; preds = %54
%65 = load i32*, i32** %6
%66 = load i64, i64* @errno
%67 = call i32 @mperror(i32* %65, i64 %66, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %103
68: ; preds = %45
%69 = load i32, i32* %7
%70 = call i32 @ftruncate(i32 %69, i32 0)
store i32 %70, i32* %8
%71 = load i32, i32* %8
%72 = icmp ne i32 0, %71
br i1 %72, label %73, label %77
73: ; preds = %68
%74 = load i32*, i32** %6
%75 = load i64, i64* @errno
%76 = call i32 @mperror(i32* %74, i64 %75, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %103
77: ; preds = %68
%78 = getelementptr inbounds [22 x i8], [22 x i8]* %11, i64 0, i64 0
%79 = load i32, i32* %5
%80 = call i32 @snprintf(i8* %78, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %79)
store i32 %80, i32* %9
%81 = load i32, i32* %9
%82 = icmp slt i32 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %77
%84 = load i32*, i32** %6
%85 = load i64, i64* @errno
%86 = call i32 @mperror(i32* %84, i64 %85, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%87 = load i32, i32* @EXIT_FAILURE
store i32 %87, i32* %8
br label %103
88: ; preds = %77
%89 = load i32, i32* %7
%90 = getelementptr inbounds [22 x i8], [22 x i8]* %11, i64 0, i64 0
%91 = load i32, i32* %9
%92 = call i64 @write(i32 %89, i8* %90, i32 %91)
store i64 %92, i64* %10
%93 = load i32, i32* %9
%94 = sext i32 %93 to i64
%95 = load i64, i64* %10
%96 = icmp ne i64 %94, %95
br i1 %96, label %97, label %102
97: ; preds = %88
%98 = load i32*, i32** %6
%99 = load i64, i64* @errno
%100 = call i32 @mperror(i32* %98, i64 %99, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%101 = load i32, i32* @EXIT_FAILURE
store i32 %101, i32* %8
br label %103
102: ; preds = %88
br label %103
103: ; preds = %102, %97, %83, %73, %64, %40
%104 = load i32, i32* %8
%105 = icmp ne i32 0, %104
br i1 %105, label %106, label %112
106: ; preds = %103
%107 = load i32, i32* %7
%108 = icmp sgt i32 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %106
%110 = load i32, i32* %7
%111 = call i32 @close(i32 %110)
br label %112
112: ; preds = %109, %106, %103
%113 = load i32, i32* %8
ret i32 %113
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IRGRP = global i32 0
@S_IROTH = global i32 0
@errno = global i64 0
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_NOCTTY = global i32 0
@.str = [20 x i8] c"make_pidfile - open\00"
@EXIT_FAILURE = global i32 0
@EACCES = global i64 0
@EAGAIN = global i64 0
@stderr = global i32 0
@.str.1 = [66 x i8] c"File [%s] is locked (another instance of daemon must be running)\0A\00"
@.str.2 = [11 x i8] c"wlock_file\00"
@.str.3 = [25 x i8] c"make_pidfile - ftruncate\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [24 x i8] c"make_pidfile - snprintf\00"
@.str.6 = [21 x i8] c"make_pidfile - write\00"
define i32 @make_pidfile(i8* %0, i32 %1, i32* %2) {
%4 = alloca [22 x i8]
%5 = getelementptr inbounds [22 x i8], [22 x i8]* %4, i64 0, i64 0
%6 = load i32, i32* @S_IRUSR
%7 = load i32, i32* @S_IWUSR
%8 = or i32 %7, %6
%9 = load i32, i32* @S_IRGRP
%10 = or i32 %8, %9
%11 = load i32, i32* @S_IROTH
%12 = or i32 %10, %11
%13 = icmp ne i8* %0, null
%14 = icmp ne i32 %1, 0
%15 = and i1 %13, %14
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
store i64 0, i64* @errno
%18 = load i32, i32* @O_CREAT
%19 = load i32, i32* @O_WRONLY
%20 = or i32 %19, %18
%21 = load i32, i32* @O_NOCTTY
%22 = or i32 %20, %21
%23 = tail call i32 @open(i8* %0, i32 %22, i32 %12)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %29
25: ; preds = %3
%26 = load i64, i64* @errno
%27 = tail call i32 @mperror(i32* %2, i64 %26, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* @EXIT_FAILURE
br label %74
29: ; preds = %3
%30 = tail call i32 @wlock_file(i32 %23)
%31 = icmp eq i32 %30, 0
br i1 %31, label %46, label %32
32: ; preds = %29
%33 = load i64, i64* @EACCES
%34 = load i64, i64* @errno
%35 = icmp eq i64 %33, %34
%36 = load i64, i64* @EAGAIN
%37 = icmp eq i64 %36, %34
%38 = select i1 %35, i1 true, i1 %37
br i1 %38, label %39, label %44
39: ; preds = %32
%40 = load i32, i32* @stderr
%41 = tail call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%42 = load i32, i32* @EXIT_FAILURE
%43 = tail call i32 @exit(i32 %42)
unreachable
44: ; preds = %32
%45 = tail call i32 @mperror(i32* %2, i64 %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %67
46: ; preds = %29
%47 = tail call i32 @ftruncate(i32 %23, i32 0)
%48 = icmp eq i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i64, i64* @errno
%51 = tail call i32 @mperror(i32* %2, i64 %50, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
br label %67
52: ; preds = %46
%53 = call i32 @snprintf(i8* %5, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %1)
%54 = icmp slt i32 %53, 0
br i1 %54, label %55, label %59
55: ; preds = %52
%56 = load i64, i64* @errno
%57 = call i32 @mperror(i32* %2, i64 %56, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
%58 = load i32, i32* @EXIT_FAILURE
br label %67
59: ; preds = %52
%60 = call i64 @write(i32 %23, i8* %5, i32 %53)
%61 = zext i32 %53 to i64
%62 = icmp eq i64 %60, %61
br i1 %62, label %74, label %63
63: ; preds = %59
%64 = load i64, i64* @errno
%65 = call i32 @mperror(i32* %2, i64 %64, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%66 = load i32, i32* @EXIT_FAILURE
br label %67
67: ; preds = %63, %55, %49, %44
%68 = phi i32 [ %30, %44 ], [ %47, %49 ], [ %58, %55 ], [ %66, %63 ]
%69 = icmp ne i32 %68, 0
%70 = icmp sgt i32 %23, 0
%71 = and i1 %70, %69
br i1 %71, label %72, label %74
72: ; preds = %67
%73 = call i32 @close(i32 %23)
br label %74
74: ; preds = %25, %59, %72, %67
%75 = phi i32 [ %68, %72 ], [ %68, %67 ], [ 0, %59 ], [ %28, %25 ]
ret i32 %75
}