#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);
int /*<<< orphan*/ printf(char *, ...);
void print_usage(const char *name, int exit_code) {
  printf("Usage: %s [OPTIONS]\n", name);
  printf("  -d --dir      The shared memory directory\n");
  printf("                default = \"%s\"\n", ".");
  printf("  -i --id       The shared memory identifier\n");
  printf("                default = %d\n", 1);
  printf("  -h, --help    Print this message\n");
  printf("\n");
  exit(exit_code);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
lea    0xf05(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf19(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xefa(%rip),%rdi
call   1040 <puts@plt>
lea    0xeae(%rip),%rdi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf05(%rip),%rdi
call   1040 <puts@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf13(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@.str.1 = [45 x i8] c" -d --dir The shared memory directory\0A\00"
@.str.2 = [32 x i8] c" default = \22%s\22\0A\00"
@.str.3 = [2 x i8] c".\00"
@.str.4 = [46 x i8] c" -i --id The shared memory identifier\0A\00"
@.str.5 = [30 x i8] c" default = %d\0A\00"
@.str.6 = [36 x i8] c" -h, --help Print this message\0A\00"
@.str.7 = [2 x i8] c"\0A\00"
define void @print_usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 1)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%13 = load i32, i32* %4
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s [OPTIONS]\0A\00"
@.str.2 = [32 x i8] c" default = \22%s\22\0A\00"
@.str.3 = [2 x i8] c".\00"
@.str.5 = [30 x i8] c" default = %d\0A\00"
@str = [44 x i8] c" -d --dir The shared memory directory\00"
@str.8 = [45 x i8] c" -i --id The shared memory identifier\00"
@str.9 = [35 x i8] c" -h, --help Print this message\00"
define void @print_usage(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.8, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.9, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @exit(i32 %1)
unreachable
}