#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*/ *newwin(int, int, int, int);
int /*<<< orphan*/ wbkgd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *create_newwin(int height, int width, int starty, int startx, int col,
                      int j, int k) {
  WINDOW *local_win;
  local_win = newwin(width, (2 * width), starty, startx);
  if (col == 0) {
    wbkgd(local_win, COLOR_PAIR(1));
    wrefresh(local_win);
  } else {
    wbkgd(local_win, COLOR_PAIR(2));
    wrefresh(local_win);
  }
  return local_win;
}


x86 assembly (clang, -O0):
<create_newwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1050 <newwin@plt>
mov    %rax,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    11ac <create_newwin+0x6c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1030 <wbkgd@plt>
mov    -0x20(%rbp),%rdi
call   1040 <wrefresh@plt>
jmp    11d2 <create_newwin+0x92>
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    $0x2,%edi
call   1060 <COLOR_PAIR@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1030 <wbkgd@plt>
mov    -0x20(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_newwin>:
push   %rbp
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %esi,%edi
lea    (%rdi,%rdi,1),%esi
call   1050 <newwin@plt>
mov    %rax,%rbx
cmp    $0x1,%ebp
mov    $0x2,%edi
sbb    $0x0,%edi
call   1060 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <wbkgd@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%16 = load i32, i32* %9
%17 = load i32, i32* %9
%18 = mul nsw i32 2, %17
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = call i32* @newwin(i32 %16, i32 %18, i32 %19, i32 %20)
store i32* %21, i32** %15
%22 = load i32, i32* %12
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %7
%25 = load i32*, i32** %15
%26 = call i32 @COLOR_PAIR(i32 1)
%27 = call i32 @wbkgd(i32* %25, i32 %26)
%28 = load i32*, i32** %15
%29 = call i32 @wrefresh(i32* %28)
br label %36
30: ; preds = %7
%31 = load i32*, i32** %15
%32 = call i32 @COLOR_PAIR(i32 2)
%33 = call i32 @wbkgd(i32* %31, i32 %32)
%34 = load i32*, i32** %15
%35 = call i32 @wrefresh(i32* %34)
br label %36
36: ; preds = %30, %24
%37 = load i32*, i32** %15
ret i32* %37
}

LLVM IR (-O2):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = shl nsw i32 %1, 1
%9 = tail call i32* @newwin(i32 %1, i32 %8, i32 %2, i32 %3)
%10 = icmp eq i32 %4, 0
%11 = select i1 %10, i32 1, i32 2
%12 = tail call i32 @COLOR_PAIR(i32 %11)
%13 = tail call i32 @wbkgd(i32* %9, i32 %12)
%14 = tail call i32 @wrefresh(i32* %9)
ret i32* %9
}