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

/* Variables and functions */
int /*<<< orphan*/ A_UNDERLINE;
int /*<<< orphan*/ COLOR_BLUE;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ COLOR_WHITE;
#define KEY_DOWN 129
int KEY_F(int);
#define KEY_UP 128
int LINES;
int /*<<< orphan*/ O_AUTOSKIP;
int REQ_END_LINE;
int REQ_NEXT_FIELD;
int REQ_PREV_FIELD;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ field_opts_off(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ form_driver(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ free_field(int /*<<< orphan*/ *);
int /*<<< orphan*/ free_form(int /*<<< orphan*/ *);
int getch();
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(int, int, char *);
int /*<<< orphan*/ *new_field(int, int, int, int, int /*<<< orphan*/,
                              int /*<<< orphan*/);
int /*<<< orphan*/ *new_form(int /*<<< orphan*/ **);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ post_form(int /*<<< orphan*/ *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ set_current_field(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
int /*<<< orphan*/ set_field_back(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_field_fore(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
int /*<<< orphan*/ unpost_form(int /*<<< orphan*/ *);
int main() {
  FIELD *field[3];
  FORM *my_form;
  int ch;
  initscr();
  start_color();
  cbreak();
  noecho();
  keypad(stdscr, TRUE);
  init_pair(1, COLOR_WHITE, COLOR_BLUE);
  init_pair(2, COLOR_WHITE, COLOR_BLUE);
  field[0] = new_field(1, 10, 4, 18, 0, 0);
  field[1] = new_field(1, 10, 6, 18, 0, 0);
  field[2] = NULL;
  set_field_fore(field[0], COLOR_PAIR(1));
  set_field_back(field[0], COLOR_PAIR(2));
  field_opts_off(field[0], O_AUTOSKIP);
  set_field_back(field[1], A_UNDERLINE);
  field_opts_off(field[1], O_AUTOSKIP);
  my_form = new_form(field);
  post_form(my_form);
  refresh();
  set_current_field(my_form, field[0]);
  mvprintw(4, 10, "Value 1:");
  mvprintw(6, 10, "Value 2:");
  mvprintw(LINES - 2, 0, "Use UP, DOWN arrow keys to switch between fields");
  refresh();
  while ((ch = getch()) != KEY_F(1)) {
    switch (ch) {
    case KEY_DOWN:
      form_driver(my_form, REQ_NEXT_FIELD);
      form_driver(my_form, REQ_END_LINE);
      break;
    case KEY_UP:
      form_driver(my_form, REQ_PREV_FIELD);
      form_driver(my_form, REQ_END_LINE);
      break;
    default:
      form_driver(my_form, ch);
      break;
    }
  }
  unpost_form(my_form);
  free_form(my_form);
  free_field(field[0]);
  free_field(field[1]);
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <initscr@plt>
mov    $0x0,%al
call   1080 <start_color@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1150 <noecho@plt>
mov    0x2d36(%rip),%rax
mov    (%rax),%edi
mov    0x2d25(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    0x2cf7(%rip),%rax
mov    (%rax),%esi
mov    0x2cde(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    0x2cdb(%rip),%rax
mov    (%rax),%esi
mov    0x2cc2(%rip),%rax
mov    (%rax),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x12,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1050 <new_field@plt>
mov    %rax,-0x20(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x6,%edx
mov    $0x12,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1050 <new_field@plt>
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    $0x1,%edi
call   10e0 <COLOR_PAIR@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
call   1110 <set_field_fore@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x2,%edi
call   10e0 <COLOR_PAIR@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
call   1170 <set_field_back@plt>
mov    -0x20(%rbp),%rdi
mov    0x2c4b(%rip),%rax
mov    (%rax),%esi
call   1180 <field_opts_off@plt>
mov    -0x18(%rbp),%rdi
mov    0x2c09(%rip),%rax
mov    (%rax),%esi
call   1170 <set_field_back@plt>
mov    -0x18(%rbp),%rdi
mov    0x2c27(%rip),%rax
mov    (%rax),%esi
call   1180 <field_opts_off@plt>
lea    -0x20(%rbp),%rdi
call   1160 <new_form@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1090 <post_form@plt>
mov    $0x0,%al
call   1100 <refresh@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10f0 <set_current_field@plt>
mov    $0x4,%edi
mov    $0xa,%esi
lea    0xc1d(%rip),%rdx
call   1190 <mvprintw@plt>
mov    $0x6,%edi
mov    $0xa,%esi
lea    0xc10(%rip),%rdx
call   1190 <mvprintw@plt>
mov    0x2be3(%rip),%rax
mov    (%rax),%edi
sub    $0x2,%edi
xor    %esi,%esi
lea    0xbff(%rip),%rdx
call   1190 <mvprintw@plt>
mov    $0x0,%al
call   1100 <refresh@plt>
mov    $0x0,%al
call   1130 <getch@plt>
mov    %eax,-0x44(%rbp)
mov    %eax,-0x2c(%rbp)
mov    $0x1,%edi
call   10a0 <KEY_F@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
cmp    %ecx,%eax
je     14cf <main+0x25f>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x48(%rbp)
sub    $0x80,%eax
je     1495 <main+0x225>
jmp    1459 <main+0x1e9>
mov    -0x48(%rbp),%eax
sub    $0x81,%eax
jne    14be <main+0x24e>
jmp    146c <main+0x1fc>
mov    -0x28(%rbp),%rdi
mov    0x2b41(%rip),%rax
mov    (%rax),%esi
call   10b0 <form_driver@plt>
mov    -0x28(%rbp),%rdi
mov    0x2b57(%rip),%rax
mov    (%rax),%esi
call   10b0 <form_driver@plt>
jmp    14ca <main+0x25a>
mov    -0x28(%rbp),%rdi
mov    0x2b08(%rip),%rax
mov    (%rax),%esi
call   10b0 <form_driver@plt>
mov    -0x28(%rbp),%rdi
mov    0x2b2e(%rip),%rax
mov    (%rax),%esi
call   10b0 <form_driver@plt>
jmp    14ca <main+0x25a>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   10b0 <form_driver@plt>
jmp    141f <main+0x1af>
mov    -0x28(%rbp),%rdi
call   10d0 <unpost_form@plt>
mov    -0x28(%rbp),%rdi
call   10c0 <free_form@plt>
mov    -0x20(%rbp),%rdi
call   1120 <free_field@plt>
mov    -0x18(%rbp),%rdi
call   1120 <free_field@plt>
mov    $0x0,%al
call   1140 <endwin@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
xor    %eax,%eax
call   1070 <initscr@plt>
xor    %eax,%eax
call   1080 <start_color@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1150 <noecho@plt>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
mov    0x2d28(%rip),%rax
mov    (%rax),%esi
call   1060 <keypad@plt>
mov    0x2cfa(%rip),%rbx
mov    (%rbx),%esi
mov    0x2ce1(%rip),%rbp
mov    0x0(%rbp),%edx
mov    $0x1,%edi
call   1040 <init_pair@plt>
mov    (%rbx),%esi
mov    0x0(%rbp),%edx
mov    $0x2,%edi
call   1040 <init_pair@plt>
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0x12,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1050 <new_field@plt>
mov    %rax,%rbp
mov    %rax,(%rsp)
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x6,%edx
mov    $0x12,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1050 <new_field@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    $0x1,%edi
call   10e0 <COLOR_PAIR@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   1110 <set_field_fore@plt>
mov    $0x2,%edi
call   10e0 <COLOR_PAIR@plt>
mov    %rbp,%rdi
mov    %eax,%esi
call   1170 <set_field_back@plt>
mov    0x2c68(%rip),%r14
mov    (%r14),%esi
mov    %rbp,%rdi
call   1180 <field_opts_off@plt>
mov    0x2c26(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1170 <set_field_back@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1180 <field_opts_off@plt>
mov    %rsp,%rdi
call   1160 <new_form@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <post_form@plt>
xor    %eax,%eax
call   1100 <refresh@plt>
mov    (%rsp),%rsi
mov    %rbx,%rdi
call   10f0 <set_current_field@plt>
lea    0xc4c(%rip),%rdx
mov    $0x4,%edi
mov    $0xa,%esi
call   1190 <mvprintw@plt>
lea    0xc3f(%rip),%rdx
mov    $0x6,%edi
mov    $0xa,%esi
call   1190 <mvprintw@plt>
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
add    $0xfffffffe,%edi
lea    0xc26(%rip),%rdx
xor    %esi,%esi
call   1190 <mvprintw@plt>
xor    %eax,%eax
call   1100 <refresh@plt>
xor    %eax,%eax
call   1130 <getch@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   10a0 <KEY_F@plt>
cmp    %eax,%ebp
jne    144a <main+0x1da>
mov    %rbx,%rdi
call   10d0 <unpost_form@plt>
mov    %rbx,%rdi
call   10c0 <free_form@plt>
mov    (%rsp),%rdi
call   1120 <free_field@plt>
mov    0x8(%rsp),%rdi
call   1120 <free_field@plt>
xor    %eax,%eax
call   1140 <endwin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b67(%rip),%r14
mov    0x2b88(%rip),%r15
mov    0x2b49(%rip),%r12
jmp    14a2 <main+0x232>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rax),%esi
mov    %rbx,%rdi
call   10b0 <form_driver@plt>
mov    (%r15),%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   10b0 <form_driver@plt>
xor    %eax,%eax
call   1130 <getch@plt>
mov    %eax,%ebp
mov    $0x1,%edi
call   10a0 <KEY_F@plt>
cmp    %eax,%ebp
je     1411 <main+0x1a1>
mov    %r14,%rax
cmp    $0x81,%ebp
je     1470 <main+0x200>
cmp    $0x80,%ebp
jne    147d <main+0x20d>
mov    %r12,%rax
jmp    1470 <main+0x200>

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@O_AUTOSKIP = global i32 0
@A_UNDERLINE = global i32 0
@.str = [9 x i8] c"Value 1:\00"
@.str.1 = [9 x i8] c"Value 2:\00"
@LINES = global i32 0
@.str.2 = [49 x i8] c"Use UP, DOWN arrow keys to switch between fields\00"
@REQ_NEXT_FIELD = global i32 0
@REQ_END_LINE = global i32 0
@REQ_PREV_FIELD = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32*]
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @initscr()
%6 = call i32 (...) @start_color()
%7 = call i32 (...) @cbreak()
%8 = call i32 (...) @noecho()
%9 = load i32, i32* @stdscr
%10 = load i32, i32* @TRUE
%11 = call i32 @keypad(i32 %9, i32 %10)
%12 = load i32, i32* @COLOR_WHITE
%13 = load i32, i32* @COLOR_BLUE
%14 = call i32 @init_pair(i32 1, i32 %12, i32 %13)
%15 = load i32, i32* @COLOR_WHITE
%16 = load i32, i32* @COLOR_BLUE
%17 = call i32 @init_pair(i32 2, i32 %15, i32 %16)
%18 = call i32* @new_field(i32 1, i32 10, i32 4, i32 18, i32 0, i32 0)
%19 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
store i32* %18, i32** %19
%20 = call i32* @new_field(i32 1, i32 10, i32 6, i32 18, i32 0, i32 0)
%21 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 1
store i32* %20, i32** %21
%22 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 2
store i32* null, i32** %22
%23 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
%24 = load i32*, i32** %23
%25 = call i32 @COLOR_PAIR(i32 1)
%26 = call i32 @set_field_fore(i32* %24, i32 %25)
%27 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
%28 = load i32*, i32** %27
%29 = call i32 @COLOR_PAIR(i32 2)
%30 = call i32 @set_field_back(i32* %28, i32 %29)
%31 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
%32 = load i32*, i32** %31
%33 = load i32, i32* @O_AUTOSKIP
%34 = call i32 @field_opts_off(i32* %32, i32 %33)
%35 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 1
%36 = load i32*, i32** %35
%37 = load i32, i32* @A_UNDERLINE
%38 = call i32 @set_field_back(i32* %36, i32 %37)
%39 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 1
%40 = load i32*, i32** %39
%41 = load i32, i32* @O_AUTOSKIP
%42 = call i32 @field_opts_off(i32* %40, i32 %41)
%43 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
%44 = call i32* @new_form(i32** %43)
store i32* %44, i32** %3
%45 = load i32*, i32** %3
%46 = call i32 @post_form(i32* %45)
%47 = call i32 (...) @refresh()
%48 = load i32*, i32** %3
%49 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
%50 = load i32*, i32** %49
%51 = call i32 @set_current_field(i32* %48, i32* %50)
%52 = call i32 @mvprintw(i32 4, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%53 = call i32 @mvprintw(i32 6, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%54 = load i32, i32* @LINES
%55 = sub nsw i32 %54, 2
%56 = call i32 @mvprintw(i32 %55, i32 0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%57 = call i32 (...) @refresh()
br label %58
58: ; preds = %82, %0
%59 = call i32 (...) @getch()
store i32 %59, i32* %4
%60 = call i32 @KEY_F(i32 1)
%61 = icmp ne i32 %59, %60
br i1 %61, label %62, label %83
62: ; preds = %58
%63 = load i32, i32* %4
switch i32 %63, label %78 [
i32 129, label %64
i32 128, label %71
]
64: ; preds = %62
%65 = load i32*, i32** %3
%66 = load i32, i32* @REQ_NEXT_FIELD
%67 = call i32 @form_driver(i32* %65, i32 %66)
%68 = load i32*, i32** %3
%69 = load i32, i32* @REQ_END_LINE
%70 = call i32 @form_driver(i32* %68, i32 %69)
br label %82
71: ; preds = %62
%72 = load i32*, i32** %3
%73 = load i32, i32* @REQ_PREV_FIELD
%74 = call i32 @form_driver(i32* %72, i32 %73)
%75 = load i32*, i32** %3
%76 = load i32, i32* @REQ_END_LINE
%77 = call i32 @form_driver(i32* %75, i32 %76)
br label %82
78: ; preds = %62
%79 = load i32*, i32** %3
%80 = load i32, i32* %4
%81 = call i32 @form_driver(i32* %79, i32 %80)
br label %82
82: ; preds = %78, %71, %64
br label %58
83: ; preds = %58
%84 = load i32*, i32** %3
%85 = call i32 @unpost_form(i32* %84)
%86 = load i32*, i32** %3
%87 = call i32 @free_form(i32* %86)
%88 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
%89 = load i32*, i32** %88
%90 = call i32 @free_field(i32* %89)
%91 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 1
%92 = load i32*, i32** %91
%93 = call i32 @free_field(i32* %92)
%94 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@COLOR_WHITE = global i32 0
@COLOR_BLUE = global i32 0
@O_AUTOSKIP = global i32 0
@A_UNDERLINE = global i32 0
@.str = [9 x i8] c"Value 1:\00"
@.str.1 = [9 x i8] c"Value 2:\00"
@LINES = global i32 0
@.str.2 = [49 x i8] c"Use UP, DOWN arrow keys to switch between fields\00"
@REQ_NEXT_FIELD = global i32 0
@REQ_END_LINE = global i32 0
@REQ_PREV_FIELD = global i32 0
define i32 @main() {
%1 = alloca [3 x i32*]
%2 = bitcast [3 x i32*]* %1 to i8*
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 (...) @start_color()
%5 = tail call i32 (...) @cbreak()
%6 = tail call i32 (...) @noecho()
%7 = load i32, i32* @stdscr
%8 = load i32, i32* @TRUE
%9 = tail call i32 @keypad(i32 %7, i32 %8)
%10 = load i32, i32* @COLOR_WHITE
%11 = load i32, i32* @COLOR_BLUE
%12 = tail call i32 @init_pair(i32 1, i32 %10, i32 %11)
%13 = load i32, i32* @COLOR_WHITE
%14 = load i32, i32* @COLOR_BLUE
%15 = tail call i32 @init_pair(i32 2, i32 %13, i32 %14)
%16 = tail call i32* @new_field(i32 1, i32 10, i32 4, i32 18, i32 0, i32 0)
%17 = getelementptr inbounds [3 x i32*], [3 x i32*]* %1, i64 0, i64 0
store i32* %16, i32** %17
%18 = tail call i32* @new_field(i32 1, i32 10, i32 6, i32 18, i32 0, i32 0)
%19 = getelementptr inbounds [3 x i32*], [3 x i32*]* %1, i64 0, i64 1
store i32* %18, i32** %19
%20 = getelementptr inbounds [3 x i32*], [3 x i32*]* %1, i64 0, i64 2
store i32* null, i32** %20
%21 = tail call i32 @COLOR_PAIR(i32 1)
%22 = tail call i32 @set_field_fore(i32* %16, i32 %21)
%23 = tail call i32 @COLOR_PAIR(i32 2)
%24 = tail call i32 @set_field_back(i32* %16, i32 %23)
%25 = load i32, i32* @O_AUTOSKIP
%26 = tail call i32 @field_opts_off(i32* %16, i32 %25)
%27 = load i32, i32* @A_UNDERLINE
%28 = tail call i32 @set_field_back(i32* %18, i32 %27)
%29 = load i32, i32* @O_AUTOSKIP
%30 = tail call i32 @field_opts_off(i32* %18, i32 %29)
%31 = call i32* @new_form(i32** %17)
%32 = call i32 @post_form(i32* %31)
%33 = call i32 (...) @refresh()
%34 = load i32*, i32** %17
%35 = call i32 @set_current_field(i32* %31, i32* %34)
%36 = call i32 @mvprintw(i32 4, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%37 = call i32 @mvprintw(i32 6, i32 10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%38 = load i32, i32* @LINES
%39 = add nsw i32 %38, -2
%40 = call i32 @mvprintw(i32 %39, i32 0, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32 (...) @refresh()
%42 = call i32 (...) @getch()
%43 = call i32 @KEY_F(i32 1)
%44 = icmp eq i32 %42, %43
br i1 %44, label %59, label %45
45: ; preds = %0, %53
%46 = phi i32 [ %56, %53 ], [ %42, %0 ]
switch i32 %46, label %53 [
i32 129, label %48
i32 128, label %47
]
47: ; preds = %45
br label %48
48: ; preds = %45, %47
%49 = phi i32* [ @REQ_PREV_FIELD, %47 ], [ @REQ_NEXT_FIELD, %45 ]
%50 = load i32, i32* %49
%51 = call i32 @form_driver(i32* %31, i32 %50)
%52 = load i32, i32* @REQ_END_LINE
br label %53
53: ; preds = %48, %45
%54 = phi i32 [ %46, %45 ], [ %52, %48 ]
%55 = call i32 @form_driver(i32* %31, i32 %54)
%56 = call i32 (...) @getch()
%57 = call i32 @KEY_F(i32 1)
%58 = icmp eq i32 %56, %57
br i1 %58, label %59, label %45
59: ; preds = %53, %0
%60 = call i32 @unpost_form(i32* %31)
%61 = call i32 @free_form(i32* %31)
%62 = load i32*, i32** %17
%63 = call i32 @free_field(i32* %62)
%64 = load i32*, i32** %19
%65 = call i32 @free_field(i32* %64)
%66 = call i32 (...) @endwin()
ret i32 0
}