// File: /workspace/github_c_makefile_star2_O1/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
movl $0x2c, %edi
callq 0x79a1
movq %rax, %rbx
callq 0x8e7d
leaq 0x5d70(%rip), %rdi      # 0x84f1
movq %rbx, %rsi
movq %rax, %rdx
callq 0x8042
movq %rax, %r14
leaq 0xfcdc(%rip), %rdx      # 0x12472
leaq -0xbd6(%rip), %r15      # 0x1bc7
movq 0x15824(%rip), %r12     # 0x17fc8
leaq -0xbd3(%rip), %r13      # 0x1bd8
movq %rax, %rdi
movq %rdx, %rsi
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0xa9c0
leaq 0xd167(%rip), %rsi      # 0xf92d
leaq 0xc977(%rip), %rbx      # 0xf144
movl %eax, %edi
movq %rbx, %rdx
movl $0xfd, %ecx
callq 0x4050
leaq 0xd186(%rip), %rbp      # 0xf969
movq %r14, %rdi
movq %rbp, %rsi
movq %rbp, %rdx
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0xaa3c
leaq 0xd16c(%rip), %rsi      # 0xf96d
movl %eax, %edi
movq %rbx, %rdx
movl $0xfe, %ecx
callq 0x4050
leaq 0xd198(%rip), %rsi      # 0xf9af
movq %r14, %rdi
movq %rbp, %rdx
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0xaa3c
leaq 0xd182(%rip), %rsi      # 0xf9b4
movl %eax, %edi
movq %rbx, %rdx
movl $0xff, %ecx
callq 0x4050
leaq 0xd1af(%rip), %rsi      # 0xf9f7
leaq 0xd1b1(%rip), %rdx      # 0xfa00
movq %r14, %rdi
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0xaa3c
leaq 0xd1a0(%rip), %rsi      # 0xfa07
movl %eax, %edi
movq %rbx, %rdx
movl $0x100, %ecx            # imm = 0x100
callq 0x4050
leaq 0xd1d4(%rip), %rsi      # 0xfa51
leaq 0xd1db(%rip), %rdx      # 0xfa5f
movq %r14, %rdi
movq %r15, %rcx
movq %r12, %r8
movq %r13, %r9
callq 0xaa3c
leaq 0xd1cf(%rip), %rsi      # 0xfa6b
movl %eax, %edi
movq %rbx, %rdx
movl $0x101, %ecx            # imm = 0x101
callq 0x4050
movq %r14, %rdi
callq 0x7052
movl $0x2c, %edi
callq 0x79a1
movq %rax, %r14
callq 0x8e7d
leaq 0xfb(%rip), %rdi        # 0x29c7
movq %r14, %rsi
movq %rax, %rdx
callq 0x8042
movq %rax, %r14
leaq 0xd1de(%rip), %rdi      # 0xfabf
leaq 0xd1de(%rip), %rsi      # 0xfac6
movq %rsp, %r15
movq %rax, %rdx
movq %r15, %rcx
callq 0x6ba1
movq (%r15), %r15
movq (%r15), %rsi
leaq 0xd1d7(%rip), %rdi      # 0xfada
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd1c7(%rip), %rsi      # 0xfade
movq %rbx, %rdx
movl $0x10a, %ecx            # imm = 0x10A
callq 0x4050
movq 0x8(%r15), %rsi
leaq 0xd1cb(%rip), %rdi      # 0xfafa
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd1bb(%rip), %rsi      # 0xfafe
movq %rbx, %rdx
movl $0x10b, %ecx            # imm = 0x10B
callq 0x4050
movq 0x10(%r15), %rsi
leaq 0xd1bf(%rip), %rdi      # 0xfb1a
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd1b0(%rip), %rsi      # 0xfb1f
movq %rbx, %rdx
movl $0x10c, %ecx            # imm = 0x10C
callq 0x4050
movq 0x18(%r15), %rsi
leaq 0xd14c(%rip), %rdi      # 0xfad3
callq 0x1130
xorl %edi, %edi
testl %eax, %eax
sete %dil
leaq 0xd1a1(%rip), %rsi      # 0xfb3c
movq %rbx, %rdx
movl $0x10d, %ecx            # imm = 0x10D
callq 0x4050
movq %r15, %rdi
callq 0x1270
movq %r14, %rdi
callq 0x7052
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq