// File: /workspace/github_c_makefile_star2_O1/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 0x29cd(%rip), %r13      # 0x3fe0
movq (%r13), %rdi
callq 0x1050
movq (%r13), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1643
movq (%r13), %rdi
leaq 0xa33(%rip), %rsi       # 0x206c
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
movq (%r13), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x1110
testq %rbx, %rbx
je 0x170f
cmpl $-0x1, %eax
je 0x1676
movq (%r13), %rdi
leaq 0xa12(%rip), %rsi       # 0x207e
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
xorl %r14d, %r14d
leaq 0x2ba0(%rip), %r15      # 0x4220
leaq 0x999(%rip), %r12       # 0x2020
movq (%r13), %rdi
leal 0x2(%r14), %edx
movl $0x1, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x16bf
movl (%r14,%r15), %eax
testl %eax, %eax
je 0x16bf
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 0x16eb
cmpl $0x0, (%r14,%r15)
je 0x16eb
movq (%r13), %rdi
xorl %esi, %esi
callq 0x1040
addq $0x4, %r14
cmpq $0x10, %r14
jne 0x1687
movq (%r13), %rdi
movl $0x1, %esi
movl $0x12, %edx
callq 0x1110
cmpl $-0x1, %eax
jne 0x171b
jmp 0x172c
cmpl $-0x1, %eax
je 0x172c
leaq 0x975(%rip), %rbx       # 0x2090
movq (%r13), %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
movq (%r13), %rdi
movl $0x2, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1756
movq (%r13), %rdi
leaq 0x956(%rip), %rsi       # 0x20a2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
leaq 0x2973(%rip), %rbp      # 0x40d0
xorl %ebx, %ebx
leaq 0x8ba(%rip), %r14       # 0x2020
leaq 0x8cf(%rip), %r12       # 0x203c
movq (%r13), %rdi
leaq 0x3(,%rbx,2), %r15
movl %r15d, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x179d
movq (%r13), %rdi
leaq 0x926(%rip), %rsi       # 0x20b9
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
movq %rbx, 0x10(%rsp)
leaq (%rbx,%rbx), %rax
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
movq (%r13), %rdi
leal 0x2(%rbx), %edx
movl %r15d, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x17e2
movl (%rbp,%rbx), %eax
testl %eax, %eax
je 0x17e2
movq (%r13), %rdi
shll $0x8, %eax
movzwl %ax, %esi
orl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r13), %rdi
movl (%rbp,%rbx), %eax
movl (%r14,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x180e
cmpl $0x0, (%rbp,%rbx)
je 0x180e
movq (%r13), %rdi
xorl %esi, %esi
callq 0x1040
addq $0x4, %rbx
cmpq $0x10, %rbx
jne 0x17ad
movl $0x4, %ebx
movq (%r13), %rdi
leal 0xd(%rbx), %edx
movl %r15d, %esi
callq 0x1110
callq 0x1030
testb %al, %al
je 0x184a
cmpl $0x0, (%rbp,%rbx,4)
je 0x184a
movq (%r13), %rdi
movl $0x200000, %esi         # imm = 0x200000
callq 0x1040
movq (%r13), %rdi
movl (%rbp,%rbx,4), %eax
movl (%r12,%rax,4), %esi
callq 0x1120
callq 0x1030
testb %al, %al
je 0x1876
cmpl $0x0, (%rbp,%rbx,4)
je 0x1876
movq (%r13), %rdi
xorl %esi, %esi
callq 0x1040
incq %rbx
cmpq $0x8, %rbx
jne 0x181d
movq (%r13), %rdi
movq 0x8(%rsp), %rsi
addl $0x4, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x18ac
movq (%r13), %rdi
leaq 0x800(%rip), %rsi       # 0x20a2
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1140
movq 0x10(%rsp), %rbx
incq %rbx
addq $0x20, %rbp
cmpq $0xa, %rbx
jne 0x176d
movq (%r13), %rdi
movl 0x2944(%rip), %eax      # 0x4210
leal 0x3(,%rax,2), %esi
movl 0x293b(%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