// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/languages/generic-forward.c
// Function: words_to_passages
static void words_to_passages(unsigned int *indicators, unsigned char *words, const struct translate *translate, const int passage_len)
{
	int word_in, word_cnt, pass_in, pass_begin, pass_end, i;

	pass_begin =
	pass_end = -1;
	pass_in =
	word_in = 0;
	word_cnt = 0;

	for(i = 0; i < translate->input_len; i++)
	{
		/*   beginning of word   */
		if(!word_in)
		if(words[i] & WORD_CHAR)
		{
			word_in = 1;
			if(pass_in)
			{
				if(!(indicators[i] & EMP_WORD || indicators[i] & EMP_SYMBOL))
				{
					if(word_cnt >= passage_len)
					if(pass_end >= 0)
						convert_to_passage(indicators, words, pass_begin, pass_end);
					pass_in = 0;
				}
				else
					word_cnt++;
			}
		}

		/*   end of word   */
		if(word_in)
		if(!(words[i] & WORD_CHAR))
		{
			word_in = 0;
			if(pass_in)
				pass_end = i;
		}

		/*   beginning of passage   */
		if(!pass_in)
		if(indicators[i] == EMP_WORD)
		{
			pass_in = 1;
			pass_begin = i;
			word_cnt = 1;
		}
		else if(indicators[i] == EMP_SYMBOL)
		{
			pass_begin = i;
			while(i < translate->input_len)
			if(words[i] & WORD_INDICATOR)
				i++;
			else
				break;

			if(!(words[i + 1] & WORD_CHAR))
			{
				pass_in = 1;
				word_cnt = 1;
			}
			else
				pass_begin = -1;
		}

		/*   end of passage   */
		if(pass_in)
		if(indicators[i] == (EMP_WORD | EMP_END))
		{
			if(word_cnt >= passage_len)
			if(pass_end >= 0)
				convert_to_passage(indicators, words, pass_begin, i);
			pass_in = 0;
		}
		else if(indicators[i] == EMP_SYMBOL)
		{
			while(i < translate->input_len)
			if(words[i] & WORD_INDICATOR)
				i++;
			else
				break;

			if(words[i + 1] & WORD_CHAR)
			{
				i++;
				if(word_cnt >= passage_len)
					convert_to_passage(indicators, words, pass_begin, i);
				pass_in = 0;
			}
		}
	}

	/*   input end   */
	if(pass_in)
	{
		if(word_cnt >= passage_len)
		if(pass_end >= 0)
		if(word_in)
			convert_to_passage(indicators, words, pass_begin, translate->input_len);
		else
			convert_to_passage(indicators, words, pass_begin, pass_end);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0xffffffff, -0x30(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x20(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x13c55
cmpl $0x0, -0x20(%rbp)
jne 0x13a9d
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13a9b
movl $0x1, -0x20(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x13a99
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x13a8e
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x13a8e
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x13a85
cmpl $0x0, -0x30(%rbp)
jl 0x13a83
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
callq 0x144e0
jmp 0x13a85
movl $0x0, -0x28(%rbp)
jmp 0x13a97
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x13a99
jmp 0x13a9b
jmp 0x13a9d
cmpl $0x0, -0x20(%rbp)
je 0x13ace
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x13acc
movl $0x0, -0x20(%rbp)
cmpl $0x0, -0x28(%rbp)
je 0x13aca
movl -0x34(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x13acc
jmp 0x13ace
cmpl $0x0, -0x28(%rbp)
jne 0x13b75
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x4, (%rax,%rcx,4)
jne 0x13afc
movl $0x1, -0x28(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl $0x1, -0x24(%rbp)
jmp 0x13b73
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x8, (%rax,%rcx,4)
jne 0x13b71
movl -0x34(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x13b3f
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x13b3b
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13b3d
jmp 0x13b3f
jmp 0x13b10
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x13b68
movl $0x1, -0x28(%rbp)
movl $0x1, -0x24(%rbp)
jmp 0x13b6f
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
jmp 0x13b71
jmp 0x13b73
jmp 0x13b75
cmpl $0x0, -0x28(%rbp)
je 0x13c45
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x6, (%rax,%rcx,4)
jne 0x13bbc
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x13bb0
cmpl $0x0, -0x30(%rbp)
jl 0x13bae
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x34(%rbp), %ecx
callq 0x144e0
jmp 0x13bb0
movl $0x0, -0x28(%rbp)
jmp 0x13c43
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x8, (%rax,%rcx,4)
jne 0x13c41
jmp 0x13bcc
movl -0x34(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x13bfb
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x13bf7
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13bf9
jmp 0x13bfb
jmp 0x13bcc
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13c3f
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x13c38
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x34(%rbp), %ecx
callq 0x144e0
movl $0x0, -0x28(%rbp)
jmp 0x13c41
jmp 0x13c43
jmp 0x13c45
jmp 0x13c47
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x13a01
cmpl $0x0, -0x28(%rbp)
je 0x13ca1
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jl 0x13c9f
cmpl $0x0, -0x30(%rbp)
jl 0x13c9d
cmpl $0x0, -0x20(%rbp)
je 0x13c88
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x44(%rax), %ecx
callq 0x144e0
jmp 0x13c9b
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x30(%rbp), %ecx
callq 0x144e0
jmp 0x13c9d
jmp 0x13c9f
jmp 0x13ca1
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)