// File: /workspace/github_c_makefile_star2_O1/jaimecgomezz[P]st/x.c
// Function: xmakeglyphfontspecs
int xmakeglyphfontspecs(XftGlyphFontSpec *specs, const Glyph *glyphs, int len,
                        int x, int y) {
  // >>>>>>>>>>>>>>>>>>>> anysize
  // ==================== anysize
  float winx = borderpx + x * win.cw, winy = borderpx + y * win.ch, xp, yp;
  // ==================== anysize
  // <<<<<<<<<<<<<<<<<<<< anysize
  ushort mode, prevmode = USHRT_MAX;
  Font *font = &dc.font;
  int frcflags = FRC_NORMAL;
  float runewidth = win.cw;
  Rune rune;
  FT_UInt glyphidx;
  FcResult fcres;
  FcPattern *fcpattern, *fontpattern;
  FcFontSet *fcsets[] = {NULL};
  FcCharSet *fccharset;
  int i, f, numspecs = 0;

  // >>>>>>>>>>>>>>>>>>>> vertcenter
  // ==================== vertcenter
  for (i = 0, xp = winx, yp = winy + font->ascent; i < len; ++i) {
  // ==================== vertcenter
  // <<<<<<<<<<<<<<<<<<<< vertcenter
    /* Fetch rune and mode for current glyph. */
    // >>>>>>>>>>>>>>>>>>>> vim-browse
    // ==================== vim-browse
    rune = glyphs[i].u;
    mode = glyphs[i].mode;
    // ==================== vim-browse
    // <<<<<<<<<<<<<<<<<<<< vim-browse

    /* Skip dummy wide-character spacing. */
    // >>>>>>>>>>>>>>>>>>>> ligatures
    // ==================== ligatures
    if (mode == ATTR_WDUMMY)
    // ==================== ligatures
    // <<<<<<<<<<<<<<<<<<<< ligatures
      continue;

    /* Determine font for glyph if different from previous glyph. */
    if (prevmode != mode) {
      prevmode = mode;
      font = &dc.font;
      frcflags = FRC_NORMAL;
      runewidth = win.cw * ((mode & ATTR_WIDE) ? 2.0f : 1.0f);
      if ((mode & ATTR_ITALIC) && (mode & ATTR_BOLD)) {
        font = &dc.ibfont;
        frcflags = FRC_ITALICBOLD;
      } else if (mode & ATTR_ITALIC) {
        font = &dc.ifont;
        frcflags = FRC_ITALIC;
      } else if (mode & ATTR_BOLD) {
        font = &dc.bfont;
        frcflags = FRC_BOLD;
      }
      // >>>>>>>>>>>>>>>>>>>> vertcenter
      // ==================== vertcenter
      yp = winy + font->ascent;
      // ==================== vertcenter
      // <<<<<<<<<<<<<<<<<<<< vertcenter
    }

    /* Lookup character index with default font. */
    glyphidx = XftCharIndex(xw.dpy, font->match, rune);
    if (glyphidx) {
      specs[numspecs].font = font->match;
      specs[numspecs].glyph = glyphidx;
      specs[numspecs].x = (short)xp;
      specs[numspecs].y = (short)yp;
      xp += runewidth;
      numspecs++;
      continue;
    }

    /* Fallback on font cache, search the font cache for match. */
    for (f = 0; f < frclen; f++) {
      glyphidx = XftCharIndex(xw.dpy, frc[f].font, rune);
      /* Everything correct. */
      if (glyphidx && frc[f].flags == frcflags)
        break;
      /* We got a default font for a not found glyph. */
      if (!glyphidx && frc[f].flags == frcflags && frc[f].unicodep == rune) {
        break;
      }
    }

    /* Nothing was found. Use fontconfig to find matching font. */
    if (f >= frclen) {
      if (!font->set)
        font->set = FcFontSort(0, font->pattern, 1, 0, &fcres);
      fcsets[0] = font->set;

      /*
       * Nothing was found in the cache. Now use
       * some dozen of Fontconfig calls to get the
       * font for one single character.
       *
       * Xft and fontconfig are design failures.
       */
      fcpattern = FcPatternDuplicate(font->pattern);
      fccharset = FcCharSetCreate();

      FcCharSetAddChar(fccharset, rune);
      FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset);
      FcPatternAddBool(fcpattern, FC_SCALABLE, 1);

      FcConfigSubstitute(0, fcpattern, FcMatchPattern);
      FcDefaultSubstitute(fcpattern);

      fontpattern = FcFontSetMatch(0, fcsets, 1, fcpattern, &fcres);

      /* Allocate memory for the new cache entry. */
      if (frclen >= frccap) {
        frccap += 16;
        frc = xrealloc(frc, frccap * sizeof(Fontcache));
      }

      frc[frclen].font = XftFontOpenPattern(xw.dpy, fontpattern);
      if (!frc[frclen].font)
        die("XftFontOpenPattern failed seeking fallback font: %s\n",
            strerror(errno));
      frc[frclen].flags = frcflags;
      frc[frclen].unicodep = rune;

      glyphidx = XftCharIndex(xw.dpy, frc[frclen].font, rune);

      f = frclen;
      frclen++;

      FcPatternDestroy(fcpattern);
      FcCharSetDestroy(fccharset);
    }

    specs[numspecs].font = frc[f].font;
    specs[numspecs].glyph = glyphidx;
    specs[numspecs].x = (short)xp;
    specs[numspecs].y = (short)yp;
    xp += runewidth;
    numspecs++;
  }

  // >>>>>>>>>>>>>>>>>>>> ligatures
  // ==================== ligatures
  // ==================== ligatures
  // <<<<<<<<<<<<<<<<<<<< ligatures

  return numspecs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl 0xd866(%rip), %eax      # 0x17db4
