#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 *, ...);
char *gettext(char *);
int /*<<< orphan*/ stderr;
char *strrchr(char *, char);
void usage(char *name) {
  char *this;
  if ((this = strrchr(name, '/')) != NULL)
    name = this + 1;
  fprintf(stderr, gettext("usage:\n"));
  fprintf(stderr, gettext("   %s [ -p ] dev name\n"), name);
  fprintf(stderr,
          gettext("   %s [ -p ] dev size sect heads tracks stretch "
                  "gap rate spec1 fmt_gap\n"),
          name);
  fprintf(stderr, gettext("   %s [ -c | -y | -n ] dev\n"), name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1174 <usage+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
lea    0xe79(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x20(%rbp),%edi
mov    %rax,%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
lea    0xe5c(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x1c(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
lea    0xe4a(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    0x2dee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    0xe69(%rip),%rdi
call   1030 <gettext@plt>
mov    -0x14(%rbp),%edi
mov    %rax,%rsi
mov    -0x8(%rbp),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%r14
test   %rax,%rax
cmove  %rbx,%r14
mov    0x2e7c(%rip),%r15
mov    (%r15),%ebx
lea    0xe92(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%ebx
lea    0xe7f(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%ebx
lea    0xe78(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    (%r15),%ebx
lea    0xea2(%rip),%rdi
call   1030 <gettext@plt>
mov    %ebx,%edi
mov    %rax,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [23 x i8] c" %s [ -p ] dev name\0A\00"
@.str.2 = [72 x i8] c" %s [ -p ] dev size sect heads tracks stretch gap rate spec1 fmt_gap\0A\00"
@.str.3 = [28 x i8] c" %s [ -c | -y | -n ] dev\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* @stderr
%12 = call i8* @gettext(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* %12)
%14 = load i32, i32* @stderr
%15 = call i8* @gettext(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%16 = load i8*, i8** %2
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* %15, i8* %16)
%18 = load i32, i32* @stderr
%19 = call i8* @gettext(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%20 = load i8*, i8** %2
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* %19, i8* %20)
%22 = load i32, i32* @stderr
%23 = call i8* @gettext(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%24 = load i8*, i8** %2
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* %23, i8* %24)
%26 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [23 x i8] c" %s [ -p ] dev name\0A\00"
@.str.2 = [72 x i8] c" %s [ -p ] dev size sect heads tracks stretch gap rate spec1 fmt_gap\0A\00"
@.str.3 = [28 x i8] c" %s [ -c | -y | -n ] dev\0A\00"
define void @usage(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = load i32, i32* @stderr
%7 = tail call i8* @gettext(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* %7)
%9 = load i32, i32* @stderr
%10 = tail call i8* @gettext(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* %10, i8* %5)
%12 = load i32, i32* @stderr
%13 = tail call i8* @gettext(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* %13, i8* %5)
%15 = load i32, i32* @stderr
%16 = tail call i8* @gettext(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* %16, i8* %5)
%18 = tail call i32 @exit(i32 1)
unreachable
}