#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 */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ curutil_attrset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ curutil_window_fill(int /*<<< orphan*/ *, char);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ waddch(int /*<<< orphan*/ *, char const);
int /*<<< orphan*/ waddstr(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ wborder(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ werase(int /*<<< orphan*/ *);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void help_show() {
  int termwidth, termheight;
  const char *p;
  int i;
  int ch;
  WINDOW *w;
  getmaxyx(stdscr, termheight, termwidth);
  w = newwin(25, 80, (termheight - 25) / 2, (termwidth - 80) / 2);
  werase(w);
  curutil_attrset(w, 0xF4);
  curutil_window_fill(w, ' ');
  wborder(w, 0, 0, 0, 0, 0, 0, 0, 0);
  wmove(w, 0, 3);
  waddstr(w, "[ Help ]");
  wmove(w, i = 1, 1);
  p = "Omnitty allows you to ssh into several machines at once. The list on "
      "the\n"
      "shows the machines you are logged into. Every key you type will be "
      "sent\n"
      "to the currently selected machine, except the following {control "
      "keys}:\n"
      "\n"
      "{F1}: brings up a menu of extended options (including {quit})\n"
      "{F2} and {F3}: move between machines on the list. The terminal window\n"
      "      on the right shows the display of the currently selected "
      "machine.\n"
      "{F4}: tag current machine. This will put a mark on the machine's name.\n"
      "      The mark by itself does nothing, but some features operate on\n"
      "      'all tagged machines', so this is a way to indicate which "
      "machines\n"
      "      they are to operate on. The {F1} menu has additional tag "
      "commands.\n"
      "{F5}: allows you to add a machine to the list. You can either supply "
      "the\n"
      "      name of the machine you want to add, or type {@file} where "
      "{file}\n"
      "      is the name of a file that contains machine names one per line,\n"
      "      in which case all machines in that file will be added.\n"
      "{F6}: delete current machine. If you want to delete multiple machines,\n"
      "      you can also tag them and choose {delete all tagged machines} "
      "from\n"
      "      the {F1} menu.\n"
      "{F7}: toggles between {singlecast} and {multicast} mode. In singlecast\n"
      "      mode, the keys you type will be directed to the currently "
      "selected\n"
      "      machine, regardless of tags. When {multicast} is selected, the\n"
      "      keys will be sent to {all tagged machines}, allowing you to "
      "operate\n"
      "      on several machines at once.\n";
  while (*p) {
    if (*p == '{')
      curutil_attrset(w, 0xE4);
    else if (*p == '}')
      curutil_attrset(w, 0xF4);
    else if (*p == '\n')
      wmove(w, ++i, 1);
    else
      waddch(w, *p);
    p++;
  }
  wrefresh(w);
  while (0 > (ch = getch()))
    ;
  delwin(w);
}


x86 assembly (clang, -O0):
<help_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x2e19(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
call   1090 <getmaxyx@plt>
mov    -0x8(%rbp),%eax
sub    $0x19,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x50,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
mov    $0x19,%edi
mov    $0x50,%esi
call   1080 <newwin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   10e0 <werase@plt>
mov    -0x20(%rbp),%rdi
mov    $0xf4,%esi
call   1050 <curutil_attrset@plt>
mov    -0x20(%rbp),%rdi
mov    $0x20,%esi
call   10d0 <curutil_window_fill@plt>
mov    -0x20(%rbp),%rdi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1060 <wborder@plt>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   10c0 <wmove@plt>
mov    -0x20(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1030 <waddstr@plt>
mov    -0x20(%rbp),%rdi
movl   $0x1,-0x14(%rbp)
mov    $0x1,%edx
mov    %edx,%esi
call   10c0 <wmove@plt>
lea    0xd64(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1353 <help_show+0x193>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7b,%eax
jne    12d9 <help_show+0x119>
mov    -0x20(%rbp),%rdi
mov    $0xe4,%esi
call   1050 <curutil_attrset@plt>
jmp    1342 <help_show+0x182>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7d,%eax
jne    12fc <help_show+0x13c>
mov    -0x20(%rbp),%rdi
mov    $0xf4,%esi
call   1050 <curutil_attrset@plt>
jmp    133d <help_show+0x17d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1328 <help_show+0x168>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
mov    $0x1,%edx
call   10c0 <wmove@plt>
jmp    1338 <help_show+0x178>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1040 <waddch@plt>
jmp    133d <help_show+0x17d>
jmp    1342 <help_show+0x182>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    12a9 <help_show+0xe9>
mov    -0x20(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    $0x0,%al
call   10b0 <getch@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
jle    1377 <help_show+0x1b7>
jmp    135c <help_show+0x19c>
mov    -0x20(%rbp),%rdi
call   10a0 <delwin@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_show>:
push   %rbp
push   %r14
push   %rbx
mov    0x2e1d(%rip),%rax
mov    (%rax),%edi
call   1090 <getmaxyx@plt>
mov    $0x19,%edi
mov    $0x50,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1080 <newwin@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   10e0 <werase@plt>
mov    %r14,%rdi
mov    $0xf4,%esi
call   1050 <curutil_attrset@plt>
mov    %r14,%rdi
mov    $0x20,%esi
call   10d0 <curutil_window_fill@plt>
sub    $0x8,%rsp
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
call   1060 <wborder@plt>
add    $0x20,%rsp
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   10c0 <wmove@plt>
lea    0xdbe(%rip),%rsi
mov    %r14,%rdi
call   1030 <waddstr@plt>
mov    $0x1,%ebp
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   10c0 <wmove@plt>
lea    0xda1(%rip),%rbx
jmp    1281 <help_show+0xc1>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0xf4,%esi
call   1050 <curutil_attrset@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0x7a,%al
jle    12a0 <help_show+0xe0>
cmp    $0x7d,%al
je     1270 <help_show+0xb0>
cmp    $0x7b,%al
jne    12c0 <help_show+0x100>
mov    %r14,%rdi
mov    $0xe4,%esi
jmp    1278 <help_show+0xb8>
nopw   0x0(%rax,%rax,1)
cmp    $0xa,%al
jne    12bc <help_show+0xfc>
add    $0x1,%ebp
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
call   10c0 <wmove@plt>
add    $0x1,%rbx
jmp    1281 <help_show+0xc1>
test   %al,%al
je     12d1 <help_show+0x111>
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <waddch@plt>
add    $0x1,%rbx
jmp    1281 <help_show+0xc1>
mov    %r14,%rdi
call   1070 <wrefresh@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   10b0 <getch@plt>
test   %eax,%eax
js     12e0 <help_show+0x120>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    10a0 <delwin@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@.str = [9 x i8] c"[ Help ]\00"
@.str.1 = [1471 x i8] c"Omnitty allows you to ssh into several machines at once. The list on the\0Ashows the machines you are logged into. Every key you type will be sent\0Ato the currently selected machine, except the following {control keys}:\0A\0A{F1}: brings up a menu of extended options (including {quit})\0A{F2} and {F3}: move between machines on the list. The terminal window\0A on the right shows the display of the currently selected machine.\0A{F4}: tag current machine. This will put a mark on the machine's name.\0A The mark by itself does nothing, but some features operate on\0A 'all tagged machines', so this is a way to indicate which machines\0A they are to operate on. The {F1} menu has additional tag commands.\0A{F5}: allows you to add a machine to the list. You can either supply the\0A name of the machine you want to add, or type {@file} where {file}\0A is the name of a file that contains machine names one per line,\0A in which case all machines in that file will be added.\0A{F6}: delete current machine. If you want to delete multiple machines,\0A you can also tag them and choose {delete all tagged machines} from\0A the {F1} menu.\0A{F7}: toggles between {singlecast} and {multicast} mode. In singlecast\0A mode, the keys you type will be directed to the currently selected\0A machine, regardless of tags. When {multicast} is selected, the\0A keys will be sent to {all tagged machines}, allowing you to operate\0A on several machines at once.\0A\00"
define void @help_show() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = load i32, i32* @stdscr
%8 = load i32, i32* %2
%9 = load i32, i32* %1
%10 = call i32 @getmaxyx(i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 25
%13 = sdiv i32 %12, 2
%14 = load i32, i32* %1
%15 = sub nsw i32 %14, 80
%16 = sdiv i32 %15, 2
%17 = call i32* @newwin(i32 25, i32 80, i32 %13, i32 %16)
store i32* %17, i32** %6
%18 = load i32*, i32** %6
%19 = call i32 @werase(i32* %18)
%20 = load i32*, i32** %6
%21 = call i32 @curutil_attrset(i32* %20, i32 244)
%22 = load i32*, i32** %6
%23 = call i32 @curutil_window_fill(i32* %22, i8 signext 32)
%24 = load i32*, i32** %6
%25 = call i32 @wborder(i32* %24, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%26 = load i32*, i32** %6
%27 = call i32 @wmove(i32* %26, i32 0, i32 3)
%28 = load i32*, i32** %6
%29 = call i32 @waddstr(i32* %28, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%30 = load i32*, i32** %6
store i32 1, i32* %4
%31 = call i32 @wmove(i32* %30, i32 1, i32 1)
store i8* getelementptr inbounds ([1471 x i8], [1471 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %32
32: ; preds = %69, %0
%33 = load i8*, i8** %3
%34 = load i8, i8* %33
%35 = icmp ne i8 %34, 0
br i1 %35, label %36, label %72
36: ; preds = %32
%37 = load i8*, i8** %3
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 123
br i1 %40, label %41, label %44
41: ; preds = %36
%42 = load i32*, i32** %6
%43 = call i32 @curutil_attrset(i32* %42, i32 228)
br label %69
44: ; preds = %36
%45 = load i8*, i8** %3
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 125
br i1 %48, label %49, label %52
49: ; preds = %44
%50 = load i32*, i32** %6
%51 = call i32 @curutil_attrset(i32* %50, i32 244)
br label %68
52: ; preds = %44
%53 = load i8*, i8** %3
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 10
br i1 %56, label %57, label %62
57: ; preds = %52
%58 = load i32*, i32** %6
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
%61 = call i32 @wmove(i32* %58, i32 %60, i32 1)
br label %67
62: ; preds = %52
%63 = load i32*, i32** %6
%64 = load i8*, i8** %3
%65 = load i8, i8* %64
%66 = call i32 @waddch(i32* %63, i8 signext %65)
br label %67
67: ; preds = %62, %57
br label %68
68: ; preds = %67, %49
br label %69
69: ; preds = %68, %41
%70 = load i8*, i8** %3
%71 = getelementptr inbounds i8, i8* %70, i32 1
store i8* %71, i8** %3
br label %32
72: ; preds = %32
%73 = load i32*, i32** %6
%74 = call i32 @wrefresh(i32* %73)
br label %75
75: ; preds = %78, %72
%76 = call i32 (...) @getch()
store i32 %76, i32* %5
%77 = icmp sgt i32 0, %76
br i1 %77, label %78, label %79
78: ; preds = %75
br label %75
79: ; preds = %75
%80 = load i32*, i32** %6
%81 = call i32 @delwin(i32* %80)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@.str = [9 x i8] c"[ Help ]\00"
@.str.1 = [1471 x i8] c"Omnitty allows you to ssh into several machines at once. The list on the\0Ashows the machines you are logged into. Every key you type will be sent\0Ato the currently selected machine, except the following {control keys}:\0A\0A{F1}: brings up a menu of extended options (including {quit})\0A{F2} and {F3}: move between machines on the list. The terminal window\0A on the right shows the display of the currently selected machine.\0A{F4}: tag current machine. This will put a mark on the machine's name.\0A The mark by itself does nothing, but some features operate on\0A 'all tagged machines', so this is a way to indicate which machines\0A they are to operate on. The {F1} menu has additional tag commands.\0A{F5}: allows you to add a machine to the list. You can either supply the\0A name of the machine you want to add, or type {@file} where {file}\0A is the name of a file that contains machine names one per line,\0A in which case all machines in that file will be added.\0A{F6}: delete current machine. If you want to delete multiple machines,\0A you can also tag them and choose {delete all tagged machines} from\0A the {F1} menu.\0A{F7}: toggles between {singlecast} and {multicast} mode. In singlecast\0A mode, the keys you type will be directed to the currently selected\0A machine, regardless of tags. When {multicast} is selected, the\0A keys will be sent to {all tagged machines}, allowing you to operate\0A on several machines at once.\0A\00"
define void @help_show() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @getmaxyx(i32 %1, i32 undef, i32 undef)
%3 = tail call i32* @newwin(i32 25, i32 80, i32 0, i32 0)
%4 = tail call i32 @werase(i32* %3)
%5 = tail call i32 @curutil_attrset(i32* %3, i32 244)
%6 = tail call i32 @curutil_window_fill(i32* %3, i8 signext 32)
%7 = tail call i32 @wborder(i32* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
%8 = tail call i32 @wmove(i32* %3, i32 0, i32 3)
%9 = tail call i32 @waddstr(i32* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @wmove(i32* %3, i32 1, i32 1)
br label %11
11: ; preds = %24, %0
%12 = phi i32 [ 1, %0 ], [ %25, %24 ]
%13 = phi i8* [ getelementptr inbounds ([1471 x i8], [1471 x i8]* @.str.1, i64 0, i64 0), %0 ], [ %26, %24 ]
%14 = load i8, i8* %13
switch i8 %14, label %22 [
i8 0, label %27
i8 123, label %15
i8 125, label %17
i8 10, label %19
]
15: ; preds = %11
%16 = tail call i32 @curutil_attrset(i32* %3, i32 228)
br label %24
17: ; preds = %11
%18 = tail call i32 @curutil_attrset(i32* %3, i32 244)
br label %24
19: ; preds = %11
%20 = add nsw i32 %12, 1
%21 = tail call i32 @wmove(i32* %3, i32 %20, i32 1)
br label %24
22: ; preds = %11
%23 = tail call i32 @waddch(i32* %3, i8 signext %14)
br label %24
24: ; preds = %17, %22, %19, %15
%25 = phi i32 [ %12, %15 ], [ %12, %17 ], [ %20, %19 ], [ %12, %22 ]
%26 = getelementptr inbounds i8, i8* %13, i64 1
br label %11
27: ; preds = %11
%28 = tail call i32 @wrefresh(i32* %3)
br label %29
29: ; preds = %29, %27
%30 = tail call i32 (...) @getch()
%31 = icmp slt i32 %30, 0
br i1 %31, label %29, label %32
32: ; preds = %29
%33 = tail call i32 @delwin(i32* %3)
ret void
}