#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*/ assert(int /*<<< orphan*/);
char base64_char_to_value(char c) {
  if (c >= 'A' && c <= 'Z')
    return (c - 'A');
  else if (c >= 'a' && c <= 'z')
    return (c - 'a') + 26;
  else if (c >= '0' && c <= '9')
    return (c - '0') + 52;
  else if (c == '+')
    return 62;
  else if (c == '/')
    return 63;
  else
    assert(0);
}


x86 assembly (clang, -O0):
<base64_char_to_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     1147 <base64_char_to_value+0x37>
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     1147 <base64_char_to_value+0x37>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    11e6 <base64_char_to_value+0xd6>
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1173 <base64_char_to_value+0x63>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1173 <base64_char_to_value+0x63>
movsbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0x1a,%eax
mov    %al,-0x1(%rbp)
jmp    11e6 <base64_char_to_value+0xd6>
movsbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     119f <base64_char_to_value+0x8f>
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     119f <base64_char_to_value+0x8f>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
add    $0x34,%eax
mov    %al,-0x1(%rbp)
jmp    11e6 <base64_char_to_value+0xd6>
movsbl -0x2(%rbp),%eax
cmp    $0x2b,%eax
jne    11b5 <base64_char_to_value+0xa5>
movb   $0x3e,-0x1(%rbp)
jmp    11e6 <base64_char_to_value+0xd6>
movsbl -0x2(%rbp),%eax
cmp    $0x2f,%eax
jne    11cb <base64_char_to_value+0xbb>
movb   $0x3f,-0x1(%rbp)
jmp    11e6 <base64_char_to_value+0xd6>
xor    %edi,%edi
call   1030 <assert@plt>
jmp    11d7 <base64_char_to_value+0xc7>
jmp    11dc <base64_char_to_value+0xcc>
jmp    11e1 <base64_char_to_value+0xd1>
jmp    11e6 <base64_char_to_value+0xd6>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_char_to_value>:
lea    -0x41(%rdi),%eax
cmp    $0x1a,%al
jae    1118 <base64_char_to_value+0x8>
ret
lea    -0x61(%rdi),%eax
cmp    $0x19,%al
ja     1126 <base64_char_to_value+0x16>
add    $0xb9,%dil
mov    %edi,%eax
ret
lea    -0x30(%rdi),%eax
cmp    $0x9,%al
ja     1134 <base64_char_to_value+0x24>
add    $0x4,%dil
mov    %edi,%eax
ret
cmp    $0x2b,%dil
je     1143 <base64_char_to_value+0x33>
cmp    $0x2f,%dil
jne    1146 <base64_char_to_value+0x36>
mov    $0x3f,%al
ret
mov    $0x3e,%al
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x8,%rsp
ret

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

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