// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/languages/nemeth-forward.c
// Function: add_numeric_indicators
static int add_numeric_indicators(struct translate *translate)
{
	int do_insert;
	const unichar indicator = u'⠼';

	translate->table_crs = translate->table_cnt - 1;

	translate->input_crs =
	translate->output_len = 0;

	if(translate_has_attributes(translate, NEMETH_DIGIT | NEMETH_DECIMAL_SEPARATOR))
	{
		CHANGE_MARK
		if(!translate_insert_dots(translate, &indicator, 1))
			return 0;
	}
	if(!translate_copy_to_output(translate, 1, 1))
		return 0;

	do_insert = 0;
	while(translate->input_crs < translate->input_len)
	{
		if(translate_has_attributes(translate, NEMETH_DIGIT | NEMETH_DECIMAL_SEPARATOR))
		{
			if(   translate_has_attributes_at(translate, translate->input_crs - 1, NEMETH_SPACE)
			   || translate->input[translate->input_crs - 1] == TABLE_MARKER_INTERNAL)
					do_insert = 1;
			else if(translate_has_attributes_at(translate, translate->input_crs - 1, NEMETH_DECIMAL_MINUS))
			{
				if(translate_has_attributes_at(translate, translate->input_crs - 2, NEMETH_SPACE))
					do_insert = 1;
				else if(   translate->input_crs - 2 < 0
				        || translate->input[translate->input_crs - 2] == TABLE_MARKER_INTERNAL)
					do_insert = 1;
			}
			/*   §9.d   */
			else if(translate_has_attributes_at(translate, translate->input_crs - 1, NEMETH_NUMERIC_AFTER))
				do_insert = 1;
		}
		if(do_insert)
		{
			do_insert = 0;
			CHANGE_MARK
			if(!translate_insert_dots(translate, &indicator, 1))
				return 0;
		}

		if(!translate_copy_to_output(translate, 1, 1))
			return 0;
	}

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

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movw $0x283c, -0x16(%rbp)    # imm = 0x283C
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x68(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x1a0b0
cmpl $0x0, %eax
je 0x19d9f
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
leaq -0x16(%rbp), %rsi
movl $0x1, %edx
callq 0xab20
cmpl $0x0, %eax
jne 0x19d9d
movl $0x0, -0x4(%rbp)
jmp 0x19f5f
jmp 0x19d9f
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x19dc0
movl $0x0, -0x4(%rbp)
jmp 0x19f5f
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x19f42
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x1a0b0
cmpl $0x0, %eax
je 0x19ee2
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x40(%rax), %esi
subl $0x1, %esi
movl $0x1, %edx
callq 0x1a0e0
cmpl $0x0, %eax
jne 0x19e2f
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x40(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0xf007, %eax           # imm = 0xF007
jne 0x19e3b
movl $0x1, -0x14(%rbp)
jmp 0x19ee0
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x40(%rax), %esi
subl $0x1, %esi
movl $0x10, %edx
callq 0x1a0e0
cmpl $0x0, %eax
je 0x19eb8
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x40(%rax), %esi
subl $0x2, %esi
movl $0x1, %edx
callq 0x1a0e0
cmpl $0x0, %eax
je 0x19e7e
movl $0x1, -0x14(%rbp)
jmp 0x19eb6
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
subl $0x2, %eax
cmpl $0x0, %eax
jl 0x19ead
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x40(%rcx), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0xf007, %eax           # imm = 0xF007
jne 0x19eb4
movl $0x1, -0x14(%rbp)
jmp 0x19eb6
jmp 0x19ede
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x40(%rax), %esi
subl $0x1, %esi
movl $0x80, %edx
callq 0x1a0e0
cmpl $0x0, %eax
je 0x19edc
movl $0x1, -0x14(%rbp)
jmp 0x19ede
jmp 0x19ee0
jmp 0x19ee2
cmpl $0x0, -0x14(%rbp)
je 0x19f1f
movl $0x0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
leaq -0x16(%rbp), %rsi
movl $0x1, %edx
callq 0xab20
cmpl $0x0, %eax
jne 0x19f1d
movl $0x0, -0x4(%rbp)
jmp 0x19f5f
jmp 0x19f1f
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x19f3d
movl $0x0, -0x4(%rbp)
jmp 0x19f5f
jmp 0x19dc7
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x68(%rcx), %rcx
movw $0x0, (%rax,%rcx,2)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)