// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/languages/generic-forward.c
// Function: add_indicators_node
static struct indicator_node* add_indicators_node(struct indicator_node *nodes, struct mode *mode, const unsigned int type, const int at)
{
	struct indicator_node *node, *node_crs;
	struct indicator *indicator, *indicator_crs;

	indicator = MALLOC(sizeof(struct indicator));
	indicator->prv =
	indicator->nxt = NULL;
	indicator->mode = mode;
	indicator->type = type;
	indicator->len = 0;

	node_crs = nodes;

	while(node_crs->nxt)
	{
		if(node_crs->nxt->at > at)
			break;
		node_crs = node_crs->nxt;
	}

	if(node_crs->at == at)
	{
		switch(type)
		{
		default:  ASSERT(0)

		case EMP_BEGIN:

			begin = indicator;
			begin_at = at;

			if(   node_crs->indicator->type != EMP_SYMBOL
			   && node_crs->indicator->type != EMP_WORD
			   && node_crs->indicator->type != (EMP_WORD | EMP_END)
			   && node_crs->indicator->type != EMP_END)
				goto insert_first;
			indicator_crs = node_crs->indicator;
			while(indicator_crs->nxt)
			{
				if(   indicator_crs->type != EMP_SYMBOL
				   && indicator_crs->type != EMP_WORD
				   && indicator_crs->type != (EMP_WORD | EMP_END)
				   && indicator_crs->type != EMP_END)
					break;
				indicator_crs = indicator_crs->nxt;
			}
			goto insert_after;

		case EMP_END:

			ASSERT(begin)
			indicator->len =
			begin->len = at - begin_at;

			if(   node_crs->indicator->type != EMP_SYMBOL
			   && node_crs->indicator->type != EMP_WORD
			   && node_crs->indicator->type != (EMP_WORD | EMP_END))
				goto insert_first;
			indicator_crs = node_crs->indicator;
			while(indicator_crs->nxt)
			{
				if(   indicator_crs->type != EMP_SYMBOL
				   && indicator_crs->type != EMP_WORD
				   && indicator_crs->type != (EMP_WORD | EMP_END))
					break;
				indicator_crs = indicator_crs->nxt;
			}
			goto insert_after;

		case EMP_WORD:

			word = indicator;
			word_at = at;

			if(   node_crs->indicator->type != EMP_SYMBOL
			   && node_crs->indicator->type != (EMP_WORD | EMP_END))
				goto insert_first;
			indicator_crs = node_crs->indicator;
			while(indicator_crs->nxt)
			{
				if(   indicator_crs->type != EMP_SYMBOL
				   && indicator_crs->type != (EMP_WORD | EMP_END))
					break;
				indicator_crs = indicator_crs->nxt;
			}
			goto insert_after;

		case EMP_WORD | EMP_END:

			ASSERT(word)
			indicator->len =
			word->len = at - word_at;

			if(node_crs->indicator->type != EMP_SYMBOL)
				goto insert_first;
			indicator_crs = node_crs->indicator;
			while(indicator_crs->nxt)
			{
				if(indicator_crs->nxt->type != EMP_SYMBOL)
					break;
				indicator_crs = indicator_crs->nxt;
			}

			insert_after:
			indicator->prv = indicator_crs;
			indicator->nxt = indicator_crs->nxt;
			if(indicator_crs->nxt)
				indicator_crs->nxt->prv = indicator;
			indicator_crs->nxt = indicator;
			break;

		case EMP_SYMBOL:

			insert_first:
			indicator->prv = NULL;
			indicator->nxt = node_crs->indicator;
			if(node_crs->indicator)
				node_crs->indicator->prv = indicator;
			node_crs->indicator = indicator;
			break;
		}
		return node_crs;
	}
	else
	{
		ASSERT(node_crs->at < at)
		node = MALLOC(sizeof(struct indicator_node));
		node->indicator = indicator;
		node->at = at;

		switch(type)
		{
		case EMP_BEGIN:

			begin = indicator;
			begin_at = at;
			break;

		case EMP_END:

			ASSERT(begin)
			indicator->len =
			begin->len = at - begin_at;
			break;

		case EMP_WORD:

			word = indicator;
			word_at = at;

		case EMP_WORD | EMP_END:

			ASSERT(word)
			indicator->len =
			word->len = at - word_at;
		}

		node->nxt = node_crs->nxt;
		node_crs->nxt = node;
		return node;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movl $0x20, %edi
callq 0x1160
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movl -0x1c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x38(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
je 0x145ec
movq -0x30(%rbp), %rax
movq (%rax), %rax
movl 0x10(%rax), %eax
cmpl -0x20(%rbp), %eax
jle 0x145df
jmp 0x145ec
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x145c4
movq -0x30(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x20(%rbp), %eax
jne 0x148e1
movl -0x1c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x48(%rbp)
subl $0x7, %eax
ja 0x14620
movq -0x48(%rbp), %rax
leaq 0xa859(%rip), %rcx      # 0x1ee70
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x1050
movq -0x38(%rbp), %rax
movq %rax, 0x11c38(%rip)     # 0x26268
movl -0x20(%rbp), %eax
movl %eax, 0x11c3b(%rip)     # 0x26274
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x8, 0x18(%rax)
je 0x14676
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x4, 0x18(%rax)
je 0x14676
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x6, 0x18(%rax)
je 0x14676
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x2, 0x18(%rax)
je 0x14676
jmp 0x14893
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x146c5
movq -0x40(%rbp), %rax
cmpl $0x8, 0x18(%rax)
je 0x146b7
movq -0x40(%rbp), %rax
cmpl $0x4, 0x18(%rax)
je 0x146b7
movq -0x40(%rbp), %rax
cmpl $0x6, 0x18(%rax)
je 0x146b7
movq -0x40(%rbp), %rax
cmpl $0x2, 0x18(%rax)
je 0x146b7
jmp 0x146c5
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x14682
jmp 0x1484e
cmpq $0x0, 0x11b96(%rip)     # 0x26268
jne 0x146d9
callq 0x1050
movl -0x20(%rbp), %ecx
subl 0x11b92(%rip), %ecx     # 0x26274
movq 0x11b7f(%rip), %rax     # 0x26268
movl %ecx, 0x1c(%rax)
movq -0x38(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x8, 0x18(%rax)
je 0x14722
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x4, 0x18(%rax)
je 0x14722
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x6, 0x18(%rax)
je 0x14722
jmp 0x14893
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x14767
movq -0x40(%rbp), %rax
cmpl $0x8, 0x18(%rax)
je 0x14759
movq -0x40(%rbp), %rax
cmpl $0x4, 0x18(%rax)
je 0x14759
movq -0x40(%rbp), %rax
cmpl $0x6, 0x18(%rax)
je 0x14759
jmp 0x14767
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x1472e
jmp 0x1484e
movq -0x38(%rbp), %rax
movq %rax, 0x11ae9(%rip)     # 0x26260
movl -0x20(%rbp), %eax
movl %eax, 0x11af0(%rip)     # 0x26270
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x8, 0x18(%rax)
je 0x147a1
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x6, 0x18(%rax)
je 0x147a1
jmp 0x14893
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x147dc
movq -0x40(%rbp), %rax
cmpl $0x8, 0x18(%rax)
je 0x147ce
movq -0x40(%rbp), %rax
cmpl $0x6, 0x18(%rax)
je 0x147ce
jmp 0x147dc
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x147ad
jmp 0x1484e
cmpq $0x0, 0x11a7a(%rip)     # 0x26260
jne 0x147ed
callq 0x1050
movl -0x20(%rbp), %ecx
subl 0x11a7a(%rip), %ecx     # 0x26270
movq 0x11a63(%rip), %rax     # 0x26260
movl %ecx, 0x1c(%rax)
movq -0x38(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x8, 0x18(%rax)
je 0x14817
jmp 0x14893
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1484c
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
cmpl $0x8, 0x18(%rax)
je 0x1483e
jmp 0x1484c
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x14823
jmp 0x1484e
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x14883
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x148d4
jmp 0x14893
movq -0x38(%rbp), %rax
movq $0x0, (%rax)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x148c8
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x149dd
movq -0x30(%rbp), %rax
movl 0x10(%rax), %eax
cmpl -0x20(%rbp), %eax
jl 0x148f2
callq 0x1050
movl $0x18, %edi
callq 0x1160
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x10(%rax)
movl -0x1c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x50(%rbp)
subl $0x5, %eax
ja 0x149bc
movq -0x50(%rbp), %rax
leaq 0xa523(%rip), %rcx      # 0x1ee58
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x38(%rbp), %rax
movq %rax, 0x1191f(%rip)     # 0x26268
movl -0x20(%rbp), %eax
movl %eax, 0x11922(%rip)     # 0x26274
jmp 0x149bc
cmpq $0x0, 0x1190c(%rip)     # 0x26268
jne 0x14963
callq 0x1050
movl -0x20(%rbp), %ecx
subl 0x11908(%rip), %ecx     # 0x26274
movq 0x118f5(%rip), %rax     # 0x26268
movl %ecx, 0x1c(%rax)
movq -0x38(%rbp), %rax
movl %ecx, 0x1c(%rax)
jmp 0x149bc
movq -0x38(%rbp), %rax
movq %rax, 0x118d6(%rip)     # 0x26260
movl -0x20(%rbp), %eax
movl %eax, 0x118dd(%rip)     # 0x26270
cmpq $0x0, 0x118c5(%rip)     # 0x26260
jne 0x149a2
callq 0x1050
movl -0x20(%rbp), %ecx
subl 0x118c5(%rip), %ecx     # 0x26270
movq 0x118ae(%rip), %rax     # 0x26260
movl %ecx, 0x1c(%rax)
movq -0x38(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)