#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*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ wborder(int /*<<< orphan*/ *, char, char, char, char, char,
                           char, char, char);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void borrarVentana(WINDOW *local_win) {
  if (local_win == NULL) {
    return;
  }
  int x, y, row, col;
  wborder(local_win, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
  getmaxyx(local_win, row, col);
  for (y = 0; y < row; y++) {
    for (x = 0; x < col; x++) {
      mvwprintw(local_win, y, x, " ");
    }
  }
  wrefresh(local_win);
  delwin(local_win);
  local_win = NULL;
}


x86 assembly (clang, -O0):
<borrarVentana>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116c <borrarVentana+0x1c>
jmp    1224 <borrarVentana+0xd4>
mov    -0x8(%rbp),%rdi
mov    $0x20,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x20,(%rsp)
movl   $0x20,0x8(%rsp)
movl   $0x20,0x10(%rsp)
call   1030 <wborder@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <getmaxyx@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    120a <borrarVentana+0xba>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11f7 <borrarVentana+0xa7>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe1c(%rip),%rcx
call   1070 <mvwprintw@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c7 <borrarVentana+0x77>
jmp    11fc <borrarVentana+0xac>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11b4 <borrarVentana+0x64>
mov    -0x8(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    -0x8(%rbp),%rdi
call   1060 <delwin@plt>
movq   $0x0,-0x8(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<borrarVentana>:
test   %rdi,%rdi
je     1190 <borrarVentana+0x50>
push   %rbx
mov    %rdi,%rbx
sub    $0x8,%rsp
mov    $0x20,%esi
mov    $0x20,%edx
mov    $0x20,%ecx
mov    $0x20,%r8d
mov    $0x20,%r9d
push   $0x20
push   $0x20
push   $0x20
call   1030 <wborder@plt>
add    $0x20,%rsp
mov    %rbx,%rdi
call   1050 <getmaxyx@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <delwin@plt>
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @borrarVentana(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
br label %43
10: ; preds = %1
%11 = load i32*, i32** %2
%12 = call i32 @wborder(i32* %11, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32)
%13 = load i32*, i32** %2
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @getmaxyx(i32* %13, i32 %14, i32 %15)
store i32 0, i32* %4
br label %17
17: ; preds = %35, %10
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %38
21: ; preds = %17
store i32 0, i32* %3
br label %22
22: ; preds = %31, %21
%23 = load i32, i32* %3
%24 = load i32, i32* %6
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %34
26: ; preds = %22
%27 = load i32*, i32** %2
%28 = load i32, i32* %4
%29 = load i32, i32* %3
%30 = call i32 @mvwprintw(i32* %27, i32 %28, i32 %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %31
31: ; preds = %26
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %22
34: ; preds = %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %17
38: ; preds = %17
%39 = load i32*, i32** %2
%40 = call i32 @wrefresh(i32* %39)
%41 = load i32*, i32** %2
%42 = call i32 @delwin(i32* %41)
store i32* null, i32** %2
br label %43
43: ; preds = %38, %9
ret void
}

LLVM IR (-O2):
define void @borrarVentana(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i32 @wborder(i32* %0, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32, i8 signext 32)
%5 = tail call i32 @getmaxyx(i32* %0, i32 undef, i32 undef)
%6 = tail call i32 @wrefresh(i32* %0)
%7 = tail call i32 @delwin(i32* %0)
br label %8
8: ; preds = %1, %3
ret void
}