#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*/ WriteSpiCommand(int);
int /*<<< orphan*/ WriteSpiData(int);
void LCDClearScreen(void) {
  long i;
  WriteSpiCommand(0x75);
  WriteSpiData(0);
  WriteSpiData(131);
  WriteSpiCommand(0x15);
  WriteSpiData(0);
  WriteSpiData(131);
  WriteSpiCommand(0x5C);
  for (i = 0; i < ((131 * 131) / 2); i++) {
    WriteSpiData((0x000 >> 4) & 0xFF);
    WriteSpiData(((0x000 & 0xF) << 4) | ((0x000 >> 8) & 0xF));
    WriteSpiData(0x000 & 0xFF);
  }
}


x86 assembly (clang, -O0):
<LCDClearScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x75,%edi
call   1030 <WriteSpiCommand@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
mov    $0x83,%edi
call   1040 <WriteSpiData@plt>
mov    $0x15,%edi
call   1030 <WriteSpiCommand@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
mov    $0x83,%edi
call   1040 <WriteSpiData@plt>
mov    $0x5c,%edi
call   1030 <WriteSpiCommand@plt>
movq   $0x0,-0x8(%rbp)
cmpq   $0x2184,-0x8(%rbp)
jge    11a4 <LCDClearScreen+0x84>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <LCDClearScreen+0x50>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDClearScreen>:
push   %rbx
mov    $0x75,%edi
call   1030 <WriteSpiCommand@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
mov    $0x83,%edi
call   1040 <WriteSpiData@plt>
mov    $0x15,%edi
call   1030 <WriteSpiCommand@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
mov    $0x83,%edi
call   1040 <WriteSpiData@plt>
mov    $0x5c,%edi
call   1030 <WriteSpiCommand@plt>
mov    $0x2184,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
xor    %edi,%edi
call   1040 <WriteSpiData@plt>
add    $0xffffffffffffffff,%rbx
jne    1170 <LCDClearScreen+0x50>
pop    %rbx
ret

LLVM IR (-O0):
define void @LCDClearScreen() {
%1 = alloca i64
%2 = call i32 @WriteSpiCommand(i32 117)
%3 = call i32 @WriteSpiData(i32 0)
%4 = call i32 @WriteSpiData(i32 131)
%5 = call i32 @WriteSpiCommand(i32 21)
%6 = call i32 @WriteSpiData(i32 0)
%7 = call i32 @WriteSpiData(i32 131)
%8 = call i32 @WriteSpiCommand(i32 92)
store i64 0, i64* %1
br label %9
9: ; preds = %16, %0
%10 = load i64, i64* %1
%11 = icmp slt i64 %10, 8580
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = call i32 @WriteSpiData(i32 0)
%14 = call i32 @WriteSpiData(i32 0)
%15 = call i32 @WriteSpiData(i32 0)
br label %16
16: ; preds = %12
%17 = load i64, i64* %1
%18 = add nsw i64 %17, 1
store i64 %18, i64* %1
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @LCDClearScreen() {
%1 = tail call i32 @WriteSpiCommand(i32 117)
%2 = tail call i32 @WriteSpiData(i32 0)
%3 = tail call i32 @WriteSpiData(i32 131)
%4 = tail call i32 @WriteSpiCommand(i32 21)
%5 = tail call i32 @WriteSpiData(i32 0)
%6 = tail call i32 @WriteSpiData(i32 131)
%7 = tail call i32 @WriteSpiCommand(i32 92)
br label %8
8: ; preds = %0, %8
%9 = phi i64 [ 0, %0 ], [ %13, %8 ]
%10 = tail call i32 @WriteSpiData(i32 0)
%11 = tail call i32 @WriteSpiData(i32 0)
%12 = tail call i32 @WriteSpiData(i32 0)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, 8580
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}