#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 *, char *);
void usage(FILE *fp, int argc, char **argv) {
  fprintf(
      fp,
      "Usage: %s [options] [command]\n\n"
      "Options:\n"
      "-h | --help              Print this message\n"
      "-v | --version           Print version\n"
      "-d | --directory         Directory (default: /var/p2pfoodlab)\n"
      "-c | --config            Alternative config file (default: "
      "${directory}/etc/config.json)\n"
      "-l | --log               Log file ('-' for stderr, default: "
      "/var/p2pfoodlab/log.txt)\n"
      "-t | --test              Test run\n"
      "-o | --output-file       Where to write the data/image to ['-' for "
      "console]\n"
      "-D | --debug             Print debug message\n"
      "Commands:\n"
      "  update                 Parse the config, create the OpenSensorData "
      "definitions if needed,\n"
      "                         update sensors and/or camera if necessary,\n"
      "                         upload data and photos [default]\n"
      "  store-data             Store the latest sensor values\n"
      "  upload-data            Upload the datapoints\n"
      "  camera                 Grab a photo\n"
      "  upload-photos          Upload the photos on the disk\n"
      "  get-time               Get the current time on the arduino\n"
      "  set-time               Set the time on the arduino\n"
      "  list-events            Set the time on the arduino\n"
      "  ifup                   Bring the network inerface up\n"
      "  ifdown                 Bring the network inerface down\n"
      "  osd                    Create the OpenSensorData definitions\n"
      "  measure                Measure and print sensor values\n"
      "  generate-system-files  Generate system files\n"
      "  system-init            Generate system files and bring up the "
      "network\n"
      "  merge filename         Merge the file into the existing config file\n"
      "",
      argv[0]);
}


x86 assembly (clang, -O0):
<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
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    (%rdx),%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [1527 x i8] c"Usage: %s [options] [command]\0A\0AOptions:\0A-h | --help Print this message\0A-v | --version Print version\0A-d | --directory Directory (default: /var/p2pfoodlab)\0A-c | --config Alternative config file (default: ${directory}/etc/config.json)\0A-l | --log Log file ('-' for stderr, default: /var/p2pfoodlab/log.txt)\0A-t | --test Test run\0A-o | --output-file Where to write the data/image to ['-' for console]\0A-D | --debug Print debug message\0ACommands:\0A update Parse the config, create the OpenSensorData definitions if needed,\0A update sensors and/or camera if necessary,\0A upload data and photos [default]\0A store-data Store the latest sensor values\0A upload-data Upload the datapoints\0A camera Grab a photo\0A upload-photos Upload the photos on the disk\0A get-time Get the current time on the arduino\0A set-time Set the time on the arduino\0A list-events Set the time on the arduino\0A ifup Bring the network inerface up\0A ifdown Bring the network inerface down\0A osd Create the OpenSensorData definitions\0A measure Measure and print sensor values\0A generate-system-files Generate system files\0A system-init Generate system files and bring up the network\0A merge filename Merge the file into the existing config file\0A\00"
define void @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 = load i8**, i8*** %6
%9 = getelementptr inbounds i8*, i8** %8, i64 0
%10 = load i8*, i8** %9
%11 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([1527 x i8], [1527 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [1527 x i8] c"Usage: %s [options] [command]\0A\0AOptions:\0A-h | --help Print this message\0A-v | --version Print version\0A-d | --directory Directory (default: /var/p2pfoodlab)\0A-c | --config Alternative config file (default: ${directory}/etc/config.json)\0A-l | --log Log file ('-' for stderr, default: /var/p2pfoodlab/log.txt)\0A-t | --test Test run\0A-o | --output-file Where to write the data/image to ['-' for console]\0A-D | --debug Print debug message\0ACommands:\0A update Parse the config, create the OpenSensorData definitions if needed,\0A update sensors and/or camera if necessary,\0A upload data and photos [default]\0A store-data Store the latest sensor values\0A upload-data Upload the datapoints\0A camera Grab a photo\0A upload-photos Upload the photos on the disk\0A get-time Get the current time on the arduino\0A set-time Set the time on the arduino\0A list-events Set the time on the arduino\0A ifup Bring the network inerface up\0A ifdown Bring the network inerface down\0A osd Create the OpenSensorData definitions\0A measure Measure and print sensor values\0A generate-system-files Generate system files\0A system-init Generate system files and bring up the network\0A merge filename Merge the file into the existing config file\0A\00"
define void @usage(i32* nocapture %0, i32 %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([1527 x i8], [1527 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}