// File: /workspace/github_c_makefile_star2_O3/aligrudi[P]neatmkfn/afm.c
// Function: afm_read
int afm_read(void)
{
	char ln[1024];
	char ch[TOKLEN] = "", pos[TOKLEN] = "";
	char c1[TOKLEN] = "", c2[TOKLEN] = "";
	char wid[TOKLEN] = "", field[TOKLEN] = "";
	char llx[TOKLEN] = "0", lly[TOKLEN] = "0";
	char urx[TOKLEN] = "0", ury[TOKLEN] = "0";
	char fontname[128];
	char *s;
	while (fgets(ln, sizeof(ln), stdin)) {
		if (ln[0] == '#')
			continue;
		if (!strncmp("FontName ", ln, 8)) {
			sscanf(ln, "FontName %s", fontname);
			continue;
		}
		if (!strncmp("StartCharMetrics", ln, 16))
			break;
	}
	while (fgets(ln, sizeof(ln), stdin)) {
		if (ln[0] == '#')
			continue;
		if (!strncmp("EndCharMetrics", ln, 14))
			break;
		s = ln;
		while (*s) {
			s = afm_charfield(s, field);
			if (!strcmp("C", field)) {
				s = afm_charfield(s, pos);
				continue;
			}
			if (!strcmp("WX", field)) {
				s = afm_charfield(s, wid);
				continue;
			}
			if (!strcmp("N", field)) {
				s = afm_charfield(s, ch);
				continue;
			}
			if (!strcmp("B", field)) {
				s = afm_charfield(s, llx);
				s = afm_charfield(s, lly);
				s = afm_charfield(s, urx);
				s = afm_charfield(s, ury);
				continue;
			}
			if (!strcmp("L", field)) {
				s = afm_charfield(s, c1);
				s = afm_charfield(s, c2);
				continue;
			}
			break;
		}
		if (ch[0] && pos[0] && wid[0])
			mkfn_char(ch, atoi(pos), 0, uwid(atoi(wid)),
				uwid(atoi(llx)), uwid(atoi(lly)),
				uwid(atoi(urx)), uwid(atoi(ury)));
	}
	mkfn_header(fontname);
	while (fgets(ln, sizeof(ln), stdin)) {
		if (ln[0] == '#')
			continue;
		if (!strncmp("StartKernPairs", ln, 14))
			break;
	}
	while (fgets(ln, sizeof(ln), stdin)) {
		if (ln[0] == '#')
			continue;
		if (!strncmp("EndKernPairs", ln, 12))
			break;
		if (sscanf(ln, "KPX %s %s %s", c1, c2, wid) == 3)
			mkfn_kern(c1, c2, uwid(atoi(wid)));
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xea8, %rsp            # imm = 0xEA8
leaq 0x6a0(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3d0f0
leaq 0xda0(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3d0f0
leaq 0xca0(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3d0f0
leaq 0xba0(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3d0f0
leaq 0x120(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3d0f0
leaq 0x20(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x3d0f0
leaq 0xaa0(%rsp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3d0f0
movb $0x30, %bpl
movb %bpl, (%rbx)
leaq 0x9a0(%rsp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3d0f0
movb %bpl, (%rbx)
leaq 0x8a0(%rsp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3d0f0
movb %bpl, (%rbx)
leaq 0x7a0(%rsp), %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
xorl %esi, %esi
callq 0x3d0f0
movb %bpl, (%rbx)
movq 0x2b668(%rip), %r13     # 0x69fd0
movq (%r13), %rdx
leaq 0x220(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
je 0x3e9fc
leaq 0x220(%rsp), %rbx
movabsq $0x656d614e746e6f46, %r12 # imm = 0x656D614E746E6F46
leaq 0x16234(%rip), %r14     # 0x54bd0
leaq 0x620(%rsp), %r15
cmpb $0x23, 0x220(%rsp)
je 0x3e9e6
cmpq %r12, 0x220(%rsp)
jne 0x3e9ca
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3d190
jmp 0x3e9e6
movdqa 0x220(%rsp), %xmm0
pcmpeqb 0x161e5(%rip), %xmm0    # 0x54bc0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x3e9fc
movq (%r13), %rdx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
jne 0x3e9a4
movq (%r13), %rdx
leaq 0x220(%rsp), %rbx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
je 0x3ed46
movl $0x0, 0x4(%rsp)
movabsq $0x4d72616843646e45, %r12 # imm = 0x4D72616843646E45
leaq 0xda0(%rsp), %r14
leaq 0x20(%rsp), %rbp
movl $0x5857, %r15d          # imm = 0x5857
movl $0x0, 0x8(%rsp)
movb 0x220(%rsp), %al
cmpb $0x23, %al
je 0x3ed2c
movq 0x220(%rsp), %rcx
xorq %r12, %rcx
movq 0x226(%rsp), %rdx
movabsq $0x7363697274654d72, %rsi # imm = 0x7363697274654D72
xorq %rsi, %rdx
orq %rcx, %rdx
je 0x3ed46
testb %al, %al
je 0x3eb68
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x3eeee
movzwl 0x20(%rsp), %ecx
cmpl $0x43, %ecx
jne 0x3eaab
movq %rax, %rdi
movq %r14, %rsi
jmp 0x3eb41
movl 0x20(%rsp), %edx
xorl %r15d, %edx
movzbl 0x22(%rsp), %esi
orw %dx, %si
je 0x3eadc
cmpl $0x42, %ecx
je 0x3eb06
cmpl $0x4c, %ecx
je 0x3eae9
cmpl $0x4e, %ecx
jne 0x3eb52
movq %rax, %rdi
leaq 0x6a0(%rsp), %rsi
jmp 0x3eb41
movq %rax, %rdi
leaq 0x120(%rsp), %rsi
jmp 0x3eb41
movq %rax, %rdi
leaq 0xca0(%rsp), %rsi
callq 0x3eeee
movq %rax, %rdi
leaq 0xba0(%rsp), %rsi
jmp 0x3eb41
movq %rax, %rdi
leaq 0xaa0(%rsp), %rsi
callq 0x3eeee
movq %rax, %rdi
leaq 0x9a0(%rsp), %rsi
callq 0x3eeee
movq %rax, %rdi
leaq 0x8a0(%rsp), %rsi
callq 0x3eeee
movq %rax, %rdi
leaq 0x7a0(%rsp), %rsi
callq 0x3eeee
movq %rax, %rdi
cmpb $0x0, (%rdi)
jne 0x3ea8e
movb 0xda0(%rsp), %al
movl %eax, 0x8(%rsp)
movb 0x120(%rsp), %al
movl %eax, 0x4(%rsp)
cmpb $0x0, 0x6a0(%rsp)
je 0x3ed2c
cmpb $0x0, 0x8(%rsp)
je 0x3ed2c
cmpb $0x0, 0x4(%rsp)
je 0x3ed2c
movq %r14, %rdi
callq 0x3d1a0
movl %eax, 0xc(%rsp)
leaq 0x120(%rsp), %rdi
callq 0x3d1a0
movl %eax, %ecx
movl $0x11940, %eax          # imm = 0x11940
xorl %edx, %edx
leaq 0x2b55b(%rip), %rsi     # 0x6a110
idivl (%rsi)
movl %eax, %esi
testl %ecx, %ecx
movl %ecx, %eax
movslq %ecx, %rcx
movl $0x14, %edi
movl $0xffffffec, %edx       # imm = 0xFFFFFFEC
cmovsl %edx, %edi
movl $0xffffffec, %r12d      # imm = 0xFFFFFFEC
cmovnsq %rax, %rcx
movl %esi, %eax
cltd
idivl %edi
cltq
addq %rcx, %rax
movslq %esi, %rbx
addq %rax, %rax
leaq (%rax,%rax,4), %rax
cqto
idivq %rbx
movq %rax, 0x18(%rsp)
leaq 0xaa0(%rsp), %rdi
callq 0x3d1a0
testl %eax, %eax
movl %eax, %ecx
movslq %eax, %rsi
movl $0x14, %edi
cmovsl %r12d, %edi
movl $0xffffffec, %r12d      # imm = 0xFFFFFFEC
cmovnsq %rcx, %rsi
movl %ebx, %eax
cltd
idivl %edi
cltq
addq %rsi, %rax
addq %rax, %rax
leaq (%rax,%rax,4), %rax
cqto
idivq %rbx
movq %rax, 0x10(%rsp)
leaq 0x9a0(%rsp), %rdi
callq 0x3d1a0
testl %eax, %eax
movl %eax, %ecx
movslq %eax, %rsi
movl $0x14, %edi
cmovsl %r12d, %edi
movl $0xffffffec, %r13d      # imm = 0xFFFFFFEC
cmovnsq %rcx, %rsi
movl %ebx, %eax
cltd
idivl %edi
cltq
addq %rsi, %rax
addq %rax, %rax
leaq (%rax,%rax,4), %rax
cqto
idivq %rbx
movq %rax, %r12
leaq 0x8a0(%rsp), %rdi
callq 0x3d1a0
testl %eax, %eax
movl %eax, %ecx
movslq %eax, %rsi
movl $0x14, %edi
cmovsl %r13d, %edi
cmovnsq %rcx, %rsi
movl %ebx, %eax
cltd
idivl %edi
cltq
addq %rsi, %rax
addq %rax, %rax
leaq (%rax,%rax,4), %rax
cqto
idivq %rbx
movq %rax, %r13
leaq 0x7a0(%rsp), %rdi
callq 0x3d1a0
testl %eax, %eax
movl %eax, %ecx
movslq %eax, %rsi
movl $0x14, %edi
movl $0xffffffec, %eax       # imm = 0xFFFFFFEC
cmovsl %eax, %edi
cmovnsq %rcx, %rsi
movl %ebx, %eax
cltd
idivl %edi
cltq
addq %rsi, %rax
addq %rax, %rax
leaq (%rax,%rax,4), %rax
cqto
idivq %rbx
leaq 0x220(%rsp), %rbx
leaq 0x6a0(%rsp), %rdi
movl 0xc(%rsp), %esi
xorl %edx, %edx
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %r8
movl %r12d, %r9d
movabsq $0x4d72616843646e45, %r12 # imm = 0x4D72616843646E45
pushq %rax
pushq %r13
movq 0x2b2ad(%rip), %r13     # 0x69fd0
callq 0x3d8fc
addq $0x10, %rsp
movq (%r13), %rdx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
jne 0x3ea4b
leaq 0x620(%rsp), %rdi
callq 0x3d5d4
movq (%r13), %rdx
leaq 0x220(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
je 0x3edc5
leaq 0x220(%rsp), %rbx
movabsq $0x72654b7472617453, %r14 # imm = 0x72654B7472617453
movabsq $0x73726961506e7265, %r15 # imm = 0x73726961506E7265
cmpb $0x23, 0x220(%rsp)
je 0x3edaf
movq 0x220(%rsp), %rax
xorq %r14, %rax
movq 0x226(%rsp), %rcx
xorq %r15, %rcx
orq %rax, %rcx
je 0x3edc5
movq (%r13), %rdx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
jne 0x3ed8a
movq (%r13), %rdx
leaq 0x220(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
je 0x3eeda
leaq 0x220(%rsp), %rbx
movabsq $0x506e72654b646e45, %rbp # imm = 0x506E72654B646E45
leaq 0x15e1e(%rip), %r14     # 0x54c1b
leaq 0xca0(%rsp), %r15
leaq 0xba0(%rsp), %r12
leaq 0x120(%rsp), %r13
cmpb $0x23, 0x220(%rsp)
je 0x3eeba
movq 0x220(%rsp), %rax
xorq %rbp, %rax
movl 0x228(%rsp), %ecx
xorq $0x73726961, %rcx       # imm = 0x73726961
orq %rax, %rcx
je 0x3eeda
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
xorl %eax, %eax
callq 0x3d190
cmpl $0x3, %eax
jne 0x3eeba
movq %r13, %rdi
callq 0x3d1a0
movl %eax, %ecx
movl $0x11940, %eax          # imm = 0x11940
xorl %edx, %edx
leaq 0x2b298(%rip), %rsi     # 0x6a110
idivl (%rsi)
movl %eax, %esi
testl %ecx, %ecx
movl %ecx, %eax
movslq %ecx, %rcx
movl $0x14, %edi
movl $0xffffffec, %edx       # imm = 0xFFFFFFEC
cmovsl %edx, %edi
cmovnsq %rax, %rcx
movl %esi, %eax
cltd
idivl %edi
cltq
addq %rcx, %rax
movslq %esi, %rcx
addq %rax, %rax
leaq (%rax,%rax,4), %rax
cqto
idivq %rcx
movq %r15, %rdi
movq %r12, %rsi
movl %eax, %edx
callq 0x3e23f
movq 0x2b10f(%rip), %rax     # 0x69fd0
movq (%rax), %rdx
movq %rbx, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x3d130
testq %rax, %rax
jne 0x3ee15
xorl %eax, %eax
addq $0xea8, %rsp            # imm = 0xEA8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq