#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 */
typedef int uint8_t;
typedef int /*<<< orphan*/ tx;

/* Variables and functions */
int SPItransfer(int, int *, int, int *);
int /*<<< orphan*/ assert(int);
void LCDmoveto(int fd, int x, int y) {
  uint8_t tx[3];
  uint8_t rx[3];
  int ret;
  tx[0] = (0xb0 | (y & 0x0f));
  tx[1] = (0x10 | (x >> 4 & 0x0f));
  tx[2] = (x & 0x0f);
  ret = SPItransfer(fd, tx, sizeof(tx), rx);
  assert(ret == sizeof(tx));
}


x86 assembly (clang, -O0):
<LCDmoveto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
or     $0xb0,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
or     $0x10,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x24(%rbp),%rcx
mov    $0xc,%edx
call   1030 <SPItransfer@plt>
mov    %eax,-0x28(%rbp)
movslq -0x28(%rbp),%rax
cmp    $0xc,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDmoveto>:
sub    $0x18,%rsp
and    $0xf,%edx
or     $0xb0,%edx
mov    %edx,(%rsp)
mov    %esi,%eax
shr    $0x4,%eax
and    $0xf,%eax
or     $0x10,%eax
mov    %eax,0x4(%rsp)
and    $0xf,%esi
mov    %esi,0x8(%rsp)
mov    %rsp,%rsi
lea    0xc(%rsp),%rcx
mov    $0xc,%edx
call   1030 <SPItransfer@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
call   1040 <assert@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @LCDmoveto(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [3 x i32]
%8 = alloca [3 x i32]
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = and i32 %10, 15
%12 = or i32 176, %11
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %5
%15 = ashr i32 %14, 4
%16 = and i32 %15, 15
%17 = or i32 16, %16
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 1
store i32 %17, i32* %18
%19 = load i32, i32* %5
%20 = and i32 %19, 15
%21 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 2
store i32 %20, i32* %21
%22 = load i32, i32* %4
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%25 = call i32 @SPItransfer(i32 %22, i32* %23, i32 12, i32* %24)
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = icmp eq i64 %27, 12
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
ret void
}

LLVM IR (-O2):
define void @LCDmoveto(i32 %0, i32 %1, i32 %2) {
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %4 to i8*
%7 = bitcast [3 x i32]* %5 to i8*
%8 = and i32 %2, 15
%9 = or i32 %8, 176
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 %9, i32* %10
%11 = lshr i32 %1, 4
%12 = and i32 %11, 15
%13 = or i32 %12, 16
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 %13, i32* %14
%15 = and i32 %1, 15
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 %15, i32* %16
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%18 = call i32 @SPItransfer(i32 %0, i32* %10, i32 12, i32* %17)
%19 = icmp eq i32 %18, 12
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}