// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonnuklear/src/./nuklear/nuklear.h
// Function: stbtt__GetGlyphClass
static stbtt_int32  stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph)
{
   stbtt_uint16 classDefFormat = ttUSHORT(classDefTable);
   switch (classDefFormat)
   {
      case 1: {
         stbtt_uint16 startGlyphID = ttUSHORT(classDefTable + 2);
         stbtt_uint16 glyphCount = ttUSHORT(classDefTable + 4);
         stbtt_uint8 *classDef1ValueArray = classDefTable + 6;

         if (glyph >= startGlyphID && glyph < startGlyphID + glyphCount)
            return (stbtt_int32)ttUSHORT(classDef1ValueArray + 2 * (glyph - startGlyphID));
         break;
      }

      case 2: {
         stbtt_uint16 classRangeCount = ttUSHORT(classDefTable + 2);
         stbtt_uint8 *classRangeRecords = classDefTable + 4;

         /*  Binary search. */
         stbtt_int32 l=0, r=classRangeCount-1, m;
         int strawStart, strawEnd, needle=glyph;
         while (l <= r) {
            stbtt_uint8 *classRangeRecord;
            m = (l + r) >> 1;
            classRangeRecord = classRangeRecords + 6 * m;
            strawStart = ttUSHORT(classRangeRecord);
            strawEnd = ttUSHORT(classRangeRecord + 2);
            if (needle < strawStart)
               r = m - 1;
            else if (needle > strawEnd)
               l = m + 1;
            else
               return (stbtt_int32)ttUSHORT(classRangeRecord + 4);
         }
         break;
      }

      default:
         return -1; /*  Unsupported definition type, return an error. */
   }

   /*  "All glyphs not assigned to a class fall into class 0". (OpenType spec) */
   return 0;
}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x58(%rsp)
movl %esi, 0x54(%rsp)
movq 0x58(%rsp), %rdi
callq 0x3cf00
movw %ax, 0x52(%rsp)
movzwl 0x52(%rsp), %eax
movl %eax, 0xc(%rsp)
subl $0x1, %eax
je 0x80cae
jmp 0x80c9c
movl 0xc(%rsp), %eax
subl $0x2, %eax
je 0x80d30
jmp 0x80e12
movq 0x58(%rsp), %rdi
addq $0x2, %rdi
callq 0x3cf00
movw %ax, 0x50(%rsp)
movq 0x58(%rsp), %rdi
addq $0x4, %rdi
callq 0x3cf00
movw %ax, 0x4e(%rsp)
movq 0x58(%rsp), %rax
addq $0x6, %rax
movq %rax, 0x40(%rsp)
movl 0x54(%rsp), %eax
movzwl 0x50(%rsp), %ecx
cmpl %ecx, %eax
jl 0x80d2b
movl 0x54(%rsp), %eax
movzwl 0x50(%rsp), %ecx
movzwl 0x4e(%rsp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x80d2b
movq 0x40(%rsp), %rdi
movl 0x54(%rsp), %eax
movzwl 0x50(%rsp), %ecx
subl %ecx, %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x3cf00
movzwl %ax, %eax
movl %eax, 0x64(%rsp)
jmp 0x80e24
jmp 0x80e1c
movq 0x58(%rsp), %rdi
addq $0x2, %rdi
callq 0x3cf00
movw %ax, 0x3e(%rsp)
movq 0x58(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movzwl 0x3e(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x2c(%rsp), %eax
cmpl 0x28(%rsp), %eax
jg 0x80e10
movl 0x2c(%rsp), %eax
addl 0x28(%rsp), %eax
sarl %eax
movl %eax, 0x24(%rsp)
movq 0x30(%rsp), %rax
imull $0x6, 0x24(%rsp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rdi
callq 0x3cf00
movzwl %ax, %eax
movl %eax, 0x20(%rsp)
movq 0x10(%rsp), %rdi
addq $0x2, %rdi
callq 0x3cf00
movzwl %ax, %eax
movl %eax, 0x1c(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x20(%rsp), %eax
jge 0x80ddb
movl 0x24(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x80e0b
movl 0x18(%rsp), %eax
cmpl 0x1c(%rsp), %eax
jle 0x80df2
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x80e09
movq 0x10(%rsp), %rdi
addq $0x4, %rdi
callq 0x3cf00
movzwl %ax, %eax
movl %eax, 0x64(%rsp)
jmp 0x80e24
jmp 0x80e0b
jmp 0x80d6d
jmp 0x80e1c
movl $0xffffffff, 0x64(%rsp) # imm = 0xFFFFFFFF
jmp 0x80e24
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
addq $0x68, %rsp
retq
nopl (%rax)