#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 printUsage(const char *name) {
  printf(
      "%s [--help]\n"
      "\n"
      "This program acts as an interactive client for membroker, allowing\n"
      "one to request and return pages to the membroker pool, and query\n"
      "the current state of membroker and available pages.\n"
      "\n"
      "Below is a summary of the commands available:\n"
      "  reserve [pages]: Makes a high-anxiety request for memory pages from\n"
      "                   membroker. Membroker will return either 0 pages or\n"
      "                   the full amount requested, and will make every "
      "effort\n"
      "                   to procure memory from other clients, possibly\n"
      "                   blocking for an indefinitely long period of time.\n"
      "\n"
      "  reserve-all      Iteratively makes high anxiety requests to "
      "membroker,\n"
      "                   eventually reserving all possible pages.\n"
      "\n"
      "  request [pages]: Makes a low-anxiety request for memory pages from\n"
      "                   membroker. Membroker may return fewer pages than\n"
      "                   requested and will only attempt to procure easily\n"
      "                   available memory but will not block indefinitely.\n"
      "\n"
      "  return [pages]:  Return a number of pages previously requested to\n"
      "                   membroker.\n"
      "\n"
      "  query:           Print this client's current page balance (i.e. the\n"
      "                   number of source pages it has made available to\n"
      "                   membroker - the number of pages membroker has\n"
      "                   borrowed + the number of pages the client has\n"
      "                   borrowed)\n"
      "\n"
      "  query-server:    print the total number of pages currently in\n"
      "                   membroker's own pool.\n"
      "\n"
      "  query-total:     print the total number of pages membroker could\n"
      "                   theorectically loan out; equal to the sum of its "
      "own\n"
      "                   pages plus the maximum number of source pages\n"
      "                   contributed by all the source clients.\n"
      "\n"
      "  end:             Terminate the connection to membroker and exit\n"
      "\n",
      name);
}


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

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

LLVM IR (-O0):
@.str = [1836 x i8] c"%s [--help]\0A\0AThis program acts as an interactive client for membroker, allowing\0Aone to request and return pages to the membroker pool, and query\0Athe current state of membroker and available pages.\0A\0ABelow is a summary of the commands available:\0A reserve [pages]: Makes a high-anxiety request for memory pages from\0A membroker. Membroker will return either 0 pages or\0A the full amount requested, and will make every effort\0A to procure memory from other clients, possibly\0A blocking for an indefinitely long period of time.\0A\0A reserve-all Iteratively makes high anxiety requests to membroker,\0A eventually reserving all possible pages.\0A\0A request [pages]: Makes a low-anxiety request for memory pages from\0A membroker. Membroker may return fewer pages than\0A requested and will only attempt to procure easily\0A available memory but will not block indefinitely.\0A\0A return [pages]: Return a number of pages previously requested to\0A membroker.\0A\0A query: Print this client's current page balance (i.e. the\0A number of source pages it has made available to\0A membroker - the number of pages membroker has\0A borrowed + the number of pages the client has\0A borrowed)\0A\0A query-server: print the total number of pages currently in\0A membroker's own pool.\0A\0A query-total: print the total number of pages membroker could\0A theorectically loan out; equal to the sum of its own\0A pages plus the maximum number of source pages\0A contributed by all the source clients.\0A\0A end: Terminate the connection to membroker and exit\0A\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([1836 x i8], [1836 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [1836 x i8] c"%s [--help]\0A\0AThis program acts as an interactive client for membroker, allowing\0Aone to request and return pages to the membroker pool, and query\0Athe current state of membroker and available pages.\0A\0ABelow is a summary of the commands available:\0A reserve [pages]: Makes a high-anxiety request for memory pages from\0A membroker. Membroker will return either 0 pages or\0A the full amount requested, and will make every effort\0A to procure memory from other clients, possibly\0A blocking for an indefinitely long period of time.\0A\0A reserve-all Iteratively makes high anxiety requests to membroker,\0A eventually reserving all possible pages.\0A\0A request [pages]: Makes a low-anxiety request for memory pages from\0A membroker. Membroker may return fewer pages than\0A requested and will only attempt to procure easily\0A available memory but will not block indefinitely.\0A\0A return [pages]: Return a number of pages previously requested to\0A membroker.\0A\0A query: Print this client's current page balance (i.e. the\0A number of source pages it has made available to\0A membroker - the number of pages membroker has\0A borrowed + the number of pages the client has\0A borrowed)\0A\0A query-server: print the total number of pages currently in\0A membroker's own pool.\0A\0A query-total: print the total number of pages membroker could\0A theorectically loan out; equal to the sum of its own\0A pages plus the maximum number of source pages\0A contributed by all the source clients.\0A\0A end: Terminate the connection to membroker and exit\0A\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([1836 x i8], [1836 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}