// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/./regexp.c
// Function: count
static int count(struct cstate *g, Renode *node, int depth)
{
	int min, max, n;
	if (!node) return 0;
	if (++depth > REG_MAXREC) die(g, "stack overflow");
	switch (node->type) {
	default: return 1;
	case P_CAT: return count(g, node->x, depth) + count(g, node->y, depth);
	case P_ALT: return count(g, node->x, depth) + count(g, node->y, depth) + 2;
	case P_REP:
		min = node->m;
		max = node->n;
		if (min == max) n = count(g, node->x, depth) * min;
		else if (max < REPINF) n = count(g, node->x, depth) * max + (max - min);
		else n = count(g, node->x, depth) * (min + 1) + 2;
		if (n < 0 || n > REG_MAXPROG) die(g, "program too large");
		return n;
	case P_PAR: return count(g, node->x, depth) + 2;
	case P_PLA: return count(g, node->x, depth) + 2;
	case P_NLA: return count(g, node->x, depth) + 2;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1c8c6
movl $0x0, -0x4(%rbp)
jmp 0x1ca95
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x400, %eax            # imm = 0x400
jle 0x1c8e6
movq -0x10(%rbp), %rdi
leaq 0x20e86(%rip), %rsi     # 0x3d767
callq 0x1c7b0
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
movq %rax, -0x30(%rbp)
subq $0x9, %rax
ja 0x1c90b
movq -0x30(%rbp), %rax
leaq 0x1702a(%rip), %rcx     # 0x3392c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, -0x4(%rbp)
jmp 0x1ca95
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
movl %eax, %ecx
movl -0x34(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x1ca95
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
movl %eax, %ecx
movl -0x38(%rbp), %eax
addl %ecx, %eax
addl $0x2, %eax
movl %eax, -0x4(%rbp)
jmp 0x1ca95
movq -0x18(%rbp), %rax
movzbl 0x2(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movzbl 0x3(%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x1c9c9
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
imull -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x1ca1c
cmpl $0xff, -0x24(%rbp)
jge 0x1c9f7
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
imull -0x24(%rbp), %eax
movl -0x24(%rbp), %ecx
subl -0x20(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x28(%rbp)
jmp 0x1ca1a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
imull %ecx, %eax
addl $0x2, %eax
movl %eax, -0x28(%rbp)
jmp 0x1ca1c
cmpl $0x0, -0x28(%rbp)
jl 0x1ca2b
cmpl $0x8000, -0x28(%rbp)    # imm = 0x8000
jle 0x1ca3b
movq -0x10(%rbp), %rdi
leaq 0x1f7d7(%rip), %rsi     # 0x3c20d
callq 0x1c7b0
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1ca95
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
addl $0x2, %eax
movl %eax, -0x4(%rbp)
jmp 0x1ca95
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
addl $0x2, %eax
movl %eax, -0x4(%rbp)
jmp 0x1ca95
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rsi
movl -0x1c(%rbp), %edx
callq 0x1c8a0
addl $0x2, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop