// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/outputs/table-output.c
// Function: rules_output
static void rules_output(FILE *output, const struct rule *const*rule_hash, const int rules_max, const enum rule_direction direction, const int use_dots)
{
	const struct rule *rule;
	int i, cnt, most;

#ifdef TABLE_ALLOCATE_HASHES
	if(!rule_hash)
		return;
#endif

	most = 0;
	for(i = 0; i < rules_max; i++)
	{
		rule = rule_hash[i];
		cnt = 0;
		while(rule)
		{
			cnt++;
			if(direction == FORWARD)
				rule = rule->chars_nxt;
			else
				rule = rule->dots_nxt;
		}
		if(cnt > most)
			most = cnt;
		if(!cnt)
			continue;

		fprintf(output, "[%5d] %5d", i, cnt);
		rule = rule_hash[i];
		while(rule)
		{
			fputs("\n   ", output);

			if(direction == FORWARD)
			{
				if(rule->chars_len == 1)
					utf16_output_char_escape(output, rule->chars[0]);
				else
					utf16_output(output, rule->chars, rule->chars_len);
				fputs(" ", output);
				if(use_dots)
					output_dots_string(output, rule->dots, rule->dots_len);
				else
				if(rule->dots_len == 1)
					utf16_output_char_escape(output, rule->dots[0]);
				else
					utf16_output(output, rule->dots, rule->dots_len);
			}
			else
			{
				if(use_dots)
					output_dots_string(output, rule->dots, rule->dots_len);
				else
				if(rule->dots_len == 1)
					utf16_output_char_escape(output, rule->dots[0]);
				else
					utf16_output(output, rule->dots, rule->dots_len);
				fputs(" ", output);
				if(rule->chars_len == 1)
					utf16_output_char_escape(output, rule->chars[0]);
				else
					utf16_output(output, rule->chars, rule->chars_len);
			}
			if(rule->attrs)
				fprintf(output, " <0x%08x>", rule->attrs);

			if(rule->filter_forward)
			{
				fputs("   ", output);
				if(!rule->filter_forward->name)
				{
					if(rule->filter_forward->before)
						pattern_print_reverse(output, rule->filter_forward->before, rule->filter_forward->before_len);
					else
						fputs("-", output);
					fputs("   ", output);
					if(rule->filter_forward->after)
						pattern_print(output, rule->filter_forward->after, attrs_chars);
					else
						fputs("-", output);
				}
				else
					utf16_output(output, rule->filter_forward->name, rule->filter_forward->name_len);
			}

			if(rule->filter_backward)
			{
				fputs("   ", output);
				if(!rule->filter_forward)
					fputs("--   ", output);
				if(!rule->filter_backward->name)
				{
					if(rule->filter_backward->before)
						pattern_print_reverse(output, rule->filter_backward->before, rule->filter_backward->before_len);
					else
						fputs("-", output);
					fputs("   ", output);
					if(rule->filter_backward->after)
						pattern_print(output, rule->filter_backward->after, attrs_chars);
					else
						fputs("-", output);
				}
				else
					utf16_output(output, rule->filter_backward->name, rule->filter_backward->name_len);
			}

			if(direction == FORWARD)
				rule = rule->chars_nxt;
			else
				rule = rule->dots_nxt;
		}
		fputs("\n", output);
	}
	fprintf(output, "most = %d\n", most);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1c2d6
jmp 0x1c773
movl $0x0, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x1c75e
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1c339
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x1, -0x18(%rbp)
jne 0x1c32b
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1c337
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1c307
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jle 0x1c347
movl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x1c352
jmp 0x1c750
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
leaq 0x3077(%rip), %rsi      # 0x1f3da
movb $0x0, %al
callq 0x1130
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1c740
movq -0x8(%rbp), %rsi
leaq 0x3054(%rip), %rdi      # 0x1f3e4
callq 0x10f0
cmpl $0x1, -0x18(%rbp)
jne 0x1c440
movq -0x28(%rbp), %rax
cmpl $0x1, 0x74(%rax)
jne 0x1c3bc
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl 0x18(%rax), %esi
callq 0x1a360
jmp 0x1c3d4
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x18, %rsi
movq -0x28(%rbp), %rax
movl 0x74(%rax), %edx
callq 0x1a220
movq -0x8(%rbp), %rsi
leaq 0x3008(%rip), %rdi      # 0x1f3e7
callq 0x10f0
cmpl $0x0, -0x1c(%rbp)
je 0x1c404
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x46, %rsi
movq -0x28(%rbp), %rax
movl 0x78(%rax), %edx
callq 0x1c940
jmp 0x1c43b
movq -0x28(%rbp), %rax
cmpl $0x1, 0x78(%rax)
jne 0x1c421
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl 0x46(%rax), %esi
callq 0x1a360
jmp 0x1c439
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x46, %rsi
movq -0x28(%rbp), %rax
movl 0x78(%rax), %edx
callq 0x1a220
jmp 0x1c43b
jmp 0x1c4de
cmpl $0x0, -0x1c(%rbp)
je 0x1c460
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x46, %rsi
movq -0x28(%rbp), %rax
movl 0x78(%rax), %edx
callq 0x1c940
jmp 0x1c497
movq -0x28(%rbp), %rax
cmpl $0x1, 0x78(%rax)
jne 0x1c47d
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl 0x46(%rax), %esi
callq 0x1a360
jmp 0x1c495
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x46, %rsi
movq -0x28(%rbp), %rax
movl 0x78(%rax), %edx
callq 0x1a220
jmp 0x1c497
movq -0x8(%rbp), %rsi
leaq 0x2f45(%rip), %rdi      # 0x1f3e7
callq 0x10f0
movq -0x28(%rbp), %rax
cmpl $0x1, 0x74(%rax)
jne 0x1c4c4
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movzwl 0x18(%rax), %esi
callq 0x1a360
jmp 0x1c4dc
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq $0x18, %rsi
movq -0x28(%rbp), %rax
movl 0x74(%rax), %edx
callq 0x1a220
jmp 0x1c4de
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
je 0x1c4ff
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %edx
leaq 0x2ef1(%rip), %rsi      # 0x1f3e9
movb $0x0, %al
callq 0x1130
movq -0x28(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x1c5fe
movq -0x8(%rbp), %rsi
leaq 0x2ec9(%rip), %rdi      # 0x1f3e5
callq 0x10f0
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x1c5d6
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c571
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
movl 0x18(%rax), %edx
callq 0x1c8d0
jmp 0x1c581
movq -0x8(%rbp), %rsi
leaq 0x2e5c(%rip), %rdi      # 0x1f3d8
callq 0x10f0
movq -0x8(%rbp), %rsi
leaq 0x2e59(%rip), %rdi      # 0x1f3e5
callq 0x10f0
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x1c5c4
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x9cc3(%rip), %rdx      # 0x26280
callq 0x1b290
jmp 0x1c5d4
movq -0x8(%rbp), %rsi
leaq 0x2e09(%rip), %rdi      # 0x1f3d8
callq 0x10f0
jmp 0x1c5fc
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
movq 0x20(%rax), %rsi
movq -0x28(%rbp), %rax
movq 0x80(%rax), %rax
movl 0x28(%rax), %edx
callq 0x1a220
jmp 0x1c5fe
movq -0x28(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x1c71b
movq -0x8(%rbp), %rsi
leaq 0x2dca(%rip), %rdi      # 0x1f3e5
callq 0x10f0
movq -0x28(%rbp), %rax
cmpq $0x0, 0x80(%rax)
jne 0x1c63e
movq -0x8(%rbp), %rsi
leaq 0x2dba(%rip), %rdi      # 0x1f3f3
callq 0x10f0
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
cmpq $0x0, 0x20(%rax)
jne 0x1c6f3
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x1c68e
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
movl 0x18(%rax), %edx
callq 0x1c8d0
jmp 0x1c69e
movq -0x8(%rbp), %rsi
leaq 0x2d3f(%rip), %rdi      # 0x1f3d8
callq 0x10f0
movq -0x8(%rbp), %rsi
leaq 0x2d3c(%rip), %rdi      # 0x1f3e5
callq 0x10f0
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
cmpq $0x0, 0x10(%rax)
je 0x1c6e1
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x10(%rax), %rsi
leaq 0x9ba6(%rip), %rdx      # 0x26280
callq 0x1b290
jmp 0x1c6f1
movq -0x8(%rbp), %rsi
leaq 0x2cec(%rip), %rdi      # 0x1f3d8
callq 0x10f0
jmp 0x1c719
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x20(%rax), %rsi
movq -0x28(%rbp), %rax
movq 0x88(%rax), %rax
movl 0x28(%rax), %edx
callq 0x1a220
jmp 0x1c71b
cmpl $0x1, -0x18(%rbp)
jne 0x1c72f
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1c73b
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x1c37a
movq -0x8(%rbp), %rsi
leaq 0x2a85(%rip), %rdi      # 0x1f1d0
callq 0x10f0
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1c2e4
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %edx
leaq 0x2c50(%rip), %rsi      # 0x1f3bc
movb $0x0, %al
callq 0x1130
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)