#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*/ clean_line(char *, char *);
unsigned char decode_parameter(char *, int *, unsigned short *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned short *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strncmp(char *, char *, int);
int dcpu16_assemble(unsigned char *out, char *unoline) {
  unsigned short wordA = 0, wordB = 0;
  int basic_opcode = 0;
  int non_basic_opcode = 0;
  char line[256];
  int off = 0;
  clean_line(line, unoline);
  if (!*line)
    return 0;
  if (!strncmp("SET", line, 3))
    basic_opcode = 0x1;
  else if (!strncmp("ADD", line, 3))
    basic_opcode = 0x2;
  else if (!strncmp("SUB", line, 3))
    basic_opcode = 0x3;
  else if (!strncmp("MUL", line, 3))
    basic_opcode = 0x4;
  else if (!strncmp("DIV", line, 3))
    basic_opcode = 0x5;
  else if (!strncmp("MOD", line, 3))
    basic_opcode = 0x6;
  else if (!strncmp("SHL", line, 3))
    basic_opcode = 0x7;
  else if (!strncmp("SHR", line, 3))
    basic_opcode = 0x8;
  else if (!strncmp("AND", line, 3))
    basic_opcode = 0x9;
  else if (!strncmp("BOR", line, 3))
    basic_opcode = 0xA;
  else if (!strncmp("XOR", line, 3))
    basic_opcode = 0xB;
  else if (!strncmp("IFE", line, 3))
    basic_opcode = 0xC;
  else if (!strncmp("IFN", line, 3))
    basic_opcode = 0xD;
  else if (!strncmp("IFG", line, 3))
    basic_opcode = 0xE;
  else if (!strncmp("IFB", line, 3))
    basic_opcode = 0xF;
  if (basic_opcode == 0) {
    if (!strncmp("JSR", line, 3)) {
      non_basic_opcode = 0x1;
    } else {
      fprintf(stderr, "Unknown instruction\n");
      return -1;
    }
  }
  if (basic_opcode != 0) {
    char *parameters = line + 3;
    unsigned char paramA = 0, paramB = 0;
    int cn = 0;
    while (parameters[cn] != ',' && parameters[cn] != '\n' &&
           parameters[cn] != 0 && cn < 256)
      cn++;
    if (parameters[cn] == ',') {
      unsigned short first_word;
      int extraA = 0;
      int extraB = 0;
      char *pa, *pb;
      parameters[cn] = 0;
      pa = parameters;
      pb = parameters + cn + 1;
      paramA = decode_parameter(pa, &extraA, &wordA);
      paramB = decode_parameter(pb, &extraB, &wordB);
      first_word = ((paramB & 0x3F) << 10) | ((paramA & 0x3F) << 4) |
                   (basic_opcode & 0xF);
      memcpy(out, &first_word, 2);
      if (extraA == 1) {
        memcpy(out + 2, &wordA, 2);
        off = 4;
      } else
        off = 2;
      if (extraB == 1) {
        memcpy(out + off, &wordB, 2);
        off += 2;
      }
    } else {
      fprintf(stderr, "Missing comma\n");
      return -1;
    }
  }
  if (non_basic_opcode == 0x1) {
    char *param = line + 3;
    int extraX = 0;
    unsigned short first_word, wordX = 0;
    unsigned char p = decode_parameter(param, &extraX, &wordX);
    first_word = ((p & 0x3F) << 10) | ((non_basic_opcode & 0x3F) << 4) |
                 (basic_opcode & 0xF);
    memcpy(out, &first_word, 2);
    if (extraX == 1) {
      memcpy(out + 2, &wordX, 2);
      off = 4;
    } else
      off = 2;
  }
  return off;
}


x86 assembly (clang, -O0):
<dcpu16_assemble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movw   $0x0,-0x1a(%rbp)
movw   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x134(%rbp)
lea    -0x130(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <clean_line@plt>
cmpb   $0x0,-0x130(%rbp)
jne    11b0 <dcpu16_assemble+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1824 <dcpu16_assemble+0x6d4>
lea    -0x130(%rbp),%rsi
lea    0xe42(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    11dd <dcpu16_assemble+0x8d>
movl   $0x1,-0x20(%rbp)
jmp    1494 <dcpu16_assemble+0x344>
lea    -0x130(%rbp),%rsi
lea    0xe19(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    120a <dcpu16_assemble+0xba>
movl   $0x2,-0x20(%rbp)
jmp    148f <dcpu16_assemble+0x33f>
lea    -0x130(%rbp),%rsi
lea    0xdf0(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1237 <dcpu16_assemble+0xe7>
movl   $0x3,-0x20(%rbp)
jmp    148a <dcpu16_assemble+0x33a>
lea    -0x130(%rbp),%rsi
lea    0xdc7(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1264 <dcpu16_assemble+0x114>
movl   $0x4,-0x20(%rbp)
jmp    1485 <dcpu16_assemble+0x335>
lea    -0x130(%rbp),%rsi
lea    0xd9e(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1291 <dcpu16_assemble+0x141>
movl   $0x5,-0x20(%rbp)
jmp    1480 <dcpu16_assemble+0x330>
lea    -0x130(%rbp),%rsi
lea    0xd75(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12be <dcpu16_assemble+0x16e>
movl   $0x6,-0x20(%rbp)
jmp    147b <dcpu16_assemble+0x32b>
lea    -0x130(%rbp),%rsi
lea    0xd4c(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    12eb <dcpu16_assemble+0x19b>
movl   $0x7,-0x20(%rbp)
jmp    1476 <dcpu16_assemble+0x326>
lea    -0x130(%rbp),%rsi
lea    0xd23(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1318 <dcpu16_assemble+0x1c8>
movl   $0x8,-0x20(%rbp)
jmp    1471 <dcpu16_assemble+0x321>
lea    -0x130(%rbp),%rsi
lea    0xcfa(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1345 <dcpu16_assemble+0x1f5>
movl   $0x9,-0x20(%rbp)
jmp    146c <dcpu16_assemble+0x31c>
lea    -0x130(%rbp),%rsi
lea    0xcd1(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1372 <dcpu16_assemble+0x222>
movl   $0xa,-0x20(%rbp)
jmp    1467 <dcpu16_assemble+0x317>
lea    -0x130(%rbp),%rsi
lea    0xca8(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    139f <dcpu16_assemble+0x24f>
movl   $0xb,-0x20(%rbp)
jmp    1462 <dcpu16_assemble+0x312>
lea    -0x130(%rbp),%rsi
lea    0xc7f(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    13cc <dcpu16_assemble+0x27c>
movl   $0xc,-0x20(%rbp)
jmp    145d <dcpu16_assemble+0x30d>
lea    -0x130(%rbp),%rsi
lea    0xc56(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    13f9 <dcpu16_assemble+0x2a9>
movl   $0xd,-0x20(%rbp)
jmp    1458 <dcpu16_assemble+0x308>
lea    -0x130(%rbp),%rsi
lea    0xc2d(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1426 <dcpu16_assemble+0x2d6>
movl   $0xe,-0x20(%rbp)
jmp    1453 <dcpu16_assemble+0x303>
lea    -0x130(%rbp),%rsi
lea    0xc04(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    144e <dcpu16_assemble+0x2fe>
movl   $0xf,-0x20(%rbp)
jmp    1453 <dcpu16_assemble+0x303>
jmp    1458 <dcpu16_assemble+0x308>
jmp    145d <dcpu16_assemble+0x30d>
jmp    1462 <dcpu16_assemble+0x312>
jmp    1467 <dcpu16_assemble+0x317>
jmp    146c <dcpu16_assemble+0x31c>
jmp    1471 <dcpu16_assemble+0x321>
jmp    1476 <dcpu16_assemble+0x326>
jmp    147b <dcpu16_assemble+0x32b>
jmp    1480 <dcpu16_assemble+0x330>
jmp    1485 <dcpu16_assemble+0x335>
jmp    148a <dcpu16_assemble+0x33a>
jmp    148f <dcpu16_assemble+0x33f>
jmp    1494 <dcpu16_assemble+0x344>
cmpl   $0x0,-0x20(%rbp)
jne    14f1 <dcpu16_assemble+0x3a1>
lea    -0x130(%rbp),%rsi
lea    0xb90(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    14cb <dcpu16_assemble+0x37b>
movl   $0x1,-0x24(%rbp)
jmp    14ec <dcpu16_assemble+0x39c>
mov    0x2b0e(%rip),%rax
mov    (%rax),%edi
lea    0xb65(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1824 <dcpu16_assemble+0x6d4>
jmp    14f1 <dcpu16_assemble+0x3a1>
cmpl   $0x0,-0x20(%rbp)
je     174c <dcpu16_assemble+0x5fc>
lea    -0x130(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x140(%rbp)
movb   $0x0,-0x141(%rbp)
movb   $0x0,-0x142(%rbp)
movl   $0x0,-0x148(%rbp)
mov    -0x140(%rbp),%rax
movslq -0x148(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0x17a(%rbp)
je     15a1 <dcpu16_assemble+0x451>
mov    -0x140(%rbp),%rax
movslq -0x148(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x17a(%rbp)
je     15a1 <dcpu16_assemble+0x451>
mov    -0x140(%rbp),%rax
movslq -0x148(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x17a(%rbp)
je     15a1 <dcpu16_assemble+0x451>
cmpl   $0x100,-0x148(%rbp)
setl   %al
mov    %al,-0x17a(%rbp)
mov    -0x17a(%rbp),%al
test   $0x1,%al
jne    15b4 <dcpu16_assemble+0x464>
jmp    15c8 <dcpu16_assemble+0x478>
mov    -0x148(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x148(%rbp)
jmp    1525 <dcpu16_assemble+0x3d5>
mov    -0x140(%rbp),%rax
movslq -0x148(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1726 <dcpu16_assemble+0x5d6>
movl   $0x0,-0x150(%rbp)
movl   $0x0,-0x154(%rbp)
mov    -0x140(%rbp),%rax
movslq -0x148(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x140(%rbp),%rax
mov    %rax,-0x160(%rbp)
mov    -0x140(%rbp),%rax
movslq -0x148(%rbp),%rcx
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x168(%rbp)
mov    -0x160(%rbp),%rdi
lea    -0x150(%rbp),%rsi
lea    -0x1a(%rbp),%rdx
call   1070 <decode_parameter@plt>
mov    %al,-0x141(%rbp)
mov    -0x168(%rbp),%rdi
lea    -0x154(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1070 <decode_parameter@plt>
mov    %al,-0x142(%rbp)
movzbl -0x142(%rbp),%eax
and    $0x3f,%eax
shl    $0xa,%eax
movzbl -0x141(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %ax,-0x14a(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14a(%rbp),%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
cmpl   $0x1,-0x150(%rbp)
jne    16df <dcpu16_assemble+0x58f>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
lea    -0x1a(%rbp),%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x134(%rbp)
jmp    16e9 <dcpu16_assemble+0x599>
movl   $0x2,-0x134(%rbp)
cmpl   $0x1,-0x154(%rbp)
jne    1721 <dcpu16_assemble+0x5d1>
mov    -0x10(%rbp),%rdi
movslq -0x134(%rbp),%rax
add    %rax,%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
mov    -0x134(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x134(%rbp)
jmp    1747 <dcpu16_assemble+0x5f7>
mov    0x28b3(%rip),%rax
mov    (%rax),%edi
lea    0x91f(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1824 <dcpu16_assemble+0x6d4>
jmp    174c <dcpu16_assemble+0x5fc>
cmpl   $0x1,-0x24(%rbp)
jne    181b <dcpu16_assemble+0x6cb>
lea    -0x130(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x170(%rbp)
movl   $0x0,-0x174(%rbp)
movw   $0x0,-0x178(%rbp)
mov    -0x170(%rbp),%rdi
lea    -0x174(%rbp),%rsi
lea    -0x178(%rbp),%rdx
call   1070 <decode_parameter@plt>
mov    %al,-0x179(%rbp)
movzbl -0x179(%rbp),%eax
and    $0x3f,%eax
shl    $0xa,%eax
mov    -0x24(%rbp),%ecx
and    $0x3f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %ax,-0x176(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x176(%rbp),%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
cmpl   $0x1,-0x174(%rbp)
jne    180c <dcpu16_assemble+0x6bc>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
lea    -0x178(%rbp),%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x134(%rbp)
jmp    1816 <dcpu16_assemble+0x6c6>
movl   $0x2,-0x134(%rbp)
jmp    181b <dcpu16_assemble+0x6cb>
mov    -0x134(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcpu16_assemble>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    %rdi,%r14
movw   $0x0,0xa(%rsp)
movw   $0x0,0x8(%rsp)
lea    0x10(%rsp),%rdi
call   1060 <clean_line@plt>
cmpb   $0x0,0x10(%rsp)
je     1382 <dcpu16_assemble+0x232>
lea    0xe76(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1389 <dcpu16_assemble+0x239>
lea    0xe5c(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1390 <dcpu16_assemble+0x240>
lea    0xe42(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1397 <dcpu16_assemble+0x247>
lea    0xe28(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     139e <dcpu16_assemble+0x24e>
lea    0xe0e(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13a5 <dcpu16_assemble+0x255>
lea    0xdf4(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13ac <dcpu16_assemble+0x25c>
lea    0xdda(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13b3 <dcpu16_assemble+0x263>
lea    0xdc0(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13ba <dcpu16_assemble+0x26a>
lea    0xda6(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13c1 <dcpu16_assemble+0x271>
lea    0xd8c(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13c8 <dcpu16_assemble+0x278>
lea    0xd72(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13cf <dcpu16_assemble+0x27f>
lea    0xd58(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13d6 <dcpu16_assemble+0x286>
lea    0xd3e(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13dd <dcpu16_assemble+0x28d>
lea    0xd24(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     13e4 <dcpu16_assemble+0x294>
lea    0xd0a(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
mov    $0xf,%ebx
test   %eax,%eax
cmovne %ecx,%ebx
je     13eb <dcpu16_assemble+0x29b>
lea    0xce6(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1507 <dcpu16_assemble+0x3b7>
mov    0x2c6c(%rip),%rax
mov    (%rax),%edi
lea    0xcc3(%rip),%rsi
jmp    14ed <dcpu16_assemble+0x39d>
xor    %ebp,%ebp
jmp    14f7 <dcpu16_assemble+0x3a7>
mov    $0x1,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x2,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x3,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x4,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x5,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x6,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x7,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x8,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0x9,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0xa,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0xb,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0xc,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0xd,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0xe,%r15w
jmp    13f0 <dcpu16_assemble+0x2a0>
mov    $0xf,%r15w
lea    0x13(%rsp),%rdi
lea    0x14(%rsp),%rbp
xor    %eax,%eax
nopl   0x0(%rax)
movzbl -0x1(%rbp),%ecx
cmp    $0xa,%cl
je     14dd <dcpu16_assemble+0x38d>
cmp    $0x2c,%cl
je     1431 <dcpu16_assemble+0x2e1>
test   %cl,%cl
je     1428 <dcpu16_assemble+0x2d8>
cmp    $0xff,%rax
ja     1428 <dcpu16_assemble+0x2d8>
add    $0x1,%rax
add    $0x1,%rbp
jmp    1400 <dcpu16_assemble+0x2b0>
cmp    $0x2c,%cl
jne    14dd <dcpu16_assemble+0x38d>
movl   $0x0,0x4(%rsp)
movl   $0x0,0xc(%rsp)
movb   $0x0,-0x1(%rbp)
lea    0x4(%rsp),%rsi
lea    0xa(%rsp),%rdx
call   1070 <decode_parameter@plt>
mov    %eax,%ebx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rbp,%rdi
call   1070 <decode_parameter@plt>
movzbl %al,%eax
shl    $0xa,%eax
and    $0x3f,%bl
movzbl %bl,%ecx
shl    $0x4,%ecx
or     %eax,%ecx
movzwl %r15w,%eax
or     %ecx,%eax
mov    %ax,0x2(%rsp)
lea    0x2(%rsp),%rsi
mov    $0x2,%ebp
mov    %r14,%rdi
mov    $0x2,%edx
call   1050 <memcpy@plt>
cmpl   $0x1,0x4(%rsp)
jne    14ba <dcpu16_assemble+0x36a>
lea    0x2(%r14),%rdi
lea    0xa(%rsp),%rsi
mov    $0x2,%edx
call   1050 <memcpy@plt>
mov    $0x4,%ebp
cmpl   $0x1,0xc(%rsp)
jne    14f7 <dcpu16_assemble+0x3a7>
mov    %ebp,%eax
add    %rax,%r14
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1050 <memcpy@plt>
add    $0x2,%ebp
jmp    14f7 <dcpu16_assemble+0x3a7>
mov    0x2afc(%rip),%rax
mov    (%rax),%edi
lea    0xb68(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x118,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x13(%rsp),%rdi
movl   $0x0,0x4(%rsp)
movw   $0x0,0x2(%rsp)
lea    0x4(%rsp),%rsi
lea    0x2(%rsp),%rdx
call   1070 <decode_parameter@plt>
movzbl %al,%eax
shl    $0xa,%eax
movzwl %bx,%ecx
add    %ecx,%eax
add    $0x10,%eax
mov    %ax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x2,%ebp
mov    %r14,%rdi
mov    $0x2,%edx
call   1050 <memcpy@plt>
cmpl   $0x1,0x4(%rsp)
jne    14f7 <dcpu16_assemble+0x3a7>
add    $0x2,%r14
lea    0x2(%rsp),%rsi
mov    %r14,%rdi
mov    $0x2,%edx
call   1050 <memcpy@plt>
mov    $0x4,%ebp
jmp    14f7 <dcpu16_assemble+0x3a7>

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

LLVM IR (-O2):
@.str = [4 x i8] c"SET\00"
@.str.1 = [4 x i8] c"ADD\00"
@.str.2 = [4 x i8] c"SUB\00"
@.str.3 = [4 x i8] c"MUL\00"
@.str.4 = [4 x i8] c"DIV\00"
@.str.5 = [4 x i8] c"MOD\00"
@.str.6 = [4 x i8] c"SHL\00"
@.str.7 = [4 x i8] c"SHR\00"
@.str.8 = [4 x i8] c"AND\00"
@.str.9 = [4 x i8] c"BOR\00"
@.str.10 = [4 x i8] c"XOR\00"
@.str.11 = [4 x i8] c"IFE\00"
@.str.12 = [4 x i8] c"IFN\00"
@.str.13 = [4 x i8] c"IFG\00"
@.str.14 = [4 x i8] c"IFB\00"
@.str.15 = [4 x i8] c"JSR\00"
@stderr = global i32 0
@.str.16 = [21 x i8] c"Unknown instruction\0A\00"
@.str.17 = [15 x i8] c"Missing comma\0A\00"
define i32 @dcpu16_assemble(i8* %0, i8* %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca [256 x i8]
%6 = alloca i16
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i16
%11 = alloca i16
%12 = bitcast i16* %3 to i8*
store i16 0, i16* %3
%13 = bitcast i16* %4 to i8*
store i16 0, i16* %4
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%15 = call i32 @clean_line(i8* %14, i8* %1)
%16 = load i8, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %139, label %18
18: ; preds = %2
%19 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14, i32 3)
%20 = icmp eq i32 %19, 0
br i1 %20, label %70, label %21
21: ; preds = %18
%22 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14, i32 3)
%23 = icmp eq i32 %22, 0
br i1 %23, label %70, label %24
24: ; preds = %21
%25 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %14, i32 3)
%26 = icmp eq i32 %25, 0
br i1 %26, label %70, label %27
27: ; preds = %24
%28 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %14, i32 3)
%29 = icmp eq i32 %28, 0
br i1 %29, label %70, label %30
30: ; preds = %27
%31 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %14, i32 3)
%32 = icmp eq i32 %31, 0
br i1 %32, label %70, label %33
33: ; preds = %30
%34 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %14, i32 3)
%35 = icmp eq i32 %34, 0
br i1 %35, label %70, label %36
36: ; preds = %33
%37 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %14, i32 3)
%38 = icmp eq i32 %37, 0
br i1 %38, label %70, label %39
39: ; preds = %36
%40 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %14, i32 3)
%41 = icmp eq i32 %40, 0
br i1 %41, label %70, label %42
42: ; preds = %39
%43 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %14, i32 3)
%44 = icmp eq i32 %43, 0
br i1 %44, label %70, label %45
45: ; preds = %42
%46 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* %14, i32 3)
%47 = icmp eq i32 %46, 0
br i1 %47, label %70, label %48
48: ; preds = %45
%49 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %14, i32 3)
%50 = icmp eq i32 %49, 0
br i1 %50, label %70, label %51
51: ; preds = %48
%52 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %14, i32 3)
%53 = icmp eq i32 %52, 0
br i1 %53, label %70, label %54
54: ; preds = %51
%55 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), i8* %14, i32 3)
%56 = icmp eq i32 %55, 0
br i1 %56, label %70, label %57
57: ; preds = %54
%58 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8* %14, i32 3)
%59 = icmp eq i32 %58, 0
br i1 %59, label %70, label %60
60: ; preds = %57
%61 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i8* %14, i32 3)
%62 = icmp eq i32 %61, 0
%63 = select i1 %62, i16 15, i16 0
br i1 %62, label %70, label %64
64: ; preds = %60
%65 = call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* %14, i32 3)
%66 = icmp eq i32 %65, 0
br i1 %66, label %121, label %67
67: ; preds = %64
%68 = load i32, i32* @stderr
%69 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0))
br label %139
70: ; preds = %57, %54, %51, %48, %45, %42, %39, %36, %33, %30, %27, %24, %21, %18, %60
%71 = phi i16 [ 15, %60 ], [ 14, %57 ], [ 13, %54 ], [ 12, %51 ], [ 11, %48 ], [ 10, %45 ], [ 9, %42 ], [ 8, %39 ], [ 7, %36 ], [ 6, %33 ], [ 5, %30 ], [ 4, %27 ], [ 3, %24 ], [ 2, %21 ], [ 1, %18 ]
%72 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 3
br label %73
73: ; preds = %81, %70
%74 = phi i64 [ %82, %81 ], [ 0, %70 ]
%75 = getelementptr inbounds i8, i8* %72, i64 %74
%76 = load i8, i8* %75
switch i8 %76, label %77 [
i8 44, label %85
i8 10, label %116
]
77: ; preds = %73
%78 = icmp ne i8 %76, 0
%79 = icmp ult i64 %74, 256
%80 = select i1 %78, i1 %79, i1 false
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = add nuw nsw i64 %74, 1
br label %73
83: ; preds = %77
%84 = icmp eq i8 %76, 44
br i1 %84, label %85, label %116
85: ; preds = %73, %83
%86 = and i64 %74, 4294967295
%87 = getelementptr inbounds i8, i8* %72, i64 %86
%88 = bitcast i16* %6 to i8*
%89 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%90 = bitcast i32* %8 to i8*
store i32 0, i32* %8
store i8 0, i8* %87
%91 = getelementptr inbounds i8, i8* %87, i64 1
%92 = call zeroext i8 @decode_parameter(i8* %72, i32* %7, i16* %3)
%93 = call zeroext i8 @decode_parameter(i8* %91, i32* %8, i16* %4)
%94 = zext i8 %93 to i16
%95 = shl i16 %94, 10
%96 = and i8 %92, 63
%97 = zext i8 %96 to i16
%98 = shl nuw nsw i16 %97, 4
%99 = or i16 %95, %98
%100 = or i16 %99, %71
store i16 %100, i16* %6
%101 = call i32 @memcpy(i8* %0, i16* %6, i32 2)
%102 = load i32, i32* %7
%103 = icmp eq i32 %102, 1
br i1 %103, label %104, label %107
104: ; preds = %85
%105 = getelementptr inbounds i8, i8* %0, i64 2
%106 = call i32 @memcpy(i8* %105, i16* %3, i32 2)
br label %107
107: ; preds = %85, %104
%108 = phi i32 [ 4, %104 ], [ 2, %85 ]
%109 = load i32, i32* %8
%110 = icmp eq i32 %109, 1
br i1 %110, label %111, label %119
111: ; preds = %107
%112 = zext i32 %108 to i64
%113 = getelementptr inbounds i8, i8* %0, i64 %112
%114 = call i32 @memcpy(i8* %113, i16* %4, i32 2)
%115 = add nuw nsw i32 %108, 2
br label %119
116: ; preds = %73, %83
%117 = load i32, i32* @stderr
%118 = call i32 @fprintf(i32 %117, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.17, i64 0, i64 0))
br label %139
119: ; preds = %107, %111
%120 = phi i32 [ %115, %111 ], [ %108, %107 ]
br label %139
121: ; preds = %64
%122 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 3
%123 = bitcast i32* %9 to i8*
store i32 0, i32* %9
%124 = bitcast i16* %10 to i8*
%125 = bitcast i16* %11 to i8*
store i16 0, i16* %11
%126 = call zeroext i8 @decode_parameter(i8* %122, i32* %9, i16* %11)
%127 = zext i8 %126 to i16
%128 = shl i16 %127, 10
%129 = or i16 %128, %63
%130 = or i16 %129, 16
store i16 %130, i16* %10
%131 = call i32 @memcpy(i8* %0, i16* %10, i32 2)
%132 = load i32, i32* %9
%133 = icmp eq i32 %132, 1
br i1 %133, label %134, label %137
134: ; preds = %121
%135 = getelementptr inbounds i8, i8* %0, i64 2
%136 = call i32 @memcpy(i8* %135, i16* %11, i32 2)
br label %137
137: ; preds = %121, %134
%138 = phi i32 [ 4, %134 ], [ 2, %121 ]
br label %139
139: ; preds = %119, %116, %137, %2, %67
%140 = phi i32 [ -1, %67 ], [ -1, %116 ], [ 0, %2 ], [ %138, %137 ], [ %120, %119 ]
ret i32 %140
}