#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *getprogname();
int /*<<< orphan*/ printf(char *, ...);
void usage(void) {
  printf("Usage:  %s [options]\n", getprogname());
  printf("  Version: %s\n", "1.0");
  printf("  -w  --wait	   Set scan period in msec (500 = 1/2sec)\n");
  printf("  -s  --scan       Set scan period in sec\n");
  printf("  -V  --verbose    Print verbose messages\n");
  printf("  -d  --debug      Turn on debug messages\n");
  printf("  -h  --help       Display this usage info\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    %rax,%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %eax,%eax
call   1040 <getprogname@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0xebe(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf39(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [15 x i8] c" Version: %s\0A\00"
@.str.2 = [4 x i8] c"1.0\00"
@.str.3 = [56 x i8] c" -w --wait\09 Set scan period in msec (500 = 1/2sec)\0A\00"
@.str.4 = [43 x i8] c" -s --scan Set scan period in sec\0A\00"
@.str.5 = [43 x i8] c" -V --verbose Print verbose messages\0A\00"
@.str.6 = [43 x i8] c" -d --debug Turn on debug messages\0A\00"
@.str.7 = [44 x i8] c" -h --help Display this usage info\0A\00"
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = call i8* (...) @getprogname()
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage: %s [options]\0A\00"
@.str.1 = [15 x i8] c" Version: %s\0A\00"
@.str.2 = [4 x i8] c"1.0\00"
@EXIT_SUCCESS = global i32 0
@str = [55 x i8] c" -w --wait\09 Set scan period in msec (500 = 1/2sec)\00"
@str.8 = [42 x i8] c" -s --scan Set scan period in sec\00"
@str.9 = [42 x i8] c" -V --verbose Print verbose messages\00"
@str.10 = [42 x i8] c" -d --debug Turn on debug messages\00"
@str.11 = [43 x i8] c" -h --help Display this usage info\00"
define void @usage() {
%1 = tail call i8* (...) @getprogname()
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.9, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.11, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}