#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(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ stdout;
int print_usage() {
  printf("Usage: %s [adhln?] <args>\n", "quotesbook");
  fputs(
      "  \n  -l                          list all entries in db\n  -d <num>    "
      "                delete entry with <num>\n  -a                          "
      "append new record to db\n  -h, -?                      show this help\n",
      stdout);
  printf("\nExamples:\n\n  %s -n 10            shows record #10 from db\n  %s "
         "-l               shows list of all records\n",
         "quotesbook", "quotesbook");
  exit(0);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0xecd(%rip),%rdi
call   1040 <fputs@plt>
lea    0xf93(%rip),%rdi
lea    0xeaf(%rip),%rdx
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xedc(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0xecd(%rip),%rdi
call   1040 <fputs@plt>
lea    0xf93(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s [adhln?] <args>\0A\00"
@.str.1 = [11 x i8] c"quotesbook\00"
@.str.2 = [210 x i8] c" \0A -l list all entries in db\0A -d <num> delete entry with <num>\0A -a append new record to db\0A -h, -? show this help\0A\00"
@stdout = global i32 0
@.str.3 = [108 x i8] c"\0AExamples:\0A\0A %s -n 10 shows record from db\0A %s -l shows list of all records\0A\00"
define i32 @print_usage() {
%1 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fputs(i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s [adhln?] <args>\0A\00"
@.str.1 = [11 x i8] c"quotesbook\00"
@.str.2 = [210 x i8] c" \0A -l list all entries in db\0A -d <num> delete entry with <num>\0A -a append new record to db\0A -h, -? show this help\0A\00"
@stdout = global i32 0
@.str.3 = [108 x i8] c"\0AExamples:\0A\0A %s -n 10 shows record from db\0A %s -l shows list of all records\0A\00"
define i32 @print_usage() {
%1 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([210 x i8], [210 x i8]* @.str.2, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 0)
unreachable
}