#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 posn(char *, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ qr_diran(char *, int, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int micro_qr_intermediate(char binary[], int jisdata[], char mode[], int length,
                          int *kanji_used, int *alphanum_used, int *byte_used) {
  int position = 0, debug = 0;
  int short_data_block_length, i;
  char data_block;
  char buffer[2];
  strcpy(binary, "");
  if (debug) {
    for (i = 0; i < length; i++) {
      printf("%c", mode[i]);
    }
    printf("\n");
  }
  do {
    if (strlen(binary) > 128) {
      return 5;
    }
    data_block = mode[position];
    short_data_block_length = 0;
    do {
      short_data_block_length++;
    } while (((short_data_block_length + position) < length) &&
             (mode[position + short_data_block_length] == data_block));
    switch (data_block) {
    case 'K':
      strcat(binary, "K");
      *kanji_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Kanji block (length %d)\n\t", short_data_block_length);
      }
      for (i = 0; i < short_data_block_length; i++) {
        int jis = jisdata[position + i];
        int msb, lsb, prod;
        if (jis > 0x9fff) {
          jis -= 0xc140;
        }
        msb = (jis & 0xff00) >> 4;
        lsb = (jis & 0xff);
        prod = (msb * 0xc0) + lsb;
        qr_diran(binary, prod, 0x1000);
        if (debug) {
          printf("0x%4X ", prod);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
      }
      if (debug) {
        printf("\n");
      }
      break;
    case 'B':
      strcat(binary, "B");
      *byte_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Byte block (length %d)\n\t", short_data_block_length);
      }
      for (i = 0; i < short_data_block_length; i++) {
        int byte = jisdata[position + i];
        qr_diran(binary, byte, 0x80);
        if (debug) {
          printf("0x%4X ", byte);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
      }
      if (debug) {
        printf("\n");
      }
      break;
    case 'A':
      strcat(binary, "A");
      *alphanum_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Alpha block (length %d)\n\t", short_data_block_length);
      }
      i = 0;
      while (i < short_data_block_length) {
        int count;
        int first = 0, second = 0, prod;
        first = posn("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",
                     (char)jisdata[position + i]);
        count = 1;
        prod = first;
        if (i + 1 < short_data_block_length && mode[position + i + 1] == 'A') {
          second = posn("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",
                        (char)jisdata[position + i + 1]);
          count = 2;
          prod = (first * 45) + second;
        }
        qr_diran(binary, prod, 1 << (5 * count));
        if (debug) {
          printf("0x%4X ", prod);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
        i += 2;
      };
      if (debug) {
        printf("\n");
      }
      break;
    case 'N':
      strcat(binary, "N");
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      strcat(binary, buffer);
      if (debug) {
        printf("Number block (length %d)\n\t", short_data_block_length);
      }
      i = 0;
      while (i < short_data_block_length) {
        int count;
        int first = 0, second = 0, third = 0, prod;
        first = posn("0123456789", (char)jisdata[position + i]);
        count = 1;
        prod = first;
        if (i + 1 < short_data_block_length && mode[position + i + 1] == 'N') {
          second = posn("0123456789", (char)jisdata[position + i + 1]);
          count = 2;
          prod = (prod * 10) + second;
        }
        if (i + 2 < short_data_block_length && mode[position + i + 2] == 'N') {
          third = posn("0123456789", (char)jisdata[position + i + 2]);
          count = 3;
          prod = (prod * 10) + third;
        }
        qr_diran(binary, prod, 1 << (3 * count));
        if (debug) {
          printf("0x%4X (%d)", prod, prod);
        }
        if (strlen(binary) > 128) {
          return 5;
        }
        i += 3;
      };
      if (debug) {
        printf("\n");
      }
      break;
    }
    position += short_data_block_length;
  } while (position < length - 1);
  return 0;
}


