// File: /workspace/github_c_makefile_star2_O0/aligrudi[P]neatmkfn/otf.c
// Function: otf_gsub
static void otf_gsub(struct otf *otf, void *gsub)
{
	struct otflookup lookups[NLOOKUPS];
	void *lookuplist = gsub + U16(gsub, 8);
	int nlookups = otf_gtab(otf, gsub, lookups);
	int i, j;
	if (mkfn_dry)
		return;
	for (i = 0; i < nlookups; i++) {
		void *lookup = lookuplist + U16(lookuplist, 2 + 2 * lookups[i].lookup);
		int ltype = U16(lookup, 0);
		int ntabs = U16(lookup, 4);
		char *tag = lookuptag(&lookups[i]);
		sec = (i + 1) * 10;
		printf("gsec %d %s\n", sec, tag);
		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);
			}
			switch (type) {
			case 1:
				otf_gsubtype1(otf, tab, tag, NULL);
				break;
			case 3:
				otf_gsubtype3(otf, tab, tag, NULL);
				break;
			case 4:
				otf_gsubtype4(otf, tab, tag, NULL);
				break;
			case 6:
				otf_gsubtype6(otf, tab, tag, gsub);
				break;
			default:
				otf_unsupported("GSUB", type, 0);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c080, %rsp          # imm = 0x1C080
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1c058(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %edi
callq 0x3d090
movw %ax, %cx
movq -0x1c058(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x1c018(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x1c010(%rbp), %rdx
callq 0x41dc0
movl %eax, -0x1c01c(%rbp)
leaq 0x30fda(%rip), %rax     # 0x727c0
cmpl $0x0, (%rax)
je 0x417f0
jmp 0x41a8a
movl $0x0, -0x1c020(%rbp)
movl -0x1c020(%rbp), %eax
cmpl -0x1c01c(%rbp), %eax
jge 0x41a8a
movq -0x1c018(%rbp), %rax
movq %rax, -0x1c060(%rbp)
movq -0x1c018(%rbp), %rax
movslq -0x1c020(%rbp), %rdx
leaq -0x1c010(%rbp), %rcx
imulq $0x1c, %rdx, %rdx
addq %rdx, %rcx
movl 0x18(%rcx), %ecx
shll %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movw %ax, %cx
movq -0x1c060(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x1c030(%rbp)
movq -0x1c030(%rbp), %rax
movzwl (%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x1c034(%rbp)
movq -0x1c030(%rbp), %rax
movzwl 0x4(%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x1c038(%rbp)
movslq -0x1c020(%rbp), %rax
leaq -0x1c010(%rbp), %rdi
imulq $0x1c, %rax, %rax
addq %rax, %rdi
callq 0x42080
movq %rax, -0x1c040(%rbp)
movl -0x1c020(%rbp), %eax
addl $0x1, %eax
imull $0xa, %eax, %eax
movl %eax, 0x5b4f68(%rip)    # 0x5f6830
movl 0x5b4f62(%rip), %esi    # 0x5f6830
movq -0x1c040(%rbp), %rdx
leaq 0x162da(%rip), %rdi     # 0x57bb6
movb $0x0, %al
callq 0x3d0b0
movl $0x0, -0x1c024(%rbp)
movl -0x1c024(%rbp), %eax
cmpl -0x1c038(%rbp), %eax
jge 0x41a74
movq -0x1c030(%rbp), %rax
movq %rax, -0x1c068(%rbp)
movq -0x1c030(%rbp), %rax
movl -0x1c024(%rbp), %ecx
shll %ecx
addl $0x6, %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx), %edi
callq 0x3d090
movw %ax, %cx
movq -0x1c068(%rbp), %rax
movzwl %cx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x1c048(%rbp)
movl -0x1c034(%rbp), %eax
movl %eax, -0x1c04c(%rbp)
cmpl $0x7, -0x1c04c(%rbp)
jne 0x419a5
movq -0x1c048(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x3d090
movzwl %ax, %eax
movl %eax, -0x1c04c(%rbp)
movq -0x1c048(%rbp), %rax
movq %rax, -0x1c070(%rbp)
movq -0x1c048(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x3d0e0
movl %eax, %ecx
movq -0x1c070(%rbp), %rax
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x1c048(%rbp)
movl -0x1c04c(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x1c078(%rbp)
subl $0x5, %eax
ja 0x41a4a
movq -0x1c078(%rbp), %rax
leaq 0x160c3(%rip), %rcx     # 0x57a90
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
movq -0x1c048(%rbp), %rsi
movq -0x1c040(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x42120
jmp 0x41a5e
movq -0x8(%rbp), %rdi
movq -0x1c048(%rbp), %rsi
movq -0x1c040(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x42370
jmp 0x41a5e
movq -0x8(%rbp), %rdi
movq -0x1c048(%rbp), %rsi
movq -0x1c040(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x42530
jmp 0x41a5e
movq -0x8(%rbp), %rdi
movq -0x1c048(%rbp), %rsi
movq -0x1c040(%rbp), %rdx
movq -0x10(%rbp), %rcx
callq 0x427a0
jmp 0x41a5e
movl -0x1c04c(%rbp), %esi
leaq 0x16155(%rip), %rdi     # 0x57bac
xorl %edx, %edx
callq 0x42d60
jmp 0x41a60
movl -0x1c024(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c024(%rbp)
jmp 0x418ed
jmp 0x41a76
movl -0x1c020(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c020(%rbp)
jmp 0x417fa
addq $0x1c080, %rsp          # imm = 0x1C080
popq %rbp
retq
nopw %cs:(%rax,%rax)