// File: /workspace/github_c_makefile_star2_O0/mcaimi[P]st/x.c
// Function: xdrawcursor
void
xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
{
  Color drawcol;

  /* remove the old cursor */
  if (selected(ox, oy))
    og.mode ^= ATTR_REVERSE;
  xdrawglyph(og, ox, oy);

  if (IS_SET(MODE_HIDE))
    return;

  /*
   * Select the right color for the right mode.
   */
  g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE|ATTR_BOXDRAW;

  if (IS_SET(MODE_REVERSE)) {
    g.mode |= ATTR_REVERSE;
    g.bg = defaultfg;
    if (selected(cx, cy)) {
      drawcol = dc.col[defaultcs];
      g.fg = defaultrcs;
    } else {
      drawcol = dc.col[defaultrcs];
      g.fg = defaultcs;
    }
  } else {
    if (selected(cx, cy)) {
      g.fg = defaultfg;
      g.bg = defaultrcs;
    } else {
      g.fg = defaultbg;
      g.bg = defaultcs;
    }
    drawcol = dc.col[g.bg];
  }

  /* draw the new one */
  if (IS_SET(MODE_FOCUSED)) {
    switch (win.cursor) {
    case 7: /* st extension: snowman (U+2603) */
      g.u = 0x2603;
      /* FALLTHROUGH */
    case 0: /* Blinking Block */
    case 1: /* Blinking Block (Default) */
    case 2: /* Steady Block */
      xdrawglyph(g, cx, cy);
      break;
    case 3: /* Blinking Underline */
    case 4: /* Steady Underline */
      XftDrawRect(xw.draw, &drawcol,
          win.dynborder_w + cx * win.cw,
          win.dynborder_h + (cy + 1) * win.ch - \
            cursorthickness,
          win.cw, cursorthickness);
      break;
    case 5: /* Blinking bar */
    case 6: /* Steady bar */
      XftDrawRect(xw.draw, &drawcol,
          win.dynborder_w + cx * win.cw,
          win.dynborder_h + cy * win.ch,
          cursorthickness, win.ch);
      break;
    }
  } else {
    XftDrawRect(xw.draw, &drawcol,
        win.dynborder_w + cx * win.cw,
        win.dynborder_h + cy * win.ch,
        win.cw - 1, 1);
    XftDrawRect(xw.draw, &drawcol,
        win.dynborder_w + cx * win.cw,
        win.dynborder_h + cy * win.ch,
        1, win.ch - 1);
    XftDrawRect(xw.draw, &drawcol,
        win.dynborder_w + (cx + 1) * win.cw - 1,
        win.dynborder_h + cy * win.ch,
        1, win.ch - 1);
    XftDrawRect(xw.draw, &drawcol,
        win.dynborder_w + cx * win.cw,
        win.dynborder_h + (cy + 1) * win.ch - 1,
        win.cw, 1);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x8(%rbp)
movl %edi, -0x14(%rbp)
movl %esi, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %esi
callq 0x73b0
cmpl $0x0, %eax
je 0xea35
movq -0x38(%rbp), %rax
movzwl 0x4(%rax), %ecx
xorl $0x20, %ecx
movw %cx, 0x4(%rax)
movq -0x38(%rbp), %rax
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movq (%rax), %rdi
movq 0x8(%rax), %rsi
callq 0xed70
movl 0x1609f(%rip), %eax     # 0x24af0
andl $0x80, %eax
cmpl $0x0, %eax
je 0xea60
jmp 0xed5e
movzwl -0xc(%rbp), %eax
andl $0xa8d, %eax            # imm = 0xA8D
movw %ax, -0xc(%rbp)
movl 0x1607d(%rip), %eax     # 0x24af0
andl $0x20, %eax
cmpl $0x0, %eax
je 0xeaff
movzwl -0xc(%rbp), %eax
orl $0x20, %eax
movw %ax, -0xc(%rbp)
movl 0x10d50(%rip), %eax     # 0x1f7e0
movl %eax, -0x4(%rbp)
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x73b0
cmpl $0x0, %eax
je 0xead1
movq 0x15de6(%rip), %rax     # 0x24890
movl 0x10d34(%rip), %ecx     # 0x1f7e4
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl 0x10d1c(%rip), %eax     # 0x1f7e8
movl %eax, -0x8(%rbp)
jmp 0xeafd
movq 0x15db8(%rip), %rax     # 0x24890
movl 0x10d0a(%rip), %ecx     # 0x1f7e8
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl 0x10cea(%rip), %eax     # 0x1f7e4
movl %eax, -0x8(%rbp)
jmp 0xeb55
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x73b0
cmpl $0x0, %eax
je 0xeb23
movl 0x10ccb(%rip), %eax     # 0x1f7e0
movl %eax, -0x8(%rbp)
movl 0x10cca(%rip), %eax     # 0x1f7e8
movl %eax, -0x4(%rbp)
jmp 0xeb35
movl 0x10cb3(%rip), %eax     # 0x1f7dc
movl %eax, -0x8(%rbp)
movl 0x10cb2(%rip), %eax     # 0x1f7e4
movl %eax, -0x4(%rbp)
movq 0x15d54(%rip), %rax     # 0x24890
movl -0x4(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl 0x15f95(%rip), %eax     # 0x24af0
andl $0x2, %eax
cmpl $0x0, %eax
je 0xec42
movl 0x15f87(%rip), %eax     # 0x24af4
movq %rax, -0x40(%rbp)
subq $0x7, %rax
ja 0xec3d
movq -0x40(%rbp), %rax
leaq 0x827e(%rip), %rcx      # 0x16e04
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x2603, -0x10(%rbp)    # imm = 0x2603
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xed70
jmp 0xec3d
movq 0x15e73(%rip), %rdi     # 0x24a28
movl 0x15f25(%rip), %edx     # 0x24ae0
movl -0x14(%rbp), %eax
imull 0x15f23(%rip), %eax     # 0x24ae8
addl %eax, %edx
movl 0x15f0f(%rip), %ecx     # 0x24adc
movl -0x18(%rbp), %eax
addl $0x1, %eax
imull 0x15f0a(%rip), %eax     # 0x24ae4
addl %eax, %ecx
subl 0x11992(%rip), %ecx     # 0x20574
movl 0x15eff(%rip), %r8d     # 0x24ae8
movl 0x11984(%rip), %r9d     # 0x20574
leaq -0x30(%rbp), %rsi
callq 0x6420
jmp 0xec3d
movq 0x15e26(%rip), %rdi     # 0x24a28
movl 0x15ed8(%rip), %edx     # 0x24ae0
movl -0x14(%rbp), %eax
imull 0x15ed6(%rip), %eax     # 0x24ae8
addl %eax, %edx
movl 0x15ec2(%rip), %ecx     # 0x24adc
movl -0x18(%rbp), %eax
imull 0x15ec0(%rip), %eax     # 0x24ae4
addl %eax, %ecx
movl 0x11947(%rip), %r8d     # 0x20574
movl 0x15eb0(%rip), %r9d     # 0x24ae4
leaq -0x30(%rbp), %rsi
callq 0x6420
jmp 0xed5e
movq 0x15ddf(%rip), %rdi     # 0x24a28
movl 0x15e91(%rip), %edx     # 0x24ae0
movl -0x14(%rbp), %eax
imull 0x15e8f(%rip), %eax     # 0x24ae8
addl %eax, %edx
movl 0x15e7b(%rip), %ecx     # 0x24adc
movl -0x18(%rbp), %eax
imull 0x15e79(%rip), %eax     # 0x24ae4
addl %eax, %ecx
movl 0x15e74(%rip), %r8d     # 0x24ae8
subl $0x1, %r8d
leaq -0x30(%rbp), %rsi
movl $0x1, %r9d
callq 0x6420
movq 0x15d9a(%rip), %rdi     # 0x24a28
movl 0x15e4c(%rip), %edx     # 0x24ae0
movl -0x14(%rbp), %eax
imull 0x15e4a(%rip), %eax     # 0x24ae8
addl %eax, %edx
movl 0x15e36(%rip), %ecx     # 0x24adc
movl -0x18(%rbp), %eax
imull 0x15e34(%rip), %eax     # 0x24ae4
addl %eax, %ecx
movl 0x15e2b(%rip), %r9d     # 0x24ae4
subl $0x1, %r9d
leaq -0x30(%rbp), %rsi
movl $0x1, %r8d
callq 0x6420
movq 0x15d55(%rip), %rdi     # 0x24a28
movl 0x15e07(%rip), %edx     # 0x24ae0
movl -0x14(%rbp), %eax
addl $0x1, %eax
imull 0x15e02(%rip), %eax     # 0x24ae8
addl %eax, %edx
subl $0x1, %edx
movl 0x15deb(%rip), %ecx     # 0x24adc
movl -0x18(%rbp), %eax
imull 0x15de9(%rip), %eax     # 0x24ae4
addl %eax, %ecx
movl 0x15de0(%rip), %r9d     # 0x24ae4
subl $0x1, %r9d
leaq -0x30(%rbp), %rsi
movl $0x1, %r8d
callq 0x6420
movq 0x15d0a(%rip), %rdi     # 0x24a28
movl 0x15dbc(%rip), %edx     # 0x24ae0
movl -0x14(%rbp), %eax
imull 0x15dba(%rip), %eax     # 0x24ae8
addl %eax, %edx
movl 0x15da6(%rip), %ecx     # 0x24adc
movl -0x18(%rbp), %eax
addl $0x1, %eax
imull 0x15da1(%rip), %eax     # 0x24ae4
addl %eax, %ecx
subl $0x1, %ecx
movl 0x15d99(%rip), %r8d     # 0x24ae8
leaq -0x30(%rbp), %rsi
movl $0x1, %r9d
callq 0x6420
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)