// File: /workspace/github_c_makefile_star2_O3/mcaimi[P]st/x.c
// Function: xdrawglyphfontspecs
void
xdrawglyphfontspecs(const XftGlyphFontSpec *specs, Glyph base, int len, int x, int y)
{
  int charlen = len * ((base.mode & ATTR_WIDE) ? 2 : 1);
  int winx = win.dynborder_w + x * win.cw, winy = win.dynborder_h + y * win.ch,
      width = charlen * win.cw;
  Color *fg, *bg, *temp, revfg, revbg, truefg, truebg;
  XRenderColor colfg, colbg;
  XRectangle r;

  /* Fallback on color display for attributes not supported by the font */
  if (base.mode & ATTR_ITALIC && base.mode & ATTR_BOLD) {
    if (dc.ibfont.badslant || dc.ibfont.badweight)
      base.fg = defaultattr;
  } else if ((base.mode & ATTR_ITALIC && dc.ifont.badslant) ||
      (base.mode & ATTR_BOLD && dc.bfont.badweight)) {
    base.fg = defaultattr;
  }

  if (IS_TRUECOL(base.fg)) {
    colfg.alpha = 0xffff;
    colfg.red = TRUERED(base.fg);
    colfg.green = TRUEGREEN(base.fg);
    colfg.blue = TRUEBLUE(base.fg);
    XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &truefg);
    fg = &truefg;
  } else {
    fg = &dc.col[base.fg];
  }

  if (IS_TRUECOL(base.bg)) {
    colbg.alpha = 0xffff;
    colbg.green = TRUEGREEN(base.bg);
    colbg.red = TRUERED(base.bg);
    colbg.blue = TRUEBLUE(base.bg);
    XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &truebg);
    bg = &truebg;
  } else {
    bg = &dc.col[base.bg];
  }

  /* Change basic system colors [0-7] to bright system colors [8-15] */
  if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7))
    fg = &dc.col[base.fg + 8];

  if (IS_SET(MODE_REVERSE)) {
    if (fg == &dc.col[defaultfg]) {
      fg = &dc.col[defaultbg];
    } else {
      colfg.red = ~fg->color.red;
      colfg.green = ~fg->color.green;
      colfg.blue = ~fg->color.blue;
      colfg.alpha = fg->color.alpha;
      XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg,
          &revfg);
      fg = &revfg;
    }

    if (bg == &dc.col[defaultbg]) {
      bg = &dc.col[defaultfg];
    } else {
      colbg.red = ~bg->color.red;
      colbg.green = ~bg->color.green;
      colbg.blue = ~bg->color.blue;
      colbg.alpha = bg->color.alpha;
      XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg,
          &revbg);
      bg = &revbg;
    }
  }

  if ((base.mode & ATTR_BOLD_FAINT) == ATTR_FAINT) {
    colfg.red = fg->color.red / 2;
    colfg.green = fg->color.green / 2;
    colfg.blue = fg->color.blue / 2;
    colfg.alpha = fg->color.alpha;
    XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg);
    fg = &revfg;
  }

  if (base.mode & ATTR_REVERSE) {
    if (bg == fg) {
      bg = &dc.col[defaultfg];
      fg = &dc.col[defaultbg];
    } else {
      temp = fg;
      fg = bg;
      bg = temp;
    }
  }

  if (base.mode & ATTR_BLINK && win.mode & MODE_BLINK)
    fg = bg;

  if (base.mode & ATTR_INVISIBLE)
    fg = bg;

  /* Intelligent cleaning up of the borders. */
  if (x == 0) {
    xclear(0, (y == 0)? 0 : winy, win.dynborder_h,
      winy + win.ch +
      ((winy + win.ch >= win.dynborder_h + win.th)? win.h : 0));
  }
  if (winx + width >= win.dynborder_w + win.tw) {
    xclear(winx + width, (y == 0)? 0 : winy, win.w,
      ((winy + win.ch >= win.dynborder_w + win.th)? win.h : (winy + win.ch)));
  }
  if (y == 0)
    xclear(winx, 0, winx + width, win.dynborder_w);
  if (winy + win.ch >= win.dynborder_h + win.th)
    xclear(winx, winy + win.ch, winx + width, win.h);

  /* Clean up the region we want to draw to. */
  XftDrawRect(xw.draw, bg, winx, winy, width, win.ch);

  /* Set the clip region because Xft is sometimes dirty. */
  r.x = 0;
  r.y = 0;
  r.height = win.ch;
  r.width = width;
  XftDrawSetClipRectangles(xw.draw, winx, winy, &r, 1);

  if (base.mode & ATTR_BOXDRAW) {
    drawboxes(winx, winy, width / len, win.ch, fg, bg, specs, len);
  } else {
    /* Render the glyphs. */
    XftDrawGlyphFontSpec(xw.draw, fg, specs, len);
  }

  /* Render underline and strikethrough. */
  if (base.mode & ATTR_UNDERLINE) {
    XftDrawRect(xw.draw, fg, winx, winy + win.cyo + dc.font.ascent * chscale + 1,
        width, 1);
  }

  if (base.mode & ATTR_STRUCK) {
    XftDrawRect(xw.draw, fg, winx, winy + win.cyo + 2 * dc.font.ascent * chscale / 3,
        width, 1);
  }

  /* Reset clip to none. */
  XftDrawSetClip(xw.draw, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %ecx, %eax
movq %rdx, %r14
movq %rsi, %rcx
movq %rdi, 0x20(%rsp)
movq %rsi, %rdx
shrq $0x20, %rdx
shrq $0x29, %rcx
andb $0x1, %cl
movq %rax, 0x28(%rsp)
shll %cl, %eax
movl %eax, 0x18(%rsp)
movl 0x13828(%rip), %ebx     # 0x20d2c
movl %ebx, %ecx
movl %r8d, 0x1c(%rsp)
imull %r8d, %ecx
addl 0x1380f(%rip), %ecx     # 0x20d24
movl 0x1380c(%rip), %r15d    # 0x20d28
movl %r9d, 0xc(%rsp)
imull %r9d, %r15d
addl 0x137f4(%rip), %r15d    # 0x20d20
movl %r14d, %ebp
movl %edx, %eax
notl %eax
testb $0x5, %al
movq %rcx, 0x30(%rsp)
movq %rdx, 0x10(%rsp)
jne 0xd561
movl 0x13655(%rip), %eax     # 0x20b9c
orl 0x1364b(%rip), %eax     # 0x20b98
movl $0xb, %eax
cmovel %ebp, %eax
movl %eax, %ebp
btl $0x18, %ebp
jb 0xd596
movl %ebp, %eax
jmp 0xd584
movl $0xb, %eax
testb $0x4, %dl
je 0xd574
cmpl $0x0, 0x135ee(%rip)     # 0x20b60
jne 0xd584
testb $0x1, 0x10(%rsp)
je 0xd557
cmpl $0x0, 0x135aa(%rip)     # 0x20b2c
je 0xd557
movl %eax, %r12d
shlq $0x4, %r12
addq 0x1353e(%rip), %r12     # 0x20ad0
movl %eax, %ebp
jmp 0xd5e1
leaq 0x40(%rsp), %rcx
movw $0xffff, 0x6(%rcx)      # imm = 0xFFFF
movl %ebp, %eax
shrl $0x8, %eax
movl $0xff00, %edx           # imm = 0xFF00
andl %edx, %eax
movw %ax, (%rcx)
andl %ebp, %edx
movw %dx, 0x2(%rcx)
movl %ebp, %eax
shll $0x8, %eax
movw %ax, 0x4(%rcx)
movq 0x13602(%rip), %rdi     # 0x20bc8
movq 0x136a3(%rip), %rsi     # 0x20c70
movq 0x135fc(%rip), %rdx     # 0x20bd0
leaq 0x78(%rsp), %r12
movq %r12, %r8
callq 0x6790
movq %r14, %r13
shrq $0x20, %r13
btq $0x38, %r14
movq %rbx, 0x38(%rsp)
jb 0xd604
movq 0x134d5(%rip), %rax     # 0x20ad0
shlq $0x4, %r13
addq %rax, %r13
jmp 0xd65a
leaq 0x48(%rsp), %rcx
movw $0xffff, 0x6(%rcx)      # imm = 0xFFFF
movl $0xff00, %eax           # imm = 0xFF00
movl %r13d, %edx
andl %eax, %edx
movw %dx, 0x2(%rcx)
shrq $0x28, %r14
andl %eax, %r14d
movw %r14w, (%rcx)
shll $0x8, %r13d
movw %r13w, 0x4(%rcx)
movq 0x13590(%rip), %rdi     # 0x20bc8
movq 0x13631(%rip), %rsi     # 0x20c70
movq 0x1358a(%rip), %rdx     # 0x20bd0
leaq 0x68(%rsp), %r13
movq %r13, %r8
callq 0x6790
movq 0x13476(%rip), %rax     # 0x20ad0
movq 0x10(%rsp), %rcx
movl %ecx, %ebx
andl $0x3, %ebx
cmpl $0x1, %ebx
sete %dl
cmpl $0x8, %ebp
setb %cl
andb %dl, %cl
orl $0x8, %ebp
shlq $0x4, %rbp
addq %rax, %rbp
testb %cl, %cl
movq %r12, %r14
cmovneq %rbp, %r14
testb $0x20, 0x136a8(%rip)    # 0x20d34
jne 0xd69d
movq 0x30(%rsp), %r12
movq 0x10(%rsp), %rbp
jmp 0xd793
movl 0xff0d(%rip), %edx      # 0x1d5b0
shlq $0x4, %rdx
addq %rax, %rdx
cmpq %rdx, %r14
je 0xd716
testb %cl, %cl
cmovneq %rbp, %r12
movl 0x8(%r12), %eax
notl %eax
leaq 0x40(%rsp), %rcx
movw %ax, (%rcx)
movzwl 0xa(%r12), %eax
notl %eax
movw %ax, 0x2(%rcx)
movl 0xc(%r12), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r12), %eax
movw %ax, 0x6(%rcx)
movq 0x134dc(%rip), %rdi     # 0x20bc8
movq 0x1357d(%rip), %rsi     # 0x20c70
movq 0x134d6(%rip), %rdx     # 0x20bd0
leaq 0x50(%rsp), %r14
movq %r14, %r8
callq 0x6790
movq 0x133c2(%rip), %rax     # 0x20ad0
movl 0xfe98(%rip), %ecx      # 0x1d5ac
jmp 0xd726
movl 0xfe90(%rip), %ecx      # 0x1d5ac
movq %rcx, %r14
shlq $0x4, %r14
addq %rax, %r14
movq 0x10(%rsp), %rbp
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
movq 0x30(%rsp), %r12
je 0xd783
movl 0x8(%r13), %eax
notl %eax
leaq 0x48(%rsp), %rcx
movl %eax, (%rcx)
movl 0xc(%r13), %eax
notl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r13), %eax
movw %ax, 0x6(%rcx)
movq 0x13465(%rip), %rdi     # 0x20bc8
movq 0x13506(%rip), %rsi     # 0x20c70
movq 0x1345f(%rip), %rdx     # 0x20bd0
leaq 0x88(%rsp), %r13
movq %r13, %r8
callq 0x6790
jmp 0xd793
movl 0xfe27(%rip), %ecx      # 0x1d5b0
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r13
cmpl $0x2, %ebx
jne 0xd7e2
movq 0x8(%r14), %xmm0
psrlw $0x1, %xmm0
leaq 0x40(%rsp), %rcx
movd %xmm0, (%rcx)
movzwl 0xc(%r14), %eax
shrl %eax
movw %ax, 0x4(%rcx)
movzwl 0xe(%r14), %eax
movw %ax, 0x6(%rcx)
movq 0x13401(%rip), %rdi     # 0x20bc8
movq 0x134a2(%rip), %rsi     # 0x20c70
movq 0x133fb(%rip), %rdx     # 0x20bd0
leaq 0x50(%rsp), %r14
movq %r14, %r8
callq 0x6790
movq 0x38(%rsp), %rbx
testb $0x20, %bpl
jne 0xd7f5
movq %r14, %rcx
movq %r13, %r14
jmp 0xd81f
movq %r13, %rcx
cmpq %r14, %r13
jne 0xd81f
movq 0x132cc(%rip), %rax     # 0x20ad0
movl 0xfda5(%rip), %r14d     # 0x1d5b0
shlq $0x4, %r14
addq %rax, %r14
movl 0xfd94(%rip), %ecx      # 0x1d5ac
shlq $0x4, %rcx
addq %rax, %rcx
imull 0x18(%rsp), %ebx
movl 0x1350a(%rip), %eax     # 0x20d34
btl $0xb, %eax
movq %r14, %r13
cmovaeq %rcx, %r13
testb $0x10, %bpl
cmoveq %rcx, %r13
testb $0x40, %bpl
cmovneq %r14, %r13
cmpl $0x0, 0x1c(%rsp)
jne 0xd8b7
movl 0xc(%rsp), %edx
testl %edx, %edx
movl %r15d, %ecx
cmovel %edx, %ecx
movl 0x134c1(%rip), %r8d     # 0x20d20
movl 0x134c2(%rip), %r9d     # 0x20d28
addl %r15d, %r9d
movl 0x134a5(%rip), %esi     # 0x20d14
addl %r8d, %esi
movl $0x0, %edx
cmpl %esi, %r9d
jl 0xd882
movl 0x1349a(%rip), %edx     # 0x20d1c
movq 0x133df(%rip), %rdi     # 0x20c68
testb $0x20, %al
leaq 0xfd1e(%rip), %rax      # 0x1d5b0
leaq 0xfd13(%rip), %rsi      # 0x1d5ac
cmovneq %rax, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0x13226(%rip), %rsi     # 0x20ad0
subl %ecx, %r9d
addl %edx, %r9d
xorl %edx, %edx
callq 0x6420
leal (%r12,%rbx), %edx
movl 0x13463(%rip), %eax     # 0x20d24
movl 0x13449(%rip), %ecx     # 0x20d10
addl %eax, %ecx
cmpl %ecx, %edx
jl 0xd934
movl 0xc(%rsp), %esi
testl %esi, %esi
movl %r15d, %ecx
cmovel %esi, %ecx
movl 0x13438(%rip), %r8d     # 0x20d18
movl 0x13441(%rip), %r9d     # 0x20d28
addl %r15d, %r9d
addl 0x13424(%rip), %eax     # 0x20d14
cmpl %eax, %r9d
jl 0xd8fc
movl 0x13420(%rip), %r9d     # 0x20d1c
movq 0x13365(%rip), %rdi     # 0x20c68
testb $0x20, 0x1342a(%rip)    # 0x20d34
leaq 0xfc9f(%rip), %rax      # 0x1d5b0
leaq 0xfc94(%rip), %rsi      # 0x1d5ac
cmovneq %rax, %rsi
movl (%rsi), %esi
shlq $0x4, %rsi
addq 0x131a7(%rip), %rsi     # 0x20ad0
subl %edx, %r8d
subl %ecx, %r9d
callq 0x6420
cmpl $0x0, 0xc(%rsp)
jne 0xd97c
movl 0x133e2(%rip), %r9d     # 0x20d24
movq 0x1331f(%rip), %rdi     # 0x20c68
testb $0x20, 0x133e4(%rip)    # 0x20d34
leaq 0xfc59(%rip), %rax      # 0x1d5b0
leaq 0xfc4e(%rip), %rcx      # 0x1d5ac
cmovneq %rax, %rcx
movl (%rcx), %esi
shlq $0x4, %rsi
addq 0x13161(%rip), %rsi     # 0x20ad0
movl %r12d, %edx
xorl %ecx, %ecx
movl %ebx, %r8d
callq 0x6420
movl 0x133a5(%rip), %r9d     # 0x20d28
leal (%r9,%r15), %ecx
movl 0x13387(%rip), %eax     # 0x20d14
addl 0x1338d(%rip), %eax     # 0x20d20
cmpl %eax, %ecx
jl 0xd9e0
movl 0x1337e(%rip), %r9d     # 0x20d1c
movq 0x132c3(%rip), %rdi     # 0x20c68
testb $0x20, 0x13388(%rip)    # 0x20d34
leaq 0xfbfd(%rip), %rax      # 0x1d5b0
leaq 0xfbf2(%rip), %rdx      # 0x1d5ac
cmovneq %rax, %rdx
movl (%rdx), %esi
shlq $0x4, %rsi
addq 0x13105(%rip), %rsi     # 0x20ad0
subl %ecx, %r9d
movl %r12d, %edx
movl %ebx, %r8d
callq 0x6420
movl 0x13348(%rip), %r9d     # 0x20d28
movq 0x13281(%rip), %rdi     # 0x20c68
movq %r14, %rsi
movl %r12d, %edx
movl %r15d, %ecx
movl %ebx, %r8d
callq 0x6420
leaq 0x60(%rsp), %rcx
movl $0x0, (%rcx)
movzwl 0x1331e(%rip), %eax     # 0x20d28
movw %ax, 0x6(%rcx)
movw %bx, 0x4(%rcx)
movq 0x1324f(%rip), %rdi     # 0x20c68
movl %r12d, %esi
movl %r15d, %edx
movl $0x1, %r8d
callq 0x66b0
btl $0xb, %ebp
jb 0xda4b
movq 0x13231(%rip), %rdi     # 0x20c68
movq %r13, %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x63d0
jmp 0xda79
movl %ebx, %eax
cltd
movq 0x28(%rsp), %r10
idivl %r10d
movl 0x132cc(%rip), %ecx     # 0x20d28
movl %r12d, %edi
movl %r15d, %esi
movl %eax, %edx
movq %r13, %r8
movq %r14, %r9
pushq %r10
pushq 0x28(%rsp)
callq 0x10ee3
addq $0x10, %rsp
testb $0x8, %bpl
je 0xdac7
movl 0x132ab(%rip), %eax     # 0x20d30
addl %r15d, %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl 0x13054(%rip), %xmm1 # 0x20ae8
movq 0x131cd(%rip), %rdi     # 0x20c68
mulss 0x1038d(%rip), %xmm1    # 0x1de30
addss %xmm0, %xmm1
addss 0x9201(%rip), %xmm1     # 0x16cb0
cvttss2si %xmm1, %ecx
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %r8d
movl $0x1, %r9d
callq 0x6420
testb %bpl, %bpl
jns 0xdb1d
addl 0x1325d(%rip), %r15d    # 0x20d30
xorps %xmm0, %xmm0
cvtsi2ss %r15d, %xmm0
movl 0x13007(%rip), %eax     # 0x20ae8
addl %eax, %eax
xorps %xmm1, %xmm1
cvtsi2ss %eax, %xmm1
mulss 0x1033e(%rip), %xmm1    # 0x1de30
divss 0x91ba(%rip), %xmm1     # 0x16cb4
movq 0x13167(%rip), %rdi     # 0x20c68
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movq %r13, %rsi
movl %r12d, %edx
movl %ebx, %r8d
movl $0x1, %r9d
callq 0x6420
movq 0x13144(%rip), %rdi     # 0x20c68
xorl %esi, %esi
callq 0x6670
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq