#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(char *, int, unsigned int);
void from_sixbit(char *bitvec, int start, int count, char *to) {
  static 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    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1198 <from_sixbit+0x88>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
imul   $0x6,-0x1c(%rbp),%eax
add    %eax,%esi
mov    $0x6,%edx
call   1030 <ubits@plt>
mov    %rax,%rcx
lea    0xea1(%rip),%rax
mov    (%rax,%rcx,1),%al
mov    %al,-0x1d(%rbp)
movsbl -0x1d(%rbp),%eax
cmp    $0x40,%eax
jne    1177 <from_sixbit+0x67>
jmp    1198 <from_sixbit+0x88>
mov    -0x1d(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    118a <from_sixbit+0x7a>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <from_sixbit+0x1d>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jl     120a <from_sixbit+0xfa>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     11e1 <from_sixbit+0xd1>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jne    11f2 <from_sixbit+0xe2>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    11f7 <from_sixbit+0xe7>
jmp    120a <from_sixbit+0xfa>
jmp    11fc <from_sixbit+0xec>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ad <from_sixbit+0x9d>
add    $0x20,%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):
@from_sixbit.sixchr = internal constant [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 i32
%10 = alloca i8
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
store i32 0, i32* %9
br label %11
11: ; preds = %36, %4
%12 = load i32, i32* %9
%13 = load i32, i32* %7
%14 = sub nsw i32 %13, 1
%15 = icmp slt i32 %12, %14
br i1 %15, label %16, label %39
16: ; preds = %11
%17 = load i8*, i8** %5
%18 = load i32, i32* %6
%19 = load i32, i32* %9
%20 = mul nsw i32 6, %19
%21 = add nsw i32 %18, %20
%22 = call i64 @ubits(i8* %17, i32 %21, i32 6)
%23 = getelementptr inbounds [64 x i8], [64 x i8]* @from_sixbit.sixchr, i64 0, i64 %22
%24 = load i8, i8* %23
store i8 %24, i8* %10
%25 = load i8, i8* %10
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 64
br i1 %27, label %28, label %29
28: ; preds = %16
br label %39
29: ; preds = %16
%30 = load i8, i8* %10
%31 = load i8*, i8** %8
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8, i8* %31, i64 %33
store i8 %30, i8* %34
br label %35
35: ; preds = %29
br label %36
36: ; preds = %35
%37 = load i32, i32* %9
%38 = add nsw i32 %37, 1
store i32 %38, i32* %9
br label %11
39: ; preds = %28, %11
%40 = load i8*, i8** %8
%41 = load i32, i32* %9
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i8, i8* %40, i64 %42
store i8 0, i8* %43
%44 = load i32, i32* %7
%45 = sub nsw i32 %44, 2
store i32 %45, i32* %9
br label %46
46: ; preds = %72, %39
%47 = load i32, i32* %9
%48 = icmp sge i32 %47, 0
br i1 %48, label %49, label %75
49: ; preds = %46
%50 = load i8*, i8** %8
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %50, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 32
br i1 %56, label %65, label %57
57: ; preds = %49
%58 = load i8*, i8** %8
%59 = load i32, i32* %9
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8, i8* %58, i64 %60
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 64
br i1 %64, label %65, label %70
65: ; preds = %57, %49
%66 = load i8*, i8** %8
%67 = load i32, i32* %9
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
store i8 0, i8* %69
br label %71
70: ; preds = %57
br label %75
71: ; preds = %65
br label %72
72: ; preds = %71
%73 = load i32, i32* %9
%74 = add nsw i32 %73, -1
store i32 %74, i32* %9
br label %46
75: ; preds = %70, %46
ret void
}

LLVM IR (-O2):
@from_sixbit.sixchr = internal unnamed_addr constant [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]* @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
}