// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/src/screen.c
// Function: putglyph
static int putglyph(VTermGlyphInfo *info, VTermPos pos, void *user)
{
  VTermScreen *screen = user;
  ScreenCell *cell = getcell(screen, pos.row, pos.col);

  if(!cell)
    return 0;

  int i;
  for(i = 0; i < VTERM_MAX_CHARS_PER_CELL && info->chars[i]; i++) {
    cell->chars[i] = info->chars[i];
    cell->pen = screen->pen;
  }
  if(i < VTERM_MAX_CHARS_PER_CELL)
    cell->chars[i] = 0;

  for(int col = 1; col < info->width; col++)
    getcell(screen, pos.row, pos.col + col)->chars[0] = (uint32_t)-1;

  VTermRect rect = {
    .start_row = pos.row,
    .end_row   = pos.row+1,
    .start_col = pos.col,
    .end_col   = pos.col+info->width,
  };

  cell->pen.protected_cell = info->protected_cell;
  cell->pen.dwl            = info->dwl;
  cell->pen.dhl            = info->dhl;

  damagerect(screen, rect);

  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0xc(%rbp)
movq %rdi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
callq 0x6a70
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x7802
movl $0x0, -0x4(%rbp)
jmp 0x7968
movl $0x0, -0x34(%rbp)
xorl %eax, %eax
cmpl $0x6, -0x34(%rbp)
movb %al, -0x49(%rbp)
jge 0x7829
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
setne %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x7832
jmp 0x7872
movq -0x18(%rbp), %rax
movq (%rax), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x80(%rcx), %rdx
movq %rdx, 0x18(%rax)
movl 0x88(%rcx), %ecx
movl %ecx, 0x20(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x7809
cmpl $0x6, -0x34(%rbp)
jge 0x7887
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x78bd
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x8(%rbp), %edx
addl -0x38(%rbp), %edx
callq 0x6a70
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x788e
movl -0xc(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x8(%rbp), %eax
movq -0x18(%rbp), %rcx
addl 0x8(%rcx), %eax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
movb 0xc(%rax), %al
andb $0x1, %al
movzbl %al, %edx
movq -0x30(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x1, %edx
shll $0xf, %edx
andl $0xffff7fff, %ecx       # imm = 0xFFFF7FFF
orl %edx, %ecx
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rax
movb 0xc(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %edx
movq -0x30(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x1, %edx
shll $0x10, %edx
andl $0xfffeffff, %ecx       # imm = 0xFFFEFFFF
orl %edx, %ecx
movl %ecx, 0x20(%rax)
movq -0x18(%rbp), %rax
movb 0xc(%rax), %al
shrb $0x2, %al
andb $0x3, %al
movzbl %al, %edx
movq -0x30(%rbp), %rax
movl 0x20(%rax), %ecx
andl $0x3, %edx
shll $0x11, %edx
andl $0xfff9ffff, %ecx       # imm = 0xFFF9FFFF
orl %edx, %ecx
movl %ecx, 0x20(%rax)
movq -0x28(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x8670
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)