imull 0xd85a(%rip), %r8d      # 0x17db0
movq $0x0, 0x38(%rsp)
testl %edx, %edx
jle 0xa95a
movq %rsi, %r14
addl $0x2, %r8d
cvtsi2ss %r8d, %xmm0
cvtsi2ssl 0xd645(%rip), %xmm1 # 0x17bc0
movss %xmm0, 0x18(%rsp)
addss %xmm0, %xmm1
movss %xmm1, 0x4(%rsp)
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x8(%rsp)
imull %eax, %ecx
addl $0x2, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %ecx, %xmm0
movl %edx, %esi
leaq 0xd60a(%rip), %r10      # 0x17bb8
movw $0xffff, 0x2(%rsp)      # imm = 0xFFFF
xorl %ebx, %ebx
xorl %eax, %eax
xorl %ebp, %ebp
movq %r14, 0x40(%rsp)
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq %rbx, %r9
shlq $0x4, %r9
movzwl 0x4(%r14,%r9), %ecx
cmpl $0x400, %ecx            # imm = 0x400
je 0xa944
movq %rax, 0x30(%rsp)
movss %xmm0, 0xc(%rsp)
cmpw %cx, 0x2(%rsp)
je 0xa682
xorps %xmm0, %xmm0
cvtsi2ssl 0xd7b0(%rip), %xmm0 # 0x17db4
xorl %edx, %edx
btl $0x9, %ecx
setae %dl
leaq 0x4434(%rip), %rsi      # 0xea48
mulss (%rsi,%rdx,4), %xmm0
movss %xmm0, 0x8(%rsp)
movl %ecx, %edx
andl $0x1, %edx
movl %ecx, %esi
notl %esi
xorl %edi, %edi
testb $0x5, %sil
sete %dil
leaq 0xd5ef(%rip), %rsi      # 0x17c28
leaq 0xd620(%rip), %rax      # 0x17c60
cmoveq %rax, %rsi
testl %edx, %edx
leaq 0xd5a3(%rip), %r10      # 0x17bf0
leaq 0xd564(%rip), %r8       # 0x17bb8
cmoveq %r8, %r10
addl %edx, %edx
testb $0x4, %cl
cmovneq %rsi, %r10
leal 0x1(%rdi,%rdi), %ebp
xorps %xmm0, %xmm0
cvtsi2ssl 0x8(%r10), %xmm0
cmovel %edx, %ebp
addss 0x18(%rsp), %xmm0
movss %xmm0, 0x4(%rsp)
movw %cx, 0x2(%rsp)
movl %ebp, %r13d
movq %r14, %rbp
movl (%r14,%r9), %r12d
movq 0xd60d(%rip), %rdi      # 0x17ca0
movq 0x20(%r10), %rsi
movl %r12d, %edx
movq %r10, %r14
callq 0x53d0
testl %eax, %eax
je 0xa6d0
movl %eax, %r15d
leaq 0x20(%r14), %rcx
movss 0xc(%rsp), %xmm0
movq 0x20(%rsp), %rsi
movq 0x30(%rsp), %rax
movq %r14, %r10
movq %rbp, %r14
movl %r13d, %ebp
movq 0x28(%rsp), %rdi
jmp 0xa911
movl %r12d, %eax
movq %r14, 0x10(%rsp)
cmpl $0x0, 0xd761(%rip)      # 0x17e40
jle 0xa74b
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %r13d, %ebp
movl %eax, %r13d
movq 0xd5ac(%rip), %rdi      # 0x17ca0
movq 0xd74d(%rip), %rax      # 0x17e48
movq (%rax,%r14), %rsi
movl %r13d, %edx
callq 0x53d0
movl %eax, %r15d
movq 0xd737(%rip), %rax      # 0x17e48
testl %r15d, %r15d
je 0xa71f
cmpl %ebp, 0x8(%rax,%r14)
jne 0xa731
jmp 0xa744
cmpl %ebp, 0x8(%rax,%r14)
jne 0xa731
cmpl %r13d, 0xc(%rax,%r14)
je 0xa952
incq %r12
movslq 0xd705(%rip), %rax      # 0x17e40
addq $0x10, %r14
cmpq %rax, %r12
jl 0xa6ed
movq 0x40(%rsp), %r14
jmp 0xa75a
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rbp, %r14
movl %r13d, %ebp
movl %eax, %r13d
cmpl 0xd6df(%rip), %r12d     # 0x17e40
movq 0x10(%rsp), %r10
jl 0xa8ee
cmpq $0x0, 0x28(%r10)
jne 0xa793
movq 0x30(%r10), %rsi
xorl %edi, %edi
movl $0x1, %edx
xorl %ecx, %ecx
leaq 0x1c(%rsp), %r8
callq 0x5560
movq 0x10(%rsp), %r10
movq %rax, 0x28(%r10)
movq 0x28(%r10), %rax
movq %rax, 0x38(%rsp)
movq 0x30(%r10), %rdi
callq 0x50e0
movq %rax, %r15
callq 0x5240
movq %rax, %r12
movq %rax, %rdi
movl %r13d, %esi
callq 0x5040
movq %r15, %rdi
leaq 0x4479(%rip), %rsi      # 0xec3e
movq %r12, 0x48(%rsp)
movq %r12, %rdx
callq 0x58f0
movq %r15, %rdi
leaq 0x446a(%rip), %rsi      # 0xec46
movl $0x1, %edx
callq 0x55d0
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5780
movq %r15, %rdi
callq 0x57d0
xorl %edi, %edi
leaq 0x38(%rsp), %rsi
movl $0x1, %edx
movq %r15, 0x50(%rsp)
movq %r15, %rcx
leaq 0x1c(%rsp), %r8
callq 0x5660
movq %rax, %r15
movslq 0xd62e(%rip), %rsi      # 0x17e50
cmpl %esi, 0xd618(%rip)      # 0x17e40
jl 0xa84b
addq $0x10, %rsi
movl %esi, 0xd61c(%rip)      # 0x17e50
movq 0xd60d(%rip), %rdi      # 0x17e48
shlq $0x4, %rsi
callq 0x5f00
movq %rax, 0xd5fd(%rip)      # 0x17e48
movq 0xd44e(%rip), %rdi      # 0x17ca0
movq %r15, %rsi
callq 0x5740
movq 0xd5e7(%rip), %rcx      # 0x17e48
movslq 0xd5d8(%rip), %rdx      # 0x17e40
shlq $0x4, %rdx
movq %rax, (%rcx,%rdx)
testq %rax, %rax
jne 0xa892
callq 0x5570
movl (%rax), %edi
callq 0x5430
leaq 0x43c7(%rip), %rdi      # 0xec4f
movq %rax, %rsi
xorl %eax, %eax
callq 0x5e66
movq 0xd5af(%rip), %rax      # 0x17e48
movslq 0xd5a0(%rip), %rcx      # 0x17e40
shlq $0x4, %rcx
movl %ebp, 0x8(%rax,%rcx)
movl %r13d, 0xc(%rax,%rcx)
movq 0xd3ec(%rip), %rdi      # 0x17ca0
movq (%rax,%rcx), %rsi
movl %r13d, %edx
callq 0x53d0
movl %eax, %r15d
movl 0xd576(%rip), %r12d     # 0x17e40
leal 0x1(%r12), %eax
movl %eax, 0xd56b(%rip)      # 0x17e40
movq 0x50(%rsp), %rdi
callq 0x5050
movq 0x48(%rsp), %rdi
callq 0x5680
movq 0x10(%rsp), %r10
movslq %r12d, %rcx
shlq $0x4, %rcx
addq 0xd54c(%rip), %rcx      # 0x17e48
movq 0x28(%rsp), %rdi
movss 0xc(%rsp), %xmm0
movq 0x20(%rsp), %rsi
movq 0x30(%rsp), %rax
movq (%rcx), %rdx
cltq
movq %rax, %rcx
shlq $0x4, %rcx
movq %rdx, (%rdi,%rcx)
movl %r15d, 0x8(%rdi,%rcx)
cvttss2si %xmm0, %r8d
cvttss2si 0x4(%rsp), %edx
movw %r8w, 0xc(%rdi,%rcx)
movw %dx, 0xe(%rdi,%rcx)
addss 0x8(%rsp), %xmm0
incl %eax
incq %rbx
cmpq %rsi, %rbx
jne 0xa5ca
jmp 0xa95c
xorl %r15d, %r15d
jmp 0xa744
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq