#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 *, char *, char *);
void help(char *cmd_name) {
  printf("shm_rampin 1.0\n"
         "Locks/unlocks Linux shared memory segments in RAM,"
         " so they're never swapped.\n"
         "(This is linux only. In BSD, use sysctl kern.ipc.shm_use_phys)\n\n"
         "Usage: %s [OPTIONS]\n\n"
         "Options:\n"
         "  -l               locks shared memory segments\n"
         "  -u               unlocks shared memory segments\n"
         "  -i <shmid>       performs the action in a specific shmid\n"
         "                   (ipcs -m for a list)\n"
         "  -U <user_name>   performs the action in all the shmems that\n"
         "                   belong to a given user\n"
         "  -h               displays this help message\n"
         "\n\n"
         "For instance to lock all the shared memory segments that belong to\n"
         "the `postgres` user in RAM:\n\n"
         "    %s -l -U postgres\n"
         "\n"
         "And to unlock them:\n\n"
         "    %s -u -U postgres\n"
         "\n",
         cmd_name, cmd_name, cmd_name);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [699 x i8] c"shm_rampin 1.0\0ALocks/unlocks Linux shared memory segments in RAM, so they're never swapped.\0A(This is linux only. In BSD, use sysctl kern.ipc.shm_use_phys)\0A\0AUsage: %s [OPTIONS]\0A\0AOptions:\0A -l locks shared memory segments\0A -u unlocks shared memory segments\0A -i <shmid> performs the action in a specific shmid\0A (ipcs -m for a list)\0A -U <user_name> performs the action in all the shmems that\0A belong to a given user\0A -h displays this help message\0A\0A\0AFor instance to lock all the shared memory segments that belong to\0Athe `postgres` user in RAM:\0A\0A %s -l -U postgres\0A\0AAnd to unlock them:\0A\0A %s -u -U postgres\0A\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([699 x i8], [699 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [699 x i8] c"shm_rampin 1.0\0ALocks/unlocks Linux shared memory segments in RAM, so they're never swapped.\0A(This is linux only. In BSD, use sysctl kern.ipc.shm_use_phys)\0A\0AUsage: %s [OPTIONS]\0A\0AOptions:\0A -l locks shared memory segments\0A -u unlocks shared memory segments\0A -i <shmid> performs the action in a specific shmid\0A (ipcs -m for a list)\0A -U <user_name> performs the action in all the shmems that\0A belong to a given user\0A -h displays this help message\0A\0A\0AFor instance to lock all the shared memory segments that belong to\0Athe `postgres` user in RAM:\0A\0A %s -l -U postgres\0A\0AAnd to unlock them:\0A\0A %s -u -U postgres\0A\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([699 x i8], [699 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0)
ret void
}