#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 sigaction {
  scalar_t__ sa_flags;
  int /*<<< orphan*/ sa_mask;
  int /*<<< orphan*/ sa_handler;
};
struct rlimit {
  int rlim_max;
};
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ LOG_CONS;
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ RLIMIT_NOFILE;
int RLIM_INFINITY;
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ SIG_IGN;
scalar_t__ chdir(char *);
int /*<<< orphan*/ close(int);
int dup(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
scalar_t__ fork();
scalar_t__ getrlimit(int /*<<< orphan*/, struct rlimit *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ openlog(char const *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ setsid();
scalar_t__ sigaction(int /*<<< orphan*/, struct sigaction *,
                     int /*<<< orphan*/ *);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int, int, int);
int /*<<< orphan*/ umask(int /*<<< orphan*/);
void daemonize(const char *cmd) {
  int i, fd0, fd1, fd2;
  pid_t pid;
  struct rlimit rl;
  struct sigaction sa;
  umask(0);
  if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
    perror("can't get file limit");
    exit(1);
  }
  if ((pid = fork()) < 0) {
    perror("can't fork");
    exit(1);
  } else if (pid != 0) {
    exit(0);
  }
  sleep(1);
  if (setsid() < 0)
    exit(1);
  sa.sa_handler = SIG_IGN;
  sigemptyset(&sa.sa_mask);
  sa.sa_flags = 0;
  if (sigaction(SIGHUP, &sa, NULL) < 0) {
    perror("can't ignore SIGHUP");
    exit(1);
  }
  if ((pid = fork()) < 0) {
    perror("can't fork");
    exit(1);
  } else if (pid != 0) {
    exit(0);
  }
  sleep(1);
  if (chdir("/") < 0) {
    perror("can't chdir");
    exit(1);
  }
  if (rl.rlim_max == RLIM_INFINITY) {
    rl.rlim_max = 1024;
  }
  for (i = 0; i < rl.rlim_max; i++)
    close(i);
  fd0 = open("/dev/null", O_RDWR);
  fd1 = dup(0);
  fd2 = dup(0);
  openlog(cmd, LOG_CONS, LOG_DAEMON);
  if (fd0 != 0 || fd1 != 1 || fd2 != 2) {
    syslog(LOG_ERR, "unexpected file descriptors %d %d %d", fd0, fd1, fd2);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<daemonize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1090 <umask@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
lea    -0x28(%rbp),%rsi
call   10f0 <getrlimit@plt>
cmp    $0x0,%rax
jge    1235 <daemonize+0x45>
lea    0xdda(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    $0x0,%al
call   1110 <fork@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jge    1260 <daemonize+0x70>
lea    0xdc4(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
cmpq   $0x0,-0x20(%rbp)
je     1272 <daemonize+0x82>
xor    %edi,%edi
call   10e0 <exit@plt>
jmp    1277 <daemonize+0x87>
mov    $0x1,%edi
call   1100 <sleep@plt>
mov    $0x0,%al
call   1070 <setsid@plt>
cmp    $0x0,%rax
jge    129c <daemonize+0xac>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x38(%rbp),%rdi
add    $0x8,%rdi
call   1080 <sigemptyset@plt>
movq   $0x0,-0x38(%rbp)
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
lea    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
cmp    $0x0,%rax
jge    12f3 <daemonize+0x103>
lea    0xd3c(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    $0x0,%al
call   1110 <fork@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jge    131e <daemonize+0x12e>
lea    0xd06(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
cmpq   $0x0,-0x20(%rbp)
je     1330 <daemonize+0x140>
xor    %edi,%edi
call   10e0 <exit@plt>
jmp    1335 <daemonize+0x145>
mov    $0x1,%edi
call   1100 <sleep@plt>
lea    0xcee(%rip),%rdi
call   1040 <chdir@plt>
cmp    $0x0,%rax
jge    136b <daemonize+0x17b>
lea    0xcda(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    -0x28(%rbp),%eax
mov    0x2c3b(%rip),%rcx
cmp    (%rcx),%eax
jne    1384 <daemonize+0x194>
movl   $0x400,-0x28(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    13ad <daemonize+0x1bd>
mov    -0xc(%rbp),%edi
call   1060 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    138b <daemonize+0x19b>
mov    0x2c2c(%rip),%rax
mov    (%rax),%esi
lea    0xc85(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,-0x10(%rbp)
xor    %edi,%edi
call   1050 <dup@plt>
mov    %eax,-0x14(%rbp)
xor    %edi,%edi
call   1050 <dup@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2bd4(%rip),%rax
mov    (%rax),%esi
mov    0x2beb(%rip),%rax
mov    (%rax),%edx
call   10d0 <openlog@plt>
cmpl   $0x0,-0x10(%rbp)
jne    1412 <daemonize+0x222>
cmpl   $0x1,-0x14(%rbp)
jne    1412 <daemonize+0x222>
cmpl   $0x2,-0x18(%rbp)
je     143b <daemonize+0x24b>
mov    0x2b87(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xc20(%rip),%rsi
call   10a0 <syslog@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%r14
xor    %edi,%edi
call   1090 <umask@plt>
mov    0x2dc5(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   10f0 <getrlimit@plt>
test   %rax,%rax
js     135d <daemonize+0x16d>
xor    %eax,%eax
call   1110 <fork@plt>
test   %rax,%rax
js     134d <daemonize+0x15d>
jne    1356 <daemonize+0x166>
mov    $0x1,%edi
call   1100 <sleep@plt>
xor    %eax,%eax
call   1070 <setsid@plt>
test   %rax,%rax
js     1366 <daemonize+0x176>
mov    0x2d73(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x14(%rsp)
lea    0x10(%rsp),%rdi
call   1080 <sigemptyset@plt>
movq   $0x0,0x8(%rsp)
mov    0x2d7b(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
test   %rax,%rax
js     1370 <daemonize+0x180>
xor    %eax,%eax
call   1110 <fork@plt>
test   %rax,%rax
js     134d <daemonize+0x15d>
jne    1356 <daemonize+0x166>
mov    $0x1,%edi
call   1100 <sleep@plt>
lea    0xd81(%rip),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
js     1379 <daemonize+0x189>
mov    (%rsp),%eax
mov    0x2ce5(%rip),%rcx
cmp    (%rcx),%eax
jne    12d8 <daemonize+0xe8>
movl   $0x400,(%rsp)
jmp    12dc <daemonize+0xec>
test   %eax,%eax
jle    12ef <daemonize+0xff>
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %ebx,%edi
call   1060 <close@plt>
add    $0x1,%ebx
cmp    (%rsp),%ebx
jl     12e0 <daemonize+0xf0>
mov    0x2cea(%rip),%rax
mov    (%rax),%esi
lea    0xd43(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,%r15d
xor    %edi,%edi
call   1050 <dup@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <dup@plt>
mov    %eax,%ebp
mov    0x2c98(%rip),%rax
mov    (%rax),%esi
mov    0x2caf(%rip),%rax
mov    (%rax),%edx
mov    %r14,%rdi
call   10d0 <openlog@plt>
test   %r15d,%r15d
jne    138f <daemonize+0x19f>
cmp    $0x1,%ebx
jne    138f <daemonize+0x19f>
cmp    $0x2,%ebp
jne    138f <daemonize+0x19f>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcc1(%rip),%rdi
jmp    1380 <daemonize+0x190>
xor    %edi,%edi
call   10e0 <exit@plt>
lea    0xc9c(%rip),%rdi
jmp    1380 <daemonize+0x190>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    0xca9(%rip),%rdi
jmp    1380 <daemonize+0x190>
lea    0xcb6(%rip),%rdi
call   10c0 <perror@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
mov    0x2c0a(%rip),%rax
mov    (%rax),%edi
lea    0xcad(%rip),%rsi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
call   10a0 <syslog@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32 }
%struct.sigaction = type { i64, i32, i32 }
@RLIMIT_NOFILE = global i32 0
@.str = [21 x i8] c"can't get file limit\00"
@.str.1 = [11 x i8] c"can't fork\00"
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
@.str.2 = [20 x i8] c"can't ignore SIGHUP\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [12 x i8] c"can't chdir\00"
@RLIM_INFINITY = global i32 0
@.str.5 = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@LOG_CONS = global i32 0
@LOG_DAEMON = global i32 0
@LOG_ERR = global i32 0
@.str.6 = [37 x i8] c"unexpected file descriptors %d %d %d\00"
define void @daemonize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca %struct.rlimit
%9 = alloca %struct.sigaction
store i8* %0, i8** %2
%10 = call i32 @umask(i32 0)
%11 = load i32, i32* @RLIMIT_NOFILE
%12 = call i64 @getrlimit(i32 %11, %struct.rlimit* %8)
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %1
%18 = call i64 (...) @fork()
store i64 %18, i64* %7
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %17
%24 = load i64, i64* %7
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @exit(i32 0)
unreachable
28: ; preds = %23
br label %29
29: ; preds = %28
%30 = call i32 @sleep(i32 1)
%31 = call i64 (...) @setsid()
%32 = icmp slt i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 @exit(i32 1)
unreachable
35: ; preds = %29
%36 = load i32, i32* @SIG_IGN
%37 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %9, i32 0, i32 2
store i32 %36, i32* %37
%38 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %9, i32 0, i32 1
%39 = call i32 @sigemptyset(i32* %38)
%40 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %9, i32 0, i32 0
store i64 0, i64* %40
%41 = load i32, i32* @SIGHUP
%42 = call i64 @sigaction(i32 %41, %struct.sigaction* %9, i32* null)
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %35
%45 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %35
%48 = call i64 (...) @fork()
store i64 %48, i64* %7
%49 = icmp slt i64 %48, 0
br i1 %49, label %50, label %53
50: ; preds = %47
%51 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%52 = call i32 @exit(i32 1)
unreachable
53: ; preds = %47
%54 = load i64, i64* %7
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %53
%57 = call i32 @exit(i32 0)
unreachable
58: ; preds = %53
br label %59
59: ; preds = %58
%60 = call i32 @sleep(i32 1)
%61 = call i64 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%62 = icmp slt i64 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%65 = call i32 @exit(i32 1)
unreachable
66: ; preds = %59
%67 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %8, i32 0, i32 0
%68 = load i32, i32* %67
%69 = load i32, i32* @RLIM_INFINITY
%70 = icmp eq i32 %68, %69
br i1 %70, label %71, label %73
71: ; preds = %66
%72 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %8, i32 0, i32 0
store i32 1024, i32* %72
br label %73
73: ; preds = %71, %66
store i32 0, i32* %3
br label %74
74: ; preds = %82, %73
%75 = load i32, i32* %3
%76 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %8, i32 0, i32 0
%77 = load i32, i32* %76
%78 = icmp slt i32 %75, %77
br i1 %78, label %79, label %85
79: ; preds = %74
%80 = load i32, i32* %3
%81 = call i32 @close(i32 %80)
br label %82
82: ; preds = %79
%83 = load i32, i32* %3
%84 = add nsw i32 %83, 1
store i32 %84, i32* %3
br label %74
85: ; preds = %74
%86 = load i32, i32* @O_RDWR
%87 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %86)
store i32 %87, i32* %4
%88 = call i32 @dup(i32 0)
store i32 %88, i32* %5
%89 = call i32 @dup(i32 0)
store i32 %89, i32* %6
%90 = load i8*, i8** %2
%91 = load i32, i32* @LOG_CONS
%92 = load i32, i32* @LOG_DAEMON
%93 = call i32 @openlog(i8* %90, i32 %91, i32 %92)
%94 = load i32, i32* %4
%95 = icmp ne i32 %94, 0
br i1 %95, label %102, label %96
96: ; preds = %85
%97 = load i32, i32* %5
%98 = icmp ne i32 %97, 1
br i1 %98, label %102, label %99
99: ; preds = %96
%100 = load i32, i32* %6
%101 = icmp ne i32 %100, 2
br i1 %101, label %102, label %109
102: ; preds = %99, %96, %85
%103 = load i32, i32* @LOG_ERR
%104 = load i32, i32* %4
%105 = load i32, i32* %5
%106 = load i32, i32* %6
%107 = call i32 @syslog(i32 %103, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %104, i32 %105, i32 %106)
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %99
ret void
}

LLVM IR (-O2):
%struct.rlimit = type { i32 }
%struct.sigaction = type { i64, i32, i32 }
@RLIMIT_NOFILE = global i32 0
@.str = [21 x i8] c"can't get file limit\00"
@.str.1 = [11 x i8] c"can't fork\00"
@SIG_IGN = global i32 0
@SIGHUP = global i32 0
@.str.2 = [20 x i8] c"can't ignore SIGHUP\00"
@.str.3 = [2 x i8] c"/\00"
@.str.4 = [12 x i8] c"can't chdir\00"
@RLIM_INFINITY = global i32 0
@.str.5 = [10 x i8] c"/dev/null\00"
@O_RDWR = global i32 0
@LOG_CONS = global i32 0
@LOG_DAEMON = global i32 0
@LOG_ERR = global i32 0
@.str.6 = [37 x i8] c"unexpected file descriptors %d %d %d\00"
define void @daemonize(i8* %0) {
%2 = alloca %struct.rlimit
%3 = alloca %struct.sigaction
%4 = bitcast %struct.rlimit* %2 to i8*
%5 = bitcast %struct.sigaction* %3 to i8*
%6 = tail call i32 @umask(i32 0)
%7 = load i32, i32* @RLIMIT_NOFILE
%8 = call i64 @getrlimit(i32 %7, %struct.rlimit* %2)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = call i64 (...) @fork()
%15 = icmp slt i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %13
%20 = icmp eq i64 %14, 0
br i1 %20, label %23, label %21
21: ; preds = %19
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %19
%24 = call i32 @sleep(i32 1)
%25 = call i64 (...) @setsid()
%26 = icmp slt i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %23
%30 = load i32, i32* @SIG_IGN
%31 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 2
store i32 %30, i32* %31
%32 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 1
%33 = call i32 @sigemptyset(i32* %32)
%34 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store i64 0, i64* %34
%35 = load i32, i32* @SIGHUP
%36 = call i64 @sigaction(i32 %35, %struct.sigaction* %3, i32* null)
%37 = icmp slt i64 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %29
%39 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %29
%42 = call i64 (...) @fork()
%43 = icmp slt i64 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%46 = call i32 @exit(i32 1)
unreachable
47: ; preds = %41
%48 = icmp eq i64 %42, 0
br i1 %48, label %51, label %49
49: ; preds = %47
%50 = call i32 @exit(i32 0)
unreachable
51: ; preds = %47
%52 = call i32 @sleep(i32 1)
%53 = call i64 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%54 = icmp slt i64 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %51
%56 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%57 = call i32 @exit(i32 1)
unreachable
58: ; preds = %51
%59 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i64 0, i32 0
%60 = load i32, i32* %59
%61 = load i32, i32* @RLIM_INFINITY
%62 = icmp eq i32 %60, %61
br i1 %62, label %63, label %64
63: ; preds = %58
store i32 1024, i32* %59
br label %66
64: ; preds = %58
%65 = icmp sgt i32 %60, 0
br i1 %65, label %66, label %73
66: ; preds = %63, %64
br label %67
67: ; preds = %66, %67
%68 = phi i32 [ %70, %67 ], [ 0, %66 ]
%69 = call i32 @close(i32 %68)
%70 = add nuw nsw i32 %68, 1
%71 = load i32, i32* %59
%72 = icmp slt i32 %70, %71
br i1 %72, label %67, label %73
73: ; preds = %67, %64
%74 = load i32, i32* @O_RDWR
%75 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %74)
%76 = call i32 @dup(i32 0)
%77 = call i32 @dup(i32 0)
%78 = load i32, i32* @LOG_CONS
%79 = load i32, i32* @LOG_DAEMON
%80 = call i32 @openlog(i8* %0, i32 %78, i32 %79)
%81 = icmp ne i32 %75, 0
%82 = icmp ne i32 %76, 1
%83 = select i1 %81, i1 true, i1 %82
%84 = icmp ne i32 %77, 2
%85 = select i1 %83, i1 true, i1 %84
br i1 %85, label %86, label %90
86: ; preds = %73
%87 = load i32, i32* @LOG_ERR
%88 = call i32 @syslog(i32 %87, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %75, i32 %76, i32 %77)
%89 = call i32 @exit(i32 1)
unreachable
90: ; preds = %73
ret void
}