// File: WolfgangLechner[P]StructureAnalysis/molecular_system.cpp
// Function: CMolecularSystem::outputBondOrderHistogramms(int)
void CMolecularSystem::outputBondOrderHistogramms(int number)
{
  char IntStr[80];

  double a,b;
  int n;
  a = OrderParameterHistoStart;
  b = OrderParameterHistoStop;
  n = OrderParameterHistoSize;

  ofstream of;
  sprintf( IntStr, "./output/orderparameter/q4Histo.%d.txt", number) ;
  of.open (IntStr, ofstream::out | ofstream::trunc);

  if (of.is_open())
  {
    for (int i = 0;i<n;i++)
    {
      of << get_xFromBox(i,a,b,n) << " "  << this->q4Histo[i]/(double(this->normq4)*(b-a)) << "\n";
    }
  } else {cerr << "unable to open file for output, please mkdir output/orderparameter\n";}
  of.close();

  sprintf( IntStr, "./output/orderparameter/q6Histo.%d.txt", number) ;
  of.open (IntStr, ofstream::out | ofstream::trunc);

  if (of.is_open())
  {
    for (int i = 0;i<n;i++)
    {
      of << get_xFromBox(i,a,b,n) << " "  << this->q6Histo[i]/(double(this->normq6)*(b-a)) << "\n";
    }
  } else {cerr << "unable to open file for output, please mkdir output/orderparameter\n";}
  of.close();


  sprintf( IntStr, "./output/orderparameter/aq4Histo.%d.txt", number) ;
  of.open (IntStr, ofstream::out | ofstream::trunc);

  if (of.is_open())
  {
    for (int i = 0;i<n;i++)
    {
      of << get_xFromBox(i,a,b,n) << " "  << this->aq4Histo[i]/(double(this->normaq4)*(b-a)) << "\n";
    }
  } else {cerr << "unable to open file for output, please mkdir output/orderparameter\n";}
  of.close();

  sprintf( IntStr, "./output/orderparameter/aq6Histo.%d.txt", number) ;
  of.open (IntStr, ofstream::out | ofstream::trunc);

  if (of.is_open())
  {
    for (int i = 0;i<n;i++)
    {
      of << get_xFromBox(i,a,b,n) << " "  << this->aq6Histo[i]/(double(this->normaq6)*(b-a)) << "\n";
    }
  } else {cerr << "unable to open file for output, please mkdir output/orderparameter\n";}
  of.close();

  sprintf( IntStr, "./output/orderparameter/q46Histo3d.%d.txt", number) ;
  of.open (IntStr, ofstream::out | ofstream::trunc);

  if (of.is_open())
  {
    for (int i = 0;i<n;i++)
    {
      for (int j = 0;j<n;j++)
      {
        of << get_xFromBox(i,a,b,n) << " "  << get_xFromBox(j,a,b,n) << " "  <<  this->q46Histo3d[i][j]/(double(this->normaq6)*pow((b-a),2.0)) << "\n";
      }
      of << "\n";
    }

  } else {cerr << "unable to open file for output, please mkdir output/orderparameter\n";}
  of.close();


  sprintf( IntStr, "./output/orderparameter/aq46Histo3d.%d.txt", number) ;
  of.open (IntStr, ofstream::out | ofstream::trunc);

  if (of.is_open())
  {
    for (int i = 0;i<n;i++)
    {
      for (int j = 0;j<n;j++)
      {
        of << get_xFromBox(i,a,b,n) << " "  << get_xFromBox(j,a,b,n) << " "  <<  this->aq46Histo3d[i][j]/(double(this->normaq6)*pow((b-a),2.0)) << "\n";
      }
      of << "\n";
    }

  } else {cerr << "unable to open file for output, please mkdir output/orderparameter\n";}
  of.close();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2b8(%rbp)
movabsq $-0x4010000000000000, %rax # imm = 0xBFF0000000000000
movq %rax, -0x68(%rbp)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, -0x70(%rbp)
movl $0x3e8, -0x74(%rbp)     # imm = 0x3E8
leaq -0x278(%rbp), %rdi
callq 0x33f0
movl -0xc(%rbp), %edx
leaq 0x2250(%rip), %rsi      # 0xc4a6
xorl %eax, %eax
leaq -0x60(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x3090
movl $0x10, %edi
movl $0x20, %esi
callq 0xadf0
movl %eax, -0x2a8(%rbp)
jmp 0xa27f
movl -0x2a8(%rbp), %edx
movq -0x2b0(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x3060
jmp 0xa29a
leaq -0x278(%rbp), %rdi
callq 0x3180
movb %al, -0x2b9(%rbp)
jmp 0xa2ae
movb -0x2b9(%rbp), %al
testb $0x1, %al
jne 0xa2bd
jmp 0xa3bd
movl $0x0, -0x288(%rbp)
movl -0x288(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xa3bb
movq -0x2b8(%rbp), %rdi
movl -0x288(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
leaq -0x278(%rbp), %rdi
callq 0x3470
movq %rax, -0x2c8(%rbp)
jmp 0xa30a
movq -0x2c8(%rbp), %rdi
leaq 0x1f5f(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x2d0(%rbp)
jmp 0xa326
movq -0x2d0(%rbp), %rdi
movq -0x2b8(%rbp), %rax
movslq -0x288(%rbp), %rcx
cvtsi2sdl 0x24(%rax,%rcx,4), %xmm0
cvtsi2sdl 0x7a50a4(%rax), %xmm1
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm3
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x3470
movq %rax, -0x2d8(%rbp)
jmp 0xa36d
movq -0x2d8(%rbp), %rdi
leaq 0x210f(%rip), %rsi      # 0xc48a
callq 0x3200
jmp 0xa382
jmp 0xa384
movl -0x288(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x288(%rbp)
jmp 0xa2c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x280(%rbp)
movl %eax, -0x284(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x3380
jmp 0xacf5
jmp 0xa3d4
movq 0x4c2c(%rip), %rdi      # 0xeff0
leaq 0x2102(%rip), %rsi      # 0xc4cd
callq 0x3200
jmp 0xa3d2
jmp 0xa3d4
leaq -0x278(%rbp), %rdi
callq 0x3350
jmp 0xa3e2
movl -0xc(%rbp), %edx
leaq 0x2125(%rip), %rsi      # 0xc511
xorl %eax, %eax
leaq -0x60(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x3090
movl $0x10, %edi
movl $0x20, %esi
callq 0xadf0
movl %eax, -0x2dc(%rbp)
jmp 0xa415
movl -0x2dc(%rbp), %edx
movq -0x2e8(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x3060
jmp 0xa430
leaq -0x278(%rbp), %rdi
callq 0x3180
movb %al, -0x2e9(%rbp)
jmp 0xa444
movb -0x2e9(%rbp), %al
testb $0x1, %al
jne 0xa453
jmp 0xa533
movl $0x0, -0x28c(%rbp)
movl -0x28c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xa531
movq -0x2b8(%rbp), %rdi
movl -0x28c(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
leaq -0x278(%rbp), %rdi
callq 0x3470
movq %rax, -0x2f8(%rbp)
jmp 0xa4a0
movq -0x2f8(%rbp), %rdi
leaq 0x1dc9(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x300(%rbp)
jmp 0xa4bc
movq -0x300(%rbp), %rdi
movq -0x2b8(%rbp), %rax
movslq -0x28c(%rbp), %rcx
cvtsi2sdl 0xfc4(%rax,%rcx,4), %xmm0
cvtsi2sdl 0x7a50a8(%rax), %xmm1
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm3
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x3470
movq %rax, -0x308(%rbp)
jmp 0xa506
movq -0x308(%rbp), %rdi
leaq 0x1f76(%rip), %rsi      # 0xc48a
callq 0x3200
jmp 0xa51b
jmp 0xa51d
movl -0x28c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28c(%rbp)
jmp 0xa45d
jmp 0xa54a
movq 0x4ab6(%rip), %rdi      # 0xeff0
leaq 0x1f8c(%rip), %rsi      # 0xc4cd
callq 0x3200
jmp 0xa548
jmp 0xa54a
leaq -0x278(%rbp), %rdi
callq 0x3350
jmp 0xa558
movl -0xc(%rbp), %edx
leaq 0x1fd6(%rip), %rsi      # 0xc538
xorl %eax, %eax
leaq -0x60(%rbp), %rdi
movq %rdi, -0x318(%rbp)
callq 0x3090
movl $0x10, %edi
movl $0x20, %esi
callq 0xadf0
movl %eax, -0x30c(%rbp)
jmp 0xa58b
movl -0x30c(%rbp), %edx
movq -0x318(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x3060
jmp 0xa5a6
leaq -0x278(%rbp), %rdi
callq 0x3180
movb %al, -0x319(%rbp)
jmp 0xa5ba
movb -0x319(%rbp), %al
testb $0x1, %al
jne 0xa5c9
jmp 0xa6a9
movl $0x0, -0x290(%rbp)
movl -0x290(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xa6a7
movq -0x2b8(%rbp), %rdi
movl -0x290(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
leaq -0x278(%rbp), %rdi
callq 0x3470
movq %rax, -0x328(%rbp)
jmp 0xa616
movq -0x328(%rbp), %rdi
leaq 0x1c53(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x330(%rbp)
jmp 0xa632
movq -0x330(%rbp), %rdi
movq -0x2b8(%rbp), %rax
movslq -0x290(%rbp), %rcx
cvtsi2sdl 0x1f64(%rax,%rcx,4), %xmm0
cvtsi2sdl 0x7a50ac(%rax), %xmm1
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm3
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x3470
movq %rax, -0x338(%rbp)
jmp 0xa67c
movq -0x338(%rbp), %rdi
leaq 0x1e00(%rip), %rsi      # 0xc48a
callq 0x3200
jmp 0xa691
jmp 0xa693
movl -0x290(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x290(%rbp)
jmp 0xa5d3
jmp 0xa6c0
movq 0x4940(%rip), %rdi      # 0xeff0
leaq 0x1e16(%rip), %rsi      # 0xc4cd
callq 0x3200
jmp 0xa6be
jmp 0xa6c0
leaq -0x278(%rbp), %rdi
callq 0x3350
jmp 0xa6ce
movl -0xc(%rbp), %edx
leaq 0x1e88(%rip), %rsi      # 0xc560
xorl %eax, %eax
leaq -0x60(%rbp), %rdi
movq %rdi, -0x348(%rbp)
callq 0x3090
movl $0x10, %edi
movl $0x20, %esi
callq 0xadf0
movl %eax, -0x33c(%rbp)
jmp 0xa701
movl -0x33c(%rbp), %edx
movq -0x348(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x3060
jmp 0xa71c
leaq -0x278(%rbp), %rdi
callq 0x3180
movb %al, -0x349(%rbp)
jmp 0xa730
movb -0x349(%rbp), %al
testb $0x1, %al
jne 0xa73f
jmp 0xa81f
movl $0x0, -0x294(%rbp)
movl -0x294(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xa81d
movq -0x2b8(%rbp), %rdi
movl -0x294(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
leaq -0x278(%rbp), %rdi
callq 0x3470
movq %rax, -0x358(%rbp)
jmp 0xa78c
movq -0x358(%rbp), %rdi
leaq 0x1add(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x360(%rbp)
jmp 0xa7a8
movq -0x360(%rbp), %rdi
movq -0x2b8(%rbp), %rax
movslq -0x294(%rbp), %rcx
cvtsi2sdl 0x2f04(%rax,%rcx,4), %xmm0
cvtsi2sdl 0x7a50b0(%rax), %xmm1
movsd -0x70(%rbp), %xmm2
movsd -0x68(%rbp), %xmm3
subsd %xmm3, %xmm2
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x3470
movq %rax, -0x368(%rbp)
jmp 0xa7f2
movq -0x368(%rbp), %rdi
leaq 0x1c8a(%rip), %rsi      # 0xc48a
callq 0x3200
jmp 0xa807
jmp 0xa809
movl -0x294(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x294(%rbp)
jmp 0xa749
jmp 0xa836
movq 0x47ca(%rip), %rdi      # 0xeff0
leaq 0x1ca0(%rip), %rsi      # 0xc4cd
callq 0x3200
jmp 0xa834
jmp 0xa836
leaq -0x278(%rbp), %rdi
callq 0x3350
jmp 0xa844
movl -0xc(%rbp), %edx
leaq 0x1d3a(%rip), %rsi      # 0xc588
xorl %eax, %eax
leaq -0x60(%rbp), %rdi
movq %rdi, -0x378(%rbp)
callq 0x3090
movl $0x10, %edi
movl $0x20, %esi
callq 0xadf0
movl %eax, -0x36c(%rbp)
jmp 0xa877
movl -0x36c(%rbp), %edx
movq -0x378(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x3060
jmp 0xa892
leaq -0x278(%rbp), %rdi
callq 0x3180
movb %al, -0x379(%rbp)
jmp 0xa8a6
movb -0x379(%rbp), %al
testb $0x1, %al
jne 0xa8b5
jmp 0xaa6d
movl $0x0, -0x298(%rbp)
movl -0x298(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xaa6b
movl $0x0, -0x29c(%rbp)
movl -0x29c(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xaa40
movq -0x2b8(%rbp), %rdi
movl -0x298(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
leaq -0x278(%rbp), %rdi
callq 0x3470
movq %rax, -0x388(%rbp)
jmp 0xa91b
movq -0x388(%rbp), %rdi
leaq 0x194e(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x390(%rbp)
jmp 0xa937
movq -0x2b8(%rbp), %rdi
movl -0x29c(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
movq -0x390(%rbp), %rdi
callq 0x3470
movq %rax, -0x398(%rbp)
jmp 0xa96b
movq -0x398(%rbp), %rdi
leaq 0x18fe(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x3a0(%rbp)
jmp 0xa987
movq -0x2b8(%rbp), %rax
movslq -0x298(%rbp), %rcx
imulq $0xfa0, %rcx, %rdx      # imm = 0xFA0
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x29c(%rbp), %rdx
cvtsi2sdl 0x3ea4(%rcx,%rdx,4), %xmm0
movsd %xmm0, -0x3b0(%rbp)
cvtsi2sdl 0x7a50b0(%rax), %xmm0
movsd %xmm0, -0x3b8(%rbp)
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd 0x1778(%rip), %xmm1     # 0xc158
callq 0x3420
movsd -0x3b8(%rbp), %xmm1
movq -0x3a0(%rbp), %rdi
movaps %xmm0, %xmm2
movsd -0x3b0(%rbp), %xmm0
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x3470
movq %rax, -0x3a8(%rbp)
jmp 0xaa15
movq -0x3a8(%rbp), %rdi
leaq 0x1a67(%rip), %rsi      # 0xc48a
callq 0x3200
jmp 0xaa2a
jmp 0xaa2c
movl -0x29c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x29c(%rbp)
jmp 0xa8d8
leaq 0x1a43(%rip), %rsi      # 0xc48a
leaq -0x278(%rbp), %rdi
callq 0x3200
jmp 0xaa55
jmp 0xaa57
movl -0x298(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x298(%rbp)
jmp 0xa8bf
jmp 0xaa84
movq 0x457c(%rip), %rdi      # 0xeff0
leaq 0x1a52(%rip), %rsi      # 0xc4cd
callq 0x3200
jmp 0xaa82
jmp 0xaa84
leaq -0x278(%rbp), %rdi
callq 0x3350
jmp 0xaa92
movl -0xc(%rbp), %edx
leaq 0x1b16(%rip), %rsi      # 0xc5b2
xorl %eax, %eax
leaq -0x60(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
callq 0x3090
movl $0x10, %edi
movl $0x20, %esi
callq 0xadf0
movl %eax, -0x3bc(%rbp)
jmp 0xaac5
movl -0x3bc(%rbp), %edx
movq -0x3c8(%rbp), %rsi
leaq -0x278(%rbp), %rdi
callq 0x3060
jmp 0xaae0
leaq -0x278(%rbp), %rdi
callq 0x3180
movb %al, -0x3c9(%rbp)
jmp 0xaaf4
movb -0x3c9(%rbp), %al
testb $0x1, %al
jne 0xab03
jmp 0xacbb
movl $0x0, -0x2a0(%rbp)
movl -0x2a0(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xacb9
movl $0x0, -0x2a4(%rbp)
movl -0x2a4(%rbp), %eax
cmpl -0x74(%rbp), %eax
jge 0xac8e
movq -0x2b8(%rbp), %rdi
movl -0x2a0(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
leaq -0x278(%rbp), %rdi
callq 0x3470
movq %rax, -0x3d8(%rbp)
jmp 0xab69
movq -0x3d8(%rbp), %rdi
leaq 0x1700(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x3e0(%rbp)
jmp 0xab85
movq -0x2b8(%rbp), %rdi
movl -0x2a4(%rbp), %esi
movsd -0x68(%rbp), %xmm0
movsd -0x70(%rbp), %xmm1
movl -0x74(%rbp), %edx
callq 0x8f00
movq -0x3e0(%rbp), %rdi
callq 0x3470
movq %rax, -0x3e8(%rbp)
jmp 0xabb9
movq -0x3e8(%rbp), %rdi
leaq 0x16b0(%rip), %rsi      # 0xc277
callq 0x3200
movq %rax, -0x3f0(%rbp)
jmp 0xabd5
movq -0x2b8(%rbp), %rax
movslq -0x2a0(%rbp), %rcx
imulq $0xfa0, %rcx, %rdx      # imm = 0xFA0
movq %rax, %rcx
addq %rdx, %rcx
movslq -0x2a4(%rbp), %rdx
cvtsi2sdl 0x3d47a4(%rcx,%rdx,4), %xmm0
movsd %xmm0, -0x400(%rbp)
cvtsi2sdl 0x7a50b0(%rax), %xmm0
movsd %xmm0, -0x408(%rbp)
movsd -0x70(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd 0x152a(%rip), %xmm1     # 0xc158
callq 0x3420
movsd -0x408(%rbp), %xmm1
movq -0x3f0(%rbp), %rdi
movaps %xmm0, %xmm2
movsd -0x400(%rbp), %xmm0
mulsd %xmm2, %xmm1
divsd %xmm1, %xmm0
callq 0x3470
movq %rax, -0x3f8(%rbp)
jmp 0xac63
movq -0x3f8(%rbp), %rdi
leaq 0x1819(%rip), %rsi      # 0xc48a
callq 0x3200
jmp 0xac78
jmp 0xac7a
movl -0x2a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a4(%rbp)
jmp 0xab26
leaq 0x17f5(%rip), %rsi      # 0xc48a
leaq -0x278(%rbp), %rdi
callq 0x3200
jmp 0xaca3
jmp 0xaca5
movl -0x2a0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a0(%rbp)
jmp 0xab0d
jmp 0xacd2
movq 0x432e(%rip), %rdi      # 0xeff0
leaq 0x1804(%rip), %rsi      # 0xc4cd
callq 0x3200
jmp 0xacd0
jmp 0xacd2
leaq -0x278(%rbp), %rdi
callq 0x3350
jmp 0xace0
leaq -0x278(%rbp), %rdi
callq 0x3380
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
movq -0x280(%rbp), %rdi
callq 0x3430
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)