// File: /workspace/github_c_makefile_star2_O2/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 0x14803(%rip), %ebx     # 0x20d2c
movl %ebx, %eax
movl %r8d, 0x1c(%rsp)
imull %r8d, %eax
addl 0x147ea(%rip), %eax     # 0x20d24
movq %rax, 0x30(%rsp)
movl 0x147e2(%rip), %r15d    # 0x20d28
movl %r9d, 0xc(%rsp)
imull %r9d, %r15d
addl 0x147ca(%rip), %r15d    # 0x20d20
movl %r14d, %ebp
movl %edx, %eax
notl %eax
testb $0x5, %al
movq %rdx, 0x10(%rsp)
jne 0xc584
movl 0x14630(%rip), %eax     # 0x20b9c
orl 0x14626(%rip), %eax     # 0x20b98
pushq $0xb
popq %rax
cmovel %ebp, %eax
movl %eax, %ebp
btl $0x18, %ebp
jb 0xc5b5
movl %ebp, %eax
jmp 0xc5a3
pushq $0xb
popq %rax
testb $0x4, %dl
je 0xc595
cmpl $0x0, 0x145cd(%rip)     # 0x20b60
jne 0xc5a3
testb $0x1, %dl
je 0xc57a
cmpl $0x0, 0x1458b(%rip)     # 0x20b2c
je 0xc57a
movl %eax, %r12d
shlq $0x4, %r12
addq 0x1451f(%rip), %r12     # 0x20ad0
movl %eax, %ebp
jmp 0xc5ff
leaq 0x40(%rsp), %rcx
orw $-0x1, 0x6(%rcx)
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 0x145e4(%rip), %rdi     # 0x20bc8
movq 0x14685(%rip), %rsi     # 0x20c70
movq 0x145de(%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 0xc622
movq 0x144b7(%rip), %rax     # 0x20ad0
shlq $0x4, %r13
addq %rax, %r13
jmp 0xc677
leaq 0x48(%rsp), %rcx
orw $-0x1, 0x6(%rcx)
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 0x14573(%rip), %rdi     # 0x20bc8
movq 0x14614(%rip), %rsi     # 0x20c70
movq 0x1456d(%rip), %rdx     # 0x20bd0
leaq 0x68(%rsp), %r13
movq %r13, %r8
callq 0x6790
movq 0x14459(%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, 0x1468b(%rip)    # 0x20d34
jne 0xc6ba
movq 0x30(%rsp), %rbp
movq 0x10(%rsp), %r12
jmp 0xc7b0
movl 0x10ef0(%rip), %edx     # 0x1d5b0
shlq $0x4, %rdx
addq %rax, %rdx
cmpq %rdx, %r14
je 0xc733
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 0x144bf(%rip), %rdi     # 0x20bc8
movq 0x14560(%rip), %rsi     # 0x20c70
movq 0x144b9(%rip), %rdx     # 0x20bd0
leaq 0x50(%rsp), %r14
movq %r14, %r8
callq 0x6790
movq 0x143a5(%rip), %rax     # 0x20ad0
movl 0x10e7b(%rip), %ecx     # 0x1d5ac
jmp 0xc743
movl 0x10e73(%rip), %ecx     # 0x1d5ac
movq %rcx, %r14
shlq $0x4, %r14
addq %rax, %r14
movq 0x10(%rsp), %r12
shlq $0x4, %rcx
addq %rax, %rcx
cmpq %rcx, %r13
movq 0x30(%rsp), %rbp
je 0xc7a0
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 0x14448(%rip), %rdi     # 0x20bc8
movq 0x144e9(%rip), %rsi     # 0x20c70
movq 0x14442(%rip), %rdx     # 0x20bd0
leaq 0x88(%rsp), %r13
movq %r13, %r8
callq 0x6790
jmp 0xc7b0
movl 0x10e0a(%rip), %ecx     # 0x1d5b0
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, %r13
cmpl $0x2, %ebx
jne 0xc7ff
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 0x143e4(%rip), %rdi     # 0x20bc8
movq 0x14485(%rip), %rsi     # 0x20c70
movq 0x143de(%rip), %rdx     # 0x20bd0
leaq 0x50(%rsp), %r14
movq %r14, %r8
callq 0x6790
movq 0x38(%rsp), %rbx
testb $0x20, %r12b
jne 0xc812
movq %r14, %rax
movq %r13, %r14
jmp 0xc83c
movq %r13, %rax
cmpq %r14, %r13
jne 0xc83c
movq 0x142af(%rip), %rcx     # 0x20ad0
movl 0x10d88(%rip), %r14d    # 0x1d5b0
shlq $0x4, %r14
addq %rcx, %r14
movl 0x10d77(%rip), %eax     # 0x1d5ac
shlq $0x4, %rax
addq %rcx, %rax
imull 0x18(%rsp), %ebx
btl $0xb, 0x144eb(%rip)     # 0x20d34
movq %r14, %r13
cmovaeq %rax, %r13
testb $0x10, %r12b
cmoveq %rax, %r13
testb $0x40, %r12b
cmovneq %r14, %r13
cmpl $0x0, 0x1c(%rsp)
jne 0xc8a2
movl 0xc(%rsp), %eax
testl %eax, %eax
movl %r15d, %esi
cmovel %eax, %esi
movl 0x144a7(%rip), %edx     # 0x20d20
movl 0x144a9(%rip), %eax     # 0x20d28
addl %r15d, %eax
movl 0x1448c(%rip), %edi     # 0x20d14
addl %edx, %edi
movl $0x0, %ecx
cmpl %edi, %eax
jl 0xc899
movl 0x14483(%rip), %ecx     # 0x20d1c
addl %eax, %ecx
xorl %edi, %edi
callq 0xe676
leal (%rbx,%rbp), %r12d
movl 0x14478(%rip), %eax     # 0x20d24
movl 0x1445e(%rip), %ecx     # 0x20d10
addl %eax, %ecx
cmpl %ecx, %r12d
jl 0xc8ec
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
movl %r15d, %esi
cmovel %ecx, %esi
movl 0x1444d(%rip), %edx     # 0x20d18
movl 0x14457(%rip), %ecx     # 0x20d28
addl %r15d, %ecx
addl 0x1443a(%rip), %eax     # 0x20d14
cmpl %eax, %ecx
jl 0xc8e4
movl 0x14438(%rip), %ecx     # 0x20d1c
movl %r12d, %edi
callq 0xe676
cmpl $0x0, 0xc(%rsp)
jne 0xc905
movl 0x1442b(%rip), %ecx     # 0x20d24
movl %ebp, %edi
xorl %esi, %esi
movl %r12d, %edx
callq 0xe676
movl 0x1441c(%rip), %r9d     # 0x20d28
leal (%r9,%r15), %esi
movl 0x143fe(%rip), %eax     # 0x20d14
addl 0x14404(%rip), %eax     # 0x20d20
cmpl %eax, %esi
jl 0xc937
movl 0x143f6(%rip), %ecx     # 0x20d1c
movl %ebp, %edi
movl %r12d, %edx
callq 0xe676
movl 0x143f1(%rip), %r9d     # 0x20d28
movq 0x1432a(%rip), %rdi     # 0x20c68
movq %r14, %rsi
movl %ebp, %edx
movl %r15d, %ecx
movl %ebx, %r8d
callq 0x6420
leaq 0x60(%rsp), %rcx
andl $0x0, (%rcx)
movzwl 0x143cb(%rip), %eax     # 0x20d28
movw %ax, 0x6(%rcx)
movw %bx, 0x4(%rcx)
movq 0x142fc(%rip), %rdi     # 0x20c68
pushq $0x1
popq %r8
movl %ebp, %esi
movl %r15d, %edx
callq 0x66b0
movq 0x10(%rsp), %r12
btl $0xb, %r12d
jb 0xc9a1
movq 0x142db(%rip), %rdi     # 0x20c68
movq %r13, %rsi
movq 0x20(%rsp), %rdx
movq 0x28(%rsp), %rcx
callq 0x63d0
jmp 0xc9cc
movl %ebx, %eax
cltd
movq 0x28(%rsp), %r10
idivl %r10d
movl 0x14376(%rip), %ecx     # 0x20d28
movl %ebp, %edi
movl %r15d, %esi
movl %eax, %edx
movq %r13, %r8
movq %r14, %r9
pushq %r10
pushq 0x28(%rsp)
callq 0xfcd2
popq %rax
popq %rcx
testb $0x8, %r12b
je 0xca17
movl 0x14358(%rip), %eax     # 0x20d30
addl %r15d, %eax
cvtsi2ss %eax, %xmm0
cvtsi2ssl 0x14101(%rip), %xmm1 # 0x20ae8
movq 0x1427a(%rip), %rdi     # 0x20c68
mulss 0x1143a(%rip), %xmm1    # 0x1de30
addss %xmm0, %xmm1
addss 0x927e(%rip), %xmm1     # 0x15c80
cvttss2si %xmm1, %ecx
pushq $0x1
popq %r9
movq %r13, %rsi
movl %ebp, %edx
movl %ebx, %r8d
callq 0x6420
testb %r12b, %r12b
jns 0xca64
addl 0x1430d(%rip), %r15d    # 0x20d30
cvtsi2ss %r15d, %xmm0
movl 0x140ba(%rip), %eax     # 0x20ae8
addl %eax, %eax
cvtsi2ss %eax, %xmm1
mulss 0x113f4(%rip), %xmm1    # 0x1de30
divss 0x9240(%rip), %xmm1     # 0x15c84
movq 0x1421d(%rip), %rdi     # 0x20c68
addss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
pushq $0x1
popq %r9
movq %r13, %rsi
movl %ebp, %edx
movl %ebx, %r8d
callq 0x6420
movq 0x141fd(%rip), %rdi     # 0x20c68
xorl %esi, %esi
callq 0x6670
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq