#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 intbracket(char const *);
int /*<<< orphan*/ printf(char *, char const *);
scalar_t__ strncmp(char const *, char *, int);
void compile1(const char *cmd, char *out, int instrno) {
  if (strncmp(cmd, "MOV", 3) == 0) {
    if (cmd[4] == 'A') {
      out[0] = 0xb8;
      *((int *)(out + 1)) = intbracket(cmd + 7);
    } else {
      out[0] = 0xbb;
      *((int *)(out + 1)) = intbracket(cmd + 7);
    }
  } else if (strncmp(cmd, "ADD", 3) == 0) {
    out[0] = 0x05;
    *((int *)(out + 1)) = intbracket(cmd + 7);
  } else if (strncmp(cmd, "SUB", 3) == 0) {
    out[0] = 0x2d;
    *((int *)(out + 1)) = intbracket(cmd + 7);
  } else if (strncmp(cmd, "SUM", 3) == 0) {
    out[0] = 0x01;
    out[1] = 0xd8;
    out[2] = 0x90;
    out[3] = 0x90;
    out[4] = 0x90;
  } else if (strncmp(cmd, "CMP", 3) == 0) {
    out[0] = 0x3d;
    *((int *)(out + 1)) = intbracket(cmd + 7);
  } else if (strncmp(cmd, "LDR", 3) == 0) {
    out[0] = 0x41;
    out[1] = 0x8b;
    if (cmd[4] == 'A') {
      out[2] = 0x44;
    } else {
      out[2] = 0x5c;
    }
    out[3] = 0x24;
    out[4] = 4 * intbracket(cmd + 7);
  } else if (strncmp(cmd, "STR", 3) == 0) {
    out[0] = 0x41;
    out[1] = 0x89;
    if (cmd[4] == 'A') {
      out[2] = 0x44;
    } else {
      out[2] = 0x5c;
    }
    out[3] = 0x24;
    out[4] = 4 * intbracket(cmd + 7);
  } else if (strncmp(cmd, "JMP", 3) == 0) {
    out[0] = 0xe2;
    out[1] = 0x01;
    out[2] = 0xc3;
    out[3] = 0xeb;
    out[4] = (intbracket(cmd + 4) - instrno) * 5 - 5;
  } else if (strncmp(cmd, "JEQ", 3) == 0) {
    out[0] = 0xe2;
    out[1] = 0x01;
    out[2] = 0xc3;
    out[3] = 0x74;
    out[4] = (intbracket(cmd + 4) - instrno) * 5 - 5;
  } else if (strncmp(cmd, "JNE", 3) == 0) {
    out[0] = 0xe2;
    out[1] = 0x01;
    out[2] = 0xc3;
    out[3] = 0x75;
    out[4] = (intbracket(cmd + 4) - instrno) * 5 - 5;
  } else if (strncmp(cmd, "RET", 3) == 0) {
    out[0] = 0xc3;
  } else {
    printf("Unknown instr: %s\n", cmd);
  }
}


