// File: /workspace/github_c_makefile_star2_O2/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 0x2340(%rip), %r12      # 0x3fe0
movq (%r12), %rdi
callq 0x1030
xorl %ebp, %ebp
leaq 0x429(%rip), %r14       # 0x20db
pushq $-0x1
popq %r15
cmpl $0xd, %ebp
jae 0x1ce1
movq (%r12), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1cdc
movq (%r12), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x1130
addl $0x4, %ebp
jmp 0x1cb6
leaq 0x23f8(%rip), %rbx      # 0x40e0
movb $0x3, %r13b
xorl %ecx, %ecx
xorl %edx, %edx
cmpq $0x9, %rcx
je 0x1da4
movzbl %cl, %eax
divb %r13b
movzbl %ah, %eax
cmpb $0x1, %al
adcl $0x0, %edx
movq (%r12), %rdi
movq %rcx, 0x10(%rsp)
movq %rdx, 0x8(%rsp)
leal (%rdx,%rcx), %esi
xorl %edx, %edx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1d30
movq (%r12), %rdi
pushq $0x7c
popq %rsi
callq 0x1100
movq %r12, %r15
movb $0x2, %bpl
xorl %r14d, %r14d
movzbl %r14b, %eax
divb %r13b
cmpq $0x9, %r14
je 0x1d8b
movl %eax, %r12d
movl (%rbx,%r14,4), %esi
testl %esi, %esi
je 0x1d61
leaq 0x391(%rip), %rdi       # 0x20e9
xorl %eax, %eax
callq 0x1110
jmp 0x1d6c
movq (%r15), %rdi
pushq $0x20
popq %rsi
callq 0x1100
movzbl %r12b, %eax
leal (%rax,%rax,2), %eax
addb %bpl, %al
jne 0x1d83
movq (%r15), %rdi
pushq $0x7c
popq %rsi
callq 0x1100
incq %r14
decb %bpl
jmp 0x1d39
movq 0x10(%rsp), %rcx
incq %rcx
addq $0x24, %rbx
movq %r15, %r12
movq 0x8(%rsp), %rdx
jmp 0x1cef
movq (%r12), %rdi
pushq $0x1
popq %rsi
pushq $0x10
popq %rdx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1dcb
movq (%r12), %rdi
leaq 0x329(%rip), %rsi       # 0x20ec
pushq $-0x1
popq %rdx
callq 0x1130
movq (%r12), %rdi
pushq $0x3
popq %rbp
pushq $0x10
popq %rdx
movl %ebp, %esi
callq 0x10f0
cmpl $-0x1, %eax
je 0x1df4
movq (%r12), %rdi
leaq 0x317(%rip), %rsi       # 0x2103
pushq $-0x1
popq %rdx
callq 0x1130
movq (%r12), %rdi
pushq $0x4
popq %rsi
pushq $0x10
popq %rdx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1e1b
movq (%r12), %rdi
leaq 0x30d(%rip), %rsi       # 0x2120
pushq $-0x1
popq %rdx
callq 0x1130
movq (%r12), %rdi
pushq $0x5
popq %rsi
pushq $0x10
popq %rdx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1e42
movq (%r12), %rdi
leaq 0x30b(%rip), %rsi       # 0x2145
pushq $-0x1
popq %rdx
callq 0x1130
movq (%r12), %rdi
pushq $0x6
popq %rsi
pushq $0x10
popq %rdx
callq 0x10f0
cmpl $-0x1, %eax
je 0x1e69
movq (%r12), %rdi
leaq 0x304(%rip), %rsi       # 0x2165
pushq $-0x1
popq %rdx
callq 0x1130
movq (%rsp), %rcx
testq %rcx, %rcx
je 0x1e86
leaq 0x319(%rip), %rdx       # 0x2192
pushq $0x8
popq %rdi
pushq $0x10
popq %rsi
xorl %eax, %eax
callq 0x10c0
movq (%r12), %rdi
movl 0x2244(%rip), %ecx      # 0x40d4
movl %ecx, %eax
cltd
idivl %ebp
leal (%rcx,%rax), %esi
incl %esi
movl 0x2230(%rip), %ecx      # 0x40d0
movl %ecx, %eax
cltd
idivl %ebp
leal (%rcx,%rax), %edx
incl %edx
callq 0x10f0
movq (%r12), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1080