// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/languages/generic-forward.c
// Function: add_indicators_emphases
static int add_indicators_emphases(struct translate *translate)
{
	const struct table *table;
	struct mode *mode;
	struct indicator_node node_auto;
	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;

	translate->input_crs =
	translate->output_len = 0;

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

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

	memset(&node_auto, 0, sizeof(struct indicator_node));
	node_auto.at = -1;

	mode = table->emphases;
	while(mode)
	{
		memset(indicators, 0, (translate->input_len + 1) * sizeof(unsigned int));
		memset(words, 0, (translate->input_len + 1) * sizeof(unsigned char));
		begin =
		word = NULL;
		begin_at =
		word_at = 0;

		mark_mode(indicators, words, translate, table, mode);
		if(mode->word_len)
		{
			indicators_to_words(indicators, words, translate);
			if(mode->passage_len)
				words_to_passages(indicators, words, translate, mode->passage_len);
		}

		if(!add_indicators_nodes(&node_auto, mode, indicators, translate->input_len + 1))
			goto return_fail_free;

		mode = mode->nxt;
	}

	if(node_auto.nxt)
	{
		CHANGE_MARK
		sort_indicators(node_auto.nxt);
		insert_indicator_nodes(translate, table, node_auto.nxt);
	}

	/*   always do this in case someone has emphasized just spaces   */
	if(!generic_remove_internal(translate))
		goto return_fail_free;

	indicator_node_free(node_auto.nxt);
	FREE(indicators);
	FREE(words);

#ifndef CHECK_FOR_CHANGE
	if(translate->output_len == 0)
	{
		utf16_copy(translate->output, translate->input, (translate->input_len + 1));
		translate->output_len = translate->input_len;

		if(translate->maps_use)
		{
			ASSERT(translate->output_max >= translate->input_len + 1)
			memcpy(translate->output_to_input_map, translate->input_map, (translate->input_len + 1) * sizeof(int));
		}
	}
#endif

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

	return 1;

	return_fail_free:
	indicator_node_free(node_auto.nxt);
	FREE(indicators);
	FREE(words);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %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 $0x0, 0x68(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x1160
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1208b
movl $0x7, %edi
leaq 0xc20c(%rip), %rsi      # 0x1e278
leaq 0xcea7(%rip), %rdx      # 0x1ef1a
movl $0x48b, %ecx            # imm = 0x48B
movb $0x0, %al
callq 0xf610
movl $0x0, -0x4(%rbp)
jmp 0x1229b
movq -0x10(%rbp), %rax
movl 0x44(%rax), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x1160
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x120e0
movl $0x7, %edi
leaq 0xc1c0(%rip), %rsi      # 0x1e278
leaq 0xce5b(%rip), %rdx      # 0x1ef1a
movl $0x492, %ecx            # imm = 0x492
movb $0x0, %al
callq 0xf610
movq -0x40(%rbp), %rdi
callq 0x1040
movl $0x0, -0x4(%rbp)
jmp 0x1229b
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1100
movl $0xffffffff, -0x28(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq 0x1d0(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x12200
movq -0x40(%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 -0x48(%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 $0x0, 0x1410c(%rip) # 0x26260
movq $0x0, 0x14109(%rip) # 0x26268
movl $0x0, 0x14107(%rip)     # 0x26270
movl $0x0, 0x14101(%rip)     # 0x26274
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
callq 0x130a0
movq -0x20(%rbp), %rax
cmpl $0x0, 0x5c(%rax)
je 0x121cb
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x13650
movq -0x20(%rbp), %rax
cmpl $0x0, 0x68(%rax)
je 0x121c9
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x20(%rbp), %rax
movl 0x68(%rax), %ecx
callq 0x139c0
jmp 0x121cb
movq -0x20(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
movl 0x44(%rax), %ecx
addl $0x1, %ecx
leaq -0x38(%rbp), %rdi
callq 0x13cb0
cmpl $0x0, %eax
jne 0x121f0
jmp 0x12279
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x12106
cmpq $0x0, -0x38(%rbp)
je 0x1222f
movq -0x10(%rbp), %rax
movl $0x1, 0x94(%rax)
movq -0x38(%rbp), %rdi
callq 0x13d20
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x13e70
movq -0x10(%rbp), %rdi
callq 0x10370
cmpl $0x0, %eax
jne 0x1223f
jmp 0x12279
movq -0x38(%rbp), %rdi
callq 0x13f90
movq -0x40(%rbp), %rdi
callq 0x1040
movq -0x48(%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 0x1229b
movq -0x38(%rbp), %rdi
callq 0x13f90
movq -0x40(%rbp), %rdi
callq 0x1040
movq -0x48(%rbp), %rdi
callq 0x1040
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)