#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 *, ...);
int commandlist() {
  printf("\n");
  int i;
  char *commandlist[50] = {
      "show",        "make",     "view",   "dt",        "ud",
      "ls",          "c",        "edit",   "ifc",       "restart",
      "shutdown",    "ping",     "host",   "about",     "exit",
      "pw",          "goto",     "goback", "newwindow", "netset",
      "edit-netset", "nslookup", "route",  "traceroute"};
  for (i = 0; i < 40; i++) {
    printf("\x1b[32m"
           "%s\t"
           "\x1b[0m",
           commandlist[i]);
    if (commandlist[i + 1] == NULL)
      break;
  }
  printf("\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<commandlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
lea    0xf5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1a0(%rbp),%rdi
lea    0x2b49(%rip),%rsi
mov    $0x190,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x28,-0x4(%rbp)
jge    11ab <commandlist+0x8b>
movslq -0x4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,8),%rsi
ff
lea    0xf0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
cmpq   $0x0,-0x1a0(%rbp,%rax,8)
jne    1198 <commandlist+0x78>
jmp    11ab <commandlist+0x8b>
jmp    119d <commandlist+0x7d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <commandlist+0x38>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandlist>:
push   %rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf3e(%rip),%rbx
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeab(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe93(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe85(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe77(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe70(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe58(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe4c(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3f(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe36(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe2e(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe22(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe16(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe0b(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdff(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdf1(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xde5(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xddb(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdd9(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdc3(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdbe(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdbb(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xda5(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xdac(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [5 x i8] c"show\00"
@.str.2 = [5 x i8] c"make\00"
@.str.3 = [5 x i8] c"view\00"
@.str.4 = [3 x i8] c"dt\00"
@.str.5 = [3 x i8] c"ud\00"
@.str.6 = [3 x i8] c"ls\00"
@.str.7 = [2 x i8] c"c\00"
@.str.8 = [5 x i8] c"edit\00"
@.str.9 = [4 x i8] c"ifc\00"
@.str.10 = [8 x i8] c"restart\00"
@.str.11 = [9 x i8] c"shutdown\00"
@.str.12 = [5 x i8] c"ping\00"
@.str.13 = [5 x i8] c"host\00"
@.str.14 = [6 x i8] c"about\00"
@.str.15 = [5 x i8] c"exit\00"
@.str.16 = [3 x i8] c"pw\00"
@.str.17 = [5 x i8] c"goto\00"
@.str.18 = [7 x i8] c"goback\00"
@.str.19 = [10 x i8] c"newwindow\00"
@.str.20 = [7 x i8] c"netset\00"
@.str.21 = [12 x i8] c"edit-netset\00"
@.str.22 = [9 x i8] c"nslookup\00"
@.str.23 = [6 x i8] c"route\00"
@.str.24 = [11 x i8] c"traceroute\00"
@__const.commandlist.commandlist = <{ [24 x i8*], [26 x i8*] }> <{ [24 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i32 0, i32 0)], [26 x i8*] zeroinitializer }>
@.str.25 = [13 x i8] c"\1B[32m%s\09\1B[0m\00"
@.str.26 = [3 x i8] c"\0A\0A\00"
define i32 @commandlist() {
%1 = alloca i32
%2 = alloca [50 x i8*]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = bitcast [50 x i8*]* %2 to i8*
store i32 0, i32* %1
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 40
br i1 %7, label %8, label %25
8: ; preds = %5
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [50 x i8*], [50 x i8*]* %2, i64 0, i64 %10
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* %12)
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [50 x i8*], [50 x i8*]* %2, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %8
br label %25
21: ; preds = %8
br label %22
22: ; preds = %21
%23 = load i32, i32* %1
%24 = add nsw i32 %23, 1
store i32 %24, i32* %1
br label %5
25: ; preds = %20, %5
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"show\00"
@.str.2 = [5 x i8] c"make\00"
@.str.3 = [5 x i8] c"view\00"
@.str.4 = [3 x i8] c"dt\00"
@.str.5 = [3 x i8] c"ud\00"
@.str.6 = [3 x i8] c"ls\00"
@.str.7 = [2 x i8] c"c\00"
@.str.8 = [5 x i8] c"edit\00"
@.str.9 = [4 x i8] c"ifc\00"
@.str.10 = [8 x i8] c"restart\00"
@.str.11 = [9 x i8] c"shutdown\00"
@.str.12 = [5 x i8] c"ping\00"
@.str.13 = [5 x i8] c"host\00"
@.str.14 = [6 x i8] c"about\00"
@.str.15 = [5 x i8] c"exit\00"
@.str.16 = [3 x i8] c"pw\00"
@.str.17 = [5 x i8] c"goto\00"
@.str.18 = [7 x i8] c"goback\00"
@.str.19 = [10 x i8] c"newwindow\00"
@.str.20 = [7 x i8] c"netset\00"
@.str.21 = [12 x i8] c"edit-netset\00"
@.str.22 = [9 x i8] c"nslookup\00"
@.str.23 = [6 x i8] c"route\00"
@.str.24 = [11 x i8] c"traceroute\00"
@.str.25 = [13 x i8] c"\1B[32m%s\09\1B[0m\00"
@str = [2 x i8] c"\0A\00"
define i32 @commandlist() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.14, i64 0, i64 0))
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0))
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.19, i64 0, i64 0))
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0))
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0))
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0))
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.25, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.24, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}