// File: WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::createFCC()
void CMolecularSystem::createFCC()
{
  int t;
  int bu;
  bu = this->parameter->baseunit;
  if (bu != -1)
  {
    if (parameter->nop != -1) {cerr << "how comes that numberofparticles is already set in createfcc?\n";}
    this->parameter->nop = 4*bu*bu*bu;
    this->initializeMolecules(4*bu*bu*bu);
    for (int jz=0; jz < 2*bu ; jz++)
    {
      for (int jy=0; jy < 2*bu ; jy++)
      {
        for (int jx = 0; jx < bu; jx++)
        {
          t = 2*bu*bu*jz + bu*jy + jx;
          this->molecules[t].posx = double(jx)*this->parameter->boxx/double(bu) + this->parameter->boxx/double(2*bu) * ((jz+jy) % 2);
          this->molecules[t].posy = double(jy)*this->parameter->boxy/double(2*bu);
          this->molecules[t].posz = double(jz)*this->parameter->boxz/double(2*bu);
        }
      }
    }
  } else { cerr << "baseunit is not set, which is needed for createFCC\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 0x504f
movq -0x28(%rbp), %rax
movq 0xb4e8c0(%rax), %rax
cmpl $-0x1, 0x3208(%rax)
je 0x4ea5
movq 0xa157(%rip), %rdi      # 0xeff0
leaq 0x73d9(%rip), %rsi      # 0xc279
callq 0x3200
movq -0x28(%rbp), %rdi
movl -0x10(%rbp), %ecx
shll $0x2, %ecx
imull -0x10(%rbp), %ecx
imull -0x10(%rbp), %ecx
movq 0xb4e8c0(%rdi), %rax
movl %ecx, 0x3208(%rax)
movl -0x10(%rbp), %esi
shll $0x2, %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 0x504d
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x10(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x503d
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x502d
movq -0x28(%rbp), %rax
movl -0x10(%rbp), %ecx
shll %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
addl -0x18(%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), %xmm0
movq 0xb4e8c0(%rax), %rcx
mulsd 0x3220(%rcx), %xmm0
movl -0x10(%rbp), %ecx
shll %ecx
cvtsi2sd %ecx, %xmm1
divsd %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 0x4f0c
jmp 0x502f
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4ef5
jmp 0x503f
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4ede
jmp 0x5062
movq 0x9f9a(%rip), %rdi      # 0xeff0
leaq 0x725b(%rip), %rsi      # 0xc2b8
callq 0x3200
movq -0x28(%rbp), %rdi
callq 0x5af0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)