// File: /workspace/github_c_makefile_star2_O1/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 0x39e3(%rip), %r12      # 0x4fe0
movq (%r12), %rdi
callq 0x1030
xorl %ebx, %ebx
leaq 0x3b31(%rip), %r13      # 0x5140
xorl %r14d, %r14d
cmpb $0x1, 0x1a(%r13,%r14)
jne 0x18e0
movl %r14d, %eax
movl $0xcccccccd, %ecx       # imm = 0xCCCCCCCD
imulq %rcx, %rax
shrq $0x23, %rax
imull $0x46, %eax, %eax
movl %ebx, %edx
subl %eax, %edx
movswl 0xc(%r13), %eax
movl %r14d, %r15d
imulq %rcx, %r15
shrq $0x21, %r15
andl $-0x4, %r15d
addl %eax, %r15d
movswl 0xe(%r13), %r13d
addl %r13d, %edx
cmpq $0x9, %r14
movl %edx, -0x2c(%rbp)
ja 0x16e1
movq (%r12), %rdi
movl %r15d, %esi
callq 0x1110
testb $0x1, %r13b
jne 0x172e
cmpl $-0x1, %eax
leaq 0x3abf(%rip), %r13      # 0x5140
je 0x1698
movq (%r12), %rdi
leaq 0x1a30(%rip), %rsi      # 0x30be
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x16c2
movq (%r12), %rdi
leaq 0x1a0c(%rip), %rsi      # 0x30c4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x19ee(%rip), %rsi      # 0x30ca
jmp 0x18cd
movq %r12, %rax
leal -0xa(%r14), %r12d
movq (%rax), %rdi
movl %r15d, %esi
callq 0x1110
cmpl $0x9, %r12d
ja 0x1798
testb $0x1, %r13b
jne 0x17f3
cmpl $-0x1, %eax
movq 0x38cf(%rip), %r12      # 0x4fe0
leaq 0x3a28(%rip), %r13      # 0x5140
je 0x181b
movq (%r12), %rdi
leaq 0x19ad(%rip), %rsi      # 0x30d6
jmp 0x1811
cmpl $-0x1, %eax
leaq 0x3a08(%rip), %r13      # 0x5140
je 0x174f
movq (%r12), %rdi
leaq 0x1979(%rip), %rsi      # 0x30be
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1779
movq (%r12), %rdi
leaq 0x1955(%rip), %rsi      # 0x30c4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x193d(%rip), %rsi      # 0x30d0
jmp 0x18cd
testb $0x1, %r13b
jne 0x1861
cmpl $-0x1, %eax
movq 0x3834(%rip), %r12      # 0x4fe0
leaq 0x398d(%rip), %r13      # 0x5140
je 0x17ca
movq (%r12), %rdi
leaq 0x192e(%rip), %rsi      # 0x30ee
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x18b3
movq (%r12), %rdi
leaq 0x1906(%rip), %rsi      # 0x30f4
jmp 0x18a9
cmpl $-0x1, %eax
movq 0x37e3(%rip), %r12      # 0x4fe0
leaq 0x393c(%rip), %r13      # 0x5140
je 0x181b
movq (%r12), %rdi
leaq 0x18d7(%rip), %rsi      # 0x30e8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1845
movq (%r12), %rdi
leaq 0x18a1(%rip), %rsi      # 0x30dc
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x1883(%rip), %rsi      # 0x30e2
jmp 0x18cd
cmpl $-0x1, %eax
movq 0x3775(%rip), %r12      # 0x4fe0
leaq 0x38ce(%rip), %r13      # 0x5140
je 0x1889
movq (%r12), %rdi
leaq 0x186f(%rip), %rsi      # 0x30ee
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x18b3
movq (%r12), %rdi
leaq 0x1857(%rip), %rsi      # 0x3100
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r12), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x182d(%rip), %rsi      # 0x30fa
cmpl $-0x1, %eax
je 0x18e0
movq (%r12), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
incq %r14
addl $0x7, %ebx
cmpq $0x1e, %r14
jne 0x1612
leaq 0x38(%r13), %r14
xorl %r15d, %r15d
movl %r15d, %eax
andl $0x3, %eax
leaq (%rax,%rax,4), %rax
leaq (%rax,%rax,2), %r12
addq $0xc, %r12
cmpq $0x4, %r15
movl $0x0, %ebx
adcl $0x13, %ebx
xorl %r13d, %r13d
cmpb $0x1, (%r14,%r13)
jne 0x194d
movq 0x36ba(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leal (%r12,%r13), %edx
movl %ebx, %esi
callq 0x1110
cmpl $-0x1, %eax
je 0x194d
movq 0x36a0(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x23, %esi
callq 0x1130
incq %r13
cmpq $0xa, %r13
jne 0x1918
incq %r15
addq $0xa, %r14
cmpq $0x8, %r15
jne 0x18f7
leaq 0x37d6(%rip), %r15      # 0x5140
movswl 0x12(%r15), %esi
testl %esi, %esi
movq 0x3668(%rip), %r14      # 0x4fe0
js 0x1999
movq (%r14), %rdi
movswl 0x14(%r15), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1999
movq (%r14), %rdi
movl $0x7c, %esi
callq 0x1130
movswl 0x16(%r15), %esi
testl %esi, %esi
js 0x19c1
movq (%r14), %rdi
movswl 0x18(%r15), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x19c1
movq (%r14), %rdi
movl $0x2a, %esi
callq 0x1130
movq (%r14), %rdi
movswl 0xa(%r15), %edx
addl $-0x2, %edx
movl $0x16, %esi
callq 0x1110
cmpl $-0x1, %eax
je 0x19ef
movq (%r14), %rdi
leaq 0x1721(%rip), %rsi      # 0x3106
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r14), %rdi
movswl 0xa(%r15), %edx
addl $-0x2, %edx
movl $0x17, %esi
callq 0x1110
cmpl $-0x1, %eax
je 0x1a1d
movq (%r14), %rdi
leaq 0x16d5(%rip), %rsi      # 0x30e8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1a2f
cmpw $0x18, 0x4(%rdi)
setge %al
jmp 0x1a31
xorl %eax, %eax
testq %rdi, %rdi
je 0x1a40
cmpw $0x50, 0x6(%rdi)
setge %bl
jmp 0x1a42
xorl %ebx, %ebx
testb %al, %al
je 0x1a66
movl $0x18, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1a66
movq (%r14), %rdi
xorl %esi, %esi
movl $0x51, %edx
callq 0x1170
testb %bl, %bl
je 0x1a8d
movq (%r14), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1a8d
movq (%r14), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x1100
movq (%r14), %rdi
movswl 0xa(%r15), %edx
movl $0x16, %esi
callq 0x1110
movq (%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1090