#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_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stderr;
void usage(const char *errmsg, char *progname) {
  printf("Usage: %s [-c count] [-d milliseconds] [-q] [-l] [starting test "
         "number] [ending test number]\n"
         "\n"
         "-c count\tRepeat the test(s) count times before stopping\n"
         "-d seconds\tThe number of milliseconds to delay between flushing "
         "stdout, and\n"
         "\t\trunning the test (default is 1)\n"
         "-l\t\tList tests, then quit\n"
         "-q\t\tQuiet (don't print out test info)\n"
         "If no test number is specified, the number of tests available will "
         "be shown.\n\n"
         "If a single test number is specified (0 <= n < # of tests), that "
         "test will be run.\n\n"
         "If two tests numbers are specified (0 <= start < end < # tests), "
         "those tests will be run\n\n"
         "If you specify -1, then all tests will be run in order.\n\n",
         progname);
  if (errmsg) {
    fprintf(stderr, "\nERROR: %s\n", errmsg);
    exit(EXIT_FAILURE);
  } else
    exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1182 <usage+0x52>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0x110b(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
test   %rbx,%rbx
jne    1153 <usage+0x23>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0x1117(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [634 x i8] c"Usage: %s [-c count] [-d milliseconds] [-q] [-l] [starting test number] [ending test number]\0A\0A-c count\09Repeat the test(s) count times before stopping\0A-d seconds\09The number of milliseconds to delay between flushing stdout, and\0A\09\09running the test (default is 1)\0A-l\09\09List tests, then quit\0A-q\09\09Quiet (don't print out test info)\0AIf no test number is specified, the number of tests available will be shown.\0A\0AIf a single test number is specified (0 <= n < # of tests), that test will be run.\0A\0AIf two tests numbers are specified (0 <= start < end < # tests), those tests will be run\0A\0AIf you specify -1, then all tests will be run in order.\0A\0A\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"\0AERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([634 x i8], [634 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %3
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = load i32, i32* @EXIT_SUCCESS
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@.str = [634 x i8] c"Usage: %s [-c count] [-d milliseconds] [-q] [-l] [starting test number] [ending test number]\0A\0A-c count\09Repeat the test(s) count times before stopping\0A-d seconds\09The number of milliseconds to delay between flushing stdout, and\0A\09\09running the test (default is 1)\0A-l\09\09List tests, then quit\0A-q\09\09Quiet (don't print out test info)\0AIf no test number is specified, the number of tests available will be shown.\0A\0AIf a single test number is specified (0 <= n < # of tests), that test will be run.\0A\0AIf two tests numbers are specified (0 <= start < end < # tests), those tests will be run\0A\0AIf you specify -1, then all tests will be run in order.\0A\0A\00"
@stderr = global i32 0
@.str.1 = [12 x i8] c"\0AERROR: %s\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([634 x i8], [634 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = icmp eq i8* %0, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
%11 = load i32, i32* @EXIT_SUCCESS
%12 = tail call i32 @exit(i32 %11)
unreachable
}