#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 int uint8_t;
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fflush;
int /*<<< orphan*/ printf(char *, int, int, int);
void bin2Base64PlusSlashEqualsOneLine(uint8_t *in, uint64_t inLen,
                                      uint8_t *out) {
  static uint8_t sixBitsToHex[64] = {
      0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
      0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56,
      0x57, 0x58, 0x59, 0x5a, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
      0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72,
      0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x30, 0x31, 0x32,
      0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x2b, 0x2f};
  static uint8_t padding = 0x3d;
  uint64_t setsOfThree;
  uint64_t charsLeftOver;
  uint8_t outSet[4];
  uint8_t inSet[3];
  uint8_t inUnit;
  setsOfThree = inLen / 3;
  charsLeftOver = inLen % 3;
  printf("inlen %i  sets %i  leftover %i\n", (int)inLen, (int)setsOfThree,
         (int)charsLeftOver);
  fflush;
  for (int i = 0; i < setsOfThree; i++) {
    inSet[0] = in[i * 3];
    inSet[1] = in[i * 3 + 1];
    inSet[2] = in[i * 3 + 2];
    inUnit = inSet[0] >> 2;
    outSet[0] = sixBitsToHex[inUnit];
    inUnit = inSet[0] << 6;
    inUnit = inUnit >> 2;
    inUnit |= inSet[1] >> 4;
    outSet[1] = sixBitsToHex[inUnit];
    inUnit = inSet[1] << 4;
    inUnit = inUnit >> 2;
    inUnit |= (inSet[2] >> 6);
    outSet[2] = sixBitsToHex[inUnit];
    inUnit = inSet[2] << 2;
    inUnit = inUnit >> 2;
    outSet[3] = sixBitsToHex[inUnit];
    out[i * 4] = outSet[0];
    out[i * 4 + 1] = outSet[1];
    out[i * 4 + 2] = outSet[2];
    out[i * 4 + 3] = outSet[3];
  };
  if (charsLeftOver == 2) {
    inSet[0] = in[inLen - 2];
    inSet[1] = in[inLen - 1];
    inUnit = inSet[0] >> 2;
    outSet[0] = sixBitsToHex[inUnit];
    inUnit = inSet[0] << 6;
    inUnit = inUnit >> 2;
    inUnit |= inSet[1] >> 4;
    outSet[1] = sixBitsToHex[inUnit];
    inUnit = inSet[1] << 4;
    inUnit = inUnit >> 2;
    outSet[2] = sixBitsToHex[inUnit];
    outSet[3] = padding;
    out[setsOfThree * 4] = outSet[0];
    out[setsOfThree * 4 + 1] = outSet[1];
    out[setsOfThree * 4 + 2] = outSet[2];
    out[setsOfThree * 4 + 3] = outSet[3];
  };
  if (charsLeftOver == 1) {
    inSet[0] = in[inLen - 1];
    inUnit = inSet[0] >> 2;
    outSet[0] = sixBitsToHex[inUnit];
    inUnit = inSet[0] << 6;
    inUnit = inUnit >> 2;
    outSet[1] = sixBitsToHex[inUnit];
    outSet[2] = padding;
    outSet[3] = padding;
    out[setsOfThree * 4] = outSet[0];
    out[setsOfThree * 4 + 1] = outSet[1];
    out[setsOfThree * 4 + 2] = outSet[2];
    out[setsOfThree * 4 + 3] = outSet[3];
  };
}


x86 assembly (clang, -O0):
<bin2Base64PlusSlashEqualsOneLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    129e <bin2Base64PlusSlashEqualsOneLine+0x18e>
mov    -0x8(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0x44(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x3c(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2e7c(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x3c(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x4,%eax
or     -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2e4d(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
mov    -0x34(%rbp),%eax
sar    $0x6,%eax
or     -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2e1e(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
mov    -0x34(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2dfb(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    115b <bin2Base64PlusSlashEqualsOneLine+0x4b>
cmpl   $0x2,-0x20(%rbp)
jne    1398 <bin2Base64PlusSlashEqualsOneLine+0x288>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2d4e(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x3c(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
mov    -0x38(%rbp),%eax
sar    $0x4,%eax
or     -0x40(%rbp),%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2d1f(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2cfc(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
mov    0x2df0(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
cmpl   $0x1,-0x20(%rbp)
jne    1459 <bin2Base64PlusSlashEqualsOneLine+0x349>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2c67(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x3c(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
sar    $0x2,%eax
mov    %eax,-0x40(%rbp)
movslq -0x40(%rbp),%rcx
lea    0x2c44(%rip),%rax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
mov    0x2d38(%rip),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d2f(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin2Base64PlusSlashEqualsOneLine>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,(%rsp)
movslq %esi,%r12
imul   $0x55555556,%r12,%r15
mov    %r15,%rax
shr    $0x3f,%rax
shr    $0x20,%r15
add    %eax,%r15d
lea    (%r15,%r15,2),%eax
mov    %r12d,%r13d
sub    %eax,%r13d
lea    0xfb5(%rip),%rdi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %r13d,%ecx
call   1030 <printf@plt>
cmp    $0x3,%r12d
jl     11e5 <bin2Base64PlusSlashEqualsOneLine+0xd5>
mov    %r15d,%r9d
mov    (%rsp),%rax
lea    0x8(%rax),%r10
lea    0xc(%r14),%rdx
lea    0xe87(%rip),%r8
nopl   0x0(%rax)
mov    -0x8(%r10),%esi
mov    -0x4(%r10),%eax
mov    (%r10),%ecx
mov    %esi,%edi
sar    $0x2,%edi
movslq %edi,%rdi
mov    (%r8,%rdi,4),%edi
shl    $0x6,%esi
sar    $0x2,%esi
mov    %eax,%ebp
sar    $0x4,%ebp
or     %esi,%ebp
movslq %ebp,%rsi
mov    (%r8,%rsi,4),%esi
shl    $0x4,%eax
sar    $0x2,%eax
mov    %ecx,%ebx
sar    $0x6,%ebx
or     %eax,%ebx
movslq %ebx,%rax
mov    (%r8,%rax,4),%eax
shl    $0x2,%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
mov    (%r8,%rcx,4),%ecx
mov    %edi,-0xc(%rdx)
mov    %esi,-0x8(%rdx)
mov    %eax,-0x4(%rdx)
mov    %ecx,(%rdx)
add    $0xc,%r10
add    $0x10,%rdx
add    $0xffffffffffffffff,%r9
jne    1180 <bin2Base64PlusSlashEqualsOneLine+0x70>
cmp    $0x1,%r13d
je     1227 <bin2Base64PlusSlashEqualsOneLine+0x117>
cmp    $0x2,%r13d
jne    128f <bin2Base64PlusSlashEqualsOneLine+0x17f>
mov    (%rsp),%rcx
mov    -0x8(%rcx,%r12,4),%eax
mov    -0x4(%rcx,%r12,4),%ecx
mov    %eax,%esi
shl    $0x6,%esi
sar    $0x2,%esi
mov    %ecx,%edx
sar    $0x4,%edx
or     %esi,%edx
shl    $0x4,%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
lea    0xdde(%rip),%rsi
mov    (%rsi,%rcx,4),%ecx
jmp    123d <bin2Base64PlusSlashEqualsOneLine+0x12d>
mov    (%rsp),%rax
mov    -0x4(%rax,%r12,4),%eax
mov    %eax,%edx
shl    $0x6,%edx
sar    $0x2,%edx
mov    $0x3d,%ecx
movslq %edx,%rdx
lea    0xdb9(%rip),%rsi
mov    (%rsi,%rdx,4),%edx
sar    $0x2,%eax
cltq
mov    (%rsi,%rax,4),%eax
lea    0x0(,%r15,4),%esi
movslq %esi,%rsi
mov    %eax,(%r14,%rsi,4)
lea    0x1(,%r15,4),%eax
cltq
mov    %edx,(%r14,%rax,4)
lea    0x2(,%r15,4),%eax
cltq
mov    %ecx,(%r14,%rax,4)
lea    0x3(,%r15,4),%eax
cltq
movl   $0x3d,(%r14,%rax,4)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@bin2Base64PlusSlashEqualsOneLine.sixBitsToHex = internal global [64 x i32] [i32 65, i32 66, i32 67, i32 68, i32 69, i32 70, i32 71, i32 72, i32 73, i32 74, i32 75, i32 76, i32 77, i32 78, i32 79, i32 80, i32 81, i32 82, i32 83, i32 84, i32 85, i32 86, i32 87, i32 88, i32 89, i32 90, i32 97, i32 98, i32 99, i32 100, i32 101, i32 102, i32 103, i32 104, i32 105, i32 106, i32 107, i32 108, i32 109, i32 110, i32 111, i32 112, i32 113, i32 114, i32 115, i32 116, i32 117, i32 118, i32 119, i32 120, i32 121, i32 122, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 43, i32 47]
@bin2Base64PlusSlashEqualsOneLine.padding = internal global i32 61
@.str = [32 x i8] c"inlen %i sets %i leftover %i\0A\00"
@fflush = global i32 0
define void @bin2Base64PlusSlashEqualsOneLine(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i32]
%10 = alloca [3 x i32]
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%13 = load i32, i32* %5
%14 = sdiv i32 %13, 3
store i32 %14, i32* %7
%15 = load i32, i32* %5
%16 = srem i32 %15, 3
store i32 %16, i32* %8
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* @fflush
store i32 0, i32* %12
br label %22
22: ; preds = %129, %3
%23 = load i32, i32* %12
%24 = load i32, i32* %7
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %132
26: ; preds = %22
%27 = load i32*, i32** %4
%28 = load i32, i32* %12
%29 = mul nsw i32 %28, 3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %27, i64 %30
%32 = load i32, i32* %31
%33 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %32, i32* %33
%34 = load i32*, i32** %4
%35 = load i32, i32* %12
%36 = mul nsw i32 %35, 3
%37 = add nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %34, i64 %38
%40 = load i32, i32* %39
%41 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %40, i32* %41
%42 = load i32*, i32** %4
%43 = load i32, i32* %12
%44 = mul nsw i32 %43, 3
%45 = add nsw i32 %44, 2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %42, i64 %46
%48 = load i32, i32* %47
%49 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
store i32 %48, i32* %49
%50 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%51 = load i32, i32* %50
%52 = ashr i32 %51, 2
store i32 %52, i32* %11
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32 %56, i32* %57
%58 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%59 = load i32, i32* %58
%60 = shl i32 %59, 6
store i32 %60, i32* %11
%61 = load i32, i32* %11
%62 = ashr i32 %61, 2
store i32 %62, i32* %11
%63 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
%64 = load i32, i32* %63
%65 = ashr i32 %64, 4
%66 = load i32, i32* %11
%67 = or i32 %66, %65
store i32 %67, i32* %11
%68 = load i32, i32* %11
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
store i32 %71, i32* %72
%73 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
%74 = load i32, i32* %73
%75 = shl i32 %74, 4
store i32 %75, i32* %11
%76 = load i32, i32* %11
%77 = ashr i32 %76, 2
store i32 %77, i32* %11
%78 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
%79 = load i32, i32* %78
%80 = ashr i32 %79, 6
%81 = load i32, i32* %11
%82 = or i32 %81, %80
store i32 %82, i32* %11
%83 = load i32, i32* %11
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %84
%86 = load i32, i32* %85
%87 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
store i32 %86, i32* %87
%88 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
%89 = load i32, i32* %88
%90 = shl i32 %89, 2
store i32 %90, i32* %11
%91 = load i32, i32* %11
%92 = ashr i32 %91, 2
store i32 %92, i32* %11
%93 = load i32, i32* %11
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %94
%96 = load i32, i32* %95
%97 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
store i32 %96, i32* %97
%98 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%99 = load i32, i32* %98
%100 = load i32*, i32** %6
%101 = load i32, i32* %12
%102 = mul nsw i32 %101, 4
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds i32, i32* %100, i64 %103
store i32 %99, i32* %104
%105 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%106 = load i32, i32* %105
%107 = load i32*, i32** %6
%108 = load i32, i32* %12
%109 = mul nsw i32 %108, 4
%110 = add nsw i32 %109, 1
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds i32, i32* %107, i64 %111
store i32 %106, i32* %112
%113 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
%114 = load i32, i32* %113
%115 = load i32*, i32** %6
%116 = load i32, i32* %12
%117 = mul nsw i32 %116, 4
%118 = add nsw i32 %117, 2
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds i32, i32* %115, i64 %119
store i32 %114, i32* %120
%121 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%122 = load i32, i32* %121
%123 = load i32*, i32** %6
%124 = load i32, i32* %12
%125 = mul nsw i32 %124, 4
%126 = add nsw i32 %125, 3
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds i32, i32* %123, i64 %127
store i32 %122, i32* %128
br label %129
129: ; preds = %26
%130 = load i32, i32* %12
%131 = add nsw i32 %130, 1
store i32 %131, i32* %12
br label %22
132: ; preds = %22
%133 = load i32, i32* %8
%134 = icmp eq i32 %133, 2
br i1 %134, label %135, label %216
135: ; preds = %132
%136 = load i32*, i32** %4
%137 = load i32, i32* %5
%138 = sub nsw i32 %137, 2
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i32, i32* %136, i64 %139
%141 = load i32, i32* %140
%142 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %141, i32* %142
%143 = load i32*, i32** %4
%144 = load i32, i32* %5
%145 = sub nsw i32 %144, 1
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds i32, i32* %143, i64 %146
%148 = load i32, i32* %147
%149 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %148, i32* %149
%150 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%151 = load i32, i32* %150
%152 = ashr i32 %151, 2
store i32 %152, i32* %11
%153 = load i32, i32* %11
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %154
%156 = load i32, i32* %155
%157 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32 %156, i32* %157
%158 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%159 = load i32, i32* %158
%160 = shl i32 %159, 6
store i32 %160, i32* %11
%161 = load i32, i32* %11
%162 = ashr i32 %161, 2
store i32 %162, i32* %11
%163 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
%164 = load i32, i32* %163
%165 = ashr i32 %164, 4
%166 = load i32, i32* %11
%167 = or i32 %166, %165
store i32 %167, i32* %11
%168 = load i32, i32* %11
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %169
%171 = load i32, i32* %170
%172 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
store i32 %171, i32* %172
%173 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
%174 = load i32, i32* %173
%175 = shl i32 %174, 4
store i32 %175, i32* %11
%176 = load i32, i32* %11
%177 = ashr i32 %176, 2
store i32 %177, i32* %11
%178 = load i32, i32* %11
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %179
%181 = load i32, i32* %180
%182 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
store i32 %181, i32* %182
%183 = load i32, i32* @bin2Base64PlusSlashEqualsOneLine.padding
%184 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
store i32 %183, i32* %184
%185 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%186 = load i32, i32* %185
%187 = load i32*, i32** %6
%188 = load i32, i32* %7
%189 = mul nsw i32 %188, 4
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i32, i32* %187, i64 %190
store i32 %186, i32* %191
%192 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%193 = load i32, i32* %192
%194 = load i32*, i32** %6
%195 = load i32, i32* %7
%196 = mul nsw i32 %195, 4
%197 = add nsw i32 %196, 1
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds i32, i32* %194, i64 %198
store i32 %193, i32* %199
%200 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
%201 = load i32, i32* %200
%202 = load i32*, i32** %6
%203 = load i32, i32* %7
%204 = mul nsw i32 %203, 4
%205 = add nsw i32 %204, 2
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds i32, i32* %202, i64 %206
store i32 %201, i32* %207
%208 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%209 = load i32, i32* %208
%210 = load i32*, i32** %6
%211 = load i32, i32* %7
%212 = mul nsw i32 %211, 4
%213 = add nsw i32 %212, 3
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds i32, i32* %210, i64 %214
store i32 %209, i32* %215
br label %216
216: ; preds = %135, %132
%217 = load i32, i32* %8
%218 = icmp eq i32 %217, 1
br i1 %218, label %219, label %280
219: ; preds = %216
%220 = load i32*, i32** %4
%221 = load i32, i32* %5
%222 = sub nsw i32 %221, 1
%223 = sext i32 %222 to i64
%224 = getelementptr inbounds i32, i32* %220, i64 %223
%225 = load i32, i32* %224
%226 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %225, i32* %226
%227 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%228 = load i32, i32* %227
%229 = ashr i32 %228, 2
store i32 %229, i32* %11
%230 = load i32, i32* %11
%231 = sext i32 %230 to i64
%232 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %231
%233 = load i32, i32* %232
%234 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32 %233, i32* %234
%235 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%236 = load i32, i32* %235
%237 = shl i32 %236, 6
store i32 %237, i32* %11
%238 = load i32, i32* %11
%239 = ashr i32 %238, 2
store i32 %239, i32* %11
%240 = load i32, i32* %11
%241 = sext i32 %240 to i64
%242 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %241
%243 = load i32, i32* %242
%244 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
store i32 %243, i32* %244
%245 = load i32, i32* @bin2Base64PlusSlashEqualsOneLine.padding
%246 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
store i32 %245, i32* %246
%247 = load i32, i32* @bin2Base64PlusSlashEqualsOneLine.padding
%248 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
store i32 %247, i32* %248
%249 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%250 = load i32, i32* %249
%251 = load i32*, i32** %6
%252 = load i32, i32* %7
%253 = mul nsw i32 %252, 4
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds i32, i32* %251, i64 %254
store i32 %250, i32* %255
%256 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%257 = load i32, i32* %256
%258 = load i32*, i32** %6
%259 = load i32, i32* %7
%260 = mul nsw i32 %259, 4
%261 = add nsw i32 %260, 1
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds i32, i32* %258, i64 %262
store i32 %257, i32* %263
%264 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
%265 = load i32, i32* %264
%266 = load i32*, i32** %6
%267 = load i32, i32* %7
%268 = mul nsw i32 %267, 4
%269 = add nsw i32 %268, 2
%270 = sext i32 %269 to i64
%271 = getelementptr inbounds i32, i32* %266, i64 %270
store i32 %265, i32* %271
%272 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
%273 = load i32, i32* %272
%274 = load i32*, i32** %6
%275 = load i32, i32* %7
%276 = mul nsw i32 %275, 4
%277 = add nsw i32 %276, 3
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds i32, i32* %274, i64 %278
store i32 %273, i32* %279
br label %280
280: ; preds = %219, %216
ret void
}

LLVM IR (-O2):
@bin2Base64PlusSlashEqualsOneLine.sixBitsToHex = internal unnamed_addr constant [64 x i32] [i32 65, i32 66, i32 67, i32 68, i32 69, i32 70, i32 71, i32 72, i32 73, i32 74, i32 75, i32 76, i32 77, i32 78, i32 79, i32 80, i32 81, i32 82, i32 83, i32 84, i32 85, i32 86, i32 87, i32 88, i32 89, i32 90, i32 97, i32 98, i32 99, i32 100, i32 101, i32 102, i32 103, i32 104, i32 105, i32 106, i32 107, i32 108, i32 109, i32 110, i32 111, i32 112, i32 113, i32 114, i32 115, i32 116, i32 117, i32 118, i32 119, i32 120, i32 121, i32 122, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54, i32 55, i32 56, i32 57, i32 43, i32 47]
@.str = [32 x i8] c"inlen %i sets %i leftover %i\0A\00"
@fflush = global i32 0
define void @bin2Base64PlusSlashEqualsOneLine(i32* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sdiv i32 %1, 3
%5 = srem i32 %1, 3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %4, i32 %5)
%7 = icmp sgt i32 %1, 2
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = zext i32 %4 to i64
br label %11
10: ; preds = %11, %3
switch i32 %5, label %103 [
i32 2, label %55
i32 1, label %73
]
11: ; preds = %8, %11
%12 = phi i64 [ 0, %8 ], [ %53, %11 ]
%13 = mul nuw nsw i64 %12, 3
%14 = getelementptr inbounds i32, i32* %0, i64 %13
%15 = load i32, i32* %14
%16 = add nuw nsw i64 %13, 1
%17 = getelementptr inbounds i32, i32* %0, i64 %16
%18 = load i32, i32* %17
%19 = add nuw nsw i64 %13, 2
%20 = getelementptr inbounds i32, i32* %0, i64 %19
%21 = load i32, i32* %20
%22 = ashr i32 %15, 2
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = shl i32 %15, 6
%27 = ashr exact i32 %26, 2
%28 = ashr i32 %18, 4
%29 = or i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = shl i32 %18, 4
%34 = ashr exact i32 %33, 2
%35 = ashr i32 %21, 6
%36 = or i32 %34, %35
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %37
%39 = load i32, i32* %38
%40 = shl i32 %21, 2
%41 = ashr exact i32 %40, 2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %42
%44 = load i32, i32* %43
%45 = shl nsw i64 %12, 2
%46 = getelementptr inbounds i32, i32* %2, i64 %45
store i32 %25, i32* %46
%47 = or i64 %45, 1
%48 = getelementptr inbounds i32, i32* %2, i64 %47
store i32 %32, i32* %48
%49 = or i64 %45, 2
%50 = getelementptr inbounds i32, i32* %2, i64 %49
store i32 %39, i32* %50
%51 = or i64 %45, 3
%52 = getelementptr inbounds i32, i32* %2, i64 %51
store i32 %44, i32* %52
%53 = add nuw nsw i64 %12, 1
%54 = icmp eq i64 %53, %9
br i1 %54, label %10, label %11
55: ; preds = %10
%56 = add nsw i32 %1, -2
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32, i32* %0, i64 %57
%59 = load i32, i32* %58
%60 = add nsw i32 %1, -1
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i32, i32* %0, i64 %61
%63 = load i32, i32* %62
%64 = shl i32 %59, 6
%65 = ashr exact i32 %64, 2
%66 = ashr i32 %63, 4
%67 = or i32 %65, %66
%68 = shl i32 %63, 4
%69 = ashr exact i32 %68, 2
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %70
%72 = load i32, i32* %71
br label %80
73: ; preds = %10
%74 = add nsw i32 %1, -1
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i32, i32* %0, i64 %75
%77 = load i32, i32* %76
%78 = shl i32 %77, 6
%79 = ashr exact i32 %78, 2
br label %80
80: ; preds = %73, %55
%81 = phi i32 [ %59, %55 ], [ %77, %73 ]
%82 = phi i32 [ %67, %55 ], [ %79, %73 ]
%83 = phi i32 [ %72, %55 ], [ 61, %73 ]
%84 = sext i32 %82 to i64
%85 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %84
%86 = load i32, i32* %85
%87 = ashr i32 %81, 2
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [64 x i32], [64 x i32]* @bin2Base64PlusSlashEqualsOneLine.sixBitsToHex, i64 0, i64 %88
%90 = load i32, i32* %89
%91 = shl nsw i32 %4, 2
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i32, i32* %2, i64 %92
store i32 %90, i32* %93
%94 = or i32 %91, 1
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i32, i32* %2, i64 %95
store i32 %86, i32* %96
%97 = or i32 %91, 2
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i32, i32* %2, i64 %98
store i32 %83, i32* %99
%100 = or i32 %91, 3
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %2, i64 %101
store i32 61, i32* %102
br label %103
103: ; preds = %80, %10
ret void
}