// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/mastermind/mastermind.c
// Function: display_update
static void display_update(char *end_msg)
{
  int i, j;

  erase();

  /* Draw area with hidden code. */
  mvaddstr(0, 0, "+---+---+---+---+");
  if (end_msg != NULL) {
    mvaddstr(1, 0, "|   |   |   |   |");
    for (i = 0; i < CODE_SLOTS; i++) {
      move(1, 2 + (i * 4));
      if (has_colors() && hidden_code[i] != CODE_NONE)
        attrset(A_BOLD | COLOR_PAIR(hidden_code[i]));
      addch(code_to_char[hidden_code[i]]);
      if (has_colors() && hidden_code[i] != CODE_NONE)
        attrset(A_NORMAL);
    }
    mvaddstr(1, 18, end_msg);
  } else {
    mvaddstr(1, 0, "|###|###|###|###|");
  }
  mvaddstr(2, 0, "+---+---+---+---+----+");

  /* Draw area with user guesses. */
  for (i = 0; i < GUESS_SLOTS; i++) {
    mvaddstr(3 + (i * 2), 0, "|   |   |   |   |    |");

    for (j = 0; j < CODE_SLOTS; j++) {
      move(3 + (i * 2), 2 + (j * 4));
      if (has_colors() && guess[i].code[j] != CODE_NONE)
        attrset(A_BOLD | COLOR_PAIR(guess[i].code[j]));
      addch(code_to_char[guess[i].code[j]]);
      if (has_colors() && guess[i].code[j] != CODE_NONE)
        attrset(A_NORMAL);
    }

    for (j = 0; j < CODE_SLOTS; j++) {
      move(3 + (i * 2), 17 + j);
      if (has_colors() && guess[i].hint[j] != HINT_NONE)
        attrset(A_BOLD);
      addch(hint_to_char[guess[i].hint[j]]);
      if (has_colors() && guess[i].hint[j] != HINT_NONE)
        attrset(A_NORMAL);
    }

    mvaddstr(4 + (i * 2), 0, "+---+---+---+---+----+");
  }

  /* Place cursor on current slot to select. */
  move(3 + (current_guess * 2), 2 + (current_slot * 4));

  refresh();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x2a3c(%rip), %r13      # 0x3fe0
movq (%r13), %rdi
callq 0x1050
movq (%r13), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x15d2
movq (%r13), %rdi
leaq 0xaa2(%rip), %rsi       # 0x206c
pushq $-0x1
popq %rdx
callq 0x1140
movq (%r13), %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x1110
testq %rbx, %rbx
je 0x1694
cmpl $-0x1, %eax
je 0x1601
movq (%r13), %rdi
leaq 0xa85(%rip), %rsi       # 0x207e
pushq $-0x1
popq %rdx
callq 0x1140
xorl %r14d, %r14d
pushq $0x1
popq %rbp
leaq 0x2c12(%rip), %r15      # 0x4220
leaq 0xa0b(%rip), %r12       # 0x2020
movq (%r13), %rdi
cmpq $0x10, %r14
je 0x1682
leal 0x2(%r14), %edx
movl %ebp, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x1650
movl (%r14,%r15), %eax
testl %eax, %eax
je 0x1650
movq (%r13), %rdi
shll $0x8, %eax
movzwl %ax, %esi
orl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r13), %rdi
movl (%r14,%r15), %eax
movl (%r12,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x167c
cmpl $0x0, (%r14,%r15)
je 0x167c
movq (%r13), %rdi
xorl %esi, %esi
callq 0x1040
addq $0x4, %r14
jmp 0x1615
pushq $0x1
popq %rsi
pushq $0x12
popq %rdx
callq 0x1110
cmpl $-0x1, %eax
jne 0x16a0
jmp 0x16af
cmpl $-0x1, %eax
je 0x16af
leaq 0x9f0(%rip), %rbx       # 0x2090
movq (%r13), %rdi
pushq $-0x1
popq %rdx
movq %rbx, %rsi
callq 0x1140
movq (%r13), %rdi
pushq $0x2
popq %rsi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x16d5
movq (%r13), %rdi
leaq 0x9d5(%rip), %rsi       # 0x20a2
pushq $-0x1
popq %rdx
callq 0x1140
leaq 0x29f4(%rip), %rbx      # 0x40d0
xorl %eax, %eax
leaq 0x957(%rip), %rbp       # 0x203c
leaq 0x934(%rip), %r14       # 0x2020
movq (%r13), %rdi
cmpq $0xa, %rax
je 0x183f
movq %rax, 0x10(%rsp)
addq %rax, %rax
movq %rax, 0x8(%rsp)
leal 0x3(%rax), %r12d
movl %r12d, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x172d
movq (%r13), %rdi
leaq 0x994(%rip), %rsi       # 0x20b9
pushq $-0x1
popq %rdx
callq 0x1140
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x179e
movq (%r13), %rdi
leal 0x2(%r15), %edx
movl %r12d, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x176c
movl (%rbx,%r15), %eax
testl %eax, %eax
je 0x176c
movq (%r13), %rdi
shll $0x8, %eax
movzwl %ax, %esi
orl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r13), %rdi
movl (%rbx,%r15), %eax
movl (%r14,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x1798
cmpl $0x0, (%rbx,%r15)
je 0x1798
movq (%r13), %rdi
xorl %esi, %esi
callq 0x1040
addq $0x4, %r15
jmp 0x1730
pushq $0x4
popq %r15
movq (%r13), %rdi
cmpq $0x8, %r15
je 0x1807
leal 0xd(%r15), %edx
movl %r12d, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x17d6
cmpl $0x0, (%rbx,%r15,4)
je 0x17d6
movq (%r13), %rdi
movl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r13), %rdi
movl (%rbx,%r15,4), %eax
movl (%rbp,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x1802
cmpl $0x0, (%rbx,%r15,4)
je 0x1802
movq (%r13), %rdi
xorl %esi, %esi
callq 0x1040
incq %r15
jmp 0x17a2
movq 0x8(%rsp), %rsi
addl $0x4, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x182e
movq (%r13), %rdi
leaq 0x87c(%rip), %rsi       # 0x20a2
pushq $-0x1
popq %rdx
callq 0x1140
movq 0x10(%rsp), %rax
incq %rax
addq $0x20, %rbx
jmp 0x16ec
movl 0x29cb(%rip), %eax      # 0x4210
leal 0x3(,%rax,2), %esi
movl 0x29c2(%rip), %eax      # 0x4214
leal 0x2(,%rax,4), %edx
callq 0x1110
movq (%r13), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0