#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*/ printf(char *);
void clearScreen(void) {
  char i = 0;
  while (i < 40) {
    printf("\n");
    i++;
  }
}


x86 assembly (clang, -O0):
<clearScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x28,%eax
jge    1142 <clearScreen+0x32>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    111c <clearScreen+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearScreen>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @clearScreen() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %6, %0
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp slt i32 %4, 40
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %1
%9 = add i8 %8, 1
store i8 %9, i8* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @clearScreen() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @putchar(i32 10)
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @putchar(i32 10)
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @putchar(i32 10)
%13 = tail call i32 @putchar(i32 10)
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @putchar(i32 10)
%16 = tail call i32 @putchar(i32 10)
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @putchar(i32 10)
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 @putchar(i32 10)
%21 = tail call i32 @putchar(i32 10)
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 @putchar(i32 10)
%24 = tail call i32 @putchar(i32 10)
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 @putchar(i32 10)
%27 = tail call i32 @putchar(i32 10)
%28 = tail call i32 @putchar(i32 10)
%29 = tail call i32 @putchar(i32 10)
%30 = tail call i32 @putchar(i32 10)
%31 = tail call i32 @putchar(i32 10)
%32 = tail call i32 @putchar(i32 10)
%33 = tail call i32 @putchar(i32 10)
%34 = tail call i32 @putchar(i32 10)
%35 = tail call i32 @putchar(i32 10)
%36 = tail call i32 @putchar(i32 10)
%37 = tail call i32 @putchar(i32 10)
%38 = tail call i32 @putchar(i32 10)
%39 = tail call i32 @putchar(i32 10)
%40 = tail call i32 @putchar(i32 10)
ret void
}