// File: /workspace/github_c_makefile_star2_O3/MikeGray-APH[P]LibLouisAPH/source/languages/generic-forward.c
// Function: indicators_to_words
static void indicators_to_words(unsigned int *indicators, unsigned char *words, const struct translate *translate)
{
	int ind_in, emp_in, emp_len, word_in, word_begin, word_began, word_whole, word_stop, word_len, i;

	ind_in =
	emp_in =
	word_in =
	word_whole = 0;
	word_began = 0;
	word_begin = -1;
	word_len =
	emp_len = 0;

	for(i = 0; i < translate->input_len; i++)
	{
		/*   keep track of indicators   */
		if(words[i] & WORD_INDICATOR)
			ind_in = 1;
		else
			ind_in = 0;

		/*   clear out previous whole word markings   */
		words[i] &= ~WORD_WHOLE;

		/*   beginning of mode   */
		if(!emp_in)
		if(indicators[i] & EMP_BEGIN)
		{
			emp_in = 1;
			emp_len = 0;
			indicators[i] &= ~EMP_BEGIN;

			/*   mode starting inside word   */
			if(words[i] & WORD_CHAR)
			{
				word_begin = i;
				word_len = 0;
				if(word_began)
					word_whole = 0;
				else
					word_whole = WORD_WHOLE;
			}
		}

		/*   end of mode   */
		if(emp_in)
		if(indicators[i] & EMP_END)
		{
			emp_in = 0;
			indicators[i] &= ~EMP_END;

			if(word_in && word_begin >= 0)
			{
				/*   check if mode ended inside a word   */
				word_stop = EMP_END | EMP_WORD;
				if(words[i] & WORD_CHAR)
					word_whole = 0;
				else
					word_stop = 0;

				/*   if whole word is one symbol,
				     turn it into a symbol   */
				if(EMP_SYMBOL && word_len == 1)
					indicators[word_begin] |= EMP_SYMBOL;
				else
				{
					indicators[word_begin] |= EMP_WORD;
					indicators[i] |= word_stop;
				}
				words[word_begin] |= word_whole;
			}
		}
		else if(!ind_in)
			emp_len++;

		/*   beginning of word   */
		if(!word_in)
		if(words[i] & WORD_CHAR)
		{
			if(!(words[i] & WORD_INDICATOR))
				word_began = 1;
			word_in = 1;
			word_len = 0;
			if(emp_in)
			{
				word_begin = i;
				word_whole = WORD_WHOLE;
			}
		}

		/*   end of word   */
		if(word_in)
		if(!(words[i] & WORD_CHAR) && !ind_in)
		{
			/*   made it through whole word   */
			if(emp_in && word_begin >= 0)
			{
				/*   if word is one character,
				     turn it into a symbol   */
				if(EMP_SYMBOL && word_len == 1)
						indicators[word_begin] |= EMP_SYMBOL;
				else
					indicators[word_begin] |= EMP_WORD;
				words[word_begin] |= word_whole;
			}

			word_in = 0;
			word_whole = 0;
			word_begin = -1;
			word_began = 0;
		}
		else
		{
			/*   words don't start on indicators   */
			if(!(words[i] & WORD_INDICATOR))
			{
				word_began = 1;
				word_len++;
			}
		}
	}

	/*   input end   */
	if(emp_in)
	{
		indicators[i] &= ~EMP_END;

		if(word_in)
		if(word_begin >= 0)
		{
			/*   if word is one character,
			     turn it into a symbol   */
			if(EMP_SYMBOL && word_len == 1)
					indicators[word_begin] |= EMP_SYMBOL;
			else
				indicators[word_begin] |= EMP_WORD;
			words[word_begin] |= word_whole;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, -0x8(%rsp)
cmpl $0x0, 0x44(%rdx)
jle 0xdf39
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r11d, %r11d
xorl %r8d, %r8d
xorl %edx, %edx
xorl %eax, %eax
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %r12d, %r12d
movb (%rsi,%r8), %r9b
movl %r9d, %r15d
andb $-0x3, %r15b
movb %r15b, (%rsi,%r8)
movl (%rdi,%r8,4), %ecx
testl %r12d, %r12d
je 0xddf2
xorl %r12d, %r12d
xorl %r10d, %r10d
testb $0x2, %cl
jne 0xddba
movl $0x1, %r12d
movb $0x1, %r10b
xorl %ebx, %ebx
jmp 0xddff
andl $-0x3, %ecx
movl %ecx, (%rdi,%r8,4)
movb (%rsi,%r8), %r15b
movb $0x1, %bl
testl %r13d, %r13d
je 0xddfc
testl %ebp, %ebp
js 0xddfc
testb $0x1, %r15b
cmovnel %r12d, %eax
movl %ebp, %ecx
cmpl $0x1, %edx
jne 0xde66
leaq (%rdi,%rcx,4), %rbx
movl $0x8, %r10d
jmp 0xde7c
testb $0x1, %cl
jne 0xde18
xorl %r10d, %r10d
movb $0x1, %bl
xorl %r12d, %r12d
testl %r13d, %r13d
jne 0xde8c
xorl %ecx, %ecx
testb $0x1, %r15b
jne 0xde47
xorl %r13d, %r13d
jmp 0xdef1
andl $-0x2, %ecx
movl %ecx, (%rdi,%r8,4)
movb (%rsi,%r8), %r15b
testb $0x1, %r15b
movl $0x0, %r12d
je 0xdda5
xorl %eax, %eax
testl %r14d, %r14d
sete %al
addl %eax, %eax
xorl %edx, %edx
movl %r8d, %ebp
jmp 0xdda5
testb $0x4, %r15b
movl $0x1, %ecx
cmovel %ecx, %r14d
testb %bl, %bl
cmovel %r8d, %ebp
movl $0x2, %ecx
cmovel %ecx, %eax
xorl %edx, %edx
jmp 0xde8c
testb $0x1, %r15b
movl $0x6, %r10d
cmovel %r12d, %r10d
leaq (%rdi,%r11), %rbx
orb $0x4, (%rdi,%rcx,4)
orl %r10d, (%rbx)
orb %al, (%rsi,%rcx)
movb (%rsi,%r8), %r15b
xorl %r12d, %r12d
xorl %r10d, %r10d
movzbl %r15b, %ecx
testb $0x4, %r9b
jne 0xdeda
movl %ecx, %r9d
andl $0x1, %r9d
jne 0xdeda
testl %ebp, %ebp
setns %cl
andb %cl, %r10b
xorl %ecx, %ecx
cmpb $0x1, %r10b
jne 0xdecb
xorl %ecx, %ecx
cmpl $0x1, %edx
sete %cl
movl %ebp, %r9d
leal 0x4(,%rcx,4), %ecx
orl %ecx, (%rdi,%r9,4)
orb %al, (%rsi,%r9)
xorl %ecx, %ecx
xorl %r13d, %r13d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
xorl %eax, %eax
jmp 0xdef1
andl $0x4, %ecx
movl $0x1, %r13d
cmovel %r13d, %r14d
shrl $0x2, %ecx
xorl $0x1, %ecx
addl %ecx, %edx
movb $0x1, %cl
incq %r8
movq -0x8(%rsp), %r9
movslq 0x44(%r9), %r9
addq $0x4, %r11
cmpq %r9, %r8
jl 0xdd8a
testl %r12d, %r12d
je 0xdf39
andb $-0x3, (%rdi,%r8,4)
testl %ebp, %ebp
setns %r8b
andb %r8b, %cl
cmpb $0x1, %cl
jne 0xdf39
xorl %ecx, %ecx
cmpl $0x1, %edx
sete %cl
movl %ebp, %edx
leal 0x4(,%rcx,4), %ecx
orl %ecx, (%rdi,%rdx,4)
orb %al, (%rsi,%rdx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq