// File: /workspace/github_c_makefile_star2_O2/orangeduck[P]mpc/tests/core.c
// Function: test_sepby
void test_sepby(void) {
  mpc_parser_t* CommaSepIdent = mpc_sepby1(mpcf_strfold, mpc_char(','), mpc_ident());

  PT_ASSERT(mpc_test_fail(CommaSepIdent, "", "", streq, free, strprint));
  PT_ASSERT(mpc_test_pass(CommaSepIdent, "one", "one", streq, free, strprint));
  PT_ASSERT(mpc_test_pass(CommaSepIdent, "one,", "one", streq, free, strprint));
  PT_ASSERT(mpc_test_pass(CommaSepIdent, "one,two,", "onetwo", streq, free, strprint));
  PT_ASSERT(mpc_test_pass(CommaSepIdent, "one,two,three", "onetwothree", streq, free, strprint));

  mpc_delete(CommaSepIdent);

  mpc_parser_t* CommaSepIdent1 = mpc_sepby1(fold_vals, mpc_char(','), mpc_ident());
  mpc_result_t r;

  mpc_parse("<test>", "uno,dos,tres,cuatro", CommaSepIdent1, &r);
  char **vals = r.output;
  PT_ASSERT(strcmp("uno",    vals[0]) == 0);
  PT_ASSERT(strcmp("dos",    vals[1]) == 0);
  PT_ASSERT(strcmp("tres",   vals[2]) == 0);
  PT_ASSERT(strcmp("cuatro", vals[3]) == 0);

  free(vals);
  mpc_delete(CommaSepIdent1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
pushq $0x2c
popq %rdi
callq 0x7106
movq %rax, %rbx
callq 0x8098
leaq 0x5283(%rip), %rdi      # 0x79cc
movq %rbx, %rsi
movq %rax, %rdx
callq 0x761d
movq %rax, %r14
leaq 0xdd34(%rip), %rdx      # 0x10492
leaq -0xbf9(%rip), %r15      # 0x1b6c
movq 0x1385c(%rip), %r12     # 0x15fc8
leaq -0xbf6(%rip), %r13      # 0x1b7d
movq %rax, %rdi
movq %rdx, %rsi
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x95e0
leaq 0xb19f(%rip), %rsi      # 0xd92d
leaq 0xa9af(%rip), %rbx      # 0xd144
movl %eax, %edi
movq %rbx, %rdx
movl $0xfd, %ecx
callq 0x4040
leaq 0xb1be(%rip), %rbp      # 0xd969
movq %r14, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x9642
leaq 0xb1a4(%rip), %rsi      # 0xd96d
movl %eax, %edi
movq %rbx, %rdx
movl $0xfe, %ecx
callq 0x4040
leaq 0xb1d0(%rip), %rsi      # 0xd9af
movq %r14, %rdi
movq %rbp, %rdx
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x9642
leaq 0xb1ba(%rip), %rsi      # 0xd9b4
movl %eax, %edi
movq %rbx, %rdx
movl $0xff, %ecx
callq 0x4040
leaq 0xb1e7(%rip), %rsi      # 0xd9f7
leaq 0xb1e9(%rip), %rdx      # 0xda00
movq %r14, %rdi
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x9642
leaq 0xb1d8(%rip), %rsi      # 0xda07
movl %eax, %edi
movq %rbx, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x4040
leaq 0xb20c(%rip), %rsi      # 0xda51
leaq 0xb213(%rip), %rdx      # 0xda5f
movq %r14, %rdi
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0x9642
leaq 0xb207(%rip), %rsi      # 0xda6b
movl %eax, %edi
movq %rbx, %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x4040
movq %r14, %rdi
callq 0x68f0
pushq $0x2c
popq %rdi
callq 0x7106
movq %rax, %r14
callq 0x8098
leaq 0xfb(%rip), %rdi        # 0x298d
movq %r14, %rsi
movq %rax, %rdx
callq 0x761d
movq %rax, %r14
leaq 0xb218(%rip), %rdi      # 0xdabf
leaq 0xb218(%rip), %rsi      # 0xdac6
movq %rsp, %r15
movq %rax, %rdx
movq %r15, %rcx
callq 0x646d
movq (%r15), %r15
movq (%r15), %rsi
leaq 0xb211(%rip), %rdi      # 0xdada
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xb201(%rip), %rsi      # 0xdade
movq %rbx, %rdx
movl $0x10a, %ecx            # imm = 0x10A
callq 0x4040
movq 0x8(%r15), %rsi
leaq 0xb205(%rip), %rdi      # 0xdafa
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xb1f5(%rip), %rsi      # 0xdafe
movq %rbx, %rdx
movl $0x10b, %ecx            # imm = 0x10B
callq 0x4040
movq 0x10(%r15), %rsi
leaq 0xb1f9(%rip), %rdi      # 0xdb1a
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xb1ea(%rip), %rsi      # 0xdb1f
movq %rbx, %rdx
movl $0x10c, %ecx            # imm = 0x10C
callq 0x4040
movq 0x18(%r15), %rsi
leaq 0xb186(%rip), %rdi      # 0xdad3
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xb1db(%rip), %rsi      # 0xdb3c
movq %rbx, %rdx
movl $0x10d, %ecx            # imm = 0x10D
callq 0x4040
movq %r15, %rdi
callq 0x1270
movq %r14, %rdi
callq 0x68f0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq