#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(int);
int /*<<< orphan*/ printf(char *, char const *, char *, char const *, char *,
                          char const *);
char *strrchr(char const *, char);
void usage(char const *cmd) {
  char const *name;
  name = strrchr(cmd, '/');
  name = (name == NULL) ? cmd : name + 1;
  printf(
      "%s (v%s) - simple process manager (for docker container)\n\nUsage: %s "
      "[options] cmd [args...] [ %s stop-cmd [args...] ]\n  -g: Send signals "
      "to process group.\n  -h: Show this help message and exit.\n\nThe "
      "stop-cmd runs with the additional environment variables\n  CMD_EXIT:   "
      "exit code of cmd.\n  CMD_KILLED: flag (0/1), if cmd was killed by %s.\n",
      name, "0.5", name, "---", name);
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1166 <usage+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1172 <usage+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x10(%rbp),%r9
lea    0xe73(%rip),%rdi
lea    0xfbf(%rip),%rdx
lea    0xfbc(%rip),%r8
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
lea    0xeb0(%rip),%rdi
lea    0xffc(%rip),%rdx
lea    0xff9(%rip),%r8
mov    %rcx,%rsi
mov    %rcx,%r9
call   1030 <printf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [339 x i8] c"%s (v%s) - simple process manager (for docker container)\0A\0AUsage: %s [options] cmd [args...] [ %s stop-cmd [args...] ]\0A -g: Send signals to process group.\0A -h: Show this help message and exit.\0A\0AThe stop-cmd runs with the additional environment variables\0A CMD_EXIT: exit code of cmd.\0A CMD_KILLED: flag (0/1), if cmd was killed by %s.\0A\00"
@.str.1 = [4 x i8] c"0.5\00"
@.str.2 = [4 x i8] c"---\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %9, %8 ], [ %12, %10 ]
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = load i8*, i8** %3
%17 = load i8*, i8** %3
%18 = call i32 @printf(i8* getelementptr inbounds ([339 x i8], [339 x i8]* @.str, i64 0, i64 0), i8* %15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [339 x i8] c"%s (v%s) - simple process manager (for docker container)\0A\0AUsage: %s [options] cmd [args...] [ %s stop-cmd [args...] ]\0A -g: Send signals to process group.\0A -h: Show this help message and exit.\0A\0AThe stop-cmd runs with the additional environment variables\0A CMD_EXIT: exit code of cmd.\0A CMD_KILLED: flag (0/1), if cmd was killed by %s.\0A\00"
@.str.1 = [4 x i8] c"0.5\00"
@.str.2 = [4 x i8] c"---\00"
define void @usage(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([339 x i8], [339 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 2)
unreachable
}