// File: /workspace/github_c_makefile_star2_O0/ggerganov[P]font-rasterizer/./stb_truetype.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));

            classDefTable = classDef1ValueArray + 2 * glyphCount;
        } 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);
            }

            classDefTable = classRangeRecords + 6 * classRangeCount;
        } break;

        default: {
            // There are no other cases.
            STBTT_assert(0);
        } break;
    }

    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4990
movw %ax, -0x16(%rbp)
movzwl -0x16(%rbp), %eax
movl %eax, -0x5c(%rbp)
subl $0x1, %eax
je 0x110cb
jmp 0x110ba
movl -0x5c(%rbp), %eax
subl $0x2, %eax
je 0x11152
jmp 0x1122a
movq -0x10(%rbp), %rdi
addq $0x2, %rdi
callq 0x4990
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x4, %rdi
callq 0x4990
movw %ax, -0x1a(%rbp)
movq -0x10(%rbp), %rax
addq $0x6, %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
movzwl -0x18(%rbp), %ecx
cmpl %ecx, %eax
jl 0x11139
movl -0x14(%rbp), %eax
movzwl -0x18(%rbp), %ecx
movzwl -0x1a(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x11139
movq -0x28(%rbp), %rdi
movl -0x14(%rbp), %eax
movzwl -0x18(%rbp), %ecx
subl %ecx, %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x4(%rbp)
jmp 0x11250
movq -0x28(%rbp), %rax
movzwl -0x1a(%rbp), %ecx
shll %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x11249
movq -0x10(%rbp), %rdi
addq $0x2, %rdi
callq 0x4990
movw %ax, -0x2a(%rbp)
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movzwl -0x2a(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x50(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x40(%rbp), %eax
jg 0x11213
movl -0x3c(%rbp), %eax
addl -0x40(%rbp), %eax
sarl %eax
movl %eax, -0x44(%rbp)
movq -0x38(%rbp), %rax
imull $0x6, -0x44(%rbp), %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x48(%rbp)
movq -0x58(%rbp), %rdi
addq $0x2, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x4c(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x48(%rbp), %eax
jge 0x111e4
movl -0x44(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x1120e
movl -0x50(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jle 0x111f7
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1120c
movq -0x58(%rbp), %rdi
addq $0x4, %rdi
callq 0x4990
movzwl %ax, %eax
movl %eax, -0x4(%rbp)
jmp 0x11250
jmp 0x1120e
jmp 0x11186
movq -0x38(%rbp), %rax
movzwl -0x2a(%rbp), %ecx
imull $0x6, %ecx, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x11249
leaq 0x5684(%rip), %rdi      # 0x168b5
leaq 0x557f(%rip), %rsi      # 0x167b7
movl $0x95f, %edx            # imm = 0x95F
leaq 0x5e3e(%rip), %rcx      # 0x17082
callq 0x10a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)