#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*/ printf(char *, ...);
int /*<<< orphan*/ processing_pending_instruction(char, unsigned int);
void processing_instruction(char instr) {
  static int label_stack[200000] = {0};
  static int label_ptr = 0;
  static int label_counter = 0;
  static char pending_instr = '\0';
  static unsigned int pending_counter = 0;
  switch (instr) {
  case '.': {
    if (pending_counter != 0) {
      processing_pending_instruction(pending_instr, pending_counter);
      pending_instr = '\0';
      pending_counter = 0;
    }
    printf("push eax\n");
    printf("sub esp, 0x4\n");
    printf("mov [esp], ah\n");
    printf("call write_byte\n");
    printf("add esp, 0x4\n");
    printf("pop eax\n");
    break;
  }
  case ',': {
    if (pending_counter != 0) {
      processing_pending_instruction(pending_instr, pending_counter);
      pending_instr = '\0';
      pending_counter = 0;
    }
    printf("push eax\n");
    printf("call read_byte\n");
    printf("mov bl, al\n");
    printf("pop eax\n");
    printf("mov ah, bl\n");
    printf("mov [data_str+esi], ah\n");
    break;
  }
  case '[': {
    if (pending_counter != 0) {
      processing_pending_instruction(pending_instr, pending_counter);
      pending_instr = '\0';
      pending_counter = 0;
    }
    label_stack[label_ptr] = label_counter++;
    label_stack[label_ptr + 1] = label_counter++;
    printf("cmp ah, 0\n");
    printf("je label_%x\n", label_stack[label_ptr]);
    printf("label_%x:\n", label_stack[label_ptr + 1]);
    label_ptr += 2;
    break;
  }
  case ']': {
    if (pending_counter != 0) {
      processing_pending_instruction(pending_instr, pending_counter);
      pending_instr = '\0';
      pending_counter = 0;
    }
    printf("cmp ah, 0\n");
    printf("jne label_%x\n", label_stack[--label_ptr]);
    printf("label_%x:\n", label_stack[--label_ptr]);
    break;
  }
  default: {
    if (instr == '<' || instr == '>' || instr == '+' || instr == '-') {
      if (pending_instr != instr) {
        processing_pending_instruction(pending_instr, pending_counter);
        pending_instr = instr;
        pending_counter = 1;
      } else {
        pending_counter++;
      }
    }
  }
  }
}


