#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*/ erase(char *, int, int);
int /*<<< orphan*/ free(char *);
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
scalar_t__ isspace(char);
int /*<<< orphan*/ printf(char *, char *);
char *string_insert(char *, int, int, char);
int prepare_expression(char **str, int len, int *is_free) {
  if ((*str)[0] == '"' && (*str)[len - 1] == '"') {
    return 1;
  }
  int left_bracket = 0;
  int right_bracket = 0;
  int quotation = 0;
  int i = 0;
  char *p = *str;
  char the_char;
  char *the_previous = NULL;
  char *the_next = NULL;
  for (i = 0; i < len; i++) {
    the_char = *p;
    if (the_char == '"')
      quotation++;
    if (*p == '(')
      left_bracket++;
    if (*p == ')')
      right_bracket++;
    int j = i, k = i;
    if (j > 0) {
      the_previous = p - 1;
      j--;
      while (isspace(*the_previous) && j > 0) {
        the_previous--;
        j--;
      }
    }
    if (k < len - 1) {
      the_next = p + 1;
      k++;
      while (isspace(*the_next) && k < len - 1) {
        the_next++;
        k++;
      }
    }
    if (the_char == '-') {
      if (i == len - 1 ||
          !(isdigit(*the_next) || isalpha(*the_next) || *the_next == '(')) {
        printf("Warning: Grammar Mistake in \"%s\".\n", *str);
        return 0;
      }
      if (i == 0) {
        char *new_string = string_insert(*str, len, 0, '0');
        if (*is_free == 1)
          free(*str);
        *str = new_string;
        *is_free = 1;
        len++;
        p = *str;
        p++;
        continue;
      }
      if (the_previous && !(isdigit(*the_previous) || *the_previous == ')' ||
                            isalpha(*the_previous))) {
        char *the_next_2 = p + 1;
        if (isspace(*the_next_2)) {
          erase(*str, len, i + 1);
          len--;
          i--;
          continue;
        }
        if (*the_previous != '(') {
          char *new_string = string_insert(*str, len, i, '(');
          int k = 0;
          char *p2 = new_string;
          int left_b = 0;
          int right_b = 0;
          while (k < len + 1) {
            if (k > i + 1) {
              if (*p2 == '(')
                left_b++;
              if (*p2 == ')')
                right_b++;
              if (left_b == right_b && left_b == 0) {
                if (!isdigit(*p2) && *p2 != '.' && !isalpha(*p2))
                  break;
              }
              if (left_b == right_b && left_b > 0) {
                break;
              }
            }
            p2++;
            k++;
          }
          char *new_string2 = string_insert(new_string, len + 1, k, ')');
          free(new_string);
          if (*is_free)
            free(*str);
          *str = new_string2;
          *is_free = 1;
          len += 2;
          p = new_string2;
          k = 0;
          while (k < i) {
            p++;
            k++;
          }
          p++;
          left_bracket++;
          continue;
        }
      }
      if (the_previous && *the_previous == '(') {
        char *new_string = string_insert(*str, len, i, '0');
        if (*is_free)
          free(*str);
        *str = new_string;
        *is_free = 1;
        len++;
        p = *str;
        int index = 0;
        while (index <= i) {
          p++;
          index++;
        }
        continue;
      }
    }
    if (the_char == '+') {
      if (i == len - 1 || !(isdigit(*the_next) || isalpha(*the_next) ||
                            *the_next == '(' || *the_next == '-')) {
        printf("Warning: Grammar Mistake in \"%s\".\n", *str);
        return 0;
      }
      if (i == 0 || !(isdigit(*the_previous) || isalpha(*the_previous) ||
                      *the_previous == ')')) {
        erase(*str, len, i);
        len--;
        p++;
        continue;
      }
    }
    if (the_char == '*' || the_char == '/' || the_char == '%' ||
        the_char == '^') {
      if ((i == 0 || !(isdigit(*the_previous) || isalpha(*the_previous) ||
                       *the_previous == ')')) ||
          i == len - 1 ||
          !(isdigit(*the_next) || isalpha(*the_next) || *the_next == '(' ||
            *the_next == '+' || *the_next == '-')) {
        printf("Warning: Grammar Mistake in \"%s\".\n", *str);
        return 0;
      }
    }
    p++;
  }
  if (left_bracket != right_bracket || quotation % 2) {
    printf("Warning: Grammar Mistake in -- %s --.\n", *str);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<prepare_expression>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    11c2 <prepare_expression+0x52>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
jne    11c2 <prepare_expression+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1a34 <prepare_expression+0x8c4>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    19ee <prepare_expression+0x87e>
mov    -0x38(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x39(%rbp)
movsbl -0x39(%rbp),%eax
cmp    $0x22,%eax
jne    122b <prepare_expression+0xbb>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
jne    1244 <prepare_expression+0xd4>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
jne    125d <prepare_expression+0xed>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x54(%rbp)
jle    12e8 <prepare_expression+0x178>
mov    -0x38(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1080 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9d(%rbp)
je     12b6 <prepare_expression+0x146>
cmpl   $0x0,-0x54(%rbp)
setg   %al
mov    %al,-0x9d(%rbp)
mov    -0x9d(%rbp),%al
test   $0x1,%al
jne    12c9 <prepare_expression+0x159>
jmp    12e3 <prepare_expression+0x173>
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    1288 <prepare_expression+0x118>
jmp    12e8 <prepare_expression+0x178>
mov    -0x58(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1375 <prepare_expression+0x205>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1080 <isspace@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9e(%rbp)
je     1343 <prepare_expression+0x1d3>
mov    -0x58(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setl   %al
mov    %al,-0x9e(%rbp)
mov    -0x9e(%rbp),%al
test   $0x1,%al
jne    1356 <prepare_expression+0x1e6>
jmp    1370 <prepare_expression+0x200>
mov    -0x50(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    130e <prepare_expression+0x19e>
jmp    1375 <prepare_expression+0x205>
movsbl -0x39(%rbp),%eax
cmp    $0x2d,%eax
jne    17c9 <prepare_expression+0x659>
mov    -0x30(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     13cf <prepare_expression+0x25f>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    13ee <prepare_expression+0x27e>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
cmp    $0x0,%rax
jne    13ee <prepare_expression+0x27e>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
je     13ee <prepare_expression+0x27e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xc23(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a34 <prepare_expression+0x8c4>
cmpl   $0x0,-0x30(%rbp)
jne    1465 <prepare_expression+0x2f5>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
mov    $0x30,%ecx
call   1050 <string_insert@plt>
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x1,(%rax)
jne    142b <prepare_expression+0x2bb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    19e0 <prepare_expression+0x870>
cmpq   $0x0,-0x48(%rbp)
je     1708 <prepare_expression+0x598>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    1708 <prepare_expression+0x598>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
je     1708 <prepare_expression+0x598>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
cmp    $0x0,%rax
jne    1708 <prepare_expression+0x598>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
movsbl (%rax),%edi
call   1080 <isspace@plt>
cmp    $0x0,%rax
je     14fa <prepare_expression+0x38a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
mov    -0x30(%rbp),%edx
add    $0x1,%edx
call   1070 <erase@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    19e0 <prepare_expression+0x870>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
je     1703 <prepare_expression+0x593>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    $0x28,%ecx
call   1050 <string_insert@plt>
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
mov    -0x74(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1650 <prepare_expression+0x4e0>
mov    -0x74(%rbp),%eax
mov    -0x30(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jle    1636 <prepare_expression+0x4c6>
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
jne    1589 <prepare_expression+0x419>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
jne    15a8 <prepare_expression+0x438>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x88(%rbp),%eax
jne    160d <prepare_expression+0x49d>
cmpl   $0x0,-0x84(%rbp)
jne    160d <prepare_expression+0x49d>
mov    -0x80(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    1608 <prepare_expression+0x498>
mov    -0x80(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1608 <prepare_expression+0x498>
mov    -0x80(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
cmp    $0x0,%rax
jne    1608 <prepare_expression+0x498>
jmp    1650 <prepare_expression+0x4e0>
jmp    160d <prepare_expression+0x49d>
mov    -0x84(%rbp),%eax
cmp    -0x88(%rbp),%eax
jne    1631 <prepare_expression+0x4c1>
cmpl   $0x0,-0x84(%rbp)
jle    1631 <prepare_expression+0x4c1>
jmp    1650 <prepare_expression+0x4e0>
jmp    1636 <prepare_expression+0x4c6>
mov    -0x80(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1548 <prepare_expression+0x3d8>
mov    -0x70(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x74(%rbp),%edx
mov    $0x29,%ecx
call   1050 <string_insert@plt>
mov    %rax,-0x90(%rbp)
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
je     1690 <prepare_expression+0x520>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x90(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x14(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x90(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    16e9 <prepare_expression+0x579>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    16c3 <prepare_expression+0x553>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    19e0 <prepare_expression+0x870>
jmp    1708 <prepare_expression+0x598>
cmpq   $0x0,-0x48(%rbp)
je     17c4 <prepare_expression+0x654>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
jne    17c4 <prepare_expression+0x654>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    $0x30,%ecx
call   1050 <string_insert@plt>
mov    %rax,-0x98(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
je     175a <prepare_expression+0x5ea>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     17bf <prepare_expression+0x64f>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1790 <prepare_expression+0x620>
jmp    19e0 <prepare_expression+0x870>
jmp    17c9 <prepare_expression+0x659>
movsbl -0x39(%rbp),%eax
cmp    $0x2b,%eax
jne    18c9 <prepare_expression+0x759>
mov    -0x30(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1833 <prepare_expression+0x6c3>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    1852 <prepare_expression+0x6e2>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
cmp    $0x0,%rax
jne    1852 <prepare_expression+0x6e2>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
je     1852 <prepare_expression+0x6e2>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1852 <prepare_expression+0x6e2>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x7bf(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a34 <prepare_expression+0x8c4>
cmpl   $0x0,-0x30(%rbp)
je     1898 <prepare_expression+0x728>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    18c4 <prepare_expression+0x754>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
cmp    $0x0,%rax
jne    18c4 <prepare_expression+0x754>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
je     18c4 <prepare_expression+0x754>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%esi
mov    -0x30(%rbp),%edx
call   1070 <erase@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    19e0 <prepare_expression+0x870>
jmp    18c9 <prepare_expression+0x759>
movsbl -0x39(%rbp),%eax
cmp    $0x2a,%eax
je     18fd <prepare_expression+0x78d>
movsbl -0x39(%rbp),%eax
cmp    $0x2f,%eax
je     18fd <prepare_expression+0x78d>
movsbl -0x39(%rbp),%eax
cmp    $0x25,%eax
je     18fd <prepare_expression+0x78d>
movsbl -0x39(%rbp),%eax
cmp    $0x5e,%eax
jne    19d4 <prepare_expression+0x864>
cmpl   $0x0,-0x30(%rbp)
je     19b0 <prepare_expression+0x840>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    1943 <prepare_expression+0x7d3>
mov    -0x48(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
cmp    $0x0,%rax
jne    1943 <prepare_expression+0x7d3>
mov    -0x48(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x29,%eax
jne    19b0 <prepare_expression+0x840>
mov    -0x30(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     19b0 <prepare_expression+0x840>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%rax
jne    19cf <prepare_expression+0x85f>
mov    -0x50(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isalpha@plt>
cmp    $0x0,%rax
jne    19cf <prepare_expression+0x85f>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x28,%eax
je     19cf <prepare_expression+0x85f>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     19cf <prepare_expression+0x85f>
mov    -0x50(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     19cf <prepare_expression+0x85f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x642(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a34 <prepare_expression+0x8c4>
jmp    19d4 <prepare_expression+0x864>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1200 <prepare_expression+0x90>
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    1a0e <prepare_expression+0x89e>
mov    -0x2c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1a2d <prepare_expression+0x8bd>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x607(%rip),%rdi
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1a34 <prepare_expression+0x8c4>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prepare_expression>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdx,0x30(%rsp)
mov    %rdi,0x28(%rsp)
mov    (%rdi),%rdx
mov    (%rdx),%r12b
cmp    $0x22,%r12b
jne    11a7 <prepare_expression+0x37>
movslq %esi,%rcx
mov    $0x1,%eax
cmpb   $0x22,-0x1(%rcx,%rdx,1)
je     17c1 <prepare_expression+0x651>
test   %esi,%esi
jle    178e <prepare_expression+0x61e>
mov    %rdx,0x20(%rsp)
mov    %rsi,0x40(%rsp)
xor    %eax,%eax
mov    %rax,0x38(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
xor    %r14d,%r14d
xor    %ebp,%ebp
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmp    $0x22,%r12b
sete   0x7(%rsp)
xor    %r13d,%r13d
cmp    $0x28,%r12b
sete   0x1f(%rsp)
cmp    $0x29,%r12b
sete   0x6(%rsp)
mov    %rax,0x8(%rsp)
test   %eax,%eax
jle    123c <prepare_expression+0xcc>
mov    0x20(%rsp),%rbp
mov    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl -0x1(%rbp),%edi
add    $0xffffffffffffffff,%rbp
call   1080 <isspace@plt>
test   %rax,%rax
je     123c <prepare_expression+0xcc>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1220 <prepare_expression+0xb0>
mov    0x40(%rsp),%rax
lea    -0x1(%rax),%r15d
cmp    %r15d,0x8(%rsp)
jge    127d <prepare_expression+0x10d>
mov    0x8(%rsp),%rax
lea    0x1(%rax),%ebx
mov    0x20(%rsp),%r14
nopl   0x0(%rax)
movsbl 0x1(%r14),%edi
add    $0x1,%r14
call   1080 <isspace@plt>
test   %rax,%rax
je     127d <prepare_expression+0x10d>
lea    0x1(%rbx),%eax
cmp    %r15d,%ebx
mov    %eax,%ebx
jl     1260 <prepare_expression+0xf0>
mov    0x1f(%rsp),%al
mov    %al,%r13b
mov    0x38(%rsp),%rbx
add    %r13d,%ebx
add    $0xdb,%r12b
cmp    $0x39,%r12b
mov    0x40(%rsp),%r13
ja     1550 <prepare_expression+0x3e0>
movzbl %r12b,%eax
movabs $0x200000000000421,%rcx
bt     %rax,%rcx
jae    1340 <prepare_expression+0x1d0>
cmpl   $0x0,0x8(%rsp)
je     1785 <prepare_expression+0x615>
movsbl 0x0(%rbp),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    12e2 <prepare_expression+0x172>
movsbl 0x0(%rbp),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
je     14cf <prepare_expression+0x35f>
cmp    %r15d,0x8(%rsp)
je     1785 <prepare_expression+0x615>
movsbl (%r14),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1550 <prepare_expression+0x3e0>
movsbl (%r14),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
jne    1550 <prepare_expression+0x3e0>
movzbl (%r14),%eax
cmp    $0x2d,%rax
ja     1785 <prepare_expression+0x615>
movabs $0x290000000000,%rcx
bt     %rax,%rcx
jb     1550 <prepare_expression+0x3e0>
jmp    1785 <prepare_expression+0x615>
nopl   0x0(%rax,%rax,1)
cmp    $0x6,%rax
je     143b <prepare_expression+0x2cb>
cmp    $0x8,%rax
jne    1550 <prepare_expression+0x3e0>
cmp    %r15d,0x8(%rsp)
je     1785 <prepare_expression+0x615>
movsbl (%r14),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1385 <prepare_expression+0x215>
movsbl (%r14),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
jne    1385 <prepare_expression+0x215>
cmpb   $0x28,(%r14)
jne    1785 <prepare_expression+0x615>
cmpl   $0x0,0x8(%rsp)
je     14e9 <prepare_expression+0x379>
test   %rbp,%rbp
je     1550 <prepare_expression+0x3e0>
movsbl 0x0(%rbp),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
je     153e <prepare_expression+0x3ce>
cmpb   $0x28,0x0(%rbp)
jne    1550 <prepare_expression+0x3e0>
mov    0x28(%rsp),%r15
mov    (%r15),%rdi
mov    %r13d,%esi
mov    0x8(%rsp),%rdx
mov    $0x30,%ecx
call   1050 <string_insert@plt>
mov    %rax,%r9
mov    0x30(%rsp),%rax
cmpl   $0x0,(%rax)
je     13ea <prepare_expression+0x27a>
mov    (%r15),%rdi
mov    %r9,%r12
call   1030 <free@plt>
mov    %r12,%r9
mov    %r9,(%r15)
mov    0x30(%rsp),%rax
movl   $0x1,(%rax)
add    $0x1,%r13d
mov    0x8(%rsp),%rax
test   %eax,%eax
mov    0x18(%rsp),%r15d
mov    0x14(%rsp),%ecx
mov    $0x0,%edx
mov    $0x0,%esi
mov    0x7(%rsp),%dil
mov    0x6(%rsp),%r8b
js     1575 <prepare_expression+0x405>
mov    0x8(%rsp),%eax
add    %rax,%r9
add    $0x1,%r9
mov    0x8(%rsp),%rax
jmp    1575 <prepare_expression+0x405>
cmp    %r15d,0x8(%rsp)
je     1785 <prepare_expression+0x615>
movsbl (%r14),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1471 <prepare_expression+0x301>
movsbl (%r14),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
jne    1471 <prepare_expression+0x301>
mov    (%r14),%al
cmp    $0x2d,%al
je     1471 <prepare_expression+0x301>
cmp    $0x28,%al
jne    1785 <prepare_expression+0x615>
cmpl   $0x0,0x8(%rsp)
je     14a6 <prepare_expression+0x336>
movsbl 0x0(%rbp),%edi
call   1040 <isdigit@plt>
test   %rax,%rax
jne    1550 <prepare_expression+0x3e0>
movsbl 0x0(%rbp),%edi
call   1090 <isalpha@plt>
test   %rax,%rax
jne    1550 <prepare_expression+0x3e0>
cmpb   $0x29,0x0(%rbp)
je     1550 <prepare_expression+0x3e0>
mov    0x28(%rsp),%rax
mov    (%rax),%rdi
mov    %r13d,%esi
mov    0x8(%rsp),%r12
mov    %r12d,%edx
call   1070 <erase@plt>
mov    %r12,%rax
mov    0x20(%rsp),%r9
add    $0x1,%r9
mov    %r15d,%r13d
jmp    1533 <prepare_expression+0x3c3>
cmpb   $0x29,0x0(%rbp)
jne    1785 <prepare_expression+0x615>
cmp    %r15d,0x8(%rsp)
jne    12ed <prepare_expression+0x17d>
jmp    1785 <prepare_expression+0x615>
mov    0x28(%rsp),%r15
mov    (%r15),%rdi
mov    %r13d,%esi
xor    %edx,%edx
mov    $0x30,%ecx
call   1050 <string_insert@plt>
mov    %rax,%r9
mov    0x30(%rsp),%rax
cmpl   $0x1,(%rax)
jne    151b <prepare_expression+0x3ab>
mov    (%r15),%rdi
mov    %r9,%r12
call   1030 <free@plt>
mov    %r12,%r9
mov    %r9,(%r15)
mov    0x30(%rsp),%rax
movl   $0x1,(%rax)
add    $0x1,%r13d
add    $0x1,%r9
xor    %eax,%eax
mov    0x18(%rsp),%r15d
mov    0x14(%rsp),%ecx
jmp    1567 <prepare_expression+0x3f7>
mov    0x0(%rbp),%al
cmp    $0x29,%al
jne    15ac <prepare_expression+0x43c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x20(%rsp),%r9
add    $0x1,%r9
mov    0x18(%rsp),%r15d
mov    0x14(%rsp),%ecx
mov    0x8(%rsp),%rax
xor    %edx,%edx
xor    %esi,%esi
mov    0x7(%rsp),%dil
mov    0x6(%rsp),%r8b
mov    %dil,%dl
add    %edx,%ecx
mov    %r8b,%sil
add    %esi,%r15d
add    $0x1,%eax
cmp    %r13d,%eax
jge    1797 <prepare_expression+0x627>
mov    %ecx,0x14(%rsp)
mov    %r13,0x40(%rsp)
mov    %r15d,0x18(%rsp)
mov    %rbx,0x38(%rsp)
mov    %r9,0x20(%rsp)
mov    (%r9),%r12b
jmp    11e0 <prepare_expression+0x70>
movsbl %al,%edi
call   1090 <isalpha@plt>
test   %rax,%rax
jne    13ab <prepare_expression+0x23b>
mov    0x20(%rsp),%rax
movsbl 0x1(%rax),%edi
call   1080 <isspace@plt>
test   %rax,%rax
je     1614 <prepare_expression+0x4a4>
mov    0x28(%rsp),%rax
mov    (%rax),%rdi
mov    0x8(%rsp),%r12
lea    0x1(%r12),%edx
mov    %r13d,%esi
call   1070 <erase@plt>
mov    %r12,%rax
add    $0xffffffff,%eax
mov    %r15d,%r13d
mov    0x18(%rsp),%r15d
mov    0x14(%rsp),%ecx
xor    %edx,%edx
xor    %esi,%esi
mov    0x7(%rsp),%dil
mov    0x6(%rsp),%r8b
mov    0x20(%rsp),%r9
jmp    1575 <prepare_expression+0x405>
cmpb   $0x28,0x0(%rbp)
je     13b5 <prepare_expression+0x245>
mov    %rbx,0x38(%rsp)
mov    0x28(%rsp),%r12
mov    (%r12),%rdi
mov    %r13d,%esi
mov    0x8(%rsp),%rbx
mov    %ebx,%edx
mov    $0x28,%ecx
call   1050 <string_insert@plt>
test   %r13d,%r13d
js     16fe <prepare_expression+0x58e>
add    $0x1,%ebx
lea    0x1(%r13),%esi
xor    %r13d,%r13d
xor    %ecx,%ecx
xor    %r12d,%r12d
mov    %rax,%rdi
mov    %ebx,0x20(%rsp)
jmp    1676 <prepare_expression+0x506>
xor    %ecx,%ecx
mov    %rbx,%rsi
mov    %r15,%rdi
mov    0x20(%rsp),%ebx
add    $0x1,%r13
cmp    %r13d,%esi
je     16f4 <prepare_expression+0x584>
cmp    %ebx,%r13d
jle    166d <prepare_expression+0x4fd>
movzbl (%rdi,%r13,1),%eax
xor    %edx,%edx
cmp    $0x28,%al
sete   %dl
add    %edx,%r12d
xor    %edx,%edx
cmp    $0x29,%al
sete   %dl
add    %edx,%ecx
cmp    %ecx,%r12d
jne    16c6 <prepare_expression+0x556>
test   %r12d,%r12d
jne    16c6 <prepare_expression+0x556>
mov    %rdi,%r15
mov    %rsi,%rbx
movsbl %al,%edi
call   1040 <isdigit@plt>
xor    %r12d,%r12d
test   %rax,%rax
jne    1661 <prepare_expression+0x4f1>
movzbl (%r15,%r13,1),%eax
cmp    $0x2e,%al
jne    16d2 <prepare_expression+0x562>
mov    %r15,%rdi
xor    %ecx,%ecx
mov    %rbx,%rsi
jmp    1669 <prepare_expression+0x4f9>
cmp    %ecx,%r12d
jne    166d <prepare_expression+0x4fd>
test   %r12d,%r12d
jle    166d <prepare_expression+0x4fd>
jmp    16f7 <prepare_expression+0x587>
movsbl %al,%edi
call   1090 <isalpha@plt>
mov    %r15,%rdi
mov    $0x0,%ecx
test   %rax,%rax
mov    %rbx,%rsi
mov    0x20(%rsp),%ebx
jne    166d <prepare_expression+0x4fd>
jmp    16f7 <prepare_expression+0x587>
mov    %esi,%r13d
mov    0x28(%rsp),%r12
jmp    1708 <prepare_expression+0x598>
lea    0x1(%r13),%esi
xor    %r13d,%r13d
mov    %rax,%rdi
mov    %rdi,%rbx
mov    %r13d,%edx
mov    $0x29,%ecx
call   1050 <string_insert@plt>
mov    %rax,0x20(%rsp)
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rax
cmpl   $0x0,(%rax)
mov    0x18(%rsp),%r15d
je     173d <prepare_expression+0x5cd>
mov    (%r12),%rdi
call   1030 <free@plt>
mov    0x40(%rsp),%r13
add    $0x2,%r13d
mov    0x8(%rsp),%rdx
lea    -0x1(%rdx),%eax
test   %edx,%edx
mov    0x20(%rsp),%rsi
mov    %rsi,(%r12)
mov    0x30(%rsp),%rcx
movl   $0x1,(%rcx)
lea    0x1(%rsi,%rax,1),%r9
mov    %rdx,%rax
cmovle %rsi,%r9
add    $0x1,%r9
mov    0x38(%rsp),%rbx
add    $0x1,%ebx
mov    0x14(%rsp),%ecx
jmp    1567 <prepare_expression+0x3f7>
lea    0x874(%rip),%rdi
jmp    17b2 <prepare_expression+0x642>
xor    %r15d,%r15d
mov    $0x1,%cl
xor    %ebx,%ebx
jmp    179d <prepare_expression+0x62d>
test   $0x1,%cl
sete   %cl
lea    0x87f(%rip),%rdi
cmp    %r15d,%ebx
jne    17b2 <prepare_expression+0x642>
mov    $0x1,%eax
test   %cl,%cl
jne    17c1 <prepare_expression+0x651>
mov    0x28(%rsp),%rax
mov    (%rax),%rsi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Warning: Grammar Mistake in \22%s\22.\0A\00"
@.str.1 = [39 x i8] c"Warning: Grammar Mistake in -- %s --.\0A\00"
define i32 @prepare_expression(i8** %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i32
%22 = alloca i8*
%23 = alloca i32
%24 = alloca i32
%25 = alloca i8*
%26 = alloca i8*
%27 = alloca i32
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%28 = load i8**, i8*** %5
%29 = load i8*, i8** %28
%30 = getelementptr inbounds i8, i8* %29, i64 0
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 34
br i1 %33, label %34, label %45
34: ; preds = %3
%35 = load i8**, i8*** %5
%36 = load i8*, i8** %35
%37 = load i32, i32* %6
%38 = sub nsw i32 %37, 1
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %36, i64 %39
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 34
br i1 %43, label %44, label %45
44: ; preds = %34
store i32 1, i32* %4
br label %523
45: ; preds = %34, %3
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
%46 = load i8**, i8*** %5
%47 = load i8*, i8** %46
store i8* %47, i8** %12
store i8* null, i8** %14
store i8* null, i8** %15
store i32 0, i32* %11
br label %48
48: ; preds = %507, %45
%49 = load i32, i32* %11
%50 = load i32, i32* %6
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %510
52: ; preds = %48
%53 = load i8*, i8** %12
%54 = load i8, i8* %53
store i8 %54, i8* %13
%55 = load i8, i8* %13
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 34
br i1 %57, label %58, label %61
58: ; preds = %52
%59 = load i32, i32* %10
%60 = add nsw i32 %59, 1
store i32 %60, i32* %10
br label %61
61: ; preds = %58, %52
%62 = load i8*, i8** %12
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 40
br i1 %65, label %66, label %69
66: ; preds = %61
%67 = load i32, i32* %8
%68 = add nsw i32 %67, 1
store i32 %68, i32* %8
br label %69
69: ; preds = %66, %61
%70 = load i8*, i8** %12
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 %72, 41
br i1 %73, label %74, label %77
74: ; preds = %69
%75 = load i32, i32* %9
%76 = add nsw i32 %75, 1
store i32 %76, i32* %9
br label %77
77: ; preds = %74, %69
%78 = load i32, i32* %11
store i32 %78, i32* %16
%79 = load i32, i32* %11
store i32 %79, i32* %17
%80 = load i32, i32* %16
%81 = icmp sgt i32 %80, 0
br i1 %81, label %82, label %103
82: ; preds = %77
%83 = load i8*, i8** %12
%84 = getelementptr inbounds i8, i8* %83, i64 -1
store i8* %84, i8** %14
%85 = load i32, i32* %16
%86 = add nsw i32 %85, -1
store i32 %86, i32* %16
br label %87
87: ; preds = %97, %82
%88 = load i8*, i8** %14
%89 = load i8, i8* %88
%90 = call i64 @isspace(i8 signext %89)
%91 = icmp ne i64 %90, 0
br i1 %91, label %92, label %95
92: ; preds = %87
%93 = load i32, i32* %16
%94 = icmp sgt i32 %93, 0
br label %95
95: ; preds = %92, %87
%96 = phi i1 [ false, %87 ], [ %94, %92 ]
br i1 %96, label %97, label %102
97: ; preds = %95
%98 = load i8*, i8** %14
%99 = getelementptr inbounds i8, i8* %98, i32 -1
store i8* %99, i8** %14
%100 = load i32, i32* %16
%101 = add nsw i32 %100, -1
store i32 %101, i32* %16
br label %87
102: ; preds = %95
br label %103
103: ; preds = %102, %77
%104 = load i32, i32* %17
%105 = load i32, i32* %6
%106 = sub nsw i32 %105, 1
%107 = icmp slt i32 %104, %106
br i1 %107, label %108, label %131
108: ; preds = %103
%109 = load i8*, i8** %12
%110 = getelementptr inbounds i8, i8* %109, i64 1
store i8* %110, i8** %15
%111 = load i32, i32* %17
%112 = add nsw i32 %111, 1
store i32 %112, i32* %17
br label %113
113: ; preds = %125, %108
%114 = load i8*, i8** %15
%115 = load i8, i8* %114
%116 = call i64 @isspace(i8 signext %115)
%117 = icmp ne i64 %116, 0
br i1 %117, label %118, label %123
118: ; preds = %113
%119 = load i32, i32* %17
%120 = load i32, i32* %6
%121 = sub nsw i32 %120, 1
%122 = icmp slt i32 %119, %121
br label %123
123: ; preds = %118, %113
%124 = phi i1 [ false, %113 ], [ %122, %118 ]
br i1 %124, label %125, label %130
125: ; preds = %123
%126 = load i8*, i8** %15
%127 = getelementptr inbounds i8, i8* %126, i32 1
store i8* %127, i8** %15
%128 = load i32, i32* %17
%129 = add nsw i32 %128, 1
store i32 %129, i32* %17
br label %113
130: ; preds = %123
br label %131
131: ; preds = %130, %103
%132 = load i8, i8* %13
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 45
br i1 %134, label %135, label %373
135: ; preds = %131
%136 = load i32, i32* %11
%137 = load i32, i32* %6
%138 = sub nsw i32 %137, 1
%139 = icmp eq i32 %136, %138
br i1 %139, label %155, label %140
140: ; preds = %135
%141 = load i8*, i8** %15
%142 = load i8, i8* %141
%143 = call i64 @isdigit(i8 signext %142)
%144 = icmp ne i64 %143, 0
br i1 %144, label %159, label %145
145: ; preds = %140
%146 = load i8*, i8** %15
%147 = load i8, i8* %146
%148 = call i64 @isalpha(i8 signext %147)
%149 = icmp ne i64 %148, 0
br i1 %149, label %159, label %150
150: ; preds = %145
%151 = load i8*, i8** %15
%152 = load i8, i8* %151
%153 = sext i8 %152 to i32
%154 = icmp eq i32 %153, 40
br i1 %154, label %159, label %155
155: ; preds = %150, %135
%156 = load i8**, i8*** %5
%157 = load i8*, i8** %156
%158 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %157)
store i32 0, i32* %4
br label %523
159: ; preds = %150, %145, %140
%160 = load i32, i32* %11
%161 = icmp eq i32 %160, 0
br i1 %161, label %162, label %184
162: ; preds = %159
%163 = load i8**, i8*** %5
%164 = load i8*, i8** %163
%165 = load i32, i32* %6
%166 = call i8* @string_insert(i8* %164, i32 %165, i32 0, i8 signext 48)
store i8* %166, i8** %18
%167 = load i32*, i32** %7
%168 = load i32, i32* %167
%169 = icmp eq i32 %168, 1
br i1 %169, label %170, label %174
170: ; preds = %162
%171 = load i8**, i8*** %5
%172 = load i8*, i8** %171
%173 = call i32 @free(i8* %172)
br label %174
174: ; preds = %170, %162
%175 = load i8*, i8** %18
%176 = load i8**, i8*** %5
store i8* %175, i8** %176
%177 = load i32*, i32** %7
store i32 1, i32* %177
%178 = load i32, i32* %6
%179 = add nsw i32 %178, 1
store i32 %179, i32* %6
%180 = load i8**, i8*** %5
%181 = load i8*, i8** %180
store i8* %181, i8** %12
%182 = load i8*, i8** %12
%183 = getelementptr inbounds i8, i8* %182, i32 1
store i8* %183, i8** %12
br label %507
184: ; preds = %159
%185 = load i8*, i8** %14
%186 = icmp ne i8* %185, null
br i1 %186, label %187, label %333
187: ; preds = %184
%188 = load i8*, i8** %14
%189 = load i8, i8* %188
%190 = call i64 @isdigit(i8 signext %189)
%191 = icmp ne i64 %190, 0
br i1 %191, label %333, label %192
192: ; preds = %187
%193 = load i8*, i8** %14
%194 = load i8, i8* %193
%195 = sext i8 %194 to i32
%196 = icmp eq i32 %195, 41
br i1 %196, label %333, label %197
197: ; preds = %192
%198 = load i8*, i8** %14
%199 = load i8, i8* %198
%200 = call i64 @isalpha(i8 signext %199)
%201 = icmp ne i64 %200, 0
br i1 %201, label %333, label %202
202: ; preds = %197
%203 = load i8*, i8** %12
%204 = getelementptr inbounds i8, i8* %203, i64 1
store i8* %204, i8** %19
%205 = load i8*, i8** %19
%206 = load i8, i8* %205
%207 = call i64 @isspace(i8 signext %206)
%208 = icmp ne i64 %207, 0
br i1 %208, label %209, label %220
209: ; preds = %202
%210 = load i8**, i8*** %5
%211 = load i8*, i8** %210
%212 = load i32, i32* %6
%213 = load i32, i32* %11
%214 = add nsw i32 %213, 1
%215 = call i32 @erase(i8* %211, i32 %212, i32 %214)
%216 = load i32, i32* %6
%217 = add nsw i32 %216, -1
store i32 %217, i32* %6
%218 = load i32, i32* %11
%219 = add nsw i32 %218, -1
store i32 %219, i32* %11
br label %507
220: ; preds = %202
%221 = load i8*, i8** %14
%222 = load i8, i8* %221
%223 = sext i8 %222 to i32
%224 = icmp ne i32 %223, 40
br i1 %224, label %225, label %332
225: ; preds = %220
%226 = load i8**, i8*** %5
%227 = load i8*, i8** %226
%228 = load i32, i32* %6
%229 = load i32, i32* %11
%230 = call i8* @string_insert(i8* %227, i32 %228, i32 %229, i8 signext 40)
store i8* %230, i8** %20
store i32 0, i32* %21
%231 = load i8*, i8** %20
store i8* %231, i8** %22
store i32 0, i32* %23
store i32 0, i32* %24
br label %232
232: ; preds = %291, %225
%233 = load i32, i32* %21
%234 = load i32, i32* %6
%235 = add nsw i32 %234, 1
%236 = icmp slt i32 %233, %235
br i1 %236, label %237, label %296
237: ; preds = %232
%238 = load i32, i32* %21
%239 = load i32, i32* %11
%240 = add nsw i32 %239, 1
%241 = icmp sgt i32 %238, %240
br i1 %241, label %242, label %291
242: ; preds = %237
%243 = load i8*, i8** %22
%244 = load i8, i8* %243
%245 = sext i8 %244 to i32
%246 = icmp eq i32 %245, 40
br i1 %246, label %247, label %250
247: ; preds = %242
%248 = load i32, i32* %23
%249 = add nsw i32 %248, 1
store i32 %249, i32* %23
br label %250
250: ; preds = %247, %242
%251 = load i8*, i8** %22
%252 = load i8, i8* %251
%253 = sext i8 %252 to i32
%254 = icmp eq i32 %253, 41
br i1 %254, label %255, label %258
255: ; preds = %250
%256 = load i32, i32* %24
%257 = add nsw i32 %256, 1
store i32 %257, i32* %24
br label %258
258: ; preds = %255, %250
%259 = load i32, i32* %23
%260 = load i32, i32* %24
%261 = icmp eq i32 %259, %260
br i1 %261, label %262, label %282
262: ; preds = %258
%263 = load i32, i32* %23
%264 = icmp eq i32 %263, 0
br i1 %264, label %265, label %282
265: ; preds = %262
%266 = load i8*, i8** %22
%267 = load i8, i8* %266
%268 = call i64 @isdigit(i8 signext %267)
%269 = icmp ne i64 %268, 0
br i1 %269, label %281, label %270
270: ; preds = %265
%271 = load i8*, i8** %22
%272 = load i8, i8* %271
%273 = sext i8 %272 to i32
%274 = icmp ne i32 %273, 46
br i1 %274, label %275, label %281
275: ; preds = %270
%276 = load i8*, i8** %22
%277 = load i8, i8* %276
%278 = call i64 @isalpha(i8 signext %277)
%279 = icmp ne i64 %278, 0
br i1 %279, label %281, label %280
280: ; preds = %275
br label %296
281: ; preds = %275, %270, %265
br label %282
282: ; preds = %281, %262, %258
%283 = load i32, i32* %23
%284 = load i32, i32* %24
%285 = icmp eq i32 %283, %284
br i1 %285, label %286, label %290
286: ; preds = %282
%287 = load i32, i32* %23
%288 = icmp sgt i32 %287, 0
br i1 %288, label %289, label %290
289: ; preds = %286
br label %296
290: ; preds = %286, %282
br label %291
291: ; preds = %290, %237
%292 = load i8*, i8** %22
%293 = getelementptr inbounds i8, i8* %292, i32 1
store i8* %293, i8** %22
%294 = load i32, i32* %21
%295 = add nsw i32 %294, 1
store i32 %295, i32* %21
br label %232
296: ; preds = %289, %280, %232
%297 = load i8*, i8** %20
%298 = load i32, i32* %6
%299 = add nsw i32 %298, 1
%300 = load i32, i32* %21
%301 = call i8* @string_insert(i8* %297, i32 %299, i32 %300, i8 signext 41)
store i8* %301, i8** %25
%302 = load i8*, i8** %20
%303 = call i32 @free(i8* %302)
%304 = load i32*, i32** %7
%305 = load i32, i32* %304
%306 = icmp ne i32 %305, 0
br i1 %306, label %307, label %311
307: ; preds = %296
%308 = load i8**, i8*** %5
%309 = load i8*, i8** %308
%310 = call i32 @free(i8* %309)
br label %311
311: ; preds = %307, %296
%312 = load i8*, i8** %25
%313 = load i8**, i8*** %5
store i8* %312, i8** %313
%314 = load i32*, i32** %7
store i32 1, i32* %314
%315 = load i32, i32* %6
%316 = add nsw i32 %315, 2
store i32 %316, i32* %6
%317 = load i8*, i8** %25
store i8* %317, i8** %12
store i32 0, i32* %21
br label %318
318: ; preds = %322, %311
%319 = load i32, i32* %21
%320 = load i32, i32* %11
%321 = icmp slt i32 %319, %320
br i1 %321, label %322, label %327
322: ; preds = %318
%323 = load i8*, i8** %12
%324 = getelementptr inbounds i8, i8* %323, i32 1
store i8* %324, i8** %12
%325 = load i32, i32* %21
%326 = add nsw i32 %325, 1
store i32 %326, i32* %21
br label %318
327: ; preds = %318
%328 = load i8*, i8** %12
%329 = getelementptr inbounds i8, i8* %328, i32 1
store i8* %329, i8** %12
%330 = load i32, i32* %8
%331 = add nsw i32 %330, 1
store i32 %331, i32* %8
br label %507
332: ; preds = %220
br label %333
333: ; preds = %332, %197, %192, %187, %184
%334 = load i8*, i8** %14
%335 = icmp ne i8* %334, null
br i1 %335, label %336, label %372
336: ; preds = %333
%337 = load i8*, i8** %14
%338 = load i8, i8* %337
%339 = sext i8 %338 to i32
%340 = icmp eq i32 %339, 40
br i1 %340, label %341, label %372
341: ; preds = %336
%342 = load i8**, i8*** %5
%343 = load i8*, i8** %342
%344 = load i32, i32* %6
%345 = load i32, i32* %11
%346 = call i8* @string_insert(i8* %343, i32 %344, i32 %345, i8 signext 48)
store i8* %346, i8** %26
%347 = load i32*, i32** %7
%348 = load i32, i32* %347
%349 = icmp ne i32 %348, 0
br i1 %349, label %350, label %354
350: ; preds = %341
%351 = load i8**, i8*** %5
%352 = load i8*, i8** %351
%353 = call i32 @free(i8* %352)
br label %354
354: ; preds = %350, %341
%355 = load i8*, i8** %26
%356 = load i8**, i8*** %5
store i8* %355, i8** %356
%357 = load i32*, i32** %7
store i32 1, i32* %357
%358 = load i32, i32* %6
%359 = add nsw i32 %358, 1
store i32 %359, i32* %6
%360 = load i8**, i8*** %5
%361 = load i8*, i8** %360
store i8* %361, i8** %12
store i32 0, i32* %27
br label %362
362: ; preds = %366, %354
%363 = load i32, i32* %27
%364 = load i32, i32* %11
%365 = icmp sle i32 %363, %364
br i1 %365, label %366, label %371
366: ; preds = %362
%367 = load i8*, i8** %12
%368 = getelementptr inbounds i8, i8* %367, i32 1
store i8* %368, i8** %12
%369 = load i32, i32* %27
%370 = add nsw i32 %369, 1
store i32 %370, i32* %27
br label %362
371: ; preds = %362
br label %507
372: ; preds = %336, %333
br label %373
373: ; preds = %372, %131
%374 = load i8, i8* %13
%375 = sext i8 %374 to i32
%376 = icmp eq i32 %375, 43
br i1 %376, label %377, label %435
377: ; preds = %373
%378 = load i32, i32* %11
%379 = load i32, i32* %6
%380 = sub nsw i32 %379, 1
%381 = icmp eq i32 %378, %380
br i1 %381, label %402, label %382
382: ; preds = %377
%383 = load i8*, i8** %15
%384 = load i8, i8* %383
%385 = call i64 @isdigit(i8 signext %384)
%386 = icmp ne i64 %385, 0
br i1 %386, label %406, label %387
387: ; preds = %382
%388 = load i8*, i8** %15
%389 = load i8, i8* %388
%390 = call i64 @isalpha(i8 signext %389)
%391 = icmp ne i64 %390, 0
br i1 %391, label %406, label %392
392: ; preds = %387
%393 = load i8*, i8** %15
%394 = load i8, i8* %393
%395 = sext i8 %394 to i32
%396 = icmp eq i32 %395, 40
br i1 %396, label %406, label %397
397: ; preds = %392
%398 = load i8*, i8** %15
%399 = load i8, i8* %398
%400 = sext i8 %399 to i32
%401 = icmp eq i32 %400, 45
br i1 %401, label %406, label %402
402: ; preds = %397, %377
%403 = load i8**, i8*** %5
%404 = load i8*, i8** %403
%405 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %404)
store i32 0, i32* %4
br label %523
406: ; preds = %397, %392, %387, %382
%407 = load i32, i32* %11
%408 = icmp eq i32 %407, 0
br i1 %408, label %424, label %409
409: ; preds = %406
%410 = load i8*, i8** %14
%411 = load i8, i8* %410
%412 = call i64 @isdigit(i8 signext %411)
%413 = icmp ne i64 %412, 0
br i1 %413, label %434, label %414
414: ; preds = %409
%415 = load i8*, i8** %14
%416 = load i8, i8* %415
%417 = call i64 @isalpha(i8 signext %416)
%418 = icmp ne i64 %417, 0
br i1 %418, label %434, label %419
419: ; preds = %414
%420 = load i8*, i8** %14
%421 = load i8, i8* %420
%422 = sext i8 %421 to i32
%423 = icmp eq i32 %422, 41
br i1 %423, label %434, label %424
424: ; preds = %419, %406
%425 = load i8**, i8*** %5
%426 = load i8*, i8** %425
%427 = load i32, i32* %6
%428 = load i32, i32* %11
%429 = call i32 @erase(i8* %426, i32 %427, i32 %428)
%430 = load i32, i32* %6
%431 = add nsw i32 %430, -1
store i32 %431, i32* %6
%432 = load i8*, i8** %12
%433 = getelementptr inbounds i8, i8* %432, i32 1
store i8* %433, i8** %12
br label %507
434: ; preds = %419, %414, %409
br label %435
435: ; preds = %434, %373
%436 = load i8, i8* %13
%437 = sext i8 %436 to i32
%438 = icmp eq i32 %437, 42
br i1 %438, label %451, label %439
439: ; preds = %435
%440 = load i8, i8* %13
%441 = sext i8 %440 to i32
%442 = icmp eq i32 %441, 47
br i1 %442, label %451, label %443
443: ; preds = %439
%444 = load i8, i8* %13
%445 = sext i8 %444 to i32
%446 = icmp eq i32 %445, 37
br i1 %446, label %451, label %447
447: ; preds = %443
%448 = load i8, i8* %13
%449 = sext i8 %448 to i32
%450 = icmp eq i32 %449, 94
br i1 %450, label %451, label %504
451: ; preds = %447, %443, %439, %435
%452 = load i32, i32* %11
%453 = icmp eq i32 %452, 0
br i1 %453, label %499, label %454
454: ; preds = %451
%455 = load i8*, i8** %14
%456 = load i8, i8* %455
%457 = call i64 @isdigit(i8 signext %456)
%458 = icmp ne i64 %457, 0
br i1 %458, label %469, label %459
459: ; preds = %454
%460 = load i8*, i8** %14
%461 = load i8, i8* %460
%462 = call i64 @isalpha(i8 signext %461)
%463 = icmp ne i64 %462, 0
br i1 %463, label %469, label %464
464: ; preds = %459
%465 = load i8*, i8** %14
%466 = load i8, i8* %465
%467 = sext i8 %466 to i32
%468 = icmp eq i32 %467, 41
br i1 %468, label %469, label %499
469: ; preds = %464, %459, %454
%470 = load i32, i32* %11
%471 = load i32, i32* %6
%472 = sub nsw i32 %471, 1
%473 = icmp eq i32 %470, %472
br i1 %473, label %499, label %474
474: ; preds = %469
%475 = load i8*, i8** %15
%476 = load i8, i8* %475
%477 = call i64 @isdigit(i8 signext %476)
%478 = icmp ne i64 %477, 0
br i1 %478, label %503, label %479
479: ; preds = %474
%480 = load i8*, i8** %15
%481 = load i8, i8* %480
%482 = call i64 @isalpha(i8 signext %481)
%483 = icmp ne i64 %482, 0
br i1 %483, label %503, label %484
484: ; preds = %479
%485 = load i8*, i8** %15
%486 = load i8, i8* %485
%487 = sext i8 %486 to i32
%488 = icmp eq i32 %487, 40
br i1 %488, label %503, label %489
489: ; preds = %484
%490 = load i8*, i8** %15
%491 = load i8, i8* %490
%492 = sext i8 %491 to i32
%493 = icmp eq i32 %492, 43
br i1 %493, label %503, label %494
494: ; preds = %489
%495 = load i8*, i8** %15
%496 = load i8, i8* %495
%497 = sext i8 %496 to i32
%498 = icmp eq i32 %497, 45
br i1 %498, label %503, label %499
499: ; preds = %494, %469, %464, %451
%500 = load i8**, i8*** %5
%501 = load i8*, i8** %500
%502 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %501)
store i32 0, i32* %4
br label %523
503: ; preds = %494, %489, %484, %479, %474
br label %504
504: ; preds = %503, %447
%505 = load i8*, i8** %12
%506 = getelementptr inbounds i8, i8* %505, i32 1
store i8* %506, i8** %12
br label %507
507: ; preds = %504, %424, %371, %327, %209, %174
%508 = load i32, i32* %11
%509 = add nsw i32 %508, 1
store i32 %509, i32* %11
br label %48
510: ; preds = %48
%511 = load i32, i32* %8
%512 = load i32, i32* %9
%513 = icmp ne i32 %511, %512
br i1 %513, label %518, label %514
514: ; preds = %510
%515 = load i32, i32* %10
%516 = srem i32 %515, 2
%517 = icmp ne i32 %516, 0
br i1 %517, label %518, label %522
518: ; preds = %514, %510
%519 = load i8**, i8*** %5
%520 = load i8*, i8** %519
%521 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %520)
store i32 0, i32* %4
br label %523
522: ; preds = %514
store i32 1, i32* %4
br label %523
523: ; preds = %522, %518, %499, %402, %155, %44
%524 = load i32, i32* %4
ret i32 %524
}

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