// File: /workspace/github_c_makefile_star2_O2/kobolt[P]curses-collection/invaders/iface.c
// Function: iface_redraw_screen
void iface_redraw_screen(void)
{
  int i, j, x, y;
  int maxy, maxx;

  erase();

  /* Draw invaders. */
  for (i = 0; i < GAME_INVADERS; i++) {
    if (game_state.invader_alive[i]) {
      y = game_state.invaders_pos_y + ((i / 10) * 4);
      x = game_state.invaders_pos_x + ((i % 10) * 7);
      if (i / 10 == 0) {
        if (game_state.invaders_pos_x % 2 == 0) {
          mvaddstr(y,     x, INVADER_1_S1_R1);
          mvaddstr(y + 1, x, INVADER_1_S1_R2);
          mvaddstr(y + 2, x, INVADER_1_S1_R3);
        } else {
          mvaddstr(y,     x, INVADER_1_S2_R1);
          mvaddstr(y + 1, x, INVADER_1_S2_R2);
          mvaddstr(y + 2, x, INVADER_1_S2_R3);
        }
      } else if (i / 10 == 1) {
        if (game_state.invaders_pos_x % 2 == 0) {
          mvaddstr(y,     x, INVADER_2_S1_R1);
          mvaddstr(y + 1, x, INVADER_2_S1_R2);
          mvaddstr(y + 2, x, INVADER_2_S1_R3);
        } else {
          mvaddstr(y,     x, INVADER_2_S2_R1);
          mvaddstr(y + 1, x, INVADER_2_S2_R2);
          mvaddstr(y + 2, x, INVADER_2_S2_R3);
        }
      } else {
        if (game_state.invaders_pos_x % 2 == 0) {
          mvaddstr(y,     x, INVADER_3_S1_R1);
          mvaddstr(y + 1, x, INVADER_3_S1_R2);
          mvaddstr(y + 2, x, INVADER_3_S1_R3);
        } else {
          mvaddstr(y,     x, INVADER_3_S2_R1);
          mvaddstr(y + 1, x, INVADER_3_S2_R2);
          mvaddstr(y + 2, x, INVADER_3_S2_R3);
        }
      }
    }
  }

  /* Draw shields. */
  for (i = 0; i < GAME_SHIELDS; i++) {
    for (j = 0; j < GAME_SHIELD_PARTS; j++) {
      if (game_state.shield_intact[i][j]) {
        y = (i / 4 == 0) ? GAME_MAP_HEIGHT - 4 : GAME_MAP_HEIGHT - 5;
        x = 12 + ((i % 4) * 15) + j;
        mvaddch(y, x, '#');
      }
    }
  }

  /* Draw shots and bombs. */
  if (game_state.shot_pos_y >= 0)
    mvaddch(game_state.shot_pos_y, game_state.shot_pos_x, '|');
  if (game_state.bomb_pos_y >= 0)
    mvaddch(game_state.bomb_pos_y, game_state.bomb_pos_x, '*');

  /* Draw player. */
  mvaddstr(GAME_MAP_HEIGHT - 2, game_state.player_pos - 2, PLAYER_R1);
  mvaddstr(GAME_MAP_HEIGHT - 1, game_state.player_pos - 2, PLAYER_R2);

  /* Draw borders. (Only if terminal size is too large.) */
  getmaxyx(stdscr, maxy, maxx);
  if (maxy > GAME_MAP_HEIGHT)
    mvhline(GAME_MAP_HEIGHT, 0, 0, GAME_MAP_WIDTH + 1);
  if (maxx > GAME_MAP_WIDTH)
    mvvline(0, GAME_MAP_WIDTH, 0, GAME_MAP_HEIGHT);

  /* Position cursor on player. */
  move(GAME_MAP_HEIGHT - 2, game_state.player_pos);

  refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x3a1a(%rip), %rbx      # 0x4fe0
movq (%rbx), %rdi
callq 0x1030
xorl %r12d, %r12d
movb $0xa, %r13b
leaq 0x3b65(%rip), %r15      # 0x5140
xorl %r14d, %r14d
movzbl %r14b, %eax
divb %r13b
cmpq $0x1e, %r14
je 0x1879
cmpb $0x1, 0x1a(%r15,%r14)
jne 0x186d
movzbl %al, %eax
imull $0x46, %eax, %eax
movq %r12, -0x30(%rbp)
movl %r12d, %ecx
subb %al, %cl
movswl 0xc(%r15), %edx
movzbl %r14b, %eax
divb %r13b
movzbl %al, %eax
leal (%rdx,%rax,4), %r13d
movswl 0xe(%r15), %r15d
movzbl %cl, %r12d
addl %r15d, %r12d
cmpq $0x9, %r14
ja 0x16a2
movq (%rbx), %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x1110
testb $0x1, %r15b
jne 0x16e9
cmpl $-0x1, %eax
je 0x165e
movq (%rbx), %rdi
leaq 0x1a68(%rip), %rsi      # 0x30be
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
leal 0x1(%r13), %esi
movl %r12d, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1684
movq (%rbx), %rdi
leaq 0x1a48(%rip), %rsi      # 0x30c4
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
addl $0x2, %r13d
movl %r13d, %esi
movl %r12d, %edx
callq 0x1110
leaq 0x1a2d(%rip), %rsi      # 0x30ca
jmp 0x184f
movq %rbx, %rax
leal -0xa(%r14), %ebx
movq (%rax), %rdi
movl %r13d, %esi
movl %r12d, %edx
callq 0x1110
cmpl $0x9, %ebx
ja 0x1744
testb $0x1, %r15b
jne 0x1793
cmpl $-0x1, %eax
movq 0x390c(%rip), %rbx      # 0x4fe0
je 0x17b1
movq (%rbx), %rdi
leaq 0x19f2(%rip), %rsi      # 0x30d6
jmp 0x17a9
cmpl $-0x1, %eax
je 0x1700
movq (%rbx), %rdi
leaq 0x19c6(%rip), %rsi      # 0x30be
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
leal 0x1(%r13), %esi
movl %r12d, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1726
movq (%rbx), %rdi
leaq 0x19a6(%rip), %rsi      # 0x30c4
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
addl $0x2, %r13d
movl %r13d, %esi
movl %r12d, %edx
callq 0x1110
leaq 0x1991(%rip), %rsi      # 0x30d0
jmp 0x184f
testb $0x1, %r15b
jne 0x17f2
cmpl $-0x1, %eax
movq 0x3888(%rip), %rbx      # 0x4fe0
je 0x176c
movq (%rbx), %rdi
leaq 0x198a(%rip), %rsi      # 0x30ee
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
leal 0x1(%r13), %esi
movl %r12d, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1836
movq (%rbx), %rdi
leaq 0x1966(%rip), %rsi      # 0x30f4
jmp 0x182e
cmpl $-0x1, %eax
movq 0x3843(%rip), %rbx      # 0x4fe0
je 0x17b1
movq (%rbx), %rdi
leaq 0x193f(%rip), %rsi      # 0x30e8
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
leal 0x1(%r13), %esi
movl %r12d, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x17d7
movq (%rbx), %rdi
leaq 0x190d(%rip), %rsi      # 0x30dc
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
addl $0x2, %r13d
movl %r13d, %esi
movl %r12d, %edx
callq 0x1110
leaq 0x18f2(%rip), %rsi      # 0x30e2
jmp 0x184f
cmpl $-0x1, %eax
movq 0x37e4(%rip), %rbx      # 0x4fe0
je 0x1810
movq (%rbx), %rdi
leaq 0x18e6(%rip), %rsi      # 0x30ee
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
leal 0x1(%r13), %esi
movl %r12d, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1836
movq (%rbx), %rdi
leaq 0x18d2(%rip), %rsi      # 0x3100
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
addl $0x2, %r13d
movl %r13d, %esi
movl %r12d, %edx
callq 0x1110
leaq 0x18ab(%rip), %rsi      # 0x30fa
cmpl $-0x1, %eax
leaq 0x38e7(%rip), %r15      # 0x5140
movq -0x30(%rbp), %r12
movb $0xa, %r13b
je 0x186d
movq (%rbx), %rdi
pushq $-0x1
popq %rdx
callq 0x1160
incq %r14
addb $0x7, %r12b
jmp 0x15de
leaq 0x38(%r15), %r12
xorl %r13d, %r13d
cmpq $0x8, %r13
je 0x18f3
movl %r13d, %eax
andl $0x3, %eax
imulq $0xf, %rax, %r15
addq $0xc, %r15
cmpq $0x4, %r13
movl $0x0, %r14d
adcl $0x13, %r14d
xorl %ebx, %ebx
cmpq $0xa, %rbx
je 0x18e3
cmpb $0x1, (%r12,%rbx)
jne 0x18de
movq 0x3728(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leal (%r15,%rbx), %edx
movl %r14d, %esi
callq 0x1110
cmpl $-0x1, %eax
je 0x18de
movq 0x370d(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
pushq $0x23
popq %rsi
callq 0x1130
incq %rbx
jmp 0x18a4
incq %r13
addq $0xa, %r12
movq 0x36ef(%rip), %rbx      # 0x4fe0
jmp 0x1880
leaq 0x3846(%rip), %r15      # 0x5140
movswl 0x12(%r15), %esi
testl %esi, %esi
js 0x1920
movq (%rbx), %rdi
movswl 0x14(%r15), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1920
movq (%rbx), %rdi
pushq $0x7c
popq %rsi
callq 0x1130
movswl 0x16(%r15), %esi
testl %esi, %esi
js 0x1946
movq (%rbx), %rdi
movswl 0x18(%r15), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1946
movq (%rbx), %rdi
pushq $0x2a
popq %rsi
callq 0x1130
movq (%rbx), %rdi
movswl 0xa(%r15), %edx
addl $-0x2, %edx
pushq $0x16
popq %rsi
callq 0x1110
cmpl $-0x1, %eax
je 0x1970
movq (%rbx), %rdi
leaq 0x179e(%rip), %rsi      # 0x3106
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
movswl 0xa(%r15), %edx
addl $-0x2, %edx
pushq $0x17
popq %rsi
callq 0x1110
cmpl $-0x1, %eax
je 0x199a
movq (%rbx), %rdi
leaq 0x1756(%rip), %rsi      # 0x30e8
pushq $-0x1
popq %rdx
callq 0x1160
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x1a07
movzwl 0x6(%rdi), %ebx
cmpw $0x18, 0x4(%rdi)
jl 0x19db
pushq $0x18
popq %rsi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x19db
movq 0x361d(%rip), %r14      # 0x4fe0
movq (%r14), %rdi
pushq $0x51
popq %rdx
xorl %esi, %esi
callq 0x1170
cmpw $0x4f, %bx
movq %r14, %rbx
jg 0x19e8
jmp 0x1a07
cmpw $0x50, %bx
movq 0x35fa(%rip), %rbx      # 0x4fe0
jl 0x1a07
movq (%rbx), %rdi
pushq $0x50
popq %rdx
xorl %esi, %esi
callq 0x1110
cmpl $-0x1, %eax
je 0x1a07
movq (%rbx), %rdi
pushq $0x18
popq %rdx
xorl %esi, %esi
callq 0x1100
movq (%rbx), %rdi
movswl 0xa(%r15), %edx
pushq $0x16
popq %rsi
callq 0x1110
movq (%rbx), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1090