// File: /workspace/github_c_makefile_star2_O0/mattn[P]orelang/slre.c
// Function: foo
static int foo(const char *re, int re_len, const char *s, int s_len,
               struct regex_info *info) {
  int i, step, depth = 0;

  /* First bracket captures everything */
  info->brackets[0].ptr = re;
  info->brackets[0].len = re_len;
  info->num_brackets = 1;

  /* Make a single pass over regex string, memorize brackets and branches */
  for (i = 0; i < re_len; i += step) {
    step = get_op_len(re + i, re_len - i);

    if (re[i] == '|') {
      FAIL_IF(info->num_branches >= (int) ARRAY_SIZE(info->branches),
              SLRE_TOO_MANY_BRANCHES);
      info->branches[info->num_branches].bracket_index =
        info->brackets[info->num_brackets - 1].len == -1 ?
        info->num_brackets - 1 : depth;
      info->branches[info->num_branches].schlong = &re[i];
      info->num_branches++;
    } else if (re[i] == '\\') {
      FAIL_IF(i >= re_len - 1, SLRE_INVALID_METACHARACTER);
      if (re[i + 1] == 'x') {
        /* Hex digit specification must follow */
        FAIL_IF(re[i + 1] == 'x' && i >= re_len - 3,
                SLRE_INVALID_METACHARACTER);
        FAIL_IF(re[i + 1] ==  'x' && !(isxdigit(re[i + 2]) &&
                isxdigit(re[i + 3])), SLRE_INVALID_METACHARACTER);
      } else {
        FAIL_IF(!is_metacharacter((unsigned char *) re + i + 1),
                SLRE_INVALID_METACHARACTER);
      }
    } else if (re[i] == '(') {
      FAIL_IF(info->num_brackets >= (int) ARRAY_SIZE(info->brackets),
              SLRE_TOO_MANY_BRACKETS);
      depth++;  /* Order is important here. Depth increments first. */
      info->brackets[info->num_brackets].ptr = re + i + 1;
      info->brackets[info->num_brackets].len = -1;
      info->num_brackets++;
      FAIL_IF(info->num_caps > 0 && info->num_brackets - 1 > info->num_caps,
              SLRE_CAPS_ARRAY_TOO_SMALL);
    } else if (re[i] == ')') {
      int ind = info->brackets[info->num_brackets - 1].len == -1 ?
        info->num_brackets - 1 : depth;
      info->brackets[ind].len = (int) (&re[i] - info->brackets[ind].ptr);
      DBG(("SETTING BRACKET %d [%.*s]\n",
           ind, info->brackets[ind].len, info->brackets[ind].ptr));
      depth--;
      FAIL_IF(depth < 0, SLRE_UNBALANCED_BRACKETS);
      FAIL_IF(i > 0 && re[i - 1] == '(', SLRE_NO_MATCH);
    }
  }

  FAIL_IF(depth != 0, SLRE_UNBALANCED_BRACKETS);
  setup_branch_points(info);

  return baz(s, s_len, info);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x10(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl -0x14(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl $0x1, 0x960(%rax)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xed99
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rax
addq %rax, %rdi
movl -0x14(%rbp), %esi
subl -0x34(%rbp), %esi
callq 0xedd0
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x7c, %eax
jne 0xeadb
movq -0x30(%rbp), %rax
cmpl $0x64, 0xfa8(%rax)
jl 0xea3e
movl $0xfffffff8, -0x4(%rbp) # imm = 0xFFFFFFF8
jmp 0xedc4
movq -0x30(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x960(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x8(%rax)
jne 0xea71
movq -0x30(%rbp), %rax
movl 0x960(%rax), %eax
subl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xea77
movl -0x3c(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %ecx
movq -0x30(%rbp), %rax
addq $0x968, %rax            # imm = 0x968
movq -0x30(%rbp), %rdx
movslq 0xfa8(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rcx
movslq -0x34(%rbp), %rax
addq %rax, %rcx
movq -0x30(%rbp), %rax
addq $0x968, %rax            # imm = 0x968
movq -0x30(%rbp), %rdx
movslq 0xfa8(%rdx), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movl 0xfa8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xfa8(%rax)
jmp 0xed89
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
jne 0xebf6
movl -0x34(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0xeb09
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
jmp 0xedc4
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x78, %eax
jne 0xebca
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x78, %eax
jne 0xeb52
movl -0x34(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jl 0xeb52
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
jmp 0xedc4
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x78, %eax
jne 0xebc8
callq 0x2270
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
addl $0x2, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
je 0xebbc
callq 0x2270
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl -0x34(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x1000, %eax           # imm = 0x1000
cmpl $0x0, %eax
jne 0xebc8
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
jmp 0xedc4
jmp 0xebf1
movq -0x10(%rbp), %rdi
movslq -0x34(%rbp), %rax
addq %rax, %rdi
addq $0x1, %rdi
callq 0xee20
cmpl $0x0, %eax
jne 0xebef
movl $0xfffffffa, -0x4(%rbp) # imm = 0xFFFFFFFA
jmp 0xedc4
jmp 0xebf1
jmp 0xed87
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
jne 0xecbc
movq -0x30(%rbp), %rax
cmpl $0x64, 0x960(%rax)
jl 0xec24
movl $0xfffffff7, -0x4(%rbp) # imm = 0xFFFFFFF7
jmp 0xedc4
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rcx
movslq -0x34(%rbp), %rax
addq %rax, %rcx
addq $0x1, %rcx
movq -0x30(%rbp), %rax
movq -0x30(%rbp), %rdx
movslq 0x960(%rdx), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movq -0x30(%rbp), %rcx
movslq 0x960(%rcx), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movl $0xffffffff, 0x8(%rax)  # imm = 0xFFFFFFFF
movq -0x30(%rbp), %rax
movl 0x960(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x960(%rax)
movq -0x30(%rbp), %rax
cmpl $0x0, 0xfb8(%rax)
jle 0xecb7
movq -0x30(%rbp), %rax
movl 0x960(%rax), %eax
subl $0x1, %eax
movq -0x30(%rbp), %rcx
cmpl 0xfb8(%rcx), %eax
jle 0xecb7
movl $0xfffffff9, -0x4(%rbp) # imm = 0xFFFFFFF9
jmp 0xedc4
jmp 0xed85
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x29, %eax
jne 0xed83
movq -0x30(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x960(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpl $-0x1, 0x8(%rax)
jne 0xed04
movq -0x30(%rbp), %rax
movl 0x960(%rax), %eax
subl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0xed0a
movl -0x3c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
addq %rcx, %rax
movq -0x30(%rbp), %rcx
movslq -0x40(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movslq -0x40(%rbp), %rdx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x3c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jge 0xed5c
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0xedc4
cmpl $0x0, -0x34(%rbp)
jle 0xed81
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x28, %eax
jne 0xed81
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xedc4
jmp 0xed83
jmp 0xed85
jmp 0xed87
jmp 0xed89
jmp 0xed8b
movl -0x38(%rbp), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0xe9eb
cmpl $0x0, -0x3c(%rbp)
je 0xeda8
movl $0xfffffffd, -0x4(%rbp) # imm = 0xFFFFFFFD
jmp 0xedc4
movq -0x30(%rbp), %rdi
callq 0xee60
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x30(%rbp), %rdx
callq 0xf040
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)