// File: /workspace/github_c_makefile_star2_O3/MikeGray-APH[P]LibLouisAPH/source/languages/generic-backward.c
// Function: convert_indicators_numeric
static int convert_indicators_numeric(struct translate *translate)
{
	const struct table *table;
	int numeric_in, numeric_passage_in;
	unichar uchar;

	/*   only remove indicators contained in last table in tables   */
	table = translate->tables[translate->table_cnt - 1];
	translate->table_crs = translate->table_cnt - 1;

	numeric_in =
	numeric_passage_in = 0;
	translate->input_crs =
	translate->output_len = 0;
	while(translate->input_crs < translate->input_len)
	{
		switch(translate_get_mode_indicator(translate, table, &table->numeric))
		{
		case FAIL:  return 0;
		case NONE:  break;

		case BEGIN:  numeric_passage_in = 1;
		case WORD:   numeric_in = 1;  break;

		case END:   numeric_passage_in = 0;
		case TERM:

			/*   numeric terminator is also nocontract symbol   */
			if(!numeric_passage_in)
				numeric_in = 0;
			break;

		/*   numeric space   */
		case SYMBOL:  break;
		}

		/*   treat nocontract symbol like an escape   */
		if(numeric_passage_in)
		if(translate_get_mode_indicator(translate, table, &table->nocontract) == SYMBOL)
		{
			if(!(translate_copy_marked_indicators(translate) > 0))
				return 0;
			if(!translate_copy_to_output(translate, 1, 1))
				return 0;
			continue;
		}

		if(translate_copy_marked_indicators(translate) > 0)
			continue;

		if(numeric_in)
		{
			/*   numeric space   */
			if(translate_is_equal(translate, table->numeric.symbol, table->numeric.symbol_len))
			{
				CHANGE_MARK
				if(!translate_insert_dot_for_chars(translate, u' ', table->numeric.symbol_len))
					return 0;
			}
			else if(!numeric_passage_in && !translate_has_attributes(translate, CHAR_NUMERIC_UCHAR | CHAR_NUMERIC_CONT))
			{
				numeric_in = 0;
				if(!translate_copy_to_output(translate, 1, 1))
					return 0;
			}
			else
			{
				uchar = generic_uchar_to_digit(table, translate->input[translate->input_crs]);
				if(uchar != translate->input[translate->input_crs])
				{
					CHANGE_MARK
					if(!translate_insert_dot_for_chars(translate, uchar, 1))
						return 0;
				}
				else if(!translate_copy_to_output(translate, 1, 1))
					return 0;
			}
		}
		else if(!translate_copy_to_output(translate, 1, 1))
			return 0;
	}

#ifdef DEBUG
	translate->output[translate->output_len] = 0;
#endif

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movslq 0xc(%rdi), %rcx
movq -0x8(%rax,%rcx,8), %r14
decq %rcx
movl %ecx, 0x8(%rdi)
xorl %ebp, %ebp
movl %ebp, 0x68(%rdi)
movl %ebp, 0x40(%rdi)
cmpl %ebp, 0x44(%rdi)
jle 0xf2e0
leaq 0x150(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x50(%r14), %rax
movq %rax, 0x8(%rsp)
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
callq 0x6f4b
cmpl $0x5, %eax
ja 0xf11b
movl %eax, %eax
leaq 0x4cd3(%rip), %rcx      # 0x13db4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movl $0x1, %r13d
movl $0x1, %r15d
jmpq *%rax
movl %r12d, %r15d
testl %ebp, %ebp
jne 0xf125
movq %rbx, %rdi
callq 0x76d5
xorl %r13d, %r13d
movl $0x0, %r15d
testl %eax, %eax
jg 0xf243
jmp 0xf226
movl %r12d, %r15d
testl %ebp, %ebp
je 0xf173
movl %ebp, %r13d
movq %rbx, %rdi
movq %r14, %rsi
movq 0x8(%rsp), %rdx
callq 0x6f4b
cmpl $0x6, %eax
jne 0xf16f
movq %rbx, %rdi
callq 0x76d5
testl %eax, %eax
jle 0xf2ea
movl $0x1, %r13d
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x7467
testl %eax, %eax
jne 0xf243
jmp 0xf2ea
xorl %ebp, %ebp
jmp 0xf179
xorl %r13d, %r13d
movb $0x1, %bpl
movq %rbx, %rdi
callq 0x76d5
testl %eax, %eax
jg 0xf243
testl %r15d, %r15d
je 0xf226
movl 0x1b4(%r14), %ecx
movl 0x40(%rbx), %eax
testq %rcx, %rcx
je 0xf1ad
leal (%rax,%rcx), %edx
cmpl 0x44(%rbx), %edx
jle 0xf25a
testb %bpl, %bpl
je 0xf1e1
testl %eax, %eax
js 0xf226
cmpl %eax, 0x44(%rbx)
jle 0xf226
movslq 0x8(%rbx), %rcx
movq (%rbx), %rdx
movq 0x38(%rbx), %rsi
movq (%rdx,%rcx,8), %rdi
movzwl (%rsi,%rax,2), %esi
callq 0x1ef5
testq %rax, %rax
je 0xf226
testb $0x30, 0x25(%rax)
je 0xf226
movl 0x40(%rbx), %eax
movq 0x38(%rbx), %rcx
cltq
movzwl (%rcx,%rax,2), %ebp
movzwl %bp, %esi
movq %r14, %rdi
callq 0x1ef5
testq %rax, %rax
je 0xf209
testb $0x10, 0x25(%rax)
je 0xf209
movq 0x10(%rax), %rax
movzwl 0x20(%rax), %ebp
movq 0x38(%rbx), %rax
movslq 0x40(%rbx), %rcx
cmpw (%rax,%rcx,2), %bp
jne 0xf2ab
movl $0x1, %r15d
jmp 0xf150
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x7467
testl %eax, %eax
je 0xf2ea
xorl %r15d, %r15d
movl 0x40(%rbx), %eax
movl %r13d, %ebp
movl %r15d, %r12d
cmpl 0x44(%rbx), %eax
jl 0xf0c3
jmp 0xf2dc
testl %ecx, %ecx
jle 0xf285
movslq %eax, %rdx
addq %rdx, %rdx
addq 0x38(%rbx), %rdx
xorl %esi, %esi
movzwl (%rdx,%rsi,2), %edi
cmpw 0x194(%r14,%rsi,2), %di
jne 0xf1ad
incq %rsi
cmpq %rsi, %rcx
jne 0xf26a
movl $0x1, 0x94(%rbx)
movw $0x20, 0x4(%rsp)
movl $0x1, %r15d
movq %rbx, %rdi
leaq 0x4(%rsp), %rsi
movl $0x1, %edx
jmp 0xf2d2
movl $0x1, 0x94(%rbx)
movw %bp, 0x6(%rsp)
movl $0x1, %r15d
movq %rbx, %rdi
leaq 0x6(%rsp), %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x72f8
jmp 0xf162
movslq 0x68(%rbx), %rbp
movq 0x60(%rbx), %rax
movw $0x0, (%rax,%rbp,2)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq