#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 */
size_t ubits(unsigned char *, unsigned int, unsigned int);
void from_sixbit(unsigned char *bitvec, unsigned int start, int count,
                 char *to) {
  const char sixchr[64] =
      "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^- !\"#$%&'()*+,-./0123456789:;<=>?";
  int i;
  char newchar;
  for (i = 0; i < count - 1; i++) {
    newchar = sixchr[ubits(bitvec, start + 6 * i, 6U)];
    if (newchar == '@')
      break;
    else
      to[i] = newchar;
  }
  to[i] = '\0';
  for (i = count - 2; i >= 0; i--)
    if (to[i] == ' ' || to[i] == '@')
      to[i] = '\0';
    else
      break;
}


x86 assembly (clang, -O0):
<from_sixbit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x40,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11b4 <from_sixbit+0x94>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
imul   $0x6,-0x64(%rbp),%eax
add    %eax,%esi
mov    $0x6,%edx
call   1030 <ubits@plt>
mov    -0x60(%rbp,%rax,1),%al
mov    %al,-0x65(%rbp)
movsbl -0x65(%rbp),%eax
cmp    $0x40,%eax
jne    1193 <from_sixbit+0x73>
jmp    11b4 <from_sixbit+0x94>
mov    -0x65(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    11a6 <from_sixbit+0x86>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1152 <from_sixbit+0x32>
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jl     1226 <from_sixbit+0x106>
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     11fd <from_sixbit+0xdd>
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jne    120e <from_sixbit+0xee>
mov    -0x18(%rbp),%rax
movslq -0x64(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1213 <from_sixbit+0xf3>
jmp    1226 <from_sixbit+0x106>
jmp    1218 <from_sixbit+0xf8>
mov    -0x64(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x64(%rbp)
jmp    11c9 <from_sixbit+0xa9>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_sixbit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
cmp    $0x1,%edx
jle    1175 <from_sixbit+0x65>
mov    %edx,%r13d
mov    %esi,%ebp
mov    %rdi,%r15
lea    -0x1(%r13),%eax
mov    %eax,0x4(%rsp)
mov    %eax,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %ebp,%esi
mov    $0x6,%edx
call   1030 <ubits@plt>
test   %rax,%rax
je     117b <from_sixbit+0x6b>
lea    0xea5(%rip),%rcx
movzbl (%rax,%rcx,1),%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
add    $0x6,%ebp
cmp    %rbx,%r12
jne    1140 <from_sixbit+0x30>
mov    0x4(%rsp),%eax
jmp    117d <from_sixbit+0x6d>
movb   $0x0,(%r14)
jmp    11ba <from_sixbit+0xaa>
mov    %ebx,%eax
mov    %eax,%eax
movb   $0x0,(%r14,%rax,1)
cmp    $0x2,%r13d
jl     11ba <from_sixbit+0xaa>
add    $0xfffffffe,%r13d
add    $0x1,%r13
jmp    11ac <from_sixbit+0x9c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,-0x1(%r14,%r13,1)
add    $0xffffffffffffffff,%r13
jle    11ba <from_sixbit+0xaa>
movzbl -0x1(%r14,%r13,1),%eax
cmp    $0x40,%al
je     11a0 <from_sixbit+0x90>
cmp    $0x20,%al
je     11a0 <from_sixbit+0x90>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.from_sixbit.sixchr = [64 x i8] c"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^- !\22#$%&'()*+,-./0123456789:;<=>?"
define void @from_sixbit(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [64 x i8]
%10 = alloca i32
%11 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%12 = bitcast [64 x i8]* %9 to i8*
store i32 0, i32* %10
br label %13
13: ; preds = %38, %4
%14 = load i32, i32* %10
%15 = load i32, i32* %7
%16 = sub nsw i32 %15, 1
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %41
18: ; preds = %13
%19 = load i8*, i8** %5
%20 = load i32, i32* %6
%21 = load i32, i32* %10
%22 = mul nsw i32 6, %21
%23 = add i32 %20, %22
%24 = call i64 @ubits(i8* %19, i32 %23, i32 6)
%25 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 %24
%26 = load i8, i8* %25
store i8 %26, i8* %11
%27 = load i8, i8* %11
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 64
br i1 %29, label %30, label %31
30: ; preds = %18
br label %41
31: ; preds = %18
%32 = load i8, i8* %11
%33 = load i8*, i8** %8
%34 = load i32, i32* %10
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %33, i64 %35
store i8 %32, i8* %36
br label %37
37: ; preds = %31
br label %38
38: ; preds = %37
%39 = load i32, i32* %10
%40 = add nsw i32 %39, 1
store i32 %40, i32* %10
br label %13
41: ; preds = %30, %13
%42 = load i8*, i8** %8
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
store i8 0, i8* %45
%46 = load i32, i32* %7
%47 = sub nsw i32 %46, 2
store i32 %47, i32* %10
br label %48
48: ; preds = %74, %41
%49 = load i32, i32* %10
%50 = icmp sge i32 %49, 0
br i1 %50, label %51, label %77
51: ; preds = %48
%52 = load i8*, i8** %8
%53 = load i32, i32* %10
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i8, i8* %52, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 32
br i1 %58, label %67, label %59
59: ; preds = %51
%60 = load i8*, i8** %8
%61 = load i32, i32* %10
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 64
br i1 %66, label %67, label %72
67: ; preds = %59, %51
%68 = load i8*, i8** %8
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
store i8 0, i8* %71
br label %73
72: ; preds = %59
br label %77
73: ; preds = %67
br label %74
74: ; preds = %73
%75 = load i32, i32* %10
%76 = add nsw i32 %75, -1
store i32 %76, i32* %10
br label %48
77: ; preds = %72, %48
ret void
}

LLVM IR (-O2):
@__const.from_sixbit.sixchr = [64 x i8] c"@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^- !\22#$%&'()*+,-./0123456789:;<=>?"
define void @from_sixbit(i8* %0, i32 %1, i32 %2, i8* nocapture %3) {
%5 = add i32 %2, -1
%6 = icmp sgt i32 %2, 1
br i1 %6, label %8, label %7
7: ; preds = %4
store i8 0, i8* %3
br label %39
8: ; preds = %4
%9 = zext i32 %5 to i64
br label %10
10: ; preds = %8, %17
%11 = phi i64 [ 0, %8 ], [ %21, %17 ]
%12 = trunc i64 %11 to i32
%13 = mul i32 %12, 6
%14 = add i32 %13, %1
%15 = tail call i64 @ubits(i8* %0, i32 %14, i32 6)
%16 = icmp eq i64 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %10
%18 = getelementptr inbounds [64 x i8], [64 x i8]* @__const.from_sixbit.sixchr, i64 0, i64 %15
%19 = load i8, i8* %18
%20 = getelementptr inbounds i8, i8* %3, i64 %11
store i8 %19, i8* %20
%21 = add nuw nsw i64 %11, 1
%22 = icmp eq i64 %21, %9
br i1 %22, label %25, label %10
23: ; preds = %10
%24 = trunc i64 %11 to i32
br label %25
25: ; preds = %17, %23
%26 = phi i32 [ %24, %23 ], [ %5, %17 ]
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %3, i64 %27
store i8 0, i8* %28
br i1 %6, label %29, label %39
29: ; preds = %25
%30 = add nsw i32 %2, -2
%31 = zext i32 %30 to i64
br label %32
32: ; preds = %29, %36
%33 = phi i64 [ %31, %29 ], [ %37, %36 ]
%34 = getelementptr inbounds i8, i8* %3, i64 %33
%35 = load i8, i8* %34
switch i8 %35, label %39 [
i8 32, label %36
i8 64, label %36
]
36: ; preds = %32, %32
store i8 0, i8* %34
%37 = add nsw i64 %33, -1
%38 = icmp sgt i64 %33, 0
br i1 %38, label %32, label %39
39: ; preds = %36, %32, %7, %25
ret void
}