// File: /workspace/github_c_makefile_star2_O1/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 0x7eec
movq (%rbx), %rdi
leaq 0x6463b(%rip), %rdx     # 0x6c0ea
movl $0xfffffffd, %esi       # imm = 0xFFFFFFFD
callq 0x84e2
movq (%rbx), %rdi
leaq 0x64635(%rip), %rdx     # 0x6c0f8
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
callq 0x84e2
movq (%rbx), %rdi
leaq 0x6462a(%rip), %rdx     # 0x6c101
movl $0x2, %esi
callq 0x84e2
movl $0x6, %edi
movl $0x6, %esi
xorl %edx, %edx
callq 0x7050
movq 0x814e7(%rip), %r13     # 0x88fe0
movq (%r13), %rdi
movl $0x20600, %esi          # imm = 0x20600
xorl %edx, %edx
callq 0x7160
movq (%rbx), %rdi
leaq 0x6460b(%rip), %rdx     # 0x6c11e
movl $0xa, %esi
callq 0x84e2
movq (%r13), %rdi
movl $0x20600, %esi          # imm = 0x20600
xorl %edx, %edx
callq 0x7380
leaq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x852e
movq (%rbx), %rdi
callq 0x7e92
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x3, %eax
je 0x7c9d
cmpl $0x71, %eax
je 0x7c9d
leaq 0x20(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x8580
testb %al, %al
je 0x7c30
leaq 0x8(%rsp), %r12
movq (%r13), %rdi
callq 0x70f0
cmpl $-0x1, %eax
je 0x7bb0
cmpl $0x3, %eax
je 0x7c9d
cmpl $0x71, %eax
je 0x7c9d
movq (%r13), %rdi
callq 0x70f0
cmpl $-0x1, %eax
jne 0x7b94
movabsq $-0x4016666666666666, %rax # imm = 0xBFE999999999999A
movq %rax, 0x10(%rbx)
movq (%rbx), %rdi
callq 0x7eec
movq %r15, %rdi
callq 0x8638
movq %r15, %rdi
callq 0x8716
movsd 0x10(%rbx), %xmm0
addsd 0x6443b(%rip), %xmm0    # 0x6c010
movsd %xmm0, 0x10(%rbx)
addsd 0x8(%rbx), %xmm0
movsd %xmm0, 0x8(%rbx)
movq %r14, %rdi
callq 0x852e
callq 0x7490
movq $0x0, 0x8(%rsp)
movq $0x3fe56c0, 0x10(%rsp)  # imm = 0x3FE56C0
movq %r12, %rdi
movq %r12, %rsi
callq 0x70c0
cmpl $-0x1, %eax
jne 0x7c1d
callq 0x7030
cmpl $0x4, (%rax)
je 0x7c03
movq %r14, %rdi
movq %r15, %rsi
callq 0x8580
testb %al, %al
jne 0x7b74
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 0x8972
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