// File: /workspace/github_c_makefile_star2_O1/voithos[P]awl/src/mpc.c
// Function: mpc_err_repeat
static mpc_err_t *mpc_err_repeat(mpc_err_t *x, const char *prefix) {

  int i;
  char *expect = malloc(strlen(prefix) + 1);
  strcpy(expect, prefix);
  
  if (x->expected_num == 1) {
    expect = realloc(expect, strlen(expect) + strlen(x->expected[0]) + 1);
    strcat(expect, x->expected[0]);
  }
  
  if (x->expected_num > 1) {
  
    for (i = 0; i < x->expected_num-2; i++) {
      expect = realloc(expect, strlen(expect) + strlen(x->expected[i]) + strlen(", ") + 1);
      strcat(expect, x->expected[i]);
      strcat(expect, ", ");
    }
    
    expect = realloc(expect, strlen(expect) + strlen(x->expected[x->expected_num-2]) + strlen(" or ") + 1);
    strcat(expect, x->expected[x->expected_num-2]);
    strcat(expect, " or ");
    expect = realloc(expect, strlen(expect) + strlen(x->expected[x->expected_num-1]) + 1);
    strcat(expect, x->expected[x->expected_num-1]);

  }
  
  mpc_err_clear_expected(x, expect);
  free(expect);
  
  return x;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x2110
leaq 0x1(%rax), %rdi
callq 0x2290
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x2080
movl 0xc(%rbx), %ebp
cmpl $0x1, %ebp
jne 0xed55
movq %r14, %rdi
callq 0x2110
movq %rax, %r15
movq 0x20(%rbx), %r12
movq (%r12), %rdi
callq 0x2110
leaq (%r15,%rax), %rsi
incq %rsi
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movq (%r12), %rsi
movq %rax, %rdi
callq 0x2360
cmpl $0x2, %ebp
jl 0xee5e
movl 0xc(%rbx), %r13d
cmpl $0x3, %r13d
jl 0xedcd
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x2110
movq %rax, %r15
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x2110
leaq (%r15,%rax), %rsi
addq $0x3, %rsi
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movq 0x20(%rbx), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
callq 0x2360
movq %r14, %rdi
callq 0x2110
movw $0x202c, (%r14,%rax)    # imm = 0x202C
movb $0x0, 0x2(%r14,%rax)
incq %r12
movslq 0xc(%rbx), %r13
addq $-0x2, %r13
cmpq %r13, %r12
jl 0xed6b
jmp 0xedd1
addl $-0x2, %r13d
movq %r14, %rdi
callq 0x2110
movq %rax, %r15
movq 0x20(%rbx), %rax
movslq %r13d, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2110
leaq (%r15,%rax), %rsi
addq $0x5, %rsi
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movq 0x20(%rbx), %r12
movslq 0xc(%rbx), %r13
movq -0x10(%r12,%r13,8), %rsi
movq %rax, %rdi
callq 0x2360
movq %r14, %rdi
callq 0x2110
movl $0x20726f20, (%r14,%rax) # imm = 0x20726F20
movb $0x0, 0x4(%r14,%rax)
movq %r14, %rdi
callq 0x2110
movq %rax, %r15
movq -0x8(%r12,%r13,8), %rdi
callq 0x2110
leaq (%r15,%rax), %rsi
incq %rsi
movq %r14, %rdi
callq 0x22e0
movq %rax, %r14
movq -0x8(%r12,%r13,8), %rsi
movq %rax, %rdi
callq 0x2360
cmpl $0x0, 0xc(%rbx)
jle 0xee80
xorl %r15d, %r15d
movq 0x20(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x23f0
incq %r15
movslq 0xc(%rbx), %rax
cmpq %rax, %r15
jl 0xee67
movl $0x1, 0xc(%rbx)
movq 0x20(%rbx), %rdi
movl $0x8, %esi
callq 0x22e0
movq %rax, %r15
movq %rax, 0x20(%rbx)
movq %r14, %rdi
callq 0x2110
leaq 0x1(%rax), %rdi
callq 0x2290
movq %rax, (%r15)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2080
movq %r14, %rdi
callq 0x23f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq