#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*/ free(unsigned char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int gsmEncode7bit(const char *pSrc, unsigned char *pDst, int nSrcLength,
                  unsigned char *pUDLen) {
  int nSrc;
  int nDst;
  int nChar;
  unsigned char nLeft;
  int len;
  unsigned char *tmp;
  tmp = (unsigned char *)malloc(320);
  memset(tmp, 0, 320);
  int UK = -1;
  const unsigned char EQ7BIT2ASCII[128] = {
      64,  163, 36,  165, 232, 223, 249, 236, 242, 199, 10,  216, 248, 13,  197,
      229, UK,  95,  UK,  UK,  UK,  UK,  UK,  UK,  UK,  UK,  UK,  UK,  198, 230,
      223, 201, 32,  33,  34,  35,  164, 37,  38,  39,  40,  41,  42,  43,  44,
      45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,  56,  57,  58,  59,
      60,  61,  62,  63,  161, 65,  66,  67,  68,  69,  70,  71,  72,  73,  74,
      75,  76,  77,  78,  79,  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,
      90,  196, 204, 209, 220, 167, 191, 97,  98,  99,  100, 101, 102, 103, 104,
      105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
      120, 121, 122, 228, 246, 241, 252, 224};
  int i, j, k;
  len = nSrcLength;
  for (i = 0, j = 0; i < nSrcLength; i++, j++) {
    switch (pSrc[i]) {
    case 0x000C:
      tmp[j] = 0x1B;
      tmp[++j] = 0x0A;
      len++;
      break;
    case 0x005E:
      tmp[j] = 0x1B;
      tmp[++j] = 0x14;
      len++;
      break;
    case 0x007B:
      tmp[j] = 0x1B;
      tmp[++j] = 0x28;
      len++;
      break;
    case 0x007D:
      tmp[j] = 0x1B;
      tmp[++j] = 0x29;
      len++;
      break;
    case 0x005C:
      tmp[j] = 0x1B;
      tmp[++j] = 0x2F;
      len++;
      break;
    case 0x005B:
      tmp[j] = 0x1B;
      tmp[++j] = 0x3C;
      len++;
      break;
    case 0x007E:
      tmp[j] = 0x1B;
      tmp[++j] = 0x3D;
      len++;
      break;
    case 0x005D:
      tmp[j] = 0x1B;
      tmp[++j] = 0x3E;
      len++;
      break;
    case 0x007C:
      tmp[j] = 0x1B;
      tmp[++j] = 0x40;
      len++;
      break;
    default:
      tmp[j] = pSrc[i];
    }
    for (k = 0; k < 128; k++) {
      if (pSrc[i] == EQ7BIT2ASCII[k]) {
        tmp[j] = k;
        break;
      }
    }
  }
  nSrc = 0;
  nDst = 0;
  unsigned char *p;
  p = tmp;
  while (nSrc < len) {
    nChar = nSrc & 7;
    if (nChar == 0) {
      nLeft = *p;
    } else {
      *pDst = (*p << (8 - nChar)) | nLeft;
      nLeft = *p >> nChar;
      pDst++;
      nDst++;
    }
    p++;
    nSrc++;
  }
  free(tmp);
  *pUDLen = len - 1;
  return nDst;
}


