// File: /workspace/github_cpp_makefile_star2_O3/wrighteagle2d[P]wrighteaglebase/Debug/../src/Kicker.h
// Function: Kicker::NearestPoint(Vector const&)
inline int NearestPoint(const Vector &p) {
    double ang = 0.0;
    double value = p.Mod();
    int idxA;
    if (value < mD1) {
      double fix = 180.0 / mNlayer[0];
      ang = p.Dir() + fix;
      ang = GetNormalizeAngleDeg(ang, 0.0);
      idxA = int(ang * mNlayer[0] / 360.0);
      return idxA;
    } else if (value > mD2) {
      double fix = 180.0 / mNlayer[2];
      ang = p.Dir() + fix;
      ang = GetNormalizeAngleDeg(ang, 0.0);
      idxA = int(ang * mNlayer[2] / 360.0);
      return mNlayer[0] + mNlayer[1] + idxA;
    } else {
      double fix = 180.0 / mNlayer[1];
      ang = p.Dir() + fix;
      ang = GetNormalizeAngleDeg(ang, 0.0);
      idxA = int(ang * mNlayer[1] / 360.0);
      return mNlayer[0] + idxA;
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movsd (%rsi), %xmm0
movsd 0x8(%rsi), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
sqrtsd %xmm0, %xmm0
movsd 0x20(%rdi), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x328c9
xorps %xmm0, %xmm0
cvtsi2sdl 0x10(%rbx), %xmm0
movsd 0x367b3(%rip), %xmm1    # 0x69048
divsd %xmm0, %xmm1
movsd %xmm1, -0x10(%rbp)
movq %rsi, %rdi
callq 0xe702
addsd -0x10(%rbp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3291f
movsd 0x367b3(%rip), %xmm2    # 0x69070
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x328bd
jmp 0x32943
ucomisd 0x28(%rbx), %xmm0
jbe 0x32960
xorps %xmm0, %xmm0
cvtsi2sdl 0x18(%rbx), %xmm0
movsd 0x36764(%rip), %xmm1    # 0x69048
divsd %xmm0, %xmm1
movsd %xmm1, -0x10(%rbp)
movq %rsi, %rdi
callq 0xe702
addsd -0x10(%rbp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x329a4
movsd 0x36760(%rip), %xmm2    # 0x69070
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x32910
jmp 0x329c8
ucomisd 0x36749(%rip), %xmm0    # 0x69070
jb 0x32943
movsd 0x36737(%rip), %xmm1    # 0x69068
movsd 0x36737(%rip), %xmm2    # 0x69070
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x32939
xorps %xmm1, %xmm1
cvtsi2sdl 0x10(%rbx), %xmm1
mulsd %xmm0, %xmm1
divsd 0x36719(%rip), %xmm1    # 0x69070
cvttsd2si %xmm1, %eax
jmp 0x32a29
xorps %xmm0, %xmm0
cvtsi2sdl 0x14(%rbx), %xmm0
movsd 0x366d8(%rip), %xmm1    # 0x69048
divsd %xmm0, %xmm1
movsd %xmm1, -0x10(%rbp)
movq %rsi, %rdi
callq 0xe702
addsd -0x10(%rbp), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x329ea
movsd 0x366d8(%rip), %xmm2    # 0x69070
addsd %xmm2, %xmm0
ucomisd %xmm0, %xmm1
ja 0x32998
jmp 0x32a0e
ucomisd 0x366c4(%rip), %xmm0    # 0x69070
jb 0x329c8
movsd 0x366b2(%rip), %xmm1    # 0x69068
movsd 0x366b2(%rip), %xmm2    # 0x69070
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x329be
xorps %xmm1, %xmm1
cvtsi2sdl 0x18(%rbx), %xmm1
mulsd %xmm0, %xmm1
divsd 0x36694(%rip), %xmm1    # 0x69070
cvttsd2si %xmm1, %ecx
movl 0x14(%rbx), %eax
addl 0x10(%rbx), %eax
addl %ecx, %eax
jmp 0x32a29
ucomisd 0x3667e(%rip), %xmm0    # 0x69070
jb 0x32a0e
movsd 0x3666c(%rip), %xmm1    # 0x69068
movsd 0x3666c(%rip), %xmm2    # 0x69070
addsd %xmm1, %xmm0
ucomisd %xmm2, %xmm0
jae 0x32a04
xorps %xmm1, %xmm1
cvtsi2sdl 0x14(%rbx), %xmm1
mulsd %xmm0, %xmm1
divsd 0x3664e(%rip), %xmm1    # 0x69070
cvttsd2si %xmm1, %eax
addl 0x10(%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq