// File: /workspace/github_c_makefile_star2_O0/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt__matchpair
static int stbtt__matchpair(stbtt_uint8 *fc, stbtt_uint32 nm, stbtt_uint8 *name, stbtt_int32 nlen, stbtt_int32 target_id, stbtt_int32 next_id)
{
   stbtt_int32 i;
   stbtt_int32 count = ttUSHORT(fc+nm+2);
   stbtt_int32 stringOffset = nm + ttUSHORT(fc+nm+4);

   for (i=0; i < count; ++i) {
      stbtt_uint32 loc = nm + 6 + 12 * i;
      stbtt_int32 id = ttUSHORT(fc+loc+6);
      if (id == target_id) {
         // find the encoding
         stbtt_int32 platform = ttUSHORT(fc+loc+0), encoding = ttUSHORT(fc+loc+2), language = ttUSHORT(fc+loc+4);

         // is this a Unicode encoding?
         if (platform == 0 || (platform == 3 && encoding == 1) || (platform == 3 && encoding == 10)) {
            stbtt_int32 slen = ttUSHORT(fc+loc+8);
            stbtt_int32 off = ttUSHORT(fc+loc+10);

            // check if there's a prefix match
            stbtt_int32 matchlen = stbtt__CompareUTF8toUTF16_bigendian_prefix(name, nlen, fc+stringOffset+off,slen);
            if (matchlen >= 0) {
               // check for target_id+1 immediately following, with same encoding & language
               if (i+1 < count && ttUSHORT(fc+loc+12+6) == next_id && ttUSHORT(fc+loc+12) == platform && ttUSHORT(fc+loc+12+2) == encoding && ttUSHORT(fc+loc+12+4) == language) {
                  slen = ttUSHORT(fc+loc+12+8);
                  off = ttUSHORT(fc+loc+12+10);
                  if (slen == 0) {
                     if (matchlen == nlen)
                        return 1;
                  } else if (matchlen < nlen && name[matchlen] == ' ') {
                     ++matchlen;
                     if (stbtt_CompareUTF8toUTF16_bigendian_internal((char*) (name+matchlen), nlen-matchlen, (char*)(fc+stringOffset+off),slen))
                        return 1;
                  }
               } else {
                  // if nothing immediately following
                  if (matchlen == nlen)
                     return 1;
               }
            }
         }

         // @TODO handle other encodings
      }
   }
   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
addq $0x2, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x34(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
addq $0x4, %rdi
callq 0x4990
movw %ax, %cx
movl -0x5c(%rbp), %eax
movzwl %cx, %ecx
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x14149
movl -0x14(%rbp), %eax
addl $0x6, %eax
imull $0xc, -0x30(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0x6, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x28(%rbp), %eax
jne 0x14139
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x44(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0x2, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0x4, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x13f72
cmpl $0x3, -0x44(%rbp)
jne 0x13f5e
cmpl $0x1, -0x48(%rbp)
je 0x13f72
cmpl $0x3, -0x44(%rbp)
jne 0x14137
cmpl $0xa, -0x48(%rbp)
jne 0x14137
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0x8, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0xa, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x10(%rbp), %rdx
movslq -0x38(%rbp), %rax
addq %rax, %rdx
movslq -0x54(%rbp), %rax
addq %rax, %rdx
movl -0x50(%rbp), %ecx
callq 0x14160
movl %eax, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
jl 0x14135
movl -0x30(%rbp), %eax
addl $0x1, %eax
cmpl -0x34(%rbp), %eax
jge 0x14120
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0xc, %rdi
addq $0x6, %rdi
callq 0x4990
movzwl %ax, %eax
cmpl -0x2c(%rbp), %eax
jne 0x14120
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0xc, %rdi
callq 0x4990
movzwl %ax, %eax
cmpl -0x44(%rbp), %eax
jne 0x14120
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0xc, %rdi
addq $0x2, %rdi
callq 0x4990
movzwl %ax, %eax
cmpl -0x48(%rbp), %eax
jne 0x14120
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0xc, %rdi
addq $0x4, %rdi
callq 0x4990
movzwl %ax, %eax
cmpl -0x4c(%rbp), %eax
jne 0x14120
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0xc, %rdi
addq $0x8, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %eax
addq %rax, %rdi
addq $0xc, %rdi
addq $0xa, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0x140bf
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x140bd
movl $0x1, -0x4(%rbp)
jmp 0x14150
jmp 0x1411e
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x1411c
movq -0x20(%rbp), %rax
movslq -0x58(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jne 0x1411c
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
movq -0x20(%rbp), %rdi
movslq -0x58(%rbp), %rax
addq %rax, %rdi
movl -0x24(%rbp), %esi
subl -0x58(%rbp), %esi
movq -0x10(%rbp), %rdx
movslq -0x38(%rbp), %rax
addq %rax, %rdx
movslq -0x54(%rbp), %rax
addq %rax, %rdx
movl -0x50(%rbp), %ecx
callq 0xce40
cmpl $0x0, %eax
je 0x1411a
movl $0x1, -0x4(%rbp)
jmp 0x14150
jmp 0x1411c
jmp 0x1411e
jmp 0x14133
movl -0x58(%rbp), %eax
cmpl -0x24(%rbp), %eax
jne 0x14131
movl $0x1, -0x4(%rbp)
jmp 0x14150
jmp 0x14133
jmp 0x14135
jmp 0x14137
jmp 0x14139
jmp 0x1413b
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x13ec5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)