// File: /workspace/github_c_makefile_star2_O3/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 0x27b4(%rip), %r12      # 0x3fe0
movq (%r12), %rdi
callq 0x1050
movq (%r12), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x185c
movq (%r12), %rdi
leaq 0x85a(%rip), %rsi       # 0x20ac
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
movq (%r12), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1110
testq %rbx, %rbx
je 0x1929
cmpl $-0x1, %eax
je 0x188f
movq (%r12), %rdi
leaq 0x839(%rip), %rsi       # 0x20be
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
xorl %r14d, %r14d
leaq 0x2987(%rip), %r15      # 0x4220
leaq 0x7c0(%rip), %r13       # 0x2060
movq (%r12), %rdi
leal 0x2(%r14), %edx
movl $0x1, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x18d8
movl (%r14,%r15), %eax
testl %eax, %eax
je 0x18d8
movq (%r12), %rdi
shll $0x8, %eax
movzwl %ax, %esi
orl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r12), %rdi
movl (%r14,%r15), %eax
movl (%r13,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x1905
cmpl $0x0, (%r14,%r15)
je 0x1905
movq (%r12), %rdi
xorl %esi, %esi
callq 0x1040
addq $0x4, %r14
cmpq $0x10, %r14
jne 0x18a0
movq (%r12), %rdi
movl $0x1, %esi
movl $0x12, %edx
callq 0x1110
cmpl $-0x1, %eax
jne 0x1935
jmp 0x1946
cmpl $-0x1, %eax
je 0x1946
leaq 0x79b(%rip), %rbx       # 0x20d0
movq (%r12), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
movq (%r12), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1970
movq (%r12), %rdi
leaq 0x77c(%rip), %rsi       # 0x20e2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
leaq 0x2759(%rip), %r13      # 0x40d0
xorl %eax, %eax
leaq 0x6e0(%rip), %r14       # 0x2060
leaq 0x6f5(%rip), %r15       # 0x207c
movq (%r12), %rdi
movq %rax, 0x10(%rsp)
addq %rax, %rax
movq %rax, 0x8(%rsp)
leal 0x3(%rax), %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x19be
movq (%r12), %rdi
leaq 0x745(%rip), %rsi       # 0x20f9
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
xorl %ebx, %ebx
movq (%r12), %rdi
leal 0x2(%rbx), %edx
movl %ebp, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x19f5
movl (%r13,%rbx), %eax
testl %eax, %eax
je 0x19f5
movq (%r12), %rdi
shll $0x8, %eax
movzwl %ax, %esi
orl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r12), %rdi
movl (%r13,%rbx), %eax
movl (%r14,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x1a23
cmpl $0x0, (%r13,%rbx)
je 0x1a23
movq (%r12), %rdi
xorl %esi, %esi
callq 0x1040
addq $0x4, %rbx
cmpq $0x10, %rbx
jne 0x19c0
movl $0x4, %ebx
movq (%r12), %rdi
leal 0xd(%rbx), %edx
movl %ebp, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x1a5f
cmpl $0x0, (%r13,%rbx,4)
je 0x1a5f
movq (%r12), %rdi
movl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r12), %rdi
movl (%r13,%rbx,4), %eax
movl (%r15,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x1a8d
cmpl $0x0, (%r13,%rbx,4)
je 0x1a8d
movq (%r12), %rdi
xorl %esi, %esi
callq 0x1040
incq %rbx
cmpq $0x8, %rbx
jne 0x1a32
movq (%r12), %rdi
movq 0x8(%rsp), %rsi
addl $0x4, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1ac3
movq (%r12), %rdi
leaq 0x629(%rip), %rsi       # 0x20e2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
movq 0x10(%rsp), %rax
incq %rax
addq $0x20, %r13
cmpq $0xa, %rax
jne 0x1987
movq (%r12), %rdi
movl 0x272d(%rip), %eax      # 0x4210
leal 0x3(,%rax,2), %esi
movl 0x2724(%rip), %eax      # 0x4214
leal 0x2(,%rax,4), %edx
callq 0x1110
movq (%r12), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10a0