#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*/ printf(char *, ...);
void showUsage() {
  printf("daemonizer %s (%s) by <hanbing0715@gmail.com>\n\n", "0.2",
         "2016-3-30");
  printf("A tool can run any program in daemon,\n");
  printf("and can set some resource limit in command line.\n\n");
  printf("Usage:daemonizer --run <prog_file> [options...]\n\n");
  printf("--run <prog_file>\tThe program want to run in daemon.\n");
  printf("--core\t\t\tEnable coredump for daemon program.\n");
  printf("--fds <max_open_fd>\tSet max number of file descriptors for daemon "
         "program.\n");
  printf(
      "--stack <stack_size>\tSet stack size of daemon program(in KiByte).\n");
  printf("--workdir <work_dir>\tSet daemon program work directory.\n");
  printf("--stdout <stdout_file>\tRedirect stdout to file.\n");
  printf("--stderr <stderr_file>\tRedirect stderr to file.\n");
  return;
}


x86 assembly (clang, -O0):
<showUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf0e(%rip),%rsi
lea    0xf0b(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1024(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x104f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1072(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<showUsage>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf01(%rip),%rsi
lea    0xefe(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
lea    0xf14(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf88(%rip),%rdi
call   1030 <puts@plt>
lea    0xfa9(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe8(%rip),%rdi
call   1030 <puts@plt>
lea    0x101e(%rip),%rdi
call   1030 <puts@plt>
lea    0x104a(%rip),%rdi
call   1030 <puts@plt>
lea    0x106e(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"daemonizer %s (%s) by <hanbing0715@gmail.com>\0A\0A\00"
@.str.1 = [4 x i8] c"0.2\00"
@.str.2 = [10 x i8] c"2016-3-30\00"
@.str.3 = [39 x i8] c"A tool can run any program in daemon,\0A\00"
@.str.4 = [51 x i8] c"and can set some resource limit in command line.\0A\0A\00"
@.str.5 = [50 x i8] c"Usage:daemonizer --run <prog_file> [options...]\0A\0A\00"
@.str.6 = [54 x i8] c"--run <prog_file>\09The program want to run in daemon.\0A\00"
@.str.7 = [46 x i8] c"--core\09\09\09Enable coredump for daemon program.\0A\00"
@.str.8 = [76 x i8] c"--fds <max_open_fd>\09Set max number of file descriptors for daemon program.\0A\00"
@.str.9 = [67 x i8] c"--stack <stack_size>\09Set stack size of daemon program(in KiByte).\0A\00"
@.str.10 = [57 x i8] c"--workdir <work_dir>\09Set daemon program work directory.\0A\00"
@.str.11 = [49 x i8] c"--stdout <stdout_file>\09Redirect stdout to file.\0A\00"
@.str.12 = [49 x i8] c"--stderr <stderr_file>\09Redirect stderr to file.\0A\00"
define void @showUsage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.8, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.10, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.12, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"daemonizer %s (%s) by <hanbing0715@gmail.com>\0A\0A\00"
@.str.1 = [4 x i8] c"0.2\00"
@.str.2 = [10 x i8] c"2016-3-30\00"
@str = [38 x i8] c"A tool can run any program in daemon,\00"
@str.13 = [50 x i8] c"and can set some resource limit in command line.\0A\00"
@str.14 = [49 x i8] c"Usage:daemonizer --run <prog_file> [options...]\0A\00"
@str.15 = [53 x i8] c"--run <prog_file>\09The program want to run in daemon.\00"
@str.16 = [45 x i8] c"--core\09\09\09Enable coredump for daemon program.\00"
@str.17 = [75 x i8] c"--fds <max_open_fd>\09Set max number of file descriptors for daemon program.\00"
@str.18 = [66 x i8] c"--stack <stack_size>\09Set stack size of daemon program(in KiByte).\00"
@str.19 = [56 x i8] c"--workdir <work_dir>\09Set daemon program work directory.\00"
@str.20 = [48 x i8] c"--stdout <stdout_file>\09Redirect stdout to file.\00"
@str.21 = [48 x i8] c"--stderr <stderr_file>\09Redirect stderr to file.\00"
define void @showUsage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.13, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.14, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.15, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.16, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.17, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str.18, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.19, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.20, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.21, i64 0, i64 0))
ret void
}