#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_wr_command(int);
void lcd_cursor(char row, char column) {
  switch (row) {
  case 1:
    lcd_wr_command(0x80 + column - 1);
    break;
  case 2:
    lcd_wr_command(0xc0 + column - 1);
    break;
  case 3:
    lcd_wr_command(0x94 + column - 1);
    break;
  case 4:
    lcd_wr_command(0xd4 + column - 1);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<lcd_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3,%eax
ja     11aa <lcd_cursor+0x9a>
mov    -0x10(%rbp),%rax
lea    0xebb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl -0x2(%rbp),%edi
add    $0x80,%edi
sub    $0x1,%edi
call   1030 <lcd_wr_command@plt>
jmp    11af <lcd_cursor+0x9f>
movsbl -0x2(%rbp),%edi
add    $0xc0,%edi
sub    $0x1,%edi
call   1030 <lcd_wr_command@plt>
jmp    11af <lcd_cursor+0x9f>
movsbl -0x2(%rbp),%edi
add    $0x94,%edi
sub    $0x1,%edi
call   1030 <lcd_wr_command@plt>
jmp    11af <lcd_cursor+0x9f>
movsbl -0x2(%rbp),%edi
add    $0xd4,%edi
sub    $0x1,%edi
call   1030 <lcd_wr_command@plt>
jmp    11af <lcd_cursor+0x9f>
jmp    11af <lcd_cursor+0x9f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_cursor>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
ja     112e <lcd_cursor+0x1e>
movslq %edi,%rax
lea    0xede(%rip),%rcx
movsbl %sil,%edi
add    (%rcx,%rax,4),%edi
jmp    1030 <lcd_wr_command@plt>
ret

LLVM IR (-O0):
define void @lcd_cursor(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
switch i32 %6, label %31 [
i32 1, label %7
i32 2, label %13
i32 3, label %19
i32 4, label %25
]
7: ; preds = %2
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = add nsw i32 128, %9
%11 = sub nsw i32 %10, 1
%12 = call i32 @lcd_wr_command(i32 %11)
br label %32
13: ; preds = %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
%16 = add nsw i32 192, %15
%17 = sub nsw i32 %16, 1
%18 = call i32 @lcd_wr_command(i32 %17)
br label %32
19: ; preds = %2
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = add nsw i32 148, %21
%23 = sub nsw i32 %22, 1
%24 = call i32 @lcd_wr_command(i32 %23)
br label %32
25: ; preds = %2
%26 = load i8, i8* %4
%27 = sext i8 %26 to i32
%28 = add nsw i32 212, %27
%29 = sub nsw i32 %28, 1
%30 = call i32 @lcd_wr_command(i32 %29)
br label %32
31: ; preds = %2
br label %32
32: ; preds = %31, %25, %19, %13, %7
ret void
}

LLVM IR (-O2):
@switch.table.lcd_cursor = [4 x i32] [i32 127, i32 191, i32 147, i32 211]
define void @lcd_cursor(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = add nsw i32 %3, -1
%5 = icmp ult i32 %4, 4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.lcd_cursor, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = sext i8 %1 to i32
%11 = add nsw i32 %9, %10
%12 = tail call i32 @lcd_wr_command(i32 %11)
br label %13
13: ; preds = %2, %6
ret void
}