// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/scca/scca.c
// Function: screen_update
static void screen_update(void)
{
  unsigned char c;
  int i, y, x, maxy, maxx, skip_newline;

  getmaxyx(stdscr, maxy, maxx);
  erase();

  /* Alphabet. */
  x = 0;
  for (c = 0; c < UCHAR_MAX; c++) {
    if (allowed_char[c] != -1) {
      mvaddch(0, x, c);
      x++;
      if (x > maxx)
        break;
    }
  }

  /* Cipher */
  x = 0;
  for (c = 0; c < UCHAR_MAX; c++) {
    mvaddch(1, x, cipher[c]);
    x++;
    if (x > maxx)
      break;
  }

  /* Upper Separation Line */
  mvhline(2, 0, ACS_HLINE, maxx);

  /* Text */
  skip_newline = text_offset;
  move(3, 0);
  for (i = 0; i < TEXT_MAX; i++) {
    if (text[i] == '\0')
      break;

    if (skip_newline > 0) {
      if (text[i] == '\n') {
        skip_newline--;
      }
      continue;
    }

    c = cipher_applied(text[i]);
    if (c != text[i]) {
      attron(A_REVERSE);
    }
    addch(c);
    if (c != text[i]) {
      attroff(A_REVERSE);
    }

    getyx(stdscr, y, x);
    if (y >= (maxy - 1)) {
      break;
    }
  }

  /* Lower Separation Line */
  mvhline(maxy - 1, 0, ACS_HLINE, maxx);

  move(1, cipher_pos);
  refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
xorl %eax, %eax
movq 0x386f(%rip), %rcx      # 0x4fd0
cmpq (%rcx), %rax
je 0x177c
movq 0x3863(%rip), %rax      # 0x4fd0
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1786
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x20(%rbp)
jmp 0x1786
movl -0x20(%rbp), %eax
movl %eax, -0x14(%rbp)
xorl %eax, %eax
movq 0x383b(%rip), %rcx      # 0x4fd0
cmpq (%rcx), %rax
je 0x17b0
movq 0x382f(%rip), %rax      # 0x4fd0
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x17ba
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x24(%rbp)
jmp 0x17ba
movl -0x24(%rbp), %eax
movl %eax, -0x18(%rbp)
movq 0x3809(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
callq 0x1030
movl $0x0, -0x10(%rbp)
movb $0x0, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0xff, %eax
jge 0x1847
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
leaq 0x3a1e(%rip), %rax      # 0x5210
cmpl $-0x1, (%rax,%rcx,4)
je 0x183b
movq 0x37d1(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl -0x10(%rbp), %edx
xorl %esi, %esi
callq 0x1140
cmpl $-0x1, %eax
jne 0x1813
jmp 0x1826
movq 0x37b6(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movzbl -0x1(%rbp), %esi
callq 0x1160
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x1839
jmp 0x1847
jmp 0x183b
jmp 0x183d
movb -0x1(%rbp), %al
addb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x17da
movl $0x0, -0x10(%rbp)
movb $0x0, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
cmpl $0xff, %eax
jge 0x18ba
movq 0x376c(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl -0x10(%rbp), %edx
movl $0x1, %esi
callq 0x1140
cmpl $-0x1, %eax
jne 0x187b
jmp 0x189b
movq 0x374e(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movzbl -0x1(%rbp), %eax
movl %eax, %ecx
leaq 0x387e(%rip), %rax      # 0x5110
movzbl (%rax,%rcx), %esi
callq 0x1160
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x18(%rbp), %eax
jle 0x18ae
jmp 0x18ba
jmp 0x18b0
movb -0x1(%rbp), %al
addb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x1852
movq 0x370f(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1140
cmpl $-0x1, %eax
jne 0x18d7
jmp 0x18f6
movq 0x36f2(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movq 0x36e0(%rip), %rax      # 0x4fc8
movl 0x1c4(%rax), %esi
movl -0x18(%rbp), %edx
callq 0x1180
movl 0x380c(%rip), %eax      # 0x5108
movl %eax, -0x1c(%rbp)
movq 0x36ca(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x1140
movl $0x0, -0x8(%rbp)
cmpl $0x10000, -0x8(%rbp)    # imm = 0x10000
jge 0x1a72
movslq -0x8(%rbp), %rcx
leaq 0x3cdc(%rip), %rax      # 0x5610
movzbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x1942
jmp 0x1a72
cmpl $0x0, -0x1c(%rbp)
jle 0x196a
movslq -0x8(%rbp), %rcx
leaq 0x3cbd(%rip), %rax      # 0x5610
movzbl (%rax,%rcx), %eax
cmpl $0xa, %eax
jne 0x1965
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1a64
movslq -0x8(%rbp), %rcx
leaq 0x3c9b(%rip), %rax      # 0x5610
movzbl (%rax,%rcx), %edi
callq 0x2040
movb %al, -0x1(%rbp)
movzbl -0x1(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x3c80(%rip), %rcx      # 0x5610
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x19b0
movq 0x3631(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x10f0
movq 0x3619(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movzbl -0x1(%rbp), %esi
callq 0x1160
movzbl -0x1(%rbp), %eax
movslq -0x8(%rbp), %rdx
leaq 0x3c3e(%rip), %rcx      # 0x5610
movzbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0x19f2
movq 0x35ef(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl $0x40000, %esi          # imm = 0x40000
xorl %eax, %eax
movl %eax, %edx
callq 0x1190
xorl %eax, %eax
movq 0x35d5(%rip), %rcx      # 0x4fd0
cmpq (%rcx), %rax
je 0x1a12
movq 0x35c9(%rip), %rax      # 0x4fd0
movq (%rax), %rax
movswl (%rax), %eax
movl %eax, -0x28(%rbp)
jmp 0x1a1c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x28(%rbp)
jmp 0x1a1c
movl -0x28(%rbp), %eax
movl %eax, -0xc(%rbp)
xorl %eax, %eax
movq 0x35a5(%rip), %rcx      # 0x4fd0
cmpq (%rcx), %rax
je 0x1a43
movq 0x3599(%rip), %rax      # 0x4fd0
movq (%rax), %rax
movswl 0x2(%rax), %eax
movl %eax, -0x2c(%rbp)
jmp 0x1a4d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x2c(%rbp)
jmp 0x1a4d
movl -0x2c(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0xc(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jl 0x1a62
jmp 0x1a72
jmp 0x1a64
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x191c
movq 0x3557(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl -0x14(%rbp), %esi
subl $0x1, %esi
xorl %edx, %edx
callq 0x1140
cmpl $-0x1, %eax
jne 0x1a90
jmp 0x1aaf
movq 0x3539(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movq 0x3527(%rip), %rax      # 0x4fc8
movl 0x1c4(%rax), %esi
movl -0x18(%rbp), %edx
callq 0x1180
movq 0x351a(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
movl 0x3641(%rip), %edx      # 0x5100
movl $0x1, %esi
callq 0x1140
movq 0x3500(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
callq 0x10b0
addq $0x30, %rsp
popq %rbp
retq
nop