// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: stbtt__GetGlyphGPOSInfoAdvance
static stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(const stbtt_fontinfo *info, int glyph1, int glyph2)
{
   stbtt_uint16 lookupListOffset;
   stbtt_uint8 *lookupList;
   stbtt_uint16 lookupCount;
   stbtt_uint8 *data;
   stbtt_int32 i, sti;

   if (!info->gpos) return 0;

   data = info->data + info->gpos;

   if (ttUSHORT(data+0) != 1) return 0; /*  Major version 1 */
   if (ttUSHORT(data+2) != 0) return 0; /*  Minor version 0 */

   lookupListOffset = ttUSHORT(data+8);
   lookupList = data + lookupListOffset;
   lookupCount = ttUSHORT(lookupList);

   for (i=0; i<lookupCount; ++i) {
      stbtt_uint16 lookupOffset = ttUSHORT(lookupList + 2 + 2 * i);
      stbtt_uint8 *lookupTable = lookupList + lookupOffset;

      stbtt_uint16 lookupType = ttUSHORT(lookupTable);
      stbtt_uint16 subTableCount = ttUSHORT(lookupTable + 4);
      stbtt_uint8 *subTableOffsets = lookupTable + 6;
      if (lookupType != 2) /*  Pair Adjustment Positioning Subtable */
         continue;

      for (sti=0; sti<subTableCount; sti++) {
         stbtt_uint16 subtableOffset = ttUSHORT(subTableOffsets + 2 * sti);
         stbtt_uint8 *table = lookupTable + subtableOffset;
         stbtt_uint16 posFormat = ttUSHORT(table);
         stbtt_uint16 coverageOffset = ttUSHORT(table + 2);
         stbtt_int32 coverageIndex = stbtt__GetCoverageIndex(table + coverageOffset, glyph1);
         if (coverageIndex == -1) continue;

         switch (posFormat) {
            case 1: {
               stbtt_int32 l, r, m;
               int straw, needle;
               stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
               stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
               if (valueFormat1 == 4 && valueFormat2 == 0) { /*  Support more formats? */
                  stbtt_int32 valueRecordPairSizeInBytes = 2;
                  stbtt_uint16 pairSetCount = ttUSHORT(table + 8);
                  stbtt_uint16 pairPosOffset = ttUSHORT(table + 10 + 2 * coverageIndex);
                  stbtt_uint8 *pairValueTable = table + pairPosOffset;
                  stbtt_uint16 pairValueCount = ttUSHORT(pairValueTable);
                  stbtt_uint8 *pairValueArray = pairValueTable + 2;

                  if (coverageIndex >= pairSetCount) return 0;

                  needle=glyph2;
                  r=pairValueCount-1;
                  l=0;

                  /*  Binary search. */
                  while (l <= r) {
                     stbtt_uint16 secondGlyph;
                     stbtt_uint8 *pairValue;
                     m = (l + r) >> 1;
                     pairValue = pairValueArray + (2 + valueRecordPairSizeInBytes) * m;
                     secondGlyph = ttUSHORT(pairValue);
                     straw = secondGlyph;
                     if (needle < straw)
                        r = m - 1;
                     else if (needle > straw)
                        l = m + 1;
                     else {
                        stbtt_int16 xAdvance = ttSHORT(pairValue + 2);
                        return xAdvance;
                     }
                  }
               } else
                  return 0;
               break;
            }

            case 2: {
               stbtt_uint16 valueFormat1 = ttUSHORT(table + 4);
               stbtt_uint16 valueFormat2 = ttUSHORT(table + 6);
               if (valueFormat1 == 4 && valueFormat2 == 0) { /*  Support more formats? */
                  stbtt_uint16 classDef1Offset = ttUSHORT(table + 8);
                  stbtt_uint16 classDef2Offset = ttUSHORT(table + 10);
                  int glyph1class = stbtt__GetGlyphClass(table + classDef1Offset, glyph1);
                  int glyph2class = stbtt__GetGlyphClass(table + classDef2Offset, glyph2);

                  stbtt_uint16 class1Count = ttUSHORT(table + 12);
                  stbtt_uint16 class2Count = ttUSHORT(table + 14);
                  stbtt_uint8 *class1Records, *class2Records;
                  stbtt_int16 xAdvance;

                  if (glyph1class < 0 || glyph1class >= class1Count) return 0; /*  malformed */
                  if (glyph2class < 0 || glyph2class >= class2Count) return 0; /*  malformed */

                  class1Records = table + 16;
                  class2Records = class1Records + 2 * (glyph1class * class2Count);
                  xAdvance = ttSHORT(class2Records + 2 * glyph2class);
                  return xAdvance;
               } else
                  return 0;
               break;
            }

            default:
               return 0; /*  Unsupported position format */
         }
      }
   }

   return 0;
}

