// File: /workspace/github_c_makefile_star2_O1/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 %r13d, %r13d
movl %r13d, 0x68(%rdi)
movl %r13d, 0x40(%rdi)
cmpl %r13d, 0x44(%rdi)
jle 0xf41f
leaq 0x150(%r14), %r15
leaq 0x50(%r14), %rax
movq %rax, 0x10(%rsp)
leaq 0x4ab7(%rip), %rbp      # 0x13ce4
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x7151
cmpl $0x5, %eax
ja 0xf277
movl %eax, %eax
movslq (%rbp,%rax,4), %rax
addq %rbp, %rax
jmpq *%rax
movl $0x1, %r12d
movl $0x1, %r13d
jmp 0xf277
movl $0x1, %r12d
jmp 0xf277
xorl %r13d, %r13d
xorl %eax, %eax
testl %r13d, %r13d
setne %al
cmovel %r13d, %r12d
movl %eax, %r13d
testl %r13d, %r13d
je 0xf2c6
movq %rbx, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rdx
callq 0x7151
cmpl $0x6, %eax
jne 0xf2c6
movq %rbx, %rdi
callq 0x78c4
testl %eax, %eax
jle 0xf42d
movl $0x1, %r13d
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x7666
testl %eax, %eax
jne 0xf3df
jmp 0xf42d
movq %rbx, %rdi
callq 0x78c4
testl %eax, %eax
jg 0xf3df
testl %r12d, %r12d
je 0xf3c6
movl 0x1b4(%r14), %ecx
movslq 0x40(%rbx), %rax
testq %rcx, %rcx
je 0xf2f7
leal (%rax,%rcx), %edx
cmpl 0x44(%rbx), %edx
jle 0xf34b
testl %r13d, %r13d
je 0xf396
movq 0x38(%rbx), %rax
movslq 0x40(%rbx), %rcx
movzwl (%rax,%rcx,2), %r12d
movzwl %r12w, %esi
movq %r14, %rdi
callq 0x1e99
testq %rax, %rax
je 0xf32d
testb $0x10, 0x25(%rax)
je 0xf32d
movq 0x10(%rax), %rax
movzwl 0x20(%rax), %r12d
movq 0x38(%rbx), %rax
movslq 0x40(%rbx), %rcx
cmpw (%rax,%rcx,2), %r12w
jne 0xf3ed
movl $0x1, %r12d
jmp 0xf2a7
testl %ecx, %ecx
jle 0xf370
leaq (%rax,%rax), %rdx
addq 0x38(%rbx), %rdx
xorl %esi, %esi
movzwl (%rdx,%rsi,2), %edi
cmpw 0x194(%r14,%rsi,2), %di
jne 0xf2f7
incq %rsi
cmpq %rsi, %rcx
jne 0xf359
movl $0x1, 0x94(%rbx)
movw $0x20, 0xc(%rsp)
movl $0x1, %r12d
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
movl $0x1, %edx
jmp 0xf415
testl %eax, %eax
js 0xf3c6
cmpl %eax, 0x44(%rbx)
jle 0xf3c6
movslq 0x8(%rbx), %rcx
movq (%rbx), %rdx
movq 0x38(%rbx), %rsi
movq (%rdx,%rcx,8), %rdi
movzwl (%rsi,%rax,2), %esi
callq 0x1e99
testq %rax, %rax
je 0xf3c6
testb $0x30, 0x25(%rax)
jne 0xf300
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x7666
testl %eax, %eax
je 0xf42d
xorl %r12d, %r12d
movl 0x40(%rbx), %eax
cmpl 0x44(%rbx), %eax
jl 0xf230
jmp 0xf41f
movl $0x1, 0x94(%rbx)
movw %r12w, 0xe(%rsp)
movl $0x1, %r12d
movq %rbx, %rdi
leaq 0xe(%rsp), %rsi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x74f9
jmp 0xf2b9
movq 0x60(%rbx), %rax
movslq 0x68(%rbx), %rcx
movw $0x0, (%rax,%rcx,2)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq