#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_Write_Byte(int /*<<< orphan*/, int);
void LCD_Goto(unsigned char x, unsigned char y) {
  unsigned char address;
  switch (y) {
  case 1:
    address = 0x00;
    break;
  case 2:
    address = 0x40;
    break;
  case 3:
    address = 0x14;
    break;
  case 4:
    address = 0x54;
    break;
  default:
    address = 0x00;
    break;
  }
  address += x - 1;
  LCD_Write_Byte(0, 0x80 | address);
}


x86 assembly (clang, -O0):
<LCD_Goto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     1172 <LCD_Goto+0x62>
mov    -0x10(%rbp),%rax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x0,-0x3(%rbp)
jmp    1176 <LCD_Goto+0x66>
movb   $0x40,-0x3(%rbp)
jmp    1176 <LCD_Goto+0x66>
movb   $0x14,-0x3(%rbp)
jmp    1176 <LCD_Goto+0x66>
movb   $0x54,-0x3(%rbp)
jmp    1176 <LCD_Goto+0x66>
movb   $0x0,-0x3(%rbp)
movzbl -0x1(%rbp),%ecx
sub    $0x1,%ecx
movzbl -0x3(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%esi
or     $0x80,%esi
xor    %edi,%edi
call   1030 <LCD_Write_Byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Goto>:
add    $0xfe,%sil
movzbl %sil,%eax
lea    0x0(,%rax,8),%ecx
mov    $0x541440,%edx
shr    %cl,%edx
xor    %ecx,%ecx
cmp    $0x3,%al
cmovae %ecx,%edx
add    %dil,%dl
add    $0xff,%dl
or     $0x80,%dl
movzbl %dl,%esi
xor    %edi,%edi
jmp    1030 <LCD_Write_Byte@plt>

LLVM IR (-O0):
define void @LCD_Goto(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
switch i32 %7, label %12 [
i32 1, label %8
i32 2, label %9
i32 3, label %10
i32 4, label %11
]
8: ; preds = %2
store i8 0, i8* %5
br label %13
9: ; preds = %2
store i8 64, i8* %5
br label %13
10: ; preds = %2
store i8 20, i8* %5
br label %13
11: ; preds = %2
store i8 84, i8* %5
br label %13
12: ; preds = %2
store i8 0, i8* %5
br label %13
13: ; preds = %12, %11, %10, %9, %8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = sub nsw i32 %15, 1
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = add nsw i32 %18, %16
%20 = trunc i32 %19 to i8
store i8 %20, i8* %5
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = or i32 128, %22
%24 = call i32 @LCD_Write_Byte(i32 0, i32 %23)
ret void
}

LLVM IR (-O2):
define void @LCD_Goto(i8 zeroext %0, i8 zeroext %1) {
%3 = add i8 %1, -2
%4 = icmp ult i8 %3, 3
%5 = zext i8 %3 to i24
%6 = shl nuw nsw i24 %5, 3
%7 = lshr i24 5510208, %6
%8 = trunc i24 %7 to i8
%9 = select i1 %4, i8 %8, i8 0
%10 = add i8 %0, 127
%11 = add i8 %10, %9
%12 = or i8 %11, -128
%13 = zext i8 %12 to i32
%14 = tail call i32 @LCD_Write_Byte(i32 0, i32 %13)
ret void
}