#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*/ printf(char *);
void errou(unsigned char id) {
  if (id == 0)
    printf("ERRO: Arquivo ou diretorio inexistente.\n");
  if (id == 1)
    printf("ERRO: Nao ha' permissao para executar esta operacao.\n");
  if (id == 2)
    printf("ERRO: Nao ha' espaco suficiente em disco.\n");
}


x86 assembly (clang, -O0):
<errou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x0,%eax
jne    1137 <errou+0x27>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x1,%eax
jne    1150 <errou+0x40>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x1(%rbp),%eax
cmp    $0x2,%eax
jne    1169 <errou+0x59>
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errou>:
cmp    $0x2,%dil
ja     112d <errou+0x1d>
movsbq %dil,%rax
lea    0xf67(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@.str = [41 x i8] c"ERRO: Arquivo ou diretorio inexistente.\0A\00"
@.str.1 = [54 x i8] c"ERRO: Nao ha' permissao para executar esta operacao.\0A\00"
@.str.2 = [43 x i8] c"ERRO: Nao ha' espaco suficiente em disco.\0A\00"
define void @errou(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %14
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"ERRO: Nao ha' espaco suficiente em disco.\00"
@str.3 = [53 x i8] c"ERRO: Nao ha' permissao para executar esta operacao.\00"
@str.4 = [40 x i8] c"ERRO: Arquivo ou diretorio inexistente.\00"
@reltable.errou = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([40 x i8]* @str.4 to i64), i64 ptrtoint ([3 x i32]* @reltable.errou to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([53 x i8]* @str.3 to i64), i64 ptrtoint ([3 x i32]* @reltable.errou to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([42 x i8]* @str to i64), i64 ptrtoint ([3 x i32]* @reltable.errou to i64)) to i32)]
define void @errou(i8 zeroext %0) {
%2 = icmp ult i8 %0, 3
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = sext i8 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.errou to i8*), i64 %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
br label %8
8: ; preds = %1, %3
ret void
}