x86 assembly (clang, -O0):
<processing_instruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x2c,%eax
je     1201 <processing_instruction+0xe1>
jmp    1143 <processing_instruction+0x23>
mov    -0x8(%rbp),%eax
sub    $0x2e,%eax
je     1176 <processing_instruction+0x56>
jmp    1154 <processing_instruction+0x34>
mov    -0x8(%rbp),%eax
sub    $0x5b,%eax
je     128c <processing_instruction+0x16c>
jmp    1165 <processing_instruction+0x45>
mov    -0x8(%rbp),%eax
sub    $0x5d,%eax
je     136c <processing_instruction+0x24c>
jmp    1405 <processing_instruction+0x2e5>
cmpl   $0x0,0xc63cf(%rip)
je     11a8 <processing_instruction+0x88>
mov    0xc63bf(%rip),%al
mov    0xc63bd(%rip),%esi
movsbl %al,%edi
call   1040 <processing_pending_instruction@plt>
movb   $0x0,0xc63aa(%rip)
movl   $0x0,0xc63a4(%rip)
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1491 <processing_instruction+0x371>
cmpl   $0x0,0xc6344(%rip)
je     1233 <processing_instruction+0x113>
mov    0xc6334(%rip),%al
mov    0xc6332(%rip),%esi
movsbl %al,%edi
call   1040 <processing_pending_instruction@plt>
movb   $0x0,0xc631f(%rip)
movl   $0x0,0xc6319(%rip)
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1491 <processing_instruction+0x371>
cmpl   $0x0,0xc62b9(%rip)
je     12be <processing_instruction+0x19e>
mov    0xc62a9(%rip),%al
mov    0xc62a7(%rip),%esi
movsbl %al,%edi
call   1040 <processing_pending_instruction@plt>
movb   $0x0,0xc6294(%rip)
movl   $0x0,0xc628e(%rip)
mov    0xc6280(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0xc6275(%rip)
movslq 0xc626a(%rip),%rcx
lea    0x2d63(%rip),%rax
mov    %edx,(%rax,%rcx,4)
mov    0xc625e(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0xc6253(%rip)
mov    0xc6249(%rip),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2d3c(%rip),%rax
mov    %edx,(%rax,%rcx,4)
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq 0xc6224(%rip),%rcx
lea    0x2d1d(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xd6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xc6206(%rip),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2cf9(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xc61e2(%rip),%eax
add    $0x2,%eax
mov    %eax,0xc61d9(%rip)
jmp    1491 <processing_instruction+0x371>
cmpl   $0x0,0xc61d9(%rip)
je     139e <processing_instruction+0x27e>
mov    0xc61c9(%rip),%al
mov    0xc61c7(%rip),%esi
movsbl %al,%edi
call   1040 <processing_pending_instruction@plt>
movb   $0x0,0xc61b4(%rip)
movl   $0x0,0xc61ae(%rip)
lea    0xcea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xc618e(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0xc6185(%rip)
movslq %eax,%rcx
lea    0x2c7b(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xce3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xc6164(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0xc615b(%rip)
movslq %eax,%rcx
lea    0x2c51(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xcae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1491 <processing_instruction+0x371>
movsbl -0x1(%rbp),%eax
cmp    $0x3c,%eax
je     1439 <processing_instruction+0x319>
movsbl -0x1(%rbp),%eax
cmp    $0x3e,%eax
je     1439 <processing_instruction+0x319>
movsbl -0x1(%rbp),%eax
cmp    $0x2b,%eax
je     1439 <processing_instruction+0x319>
movsbl -0x1(%rbp),%eax
cmp    $0x2d,%eax
jne    148c <processing_instruction+0x36c>
movsbl 0xc6108(%rip),%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
je     1478 <processing_instruction+0x358>
mov    0xc60f6(%rip),%al
mov    0xc60f4(%rip),%esi
movsbl %al,%edi
call   1040 <processing_pending_instruction@plt>
mov    -0x1(%rbp),%al
mov    %al,0xc60df(%rip)
movl   $0x1,0xc60d9(%rip)
jmp    1487 <processing_instruction+0x367>
mov    0xc60ce(%rip),%eax
add    $0x1,%eax
mov    %eax,0xc60c5(%rip)
jmp    148c <processing_instruction+0x36c>
jmp    1491 <processing_instruction+0x371>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processing_instruction>:
push   %rbx
mov    %edi,%ebx
cmp    $0x5a,%edi
jg     11be <processing_instruction+0x8e>
cmp    $0x2c,%ebx
je     1251 <processing_instruction+0x121>
cmp    $0x2e,%ebx
jne    1355 <processing_instruction+0x225>
mov    0xc6408(%rip),%esi
test   %esi,%esi
je     1175 <processing_instruction+0x45>
movsbl 0xc63f9(%rip),%edi
call   1050 <processing_pending_instruction@plt>
movb   $0x0,0xc63ed(%rip)
movl   $0x0,0xc63e7(%rip)
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
cmp    $0x5b,%ebx
je     12c1 <processing_instruction+0x191>
cmp    $0x5d,%ebx
jne    1355 <processing_instruction+0x225>
mov    0xc6386(%rip),%esi
test   %esi,%esi
je     11f7 <processing_instruction+0xc7>
movsbl 0xc6377(%rip),%edi
call   1050 <processing_pending_instruction@plt>
movb   $0x0,0xc636b(%rip)
movl   $0x0,0xc6365(%rip)
lea    0xe28(%rip),%rdi
call   1030 <puts@plt>
movslq 0xc6346(%rip),%rax
lea    -0x1(%rax),%rcx
mov    %ecx,0xc633c(%rip)
lea    0x2e35(%rip),%rbx
mov    -0x4(%rbx,%rax,4),%esi
lea    0xdf2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xc631c(%rip),%rax
lea    -0x1(%rax),%rcx
mov    %ecx,0xc6312(%rip)
mov    -0x4(%rbx,%rax,4),%esi
lea    0xdc4(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
mov    0xc6305(%rip),%esi
test   %esi,%esi
je     1278 <processing_instruction+0x148>
movsbl 0xc62f6(%rip),%edi
call   1050 <processing_pending_instruction@plt>
movb   $0x0,0xc62ea(%rip)
movl   $0x0,0xc62e4(%rip)
lea    0xded(%rip),%rdi
call   1030 <puts@plt>
lea    0xda5(%rip),%rdi
call   1030 <puts@plt>
lea    0xda8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xd9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xd9a(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
mov    0xc6295(%rip),%esi
test   %esi,%esi
je     12e8 <processing_instruction+0x1b8>
movsbl 0xc6286(%rip),%edi
call   1050 <processing_pending_instruction@plt>
movb   $0x0,0xc627a(%rip)
movl   $0x0,0xc6274(%rip)
mov    0xc6266(%rip),%eax
lea    0x1(%rax),%ecx
movslq 0xc6258(%rip),%rdx
lea    0x2d51(%rip),%rbx
mov    %eax,(%rbx,%rdx,4)
add    $0x2,%eax
mov    %eax,0xc6249(%rip)
mov    %ecx,0x4(%rbx,%rdx,4)
lea    0xd10(%rip),%rdi
call   1030 <puts@plt>
movslq 0xc622e(%rip),%rax
mov    (%rbx,%rax,4),%esi
lea    0xcd4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0xc6216(%rip),%rax
mov    0x4(%rbx,%rax,4),%esi
lea    0xcc8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x2,0xc61fd(%rip)
pop    %rbx
ret
cmp    $0x3e,%bl
ja     1386 <processing_instruction+0x256>
movzbl %bl,%eax
movabs $0x5000280000000000,%rcx
bt     %rax,%rcx
jae    1386 <processing_instruction+0x256>
mov    0xc61e5(%rip),%al
mov    0xc61e3(%rip),%esi
cmp    %bl,%al
jne    1388 <processing_instruction+0x258>
add    $0x1,%esi
mov    %esi,0xc61d6(%rip)
pop    %rbx
ret
movsbl %al,%edi
call   1050 <processing_pending_instruction@plt>
mov    %bl,0xc61c2(%rip)
movl   $0x1,0xc61bc(%rip)
pop    %rbx
ret

LLVM IR (-O0):
@processing_instruction.label_stack = internal global [200000 x i32] zeroinitializer
@processing_instruction.label_ptr = internal global i32 0
@processing_instruction.label_counter = internal global i32 0
@processing_instruction.pending_instr = internal global i8 0
@processing_instruction.pending_counter = internal global i32 0
@.str = [10 x i8] c"push eax\0A\00"
@.str.1 = [14 x i8] c"sub esp, 0x4\0A\00"
@.str.2 = [15 x i8] c"mov [esp], ah\0A\00"
@.str.3 = [17 x i8] c"call write_byte\0A\00"
@.str.4 = [14 x i8] c"add esp, 0x4\0A\00"
@.str.5 = [9 x i8] c"pop eax\0A\00"
@.str.6 = [16 x i8] c"call read_byte\0A\00"
@.str.7 = [12 x i8] c"mov bl, al\0A\00"
@.str.8 = [12 x i8] c"mov ah, bl\0A\00"
@.str.9 = [24 x i8] c"mov [data_str+esi], ah\0A\00"
@.str.10 = [11 x i8] c"cmp ah, 0\0A\00"
@.str.11 = [13 x i8] c"je label_%x\0A\00"
@.str.12 = [11 x i8] c"label_%x:\0A\00"
@.str.13 = [14 x i8] c"jne label_%x\0A\00"
define void @processing_instruction(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %87 [
i32 46, label %5
i32 44, label %19
i32 91, label %33
i32 93, label %66
]
5: ; preds = %1
%6 = load i32, i32* @processing_instruction.pending_counter
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i8, i8* @processing_instruction.pending_instr
%10 = load i32, i32* @processing_instruction.pending_counter
%11 = call i32 @processing_pending_instruction(i8 signext %9, i32 %10)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %12
12: ; preds = %8, %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %119
19: ; preds = %1
%20 = load i32, i32* @processing_instruction.pending_counter
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = load i8, i8* @processing_instruction.pending_instr
%24 = load i32, i32* @processing_instruction.pending_counter
%25 = call i32 @processing_pending_instruction(i8 signext %23, i32 %24)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %26
26: ; preds = %22, %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
br label %119
33: ; preds = %1
%34 = load i32, i32* @processing_instruction.pending_counter
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %40
36: ; preds = %33
%37 = load i8, i8* @processing_instruction.pending_instr
%38 = load i32, i32* @processing_instruction.pending_counter
%39 = call i32 @processing_pending_instruction(i8 signext %37, i32 %38)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %40
40: ; preds = %36, %33
%41 = load i32, i32* @processing_instruction.label_counter
%42 = add nsw i32 %41, 1
store i32 %42, i32* @processing_instruction.label_counter
%43 = load i32, i32* @processing_instruction.label_ptr
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %44
store i32 %41, i32* %45
%46 = load i32, i32* @processing_instruction.label_counter
%47 = add nsw i32 %46, 1
store i32 %47, i32* @processing_instruction.label_counter
%48 = load i32, i32* @processing_instruction.label_ptr
%49 = add nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %50
store i32 %46, i32* %51
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%53 = load i32, i32* @processing_instruction.label_ptr
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %56)
%58 = load i32, i32* @processing_instruction.label_ptr
%59 = add nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 %62)
%64 = load i32, i32* @processing_instruction.label_ptr
%65 = add nsw i32 %64, 2
store i32 %65, i32* @processing_instruction.label_ptr
br label %119
66: ; preds = %1
%67 = load i32, i32* @processing_instruction.pending_counter
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %73
69: ; preds = %66
%70 = load i8, i8* @processing_instruction.pending_instr
%71 = load i32, i32* @processing_instruction.pending_counter
%72 = call i32 @processing_pending_instruction(i8 signext %70, i32 %71)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %73
73: ; preds = %69, %66
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
%75 = load i32, i32* @processing_instruction.label_ptr
%76 = add nsw i32 %75, -1
store i32 %76, i32* @processing_instruction.label_ptr
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i32 %79)
%81 = load i32, i32* @processing_instruction.label_ptr
%82 = add nsw i32 %81, -1
store i32 %82, i32* @processing_instruction.label_ptr
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %83
%85 = load i32, i32* %84
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 %85)
br label %119
87: ; preds = %1
%88 = load i8, i8* %2
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 60
br i1 %90, label %103, label %91
91: ; preds = %87
%92 = load i8, i8* %2
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 62
br i1 %94, label %103, label %95
95: ; preds = %91
%96 = load i8, i8* %2
%97 = sext i8 %96 to i32
%98 = icmp eq i32 %97, 43
br i1 %98, label %103, label %99
99: ; preds = %95
%100 = load i8, i8* %2
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 45
br i1 %102, label %103, label %118
103: ; preds = %99, %95, %91, %87
%104 = load i8, i8* @processing_instruction.pending_instr
%105 = sext i8 %104 to i32
%106 = load i8, i8* %2
%107 = sext i8 %106 to i32
%108 = icmp ne i32 %105, %107
br i1 %108, label %109, label %114
109: ; preds = %103
%110 = load i8, i8* @processing_instruction.pending_instr
%111 = load i32, i32* @processing_instruction.pending_counter
%112 = call i32 @processing_pending_instruction(i8 signext %110, i32 %111)
%113 = load i8, i8* %2
store i8 %113, i8* @processing_instruction.pending_instr
store i32 1, i32* @processing_instruction.pending_counter
br label %117
114: ; preds = %103
%115 = load i32, i32* @processing_instruction.pending_counter
%116 = add i32 %115, 1
store i32 %116, i32* @processing_instruction.pending_counter
br label %117
117: ; preds = %114, %109
br label %118
118: ; preds = %117, %99
br label %119
119: ; preds = %118, %73, %40, %26, %12
ret void
}

LLVM IR (-O2):
@processing_instruction.label_stack = internal unnamed_addr global [200000 x i32] zeroinitializer
@processing_instruction.label_ptr = internal unnamed_addr global i32 0
@processing_instruction.label_counter = internal unnamed_addr global i32 0
@processing_instruction.pending_instr = internal unnamed_addr global i8 0
@processing_instruction.pending_counter = internal unnamed_addr global i32 0
@.str.11 = [13 x i8] c"je label_%x\0A\00"
@.str.12 = [11 x i8] c"label_%x:\0A\00"
@.str.13 = [14 x i8] c"jne label_%x\0A\00"
@str.14 = [10 x i8] c"cmp ah, 0\00"
@str.16 = [15 x i8] c"call read_byte\00"
@str.17 = [11 x i8] c"mov bl, al\00"
@str.19 = [11 x i8] c"mov ah, bl\00"
@str.20 = [23 x i8] c"mov [data_str+esi], ah\00"
@str.21 = [9 x i8] c"push eax\00"
@str.22 = [13 x i8] c"sub esp, 0x4\00"
@str.23 = [14 x i8] c"mov [esp], ah\00"
@str.24 = [16 x i8] c"call write_byte\00"
@str.25 = [13 x i8] c"add esp, 0x4\00"
@str.26 = [8 x i8] c"pop eax\00"
define void @processing_instruction(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %79 [
i32 46, label %3
i32 44, label %16
i32 91, label %29
i32 93, label %59
]
3: ; preds = %1
%4 = load i32, i32* @processing_instruction.pending_counter
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i8, i8* @processing_instruction.pending_instr
%8 = tail call i32 @processing_pending_instruction(i8 signext %7, i32 %4)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %9
9: ; preds = %6, %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.21, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.23, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.24, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.25, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.26, i64 0, i64 0))
br label %88
16: ; preds = %1
%17 = load i32, i32* @processing_instruction.pending_counter
%18 = icmp eq i32 %17, 0
br i1 %18, label %22, label %19
19: ; preds = %16
%20 = load i8, i8* @processing_instruction.pending_instr
%21 = tail call i32 @processing_pending_instruction(i8 signext %20, i32 %17)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %22
22: ; preds = %19, %16
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.21, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.16, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.17, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.26, i64 0, i64 0))
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.19, i64 0, i64 0))
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.20, i64 0, i64 0))
br label %88
29: ; preds = %1
%30 = load i32, i32* @processing_instruction.pending_counter
%31 = icmp eq i32 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %29
%33 = load i8, i8* @processing_instruction.pending_instr
%34 = tail call i32 @processing_pending_instruction(i8 signext %33, i32 %30)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %35
35: ; preds = %32, %29
%36 = load i32, i32* @processing_instruction.label_counter
%37 = add nsw i32 %36, 1
%38 = load i32, i32* @processing_instruction.label_ptr
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %39
store i32 %36, i32* %40
%41 = add nsw i32 %36, 2
store i32 %41, i32* @processing_instruction.label_counter
%42 = add nsw i32 %38, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %43
store i32 %37, i32* %44
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.14, i64 0, i64 0))
%46 = load i32, i32* @processing_instruction.label_ptr
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i32 %49)
%51 = load i32, i32* @processing_instruction.label_ptr
%52 = add nsw i32 %51, 1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 %55)
%57 = load i32, i32* @processing_instruction.label_ptr
%58 = add nsw i32 %57, 2
store i32 %58, i32* @processing_instruction.label_ptr
br label %88
59: ; preds = %1
%60 = load i32, i32* @processing_instruction.pending_counter
%61 = icmp eq i32 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %59
%63 = load i8, i8* @processing_instruction.pending_instr
%64 = tail call i32 @processing_pending_instruction(i8 signext %63, i32 %60)
store i8 0, i8* @processing_instruction.pending_instr
store i32 0, i32* @processing_instruction.pending_counter
br label %65
65: ; preds = %62, %59
%66 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.14, i64 0, i64 0))
%67 = load i32, i32* @processing_instruction.label_ptr
%68 = add nsw i32 %67, -1
store i32 %68, i32* @processing_instruction.label_ptr
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %69
%71 = load i32, i32* %70
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i32 %71)
%73 = load i32, i32* @processing_instruction.label_ptr
%74 = add nsw i32 %73, -1
store i32 %74, i32* @processing_instruction.label_ptr
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [200000 x i32], [200000 x i32]* @processing_instruction.label_stack, i64 0, i64 %75
%77 = load i32, i32* %76
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i32 %77)
br label %88
79: ; preds = %1
switch i8 %0, label %88 [
i8 62, label %80
i8 60, label %80
i8 45, label %80
i8 43, label %80
]
80: ; preds = %79, %79, %79, %79
%81 = load i8, i8* @processing_instruction.pending_instr
%82 = icmp eq i8 %81, %0
%83 = load i32, i32* @processing_instruction.pending_counter
br i1 %82, label %86, label %84
84: ; preds = %80
%85 = tail call i32 @processing_pending_instruction(i8 signext %81, i32 %83)
store i8 %0, i8* @processing_instruction.pending_instr
store i32 1, i32* @processing_instruction.pending_counter
br label %88
86: ; preds = %80
%87 = add i32 %83, 1
store i32 %87, i32* @processing_instruction.pending_counter
br label %88
88: ; preds = %79, %86, %84, %65, %35, %22, %9
ret void
}