// File: /workspace/github_c_makefile_star2_O1/MikeGray-APH[P]LibLouisAPH/source/languages/generic-common.c
// Function: generic_process
int generic_process(struct translate *translate, const enum table_hash_type hash_type, const enum rule_direction direction)
{
	const struct table *table;
	const struct rule *rule;
	enum mode_type nocontract_state;

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

	/*   reset tracked cursor   */
	translate->cursor_set = 0;

	nocontract_state = NONE;

	translate->input_crs =
	translate->output_len = 0;
	while(translate->input_crs < translate->input_len)
	{
		/*   just copy when notrans is set   */
		if(translate->input_mask[translate->input_crs] & MASK_NO_TRANSLATION)
		{
			if(!translate_copy_to_output(translate, 1, 1))
				return 0;
			continue;
		}

		/*   nocontract word stops on space   */
		if(nocontract_state == WORD)
		if(table_get_character_attributes(table, translate->input[translate->input_crs]) & CHAR_SPACE)
			nocontract_state = NONE;

		/*   nocontract   */
		switch(translate_get_mode_indicator(translate, table, &table->nocontract))
		{
		case FAIL:   return 0;
		case NONE:                              break;
		case BEGIN:  nocontract_state = BEGIN;  break;
		case WORD:   nocontract_state = WORD;   break;
		case END:
		case TERM:   nocontract_state = NONE;   break;

		case SYMBOL:

			/*   it is possible for symbol to be inside WORD or PASSAGE   */
			if(nocontract_state == NONE)
				nocontract_state = SYMBOL;
			break;
		}

		if(translate_copy_marked_indicators(translate) > 0)
			continue;

		/*   find rule   */
		rule = generic_match_rule(translate, hash_type, direction, nocontract_state == NONE);
		if(!rule)
		{
			if(!translate_copy_to_output(translate, 1, 1))
				return 0;
		}
		else
		{
			CHANGE_MARK
			if(!generic_apply_rule(translate, rule, direction))
				return 0;
		}

		/*   reset nocontract symbol   */
		if(nocontract_state == SYMBOL)
			nocontract_state = NONE;
	}

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

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebp
movl %esi, 0x14(%rsp)
movq %rdi, %rbx
movq (%rdi), %rax
movslq 0xc(%rdi), %rcx
movq -0x8(%rax,%rcx,8), %r15
xorl %eax, %eax
movl %eax, 0x8c(%rdi)
movl %eax, 0x68(%rdi)
movl %eax, 0x40(%rdi)
leaq 0x50(%r15), %r12
leaq 0x8e29(%rip), %r13      # 0x13b78
movl $0x1, %r14d
movslq 0x40(%rbx), %rax
cmpl 0x44(%rbx), %eax
jge 0xb361
movq 0x58(%rbx), %rcx
testb $0x1, (%rcx,%rax)
je 0xad87
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x7666
testl %eax, %eax
jne 0xad55
jmp 0xb376
cmpl $0x4, %r14d
jne 0xadba
movq 0x38(%rbx), %rcx
movzwl (%rcx,%rax,2), %esi
movq %r15, %rdi
callq 0x1e99
testq %rax, %rax
je 0xadb4
xorl %ecx, %ecx
testb $0x1, 0x24(%rax)
sete %cl
leal (%rcx,%rcx,2), %r14d
incl %r14d
jmp 0xadba
movl $0x4, %r14d
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7151
cmpl $0x6, %eax
ja 0xadf3
movl %eax, %ecx
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
movl $0x1, %r14d
jmp 0xadf3
movl %eax, %r14d
jmp 0xadf3
cmpl $0x1, %r14d
movl $0x6, %eax
cmovel %eax, %r14d
movq %rbx, %rdi
callq 0x78c4
testl %eax, %eax
jg 0xad55
movl $0x0, 0x8(%rbx)
cmpl $0x0, 0xc(%rbx)
jle 0xafc5
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
xorl %eax, %eax
movslq 0x40(%rbx), %rcx
movq %rcx, %r12
addq %rcx, %r12
addq 0x38(%rbx), %r12
movl 0x44(%rbx), %r15d
subl %ecx, %r15d
movq (%rbx), %rcx
cltq
movq (%rcx,%rax,8), %rdi
movl 0x14(%rsp), %esi
movl %ebp, %edx
movq %r12, %rcx
movl %r15d, %r8d
xorl %r9d, %r9d
callq 0x2a1a
testq %rax, %rax
je 0xafa6
movq %rax, %r13
cmpl $0x1, %r14d
je 0xae6e
testb $0x1, (%r13)
jne 0xaf7b
cmpl $-0x1, %ebp
je 0xaeea
cmpl $0x1, %ebp
jne 0xb387
movq 0x80(%r13), %rax
testq %rax, %rax
je 0xafba
movq 0x8(%rax), %r9
testq %r9, %r9
je 0xaecd
movq (%rbx), %rax
movq 0x38(%rbx), %rsi
movl 0x40(%rbx), %edx
decl %edx
movslq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq %rbx, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
pushq 0x28(%rax)
pushq $0x0
callq 0x8692
addq $0x10, %rsp
testl %eax, %eax
je 0xaf7b
movq 0x80(%r13), %rax
movq 0x10(%rax), %r9
testq %r9, %r9
je 0xafba
movq (%rbx), %rax
movl 0x74(%r13), %edx
jmp 0xaf4e
movq 0x88(%r13), %rax
testq %rax, %rax
je 0xafba
movq 0x8(%rax), %r9
testq %r9, %r9
je 0xaf37
movq (%rbx), %rax
movq 0x38(%rbx), %rsi
movl 0x40(%rbx), %edx
decl %edx
movslq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movq %rbx, %rdi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
pushq 0x28(%rax)
pushq $0x0
callq 0x8692
addq $0x10, %rsp
testl %eax, %eax
je 0xaf7b
movq 0x88(%r13), %rax
movq 0x10(%rax), %r9
testq %r9, %r9
je 0xafba
movq (%rbx), %rax
movl 0x78(%r13), %edx
addl 0x40(%rbx), %edx
movq 0x38(%rbx), %rsi
movl 0x44(%rbx), %ecx
movslq 0x8(%rbx), %rdi
movq (%rax,%rdi,8), %rax
movq %rbx, %rdi
movl $0x1, %r8d
pushq 0x28(%rax)
pushq $0x0
callq 0x8692
addq $0x10, %rsp
testl %eax, %eax
jne 0xafba
movq (%rbx), %rax
movslq 0x8(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
movl 0x14(%rsp), %esi
movl %ebp, %edx
movq %r12, %rcx
movl %r15d, %r8d
movq %r13, %r9
callq 0x2a1a
movq %rax, %r13
testq %rax, %rax
jne 0xae5d
movl 0x8(%rbx), %eax
incl %eax
movl %eax, 0x8(%rbx)
cmpl 0xc(%rbx), %eax
jl 0xae1f
xorl %r13d, %r13d
movq 0x8(%rsp), %r15
movq (%rsp), %r12
jmp 0xafc8
xorl %r13d, %r13d
testq %r13, %r13
je 0xb164
movl $0x1, 0x94(%rbx)
cmpl $-0x1, %ebp
je 0xb18f
cmpl $0x1, %ebp
jne 0xb387
movl 0x78(%r13), %esi
movq %rbx, %rdi
callq 0x72d8
testl %eax, %eax
je 0xb376
cmpl $0x0, 0x78(%r13)
jle 0xb047
movq 0x60(%rbx), %rax
xorl %ecx, %ecx
movzwl 0x46(%r13,%rcx,2), %esi
movslq 0x68(%rbx), %rdx
addq %rcx, %rdx
movw %si, (%rax,%rdx,2)
cmpl $0x0, 0x90(%rbx)
je 0xb03b
movslq 0x40(%rbx), %rsi
movq 0x50(%rbx), %rdi
movq 0x78(%rbx), %r8
movl (%rdi,%rsi,4), %esi
movl %esi, (%r8,%rdx,4)
incq %rcx
movslq 0x78(%r13), %rdx
cmpq %rdx, %rcx
jl 0xb00e
cmpl $0x0, 0x90(%rbx)
je 0xb157
cmpl $0x0, 0x74(%r13)
jle 0xb157
xorl %eax, %eax
cmpl $0x0, 0x78(%r13)
jle 0xb0e0
movslq 0x40(%rbx), %rsi
movslq %eax, %rcx
addq %rsi, %rcx
cmpl 0x44(%rbx), %ecx
jge 0xb387
movq 0x50(%rbx), %rdi
movslq (%rdi,%rcx,4), %rcx
testq %rcx, %rcx
js 0xb14b
movl 0x68(%rbx), %edx
testl %esi, %esi
je 0xb0a2
movl -0x4(%rdi,%rsi,4), %r8d
cmpl (%rdi,%rsi,4), %r8d
je 0xb14b
movq 0x48(%rbx), %rsi
cmpl $0x0, (%rsi,%rcx,4)
js 0xb14b
leal 0x1(%rcx), %edi
cmpl 0x20(%rbx), %edi
jge 0xb0db
movl %edi, %r8d
leaq (%rsi,%r8,4), %r8
movl (%r8), %r9d
testl %r9d, %r9d
js 0xb0db
cmpl (%rsi,%rcx,4), %r9d
jne 0xb0db
movl %edx, (%r8)
incl %edi
addq $0x4, %r8
cmpl %edi, 0x20(%rbx)
jg 0xb0bf
movl %edx, (%rsi,%rcx,4)
jmp 0xb14b
movslq 0x40(%rbx), %rdx
movslq %eax, %rcx
addq %rdx, %rcx
cmpl 0x44(%rbx), %ecx
jge 0xb387
movq 0x50(%rbx), %rsi
movslq (%rsi,%rcx,4), %rcx
testq %rcx, %rcx
js 0xb14b
testl %edx, %edx
je 0xb10d
movl -0x4(%rsi,%rdx,4), %edi
cmpl (%rsi,%rdx,4), %edi
je 0xb14b
movq 0x48(%rbx), %rdx
cmpl $0x0, (%rdx,%rcx,4)
js 0xb14b
leal 0x1(%rcx), %esi
cmpl 0x20(%rbx), %esi
jge 0xb144
movl %esi, %edi
leaq (%rdx,%rdi,4), %rdi
movl (%rdi), %r8d
testl %r8d, %r8d
js 0xb144
cmpl (%rdx,%rcx,4), %r8d
jne 0xb144
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
incl %esi
addq $0x4, %rdi
cmpl %esi, 0x20(%rbx)
jg 0xb125
movl $0xffffffff, (%rdx,%rcx,4) # imm = 0xFFFFFFFF
incl %eax
cmpl 0x74(%r13), %eax
jl 0xb061
movl 0x74(%r13), %ecx
movl 0x78(%r13), %eax
jmp 0xb301
movq %rbx, %rdi
movl $0x1, %esi
movl $0x1, %edx
callq 0x7666
testl %eax, %eax
movl $0x1, %edi
leaq 0x89f4(%rip), %r13      # 0x13b78
jne 0xb354
jmp 0xb376
movl 0x74(%r13), %esi
movq %rbx, %rdi
callq 0x72d8
testl %eax, %eax
je 0xb376
cmpl $0x0, 0x74(%r13)
jle 0xb1e9
movq 0x60(%rbx), %rax
xorl %ecx, %ecx
movzwl 0x18(%r13,%rcx,2), %esi
movslq 0x68(%rbx), %rdx
addq %rcx, %rdx
movw %si, (%rax,%rdx,2)
cmpl $0x0, 0x90(%rbx)
je 0xb1dd
movslq 0x40(%rbx), %rsi
movq 0x50(%rbx), %rdi
movq 0x78(%rbx), %r8
movl (%rdi,%rsi,4), %esi
movl %esi, (%r8,%rdx,4)
incq %rcx
movslq 0x74(%r13), %rdx
cmpq %rdx, %rcx
jl 0xb1b0
cmpl $0x0, 0x90(%rbx)
je 0xb2f9
cmpl $0x0, 0x78(%r13)
jle 0xb2f9
xorl %eax, %eax
cmpl $0x0, 0x74(%r13)
jle 0xb282
movslq 0x40(%rbx), %rsi
movslq %eax, %rcx
addq %rsi, %rcx
cmpl 0x44(%rbx), %ecx
jge 0xb387
movq 0x50(%rbx), %rdi
movslq (%rdi,%rcx,4), %rcx
testq %rcx, %rcx
js 0xb2ed
movl 0x68(%rbx), %edx
testl %esi, %esi
je 0xb244
movl -0x4(%rdi,%rsi,4), %r8d
cmpl (%rdi,%rsi,4), %r8d
je 0xb2ed
movq 0x48(%rbx), %rsi
cmpl $0x0, (%rsi,%rcx,4)
js 0xb2ed
leal 0x1(%rcx), %edi
cmpl 0x20(%rbx), %edi
jge 0xb27d
movl %edi, %r8d
leaq (%rsi,%r8,4), %r8
movl (%r8), %r9d
testl %r9d, %r9d
js 0xb27d
cmpl (%rsi,%rcx,4), %r9d
jne 0xb27d
movl %edx, (%r8)
incl %edi
addq $0x4, %r8
cmpl %edi, 0x20(%rbx)
jg 0xb261
movl %edx, (%rsi,%rcx,4)
jmp 0xb2ed
movslq 0x40(%rbx), %rdx
movslq %eax, %rcx
addq %rdx, %rcx
cmpl 0x44(%rbx), %ecx
jge 0xb387
movq 0x50(%rbx), %rsi
movslq (%rsi,%rcx,4), %rcx
testq %rcx, %rcx
js 0xb2ed
testl %edx, %edx
je 0xb2af
movl -0x4(%rsi,%rdx,4), %edi
cmpl (%rsi,%rdx,4), %edi
je 0xb2ed
movq 0x48(%rbx), %rdx
cmpl $0x0, (%rdx,%rcx,4)
js 0xb2ed
leal 0x1(%rcx), %esi
cmpl 0x20(%rbx), %esi
jge 0xb2e6
movl %esi, %edi
leaq (%rdx,%rdi,4), %rdi
movl (%rdi), %r8d
testl %r8d, %r8d
js 0xb2e6
cmpl (%rdx,%rcx,4), %r8d
jne 0xb2e6
movl $0xffffffff, (%rdi)     # imm = 0xFFFFFFFF
incl %esi
addq $0x4, %rdi
cmpl %esi, 0x20(%rbx)
jg 0xb2c7
movl $0xffffffff, (%rdx,%rcx,4) # imm = 0xFFFFFFFF
incl %eax
cmpl 0x78(%r13), %eax
jl 0xb203
movl 0x74(%r13), %eax
movl 0x78(%r13), %ecx
testl %ecx, %ecx
je 0xb342
cmpl $0x0, 0x8c(%rbx)
movl $0x1, %edi
leaq 0x8860(%rip), %r13      # 0x13b78
jne 0xb34e
movl 0x40(%rbx), %edx
movl 0x88(%rbx), %esi
cmpl %edx, %esi
jl 0xb34e
addl %ecx, %edx
cmpl %edx, %esi
jge 0xb34e
movl $0x1, 0x8c(%rbx)
movl 0x68(%rbx), %edx
movl %edx, 0x88(%rbx)
jmp 0xb34e
movl $0x1, %edi
leaq 0x882a(%rip), %r13      # 0x13b78
addl %ecx, 0x40(%rbx)
addl %eax, 0x68(%rbx)
cmpl $0x6, %r14d
cmovel %edi, %r14d
jmp 0xad55
movq 0x60(%rbx), %rax
movslq 0x68(%rbx), %rcx
movw $0x0, (%rax,%rcx,2)
movl $0x1, %eax
jmp 0xb378
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1060