void help(void) {
  struct help {
    char *thing;
    char *help;
  } * pi;
  static struct help info[] = {
      {0, "Names:"},
      {"rootdev", "Root device"},
      {"ramimagedev", "RAM disk image if root is RAM"},
      {"ramsize", "RAM disk size if root is not RAM"},
      {"bootdev", "Special name for the boot device"},
      {"fd0, hd3, hd2a", "Devices (as in /dev)"},
      {"image", "Name of the kernel image"},
      {"main", "Startup function"},
      {0, "Commands:"},
      {"name = [device] value", "Set environment variable"},
      {"name() { ... }", "Define function"},
      {"name(key,text) { ... }",
       "A menu function like: minix(=,Start Minix) {boot}"},
      {"name", "Call function"},
      {"boot [device]", "Boot Minix or another O.S."},
      {"delay [msec]", "Delay (500 msec default)"},
      {"echo word ...", "Print the words"},
      {"ls [directory]", "List contents of directory"},
      {"menu", "Choose a menu function"},
      {"save", "Save environment"},
      {"set", "Show environment"},
      {"trap msec command", "Schedule command"},
      {"unset name ...", "Unset variable or set to default"},
      {"exit", "Exit to UNIX"},
  };
  for (pi = info; pi < ((info) + (sizeof(info) / sizeof((info)[0]))); pi++) {
    if (pi->thing != 0)
      printf("    %-24s- ", pi->thing);
    printf("%s\n", pi->help);
  }
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0x2f11(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0x2f06(%rip),%rax
add    $0x170,%rax
cmp    %rax,-0x8(%rbp)
jae    1184 <help+0x74>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     115d <help+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0x118b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0x1181(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <help+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
push   %r15
push   %r14
push   %rbx
lea    0x2b84(%rip),%rbx
lea    0x2ced(%rip),%r15
lea    0x11a7(%rip),%r14
jmp    1152 <help+0x32>
nopl   0x0(%rax)
mov    0x8(%rbx),%rdi
call   1030 <puts@plt>
add    $0x10,%rbx
cmp    %r15,%rbx
jae    1166 <help+0x46>
mov    (%rbx),%rsi
test   %rsi,%rsi
je     1140 <help+0x20>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1140 <help+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.help = type { i8*, i8* }
@help.info = internal global [23 x %struct.help] [%struct.help { i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i32 0, i32 0) }, %struct.help { i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.19, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.21, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.25, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.27, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.31, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.33, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.35, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.37, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.39, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.40, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.41, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.42, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.43, i32 0, i32 0) }]
@.str = [7 x i8] c"Names:\00"
@.str.1 = [8 x i8] c"rootdev\00"
@.str.2 = [12 x i8] c"Root device\00"
@.str.3 = [12 x i8] c"ramimagedev\00"
@.str.4 = [30 x i8] c"RAM disk image if root is RAM\00"
@.str.5 = [8 x i8] c"ramsize\00"
@.str.6 = [33 x i8] c"RAM disk size if root is not RAM\00"
@.str.7 = [8 x i8] c"bootdev\00"
@.str.8 = [33 x i8] c"Special name for the boot device\00"
@.str.9 = [15 x i8] c"fd0, hd3, hd2a\00"
@.str.10 = [21 x i8] c"Devices (as in /dev)\00"
@.str.11 = [6 x i8] c"image\00"
@.str.12 = [25 x i8] c"Name of the kernel image\00"
@.str.13 = [5 x i8] c"main\00"
@.str.14 = [17 x i8] c"Startup function\00"
@.str.15 = [10 x i8] c"Commands:\00"
@.str.16 = [22 x i8] c"name = [device] value\00"
@.str.17 = [25 x i8] c"Set environment variable\00"
@.str.18 = [15 x i8] c"name() { ... }\00"
@.str.19 = [16 x i8] c"Define function\00"
@.str.20 = [23 x i8] c"name(key,text) { ... }\00"
@.str.21 = [50 x i8] c"A menu function like: minix(=,Start Minix) {boot}\00"
@.str.22 = [5 x i8] c"name\00"
@.str.23 = [14 x i8] c"Call function\00"
@.str.24 = [14 x i8] c"boot [device]\00"
@.str.25 = [27 x i8] c"Boot Minix or another O.S.\00"
@.str.26 = [13 x i8] c"delay [msec]\00"
@.str.27 = [25 x i8] c"Delay (500 msec default)\00"
@.str.28 = [14 x i8] c"echo word ...\00"
@.str.29 = [16 x i8] c"Print the words\00"
@.str.30 = [15 x i8] c"ls [directory]\00"
@.str.31 = [27 x i8] c"List contents of directory\00"
@.str.32 = [5 x i8] c"menu\00"
@.str.33 = [23 x i8] c"Choose a menu function\00"
@.str.34 = [5 x i8] c"save\00"
@.str.35 = [17 x i8] c"Save environment\00"
@.str.36 = [4 x i8] c"set\00"
@.str.37 = [17 x i8] c"Show environment\00"
@.str.38 = [18 x i8] c"trap msec command\00"
@.str.39 = [17 x i8] c"Schedule command\00"
@.str.40 = [15 x i8] c"unset name ...\00"
@.str.41 = [33 x i8] c"Unset variable or set to default\00"
@.str.42 = [5 x i8] c"exit\00"
@.str.43 = [13 x i8] c"Exit to UNIX\00"
@.str.44 = [12 x i8] c" %-24s- \00"
@.str.45 = [4 x i8] c"%s\0A\00"
define void @help() {
%1 = alloca %struct.help*
store %struct.help* getelementptr inbounds ([23 x %struct.help], [23 x %struct.help]* @help.info, i64 0, i64 0), %struct.help** %1
br label %2
2: ; preds = %20, %0
%3 = load %struct.help*, %struct.help** %1
%4 = icmp ult %struct.help* %3, getelementptr inbounds ([23 x %struct.help], [23 x %struct.help]* @help.info, i64 1, i64 0)
br i1 %4, label %5, label %23
5: ; preds = %2
%6 = load %struct.help*, %struct.help** %1
%7 = getelementptr inbounds %struct.help, %struct.help* %6, i32 0, i32 0
%8 = load i8*, i8** %7
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load %struct.help*, %struct.help** %1
%12 = getelementptr inbounds %struct.help, %struct.help* %11, i32 0, i32 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.44, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %10, %5
%16 = load %struct.help*, %struct.help** %1
%17 = getelementptr inbounds %struct.help, %struct.help* %16, i32 0, i32 1
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.45, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %15
%21 = load %struct.help*, %struct.help** %1
%22 = getelementptr inbounds %struct.help, %struct.help* %21, i32 1
store %struct.help* %22, %struct.help** %1
br label %2
23: ; preds = %2
ret void
}

LLVM IR (-O2):
%struct.help = type { i8*, i8* }
@help.info = internal constant [23 x %struct.help] [%struct.help { i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.12, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.14, i32 0, i32 0) }, %struct.help { i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.17, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.19, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.21, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.23, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.25, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.27, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.29, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.31, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.33, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.35, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.37, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.39, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.40, i32 0, i32 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.41, i32 0, i32 0) }, %struct.help { i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.42, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.43, i32 0, i32 0) }]
@.str = [7 x i8] c"Names:\00"
@.str.1 = [8 x i8] c"rootdev\00"
@.str.2 = [12 x i8] c"Root device\00"
@.str.3 = [12 x i8] c"ramimagedev\00"
@.str.4 = [30 x i8] c"RAM disk image if root is RAM\00"
@.str.5 = [8 x i8] c"ramsize\00"
@.str.6 = [33 x i8] c"RAM disk size if root is not RAM\00"
@.str.7 = [8 x i8] c"bootdev\00"
@.str.8 = [33 x i8] c"Special name for the boot device\00"
@.str.9 = [15 x i8] c"fd0, hd3, hd2a\00"
@.str.10 = [21 x i8] c"Devices (as in /dev)\00"
@.str.11 = [6 x i8] c"image\00"
@.str.12 = [25 x i8] c"Name of the kernel image\00"
@.str.13 = [5 x i8] c"main\00"
@.str.14 = [17 x i8] c"Startup function\00"
@.str.15 = [10 x i8] c"Commands:\00"
@.str.16 = [22 x i8] c"name = [device] value\00"
@.str.17 = [25 x i8] c"Set environment variable\00"
@.str.18 = [15 x i8] c"name() { ... }\00"
@.str.19 = [16 x i8] c"Define function\00"
@.str.20 = [23 x i8] c"name(key,text) { ... }\00"
@.str.21 = [50 x i8] c"A menu function like: minix(=,Start Minix) {boot}\00"
@.str.22 = [5 x i8] c"name\00"
@.str.23 = [14 x i8] c"Call function\00"
@.str.24 = [14 x i8] c"boot [device]\00"
@.str.25 = [27 x i8] c"Boot Minix or another O.S.\00"
@.str.26 = [13 x i8] c"delay [msec]\00"
@.str.27 = [25 x i8] c"Delay (500 msec default)\00"
@.str.28 = [14 x i8] c"echo word ...\00"
@.str.29 = [16 x i8] c"Print the words\00"
@.str.30 = [15 x i8] c"ls [directory]\00"
@.str.31 = [27 x i8] c"List contents of directory\00"
@.str.32 = [5 x i8] c"menu\00"
@.str.33 = [23 x i8] c"Choose a menu function\00"
@.str.34 = [5 x i8] c"save\00"
@.str.35 = [17 x i8] c"Save environment\00"
@.str.36 = [4 x i8] c"set\00"
@.str.37 = [17 x i8] c"Show environment\00"
@.str.38 = [18 x i8] c"trap msec command\00"
@.str.39 = [17 x i8] c"Schedule command\00"
@.str.40 = [15 x i8] c"unset name ...\00"
@.str.41 = [33 x i8] c"Unset variable or set to default\00"
@.str.42 = [5 x i8] c"exit\00"
@.str.43 = [13 x i8] c"Exit to UNIX\00"
@.str.44 = [12 x i8] c" %-24s- \00"
define void @help() {
br label %1
1: ; preds = %0, %8
%2 = phi %struct.help* [ getelementptr inbounds ([23 x %struct.help], [23 x %struct.help]* @help.info, i64 0, i64 0), %0 ], [ %12, %8 ]
%3 = getelementptr inbounds %struct.help, %struct.help* %2, i64 0, i32 0
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.44, i64 0, i64 0), i8* %4)
br label %8
8: ; preds = %6, %1
%9 = getelementptr inbounds %struct.help, %struct.help* %2, i64 0, i32 1
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = getelementptr inbounds %struct.help, %struct.help* %2, i64 1
%13 = icmp ult %struct.help* %12, getelementptr inbounds ([23 x %struct.help], [23 x %struct.help]* @help.info, i64 1, i64 0)
br i1 %13, label %1, label %14
14: ; preds = %8
ret void
}