#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ finalize(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int, char *);
void usage(char *name) {
  printf(
      "Usage: %s [keys]\n  -p, --pid pid         Pid of traced process\n  -s, "
      "--script {file}   Path to script starting/stopping helpers\n  -u, --up "
      "{command}    Script command to bring helpers up\n  -d, --down {command} "
      " Script command to bring helpers down\n  -t, --timeout seconds "
      "Inactivity timeout before bringing helpers down (default is %d)\n  -l, "
      "--logfile {log}   File to save log of nethelperd\n  -v, --verbose       "
      "  Log actions to console\n  -f, --pidfile {file}  Pidfile to avoid "
      "several instances of same nethelperd staring\n  -b, --background      "
      "Go to background after startup\n  -h, --help            This help "
      "message\n  Example: %s --pid `pidof httpd` --script "
      "/media/DISK_A1/system/etc/init.d/S90extended_webface --up start_servers "
      "--down stop_servers --timeout 60\n  This will run "
      "/media/DISK_A1/system/etc/init.d/S90extended_webface start_servers on "
      "network activity of httpd process and run "
      "/media/DISK_A1/system/etc/init.d/S90extended_webface stop_servers after "
      "60 seconds of no network activity of httpd\n  Version 0.01, Soul Trace "
      "<S-trace@list.ru>, 14.11.2013\n",
      name, 300, name);
  finalize(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rcx
lea    0xec5(%rip),%rdi
mov    $0x12c,%edx
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <finalize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rcx
lea    0xed5(%rip),%rdi
mov    %rcx,%rsi
mov    $0x12c,%edx
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <finalize@plt>

LLVM IR (-O0):
@.str = [1070 x i8] c"Usage: %s [keys]\0A -p, --pid pid Pid of traced process\0A -s, --script {file} Path to script starting/stopping helpers\0A -u, --up {command} Script command to bring helpers up\0A -d, --down {command} Script command to bring helpers down\0A -t, --timeout seconds Inactivity timeout before bringing helpers down (default is %d)\0A -l, --logfile {log} File to save log of nethelperd\0A -v, --verbose Log actions to console\0A -f, --pidfile {file} Pidfile to avoid several instances of same nethelperd staring\0A -b, --background Go to background after startup\0A -h, --help This help message\0A Example: %s --pid `pidof httpd` --script /media/DISK_A1/system/etc/init.d/S90extended_webface --up start_servers --down stop_servers --timeout 60\0A This will run /media/DISK_A1/system/etc/init.d/S90extended_webface start_servers on network activity of httpd process and run /media/DISK_A1/system/etc/init.d/S90extended_webface stop_servers after 60 seconds of no network activity of httpd\0A Version 0.01, Soul Trace <S-trace@list.ru>, 14.11.2013\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([1070 x i8], [1070 x i8]* @.str, i64 0, i64 0), i8* %3, i32 300, i8* %4)
%6 = load i32, i32* @EXIT_SUCCESS
%7 = call i32 @finalize(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [1070 x i8] c"Usage: %s [keys]\0A -p, --pid pid Pid of traced process\0A -s, --script {file} Path to script starting/stopping helpers\0A -u, --up {command} Script command to bring helpers up\0A -d, --down {command} Script command to bring helpers down\0A -t, --timeout seconds Inactivity timeout before bringing helpers down (default is %d)\0A -l, --logfile {log} File to save log of nethelperd\0A -v, --verbose Log actions to console\0A -f, --pidfile {file} Pidfile to avoid several instances of same nethelperd staring\0A -b, --background Go to background after startup\0A -h, --help This help message\0A Example: %s --pid `pidof httpd` --script /media/DISK_A1/system/etc/init.d/S90extended_webface --up start_servers --down stop_servers --timeout 60\0A This will run /media/DISK_A1/system/etc/init.d/S90extended_webface start_servers on network activity of httpd process and run /media/DISK_A1/system/etc/init.d/S90extended_webface stop_servers after 60 seconds of no network activity of httpd\0A Version 0.01, Soul Trace <S-trace@list.ru>, 14.11.2013\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([1070 x i8], [1070 x i8]* @.str, i64 0, i64 0), i8* %0, i32 300, i8* %0)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @finalize(i32 %3)
ret void
}