#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_PAIR(int);
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ wbkgd(int /*<<< orphan*/ *, int /*<<< orphan*/);
WINDOW *cria_janela(int altura, int largura, int y, int x, int boolean) {
  WINDOW *janela_local;
  janela_local = newwin(altura, largura, y, x);
  wbkgd(janela_local, COLOR_PAIR(2));
  if (boolean)
    box(janela_local, 0, 0);
  return janela_local;
}


x86 assembly (clang, -O0):
<cria_janela>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <newwin@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x2,%edi
call   1060 <COLOR_PAIR@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1030 <wbkgd@plt>
cmpl   $0x0,-0x14(%rbp)
je     11a1 <cria_janela+0x61>
mov    -0x20(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <box@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cria_janela>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
call   1040 <newwin@plt>
mov    %rax,%rbx
mov    $0x2,%edi
call   1060 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <wbkgd@plt>
test   %ebp,%ebp
je     1172 <cria_janela+0x32>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <box@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @cria_janela(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 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call i32* @newwin(i32 %12, i32 %13, i32 %14, i32 %15)
store i32* %16, i32** %11
%17 = load i32*, i32** %11
%18 = call i32 @COLOR_PAIR(i32 2)
%19 = call i32 @wbkgd(i32* %17, i32 %18)
%20 = load i32, i32* %10
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %5
%23 = load i32*, i32** %11
%24 = call i32 @box(i32* %23, i32 0, i32 0)
br label %25
25: ; preds = %22, %5
%26 = load i32*, i32** %11
ret i32* %26
}

LLVM IR (-O2):
define i32* @cria_janela(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32* @newwin(i32 %0, i32 %1, i32 %2, i32 %3)
%7 = tail call i32 @COLOR_PAIR(i32 2)
%8 = tail call i32 @wbkgd(i32* %6, i32 %7)
%9 = icmp eq i32 %4, 0
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = tail call i32 @box(i32* %6, i32 0, i32 0)
br label %12
12: ; preds = %10, %5
ret i32* %6
}