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

	cell = 0;
	crs = 0;
	for(off = 0; off < uchars_len; off++)
	{
		if(uchars[off] >= 0x2800 && uchars[off] <= 0x28ff)
		{
			if(cell)
			{
				uchars[crs++] = cell | 0x2800;
				cell = 0;
			}
			uchars[crs++] = uchars[off];
		}
		else if(uchars[off] == u'0')
			cell = 0x2800;
		else if(uchars[off] >= u'1' && uchars[off] <= u'8')
			cell |= (unichar)BIT(uchars[off] - u'1');
		else if(uchars[off] == u'-')
		{
			if(cell)
			{
				uchars[crs++] = cell | 0x2800;
				cell = 0;
			}
		}
		else
			return -1;
	}

	if(cell)
	{
		uchars[crs++] = cell | 0x2800;
		cell = 0;
	}

	return crs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movw $0x0, -0x16(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0xa060
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x2800, %eax           # imm = 0x2800
jl 0x9f97
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x28ff, %eax           # imm = 0x28FF
jg 0x9f97
cmpw $0x0, -0x16(%rbp)
je 0x9f70
movzwl -0x16(%rbp), %eax
orl $0x2800, %eax           # imm = 0x2800
movw %ax, %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)
movw $0x0, -0x16(%rbp)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %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 0xa050
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x30, %eax
jne 0x9fb3
movw $0x2800, -0x16(%rbp)    # imm = 0x2800
jmp 0xa04e
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x31, %eax
jl 0x9fff
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x38, %eax
jg 0x9fff
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
subl $0x31, %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movzwl %ax, %ecx
movzwl -0x16(%rbp), %eax
orl %ecx, %eax
movw %ax, -0x16(%rbp)
jmp 0xa04c
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
cmpl $0x2d, %eax
jne 0xa041
cmpw $0x0, -0x16(%rbp)
je 0xa03f
movzwl -0x16(%rbp), %eax
orl $0x2800, %eax           # imm = 0x2800
movw %ax, %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)
movw $0x0, -0x16(%rbp)
jmp 0xa04a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xa095
jmp 0xa04c
jmp 0xa04e
jmp 0xa050
jmp 0xa052
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9f0f
cmpw $0x0, -0x16(%rbp)
je 0xa08f
movzwl -0x16(%rbp), %eax
orl $0x2800, %eax           # imm = 0x2800
movw %ax, %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)
movw $0x0, -0x16(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw (%rax,%rax)