// File: /workspace/github_c_makefile_star2_O0/MikeGray-APH[P]LibLouisAPH/source/compile.c
// Function: convert_with_dots
static int convert_with_dots(unichar *uchars, const int uchars_len)
{
	int esc, crs, off, cells_len, cells_end, i;

	if(uchars_len == 1 && uchars[0] == u';')
		return 1;

	esc =
	crs =
	off = 0;
	while(off < uchars_len)
	{
		if(uchars[off] == u'\\')
		{
			/*   deal with escaped back slash   */
			if(esc)
				uchars[crs++] = uchars[off++];
			else if(uchars[off + 1] == u';')
			{
				off++;

				/*   find next ;   */
				for(cells_end = off + 1; cells_end < uchars_len; cells_end++)
				if(uchars[cells_end] == u';')
					break;
				if(cells_end >= uchars_len)
					return 0;

				/*   ;;, no digits   */
				if(cells_end == off + 1)
					off = cells_end + 1;
				else
				{
					cells_len = convert_to_dots(&uchars[off + 1], cells_end - off - 1);
					if(cells_len == -1)
						return -1;

					for(i = 0; i < cells_len; i++)
						uchars[crs + i] = uchars[off + i + 1];

					off = cells_end + 1;
					crs += cells_len;
				}
			}
			else
			{
				uchars[crs++] = uchars[off++];
				esc = 1;
				continue;
			}
		}
		else
			uchars[crs++] = uchars[off++];
		esc = 0;
	}

	uchars[crs] = 0;
	return crs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jne 0xa15d
movq -0x10(%rbp), %rax
movzwl (%rax), %eax
cmpl $0x3b, %eax
jne 0xa15d
movl $0x1, -0x4(%rbp)
jmp 0xa35d
movl $0x0, -0x20(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xa349
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x5c, %eax
jne 0xa311
cmpl $0x0, -0x18(%rbp)
je 0xa1ca
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
jmp 0xa30f
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x3b, %eax
jne 0xa2d5
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xa21e
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x3b, %eax
jne 0xa211
jmp 0xa21e
jmp 0xa213
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0xa1f6
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0xa232
movl $0x0, -0x4(%rbp)
jmp 0xa35d
movl -0x28(%rbp), %eax
movl -0x20(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0xa24d
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xa2d3
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %eax
addl $0x1, %eax
cltq
shlq %rax
addq %rax, %rdi
movl -0x28(%rbp), %esi
subl -0x20(%rbp), %esi
subl $0x1, %esi
callq 0x9ef0
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
jne 0xa282
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa35d
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0xa2c1
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
addl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
addl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xa289
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0xa30d
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl $0x1, -0x18(%rbp)
jmp 0xa172
jmp 0xa30f
jmp 0xa33d
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x20(%rbp)
movslq %ecx, %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl $0x0, -0x18(%rbp)
jmp 0xa172
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movw $0x0, (%rax,%rcx,2)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)