#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*/ 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() {
  WINDOW *my_wins[3];
  PANEL *my_panels[3];
  int lines = 10, cols = 40, y = 2, x = 4, i;
  initscr();
  cbreak();
  noecho();
  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();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x44(%rbp)
movl   $0x28,-0x48(%rbp)
movl   $0x2,-0x4c(%rbp)
movl   $0x4,-0x50(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   10b0 <noecho@plt>
mov    -0x44(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x4c(%rbp),%edx
mov    -0x50(%rbp),%ecx
call   1060 <newwin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x44(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x4c(%rbp),%edx
add    $0x1,%edx
mov    -0x50(%rbp),%ecx
add    $0x5,%ecx
call   1060 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x44(%rbp),%edi
mov    -0x48(%rbp),%esi
mov    -0x4c(%rbp),%edx
add    $0x2,%edx
mov    -0x50(%rbp),%ecx
add    $0xa,%ecx
call   1060 <newwin@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    125c <main+0xbc>
movslq -0x54(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <box@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1232 <main+0x92>
mov    -0x20(%rbp),%rdi
call   1080 <new_panel@plt>
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <new_panel@plt>
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <new_panel@plt>
mov    %rax,-0x30(%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>
mov    -0x4(%rbp),%eax
add    $0x60,%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>
mov    $0xa,%edi
mov    $0x28,%esi
mov    $0x2,%edx
mov    $0x4,%ecx
call   1060 <newwin@plt>
mov    %rax,%r14
mov    $0xa,%edi
mov    $0x28,%esi
mov    $0x3,%edx
mov    $0x9,%ecx
call   1060 <newwin@plt>
mov    %rax,%r15
mov    $0xa,%edi
mov    $0x28,%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() {
%1 = alloca i32
%2 = alloca [3 x i32*]
%3 = alloca [3 x i32*]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %4
store i32 40, i32* %5
store i32 2, i32* %6
store i32 4, i32* %7
%9 = call i32 (...) @initscr()
%10 = call i32 (...) @cbreak()
%11 = call i32 (...) @noecho()
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32* @newwin(i32 %12, i32 %13, i32 %14, i32 %15)
%17 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
store i32* %16, i32** %17
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 5
%24 = call i32* @newwin(i32 %18, i32 %19, i32 %21, i32 %23)
%25 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 1
store i32* %24, i32** %25
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 2
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 10
%32 = call i32* @newwin(i32 %26, i32 %27, i32 %29, i32 %31)
%33 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 2
store i32* %32, i32** %33
store i32 0, i32* %8
br label %34
34: ; preds = %43, %0
%35 = load i32, i32* %8
%36 = icmp slt i32 %35, 3
br i1 %36, label %37, label %46
37: ; preds = %34
%38 = load i32, i32* %8
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 %39
%41 = load i32*, i32** %40
%42 = call i32 @box(i32* %41, i32 0, i32 0)
br label %43
43: ; preds = %37
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %34
46: ; preds = %34
%47 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 0
%48 = load i32*, i32** %47
%49 = call i32* @new_panel(i32* %48)
%50 = getelementptr inbounds [3 x i32*], [3 x i32*]* %3, i64 0, i64 0
store i32* %49, i32** %50
%51 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 1
%52 = load i32*, i32** %51
%53 = call i32* @new_panel(i32* %52)
%54 = getelementptr inbounds [3 x i32*], [3 x i32*]* %3, i64 0, i64 1
store i32* %53, i32** %54
%55 = getelementptr inbounds [3 x i32*], [3 x i32*]* %2, i64 0, i64 2
%56 = load i32*, i32** %55
%57 = call i32* @new_panel(i32* %56)
%58 = getelementptr inbounds [3 x i32*], [3 x i32*]* %3, i64 0, i64 2
store i32* %57, i32** %58
%59 = call i32 (...) @update_panels()
%60 = call i32 (...) @doupdate()
%61 = call i32 (...) @getch()
%62 = call i32 (...) @endwin()
%63 = load i32, i32* %1
ret i32 %63
}

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