// File: /workspace/github_c_makefile_star2_O0/voithos[P]awl/src/mpc.c
// Function: mpcf_re_range
static mpc_val_t *mpcf_re_range(mpc_val_t *x) {
  
  mpc_parser_t *out;
  char *range = calloc(1,1);
  char *tmp = NULL;
  char *s = x;
  char start, end;
  int i, j;
  int comp = 0;
  
  if (s[0] == '\0') { free(x); return mpc_fail("Invalid Regex Range Expression"); } 
  if (s[0] == '^' && 
      s[1] == '\0') { free(x); return mpc_fail("Invalid Regex Range Expression"); }
  
  if (s[0] == '^') { comp = 1;}
  
  for (i = comp; i < strlen(s); i++){
    
    /* Regex Range Escape */
    if (s[i] == '\\') {
      tmp = mpc_re_range_escape_char(s[i+1]);
      if (tmp != NULL) {
        range = realloc(range, strlen(range) + strlen(tmp) + 1);
        strcat(range, tmp);
      } else {
        range = realloc(range, strlen(range) + 1 + 1);
        range[strlen(range) + 1] = '\0';
        range[strlen(range) + 0] = s[i+1];      
      }
      i++;
    }
    
    /* Regex Range...Range */
    else if (s[i] == '-') {
      if (s[i+1] == '\0' || i == 0) {
          range = realloc(range, strlen(range) + strlen("-") + 1);
          strcat(range, "-");
      } else {
        start = s[i-1]+1;
        end = s[i+1]-1;
        for (j = start; j <= end; j++) {
          range = realloc(range, strlen(range) + 1 + 1);
          range[strlen(range) + 1] = '\0';
          range[strlen(range) + 0] = j;
        }        
      }
    }
    
    /* Regex Range Normal */
    else {
      range = realloc(range, strlen(range) + 1 + 1);
      range[strlen(range) + 1] = '\0';
      range[strlen(range) + 0] = s[i];
    }
  
  }
  
  out = comp ? mpc_noneof(range) : mpc_oneof(range);
  
  free(x);
  free(range);
  
  return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x10(%rbp)
movl $0x1, %esi
movq %rsi, %rdi
callq 0x21c0
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x10201
movq -0x10(%rbp), %rdi
callq 0x23a0
leaq 0xafc2(%rip), %rdi      # 0x1b1b5
callq 0xdf50
movq %rax, -0x8(%rbp)
jmp 0x105a5
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
jne 0x10238
movq -0x30(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x10238
movq -0x10(%rbp), %rdi
callq 0x23a0
leaq 0xaf8b(%rip), %rdi      # 0x1b1b5
callq 0xdf50
movq %rax, -0x8(%rbp)
jmp 0x105a5
movq -0x30(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
jne 0x1024b
movl $0x1, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x38(%rbp)
movslq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
callq 0x20f0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x10558
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x5c, %eax
jne 0x10372
movq -0x30(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edi
callq 0x14550
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x102ed
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq %rax, -0x58(%rbp)
movq -0x28(%rbp), %rdi
callq 0x20f0
movq -0x58(%rbp), %rsi
movq -0x50(%rbp), %rdi
addq %rax, %rsi
addq $0x1, %rsi
callq 0x22a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2320
jmp 0x10364
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq -0x78(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
addq $0x1, %rsi
callq 0x22a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movb $0x0, 0x1(%rax,%rcx)
movq -0x30(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %al
movb %al, -0x61(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movb -0x61(%rbp), %dl
movq %rax, %rcx
movq -0x60(%rbp), %rax
movb %dl, (%rax,%rcx)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x10548
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x104bc
movq -0x30(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x103a3
cmpl $0x0, -0x38(%rbp)
jne 0x103e1
movq -0x20(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq -0x80(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
addq $0x1, %rsi
callq 0x22a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
leaq 0xac52(%rip), %rsi      # 0x1b029
callq 0x2320
jmp 0x104b7
movq -0x30(%rbp), %rax
movl -0x38(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
addl $0x1, %eax
movb %al, -0x31(%rbp)
movq -0x30(%rbp), %rax
movl -0x38(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
subl $0x1, %eax
movb %al, -0x32(%rbp)
movsbl -0x31(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movsbl -0x32(%rbp), %ecx
cmpl %ecx, %eax
jg 0x104b5
movq -0x20(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
addq $0x1, %rsi
callq 0x22a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq %rax, %rcx
movq -0x98(%rbp), %rax
movb $0x0, 0x1(%rax,%rcx)
movl -0x3c(%rbp), %eax
movb %al, -0x89(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movb -0x89(%rbp), %dl
movq %rax, %rcx
movq -0x88(%rbp), %rax
movb %dl, (%rax,%rcx)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x10416
jmp 0x104b7
jmp 0x10546
movq -0x20(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq -0xc0(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
addq $0x1, %rsi
callq 0x22a0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
movb $0x0, 0x1(%rax,%rcx)
movq -0x30(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0xa9(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x20f0
movb -0xa9(%rbp), %dl
movq %rax, %rcx
movq -0xa8(%rbp), %rax
movb %dl, (%rax,%rcx)
jmp 0x10548
jmp 0x1054a
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x10251
cmpl $0x0, -0x40(%rbp)
je 0x10570
movq -0x20(%rbp), %rdi
callq 0xe350
movq %rax, -0xc8(%rbp)
jmp 0x10580
movq -0x20(%rbp), %rdi
callq 0xe2e0
movq %rax, -0xc8(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x23a0
movq -0x20(%rbp), %rdi
callq 0x23a0
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)