// File: /workspace/github_c_makefile_star2_O0/aligrudi[P]neatmkfn/otf.c
// Function: otf_gsubtype6
static void otf_gsubtype6(struct otf *otf, void *sub, char *feat, void *gsub)
{
	struct gctx ctx = {{0}};
	void *lookups = gsub + U16(gsub, 8);
	int fmt = U16(sub, 0);
	int *cov;
	int i, j, nsub, ncov;
	int off = 2;
	if (fmt != 3) {
		otf_unsupported("GSUB", 6, fmt);
		return;
	}
	ctx.bn = U16(sub, off);
	for (i = 0; i < ctx.bn; i++) {
		cov = coverage(sub + U16(sub, off + 2 + 2 * i), &ncov);
		ctx.bgrp[i] = ggrp_coverage(cov, ncov);
		free(cov);
	}
	off += 2 + 2 * ctx.bn;
	ctx.in = U16(sub, off);
	for (i = 0; i < ctx.in; i++) {
		cov = coverage(sub + U16(sub, off + 2 + 2 * i), &ncov);
		ctx.igrp[i] = ggrp_coverage(cov, ncov);
		free(cov);
	}
	off += 2 + 2 * ctx.in;
	ctx.ln = U16(sub, off);
	for (i = 0; i < ctx.ln; i ++) {
		cov = coverage(sub + U16(sub, off + 2 + 2 * i), &ncov);
		ctx.lgrp[i] = ggrp_coverage(cov, ncov);
		free(cov);
	}
	off += 2 + 2 * ctx.ln;
	nsub = U16(sub, off);	/* nsub > 1 is not supported */
	for (i = 0; i < nsub && i < 1; i++) {
		int lidx = U16(sub, off + 2 + 4 * i + 2);
		void *lookup = lookups + U16(lookups, 2 + 2 * lidx);
		int ltype = U16(lookup, 0);
		int ntabs = U16(lookup, 4);
		ctx.seqidx = U16(sub, off + 2 + 4 * i);
		for (j = 0; j < ntabs; j++) {
			void *tab = lookup + U16(lookup, 6 + 2 * j);
			int type = ltype;
			if (type == 7) {	/* extension substitution */
				type = U16(tab, 2);
				tab = tab + U32(tab, 4);
			}
			if (type == 1)
				otf_gsubtype1(otf, tab, feat, &ctx);
			if (type == 3)
				otf_gsubtype3(otf, tab, feat, &ctx);
			if (type == 4)
				otf_gsubtype4(otf, tab, feat, &ctx);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x180, %rsp            # imm = 0x180
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
leaq -0xf0(%rbp), %rdi
xorl %esi, %esi
movl $0xd0, %edx
callq 0x3d0f0
movq -0x20(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x8(%rax), %edi
callq 0x3d090
movw %ax, %cx
movq -0x148(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0xfc(%rbp)
movl $0x2, -0x11c(%rbp)
cmpl $0x3, -0xfc(%rbp)
je 0x42844
movl -0xfc(%rbp), %edx
leaq 0x15377(%rip), %rdi     # 0x57bac
movl $0x6, %esi
callq 0x42d60
jmp 0x42d53
movq -0x10(%rbp), %rax
movslq -0x11c(%rbp), %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x42909
movq -0x10(%rbp), %rax
movq %rax, -0x150(%rbp)
movq -0x10(%rbp), %rax
movl -0x11c(%rbp), %ecx
addl $0x2, %ecx
movl -0x10c(%rbp), %edx
shll %edx
addl %edx, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movq -0x150(%rbp), %rdi
movzwl %ax, %eax
cltq
addq %rax, %rdi
leaq -0x118(%rbp), %rsi
callq 0x431f0
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movl -0x118(%rbp), %esi
callq 0x434e0
movl %eax, %ecx
movslq -0x10c(%rbp), %rax
movl %ecx, -0xf0(%rbp,%rax,4)
movq -0x108(%rbp), %rdi
callq 0x3d030
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x42868
movl -0x30(%rbp), %eax
shll %eax
addl $0x2, %eax
addl -0x11c(%rbp), %eax
movl %eax, -0x11c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x11c(%rbp), %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x429e2
movq -0x10(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x10(%rbp), %rax
movl -0x11c(%rbp), %ecx
addl $0x2, %ecx
movl -0x10c(%rbp), %edx
shll %edx
addl %edx, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movq -0x158(%rbp), %rdi
movzwl %ax, %eax
cltq
addq %rax, %rdi
leaq -0x118(%rbp), %rsi
callq 0x431f0
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movl -0x118(%rbp), %esi
callq 0x434e0
movl %eax, %ecx
movslq -0x10c(%rbp), %rax
movl %ecx, -0xb0(%rbp,%rax,4)
movq -0x108(%rbp), %rdi
callq 0x3d030
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x42941
movl -0x2c(%rbp), %eax
shll %eax
addl $0x2, %eax
addl -0x11c(%rbp), %eax
movl %eax, -0x11c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x11c(%rbp), %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x42ab8
movq -0x10(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x10(%rbp), %rax
movl -0x11c(%rbp), %ecx
addl $0x2, %ecx
movl -0x10c(%rbp), %edx
shll %edx
addl %edx, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movq -0x160(%rbp), %rdi
movzwl %ax, %eax
cltq
addq %rax, %rdi
leaq -0x118(%rbp), %rsi
callq 0x431f0
movq %rax, -0x108(%rbp)
movq -0x108(%rbp), %rdi
movl -0x118(%rbp), %esi
callq 0x434e0
movl %eax, %ecx
movslq -0x10c(%rbp), %rax
movl %ecx, -0x70(%rbp,%rax,4)
movq -0x108(%rbp), %rdi
callq 0x3d030
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x42a1a
movl -0x28(%rbp), %eax
shll %eax
addl $0x2, %eax
addl -0x11c(%rbp), %eax
movl %eax, -0x11c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x11c(%rbp), %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x114(%rbp)
movl $0x0, -0x10c(%rbp)
movl -0x10c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x114(%rbp), %ecx
movb %al, -0x161(%rbp)
jge 0x42b19
cmpl $0x1, -0x10c(%rbp)
setl %al
movb %al, -0x161(%rbp)
movb -0x161(%rbp), %al
testb $0x1, %al
jne 0x42b28
jmp 0x42d53
movq -0x10(%rbp), %rax
movl -0x11c(%rbp), %ecx
addl $0x2, %ecx
movl -0x10c(%rbp), %edx
shll $0x2, %edx
addl %edx, %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x120(%rbp)
movq -0xf8(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0xf8(%rbp), %rax
movl -0x120(%rbp), %ecx
shll %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movw %ax, %cx
movq -0x170(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x12c(%rbp)
movq -0x128(%rbp), %rax
movzwl 0x4(%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x130(%rbp)
movq -0x10(%rbp), %rax
movl -0x11c(%rbp), %ecx
addl $0x2, %ecx
movl -0x10c(%rbp), %edx
shll $0x2, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x110(%rbp)
movl -0x110(%rbp), %eax
cmpl -0x130(%rbp), %eax
jge 0x42d3d
movq -0x128(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x128(%rbp), %rax
movl -0x110(%rbp), %ecx
shll %ecx
addl $0x6, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movw %ax, %cx
movq -0x178(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x138(%rbp)
movl -0x12c(%rbp), %eax
movl %eax, -0x13c(%rbp)
cmpl $0x7, -0x13c(%rbp)
jne 0x42cbb
movq -0x138(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x13c(%rbp)
movq -0x138(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x138(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x3d0e0
movl %eax, %ecx
movq -0x180(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x138(%rbp)
cmpl $0x1, -0x13c(%rbp)
jne 0x42cdf
movq -0x8(%rbp), %rdi
movq -0x138(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
callq 0x42120
cmpl $0x3, -0x13c(%rbp)
jne 0x42d03
movq -0x8(%rbp), %rdi
movq -0x138(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
callq 0x42370
cmpl $0x4, -0x13c(%rbp)
jne 0x42d27
movq -0x8(%rbp), %rdi
movq -0x138(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0xf0(%rbp), %rcx
callq 0x42530
jmp 0x42d29
movl -0x110(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x110(%rbp)
jmp 0x42c03
jmp 0x42d3f
movl -0x10c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10c(%rbp)
jmp 0x42af3
addq $0x180, %rsp            # imm = 0x180
popq %rbp
retq
nopl (%rax)