#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*/ memset(unsigned char *, int, int);
int /*<<< orphan*/ snprintf(unsigned char *, int, char *);
unsigned char return_char(unsigned char c) {
  unsigned char translation_array[65];
  memset(translation_array, 0x00, 65);
  snprintf(translation_array, 65,
           "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
  if (c < 64)
    return translation_array[c];
  else
    return 255;
}


x86 assembly (clang, -O0):
<return_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    $0x41,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x40,%eax
jge    1170 <return_char+0x50>
movzbl -0x2(%rbp),%eax
mov    -0x50(%rbp,%rax,1),%al
mov    %al,-0x1(%rbp)
jmp    1174 <return_char+0x54>
movb   $0xff,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_char>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x41,%edx
call   1040 <memset@plt>
lea    0xebe(%rip),%rdx
mov    %r14,%rdi
mov    $0x41,%esi
call   1030 <snprintf@plt>
mov    $0xff,%al
cmp    $0x3f,%bl
ja     115c <return_char+0x3c>
movzbl %bl,%eax
mov    (%rsp,%rax,1),%al
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define zeroext i8 @return_char(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca [65 x i8]
store i8 %0, i8* %3
%5 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i32 0, i32 65)
%7 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 0
%8 = call i32 @snprintf(i8* %7, i32 65, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = icmp slt i32 %10, 64
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i64
%15 = getelementptr inbounds [65 x i8], [65 x i8]* %4, i64 0, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %2
br label %18
17: ; preds = %1
store i8 -1, i8* %2
br label %18
18: ; preds = %17, %12
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
@.str = [65 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\00"
define zeroext i8 @return_char(i8 zeroext %0) {
%2 = alloca [65 x i8]
%3 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 65)
%5 = call i32 @snprintf(i8* %3, i32 65, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%6 = icmp ult i8 %0, 64
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = zext i8 %0 to i64
%9 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 %8
%10 = load i8, i8* %9
br label %11
11: ; preds = %1, %7
%12 = phi i8 [ %10, %7 ], [ -1, %1 ]
ret i8 %12
}