// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/languages/generic-forward.c
// Function: mark_mode
static void mark_mode(unsigned int *indicators, unsigned char *words, const struct translate *translate, const struct table *table, const struct mode *mode)
{
	unsigned int attrs;
	unsigned char word_mark;
	int emp_begin, user_begin_in, user_end_in, user_indicator_in, user_mode_in, marked_in, word_begin, space_prv, i;

	user_begin_in =
	user_end_in =
	user_indicator_in =
	marked_in = 0;
	emp_begin =
	user_mode_in =
	word_begin = -1;
	space_prv = 0;
	word_mark = WORD_INDICATOR;
	for(i = 0; i < translate->input_len; i++)
	{
		/*   skip when notrans is set   */
		if(translate->input_mask[translate->input_crs] & MASK_NO_TRANSLATION)
			continue;

		if(marked_in)
		{
			words[i] |= word_mark;
			if(translate_on_indicator_or_modifier_marker_at(translate, i))
				marked_in = 0;
		}
		else if(user_begin_in)
		{
			words[i] |= word_mark;
			if(translate->input[i] == table->marker_begin)
			{
				user_begin_in = 0;

				if(user_mode_in >= 0)
				{
					translate->input[i] = table->marker_internal;
					user_mode_in = -1;
				}
			}
			continue;
		}
		else if(user_end_in)
		{
			words[i] |= word_mark;
			if(translate->input[i] == table->marker_end)
			{
				user_end_in = 0;

				if(user_mode_in >= 0)
				{
					translate->input[i] = table->marker_internal;
					user_mode_in = -1;
				}
			}
			continue;
		}
		else if(user_indicator_in)
		{
			words[i] |= word_mark;
			if(translate->input[i] == table->marker_user)
			{
				user_indicator_in = 0;

				if(user_mode_in >= 0)
				{
					translate->input[i] = table->marker_internal;
					user_mode_in = -1;
				}
			}
			continue;
		}
		else if(translate->input[i] == table->marker_begin)
		{
			if(is_word_start(words, translate, i))
				word_mark = WORD_INDICATOR | WORD_CHAR;
			else
				word_mark = WORD_INDICATOR;
			words[i] |= word_mark;
			user_begin_in = 1;
			if(emp_begin < 0)
			{
				/*   set EMP_BEGIN at the spot of the marked
				     indicator in the text so that the order of
				     multiple begins can be distinguished by
				     different lengths   */
				if(is_marked_with_node_name_at(translate, mode, i))
				{
					emp_begin = i;
					user_mode_in = i;
					translate->input[i] = table->marker_internal;
				}
			}
			continue;
		}
		else if(translate->input[i] == table->marker_end)
		{
			if(is_word_start(words, translate, i))
				word_mark = WORD_INDICATOR | WORD_CHAR;
			else
				word_mark = WORD_INDICATOR;
			words[i] |= word_mark;
			user_end_in = 1;
			if(emp_begin >= 0)
			{
				if(is_marked_with_node_name_at(translate, mode, i))
				{
					indicators[emp_begin] = EMP_BEGIN;

					/*   set EMP_END before all contiguous
					     marked indicators   */
					indicators[get_before_indicators(words, i)] = EMP_END;
					emp_begin = -1;

					user_mode_in = i;
					translate->input[i] = table->marker_internal;
				}
			}
			continue;
		}
		else if(translate->input[i] == table->marker_user)
		{
			if(is_word_start(words, translate, i))
				word_mark = WORD_INDICATOR | WORD_CHAR;
			else
				word_mark = WORD_INDICATOR;
			words[i] |= word_mark;
			user_indicator_in = 1;
			if(emp_begin < 0)
			{
				if(is_marked_indicator_begin_at(translate, mode, i))
				{
					emp_begin = i;
					user_mode_in = i;
					translate->input[i] = table->marker_internal;
				}
			}
			else
			{
				if(is_marked_indicator_end_at(translate, mode, i))
				{
					indicators[emp_begin] = EMP_BEGIN;
					indicators[get_before_indicators(words, i)] = EMP_END;
					emp_begin = -1;

					user_mode_in = i;
					translate->input[i] = table->marker_internal;
				}
			}
			continue;
		}
		else if(translate_on_indicator_or_modifier_marker_at(translate, i))
		{
			if(is_word_start(words, translate, i))
				word_mark = WORD_INDICATOR | WORD_CHAR;
			else
				word_mark = WORD_INDICATOR;
			words[i] |= word_mark;
			marked_in = 1;
			continue;
		}

		/*   make sure no prefixed delimiters counting as word   */
		attrs = translate_get_attributes_at(translate, i);
		if(attrs & CHAR_SPACE)
		{
			space_prv = 1;
			word_begin = -1;
		}
		else if(attrs & CHAR_SEQUENCE_DELIMITER)
		{
			if(!space_prv)
			{
				words[i] |= WORD_CHAR;
				if(word_begin < 0)
					word_begin = i;
			}
		}
		else
		{
			words[i] |= WORD_CHAR;
			space_prv = 0;
			if(word_begin < 0)
				word_begin = i;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x38(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x50(%rbp)
movb $0x4, -0x2d(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x13648
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x18(%rbp), %rcx
movslq 0x40(%rcx), %rcx
movsbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13130
jmp 0x1363a
cmpl $0x0, -0x48(%rbp)
je 0x13168
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x13fd0
cmpl $0x0, %eax
je 0x13163
movl $0x0, -0x48(%rbp)
jmp 0x135b2
cmpl $0x0, -0x38(%rbp)
je 0x131d8
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
movzwl 0x1ea(%rcx), %ecx
cmpl %ecx, %eax
jne 0x131d3
movl $0x0, -0x38(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x131d1
movq -0x20(%rbp), %rax
movw 0x1f4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
jmp 0x131d3
jmp 0x1363a
cmpl $0x0, -0x3c(%rbp)
je 0x13248
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
movzwl 0x1ec(%rcx), %ecx
cmpl %ecx, %eax
jne 0x13243
movl $0x0, -0x3c(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x13241
movq -0x20(%rbp), %rax
movw 0x1f4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
jmp 0x13243
jmp 0x1363a
cmpl $0x0, -0x40(%rbp)
je 0x132b8
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
movzwl 0x1e8(%rcx), %ecx
cmpl %ecx, %eax
jne 0x132b3
movl $0x0, -0x40(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x132b1
movq -0x20(%rbp), %rax
movw 0x1f4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl $0xffffffff, -0x44(%rbp) # imm = 0xFFFFFFFF
jmp 0x132b3
jmp 0x1363a
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
movzwl 0x1ea(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1335f
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x14070
cmpl $0x0, %eax
je 0x132f6
movb $0x5, -0x2d(%rbp)
jmp 0x132fa
movb $0x4, -0x2d(%rbp)
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl $0x1, -0x38(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x1335a
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x14110
cmpl $0x0, %eax
je 0x13358
movl -0x54(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movw 0x1f4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x1335a
jmp 0x1363a
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
movzwl 0x1ec(%rcx), %ecx
cmpl %ecx, %eax
jne 0x1343a
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x14070
cmpl $0x0, %eax
je 0x1339d
movb $0x5, -0x2d(%rbp)
jmp 0x133a1
movb $0x4, -0x2d(%rbp)
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl $0x1, -0x3c(%rbp)
cmpl $0x0, -0x34(%rbp)
jl 0x13435
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x14110
cmpl $0x0, %eax
je 0x13433
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x14150
movl %eax, %ecx
movq -0x60(%rbp), %rax
movslq %ecx, %rcx
movl $0x2, (%rax,%rcx,4)
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl -0x54(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movw 0x1f4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x13435
jmp 0x1363a
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
movq -0x20(%rbp), %rcx
movzwl 0x1e8(%rcx), %ecx
cmpl %ecx, %eax
jne 0x13553
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x14070
cmpl $0x0, %eax
je 0x13478
movb $0x5, -0x2d(%rbp)
jmp 0x1347c
movb $0x4, -0x2d(%rbp)
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl $0x1, -0x40(%rbp)
cmpl $0x0, -0x34(%rbp)
jge 0x134dc
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x141a0
cmpl $0x0, %eax
je 0x134da
movl -0x54(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x54(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movw 0x1f4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x1354e
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x141f0
cmpl $0x0, %eax
je 0x1354c
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x14150
movl %eax, %ecx
movq -0x68(%rbp), %rax
movslq %ecx, %rcx
movl $0x2, (%rax,%rcx,4)
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl -0x54(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
movw 0x1f4(%rax), %dx
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x54(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x1354e
jmp 0x1363a
movq -0x18(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x13fd0
cmpl $0x0, %eax
je 0x135a4
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x14070
cmpl $0x0, %eax
je 0x1357f
movb $0x5, -0x2d(%rbp)
jmp 0x13583
movb $0x4, -0x2d(%rbp)
movzbl -0x2d(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl $0x1, -0x48(%rbp)
jmp 0x1363a
jmp 0x135a6
jmp 0x135a8
jmp 0x135aa
jmp 0x135ac
jmp 0x135ae
jmp 0x135b0
jmp 0x135b2
movq -0x18(%rbp), %rdi
movl -0x54(%rbp), %esi
callq 0x14240
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x135dc
movl $0x1, -0x50(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
jmp 0x13638
movl -0x2c(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x1360f
cmpl $0x0, -0x50(%rbp)
jne 0x1360d
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl $0x1, %edx
movb %dl, (%rax,%rcx)
cmpl $0x0, -0x4c(%rbp)
jge 0x1360b
movl -0x54(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x1360d
jmp 0x13636
movq -0x10(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %edx
orl $0x1, %edx
movb %dl, (%rax,%rcx)
movl $0x0, -0x50(%rbp)
cmpl $0x0, -0x4c(%rbp)
jge 0x13634
movl -0x54(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0x13636
jmp 0x13638
jmp 0x1363a
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x130ff
addq $0x70, %rsp
popq %rbp
retq
nop