#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*/ printf(char *, char const *);
void usage(const char *name) {
  static const char *const usage_msg[] = {
      "-c              check syntax only",
      "-d              set debugging flags (set DEBUG to true)",
      "-e 'command'    executes a single line command",
      "-w              turn warnings on for your script",
      "-W[level]       set warning level (0=silence, 1=medium, 2=verbose)",
      "--copyright     print the copyright",
      "--version       print the version",
      NULL};
  const char *const *p = usage_msg;
  printf("Usage: %s [switches] [--] [programfile] [arguments]\n", name);
  while (*p) {
    printf("  %s\n", *p++);
  }
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0x2cbd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x1011(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1168 <usage+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rsi
lea    0x101a(%rip),%rdi
call   1030 <printf@plt>
jmp    1137 <usage+0x27>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rsi
lea    0x1028(%rip),%rdi
call   1030 <printf@plt>
lea    0x1051(%rip),%rbx
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf0e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf2e(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf50(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf84(%rip),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xf99(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@usage.usage_msg = internal constant [8 x i8*] [i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i32 0, i32 0), i8* null]
@.str = [34 x i8] c"-c check syntax only\00"
@.str.1 = [56 x i8] c"-d set debugging flags (set DEBUG to true)\00"
@.str.2 = [47 x i8] c"-e 'command' executes a single line command\00"
@.str.3 = [49 x i8] c"-w turn warnings on for your script\00"
@.str.4 = [67 x i8] c"-W[level] set warning level (0=silence, 1=medium, 2=verbose)\00"
@.str.5 = [36 x i8] c"--copyright print the copyright\00"
@.str.6 = [34 x i8] c"--version print the version\00"
@.str.7 = [53 x i8] c"Usage: %s [switches] [--] [programfile] [arguments]\0A\00"
@.str.8 = [6 x i8] c" %s\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8* %0, i8** %2
store i8** getelementptr inbounds ([8 x i8*], [8 x i8*]* @usage.usage_msg, i64 0, i64 0), i8*** %3
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0), i8* %4)
br label %6
6: ; preds = %10, %1
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %3
%13 = load i8*, i8** %11
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"-c check syntax only\00"
@.str.1 = [56 x i8] c"-d set debugging flags (set DEBUG to true)\00"
@.str.2 = [47 x i8] c"-e 'command' executes a single line command\00"
@.str.3 = [49 x i8] c"-w turn warnings on for your script\00"
@.str.4 = [67 x i8] c"-W[level] set warning level (0=silence, 1=medium, 2=verbose)\00"
@.str.5 = [36 x i8] c"--copyright print the copyright\00"
@.str.6 = [34 x i8] c"--version print the version\00"
@.str.7 = [53 x i8] c"Usage: %s [switches] [--] [programfile] [arguments]\0A\00"
@.str.8 = [6 x i8] c" %s\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
ret void
}