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

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

	for(i = 0; i < translate->input_len; i++)
	{
		/*   reset passages and skip when notrans or nocapital is set   */
		if(!nocaps_in)
		{
			if(translate->input_mask[i] & (MASK_NO_TRANSLATION | MASK_NO_CAPITALIZATION))
			{
				nocaps_in = 1;

				/*   reset passages   */
				if(word_cnt >= passage_len)
				{
					if(word_in)
						pass_end = i;
					if(pass_end >= 0)
						convert_to_passage(indicators, words, pass_begin, pass_end);
				}
				pass_in = 0;
				word_in = 0;

				continue;
			}
		}
		else
		{
			if(!(translate->input_mask[i] & (MASK_NO_TRANSLATION | MASK_NO_CAPITALIZATION)))
				nocaps_in = 0;
			else
				continue;
		}

		/*   indicators   */
		if(indicator_in)
		{
			if(is_indicator_delimiter(table, translate->input[i]))
				indicator_in = 0;
			continue;
		}
		else if(is_indicator_delimiter_capital(translate, table, i))
		{
			indicator_in = 1;
			continue;
		}

		if(!pass_in)
		{
			/*   word starting   */
			if(!word_in)
			{
				if(words[i] & WORD_CHAR)
				{
					word_in = 1;
					word_whole = get_word_capital_whole(words, i, translate);
					if(word_whole >= 0)
					if(!(words[word_whole] & WORD_NONLETTER))
					{
						pass_in = 1;
						pass_begin = word_whole;
						pass_end = -1;
						word_cnt = 1;
						i = word_whole;
					}
				}
			}

			/*   word ending   */
			else
			{
				if(!(words[i] & WORD_CHAR))
					word_in = 0;
			}
		}
		else
		{
			/*   word starting   */
			if(!word_in)
			{
				if(words[i] & WORD_CHAR)
				{
					word_in = 1;
					word_whole = get_word_capital_whole(words, i, translate);
					if(word_whole >= 0)
					{
						if(!(words[word_whole] & WORD_NONLETTER))
							word_cnt++;
					}
					else
					{
						if(word_cnt >= passage_len)
						if(pass_end >= 0)
							convert_to_passage(indicators, words, pass_begin, pass_end);
						pass_in = 0;
					}
				}
			}

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

	/*   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 $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movl $0xffffffff, -0x34(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x28(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x3c(%rbp)
movl $0x0, -0x40(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x44(%rcx), %eax
jge 0x15609
cmpl $0x0, -0x40(%rbp)
jne 0x1542d
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x1542b
movl $0x1, -0x40(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x15418
cmpl $0x0, -0x28(%rbp)
je 0x153fd
movl -0x48(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl $0x0, -0x38(%rbp)
jl 0x15416
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x144e0
jmp 0x15418
movl $0x0, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
jmp 0x155fb
jmp 0x15455
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x48(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x1544e
movl $0x0, -0x40(%rbp)
jmp 0x15453
jmp 0x155fb
jmp 0x15455
cmpl $0x0, -0x3c(%rbp)
je 0x15485
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x48(%rbp), %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x15d50
cmpl $0x0, %eax
je 0x15480
movl $0x0, -0x3c(%rbp)
jmp 0x155fb
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x48(%rbp), %edx
callq 0x15e00
cmpl $0x0, %eax
je 0x154a6
movl $0x1, -0x3c(%rbp)
jmp 0x155fb
jmp 0x154a8
cmpl $0x0, -0x30(%rbp)
jne 0x15549
cmpl $0x0, -0x28(%rbp)
jne 0x15527
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15525
movl $0x1, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x48(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x15f20
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x15523
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x15521
movl $0x1, -0x30(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x2c(%rbp)
movl -0x44(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0x15523
jmp 0x15525
jmp 0x15544
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x15542
movl $0x0, -0x28(%rbp)
jmp 0x15544
jmp 0x155f9
cmpl $0x0, -0x28(%rbp)
jne 0x155d4
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x155d2
movl $0x1, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movl -0x48(%rbp), %esi
movq -0x18(%rbp), %rdx
callq 0x15f20
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
jl 0x155a6
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x8, %eax
cmpl $0x0, %eax
jne 0x155a4
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x155d0
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x155c9
cmpl $0x0, -0x38(%rbp)
jl 0x155c7
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x144e0
jmp 0x155c9
movl $0x0, -0x30(%rbp)
jmp 0x155d2
jmp 0x155f7
movq -0x10(%rbp), %rax
movslq -0x48(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x155f5
movl $0x0, -0x28(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0x155f7
jmp 0x155f9
jmp 0x155fb
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x153b4
cmpl $0x0, -0x30(%rbp)
je 0x15655
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jl 0x15653
cmpl $0x0, -0x38(%rbp)
jl 0x15651
cmpl $0x0, -0x28(%rbp)
je 0x1563c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %edx
movq -0x18(%rbp), %rax
movl 0x44(%rax), %ecx
callq 0x144e0
jmp 0x1564f
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x38(%rbp), %ecx
callq 0x144e0
jmp 0x15651
jmp 0x15653
jmp 0x15655
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)