// File: /workspace/github_c_makefile_star2_O0/spacifici[P]st/src/hb.c
// Function: hbtransform
void
hbtransform(XftGlyphFontSpec *specs, const Glyph *glyphs, size_t len, int x, int y)
{
	int start = 0, length = 1, gstart = 0;
	hb_codepoint_t *codepoints = calloc(len, sizeof(hb_codepoint_t));

	for (int idx = 1, specidx = 1; idx < len; idx++) {
		if (glyphs[idx].mode & ATTR_WDUMMY) {
			length += 1;
			continue;
		}

		if (specs[specidx].font != specs[start].font || ATTRCMP(glyphs[gstart], glyphs[idx]) || selected(x + idx, y) != selected(x + gstart, y)) {
			hbtransformsegment(specs[start].font, glyphs, codepoints, gstart, length);

			/* Reset the sequence. */
			length = 1;
			start = specidx;
			gstart = idx;
		} else {
			length += 1;
		}

		specidx++;
	}

	/* EOL. */
	hbtransformsegment(specs[start].font, glyphs, codepoints, gstart, length);

	/* Apply the transformation to glyph specs. */
	for (int i = 0, specidx = 0; i < len; i++) {
		if (glyphs[i].mode & ATTR_WDUMMY)
			continue;

		if (codepoints[i] != specs[specidx].glyph)
			((Glyph *)glyphs)[i].mode |= ATTR_LIGA;

		specs[specidx++].glyph = codepoints[i];
	}

	free(codepoints);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x1, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x18(%rbp), %rdi
movl $0x4, %esi
callq 0x67f0
movq %rax, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
movl $0x1, -0x40(%rbp)
movslq -0x3c(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x12812
movq -0x10(%rbp), %rax
movslq -0x3c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x126d9
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x12804
movq -0x8(%rbp), %rax
movslq -0x40(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movslq -0x24(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpq (%rcx), %rax
jne 0x127b7
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
andl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movq -0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movzwl 0x4(%rcx), %ecx
andl $0xfffffeff, %ecx       # imm = 0xFFFFFEFF
andl $0xfffff7ff, %ecx       # imm = 0xFFFFF7FF
cmpl %ecx, %eax
jne 0x127b7
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jne 0x127b7
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0xc(%rcx), %eax
jne 0x127b7
movl -0x1c(%rbp), %edi
addl -0x3c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0x72f0
movl %eax, -0x4c(%rbp)
movl -0x1c(%rbp), %edi
addl -0x2c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0x72f0
movl %eax, %ecx
movl -0x4c(%rbp), %eax
cmpl %ecx, %eax
je 0x127f2
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0x12900
movl $0x1, -0x28(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x127fb
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x126a0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movl -0x28(%rbp), %r8d
callq 0x12900
movl $0x0, -0x44(%rbp)
movl $0x0, -0x48(%rbp)
movslq -0x44(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x128e4
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0x12873
jmp 0x128d6
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
movslq -0x48(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
je 0x128af
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movw %cx, 0x4(%rax)
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movq -0x8(%rbp), %rax
movl -0x48(%rbp), %edx
movl %edx, %esi
addl $0x1, %esi
movl %esi, -0x48(%rbp)
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x12846
movq -0x38(%rbp), %rdi
callq 0x6360
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)