// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Formation.cpp
// Function: TeammateFormation::SetVInterval(double, double, double)
void TeammateFormation::SetVInterval(double back, double middle, double front) {
  double max_wide =
      Max(back * (mLineArrange[1] - 1), middle * (mLineArrange[2] - 1));
  max_wide = Max(max_wide, front * (mLineArrange[3] - 1));
  mVBallFactor = (m_FORMATION_MAX_Y - max_wide / 2.0) /
                 ServerParam::instance().PITCH_WIDTH * 2.0;
  mVBallFactor = Max(0.0, mVBallFactor);

  RoleType role_i, role_j;
  for (int i = 1; i <= TEAMSIZE; ++i) {
    role_i = mPlayerRole[i];
    mActiveField[i].SetTop(-m_FORMATION_MAX_Y +
                           (role_i.mIndexY - 1) * mVInterval[role_i.mIndexX]);
    mActiveField[i].SetBottom(m_FORMATION_MAX_Y -
                              (mLineArrange[role_i.mIndexX] - role_i.mIndexY) *
                                  mVInterval[role_i.mIndexX]);
    double iy = (role_i.mIndexY - (mLineArrange[role_i.mIndexX] + 1) / 2.0) *
                mVInterval[role_i.mIndexX];
    mOffsetMatrix[0][i].SetY(iy);
    mOffsetMatrix[i][0].SetY(-iy);

    for (int j = 1; j <= TEAMSIZE; ++j) {
      role_j = mPlayerRole[j];
      double jy = (role_j.mIndexY - (mLineArrange[role_j.mIndexX] + 1) / 2.0) *
                  mVInterval[role_j.mIndexX];
      mOffsetMatrix[i][j].SetY(jy - iy);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movsd %xmm1, -0x18(%rbp)
movsd %xmm2, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x130(%rbp)
movsd -0x10(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
addq $0x40, %rdi
movq $0x1, -0x38(%rbp)
leaq -0x38(%rbp), %rsi
callq 0x40280
movsd -0x150(%rbp), %xmm0
movq -0x130(%rbp), %rdi
movl (%rax), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
addq $0x40, %rdi
movq $0x2, -0x48(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x40280
movsd -0x148(%rbp), %xmm0
movl (%rax), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x12a90
movq -0x130(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
addq $0x40, %rdi
movq $0x3, -0x58(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x40280
movsd -0x140(%rbp), %xmm0
movl (%rax), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x12a90
movq %rax, %rcx
movq -0x130(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0xc98(%rax), %xmm0
movsd -0x28(%rbp), %xmm1
movsd 0x8606a(%rip), %xmm2    # 0xc14b0
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x138(%rbp)
callq 0x855e0
movsd -0x138(%rbp), %xmm0
movq -0x130(%rbp), %rsi
leaq 0x88bcf(%rip), %rax     # 0xc4040
divsd (%rax), %xmm0
movsd 0x86033(%rip), %xmm1    # 0xc14b0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x58(%rsi)
xorps %xmm0, %xmm0
movsd %xmm0, -0x60(%rbp)
addq $0x58, %rsi
leaq -0x60(%rbp), %rdi
callq 0x12a90
movq %rax, %rcx
movq -0x130(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x58(%rax)
leaq -0x70(%rbp), %rdi
callq 0x40300
leaq -0x80(%rbp), %rdi
callq 0x40300
movl $0x1, -0x84(%rbp)
cmpl $0xb, -0x84(%rbp)
jg 0x3b93c
movq -0x130(%rbp), %rdi
addq $0x60, %rdi
leaq -0x84(%rbp), %rsi
callq 0x40240
movq -0x130(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, -0x70(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
addq $0x110, %rdi            # imm = 0x110
leaq -0x84(%rbp), %rsi
callq 0x3fb70
movq -0x130(%rbp), %rdi
movq %rax, -0x180(%rbp)
movsd 0xc98(%rdi), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x188(%rbp)
movl -0x6c(%rbp), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x190(%rbp)
addq $0x20, %rdi
movslq -0x70(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x402e0
movsd -0x190(%rbp), %xmm0
movsd -0x188(%rbp), %xmm1
movq -0x180(%rbp), %rdi
movsd (%rax), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x40350
movq -0x130(%rbp), %rdi
addq $0x110, %rdi            # imm = 0x110
leaq -0x84(%rbp), %rsi
callq 0x3fb70
movq -0x130(%rbp), %rdi
movq %rax, -0x168(%rbp)
movsd 0xc98(%rdi), %xmm0
movsd %xmm0, -0x170(%rbp)
addq $0x40, %rdi
movslq -0x70(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0xa8(%rbp), %rsi
callq 0x40280
movq -0x130(%rbp), %rdi
movl (%rax), %eax
subl -0x6c(%rbp), %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x178(%rbp)
addq $0x20, %rdi
movslq -0x70(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0xb0(%rbp), %rsi
callq 0x402e0
movsd -0x178(%rbp), %xmm0
movsd -0x170(%rbp), %xmm1
movq -0x168(%rbp), %rdi
movsd (%rax), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
leaq -0xa0(%rbp), %rsi
callq 0x40370
movq -0x130(%rbp), %rdi
cvtsi2sdl -0x6c(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
addq $0x40, %rdi
movslq -0x70(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x40280
movsd -0x160(%rbp), %xmm0
movq -0x130(%rbp), %rdi
movl (%rax), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm1
movsd 0x85ddd(%rip), %xmm2    # 0xc14b0
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x158(%rbp)
addq $0x20, %rdi
movslq -0x70(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0xc8(%rbp), %rsi
callq 0x402e0
movsd -0x158(%rbp), %xmm0
movq -0x130(%rbp), %rdi
mulsd (%rax), %xmm0
movsd %xmm0, -0xb8(%rbp)
addq $0x380, %rdi            # imm = 0x380
movq $0x0, -0xd0(%rbp)
leaq -0xd0(%rbp), %rsi
callq 0x3fb30
movq %rax, %rdi
movslq -0x84(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0xd8(%rbp), %rsi
callq 0x3fb50
movq %rax, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x26210
movq -0x130(%rbp), %rdi
addq $0x380, %rdi            # imm = 0x380
movslq -0x84(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rsi
callq 0x3fb30
movq %rax, %rdi
movq $0x0, -0xe8(%rbp)
leaq -0xe8(%rbp), %rsi
callq 0x3fb50
movq %rax, %rdi
movsd -0xb8(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0xf0(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0x26210
movl $0x1, -0xf4(%rbp)
cmpl $0xb, -0xf4(%rbp)
jg 0x3b926
movq -0x130(%rbp), %rdi
addq $0x60, %rdi
leaq -0xf4(%rbp), %rsi
callq 0x40240
movq -0x130(%rbp), %rdi
movq (%rax), %rcx
movq %rcx, -0x80(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x78(%rbp)
cvtsi2sdl -0x7c(%rbp), %xmm0
movsd %xmm0, -0x1a0(%rbp)
addq $0x40, %rdi
movslq -0x80(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x108(%rbp), %rsi
callq 0x40280
movsd -0x1a0(%rbp), %xmm0
movq -0x130(%rbp), %rdi
movl (%rax), %eax
addl $0x1, %eax
cvtsi2sd %eax, %xmm1
movsd 0x85c49(%rip), %xmm2    # 0xc14b0
divsd %xmm2, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x198(%rbp)
addq $0x20, %rdi
movslq -0x80(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x110(%rbp), %rsi
callq 0x402e0
movsd -0x198(%rbp), %xmm0
movq -0x130(%rbp), %rdi
mulsd (%rax), %xmm0
movsd %xmm0, -0x100(%rbp)
addq $0x380, %rdi            # imm = 0x380
movslq -0x84(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x118(%rbp), %rsi
callq 0x3fb30
movq %rax, %rdi
movslq -0xf4(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0x120(%rbp), %rsi
callq 0x3fb50
movq %rax, %rdi
movsd -0x100(%rbp), %xmm0
subsd -0xb8(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
leaq -0x128(%rbp), %rsi
callq 0x26210
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0x3b7e5
jmp 0x3b928
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x3b4ca
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
nopw %cs:(%rax,%rax)