#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__ esFuncion(char);
unsigned int evaluar_prioridad(char c) {
  unsigned int prioridad;
  if (esFuncion(c))
    prioridad = 4;
  else
    switch (c) {
    case '(':
      prioridad = 1;
      break;
    case ')':
      prioridad = 0;
      break;
    case '+':
    case '-':
      prioridad = 2;
      break;
    case '*':
    case '/':
      prioridad = 3;
      break;
    case '^':
      prioridad = 5;
      break;
    default:
      prioridad = 6;
    }
  return (prioridad);
}


x86 assembly (clang, -O0):
<evaluar_prioridad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <esFuncion@plt>
cmp    $0x0,%rax
je     113d <evaluar_prioridad+0x2d>
movl   $0x4,-0x8(%rbp)
jmp    11af <evaluar_prioridad+0x9f>
movsbl -0x1(%rbp),%eax
add    $0xffffffd8,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x36,%eax
ja     11a3 <evaluar_prioridad+0x93>
mov    -0x10(%rbp),%rax
lea    0xea2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x8(%rbp)
jmp    11aa <evaluar_prioridad+0x9a>
movl   $0x0,-0x8(%rbp)
jmp    11aa <evaluar_prioridad+0x9a>
movl   $0x2,-0x8(%rbp)
jmp    11aa <evaluar_prioridad+0x9a>
movl   $0x3,-0x8(%rbp)
jmp    11aa <evaluar_prioridad+0x9a>
movl   $0x5,-0x8(%rbp)
jmp    11aa <evaluar_prioridad+0x9a>
movl   $0x6,-0x8(%rbp)
jmp    11af <evaluar_prioridad+0x9f>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluar_prioridad>:
push   %rbx
mov    %edi,%ebx
call   1030 <esFuncion@plt>
mov    %rax,%rcx
mov    $0x4,%eax
test   %rcx,%rcx
je     1127 <evaluar_prioridad+0x17>
pop    %rbx
ret
movsbl %bl,%ecx
add    $0xffffffd8,%ecx
cmp    $0x36,%ecx
ja     1159 <evaluar_prioridad+0x49>
mov    $0x1,%eax
lea    0xec2(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x3,%eax
pop    %rbx
ret
mov    $0x2,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    $0x6,%eax
pop    %rbx
ret
mov    $0x5,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @evaluar_prioridad(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = call i64 @esFuncion(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 4, i32* %3
br label %18
8: ; preds = %1
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
switch i32 %10, label %16 [
i32 40, label %11
i32 41, label %12
i32 43, label %13
i32 45, label %13
i32 42, label %14
i32 47, label %14
i32 94, label %15
]
11: ; preds = %8
store i32 1, i32* %3
br label %17
12: ; preds = %8
store i32 0, i32* %3
br label %17
13: ; preds = %8, %8
store i32 2, i32* %3
br label %17
14: ; preds = %8, %8
store i32 3, i32* %3
br label %17
15: ; preds = %8
store i32 5, i32* %3
br label %17
16: ; preds = %8
store i32 6, i32* %3
br label %17
17: ; preds = %16, %15, %14, %13, %12, %11
br label %18
18: ; preds = %17, %7
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @evaluar_prioridad(i8 signext %0) {
%2 = tail call i64 @esFuncion(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = sext i8 %0 to i32
switch i32 %5, label %10 [
i32 40, label %11
i32 41, label %6
i32 43, label %7
i32 45, label %7
i32 42, label %8
i32 47, label %8
i32 94, label %9
]
6: ; preds = %4
br label %11
7: ; preds = %4, %4
br label %11
8: ; preds = %4, %4
br label %11
9: ; preds = %4
br label %11
10: ; preds = %4
br label %11
11: ; preds = %4, %1, %6, %7, %8, %9, %10
%12 = phi i32 [ 6, %10 ], [ 5, %9 ], [ 3, %8 ], [ 2, %7 ], [ 0, %6 ], [ 4, %1 ], [ 1, %4 ]
ret i32 %12
}