// File: /workspace/github_c_makefile_star2_O3/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, 0x8(%rsp)
movq 0x229f(%rip), %r15      # 0x3fe0
movq (%r15), %rdi
callq 0x1030
movl $0xfffffffc, %ebp       # imm = 0xFFFFFFFC
leaq 0x386(%rip), %r14       # 0x20db
addl $0x4, %ebp
movq (%r15), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1d79
movq (%r15), %rdi
movq %r14, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
cmpl $0x9, %ebp
jb 0x1d55
leaq 0x235b(%rip), %r12      # 0x40e0
leaq 0x35d(%rip), %r14       # 0x20e9
xorl %r13d, %r13d
xorl %ecx, %ecx
imull $-0x55, %r13d, %eax
cmpb $0x56, %al
adcl $0x0, %ecx
movq (%r15), %rdi
movq %rcx, 0x10(%rsp)
leal (%rcx,%r13), %esi
xorl %edx, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1dbf
movq (%r15), %rdi
movl $0x7c, %esi
callq 0x1100
movb $0x2, %bl
xorl %ebp, %ebp
movl (%r12,%rbp,4), %esi
testl %esi, %esi
je 0x1dd7
movq %r14, %rdi
xorl %eax, %eax
callq 0x1110
jmp 0x1de4
movq (%r15), %rdi
movl $0x20, %esi
callq 0x1100
movzbl %bpl, %eax
imull $0xab, %eax, %eax
shrl $0x9, %eax
leal (%rax,%rax,2), %eax
addb %bl, %al
jne 0x1e05
movq (%r15), %rdi
movl $0x7c, %esi
callq 0x1100
incq %rbp
decb %bl
cmpq $0x9, %rbp
jne 0x1dc3
incq %r13
addq $0x24, %r12
cmpq $0x9, %r13
movq 0x10(%rsp), %rcx
jne 0x1d91
movq (%r15), %rdi
movl $0x1, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1e51
movq (%r15), %rdi
leaq 0x2a5(%rip), %rsi       # 0x20ec
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r15), %rdi
movl $0x3, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1e7c
movq (%r15), %rdi
leaq 0x291(%rip), %rsi       # 0x2103
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r15), %rdi
movl $0x4, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1ea7
movq (%r15), %rdi
leaq 0x283(%rip), %rsi       # 0x2120
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r15), %rdi
movl $0x5, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1ed2
movq (%r15), %rdi
leaq 0x27d(%rip), %rsi       # 0x2145
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq (%r15), %rdi
movl $0x6, %esi
movl $0x10, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1efd
movq (%r15), %rdi
leaq 0x272(%rip), %rsi       # 0x2165
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1130
movq 0x8(%rsp), %rcx
testq %rcx, %rcx
je 0x1f1f
leaq 0x284(%rip), %rdx       # 0x2192
movl $0x8, %edi
movl $0x10, %esi
xorl %eax, %eax
callq 0x10c0
movq (%r15), %rdi
movslq 0x21ab(%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 0x2187(%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 (%r15), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1080