#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 */
char *basename(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void show_usage(FILE *fp, int argc, char *argv[]) {
  fprintf(fp, "Usage:\n");
  fprintf(fp, "   %s survey=<surveyid> [plate=<plateid>] [INPUT-FILE]\n",
          basename(argv[0]));
  fprintf(fp, "If no plateid is specified then all plates of given survey will "
              "extracted into separate output files\n");
}


x86 assembly (clang, -O0):
<show_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <basename@plt>
mov    -0x20(%rbp),%rdi
mov    %rax,%rdx
lea    0xea1(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    (%r14),%rdi
call   1040 <basename@plt>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0xeca(%rip),%rdi
mov    $0x65,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [56 x i8] c" %s survey=<surveyid> [plate=<plateid>] [INPUT-FILE]\0A\00"
@.str.2 = [102 x i8] c"If no plateid is specified then all plates of given survey will extracted into separate output files\0A\00"
define void @show_usage(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = load i32*, i32** %4
%10 = load i8**, i8*** %6
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i8* @basename(i8* %12)
%14 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = load i32*, i32** %4
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [56 x i8] c" %s survey=<surveyid> [plate=<plateid>] [INPUT-FILE]\0A\00"
@.str.2 = [102 x i8] c"If no plateid is specified then all plates of given survey will extracted into separate output files\0A\00"
define void @show_usage(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
%5 = load i8*, i8** %2
%6 = tail call i8* @basename(i8* %5)
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str.2, i64 0, i64 0), i64 101, i64 1, i32* %0)
ret void
}