// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/languages/generic-forward.c
// Function: add_indicators_capital
static int add_indicators_capital(struct translate *translate)
{
	const struct table *table;
	unsigned int *indicators;
	unsigned char *words;

	/*   only copy indicators from last table in tables   */
	table = translate->tables[translate->table_cnt - 1];
	translate->table_crs = translate->table_cnt - 1;

	indicators = MALLOC((translate->input_len + 1) * sizeof(unsigned int));
	if(!indicators)
	{
		LOG_ALLOCATE_FAIL
		return 0;
	}
	memset(indicators, 0, (translate->input_len + 1) * sizeof(unsigned int));

	words = MALLOC((translate->input_len + 1) * sizeof(unsigned char));
	if(!words)
	{
		LOG_ALLOCATE_FAIL
		FREE(indicators);
		return 0;
	}
	memset(words, 0, (translate->input_len + 1) * sizeof(unsigned char));

	mark_capitals(indicators, words, translate, table);
	if(table->capital.word_len)
	{
		indicators_to_words(indicators, words, translate);
		mark_nonalphabetic_words(indicators, words, translate);
		mark_capital_whole_words(indicators, words, translate);
		if(table->capital.begin_len && table->capital.passage_len)
		{
			capital_words_to_passages(indicators, words, translate, table, table->capital.passage_len);
			reset_words_in_passages(indicators, words, translate, table);
		}
	}

	if(!insert_indicators_capital(translate, table, indicators))
		goto return_fail_free;

	FREE(indicators);
	FREE(words);

#ifdef DEBUG
	translate->output[translate->output_len] = 0;
#endif

	return 1;

	return_fail_free:
	FREE(indicators);
	FREE(words);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0xc(%rcx), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
subl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1160
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x123b5
movl $0x7, %edi
leaq 0xbee2(%rip), %rsi      # 0x1e278
leaq 0xcb7d(%rip), %rdx      # 0x1ef1a
movl $0x742, %ecx            # imm = 0x742
movb $0x0, %al
callq 0xf610
movl $0x0, -0x4(%rbp)
jmp 0x1254e
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1100
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x1160
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x12426
movl $0x7, %edi
leaq 0xbe7a(%rip), %rsi      # 0x1e278
leaq 0xcb15(%rip), %rdx      # 0x1ef1a
movl $0x74a, %ecx            # imm = 0x74A
movb $0x0, %al
callq 0xf610
movq -0x20(%rbp), %rdi
callq 0x1040
movl $0x0, -0x4(%rbp)
jmp 0x1254e
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdx
shlq $0x0, %rdx
xorl %esi, %esi
callq 0x1100
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x14f10
movq -0x18(%rbp), %rax
cmpl $0x0, 0x12c(%rax)
je 0x124ec
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x13650
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x15130
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x15220
movq -0x18(%rbp), %rax
cmpl $0x0, 0x124(%rax)
je 0x124ea
movq -0x18(%rbp), %rax
cmpl $0x0, 0x138(%rax)
je 0x124ea
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movl 0x138(%rax), %r8d
callq 0x15360
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x15660
jmp 0x124ec
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x15b20
cmpl $0x0, %eax
jne 0x12504
jmp 0x12535
movq -0x20(%rbp), %rdi
callq 0x1040
movq -0x28(%rbp), %rdi
callq 0x1040
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x68(%rcx), %rcx
movw $0x0, (%rax,%rcx,2)
movl $0x1, -0x4(%rbp)
jmp 0x1254e
movq -0x20(%rbp), %rdi
callq 0x1040
movq -0x28(%rbp), %rdi
callq 0x1040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)