#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*/ concat(char *, char *);
int posn(char *, char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ qr_diran(char *, int, int);
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':
      concat(binary, "K");
      *kanji_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      concat(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':
      concat(binary, "B");
      *byte_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      concat(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':
      concat(binary, "A");
      *alphanum_used = 1;
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      concat(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 (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':
      concat(binary, "N");
      buffer[0] = short_data_block_length;
      buffer[1] = '\0';
      concat(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 (mode[position + i + 1] == 'N') {
          second = posn("0123456789", (char)jisdata[position + i + 1]);
          count = 2;
          prod = (prod * 10) + second;
        }
        if (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    182d <micro_qr_intermediate+0x6cd>
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     180c <micro_qr_intermediate+0x6ac>
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   1060 <concat@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   1060 <concat@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   1080 <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    182d <micro_qr_intermediate+0x6cd>
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    180c <micro_qr_intermediate+0x6ac>
mov    -0x10(%rbp),%rdi
lea    0xc7a(%rip),%rsi
call   1060 <concat@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   1060 <concat@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   1080 <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    182d <micro_qr_intermediate+0x6cd>
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    180c <micro_qr_intermediate+0x6ac>
mov    -0x10(%rbp),%rdi
lea    0xba7(%rip),%rsi
call   1060 <concat@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   1060 <concat@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    1618 <micro_qr_intermediate+0x4b8>
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   1070 <posn@plt>
mov    %eax,-0x68(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x68(%rbp),%eax
mov    %eax,-0x70(%rbp)
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    15b8 <micro_qr_intermediate+0x458>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0xafb(%rip),%rdi
movsbl %al,%esi
call   1070 <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   1080 <qr_diran@plt>
cmpl   $0x0,-0x40(%rbp)
je     15ea <micro_qr_intermediate+0x48a>
mov    -0x70(%rbp),%esi
lea    0xa76(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jle    160a <micro_qr_intermediate+0x4aa>
movl   $0x5,-0x4(%rbp)
jmp    182d <micro_qr_intermediate+0x6cd>
mov    -0x48(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x48(%rbp)
jmp    151c <micro_qr_intermediate+0x3bc>
cmpl   $0x0,-0x40(%rbp)
je     1630 <micro_qr_intermediate+0x4d0>
lea    0xa12(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    180c <micro_qr_intermediate+0x6ac>
mov    -0x10(%rbp),%rdi
lea    0xa85(%rip),%rsi
call   1060 <concat@plt>
mov    -0x44(%rbp),%eax
mov    %al,-0x4b(%rbp)
movb   $0x0,-0x4a(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4b(%rbp),%rsi
call   1060 <concat@plt>
cmpl   $0x0,-0x40(%rbp)
je     1677 <micro_qr_intermediate+0x517>
mov    -0x44(%rbp),%esi
lea    0xa57(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    17ef <micro_qr_intermediate+0x68f>
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    0xa2c(%rip),%rdi
movsbl %al,%esi
call   1070 <posn@plt>
mov    %eax,-0x78(%rbp)
movl   $0x1,-0x74(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x84(%rbp)
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    172a <micro_qr_intermediate+0x5ca>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0x9da(%rip),%rdi
movsbl %al,%esi
call   1070 <posn@plt>
mov    %eax,-0x7c(%rbp)
movl   $0x2,-0x74(%rbp)
imul   $0xa,-0x84(%rbp),%eax
add    -0x7c(%rbp),%eax
mov    %eax,-0x84(%rbp)
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    1783 <micro_qr_intermediate+0x623>
mov    -0x18(%rbp),%rax
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
lea    0x981(%rip),%rdi
movsbl %al,%esi
call   1070 <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   1080 <qr_diran@plt>
cmpl   $0x0,-0x40(%rbp)
je     17c1 <micro_qr_intermediate+0x661>
mov    -0x84(%rbp),%esi
mov    -0x84(%rbp),%edx
lea    0x933(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jle    17e1 <micro_qr_intermediate+0x681>
movl   $0x5,-0x4(%rbp)
jmp    182d <micro_qr_intermediate+0x6cd>
mov    -0x48(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x48(%rbp)
jmp    167e <micro_qr_intermediate+0x51e>
cmpl   $0x0,-0x40(%rbp)
je     1807 <micro_qr_intermediate+0x6a7>
lea    0x83b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    180c <micro_qr_intermediate+0x6ac>
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    $0x78,%rsp
mov    %r9,0x60(%rsp)
mov    %r8,0x58(%rsp)
mov    %ecx,%r15d
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xefd(%rip),%rsi
call   1030 <strcpy@plt>
mov    %r15,0x70(%rsp)
lea    -0x1(%r15),%eax
mov    %eax,0xc(%rsp)
lea    0x1(%rbp),%rax
mov    %rax,0x20(%rsp)
lea    0x8(%rbx),%rax
mov    %rax,0x50(%rsp)
mov    %rbp,0x68(%rsp)
lea    0x2(%rbp),%rax
mov    %rax,0x48(%rsp)
mov    %rbx,0x10(%rsp)
lea    0x4(%rbx),%rax
mov    %rax,0x40(%rsp)
xor    %r12d,%r12d
jmp    11d0 <micro_qr_intermediate+0x80>
mov    0x18(%rsp),%r12
cmp    0xc(%rsp),%r12d
jge    157e <micro_qr_intermediate+0x42e>
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jg     1574 <micro_qr_intermediate+0x424>
mov    %r12d,%r15d
mov    0x68(%rsp),%rax
movsbl (%rax,%r15,1),%eax
lea    0x1(%r12),%ecx
mov    0x70(%rsp),%rdx
cmp    %ecx,%edx
cmovg  %edx,%ecx
not    %r12d
add    %ecx,%r12d
neg    %r12
mov    $0x1,%edi
mov    0x20(%rsp),%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rsi,%r13
mov    %edi,%ebx
cmp    %rsi,%r12
je     1250 <micro_qr_intermediate+0x100>
lea    -0x1(%r13),%rsi
lea    0x1(%rdx),%rbp
lea    0x1(%rbx),%edi
cmp    %al,(%rdx,%r15,1)
mov    %rbp,%rdx
je     1220 <micro_qr_intermediate+0xd0>
movl   $0x5,0x8(%rsp)
mov    %r15d,%ecx
sub    %esi,%ecx
jmp    1258 <micro_qr_intermediate+0x108>
nopl   (%rax)
movl   $0x5,0x8(%rsp)
mov    %rcx,0x18(%rsp)
add    $0xffffffbf,%eax
cmp    $0xd,%eax
ja     11c0 <micro_qr_intermediate+0x70>
lea    0xd90(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %r14,%rdi
lea    0xdb9(%rip),%rsi
call   1050 <concat@plt>
mov    0x60(%rsp),%rax
movl   $0x1,(%rax)
neg    %r13
lea    0x1(%r13),%eax
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
lea    0x6(%rsp),%rsi
call   1050 <concat@plt>
mov    0x40(%rsp),%rax
lea    (%rax,%r15,4),%rbp
add    0x20(%rsp),%r15
xor    %r12d,%r12d
jmp    12f8 <micro_qr_intermediate+0x1a8>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%edx
shl    %cl,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1070 <qr_diran@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
add    $0x2,%r12
cmp    $0x80,%eax
jg     1586 <micro_qr_intermediate+0x436>
cmp    %r13,%r12
ja     11c0 <micro_qr_intermediate+0x70>
movsbl -0x4(%rbp,%r12,4),%esi
lea    0xd30(%rip),%rdi
call   1060 <posn@plt>
mov    %eax,%ebx
movl   $0x5,0x8(%rsp)
cmpb   $0x41,(%r15,%r12,1)
mov    $0x5,%ecx
jne    12d0 <micro_qr_intermediate+0x180>
movsbl 0x0(%rbp,%r12,4),%esi
lea    0xd08(%rip),%rdi
call   1060 <posn@plt>
lea    (%rbx,%rbx,8),%ecx
lea    (%rcx,%rcx,4),%ebx
add    %eax,%ebx
mov    $0xa,%ecx
jmp    12d0 <micro_qr_intermediate+0x180>
mov    %r14,%rdi
lea    0xce6(%rip),%rsi
call   1050 <concat@plt>
mov    0xb0(%rsp),%rax
movl   $0x1,(%rax)
mov    $0x1,%al
sub    %r13b,%al
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
lea    0x6(%rsp),%rsi
call   1050 <concat@plt>
mov    0x10(%rsp),%rax
lea    (%rax,%r15,4),%r15
mov    %ebx,%r12d
xor    %ebx,%ebx
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
mov    $0x80,%edx
call   1070 <qr_diran@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jg     1586 <micro_qr_intermediate+0x436>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1390 <micro_qr_intermediate+0x240>
jmp    11c0 <micro_qr_intermediate+0x70>
mov    %r14,%rdi
lea    0xc6c(%rip),%rsi
call   1050 <concat@plt>
mov    0x58(%rsp),%rax
movl   $0x1,(%rax)
mov    $0x1,%al
sub    %r13b,%al
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
lea    0x6(%rsp),%rsi
call   1050 <concat@plt>
mov    0x10(%rsp),%rax
lea    (%rax,%r15,4),%r15
mov    %ebx,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%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    %r14,%rdi
mov    $0x1000,%edx
call   1070 <qr_diran@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    $0x80,%eax
jg     1586 <micro_qr_intermediate+0x436>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1410 <micro_qr_intermediate+0x2c0>
jmp    11c0 <micro_qr_intermediate+0x70>
mov    %r14,%rdi
lea    0xc01(%rip),%rsi
call   1050 <concat@plt>
neg    %r13
lea    0x1(%r13),%eax
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
mov    %r14,%rdi
lea    0x6(%rsp),%rsi
call   1050 <concat@plt>
mov    0x50(%rsp),%rax
lea    (%rax,%r15,4),%rbp
add    0x48(%rsp),%r15
xor    %ebx,%ebx
mov    %rbp,0x38(%rsp)
mov    %r14,0x30(%rsp)
mov    %r15,0x28(%rsp)
jmp    14ff <micro_qr_intermediate+0x3af>
xchg   %ax,%ax
mov    0x38(%rsp),%rbp
movsbl 0x0(%rbp,%rbx,4),%esi
lea    0xbad(%rip),%rdi
call   1060 <posn@plt>
lea    (%r12,%r12,4),%ecx
lea    (%rax,%rcx,2),%r12d
mov    $0x3,%eax
lea    (%rax,%rax,2),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %r14,%rdi
mov    %r12d,%esi
call   1070 <qr_diran@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
add    $0x3,%rbx
cmp    $0x80,%eax
jg     1586 <micro_qr_intermediate+0x436>
cmp    %r13,%rbx
ja     11c0 <micro_qr_intermediate+0x70>
movsbl -0x8(%rbp,%rbx,4),%esi
mov    %rbp,%r14
lea    0xb57(%rip),%rbp
mov    %rbp,%rdi
call   1060 <posn@plt>
mov    %eax,%r12d
cmpb   $0x4e,-0x1(%r15,%rbx,1)
jne    1550 <micro_qr_intermediate+0x400>
movsbl -0x4(%r14,%rbx,4),%esi
mov    %rbp,%rdi
call   1060 <posn@plt>
lea    (%r12,%r12,4),%ecx
lea    (%rax,%rcx,2),%r12d
mov    $0x2,%eax
jmp    1555 <micro_qr_intermediate+0x405>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%eax
mov    0x30(%rsp),%r14
mov    0x28(%rsp),%r15
cmpb   $0x4e,(%r15,%rbx,1)
je     14b0 <micro_qr_intermediate+0x360>
mov    0x38(%rsp),%rbp
jmp    14d3 <micro_qr_intermediate+0x383>
movl   $0x5,0x8(%rsp)
jmp    1586 <micro_qr_intermediate+0x436>
movl   $0x0,0x8(%rsp)
mov    0x8(%rsp),%eax
add    $0x78,%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 = %411, %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 %417
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 %407 [
i32 75, label %96
i32 66, label %163
i32 65, label %215
i32 78, label %298
]
96: ; preds = %93
%97 = load i8*, i8** %9
%98 = call i32 @concat(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 @concat(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 %417
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 %407
163: ; preds = %93
%164 = load i8*, i8** %9
%165 = call i32 @concat(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 @concat(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 %417
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 %407
215: ; preds = %93
%216 = load i8*, i8** %9
%217 = call i32 @concat(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 @concat(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 = %289, %231
%233 = load i32, i32* %19
%234 = load i32, i32* %18
%235 = icmp slt i32 %233, %234
br i1 %235, label %236, label %292
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 i8*, i8** %11
%248 = load i32, i32* %16
%249 = load i32, i32* %19
%250 = add nsw i32 %248, %249
%251 = add nsw i32 %250, 1
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds i8, i8* %247, i64 %252
%254 = load i8, i8* %253
%255 = sext i8 %254 to i32
%256 = icmp eq i32 %255, 65
br i1 %256, label %257, label %272
257: ; preds = %236
%258 = load i32*, i32** %10
%259 = load i32, i32* %16
%260 = load i32, i32* %19
%261 = add nsw i32 %259, %260
%262 = add nsw i32 %261, 1
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds i32, i32* %258, i64 %263
%265 = load i32, i32* %264
%266 = trunc i32 %265 to i8
%267 = call i32 @posn(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i8 signext %266)
store i32 %267, i32* %29
store i32 2, i32* %27
%268 = load i32, i32* %28
%269 = mul nsw i32 %268, 45
%270 = load i32, i32* %29
%271 = add nsw i32 %269, %270
store i32 %271, i32* %30
br label %272
272: ; preds = %257, %236
%273 = load i8*, i8** %9
%274 = load i32, i32* %30
%275 = load i32, i32* %27
%276 = mul nsw i32 5, %275
%277 = shl i32 1, %276
%278 = call i32 @qr_diran(i8* %273, i32 %274, i32 %277)
%279 = load i32, i32* %17
%280 = icmp ne i32 %279, 0
br i1 %280, label %281, label %284
281: ; preds = %272
%282 = load i32, i32* %30
%283 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %282)
br label %284
284: ; preds = %281, %272
%285 = load i8*, i8** %9
%286 = call i32 @strlen(i8* %285)
%287 = icmp sgt i32 %286, 128
br i1 %287, label %288, label %289
288: ; preds = %284
store i32 5, i32* %8
br label %417
289: ; preds = %284
%290 = load i32, i32* %19
%291 = add nsw i32 %290, 2
store i32 %291, i32* %19
br label %232
292: ; preds = %232
%293 = load i32, i32* %17
%294 = icmp ne i32 %293, 0
br i1 %294, label %295, label %297
295: ; preds = %292
%296 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %297
297: ; preds = %295, %292
br label %407
298: ; preds = %93
%299 = load i8*, i8** %9
%300 = call i32 @concat(i8* %299, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%301 = load i32, i32* %18
%302 = trunc i32 %301 to i8
%303 = getelementptr inbounds [2 x i8], [2 x i8]* %21, i64 0, i64 0
store i8 %302, i8* %303
%304 = getelementptr inbounds [2 x i8], [2 x i8]* %21, i64 0, i64 1
store i8 0, i8* %304
%305 = load i8*, i8** %9
%306 = getelementptr inbounds [2 x i8], [2 x i8]* %21, i64 0, i64 0
%307 = call i32 @concat(i8* %305, i8* %306)
%308 = load i32, i32* %17
%309 = icmp ne i32 %308, 0
br i1 %309, label %310, label %313
310: ; preds = %298
%311 = load i32, i32* %18
%312 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), i32 %311)
br label %313
313: ; preds = %310, %298
store i32 0, i32* %19
br label %314
314: ; preds = %398, %313
%315 = load i32, i32* %19
%316 = load i32, i32* %18
%317 = icmp slt i32 %315, %316
br i1 %317, label %318, label %401
318: ; preds = %314
store i32 0, i32* %32
store i32 0, i32* %33
store i32 0, i32* %34
%319 = load i32*, i32** %10
%320 = load i32, i32* %16
%321 = load i32, i32* %19
%322 = add nsw i32 %320, %321
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds i32, i32* %319, i64 %323
%325 = load i32, i32* %324
%326 = trunc i32 %325 to i8
%327 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %326)
store i32 %327, i32* %32
store i32 1, i32* %31
%328 = load i32, i32* %32
store i32 %328, i32* %35
%329 = load i8*, i8** %11
%330 = load i32, i32* %16
%331 = load i32, i32* %19
%332 = add nsw i32 %330, %331
%333 = add nsw i32 %332, 1
%334 = sext i32 %333 to i64
%335 = getelementptr inbounds i8, i8* %329, i64 %334
%336 = load i8, i8* %335
%337 = sext i8 %336 to i32
%338 = icmp eq i32 %337, 78
br i1 %338, label %339, label %354
339: ; preds = %318
%340 = load i32*, i32** %10
%341 = load i32, i32* %16
%342 = load i32, i32* %19
%343 = add nsw i32 %341, %342
%344 = add nsw i32 %343, 1
%345 = sext i32 %344 to i64
%346 = getelementptr inbounds i32, i32* %340, i64 %345
%347 = load i32, i32* %346
%348 = trunc i32 %347 to i8
%349 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %348)
store i32 %349, i32* %33
store i32 2, i32* %31
%350 = load i32, i32* %35
%351 = mul nsw i32 %350, 10
%352 = load i32, i32* %33
%353 = add nsw i32 %351, %352
store i32 %353, i32* %35
br label %354
354: ; preds = %339, %318
%355 = load i8*, i8** %11
%356 = load i32, i32* %16
%357 = load i32, i32* %19
%358 = add nsw i32 %356, %357
%359 = add nsw i32 %358, 2
%360 = sext i32 %359 to i64
%361 = getelementptr inbounds i8, i8* %355, i64 %360
%362 = load i8, i8* %361
%363 = sext i8 %362 to i32
%364 = icmp eq i32 %363, 78
br i1 %364, label %365, label %380
365: ; preds = %354
%366 = load i32*, i32** %10
%367 = load i32, i32* %16
%368 = load i32, i32* %19
%369 = add nsw i32 %367, %368
%370 = add nsw i32 %369, 2
%371 = sext i32 %370 to i64
%372 = getelementptr inbounds i32, i32* %366, i64 %371
%373 = load i32, i32* %372
%374 = trunc i32 %373 to i8
%375 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %374)
store i32 %375, i32* %34
store i32 3, i32* %31
%376 = load i32, i32* %35
%377 = mul nsw i32 %376, 10
%378 = load i32, i32* %34
%379 = add nsw i32 %377, %378
store i32 %379, i32* %35
br label %380
380: ; preds = %365, %354
%381 = load i8*, i8** %9
%382 = load i32, i32* %35
%383 = load i32, i32* %31
%384 = mul nsw i32 3, %383
%385 = shl i32 1, %384
%386 = call i32 @qr_diran(i8* %381, i32 %382, i32 %385)
%387 = load i32, i32* %17
%388 = icmp ne i32 %387, 0
br i1 %388, label %389, label %393
389: ; preds = %380
%390 = load i32, i32* %35
%391 = load i32, i32* %35
%392 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 %390, i32 %391)
br label %393
393: ; preds = %389, %380
%394 = load i8*, i8** %9
%395 = call i32 @strlen(i8* %394)
%396 = icmp sgt i32 %395, 128
br i1 %396, label %397, label %398
397: ; preds = %393
store i32 5, i32* %8
br label %417
398: ; preds = %393
%399 = load i32, i32* %19
%400 = add nsw i32 %399, 3
store i32 %400, i32* %19
br label %314
401: ; preds = %314
%402 = load i32, i32* %17
%403 = icmp ne i32 %402, 0
br i1 %403, label %404, label %406
404: ; preds = %401
%405 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %406
406: ; preds = %404, %401
br label %407
407: ; preds = %93, %406, %297, %214, %162
%408 = load i32, i32* %18
%409 = load i32, i32* %16
%410 = add nsw i32 %409, %408
store i32 %410, i32* %16
br label %411
411: ; preds = %407
%412 = load i32, i32* %16
%413 = load i32, i32* %12
%414 = sub nsw i32 %413, 1
%415 = icmp slt i32 %412, %414
br i1 %415, label %59, label %416
416: ; preds = %411
store i32 0, i32* %8
br label %417
417: ; preds = %416, %397, %288, %204, %152, %63
%418 = load i32, i32* %8
ret i32 %418
}

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 = %163, %7
%14 = phi i32 [ 0, %7 ], [ %38, %163 ]
%15 = call i32 @strlen(i8* %0)
%16 = icmp sgt i32 %15, 128
br i1 %16, label %165, 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 %163 [
i32 75, label %40
i32 66, label %65
i32 65, label %82
i32 78, label %115
]
40: ; preds = %37
%41 = call i32 @concat(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 @concat(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 %163, 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 %165, label %46
65: ; preds = %37
%66 = call i32 @concat(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 @concat(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 %163, 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 %165, label %71
82: ; preds = %37
%83 = call i32 @concat(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 @concat(i8* %0, i8* %9)
%86 = and i64 %27, 4294967295
br label %87
87: ; preds = %107, %82
%88 = phi i64 [ %114, %107 ], [ 0, %82 ]
%89 = icmp ugt i64 %88, %86
br i1 %89, label %163, 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 = add nuw nsw i64 %91, 1
%97 = getelementptr inbounds i8, i8* %2, i64 %96
%98 = load i8, i8* %97
%99 = icmp eq i8 %98, 65
br i1 %99, label %100, label %107
100: ; preds = %90
%101 = getelementptr inbounds i32, i32* %1, i64 %96
%102 = load i32, i32* %101
%103 = trunc i32 %102 to i8
%104 = call i32 @posn(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0), i8 signext %103)
%105 = mul nsw i32 %95, 45
%106 = add nsw i32 %104, %105
br label %107
107: ; preds = %100, %90
%108 = phi i32 [ 10, %100 ], [ 5, %90 ]
%109 = phi i32 [ %106, %100 ], [ %95, %90 ]
%110 = shl nuw nsw i32 1, %108
%111 = call i32 @qr_diran(i8* %0, i32 %109, i32 %110)
%112 = call i32 @strlen(i8* %0)
%113 = icmp sgt i32 %112, 128
%114 = add nuw nsw i64 %88, 2
br i1 %113, label %165, label %87
115: ; preds = %37
%116 = call i32 @concat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%117 = trunc i64 %28 to i8
store i8 %117, i8* %9
store i8 0, i8* %11
%118 = call i32 @concat(i8* %0, i8* %9)
%119 = and i64 %27, 4294967295
br label %120
120: ; preds = %154, %115
%121 = phi i64 [ %162, %154 ], [ 0, %115 ]
%122 = icmp ugt i64 %121, %119
br i1 %122, label %163, label %123
123: ; preds = %120
%124 = add nuw nsw i64 %121, %18
%125 = getelementptr inbounds i32, i32* %1, i64 %124
%126 = load i32, i32* %125
%127 = trunc i32 %126 to i8
%128 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %127)
%129 = add nuw nsw i64 %124, 1
%130 = getelementptr inbounds i8, i8* %2, i64 %129
%131 = load i8, i8* %130
%132 = icmp eq i8 %131, 78
br i1 %132, label %133, label %140
133: ; preds = %123
%134 = getelementptr inbounds i32, i32* %1, i64 %129
%135 = load i32, i32* %134
%136 = trunc i32 %135 to i8
%137 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %136)
%138 = mul nsw i32 %128, 10
%139 = add nsw i32 %137, %138
br label %140
140: ; preds = %133, %123
%141 = phi i32 [ 2, %133 ], [ 1, %123 ]
%142 = phi i32 [ %139, %133 ], [ %128, %123 ]
%143 = add nuw nsw i64 %124, 2
%144 = getelementptr inbounds i8, i8* %2, i64 %143
%145 = load i8, i8* %144
%146 = icmp eq i8 %145, 78
br i1 %146, label %147, label %154
147: ; preds = %140
%148 = getelementptr inbounds i32, i32* %1, i64 %143
%149 = load i32, i32* %148
%150 = trunc i32 %149 to i8
%151 = call i32 @posn(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i8 signext %150)
%152 = mul nsw i32 %142, 10
%153 = add nsw i32 %151, %152
br label %154
154: ; preds = %147, %140
%155 = phi i32 [ 3, %147 ], [ %141, %140 ]
%156 = phi i32 [ %153, %147 ], [ %142, %140 ]
%157 = mul nuw nsw i32 %155, 3
%158 = shl nuw nsw i32 1, %157
%159 = call i32 @qr_diran(i8* %0, i32 %156, i32 %158)
%160 = call i32 @strlen(i8* %0)
%161 = icmp sgt i32 %160, 128
%162 = add nuw nsw i64 %121, 3
br i1 %161, label %165, label %120
163: ; preds = %120, %87, %71, %46, %37
%164 = icmp slt i32 %38, %12
br i1 %164, label %13, label %165
165: ; preds = %163, %13, %154, %107, %74, %49
%166 = phi i32 [ 5, %49 ], [ 5, %74 ], [ 5, %107 ], [ 5, %154 ], [ 0, %163 ], [ 5, %13 ]
ret i32 %166
}