#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*/ fprintf(int /*<<< orphan*/, char *, int, int, char *, char *,
                           char *);
int /*<<< orphan*/ stderr;
int help() {
  fprintf(
      stderr,
      "Usage: niet /usr/bin/someprogram foo bar\n"
      "          - Runs someprogram with the arguments 'foo' and 'bar', "
      "restarting the program again if it\n"
      "            dies, waiting for up to %ds if it's dying in less than %ds. "
      "Sends output from the program\n"
      "            on its stdout and stderr to syslog using `logger`.  If sent "
      "a TERM signal, sends a TERM\n"
      "            signal to the program, waits for it to finish, and then "
      "restarts it.  If sent a QUIT\n"
      "            signal, sends a TERM signal to the program, waits for it to "
      "finish, and then quits.\n"
      "\n"
      "            niet requires no privileges and should be run as the user "
      "you want to run the daemon under.\n"
      "            It can be run as root, but running your daemons as root is "
      "generally discouraged.\n"
      "\n"
      "Options: -o daemon.notice  Changes the log priority of the syslog "
      "messages logged from the program's\n"
      "                           stdout to 'daemon.notice'.  Default: %s.\n"
      "         -e daemon.alert   Changes the log priority of the syslog "
      "messages logged from the program's\n"
      "                           stderr to 'daemon.alert'.  Default: %s.\n"
      "         -t syslog_tag     Changes the syslog tag of the syslog "
      "messages logged from the program's\n"
      "                           stdout & stderr to 'syslog_tag'.  Default: "
      "the program's command name.\n"
      "         -k 15             Sets a timeout of 15 seconds after the "
      "program is sent a TERM signal,\n"
      "                           after which it will be killed by a KILL "
      "signal.  Default: no KILL signal.\n"
      "         -p /var/run/x.pid Writes the PID of this process to "
      "/var/run/x.pid.  Default: no PID file.\n"
      "                           The use of PID files is discouraged: they're "
      "just another thing to go\n"
      "                           wrong.  niet is designed to be controlled "
      "entirely using signals, which\n"
      "                           you can use without PID files, eg. `killall "
      "niet` or `killall -QUIT niet`;\n"
      "                           you can tell when niet (and therefore the "
      "supervised program) has\n"
      "                           terminated because there's nothing left to "
      "kill.\n"
      "         -c /cd/to/here    Changes to this directory before running the "
      "command.  Default: %s.\n",
      60, 60, "user.info", "user.err", "/");
  return 100;
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    0xed8(%rip),%rsi
mov    $0x3c,%ecx
lea    0x171f(%rip),%r8
lea    0x1722(%rip),%r9
lea    0x1724(%rip),%rax
mov    %ecx,%edx
mov    %rax,(%rsp)
call   1030 <fprintf@plt>
mov    $0x64,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0x1745(%rip),%rax
mov    %rax,(%rsp)
lea    0xed4(%rip),%rsi
lea    0x1720(%rip),%r8
lea    0x1723(%rip),%r9
mov    $0x3c,%edx
mov    $0x3c,%ecx
call   1030 <fprintf@plt>
mov    $0x64,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2131 x i8] c"Usage: niet /usr/bin/someprogram foo bar\0A - Runs someprogram with the arguments 'foo' and 'bar', restarting the program again if it\0A dies, waiting for up to %ds if it's dying in less than %ds. Sends output from the program\0A on its stdout and stderr to syslog using `logger`. If sent a TERM signal, sends a TERM\0A signal to the program, waits for it to finish, and then restarts it. If sent a QUIT\0A signal, sends a TERM signal to the program, waits for it to finish, and then quits.\0A\0A niet requires no privileges and should be run as the user you want to run the daemon under.\0A It can be run as root, but running your daemons as root is generally discouraged.\0A\0AOptions: -o daemon.notice Changes the log priority of the syslog messages logged from the program's\0A stdout to 'daemon.notice'. Default: %s.\0A -e daemon.alert Changes the log priority of the syslog messages logged from the program's\0A stderr to 'daemon.alert'. Default: %s.\0A -t syslog_tag Changes the syslog tag of the syslog messages logged from the program's\0A stdout & stderr to 'syslog_tag'. Default: the program's command name.\0A -k 15 Sets a timeout of 15 seconds after the program is sent a TERM signal,\0A after which it will be killed by a KILL signal. Default: no KILL signal.\0A -p /var/run/x.pid Writes the PID of this process to /var/run/x.pid. Default: no PID file.\0A The use of PID files is discouraged: they're just another thing to go\0A wrong. niet is designed to be controlled entirely using signals, which\0A you can use without PID files, eg. `killall niet` or `killall -QUIT niet`;\0A you can tell when niet (and therefore the supervised program) has\0A terminated because there's nothing left to kill.\0A -c /cd/to/here Changes to this directory before running the command. Default: %s.\0A\00"
@.str.1 = [10 x i8] c"user.info\00"
@.str.2 = [9 x i8] c"user.err\00"
@.str.3 = [2 x i8] c"/\00"
define i32 @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2131 x i8], [2131 x i8]* @.str, i64 0, i64 0), i32 60, i32 60, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 100
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2131 x i8] c"Usage: niet /usr/bin/someprogram foo bar\0A - Runs someprogram with the arguments 'foo' and 'bar', restarting the program again if it\0A dies, waiting for up to %ds if it's dying in less than %ds. Sends output from the program\0A on its stdout and stderr to syslog using `logger`. If sent a TERM signal, sends a TERM\0A signal to the program, waits for it to finish, and then restarts it. If sent a QUIT\0A signal, sends a TERM signal to the program, waits for it to finish, and then quits.\0A\0A niet requires no privileges and should be run as the user you want to run the daemon under.\0A It can be run as root, but running your daemons as root is generally discouraged.\0A\0AOptions: -o daemon.notice Changes the log priority of the syslog messages logged from the program's\0A stdout to 'daemon.notice'. Default: %s.\0A -e daemon.alert Changes the log priority of the syslog messages logged from the program's\0A stderr to 'daemon.alert'. Default: %s.\0A -t syslog_tag Changes the syslog tag of the syslog messages logged from the program's\0A stdout & stderr to 'syslog_tag'. Default: the program's command name.\0A -k 15 Sets a timeout of 15 seconds after the program is sent a TERM signal,\0A after which it will be killed by a KILL signal. Default: no KILL signal.\0A -p /var/run/x.pid Writes the PID of this process to /var/run/x.pid. Default: no PID file.\0A The use of PID files is discouraged: they're just another thing to go\0A wrong. niet is designed to be controlled entirely using signals, which\0A you can use without PID files, eg. `killall niet` or `killall -QUIT niet`;\0A you can tell when niet (and therefore the supervised program) has\0A terminated because there's nothing left to kill.\0A -c /cd/to/here Changes to this directory before running the command. Default: %s.\0A\00"
@.str.1 = [10 x i8] c"user.info\00"
@.str.2 = [9 x i8] c"user.err\00"
@.str.3 = [2 x i8] c"/\00"
define i32 @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2131 x i8], [2131 x i8]* @.str, i64 0, i64 0), i32 60, i32 60, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 100
}