#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*/ COLOR_BLACK;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ COLOR_RED;
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ init_pair(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ new_database(char *);
int /*<<< orphan*/ *newwin(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ print_form_str(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ print_in_middle(int /*<<< orphan*/ *, int,
                                   int /*<<< orphan*/, int, char *,
                                   int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ scanstr(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ stdscr;
void new_database_form() {
  refresh();
  char name[128];
  noecho();
  WINDOW *win;
  int y, x;
  start_color();
  getmaxyx(stdscr, y, x);
  win = newwin(0, 0, 0, 0);
  init_pair(1, COLOR_RED, COLOR_BLACK);
  box(win, 0, 0);
  print_in_middle(win, y / 4 + 1, 0, x, "Enter the Name of Database",
                  COLOR_PAIR(1));
  print_form_str(win, y, x);
  scanstr(win, name, x / 3 - 1);
  new_database(name);
  refresh();
  endwin();
  clear();
  return;
}


x86 assembly (clang, -O0):
<new_database_form>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    $0x0,%al
call   10b0 <refresh@plt>
mov    $0x0,%al
call   10d0 <noecho@plt>
mov    $0x0,%al
call   1040 <start_color@plt>
mov    0x2de1(%rip),%rax
mov    (%rax),%edi
mov    -0x8c(%rbp),%esi
mov    -0x90(%rbp),%edx
call   1060 <getmaxyx@plt>
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1050 <newwin@plt>
mov    %rax,-0x88(%rbp)
mov    0x2d9b(%rip),%rax
mov    (%rax),%esi
mov    0x2da2(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    -0x88(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <box@plt>
mov    -0x88(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x8c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
mov    -0x90(%rbp),%eax
mov    %eax,-0x94(%rbp)
mov    $0x1,%edi
call   1090 <COLOR_PAIR@plt>
mov    -0xa0(%rbp),%rdi
mov    -0x98(%rbp),%esi
mov    -0x94(%rbp),%ecx
mov    %eax,%r9d
xor    %edx,%edx
lea    0xd4c(%rip),%r8
call   10e0 <print_in_middle@plt>
mov    -0x88(%rbp),%rdi
mov    -0x8c(%rbp),%esi
mov    -0x90(%rbp),%edx
call   1080 <print_form_str@plt>
mov    -0x88(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    -0x90(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
sub    $0x1,%edx
call   10a0 <scanstr@plt>
lea    -0x80(%rbp),%rdi
call   1100 <new_database@plt>
mov    $0x0,%al
call   10b0 <refresh@plt>
mov    $0x0,%al
call   10c0 <endwin@plt>
mov    $0x0,%al
call   10f0 <clear@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_database_form>:
push   %r14
push   %rbx
sub    $0x88,%rsp
xor    %eax,%eax
call   10b0 <refresh@plt>
xor    %eax,%eax
call   10d0 <noecho@plt>
xor    %eax,%eax
call   1040 <start_color@plt>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
call   1060 <getmaxyx@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <newwin@plt>
mov    %rax,%rbx
mov    0x2dac(%rip),%rax
mov    (%rax),%esi
mov    0x2db3(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%edi
call   1030 <init_pair@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <box@plt>
mov    $0x1,%edi
call   1090 <COLOR_PAIR@plt>
lea    0xdaa(%rip),%r8
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    %eax,%r9d
call   10e0 <print_in_middle@plt>
mov    %rbx,%rdi
call   1080 <print_form_str@plt>
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xffffffff,%edx
call   10a0 <scanstr@plt>
mov    %r14,%rdi
call   1100 <new_database@plt>
xor    %eax,%eax
call   10b0 <refresh@plt>
xor    %eax,%eax
call   10c0 <endwin@plt>
xor    %eax,%eax
call   10f0 <clear@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdscr = global i32 0
@COLOR_RED = global i32 0
@COLOR_BLACK = global i32 0
@.str = [27 x i8] c"Enter the Name of Database\00"
define void @new_database_form() {
%1 = alloca [128 x i8]
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (...) @refresh()
%6 = call i32 (...) @noecho()
%7 = call i32 (...) @start_color()
%8 = load i32, i32* @stdscr
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @getmaxyx(i32 %8, i32 %9, i32 %10)
%12 = call i32* @newwin(i32 0, i32 0, i32 0, i32 0)
store i32* %12, i32** %2
%13 = load i32, i32* @COLOR_RED
%14 = load i32, i32* @COLOR_BLACK
%15 = call i32 @init_pair(i32 1, i32 %13, i32 %14)
%16 = load i32*, i32** %2
%17 = call i32 @box(i32* %16, i32 0, i32 0)
%18 = load i32*, i32** %2
%19 = load i32, i32* %3
%20 = sdiv i32 %19, 4
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %4
%23 = call i32 @COLOR_PAIR(i32 1)
%24 = call i32 @print_in_middle(i32* %18, i32 %21, i32 0, i32 %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i32*, i32** %2
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @print_form_str(i32* %25, i32 %26, i32 %27)
%29 = load i32*, i32** %2
%30 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%31 = load i32, i32* %4
%32 = sdiv i32 %31, 3
%33 = sub nsw i32 %32, 1
%34 = call i32 @scanstr(i32* %29, i8* %30, i32 %33)
%35 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%36 = call i32 @new_database(i8* %35)
%37 = call i32 (...) @refresh()
%38 = call i32 (...) @endwin()
%39 = call i32 (...) @clear()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@COLOR_RED = global i32 0
@COLOR_BLACK = global i32 0
@.str = [27 x i8] c"Enter the Name of Database\00"
define void @new_database_form() {
%1 = alloca [128 x i8]
%2 = tail call i32 (...) @refresh()
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = tail call i32 (...) @noecho()
%5 = tail call i32 (...) @start_color()
%6 = load i32, i32* @stdscr
%7 = tail call i32 @getmaxyx(i32 %6, i32 undef, i32 undef)
%8 = tail call i32* @newwin(i32 0, i32 0, i32 0, i32 0)
%9 = load i32, i32* @COLOR_RED
%10 = load i32, i32* @COLOR_BLACK
%11 = tail call i32 @init_pair(i32 1, i32 %9, i32 %10)
%12 = tail call i32 @box(i32* %8, i32 0, i32 0)
%13 = tail call i32 @COLOR_PAIR(i32 1)
%14 = tail call i32 @print_in_middle(i32* %8, i32 1, i32 0, i32 undef, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = tail call i32 @print_form_str(i32* %8, i32 undef, i32 undef)
%16 = call i32 @scanstr(i32* %8, i8* %3, i32 -1)
%17 = call i32 @new_database(i8* %3)
%18 = call i32 (...) @refresh()
%19 = call i32 (...) @endwin()
%20 = call i32 (...) @clear()
ret void
}