// File: /workspace/github_c_makefile_star2_O1/macournoyer[P]peg/compile.c
// Function: Rule_compile_c2
static void Rule_compile_c2(Node *node)
{
  assert(node);
  assert(Rule == node->type);

  if (!node->rule.expression)
    fprintf(stderr, "rule '%s' used but not defined\n", node->rule.name);
  else
    {
      int ko= yyl(), safe;

      if ((!(RuleUsed & node->rule.flags)) && (node != start))
	fprintf(stderr, "rule '%s' defined but not used\n", node->rule.name);

      safe= ((Query == node->rule.expression->type) || (Star == node->rule.expression->type));

      fprintf(output, "\nYY_RULE(int) yy_%s()\n{", node->rule.name);
      if (!safe) save(0);
      if (node->rule.variables)
	fprintf(output, "  yyDo(yyPush, %d, 0);", countVariables(node->rule.variables));
      fprintf(output, "\n  yyprintf((stderr, \"%%s\\n\", \"%s\"));", node->rule.name);
      Node_compile_c_ko(node->rule.expression, ko);
      fprintf(output, "\n  yyprintf((stderr, \"  ok   %%s @ %%s\\n\", \"%s\", yybuf+yypos));", node->rule.name);
      if (node->rule.variables)
	fprintf(output, "  yyDo(yyPop, %d, 0);", countVariables(node->rule.variables));
      fprintf(output, "\n  return 1;");
      if (!safe)
	{
	  label(ko);
	  restore(0);
	  fprintf(output, "\n  yyprintf((stderr, \"  fail %%s @ %%s\\n\", \"%s\", yybuf+yypos));", node->rule.name);
	  fprintf(output, "\n  return 0;");
	}
      fprintf(output, "\n}");
    }

  if (node->rule.next)
    Rule_compile_c2(node->rule.next);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x634d(%rip), %r15      # 0xa1b0
leaq 0x2ca2(%rip), %r13      # 0x6b0c
leaq 0x2cf5(%rip), %rbp      # 0x6b66
testq %rbx, %rbx
je 0x4030
cmpl $0x1, (%rbx)
jne 0x404f
cmpq $0x0, 0x20(%rbx)
je 0x400a
movl 0x832b(%rip), %r14d     # 0xc1c0
incl %r14d
movl %r14d, 0x8321(%rip)     # 0xc1c0
testb $0x1, 0x2c(%rbx)
jne 0x3eb5
leaq 0x62fc(%rip), %rax      # 0xa1a8
cmpq %rbx, (%rax)
jne 0x4014
movq 0x10(%rbx), %rdx
movq 0x20(%rbx), %rax
movl (%rax), %r12d
movq (%r15), %rdi
leaq 0x2b97(%rip), %rsi      # 0x6a61
xorl %eax, %eax
callq 0x10c0
andl $-0x2, %r12d
cmpl $0xe, %r12d
je 0x3ef0
movq (%r15), %rdi
leaq 0x2c84(%rip), %rsi      # 0x6b69
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x10c0
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x3f17
movq (%r15), %rdi
xorl %edx, %edx
incl %edx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x3efe
leaq 0x2b69(%rip), %rsi      # 0x6a79
xorl %eax, %eax
callq 0x10c0
movq (%r15), %rdi
movq 0x10(%rbx), %rdx
leaq 0x2b6b(%rip), %rsi      # 0x6a90
xorl %eax, %eax
callq 0x10c0
movq 0x20(%rbx), %rdi
movl %r14d, %esi
callq 0x406e
movq (%r15), %rdi
movq 0x10(%rbx), %rdx
leaq 0x2b70(%rip), %rsi      # 0x6ab6
xorl %eax, %eax
callq 0x10c0
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x3f74
movq (%r15), %rdi
xorl %edx, %edx
incl %edx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x3f5b
leaq 0x2b89(%rip), %rsi      # 0x6af6
xorl %eax, %eax
callq 0x10c0
movq (%r15), %rcx
movl $0xc, %esi
movl $0x1, %edx
movq %r13, %rdi
callq 0x1180
cmpl $0xe, %r12d
je 0x3fe6
movq (%r15), %rdi
leaq 0x2da0(%rip), %rsi      # 0x6d39
movl %r14d, %edx
xorl %eax, %eax
callq 0x10c0
movq (%r15), %rdi
leaq 0x2d96(%rip), %rsi      # 0x6d43
xorl %edx, %edx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x10c0
movq (%r15), %rdi
movq 0x10(%rbx), %rdx
leaq 0x2b53(%rip), %rsi      # 0x6b19
xorl %eax, %eax
callq 0x10c0
movq (%r15), %rcx
movl $0xc, %esi
movl $0x1, %edx
leaq 0x2b78(%rip), %rdi      # 0x6b59
callq 0x1180
movq (%r15), %rcx
movl $0x2, %esi
movl $0x1, %edx
movq %rbp, %rdi
callq 0x1180
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x3e71
jmp 0x4021
movq %rbx, %rdi
callq 0x13a4
jmp 0x3ffb
movq %rbx, %rdi
callq 0x1385
jmp 0x3eb5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x131b(%rip), %rdi      # 0x5352
leaq 0x29bc(%rip), %rsi      # 0x69fa
leaq 0x29bf(%rip), %rcx      # 0x6a04
movl $0x114, %edx            # imm = 0x114
callq 0x1060
leaq 0x1329(%rip), %rdi      # 0x537f
leaq 0x299d(%rip), %rsi      # 0x69fa
leaq 0x29a0(%rip), %rcx      # 0x6a04
movl $0x115, %edx            # imm = 0x115
callq 0x1060