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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ isupper(char const);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t _BRBCashAddrEncode(char *addr55, const char *hrp, const uint8_t data[],
                          size_t dataLen) {
  static const char chars[] = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
  char addr[55];
  uint64_t x, chk = 1;
  uint8_t a, b = 0, c = 0;
  size_t i, j;
  assert(addr55 != NULL);
  assert(hrp != NULL);
  assert(data != NULL);
  assert(dataLen == 21);
  for (i = 0; hrp && hrp[i]; i++) {
    if (i > 12 || hrp[i] < 33 || hrp[i] > 126 || isupper(hrp[i]))
      return 0;
    chk = ((((chk)&0x07ffffffff) << 5) ^ (-(((chk) >> 35) & 1) & 0x98f2bc8e61) ^
           (-(((chk) >> 36) & 1) & 0x79b76d99e2) ^
           (-(((chk) >> 37) & 1) & 0xf33e5fb3c4) ^
           (-(((chk) >> 38) & 1) & 0xae2eabe2a8) ^
           (-(((chk) >> 39) & 1) & 0x1e4f43e470)) ^
          (hrp[i] & 0x1f);
    addr[i] = hrp[i];
  }
  chk = ((((chk)&0x07ffffffff) << 5) ^ (-(((chk) >> 35) & 1) & 0x98f2bc8e61) ^
         (-(((chk) >> 36) & 1) & 0x79b76d99e2) ^
         (-(((chk) >> 37) & 1) & 0xf33e5fb3c4) ^
         (-(((chk) >> 38) & 1) & 0xae2eabe2a8) ^
         (-(((chk) >> 39) & 1) & 0x1e4f43e470));
  addr[i++] = ':';
  if (i < 1 || data == NULL || dataLen != 21)
    return 0;
  for (j = 0; j <= dataLen; j++) {
    a = b, b = (j < dataLen) ? data[j] : 0;
    x = (j % 5) * 8 - ((j % 5) * 8 / 5) * 5;
    c = ((a << (5 - x)) | (b >> (3 + x))) & 0x1f;
    if (j < dataLen || j % 5 > 0)
      chk =
          ((((chk)&0x07ffffffff) << 5) ^ (-(((chk) >> 35) & 1) & 0x98f2bc8e61) ^
           (-(((chk) >> 36) & 1) & 0x79b76d99e2) ^
           (-(((chk) >> 37) & 1) & 0xf33e5fb3c4) ^
           (-(((chk) >> 38) & 1) & 0xae2eabe2a8) ^
           (-(((chk) >> 39) & 1) & 0x1e4f43e470)) ^
          c,
      addr[i++] = chars[c];
    if (x >= 2)
      c = (b >> (x - 2)) & 0x1f;
    if (x >= 2 && j < dataLen)
      chk =
          ((((chk)&0x07ffffffff) << 5) ^ (-(((chk) >> 35) & 1) & 0x98f2bc8e61) ^
           (-(((chk) >> 36) & 1) & 0x79b76d99e2) ^
           (-(((chk) >> 37) & 1) & 0xf33e5fb3c4) ^
           (-(((chk) >> 38) & 1) & 0xae2eabe2a8) ^
           (-(((chk) >> 39) & 1) & 0x1e4f43e470)) ^
          c,
      addr[i++] = chars[c];
  }
  for (j = 0; j < 8; j++)
    chk = ((((chk)&0x07ffffffff) << 5) ^ (-(((chk) >> 35) & 1) & 0x98f2bc8e61) ^
           (-(((chk) >> 36) & 1) & 0x79b76d99e2) ^
           (-(((chk) >> 37) & 1) & 0xf33e5fb3c4) ^
           (-(((chk) >> 38) & 1) & 0xae2eabe2a8) ^
           (-(((chk) >> 39) & 1) & 0x1e4f43e470));
  chk ^= 1;
  for (j = 0; j < 8; ++j)
    addr[i++] = chars[(chk >> ((7 - j) * 5)) & 0x1f];
  addr[i++] = '\0';
  memcpy(addr55, addr, i);
  return i;
}


x86 assembly (clang, -O0):
<_BRBCashAddrEncode>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movl   $0x1,-0x68(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x15,-0x28(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movq   $0x0,-0x80(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x89(%rbp)
je     11db <_BRBCashAddrEncode+0xab>
mov    -0x18(%rbp),%rax
mov    -0x80(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x89(%rbp)
mov    -0x89(%rbp),%al
test   $0x1,%al
jne    11ee <_BRBCashAddrEncode+0xbe>
jmp    1350 <_BRBCashAddrEncode+0x220>
cmpq   $0xc,-0x80(%rbp)
ja     123e <_BRBCashAddrEncode+0x10e>
mov    -0x18(%rbp),%rax
mov    -0x80(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x21,%eax
jl     123e <_BRBCashAddrEncode+0x10e>
mov    -0x18(%rbp),%rax
mov    -0x80(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7e,%eax
jg     123e <_BRBCashAddrEncode+0x10e>
mov    -0x18(%rbp),%rax
mov    -0x80(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <isupper@plt>
cmp    $0x0,%rax
je     124b <_BRBCashAddrEncode+0x11b>
movq   $0x0,-0x8(%rbp)
jmp    1934 <_BRBCashAddrEncode+0x804>
movslq -0x68(%rbp),%rax
movabs $0x7ffffffff,%rcx
and    %rcx,%rax
shl    $0x5,%rax
mov    -0x68(%rbp),%edx
mov    $0x23,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x98f2bc8e61,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x24,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x79b76d99e2,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x25,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xf33e5fb3c4,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x26,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xae2eabe2a8,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x27,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x1e4f43e470,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x18(%rbp),%rcx
mov    -0x80(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
and    $0x1f,%ecx
movslq %ecx,%rcx
xor    %rcx,%rax
mov    %eax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x80(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x80(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x80(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80(%rbp)
jmp    11b0 <_BRBCashAddrEncode+0x80>
movslq -0x68(%rbp),%rax
movabs $0x7ffffffff,%rcx
and    %rcx,%rax
shl    $0x5,%rax
mov    -0x68(%rbp),%edx
mov    $0x23,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x98f2bc8e61,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x24,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x79b76d99e2,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x25,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xf33e5fb3c4,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x26,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xae2eabe2a8,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x27,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x1e4f43e470,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    %eax,-0x68(%rbp)
mov    -0x80(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x80(%rbp)
movb   $0x3a,-0x60(%rbp,%rax,1)
cmpq   $0x1,-0x80(%rbp)
jb     1451 <_BRBCashAddrEncode+0x321>
cmpq   $0x0,-0x20(%rbp)
je     1451 <_BRBCashAddrEncode+0x321>
cmpq   $0x15,-0x28(%rbp)
je     145e <_BRBCashAddrEncode+0x32e>
movq   $0x0,-0x8(%rbp)
jmp    1934 <_BRBCashAddrEncode+0x804>
movq   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%rax
cmp    -0x28(%rbp),%rax
ja     179a <_BRBCashAddrEncode+0x66a>
mov    -0x70(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x88(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    14aa <_BRBCashAddrEncode+0x37a>
mov    -0x20(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x90(%rbp)
jmp    14b7 <_BRBCashAddrEncode+0x387>
xor    %eax,%eax
mov    %eax,-0x90(%rbp)
jmp    14b7 <_BRBCashAddrEncode+0x387>
mov    -0x90(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x88(%rbp),%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x3,%rdx
mov    %rdx,-0x98(%rbp)
mov    -0x88(%rbp),%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
shl    $0x3,%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x98(%rbp),%rax
imul   $0x5,%rcx,%rcx
sub    %rcx,%rax
mov    %eax,-0x64(%rbp)
mov    -0x6c(%rbp),%eax
mov    $0x5,%ecx
sub    -0x64(%rbp),%ecx
shl    %cl,%eax
mov    -0x70(%rbp),%edx
mov    -0x64(%rbp),%ecx
add    $0x3,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
and    $0x1f,%eax
mov    %eax,-0x74(%rbp)
mov    -0x88(%rbp),%rax
cmp    -0x28(%rbp),%rax
jb     1560 <_BRBCashAddrEncode+0x430>
mov    -0x88(%rbp),%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jbe    1654 <_BRBCashAddrEncode+0x524>
movslq -0x68(%rbp),%rax
movabs $0x7ffffffff,%rcx
and    %rcx,%rax
shl    $0x5,%rax
mov    -0x68(%rbp),%edx
mov    $0x23,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x98f2bc8e61,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x24,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x79b76d99e2,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x25,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xf33e5fb3c4,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x26,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xae2eabe2a8,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x27,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x1e4f43e470,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
movslq -0x74(%rbp),%rcx
xor    %rcx,%rax
mov    %eax,-0x68(%rbp)
movslq -0x74(%rbp),%rcx
lea    0x9c2(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x80(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x80(%rbp)
mov    %cl,-0x60(%rbp,%rax,1)
cmpl   $0x2,-0x64(%rbp)
jl     166f <_BRBCashAddrEncode+0x53f>
mov    -0x70(%rbp),%eax
mov    -0x64(%rbp),%ecx
sub    $0x2,%ecx
sar    %cl,%eax
and    $0x1f,%eax
mov    %eax,-0x74(%rbp)
cmpl   $0x2,-0x64(%rbp)
jl     177e <_BRBCashAddrEncode+0x64e>
mov    -0x88(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    177e <_BRBCashAddrEncode+0x64e>
movslq -0x68(%rbp),%rax
movabs $0x7ffffffff,%rcx
and    %rcx,%rax
shl    $0x5,%rax
mov    -0x68(%rbp),%edx
mov    $0x23,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x98f2bc8e61,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x24,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x79b76d99e2,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x25,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xf33e5fb3c4,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x26,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xae2eabe2a8,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x27,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x1e4f43e470,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
movslq -0x74(%rbp),%rcx
xor    %rcx,%rax
mov    %eax,-0x68(%rbp)
movslq -0x74(%rbp),%rcx
lea    0x898(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x80(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x80(%rbp)
mov    %cl,-0x60(%rbp,%rax,1)
jmp    1783 <_BRBCashAddrEncode+0x653>
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    1469 <_BRBCashAddrEncode+0x339>
movq   $0x0,-0x88(%rbp)
cmpq   $0x8,-0x88(%rbp)
08
jae    1896 <_BRBCashAddrEncode+0x766>
movslq -0x68(%rbp),%rax
movabs $0x7ffffffff,%rcx
and    %rcx,%rax
shl    $0x5,%rax
mov    -0x68(%rbp),%edx
mov    $0x23,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x98f2bc8e61,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x24,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x79b76d99e2,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x25,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xf33e5fb3c4,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x26,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0xae2eabe2a8,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x68(%rbp),%edx
mov    $0x27,%ecx
sar    %cl,%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
movabs $0x1e4f43e470,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    %eax,-0x68(%rbp)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    17a5 <_BRBCashAddrEncode+0x675>
mov    -0x68(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x68(%rbp)
movq   $0x0,-0x88(%rbp)
cmpq   $0x8,-0x88(%rbp)
08
jae    1907 <_BRBCashAddrEncode+0x7d7>
mov    -0x68(%rbp),%eax
mov    $0x7,%ecx
sub    -0x88(%rbp),%rcx
imul   $0x5,%rcx,%rcx
sar    %cl,%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0x726(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x80(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x80(%rbp)
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x88(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x88(%rbp)
jmp    18aa <_BRBCashAddrEncode+0x77a>
mov    -0x80(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x80(%rbp)
movb   $0x0,-0x60(%rbp,%rax,1)
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x80(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x80(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_BRBCashAddrEncode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rcx,%r12
mov    %rdx,%r15
mov    %rsi,%r13
mov    %rdi,%rbp
xor    %edi,%edi
test   %rbp,%rbp
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r13,%r13
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x15,%r12
sete   %dil
call   1030 <assert@plt>
test   %r13,%r13
je     11e5 <_BRBCashAddrEncode+0xb5>
mov    0x0(%r13),%al
test   %al,%al
je     11e5 <_BRBCashAddrEncode+0xb5>
xor    %ebx,%ebx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0xc,%r14
ja     1304 <_BRBCashAddrEncode+0x1d4>
cmp    $0x21,%al
jl     1304 <_BRBCashAddrEncode+0x1d4>
cmp    $0x7f,%al
je     1304 <_BRBCashAddrEncode+0x1d4>
movsbl %al,%edi
call   1050 <isupper@plt>
test   %rax,%rax
jne    1304 <_BRBCashAddrEncode+0x1d4>
movzbl 0x0(%r13,%r14,1),%eax
mov    %al,(%rsp,%r14,1)
movzbl 0x1(%r13,%r14,1),%eax
add    $0x1,%r14
test   %al,%al
jne    11a0 <_BRBCashAddrEncode+0x70>
jmp    11e8 <_BRBCashAddrEncode+0xb8>
xor    %r14d,%r14d
movb   $0x3a,(%rsp,%r14,1)
xor    %ebx,%ebx
test   %r15,%r15
je     1304 <_BRBCashAddrEncode+0x1d4>
cmp    $0x15,%r12
jne    1304 <_BRBCashAddrEncode+0x1d4>
mov    %rbp,%rdi
add    $0x1,%r14
xor    %r11d,%r11d
mov    $0xffffffffffffffea,%rdx
lea    0xde6(%rip),%r8
xor    %eax,%eax
xor    %r9d,%r9d
jmp    123f <_BRBCashAddrEncode+0x10f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x8,%al
add    $0x1,%r11b
inc    %rdx
je     12de <_BRBCashAddrEncode+0x1ae>
mov    %r9d,%ebp
mov    %r14,%r10
movzbl %r11b,%ecx
imul   $0xcd,%ecx,%ecx
shr    $0x7,%ecx
and    $0xfffffff8,%ecx
lea    (%rcx,%rcx,4),%ecx
mov    %eax,%ebx
sub    %cl,%bl
movzbl %bl,%esi
imul   $0xcd,%esi,%esi
shr    $0xa,%esi
lea    (%rsi,%rsi,4),%ebx
mov    %eax,%esi
sub    %bl,%sil
sub    %cl,%sil
mov    $0x0,%r9d
cmp    $0xffffffffffffffff,%rdx
je     1284 <_BRBCashAddrEncode+0x154>
mov    0x58(%r15,%rdx,4),%r9d
mov    $0x5,%cl
sub    %sil,%cl
shl    %cl,%ebp
lea    0x3(%rsi),%ecx
mov    %r9d,%ebx
sar    %cl,%ebx
or     %ebp,%ebx
and    $0x1f,%ebx
movzbl (%rbx,%r8,1),%ecx
lea    0x1(%r10),%r14
mov    %cl,(%rsp,%r10,1)
cmp    $0x2,%sil
jb     1230 <_BRBCashAddrEncode+0x100>
cmp    $0xffffffffffffffff,%rdx
je     1230 <_BRBCashAddrEncode+0x100>
lea    -0x2(%rsi),%ecx
mov    %r9d,%ebp
sar    %cl,%ebp
and    $0x1f,%ebp
cmp    $0x2,%sil
cmovb  %ebx,%ebp
movzbl 0x0(%rbp,%r8,1),%ecx
mov    %cl,0x1(%rsp,%r10,1)
add    $0x2,%r10
mov    %r10,%r14
jmp    1230 <_BRBCashAddrEncode+0x100>
movabs $0x7171717171717171,%rax
71 71 71
mov    %rax,(%rsp,%r14,1)
movb   $0x0,0x8(%rsp,%r14,1)
add    $0x9,%r14
mov    %rsp,%rsi
mov    %r14,%rdx
call   1040 <memcpy@plt>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@_BRBCashAddrEncode.chars = internal constant [33 x i8] c"qpzry9x8gf2tvdw0s3jn54khce6mua7l\00"
define i64 @_BRBCashAddrEncode(i8* %0, i8* %1, i32* %2, i64 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i64
%10 = alloca [55 x i8]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i64
%17 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i64 %3, i64* %9
store i32 1, i32* %12
store i32 0, i32* %14
store i32 0, i32* %15
%18 = load i8*, i8** %6
%19 = icmp ne i8* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = load i8*, i8** %7
%23 = icmp ne i8* %22, null
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32*, i32** %8
%27 = icmp ne i32* %26, null
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load i64, i64* %9
%31 = icmp eq i64 %30, 21
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
store i64 0, i64* %16
br label %34
34: ; preds = %126, %4
%35 = load i8*, i8** %7
%36 = icmp ne i8* %35, null
br i1 %36, label %37, label %44
37: ; preds = %34
%38 = load i8*, i8** %7
%39 = load i64, i64* %16
%40 = getelementptr inbounds i8, i8* %38, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp ne i32 %42, 0
br label %44
44: ; preds = %37, %34
%45 = phi i1 [ false, %34 ], [ %43, %37 ]
br i1 %45, label %46, label %129
46: ; preds = %44
%47 = load i64, i64* %16
%48 = icmp ugt i64 %47, 12
br i1 %48, label %70, label %49
49: ; preds = %46
%50 = load i8*, i8** %7
%51 = load i64, i64* %16
%52 = getelementptr inbounds i8, i8* %50, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp slt i32 %54, 33
br i1 %55, label %70, label %56
56: ; preds = %49
%57 = load i8*, i8** %7
%58 = load i64, i64* %16
%59 = getelementptr inbounds i8, i8* %57, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp sgt i32 %61, 126
br i1 %62, label %70, label %63
63: ; preds = %56
%64 = load i8*, i8** %7
%65 = load i64, i64* %16
%66 = getelementptr inbounds i8, i8* %64, i64 %65
%67 = load i8, i8* %66
%68 = call i64 @isupper(i8 signext %67)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %71
70: ; preds = %63, %56, %49, %46
store i64 0, i64* %5
br label %429
71: ; preds = %63
%72 = load i32, i32* %12
%73 = sext i32 %72 to i64
%74 = and i64 %73, 34359738367
%75 = shl i64 %74, 5
%76 = load i32, i32* %12
%77 = ashr i32 %76, 35
%78 = and i32 %77, 1
%79 = sub nsw i32 0, %78
%80 = sext i32 %79 to i64
%81 = and i64 %80, 656907472481
%82 = xor i64 %75, %81
%83 = load i32, i32* %12
%84 = ashr i32 %83, 36
%85 = and i32 %84, 1
%86 = sub nsw i32 0, %85
%87 = sext i32 %86 to i64
%88 = and i64 %87, 522768456162
%89 = xor i64 %82, %88
%90 = load i32, i32* %12
%91 = ashr i32 %90, 37
%92 = and i32 %91, 1
%93 = sub nsw i32 0, %92
%94 = sext i32 %93 to i64
%95 = and i64 %94, 1044723512260
%96 = xor i64 %89, %95
%97 = load i32, i32* %12
%98 = ashr i32 %97, 38
%99 = and i32 %98, 1
%100 = sub nsw i32 0, %99
%101 = sext i32 %100 to i64
%102 = and i64 %101, 748107326120
%103 = xor i64 %96, %102
%104 = load i32, i32* %12
%105 = ashr i32 %104, 39
%106 = and i32 %105, 1
%107 = sub nsw i32 0, %106
%108 = sext i32 %107 to i64
%109 = and i64 %108, 130178868336
%110 = xor i64 %103, %109
%111 = load i8*, i8** %7
%112 = load i64, i64* %16
%113 = getelementptr inbounds i8, i8* %111, i64 %112
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = and i32 %115, 31
%117 = sext i32 %116 to i64
%118 = xor i64 %110, %117
%119 = trunc i64 %118 to i32
store i32 %119, i32* %12
%120 = load i8*, i8** %7
%121 = load i64, i64* %16
%122 = getelementptr inbounds i8, i8* %120, i64 %121
%123 = load i8, i8* %122
%124 = load i64, i64* %16
%125 = getelementptr inbounds [55 x i8], [55 x i8]* %10, i64 0, i64 %124
store i8 %123, i8* %125
br label %126
126: ; preds = %71
%127 = load i64, i64* %16
%128 = add i64 %127, 1
store i64 %128, i64* %16
br label %34
129: ; preds = %44
%130 = load i32, i32* %12
%131 = sext i32 %130 to i64
%132 = and i64 %131, 34359738367
%133 = shl i64 %132, 5
%134 = load i32, i32* %12
%135 = ashr i32 %134, 35
%136 = and i32 %135, 1
%137 = sub nsw i32 0, %136
%138 = sext i32 %137 to i64
%139 = and i64 %138, 656907472481
%140 = xor i64 %133, %139
%141 = load i32, i32* %12
%142 = ashr i32 %141, 36
%143 = and i32 %142, 1
%144 = sub nsw i32 0, %143
%145 = sext i32 %144 to i64
%146 = and i64 %145, 522768456162
%147 = xor i64 %140, %146
%148 = load i32, i32* %12
%149 = ashr i32 %148, 37
%150 = and i32 %149, 1
%151 = sub nsw i32 0, %150
%152 = sext i32 %151 to i64
%153 = and i64 %152, 1044723512260
%154 = xor i64 %147, %153
%155 = load i32, i32* %12
%156 = ashr i32 %155, 38
%157 = and i32 %156, 1
%158 = sub nsw i32 0, %157
%159 = sext i32 %158 to i64
%160 = and i64 %159, 748107326120
%161 = xor i64 %154, %160
%162 = load i32, i32* %12
%163 = ashr i32 %162, 39
%164 = and i32 %163, 1
%165 = sub nsw i32 0, %164
%166 = sext i32 %165 to i64
%167 = and i64 %166, 130178868336
%168 = xor i64 %161, %167
%169 = trunc i64 %168 to i32
store i32 %169, i32* %12
%170 = load i64, i64* %16
%171 = add i64 %170, 1
store i64 %171, i64* %16
%172 = getelementptr inbounds [55 x i8], [55 x i8]* %10, i64 0, i64 %170
store i8 58, i8* %172
%173 = load i64, i64* %16
%174 = icmp ult i64 %173, 1
br i1 %174, label %181, label %175
175: ; preds = %129
%176 = load i32*, i32** %8
%177 = icmp eq i32* %176, null
br i1 %177, label %181, label %178
178: ; preds = %175
%179 = load i64, i64* %9
%180 = icmp ne i64 %179, 21
br i1 %180, label %181, label %182
181: ; preds = %178, %175, %129
store i64 0, i64* %5
br label %429
182: ; preds = %178
store i64 0, i64* %17
br label %183
183: ; preds = %346, %182
%184 = load i64, i64* %17
%185 = load i64, i64* %9
%186 = icmp ule i64 %184, %185
br i1 %186, label %187, label %349
187: ; preds = %183
%188 = load i32, i32* %14
store i32 %188, i32* %13
%189 = load i64, i64* %17
%190 = load i64, i64* %9
%191 = icmp ult i64 %189, %190
br i1 %191, label %192, label %197
192: ; preds = %187
%193 = load i32*, i32** %8
%194 = load i64, i64* %17
%195 = getelementptr inbounds i32, i32* %193, i64 %194
%196 = load i32, i32* %195
br label %198
197: ; preds = %187
br label %198
198: ; preds = %197, %192
%199 = phi i32 [ %196, %192 ], [ 0, %197 ]
store i32 %199, i32* %14
%200 = load i64, i64* %17
%201 = urem i64 %200, 5
%202 = mul i64 %201, 8
%203 = load i64, i64* %17
%204 = urem i64 %203, 5
%205 = mul i64 %204, 8
%206 = udiv i64 %205, 5
%207 = mul i64 %206, 5
%208 = sub i64 %202, %207
%209 = trunc i64 %208 to i32
store i32 %209, i32* %11
%210 = load i32, i32* %13
%211 = load i32, i32* %11
%212 = sub nsw i32 5, %211
%213 = shl i32 %210, %212
%214 = load i32, i32* %14
%215 = load i32, i32* %11
%216 = add nsw i32 3, %215
%217 = ashr i32 %214, %216
%218 = or i32 %213, %217
%219 = and i32 %218, 31
store i32 %219, i32* %15
%220 = load i64, i64* %17
%221 = load i64, i64* %9
%222 = icmp ult i64 %220, %221
br i1 %222, label %227, label %223
223: ; preds = %198
%224 = load i64, i64* %17
%225 = urem i64 %224, 5
%226 = icmp ugt i64 %225, 0
br i1 %226, label %227, label %278
227: ; preds = %223, %198
%228 = load i32, i32* %12
%229 = sext i32 %228 to i64
%230 = and i64 %229, 34359738367
%231 = shl i64 %230, 5
%232 = load i32, i32* %12
%233 = ashr i32 %232, 35
%234 = and i32 %233, 1
%235 = sub nsw i32 0, %234
%236 = sext i32 %235 to i64
%237 = and i64 %236, 656907472481
%238 = xor i64 %231, %237
%239 = load i32, i32* %12
%240 = ashr i32 %239, 36
%241 = and i32 %240, 1
%242 = sub nsw i32 0, %241
%243 = sext i32 %242 to i64
%244 = and i64 %243, 522768456162
%245 = xor i64 %238, %244
%246 = load i32, i32* %12
%247 = ashr i32 %246, 37
%248 = and i32 %247, 1
%249 = sub nsw i32 0, %248
%250 = sext i32 %249 to i64
%251 = and i64 %250, 1044723512260
%252 = xor i64 %245, %251
%253 = load i32, i32* %12
%254 = ashr i32 %253, 38
%255 = and i32 %254, 1
%256 = sub nsw i32 0, %255
%257 = sext i32 %256 to i64
%258 = and i64 %257, 748107326120
%259 = xor i64 %252, %258
%260 = load i32, i32* %12
%261 = ashr i32 %260, 39
%262 = and i32 %261, 1
%263 = sub nsw i32 0, %262
%264 = sext i32 %263 to i64
%265 = and i64 %264, 130178868336
%266 = xor i64 %259, %265
%267 = load i32, i32* %15
%268 = sext i32 %267 to i64
%269 = xor i64 %266, %268
%270 = trunc i64 %269 to i32
store i32 %270, i32* %12
%271 = load i32, i32* %15
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds [33 x i8], [33 x i8]* @_BRBCashAddrEncode.chars, i64 0, i64 %272
%274 = load i8, i8* %273
%275 = load i64, i64* %16
%276 = add i64 %275, 1
store i64 %276, i64* %16
%277 = getelementptr inbounds [55 x i8], [55 x i8]* %10, i64 0, i64 %275
store i8 %274, i8* %277
br label %278
278: ; preds = %227, %223
%279 = load i32, i32* %11
%280 = icmp sge i32 %279, 2
br i1 %280, label %281, label %287
281: ; preds = %278
%282 = load i32, i32* %14
%283 = load i32, i32* %11
%284 = sub nsw i32 %283, 2
%285 = ashr i32 %282, %284
%286 = and i32 %285, 31
store i32 %286, i32* %15
br label %287
287: ; preds = %281, %278
%288 = load i32, i32* %11
%289 = icmp sge i32 %288, 2
br i1 %289, label %290, label %345
290: ; preds = %287
%291 = load i64, i64* %17
%292 = load i64, i64* %9
%293 = icmp ult i64 %291, %292
br i1 %293, label %294, label %345
294: ; preds = %290
%295 = load i32, i32* %12
%296 = sext i32 %295 to i64
%297 = and i64 %296, 34359738367
%298 = shl i64 %297, 5
%299 = load i32, i32* %12
%300 = ashr i32 %299, 35
%301 = and i32 %300, 1
%302 = sub nsw i32 0, %301
%303 = sext i32 %302 to i64
%304 = and i64 %303, 656907472481
%305 = xor i64 %298, %304
%306 = load i32, i32* %12
%307 = ashr i32 %306, 36
%308 = and i32 %307, 1
%309 = sub nsw i32 0, %308
%310 = sext i32 %309 to i64
%311 = and i64 %310, 522768456162
%312 = xor i64 %305, %311
%313 = load i32, i32* %12
%314 = ashr i32 %313, 37
%315 = and i32 %314, 1
%316 = sub nsw i32 0, %315
%317 = sext i32 %316 to i64
%318 = and i64 %317, 1044723512260
%319 = xor i64 %312, %318
%320 = load i32, i32* %12
%321 = ashr i32 %320, 38
%322 = and i32 %321, 1
%323 = sub nsw i32 0, %322
%324 = sext i32 %323 to i64
%325 = and i64 %324, 748107326120
%326 = xor i64 %319, %325
%327 = load i32, i32* %12
%328 = ashr i32 %327, 39
%329 = and i32 %328, 1
%330 = sub nsw i32 0, %329
%331 = sext i32 %330 to i64
%332 = and i64 %331, 130178868336
%333 = xor i64 %326, %332
%334 = load i32, i32* %15
%335 = sext i32 %334 to i64
%336 = xor i64 %333, %335
%337 = trunc i64 %336 to i32
store i32 %337, i32* %12
%338 = load i32, i32* %15
%339 = sext i32 %338 to i64
%340 = getelementptr inbounds [33 x i8], [33 x i8]* @_BRBCashAddrEncode.chars, i64 0, i64 %339
%341 = load i8, i8* %340
%342 = load i64, i64* %16
%343 = add i64 %342, 1
store i64 %343, i64* %16
%344 = getelementptr inbounds [55 x i8], [55 x i8]* %10, i64 0, i64 %342
store i8 %341, i8* %344
br label %345
345: ; preds = %294, %290, %287
br label %346
346: ; preds = %345
%347 = load i64, i64* %17
%348 = add i64 %347, 1
store i64 %348, i64* %17
br label %183
349: ; preds = %183
store i64 0, i64* %17
br label %350
350: ; preds = %394, %349
%351 = load i64, i64* %17
%352 = icmp ult i64 %351, 8
br i1 %352, label %353, label %397
353: ; preds = %350
%354 = load i32, i32* %12
%355 = sext i32 %354 to i64
%356 = and i64 %355, 34359738367
%357 = shl i64 %356, 5
%358 = load i32, i32* %12
%359 = ashr i32 %358, 35
%360 = and i32 %359, 1
%361 = sub nsw i32 0, %360
%362 = sext i32 %361 to i64
%363 = and i64 %362, 656907472481
%364 = xor i64 %357, %363
%365 = load i32, i32* %12
%366 = ashr i32 %365, 36
%367 = and i32 %366, 1
%368 = sub nsw i32 0, %367
%369 = sext i32 %368 to i64
%370 = and i64 %369, 522768456162
%371 = xor i64 %364, %370
%372 = load i32, i32* %12
%373 = ashr i32 %372, 37
%374 = and i32 %373, 1
%375 = sub nsw i32 0, %374
%376 = sext i32 %375 to i64
%377 = and i64 %376, 1044723512260
%378 = xor i64 %371, %377
%379 = load i32, i32* %12
%380 = ashr i32 %379, 38
%381 = and i32 %380, 1
%382 = sub nsw i32 0, %381
%383 = sext i32 %382 to i64
%384 = and i64 %383, 748107326120
%385 = xor i64 %378, %384
%386 = load i32, i32* %12
%387 = ashr i32 %386, 39
%388 = and i32 %387, 1
%389 = sub nsw i32 0, %388
%390 = sext i32 %389 to i64
%391 = and i64 %390, 130178868336
%392 = xor i64 %385, %391
%393 = trunc i64 %392 to i32
store i32 %393, i32* %12
br label %394
394: ; preds = %353
%395 = load i64, i64* %17
%396 = add i64 %395, 1
store i64 %396, i64* %17
br label %350
397: ; preds = %350
%398 = load i32, i32* %12
%399 = xor i32 %398, 1
store i32 %399, i32* %12
store i64 0, i64* %17
br label %400
400: ; preds = %417, %397
%401 = load i64, i64* %17
%402 = icmp ult i64 %401, 8
br i1 %402, label %403, label %420
403: ; preds = %400
%404 = load i32, i32* %12
%405 = load i64, i64* %17
%406 = sub i64 7, %405
%407 = mul i64 %406, 5
%408 = trunc i64 %407 to i32
%409 = ashr i32 %404, %408
%410 = and i32 %409, 31
%411 = sext i32 %410 to i64
%412 = getelementptr inbounds [33 x i8], [33 x i8]* @_BRBCashAddrEncode.chars, i64 0, i64 %411
%413 = load i8, i8* %412
%414 = load i64, i64* %16
%415 = add i64 %414, 1
store i64 %415, i64* %16
%416 = getelementptr inbounds [55 x i8], [55 x i8]* %10, i64 0, i64 %414
store i8 %413, i8* %416
br label %417
417: ; preds = %403
%418 = load i64, i64* %17
%419 = add i64 %418, 1
store i64 %419, i64* %17
br label %400
420: ; preds = %400
%421 = load i64, i64* %16
%422 = add i64 %421, 1
store i64 %422, i64* %16
%423 = getelementptr inbounds [55 x i8], [55 x i8]* %10, i64 0, i64 %421
store i8 0, i8* %423
%424 = load i8*, i8** %6
%425 = getelementptr inbounds [55 x i8], [55 x i8]* %10, i64 0, i64 0
%426 = load i64, i64* %16
%427 = call i32 @memcpy(i8* %424, i8* %425, i64 %426)
%428 = load i64, i64* %16
store i64 %428, i64* %5
br label %429
429: ; preds = %420, %181, %70
%430 = load i64, i64* %5
ret i64 %430
}

LLVM IR (-O2):
@_BRBCashAddrEncode.chars = internal unnamed_addr constant [33 x i8] c"qpzry9x8gf2tvdw0s3jn54khce6mua7l\00"
define i64 @_BRBCashAddrEncode(i8* %0, i8* %1, i32* %2, i64 %3) {
%5 = alloca [55 x i8]
%6 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 0
%7 = icmp ne i8* %0, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp ne i8* %1, null
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = icmp ne i32* %2, null
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = icmp eq i64 %3, 21
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
br i1 %10, label %19, label %41
19: ; preds = %4
%20 = load i8, i8* %1
%21 = icmp eq i8 %20, 0
br i1 %21, label %41, label %22
22: ; preds = %19, %34
%23 = phi i8 [ %39, %34 ], [ %20, %19 ]
%24 = phi i8* [ %38, %34 ], [ %1, %19 ]
%25 = phi i64 [ %37, %34 ], [ 0, %19 ]
%26 = icmp ugt i64 %25, 12
%27 = icmp slt i8 %23, 33
%28 = select i1 %26, i1 true, i1 %27
%29 = icmp eq i8 %23, 127
%30 = select i1 %28, i1 true, i1 %29
br i1 %30, label %99, label %31
31: ; preds = %22
%32 = tail call i64 @isupper(i8 signext %23)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %99
34: ; preds = %31
%35 = load i8, i8* %24
%36 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 %25
store i8 %35, i8* %36
%37 = add nuw nsw i64 %25, 1
%38 = getelementptr inbounds i8, i8* %1, i64 %37
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 0
br i1 %40, label %41, label %22
41: ; preds = %34, %19, %4
%42 = phi i64 [ 0, %4 ], [ 0, %19 ], [ %37, %34 ]
%43 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 %42
store i8 58, i8* %43
%44 = icmp eq i32* %2, null
%45 = icmp ne i64 %3, 21
%46 = or i1 %44, %45
br i1 %46, label %99, label %47
47: ; preds = %41
%48 = add nuw nsw i64 %42, 1
br label %56
49: ; preds = %95
%50 = getelementptr [55 x i8], [55 x i8]* %5, i64 0, i64 %96
%51 = bitcast i8* %50 to i64*
store i64 8174439530702664049, i64* %51
%52 = add i64 %96, 8
%53 = add i64 %96, 9
%54 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 %52
store i8 0, i8* %54
%55 = call i32 @memcpy(i8* %0, i8* %6, i64 %53)
br label %99
56: ; preds = %47, %95
%57 = phi i64 [ %97, %95 ], [ 0, %47 ]
%58 = phi i64 [ %96, %95 ], [ %48, %47 ]
%59 = phi i32 [ %65, %95 ], [ 0, %47 ]
%60 = icmp eq i64 %57, 21
br i1 %60, label %64, label %61
61: ; preds = %56
%62 = getelementptr inbounds i32, i32* %2, i64 %57
%63 = load i32, i32* %62
br label %64
64: ; preds = %56, %61
%65 = phi i32 [ %63, %61 ], [ 0, %56 ]
%66 = trunc i64 %57 to i8
%67 = urem i8 %66, 5
%68 = shl nuw nsw i8 %67, 3
%69 = urem i8 %68, 5
%70 = zext i8 %69 to i32
%71 = sub nuw nsw i32 5, %70
%72 = shl i32 %59, %71
%73 = add nuw nsw i32 %70, 3
%74 = ashr i32 %65, %73
%75 = or i32 %74, %72
%76 = and i32 %75, 31
%77 = zext i32 %76 to i64
%78 = getelementptr inbounds [33 x i8], [33 x i8]* @_BRBCashAddrEncode.chars, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = add i64 %58, 1
%81 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 %58
store i8 %79, i8* %81
%82 = icmp ugt i8 %69, 1
%83 = xor i1 %82, true
%84 = select i1 %83, i1 true, i1 %60
br i1 %84, label %95, label %85
85: ; preds = %64
%86 = add nsw i32 %70, -2
%87 = ashr i32 %65, %86
%88 = and i32 %87, 31
%89 = select i1 %82, i32 %88, i32 %76
%90 = zext i32 %89 to i64
%91 = getelementptr inbounds [33 x i8], [33 x i8]* @_BRBCashAddrEncode.chars, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = add i64 %58, 2
%94 = getelementptr inbounds [55 x i8], [55 x i8]* %5, i64 0, i64 %80
store i8 %92, i8* %94
br label %95
95: ; preds = %64, %85
%96 = phi i64 [ %93, %85 ], [ %80, %64 ]
%97 = add nuw nsw i64 %57, 1
%98 = icmp eq i64 %97, 22
br i1 %98, label %49, label %56
99: ; preds = %22, %31, %41, %49
%100 = phi i64 [ %53, %49 ], [ 0, %41 ], [ 0, %31 ], [ 0, %22 ]
ret i64 %100
}