// File: /workspace/github_cpp_makefile_star2_O1/Luthaf[P]zeopp/area_and_volume.cc
// Function: NEWcalcAVprint(MATERIAL*, std::ostream&, char*)
void NEWcalcAVprint(MATERIAL *Mat, ostream &output, char *filename) {

  double volumeFraction = Mat->AVcount*1.0/Mat->AVnumSamples;
  double origVolume = calcDeterminant(Mat->atmnet.ucVectors);
  double av = volumeFraction * origVolume;

  // Write the results to the output stream
  double volumeFraction_inaxs = Mat->AVcount_inaxs*1.0/Mat->AVnumSamples;
  double rho_crystal = calcDensity(&(Mat->atmnet));
  double avPerMass   = volumeFraction/rho_crystal;
  double av_inaxs = volumeFraction_inaxs * origVolume;
  double avPerMass_inaxs   = volumeFraction_inaxs/rho_crystal;
 //    output << newAtomNet.name << " ";
  output << "@ " << filename << " ";
  output << "Unitcell_volume: " << origVolume << "   Density: " << rho_crystal << "   ";
  output << "AV_A^3: " << av << " "
         << "AV_Volume_fraction: " << volumeFraction << " "
         << "AV_cm^3/g: " << avPerMass << " "
         << "NAV_A^3: " << av_inaxs << " "
         << "NAV_Volume_fraction: " << volumeFraction_inaxs << " "
         << "NAV_cm^3/g: " << avPerMass_inaxs;
  if(Mat->AVwithin_rangeFlag) {
    double volumeFraction_within_range = Mat->AVcount_within_range*1.0/Mat->AVnumSamples;
    double av_within_range = volumeFraction_within_range * origVolume;
    double avPerMass_within_range   = volumeFraction_within_range/rho_crystal;
    output << " range_A^3: " << av_within_range << " "
    << "range_Volume_fraction: " << volumeFraction_within_range << " "
    << "range_cm^3/g: " << avPerMass_within_range;
  }
  output << "\n";

  output << "Number_of_channels: " << Mat->AVcount_inChannel.size()  << " Channel_volume_A^3: ";
  for(unsigned int i = 0; i < Mat->AVcount_inChannel.size(); i++)
    {
    output << Mat->AVcount_inChannel[i]*(1.0/Mat->AVnumSamples) * origVolume << "  ";
    };
  output << "\nNumber_of_pockets: " << Mat->AVcount_inPocket.size()  << " Pocket_volume_A^3: ";
  for(unsigned int i = 0; i < Mat->AVcount_inPocket.size(); i++)
    {
    output << Mat->AVcount_inPocket[i]*(1.0/Mat->AVnumSamples) * origVolume << "  ";
    };
  output << "\n";

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
cvtsi2sdl 0xc7c(%rdi), %xmm1
cvtsi2sdl 0xc78(%rdi), %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
addq $0x80, %rdi
callq 0x84ffd
movsd %xmm0, 0x8(%rsp)
movapd %xmm0, %xmm1
cvtsi2sdl 0xc80(%r14), %xmm2
mulsd (%rsp), %xmm1
movsd %xmm1, 0x28(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0xc78(%r14), %xmm0
divsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
movq %r14, %rdi
callq 0x3c9c8
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
movsd 0x8(%rsp), %xmm1
movsd 0x10(%rsp), %xmm2
mulsd %xmm2, %xmm1
movsd %xmm1, 0x38(%rsp)
movapd %xmm2, %xmm1
movsd %xmm0, 0x20(%rsp)
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
leaq 0x115011(%rip), %rsi    # 0x156bcd
movl $0x2, %edx
movq %rbx, %rdi
callq 0x44e0
testq %r15, %r15
je 0x41be6
movq %r15, %rdi
callq 0x41e0
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x44e0
jmp 0x41bfd
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x4710
leaq 0x115882(%rip), %r15    # 0x157486
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x44e0
leaq 0x111be7(%rip), %rsi    # 0x153802
movl $0x11, %edx
movq %rbx, %rdi
callq 0x44e0
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x46b0
movq %rax, %r12
leaq 0x111bd4(%rip), %rsi    # 0x153814
movl $0xc, %edx
movq %rax, %rdi
callq 0x44e0
movq %r12, %rdi
movsd 0x20(%rsp), %xmm0
callq 0x46b0
leaq 0x10d82c(%rip), %rsi    # 0x14f48e
movl $0x3, %edx
movq %rax, %rdi
callq 0x44e0
leaq 0x111c67(%rip), %rsi    # 0x1538dd
movl $0x8, %edx
movq %rbx, %rdi
callq 0x44e0
movq %rbx, %rdi
movsd 0x28(%rsp), %xmm0
callq 0x46b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x44e0
leaq 0x111c3e(%rip), %rsi    # 0x1538e9
movl $0x14, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movsd (%rsp), %xmm0
callq 0x46b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x44e0
leaq 0x111c22(%rip), %rsi    # 0x153901
movl $0xb, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movsd 0x30(%rsp), %xmm0
callq 0x46b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x44e0
leaq 0x111bc8(%rip), %rsi    # 0x1538dc
movl $0x9, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movsd 0x38(%rsp), %xmm0
callq 0x46b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x44e0
leaq 0x111b9f(%rip), %rsi    # 0x1538e8
movl $0x15, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x46b0
movq %rax, %r12
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x44e0
leaq 0x111b82(%rip), %rsi    # 0x153900
movl $0xc, %edx
movq %r12, %rdi
callq 0x44e0
movq %r12, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x46b0
cmpb $0x1, 0xc8c(%r14)
jne 0x41e77
cvtsi2sdl 0xc84(%r14), %xmm1
xorps %xmm0, %xmm0
cvtsi2sdl 0xc78(%r14), %xmm0
divsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movapd %xmm1, %xmm0
divsd 0x20(%rsp), %xmm0
movsd %xmm0, (%rsp)
leaq 0x111a35(%rip), %rsi    # 0x153821
movl $0xc, %edx
movq %rbx, %rdi
callq 0x44e0
movq %rbx, %rdi
movsd 0x18(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
leaq 0x115675(%rip), %r12    # 0x157486
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
leaq 0x111a06(%rip), %rsi    # 0x15382e
movl $0x17, %edx
movq %r15, %rdi
callq 0x44e0
movq %r15, %rdi
movsd 0x10(%rsp), %xmm0
callq 0x46b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x44e0
leaq 0x1119e9(%rip), %rsi    # 0x153846
movl $0xe, %edx
movq %r15, %rdi
callq 0x44e0
movq %r15, %rdi
movsd (%rsp), %xmm0
callq 0x46b0
leaq 0x1136b0(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
callq 0x44e0
leaq 0x1119c3(%rip), %rsi    # 0x153855
movl $0x14, %edx
movq %rbx, %rdi
callq 0x44e0
movq 0xcf8(%r14), %rsi
subq 0xcf0(%r14), %rsi
sarq $0x2, %rsi
movq %rbx, %rdi
callq 0x42b0
leaq 0x1119aa(%rip), %rsi    # 0x15386a
movl $0x15, %edx
movq %rax, %rdi
callq 0x44e0
movq 0xcf0(%r14), %rax
cmpq %rax, 0xcf8(%r14)
je 0x41f4b
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x10d5a4(%rip), %r15    # 0x14f48f
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rcx,4), %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0xc78(%r14), %xmm2
movsd 0x10d151(%rip), %xmm0   # 0x14f058
divsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x46b0
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0xcf0(%r14), %rax
movq 0xcf8(%r14), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x41eeb
leaq 0x11192e(%rip), %rsi    # 0x153880
movl $0x14, %edx
movq %rbx, %rdi
callq 0x44e0
movq 0xd10(%r14), %rsi
subq 0xd08(%r14), %rsi
sarq $0x2, %rsi
movq %rbx, %rdi
callq 0x42b0
leaq 0x111915(%rip), %rsi    # 0x153895
movl $0x14, %edx
movq %rax, %rdi
callq 0x44e0
movq 0xd08(%r14), %rax
cmpq %rax, 0xd10(%r14)
je 0x4200b
movl $0x1, %ebp
xorl %ecx, %ecx
leaq 0x10d4e4(%rip), %r15    # 0x14f48f
xorps %xmm1, %xmm1
cvtsi2sdl (%rax,%rcx,4), %xmm1
xorps %xmm2, %xmm2
cvtsi2sdl 0xc78(%r14), %xmm2
movsd 0x10d091(%rip), %xmm0   # 0x14f058
divsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
movq %rbx, %rdi
callq 0x46b0
movl $0x2, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x44e0
movl %ebp, %ecx
movq 0xd08(%r14), %rax
movq 0xd10(%r14), %rdx
subq %rax, %rdx
sarq $0x2, %rdx
incl %ebp
cmpq %rcx, %rdx
ja 0x41fab
leaq 0x11351c(%rip), %rsi    # 0x15552e
movl $0x1, %edx
movq %rbx, %rdi
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x44e0