// File: /workspace/github_c_makefile_star2_O3/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 0x39fc(%rip), %r13      # 0x4fe0
movq (%r13), %rdi
callq 0x1030
xorl %ebx, %ebx
leaq 0x3b4a(%rip), %r12      # 0x5140
xorl %r14d, %r14d
cmpb $0x1, 0x1a(%r12,%r14)
jne 0x18c8
movzbl %r14b, %eax
imull $0xcd, %eax, %eax
shrl $0xb, %eax
imull $0x46, %eax, %eax
movl %ebx, %ecx
subb %al, %cl
movswl 0xc(%r12), %eax
movzbl %r14b, %edx
imull $0xcd, %edx, %edx
shrl $0xb, %edx
leal (%rax,%rdx,4), %r15d
movswl 0xe(%r12), %r12d
movzbl %cl, %edx
addl %r12d, %edx
cmpq $0x9, %r14
movl %edx, -0x2c(%rbp)
ja 0x16c9
movq (%r13), %rdi
movl %r15d, %esi
callq 0x1110
testb $0x1, %r12b
jne 0x1716
cmpl $-0x1, %eax
leaq 0x3ad7(%rip), %r12      # 0x5140
je 0x1680
movq (%r13), %rdi
leaq 0x1a48(%rip), %rsi      # 0x30be
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x16aa
movq (%r13), %rdi
leaq 0x1a24(%rip), %rsi      # 0x30c4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x1a06(%rip), %rsi      # 0x30ca
jmp 0x18b5
movq %r13, %rax
leal -0xa(%r14), %r13d
movq (%rax), %rdi
movl %r15d, %esi
callq 0x1110
cmpl $0x9, %r13d
ja 0x1780
testb $0x1, %r12b
jne 0x17db
cmpl $-0x1, %eax
movq 0x38e7(%rip), %r13      # 0x4fe0
leaq 0x3a40(%rip), %r12      # 0x5140
je 0x1803
movq (%r13), %rdi
leaq 0x19c5(%rip), %rsi      # 0x30d6
jmp 0x17f9
cmpl $-0x1, %eax
leaq 0x3a20(%rip), %r12      # 0x5140
je 0x1737
movq (%r13), %rdi
leaq 0x1991(%rip), %rsi      # 0x30be
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1761
movq (%r13), %rdi
leaq 0x196d(%rip), %rsi      # 0x30c4
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x1955(%rip), %rsi      # 0x30d0
jmp 0x18b5
testb $0x1, %r12b
jne 0x1849
cmpl $-0x1, %eax
movq 0x384c(%rip), %r13      # 0x4fe0
leaq 0x39a5(%rip), %r12      # 0x5140
je 0x17b2
movq (%r13), %rdi
leaq 0x1946(%rip), %rsi      # 0x30ee
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x189b
movq (%r13), %rdi
leaq 0x191e(%rip), %rsi      # 0x30f4
jmp 0x1891
cmpl $-0x1, %eax
movq 0x37fb(%rip), %r13      # 0x4fe0
leaq 0x3954(%rip), %r12      # 0x5140
je 0x1803
movq (%r13), %rdi
leaq 0x18ef(%rip), %rsi      # 0x30e8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x182d
movq (%r13), %rdi
leaq 0x18b9(%rip), %rsi      # 0x30dc
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x189b(%rip), %rsi      # 0x30e2
jmp 0x18b5
cmpl $-0x1, %eax
movq 0x378d(%rip), %r13      # 0x4fe0
leaq 0x38e6(%rip), %r12      # 0x5140
je 0x1871
movq (%r13), %rdi
leaq 0x1887(%rip), %rsi      # 0x30ee
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
leal 0x1(%r15), %esi
movl -0x2c(%rbp), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x189b
movq (%r13), %rdi
leaq 0x186f(%rip), %rsi      # 0x3100
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r13), %rdi
addl $0x2, %r15d
movl %r15d, %esi
movl -0x2c(%rbp), %edx
callq 0x1110
leaq 0x1845(%rip), %rsi      # 0x30fa
cmpl $-0x1, %eax
je 0x18c8
movq (%r13), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
incq %r14
addb $0x7, %bl
cmpq $0x1e, %r14
jne 0x15f9
leaq 0x38(%r12), %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 0x1936
movq 0x36d1(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
leal (%r12,%r13), %edx
movl %ebx, %esi
callq 0x1110
cmpl $-0x1, %eax
je 0x1936
movq 0x36b7(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movl $0x23, %esi
callq 0x1130
incq %r13
cmpq $0xa, %r13
jne 0x1901
incq %r15
addq $0xa, %r14
cmpq $0x8, %r15
jne 0x18e0
leaq 0x37ed(%rip), %r15      # 0x5140
movswl 0x12(%r15), %esi
testl %esi, %esi
movq 0x367f(%rip), %r14      # 0x4fe0
js 0x1982
movq (%r14), %rdi
movswl 0x14(%r15), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1982
movq (%r14), %rdi
movl $0x7c, %esi
callq 0x1130
movswl 0x16(%r15), %esi
testl %esi, %esi
js 0x19aa
movq (%r14), %rdi
movswl 0x18(%r15), %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x19aa
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 0x19d8
movq (%r14), %rdi
leaq 0x1738(%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 0x1a06
movq (%r14), %rdi
leaq 0x16ec(%rip), %rsi      # 0x30e8
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1160
movq (%r14), %rdi
testq %rdi, %rdi
je 0x1a6a
movzwl 0x6(%rdi), %ebx
cmpw $0x18, 0x4(%rdi)
jl 0x1a41
movl $0x18, %esi
xorl %edx, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1a41
movq (%r14), %rdi
xorl %esi, %esi
movl $0x51, %edx
callq 0x1170
cmpw $0x4f, %bx
jg 0x1a47
jmp 0x1a6a
cmpw $0x50, %bx
jl 0x1a6a
movq (%r14), %rdi
xorl %esi, %esi
movl $0x50, %edx
callq 0x1110
cmpl $-0x1, %eax
je 0x1a6a
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