#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 const *, char *, char *);
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
void usage(FILE *f, const char *p) {
  char *dup = strdup(p);
  char *pname = basename(dup);
  const char *u =
      "usage: %s -w width -h height [-x x] [-y y] in-file out-file.\n"
      "extrapolate optical flow from a lower resolution FLO(W) file to a "
      "higher resolution.\n"
      "The output file format (either FLO or FLO) is determined by the input "
      "format\n"
      "example: %s -w 512 -h 488 -x 5.0 -y 5.0 small.flow large.flow\n\n"
      "   -H          print this help text\n\n"
      "Extrapolation Control:\n"
      "   -w width    target width\n"
      "   -h height   target height\n"
      "   -x x        extrapolation factor in x-direction\n"
      "   -y y        extrapolation factor in y-direction\n\n"
      "Note that if x and y are not passed, they are determined by "
      "input-{w,h}/output-{w,h}\n";
  fprintf(f, u, pname, pname);
  free(dup);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <basename@plt>
mov    %rax,-0x20(%rbp)
lea    0xe8f(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1060 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <basename@plt>
lea    0xe9f(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
mov    %rax,%rcx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [592 x i8] c"usage: %s -w width -h height [-x x] [-y y] in-file out-file.\0Aextrapolate optical flow from a lower resolution FLO(W) file to a higher resolution.\0AThe output file format (either FLO or FLO) is determined by the input format\0Aexample: %s -w 512 -h 488 -x 5.0 -y 5.0 small.flow large.flow\0A\0A -H print this help text\0A\0AExtrapolation Control:\0A -w width target width\0A -h height target height\0A -x x extrapolation factor in x-direction\0A -y y extrapolation factor in y-direction\0A\0ANote that if x and y are not passed, they are determined by input-{w,h}/output-{w,h}\0A\00"
define void @usage(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = call i8* @basename(i8* %10)
store i8* %11, i8** %6
store i8* getelementptr inbounds ([592 x i8], [592 x i8]* @.str, i64 0, i64 0), i8** %7
%12 = load i32*, i32** %3
%13 = load i8*, i8** %7
%14 = load i8*, i8** %6
%15 = load i8*, i8** %6
%16 = call i32 @fprintf(i32* %12, i8* %13, i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
@.str = [592 x i8] c"usage: %s -w width -h height [-x x] [-y y] in-file out-file.\0Aextrapolate optical flow from a lower resolution FLO(W) file to a higher resolution.\0AThe output file format (either FLO or FLO) is determined by the input format\0Aexample: %s -w 512 -h 488 -x 5.0 -y 5.0 small.flow large.flow\0A\0A -H print this help text\0A\0AExtrapolation Control:\0A -w width target width\0A -h height target height\0A -x x extrapolation factor in x-direction\0A -y y extrapolation factor in y-direction\0A\0ANote that if x and y are not passed, they are determined by input-{w,h}/output-{w,h}\0A\00"
define void @usage(i32* nocapture %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %1)
%4 = tail call i8* @basename(i8* %3)
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([592 x i8], [592 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %4)
%6 = tail call i32 @free(i8* %3)
ret void
}