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

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ *new_panel(int /*<<< orphan*/ *);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ update_panels();
int main(int argc, char const *argv[]) {
  WINDOW *my_wins[3];
  PANEL *my_panels[3];
  int lines = 10, cols = 10, y = 2, x = 4, i;
  initscr();
  cbreak();
  noecho();
  curs_set(0);
  my_wins[0] = newwin(lines, cols, y, x);
  my_wins[1] = newwin(lines, cols, y + 1, x + 5);
  my_wins[2] = newwin(lines, cols, y + 2, x + 10);
  for (i = 0; i < 3; ++i)
    box(my_wins[i], 0, 0);
  my_panels[0] = new_panel(my_wins[0]);
  my_panels[1] = new_panel(my_wins[1]);
  my_panels[2] = new_panel(my_wins[2]);
  update_panels();
  doupdate();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x54(%rbp)
movl   $0xa,-0x58(%rbp)
movl   $0x2,-0x5c(%rbp)
movl   $0x4,-0x60(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x60(%rbp),%ecx
call   1060 <newwin@plt>
mov    %rax,-0x30(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
mov    -0x5c(%rbp),%edx
add    $0x1,%edx
mov    -0x60(%rbp),%ecx
add    $0x5,%ecx
call   1060 <newwin@plt>
mov    %rax,-0x28(%rbp)
mov    -0x54(%rbp),%edi
mov    -0x58(%rbp),%esi
mov    -0x5c(%rbp),%edx
add    $0x2,%edx
mov    -0x60(%rbp),%ecx
add    $0xa,%ecx
call   1060 <newwin@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0x3,-0x64(%rbp)
jge    127a <main+0xca>
movslq -0x64(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <box@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1250 <main+0xa0>
mov    -0x30(%rbp),%rdi
call   1080 <new_panel@plt>
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rdi
call   1080 <new_panel@plt>
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <new_panel@plt>
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   1040 <update_panels@plt>
mov    $0x0,%al
call   10c0 <doupdate@plt>
mov    $0x0,%al
call   1090 <getch@plt>
mov    $0x0,%al
call   10a0 <endwin@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   10b0 <noecho@plt>
xor    %edi,%edi
call   10d0 <curs_set@plt>
mov    $0xa,%edi
mov    $0xa,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
call   1060 <newwin@plt>
mov    %rax,%r14
mov    $0xa,%edi
mov    $0xa,%esi
mov    $0x3,%edx
mov    $0x9,%ecx
call   1060 <newwin@plt>
mov    %rax,%r15
mov    $0xa,%edi
mov    $0xa,%esi
mov    $0x4,%edx
mov    $0xe,%ecx
call   1060 <newwin@plt>
mov    %rax,%rbx
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <box@plt>
mov    %r15,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <box@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <box@plt>
mov    %r14,%rdi
call   1080 <new_panel@plt>
mov    %r15,%rdi
call   1080 <new_panel@plt>
mov    %rbx,%rdi
call   1080 <new_panel@plt>
xor    %eax,%eax
call   1040 <update_panels@plt>
xor    %eax,%eax
call   10c0 <doupdate@plt>
xor    %eax,%eax
call   1090 <getch@plt>
xor    %eax,%eax
call   10a0 <endwin@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32*]
%7 = alloca [3 x i32*]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %8
store i32 10, i32* %9
store i32 2, i32* %10
store i32 4, i32* %11
%13 = call i32 (...) @initscr()
%14 = call i32 (...) @cbreak()
%15 = call i32 (...) @noecho()
%16 = call i32 @curs_set(i32 0)
%17 = load i32, i32* %8
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = call i32* @newwin(i32 %17, i32 %18, i32 %19, i32 %20)
%22 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
store i32* %21, i32** %22
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = load i32, i32* %10
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %11
%28 = add nsw i32 %27, 5
%29 = call i32* @newwin(i32 %23, i32 %24, i32 %26, i32 %28)
%30 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
store i32* %29, i32** %30
%31 = load i32, i32* %8
%32 = load i32, i32* %9
%33 = load i32, i32* %10
%34 = add nsw i32 %33, 2
%35 = load i32, i32* %11
%36 = add nsw i32 %35, 10
%37 = call i32* @newwin(i32 %31, i32 %32, i32 %34, i32 %36)
%38 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
store i32* %37, i32** %38
store i32 0, i32* %12
br label %39
39: ; preds = %48, %2
%40 = load i32, i32* %12
%41 = icmp slt i32 %40, 3
br i1 %41, label %42, label %51
42: ; preds = %39
%43 = load i32, i32* %12
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 %44
%46 = load i32*, i32** %45
%47 = call i32 @box(i32* %46, i32 0, i32 0)
br label %48
48: ; preds = %42
%49 = load i32, i32* %12
%50 = add nsw i32 %49, 1
store i32 %50, i32* %12
br label %39
51: ; preds = %39
%52 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%53 = load i32*, i32** %52
%54 = call i32* @new_panel(i32* %53)
%55 = getelementptr inbounds [3 x i32*], [3 x i32*]* %7, i64 0, i64 0
store i32* %54, i32** %55
%56 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 1
%57 = load i32*, i32** %56
%58 = call i32* @new_panel(i32* %57)
%59 = getelementptr inbounds [3 x i32*], [3 x i32*]* %7, i64 0, i64 1
store i32* %58, i32** %59
%60 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 2
%61 = load i32*, i32** %60
%62 = call i32* @new_panel(i32* %61)
%63 = getelementptr inbounds [3 x i32*], [3 x i32*]* %7, i64 0, i64 2
store i32* %62, i32** %63
%64 = call i32 (...) @update_panels()
%65 = call i32 (...) @doupdate()
%66 = call i32 (...) @getch()
%67 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 (...) @cbreak()
%5 = tail call i32 (...) @noecho()
%6 = tail call i32 @curs_set(i32 0)
%7 = tail call i32* @newwin(i32 10, i32 10, i32 2, i32 4)
%8 = tail call i32* @newwin(i32 10, i32 10, i32 3, i32 9)
%9 = tail call i32* @newwin(i32 10, i32 10, i32 4, i32 14)
%10 = tail call i32 @box(i32* %7, i32 0, i32 0)
%11 = tail call i32 @box(i32* %8, i32 0, i32 0)
%12 = tail call i32 @box(i32* %9, i32 0, i32 0)
%13 = tail call i32* @new_panel(i32* %7)
%14 = tail call i32* @new_panel(i32* %8)
%15 = tail call i32* @new_panel(i32* %9)
%16 = tail call i32 (...) @update_panels()
%17 = tail call i32 (...) @doupdate()
%18 = tail call i32 (...) @getch()
%19 = tail call i32 (...) @endwin()
ret i32 0
}