// File: /workspace/github_c_makefile_star2_O2/orangeduck[P]mpc/mpc.c
// Function: mpc_err_repeat
static mpc_err_t *mpc_err_repeat(mpc_input_t *i, mpc_err_t *x, const char *prefix) {

  int j = 0;
  size_t l = 0;
  char *expect = NULL;

  if (x == NULL) { return NULL; }

  if (x->expected_num == 0) {
    expect = mpc_calloc(i, 1, 1);
    x->expected_num = 1;
    x->expected = mpc_realloc(i, x->expected, sizeof(char*) * x->expected_num);
    x->expected[0] = expect;
    return x;
  }

  else if (x->expected_num == 1) {
    expect = mpc_malloc(i, strlen(prefix) + strlen(x->expected[0]) + 1);
    strcpy(expect, prefix);
    strcat(expect, x->expected[0]);
    mpc_free(i, x->expected[0]);
    x->expected[0] = expect;
    return x;
  }

  else if (x->expected_num > 1) {

    l += strlen(prefix);
    for (j = 0; j < x->expected_num-2; j++) {
      l += strlen(x->expected[j]) + strlen(", ");
    }
    l += strlen(x->expected[x->expected_num-2]);
    l += strlen(" or ");
    l += strlen(x->expected[x->expected_num-1]);

    expect = mpc_malloc(i, l + 1);

    strcpy(expect, prefix);
    for (j = 0; j < x->expected_num-2; j++) {
      strcat(expect, x->expected[j]); strcat(expect, ", ");
    }
    strcat(expect, x->expected[x->expected_num-2]);
    strcat(expect, " or ");
    strcat(expect, x->expected[x->expected_num-1]);

    for (j = 0; j < x->expected_num; j++) { mpc_free(i, x->expected[j]); }

    x->expected_num = 1;
    x->expected = mpc_realloc(i, x->expected, sizeof(char*) * x->expected_num);
    x->expected[0] = expect;
    return x;
  }

  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0xb8eb
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movl 0x20(%rsi), %ebp
cmpq $0x1, %rbp
je 0xb850
testl %ebp, %ebp
jne 0xb8ab
pushq $0x1
popq %rsi
movq %r14, %rdi
callq 0xaf8f
movq %rax, %r15
movb $0x0, (%rax)
movl $0x1, 0x20(%rbx)
movq 0x38(%rbx), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0xb723
movq %rax, 0x38(%rbx)
movq %r15, (%rax)
jmp 0xb9e4
movq %r15, %rdi
callq 0x41c0
movq %rax, %r12
movq 0x38(%rbx), %rax
movq (%rax), %rdi
callq 0x41c0
leaq (%r12,%rax), %rsi
incq %rsi
movq %r14, %rdi
callq 0xaf8f
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x40e0
movq 0x38(%rbx), %rax
movq (%rax), %rsi
movq %r12, %rdi
callq 0x4740
movq 0x38(%rbx), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0xb49e
movq 0x38(%rbx), %rax
jmp 0xb9e1
cmpl $0x2, %ebp
jl 0xb8eb
movq %r14, 0x10(%rsp)
movq %r15, 0x8(%rsp)
movq %r15, %rdi
callq 0x41c0
movq %rax, %r12
leal -0x2(%rbp), %r15d
movq 0x38(%rbx), %r13
xorl %r14d, %r14d
cmpq %r14, %r15
je 0xb8f2
movq (%r13,%r14,8), %rdi
callq 0x41c0
addq %rax, %r12
addq $0x2, %r12
incq %r14
jmp 0xb8d0
xorl %ebx, %ebx
jmp 0xb9e4
movslq %r15d, %rax
movq (%r13,%rax,8), %rdi
callq 0x41c0
movq %rax, %r14
movq -0x8(%r13,%rbp,8), %rdi
callq 0x41c0
addq %r14, %r12
leaq (%rax,%r12), %rsi
addq $0x5, %rsi
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0xaf8f
movq %rax, %r12
movq %rax, %rdi
movq 0x8(%rsp), %rsi
callq 0x40e0
xorl %r15d, %r15d
movslq 0x20(%rbx), %rax
leaq -0x2(%rax), %rdx
movq 0x38(%rbx), %rcx
cmpq %rdx, %r15
jge 0xb96e
movq (%rcx,%r15,8), %rsi
movq %r12, %rdi
callq 0x4740
movq %r12, %rdi
callq 0x41c0
movw $0x202c, (%r12,%rax)    # imm = 0x202C
movb $0x0, 0x2(%r12,%rax)
incq %r15
jmp 0xb937
movq -0x10(%rcx,%rax,8), %rsi
movq %r12, %rdi
callq 0x4740
movq %r12, %rdi
callq 0x41c0
movl $0x20726f20, (%r12,%rax) # imm = 0x20726F20
movb $0x0, 0x4(%r12,%rax)
movq 0x38(%rbx), %rax
movslq 0x20(%rbx), %rcx
movq -0x8(%rax,%rcx,8), %rsi
movq %r12, %rdi
callq 0x4740
xorl %r14d, %r14d
movslq 0x20(%rbx), %rax
cmpq %rax, %r14
jge 0xb9c7
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rsi
movq %r13, %rdi
callq 0xb49e
incq %r14
jmp 0xb9a9
movl $0x1, 0x20(%rbx)
movq 0x38(%rbx), %rsi
pushq $0x8
popq %rdx
movq %r13, %rdi
callq 0xb723
movq %rax, 0x38(%rbx)
movq %r12, (%rax)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq