#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 *get_pi_timer_version();
scalar_t__ get_pin();
int get_random_sleep_minutes();
scalar_t__ get_run_as_daemon();
int get_run_minutes();
scalar_t__ get_server_port();
char *get_up_time_string();
scalar_t__ get_use_random();
int /*<<< orphan*/ stdout;
void usage(const char *program) {
  fprintf(stdout, "Version: %s\n", get_pi_timer_version());
  fprintf(stdout, "Usage:     %s --run=RUN_MINUTES --sleep=SLEEP_MINUTES \n",
          program);
  fprintf(stdout, "Example:   %s --run=5 --sleep=50 \n\n", program);
  fprintf(stdout, "Simple Raspberry Timer for our compost bin.\n\n");
  fprintf(stdout, "     run        number of minutes to run, default: %u\n",
          get_run_minutes());
  fprintf(stdout, "     sleep      number of minutes to sleep, default: %u\n",
          get_random_sleep_minutes());
  fprintf(stdout, "     gpio       gpio pin to signal fan, default: %u\n",
          (unsigned int)get_pin());
  fprintf(stdout, "     daemon     run as daemon, default: %s\n",
          get_run_as_daemon() ? "true" : "false");
  fprintf(stdout, "     port       port to listen to, default: %d\n",
          (int)get_server_port());
  fprintf(stdout,
          "     up_time    up time specifies 24 hour range where pin can be "
          "on, default: %s\n",
          get_up_time_string());
  fprintf(
      stdout,
      "     random     use random time offset to turn on pin, default: %s\n",
      get_use_random() ? "true" : "false");
  fprintf(stdout, "     help       get this help message\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e3d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    $0x0,%al
call   1060 <get_pi_timer_version@plt>
mov    -0x28(%rbp),%edi
mov    %rax,%rdx
lea    0xe44(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2dfb(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe53(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2dc9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   10b0 <get_run_minutes@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%edx
lea    0xe68(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   10a0 <get_random_sleep_minutes@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%edx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <get_pin@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%edx
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2d57(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1090 <get_run_as_daemon@plt>
mov    -0x18(%rbp),%edi
mov    %rax,%rcx
lea    0xecb(%rip),%rdx
lea    0xebf(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2d1a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <get_server_port@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xe95(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2cf4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1080 <get_up_time_string@plt>
mov    -0x10(%rbp),%edi
mov    %rax,%rdx
lea    0xe9e(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2ccd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <get_use_random@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rcx
lea    0xe41(%rip),%rdx
lea    0xe35(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
lea    0xeb3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2c90(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e3f(%rip),%r14
mov    (%r14),%ebp
xor    %eax,%eax
call   1060 <get_pi_timer_version@plt>
lea    0xe4e(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%edi
lea    0xe45(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%edi
lea    0xe69(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%edi
lea    0xe79(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%ebx
xor    %eax,%eax
call   10b0 <get_run_minutes@plt>
lea    0xe8f(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%ebx
xor    %eax,%eax
call   10a0 <get_random_sleep_minutes@plt>
lea    0xeaa(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%ebx
xor    %eax,%eax
call   1040 <get_pin@plt>
lea    0xec7(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%ebp
xor    %eax,%eax
call   1090 <get_run_as_daemon@plt>
test   %rax,%rax
lea    0xf0e(%rip),%r15
lea    0xf02(%rip),%rbx
mov    %rbx,%rdx
cmove  %r15,%rdx
lea    0xec8(%rip),%rsi
mov    %ebp,%edi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%ebp
xor    %eax,%eax
call   1050 <get_server_port@plt>
lea    0xee5(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%ebp
xor    %eax,%eax
call   1080 <get_up_time_string@plt>
lea    0xef9(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%ebp
xor    %eax,%eax
call   1030 <get_use_random@plt>
test   %rax,%rax
cmove  %r15,%rbx
lea    0xf27(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%r14),%edi
lea    0xf55(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [56 x i8] c"Usage: %s --run=RUN_MINUTES --sleep=SLEEP_MINUTES \0A\00"
@.str.2 = [36 x i8] c"Example: %s --run=5 --sleep=50 \0A\0A\00"
@.str.3 = [46 x i8] c"Simple Raspberry Timer for our compost bin.\0A\0A\00"
@.str.4 = [55 x i8] c" run number of minutes to run, default: %u\0A\00"
@.str.5 = [57 x i8] c" sleep number of minutes to sleep, default: %u\0A\00"
@.str.6 = [53 x i8] c" gpio gpio pin to signal fan, default: %u\0A\00"
@.str.7 = [44 x i8] c" daemon run as daemon, default: %s\0A\00"
@.str.8 = [5 x i8] c"true\00"
@.str.9 = [6 x i8] c"false\00"
@.str.10 = [48 x i8] c" port port to listen to, default: %d\0A\00"
@.str.11 = [82 x i8] c" up_time up time specifies 24 hour range where pin can be on, default: %s\0A\00"
@.str.12 = [68 x i8] c" random use random time offset to turn on pin, default: %s\0A\00"
@.str.13 = [39 x i8] c" help get this help message\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = call i8* (...) @get_pi_timer_version()
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %2
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @stdout
%10 = load i8*, i8** %2
%11 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @stdout
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = call i32 (...) @get_run_minutes()
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = call i32 (...) @get_random_sleep_minutes()
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = load i32, i32* @stdout
%21 = call i64 (...) @get_pin()
%22 = trunc i64 %21 to i32
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @stdout
%25 = call i64 (...) @get_run_as_daemon()
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0)
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), i8* %28)
%30 = load i32, i32* @stdout
%31 = call i64 (...) @get_server_port()
%32 = trunc i64 %31 to i32
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i32 %32)
%34 = load i32, i32* @stdout
%35 = call i8* (...) @get_up_time_string()
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.11, i64 0, i64 0), i8* %35)
%37 = load i32, i32* @stdout
%38 = call i64 (...) @get_use_random()
%39 = icmp ne i64 %38, 0
%40 = zext i1 %39 to i64
%41 = select i1 %39, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0)
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* %41)
%43 = load i32, i32* @stdout
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"Version: %s\0A\00"
@.str.1 = [56 x i8] c"Usage: %s --run=RUN_MINUTES --sleep=SLEEP_MINUTES \0A\00"
@.str.2 = [36 x i8] c"Example: %s --run=5 --sleep=50 \0A\0A\00"
@.str.3 = [46 x i8] c"Simple Raspberry Timer for our compost bin.\0A\0A\00"
@.str.4 = [55 x i8] c" run number of minutes to run, default: %u\0A\00"
@.str.5 = [57 x i8] c" sleep number of minutes to sleep, default: %u\0A\00"
@.str.6 = [53 x i8] c" gpio gpio pin to signal fan, default: %u\0A\00"
@.str.7 = [44 x i8] c" daemon run as daemon, default: %s\0A\00"
@.str.8 = [5 x i8] c"true\00"
@.str.9 = [6 x i8] c"false\00"
@.str.10 = [48 x i8] c" port port to listen to, default: %d\0A\00"
@.str.11 = [82 x i8] c" up_time up time specifies 24 hour range where pin can be on, default: %s\0A\00"
@.str.12 = [68 x i8] c" random use random time offset to turn on pin, default: %s\0A\00"
@.str.13 = [39 x i8] c" help get this help message\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i8* (...) @get_pi_timer_version()
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%9 = load i32, i32* @stdout
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = tail call i32 (...) @get_run_minutes()
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load i32, i32* @stdout
%15 = tail call i32 (...) @get_random_sleep_minutes()
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.5, i64 0, i64 0), i32 %15)
%17 = load i32, i32* @stdout
%18 = tail call i64 (...) @get_pin()
%19 = trunc i64 %18 to i32
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 %19)
%21 = load i32, i32* @stdout
%22 = tail call i64 (...) @get_run_as_daemon()
%23 = icmp eq i64 %22, 0
%24 = select i1 %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%25 = tail call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @stdout
%27 = tail call i64 (...) @get_server_port()
%28 = trunc i64 %27 to i32
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.10, i64 0, i64 0), i32 %28)
%30 = load i32, i32* @stdout
%31 = tail call i8* (...) @get_up_time_string()
%32 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.11, i64 0, i64 0), i8* %31)
%33 = load i32, i32* @stdout
%34 = tail call i64 (...) @get_use_random()
%35 = icmp eq i64 %34, 0
%36 = select i1 %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.12, i64 0, i64 0), i8* %36)
%38 = load i32, i32* @stdout
%39 = tail call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.13, i64 0, i64 0))
ret void
}