#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 */
typedef char uint8_t;

/* Variables and functions */
char Base64_ObterCaractereDecodificado(uint8_t codigo) {
  if (codigo >= '0' && codigo <= '9') {
    return codigo + 4;
  }
  if (codigo <= 'Z' && codigo >= 'A') {
    return codigo - 'A';
  }
  if (codigo <= 'z' && codigo >= 'a') {
    return codigo - 71;
  }
  if (codigo == '+') {
    return 62;
  }
  if (codigo == '/') {
    return 63;
  }
  if (codigo == '=') {
    return 64;
  } else {
    return '?';
  }
}


x86 assembly (clang, -O0):
<Base64_ObterCaractereDecodificado>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <Base64_ObterCaractereDecodificado+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <Base64_ObterCaractereDecodificado+0x33>
movsbl -0x2(%rbp),%eax
add    $0x4,%eax
mov    %al,-0x1(%rbp)
jmp    11cb <Base64_ObterCaractereDecodificado+0xcb>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     115c <Base64_ObterCaractereDecodificado+0x5c>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     115c <Base64_ObterCaractereDecodificado+0x5c>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    11cb <Base64_ObterCaractereDecodificado+0xcb>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1185 <Base64_ObterCaractereDecodificado+0x85>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1185 <Base64_ObterCaractereDecodificado+0x85>
movsbl -0x2(%rbp),%eax
sub    $0x47,%eax
mov    %al,-0x1(%rbp)
jmp    11cb <Base64_ObterCaractereDecodificado+0xcb>
movsbl -0x2(%rbp),%eax
cmp    $0x2b,%eax
jne    119b <Base64_ObterCaractereDecodificado+0x9b>
movb   $0x3e,-0x1(%rbp)
jmp    11cb <Base64_ObterCaractereDecodificado+0xcb>
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
jne    11b1 <Base64_ObterCaractereDecodificado+0xb1>
movb   $0x3f,-0x1(%rbp)
jmp    11cb <Base64_ObterCaractereDecodificado+0xcb>
movsbl -0x2(%rbp),%eax
cmp    $0x3d,%eax
jne    11c7 <Base64_ObterCaractereDecodificado+0xc7>
movb   $0x40,-0x1(%rbp)
jmp    11cb <Base64_ObterCaractereDecodificado+0xcb>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Base64_ObterCaractereDecodificado>:
lea    -0x30(%rdi),%eax
cmp    $0x9,%al
ja     110e <Base64_ObterCaractereDecodificado+0xe>
add    $0x4,%dil
mov    %edi,%eax
ret
lea    -0x41(%rdi),%eax
cmp    $0x1a,%al
jae    1116 <Base64_ObterCaractereDecodificado+0x16>
ret
lea    -0x61(%rdi),%eax
cmp    $0x19,%al
ja     1124 <Base64_ObterCaractereDecodificado+0x24>
add    $0xb9,%dil
mov    %edi,%eax
ret
cmp    $0x2b,%dil
je     1137 <Base64_ObterCaractereDecodificado+0x37>
cmp    $0x3d,%dil
je     113a <Base64_ObterCaractereDecodificado+0x3a>
cmp    $0x2f,%dil
mov    $0x3f,%al
ret
mov    $0x3e,%al
ret
mov    $0x40,%al
ret

LLVM IR (-O0):
define signext i8 @Base64_ObterCaractereDecodificado(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 4
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %58
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %29
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sge i32 %22, 65
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 65
%28 = trunc i32 %27 to i8
store i8 %28, i8* %2
br label %58
29: ; preds = %20, %16
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = icmp sle i32 %31, 122
br i1 %32, label %33, label %42
33: ; preds = %29
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp sge i32 %35, 97
br i1 %36, label %37, label %42
37: ; preds = %33
%38 = load i8, i8* %3
%39 = sext i8 %38 to i32
%40 = sub nsw i32 %39, 71
%41 = trunc i32 %40 to i8
store i8 %41, i8* %2
br label %58
42: ; preds = %33, %29
%43 = load i8, i8* %3
%44 = sext i8 %43 to i32
%45 = icmp eq i32 %44, 43
br i1 %45, label %46, label %47
46: ; preds = %42
store i8 62, i8* %2
br label %58
47: ; preds = %42
%48 = load i8, i8* %3
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 47
br i1 %50, label %51, label %52
51: ; preds = %47
store i8 63, i8* %2
br label %58
52: ; preds = %47
%53 = load i8, i8* %3
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 61
br i1 %55, label %56, label %57
56: ; preds = %52
store i8 64, i8* %2
br label %58
57: ; preds = %52
store i8 63, i8* %2
br label %58
58: ; preds = %57, %56, %51, %46, %37, %24, %11
%59 = load i8, i8* %2
ret i8 %59
}

LLVM IR (-O2):
define signext i8 @Base64_ObterCaractereDecodificado(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = add nuw nsw i8 %0, 4
br label %18
6: ; preds = %1
%7 = add i8 %0, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = add i8 %0, -97
%11 = icmp ult i8 %10, 26
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = add nsw i8 %0, -71
br label %18
14: ; preds = %9
switch i8 %0, label %17 [
i8 43, label %18
i8 47, label %15
i8 61, label %16
]
15: ; preds = %14
br label %18
16: ; preds = %14
br label %18
17: ; preds = %14
br label %18
18: ; preds = %6, %14, %17, %16, %15, %12, %4
%19 = phi i8 [ %5, %4 ], [ %13, %12 ], [ 63, %15 ], [ 64, %16 ], [ 63, %17 ], [ 62, %14 ], [ %7, %6 ]
ret i8 %19
}