#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 */
char *basename(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(char *app) {
  fprintf(stderr, "%s, Ver %s.%s.%s\n", basename(app), "0", "2", "0");
  fprintf(stderr, "Usage: %s [-h] [-s bus_path]\n", app);
  fprintf(stderr, "-h: shows this help\n");
  fprintf(stderr, "-d: detach from terminal and run as daemon\n");
  fprintf(
      stderr,
      "-s bus_path: uses bus_path as bus path name (default: /tmp/ttybus)\n");
  fprintf(stderr, "-i init_string: send init string to plug's STDOUT\n\n");
  fprintf(stderr, "Please also see: tty_bus, tty_attach, tty_fake, dpipe\n");
  fprintf(stderr, "Example of usage:\n");
  fprintf(stderr, "  Create two tty_bus, one per machine\n");
  fprintf(stderr, "    mars:$ tty_bus -d -s /tmp/exported_ttybus\n");
  fprintf(stderr, "    venus:$ tty_bus -d -s /tmp/remote_ttybus\n");
  fprintf(stderr, "  On mars, attach the device to the local bus\n");
  fprintf(stderr,
          "    mars:$ tty_attach -d -s /tmp/exported_ttybus /dev/ttyUSB0\n");
  fprintf(stderr,
          "  On venus, prepare the fake tty device, on the same path,\n");
  fprintf(stderr, "  temporarly overriding the local /dev/ttyUSB0 device\n");
  fprintf(stderr,
          "    venus:$ tty_fake -d -s /tmp/remote_ttybus -o /dev/ttyUSB0\n");
  fprintf(stderr, "  Connect the two buses on the two hosts, using remote ssh "
                  "command and tty_plug\n");
  fprintf(stderr, "    venus:$ dpipe tty_plug -s /tmp/remote_ttybus = ssh mars "
                  "tty_plug -s /tmp/exported_ttybus\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <basename@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xea2(%rip),%rsi
lea    0xead(%rip),%r9
lea    0xea8(%rip),%r8
mov    %r9,%rcx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e48(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    0xe91(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e1a(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
lea    0xef0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dd5(%rip),%rax
mov    (%rax),%edi
lea    0xf10(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dbe(%rip),%rax
mov    (%rax),%edi
lea    0xf0c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
lea    0xf1c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
lea    0xf34(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
lea    0xf4b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
lea    0xf63(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d4b(%rip),%rax
mov    (%rax),%edi
lea    0xf8b(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d34(%rip),%rax
mov    (%rax),%edi
lea    0xfb0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d1d(%rip),%rax
mov    (%rax),%edi
lea    0xfd0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d06(%rip),%rax
mov    (%rax),%edi
lea    0xff8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2cef(%rip),%rax
mov    (%rax),%edi
lea    0x1032(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%ebp
call   1040 <basename@plt>
lea    0xeb3(%rip),%rsi
lea    0xec0(%rip),%r8
lea    0xeb7(%rip),%rcx
mov    %ebp,%edi
mov    %rax,%rdx
mov    %rcx,%r9
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xea2(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeac(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeb0(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xecb(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xefe(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf21(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf47(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf49(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf5f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf7d(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf9a(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xfb8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xfe6(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1011(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1037(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x1065(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0x10a5(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"%s, Ver %s.%s.%s\0A\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [30 x i8] c"Usage: %s [-h] [-s bus_path]\0A\00"
@.str.4 = [21 x i8] c"-h: shows this help\0A\00"
@.str.5 = [44 x i8] c"-d: detach from terminal and run as daemon\0A\00"
@.str.6 = [68 x i8] c"-s bus_path: uses bus_path as bus path name (default: /tmp/ttybus)\0A\00"
@.str.7 = [52 x i8] c"-i init_string: send init string to plug's STDOUT\0A\0A\00"
@.str.8 = [55 x i8] c"Please also see: tty_bus, tty_attach, tty_fake, dpipe\0A\00"
@.str.9 = [19 x i8] c"Example of usage:\0A\00"
@.str.10 = [39 x i8] c" Create two tty_bus, one per machine\0A\00"
@.str.11 = [47 x i8] c" mars:$ tty_bus -d -s /tmp/exported_ttybus\0A\00"
@.str.12 = [46 x i8] c" venus:$ tty_bus -d -s /tmp/remote_ttybus\0A\00"
@.str.13 = [47 x i8] c" On mars, attach the device to the local bus\0A\00"
@.str.14 = [63 x i8] c" mars:$ tty_attach -d -s /tmp/exported_ttybus /dev/ttyUSB0\0A\00"
@.str.15 = [60 x i8] c" On venus, prepare the fake tty device, on the same path,\0A\00"
@.str.16 = [55 x i8] c" temporarly overriding the local /dev/ttyUSB0 device\0A\00"
@.str.17 = [63 x i8] c" venus:$ tty_fake -d -s /tmp/remote_ttybus -o /dev/ttyUSB0\0A\00"
@.str.18 = [81 x i8] c" Connect the two buses on the two hosts, using remote ssh command and tty_plug\0A\00"
@.str.19 = [94 x i8] c" venus:$ dpipe tty_plug -s /tmp/remote_ttybus = ssh mars tty_plug -s /tmp/exported_ttybus\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i8* @basename(i8* %4)
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %2
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0))
%24 = load i32, i32* @stderr
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.11, i64 0, i64 0))
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.14, i64 0, i64 0))
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.15, i64 0, i64 0))
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.16, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.17, i64 0, i64 0))
%38 = load i32, i32* @stderr
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.18, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.19, i64 0, i64 0))
%42 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"%s, Ver %s.%s.%s\0A\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [2 x i8] c"2\00"
@.str.3 = [30 x i8] c"Usage: %s [-h] [-s bus_path]\0A\00"
@.str.4 = [21 x i8] c"-h: shows this help\0A\00"
@.str.5 = [44 x i8] c"-d: detach from terminal and run as daemon\0A\00"
@.str.6 = [68 x i8] c"-s bus_path: uses bus_path as bus path name (default: /tmp/ttybus)\0A\00"
@.str.7 = [52 x i8] c"-i init_string: send init string to plug's STDOUT\0A\0A\00"
@.str.8 = [55 x i8] c"Please also see: tty_bus, tty_attach, tty_fake, dpipe\0A\00"
@.str.9 = [19 x i8] c"Example of usage:\0A\00"
@.str.10 = [39 x i8] c" Create two tty_bus, one per machine\0A\00"
@.str.11 = [47 x i8] c" mars:$ tty_bus -d -s /tmp/exported_ttybus\0A\00"
@.str.12 = [46 x i8] c" venus:$ tty_bus -d -s /tmp/remote_ttybus\0A\00"
@.str.13 = [47 x i8] c" On mars, attach the device to the local bus\0A\00"
@.str.14 = [63 x i8] c" mars:$ tty_attach -d -s /tmp/exported_ttybus /dev/ttyUSB0\0A\00"
@.str.15 = [60 x i8] c" On venus, prepare the fake tty device, on the same path,\0A\00"
@.str.16 = [55 x i8] c" temporarly overriding the local /dev/ttyUSB0 device\0A\00"
@.str.17 = [63 x i8] c" venus:$ tty_fake -d -s /tmp/remote_ttybus -o /dev/ttyUSB0\0A\00"
@.str.18 = [81 x i8] c" Connect the two buses on the two hosts, using remote ssh command and tty_plug\0A\00"
@.str.19 = [94 x i8] c" venus:$ dpipe tty_plug -s /tmp/remote_ttybus = ssh mars tty_plug -s /tmp/exported_ttybus\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i8* @basename(i8* %0)
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @stderr
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.6, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.8, i64 0, i64 0))
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.11, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.13, i64 0, i64 0))
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.14, i64 0, i64 0))
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.15, i64 0, i64 0))
%31 = load i32, i32* @stderr
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.16, i64 0, i64 0))
%33 = load i32, i32* @stderr
%34 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.17, i64 0, i64 0))
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.18, i64 0, i64 0))
%37 = load i32, i32* @stderr
%38 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.19, i64 0, i64 0))
%39 = tail call i32 @exit(i32 2)
unreachable
}