#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void usage(const char *progname, int status) {
  FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
  int i;
  fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
  fprintf(stream,
          "\n"
          "Options:\n"
          "  -f <file>		generate a factory flash image <file>\n"
          "  -s <file>		generate a sysupgrade flash image <file>\n"
          "  -h			show this screen\n");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%eax
je     1154 <usage+0x34>
mov    0x2e98(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    1162 <usage+0x42>
mov    0x2e7d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rdx
mov    0x2e91(%rip),%rax
cmp    %esi,(%rax)
jne    114c <usage+0x1c>
mov    0x2e8e(%rip),%rax
jmp    1153 <usage+0x23>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rbx
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x8b,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %ebp,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stderr = global i32* null
@stdout = global i32* null
@.str = [24 x i8] c"Usage: %s [OPTIONS...]\0A\00"
@.str.1 = [140 x i8] c"\0AOptions:\0A -f <file>\09\09generate a factory flash image <file>\0A -s <file>\09\09generate a sysupgrade flash image <file>\0A -h\09\09\09show this screen\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stderr
br label %14
12: ; preds = %2
%13 = load i32*, i32** @stdout
br label %14
14: ; preds = %12, %10
%15 = phi i32* [ %11, %10 ], [ %13, %12 ]
store i32* %15, i32** %5
%16 = load i32*, i32** %5
%17 = load i8*, i8** %3
%18 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %17)
%19 = load i32*, i32** %5
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* %4
%22 = call i32 @exit(i32 %21)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stderr = global i32* null
@stdout = global i32* null
@.str = [24 x i8] c"Usage: %s [OPTIONS...]\0A\00"
@.str.1 = [140 x i8] c"\0AOptions:\0A -f <file>\09\09generate a factory flash image <file>\0A -s <file>\09\09generate a sysupgrade flash image <file>\0A -h\09\09\09show this screen\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stderr
%6 = load i32*, i32** @stdout
%7 = select i1 %4, i32* %6, i32* %5
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i64 139, i64 1, i32* %7)
%10 = tail call i32 @exit(i32 %1)
unreachable
}