// File: /workspace/github_c_makefile_star2_O1/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 $0x0, -0x8(%rsp)
cmpl $0x0, 0x44(%rdx)
jle 0xe015
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movq %rdi, -0x10(%rsp)
movq %rdi, %r11
xorl %ecx, %ecx
xorl %edi, %edi
xorl %ebx, %ebx
xorl %r14d, %r14d
xorl %r13d, %r13d
xorl %r12d, %r12d
movl %r12d, %eax
movb (%rsi,%rcx), %r9b
movl %r9d, %r10d
andb $-0x3, %r10b
movb %r10b, (%rsi,%rcx)
xorl %r12d, %r12d
testl %eax, %eax
jne 0xdea1
movl (%r11), %r10d
movb $0x1, %al
testb $0x1, %r10b
je 0xdea3
andl $-0x2, %r10d
movl %r10d, (%r11)
xorl %eax, %eax
testb $0x1, (%rsi,%rcx)
je 0xdea3
xorl %ebx, %ebx
testl %r14d, %r14d
sete %bl
addl %ebx, %ebx
movl %ecx, %r8d
xorl %edi, %edi
jmp 0xdea3
xorl %eax, %eax
testb %al, %al
je 0xdeae
movb $0x1, %r15b
xorl %eax, %eax
jmp 0xdf2b
movl (%r11), %r10d
xorl %eax, %eax
testb $0x2, %r10b
jne 0xdec6
movl $0x1, %r12d
movb $0x1, %al
xorl %r15d, %r15d
jmp 0xdf2b
andl $-0x3, %r10d
movl %r10d, (%r11)
movb $0x1, %r15b
testl %r13d, %r13d
je 0xdf28
testl %r8d, %r8d
js 0xdf28
movb (%rsi,%rcx), %r12b
testb $0x1, %r12b
movl $0x0, %eax
cmovnel %eax, %ebx
movl %r8d, %eax
cmpl $0x1, %edi
jne 0xdf03
movq -0x10(%rsp), %r10
leaq (%r10,%rax,4), %r12
movl $0x8, %r10d
jmp 0xdf1f
xorl %r10d, %r10d
testb $0x1, %r12b
je 0xdf12
movl $0x6, %r10d
movq -0x10(%rsp), %r12
orb $0x4, (%r12,%rax,4)
movq %r11, %r12
orl %r10d, (%r12)
orb %bl, (%rsi,%rax)
xorl %eax, %eax
xorl %r12d, %r12d
xorl %r10d, %r10d
testl %r13d, %r13d
jne 0xdf63
movzbl (%rsi,%rcx), %ebp
movb $0x1, %r13b
testb $0x1, %bpl
je 0xdf66
testb $0x4, %bpl
movl $0x1, %edi
cmovel %edi, %r14d
testb %r15b, %r15b
cmovel %ecx, %r8d
movl $0x2, %edi
cmovel %edi, %ebx
xorl %r13d, %r13d
xorl %edi, %edi
jmp 0xdf66
xorl %r13d, %r13d
testb %r13b, %r13b
je 0xdf70
xorl %r13d, %r13d
jmp 0xdfe4
shrb $0x2, %r9b
movzbl (%rsi,%rcx), %r10d
movl %r10d, %ebp
orb %r9b, %bpl
testb $0x1, %bpl
je 0xdfa3
andl $0x4, %r10d
movl $0x1, %r13d
cmovel %r13d, %r14d
shrl $0x2, %r10d
xorl $0x1, %r10d
addl %r10d, %edi
movb $0x1, %r10b
jmp 0xdfe4
testl %r8d, %r8d
setns %r9b
andb %r9b, %al
xorl %r10d, %r10d
cmpb $0x1, %al
jne 0xdfd6
xorl %eax, %eax
cmpl $0x1, %edi
sete %al
movl %r8d, %r8d
leal 0x4(,%rax,4), %eax
movq -0x10(%rsp), %r9
orl %eax, (%r9,%r8,4)
orb %bl, (%rsi,%r8)
xorl %r10d, %r10d
xorl %r13d, %r13d
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
xorl %ebx, %ebx
incq %rcx
movslq 0x44(%rdx), %rax
addq $0x4, %r11
cmpq %rax, %rcx
jl 0xde5d
xorl %eax, %eax
cmpl $0x1, %edi
sete %al
leal 0x4(,%rax,4), %eax
movl %ebx, %edx
movq %rdx, -0x8(%rsp)
movq -0x10(%rsp), %rdi
jmp 0xe028
movl $0x4, %eax
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
movb $0x1, %r15b
xorl %r10d, %r10d
xorl %ecx, %ecx
testb %r15b, %r15b
jne 0xe04e
andb $-0x3, (%rdi,%rcx,4)
testl %r8d, %r8d
setns %cl
andb %cl, %r10b
cmpb $0x1, %r10b
jne 0xe04e
movl %r8d, %ecx
orl %eax, (%rdi,%rcx,4)
movq -0x8(%rsp), %rax
orb %al, (%rsi,%rcx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq