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

  /* remove the old cursor */
  if (selected(ox, oy))
    // >>>>>>>>>>>>>>>>>>>> selection-colors
    // ==================== selection-colors
    og.mode ^= ATTR_REVERSE;
    // ==================== selection-colors
    // <<<<<<<<<<<<<<<<<<<< selection-colors

  // >>>>>>>>>>>>>>>>>>>> ligatures
  // ==================== ligatures
  xdrawglyph(og, ox, oy);
  // ==================== ligatures
  // <<<<<<<<<<<<<<<<<<<< ligatures

  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;

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

  /* draw the new one */
  if (IS_SET(MODE_FOCUSED)) {
    switch (win.cursor) {
    case 0:         /* Blinking Block */
    case 1:         /* Blinking Block (Default) */
      // >>>>>>>>>>>>>>>>>>>> blinking-cursor
      // ==================== blinking-cursor
      // ==================== blinking-cursor
      // <<<<<<<<<<<<<<<<<<<< blinking-cursor
    case 2:         /* Steady Block */
      xdrawglyph(g, cx, cy);
      break;
    case 3: /* Blinking Underline */
      // >>>>>>>>>>>>>>>>>>>> blinking-cursor
      // ==================== blinking-cursor
      // ==================== blinking-cursor
      // <<<<<<<<<<<<<<<<<<<< blinking-cursor
    case 4: /* Steady Underline */
      XftDrawRect(
        xw.draw,
        &drawcol,
        // >>>>>>>>>>>>>>>>>>>> anysize
        // ==================== anysize
        borderpx + cx * win.cw,
        borderpx + (cy + 1) * win.ch - cursorthickness,
        // ==================== anysize
        // <<<<<<<<<<<<<<<<<<<< anysize
        win.cw,
        cursorthickness
      );
      break;
    case 5: /* Blinking bar */
      // >>>>>>>>>>>>>>>>>>>> blinking-cursor
      // ==================== blinking-cursor
      // ==================== blinking-cursor
      // <<<<<<<<<<<<<<<<<<<< blinking-cursor
    case 6: /* Steady bar */
      XftDrawRect(
        xw.draw,
        &drawcol,
        // >>>>>>>>>>>>>>>>>>>> anysize
        // ==================== anysize
        borderpx + cx * win.cw,
        borderpx + cy * win.ch,
        // ==================== anysize
        // <<<<<<<<<<<<<<<<<<<< anysize
        cursorthickness,
        win.ch
      );
      break;
    // >>>>>>>>>>>>>>>>>>>> blinking-cursor
    // ==================== blinking-cursor
    case 7:         /* st extension */
      g.u = 0x2603; /* snowman (U+2603) */
                    /* FALLTHROUGH */
    // ==================== blinking-cursor
    // <<<<<<<<<<<<<<<<<<<< blinking-cursor
    }
  } else {
    XftDrawRect(
      xw.draw,
      &drawcol,
      // >>>>>>>>>>>>>>>>>>>> anysize
      // ==================== anysize
      borderpx + cx * win.cw,
      borderpx + cy * win.ch,
      // ==================== anysize
      // <<<<<<<<<<<<<<<<<<<< anysize
      win.cw - 1,
      1
    );
    XftDrawRect(
      xw.draw,
      &drawcol,
      // >>>>>>>>>>>>>>>>>>>> anysize
      // ==================== anysize
      borderpx + cx * win.cw,
      borderpx + cy * win.ch,
      // ==================== anysize
      // <<<<<<<<<<<<<<<<<<<< anysize
      1,
      win.ch - 1
    );
    XftDrawRect(
      xw.draw,
      &drawcol,
      // >>>>>>>>>>>>>>>>>>>> anysize
      // ==================== anysize
      borderpx + (cx + 1) * win.cw - 1,
      borderpx + cy * win.ch,
      // ==================== anysize
      // <<<<<<<<<<<<<<<<<<<< anysize
      1,
      win.ch - 1
    );
    XftDrawRect(
      xw.draw,
      &drawcol,
      // >>>>>>>>>>>>>>>>>>>> anysize
      // ==================== anysize
      borderpx + cx * win.cw,
      borderpx + (cy + 1) * win.ch - 1,
      // ==================== anysize
      // <<<<<<<<<<<<<<<<<<<< anysize
      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 0x61d0
cmpl $0x0, %eax
je 0xc125
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 0xc460
movl 0xf277(%rip), %eax      # 0x1b3b8
andl $0x80, %eax
cmpl $0x0, %eax
je 0xc150
jmp 0xc450
movzwl -0xc(%rbp), %eax
andl $0x28d, %eax            # imm = 0x28D
movw %ax, -0xc(%rbp)
movl 0xf255(%rip), %eax      # 0x1b3b8
andl $0x20, %eax
cmpl $0x0, %eax
je 0xc1ef
movzwl -0xc(%rbp), %eax
orl $0x20, %eax
movw %ax, -0xc(%rbp)
movl 0xa58c(%rip), %eax      # 0x1670c
movl %eax, -0x4(%rbp)
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x61d0
cmpl $0x0, %eax
je 0xc1c1
movq 0xf00e(%rip), %rax      # 0x1b1a8
movl 0xad80(%rip), %ecx      # 0x16f20
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl 0xad68(%rip), %eax      # 0x16f24
movl %eax, -0x8(%rbp)
jmp 0xc1ed
movq 0xefe0(%rip), %rax      # 0x1b1a8
movl 0xad56(%rip), %ecx      # 0x16f24
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl 0xad36(%rip), %eax      # 0x16f20
movl %eax, -0x8(%rbp)
jmp 0xc245
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x61d0
cmpl $0x0, %eax
je 0xc213
movl 0xa507(%rip), %eax      # 0x1670c
movl %eax, -0x8(%rbp)
movl 0xad16(%rip), %eax      # 0x16f24
movl %eax, -0x4(%rbp)
jmp 0xc225
movl 0xef83(%rip), %eax      # 0x1b19c
movl %eax, -0x8(%rbp)
movl 0xacfe(%rip), %eax      # 0x16f20
movl %eax, -0x4(%rbp)
movq 0xef7c(%rip), %rax      # 0x1b1a8
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 0xf16d(%rip), %eax      # 0x1b3b8
andl $0x2, %eax
cmpl $0x0, %eax
je 0xc334
movl 0xf15f(%rip), %eax      # 0x1b3bc
movq %rax, -0x40(%rbp)
subq $0x7, %rax
ja 0xc32f
movq -0x40(%rbp), %rax
leaq 0x5a56(%rip), %rcx      # 0x11ccc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x14(%rbp), %edx
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0xc460
jmp 0xc32f
movq 0xf06a(%rip), %rdi      # 0x1b308
movl 0xac84(%rip), %edx      # 0x16f28
movl -0x14(%rbp), %eax
imull 0xf106(%rip), %eax      # 0x1b3b4
addl %eax, %edx
movl 0xac72(%rip), %ecx      # 0x16f28
movl -0x18(%rbp), %eax
addl $0x1, %eax
imull 0xf0ed(%rip), %eax      # 0x1b3b0
addl %eax, %ecx
subl 0xac61(%rip), %ecx      # 0x16f2c
movl 0xf0e2(%rip), %r8d      # 0x1b3b4
movl 0xac53(%rip), %r9d      # 0x16f2c
leaq -0x30(%rbp), %rsi
callq 0x53b0
jmp 0xc32f
movq 0xf01d(%rip), %rdi      # 0x1b308
movl 0xac37(%rip), %edx      # 0x16f28
movl -0x14(%rbp), %eax
imull 0xf0b9(%rip), %eax      # 0x1b3b4
addl %eax, %edx
movl 0xac25(%rip), %ecx      # 0x16f28
movl -0x18(%rbp), %eax
imull 0xf0a3(%rip), %eax      # 0x1b3b0
addl %eax, %ecx
movl 0xac16(%rip), %r8d      # 0x16f2c
movl 0xf093(%rip), %r9d      # 0x1b3b0
leaq -0x30(%rbp), %rsi
callq 0x53b0
jmp 0xc32f
movl $0x2603, -0x10(%rbp)    # imm = 0x2603
jmp 0xc450
movq 0xefcd(%rip), %rdi      # 0x1b308
movl 0xabe7(%rip), %edx      # 0x16f28
movl -0x14(%rbp), %eax
imull 0xf069(%rip), %eax      # 0x1b3b4
addl %eax, %edx
movl 0xabd5(%rip), %ecx      # 0x16f28
movl -0x18(%rbp), %eax
imull 0xf053(%rip), %eax      # 0x1b3b0
addl %eax, %ecx
movl 0xf04e(%rip), %r8d      # 0x1b3b4
subl $0x1, %r8d
leaq -0x30(%rbp), %rsi
movl $0x1, %r9d
callq 0x53b0
movq 0xef88(%rip), %rdi      # 0x1b308
movl 0xaba2(%rip), %edx      # 0x16f28
movl -0x14(%rbp), %eax
imull 0xf024(%rip), %eax      # 0x1b3b4
addl %eax, %edx
movl 0xab90(%rip), %ecx      # 0x16f28
movl -0x18(%rbp), %eax
imull 0xf00e(%rip), %eax      # 0x1b3b0
addl %eax, %ecx
movl 0xf005(%rip), %r9d      # 0x1b3b0
subl $0x1, %r9d
leaq -0x30(%rbp), %rsi
movl $0x1, %r8d
callq 0x53b0
movq 0xef43(%rip), %rdi      # 0x1b308
movl 0xab5d(%rip), %edx      # 0x16f28
movl -0x14(%rbp), %eax
addl $0x1, %eax
imull 0xefdc(%rip), %eax      # 0x1b3b4
addl %eax, %edx
subl $0x1, %edx
movl 0xab45(%rip), %ecx      # 0x16f28
movl -0x18(%rbp), %eax
imull 0xefc3(%rip), %eax      # 0x1b3b0
addl %eax, %ecx
movl 0xefba(%rip), %r9d      # 0x1b3b0
subl $0x1, %r9d
leaq -0x30(%rbp), %rsi
movl $0x1, %r8d
callq 0x53b0
movq 0xeef8(%rip), %rdi      # 0x1b308
movl 0xab12(%rip), %edx      # 0x16f28
movl -0x14(%rbp), %eax
imull 0xef94(%rip), %eax      # 0x1b3b4
addl %eax, %edx
movl 0xab00(%rip), %ecx      # 0x16f28
movl -0x18(%rbp), %eax
addl $0x1, %eax
imull 0xef7b(%rip), %eax      # 0x1b3b0
addl %eax, %ecx
subl $0x1, %ecx
movl 0xef73(%rip), %r8d      # 0x1b3b4
leaq -0x30(%rbp), %rsi
movl $0x1, %r9d
callq 0x53b0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)