#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 *);
void usage(int ret) {
  printf("Usage: smd_tty_loopback_test [OPTIONS] [PARAMS]...\n\n"
         "Runs the SMD loopback test with parameters specified.\n"
         "If neither size or pattern is specified,\n"
         "then the default tests are run.\n"
         "\nOPTIONS can be:\n"
         "  -v, --verbose         run with debug messages on\n"
         "  -h, --help            print this help message and exit\n"
         "  -n, --nocheck         Donot check the integrity of data\n"
         "\nPARAMS can be:\n"
         "  -s, --size            write/read buffer size (default 2 bytes)\n"
         "  -p, --pattern         pattern to be written (default 0xfa)\n"
         "  -a, --attempts        max number of attempts (default 2000)\n"
         "  -i, --iterations      number of test iterations (default 1)\n");
  exit(ret);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [629 x i8] c"Usage: smd_tty_loopback_test [OPTIONS] [PARAMS]...\0A\0ARuns the SMD loopback test with parameters specified.\0AIf neither size or pattern is specified,\0Athen the default tests are run.\0A\0AOPTIONS can be:\0A -v, --verbose run with debug messages on\0A -h, --help print this help message and exit\0A -n, --nocheck Donot check the integrity of data\0A\0APARAMS can be:\0A -s, --size write/read buffer size (default 2 bytes)\0A -p, --pattern pattern to be written (default 0xfa)\0A -a, --attempts max number of attempts (default 2000)\0A -i, --iterations number of test iterations (default 1)\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([629 x i8], [629 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [628 x i8] c"Usage: smd_tty_loopback_test [OPTIONS] [PARAMS]...\0A\0ARuns the SMD loopback test with parameters specified.\0AIf neither size or pattern is specified,\0Athen the default tests are run.\0A\0AOPTIONS can be:\0A -v, --verbose run with debug messages on\0A -h, --help print this help message and exit\0A -n, --nocheck Donot check the integrity of data\0A\0APARAMS can be:\0A -s, --size write/read buffer size (default 2 bytes)\0A -p, --pattern pattern to be written (default 0xfa)\0A -a, --attempts max number of attempts (default 2000)\0A -i, --iterations number of test iterations (default 1)\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([628 x i8], [628 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}