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

/* Variables and functions */
int /*<<< orphan*/ ACS_HLINE;
int /*<<< orphan*/ ACS_VLINE;
int /*<<< orphan*/ COLOR_PAIR(int);
#define KEY_BACKSPACE 128
int REQ_DEL_CHAR;
int REQ_DEL_PREV;
int REQ_VALIDATION;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ derwin(int /*<<< orphan*/ *, int, int, int, int);
int /*<<< orphan*/ form_driver(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ free_field(int /*<<< orphan*/ *);
int /*<<< orphan*/ free_form(int /*<<< orphan*/ *);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ keypad(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *, int, int);
int /*<<< orphan*/ *new_field(int, int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ *new_form(int /*<<< orphan*/ **);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ post_form(int /*<<< orphan*/ *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ scale_form(int /*<<< orphan*/ *, int *, int *);
int /*<<< orphan*/ set_field_back(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_field_fore(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_form_sub(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_form_win(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ snprintf(char *, int, char *, ...);
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ strncat(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ touchwin(int /*<<< orphan*/);
int /*<<< orphan*/ unpost_form(int /*<<< orphan*/ *);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
int wgetch(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
char *nfilename() {
  FIELD *field[2];
  FORM *form;
  WINDOW *form_win;
  char buf[255] = "";
  int key, row, col, maxrow, maxcol;
  int i, b;
  char tmp[255] = "";
  char *bufpoint;
  getmaxyx(stdscr, maxrow, maxcol);
  field[0] = new_field(1, 53, 0, 0, 0, 0);
  field[1] = NULL;
  set_field_fore(field[0], COLOR_PAIR(10));
  set_field_back(field[0], COLOR_PAIR(10));
  form = new_form(field);
  scale_form(form, &row, &col);
  form_win = newwin(4, 58, (maxrow - 7) / 2, (maxcol - 57) / 2);
  keypad(form_win, TRUE);
  wattron(form_win, COLOR_PAIR(6));
  for (i = 1; i < 8; i++) {
    for (b = 1; b < 57; b++) {
      mvwaddch(form_win, i, b, ' ');
    }
  }
  set_form_win(form, form_win);
  set_form_sub(form, derwin(form_win, row, col, 2, 2));
  box(form_win, ACS_VLINE, ACS_HLINE);
  mvwprintw(form_win, 1, 2, "Enter Filename To Save State To: [Nothing Aborts]",
            row, col);
  post_form(form);
  wrefresh(form_win);
  while ((key = wgetch(form_win)) != 0x0a) {
    switch (key) {
    case KEY_BACKSPACE:
      form_driver(form, REQ_DEL_PREV);
      form_driver(form, REQ_DEL_CHAR);
      snprintf(tmp, sizeof(tmp), buf);
      strncpy(buf, tmp, sizeof(buf));
      break;
    case 0x08:
      form_driver(form, REQ_DEL_PREV);
      form_driver(form, REQ_DEL_CHAR);
      snprintf(tmp, sizeof(tmp), buf);
      strncpy(buf, tmp, sizeof(buf));
      break;
    case 0x7f:
      form_driver(form, REQ_DEL_PREV);
      form_driver(form, REQ_DEL_CHAR);
      snprintf(tmp, sizeof(tmp), buf);
      strncpy(buf, tmp, sizeof(buf));
      break;
    default:
      form_driver(form, key);
      snprintf(tmp, sizeof(tmp), "%c", key);
      strncat(buf, tmp, sizeof(buf));
    }
  }
  form_driver(form, REQ_VALIDATION);
  unpost_form(form);
  free_form(form);
  free_field(field[0]);
  delwin(form_win);
  touchwin(stdscr);
  refresh();
  bufpoint = buf;
  return bufpoint;
}


x86 assembly (clang, -O0):
<nfilename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x280,%rsp
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   10c0 <memset@plt>
lea    -0x240(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   10c0 <memset@plt>
mov    0x2cc8(%rip),%rax
mov    (%rax),%edi
mov    -0x130(%rbp),%esi
mov    -0x134(%rbp),%edx
call   10f0 <getmaxyx@plt>
mov    $0x1,%edi
mov    $0x35,%esi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1060 <new_field@plt>
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x268(%rbp)
mov    $0xa,%edi
call   1140 <COLOR_PAIR@plt>
mov    -0x268(%rbp),%rdi
mov    %eax,%esi
call   1170 <set_field_fore@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x260(%rbp)
mov    $0xa,%edi
call   1140 <COLOR_PAIR@plt>
mov    -0x260(%rbp),%rdi
mov    %eax,%esi
call   11f0 <set_field_back@plt>
lea    -0x10(%rbp),%rdi
call   11c0 <new_form@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x128(%rbp),%rsi
lea    -0x12c(%rbp),%rdx
call   1030 <scale_form@plt>
mov    -0x130(%rbp),%eax
sub    $0x7,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x254(%rbp)
mov    -0x134(%rbp),%eax
sub    $0x39,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x254(%rbp),%edx
mov    %eax,%ecx
mov    $0x4,%edi
mov    $0x3a,%esi
call   10b0 <newwin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2bce(%rip),%rax
mov    (%rax),%esi
call   1080 <keypad@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x250(%rbp)
mov    $0x6,%edi
call   1140 <COLOR_PAIR@plt>
mov    -0x250(%rbp),%rdi
mov    %eax,%esi
call   11d0 <wattron@plt>
movl   $0x1,-0x138(%rbp)
cmpl   $0x8,-0x138(%rbp)
jge    14a9 <nfilename+0x1c9>
movl   $0x1,-0x13c(%rbp)
cmpl   $0x39,-0x13c(%rbp)
jge    1490 <nfilename+0x1b0>
mov    -0x20(%rbp),%rdi
mov    -0x138(%rbp),%esi
mov    -0x13c(%rbp),%edx
mov    $0x20,%ecx
call   11b0 <mvwaddch@plt>
mov    -0x13c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13c(%rbp)
jmp    1455 <nfilename+0x175>
jmp    1495 <nfilename+0x1b5>
mov    -0x138(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x138(%rbp)
jmp    143e <nfilename+0x15e>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1150 <set_form_win@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x270(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x128(%rbp),%esi
mov    -0x12c(%rbp),%edx
mov    $0x2,%r8d
mov    %r8d,%ecx
call   1200 <derwin@plt>
mov    -0x270(%rbp),%rdi
mov    %eax,%esi
call   11e0 <set_form_sub@plt>
mov    -0x20(%rbp),%rdi
mov    0x2ac0(%rip),%rax
mov    (%rax),%esi
mov    0x2ac7(%rip),%rax
mov    (%rax),%edx
call   1100 <box@plt>
mov    -0x20(%rbp),%rdi
mov    -0x128(%rbp),%r8d
mov    -0x12c(%rbp),%r9d
mov    $0x1,%esi
mov    $0x2,%edx
lea    0xad5(%rip),%rcx
call   11a0 <mvwprintw@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <post_form@plt>
mov    -0x20(%rbp),%rdi
call   1070 <wrefresh@plt>
mov    -0x20(%rbp),%rdi
call   1190 <wgetch@plt>
mov    %eax,-0x124(%rbp)
cmp    $0xa,%eax
je     16fb <nfilename+0x41b>
mov    -0x124(%rbp),%eax
mov    %eax,-0x274(%rbp)
sub    $0x8,%eax
je     15f9 <nfilename+0x319>
jmp    1574 <nfilename+0x294>
mov    -0x274(%rbp),%eax
sub    $0x7f,%eax
je     1654 <nfilename+0x374>
jmp    1588 <nfilename+0x2a8>
mov    -0x274(%rbp),%eax
sub    $0x80,%eax
jne    16af <nfilename+0x3cf>
jmp    159e <nfilename+0x2be>
mov    -0x18(%rbp),%rdi
mov    0x2a17(%rip),%rax
mov    (%rax),%esi
call   10e0 <form_driver@plt>
mov    -0x18(%rbp),%rdi
mov    0x29ed(%rip),%rax
mov    (%rax),%esi
call   10e0 <form_driver@plt>
lea    -0x240(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    $0xff,%esi
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x120(%rbp),%rdi
lea    -0x240(%rbp),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
jmp    16f6 <nfilename+0x416>
mov    -0x18(%rbp),%rdi
mov    0x29bc(%rip),%rax
mov    (%rax),%esi
call   10e0 <form_driver@plt>
mov    -0x18(%rbp),%rdi
mov    0x2992(%rip),%rax
mov    (%rax),%esi
call   10e0 <form_driver@plt>
lea    -0x240(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    $0xff,%esi
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x120(%rbp),%rdi
lea    -0x240(%rbp),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
jmp    16f6 <nfilename+0x416>
mov    -0x18(%rbp),%rdi
mov    0x2961(%rip),%rax
mov    (%rax),%esi
call   10e0 <form_driver@plt>
mov    -0x18(%rbp),%rdi
mov    0x2937(%rip),%rax
mov    (%rax),%esi
call   10e0 <form_driver@plt>
lea    -0x240(%rbp),%rdi
lea    -0x120(%rbp),%rdx
mov    $0xff,%esi
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x120(%rbp),%rdi
lea    -0x240(%rbp),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
jmp    16f6 <nfilename+0x416>
mov    -0x18(%rbp),%rdi
mov    -0x124(%rbp),%esi
call   10e0 <form_driver@plt>
lea    -0x240(%rbp),%rdi
mov    -0x124(%rbp),%ecx
mov    $0xff,%esi
lea    0x95b(%rip),%rdx
mov    $0x0,%al
call   1090 <snprintf@plt>
lea    -0x120(%rbp),%rdi
lea    -0x240(%rbp),%rsi
mov    $0xff,%edx
call   10d0 <strncat@plt>
jmp    1542 <nfilename+0x262>
mov    -0x18(%rbp),%rdi
mov    0x28e2(%rip),%rax
mov    (%rax),%esi
call   10e0 <form_driver@plt>
mov    -0x18(%rbp),%rdi
call   1130 <unpost_form@plt>
mov    -0x18(%rbp),%rdi
call   1120 <free_form@plt>
mov    -0x10(%rbp),%rdi
call   1180 <free_field@plt>
mov    -0x20(%rbp),%rdi
call   1110 <delwin@plt>
mov    0x28a8(%rip),%rax
mov    (%rax),%edi
call   1050 <touchwin@plt>
mov    $0x0,%al
call   1160 <refresh@plt>
lea    -0x120(%rbp),%rax
mov    %rax,-0x248(%rbp)
mov    -0x248(%rbp),%rax
add    $0x280,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nfilename>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x228,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x10f(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movups %xmm0,0x20f(%rsp)
movaps %xmm0,0x200(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
mov    0x2c07(%rip),%rax
mov    (%rax),%edi
call   10e0 <getmaxyx@plt>
mov    $0x1,%ebp
mov    $0x1,%edi
mov    $0x35,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1060 <new_field@plt>
mov    %rax,%rbx
mov    %rax,0x10(%rsp)
movq   $0x0,0x18(%rsp)
mov    $0xa,%edi
call   1130 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1160 <set_field_fore@plt>
mov    $0xa,%edi
call   1130 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   11e0 <set_field_back@plt>
lea    0x10(%rsp),%rdi
call   11b0 <new_form@plt>
mov    %rax,%r14
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
call   1030 <scale_form@plt>
mov    $0x4,%edi
mov    $0x3a,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   10b0 <newwin@plt>
mov    %rax,%rbx
mov    0x2b65(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1080 <keypad@plt>
mov    $0x6,%edi
call   1130 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   11c0 <wattron@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   11a0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x39,%ebp
jne    14a0 <nfilename+0x1d0>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   11a0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x39,%ebp
jne    14d0 <nfilename+0x200>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   11a0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x39,%ebp
jne    1500 <nfilename+0x230>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   11a0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x39,%ebp
jne    1530 <nfilename+0x260>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x5,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   11a0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x39,%ebp
jne    1560 <nfilename+0x290>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   11a0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x39,%ebp
jne    1590 <nfilename+0x2c0>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   11a0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x39,%ebp
jne    15c0 <nfilename+0x2f0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1140 <set_form_win@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
mov    $0x2,%ecx
mov    $0x2,%r8d
call   11f0 <derwin@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   11d0 <set_form_sub@plt>
mov    0x29a5(%rip),%rax
mov    (%rax),%esi
mov    0x29ac(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   10f0 <box@plt>
mov    0xc(%rsp),%r8d
mov    0x8(%rsp),%r9d
lea    0x9c9(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1190 <mvwprintw@plt>
mov    %r14,%rdi
call   10a0 <post_form@plt>
mov    %rbx,%rdi
call   1070 <wrefresh@plt>
mov    0x2948(%rip),%r13
lea    0x120(%rsp),%r15
lea    0x20(%rsp),%r12
jmp    16b4 <nfilename+0x3e4>
nop
cmp    $0x8,%ebp
jne    16d2 <nfilename+0x402>
mov    0x2944(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10d0 <form_driver@plt>
mov    0x0(%r13),%esi
mov    %r14,%rdi
call   10d0 <form_driver@plt>
mov    %r15,%rdi
mov    $0xff,%esi
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <snprintf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
mov    %rbx,%rdi
call   1180 <wgetch@plt>
mov    %eax,%ebp
cmp    $0x7e,%eax
jle    1670 <nfilename+0x3a0>
cmp    $0x7f,%ebp
je     1675 <nfilename+0x3a5>
cmp    $0x80,%ebp
je     1675 <nfilename+0x3a5>
jmp    16d7 <nfilename+0x407>
cmp    $0xa,%ebp
je     170b <nfilename+0x43b>
mov    %r14,%rdi
mov    %ebp,%esi
call   10d0 <form_driver@plt>
mov    %r15,%rdi
mov    $0xff,%esi
lea    0x942(%rip),%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1090 <snprintf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0xff,%edx
call   10c0 <strncat@plt>
jmp    16b4 <nfilename+0x3e4>
mov    0x28d6(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10d0 <form_driver@plt>
mov    %r14,%rdi
call   1120 <unpost_form@plt>
mov    %r14,%rdi
call   1110 <free_form@plt>
mov    0x10(%rsp),%rdi
call   1170 <free_field@plt>
mov    %rbx,%rdi
call   1100 <delwin@plt>
mov    0x289b(%rip),%rax
mov    (%rax),%edi
call   1050 <touchwin@plt>
xor    %eax,%eax
call   1150 <refresh@plt>
lea    0x20(%rsp),%rax
add    $0x228,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [50 x i8] c"Enter Filename To Save State To: [Nothing Aborts]\00"
@REQ_DEL_PREV = global i32 0
@REQ_DEL_CHAR = global i32 0
@.str.1 = [3 x i8] c"%c\00"
@REQ_VALIDATION = global i32 0
define i8* @nfilename() {
%1 = alloca [2 x i32*]
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [255 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [255 x i8]
%13 = alloca i8*
%14 = bitcast [255 x i8]* %4 to i8*
%15 = bitcast [255 x i8]* %12 to i8*
%16 = load i32, i32* @stdscr
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = call i32 @getmaxyx(i32 %16, i32 %17, i32 %18)
%20 = call i32* @new_field(i32 1, i32 53, i32 0, i32 0, i32 0, i32 0)
%21 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 0
store i32* %20, i32** %21
%22 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 1
store i32* null, i32** %22
%23 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 0
%24 = load i32*, i32** %23
%25 = call i32 @COLOR_PAIR(i32 10)
%26 = call i32 @set_field_fore(i32* %24, i32 %25)
%27 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 0
%28 = load i32*, i32** %27
%29 = call i32 @COLOR_PAIR(i32 10)
%30 = call i32 @set_field_back(i32* %28, i32 %29)
%31 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 0
%32 = call i32* @new_form(i32** %31)
store i32* %32, i32** %2
%33 = load i32*, i32** %2
%34 = call i32 @scale_form(i32* %33, i32* %6, i32* %7)
%35 = load i32, i32* %8
%36 = sub nsw i32 %35, 7
%37 = sdiv i32 %36, 2
%38 = load i32, i32* %9
%39 = sub nsw i32 %38, 57
%40 = sdiv i32 %39, 2
%41 = call i32* @newwin(i32 4, i32 58, i32 %37, i32 %40)
store i32* %41, i32** %3
%42 = load i32*, i32** %3
%43 = load i32, i32* @TRUE
%44 = call i32 @keypad(i32* %42, i32 %43)
%45 = load i32*, i32** %3
%46 = call i32 @COLOR_PAIR(i32 6)
%47 = call i32 @wattron(i32* %45, i32 %46)
store i32 1, i32* %10
br label %48
48: ; preds = %64, %0
%49 = load i32, i32* %10
%50 = icmp slt i32 %49, 8
br i1 %50, label %51, label %67
51: ; preds = %48
store i32 1, i32* %11
br label %52
52: ; preds = %60, %51
%53 = load i32, i32* %11
%54 = icmp slt i32 %53, 57
br i1 %54, label %55, label %63
55: ; preds = %52
%56 = load i32*, i32** %3
%57 = load i32, i32* %10
%58 = load i32, i32* %11
%59 = call i32 @mvwaddch(i32* %56, i32 %57, i32 %58, i8 signext 32)
br label %60
60: ; preds = %55
%61 = load i32, i32* %11
%62 = add nsw i32 %61, 1
store i32 %62, i32* %11
br label %52
63: ; preds = %52
br label %64
64: ; preds = %63
%65 = load i32, i32* %10
%66 = add nsw i32 %65, 1
store i32 %66, i32* %10
br label %48
67: ; preds = %48
%68 = load i32*, i32** %2
%69 = load i32*, i32** %3
%70 = call i32 @set_form_win(i32* %68, i32* %69)
%71 = load i32*, i32** %2
%72 = load i32*, i32** %3
%73 = load i32, i32* %6
%74 = load i32, i32* %7
%75 = call i32 @derwin(i32* %72, i32 %73, i32 %74, i32 2, i32 2)
%76 = call i32 @set_form_sub(i32* %71, i32 %75)
%77 = load i32*, i32** %3
%78 = load i32, i32* @ACS_VLINE
%79 = load i32, i32* @ACS_HLINE
%80 = call i32 @box(i32* %77, i32 %78, i32 %79)
%81 = load i32*, i32** %3
%82 = load i32, i32* %6
%83 = load i32, i32* %7
%84 = call i32 @mvwprintw(i32* %81, i32 1, i32 2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %82, i32 %83)
%85 = load i32*, i32** %2
%86 = call i32 @post_form(i32* %85)
%87 = load i32*, i32** %3
%88 = call i32 @wrefresh(i32* %87)
br label %89
89: ; preds = %144, %67
%90 = load i32*, i32** %3
%91 = call i32 @wgetch(i32* %90)
store i32 %91, i32* %5
%92 = icmp ne i32 %91, 10
br i1 %92, label %93, label %145
93: ; preds = %89
%94 = load i32, i32* %5
switch i32 %94, label %134 [
i32 128, label %95
i32 8, label %108
i32 127, label %121
]
95: ; preds = %93
%96 = load i32*, i32** %2
%97 = load i32, i32* @REQ_DEL_PREV
%98 = call i32 @form_driver(i32* %96, i32 %97)
%99 = load i32*, i32** %2
%100 = load i32, i32* @REQ_DEL_CHAR
%101 = call i32 @form_driver(i32* %99, i32 %100)
%102 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%103 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%104 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %102, i32 255, i8* %103)
%105 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%106 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%107 = call i32 @strncpy(i8* %105, i8* %106, i32 255)
br label %144
108: ; preds = %93
%109 = load i32*, i32** %2
%110 = load i32, i32* @REQ_DEL_PREV
%111 = call i32 @form_driver(i32* %109, i32 %110)
%112 = load i32*, i32** %2
%113 = load i32, i32* @REQ_DEL_CHAR
%114 = call i32 @form_driver(i32* %112, i32 %113)
%115 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%116 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%117 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %115, i32 255, i8* %116)
%118 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%119 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%120 = call i32 @strncpy(i8* %118, i8* %119, i32 255)
br label %144
121: ; preds = %93
%122 = load i32*, i32** %2
%123 = load i32, i32* @REQ_DEL_PREV
%124 = call i32 @form_driver(i32* %122, i32 %123)
%125 = load i32*, i32** %2
%126 = load i32, i32* @REQ_DEL_CHAR
%127 = call i32 @form_driver(i32* %125, i32 %126)
%128 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%129 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%130 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %128, i32 255, i8* %129)
%131 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%132 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%133 = call i32 @strncpy(i8* %131, i8* %132, i32 255)
br label %144
134: ; preds = %93
%135 = load i32*, i32** %2
%136 = load i32, i32* %5
%137 = call i32 @form_driver(i32* %135, i32 %136)
%138 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%139 = load i32, i32* %5
%140 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %138, i32 255, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %139)
%141 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%142 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i64 0, i64 0
%143 = call i32 @strncat(i8* %141, i8* %142, i32 255)
br label %144
144: ; preds = %134, %121, %108, %95
br label %89
145: ; preds = %89
%146 = load i32*, i32** %2
%147 = load i32, i32* @REQ_VALIDATION
%148 = call i32 @form_driver(i32* %146, i32 %147)
%149 = load i32*, i32** %2
%150 = call i32 @unpost_form(i32* %149)
%151 = load i32*, i32** %2
%152 = call i32 @free_form(i32* %151)
%153 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 0
%154 = load i32*, i32** %153
%155 = call i32 @free_field(i32* %154)
%156 = load i32*, i32** %3
%157 = call i32 @delwin(i32* %156)
%158 = load i32, i32* @stdscr
%159 = call i32 @touchwin(i32 %158)
%160 = call i32 (...) @refresh()
%161 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
store i8* %161, i8** %13
%162 = load i8*, i8** %13
ret i8* %162
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [50 x i8] c"Enter Filename To Save State To: [Nothing Aborts]\00"
@REQ_DEL_PREV = global i32 0
@REQ_DEL_CHAR = global i32 0
@.str.1 = [3 x i8] c"%c\00"
@REQ_VALIDATION = global i32 0
define i8* @nfilename() {
%1 = alloca [2 x i32*]
%2 = alloca [255 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca [255 x i8]
%6 = bitcast [2 x i32*]* %1 to i8*
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* @stdscr
%12 = tail call i32 @getmaxyx(i32 %11, i32 undef, i32 undef)
%13 = tail call i32* @new_field(i32 1, i32 53, i32 0, i32 0, i32 0, i32 0)
%14 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 0
store i32* %13, i32** %14
%15 = getelementptr inbounds [2 x i32*], [2 x i32*]* %1, i64 0, i64 1
store i32* null, i32** %15
%16 = tail call i32 @COLOR_PAIR(i32 10)
%17 = tail call i32 @set_field_fore(i32* %13, i32 %16)
%18 = tail call i32 @COLOR_PAIR(i32 10)
%19 = tail call i32 @set_field_back(i32* %13, i32 %18)
%20 = call i32* @new_form(i32** %14)
%21 = call i32 @scale_form(i32* %20, i32* %3, i32* %4)
%22 = call i32* @newwin(i32 4, i32 58, i32 0, i32 0)
%23 = load i32, i32* @TRUE
%24 = call i32 @keypad(i32* %22, i32 %23)
%25 = call i32 @COLOR_PAIR(i32 6)
%26 = call i32 @wattron(i32* %22, i32 %25)
br label %27
27: ; preds = %0, %27
%28 = phi i32 [ 1, %0 ], [ %30, %27 ]
%29 = call i32 @mvwaddch(i32* %22, i32 1, i32 %28, i8 signext 32)
%30 = add nuw nsw i32 %28, 1
%31 = icmp eq i32 %30, 57
br i1 %31, label %32, label %27
32: ; preds = %27, %32
%33 = phi i32 [ %35, %32 ], [ 1, %27 ]
%34 = call i32 @mvwaddch(i32* %22, i32 2, i32 %33, i8 signext 32)
%35 = add nuw nsw i32 %33, 1
%36 = icmp eq i32 %35, 57
br i1 %36, label %37, label %32
37: ; preds = %32, %37
%38 = phi i32 [ %40, %37 ], [ 1, %32 ]
%39 = call i32 @mvwaddch(i32* %22, i32 3, i32 %38, i8 signext 32)
%40 = add nuw nsw i32 %38, 1
%41 = icmp eq i32 %40, 57
br i1 %41, label %42, label %37
42: ; preds = %37, %42
%43 = phi i32 [ %45, %42 ], [ 1, %37 ]
%44 = call i32 @mvwaddch(i32* %22, i32 4, i32 %43, i8 signext 32)
%45 = add nuw nsw i32 %43, 1
%46 = icmp eq i32 %45, 57
br i1 %46, label %47, label %42
47: ; preds = %42, %47
%48 = phi i32 [ %50, %47 ], [ 1, %42 ]
%49 = call i32 @mvwaddch(i32* %22, i32 5, i32 %48, i8 signext 32)
%50 = add nuw nsw i32 %48, 1
%51 = icmp eq i32 %50, 57
br i1 %51, label %52, label %47
52: ; preds = %47, %52
%53 = phi i32 [ %55, %52 ], [ 1, %47 ]
%54 = call i32 @mvwaddch(i32* %22, i32 6, i32 %53, i8 signext 32)
%55 = add nuw nsw i32 %53, 1
%56 = icmp eq i32 %55, 57
br i1 %56, label %57, label %52
57: ; preds = %52, %57
%58 = phi i32 [ %60, %57 ], [ 1, %52 ]
%59 = call i32 @mvwaddch(i32* %22, i32 7, i32 %58, i8 signext 32)
%60 = add nuw nsw i32 %58, 1
%61 = icmp eq i32 %60, 57
br i1 %61, label %62, label %57
62: ; preds = %57
%63 = call i32 @set_form_win(i32* %20, i32* %22)
%64 = load i32, i32* %3
%65 = load i32, i32* %4
%66 = call i32 @derwin(i32* %22, i32 %64, i32 %65, i32 2, i32 2)
%67 = call i32 @set_form_sub(i32* %20, i32 %66)
%68 = load i32, i32* @ACS_VLINE
%69 = load i32, i32* @ACS_HLINE
%70 = call i32 @box(i32* %22, i32 %68, i32 %69)
%71 = load i32, i32* %3
%72 = load i32, i32* %4
%73 = call i32 @mvwprintw(i32* %22, i32 1, i32 2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %71, i32 %72)
%74 = call i32 @post_form(i32* %20)
%75 = call i32 @wrefresh(i32* %22)
br label %76
76: ; preds = %103, %62
%77 = call i32 @wgetch(i32* %22)
switch i32 %77, label %99 [
i32 10, label %104
i32 128, label %78
i32 8, label %85
i32 127, label %92
]
78: ; preds = %76
%79 = load i32, i32* @REQ_DEL_PREV
%80 = call i32 @form_driver(i32* %20, i32 %79)
%81 = load i32, i32* @REQ_DEL_CHAR
%82 = call i32 @form_driver(i32* %20, i32 %81)
%83 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %10, i32 255, i8* %7)
%84 = call i32 @strncpy(i8* %7, i8* %10, i32 255)
br label %103
85: ; preds = %76
%86 = load i32, i32* @REQ_DEL_PREV
%87 = call i32 @form_driver(i32* %20, i32 %86)
%88 = load i32, i32* @REQ_DEL_CHAR
%89 = call i32 @form_driver(i32* %20, i32 %88)
%90 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %10, i32 255, i8* %7)
%91 = call i32 @strncpy(i8* %7, i8* %10, i32 255)
br label %103
92: ; preds = %76
%93 = load i32, i32* @REQ_DEL_PREV
%94 = call i32 @form_driver(i32* %20, i32 %93)
%95 = load i32, i32* @REQ_DEL_CHAR
%96 = call i32 @form_driver(i32* %20, i32 %95)
%97 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %10, i32 255, i8* %7)
%98 = call i32 @strncpy(i8* %7, i8* %10, i32 255)
br label %103
99: ; preds = %76
%100 = call i32 @form_driver(i32* %20, i32 %77)
%101 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %10, i32 255, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %77)
%102 = call i32 @strncat(i8* %7, i8* %10, i32 255)
br label %103
103: ; preds = %99, %92, %85, %78
br label %76
104: ; preds = %76
%105 = load i32, i32* @REQ_VALIDATION
%106 = call i32 @form_driver(i32* %20, i32 %105)
%107 = call i32 @unpost_form(i32* %20)
%108 = call i32 @free_form(i32* %20)
%109 = load i32*, i32** %14
%110 = call i32 @free_field(i32* %109)
%111 = call i32 @delwin(i32* %22)
%112 = load i32, i32* @stdscr
%113 = call i32 @touchwin(i32 %112)
%114 = call i32 (...) @refresh()
ret i8* %7
}