// File: /workspace/github_c_makefile_star2_O3/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 0xd569(%rip), %eax      # 0x17da4
imull 0xd55d(%rip), %r8d      # 0x17da0
movq $0x0, 0x30(%rsp)
testl %edx, %edx
jle 0xac45
movq %rsi, %r14
addl $0x2, %r8d
cvtsi2ss %r8d, %xmm0
cvtsi2ssl 0xd348(%rip), %xmm1 # 0x17bb0
movss %xmm0, 0x10(%rsp)
addss %xmm0, %xmm1
movaps %xmm1, 0x50(%rsp)
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x4(%rsp)
imull %eax, %ecx
addl $0x2, %ecx
xorps %xmm1, %xmm1
cvtsi2ss %ecx, %xmm1
movl %edx, %edx
leaq 0xd30e(%rip), %r10      # 0x17ba8
movw $0xffff, 0x2(%rsp)      # imm = 0xFFFF
xorl %ebx, %ebx
xorl %eax, %eax
xorl %ebp, %ebp
movq %rsi, 0x38(%rsp)
movq %rdi, 0x20(%rsp)
movq %rdx, 0x18(%rsp)
movq %rbx, %r9
shlq $0x4, %r9
movzwl 0x4(%r14,%r9), %ecx
cmpl $0x400, %ecx            # imm = 0x400
je 0xac37
movq %rax, 0x28(%rsp)
movaps %xmm1, 0x60(%rsp)
cmpw %cx, 0x2(%rsp)
je 0xa96c
xorps %xmm0, %xmm0
cvtsi2ssl 0xd4b5(%rip), %xmm0 # 0x17da4
xorl %edx, %edx
btl $0x9, %ecx
setae %dl
leaq 0x4171(%rip), %rsi      # 0xea70
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 0xd2f4(%rip), %rsi      # 0x17c18
leaq 0xd325(%rip), %rax      # 0x17c50
cmoveq %rax, %rsi
testl %edx, %edx
leaq 0xd2a8(%rip), %r10      # 0x17be0
leaq 0xd269(%rip), %r8       # 0x17ba8
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 0x10(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movw %cx, 0x2(%rsp)
movl %ebp, %r13d
movq %r14, %rbp
movl (%r14,%r9), %r12d
movq 0xd313(%rip), %rdi      # 0x17c90
movq 0x20(%r10), %rsi
movl %r12d, %edx
movq %r10, %r14
callq 0x53d0
testl %eax, %eax
je 0xa9b9
movl %eax, %r15d
leaq 0x20(%r14), %rcx
movaps 0x60(%rsp), %xmm1
movq 0x18(%rsp), %rdx
movq 0x28(%rsp), %rax
movq %r14, %r10
movq %rbp, %r14
movl %r13d, %ebp
movq 0x20(%rsp), %rdi
jmp 0xac03
movl %r12d, %ecx
movq %r14, 0x8(%rsp)
movl 0xd469(%rip), %eax      # 0x17e30
testl %eax, %eax
jle 0xaa37
movq 0xd466(%rip), %rax      # 0x17e38
xorl %r14d, %r14d
xorl %r12d, %r12d
movl %r13d, %ebp
movl %ecx, %r13d
movq 0xd2ab(%rip), %rdi      # 0x17c90
movq (%rax,%r14), %rsi
movl %r13d, %edx
callq 0x53d0
movl %eax, %r15d
movq 0xd43d(%rip), %rax      # 0x17e38
testl %r15d, %r15d
je 0xaa09
cmpl %ebp, 0x8(%rax,%r14)
jne 0xaa17
jmp 0xaa2a
cmpl %ebp, 0x8(%rax,%r14)
jne 0xaa17
cmpl %r13d, 0xc(%rax,%r14)
je 0xaa2a
incq %r12
movslq 0xd40f(%rip), %rcx      # 0x17e30
addq $0x10, %r14
cmpq %rcx, %r12
jl 0xa9de
movl 0xd400(%rip), %eax      # 0x17e30
movq 0x38(%rsp), %r14
jmp 0xaa46
xorl %r12d, %r12d
xorl %r15d, %r15d
movq %rbp, %r14
movl %r13d, %ebp
movl %ecx, %r13d
cmpl %eax, %r12d
movq 0x8(%rsp), %r10
jl 0xabe1
movq 0x28(%r10), %rax
testq %rax, %rax
jne 0xaa7d
movq 0x30(%r10), %rsi
xorl %edi, %edi
movl $0x1, %edx
xorl %ecx, %ecx
leaq 0x14(%rsp), %r8
callq 0x5560
movq 0x8(%rsp), %r10
movq %rax, 0x28(%r10)
movq %rax, 0x30(%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 0x41af(%rip), %rsi      # 0xec5a
movq %r12, 0x40(%rsp)
movq %r12, %rdx
callq 0x58e0
movq %r15, %rdi
leaq 0x41a0(%rip), %rsi      # 0xec62
movl $0x1, %edx
callq 0x55d0
xorl %edi, %edi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5770
movq %r15, %rdi
callq 0x57c0
xorl %edi, %edi
leaq 0x30(%rsp), %rsi
movl $0x1, %edx
movq %r15, 0x48(%rsp)
movq %r15, %rcx
leaq 0x14(%rsp), %r8
callq 0x5650
movq %rax, %r15
movslq 0xd338(%rip), %rsi      # 0x17e40
cmpl %esi, 0xd322(%rip)      # 0x17e30
jl 0xab31
addq $0x10, %rsi
movl %esi, 0xd326(%rip)      # 0x17e40
movq 0xd317(%rip), %rdi      # 0x17e38
shlq $0x4, %rsi
callq 0x5ef0
movq %rax, 0xd307(%rip)      # 0x17e38
movq 0xd158(%rip), %rdi      # 0x17c90
movq %r15, %rsi
callq 0x5730
movq 0xd2f1(%rip), %rcx      # 0x17e38
movslq 0xd2e2(%rip), %rdx      # 0x17e30
movq %rdx, %rsi
shlq $0x4, %rsi
movq %rax, (%rcx,%rsi)
testq %rax, %rax
jne 0xab94
callq 0x5570
movl (%rax), %edi
callq 0x5430
leaq 0x40fa(%rip), %rdi      # 0xec6b
movq %rax, %rsi
xorl %eax, %eax
callq 0x5e56
movq 0xd2b6(%rip), %rcx      # 0x17e38
movslq 0xd2a7(%rip), %rdx      # 0x17e30
movq %rdx, %rax
shlq $0x4, %rax
movq (%rcx,%rax), %rax
shlq $0x4, %rdx
movl %ebp, 0x8(%rcx,%rdx)
movl %r13d, 0xc(%rcx,%rdx)
movq 0xd0e8(%rip), %rdi      # 0x17c90
movq %rax, %rsi
movl %r13d, %edx
callq 0x53d0
movl %eax, %r15d
movl 0xd273(%rip), %r12d     # 0x17e30
leal 0x1(%r12), %eax
movl %eax, 0xd268(%rip)      # 0x17e30
movq 0x48(%rsp), %rdi
callq 0x5050
movq 0x40(%rsp), %rdi
callq 0x5670
movq 0x8(%rsp), %r10
movslq %r12d, %rcx
shlq $0x4, %rcx
addq 0xd249(%rip), %rcx      # 0x17e38
movq 0x20(%rsp), %rdi
movaps 0x60(%rsp), %xmm1
movq 0x18(%rsp), %rdx
movq 0x28(%rsp), %rax
movq (%rcx), %rsi
cltq
movq %rax, %rcx
shlq $0x4, %rcx
movq %rsi, (%rdi,%rcx)
movl %r15d, 0x8(%rdi,%rcx)
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(%rdi,%rcx)
addss 0x4(%rsp), %xmm1
incl %eax
incq %rbx
cmpq %rdx, %rbx
jne 0xa8b6
jmp 0xac47
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq