#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*/ ACS_HLINE;
int /*<<< orphan*/ ACS_VLINE;
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *,
                             char const *);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stdscr;
int strlen(char const *);
int /*<<< orphan*/ touchwin(int /*<<< orphan*/);
int /*<<< orphan*/ wattrset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void ninfo(const char *msg, int mtype) {
  WINDOW *info;
  int i;
  int b;
  int maxrow;
  int maxcol;
  getmaxyx(stdscr, maxrow, maxcol);
  info = newwin(7, 50, (maxrow - 7) / 2, (maxcol - 50) / 2);
  if (mtype == 1) {
    wattrset(info, COLOR_PAIR(3));
  }
  if (mtype == 2) {
    wattrset(info, COLOR_PAIR(4));
  }
  box(info, ACS_VLINE, ACS_HLINE);
  for (i = 1; i < 6; i++) {
    for (b = 1; b < 49; b++) {
      mvwaddch(info, i, b, ' ');
    }
  }
  mvwprintw(info, 3, (50 - strlen(msg)) / 2, "%s", msg);
  wrefresh(info);
  sleep(1);
  delwin(info);
  touchwin(stdscr);
  refresh();
}


x86 assembly (clang, -O0):
<ninfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2e02(%rip),%rax
mov    (%rax),%edi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
call   1080 <getmaxyx@plt>
mov    -0x24(%rbp),%eax
sub    $0x7,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
sub    $0x32,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x2c(%rbp),%edx
mov    %eax,%ecx
mov    $0x7,%edi
mov    $0x32,%esi
call   1070 <newwin@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1251 <ninfo+0x81>
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    $0x3,%edi
call   10b0 <COLOR_PAIR@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%esi
call   1040 <wattrset@plt>
cmpl   $0x2,-0xc(%rbp)
jne    1278 <ninfo+0xa8>
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    $0x4,%edi
call   10b0 <COLOR_PAIR@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%esi
call   1040 <wattrset@plt>
mov    -0x18(%rbp),%rdi
mov    0x2d4d(%rip),%rax
mov    (%rax),%esi
mov    0x2d4c(%rip),%rax
mov    (%rax),%edx
call   1090 <box@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    12ea <ninfo+0x11a>
movl   $0x1,-0x20(%rbp)
cmpl   $0x31,-0x20(%rbp)
jge    12d7 <ninfo+0x107>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    $0x20,%ecx
call   10e0 <mvwaddch@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12ab <ninfo+0xdb>
jmp    12dc <ninfo+0x10c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    129a <ninfo+0xca>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%ecx
mov    $0x32,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    -0x8(%rbp),%r8
mov    $0x3,%esi
lea    0xcde(%rip),%rcx
call   10d0 <mvwprintw@plt>
mov    -0x18(%rbp),%rdi
call   1060 <wrefresh@plt>
mov    $0x1,%edi
call   10f0 <sleep@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <delwin@plt>
mov    0x2c9e(%rip),%rax
mov    (%rax),%edi
call   1030 <touchwin@plt>
mov    $0x0,%al
call   10c0 <refresh@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ninfo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
mov    0x2e05(%rip),%r15
mov    (%r15),%edi
call   1080 <getmaxyx@plt>
mov    $0x7,%edi
mov    $0x32,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1070 <newwin@plt>
mov    %rax,%rbx
cmp    $0x1,%ebp
je     1212 <ninfo+0x42>
cmp    $0x2,%ebp
jne    1226 <ninfo+0x56>
mov    $0x4,%edi
jmp    1217 <ninfo+0x47>
mov    $0x3,%edi
call   10b0 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <wattrset@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%esi
mov    0x2da2(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
call   1090 <box@plt>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x20,%ecx
call   10e0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x31,%ebp
jne    1250 <ninfo+0x80>
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   10e0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x31,%ebp
jne    1280 <ninfo+0xb0>
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   10e0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x31,%ebp
jne    12b0 <ninfo+0xe0>
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   10e0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x31,%ebp
jne    12e0 <ninfo+0x110>
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   10e0 <mvwaddch@plt>
add    $0x1,%ebp
cmp    $0x31,%ebp
jne    1310 <ninfo+0x140>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    $0x32,%ecx
sub    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
lea    0xcb5(%rip),%rcx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r14,%r8
call   10d0 <mvwprintw@plt>
mov    %rbx,%rdi
call   1060 <wrefresh@plt>
mov    $0x1,%edi
call   10f0 <sleep@plt>
mov    %rbx,%rdi
call   10a0 <delwin@plt>
mov    (%r15),%edi
call   1030 <touchwin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <refresh@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [3 x i8] c"%s\00"
define void @ninfo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%10 = load i32, i32* @stdscr
%11 = load i32, i32* %8
%12 = load i32, i32* %9
%13 = call i32 @getmaxyx(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %8
%15 = sub nsw i32 %14, 7
%16 = sdiv i32 %15, 2
%17 = load i32, i32* %9
%18 = sub nsw i32 %17, 50
%19 = sdiv i32 %18, 2
%20 = call i32* @newwin(i32 7, i32 50, i32 %16, i32 %19)
store i32* %20, i32** %5
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %27
23: ; preds = %2
%24 = load i32*, i32** %5
%25 = call i32 @COLOR_PAIR(i32 3)
%26 = call i32 @wattrset(i32* %24, i32 %25)
br label %27
27: ; preds = %23, %2
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 2
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load i32*, i32** %5
%32 = call i32 @COLOR_PAIR(i32 4)
%33 = call i32 @wattrset(i32* %31, i32 %32)
br label %34
34: ; preds = %30, %27
%35 = load i32*, i32** %5
%36 = load i32, i32* @ACS_VLINE
%37 = load i32, i32* @ACS_HLINE
%38 = call i32 @box(i32* %35, i32 %36, i32 %37)
store i32 1, i32* %6
br label %39
39: ; preds = %55, %34
%40 = load i32, i32* %6
%41 = icmp slt i32 %40, 6
br i1 %41, label %42, label %58
42: ; preds = %39
store i32 1, i32* %7
br label %43
43: ; preds = %51, %42
%44 = load i32, i32* %7
%45 = icmp slt i32 %44, 49
br i1 %45, label %46, label %54
46: ; preds = %43
%47 = load i32*, i32** %5
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = call i32 @mvwaddch(i32* %47, i32 %48, i32 %49, i8 signext 32)
br label %51
51: ; preds = %46
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 1
store i32 %53, i32* %7
br label %43
54: ; preds = %43
br label %55
55: ; preds = %54
%56 = load i32, i32* %6
%57 = add nsw i32 %56, 1
store i32 %57, i32* %6
br label %39
58: ; preds = %39
%59 = load i32*, i32** %5
%60 = load i8*, i8** %3
%61 = call i32 @strlen(i8* %60)
%62 = sub nsw i32 50, %61
%63 = sdiv i32 %62, 2
%64 = load i8*, i8** %3
%65 = call i32 @mvwprintw(i32* %59, i32 3, i32 %63, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %64)
%66 = load i32*, i32** %5
%67 = call i32 @wrefresh(i32* %66)
%68 = call i32 @sleep(i32 1)
%69 = load i32*, i32** %5
%70 = call i32 @delwin(i32* %69)
%71 = load i32, i32* @stdscr
%72 = call i32 @touchwin(i32 %71)
%73 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@ACS_VLINE = global i32 0
@ACS_HLINE = global i32 0
@.str = [3 x i8] c"%s\00"
define void @ninfo(i8* %0, i32 %1) {
%3 = load i32, i32* @stdscr
%4 = tail call i32 @getmaxyx(i32 %3, i32 undef, i32 undef)
%5 = tail call i32* @newwin(i32 7, i32 50, i32 0, i32 0)
switch i32 %1, label %11 [
i32 1, label %7
i32 2, label %6
]
6: ; preds = %2
br label %7
7: ; preds = %2, %6
%8 = phi i32 [ 4, %6 ], [ 3, %2 ]
%9 = tail call i32 @COLOR_PAIR(i32 %8)
%10 = tail call i32 @wattrset(i32* %5, i32 %9)
br label %11
11: ; preds = %7, %2
%12 = load i32, i32* @ACS_VLINE
%13 = load i32, i32* @ACS_HLINE
%14 = tail call i32 @box(i32* %5, i32 %12, i32 %13)
br label %15
15: ; preds = %11, %15
%16 = phi i32 [ 1, %11 ], [ %18, %15 ]
%17 = tail call i32 @mvwaddch(i32* %5, i32 1, i32 %16, i8 signext 32)
%18 = add nuw nsw i32 %16, 1
%19 = icmp eq i32 %18, 49
br i1 %19, label %20, label %15
20: ; preds = %15, %20
%21 = phi i32 [ %23, %20 ], [ 1, %15 ]
%22 = tail call i32 @mvwaddch(i32* %5, i32 2, i32 %21, i8 signext 32)
%23 = add nuw nsw i32 %21, 1
%24 = icmp eq i32 %23, 49
br i1 %24, label %25, label %20
25: ; preds = %20, %25
%26 = phi i32 [ %28, %25 ], [ 1, %20 ]
%27 = tail call i32 @mvwaddch(i32* %5, i32 3, i32 %26, i8 signext 32)
%28 = add nuw nsw i32 %26, 1
%29 = icmp eq i32 %28, 49
br i1 %29, label %30, label %25
30: ; preds = %25, %30
%31 = phi i32 [ %33, %30 ], [ 1, %25 ]
%32 = tail call i32 @mvwaddch(i32* %5, i32 4, i32 %31, i8 signext 32)
%33 = add nuw nsw i32 %31, 1
%34 = icmp eq i32 %33, 49
br i1 %34, label %35, label %30
35: ; preds = %30, %35
%36 = phi i32 [ %38, %35 ], [ 1, %30 ]
%37 = tail call i32 @mvwaddch(i32* %5, i32 5, i32 %36, i8 signext 32)
%38 = add nuw nsw i32 %36, 1
%39 = icmp eq i32 %38, 49
br i1 %39, label %40, label %35
40: ; preds = %35
%41 = tail call i32 @strlen(i8* %0)
%42 = sub nsw i32 50, %41
%43 = sdiv i32 %42, 2
%44 = tail call i32 @mvwprintw(i32* %5, i32 3, i32 %43, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%45 = tail call i32 @wrefresh(i32* %5)
%46 = tail call i32 @sleep(i32 1)
%47 = tail call i32 @delwin(i32* %5)
%48 = load i32, i32* @stdscr
%49 = tail call i32 @touchwin(i32 %48)
%50 = tail call i32 (...) @refresh()
ret void
}