#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 */
scalar_t__ isalpha(char *);
scalar_t__ isdigit(char *);
scalar_t__ ispunct(char *);
scalar_t__ isspace(char *);
int /*<<< orphan*/ *strchr(char *, char *);
int indentifyLexema(char *buffer_i) {
  char *operators = "+-*/^%";
  if (strchr(operators, buffer_i) != NULL) {
    return 4;
  } else if (isdigit(buffer_i)) {
    return 1;
  } else if (isspace(buffer_i)) {
    return 0;
  } else if (ispunct(buffer_i)) {
    return 3;
  } else if (isalpha(buffer_i)) {
    return 5;
  } else {
    return 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<indentifyLexema>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strchr@plt>
cmp    $0x0,%rax
je     118a <indentifyLexema+0x3a>
movl   $0x4,-0x4(%rbp)
jmp    120d <indentifyLexema+0xbd>
mov    -0x10(%rbp),%rdi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11a9 <indentifyLexema+0x59>
movl   $0x1,-0x4(%rbp)
jmp    120d <indentifyLexema+0xbd>
mov    -0x10(%rbp),%rdi
call   1060 <isspace@plt>
cmp    $0x0,%rax
je     11c8 <indentifyLexema+0x78>
movl   $0x0,-0x4(%rbp)
jmp    120d <indentifyLexema+0xbd>
mov    -0x10(%rbp),%rdi
call   1050 <ispunct@plt>
cmp    $0x0,%rax
je     11e7 <indentifyLexema+0x97>
movl   $0x3,-0x4(%rbp)
jmp    120d <indentifyLexema+0xbd>
mov    -0x10(%rbp),%rdi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
je     1206 <indentifyLexema+0xb6>
movl   $0x5,-0x4(%rbp)
jmp    120d <indentifyLexema+0xbd>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indentifyLexema>:
push   %rbx
mov    %rdi,%rbx
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <strchr@plt>
mov    %rax,%rcx
mov    $0x4,%eax
test   %rcx,%rcx
je     1172 <indentifyLexema+0x22>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1170 <indentifyLexema+0x20>
mov    %rbx,%rdi
call   1060 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1170 <indentifyLexema+0x20>
mov    %rbx,%rdi
call   1050 <ispunct@plt>
mov    %rax,%rcx
mov    $0x3,%eax
test   %rcx,%rcx
jne    1170 <indentifyLexema+0x20>
mov    %rbx,%rdi
call   1070 <isalpha@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,2),%eax
add    $0x2,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"+-*/^%\00"
define i32 @indentifyLexema(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @strchr(i8* %5, i8* %6)
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 4, i32* %2
br label %31
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i64 @isdigit(i8* %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %2
br label %31
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = call i64 @isspace(i8* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 0, i32* %2
br label %31
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = call i64 @ispunct(i8* %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 3, i32* %2
br label %31
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = call i64 @isalpha(i8* %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %25
store i32 5, i32* %2
br label %31
30: ; preds = %25
store i32 2, i32* %2
br label %31
31: ; preds = %30, %29, %24, %19, %14, %9
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
@.str = [7 x i8] c"+-*/^%\00"
define i32 @indentifyLexema(i8* %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = tail call i64 @isdigit(i8* %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = tail call i64 @isspace(i8* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = tail call i64 @ispunct(i8* %0)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = tail call i64 @isalpha(i8* %0)
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i32 2, i32 5
br label %17
17: ; preds = %13, %10, %7, %4, %1
%18 = phi i32 [ 4, %1 ], [ 1, %4 ], [ 0, %7 ], [ 3, %10 ], [ %16, %13 ]
ret i32 %18
}