#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 */

/* Variables and functions */
int /*<<< orphan*/ mvaddch(int, int, char);
void ClearScr(int left, int right, int top, int buttom) {
  int i, j;
  for (i = top; i <= buttom; ++i) {
    for (j = left; j <= right; ++j) {
      mvaddch(i, j, ' ');
    }
  }
}


x86 assembly (clang, -O0):
<ClearScr>:
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    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1179 <ClearScr+0x69>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1166 <ClearScr+0x56>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    $0x20,%edx
call   1030 <mvaddch@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    113c <ClearScr+0x2c>
jmp    116b <ClearScr+0x5b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <ClearScr+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearScr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    %ecx,%edx
jle    112e <ClearScr+0x1e>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
mov    %edi,%r12d
lea    0x1(%r15),%r13d
jmp    114a <ClearScr+0x3a>
nop
lea    0x1(%rbp),%eax
cmp    %r14d,%ebp
mov    %eax,%ebp
je     111f <ClearScr+0xf>
cmp    %r15d,%r12d
jg     1140 <ClearScr+0x30>
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x20,%edx
call   1030 <mvaddch@plt>
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    1160 <ClearScr+0x50>
jmp    1140 <ClearScr+0x30>

LLVM IR (-O0):
define void @ClearScr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %7
store i32 %11, i32* %9
br label %12
12: ; preds = %30, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %8
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %33
16: ; preds = %12
%17 = load i32, i32* %5
store i32 %17, i32* %10
br label %18
18: ; preds = %26, %16
%19 = load i32, i32* %10
%20 = load i32, i32* %6
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %29
22: ; preds = %18
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = call i32 @mvaddch(i32 %23, i32 %24, i8 signext 32)
br label %26
26: ; preds = %22
%27 = load i32, i32* %10
%28 = add nsw i32 %27, 1
store i32 %28, i32* %10
br label %18
29: ; preds = %18
br label %30
30: ; preds = %29
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %12
33: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @ClearScr(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %2, %3
br i1 %5, label %18, label %6
6: ; preds = %4
%7 = icmp sgt i32 %0, %1
br label %8
8: ; preds = %6, %15
%9 = phi i32 [ %2, %6 ], [ %16, %15 ]
br i1 %7, label %15, label %10
10: ; preds = %8, %10
%11 = phi i32 [ %13, %10 ], [ %0, %8 ]
%12 = tail call i32 @mvaddch(i32 %9, i32 %11, i8 signext 32)
%13 = add i32 %11, 1
%14 = icmp eq i32 %11, %1
br i1 %14, label %15, label %10
15: ; preds = %10, %8
%16 = add i32 %9, 1
%17 = icmp eq i32 %9, %3
br i1 %17, label %18, label %8
18: ; preds = %15, %4
ret void
}