// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xb4e8c0(%rdi), %rax
movl 0x320c(%rax), %r14d
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %r14
je 0x38a8
cmpl $-0x1, 0x3208(%rax)
je 0x3768
movq 0x7899(%rip), %rdi      # 0xaff0
leaq 0x4a7e(%rip), %rsi      # 0x81dc
movl $0x3e, %edx
callq 0x21f0
leal (%r14,%r14), %r15d
movl %r14d, %esi
imull %r14d, %esi
imull %r15d, %esi
movq 0xb4e8c0(%rbx), %rax
movl %esi, 0x3208(%rax)
movq %rbx, %rdi
callq 0x3230
testl %r14d, %r14d
jle 0x38c0
cvtsi2sd %r14d, %xmm0
cvtsi2sd %r15d, %xmm1
cmpl $0x2, %r15d
movl $0x1, %eax
cmovgel %r15d, %eax
movl %r14d, %ecx
imull %r14d, %ecx
xorl %edx, %edx
xorpd %xmm2, %xmm2
movsd 0x4847(%rip), %xmm3     # 0x8008
xorl %esi, %esi
movq 0xb4e8b8(%rbx), %rdi
movq 0xb4e8c0(%rbx), %r8
movl %esi, %r9d
andl $0x1, %r9d
xorps %xmm9, %xmm9
cvtsi2sd %r9d, %xmm9
movsd 0x3218(%r8), %xmm4
movsd 0x3220(%r8), %xmm5
movapd %xmm4, %xmm6
divsd %xmm1, %xmm6
movapd %xmm5, %xmm7
divsd %xmm1, %xmm7
movsd 0x3228(%r8), %xmm8
mulsd %xmm2, %xmm8
divsd %xmm1, %xmm8
mulsd %xmm9, %xmm7
mulsd %xmm9, %xmm6
movq %rdx, %r8
xorpd %xmm9, %xmm9
xorl %r9d, %r9d
movapd %xmm5, %xmm10
mulsd %xmm9, %xmm10
divsd %xmm0, %xmm10
addsd %xmm7, %xmm10
xorl %r10d, %r10d
leal (%r8,%r10), %r11d
xorps %xmm11, %xmm11
cvtsi2sd %r10d, %xmm11
mulsd %xmm4, %xmm11
divsd %xmm0, %xmm11
addsd %xmm6, %xmm11
movslq %r11d, %r11
imulq $0x870, %r11, %r11      # imm = 0x870
movsd %xmm11, 0x8(%rdi,%r11)
movsd %xmm10, 0x10(%rdi,%r11)
movsd %xmm8, 0x18(%rdi,%r11)
incq %r10
cmpq %r10, %r14
jne 0x3842
addsd %xmm3, %xmm9
incl %r9d
addq %r14, %r8
cmpl %r14d, %r9d
jne 0x382b
addsd %xmm3, %xmm2
incl %esi
addq %rcx, %rdx
cmpl %eax, %esi
jne 0x37c3
jmp 0x38c0
movq 0x7741(%rip), %rdi      # 0xaff0
leaq 0x4965(%rip), %rsi      # 0x821b
movl $0x33, %edx
callq 0x21f0
movq 0xb4e8c0(%rbx), %rbx
cmpl $0x0, 0x3214(%rbx)
jns 0x38fd
movsd 0x3218(%rbx), %xmm0
divsd 0x3250(%rbx), %xmm0
callq 0x2300
cvttsd2si %xmm0, %eax
cmpl $0x6, %eax
movl $0x5, %ecx
cmovgel %eax, %ecx
addl $-0x2, %ecx
movl %ecx, 0x3214(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq