// File: Luthaf[P]zeopp/networkstorage.cc
// Function: ATOM_NETWORK::initialize()
void ATOM_NETWORK::initialize(){
  double tempd, talpha, tbeta, tgamma;
  talpha = 2*PI/360.0*alpha;
  tbeta  = 2*PI/360.0*beta;
  tgamma = 2*PI/360.0*gamma;
  double cosb = cos(tbeta);
  double cosg = cos(tgamma);
  double sing = sin(tgamma);
  tempd=(cos(talpha)-cosg*cosb)/sing;
  v_a.x=a;
  v_a.y=0.0;
  v_a.z=0.0;  
  v_b.x=b*cosg; 
  if(fabs(v_b.x) < TOLERANCE)
    v_b.x=0;  
  v_b.y=b*sing;
  v_b.z=0.0;  
  v_c.x=c*cosb;
  if(fabs(v_c.x) < TOLERANCE)
    v_c.x = 0;
  v_c.y=c*tempd;
  if(fabs(v_c.y) < TOLERANCE)
    v_c.y = 0;
  v_c.z=c*sqrt(1.0-(cosb*cosb)-(tempd*tempd));
  initMatrices();
  distanceCalculator = MIN_PER_DISTANCE(v_a.x, v_b.x, v_b.y, v_c.x, v_c.y, v_c.z);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movsd 0x15c83e(%rip), %xmm0   # 0x1f2ab0
mulsd 0x20(%rax), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x15c82c(%rip), %xmm0   # 0x1f2ab0
mulsd 0x28(%rax), %xmm0
movsd %xmm0, -0x20(%rbp)
movsd 0x15c81a(%rip), %xmm0   # 0x1f2ab0
mulsd 0x30(%rax), %xmm0
movsd %xmm0, -0x28(%rbp)
movsd -0x20(%rbp), %xmm0
callq 0x5970
movsd %xmm0, -0x30(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x5970
movsd %xmm0, -0x38(%rbp)
movsd -0x28(%rbp), %xmm0
callq 0x5140
movsd %xmm0, -0x40(%rbp)
movsd -0x18(%rbp), %xmm0
callq 0x5970
movq -0xc0(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm2
movq %xmm0, %rcx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
xorq %rdx, %rcx
movq %rcx, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
divsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x10(%rbp)
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x38(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x48(%rax)
movsd 0x10(%rax), %xmm0
mulsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x50(%rax)
movsd 0x50(%rax), %xmm1
movaps 0x15bd37(%rip), %xmm0   # 0x1f2080
pand %xmm0, %xmm1
movsd 0x16150b(%rip), %xmm0   # 0x1f7860
ucomisd %xmm1, %xmm0
jbe 0x9636a
movq -0xc0(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x50(%rax)
movq -0xc0(%rbp), %rax
movsd 0x10(%rax), %xmm0
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, 0x58(%rax)
xorps %xmm0, %xmm0
movsd %xmm0, 0x60(%rax)
movsd 0x18(%rax), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x68(%rax)
movsd 0x68(%rax), %xmm1
movaps 0x15bcdd(%rip), %xmm0   # 0x1f2080
pand %xmm0, %xmm1
movsd 0x1614b1(%rip), %xmm0   # 0x1f7860
ucomisd %xmm1, %xmm0
jbe 0x963c4
movq -0xc0(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x68(%rax)
movq -0xc0(%rbp), %rax
movsd 0x18(%rax), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd %xmm0, 0x70(%rax)
movsd 0x70(%rax), %xmm1
movaps 0x15bc9a(%rip), %xmm0   # 0x1f2080
pand %xmm0, %xmm1
movsd 0x16146e(%rip), %xmm0   # 0x1f7860
ucomisd %xmm1, %xmm0
jbe 0x96407
movq -0xc0(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x70(%rax)
movq -0xc0(%rbp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
movsd -0x30(%rbp), %xmm1
movsd -0x30(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
mulsd %xmm0, %xmm1
movsd 0x15bc08(%rip), %xmm0   # 0x1f2050
addsd %xmm0, %xmm1
movsd -0x10(%rbp), %xmm0
movsd -0x10(%rbp), %xmm2
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x53f0
movq -0xc0(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0xc8(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x78(%rdi)
callq 0x966b0
movq -0xc0(%rbp), %rax
movsd 0x38(%rax), %xmm0
movsd 0x50(%rax), %xmm1
movsd 0x58(%rax), %xmm2
movsd 0x68(%rax), %xmm3
movsd 0x70(%rax), %xmm4
movsd 0x78(%rax), %xmm5
leaq -0xb8(%rbp), %rdi
callq 0xd73c0
movq -0xc0(%rbp), %rdi
addq $0x340, %rdi            # imm = 0x340
leaq -0xb8(%rbp), %rsi
callq 0xada80
leaq -0xb8(%rbp), %rdi
callq 0x122d0
addq $0xd0, %rsp
popq %rbp
retq
nopw (%rax,%rax)