// File: /workspace/github_c_makefile_star2_O2/mattn[P]orelang/mpc.c
// Function: mpc_err_string
char *mpc_err_string(mpc_err_t *x) {

  int i;  
  int pos = 0; 
  int max = 1023;
  char *buffer = calloc(1, 1024);
  
  if (x->failure) {
    mpc_err_string_cat(buffer, &pos, &max,
    "%s: error: %s\n", x->filename, x->failure);
    return buffer;
  }
  
  mpc_err_string_cat(buffer, &pos, &max, 
    "%s:%i:%i: error: expected ", x->filename, x->state.row+1, x->state.col+1);
  
  if (x->expected_num == 0) { mpc_err_string_cat(buffer, &pos, &max, "ERROR: NOTHING EXPECTED"); }
  if (x->expected_num == 1) { mpc_err_string_cat(buffer, &pos, &max, "%s", x->expected[0]); }
  if (x->expected_num >= 2) {
  
    for (i = 0; i < x->expected_num-2; i++) {
      mpc_err_string_cat(buffer, &pos, &max, "%s, ", x->expected[i]);
    } 
    
    mpc_err_string_cat(buffer, &pos, &max, "%s or %s", 
      x->expected[x->expected_num-2], 
      x->expected[x->expected_num-1]);
  }
  
  mpc_err_string_cat(buffer, &pos, &max, " at ");
  mpc_err_string_cat(buffer, &pos, &max, mpc_err_char_unescape(x->recieved));
  mpc_err_string_cat(buffer, &pos, &max, "\n");
  
  return realloc(buffer, strlen(buffer) + 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
andl $0x0, 0xc(%rsp)
pushq $0x1
popq %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x2140
movq %rax, %rbx
movq 0x20(%r14), %r8
movq 0x28(%r14), %r9
testq %r9, %r9
je 0x2498
leaq 0xde18(%rip), %rcx      # 0x10290
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x264e
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x8(%r14), %r9
movq 0x10(%r14), %rax
incq %r9
incq %rax
movq %rax, (%rsp)
leaq 0xddee(%rip), %rcx      # 0x1029f
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x264e
movl 0x18(%r14), %eax
testl %eax, %eax
jne 0x24e2
leaq 0xddeb(%rip), %rcx      # 0x102ba
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x264e
movl 0x18(%r14), %eax
cmpl $0x1, %eax
jne 0x2508
movq 0x30(%r14), %rax
movq (%rax), %r8
leaq 0xe0ae(%rip), %rcx      # 0x105a3
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x264e
movl 0x18(%r14), %eax
cmpl $0x2, %eax
jl 0x2569
leaq 0xddbe(%rip), %r15      # 0x102d2
leaq 0xc(%rsp), %r12
xorl %r13d, %r13d
leal -0x2(%rax), %ecx
movslq %ecx, %rdx
movq 0x30(%r14), %rcx
cmpq %rdx, %r13
jge 0x2548
movq (%rcx,%r13,8), %r8
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x264e
incq %r13
movl 0x18(%r14), %eax
jmp 0x251c
movq (%rcx,%rdx,8), %r8
cltq
movq -0x8(%rcx,%rax,8), %r9
leaq 0xdd7d(%rip), %rcx      # 0x102d7
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x264e
leaq 0xdd70(%rip), %rcx      # 0x102e0
leaq 0xc(%rsp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x264e
movzbl 0x38(%r14), %eax
movl $0x272027, 0x15c76(%rip) # imm = 0x272027
cmpq $0xd, %rax
ja 0x25ad
leaq 0xda69(%rip), %rcx      # 0x10004
movslq (%rcx,%rax,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
leaq 0xddff(%rip), %rcx      # 0x103aa
jmp 0x2607
cmpl $0x20, %eax
jne 0x25bb
leaq 0xde13(%rip), %rcx      # 0x103cc
jmp 0x2607
movb %al, 0x15c44(%rip)      # 0x18205
leaq 0x15c3c(%rip), %rcx     # 0x18204
jmp 0x2607
leaq 0xe02b(%rip), %rcx      # 0x105fc
jmp 0x2607
leaq 0xe019(%rip), %rcx      # 0x105f3
jmp 0x2607
leaq 0xe006(%rip), %rcx      # 0x105e9
jmp 0x2607
leaq 0xdff8(%rip), %rcx      # 0x105e4
jmp 0x2607
leaq 0xdde4(%rip), %rcx      # 0x103d9
jmp 0x2607
leaq 0xe017(%rip), %rcx      # 0x10615
jmp 0x2607
leaq 0xe005(%rip), %rcx      # 0x1060c
leaq 0xc(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x264e
leaq 0xf848(%rip), %rcx      # 0x11e68
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x264e
movq %rbx, %rdi
callq 0x20c0
leaq 0x1(%rax), %rsi
movq %rbx, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21e0