#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__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ STDOUT_FILENO;
scalar_t__ chdir(char *);
int /*<<< orphan*/ close(int);
scalar_t__ dup2(int, int /*<<< orphan*/);
int errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ mempig_log(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ mempig_log_set_use_syslog(int);
int open(char *, int /*<<< orphan*/);
int setsid();
int /*<<< orphan*/ strerror(int);
int /*<<< orphan*/ umask(int /*<<< orphan*/);
void daemonize_me(void) {
  pid_t pid;
  int sid, err, devnull_fd;
  pid = fork();
  if (pid < 0) {
    err = errno;
    mempig_log("fork failed: error %d (%s)\n", err, strerror(err));
    exit(EXIT_FAILURE);
  }
  if (pid > 0) {
    exit(EXIT_SUCCESS);
  }
  mempig_log_set_use_syslog(1);
  devnull_fd = open("/dev/null", O_RDONLY);
  if (devnull_fd < 0) {
    err = errno;
    mempig_log("daemonize_me: failed to open /dev/null: error %d (%s)\n", err,
               strerror(err));
    exit(EXIT_FAILURE);
  }
  umask(0);
  sid = setsid();
  if (sid < 0) {
    err = errno;
    mempig_log("daemonize_me: setsid failed: error %d (%s)\n", err,
               strerror(err));
    exit(EXIT_FAILURE);
  }
  if ((chdir("/")) < 0) {
    err = errno;
    mempig_log("daemonize_me: chdir(/) failed: error %d (%s)\n", err,
               strerror(err));
    exit(EXIT_FAILURE);
  }
  if (dup2(devnull_fd, STDIN_FILENO) < 0) {
    err = errno;
    mempig_log("daemonize_me: failed to dup /dev/null to stdin: "
               "error %d (%s)\n",
               err, strerror(err));
    exit(EXIT_FAILURE);
  }
  if (dup2(devnull_fd, STDOUT_FILENO) < 0) {
    err = errno;
    mempig_log("daemonize_me: failed to dup /dev/null to stdout: "
               "error %d (%s)\n",
               err, strerror(err));
    exit(EXIT_FAILURE);
  }
  if (dup2(devnull_fd, STDERR_FILENO) < 0) {
    err = errno;
    mempig_log("daemonize_me: failed to dup /dev/null to stderr: "
               "error %d (%s)\n",
               err, strerror(err));
    exit(EXIT_FAILURE);
  }
  close(devnull_fd);
}


x86 assembly (clang, -O0):
<daemonize_me>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   10d0 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1207 <daemonize_me+0x57>
mov    0x2dfb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x18(%rbp),%esi
mov    %eax,%edx
lea    0xe0c(%rip),%rdi
call   1030 <mempig_log@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
cmpq   $0x0,-0x8(%rbp)
jle    1220 <daemonize_me+0x70>
mov    0x2d9f(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    $0x1,%edi
call   1090 <mempig_log_set_use_syslog@plt>
mov    0x2daf(%rip),%rax
mov    (%rax),%esi
lea    0xde2(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1285 <daemonize_me+0xd5>
mov    0x2d7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x1c(%rbp),%esi
mov    %eax,%edx
lea    0xdb4(%rip),%rdi
call   1030 <mempig_log@plt>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
xor    %edi,%edi
call   1080 <umask@plt>
mov    $0x0,%al
call   1070 <setsid@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    12d9 <daemonize_me+0x129>
mov    0x2d29(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x20(%rbp),%esi
mov    %eax,%edx
lea    0xd97(%rip),%rdi
call   1030 <mempig_log@plt>
mov    0x2cee(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
lea    0xda9(%rip),%rdi
call   1040 <chdir@plt>
cmp    $0x0,%rax
jge    1328 <daemonize_me+0x178>
mov    0x2cda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x24(%rbp),%esi
mov    %eax,%edx
lea    0xd76(%rip),%rdi
call   1030 <mempig_log@plt>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x14(%rbp),%edi
mov    0x2c7e(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
cmp    $0x0,%rax
jge    137c <daemonize_me+0x1cc>
mov    0x2c86(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
lea    0xd50(%rip),%rdi
call   1030 <mempig_log@plt>
mov    0x2c4b(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x14(%rbp),%edi
mov    0x2c6a(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
cmp    $0x0,%rax
jge    13d0 <daemonize_me+0x220>
mov    0x2c32(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x2c(%rbp),%esi
mov    %eax,%edx
lea    0xd3b(%rip),%rdi
call   1030 <mempig_log@plt>
mov    0x2bf7(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x14(%rbp),%edi
mov    0x2bee(%rip),%rax
mov    (%rax),%esi
call   1050 <dup2@plt>
cmp    $0x0,%rax
jge    1424 <daemonize_me+0x274>
mov    0x2bde(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <strerror@plt>
mov    -0x30(%rbp),%esi
mov    %eax,%edx
lea    0xd27(%rip),%rdi
call   1030 <mempig_log@plt>
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize_me>:
push   %rbx
xor    %eax,%eax
call   10d0 <fork@plt>
test   %rax,%rax
js     126e <daemonize_me+0xbe>
jne    128a <daemonize_me+0xda>
mov    $0x1,%edi
call   1090 <mempig_log_set_use_syslog@plt>
mov    0x2e08(%rip),%rax
mov    (%rax),%esi
lea    0xe3b(%rip),%rdi
call   10a0 <open@plt>
test   %eax,%eax
js     1298 <daemonize_me+0xe8>
mov    %eax,%ebx
xor    %edi,%edi
call   1080 <umask@plt>
xor    %eax,%eax
call   1070 <setsid@plt>
test   %eax,%eax
js     12b1 <daemonize_me+0x101>
lea    0xe7c(%rip),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
js     12ca <daemonize_me+0x11a>
mov    0x2d8e(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1050 <dup2@plt>
test   %rax,%rax
js     12e3 <daemonize_me+0x133>
mov    0x2db5(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1050 <dup2@plt>
test   %rax,%rax
js     12fc <daemonize_me+0x14c>
mov    0x2d74(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1050 <dup2@plt>
test   %rax,%rax
js     1315 <daemonize_me+0x165>
mov    %ebx,%edi
pop    %rbx
jmp    1060 <close@plt>
mov    0x2d5b(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xd7b(%rip),%rdi
jmp    132c <daemonize_me+0x17c>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xd77(%rip),%rdi
jmp    132c <daemonize_me+0x17c>
mov    0x2d18(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xd95(%rip),%rdi
jmp    132c <daemonize_me+0x17c>
mov    0x2cff(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xdaa(%rip),%rdi
jmp    132c <daemonize_me+0x17c>
mov    0x2ce6(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xdbf(%rip),%rdi
jmp    132c <daemonize_me+0x17c>
mov    0x2ccd(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xde5(%rip),%rdi
jmp    132c <daemonize_me+0x17c>
mov    0x2cb4(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%edi
call   10c0 <strerror@plt>
lea    0xe0c(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <mempig_log@plt>
mov    0x2c84(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@errno = global i32 0
@.str = [28 x i8] c"fork failed: error %d (%s)\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.1 = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
@.str.2 = [55 x i8] c"daemonize_me: failed to open /dev/null: error %d (%s)\0A\00"
@.str.3 = [44 x i8] c"daemonize_me: setsid failed: error %d (%s)\0A\00"
@.str.4 = [2 x i8] c"/\00"
@.str.5 = [46 x i8] c"daemonize_me: chdir(/) failed: error %d (%s)\0A\00"
@STDIN_FILENO = global i32 0
@.str.6 = [63 x i8] c"daemonize_me: failed to dup /dev/null to stdin: error %d (%s)\0A\00"
@STDOUT_FILENO = global i32 0
@.str.7 = [64 x i8] c"daemonize_me: failed to dup /dev/null to stdout: error %d (%s)\0A\00"
@STDERR_FILENO = global i32 0
@.str.8 = [64 x i8] c"daemonize_me: failed to dup /dev/null to stderr: error %d (%s)\0A\00"
define void @daemonize_me() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i64 (...) @fork()
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = load i32, i32* @errno
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = call i32 @strerror(i32 %11)
%13 = call i32 @mempig_log(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %12)
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %0
%17 = load i64, i64* %1
%18 = icmp sgt i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* @EXIT_SUCCESS
%21 = call i32 @exit(i32 %20)
unreachable
22: ; preds = %16
%23 = call i32 @mempig_log_set_use_syslog(i32 1)
%24 = load i32, i32* @O_RDONLY
%25 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %24)
store i32 %25, i32* %4
%26 = load i32, i32* %4
%27 = icmp slt i32 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %22
%29 = load i32, i32* @errno
store i32 %29, i32* %3
%30 = load i32, i32* %3
%31 = load i32, i32* %3
%32 = call i32 @strerror(i32 %31)
%33 = call i32 @mempig_log(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 %30, i32 %32)
%34 = load i32, i32* @EXIT_FAILURE
%35 = call i32 @exit(i32 %34)
unreachable
36: ; preds = %22
%37 = call i32 @umask(i32 0)
%38 = call i32 (...) @setsid()
store i32 %38, i32* %2
%39 = load i32, i32* %2
%40 = icmp slt i32 %39, 0
br i1 %40, label %41, label %49
41: ; preds = %36
%42 = load i32, i32* @errno
store i32 %42, i32* %3
%43 = load i32, i32* %3
%44 = load i32, i32* %3
%45 = call i32 @strerror(i32 %44)
%46 = call i32 @mempig_log(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %43, i32 %45)
%47 = load i32, i32* @EXIT_FAILURE
%48 = call i32 @exit(i32 %47)
unreachable
49: ; preds = %36
%50 = call i64 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%51 = icmp slt i64 %50, 0
br i1 %51, label %52, label %60
52: ; preds = %49
%53 = load i32, i32* @errno
store i32 %53, i32* %3
%54 = load i32, i32* %3
%55 = load i32, i32* %3
%56 = call i32 @strerror(i32 %55)
%57 = call i32 @mempig_log(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %54, i32 %56)
%58 = load i32, i32* @EXIT_FAILURE
%59 = call i32 @exit(i32 %58)
unreachable
60: ; preds = %49
%61 = load i32, i32* %4
%62 = load i32, i32* @STDIN_FILENO
%63 = call i64 @dup2(i32 %61, i32 %62)
%64 = icmp slt i64 %63, 0
br i1 %64, label %65, label %73
65: ; preds = %60
%66 = load i32, i32* @errno
store i32 %66, i32* %3
%67 = load i32, i32* %3
%68 = load i32, i32* %3
%69 = call i32 @strerror(i32 %68)
%70 = call i32 @mempig_log(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), i32 %67, i32 %69)
%71 = load i32, i32* @EXIT_FAILURE
%72 = call i32 @exit(i32 %71)
unreachable
73: ; preds = %60
%74 = load i32, i32* %4
%75 = load i32, i32* @STDOUT_FILENO
%76 = call i64 @dup2(i32 %74, i32 %75)
%77 = icmp slt i64 %76, 0
br i1 %77, label %78, label %86
78: ; preds = %73
%79 = load i32, i32* @errno
store i32 %79, i32* %3
%80 = load i32, i32* %3
%81 = load i32, i32* %3
%82 = call i32 @strerror(i32 %81)
%83 = call i32 @mempig_log(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.7, i64 0, i64 0), i32 %80, i32 %82)
%84 = load i32, i32* @EXIT_FAILURE
%85 = call i32 @exit(i32 %84)
unreachable
86: ; preds = %73
%87 = load i32, i32* %4
%88 = load i32, i32* @STDERR_FILENO
%89 = call i64 @dup2(i32 %87, i32 %88)
%90 = icmp slt i64 %89, 0
br i1 %90, label %91, label %99
91: ; preds = %86
%92 = load i32, i32* @errno
store i32 %92, i32* %3
%93 = load i32, i32* %3
%94 = load i32, i32* %3
%95 = call i32 @strerror(i32 %94)
%96 = call i32 @mempig_log(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.8, i64 0, i64 0), i32 %93, i32 %95)
%97 = load i32, i32* @EXIT_FAILURE
%98 = call i32 @exit(i32 %97)
unreachable
99: ; preds = %86
%100 = load i32, i32* %4
%101 = call i32 @close(i32 %100)
ret void
}

LLVM IR (-O2):
@errno = global i32 0
@.str = [28 x i8] c"fork failed: error %d (%s)\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@.str.1 = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
@.str.2 = [55 x i8] c"daemonize_me: failed to open /dev/null: error %d (%s)\0A\00"
@.str.3 = [44 x i8] c"daemonize_me: setsid failed: error %d (%s)\0A\00"
@.str.4 = [2 x i8] c"/\00"
@.str.5 = [46 x i8] c"daemonize_me: chdir(/) failed: error %d (%s)\0A\00"
@STDIN_FILENO = global i32 0
@.str.6 = [63 x i8] c"daemonize_me: failed to dup /dev/null to stdin: error %d (%s)\0A\00"
@STDOUT_FILENO = global i32 0
@.str.7 = [64 x i8] c"daemonize_me: failed to dup /dev/null to stdout: error %d (%s)\0A\00"
@STDERR_FILENO = global i32 0
@.str.8 = [64 x i8] c"daemonize_me: failed to dup /dev/null to stderr: error %d (%s)\0A\00"
define void @daemonize_me() {
%1 = tail call i64 (...) @fork()
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @mempig_log(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
%10 = icmp eq i64 %1, 0
br i1 %10, label %14, label %11
11: ; preds = %9
%12 = load i32, i32* @EXIT_SUCCESS
%13 = tail call i32 @exit(i32 %12)
unreachable
14: ; preds = %9
%15 = tail call i32 @mempig_log_set_use_syslog(i32 1)
%16 = load i32, i32* @O_RDONLY
%17 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i32, i32* @errno
%21 = tail call i32 @strerror(i32 %20)
%22 = tail call i32 @mempig_log(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i32 %20, i32 %21)
%23 = load i32, i32* @EXIT_FAILURE
%24 = tail call i32 @exit(i32 %23)
unreachable
25: ; preds = %14
%26 = tail call i32 @umask(i32 0)
%27 = tail call i32 (...) @setsid()
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %25
%30 = load i32, i32* @errno
%31 = tail call i32 @strerror(i32 %30)
%32 = tail call i32 @mempig_log(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0), i32 %30, i32 %31)
%33 = load i32, i32* @EXIT_FAILURE
%34 = tail call i32 @exit(i32 %33)
unreachable
35: ; preds = %25
%36 = tail call i64 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %44
38: ; preds = %35
%39 = load i32, i32* @errno
%40 = tail call i32 @strerror(i32 %39)
%41 = tail call i32 @mempig_log(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i32 %39, i32 %40)
%42 = load i32, i32* @EXIT_FAILURE
%43 = tail call i32 @exit(i32 %42)
unreachable
44: ; preds = %35
%45 = load i32, i32* @STDIN_FILENO
%46 = tail call i64 @dup2(i32 %17, i32 %45)
%47 = icmp slt i64 %46, 0
br i1 %47, label %48, label %54
48: ; preds = %44
%49 = load i32, i32* @errno
%50 = tail call i32 @strerror(i32 %49)
%51 = tail call i32 @mempig_log(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0), i32 %49, i32 %50)
%52 = load i32, i32* @EXIT_FAILURE
%53 = tail call i32 @exit(i32 %52)
unreachable
54: ; preds = %44
%55 = load i32, i32* @STDOUT_FILENO
%56 = tail call i64 @dup2(i32 %17, i32 %55)
%57 = icmp slt i64 %56, 0
br i1 %57, label %58, label %64
58: ; preds = %54
%59 = load i32, i32* @errno
%60 = tail call i32 @strerror(i32 %59)
%61 = tail call i32 @mempig_log(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.7, i64 0, i64 0), i32 %59, i32 %60)
%62 = load i32, i32* @EXIT_FAILURE
%63 = tail call i32 @exit(i32 %62)
unreachable
64: ; preds = %54
%65 = load i32, i32* @STDERR_FILENO
%66 = tail call i64 @dup2(i32 %17, i32 %65)
%67 = icmp slt i64 %66, 0
br i1 %67, label %68, label %74
68: ; preds = %64
%69 = load i32, i32* @errno
%70 = tail call i32 @strerror(i32 %69)
%71 = tail call i32 @mempig_log(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.8, i64 0, i64 0), i32 %69, i32 %70)
%72 = load i32, i32* @EXIT_FAILURE
%73 = tail call i32 @exit(i32 %72)
unreachable
74: ; preds = %64
%75 = tail call i32 @close(i32 %17)
ret void
}