// File: /workspace/github_c_makefile_star2_O0/aligrudi[P]neatmkfn/otf.c
// Function: otf_featrec
static int otf_featrec(struct otf *otf, void *gtab, void *featrec,
			char *stag, char *ltag,
			struct otflookup *lookups, int lookups_n)
{
	void *feats = gtab + U16(gtab, 6);
	void *feat = feats + U16(featrec, 4);
	char ftag[8] = "";
	int n = U16(feat, 2);
	int i, j;
	memcpy(ftag, featrec, 4);
	for (i = 0; i < n; i++) {
		int lookup = U16(feat, 4 + 2 * i);	/* lookup index */
		/* do not store features common to all languages in a script */
		for (j = 0; j < lookups_n; j++)
			if (lookups[j].lookup == lookup && !lookups[j].lang[0])
				if (!strcmp(lookups[j].scrp, stag) &&
						!strcmp(lookups[j].feat, ftag))
					break;
		if (j == lookups_n) {
			strcpy(lookups[j].feat, ftag);
			strcpy(lookups[j].scrp, stag);
			strcpy(lookups[j].lang, ltag);
			lookups[j].lookup = U16(feat, 4 + 2 * i);
			lookups_n++;
		}
	}
	return lookups_n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %edi
callq 0x3d090
movw %ax, %cx
movq -0x68(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rax
movzwl 0x4(%rax), %edi
callq 0x3d090
movw %ax, %cx
movq -0x60(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x8, %edx
callq 0x3d0f0
movq -0x40(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x48(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x431e1
movq -0x40(%rbp), %rax
movl -0x50(%rbp), %ecx
shll %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x58(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl 0x10(%rbp), %eax
jge 0x4313f
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
cmpl -0x58(%rbp), %eax
jne 0x4312f
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
imulq $0x1c, %rcx, %rcx
addq %rcx, %rax
cmpb $0x0, 0x8(%rax)
jne 0x4312f
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rax
imulq $0x1c, %rax, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x3d120
cmpl $0x0, %eax
jne 0x4312d
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rax
imulq $0x1c, %rax, %rax
addq %rax, %rdi
addq $0x10, %rdi
leaq -0x48(%rbp), %rsi
callq 0x3d120
cmpl $0x0, %eax
jne 0x4312d
jmp 0x4313f
jmp 0x4312f
jmp 0x43131
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x430b9
movl -0x54(%rbp), %eax
cmpl 0x10(%rbp), %eax
jne 0x431d1
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rax
imulq $0x1c, %rax, %rax
addq %rax, %rdi
addq $0x10, %rdi
leaq -0x48(%rbp), %rsi
callq 0x3d050
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rax
imulq $0x1c, %rax, %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x3d050
movq -0x30(%rbp), %rdi
movslq -0x54(%rbp), %rax
imulq $0x1c, %rax, %rax
addq %rax, %rdi
addq $0x8, %rdi
movq -0x28(%rbp), %rsi
callq 0x3d050
movq -0x40(%rbp), %rax
movl -0x50(%rbp), %ecx
shll %ecx
addl $0x4, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movzwl %ax, %ecx
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rdx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x18(%rax)
movl 0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, 0x10(%rbp)
jmp 0x431d3
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x43088
movl 0x10(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw (%rax,%rax)