#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*/ envia_byte_lcd(int, char);
int /*<<< orphan*/ posicao_xy_lcd(int, int);
void exibe_lcd(char caracter) {
  switch (caracter) {
  case '\f':
    envia_byte_lcd(0, 1);
    delay_ms(2);
    break;
  case '\n':
    posicao_xy_lcd(1, 2);
    break;
  case '\b':
    envia_byte_lcd(0, 10);
    break;
  default:
    envia_byte_lcd(1, caracter);
    break;
  }
}


x86 assembly (clang, -O0):
<exibe_lcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x8,%eax
je     11a4 <exibe_lcd+0x74>
jmp    1153 <exibe_lcd+0x23>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
je     1190 <exibe_lcd+0x60>
jmp    1164 <exibe_lcd+0x34>
mov    -0x8(%rbp),%eax
sub    $0xc,%eax
jne    11b5 <exibe_lcd+0x85>
jmp    1175 <exibe_lcd+0x45>
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <envia_byte_lcd@plt>
mov    $0x2,%edi
call   1040 <delay_ms@plt>
jmp    11c3 <exibe_lcd+0x93>
mov    $0x1,%edi
mov    $0x2,%esi
call   1050 <posicao_xy_lcd@plt>
jmp    11c3 <exibe_lcd+0x93>
xor    %edi,%edi
mov    $0xa,%esi
call   1030 <envia_byte_lcd@plt>
jmp    11c3 <exibe_lcd+0x93>
mov    $0x1,%edi
movsbl -0x1(%rbp),%esi
call   1030 <envia_byte_lcd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exibe_lcd>:
cmp    $0x8,%edi
je     1157 <exibe_lcd+0x27>
cmp    $0xa,%edi
je     1163 <exibe_lcd+0x33>
cmp    $0xc,%edi
jne    1172 <exibe_lcd+0x42>
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <envia_byte_lcd@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <delay_ms@plt>
xor    %edi,%edi
mov    $0xa,%esi
jmp    1030 <envia_byte_lcd@plt>
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1050 <posicao_xy_lcd@plt>
movsbl %dil,%esi
mov    $0x1,%edi
jmp    1030 <envia_byte_lcd@plt>

LLVM IR (-O0):
define void @exibe_lcd(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 12, label %5
i32 10, label %8
i32 8, label %10
]
5: ; preds = %1
%6 = call i32 @envia_byte_lcd(i32 0, i8 signext 1)
%7 = call i32 @delay_ms(i32 2)
br label %15
8: ; preds = %1
%9 = call i32 @posicao_xy_lcd(i32 1, i32 2)
br label %15
10: ; preds = %1
%11 = call i32 @envia_byte_lcd(i32 0, i8 signext 10)
br label %15
12: ; preds = %1
%13 = load i8, i8* %2
%14 = call i32 @envia_byte_lcd(i32 1, i8 signext %13)
br label %15
15: ; preds = %12, %10, %8, %5
ret void
}

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