#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*/ printStringDirect(char *, int /*<<< orphan*/, int, int);
void clearScreenDirect(void) {
  int i;
  int j;
  char *empty = " ";
  for (i = 0; i < 80; i++) {
    for (j = 0; j < 25; j++) {
      printStringDirect(empty, 0, i, j);
    }
  }
}


x86 assembly (clang, -O0):
<clearScreenDirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jge    1177 <clearScreenDirect+0x67>
movl   $0x0,-0x8(%rbp)
cmpl   $0x19,-0x8(%rbp)
jge    1164 <clearScreenDirect+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
call   1030 <printStringDirect@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113b <clearScreenDirect+0x2b>
jmp    1169 <clearScreenDirect+0x59>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112a <clearScreenDirect+0x1a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreenDirect>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1030 <printStringDirect@plt>
add    $0x1,%ebp
cmp    $0x19,%ebp
jne    1130 <clearScreenDirect+0x20>
add    $0x1,%ebx
cmp    $0x50,%ebx
jne    1120 <clearScreenDirect+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @clearScreenDirect() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %3
store i32 0, i32* %1
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 80
br i1 %6, label %7, label %23
7: ; preds = %4
store i32 0, i32* %2
br label %8
8: ; preds = %16, %7
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 25
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i8*, i8** %3
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = call i32 @printStringDirect(i8* %12, i32 0, i32 %13, i32 %14)
br label %16
16: ; preds = %11
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %8
19: ; preds = %8
br label %20
20: ; preds = %19
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
br label %4
23: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @clearScreenDirect() {
br label %1
1: ; preds = %0, %8
%2 = phi i32 [ 0, %0 ], [ %9, %8 ]
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @printStringDirect(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0, i32 %2, i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 25
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = add nuw nsw i32 %2, 1
%10 = icmp eq i32 %9, 80
br i1 %10, label %11, label %1
11: ; preds = %8
ret void
}