#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*/ my_putstr(char *);
char *my_errors(int err) {
  if (err == 0)
    my_putstr("Error two operands without operator\n");
  else if (err == 1)
    my_putstr("Syntax error or collide between base and operators\n");
  else if (err == 2)
    my_putstr("Error, the expression have different numbers of parentheses\n");
  else if (err == 4)
    my_putstr("Failed to translate the expression\n");
  else if (err == 5)
    my_putstr("Failed to compute the expression\n");
  return ("The program terminated with an error\n");
}


x86 assembly (clang, -O0):
<my_errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1136 <my_errors+0x26>
lea    0xed4(%rip),%rdi
call   1030 <my_putstr@plt>
jmp    11b1 <my_errors+0xa1>
cmpl   $0x1,-0x4(%rbp)
jne    1151 <my_errors+0x41>
lea    0xede(%rip),%rdi
call   1030 <my_putstr@plt>
jmp    11ac <my_errors+0x9c>
cmpl   $0x2,-0x4(%rbp)
jne    116c <my_errors+0x5c>
lea    0xef7(%rip),%rdi
call   1030 <my_putstr@plt>
jmp    11a7 <my_errors+0x97>
cmpl   $0x4,-0x4(%rbp)
jne    1187 <my_errors+0x77>
lea    0xf19(%rip),%rdi
call   1030 <my_putstr@plt>
jmp    11a2 <my_errors+0x92>
cmpl   $0x5,-0x4(%rbp)
jne    119d <my_errors+0x8d>
lea    0xf22(%rip),%rdi
call   1030 <my_putstr@plt>
jmp    11a2 <my_errors+0x92>
jmp    11a7 <my_errors+0x97>
jmp    11ac <my_errors+0x9c>
jmp    11b1 <my_errors+0xa1>
lea    0xf24(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_errors>:
cmp    $0x5,%edi
ja     113a <my_errors+0x2a>
mov    $0x37,%eax
bt     %edi,%eax
jae    113a <my_errors+0x2a>
push   %rax
movslq %edi,%rax
lea    0xfda(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <my_putstr@plt>
add    $0x8,%rsp
lea    0xf9b(%rip),%rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Error two operands without operator\0A\00"
@.str.1 = [52 x i8] c"Syntax error or collide between base and operators\0A\00"
@.str.2 = [61 x i8] c"Error, the expression have different numbers of parentheses\0A\00"
@.str.3 = [36 x i8] c"Failed to translate the expression\0A\00"
@.str.4 = [34 x i8] c"Failed to compute the expression\0A\00"
@.str.5 = [38 x i8] c"The program terminated with an error\0A\00"
define i8* @my_errors(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @my_putstr(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %31
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @my_putstr(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
br label %30
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @my_putstr(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
br label %29
17: ; preds = %12
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 4
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @my_putstr(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %28
22: ; preds = %17
%23 = load i32, i32* %2
%24 = icmp eq i32 %23, 5
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 @my_putstr(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %22
br label %28
28: ; preds = %27, %20
br label %29
29: ; preds = %28, %15
br label %30
30: ; preds = %29, %10
br label %31
31: ; preds = %30, %5
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [37 x i8] c"Error two operands without operator\0A\00"
@.str.1 = [52 x i8] c"Syntax error or collide between base and operators\0A\00"
@.str.2 = [61 x i8] c"Error, the expression have different numbers of parentheses\0A\00"
@.str.3 = [36 x i8] c"Failed to translate the expression\0A\00"
@.str.4 = [34 x i8] c"Failed to compute the expression\0A\00"
@.str.5 = [38 x i8] c"The program terminated with an error\0A\00"
@reltable.my_errors = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.my_errors to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([52 x i8]* @.str.1 to i64), i64 ptrtoint ([6 x i32]* @reltable.my_errors to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([61 x i8]* @.str.2 to i64), i64 ptrtoint ([6 x i32]* @reltable.my_errors to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([37 x i8]* @.str to i64), i64 ptrtoint ([6 x i32]* @reltable.my_errors to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([36 x i8]* @.str.3 to i64), i64 ptrtoint ([6 x i32]* @reltable.my_errors to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([34 x i8]* @.str.4 to i64), i64 ptrtoint ([6 x i32]* @reltable.my_errors to i64)) to i32)]
define i8* @my_errors(i32 %0) {
%2 = icmp ult i32 %0, 6
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = lshr i8 55, %4
%6 = and i8 %5, 1
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = sext i32 %0 to i64
%10 = shl i64 %9, 2
%11 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.my_errors to i8*), i64 %10)
%12 = tail call i32 @my_putstr(i8* %11)
br label %13
13: ; preds = %3, %1, %8
ret i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0)
}