#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 *, char const *);
int /*<<< orphan*/ stderr;
void print_usage(const char *name) {
  const char *usage =
      "\n    -h|--help                     Print this message\n    <command> "
      "-h                  Print command specific help\n\n    create <name> "
      "[--id=<id>]     Create a new walnut (optional telephony id)\n    "
      "destroy <name> [name ...]     Completely removes a walnut (deletes "
      "FS)\n    next/prev                     Select next/prev walnut as "
      "foreground\n    list [--all|--running|--zombie]\n                       "
      "           List walnuts (default: --all)\n\n    start <name> [options]  "
      "      Start a walnut (see start -h for options)\n    stop <name>        "
      "           Stop a walnut\n    switch <name>                 Switch to a "
      "walnut\n    console <name>                Open a walnut's console\n\n   "
      " autostart <name> [on|off]     Set/Get a walnut's autostart "
      "configuration\n    autoswitch <name> [on|off]    Set/Get a walnut's "
      "autoswitch configuration\n    getid <name>                  Print a "
      "walnut's telephony ID\n    setid <name> <id>             Set a walnut's "
      "telephony ID\n    getactive                     Print the name of the "
      "active walnut\n    mount <name> [--all]          Mount a walnut's "
      "filesystem\n    unmount <name>                Unmount a walnut's "
      "filesystem\n    runcmd <name> <cmd> [args...] Run the command <cmd> in "
      "walnut <name>\n";
  fprintf(stderr, "Usage: %s [options]\n", name);
  fprintf(stderr, "%s", usage);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x1393(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0x138f(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0x13aa(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0x13b1(%rip),%rsi
lea    0xec7(%rip),%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [1230 x i8] c"\0A -h|--help Print this message\0A <command> -h Print command specific help\0A\0A create <name> [--id=<id>] Create a new walnut (optional telephony id)\0A destroy <name> [name ...] Completely removes a walnut (deletes FS)\0A next/prev Select next/prev walnut as foreground\0A list [--all|--running|--zombie]\0A List walnuts (default: --all)\0A\0A start <name> [options] Start a walnut (see start -h for options)\0A stop <name> Stop a walnut\0A switch <name> Switch to a walnut\0A console <name> Open a walnut's console\0A\0A autostart <name> [on|off] Set/Get a walnut's autostart configuration\0A autoswitch <name> [on|off] Set/Get a walnut's autoswitch configuration\0A getid <name> Print a walnut's telephony ID\0A setid <name> <id> Set a walnut's telephony ID\0A getactive Print the name of the active walnut\0A mount <name> [--all] Mount a walnut's filesystem\0A unmount <name> Unmount a walnut's filesystem\0A runcmd <name> <cmd> [args...] Run the command <cmd> in walnut <name>\0A\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([1230 x i8], [1230 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [1230 x i8] c"\0A -h|--help Print this message\0A <command> -h Print command specific help\0A\0A create <name> [--id=<id>] Create a new walnut (optional telephony id)\0A destroy <name> [name ...] Completely removes a walnut (deletes FS)\0A next/prev Select next/prev walnut as foreground\0A list [--all|--running|--zombie]\0A List walnuts (default: --all)\0A\0A start <name> [options] Start a walnut (see start -h for options)\0A stop <name> Stop a walnut\0A switch <name> Switch to a walnut\0A console <name> Open a walnut's console\0A\0A autostart <name> [on|off] Set/Get a walnut's autostart configuration\0A autoswitch <name> [on|off] Set/Get a walnut's autoswitch configuration\0A getid <name> Print a walnut's telephony ID\0A setid <name> <id> Set a walnut's telephony ID\0A getactive Print the name of the active walnut\0A mount <name> [--all] Mount a walnut's filesystem\0A unmount <name> Unmount a walnut's filesystem\0A runcmd <name> <cmd> [args...] Run the command <cmd> in walnut <name>\0A\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Usage: %s [options]\0A\00"
@.str.2 = [3 x i8] c"%s\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1230 x i8], [1230 x i8]* @.str, i64 0, i64 0))
ret void
}