// File: /workspace/github_c_makefile_star2_O0/jaimecgomezz[P]st/st.c
// Function: tsetchar
void tsetchar(Rune u, Glyph *attr, int x, int y) {
  static char *vt100_0[62] = {
      /* 0x41 - 0x7e */
      "↑", "↓", "→", "←", "█", "▚", "☃",      /* A - G */
      0,   0,   0,   0,   0,   0,   0,   0,   /* H - O */
      0,   0,   0,   0,   0,   0,   0,   0,   /* P - W */
      0,   0,   0,   0,   0,   0,   0,   " ", /* X - _ */
      "◆", "▒", "␉", "␌", "␍", "␊", "°", "±", /* ` - g */
      "␤", "␋", "┘", "┐", "┌", "└", "┼", "⎺", /* h - o */
      "⎻", "─", "⎼", "⎽", "├", "┤", "┴", "┬", /* p - w */
      "│", "≤", "≥", "π", "≠", "£", "·",      /* x - ~ */
  };

  /*
   * The table is proudly stolen from rxvt.
   */
  if (term.trantbl[term.charset] == CS_GRAPHIC0 && BETWEEN(u, 0x41, 0x7e) &&
      vt100_0[u - 0x41])
    utf8decode(vt100_0[u - 0x41], &u, UTF_SIZ);

  if (term.line[y][x].mode & ATTR_WIDE) {
    if (x + 1 < term.col) {
      term.line[y][x + 1].u = ' ';
      term.line[y][x + 1].mode &= ~ATTR_WDUMMY;
    }
  } else if (term.line[y][x].mode & ATTR_WDUMMY) {
    term.line[y][x - 1].u = ' ';
    term.line[y][x - 1].mode &= ~ATTR_WIDE;
  }

  term.dirty[y] = 1;
  term.line[y][x] = *attr;
  term.line[y][x].u = u;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movslq 0xedac(%rip), %rcx      # 0x18e18
leaq 0xed4d(%rip), %rax      # 0x18dc0
movsbl 0x54(%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0xa0c8
movl $0x41, %eax
cmpl -0x4(%rbp), %eax
ja 0xa0c8
cmpl $0x7e, -0x4(%rbp)
ja 0xa0c8
movl -0x4(%rbp), %eax
subl $0x41, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0xc452(%rip), %rax      # 0x164f0
cmpq $0x0, (%rax,%rcx,8)
je 0xa0c8
movl -0x4(%rbp), %eax
subl $0x41, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0xc43a(%rip), %rax      # 0x164f0
movq (%rax,%rcx,8), %rdi
leaq -0x4(%rbp), %rsi
movl $0x4, %edx
callq 0x8910
movq 0xecf9(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
andl $0x200, %eax            # imm = 0x200
cmpl $0x0, %eax
je 0xa152
movl -0x14(%rbp), %eax
addl $0x1, %eax
cmpl 0xecc8(%rip), %eax      # 0x18dc4
jge 0xa150
movq 0xecc3(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x20, (%rax)
movq 0xec9e(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %ecx
andl $0xfffffbff, %ecx       # imm = 0xFFFFFBFF
movw %cx, 0x4(%rax)
jmp 0xa1ce
movq 0xec6f(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %eax
andl $0x400, %eax            # imm = 0x400
cmpl $0x0, %eax
je 0xa1cc
movq 0xec47(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0x20, (%rax)
movq 0xec22(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzwl 0x4(%rax), %ecx
andl $0xfffffdff, %ecx       # imm = 0xFFFFFDFF
movw %cx, 0x4(%rax)
jmp 0xa1ce
movq 0xec03(%rip), %rax      # 0x18dd8
movslq -0x18(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movq 0xebe1(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, (%rax)
movq 0x8(%rcx), %rcx
movq %rcx, 0x8(%rax)
movl -0x4(%rbp), %ecx
movq 0xebb2(%rip), %rax      # 0x18dc8
movslq -0x18(%rbp), %rdx
movq (%rax,%rdx,8), %rax
movslq -0x14(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)