#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 *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname, int full) {
  fprintf(
      stderr, "usage: %s -{flags}  where:\n%s%s", progname,
      "   -h gives the usage message\n"
      "   -H gives a more complete usage message\n"
      "   -c grabs a color image\n"
      "   -g grabs a greyscale image\n"
      "   -v grabs a viewfinder image\n"
      "     (if none of -v, -g, or -c is used, no image will be grabbed,\n"
      "      but camera will still be discovered and initialized)\n"
      "   -2 to double-scan an image\n"
      "   -z N sets image reduction factor, or viewfinder zoom. (1, 2, 4, or "
      "8)\n"
      "   -b NN - brightness (1-100, 0 for default) [50]\n"
      "   -l color-adjustment\n"
      "   -a causes an audible alert (beep) when image is exposed\n"
      "   -s SPEED sets the preferred baud rate\n"
      "   -i IDSTRING assigns a prefix for all config info looked up\n"
      "   -o FILE sets the output file to use in place of stdout\n"
      "",
      !full ? ""
            : "   -S NN saves a starfield image, using NN as the \"bad\" "
              "threshold\n"
              "   -e NN sets exposure in milliseconds\n"
              "   -E NN sets exposure in microseconds\n"
              "   -f don't do faster grab\n"
              "   -n leaves \"narrow\" image, rather than widening\n"
              "   -r leaves a dark image, rather than brightening corners\n"
              "	-G VAL processes with gamma function . (100 normal, 110 "
              "default)\n"
              "   -d runs camera diagnostics\n"
              "   -t STR sets tracing; arg is a string of traceflags:\n"
              "	    v just shows program and camera version information\n"
              "	    V will turn on all possible messages\n"
              "	    e to get exposure information\n"
              "	    a for simple API tracing\n"
              "	    A for full API tracing\n"
              "	    c for camera commands\n"
              "	    s for serial protocol\n"
              "	    S for all bytes of serial protocol\n"
              "	    g for graphics output routine tracing\n"
              "	    r for winc.rc file tracing\n"
              "   -R writes .wcd format data\n"
              "   -D gets .wcd format data from stdin\n"
              "\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
cmpl   $0x0,-0xc(%rbp)
setne  %cl
xor    $0xff,%cl
lea    0x118c(%rip),%r8
lea    0x14e3(%rip),%rax
test   $0x1,%cl
cmovne %rax,%r8
lea    0xeae(%rip),%rsi
lea    0xec7(%rip),%rcx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
test   %esi,%esi
lea    0x1502(%rip),%rax
lea    0x119d(%rip),%r8
cmove  %rax,%r8
lea    0xec9(%rip),%rsi
lea    0xee2(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: %s -{flags} where:\0A%s%s\00"
@.str.1 = [681 x i8] c" -h gives the usage message\0A -H gives a more complete usage message\0A -c grabs a color image\0A -g grabs a greyscale image\0A -v grabs a viewfinder image\0A (if none of -v, -g, or -c is used, no image will be grabbed,\0A but camera will still be discovered and initialized)\0A -2 to double-scan an image\0A -z N sets image reduction factor, or viewfinder zoom. (1, 2, 4, or 8)\0A -b NN - brightness (1-100, 0 for default) [50]\0A -l color-adjustment\0A -a causes an audible alert (beep) when image is exposed\0A -s SPEED sets the preferred baud rate\0A -i IDSTRING assigns a prefix for all config info looked up\0A -o FILE sets the output file to use in place of stdout\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [863 x i8] c" -S NN saves a starfield image, using NN as the \22bad\22 threshold\0A -e NN sets exposure in milliseconds\0A -E NN sets exposure in microseconds\0A -f don't do faster grab\0A -n leaves \22narrow\22 image, rather than widening\0A -r leaves a dark image, rather than brightening corners\0A\09-G VAL processes with gamma function . (100 normal, 110 default)\0A -d runs camera diagnostics\0A -t STR sets tracing; arg is a string of traceflags:\0A\09 v just shows program and camera version information\0A\09 V will turn on all possible messages\0A\09 e to get exposure information\0A\09 a for simple API tracing\0A\09 A for full API tracing\0A\09 c for camera commands\0A\09 s for serial protocol\0A\09 S for all bytes of serial protocol\0A\09 g for graphics output routine tracing\0A\09 r for winc.rc file tracing\0A -R writes .wcd format data\0A -D gets .wcd format data from stdin\0A\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([863 x i8], [863 x i8]* @.str.3, i64 0, i64 0)
%12 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([681 x i8], [681 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: %s -{flags} where:\0A%s%s\00"
@.str.1 = [681 x i8] c" -h gives the usage message\0A -H gives a more complete usage message\0A -c grabs a color image\0A -g grabs a greyscale image\0A -v grabs a viewfinder image\0A (if none of -v, -g, or -c is used, no image will be grabbed,\0A but camera will still be discovered and initialized)\0A -2 to double-scan an image\0A -z N sets image reduction factor, or viewfinder zoom. (1, 2, 4, or 8)\0A -b NN - brightness (1-100, 0 for default) [50]\0A -l color-adjustment\0A -a causes an audible alert (beep) when image is exposed\0A -s SPEED sets the preferred baud rate\0A -i IDSTRING assigns a prefix for all config info looked up\0A -o FILE sets the output file to use in place of stdout\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [863 x i8] c" -S NN saves a starfield image, using NN as the \22bad\22 threshold\0A -e NN sets exposure in milliseconds\0A -E NN sets exposure in microseconds\0A -f don't do faster grab\0A -n leaves \22narrow\22 image, rather than widening\0A -r leaves a dark image, rather than brightening corners\0A\09-G VAL processes with gamma function . (100 normal, 110 default)\0A -d runs camera diagnostics\0A -t STR sets tracing; arg is a string of traceflags:\0A\09 v just shows program and camera version information\0A\09 V will turn on all possible messages\0A\09 e to get exposure information\0A\09 a for simple API tracing\0A\09 A for full API tracing\0A\09 c for camera commands\0A\09 s for serial protocol\0A\09 S for all bytes of serial protocol\0A\09 g for graphics output routine tracing\0A\09 r for winc.rc file tracing\0A -R writes .wcd format data\0A -D gets .wcd format data from stdin\0A\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([863 x i8], [863 x i8]* @.str.3, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([681 x i8], [681 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}