// File: Ciaxur[P]yagb-emu/include/imgui/imstb_truetype.h
// Function: stbtt__GetGlyfOffset(stbtt_fontinfo const*, int)
static int stbtt__GetGlyfOffset(const stbtt_fontinfo *info, int glyph_index)
{
   int g1,g2;

   STBTT_assert(!info->cff.size);

   if (glyph_index >= info->numGlyphs) return -1; // glyph index out of range
   if (info->indexToLocFormat >= 2)    return -1; // unknown index->glyph map format

   if (info->indexToLocFormat == 0) {
      g1 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2) * 2;
      g2 = info->glyf + ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2;
   } else {
      g1 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4);
      g2 = info->glyf + ttULONG (info->data + info->loca + glyph_index * 4 + 4);
   }

   return g1==g2 ? -1 : g1; // if length is 0, return -1
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x4c(%rax)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x11fbd2
jmp 0x11fbd4
jmp 0x11fbf3
leaq 0x6b695(%rip), %rdi     # 0x18b270
leaq 0x6b408(%rip), %rsi     # 0x18afea
movl $0x624, %edx            # imm = 0x624
leaq 0x6b692(%rip), %rcx     # 0x18b280
callq 0xd180
jmp 0x11fbf5
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x14(%rcx), %eax
jl 0x11fc0d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x11fd3b
movq -0x10(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jl 0x11fc23
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x11fd3b
movq -0x10(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x11fcab
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rdi
movl -0x14(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
callq 0x11f5b0
movw %ax, %cx
movl -0x24(%rbp), %eax
movzwl %cx, %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rdi
movl -0x14(%rbp), %eax
shll %eax
cltq
addq %rax, %rdi
addq $0x2, %rdi
callq 0x11f5b0
movw %ax, %cx
movl -0x20(%rbp), %eax
movzwl %cx, %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
jmp 0x11fd1d
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rdi
movl -0x14(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
callq 0x11e7b0
movl %eax, %ecx
movl -0x2c(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movslq 0x18(%rax), %rax
addq %rax, %rdi
movl -0x14(%rbp), %eax
shll $0x2, %eax
cltq
addq %rax, %rdi
addq $0x4, %rdi
callq 0x11e7b0
movl %eax, %ecx
movl -0x28(%rbp), %eax
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jne 0x11fd2f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x30(%rbp)
jmp 0x11fd35
movl -0x18(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)