#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 LCDSetPixel(int x, int y, int color) {
  WriteSpiCommand(0x75);
  WriteSpiData(x);
  WriteSpiData(x);
  WriteSpiCommand(0x15);
  WriteSpiData(y);
  WriteSpiData(y);
  WriteSpiCommand(0x5C);
  WriteSpiData((color >> 4) & 0xFF);
  WriteSpiData(((color & 0xF) << 4) | ((color >> 8) & 0xF));
  WriteSpiData(color & 0xFF);
}


x86 assembly (clang, -O0):
<LCDSetPixel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x75,%edi
call   1030 <WriteSpiCommand@plt>
mov    -0x4(%rbp),%edi
call   1040 <WriteSpiData@plt>
mov    -0x4(%rbp),%edi
call   1040 <WriteSpiData@plt>
mov    $0x15,%edi
call   1030 <WriteSpiCommand@plt>
mov    -0x8(%rbp),%edi
call   1040 <WriteSpiData@plt>
mov    -0x8(%rbp),%edi
call   1040 <WriteSpiData@plt>
mov    $0x5c,%edi
call   1030 <WriteSpiCommand@plt>
mov    -0xc(%rbp),%edi
sar    $0x4,%edi
and    $0xff,%edi
call   1040 <WriteSpiData@plt>
mov    -0xc(%rbp),%edi
and    $0xf,%edi
shl    $0x4,%edi
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xf,%eax
or     %eax,%edi
call   1040 <WriteSpiData@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
call   1040 <WriteSpiData@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDSetPixel>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0x75,%edi
call   1030 <WriteSpiCommand@plt>
mov    %ebp,%edi
call   1040 <WriteSpiData@plt>
mov    %ebp,%edi
call   1040 <WriteSpiData@plt>
mov    $0x15,%edi
call   1030 <WriteSpiCommand@plt>
mov    %r14d,%edi
call   1040 <WriteSpiData@plt>
mov    %r14d,%edi
call   1040 <WriteSpiData@plt>
mov    $0x5c,%edi
call   1030 <WriteSpiCommand@plt>
mov    %ebx,%eax
shr    $0x4,%eax
movzbl %al,%edi
call   1040 <WriteSpiData@plt>
mov    %ebx,%eax
shl    $0x4,%eax
movzbl %al,%eax
mov    %ebx,%edi
shr    $0x8,%edi
and    $0xf,%edi
or     %eax,%edi
call   1040 <WriteSpiData@plt>
movzbl %bl,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <WriteSpiData@plt>

LLVM IR (-O0):
define void @LCDSetPixel(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 @WriteSpiCommand(i32 117)
%8 = load i32, i32* %4
%9 = call i32 @WriteSpiData(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @WriteSpiData(i32 %10)
%12 = call i32 @WriteSpiCommand(i32 21)
%13 = load i32, i32* %5
%14 = call i32 @WriteSpiData(i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @WriteSpiData(i32 %15)
%17 = call i32 @WriteSpiCommand(i32 92)
%18 = load i32, i32* %6
%19 = ashr i32 %18, 4
%20 = and i32 %19, 255
%21 = call i32 @WriteSpiData(i32 %20)
%22 = load i32, i32* %6
%23 = and i32 %22, 15
%24 = shl i32 %23, 4
%25 = load i32, i32* %6
%26 = ashr i32 %25, 8
%27 = and i32 %26, 15
%28 = or i32 %24, %27
%29 = call i32 @WriteSpiData(i32 %28)
%30 = load i32, i32* %6
%31 = and i32 %30, 255
%32 = call i32 @WriteSpiData(i32 %31)
ret void
}

LLVM IR (-O2):
define void @LCDSetPixel(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @WriteSpiCommand(i32 117)
%5 = tail call i32 @WriteSpiData(i32 %0)
%6 = tail call i32 @WriteSpiData(i32 %0)
%7 = tail call i32 @WriteSpiCommand(i32 21)
%8 = tail call i32 @WriteSpiData(i32 %1)
%9 = tail call i32 @WriteSpiData(i32 %1)
%10 = tail call i32 @WriteSpiCommand(i32 92)
%11 = lshr i32 %2, 4
%12 = and i32 %11, 255
%13 = tail call i32 @WriteSpiData(i32 %12)
%14 = shl i32 %2, 4
%15 = and i32 %14, 240
%16 = lshr i32 %2, 8
%17 = and i32 %16, 15
%18 = or i32 %15, %17
%19 = tail call i32 @WriteSpiData(i32 %18)
%20 = and i32 %2, 255
%21 = tail call i32 @WriteSpiData(i32 %20)
ret void
}