#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*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int usage(char const *prog) {
  fprintf(
      stderr,
      "usage: %s [-h] [-b] [-p] [-r ch] [-u] [-z] [input_file [output_file]]\n",
      prog);
  fputs("use -b to remove BOM from input\n", stderr);
  fputs("use -p to ensure all characters are printable\n", stderr);
  fputs("use -r to specify a replacement character\n", stderr);
  fputs("use -u to strip CRs from input\n", stderr);
  fputs("use -z to strip DOS EOF marker from input\n", stderr);
  return 2;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0xef2(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
lea    0xefe(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
lea    0xf18(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e55(%rip),%rax
mov    (%rax),%esi
lea    0xf2e(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%esi
lea    0xf39(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%esi
lea    0xf05(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xf18(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xf39(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xf56(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xf68(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [71 x i8] c"usage: %s [-h] [-b] [-p] [-r ch] [-u] [-z] [input_file [output_file]]\0A\00"
@.str.1 = [33 x i8] c"use -b to remove BOM from input\0A\00"
@.str.2 = [47 x i8] c"use -p to ensure all characters are printable\0A\00"
@.str.3 = [43 x i8] c"use -r to specify a replacement character\0A\00"
@.str.4 = [32 x i8] c"use -u to strip CRs from input\0A\00"
@.str.5 = [43 x i8] c"use -z to strip DOS EOF marker from input\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fputs(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stderr
%11 = call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @stderr
%13 = call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %14)
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [71 x i8] c"usage: %s [-h] [-b] [-p] [-r ch] [-u] [-z] [input_file [output_file]]\0A\00"
@.str.1 = [33 x i8] c"use -b to remove BOM from input\0A\00"
@.str.2 = [47 x i8] c"use -p to ensure all characters are printable\0A\00"
@.str.3 = [43 x i8] c"use -r to specify a replacement character\0A\00"
@.str.4 = [32 x i8] c"use -u to strip CRs from input\0A\00"
@.str.5 = [43 x i8] c"use -z to strip DOS EOF marker from input\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stderr
%11 = tail call i32 @fputs(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @stderr
%13 = tail call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %12)
ret i32 2
}