x86 assembly (clang, -O0):
<micro_qr_intermediate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xef7(%rip),%rsi
call   1030 <strcpy@plt>
cmpl   $0x0,-0x40(%rbp)
je     11f7 <micro_qr_intermediate+0x97>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11e9 <micro_qr_intermediate+0x89>
mov    -0x20(%rbp),%rax
movslq -0x48(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11b5 <micro_qr_intermediate+0x55>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11fc <micro_qr_intermediate+0x9c>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jle    121c <micro_qr_intermediate+0xbc>
movl   $0x5,-0x4(%rbp)
jmp    185a <micro_qr_intermediate+0x6fa>
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x49(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%ecx
add    -0x3c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x24(%rbp),%ecx
mov    %al,-0x85(%rbp)
jge    1271 <micro_qr_intermediate+0x111>
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x44(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x49(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x85(%rbp)
mov    -0x85(%rbp),%al
test   $0x1,%al
jne    1231 <micro_qr_intermediate+0xd1>
movsbl -0x49(%rbp),%eax
add    $0xffffffbf,%eax
mov    %eax,%ecx
mov    %rcx,-0x90(%rbp)
sub    $0xd,%eax
ja     1839 <micro_qr_intermediate+0x6d9>
mov    -0x90(%rbp),%rax
lea    0xd5a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
lea    0xd83(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x30(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x44(%rbp),%eax
mov    %al,-0x4b(%rbp)
movb   $0x0,-0x4a(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4b(%rbp),%rsi
call   1080 <strcat@plt>
cmpl   $0x0,-0x40(%rbp)
je     12fb <micro_qr_intermediate+0x19b>
mov    -0x44(%rbp),%esi
lea    0xd4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    13be <micro_qr_intermediate+0x25e>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x50(%rbp)
cmpl   $0x9fff,-0x50(%rbp)
jle    1339 <micro_qr_intermediate+0x1d9>
mov    -0x50(%rbp),%eax
sub    $0xc140,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
and    $0xff00,%eax
sar    $0x4,%eax
mov    %eax,-0x54(%rbp)
mov    -0x50(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x58(%rbp)
imul   $0xc0,-0x54(%rbp),%eax
add    -0x58(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x5c(%rbp),%esi
mov    $0x1000,%edx
call   1070 <qr_diran@plt>
cmpl   $0x0,-0x40(%rbp)
je     138b <micro_qr_intermediate+0x22b>
mov    -0x5c(%rbp),%esi
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jle    13ab <micro_qr_intermediate+0x24b>
movl   $0x5,-0x4(%rbp)
jmp    185a <micro_qr_intermediate+0x6fa>
jmp    13b0 <micro_qr_intermediate+0x250>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1302 <micro_qr_intermediate+0x1a2>
cmpl   $0x0,-0x40(%rbp)
je     13d6 <micro_qr_intermediate+0x276>
lea    0xc6c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1839 <micro_qr_intermediate+0x6d9>
mov    -0x10(%rbp),%rdi
lea    0xc7a(%rip),%rsi
call   1080 <strcat@plt>
mov    0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x44(%rbp),%eax
mov    %al,-0x4b(%rbp)
movb   $0x0,-0x4a(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4b(%rbp),%rsi
call   1080 <strcat@plt>
cmpl   $0x0,-0x40(%rbp)
je     1427 <micro_qr_intermediate+0x2c7>
mov    -0x44(%rbp),%esi
lea    0xc42(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    14ac <micro_qr_intermediate+0x34c>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x60(%rbp),%esi
mov    $0x80,%edx
call   1070 <qr_diran@plt>
cmpl   $0x0,-0x40(%rbp)
je     1479 <micro_qr_intermediate+0x319>
mov    -0x60(%rbp),%esi
lea    0xbe7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jle    1499 <micro_qr_intermediate+0x339>
movl   $0x5,-0x4(%rbp)
jmp    185a <micro_qr_intermediate+0x6fa>
jmp    149e <micro_qr_intermediate+0x33e>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    142e <micro_qr_intermediate+0x2ce>
cmpl   $0x0,-0x40(%rbp)
je     14c4 <micro_qr_intermediate+0x364>
lea    0xb7e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1839 <micro_qr_intermediate+0x6d9>
mov    -0x10(%rbp),%rdi
lea    0xba7(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x38(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x44(%rbp),%eax
mov    %al,-0x4b(%rbp)
movb   $0x0,-0x4a(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4b(%rbp),%rsi
call   1080 <strcat@plt>
cmpl   $0x0,-0x40(%rbp)
je     1515 <micro_qr_intermediate+0x3b5>
mov    -0x44(%rbp),%esi
lea    0xb6f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    1627 <micro_qr_intermediate+0x4c7>
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0xb4a(%rip),%rdi
movsbl %al,%esi
call   1060 <posn@plt>
mov    %eax,-0x68(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
cmp    -0x44(%rbp),%eax
jge    15c7 <micro_qr_intermediate+0x467>
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x41,%eax
jne    15c7 <micro_qr_intermediate+0x467>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0xaec(%rip),%rdi
movsbl %al,%esi
call   1060 <posn@plt>
mov    %eax,-0x6c(%rbp)
movl   $0x2,-0x64(%rbp)
imul   $0x2d,-0x68(%rbp),%eax
add    -0x6c(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x70(%rbp),%esi
imul   $0x5,-0x64(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1070 <qr_diran@plt>
cmpl   $0x0,-0x40(%rbp)
je     15f9 <micro_qr_intermediate+0x499>
mov    -0x70(%rbp),%esi
lea    0xa67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jle    1619 <micro_qr_intermediate+0x4b9>
movl   $0x5,-0x4(%rbp)
jmp    185a <micro_qr_intermediate+0x6fa>
mov    -0x48(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x48(%rbp)
jmp    151c <micro_qr_intermediate+0x3bc>
cmpl   $0x0,-0x40(%rbp)
je     163f <micro_qr_intermediate+0x4df>
lea    0xa03(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1839 <micro_qr_intermediate+0x6d9>
mov    -0x10(%rbp),%rdi
lea    0xa76(%rip),%rsi
call   1080 <strcat@plt>
mov    -0x44(%rbp),%eax
mov    %al,-0x4b(%rbp)
movb   $0x0,-0x4a(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4b(%rbp),%rsi
call   1080 <strcat@plt>
cmpl   $0x0,-0x40(%rbp)
je     1686 <micro_qr_intermediate+0x526>
mov    -0x44(%rbp),%esi
lea    0xa48(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    181c <micro_qr_intermediate+0x6bc>
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0xa1d(%rip),%rdi
movsbl %al,%esi
call   1060 <posn@plt>
mov    %eax,-0x78(%rbp)
movl   $0x1,-0x74(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
cmp    -0x44(%rbp),%eax
jge    1748 <micro_qr_intermediate+0x5e8>
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4e,%eax
jne    1748 <micro_qr_intermediate+0x5e8>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0x9bc(%rip),%rdi
movsbl %al,%esi
call   1060 <posn@plt>
mov    %eax,-0x7c(%rbp)
movl   $0x2,-0x74(%rbp)
imul   $0xa,-0x84(%rbp),%eax
add    -0x7c(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x48(%rbp),%eax
add    $0x2,%eax
cmp    -0x44(%rbp),%eax
jge    17b0 <micro_qr_intermediate+0x650>
mov    -0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4e,%eax
jne    17b0 <micro_qr_intermediate+0x650>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0x954(%rip),%rdi
movsbl %al,%esi
call   1060 <posn@plt>
mov    %eax,-0x80(%rbp)
movl   $0x3,-0x74(%rbp)
imul   $0xa,-0x84(%rbp),%eax
add    -0x80(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x84(%rbp),%esi
imul   $0x3,-0x74(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
call   1070 <qr_diran@plt>
cmpl   $0x0,-0x40(%rbp)
je     17ee <micro_qr_intermediate+0x68e>
mov    -0x84(%rbp),%esi
mov    -0x84(%rbp),%edx
lea    0x906(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jle    180e <micro_qr_intermediate+0x6ae>
movl   $0x5,-0x4(%rbp)
jmp    185a <micro_qr_intermediate+0x6fa>
mov    -0x48(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x48(%rbp)
jmp    168d <micro_qr_intermediate+0x52d>
cmpl   $0x0,-0x40(%rbp)
je     1834 <micro_qr_intermediate+0x6d4>
lea    0x80e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1839 <micro_qr_intermediate+0x6d9>
mov    -0x44(%rbp),%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jl     11fc <micro_qr_intermediate+0x9c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<micro_qr_intermediate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,0x50(%rsp)
mov    %r8,0x48(%rsp)
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0xefd(%rip),%rsi
call   1030 <strcpy@plt>
mov    %r14,0x60(%rsp)
lea    -0x1(%r14),%eax
mov    %eax,0x14(%rsp)
lea    0x1(%rbp),%rax
mov    %rax,0x28(%rsp)
lea    0x8(%rbx),%rax
mov    %rax,0x40(%rsp)
mov    %rbp,0x58(%rsp)
lea    0x2(%rbp),%rax
mov    %rax,0x38(%rsp)
mov    %r15,%rbp
mov    %rbx,0x18(%rsp)
lea    0x4(%rbx),%rax
mov    %rax,0x30(%rsp)
xor    %r15d,%r15d
jmp    11e0 <micro_qr_intermediate+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x20(%rsp),%r15
cmp    0x14(%rsp),%r15d
jge    15af <micro_qr_intermediate+0x45f>
mov    %rbp,%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jg     15a5 <micro_qr_intermediate+0x455>
mov    %rbp,%r8
mov    %r15d,%r14d
mov    0x58(%rsp),%rax
movsbl (%rax,%r14,1),%eax
lea    0x1(%r15),%ecx
mov    0x60(%rsp),%rdx
cmp    %ecx,%edx
cmovg  %edx,%ecx
not    %r15d
add    %ecx,%r15d
neg    %r15
mov    $0x1,%edi
mov    0x28(%rsp),%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
mov    %rsi,%r13
mov    %edi,%ebx
cmp    %rsi,%r15
je     1260 <micro_qr_intermediate+0x110>
lea    -0x1(%r13),%rsi
lea    0x1(%rdx),%rbp
lea    0x1(%rbx),%edi
cmp    %al,(%rdx,%r14,1)
mov    %rbp,%rdx
je     1230 <micro_qr_intermediate+0xe0>
movl   $0x5,0x4(%rsp)
mov    %r14d,%ecx
sub    %esi,%ecx
jmp    1268 <micro_qr_intermediate+0x118>
nopl   (%rax)
movl   $0x5,0x4(%rsp)
mov    %rcx,0x20(%rsp)
mov    %r8,%rbp
add    $0xffffffbf,%eax
cmp    $0xd,%eax
ja     11d0 <micro_qr_intermediate+0x80>
lea    0xd7d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %rbp,%rdi
lea    0xda6(%rip),%rsi
call   1070 <strcat@plt>
mov    0x50(%rsp),%rax
movl   $0x1,(%rax)
neg    %r13
lea    0x1(%r13),%eax
mov    %al,0x2(%rsp)
movb   $0x0,0x3(%rsp)
mov    %rbp,%rdi
lea    0x2(%rsp),%rsi
call   1070 <strcat@plt>
mov    0x30(%rsp),%rax
lea    (%rax,%r14,4),%r12
add    0x28(%rsp),%r14
xor    %r15d,%r15d
jmp    1315 <micro_qr_intermediate+0x1c5>
cs nopw 0x0(%rax,%rax,1)
movl   $0x5,0x4(%rsp)
mov    $0x5,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %rbp,%rdi
mov    %ebx,%esi
call   1060 <qr_diran@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
add    $0x2,%r15
cmp    $0x80,%eax
jg     15b7 <micro_qr_intermediate+0x467>
cmp    %r13,%r15
ja     11d0 <micro_qr_intermediate+0x80>
movsbl -0x4(%r12,%r15,4),%esi
lea    0xd13(%rip),%rdi
call   1050 <posn@plt>
mov    %eax,%ebx
cmp    %r13,%r15
jae    12e0 <micro_qr_intermediate+0x190>
movl   $0x5,0x4(%rsp)
cmpb   $0x41,(%r14,%r15,1)
mov    $0x5,%ecx
jne    12ed <micro_qr_intermediate+0x19d>
movsbl (%r12,%r15,4),%esi
lea    0xce7(%rip),%rdi
call   1050 <posn@plt>
lea    (%rbx,%rbx,8),%ecx
lea    (%rcx,%rcx,4),%ebx
add    %eax,%ebx
mov    $0xa,%ecx
jmp    12ed <micro_qr_intermediate+0x19d>
mov    %rbp,%rdi
lea    0xcc5(%rip),%rsi
call   1070 <strcat@plt>
mov    0xa0(%rsp),%rax
movl   $0x1,(%rax)
mov    $0x1,%al
sub    %r13b,%al
mov    %al,0x2(%rsp)
movb   $0x0,0x3(%rsp)
mov    %rbp,%rdi
lea    0x2(%rsp),%rsi
call   1070 <strcat@plt>
mov    0x18(%rsp),%rax
lea    (%rax,%r14,4),%r14
mov    %ebx,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%esi
mov    %rbp,%rdi
mov    $0x80,%edx
call   1060 <qr_diran@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jg     15b7 <micro_qr_intermediate+0x467>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    13c0 <micro_qr_intermediate+0x270>
jmp    11d0 <micro_qr_intermediate+0x80>
mov    %rbp,%rdi
lea    0xc3c(%rip),%rsi
call   1070 <strcat@plt>
mov    0x48(%rsp),%rax
movl   $0x1,(%rax)
mov    $0x1,%al
sub    %r13b,%al
mov    %al,0x2(%rsp)
movb   $0x0,0x3(%rsp)
mov    %rbp,%rdi
lea    0x2(%rsp),%rsi
call   1070 <strcat@plt>
mov    0x18(%rsp),%rax
lea    (%rax,%r14,4),%r14
mov    %ebx,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,4),%eax
lea    -0xc140(%rax),%ecx
cmp    $0xa000,%eax
cmovl  %eax,%ecx
movzbl %cl,%eax
shl    $0x2,%ecx
and    $0x3fc00,%ecx
lea    (%rcx,%rcx,2),%esi
or     %eax,%esi
mov    %rbp,%rdi
mov    $0x1000,%edx
call   1060 <qr_diran@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jg     15b7 <micro_qr_intermediate+0x467>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1440 <micro_qr_intermediate+0x2f0>
jmp    11d0 <micro_qr_intermediate+0x80>
mov    %rbp,%rdi
lea    0xbd1(%rip),%rsi
call   1070 <strcat@plt>
neg    %r13
lea    0x1(%r13),%eax
mov    %al,0x2(%rsp)
movb   $0x0,0x3(%rsp)
mov    %rbp,%rdi
lea    0x2(%rsp),%rsi
call   1070 <strcat@plt>
mov    0x40(%rsp),%rax
lea    (%rax,%r14,4),%rax
mov    %rax,0x8(%rsp)
add    0x38(%rsp),%r14
xor    %ebx,%ebx
jmp    150f <micro_qr_intermediate+0x3bf>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    (%rax,%rax,2),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %rbp,%rdi
mov    %r15d,%esi
call   1060 <qr_diran@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
add    $0x1,%r12
mov    %r12,%rbx
cmp    $0x80,%eax
jg     15b7 <micro_qr_intermediate+0x467>
cmp    %r13,%rbx
ja     11d0 <micro_qr_intermediate+0x80>
mov    0x8(%rsp),%rax
movsbl -0x8(%rax,%rbx,4),%esi
lea    0xb45(%rip),%rdi
call   1050 <posn@plt>
mov    %eax,%r15d
mov    $0x1,%eax
cmp    %r13,%rbx
jae    1566 <micro_qr_intermediate+0x416>
cmpb   $0x4e,-0x1(%r14,%rbx,1)
jne    1566 <micro_qr_intermediate+0x416>
mov    0x8(%rsp),%rax
movsbl -0x4(%rax,%rbx,4),%esi
lea    0xb1a(%rip),%rdi
call   1050 <posn@plt>
lea    (%r15,%r15,4),%ecx
lea    (%rax,%rcx,2),%r15d
mov    $0x2,%eax
lea    0x2(%rbx),%r12
cmp    %r13,%r12
ja     14e0 <micro_qr_intermediate+0x390>
cmpb   $0x4e,(%r14,%rbx,1)
jne    14e0 <micro_qr_intermediate+0x390>
mov    0x8(%rsp),%rax
movsbl (%rax,%rbx,4),%esi
lea    0xae0(%rip),%rdi
call   1050 <posn@plt>
lea    (%r15,%r15,4),%ecx
lea    (%rax,%rcx,2),%r15d
mov    $0x3,%eax
jmp    14e0 <micro_qr_intermediate+0x390>
movl   $0x5,0x4(%rsp)
jmp    15b7 <micro_qr_intermediate+0x467>
movl   $0x0,0x4(%rsp)
mov    0x4(%rsp),%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.3 = [2 x i8] c"K\00"
@.str.6 = [2 x i8] c"B\00"
@.str.8 = [2 x i8] c"A\00"
@.str.10 = [46 x i8] c"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\00"
@.str.11 = [2 x i8] c"N\00"
@.str.13 = [11 x i8] c"0123456789\00"
define i32 @micro_qr_intermediate(i8* %0, i32* nocapture %1, i8* nocapture %2, i32 %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6) {
%8 = alloca [2 x i8]
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 0
%10 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %8, i64 0, i64 1
%12 = add nsw i32 %3, -1
br label %13
13: ; preds = %170, %7
%14 = phi i32 [ 0, %7 ], [ %38, %170 ]
%15 = call i32 @strlen(i8* %0)
%16 = icmp sgt i32 %15, 128
br i1 %16, label %172, label %17
17: ; preds = %13
%18 = zext i32 %14 to i64
%19 = getelementptr inbounds i8, i8* %2, i64 %18
%20 = load i8, i8* %19
%21 = add nsw i32 %14, 1
%22 = call i32 @llvm.smax.i32(i32 %3, i32 %21)
%23 = xor i32 %14, -1
%24 = add i32 %22, %23
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %31, %17
%27 = phi i64 [ %28, %31 ], [ 0, %17 ]
%28 = add nuw nsw i64 %27, 1
%29 = add nuw nsw i64 %28, %18
%30 = icmp eq i64 %27, %25
br i1 %30, label %37, label %31
31: ; preds = %26
%32 = getelementptr inbounds i8, i8* %2, i64 %29
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, %20
br i1 %34, label %26, label %35
35: ; preds = %31
%36 = trunc i64 %29 to i32
br label %37
37: ; preds = %26, %35
%38 = phi i32 [ %36, %35 ], [ %22, %26 ]
%39 = sext i8 %20 to i32
switch i32 %39, label %170 [
i32 75, label %40
i32 66, label %65
i32 65, label %82
i32 78, label %117
]
40: ; preds = %37
%41 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %4
%42 = trunc i64 %28 to i8
store i8 %42, i8* %9
store i8 0, i8* %11
%43 = call i32 @strcat(i8* %0, i8* %9)
%44 = add nuw i64 %27, 1
%45 = and i64 %44, 4294967295
br label %49
46: ; preds = %49
%47 = add nuw nsw i64 %50, 1
%48 = icmp eq i64 %47, %45
br i1 %48, label %170, label %49
49: ; preds = %40, %46
%50 = phi i64 [ 0, %40 ], [ %47, %46 ]
%51 = add nuw nsw i64 %50, %18
%52 = getelementptr inbounds i32, i32* %1, i64 %51
%53 = load i32, i32* %52
%54 = icmp sgt i32 %53, 40959
%55 = add nsw i32 %53, -49472
%56 = select i1 %54, i32 %55, i32 %53
%57 = lshr i32 %56, 4
%58 = and i32 %57, 4080
%59 = and i32 %56, 255
%60 = mul nuw nsw i32 %58, 192
%61 = or i32 %60, %59
%62 = call i32 @qr_diran(i8* %0, i32 %61, i32 4096)
%63 = call i32 @strlen(i8* %0)
%64 = icmp sgt i32 %63, 128
br i1 %64, label %172, label %46
65: ; preds = %37
%66 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %6
%67 = trunc i64 %28 to i8
store i8 %67, i8* %9
store i8 0, i8* %11
%68 = call i32 @strcat(i8* %0, i8* %9)
%69 = add nuw i64 %27, 1
%70 = and i64 %69, 4294967295
br label %74
71: ; preds = %74
%72 = add nuw nsw i64 %75, 1
%73 = icmp eq i64 %72, %70
br i1 %73, label %170, label %74
74: ; preds = %65, %71
%75 = phi i64 [ 0, %65 ], [ %72, %71 ]
%76 = add nuw nsw i64 %75, %18
%77 = getelementptr inbounds i32, i32* %1, i64 %76
%78 = load i32, i32* %77
%79 = call i32 @qr_diran(i8* %0, i32 %78, i32 128)
%80 = call i32 @strlen(i8* %0)
%81 = icmp sgt i32 %80, 128
br i1 %81, label %172, label %71
82: ; preds = %37
%83 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
store i32 1, i32* %5
%84 = trunc i64 %28 to i8
store i8 %84, i8* %9
store i8 0, i8* %11
%85 = call i32 @strcat(i8* %0, i8* %9)
%86 = and i64 %27, 4294967295
br label %87
87: ; preds = %109, %82
%88 = phi i64 [ %116, %109 ], [ 0, %82 ]
%89 = icmp ugt i64 %88, %86
br i1 %89, label %170, label %90
90: ; preds = %87
%91 = add nuw nsw i64 %88, %18
%92 = getelementptr inbounds i32, i32* %1, i64 %91
%93 = load i32, i32* %92
%94 = trunc i32 %93 to i8
%95 = call i32 @posn(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i8 signext %94)
%96 = icmp ult i64 %88, %86
br i1 %96, label %97, label %109
97: ; preds = %90
%98 = add nuw nsw i64 %91, 1
%99 = getelementptr inbounds i8, i8* %2, i64 %98
%100 = load i8, i8* %99
%101 = icmp eq i8 %100, 65
br i1 %101, label %102, label %109
102: ; preds = %97
%103 = getelementptr inbounds i32, i32* %1, i64 %98
%104 = load i32, i32* %103
%105 = trunc i32 %104 to i8
%106 = call i32 @posn(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i8 signext %105)
%107 = mul nsw i32 %95, 45
%108 = add nsw i32 %106, %107
br label %109
109: ; preds = %102, %97, %90
%110 = phi i32 [ 10, %102 ], [ 5, %97 ], [ 5, %90 ]
%111 = phi i32 [ %108, %102 ], [ %95, %97 ], [ %95, %90 ]
%112 = shl nuw nsw i32 1, %110
%113 = call i32 @qr_diran(i8* %0, i32 %111, i32 %112)
%114 = call i32 @strlen(i8* %0)
%115 = icmp sgt i32 %114, 128
%116 = add nuw nsw i64 %88, 2
br i1 %115, label %172, label %87
117: ; preds = %37
%118 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%119 = trunc i64 %28 to i8
store i8 %119, i8* %9
store i8 0, i8* %11
%120 = call i32 @strcat(i8* %0, i8* %9)
%121 = and i64 %27, 4294967295
br label %122
122: ; preds = %161, %117
%123 = phi i64 [ %169, %161 ], [ 0, %117 ]
%124 = icmp ugt i64 %123, %121
br i1 %124, label %170, label %125
125: ; preds = %122
%126 = add nuw nsw i64 %123, %18
%127 = getelementptr inbounds i32, i32* %1, i64 %126
%128 = load i32, i32* %127
%129 = trunc i32 %128 to i8
%130 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %129)
%131 = icmp ult i64 %123, %121
br i1 %131, label %132, label %144
132: ; preds = %125
%133 = add nuw nsw i64 %126, 1
%134 = getelementptr inbounds i8, i8* %2, i64 %133
%135 = load i8, i8* %134
%136 = icmp eq i8 %135, 78
br i1 %136, label %137, label %144
137: ; preds = %132
%138 = getelementptr inbounds i32, i32* %1, i64 %133
%139 = load i32, i32* %138
%140 = trunc i32 %139 to i8
%141 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %140)
%142 = mul nsw i32 %130, 10
%143 = add nsw i32 %141, %142
br label %144
144: ; preds = %137, %132, %125
%145 = phi i32 [ 2, %137 ], [ 1, %132 ], [ 1, %125 ]
%146 = phi i32 [ %143, %137 ], [ %130, %132 ], [ %130, %125 ]
%147 = add nuw nsw i64 %123, 2
%148 = icmp ugt i64 %147, %121
br i1 %148, label %161, label %149
149: ; preds = %144
%150 = add nuw nsw i64 %126, 2
%151 = getelementptr inbounds i8, i8* %2, i64 %150
%152 = load i8, i8* %151
%153 = icmp eq i8 %152, 78
br i1 %153, label %154, label %161
154: ; preds = %149
%155 = getelementptr inbounds i32, i32* %1, i64 %150
%156 = load i32, i32* %155
%157 = trunc i32 %156 to i8
%158 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %157)
%159 = mul nsw i32 %146, 10
%160 = add nsw i32 %158, %159
br label %161
161: ; preds = %154, %149, %144
%162 = phi i32 [ 3, %154 ], [ %145, %149 ], [ %145, %144 ]
%163 = phi i32 [ %160, %154 ], [ %146, %149 ], [ %146, %144 ]
%164 = mul nuw nsw i32 %162, 3
%165 = shl nuw nsw i32 1, %164
%166 = call i32 @qr_diran(i8* %0, i32 %163, i32 %165)
%167 = call i32 @strlen(i8* %0)
%168 = icmp sgt i32 %167, 128
%169 = add nuw nsw i64 %123, 3
br i1 %168, label %172, label %122
170: ; preds = %122, %87, %71, %46, %37
%171 = icmp slt i32 %38, %12
br i1 %171, label %13, label %172
172: ; preds = %170, %13, %161, %109, %74, %49
%173 = phi i32 [ 5, %49 ], [ 5, %74 ], [ 5, %109 ], [ 5, %161 ], [ 0, %170 ], [ 5, %13 ]
ret i32 %173
}