// File: /workspace/github_c_makefile_star2_O0/aligrudi[P]neatmkfn/otf.c
// Function: otf_gtab
static int otf_gtab(struct otf *otf, void *gpos, struct otflookup *lookups)
{
	void *scripts = gpos + U16(gpos, 4);
	int nscripts, nlangs;
	void *script;
	char stag[8], ltag[8];		/* script and language tags */
	int i, j;
	int n = 0;
	nscripts = U16(scripts, 0);
	for (i = 0; i < nscripts; i++) {
		void *grec = scripts + 2 + 6 * i;
		memcpy(stag, grec, 4);
		stag[4] = '\0';
		if (!mkfn_script(stag, nscripts))
			continue;
		script = scripts + U16(grec, 4);
		nlangs = U16(script, 2);
		if (U16(script, 0) && mkfn_lang(NULL, nlangs + (U16(script, 0) != 0)))
			n = otf_lang(otf, gpos, script + U16(script, 0),
						stag, "", lookups, n);
		for (j = 0; j < nlangs; j++) {
			void *lrec = script + 4 + 6 * j;
			memcpy(ltag, lrec, 4);
			ltag[4] = '\0';
			if (mkfn_lang(ltag, nlangs + (U16(script, 0) != 0)))
				n = otf_lang(otf, gpos, script + U16(lrec, 4),
						stag, ltag, lookups, n);
		}
	}
	qsort(lookups, n, sizeof(lookups[0]), (void *) lookupcmp);
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x4(%rax), %edi
callq 0x3d090
movw %ax, %cx
movq -0x68(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x4204f
movq -0x20(%rbp), %rax
addq $0x2, %rax
imull $0x6, -0x44(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x38(%rbp)
movb $0x0, -0x34(%rbp)
leaq -0x38(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x3d2b0
cmpl $0x0, %eax
jne 0x41e65
jmp 0x42041
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x58(%rbp), %rax
movzwl 0x4(%rax), %edi
callq 0x3d090
movw %ax, %cx
movq -0x70(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x41f4d
movl -0x28(%rbp), %eax
movl %eax, -0x74(%rbp)
movq -0x30(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movl -0x74(%rbp), %esi
movzwl %ax, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %esi
xorl %eax, %eax
movl %eax, %edi
callq 0x3d3b0
cmpl $0x0, %eax
je 0x41f4d
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x30(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movq -0x90(%rbp), %rdx
movq -0x88(%rbp), %rdi
movq -0x80(%rbp), %rsi
movzwl %ax, %eax
cltq
addq %rax, %rdx
leaq -0x38(%rbp), %rcx
movq -0x18(%rbp), %r9
movl -0x4c(%rbp), %eax
leaq 0x4839(%rip), %r8       # 0x4677b
movl %eax, (%rsp)
callq 0x42de0
movl %eax, -0x4c(%rbp)
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x4203f
movq -0x30(%rbp), %rax
addq $0x4, %rax
imull $0x6, -0x48(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movb $0x0, -0x3c(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x98(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x9c(%rbp)
movq -0x30(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movl -0x9c(%rbp), %esi
movq -0x98(%rbp), %rdi
movzwl %ax, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movzbl %al, %eax
addl %eax, %esi
callq 0x3d3b0
cmpl $0x0, %eax
je 0x4202f
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x60(%rbp), %rax
movzwl 0x4(%rax), %edi
callq 0x3d090
movq -0xb8(%rbp), %rdx
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %rsi
movzwl %ax, %eax
cltq
addq %rax, %rdx
leaq -0x38(%rbp), %rcx
leaq -0x40(%rbp), %r8
movq -0x18(%rbp), %r9
movl -0x4c(%rbp), %eax
movl %eax, (%rsp)
callq 0x42de0
movl %eax, -0x4c(%rbp)
jmp 0x42031
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x41f54
jmp 0x42041
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x41e20
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rsi
movl $0x1c, %edx
leaq 0xebd(%rip), %rcx       # 0x42f20
callq 0x3d060
movl -0x4c(%rbp), %eax
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)