// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/sudoku/sudoku.c
// Function: display_update
static void display_update(char *status_msg)
{
  int x, y, offset = 0;

  erase();

  for (y = 0; y < 13; y += 4)
    mvaddstr(y, 0, "|---+---+---|");

  for (y = 0; y < 9; y++) {
    if (y % 3 == 0)
      offset++;
    mvaddch(y + offset, 0, '|');

    for (x = 0; x < 9; x++) {
      if (sudoku[y][x] == 0) 
        addch(' ');
      else
        printw("%d", sudoku[y][x]);

      if (x % 3 == 2)
        addch('|');
    }
  }

  mvaddstr(1, 16, " *** SUDOKU SOLVER ***");
  mvaddstr(3, 16, "Move cursor with arrow keys.");
  mvaddstr(4, 16, "Use numbers 1 to 9 to input numbers.");
  mvaddstr(5, 16, "Clear a number with 0 or space.");
  mvaddstr(6, 16, "Attempt automatic solving by pressing enter.");

  if (status_msg != NULL)
    mvprintw(8, 16, "Status: %s", status_msg);

  /* Place cursor. */
  move(current_y + (current_y / 3) + 1,
       current_x + (current_x / 3) + 1);

  refresh();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, (%rsp)
movq 0x22aa(%rip), %r13      # 0x3fe0
movq (%r13), %rdi
callq 0x1030
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
leaq 0x390(%rip), %r14       # 0x20db
addl $0x4, %ebp
movq (%r13), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1d71
movq (%r13), %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
cmpl $0x9, %ebp
jb 0x1d4b
leaq 0x2363(%rip), %rbp      # 0x40e0
movabsq $-0x5555555555555555, %rbx # imm = 0xAAAAAAAAAAAAAAAB
leaq 0x35b(%rip), %r14       # 0x20e9
xorl %ecx, %ecx
xorl %edx, %edx
imull $0xaaaaaaab, %ecx, %eax # imm = 0xAAAAAAAB
cmpl $0x55555556, %eax       # imm = 0x55555556
adcl $0x0, %edx
movq (%r13), %rdi
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
leal (%rdx,%rcx), %esi
xorl %edx, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1dcb
movq (%r13), %rdi
movl $0x7c, %esi
callq 0x1100
xorl %r15d, %r15d
movq %r15, %rax
mulq %rbx
movq %rdx, %r12
movl (%rbp,%r15,4), %esi
testl %esi, %esi
je 0x1dec
movq %r14, %rdi
xorl %eax, %eax
callq 0x1110
jmp 0x1dfa
movq (%r13), %rdi
movl $0x20, %esi
callq 0x1100
shrq %r12
leaq (%r12,%r12,2), %rax
addq $0x2, %rax
cmpl %r15d, %eax
jne 0x1e18
movq (%r13), %rdi
movl $0x7c, %esi
callq 0x1100
incq %r15
cmpq $0x9, %r15
jne 0x1dce
movq 0x10(%rsp), %rcx
incq %rcx
addq $0x24, %rbp
cmpq $0x9, %rcx
movq 0x8(%rsp), %rdx
jne 0x1d92
movq (%r13), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1e69
movq (%r13), %rdi
leaq 0x28d(%rip), %rsi       # 0x20ec
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r13), %rdi
movl $0x3, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1e96
movq (%r13), %rdi
leaq 0x277(%rip), %rsi       # 0x2103
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r13), %rdi
movl $0x4, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1ec3
movq (%r13), %rdi
leaq 0x267(%rip), %rsi       # 0x2120
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r13), %rdi
movl $0x5, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1ef0
movq (%r13), %rdi
leaq 0x25f(%rip), %rsi       # 0x2145
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r13), %rdi
movl $0x6, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1f1d
movq (%r13), %rdi
leaq 0x252(%rip), %rsi       # 0x2165
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x1f3e
leaq 0x265(%rip), %rdx       # 0x2192
movl $0x8, %edi
movl $0x10, %esi
xorl %eax, %eax
callq 0x10c0
movq (%r13), %rdi
movslq 0x218b(%rip), %rax      # 0x40d4
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rax,%rcx), %esi
incl %esi
movslq 0x2167(%rip), %rax      # 0x40d0
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rax,%rcx), %edx
incl %edx
callq 0x10f0
movq (%r13), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1080