// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/languages/generic-forward.c
// Function: add_indicators_numeric
static int add_indicators_numeric(struct translate *translate)
{
	const struct table *table;
	unsigned int attrs;
	int notrans_in, numeric_in, numeric_passage_in, nocontract_in;
	unichar uchar;

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

	notrans_in =
	numeric_in =
	numeric_passage_in =
	nocontract_in = 0;

	translate->input_crs =
	translate->output_len = 0;
	while(translate->input_crs < translate->input_len)
	{
		/*   reset mode and just copy input when notrans is set   */
		if(!notrans_in)
		{
			if(translate->input_mask[translate->input_crs] & MASK_NO_TRANSLATION)
			{
				notrans_in = 1;

				/*   reset mode   */
				numeric_in =
				numeric_passage_in =
				nocontract_in = 0;

				if(!translate_copy_to_output(translate, 1, 1))
					return 0;
				continue;
			}
		}
		else
		{
			if(!(translate->input_mask[translate->input_crs] & MASK_NO_TRANSLATION))
				notrans_in = 0;
			else
			{
				if(!translate_copy_to_output(translate, 1, 1))
					return 0;
				continue;
			}
		}

		/*   numeric passages   */
		if(!numeric_passage_in)
		{
			if(is_marked_indicator_begin(translate, &table->numeric))
			{
				if(!nocontract_in)
				{
					nocontract_in = 1;
					if(table->nocontract.begin_len)
					if(!generic_insert_marked(translate, table->nocontract.begin, table->nocontract.begin_len, table->marker_soft))
						return 0;
				}

				numeric_passage_in = 1;
				translate_copy_marked_indicators(translate);
				continue;
			}
		}
		else
		{
			if(is_marked_indicator_end(translate, &table->numeric))
			{
				numeric_passage_in = 0;
				translate_copy_marked_indicators(translate);

				ASSERT(nocontract_in)
				nocontract_in = 0;
				if(table->nocontract.end_len)
				if(!generic_insert_marked(translate, table->nocontract.end, table->nocontract.end_len, table->marker_soft))
					return 0;
			}
			else
			{
				if(translate_has_attributes(translate, CHAR_NUMERIC_UCHAR))
				{
					if(table->nocontract.symbol_len)
					if(!generic_insert_marked(translate, table->nocontract.symbol, table->nocontract.symbol_len, table->marker_hard))
						return 0;
				}

				uchar = generic_digit_to_uchar(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;
			}
			continue;
		}

		/*   numeric mode   */
		attrs = table_get_character_attributes(table, translate->input[translate->input_crs]);
		if(!numeric_in)
		{
			if(attrs & CHAR_NUMERIC_DIGIT)
			{
				if(!nocontract_in)
				{
					nocontract_in = 1;
					if(table->nocontract.word_len)
					if(!generic_insert_marked(translate, table->nocontract.word, table->nocontract.word_len, table->marker_soft))
						return 0;
				}

				numeric_in = 1;
				if(!generic_insert_marked(translate, table->numeric.word, table->numeric.word_len, table->marker_hard))
					return 0;
			}
			else if(attrs & CHAR_NUMERIC_CONT)
			{
				/*   for a CHAR_NUMERIC_CONT to start numeric
				     mode, it must not be preceded by a letter,
				     and must be followed by a digit   */
				if(!is_letter_before(translate, table) && is_digit_after(translate, table))
				{
					numeric_in =
					nocontract_in = 1;
					if(table->nocontract.word_len)
					if(!generic_insert_marked(translate, table->nocontract.word, table->nocontract.word_len, table->marker_soft))
						return 0;
					if(!generic_insert_marked(translate, table->numeric.word, table->numeric.word_len, table->marker_hard))
						return 0;
				}
				else if(!translate_copy_to_output(translate, 1, 1))
					return 0;
			}
			else if(nocontract_in && (attrs & (CHAR_SPACE | CHAR_SEQUENCE_DELIMITER)))
			{
				nocontract_in = 0;
				if(table->nocontract.term_len)
				{
					CHANGE_MARK
					if(!generic_insert_marked(translate, table->nocontract.term, table->nocontract.term_len, table->marker_soft))
						return 0;
				}
			}
			else if(!translate_copy_to_output(translate, 1, 1))
				return 0;
		}
		else
		{
			if(attrs & (CHAR_SPACE | CHAR_SEQUENCE_DELIMITER))
			{
				numeric_in = 0;
				CHANGE_MARK

				if(!generic_insert_marked(translate, table->numeric.end, table->numeric.end_len, table->marker_soft))
					return 0;

				ASSERT(nocontract_in)
				nocontract_in = 0;
				if(table->nocontract.term_len)
				if(!generic_insert_marked(translate, table->nocontract.term, table->nocontract.term_len, table->marker_soft))
					return 0;
			}
			else if(!(attrs & (CHAR_NUMERIC_DIGIT | CHAR_NUMERIC_CONT)))
			{
				CHANGE_MARK
				if(!generic_insert_marked(translate, table->numeric.end, table->numeric.end_len, table->marker_soft))
					return 0;
				if(attrs & CHAR_NUMERIC_TERM)
				if(!generic_insert_marked(translate, table->numeric.term, table->numeric.term_len, table->marker_hard))
					return 0;
				numeric_in = 0;
			}
			else
			{
				uchar = generic_digit_to_uchar(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;
			}
		}
	}

	//   there were issues with characters that rely on matching word endings choking on terminating indicators
	if(nocontract_in)
	if(table->nocontract.term_len)
	{
		CHANGE_MARK
		if(!generic_insert_marked(translate, table->nocontract.term, table->nocontract.term_len, table->marker_soft))
			return 0;
	}

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

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl $0x0, 0x68(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movl 0x40(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x12d68
cmpl $0x0, -0x20(%rbp)
jne 0x12672
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x40(%rcx), %rcx
movsbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x12670
movl $0x1, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x1266e
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x125fb
jmp 0x126bf
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x40(%rcx), %rcx
movsbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x12697
movl $0x0, -0x20(%rbp)
jmp 0x126bd
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x126b8
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x125fb
jmp 0x126bf
cmpl $0x0, -0x28(%rbp)
jne 0x12755
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
callq 0x16230
cmpl $0x0, %eax
je 0x12750
cmpl $0x0, -0x2c(%rbp)
jne 0x1273b
movl $0x1, -0x2c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xa4(%rax)
je 0x12739
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0xc, %rsi
movq -0x18(%rbp), %rax
movl 0xa4(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12737
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12739
jmp 0x1273b
movl $0x1, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb160
jmp 0x125fb
jmp 0x128d8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
callq 0x16260
cmpl $0x0, %eax
je 0x127df
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0xb160
cmpl $0x0, -0x2c(%rbp)
jne 0x12789
callq 0x1050
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xa8(%rax)
je 0x127da
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0x1a, %rsi
movq -0x18(%rbp), %rax
movl 0xa8(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x127d8
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x127da
jmp 0x128d3
movq -0x10(%rbp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x16290
cmpl $0x0, %eax
je 0x1283e
movq -0x18(%rbp), %rax
cmpl $0x0, 0xb4(%rax)
je 0x1283c
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0x44, %rsi
movq -0x18(%rbp), %rax
movl 0xb4(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f0(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x1283a
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x1283c
jmp 0x1283e
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x40(%rcx), %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x162c0
movw %ax, -0x2e(%rbp)
movzwl -0x2e(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rcx
movq -0x10(%rbp), %rdx
movslq 0x40(%rdx), %rdx
movzwl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
je 0x128ae
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movzwl -0x2e(%rbp), %esi
callq 0x161f0
cmpl $0x0, %eax
jne 0x128ac
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x128d1
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x128cf
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x128d1
jmp 0x128d3
jmp 0x125fb
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x40(%rcx), %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x14490
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x12b51
movl -0x1c(%rbp), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x129b6
cmpl $0x0, -0x2c(%rbp)
jne 0x1296c
movl $0x1, -0x2c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xac(%rax)
je 0x1296a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0x28, %rsi
movq -0x18(%rbp), %rax
movl 0xac(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12968
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x1296a
jmp 0x1296c
movl $0x1, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x28, %rsi
movq -0x18(%rbp), %rax
movl 0x1ac(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f0(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x129b1
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12b4c
movl -0x1c(%rbp), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x12ab3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x16330
cmpl $0x0, %eax
jne 0x12a8b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x163b0
cmpl $0x0, %eax
je 0x12a8b
movl $0x1, -0x2c(%rbp)
movl $0x1, -0x24(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xac(%rax)
je 0x12a4b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0x28, %rsi
movq -0x18(%rbp), %rax
movl 0xac(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12a49
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12a4b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x28, %rsi
movq -0x18(%rbp), %rax
movl 0x1ac(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f0(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12a89
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12aae
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x12aac
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12aae
jmp 0x12b4a
cmpl $0x0, -0x2c(%rbp)
je 0x12b25
movl -0x1c(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x12b25
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xb0(%rax)
je 0x12b23
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0x36, %rsi
movq -0x18(%rbp), %rax
movl 0xb0(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12b21
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12b23
jmp 0x12b48
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x12b46
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12b48
jmp 0x12b4a
jmp 0x12b4c
jmp 0x12d63
movl -0x1c(%rbp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x12c14
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x1a, %rsi
movq -0x18(%rbp), %rax
movl 0x1a8(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12bb3
movl $0x0, -0x4(%rbp)
jmp 0x12de2
cmpl $0x0, -0x2c(%rbp)
jne 0x12bbe
callq 0x1050
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xb0(%rax)
je 0x12c0f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0x36, %rsi
movq -0x18(%rbp), %rax
movl 0xb0(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12c0d
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12c0f
jmp 0x12d61
movl -0x1c(%rbp), %eax
andl $0x2800, %eax           # imm = 0x2800
cmpl $0x0, %eax
jne 0x12cca
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x1a, %rsi
movq -0x18(%rbp), %rax
movl 0x1a8(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12c71
movl $0x0, -0x4(%rbp)
jmp 0x12de2
movl -0x1c(%rbp), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x12cbe
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x150, %rsi            # imm = 0x150
addq $0x36, %rsi
movq -0x18(%rbp), %rax
movl 0x1b0(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f0(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12cbc
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12cbe
movl $0x0, -0x24(%rbp)
jmp 0x12d5f
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x40(%rcx), %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x162c0
movw %ax, -0x2e(%rbp)
movzwl -0x2e(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x38(%rcx), %rcx
movq -0x10(%rbp), %rdx
movslq 0x40(%rdx), %rdx
movzwl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
je 0x12d3a
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movzwl -0x2e(%rbp), %esi
callq 0x161f0
cmpl $0x0, %eax
jne 0x12d38
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12d5d
movq -0x10(%rbp), %rdi
movl $0x1, %edx
movl %edx, %esi
callq 0xaeb0
cmpl $0x0, %eax
jne 0x12d5b
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12d5d
jmp 0x12d5f
jmp 0x12d61
jmp 0x12d63
jmp 0x125fb
cmpl $0x0, -0x2c(%rbp)
je 0x12dc5
movq -0x18(%rbp), %rax
cmpl $0x0, 0xb0(%rax)
je 0x12dc3
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
addq $0x36, %rsi
movq -0x18(%rbp), %rax
movl 0xb0(%rax), %edx
movq -0x18(%rbp), %rax
movzwl 0x1f2(%rax), %ecx
callq 0x102a0
cmpl $0x0, %eax
jne 0x12dc1
movl $0x0, -0x4(%rbp)
jmp 0x12de2
jmp 0x12dc3
jmp 0x12dc5
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 $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)