// Assembly:
subq $0xf8, %rsp
movq %rdi, 0xe8(%rsp)
movl %esi, 0xe4(%rsp)
movl %edx, 0xe0(%rsp)
movq 0xe8(%rsp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x3ec8b
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
movq 0xe8(%rsp), %rax
movq 0x8(%rax), %rax
movq 0xe8(%rsp), %rcx
movslq 0x30(%rcx), %rcx
addq %rcx, %rax
movq %rax, 0xc0(%rsp)
movq 0xc0(%rsp), %rdi
callq 0x3cf00
movzwl %ax, %eax
cmpl $0x1, %eax
je 0x3ecd3
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
movq 0xc0(%rsp), %rdi
addq $0x2, %rdi
callq 0x3cf00
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x3ecfc
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
movq 0xc0(%rsp), %rdi
addq $0x8, %rdi
callq 0x3cf00
movw %ax, 0xde(%rsp)
movq 0xc0(%rsp), %rax
movzwl 0xde(%rsp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0xd0(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x3cf00
movw %ax, 0xce(%rsp)
movl $0x0, 0xbc(%rsp)
movl 0xbc(%rsp), %eax
movzwl 0xce(%rsp), %ecx
cmpl %ecx, %eax
jge 0x3f27b
movq 0xd0(%rsp), %rdi
addq $0x2, %rdi
movl 0xbc(%rsp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x3cf00
movw %ax, 0xb6(%rsp)
movq 0xd0(%rsp), %rax
movzwl 0xb6(%rsp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
callq 0x3cf00
movw %ax, 0xa6(%rsp)
movq 0xa8(%rsp), %rdi
addq $0x4, %rdi
callq 0x3cf00
movw %ax, 0xa4(%rsp)
movq 0xa8(%rsp), %rax
addq $0x6, %rax
movq %rax, 0x98(%rsp)
movzwl 0xa6(%rsp), %eax
cmpl $0x2, %eax
je 0x3ee03
jmp 0x3f265
movl $0x0, 0xb8(%rsp)
movl 0xb8(%rsp), %eax
movzwl 0xa4(%rsp), %ecx
cmpl %ecx, %eax
jge 0x3f263
movq 0x98(%rsp), %rdi
movl 0xb8(%rsp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x3cf00
movw %ax, 0x96(%rsp)
movq 0xa8(%rsp), %rax
movzwl 0x96(%rsp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
callq 0x3cf00
movw %ax, 0x86(%rsp)
movq 0x88(%rsp), %rdi
addq $0x2, %rdi
callq 0x3cf00
movw %ax, 0x84(%rsp)
movq 0x88(%rsp), %rdi
movzwl 0x84(%rsp), %eax
cltq
addq %rax, %rdi
movl 0xe4(%rsp), %esi
callq 0x80a60
movl %eax, 0x80(%rsp)
cmpl $-0x1, 0x80(%rsp)
jne 0x3eecb
jmp 0x3f24d
movzwl 0x86(%rsp), %eax
movl %eax, 0x8(%rsp)
subl $0x1, %eax
je 0x3eef0
jmp 0x3eede
movl 0x8(%rsp), %eax
subl $0x2, %eax
je 0x3f0ae
jmp 0x3f23e
movq 0x88(%rsp), %rdi
addq $0x4, %rdi
callq 0x3cf00
movw %ax, 0x6a(%rsp)
movq 0x88(%rsp), %rdi
addq $0x6, %rdi
callq 0x3cf00
movw %ax, 0x68(%rsp)
movzwl 0x6a(%rsp), %eax
cmpl $0x4, %eax
jne 0x3f099
movzwl 0x68(%rsp), %eax
cmpl $0x0, %eax
jne 0x3f099
movl $0x2, 0x64(%rsp)
movq 0x88(%rsp), %rdi
addq $0x8, %rdi
callq 0x3cf00
movw %ax, 0x62(%rsp)
movq 0x88(%rsp), %rdi
addq $0xa, %rdi
movl 0x80(%rsp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x3cf00
movw %ax, 0x60(%rsp)
movq 0x88(%rsp), %rax
movzwl 0x60(%rsp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
callq 0x3cf00
movw %ax, 0x56(%rsp)
movq 0x58(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x48(%rsp)
movl 0x80(%rsp), %eax
movzwl 0x62(%rsp), %ecx
cmpl %ecx, %eax
jl 0x3efcf
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
movl 0xe0(%rsp), %eax
movl %eax, 0x6c(%rsp)
movzwl 0x56(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x78(%rsp)
movl $0x0, 0x7c(%rsp)
movl 0x7c(%rsp), %eax
cmpl 0x78(%rsp), %eax
jg 0x3f097
movl 0x7c(%rsp), %eax
addl 0x78(%rsp), %eax
sarl %eax
movl %eax, 0x74(%rsp)
movq 0x48(%rsp), %rax
movl 0x64(%rsp), %ecx
addl $0x2, %ecx
imull 0x74(%rsp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x3cf00
movw %ax, 0x46(%rsp)
movzwl 0x46(%rsp), %eax
movl %eax, 0x70(%rsp)
movl 0x6c(%rsp), %eax
cmpl 0x70(%rsp), %eax
jge 0x3f055
movl 0x74(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x3f092
movl 0x6c(%rsp), %eax
cmpl 0x70(%rsp), %eax
jle 0x3f06c
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0x3f090
movq 0x38(%rsp), %rdi
addq $0x2, %rdi
callq 0x3cf20
movw %ax, 0x36(%rsp)
movswl 0x36(%rsp), %eax
movl %eax, 0xf4(%rsp)
jmp 0x3f286
jmp 0x3f092
jmp 0x3efee
jmp 0x3f0a9
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
jmp 0x3f24b
movq 0x88(%rsp), %rdi
addq $0x4, %rdi
callq 0x3cf00
movw %ax, 0x34(%rsp)
movq 0x88(%rsp), %rdi
addq $0x6, %rdi
callq 0x3cf00
movw %ax, 0x32(%rsp)
movzwl 0x34(%rsp), %eax
cmpl $0x4, %eax
jne 0x3f231
movzwl 0x32(%rsp), %eax
cmpl $0x0, %eax
jne 0x3f231
movq 0x88(%rsp), %rdi
addq $0x8, %rdi
callq 0x3cf00
movw %ax, 0x30(%rsp)
movq 0x88(%rsp), %rdi
addq $0xa, %rdi
callq 0x3cf00
movw %ax, 0x2e(%rsp)
movq 0x88(%rsp), %rdi
movzwl 0x30(%rsp), %eax
cltq
addq %rax, %rdi
movl 0xe4(%rsp), %esi
callq 0x80c70
movl %eax, 0x28(%rsp)
movq 0x88(%rsp), %rdi
movzwl 0x2e(%rsp), %eax
cltq
addq %rax, %rdi
movl 0xe0(%rsp), %esi
callq 0x80c70
movl %eax, 0x24(%rsp)
movq 0x88(%rsp), %rdi
addq $0xc, %rdi
callq 0x3cf00
movw %ax, 0x22(%rsp)
movq 0x88(%rsp), %rdi
addq $0xe, %rdi
callq 0x3cf00
movw %ax, 0x20(%rsp)
cmpl $0x0, 0x28(%rsp)
jl 0x3f1a6
movl 0x28(%rsp), %eax
movzwl 0x22(%rsp), %ecx
cmpl %ecx, %eax
jl 0x3f1b6
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
cmpl $0x0, 0x24(%rsp)
jl 0x3f1ca
movl 0x24(%rsp), %eax
movzwl 0x20(%rsp), %ecx
cmpl %ecx, %eax
jl 0x3f1da
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
movq 0x88(%rsp), %rax
addq $0x10, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl 0x28(%rsp), %ecx
movzwl 0x20(%rsp), %edx
imull %edx, %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
movl 0x24(%rsp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x3cf20
movw %ax, 0xe(%rsp)
movswl 0xe(%rsp), %eax
movl %eax, 0xf4(%rsp)
jmp 0x3f286
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
movl $0x0, 0xf4(%rsp)
jmp 0x3f286
jmp 0x3f24d
movl 0xb8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb8(%rsp)
jmp 0x3ee0e
jmp 0x3f265
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0x3ed53
movl $0x0, 0xf4(%rsp)
movl 0xf4(%rsp), %eax
addq $0xf8, %rsp
retq
nopw %cs:(%rax,%rax)