// File: WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::createBCC()
void CMolecularSystem::createBCC()
{
  int t;
  int bu;
  bu = this->parameter->baseunit;
  if (bu != -1)
  {
    if (parameter->nop != -1) {cerr << "how comes that numberofparticles is already set in createbcc?\n";}
    this->parameter->nop = 2*bu*bu*bu;
    this->initializeMolecules(2*bu*bu*bu);
    for (int jz=0; jz < 2*bu ; jz++)
    {
      for (int jy=0; jy < bu ; jy++)
      {
        for (int jx = 0; jx < bu; jx++)
        {
          t = bu*bu*jz + bu*jy + jx;
          this->molecules[t].posx = double(jx)*this->parameter->boxx/double(bu) + this->parameter->boxx/double(2*bu) * (jz % 2);
          this->molecules[t].posy = double(jy)*this->parameter->boxy/double(bu) + this->parameter->boxy/double(2*bu) * (jz % 2);
          this->molecules[t].posz = double(jz)*this->parameter->boxz/double(2*bu);
        }
      }
    }
  } else { cerr << "baseunit is not set, which is needed for createBCC\n";}
  setNumberOfCells();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0xb4e8c0(%rax), %rax
movl 0x320c(%rax), %eax
movl %eax, -0x10(%rbp)
cmpl $-0x1, -0x10(%rbp)
je 0x52a7
movq -0x28(%rbp), %rax
movq 0xb4e8c0(%rax), %rax
cmpl $-0x1, 0x3208(%rax)
je 0x50d5
movq 0x9f27(%rip), %rdi      # 0xeff0
leaq 0x721c(%rip), %rsi      # 0xc2ec
callq 0x3200
movq -0x28(%rbp), %rdi
movl -0x10(%rbp), %ecx
shll %ecx
imull -0x10(%rbp), %ecx
imull -0x10(%rbp), %ecx
movq 0xb4e8c0(%rdi), %rax
movl %ecx, 0x3208(%rax)
movl -0x10(%rbp), %esi
shll %esi
imull -0x10(%rbp), %esi
imull -0x10(%rbp), %esi
callq 0x4a00
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl -0x10(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x52a5
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x5295
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x5285
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %ecx
imull -0x10(%rbp), %ecx
imull -0x14(%rbp), %ecx
movl -0x10(%rbp), %edx
imull -0x18(%rbp), %edx
addl %edx, %ecx
addl -0x1c(%rbp), %ecx
movl %ecx, -0xc(%rbp)
cvtsi2sdl -0x1c(%rbp), %xmm1
movq 0xb4e8c0(%rax), %rcx
mulsd 0x3218(%rcx), %xmm1
cvtsi2sdl -0x10(%rbp), %xmm0
divsd %xmm0, %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3218(%rax), %xmm0
movl -0x10(%rbp), %eax
shll %eax
cvtsi2sd %eax, %xmm2
divsd %xmm2, %xmm0
movl -0x14(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movq -0x28(%rbp), %rax
cvtsi2sd %edx, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movsd %xmm0, 0x8(%rcx)
cvtsi2sdl -0x18(%rbp), %xmm1
movq 0xb4e8c0(%rax), %rcx
mulsd 0x3220(%rcx), %xmm1
cvtsi2sdl -0x10(%rbp), %xmm0
divsd %xmm0, %xmm1
movq 0xb4e8c0(%rax), %rax
movsd 0x3220(%rax), %xmm0
movl -0x10(%rbp), %eax
shll %eax
cvtsi2sd %eax, %xmm2
divsd %xmm2, %xmm0
movl -0x14(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movq -0x28(%rbp), %rax
cvtsi2sd %edx, %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq 0xb4e8b8(%rax), %rcx
movslq -0xc(%rbp), %rdx
imulq $0x870, %rdx, %rdx      # imm = 0x870
addq %rdx, %rcx
movsd %xmm0, 0x10(%rcx)
cvtsi2sdl -0x14(%rbp), %xmm0
movq 0xb4e8c0(%rax), %rcx
mulsd 0x3228(%rcx), %xmm0
movl -0x10(%rbp), %ecx
shll %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm1, %xmm0
movq 0xb4e8b8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x870, %rcx, %rcx      # imm = 0x870
addq %rcx, %rax
movsd %xmm0, 0x18(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x5136
jmp 0x5287
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x5123
jmp 0x5297
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x510c
jmp 0x52ba
movq 0x9d42(%rip), %rdi      # 0xeff0
leaq 0x7076(%rip), %rsi      # 0xc32b
callq 0x3200
movq -0x28(%rbp), %rdi
callq 0x5af0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)