#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*/ printf(char *, char const *);
void print_usage(const char *cmd) {
  printf("%s -h: show this help\n", cmd);
  printf("%s -c\"message\" <shm name>:"
         " initialiaze a shm\n",
         cmd);
  printf("%s -d <shm name>:"
         " delete a shm\n",
         cmd);
  printf("%s -r\"N\" <shm name>:"
         " read N times from a shm with a small pause between each "
         "reading\n",
         cmd);
  printf("%s -w\"message\" <shm name>:"
         " write to a shm\n",
         cmd);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xefe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xf54(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf64(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s -h: show this help\0A\00"
@.str.1 = [46 x i8] c"%s -c\22message\22 <shm name>: initialiaze a shm\0A\00"
@.str.2 = [32 x i8] c"%s -d <shm name>: delete a shm\0A\00"
@.str.3 = [86 x i8] c"%s -r\22N\22 <shm name>: read N times from a shm with a small pause between each reading\0A\00"
@.str.4 = [43 x i8] c"%s -w\22message\22 <shm name>: write to a shm\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s -h: show this help\0A\00"
@.str.1 = [46 x i8] c"%s -c\22message\22 <shm name>: initialiaze a shm\0A\00"
@.str.2 = [32 x i8] c"%s -d <shm name>: delete a shm\0A\00"
@.str.3 = [86 x i8] c"%s -r\22N\22 <shm name>: read N times from a shm with a small pause between each reading\0A\00"
@.str.4 = [43 x i8] c"%s -w\22message\22 <shm name>: write to a shm\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.3, i64 0, i64 0), i8* %0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0), i8* %0)
ret void
}