// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/bin/unterm.c
// Function: dump_cell
static void dump_cell(const VTermScreenCell *cell, const VTermScreenCell *prevcell)
{
  switch(format) {
    case FORMAT_PLAIN:
      break;
    case FORMAT_SGR:
      {
        // If all 7 attributes change, that means 7 SGRs max
        // Each colour could consume up to 5 entries
        int sgr[7 + 2*5]; int sgri = 0;

        if(!prevcell->attrs.bold && cell->attrs.bold)
          sgr[sgri++] = 1;
        if(prevcell->attrs.bold && !cell->attrs.bold)
          sgr[sgri++] = 22;

        if(!prevcell->attrs.underline && cell->attrs.underline)
          sgr[sgri++] = 4;
        if(prevcell->attrs.underline && !cell->attrs.underline)
          sgr[sgri++] = 24;

        if(!prevcell->attrs.italic && cell->attrs.italic)
          sgr[sgri++] = 3;
        if(prevcell->attrs.italic && !cell->attrs.italic)
          sgr[sgri++] = 23;

        if(!prevcell->attrs.blink && cell->attrs.blink)
          sgr[sgri++] = 5;
        if(prevcell->attrs.blink && !cell->attrs.blink)
          sgr[sgri++] = 25;

        if(!prevcell->attrs.reverse && cell->attrs.reverse)
          sgr[sgri++] = 7;
        if(prevcell->attrs.reverse && !cell->attrs.reverse)
          sgr[sgri++] = 27;

        if(!prevcell->attrs.conceal && cell->attrs.conceal)
          sgr[sgri++] = 8;
        if(prevcell->attrs.conceal && !cell->attrs.conceal)
          sgr[sgri++] = 28;

        if(!prevcell->attrs.strike && cell->attrs.strike)
          sgr[sgri++] = 9;
        if(prevcell->attrs.strike && !cell->attrs.strike)
          sgr[sgri++] = 29;

        if(!prevcell->attrs.font && cell->attrs.font)
          sgr[sgri++] = 10 + cell->attrs.font;
        if(prevcell->attrs.font && !cell->attrs.font)
          sgr[sgri++] = 10;

        if(!vterm_color_is_equal(&prevcell->fg, &cell->fg)) {
          sgri = dump_cell_color(&cell->fg, sgri, sgr, 1);
        }

        if(!vterm_color_is_equal(&prevcell->bg, &cell->bg)) {
          sgri = dump_cell_color(&cell->bg, sgri, sgr, 0);
        }

        if(!sgri)
          break;

        printf("\x1b[");
        for(int i = 0; i < sgri; i++)
          printf(!i               ? "%d" :
              CSI_ARG_HAS_MORE(sgr[i]) ? ":%d" :
              ";%d",
              CSI_ARG(sgr[i]));
        printf("m");
      }
      break;
  }

  for(int i = 0; i < VTERM_MAX_CHARS_PER_CELL && cell->chars[i]; i++) {
    char bytes[6];
    bytes[fill_utf8(cell->chars[i], bytes)] = 0;
    printf("%s", bytes);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x3de3(%rip), %eax      # 0x515c
movl %eax, -0x78(%rbp)
testl %eax, %eax
je 0x138f
jmp 0x1382
movl -0x78(%rbp), %eax
subl $0x1, %eax
je 0x1394
jmp 0x1824
jmp 0x1824
movl $0x0, -0x64(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x13ce
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x13ce
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x1, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1401
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1401
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x16, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x1438
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x1438
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x4, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x146f
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x146f
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x18, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x14a8
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x14a8
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x3, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x14e1
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x14e1
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x17, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x4, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x151a
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x4, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x151a
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x5, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x4, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1553
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x4, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1553
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x19, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x5, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x158c
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x5, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x158c
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x7, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x5, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15c5
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x5, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x15c5
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x1b, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x6, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x15fe
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x6, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x15fe
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x8, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x6, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1637
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x6, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1637
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x1c, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x7, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x1670
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x7, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1670
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x9, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x7, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16a9
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x7, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x16a9
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0x1d, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x16ee
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x16ee
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
shrl $0x8, %ecx
andl $0xf, %ecx
addl $0xa, %ecx
movl -0x64(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x64(%rbp)
cltq
movl %ecx, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x1727
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
shrl $0x8, %eax
andl $0xf, %eax
cmpl $0x0, %eax
jne 0x1727
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x64(%rbp)
cltq
movl $0xa, -0x60(%rbp,%rax,4)
movq -0x10(%rbp), %rdi
addq $0x20, %rdi
movq -0x8(%rbp), %rsi
addq $0x20, %rsi
callq 0x1070
cmpl $0x0, %eax
jne 0x175d
movq -0x8(%rbp), %rdi
addq $0x20, %rdi
movl -0x64(%rbp), %esi
leaq -0x60(%rbp), %rdx
movl $0x1, %ecx
callq 0x1c60
movl %eax, -0x64(%rbp)
movq -0x10(%rbp), %rdi
addq $0x24, %rdi
movq -0x8(%rbp), %rsi
addq $0x24, %rsi
callq 0x1070
cmpl $0x0, %eax
jne 0x1790
movq -0x8(%rbp), %rdi
addq $0x24, %rdi
movl -0x64(%rbp), %esi
leaq -0x60(%rbp), %rdx
xorl %ecx, %ecx
callq 0x1c60
movl %eax, -0x64(%rbp)
cmpl $0x0, -0x64(%rbp)
jne 0x179b
jmp 0x1824
leaq 0x18ba(%rip), %rdi      # 0x305c
movb $0x0, %al
callq 0x1080
movl $0x0, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x64(%rbp), %eax
jge 0x1816
cmpl $0x0, -0x68(%rbp)
jne 0x17cb
leaq 0x189b(%rip), %rax      # 0x3060
movq %rax, -0x80(%rbp)
jmp 0x17f2
movslq -0x68(%rbp), %rax
movl -0x60(%rbp,%rax,4), %edx
andl $0x80000000, %edx       # imm = 0x80000000
leaq 0x1883(%rip), %rax      # 0x3063
leaq 0x1878(%rip), %rcx      # 0x305f
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rdi
movslq -0x68(%rbp), %rax
movl -0x60(%rbp,%rax,4), %esi
andl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
movb $0x0, %al
callq 0x1080
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0x17b0
leaq 0x184f(%rip), %rdi      # 0x306c
movb $0x0, %al
callq 0x1080
movl $0x0, -0x6c(%rbp)
xorl %eax, %eax
cmpl $0x6, -0x6c(%rbp)
movb %al, -0x81(%rbp)
jge 0x184e
movq -0x8(%rbp), %rax
movslq -0x6c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
setne %al
movb %al, -0x81(%rbp)
movb -0x81(%rbp), %al
testb $0x1, %al
jne 0x185a
jmp 0x1894
movq -0x8(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, %edi
leaq -0x72(%rbp), %rsi
callq 0x1ea0
cltq
movb $0x0, -0x72(%rbp,%rax)
leaq -0x72(%rbp), %rsi
leaq 0x17e5(%rip), %rdi      # 0x3067
movb $0x0, %al
callq 0x1080
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x182b
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)