#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 *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int fd) {
  char *message =
      "Usage: tf [OPTION]...\n\nCreates a .wav file with single "
      "frequency\n\nOPTIONS:\n  -f, --freq      specify frequency (default = "
      "440Hz)\n  -d, --duration  specify time duration (default = 10s)\n  -n, "
      "--name      specify file name (default = A440.wav)\n  -h, --help      "
      "display this help menu";
  fprintf(fd == 1 ? stdout : stderr, "%s\n", message);
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1141 <usage+0x31>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    114d <usage+0x3d>
mov    0x2e98(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xfc0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
cmp    $0x1,%edi
jne    111e <usage+0xe>
mov    0x2ebc(%rip),%rax
jmp    1125 <usage+0x15>
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
lea    0xfed(%rip),%rsi
lea    0xecb(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [283 x i8] c"Usage: tf [OPTION]...\0A\0ACreates a .wav file with single frequency\0A\0AOPTIONS:\0A -f, --freq specify frequency (default = 440Hz)\0A -d, --duration specify time duration (default = 10s)\0A -n, --name specify file name (default = A440.wav)\0A -h, --help display this help menu\00"
@stdout = global i32 0
@stderr = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @stdout
br label %10
8: ; preds = %1
%9 = load i32, i32* @stderr
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [283 x i8] c"Usage: tf [OPTION]...\0A\0ACreates a .wav file with single frequency\0A\0AOPTIONS:\0A -f, --freq specify frequency (default = 440Hz)\0A -d, --duration specify time duration (default = 10s)\0A -n, --name specify file name (default = A440.wav)\0A -h, --help display this help menu\00"
@stdout = global i32 0
@stderr = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = load i32, i32* @stdout
%4 = load i32, i32* @stderr
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([283 x i8], [283 x i8]* @.str, i64 0, i64 0))
ret void
}