#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*/ lcd_cmd(int, unsigned short);
void lcd_area(unsigned short x0, unsigned short y0, unsigned short x1,
              unsigned short y1) {
  lcd_cmd(0x03, (x0 >> 0));
  lcd_cmd(0x02, (x0 >> 8));
  lcd_cmd(0x05, (x1 >> 0));
  lcd_cmd(0x04, (x1 >> 8));
  lcd_cmd(0x07, (y0 >> 0));
  lcd_cmd(0x06, (y0 >> 8));
  lcd_cmd(0x09, (y1 >> 0));
  lcd_cmd(0x08, (y1 >> 8));
  return;
}


x86 assembly (clang, -O0):
<lcd_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %si,%dx
mov    %di,%si
mov    %si,-0x2(%rbp)
mov    %dx,-0x4(%rbp)
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x0,%eax
mov    $0x3,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    $0x2,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
movzwl -0x6(%rbp),%eax
sar    $0x0,%eax
mov    $0x5,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
movzwl -0x6(%rbp),%eax
sar    $0x8,%eax
mov    $0x4,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
movzwl -0x4(%rbp),%eax
sar    $0x0,%eax
mov    $0x7,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
mov    $0x6,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
movzwl -0x8(%rbp),%eax
sar    $0x0,%eax
mov    $0x9,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
movzwl -0x8(%rbp),%eax
sar    $0x8,%eax
mov    $0x8,%edi
movzwl %ax,%esi
call   1030 <lcd_cmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_area>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %esi,%r15d
mov    %edi,%ebp
mov    $0x3,%edi
mov    %ebp,%esi
call   1030 <lcd_cmd@plt>
shr    $0x8,%ebp
mov    $0x2,%edi
mov    %ebp,%esi
call   1030 <lcd_cmd@plt>
mov    $0x5,%edi
mov    %ebx,%esi
call   1030 <lcd_cmd@plt>
shr    $0x8,%ebx
mov    $0x4,%edi
mov    %ebx,%esi
call   1030 <lcd_cmd@plt>
mov    $0x7,%edi
mov    %r15d,%esi
call   1030 <lcd_cmd@plt>
shr    $0x8,%r15d
mov    $0x6,%edi
mov    %r15d,%esi
call   1030 <lcd_cmd@plt>
mov    $0x9,%edi
mov    %r14d,%esi
call   1030 <lcd_cmd@plt>
shr    $0x8,%r14d
mov    $0x8,%edi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <lcd_cmd@plt>

LLVM IR (-O0):
define void @lcd_area(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
store i16 %0, i16* %5
store i16 %1, i16* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = load i16, i16* %5
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 0
%12 = trunc i32 %11 to i16
%13 = call i32 @lcd_cmd(i32 3, i16 zeroext %12)
%14 = load i16, i16* %5
%15 = zext i16 %14 to i32
%16 = ashr i32 %15, 8
%17 = trunc i32 %16 to i16
%18 = call i32 @lcd_cmd(i32 2, i16 zeroext %17)
%19 = load i16, i16* %7
%20 = zext i16 %19 to i32
%21 = ashr i32 %20, 0
%22 = trunc i32 %21 to i16
%23 = call i32 @lcd_cmd(i32 5, i16 zeroext %22)
%24 = load i16, i16* %7
%25 = zext i16 %24 to i32
%26 = ashr i32 %25, 8
%27 = trunc i32 %26 to i16
%28 = call i32 @lcd_cmd(i32 4, i16 zeroext %27)
%29 = load i16, i16* %6
%30 = zext i16 %29 to i32
%31 = ashr i32 %30, 0
%32 = trunc i32 %31 to i16
%33 = call i32 @lcd_cmd(i32 7, i16 zeroext %32)
%34 = load i16, i16* %6
%35 = zext i16 %34 to i32
%36 = ashr i32 %35, 8
%37 = trunc i32 %36 to i16
%38 = call i32 @lcd_cmd(i32 6, i16 zeroext %37)
%39 = load i16, i16* %8
%40 = zext i16 %39 to i32
%41 = ashr i32 %40, 0
%42 = trunc i32 %41 to i16
%43 = call i32 @lcd_cmd(i32 9, i16 zeroext %42)
%44 = load i16, i16* %8
%45 = zext i16 %44 to i32
%46 = ashr i32 %45, 8
%47 = trunc i32 %46 to i16
%48 = call i32 @lcd_cmd(i32 8, i16 zeroext %47)
ret void
}

LLVM IR (-O2):
define void @lcd_area(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3) {
%5 = tail call i32 @lcd_cmd(i32 3, i16 zeroext %0)
%6 = lshr i16 %0, 8
%7 = tail call i32 @lcd_cmd(i32 2, i16 zeroext %6)
%8 = tail call i32 @lcd_cmd(i32 5, i16 zeroext %2)
%9 = lshr i16 %2, 8
%10 = tail call i32 @lcd_cmd(i32 4, i16 zeroext %9)
%11 = tail call i32 @lcd_cmd(i32 7, i16 zeroext %1)
%12 = lshr i16 %1, 8
%13 = tail call i32 @lcd_cmd(i32 6, i16 zeroext %12)
%14 = tail call i32 @lcd_cmd(i32 9, i16 zeroext %3)
%15 = lshr i16 %3, 8
%16 = tail call i32 @lcd_cmd(i32 8, i16 zeroext %15)
ret void
}