// File: /workspace/github_c_makefile_star2_O2/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 $0x78, %rsp
movl 0xcf1e(%rip), %eax      # 0x16da4
imull %eax, %ecx
addl $0x2, %ecx
cvtsi2ss %ecx, %xmm0
movaps %xmm0, 0x60(%rsp)
movl %edx, %r15d
imull 0xcf00(%rip), %r8d      # 0x16da0
addl $0x2, %r8d
cvtsi2ss %r8d, %xmm0
movq %rsi, %r12
cvtsi2ss %eax, %xmm1
movss %xmm1, 0x4(%rsp)
leaq 0x28(%rsp), %rax
andq $0x0, (%rax)
movq %rdi, 0x48(%rsp)
cvtsi2ssl 0xcce4(%rip), %xmm1 # 0x16bb0
xorl %eax, %eax
testl %edx, %edx
cmovlel %eax, %r15d
movss %xmm0, 0x8(%rsp)
addss %xmm0, %xmm1
movaps %xmm1, 0x50(%rsp)
movw $0xffff, 0x2(%rsp)      # imm = 0xFFFF
leaq 0xccb7(%rip), %rbx      # 0x16ba8
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %eax, %eax
movq %r15, 0x40(%rsp)
movq %rsi, 0x10(%rsp)
cmpq %r15, %r14
je 0xa240
movq %r14, %r9
shlq $0x4, %r9
movzwl 0x4(%r12,%r9), %ecx
cmpl $0x400, %ecx            # imm = 0x400
je 0xa238
movq %rax, 0x18(%rsp)
cmpw %cx, 0x2(%rsp)
je 0x9fb5
cvtsi2ssl 0xce68(%rip), %xmm0 # 0x16da4
xorl %edx, %edx
btl $0x9, %ecx
setae %dl
leaq 0x3af4(%rip), %rsi      # 0xda40
mulss (%rsi,%rdx,4), %xmm0
movss %xmm0, 0x4(%rsp)
movl %ecx, %edx
andl $0x1, %edx
movl %ecx, %esi
notl %esi
xorl %edi, %edi
testb $0x5, %sil
sete %dil
leaq 0xcca7(%rip), %rsi      # 0x16c18
leaq 0xccd8(%rip), %r8       # 0x16c50
cmoveq %r8, %rsi
testl %edx, %edx
leaq 0xcc5b(%rip), %rbx      # 0x16be0
leaq 0xcc1c(%rip), %r8       # 0x16ba8
cmoveq %r8, %rbx
addl %edx, %edx
testb $0x4, %cl
cmovneq %rsi, %rbx
leal 0x1(%rdi,%rdi), %ebp
cvtsi2ssl 0x8(%rbx), %xmm0
cmovel %edx, %ebp
addss 0x8(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movw %cx, 0x2(%rsp)
movl (%r12,%r9), %r13d
movq 0xccd0(%rip), %rdi      # 0x16c90
movq 0x20(%rbx), %rsi
movl %r13d, %edx
callq 0x53d0
movq %rbx, %rcx
testl %eax, %eax
movq %rbx, 0x20(%rsp)
je 0x9fe3
movl %eax, %ebx
addq $0x20, %rcx
jmp 0xa1ec
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %ebx, %ebx
movslq 0xce3e(%rip), %rax      # 0x16e30
cmpq %rax, %r15
jge 0xa040
movq 0xcc92(%rip), %rdi      # 0x16c90
movq 0xce33(%rip), %rax      # 0x16e38
movq (%rax,%r12), %rsi
movl %r13d, %edx
callq 0x53d0
movl %eax, %ebx
movq 0xce1e(%rip), %rax      # 0x16e38
testl %ebx, %ebx
je 0xa027
cmpl %ebp, 0x8(%rax,%r12)
jne 0xa035
jmp 0xa040
cmpl %ebp, 0x8(%rax,%r12)
jne 0xa035
cmpl %r13d, 0xc(%rax,%r12)
je 0xa03e
incq %r15
addq $0x10, %r12
jmp 0x9feb
xorl %ebx, %ebx
cmpl %r15d, 0xcde9(%rip)     # 0x16e30
jle 0xa053
movq 0x10(%rsp), %r12
jmp 0xa1d9
movq 0x20(%rsp), %rbx
movq 0x28(%rbx), %rax
testq %rax, %rax
movq 0x10(%rsp), %r12
jne 0xa07f
movq 0x30(%rbx), %rsi
xorl %edi, %edi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
leaq 0xc(%rsp), %r8
callq 0x5560
movq %rax, 0x28(%rbx)
movq %rax, 0x28(%rsp)
movq 0x30(%rbx), %rdi
callq 0x50e0
movq %rax, %r15
callq 0x5240
movq %rax, %rbx
movq %rax, %rdi
movl %r13d, %esi
callq 0x5040
movq %r15, %rdi
leaq 0x3b7d(%rip), %rsi      # 0xdc2a
movq %rbx, 0x30(%rsp)
movq %rbx, %rdx
callq 0x58e0
movq %r15, %rdi
leaq 0x3b6e(%rip), %rsi      # 0xdc32
pushq $0x1
popq %rbx
movl %ebx, %edx
callq 0x55d0
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5770
movq %r15, %rdi
callq 0x57c0
xorl %edi, %edi
leaq 0x28(%rsp), %rsi
movl %ebx, %edx
movq %r15, 0x38(%rsp)
movq %r15, %rcx
leaq 0xc(%rsp), %r8
callq 0x5650
movq %rax, %rbx
movslq 0xcd39(%rip), %rsi      # 0x16e40
cmpl %esi, 0xcd23(%rip)      # 0x16e30
jl 0xa130
addq $0x10, %rsi
movl %esi, 0xcd27(%rip)      # 0x16e40
movq 0xcd18(%rip), %rdi      # 0x16e38
shlq $0x4, %rsi
callq 0x5abe
movq %rax, 0xcd08(%rip)      # 0x16e38
movq 0xcb59(%rip), %rdi      # 0x16c90
movq %rbx, %rsi
callq 0x5730
movq 0xccf2(%rip), %rcx      # 0x16e38
movslq 0xcce3(%rip), %rdx      # 0x16e30
movq %rdx, %rsi
shlq $0x4, %rsi
movq %rax, (%rcx,%rsi)
testq %rax, %rax
jne 0xa193
callq 0x5570
movl (%rax), %edi
callq 0x5430
leaq 0x3acb(%rip), %rdi      # 0xdc3b
movq %rax, %rsi
xorl %eax, %eax
callq 0x5a26
movq 0xccb7(%rip), %rcx      # 0x16e38
movslq 0xcca8(%rip), %rdx      # 0x16e30
movq %rdx, %rax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
shlq $0x4, %rdx
movl %ebp, 0x8(%rcx,%rdx)
movl %r13d, 0xc(%rcx,%rdx)
movq 0xcae9(%rip), %rdi      # 0x16c90
movq %rax, %rsi
movl %r13d, %edx
callq 0x53d0
movl %eax, %ebx
movl 0xcc75(%rip), %r15d     # 0x16e30
leal 0x1(%r15), %eax
movl %eax, 0xcc6b(%rip)      # 0x16e30
movq 0x38(%rsp), %rdi
callq 0x5050
movq 0x30(%rsp), %rdi
callq 0x5670
movslq %r15d, %rcx
shlq $0x4, %rcx
addq 0xcc51(%rip), %rcx      # 0x16e38
movq 0x40(%rsp), %r15
movq 0x18(%rsp), %rax
movq (%rcx), %rsi
cltq
movq %rax, %rcx
shlq $0x4, %rcx
movq 0x48(%rsp), %rdx
movq %rsi, (%rdx,%rcx)
movl %ebx, 0x8(%rdx,%rcx)
movaps 0x60(%rsp), %xmm1
movaps %xmm1, %xmm0
unpcklps 0x50(%rsp), %xmm0       # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
cvttps2dq %xmm0, %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0xc(%rdx,%rcx)
addss 0x4(%rsp), %xmm1
movaps %xmm1, 0x60(%rsp)
incl %eax
movq 0x20(%rsp), %rbx
incq %r14
jmp 0x9f02
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq