#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 */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int _maxx;
  int _maxy;
};
typedef TYPE_1__ WINDOW;

/* Variables and functions */
int OK;
int /*<<< orphan*/ waddch(TYPE_1__ *, char);
int /*<<< orphan*/ wmove(TYPE_1__ *, int /*<<< orphan*/, int /*<<< orphan*/);
int my_wclear(WINDOW *win) {
  int i;
  wmove(win, 0, 0);
  i = (win->_maxx + 1) * (win->_maxy + 1);
  while (i-- >= 0)
    waddch(win, ' ');
  wmove(win, 0, 0);
  return OK;
}


x86 assembly (clang, -O0):
<my_wclear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <wmove@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jl     1179 <my_wclear+0x59>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <waddch@plt>
jmp    1152 <my_wclear+0x32>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <wmove@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_wclear>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <wmove@plt>
mov    (%rbx),%eax
mov    0x4(%rbx),%ebp
add    $0x1,%eax
add    $0x1,%ebp
imul   %eax,%ebp
test   %ebp,%ebp
js     1162 <my_wclear+0x42>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x20,%esi
call   1030 <waddch@plt>
add    $0xffffffff,%ebp
jne    1150 <my_wclear+0x30>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <wmove@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32 }
@OK = global i32 0
define i32 @my_wclear(%struct.TYPE_5__* %0) {
%2 = alloca %struct.TYPE_5__*
%3 = alloca i32
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %2
%4 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%5 = call i32 @wmove(%struct.TYPE_5__* %4, i32 0, i32 0)
%6 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%7 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = add nsw i32 %8, 1
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
%14 = mul nsw i32 %9, %13
store i32 %14, i32* %3
br label %15
15: ; preds = %19, %1
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
%18 = icmp sge i32 %16, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%21 = call i32 @waddch(%struct.TYPE_5__* %20, i8 signext 32)
br label %15
22: ; preds = %15
%23 = load %struct.TYPE_5__*, %struct.TYPE_5__** %2
%24 = call i32 @wmove(%struct.TYPE_5__* %23, i32 0, i32 0)
%25 = load i32, i32* @OK
ret i32 %25
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, i32 }
@OK = global i32 0
define i32 @my_wclear(%struct.TYPE_5__* %0) {
%2 = tail call i32 @wmove(%struct.TYPE_5__* %0, i32 0, i32 0)
%3 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1
%6 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1
%9 = mul nsw i32 %8, %5
%10 = icmp sgt i32 %9, -1
br i1 %10, label %11, label %16
11: ; preds = %1, %11
%12 = phi i32 [ %13, %11 ], [ %9, %1 ]
%13 = add nsw i32 %12, -1
%14 = tail call i32 @waddch(%struct.TYPE_5__* %0, i8 signext 32)
%15 = icmp eq i32 %12, 0
br i1 %15, label %16, label %11
16: ; preds = %11, %1
%17 = tail call i32 @wmove(%struct.TYPE_5__* %0, i32 0, i32 0)
%18 = load i32, i32* @OK
ret i32 %18
}