// File: /workspace/github_c_makefile_star2_O0/ggerganov[P]font-rasterizer/./stb_truetype.h
// Function: stbtt__CompareUTF8toUTF16_bigendian_prefix
static stbtt_int32 stbtt__CompareUTF8toUTF16_bigendian_prefix(stbtt_uint8 *s1, stbtt_int32 len1, stbtt_uint8 *s2, stbtt_int32 len2) 
{
   stbtt_int32 i=0;

   // convert utf16 to utf8 and compare the results while converting
   while (len2) {
      stbtt_uint16 ch = s2[0]*256 + s2[1];
      if (ch < 0x80) {
         if (i >= len1) return -1;
         if (s1[i++] != ch) return -1;
      } else if (ch < 0x800) {
         if (i+1 >= len1) return -1;
         if (s1[i++] != 0xc0 + (ch >> 6)) return -1;
         if (s1[i++] != 0x80 + (ch & 0x3f)) return -1;
      } else if (ch >= 0xd800 && ch < 0xdc00) {
         stbtt_uint32 c;
         stbtt_uint16 ch2 = s2[2]*256 + s2[3];
         if (i+3 >= len1) return -1;
         c = ((ch - 0xd800) << 10) + (ch2 - 0xdc00) + 0x10000;
         if (s1[i++] != 0xf0 + (c >> 18)) return -1;
         if (s1[i++] != 0x80 + ((c >> 12) & 0x3f)) return -1;
         if (s1[i++] != 0x80 + ((c >>  6) & 0x3f)) return -1;
         if (s1[i++] != 0x80 + ((c      ) & 0x3f)) return -1;
         s2 += 2; // plus another 2 below
         len2 -= 2;
      } else if (ch >= 0xdc00 && ch < 0xe000) {
         return -1;
      } else {
         if (i+2 >= len1) return -1;
         if (s1[i++] != 0xe0 + (ch >> 12)) return -1;
         if (s1[i++] != 0x80 + ((ch >> 6) & 0x3f)) return -1;
         if (s1[i++] != 0x80 + ((ch     ) & 0x3f)) return -1;
      }
      s2 += 2;
      len2 -= 2;
   }
   return i;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x144c1
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x2a(%rbp)
movzwl -0x2a(%rbp), %eax
cmpl $0x80, %eax
jge 0x141e9
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jl 0x141ba
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movzwl -0x2a(%rbp), %ecx
cmpl %ecx, %eax
je 0x141e4
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
jmp 0x144a7
movzwl -0x2a(%rbp), %eax
cmpl $0x800, %eax            # imm = 0x800
jge 0x1427a
movl -0x28(%rbp), %eax
addl $0x1, %eax
cmpl -0x14(%rbp), %eax
jl 0x1420f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movzwl -0x2a(%rbp), %ecx
sarl $0x6, %ecx
addl $0xc0, %ecx
cmpl %ecx, %eax
je 0x14242
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movzwl -0x2a(%rbp), %ecx
andl $0x3f, %ecx
addl $0x80, %ecx
cmpl %ecx, %eax
je 0x14275
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
jmp 0x144a5
movzwl -0x2a(%rbp), %eax
cmpl $0xd800, %eax           # imm = 0xD800
jl 0x143d0
movzwl -0x2a(%rbp), %eax
cmpl $0xdc00, %eax           # imm = 0xDC00
jge 0x143d0
movq -0x20(%rbp), %rax
movzbl 0x2(%rax), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0x32(%rbp)
movl -0x28(%rbp), %eax
addl $0x3, %eax
cmpl -0x14(%rbp), %eax
jl 0x142c8
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movzwl -0x2a(%rbp), %eax
subl $0xd800, %eax           # imm = 0xD800
shll $0xa, %eax
movzwl -0x32(%rbp), %ecx
subl $0xdc00, %ecx           # imm = 0xDC00
addl %ecx, %eax
addl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl -0x30(%rbp), %ecx
shrl $0x12, %ecx
addl $0xf0, %ecx
cmpl %ecx, %eax
je 0x1431a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl -0x30(%rbp), %ecx
shrl $0xc, %ecx
andl $0x3f, %ecx
addl $0x80, %ecx
cmpl %ecx, %eax
je 0x1434f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl -0x30(%rbp), %ecx
shrl $0x6, %ecx
andl $0x3f, %ecx
addl $0x80, %ecx
cmpl %ecx, %eax
je 0x14384
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl -0x30(%rbp), %ecx
andl $0x3f, %ecx
addl $0x80, %ecx
cmpl %ecx, %eax
je 0x143b6
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x144a3
movzwl -0x2a(%rbp), %eax
cmpl $0xdc00, %eax           # imm = 0xDC00
jl 0x143f2
movzwl -0x2a(%rbp), %eax
cmpl $0xe000, %eax           # imm = 0xE000
jge 0x143f2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movl -0x28(%rbp), %eax
addl $0x2, %eax
cmpl -0x14(%rbp), %eax
jl 0x14409
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movzwl -0x2a(%rbp), %ecx
sarl $0xc, %ecx
addl $0xe0, %ecx
cmpl %ecx, %eax
je 0x1443c
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movzwl -0x2a(%rbp), %ecx
sarl $0x6, %ecx
andl $0x3f, %ecx
addl $0x80, %ecx
cmpl %ecx, %eax
je 0x1446f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x28(%rbp)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movzwl -0x2a(%rbp), %ecx
andl $0x3f, %ecx
addl $0x80, %ecx
cmpl %ecx, %eax
je 0x1449f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x144c7
jmp 0x144a1
jmp 0x144a3
jmp 0x144a5
jmp 0x144a7
movq -0x20(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x20(%rbp)
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x14179
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq