// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x7ec0
movq (%rbx), %rdi
leaq 0x6566f(%rip), %rdx     # 0x6d0ea
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x84be
movq (%rbx), %rdi
leaq 0x65669(%rip), %rdx     # 0x6d0f8
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x84be
movq (%rbx), %rdi
leaq 0x6565e(%rip), %rdx     # 0x6d101
movl $0x2, %esi
callq 0x84be
movl $0x6, %edi
movl $0x6, %esi
xorl %edx, %edx
callq 0x7050
movq 0x8251b(%rip), %r13     # 0x89fe0
movq (%r13), %rdi
movl $0x20600, %esi          # imm = 0x20600
xorl %edx, %edx
callq 0x7160
movq (%rbx), %rdi
leaq 0x6563f(%rip), %rdx     # 0x6d11e
movl $0xa, %esi
callq 0x84be
movq (%r13), %rdi
movl $0x20600, %esi          # imm = 0x20600
xorl %edx, %edx
callq 0x7380
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x850a
movq (%rbx), %rdi
callq 0x7e66
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, %eax
je 0x7c69
cmpl $0x71, %eax
je 0x7c69
leaq 0x20(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x855c
testb %al, %al
je 0x7bfc
leaq 0x8(%rsp), %r12
movq (%r13), %rdi
callq 0x70f0
cmpl $-0x1, %eax
je 0x7b7c
cmpl $0x3, %eax
je 0x7c69
cmpl $0x71, %eax
je 0x7c69
movq (%r13), %rdi
callq 0x70f0
cmpl $-0x1, %eax
jne 0x7b60
movabsq $-0x4016666666666666, %rax # imm = 0xBFE999999999999A
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
callq 0x7ec0
movq %r15, %rdi
callq 0x8608
movq %r15, %rdi
callq 0x86e6
movsd 0x10(%rbx), %xmm0
addsd 0x6546f(%rip), %xmm0    # 0x6d010
movsd %xmm0, 0x10(%rbx)
addsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rbx)
movq %r14, %rdi
callq 0x850a
callq 0x7490
movq $0x0, 0x8(%rsp)
movq $0x3fe56c0, 0x10(%rsp)  # imm = 0x3FE56C0
movq %r12, %rdi
movq %r12, %rsi
callq 0x70c0
cmpl $-0x1, %eax
jne 0x7be9
callq 0x7030
cmpl $0x4, (%rax)
je 0x7bcf
movq %r14, %rdi
movq %r15, %rsi
callq 0x855c
testb %al, %al
jne 0x7b40
movl $0x5, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x7050
movq (%r13), %rdi
movl $0x200500, %esi         # imm = 0x200500
xorl %edx, %edx
callq 0x7160
movq %r14, %rdi
movl $0x58, %esi
callq 0x893a
movq (%r13), %rdi
movl $0x200500, %esi         # imm = 0x200500
xorl %edx, %edx
callq 0x7380
callq 0x7490
movl 0x78(%rbx), %eax
addl $-0x2, %eax
cltq
imulq $0x66666667, %rax, %rax # imm = 0x66666667
movq %rax, %rcx
shrq $0x3f, %rcx
sarq $0x23, %rax
addl %ecx, %eax
cmpl $0x3, %eax
movl $0x2, %ebp
cmovgel %eax, %ebp
addl $-0x2, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq