// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x3ff, -0x1c(%rbp)     # imm = 0x3FF
movl $0x1, %edi
movl $0x400, %esi            # imm = 0x400
callq 0x2120
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x24ef
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x28(%rax), %r9
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x17edf(%rip), %rcx     # 0x1a3ba
movb $0x0, %al
callq 0x26c0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x26ab
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x20(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %r9
addq $0x1, %r9
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x1, %rax
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x17ea7(%rip), %rcx     # 0x1a3c9
movq %rax, (%rsp)
movb $0x0, %al
callq 0x26c0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x18(%rax)
jne 0x2551
movq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x17e9a(%rip), %rcx     # 0x1a3e4
movb $0x0, %al
callq 0x26c0
movq -0x10(%rbp), %rax
cmpl $0x1, 0x18(%rax)
jne 0x2580
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq (%rax), %r8
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x18156(%rip), %rcx     # 0x1a6cf
movb $0x0, %al
callq 0x26c0
movq -0x10(%rbp), %rax
cmpl $0x2, 0x18(%rax)
jl 0x2627
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x25db
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %r8
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x17e33(%rip), %rcx     # 0x1a3fc
movb $0x0, %al
callq 0x26c0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x2595
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %r8
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x18(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %r9
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x17de1(%rip), %rcx     # 0x1a401
movb $0x0, %al
callq 0x26c0
movq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x17dd0(%rip), %rcx     # 0x1a40a
movb $0x0, %al
callq 0x26c0
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movsbl 0x38(%rax), %edi
callq 0x2790
movq -0x38(%rbp), %rdi
movq %rax, %rcx
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
movb $0x0, %al
callq 0x26c0
movq -0x28(%rbp), %rdi
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
leaq 0x19961(%rip), %rcx     # 0x1bfe0
movb $0x0, %al
callq 0x26c0
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
callq 0x20b0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x21c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)