// File: /workspace/github_c_makefile_star2_O2/skeeto[P]flappy/flappy.cc
// Function: Game::run()
int run() {
    display->erase();
    const char *title = "Flappy Curses", *version = "v" STR(VERSION),
               *intro = "[Press SPACE to hop upwards]",
                 *url = "https://github.com/skeeto/flappy";
    display->center(-3, title);
    display->center(-2, version);
    display->center(2, intro);
    init_pair(6, COLOR_CYAN, COLOR_BLACK);
    attron(COLOR_PAIR(6) | A_UNDERLINE);
    display->center(10, url);
    attroff(COLOR_PAIR(6) | A_UNDERLINE);
    bird.draw();
    if (is_exit(display->block_getch())) return -1;
    while (bird.is_alive(world)) {
      int c = getch();
      if (is_exit(c)) {
        return -1;
      } else if (c != ERR) {
        while (getch() != ERR)
          ;  // clear repeat buffer
        bird.poke();
      }
      display->erase();
      world.step();
      world.draw();
      bird.gravity();
      bird.draw();
      display->refresh();
      std::this_thread::sleep_for(std::chrono::milliseconds{67});
    }
    init_pair(5, COLOR_RED, COLOR_BLACK);
    attron(COLOR_PAIR(5) | A_BOLD);
    bird.draw('X');
    attroff(COLOR_PAIR(5) | A_BOLD);
    display->refresh();
    return world.score();
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x7e06
movq (%rbx), %rdi
leaq 0x576cc(%rip), %rdx     # 0x5f0ea
pushq $-0x3
popq %rsi
callq 0x8434
movq (%rbx), %rdi
leaq 0x576c8(%rip), %rdx     # 0x5f0f8
pushq $-0x2
popq %rsi
callq 0x8434
movq (%rbx), %rdi
leaq 0x576bf(%rip), %rdx     # 0x5f101
pushq $0x2
popq %rsi
callq 0x8434
pushq $0x6
popq %rdi
movl %edi, %esi
xorl %edx, %edx
callq 0x7050
movq 0x78583(%rip), %rbp     # 0x7ffe0
movq (%rbp), %rdi
movl $0x20600, %esi          # imm = 0x20600
xorl %edx, %edx
callq 0x7170
movq (%rbx), %rdi
leaq 0x576a7(%rip), %rdx     # 0x5f11e
pushq $0xa
popq %rsi
callq 0x8434
movq (%rbp), %rdi
movl $0x20600, %esi          # imm = 0x20600
xorl %edx, %edx
callq 0x7390
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x847a
movq (%rbx), %rdi
callq 0x7dae
pushq $-0x1
popq %r15
cmpl $0x3, %eax
je 0x7bbd
cmpl $0x71, %eax
je 0x7bbd
leaq 0x20(%rbx), %r12
movq %rsp, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0x84c6
testb %al, %al
je 0x7b65
movq (%rbp), %rdi
callq 0x70f0
cmpl $-0x1, %eax
je 0x7b0f
cmpl $0x3, %eax
je 0x7bbd
cmpl $0x71, %eax
je 0x7bbd
movq (%rbp), %rdi
callq 0x70f0
cmpl $-0x1, %eax
jne 0x7af3
movabsq $-0x4016666666666666, %rax # imm = 0xBFE999999999999A
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
callq 0x7e06
movq %r12, %rdi
callq 0x853c
movq %r12, %rdi
callq 0x85bc
movsd 0x10(%rbx), %xmm0
addsd 0x574f4(%rip), %xmm0    # 0x5f028
movsd %xmm0, 0x10(%rbx)
addsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rbx)
movq %r14, %rdi
callq 0x847a
callq 0x74c0
movq $0x43, (%rsp)
movq %r13, %rdi
callq 0x877c
jmp 0x7ac0
pushq $0x5
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x7050
movq (%rbp), %rdi
movl $0x200500, %esi         # imm = 0x200500
xorl %edx, %edx
callq 0x7170
pushq $0x58
popq %rsi
movq %r14, %rdi
callq 0x87d2
movq (%rbp), %rdi
movl $0x200500, %esi         # imm = 0x200500
xorl %edx, %edx
callq 0x7390
callq 0x74c0
movl 0x78(%rbx), %eax
addl $-0x2, %eax
pushq $0x14
popq %rcx
cltd
idivl %ecx
cmpl $0x3, %eax
pushq $0x2
popq %r15
cmovgel %eax, %r15d
addl $-0x2, %r15d
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop