#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*/ delay_ms(int);
int /*<<< orphan*/ sendLCD(int, char);
void putcharLCD(char c) {
  switch (c) {
  case '\r':
    sendLCD(0, 1);
    delay_ms(2);
    break;
  case '\f':
    sendLCD(0, 0x80);
    break;
  case '\n':
    sendLCD(0, 0xc0);
    break;
  default:
    sendLCD(1, c);
    break;
  }
}


x86 assembly (clang, -O0):
<putcharLCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xa,%eax
je     1191 <putcharLCD+0x71>
jmp    1143 <putcharLCD+0x23>
mov    -0x8(%rbp),%eax
sub    $0xc,%eax
je     1180 <putcharLCD+0x60>
jmp    1154 <putcharLCD+0x34>
mov    -0x8(%rbp),%eax
sub    $0xd,%eax
jne    11a2 <putcharLCD+0x82>
jmp    1165 <putcharLCD+0x45>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <sendLCD@plt>
mov    $0x2,%edi
call   1030 <delay_ms@plt>
jmp    11b0 <putcharLCD+0x90>
xor    %edi,%edi
mov    $0xffffff80,%esi
call   1040 <sendLCD@plt>
jmp    11b0 <putcharLCD+0x90>
xor    %edi,%edi
mov    $0xffffffc0,%esi
call   1040 <sendLCD@plt>
jmp    11b0 <putcharLCD+0x90>
mov    $0x1,%edi
movsbl -0x1(%rbp),%esi
call   1040 <sendLCD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcharLCD>:
cmp    $0xa,%edi
je     1147 <putcharLCD+0x27>
cmp    $0xc,%edi
je     1153 <putcharLCD+0x33>
cmp    $0xd,%edi
jne    115f <putcharLCD+0x3f>
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <sendLCD@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <delay_ms@plt>
xor    %edi,%edi
mov    $0xffffffc0,%esi
jmp    1040 <sendLCD@plt>
xor    %edi,%edi
mov    $0xffffff80,%esi
jmp    1040 <sendLCD@plt>
movsbl %dil,%esi
mov    $0x1,%edi
jmp    1040 <sendLCD@plt>

LLVM IR (-O0):
define void @putcharLCD(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %12 [
i32 13, label %5
i32 12, label %8
i32 10, label %10
]
5: ; preds = %1
%6 = call i32 @sendLCD(i32 0, i8 signext 1)
%7 = call i32 @delay_ms(i32 2)
br label %15
8: ; preds = %1
%9 = call i32 @sendLCD(i32 0, i8 signext -128)
br label %15
10: ; preds = %1
%11 = call i32 @sendLCD(i32 0, i8 signext -64)
br label %15
12: ; preds = %1
%13 = load i8, i8* %2
%14 = call i32 @sendLCD(i32 1, i8 signext %13)
br label %15
15: ; preds = %12, %10, %8, %5
ret void
}

LLVM IR (-O2):
define void @putcharLCD(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %10 [
i32 13, label %3
i32 12, label %6
i32 10, label %8
]
3: ; preds = %1
%4 = tail call i32 @sendLCD(i32 0, i8 signext 1)
%5 = tail call i32 @delay_ms(i32 2)
br label %12
6: ; preds = %1
%7 = tail call i32 @sendLCD(i32 0, i8 signext -128)
br label %12
8: ; preds = %1
%9 = tail call i32 @sendLCD(i32 0, i8 signext -64)
br label %12
10: ; preds = %1
%11 = tail call i32 @sendLCD(i32 1, i8 signext %0)
br label %12
12: ; preds = %10, %8, %6, %3
ret void
}