#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*/ TRUE;
int /*<<< orphan*/ keypad(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ printBox(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ scrollok(int /*<<< orphan*/ *, int /*<<< orphan*/);
WINDOW *newWindow(int y, int x, int height, int width, int color) {
  WINDOW *win;
  y++;
  height--;
  x += 2;
  width -= 2;
  win = newwin(height, width, y, x);
  scrollok(win, TRUE);
  keypad(win, TRUE);
  printBox(win, color);
  return win;
}


x86 assembly (clang, -O0):
<newWindow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1050 <newwin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2e4c(%rip),%rax
mov    (%rax),%esi
call   1060 <scrollok@plt>
mov    -0x20(%rbp),%rdi
mov    0x2e3a(%rip),%rax
mov    (%rax),%esi
call   1040 <keypad@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <printBox@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newWindow>:
push   %rbp
push   %r14
push   %rbx
mov    %r8d,%r14d
lea    0x1(%rdi),%eax
lea    -0x1(%rdx),%edi
lea    0x2(%rsi),%ebx
lea    -0x2(%rcx),%esi
mov    %eax,%edx
mov    %ebx,%ecx
call   1050 <newwin@plt>
mov    %rax,%rbx
mov    0x2e82(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %rax,%rdi
call   1060 <scrollok@plt>
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   1040 <keypad@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <printBox@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@TRUE = global i32 0
define i32* @newWindow(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
store i32 %13, i32* %6
%14 = load i32, i32* %8
%15 = add nsw i32 %14, -1
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 2
store i32 %17, i32* %7
%18 = load i32, i32* %9
%19 = sub nsw i32 %18, 2
store i32 %19, i32* %9
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = call i32* @newwin(i32 %20, i32 %21, i32 %22, i32 %23)
store i32* %24, i32** %11
%25 = load i32*, i32** %11
%26 = load i32, i32* @TRUE
%27 = call i32 @scrollok(i32* %25, i32 %26)
%28 = load i32*, i32** %11
%29 = load i32, i32* @TRUE
%30 = call i32 @keypad(i32* %28, i32 %29)
%31 = load i32*, i32** %11
%32 = load i32, i32* %10
%33 = call i32 @printBox(i32* %31, i32 %32)
%34 = load i32*, i32** %11
ret i32* %34
}

LLVM IR (-O2):
@TRUE = global i32 0
define i32* @newWindow(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %0, 1
%7 = add nsw i32 %2, -1
%8 = add nsw i32 %1, 2
%9 = add nsw i32 %3, -2
%10 = tail call i32* @newwin(i32 %7, i32 %9, i32 %6, i32 %8)
%11 = load i32, i32* @TRUE
%12 = tail call i32 @scrollok(i32* %10, i32 %11)
%13 = load i32, i32* @TRUE
%14 = tail call i32 @keypad(i32* %10, i32 %13)
%15 = tail call i32 @printBox(i32* %10, i32 %4)
ret i32* %10
}