#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*/ Lcd4_Cmd(char);
void Lcd4_Set_Cursor(char a, char b) {
  char temp, z, y;
  if (a == 1) {
    temp = 0x80 + b;
    z = temp >> 4;
    y = (0x80 + b) & 0x0F;
    Lcd4_Cmd(z);
    Lcd4_Cmd(y);
  } else if (a == 2) {
    temp = 0xC0 + b;
    z = temp >> 4;
    y = (0xC0 + b) & 0x0F;
    Lcd4_Cmd(z);
    Lcd4_Cmd(y);
  }
}


x86 assembly (clang, -O0):
<Lcd4_Set_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
cmp    $0x1,%eax
jne    116d <Lcd4_Set_Cursor+0x5d>
movsbl -0x2(%rbp),%eax
add    $0x80,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x4(%rbp)
movsbl -0x2(%rbp),%eax
add    $0x80,%eax
and    $0xf,%eax
mov    %al,-0x5(%rbp)
movsbl -0x4(%rbp),%edi
call   1030 <Lcd4_Cmd@plt>
movsbl -0x5(%rbp),%edi
call   1030 <Lcd4_Cmd@plt>
jmp    11b6 <Lcd4_Set_Cursor+0xa6>
movsbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    11b1 <Lcd4_Set_Cursor+0xa1>
movsbl -0x2(%rbp),%eax
add    $0xc0,%eax
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x4(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xc0,%eax
and    $0xf,%eax
mov    %al,-0x5(%rbp)
movsbl -0x4(%rbp),%edi
call   1030 <Lcd4_Cmd@plt>
movsbl -0x5(%rbp),%edi
call   1030 <Lcd4_Cmd@plt>
jmp    11b6 <Lcd4_Set_Cursor+0xa6>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd4_Set_Cursor>:
push   %rbx
mov    %esi,%ebx
cmp    $0x2,%dil
je     1129 <Lcd4_Set_Cursor+0x19>
cmp    $0x1,%dil
jne    114b <Lcd4_Set_Cursor+0x3b>
movsbl %bl,%eax
shr    $0x4,%eax
xor    $0xf8,%al
jmp    1137 <Lcd4_Set_Cursor+0x27>
movzbl %bl,%eax
shl    $0x18,%eax
add    $0xc0000000,%eax
sar    $0x1c,%eax
and    $0xf,%bl
movsbl %al,%edi
call   1030 <Lcd4_Cmd@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <Lcd4_Cmd@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @Lcd4_Set_Cursor(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %29
11: ; preds = %2
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = add nsw i32 128, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %5
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = ashr i32 %17, 4
%19 = trunc i32 %18 to i8
store i8 %19, i8* %6
%20 = load i8, i8* %4
%21 = sext i8 %20 to i32
%22 = add nsw i32 128, %21
%23 = and i32 %22, 15
%24 = trunc i32 %23 to i8
store i8 %24, i8* %7
%25 = load i8, i8* %6
%26 = call i32 @Lcd4_Cmd(i8 signext %25)
%27 = load i8, i8* %7
%28 = call i32 @Lcd4_Cmd(i8 signext %27)
br label %52
29: ; preds = %2
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 2
br i1 %32, label %33, label %51
33: ; preds = %29
%34 = load i8, i8* %4
%35 = sext i8 %34 to i32
%36 = add nsw i32 192, %35
%37 = trunc i32 %36 to i8
store i8 %37, i8* %5
%38 = load i8, i8* %5
%39 = sext i8 %38 to i32
%40 = ashr i32 %39, 4
%41 = trunc i32 %40 to i8
store i8 %41, i8* %6
%42 = load i8, i8* %4
%43 = sext i8 %42 to i32
%44 = add nsw i32 192, %43
%45 = and i32 %44, 15
%46 = trunc i32 %45 to i8
store i8 %46, i8* %7
%47 = load i8, i8* %6
%48 = call i32 @Lcd4_Cmd(i8 signext %47)
%49 = load i8, i8* %7
%50 = call i32 @Lcd4_Cmd(i8 signext %49)
br label %51
51: ; preds = %33, %29
br label %52
52: ; preds = %51, %11
ret void
}

LLVM IR (-O2):
define void @Lcd4_Set_Cursor(i8 signext %0, i8 signext %1) {
switch i8 %0, label %20 [
i8 1, label %3
i8 2, label %9
]
3: ; preds = %2
%4 = zext i8 %1 to i32
%5 = shl nuw i32 %4, 24
%6 = ashr i32 %5, 28
%7 = trunc i32 %6 to i8
%8 = xor i8 %7, -8
br label %15
9: ; preds = %2
%10 = zext i8 %1 to i32
%11 = shl nuw i32 %10, 24
%12 = add i32 %11, -1073741824
%13 = ashr i32 %12, 28
%14 = trunc i32 %13 to i8
br label %15
15: ; preds = %3, %9
%16 = phi i8 [ %14, %9 ], [ %8, %3 ]
%17 = and i8 %1, 15
%18 = tail call i32 @Lcd4_Cmd(i8 signext %16)
%19 = tail call i32 @Lcd4_Cmd(i8 signext %17)
br label %20
20: ; preds = %15, %2
ret void
}