x86 assembly (clang, -O0):
<compile1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11b7 <compile1+0x87>
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x41,%eax
jne    1195 <compile1+0x65>
mov    -0x10(%rbp),%rax
movb   $0xb8,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
call   1050 <intbracket@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1(%rax)
jmp    11b2 <compile1+0x82>
mov    -0x10(%rbp),%rax
movb   $0xbb,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
call   1050 <intbracket@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1(%rax)
jmp    154c <compile1+0x41c>
mov    -0x8(%rbp),%rdi
lea    0xe42(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11f8 <compile1+0xc8>
mov    -0x10(%rbp),%rax
movb   $0x5,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
call   1050 <intbracket@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1(%rax)
jmp    1547 <compile1+0x417>
mov    -0x8(%rbp),%rdi
lea    0xe05(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1239 <compile1+0x109>
mov    -0x10(%rbp),%rax
movb   $0x2d,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
call   1050 <intbracket@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1(%rax)
jmp    1542 <compile1+0x412>
mov    -0x8(%rbp),%rdi
lea    0xdc8(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1284 <compile1+0x154>
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movb   $0xd8,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x90,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x90,0x3(%rax)
mov    -0x10(%rbp),%rax
movb   $0x90,0x4(%rax)
jmp    153d <compile1+0x40d>
mov    -0x8(%rbp),%rdi
lea    0xd81(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12c5 <compile1+0x195>
mov    -0x10(%rbp),%rax
movb   $0x3d,(%rax)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
call   1050 <intbracket@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x1(%rax)
jmp    1538 <compile1+0x408>
mov    -0x8(%rbp),%rdi
lea    0xd44(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    133f <compile1+0x20f>
mov    -0x10(%rbp),%rax
movb   $0x41,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x8b,0x1(%rax)
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x41,%eax
jne    1311 <compile1+0x1e1>
mov    -0x10(%rbp),%rax
movb   $0x44,0x2(%rax)
jmp    1319 <compile1+0x1e9>
mov    -0x10(%rbp),%rax
movb   $0x5c,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x24,0x3(%rax)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
call   1050 <intbracket@plt>
shl    $0x2,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    1533 <compile1+0x403>
mov    -0x8(%rbp),%rdi
lea    0xcce(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    13b9 <compile1+0x289>
mov    -0x10(%rbp),%rax
movb   $0x41,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x89,0x1(%rax)
mov    -0x8(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x41,%eax
jne    138b <compile1+0x25b>
mov    -0x10(%rbp),%rax
movb   $0x44,0x2(%rax)
jmp    1393 <compile1+0x263>
mov    -0x10(%rbp),%rax
movb   $0x5c,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x24,0x3(%rax)
mov    -0x8(%rbp),%rdi
add    $0x7,%rdi
call   1050 <intbracket@plt>
shl    $0x2,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    152e <compile1+0x3fe>
mov    -0x8(%rbp),%rdi
lea    0xc58(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    141b <compile1+0x2eb>
mov    -0x10(%rbp),%rax
movb   $0xe2,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0xc3,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0xeb,0x3(%rax)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1050 <intbracket@plt>
sub    -0x14(%rbp),%eax
imul   $0x5,%eax,%eax
sub    $0x5,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    1529 <compile1+0x3f9>
mov    -0x8(%rbp),%rdi
lea    0xbfa(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    147d <compile1+0x34d>
mov    -0x10(%rbp),%rax
movb   $0xe2,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0xc3,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x74,0x3(%rax)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1050 <intbracket@plt>
sub    -0x14(%rbp),%eax
imul   $0x5,%eax,%eax
sub    $0x5,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    1524 <compile1+0x3f4>
mov    -0x8(%rbp),%rdi
lea    0xb9c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    14df <compile1+0x3af>
mov    -0x10(%rbp),%rax
movb   $0xe2,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x1,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0xc3,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x75,0x3(%rax)
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
call   1050 <intbracket@plt>
sub    -0x14(%rbp),%eax
imul   $0x5,%eax,%eax
sub    $0x5,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x4(%rax)
jmp    151f <compile1+0x3ef>
mov    -0x8(%rbp),%rdi
lea    0xb3e(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    150a <compile1+0x3da>
mov    -0x10(%rbp),%rax
movb   $0xc3,(%rax)
jmp    151a <compile1+0x3ea>
mov    -0x8(%rbp),%rsi
lea    0xb17(%rip),%rdi
call   1040 <printf@plt>
jmp    151f <compile1+0x3ef>
jmp    1524 <compile1+0x3f4>
jmp    1529 <compile1+0x3f9>
jmp    152e <compile1+0x3fe>
jmp    1533 <compile1+0x403>
jmp    1538 <compile1+0x408>
jmp    153d <compile1+0x40d>
jmp    1542 <compile1+0x412>
jmp    1547 <compile1+0x417>
jmp    154c <compile1+0x41c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compile1>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebd(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     128b <compile1+0x15b>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1297 <compile1+0x167>
lea    0xe8e(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12a3 <compile1+0x173>
lea    0xe75(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12a9 <compile1+0x179>
lea    0xe5c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12b7 <compile1+0x187>
lea    0xe43(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12d0 <compile1+0x1a0>
lea    0xe2a(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     12d8 <compile1+0x1a8>
lea    0xe11(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     130d <compile1+0x1dd>
lea    0xdf8(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1316 <compile1+0x1e6>
lea    0xddf(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     131f <compile1+0x1ef>
lea    0xdc6(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     133f <compile1+0x20f>
lea    0xdad(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>
cmpb   $0x41,0x4(%rbx)
jne    129d <compile1+0x16d>
movb   $0xb8,(%r14)
jmp    12bb <compile1+0x18b>
movb   $0x5,(%r14)
jmp    12bb <compile1+0x18b>
movb   $0xbb,(%r14)
jmp    12bb <compile1+0x18b>
movb   $0x2d,(%r14)
jmp    12bb <compile1+0x18b>
movl   $0x9090d801,(%r14)
movb   $0x90,0x4(%r14)
jmp    12cb <compile1+0x19b>
movb   $0x3d,(%r14)
add    $0x7,%rbx
mov    %rbx,%rdi
call   1050 <intbracket@plt>
mov    %eax,0x1(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret
movw   $0x8b41,(%r14)
jmp    12de <compile1+0x1ae>
movw   $0x8941,(%r14)
cmpb   $0x41,0x4(%rbx)
mov    $0x44,%eax
mov    $0x5c,%ecx
cmove  %eax,%ecx
mov    %cl,0x2(%r14)
movb   $0x24,0x3(%r14)
add    $0x7,%rbx
mov    %rbx,%rdi
call   1050 <intbracket@plt>
shl    $0x2,%al
mov    %al,0x4(%r14)
jmp    12cb <compile1+0x19b>
movl   $0xebc301e2,(%r14)
jmp    1326 <compile1+0x1f6>
movl   $0x74c301e2,(%r14)
jmp    1326 <compile1+0x1f6>
movl   $0x75c301e2,(%r14)
add    $0x4,%rbx
mov    %rbx,%rdi
call   1050 <intbracket@plt>
sub    %ebp,%eax
lea    (%rax,%rax,4),%eax
add    $0xfb,%al
mov    %al,0x4(%r14)
jmp    12cb <compile1+0x19b>
movb   $0xc3,(%r14)
jmp    12cb <compile1+0x19b>

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

LLVM IR (-O2):
@.str = [4 x i8] c"MOV\00"
@.str.1 = [4 x i8] c"ADD\00"
@.str.2 = [4 x i8] c"SUB\00"
@.str.3 = [4 x i8] c"SUM\00"
@.str.4 = [4 x i8] c"CMP\00"
@.str.5 = [4 x i8] c"LDR\00"
@.str.6 = [4 x i8] c"STR\00"
@.str.7 = [4 x i8] c"JMP\00"
@.str.8 = [4 x i8] c"JEQ\00"
@.str.9 = [4 x i8] c"JNE\00"
@.str.10 = [4 x i8] c"RET\00"
@.str.11 = [19 x i8] c"Unknown instr: %s\0A\00"
define void @compile1(i8* %0, i8* writeonly %1, i32 %2) {
%4 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 4
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 65
br i1 %9, label %10, label %15
10: ; preds = %6
store i8 -72, i8* %1
%11 = getelementptr inbounds i8, i8* %0, i64 7
%12 = tail call i32 @intbracket(i8* %11)
%13 = getelementptr inbounds i8, i8* %1, i64 1
%14 = bitcast i8* %13 to i32*
store i32 %12, i32* %14
br label %132
15: ; preds = %6
store i8 -69, i8* %1
%16 = getelementptr inbounds i8, i8* %0, i64 7
%17 = tail call i32 @intbracket(i8* %16)
%18 = getelementptr inbounds i8, i8* %1, i64 1
%19 = bitcast i8* %18 to i32*
store i32 %17, i32* %19
br label %132
20: ; preds = %3
%21 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20
store i8 5, i8* %1
%24 = getelementptr inbounds i8, i8* %0, i64 7
%25 = tail call i32 @intbracket(i8* %24)
%26 = getelementptr inbounds i8, i8* %1, i64 1
%27 = bitcast i8* %26 to i32*
store i32 %25, i32* %27
br label %132
28: ; preds = %20
%29 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %36
31: ; preds = %28
store i8 45, i8* %1
%32 = getelementptr inbounds i8, i8* %0, i64 7
%33 = tail call i32 @intbracket(i8* %32)
%34 = getelementptr inbounds i8, i8* %1, i64 1
%35 = bitcast i8* %34 to i32*
store i32 %33, i32* %35
br label %132
36: ; preds = %28
%37 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %36
store i8 1, i8* %1
%40 = getelementptr inbounds i8, i8* %1, i64 1
store i8 -40, i8* %40
%41 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -112, i8* %41
%42 = getelementptr inbounds i8, i8* %1, i64 3
store i8 -112, i8* %42
%43 = getelementptr inbounds i8, i8* %1, i64 4
store i8 -112, i8* %43
br label %132
44: ; preds = %36
%45 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %52
47: ; preds = %44
store i8 61, i8* %1
%48 = getelementptr inbounds i8, i8* %0, i64 7
%49 = tail call i32 @intbracket(i8* %48)
%50 = getelementptr inbounds i8, i8* %1, i64 1
%51 = bitcast i8* %50 to i32*
store i32 %49, i32* %51
br label %132
52: ; preds = %44
%53 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %68
55: ; preds = %52
store i8 65, i8* %1
%56 = getelementptr inbounds i8, i8* %1, i64 1
store i8 -117, i8* %56
%57 = getelementptr inbounds i8, i8* %0, i64 4
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, 65
%60 = select i1 %59, i8 68, i8 92
%61 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %60, i8* %61
%62 = getelementptr inbounds i8, i8* %1, i64 3
store i8 36, i8* %62
%63 = getelementptr inbounds i8, i8* %0, i64 7
%64 = tail call i32 @intbracket(i8* %63)
%65 = trunc i32 %64 to i8
%66 = shl i8 %65, 2
%67 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %66, i8* %67
br label %132
68: ; preds = %52
%69 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %84
71: ; preds = %68
store i8 65, i8* %1
%72 = getelementptr inbounds i8, i8* %1, i64 1
store i8 -119, i8* %72
%73 = getelementptr inbounds i8, i8* %0, i64 4
%74 = load i8, i8* %73
%75 = icmp eq i8 %74, 65
%76 = select i1 %75, i8 68, i8 92
%77 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %76, i8* %77
%78 = getelementptr inbounds i8, i8* %1, i64 3
store i8 36, i8* %78
%79 = getelementptr inbounds i8, i8* %0, i64 7
%80 = tail call i32 @intbracket(i8* %79)
%81 = trunc i32 %80 to i8
%82 = shl i8 %81, 2
%83 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %82, i8* %83
br label %132
84: ; preds = %68
%85 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %98
87: ; preds = %84
store i8 -30, i8* %1
%88 = getelementptr inbounds i8, i8* %1, i64 1
store i8 1, i8* %88
%89 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -61, i8* %89
%90 = getelementptr inbounds i8, i8* %1, i64 3
store i8 -21, i8* %90
%91 = getelementptr inbounds i8, i8* %0, i64 4
%92 = tail call i32 @intbracket(i8* %91)
%93 = sub nsw i32 %92, %2
%94 = trunc i32 %93 to i8
%95 = mul i8 %94, 5
%96 = add i8 %95, -5
%97 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %96, i8* %97
br label %132
98: ; preds = %84
%99 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %112
101: ; preds = %98
store i8 -30, i8* %1
%102 = getelementptr inbounds i8, i8* %1, i64 1
store i8 1, i8* %102
%103 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -61, i8* %103
%104 = getelementptr inbounds i8, i8* %1, i64 3
store i8 116, i8* %104
%105 = getelementptr inbounds i8, i8* %0, i64 4
%106 = tail call i32 @intbracket(i8* %105)
%107 = sub nsw i32 %106, %2
%108 = trunc i32 %107 to i8
%109 = mul i8 %108, 5
%110 = add i8 %109, -5
%111 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %110, i8* %111
br label %132
112: ; preds = %98
%113 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%114 = icmp eq i64 %113, 0
br i1 %114, label %115, label %126
115: ; preds = %112
store i8 -30, i8* %1
%116 = getelementptr inbounds i8, i8* %1, i64 1
store i8 1, i8* %116
%117 = getelementptr inbounds i8, i8* %1, i64 2
store i8 -61, i8* %117
%118 = getelementptr inbounds i8, i8* %1, i64 3
store i8 117, i8* %118
%119 = getelementptr inbounds i8, i8* %0, i64 4
%120 = tail call i32 @intbracket(i8* %119)
%121 = sub nsw i32 %120, %2
%122 = trunc i32 %121 to i8
%123 = mul i8 %122, 5
%124 = add i8 %123, -5
%125 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %124, i8* %125
br label %132
126: ; preds = %112
%127 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%128 = icmp eq i64 %127, 0
br i1 %128, label %129, label %130
129: ; preds = %126
store i8 -61, i8* %1
br label %132
130: ; preds = %126
%131 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0), i8* %0)
br label %132
132: ; preds = %23, %39, %55, %87, %115, %130, %129, %101, %71, %47, %31, %10, %15
ret void
}