// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/outputs/pattern-output.c
// Function: pattern_print_expression
void pattern_print_expression(FILE *output, const unichar *expr_data, int expr_crs)
{
	int i;

	if(expr_crs == PTN_END)
		return;

	ASSERT(expr_crs > 1)
	ASSERT(expr_crs < expr_data[0])

	while(EXPR_TYPE(expr_crs) != PTN_END)
	{
		switch(EXPR_TYPE(expr_crs))
		{
		case PTN_START:  break;

		case PTN_GROUP:

			fputs("(", output);
			pattern_print_expression(output, expr_data, EXPR_DATA_0(expr_crs));
			fputs(")", output);
			break;

		case PTN_NOT:

			fputs("!", output);
			pattern_print_expression(output, expr_data, EXPR_DATA_0(expr_crs));
			break;

		case PTN_ONE_MORE:

			pattern_print_expression(output, expr_data, EXPR_DATA_0(expr_crs));
			fputs("+", output);
			break;

		case PTN_ZERO_MORE:

			pattern_print_expression(output, expr_data, EXPR_DATA_0(expr_crs));
			fputs("*", output);
			break;

		case PTN_OPTIONAL:

			pattern_print_expression(output, expr_data, EXPR_DATA_0(expr_crs));
			fputs("?", output);
			break;

		case PTN_ALTERNATE:

			pattern_print_expression(output, expr_data, EXPR_DATA_0(expr_crs));
			fputs("|", output);
			pattern_print_expression(output, expr_data, EXPR_DATA_1(expr_crs));
			break;

		case PTN_ANY:

			fputs(".", output);
			break;

		case PTN_ATTRIBUTES:

			fputs("%", output);
			attrs_output_brackets(EXPR_DATA_0(expr_crs), EXPR_DATA_1(expr_crs));
			break;

		case PTN_CHARS:

			if(EXPR_DATA_0(expr_crs) == 1)
				utf16_output_char_escape(stdout, EXPR_DATA_1(expr_crs));
			else
			{
				fputs("[", output);
				for(i = 0; i < EXPR_DATA_0(expr_crs); i++)
					utf16_output_char_escape(output, EXPR_CONST_DATA(expr_crs)[i + 1]);
				fputs("]", output);
			}
			break;

		case PTN_SUBPATTERN:

			fputs("@{", output);
			for(i = 0; i < EXPR_DATA_0(expr_crs); i++)
				fprintf(output, "%c", EXPR_CONST_DATA(expr_crs)[i + 1]);
			fputs("}", output);
			break;

		case PTN_END_OF_INPUT:

			fputs("^", output);
			break;

		default:  fprintf(output, "0x%x?", EXPR_TYPE(expr_crs));  return;
		}

		expr_crs = EXPR_NXT(expr_crs);
	}

	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0xffff, -0x14(%rbp)    # imm = 0xFFFF
jne 0x1ad61
jmp 0x1b107
cmpl $0x1, -0x14(%rbp)
jg 0x1ad6c
callq 0x1050
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movzwl (%rcx), %ecx
cmpl %ecx, %eax
jl 0x1ad7f
callq 0x1050
jmp 0x1ad81
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x1b105
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0xb, %eax
ja 0x1b0c7
movq -0x20(%rbp), %rax
leaq 0x423f(%rip), %rcx      # 0x1f004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x1b0ec
movq -0x8(%rbp), %rsi
leaq 0x4273(%rip), %rdi      # 0x1f051
callq 0x10f0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
callq 0x1ad40
movq -0x8(%rbp), %rsi
leaq 0x4247(%rip), %rdi      # 0x1f053
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rsi
leaq 0x4234(%rip), %rdi      # 0x1f055
callq 0x10f0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
callq 0x1ad40
jmp 0x1b0ec
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
callq 0x1ad40
movq -0x8(%rbp), %rsi
leaq 0x41e5(%rip), %rdi      # 0x1f057
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
callq 0x1ad40
movq -0x8(%rbp), %rsi
leaq 0x41b4(%rip), %rdi      # 0x1f059
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
callq 0x1ad40
movq -0x8(%rbp), %rsi
leaq 0x4196(%rip), %rdi      # 0x1f06e
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
callq 0x1ad40
movq -0x8(%rbp), %rsi
leaq 0x4150(%rip), %rdi      # 0x1f05b
callq 0x10f0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
callq 0x1ad40
jmp 0x1b0ec
movq -0x8(%rbp), %rsi
leaq 0x411f(%rip), %rdi      # 0x1f05d
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rsi
leaq 0x410c(%rip), %rdi      # 0x1f05f
callq 0x10f0
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl %dx, %edi
movzwl (%rax,%rcx,2), %esi
callq 0x1b110
jmp 0x1b0ec
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x1, %eax
jne 0x1afbf
movq 0x9034(%rip), %rax      # 0x23fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x1a360
jmp 0x1b032
movq -0x8(%rbp), %rsi
leaq 0x4097(%rip), %rdi      # 0x1f061
callq 0x10f0
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jge 0x1b022
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %esi
callq 0x1a360
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1afd6
movq -0x8(%rbp), %rsi
leaq 0x438d(%rip), %rdi      # 0x1f3ba
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rsi
leaq 0x4021(%rip), %rdi      # 0x1f063
callq 0x10f0
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x14(%rbp), %edx
addl $0x3, %edx
movslq %edx, %rdx
movzwl (%rcx,%rdx,2), %ecx
cmpl %ecx, %eax
jge 0x1b0a3
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
shlq %rcx
addq %rcx, %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
leaq 0x3d84(%rip), %rsi      # 0x1ee15
movb $0x0, %al
callq 0x1130
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1b04e
movq -0x8(%rbp), %rsi
leaq 0x3fb8(%rip), %rdi      # 0x1f066
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rsi
leaq 0x3fa8(%rip), %rdi      # 0x1f068
callq 0x10f0
jmp 0x1b0ec
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x0, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %edx
leaq 0x3f87(%rip), %rsi      # 0x1f06a
movb $0x0, %al
callq 0x1130
jmp 0x1b107
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
movl %eax, -0x14(%rbp)
jmp 0x1ad81
jmp 0x1b107
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)