// File: /workspace/github_c_makefile_star2_O2/MikeGray-APH[P]LibLouisAPH/source/outputs/table-output.c
// Function: mode_output
static void mode_output(FILE *output, const struct mode *mode, const char *name)
{
	int i;

	if(!mode)
		return;

	mode_output(output, mode->nxt, name);

	fputs("   ", output);

	if(!mode->begin_len)
		fputs("-", output);
	else
	for(i = 0; i < mode->begin_len; i++)
	if(mode->begin[i])
		utf16_output_char(output, mode->begin[i]);

	fputs("  ", output);


	if(!mode->end_len)
		fputs("-", output);
	else
	for(i = 0; i < mode->end_len; i++)
	if(mode->end[i])
		utf16_output_char(output, mode->end[i]);

	if(mode->word_len)
	{

		fputs("  ", output);

		if(!mode->word_len)
			fputs("-", output);
		else
		for(i = 0; i < mode->word_len; i++)
		if(mode->word[i])
			utf16_output_char(output, mode->word[i]);

		fputs("  ", output);

		if(!mode->term_len)
			fputs("-", output);
		else
		for(i = 0; i < mode->term_len; i++)
		if(mode->term[i])
			utf16_output_char(output, mode->term[i]);

		fputs("  ", output);

		if(!mode->symbol_len)
			fputs("-", output);
		else
		for(i = 0; i < mode->symbol_len; i++)
		if(mode->symbol[i])
			utf16_output_char(output, mode->symbol[i]);

		fprintf(output, "  %d", mode->passage_len);
	}
	else
		fprintf(output, "  -  -  -  %d", mode->passage_len);

	fputs("  ", output);

	if(name)
		fprintf(output, "%s", name);
	else
		utf16_output(output, mode->name, mode->name_len);

	fputs("\n", output);

	mode = mode->nxt;
}

// Assembly:
testq %rsi, %rsi
je 0xfdab
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq (%rsi), %rsi
callq 0xfd4b
leaq 0x2424(%rip), %rdi      # 0x12195
movq %rbx, %rsi
callq 0x1100
movl 0x54(%r15), %eax
testl %eax, %eax
je 0xfdac
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0xfdbb
movzwl 0xc(%r15,%r12,2), %ecx
testw %cx, %cx
je 0xfda6
movzwl %cx, %esi
movq %rbx, %rdi
callq 0xece1
movl 0x54(%r15), %eax
incq %r12
jmp 0xfd84
retq
leaq 0x23d5(%rip), %rdi      # 0x12188
movq %rbx, %rsi
callq 0x1100
leaq 0x23d4(%rip), %rdi      # 0x12196
movq %rbx, %rsi
callq 0x1100
movl 0x58(%r15), %eax
testl %eax, %eax
je 0xfdfc
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0xfe0b
movzwl 0x1a(%r15,%r12,2), %ecx
testw %cx, %cx
je 0xfdf7
movzwl %cx, %esi
movq %rbx, %rdi
callq 0xece1
movl 0x58(%r15), %eax
incq %r12
jmp 0xfdd5
leaq 0x2385(%rip), %rdi      # 0x12188
movq %rbx, %rsi
callq 0x1100
cmpl $0x0, 0x5c(%r15)
je 0xfe53
leaq 0x237d(%rip), %rdi      # 0x12196
movq %rbx, %rsi
callq 0x1100
movl 0x5c(%r15), %eax
testl %eax, %eax
je 0xfe5f
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0xfe6e
movzwl 0x28(%r15,%r12,2), %ecx
testw %cx, %cx
je 0xfe4e
movzwl %cx, %esi
movq %rbx, %rdi
callq 0xece1
movl 0x5c(%r15), %eax
incq %r12
jmp 0xfe2c
leaq 0x231d(%rip), %r12      # 0x12177
jmp 0xff1c
leaq 0x2322(%rip), %rdi      # 0x12188
movq %rbx, %rsi
callq 0x1100
leaq 0x2321(%rip), %rdi      # 0x12196
movq %rbx, %rsi
callq 0x1100
movl 0x60(%r15), %eax
testl %eax, %eax
je 0xfeaf
xorl %r12d, %r12d
movslq %eax, %rcx
cmpq %rcx, %r12
jge 0xfebe
movzwl 0x36(%r15,%r12,2), %ecx
testw %cx, %cx
je 0xfeaa
movzwl %cx, %esi
movq %rbx, %rdi
callq 0xece1
movl 0x60(%r15), %eax
incq %r12
jmp 0xfe88
leaq 0x22d2(%rip), %rdi      # 0x12188
movq %rbx, %rsi
callq 0x1100
leaq 0x22d1(%rip), %rdi      # 0x12196
movq %rbx, %rsi
callq 0x1100
movl 0x64(%r15), %eax
testl %eax, %eax
je 0xff06
xorl %r13d, %r13d
leaq 0x22a1(%rip), %r12      # 0x12180
movslq %eax, %rcx
cmpq %rcx, %r13
jge 0xff1c
movzwl 0x44(%r15,%r13,2), %ecx
testw %cx, %cx
je 0xff01
movzwl %cx, %esi
movq %rbx, %rdi
callq 0xece1
movl 0x64(%r15), %eax
incq %r13
jmp 0xfedf
leaq 0x227b(%rip), %rdi      # 0x12188
movq %rbx, %rsi
callq 0x1100
leaq 0x2264(%rip), %r12      # 0x12180
movl 0x68(%r15), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1160
leaq 0x2262(%rip), %rdi      # 0x12196
movq %rbx, %rsi
callq 0x1100
testq %r14, %r14
je 0xff4e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1100
jmp 0xff5e
movq 0x70(%r15), %rsi
movl 0x78(%r15), %edx
movq %rbx, %rdi
callq 0xec74
leaq 0x201b(%rip), %rdi      # 0x11f80
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x1100