// File: /workspace/github_c_makefile_star2_O0/orangeduck[P]mpc/tests/grammar.c
// Function: test_digits_file
void test_digits_file(void) {
  
  FILE *f;
  mpc_result_t r;
  mpc_parser_t *Digit = mpc_new("digit");
  mpc_parser_t *Program = mpc_new("program");
  mpc_ast_t* t0;
  
  mpc_err_t* err = mpca_lang(MPCA_LANG_DEFAULT,
    " digit   : /[0-9]/ ;"
    " program : /^/ <digit>+ /$/ ;"
    , Digit, Program, NULL);
  
  PT_ASSERT(err == NULL);

  t0 = mpc_ast_build(5, ">", 
    mpc_ast_new("regex", ""),
    mpc_ast_new("digit|regex", "1"),
    mpc_ast_new("digit|regex", "2"),
    mpc_ast_new("digit|regex", "3"),
    mpc_ast_new("regex", ""));
  
  if (mpc_parse_contents("tests/digits.txt", Program, &r)) {
    PT_ASSERT(1);
    PT_ASSERT(mpc_ast_eq(t0, r.output));
    mpc_ast_delete(r.output);
  } else {
    PT_ASSERT(0);
    mpc_err_print(r.error);
    mpc_err_delete(r.error);
  }
  
  f = fopen("tests/digits.txt", "r");
  PT_ASSERT(f != NULL);

  if (mpc_parse_file("tests/digits.txt", f, Program, &r)) {
    PT_ASSERT(1);
    PT_ASSERT(mpc_ast_eq(t0, r.output));
    mpc_ast_delete(r.output);
  } else {
    PT_ASSERT(0);
    mpc_err_print(r.error);
    mpc_err_delete(r.error);
  }
    
  fclose(f);
    
  if (mpc_parse("tests/digits.txt", "123", Program, &r)) {
    PT_ASSERT(1);
    PT_ASSERT(mpc_ast_eq(t0, r.output));
    mpc_ast_delete(r.output);
  } else {
    PT_ASSERT(0);
    mpc_err_print(r.error);
    mpc_err_delete(r.error);
  }
  
  mpc_ast_delete(t0);
    
  mpc_cleanup(2, Digit, Program);
  
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
leaq 0x11fce(%rip), %rdi     # 0x1732d
callq 0x9350
movq %rax, -0x18(%rbp)
leaq 0x10a5e(%rip), %rdi     # 0x15dcd
callq 0x9350
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %edi, %edi
leaq 0x10a4c(%rip), %rsi     # 0x15dd5
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xff70
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
sete %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x1001f(%rip), %rsi     # 0x153cc
leaq 0xf986(%rip), %rdx      # 0x14d3a
movl $0x161, %ecx            # imm = 0x161
callq 0x5780
leaq 0x104b3(%rip), %rdi     # 0x15878
leaq 0x1221e(%rip), %rsi     # 0x175ea
callq 0xd8f0
movq %rax, -0x50(%rbp)
leaq 0x10a2b(%rip), %rdi     # 0x15e07
leaq 0xf8bf(%rip), %rsi      # 0x14ca2
callq 0xd8f0
movq %rax, -0x48(%rbp)
leaq 0x10a14(%rip), %rdi     # 0x15e07
leaq 0xf1c0(%rip), %rsi      # 0x145ba
callq 0xd8f0
movq %rax, -0x40(%rbp)
leaq 0x109fd(%rip), %rdi     # 0x15e07
leaq 0x10a38(%rip), %rsi     # 0x15e49
callq 0xd8f0
movq %rax, -0x38(%rbp)
leaq 0x10457(%rip), %rdi     # 0x15878
leaq 0x121c2(%rip), %rsi     # 0x175ea
callq 0xd8f0
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x38(%rbp), %r9
movl $0x5, %edi
leaq 0x121e1(%rip), %rsi     # 0x1762a
movq %rax, (%rsp)
movb $0x0, %al
callq 0xda00
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rsi
leaq 0x109b0(%rip), %rdi     # 0x15e13
leaq -0x10(%rbp), %rdx
callq 0x8ff0
cmpl $0x0, %eax
je 0x54c0
movl $0x1, %edi
leaq 0xf825(%rip), %rsi      # 0x14ca2
leaq 0xf8b6(%rip), %rdx      # 0x14d3a
movl $0x16b, %ecx            # imm = 0x16B
callq 0x5780
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdc30
movl %eax, %edi
leaq 0x10980(%rip), %rsi     # 0x15e24
leaq 0xf88f(%rip), %rdx      # 0x14d3a
movl $0x16c, %ecx            # imm = 0x16C
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0xd870
jmp 0x54ec
xorl %edi, %edi
leaq 0xebb5(%rip), %rsi      # 0x1407e
leaq 0xf86a(%rip), %rdx      # 0x14d3a
movl $0x16f, %ecx            # imm = 0x16F
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x6f50
movq -0x10(%rbp), %rdi
callq 0x6ed0
leaq 0x10920(%rip), %rdi     # 0x15e13
leaq 0x12103(%rip), %rsi     # 0x175fd
callq 0x21e0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
setne %al
andb $0x1, %al
movzbl %al, %edi
leaq 0x10926(%rip), %rsi     # 0x15e3d
leaq 0xf81c(%rip), %rdx      # 0x14d3a
movl $0x175, %ecx            # imm = 0x175
callq 0x5780
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x108dc(%rip), %rdi     # 0x15e13
leaq -0x10(%rbp), %rcx
callq 0x8cb0
cmpl $0x0, %eax
je 0x5594
movl $0x1, %edi
leaq 0xf751(%rip), %rsi      # 0x14ca2
leaq 0xf7e2(%rip), %rdx      # 0x14d3a
movl $0x178, %ecx            # imm = 0x178
callq 0x5780
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdc30
movl %eax, %edi
leaq 0x108ac(%rip), %rsi     # 0x15e24
leaq 0xf7bb(%rip), %rdx      # 0x14d3a
movl $0x179, %ecx            # imm = 0x179
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0xd870
jmp 0x55c0
xorl %edi, %edi
leaq 0xeae1(%rip), %rsi      # 0x1407e
leaq 0xf796(%rip), %rdx      # 0x14d3a
movl $0x17c, %ecx            # imm = 0x17C
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x6f50
movq -0x10(%rbp), %rdi
callq 0x6ed0
movq -0x8(%rbp), %rdi
callq 0x20a0
movq -0x20(%rbp), %rdx
leaq 0x1083f(%rip), %rdi     # 0x15e13
leaq 0x1086c(%rip), %rsi     # 0x15e47
leaq -0x10(%rbp), %rcx
callq 0x88a0
cmpl $0x0, %eax
je 0x5638
movl $0x1, %edi
leaq 0xf6ad(%rip), %rsi      # 0x14ca2
leaq 0xf73e(%rip), %rdx      # 0x14d3a
movl $0x184, %ecx            # imm = 0x184
callq 0x5780
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xdc30
movl %eax, %edi
leaq 0x10808(%rip), %rsi     # 0x15e24
leaq 0xf717(%rip), %rdx      # 0x14d3a
movl $0x185, %ecx            # imm = 0x185
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0xd870
jmp 0x5664
xorl %edi, %edi
leaq 0xea3d(%rip), %rsi      # 0x1407e
leaq 0xf6f2(%rip), %rdx      # 0x14d3a
movl $0x188, %ecx            # imm = 0x188
callq 0x5780
movq -0x10(%rbp), %rdi
callq 0x6f50
movq -0x10(%rbp), %rdi
callq 0x6ed0
movq -0x28(%rbp), %rdi
callq 0xd870
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x2, %edi
movb $0x0, %al
callq 0x9a50
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)