#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_trc_flags(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int rc) {
  fprintf(rc ? stderr : stdout,
          "usage: jtrace -n <trc_buf_name> <options>\n"
          "\n    Display trace information:\n"
          "    -n <trc_buf_name>   trace buffer name\n"
          "    -D     use default trace buffer name\n"
          "    [-v]        verbose\n"
          "\n    Trace flag control (requires -n|-D first):\n"
          "    [-h trace_flags]  trace flags absolute, hex value\n"
          "    [-f trace_flag_strs] trace flags absolute, string values\n"
          "    [-s trace_flag_strs] set a trace flag(s) (logical or)\n"
          "    [-u trace_flag_strs] unset a trace flag(s) (logical nand)\n"
          "    [-g ] Show currently set trace flags\n"
          "\n    Output Trace to console (requires -n|-D first):\n"
          "    [-p <0|1> ] Set printk value (1=print to console enabled)\n"
          "\n    Clear Trace buffer (requires -n|-D first):\n"
          "    [-c]        clear the trace buffer\n"
          "\n    ACPI/Config helpers :\n"
          "    [-A]        Dump ACPI info to jtrc_default.\n"
          "    [-L]        Dump physical location info to jtrc_default.\n");
  printf("\nValid trace flags:\n\n");
  show_trc_flags(0xffffffff);
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1166 <usage+0x26>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1172 <usage+0x32>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xe84(%rip),%rsi
call   1050 <fprintf@plt>
lea    0x11c4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <show_trc_flags@plt>
mov    -0x4(%rbp),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1150 <usage+0x10>
mov    0x2e8a(%rip),%rax
jmp    1157 <usage+0x17>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
call   1050 <fprintf@plt>
lea    0x11e0(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <show_trc_flags@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [844 x i8] c"usage: jtrace -n <trc_buf_name> <options>\0A\0A Display trace information:\0A -n <trc_buf_name> trace buffer name\0A -D use default trace buffer name\0A [-v] verbose\0A\0A Trace flag control (requires -n|-D first):\0A [-h trace_flags] trace flags absolute, hex value\0A [-f trace_flag_strs] trace flags absolute, string values\0A [-s trace_flag_strs] set a trace flag(s) (logical or)\0A [-u trace_flag_strs] unset a trace flag(s) (logical nand)\0A [-g ] Show currently set trace flags\0A\0A Output Trace to console (requires -n|-D first):\0A [-p <0|1> ] Set printk value (1=print to console enabled)\0A\0A Clear Trace buffer (requires -n|-D first):\0A [-c] clear the trace buffer\0A\0A ACPI/Config helpers :\0A [-A] Dump ACPI info to jtrc_default.\0A [-L] Dump physical location info to jtrc_default.\0A\00"
@.str.1 = [22 x i8] c"\0AValid trace flags:\0A\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([844 x i8], [844 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @show_trc_flags(i32 -1)
%14 = load i32, i32* %2
%15 = call i32 @exit(i32 %14)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [844 x i8] c"usage: jtrace -n <trc_buf_name> <options>\0A\0A Display trace information:\0A -n <trc_buf_name> trace buffer name\0A -D use default trace buffer name\0A [-v] verbose\0A\0A Trace flag control (requires -n|-D first):\0A [-h trace_flags] trace flags absolute, hex value\0A [-f trace_flag_strs] trace flags absolute, string values\0A [-s trace_flag_strs] set a trace flag(s) (logical or)\0A [-u trace_flag_strs] unset a trace flag(s) (logical nand)\0A [-g ] Show currently set trace flags\0A\0A Output Trace to console (requires -n|-D first):\0A [-p <0|1> ] Set printk value (1=print to console enabled)\0A\0A Clear Trace buffer (requires -n|-D first):\0A [-c] clear the trace buffer\0A\0A ACPI/Config helpers :\0A [-A] Dump ACPI info to jtrc_default.\0A [-L] Dump physical location info to jtrc_default.\0A\00"
@str = [21 x i8] c"\0AValid trace flags:\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([844 x i8], [844 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @show_trc_flags(i32 -1)
%9 = tail call i32 @exit(i32 %0)
unreachable
}