#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*/ die(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stdout;
void usage(int status, int errno) {
  fprintf(stdout, "%s %s -- a simple calendar.\n", "kapan", "0.0.0");
  fprintf(stdout, "Usage: %s [options]...\n", "kapan");
  fprintf(stdout,
          "-d, --date STRING	Display what's happening on the period "
          "STRING\n-f, --file FILE		Use FILE as database\n-r, "
          "--remove ID		Remove event ID\n-a, --add STRING	Add "
          "event STRING\n-m, --move STRING	Move event to another "
          "date\n-l, --list		List all events\n-e, --edit	"
          "	Edit the database in your favorite editor\n-h, --help	"
          "	Display this help message\n");
  fprintf(stdout,
          "Event STRING should be of the format \"STARTTIME["
          "|"
          "ENDTIME]"
          "|"
          "DESCRIPTION\".\nPeriod STRING should be of the format \"[STARTTIME"
          "|"
          "]ENDTIME\". If no STARTTIME is provided, current time is "
          "assumed.\nMove STRING should be of the format \"ID"
          "|"
          "STARTTIME["
          "|"
          "ENDTIME]\".\n");
  die(status, errno);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
lea    0xed8(%rip),%rdx
lea    0xed7(%rip),%rcx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
lea    0xeb3(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
lea    0xff8(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%r15d
mov    0x2eac(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xec2(%rip),%rsi
lea    0xed8(%rip),%rbx
lea    0xed7(%rip),%rcx
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xec9(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0xecd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x0(%rbp),%edi
lea    0x100b(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %r15d,%edi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <die@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [29 x i8] c"%s %s -- a simple calendar.\0A\00"
@.str.1 = [6 x i8] c"kapan\00"
@.str.2 = [6 x i8] c"0.0.0\00"
@.str.3 = [24 x i8] c"Usage: %s [options]...\0A\00"
@.str.4 = [335 x i8] c"-d, --date STRING\09Display what's happening on the period STRING\0A-f, --file FILE\09\09Use FILE as database\0A-r, --remove ID\09\09Remove event ID\0A-a, --add STRING\09Add event STRING\0A-m, --move STRING\09Move event to another date\0A-l, --list\09\09List all events\0A-e, --edit\09\09Edit the database in your favorite editor\0A-h, --help\09\09Display this help message\0A\00"
@.str.5 = [250 x i8] c"Event STRING should be of the format \22STARTTIME[|ENDTIME]|DESCRIPTION\22.\0APeriod STRING should be of the format \22[STARTTIME|]ENDTIME\22. If no STARTTIME is provided, current time is assumed.\0AMove STRING should be of the format \22ID|STARTTIME[|ENDTIME]\22.\0A\00"
define void @usage(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([335 x i8], [335 x i8]* @.str.4, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([250 x i8], [250 x i8]* @.str.5, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @die(i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [29 x i8] c"%s %s -- a simple calendar.\0A\00"
@.str.1 = [6 x i8] c"kapan\00"
@.str.2 = [6 x i8] c"0.0.0\00"
@.str.3 = [24 x i8] c"Usage: %s [options]...\0A\00"
@.str.4 = [335 x i8] c"-d, --date STRING\09Display what's happening on the period STRING\0A-f, --file FILE\09\09Use FILE as database\0A-r, --remove ID\09\09Remove event ID\0A-a, --add STRING\09Add event STRING\0A-m, --move STRING\09Move event to another date\0A-l, --list\09\09List all events\0A-e, --edit\09\09Edit the database in your favorite editor\0A-h, --help\09\09Display this help message\0A\00"
@.str.5 = [250 x i8] c"Event STRING should be of the format \22STARTTIME[|ENDTIME]|DESCRIPTION\22.\0APeriod STRING should be of the format \22[STARTTIME|]ENDTIME\22. If no STARTTIME is provided, current time is assumed.\0AMove STRING should be of the format \22ID|STARTTIME[|ENDTIME]\22.\0A\00"
define void @usage(i32 %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([335 x i8], [335 x i8]* @.str.4, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([250 x i8], [250 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @die(i32 %0, i32 %1)
ret void
}