#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 */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void usage(FILE *f) {
  fputs("bpm (C) Copyright 2013 Mark Hills <mark@xwax.org>"
        "\n\n",
        f);
  fprintf(f,
          "Usage: "
          "bpm"
          " [options]\n"
          "Analyse the tempo (in beats-per-minute, BPM) of incoming audio\n\n"
          "  -g <path>  Output autodifference data to file\n"
          "  -e <path>  Output energy data to file\n"
          "  -f         Print format for final BPM value (default \"%%0.1f\")\n"
          "  -m <f>     Minimum detected BPM (default %0.0f)\n"
          "  -x <f>     Maximum detected BPM (default %0.0f)\n"
          "  -v         Print progress information to stderr\n"
          "  -h         Display this help message and exit\n\n",
          84.0, 146.0);
  fprintf(
      f,
      "Incoming audio is raw audio on stdin at %dHz, mono, 32-bit float; eg.\n"
      "  $ sox file.mp3 -t raw -r %d -e float -c 1 - | ./"
      "bpm"
      "\n\n",
      44100, 44100);
  fprintf(f, "To view autodifference or energy data:\n"
             "  $ sox [...] | "
             "bpm"
             " -g file.dat\n"
             "  $ gnuplot\n"
             "  gnuplot> plot \"file.dat\"\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
lea    0xefd(%rip),%rsi
movsd  0xeb1(%rip),%xmm0
movsd  0xeb1(%rip),%xmm1
mov    $0x2,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x1091(%rip),%rsi
mov    $0xac44,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0x10f6(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x33,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
lea    0xf00(%rip),%rsi
movsd  0xeb4(%rip),%xmm0
movsd  0xeb4(%rip),%xmm1
mov    %rbx,%rdi
mov    $0x2,%al
call   1030 <fprintf@plt>
lea    0x1095(%rip),%rsi
mov    %rbx,%rdi
mov    $0xac44,%edx
mov    $0xac44,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
lea    0x10f8(%rip),%rdi
mov    $0x6f,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"bpm (C) Copyright 2013 Mark Hills <mark@xwax.org>\0A\0A\00"
@.str.1 = [438 x i8] c"Usage: bpm [options]\0AAnalyse the tempo (in beats-per-minute, BPM) of incoming audio\0A\0A -g <path> Output autodifference data to file\0A -e <path> Output energy data to file\0A -f Print format for final BPM value (default \22%%0.1f\22)\0A -m <f> Minimum detected BPM (default %0.0f)\0A -x <f> Maximum detected BPM (default %0.0f)\0A -v Print progress information to stderr\0A -h Display this help message and exit\0A\0A\00"
@.str.2 = [126 x i8] c"Incoming audio is raw audio on stdin at %dHz, mono, 32-bit float; eg.\0A $ sox file.mp3 -t raw -r %d -e float -c 1 - | ./bpm\0A\0A\00"
@.str.3 = [112 x i8] c"To view autodifference or energy data:\0A $ sox [...] | bpm -g file.dat\0A $ gnuplot\0A gnuplot> plot \22file.dat\22\0A\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([438 x i8], [438 x i8]* @.str.1, i64 0, i64 0), double 8.400000e+01, double 1.460000e+02)
%7 = load i32*, i32** %2
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %7, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.2, i64 0, i64 0), i32 44100, i32 44100)
%9 = load i32*, i32** %2
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [52 x i8] c"bpm (C) Copyright 2013 Mark Hills <mark@xwax.org>\0A\0A\00"
@.str.1 = [438 x i8] c"Usage: bpm [options]\0AAnalyse the tempo (in beats-per-minute, BPM) of incoming audio\0A\0A -g <path> Output autodifference data to file\0A -e <path> Output energy data to file\0A -f Print format for final BPM value (default \22%%0.1f\22)\0A -m <f> Minimum detected BPM (default %0.0f)\0A -x <f> Maximum detected BPM (default %0.0f)\0A -v Print progress information to stderr\0A -h Display this help message and exit\0A\0A\00"
@.str.2 = [126 x i8] c"Incoming audio is raw audio on stdin at %dHz, mono, 32-bit float; eg.\0A $ sox file.mp3 -t raw -r %d -e float -c 1 - | ./bpm\0A\0A\00"
@.str.3 = [112 x i8] c"To view autodifference or energy data:\0A $ sox [...] | bpm -g file.dat\0A $ gnuplot\0A gnuplot> plot \22file.dat\22\0A\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 51, i64 1, i32* %0)
%3 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([438 x i8], [438 x i8]* @.str.1, i64 0, i64 0), double 8.400000e+01, double 1.460000e+02)
%4 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([126 x i8], [126 x i8]* @.str.2, i64 0, i64 0), i32 44100, i32 44100)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str.3, i64 0, i64 0), i64 111, i64 1, i32* %0)
ret void
}