// File: therealgymmy[P]HelicopterGame/src/helicopter.cpp
// Function: Helicopter::move()
void Helicopter::move () {
    if ((up_    || ++delayU < delayUp_  )  &&
        y_ > top_.h()) {
        y_ -= (speed_ - 0.3 * delayU);
    }

    if ((down_  || ++delayD < delayDown_)  &&
        y_ < PLANE_H) {
        y_ += (speed_ - 0.3 * delayD);
    }

    if ((left_  || ++delayL < delayLeft_)  &&
        x_ > 0) {
        x_ -= (speed_ - 0.3 * delayL);
    }

    if ((right_ || ++delayR < delayRight_) &&
        x_ < PLANE_W - w_) {
        x_ += (speed_ - 0.3 * delayR);
    }

    if (delayU >= delayUp_) {
        delayU = 0;
        delayUp_ = 0;
    }
    if (delayD >= delayDown_) {
        delayD = 0;
        delayDown_ = 0;
    }
    if (delayR >= delayRight_) {
        delayR = 0;
        delayRight_ = 0;
    }
    if (delayL >= delayLeft_) {
        delayL = 0;
        delayLeft_ = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
testb $0x1, (%rax)
jne 0x8761
movq -0x10(%rbp), %rcx
movl 0xab71(%rip), %eax      # 0x132c4
addl $0x1, %eax
movl %eax, 0xab68(%rip)      # 0x132c4
cmpl 0x4(%rcx), %eax
jge 0x87ad
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x14(%rbp)
callq 0x8af0
movl %eax, %ecx
movl -0x14(%rbp), %eax
cmpl %ecx, %eax
jle 0x87ad
movq -0x10(%rbp), %rax
cvtsi2sdl 0xab03(%rip), %xmm0 # 0x13288
cvtsi2sdl 0xab37(%rip), %xmm1 # 0x132c4
movsd 0x4b13(%rip), %xmm2     # 0xd2a8
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsi2sdl 0x18(%rax), %xmm0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x1(%rax)
jne 0x87cf
movq -0x10(%rbp), %rcx
movl 0xab07(%rip), %eax      # 0x132c8
addl $0x1, %eax
movl %eax, 0xaafe(%rip)      # 0x132c8
cmpl 0x8(%rcx), %eax
jge 0x8810
movq -0x10(%rbp), %rax
cmpl $0xbb8, 0x18(%rax)      # imm = 0xBB8
jge 0x8810
movq -0x10(%rbp), %rax
cvtsi2sdl 0xaaa0(%rip), %xmm0 # 0x13288
cvtsi2sdl 0xaad8(%rip), %xmm1 # 0x132c8
movsd 0x4ab0(%rip), %xmm2     # 0xd2a8
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsi2sdl 0x18(%rax), %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x2(%rax)
jne 0x8832
movq -0x10(%rbp), %rcx
movl 0xaaa8(%rip), %eax      # 0x132cc
addl $0x1, %eax
movl %eax, 0xaa9f(%rip)      # 0x132cc
cmpl 0xc(%rcx), %eax
jge 0x8870
movq -0x10(%rbp), %rax
cmpl $0x0, 0x14(%rax)
jle 0x8870
movq -0x10(%rbp), %rax
cvtsi2sdl 0xaa40(%rip), %xmm0 # 0x13288
cvtsi2sdl 0xaa7c(%rip), %xmm1 # 0x132cc
movsd 0x4a50(%rip), %xmm2     # 0xd2a8
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsi2sdl 0x14(%rax), %xmm0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x3(%rax)
jne 0x8892
movq -0x10(%rbp), %rcx
movl 0xaa4c(%rip), %eax      # 0x132d0
addl $0x1, %eax
movl %eax, 0xaa43(%rip)      # 0x132d0
cmpl 0x10(%rcx), %eax
jge 0x88dc
movq -0x10(%rbp), %rax
movl 0x14(%rax), %eax
movl $0xfa0, %ecx            # imm = 0xFA0
subl 0xaa18(%rip), %ecx      # 0x132bc
cmpl %ecx, %eax
jge 0x88dc
movq -0x10(%rbp), %rax
cvtsi2sdl 0xa9d4(%rip), %xmm0 # 0x13288
cvtsi2sdl 0xaa14(%rip), %xmm1 # 0x132d0
movsd 0x49e4(%rip), %xmm2     # 0xd2a8
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
cvtsi2sdl 0x14(%rax), %xmm0
addsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rcx
movl 0xa9de(%rip), %eax      # 0x132c4
cmpl 0x4(%rcx), %eax
jl 0x8900
movq -0x10(%rbp), %rax
movl $0x0, 0xa9cb(%rip)      # 0x132c4
movl $0x0, 0x4(%rax)
movq -0x10(%rbp), %rcx
movl 0xa9be(%rip), %eax      # 0x132c8
cmpl 0x8(%rcx), %eax
jl 0x8924
movq -0x10(%rbp), %rax
movl $0x0, 0xa9ab(%rip)      # 0x132c8
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rcx
movl 0xa9a2(%rip), %eax      # 0x132d0
cmpl 0x10(%rcx), %eax
jl 0x8948
movq -0x10(%rbp), %rax
movl $0x0, 0xa98f(%rip)      # 0x132d0
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rcx
movl 0xa97a(%rip), %eax      # 0x132cc
cmpl 0xc(%rcx), %eax
jl 0x896c
movq -0x10(%rbp), %rax
movl $0x0, 0xa967(%rip)      # 0x132cc
movl $0x0, 0xc(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)