x86 assembly (clang, -O0):
<gsmEncode7bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x140,%edi
call   1050 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x140,%edx
call   1040 <memset@plt>
movl   $0xffffffff,-0x44(%rbp)
movb   $0x40,-0xd0(%rbp)
movb   $0xa3,-0xcf(%rbp)
movb   $0x24,-0xce(%rbp)
movb   $0xa5,-0xcd(%rbp)
movb   $0xe8,-0xcc(%rbp)
movb   $0xdf,-0xcb(%rbp)
movb   $0xf9,-0xca(%rbp)
movb   $0xec,-0xc9(%rbp)
movb   $0xf2,-0xc8(%rbp)
movb   $0xc7,-0xc7(%rbp)
movb   $0xa,-0xc6(%rbp)
movb   $0xd8,-0xc5(%rbp)
movb   $0xf8,-0xc4(%rbp)
movb   $0xd,-0xc3(%rbp)
movb   $0xc5,-0xc2(%rbp)
movb   $0xe5,-0xc1(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xc0(%rbp)
movb   $0x5f,-0xbf(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xbe(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xbd(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xbc(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xbb(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xba(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xb9(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xb8(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xb7(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xb6(%rbp)
mov    -0x44(%rbp),%eax
mov    %al,-0xb5(%rbp)
movb   $0xc6,-0xb4(%rbp)
movb   $0xe6,-0xb3(%rbp)
movb   $0xdf,-0xb2(%rbp)
movb   $0xc9,-0xb1(%rbp)
movb   $0x20,-0xb0(%rbp)
movb   $0x21,-0xaf(%rbp)
movb   $0x22,-0xae(%rbp)
movb   $0x23,-0xad(%rbp)
movb   $0xa4,-0xac(%rbp)
movb   $0x25,-0xab(%rbp)
movb   $0x26,-0xaa(%rbp)
movb   $0x27,-0xa9(%rbp)
movb   $0x28,-0xa8(%rbp)
movb   $0x29,-0xa7(%rbp)
movb   $0x2a,-0xa6(%rbp)
movb   $0x2b,-0xa5(%rbp)
movb   $0x2c,-0xa4(%rbp)
movb   $0x2d,-0xa3(%rbp)
movb   $0x2e,-0xa2(%rbp)
movb   $0x2f,-0xa1(%rbp)
movb   $0x30,-0xa0(%rbp)
movb   $0x31,-0x9f(%rbp)
movb   $0x32,-0x9e(%rbp)
movb   $0x33,-0x9d(%rbp)
movb   $0x34,-0x9c(%rbp)
movb   $0x35,-0x9b(%rbp)
movb   $0x36,-0x9a(%rbp)
movb   $0x37,-0x99(%rbp)
movb   $0x38,-0x98(%rbp)
movb   $0x39,-0x97(%rbp)
movb   $0x3a,-0x96(%rbp)
movb   $0x3b,-0x95(%rbp)
movb   $0x3c,-0x94(%rbp)
movb   $0x3d,-0x93(%rbp)
movb   $0x3e,-0x92(%rbp)
movb   $0x3f,-0x91(%rbp)
movb   $0xa1,-0x90(%rbp)
movb   $0x41,-0x8f(%rbp)
movb   $0x42,-0x8e(%rbp)
movb   $0x43,-0x8d(%rbp)
movb   $0x44,-0x8c(%rbp)
movb   $0x45,-0x8b(%rbp)
movb   $0x46,-0x8a(%rbp)
movb   $0x47,-0x89(%rbp)
movb   $0x48,-0x88(%rbp)
movb   $0x49,-0x87(%rbp)
movb   $0x4a,-0x86(%rbp)
movb   $0x4b,-0x85(%rbp)
movb   $0x4c,-0x84(%rbp)
movb   $0x4d,-0x83(%rbp)
movb   $0x4e,-0x82(%rbp)
movb   $0x4f,-0x81(%rbp)
movb   $0x50,-0x80(%rbp)
movb   $0x51,-0x7f(%rbp)
movb   $0x52,-0x7e(%rbp)
movb   $0x53,-0x7d(%rbp)
movb   $0x54,-0x7c(%rbp)
movb   $0x55,-0x7b(%rbp)
movb   $0x56,-0x7a(%rbp)
movb   $0x57,-0x79(%rbp)
movb   $0x58,-0x78(%rbp)
movb   $0x59,-0x77(%rbp)
movb   $0x5a,-0x76(%rbp)
movb   $0xc4,-0x75(%rbp)
movb   $0xcc,-0x74(%rbp)
movb   $0xd1,-0x73(%rbp)
movb   $0xdc,-0x72(%rbp)
movb   $0xa7,-0x71(%rbp)
movb   $0xbf,-0x70(%rbp)
movb   $0x61,-0x6f(%rbp)
movb   $0x62,-0x6e(%rbp)
movb   $0x63,-0x6d(%rbp)
movb   $0x64,-0x6c(%rbp)
movb   $0x65,-0x6b(%rbp)
movb   $0x66,-0x6a(%rbp)
movb   $0x67,-0x69(%rbp)
movb   $0x68,-0x68(%rbp)
movb   $0x69,-0x67(%rbp)
movb   $0x6a,-0x66(%rbp)
movb   $0x6b,-0x65(%rbp)
movb   $0x6c,-0x64(%rbp)
movb   $0x6d,-0x63(%rbp)
movb   $0x6e,-0x62(%rbp)
movb   $0x6f,-0x61(%rbp)
movb   $0x70,-0x60(%rbp)
movb   $0x71,-0x5f(%rbp)
movb   $0x72,-0x5e(%rbp)
movb   $0x73,-0x5d(%rbp)
movb   $0x74,-0x5c(%rbp)
movb   $0x75,-0x5b(%rbp)
movb   $0x76,-0x5a(%rbp)
movb   $0x77,-0x59(%rbp)
movb   $0x78,-0x58(%rbp)
movb   $0x79,-0x57(%rbp)
movb   $0x7a,-0x56(%rbp)
movb   $0xe4,-0x55(%rbp)
movb   $0xf6,-0x54(%rbp)
movb   $0xf1,-0x53(%rbp)
movb   $0xfc,-0x52(%rbp)
movb   $0xe0,-0x51(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0xd4(%rbp)
movl   $0x0,-0xd8(%rbp)
mov    -0xd4(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1808 <gsmEncode7bit+0x6d8>
mov    -0x8(%rbp),%rax
movslq -0xd4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0xec(%rbp)
sub    $0xc,%eax
je     1561 <gsmEncode7bit+0x431>
jmp    14c1 <gsmEncode7bit+0x391>
mov    -0xec(%rbp),%eax
sub    $0x5b,%eax
je     1674 <gsmEncode7bit+0x544>
jmp    14d5 <gsmEncode7bit+0x3a5>
mov    -0xec(%rbp),%eax
sub    $0x5c,%eax
je     163d <gsmEncode7bit+0x50d>
jmp    14e9 <gsmEncode7bit+0x3b9>
mov    -0xec(%rbp),%eax
sub    $0x5d,%eax
je     16e2 <gsmEncode7bit+0x5b2>
jmp    14fd <gsmEncode7bit+0x3cd>
mov    -0xec(%rbp),%eax
sub    $0x5e,%eax
je     1598 <gsmEncode7bit+0x468>
jmp    1511 <gsmEncode7bit+0x3e1>
mov    -0xec(%rbp),%eax
sub    $0x7b,%eax
je     15cf <gsmEncode7bit+0x49f>
jmp    1525 <gsmEncode7bit+0x3f5>
mov    -0xec(%rbp),%eax
sub    $0x7c,%eax
je     1719 <gsmEncode7bit+0x5e9>
jmp    1539 <gsmEncode7bit+0x409>
mov    -0xec(%rbp),%eax
sub    $0x7d,%eax
je     1606 <gsmEncode7bit+0x4d6>
jmp    154d <gsmEncode7bit+0x41d>
mov    -0xec(%rbp),%eax
sub    $0x7e,%eax
je     16ab <gsmEncode7bit+0x57b>
jmp    1750 <gsmEncode7bit+0x620>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0xa,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x14,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x28,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x29,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x2f,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x3c,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x3d,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x3e,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
movb   $0x1b,(%rax,%rcx,1)
mov    -0x40(%rbp),%rax
mov    -0xd8(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xd8(%rbp)
movslq %ecx,%rcx
movb   $0x40,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    176c <gsmEncode7bit+0x63c>
mov    -0x8(%rbp),%rax
movslq -0xd4(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movl   $0x0,-0xdc(%rbp)
cmpl   $0x80,-0xdc(%rbp)
jge    17e0 <gsmEncode7bit+0x6b0>
mov    -0x8(%rbp),%rax
movslq -0xd4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movslq -0xdc(%rbp),%rcx
movzbl -0xd0(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
jne    17c7 <gsmEncode7bit+0x697>
mov    -0xdc(%rbp),%eax
mov    %al,%dl
mov    -0x40(%rbp),%rax
movslq -0xd8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    17e0 <gsmEncode7bit+0x6b0>
jmp    17cc <gsmEncode7bit+0x69c>
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    1776 <gsmEncode7bit+0x646>
jmp    17e5 <gsmEncode7bit+0x6b5>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    148f <gsmEncode7bit+0x35f>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    18ba <gsmEncode7bit+0x78a>
mov    -0x24(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1851 <gsmEncode7bit+0x721>
mov    -0xe8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x2d(%rbp)
jmp    189a <gsmEncode7bit+0x76a>
mov    -0xe8(%rbp),%rax
movzbl (%rax),%eax
mov    $0x8,%ecx
sub    -0x2c(%rbp),%ecx
shl    %cl,%eax
movzbl -0x2d(%rbp),%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0xe8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x2c(%rbp),%ecx
sar    %cl,%eax
mov    %al,-0x2d(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0xe8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xe8(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1821 <gsmEncode7bit+0x6f1>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x34(%rbp),%eax
sub    $0x1,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsmEncode7bit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbx
mov    $0x140,%edi
call   1050 <malloc@plt>
mov    %rax,%r13
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x140,%edx
call   1040 <memset@plt>
movaps 0xe8e(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x5fff,0x10(%rsp)
movq   $0xffffffffffffffff,0x12(%rsp)
ff ff
movw   $0xffff,0x1a(%rsp)
movaps 0xe7c(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xe80(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xe84(%rip),%xmm0
movups %xmm0,0x3c(%rsp)
movaps 0xe88(%rip),%xmm0
movups %xmm0,0x4c(%rsp)
movaps 0xe8c(%rip),%xmm0
movups %xmm0,0x5c(%rsp)
movaps 0xe90(%rip),%xmm0
movups %xmm0,0x6c(%rsp)
movl   $0xe0fcf1f6,0x7c(%rsp)
e0
test   %r15d,%r15d
jle    13ea <gsmEncode7bit+0x2ba>
mov    %r15d,%eax
xor    %ecx,%ecx
lea    0xe7e(%rip),%r8
xor    %esi,%esi
jmp    121c <gsmEncode7bit+0xec>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rdi
movslq %esi,%rdx
mov    %dil,0x0(%r13,%rdx,1)
add    $0x1,%rcx
add    $0x1,%esi
cmp    %rax,%rcx
je     131f <gsmEncode7bit+0x1ef>
mov    (%rbx,%rcx,1),%dl
movsbl %dl,%edi
lea    -0x5b(%rdi),%ebp
cmp    $0x23,%ebp
ja     1243 <gsmEncode7bit+0x113>
movslq (%r8,%rbp,4),%rdi
add    %r8,%rdi
jmp    *%rdi
movslq %esi,%rdx
movw   $0x3c1b,0x0(%r13,%rdx,1)
3c
jmp    12c0 <gsmEncode7bit+0x190>
cmp    $0xc,%edi
jne    1255 <gsmEncode7bit+0x125>
movslq %esi,%rdx
movw   $0xa1b,0x0(%r13,%rdx,1)
0a
jmp    12c0 <gsmEncode7bit+0x190>
movslq %esi,%rdi
mov    %dl,0x0(%r13,%rdi,1)
jmp    12c7 <gsmEncode7bit+0x197>
movslq %esi,%rdx
movw   $0x2f1b,0x0(%r13,%rdx,1)
2f
jmp    12c0 <gsmEncode7bit+0x190>
movslq %esi,%rdx
movw   $0x3e1b,0x0(%r13,%rdx,1)
3e
jmp    12c0 <gsmEncode7bit+0x190>
movslq %esi,%rdx
movw   $0x141b,0x0(%r13,%rdx,1)
14
jmp    12c0 <gsmEncode7bit+0x190>
movslq %esi,%rdx
movw   $0x281b,0x0(%r13,%rdx,1)
28
jmp    12c0 <gsmEncode7bit+0x190>
movslq %esi,%rsi
movw   $0x401b,0x0(%r13,%rsi,1)
40
jmp    12c0 <gsmEncode7bit+0x190>
movslq %esi,%rdx
movw   $0x291b,0x0(%r13,%rdx,1)
29
jmp    12c0 <gsmEncode7bit+0x190>
movslq %esi,%rdx
movw   $0x3d1b,0x0(%r13,%rdx,1)
3d
nopl   0x0(%rax,%rax,1)
add    $0x1,%esi
add    $0x1,%r15d
movsbl (%rbx,%rcx,1),%ebp
xor    %edi,%edi
nopl   (%rax)
movzbl (%rsp,%rdi,1),%edx
cmp    %edx,%ebp
je     1204 <gsmEncode7bit+0xd4>
movzbl 0x1(%rsp,%rdi,1),%edx
cmp    %edx,%ebp
je     1200 <gsmEncode7bit+0xd0>
movzbl 0x2(%rsp,%rdi,1),%edx
cmp    %edx,%ebp
je     130d <gsmEncode7bit+0x1dd>
movzbl 0x3(%rsp,%rdi,1),%edx
cmp    %edx,%ebp
je     1316 <gsmEncode7bit+0x1e6>
add    $0x4,%rdi
cmp    $0x80,%rdi
jne    12d0 <gsmEncode7bit+0x1a0>
jmp    120c <gsmEncode7bit+0xdc>
add    $0x2,%rdi
jmp    1204 <gsmEncode7bit+0xd4>
add    $0x3,%rdi
jmp    1204 <gsmEncode7bit+0xd4>
test   %r15d,%r15d
jle    1340 <gsmEncode7bit+0x210>
cmp    $0x1,%r15d
jne    1347 <gsmEncode7bit+0x217>
xor    %eax,%eax
mov    %r13,%rcx
xor    %ebp,%ebp
test   $0x1,%r15b
jne    13d3 <gsmEncode7bit+0x2a3>
jmp    13ea <gsmEncode7bit+0x2ba>
xor    %ebp,%ebp
jmp    13ea <gsmEncode7bit+0x2ba>
mov    %r15d,%esi
and    $0xfffffffe,%esi
xor    %edx,%edx
xor    %ebp,%ebp
jmp    1392 <gsmEncode7bit+0x262>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x1(%r13,%rdx,1),%edi
mov    %edx,%eax
and    $0x6,%al
or     $0x1,%al
mov    $0x8,%cl
sub    %al,%cl
shl    %cl,%edi
or     %bl,%dil
mov    %dil,(%r12)
movzbl 0x1(%r13,%rdx,1),%edi
mov    %eax,%ecx
shr    %cl,%edi
add    $0x1,%r12
add    $0x1,%ebp
add    $0x2,%rdx
cmp    %edx,%esi
je     13c2 <gsmEncode7bit+0x292>
mov    %edx,%eax
movzbl 0x0(%r13,%rdx,1),%ebx
and    $0x6,%eax
je     1360 <gsmEncode7bit+0x230>
movzbl %bl,%ebx
mov    $0x8,%cl
sub    %al,%cl
shl    %cl,%ebx
or     %bl,%dil
mov    %dil,(%r12)
movzbl 0x0(%r13,%rdx,1),%ebx
mov    %eax,%ecx
shr    %cl,%ebx
add    $0x1,%r12
add    $0x1,%ebp
jmp    1360 <gsmEncode7bit+0x230>
mov    %edx,%eax
and    $0x6,%eax
mov    %r13,%rcx
add    %rdx,%rcx
test   $0x1,%r15b
je     13ea <gsmEncode7bit+0x2ba>
test   %eax,%eax
je     13ea <gsmEncode7bit+0x2ba>
movzbl (%rcx),%edx
mov    $0x8,%cl
sub    %al,%cl
shl    %cl,%edx
or     %dl,%dil
mov    %dil,(%r12)
add    $0x1,%ebp
mov    %r13,%rdi
call   1030 <free@plt>
add    $0xff,%r15b
mov    %r15b,(%r14)
mov    %ebp,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @gsmEncode7bit(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2, i8* nocapture writeonly %3) {
%5 = alloca [128 x i8]
%6 = tail call i64 @malloc(i32 320)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memset(i8* %7, i32 0, i32 320)
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%10 = bitcast [128 x i8]* %5 to <16 x i8>*
store <16 x i8> <i8 64, i8 -93, i8 36, i8 -91, i8 -24, i8 -33, i8 -7, i8 -20, i8 -14, i8 -57, i8 10, i8 -40, i8 -8, i8 13, i8 -59, i8 -27>, <16 x i8>* %10
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 16
store i8 -1, i8* %11
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 17
store i8 95, i8* %12
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 18
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 28
%15 = bitcast i8* %14 to <16 x i8>*
store <16 x i8> <i8 -58, i8 -26, i8 -33, i8 -55, i8 32, i8 33, i8 34, i8 35, i8 -92, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43>, <16 x i8>* %15
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 44
%17 = bitcast i8* %16 to <16 x i8>*
store <16 x i8> <i8 44, i8 45, i8 46, i8 47, i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59>, <16 x i8>* %17
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 60
%19 = bitcast i8* %18 to <16 x i8>*
store <16 x i8> <i8 60, i8 61, i8 62, i8 63, i8 -95, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75>, <16 x i8>* %19
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 76
%21 = bitcast i8* %20 to <16 x i8>*
store <16 x i8> <i8 76, i8 77, i8 78, i8 79, i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 -60>, <16 x i8>* %21
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 92
%23 = bitcast i8* %22 to <16 x i8>*
store <16 x i8> <i8 -52, i8 -47, i8 -36, i8 -89, i8 -65, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107>, <16 x i8>* %23
%24 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 108
%25 = bitcast i8* %24 to <16 x i8>*
store <16 x i8> <i8 108, i8 109, i8 110, i8 111, i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 -28>, <16 x i8>* %25
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 124
store i8 -10, i8* %26
%27 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 125
store i8 -15, i8* %27
%28 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 126
store i8 -4, i8* %28
%29 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 127
store i8 -32, i8* %29
%30 = icmp sgt i32 %2, 0
br i1 %30, label %31, label %219
31: ; preds = %4
%32 = zext i32 %2 to i64
br label %40
33: ; preds = %150
%34 = icmp sgt i32 %114, 0
br i1 %34, label %35, label %219
35: ; preds = %33
%36 = and i32 %114, 1
%37 = icmp eq i32 %114, 1
br i1 %37, label %201, label %38
38: ; preds = %35
%39 = and i32 %114, -2
br label %154
40: ; preds = %31, %150
%41 = phi i64 [ 0, %31 ], [ %151, %150 ]
%42 = phi i32 [ 0, %31 ], [ %152, %150 ]
%43 = phi i32 [ %2, %31 ], [ %114, %150 ]
%44 = getelementptr inbounds i8, i8* %0, i64 %41
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
switch i32 %46, label %110 [
i32 12, label %47
i32 94, label %54
i32 123, label %61
i32 125, label %68
i32 92, label %75
i32 91, label %82
i32 126, label %89
i32 93, label %96
i32 124, label %103
]
47: ; preds = %40
%48 = sext i32 %42 to i64
%49 = getelementptr inbounds i8, i8* %7, i64 %48
store i8 27, i8* %49
%50 = add nsw i32 %42, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %7, i64 %51
store i8 10, i8* %52
%53 = add nsw i32 %43, 1
br label %113
54: ; preds = %40
%55 = sext i32 %42 to i64
%56 = getelementptr inbounds i8, i8* %7, i64 %55
store i8 27, i8* %56
%57 = add nsw i32 %42, 1
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %7, i64 %58
store i8 20, i8* %59
%60 = add nsw i32 %43, 1
br label %113
61: ; preds = %40
%62 = sext i32 %42 to i64
%63 = getelementptr inbounds i8, i8* %7, i64 %62
store i8 27, i8* %63
%64 = add nsw i32 %42, 1
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %7, i64 %65
store i8 40, i8* %66
%67 = add nsw i32 %43, 1
br label %113
68: ; preds = %40
%69 = sext i32 %42 to i64
%70 = getelementptr inbounds i8, i8* %7, i64 %69
store i8 27, i8* %70
%71 = add nsw i32 %42, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %7, i64 %72
store i8 41, i8* %73
%74 = add nsw i32 %43, 1
br label %113
75: ; preds = %40
%76 = sext i32 %42 to i64
%77 = getelementptr inbounds i8, i8* %7, i64 %76
store i8 27, i8* %77
%78 = add nsw i32 %42, 1
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %7, i64 %79
store i8 47, i8* %80
%81 = add nsw i32 %43, 1
br label %113
82: ; preds = %40
%83 = sext i32 %42 to i64
%84 = getelementptr inbounds i8, i8* %7, i64 %83
store i8 27, i8* %84
%85 = add nsw i32 %42, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %7, i64 %86
store i8 60, i8* %87
%88 = add nsw i32 %43, 1
br label %113
89: ; preds = %40
%90 = sext i32 %42 to i64
%91 = getelementptr inbounds i8, i8* %7, i64 %90
store i8 27, i8* %91
%92 = add nsw i32 %42, 1
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8, i8* %7, i64 %93
store i8 61, i8* %94
%95 = add nsw i32 %43, 1
br label %113
96: ; preds = %40
%97 = sext i32 %42 to i64
%98 = getelementptr inbounds i8, i8* %7, i64 %97
store i8 27, i8* %98
%99 = add nsw i32 %42, 1
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %7, i64 %100
store i8 62, i8* %101
%102 = add nsw i32 %43, 1
br label %113
103: ; preds = %40
%104 = sext i32 %42 to i64
%105 = getelementptr inbounds i8, i8* %7, i64 %104
store i8 27, i8* %105
%106 = add nsw i32 %42, 1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %7, i64 %107
store i8 64, i8* %108
%109 = add nsw i32 %43, 1
br label %113
110: ; preds = %40
%111 = sext i32 %42 to i64
%112 = getelementptr inbounds i8, i8* %7, i64 %111
store i8 %45, i8* %112
br label %113
113: ; preds = %110, %103, %96, %89, %82, %75, %68, %61, %54, %47
%114 = phi i32 [ %43, %110 ], [ %109, %103 ], [ %102, %96 ], [ %95, %89 ], [ %88, %82 ], [ %81, %75 ], [ %74, %68 ], [ %67, %61 ], [ %60, %54 ], [ %53, %47 ]
%115 = phi i32 [ %42, %110 ], [ %106, %103 ], [ %99, %96 ], [ %92, %89 ], [ %85, %82 ], [ %78, %75 ], [ %71, %68 ], [ %64, %61 ], [ %57, %54 ], [ %50, %47 ]
%116 = load i8, i8* %44
%117 = sext i8 %116 to i32
br label %118
118: ; preds = %147, %113
%119 = phi i64 [ 0, %113 ], [ %148, %147 ]
%120 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %119
%121 = load i8, i8* %120
%122 = zext i8 %121 to i32
%123 = icmp eq i32 %117, %122
br i1 %123, label %124, label %129
124: ; preds = %141, %135, %129, %118
%125 = phi i64 [ %119, %118 ], [ %130, %129 ], [ %136, %135 ], [ %142, %141 ]
%126 = trunc i64 %125 to i8
%127 = sext i32 %115 to i64
%128 = getelementptr inbounds i8, i8* %7, i64 %127
store i8 %126, i8* %128
br label %150
129: ; preds = %118
%130 = or i64 %119, 1
%131 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %130
%132 = load i8, i8* %131
%133 = zext i8 %132 to i32
%134 = icmp eq i32 %117, %133
br i1 %134, label %124, label %135
135: ; preds = %129
%136 = or i64 %119, 2
%137 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %136
%138 = load i8, i8* %137
%139 = zext i8 %138 to i32
%140 = icmp eq i32 %117, %139
br i1 %140, label %124, label %141
141: ; preds = %135
%142 = or i64 %119, 3
%143 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 %142
%144 = load i8, i8* %143
%145 = zext i8 %144 to i32
%146 = icmp eq i32 %117, %145
br i1 %146, label %124, label %147
147: ; preds = %141
%148 = add nuw nsw i64 %119, 4
%149 = icmp eq i64 %148, 128
br i1 %149, label %150, label %118
150: ; preds = %147, %124
%151 = add nuw nsw i64 %41, 1
%152 = add nsw i32 %115, 1
%153 = icmp eq i64 %151, %32
br i1 %153, label %33, label %40
154: ; preds = %176, %38
%155 = phi i8* [ %7, %38 ], [ %195, %176 ]
%156 = phi i8* [ %1, %38 ], [ %193, %176 ]
%157 = phi i32 [ 0, %38 ], [ %196, %176 ]
%158 = phi i8 [ undef, %38 ], [ %192, %176 ]
%159 = phi i32 [ 0, %38 ], [ %194, %176 ]
%160 = phi i32 [ 0, %38 ], [ %197, %176 ]
%161 = and i32 %157, 6
%162 = icmp eq i32 %161, 0
%163 = load i8, i8* %155
br i1 %162, label %176, label %164
164: ; preds = %154
%165 = zext i8 %163 to i32
%166 = sub nuw nsw i32 8, %161
%167 = shl nuw nsw i32 %165, %166
%168 = trunc i32 %167 to i8
%169 = or i8 %158, %168
store i8 %169, i8* %156
%170 = load i8, i8* %155
%171 = zext i8 %170 to i32
%172 = lshr i32 %171, %161
%173 = trunc i32 %172 to i8
%174 = getelementptr inbounds i8, i8* %156, i64 1
%175 = add nsw i32 %159, 1
br label %176
176: ; preds = %154, %164
%177 = phi i32 [ %175, %164 ], [ %159, %154 ]
%178 = phi i8 [ %173, %164 ], [ %163, %154 ]
%179 = phi i8* [ %174, %164 ], [ %156, %154 ]
%180 = getelementptr inbounds i8, i8* %155, i64 1
%181 = and i32 %157, 6
%182 = or i32 %181, 1
%183 = load i8, i8* %180
%184 = zext i8 %183 to i32
%185 = sub nuw nsw i32 8, %182
%186 = shl nuw nsw i32 %184, %185
%187 = trunc i32 %186 to i8
%188 = or i8 %178, %187
store i8 %188, i8* %179
%189 = load i8, i8* %180
%190 = zext i8 %189 to i32
%191 = lshr i32 %190, %182
%192 = trunc i32 %191 to i8
%193 = getelementptr inbounds i8, i8* %179, i64 1
%194 = add nsw i32 %177, 1
%195 = getelementptr inbounds i8, i8* %155, i64 2
%196 = add nuw nsw i32 %157, 2
%197 = add i32 %160, 2
%198 = icmp eq i32 %197, %39
br i1 %198, label %199, label %154
199: ; preds = %176
%200 = and i32 %196, 6
br label %201
201: ; preds = %199, %35
%202 = phi i32 [ undef, %35 ], [ %194, %199 ]
%203 = phi i8* [ %7, %35 ], [ %195, %199 ]
%204 = phi i8* [ %1, %35 ], [ %193, %199 ]
%205 = phi i32 [ 0, %35 ], [ %200, %199 ]
%206 = phi i8 [ undef, %35 ], [ %192, %199 ]
%207 = phi i32 [ 0, %35 ], [ %194, %199 ]
%208 = icmp eq i32 %36, 0
br i1 %208, label %219, label %209
209: ; preds = %201
%210 = icmp eq i32 %205, 0
br i1 %210, label %219, label %211
211: ; preds = %209
%212 = load i8, i8* %203
%213 = zext i8 %212 to i32
%214 = sub nuw nsw i32 8, %205
%215 = shl nuw nsw i32 %213, %214
%216 = trunc i32 %215 to i8
%217 = or i8 %206, %216
store i8 %217, i8* %204
%218 = add nsw i32 %207, 1
br label %219
219: ; preds = %201, %211, %209, %4, %33
%220 = phi i32 [ %114, %33 ], [ %2, %4 ], [ %114, %209 ], [ %114, %211 ], [ %114, %201 ]
%221 = phi i32 [ 0, %33 ], [ 0, %4 ], [ %202, %201 ], [ %218, %211 ], [ %207, %209 ]
%222 = tail call i32 @free(i8* %7)
%223 = trunc i32 %220 to i8
%224 = add i8 %223, -1
store i8 %224, i8* %3
ret i32 %221
}