// File: /workspace/github_c_makefile_star2_O0/josch[P]stride/area.c
// Function: Area
void Area(CHAIN **Chain, int NChain, COMMAND *Cmd)
{

  double *Coord, *Radii, OverallArea, *AreaPerAtom, *p1, *p2;
  int At, TotalAt=0, Cn, Res, DotsPerSphere=600;

  for( Cn=0; Cn<NChain; Cn++ ) {

    if( !Chain[Cn]->Valid )
      continue;

    for( Res=0; Res<Chain[Cn]->NRes; Res++ )
      for( At=0; At<Chain[Cn]->Rsd[Res]->NAtom; At++ )
	if( !IsHydrogen(Chain[Cn]->Rsd[Res]->AtomType[At]) )
	  TotalAt ++;
  }

  Coord = (double *)ckalloc(3*TotalAt*sizeof(double));
  Radii = (double *)ckalloc(TotalAt*sizeof(double));

  p1 = Coord;
  p2 = Radii;

  for( Cn=0; Cn<NChain; Cn++ ) {

    if( !Chain[Cn]->Valid )
      continue;

    for( Res=0; Res<Chain[Cn]->NRes; Res++ )
      for( At=0; At<Chain[Cn]->Rsd[Res]->NAtom; At++ ) 
	if( !IsHydrogen(Chain[Cn]->Rsd[Res]->AtomType[At]) ) {
	  (*p1++) = (double)Chain[Cn]->Rsd[Res]->Coord[At][0];
	  (*p1++) = (double)Chain[Cn]->Rsd[Res]->Coord[At][1];
	  (*p1++) = (double)Chain[Cn]->Rsd[Res]->Coord[At][2];
	  (*p2++) = GetAtomRadius(Chain[Cn]->Rsd[Res]->AtomType[At])+1.4;
	}
  
  }  

  p1 = Coord;
  p2 = Radii;

  NSC(Coord,Radii,TotalAt,DotsPerSphere,FLAG_ATOM_AREA,&OverallArea,
      &AreaPerAtom,NULL,NULL,NULL);
    
    for( Cn=0; Cn<NChain; Cn++ ) {

      if( !Chain[Cn]->Valid )
	continue;
      
      for( Res=0; Res<Chain[Cn]->NRes; Res++ ) {
	Chain[Cn]->Rsd[Res]->Prop->Solv = 0.0;
	for( At=0; At<Chain[Cn]->Rsd[Res]->NAtom; At++ )
	  if( !IsHydrogen(Chain[Cn]->Rsd[Res]->AtomType[At]) ) {
	    Chain[Cn]->Rsd[Res]->Prop->Solv += (*AreaPerAtom++);
	  }
      }
    }
  free(Coord);
  free(Radii);
}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movl %esi, 0x7c(%rsp)
movq %rdx, 0x70(%rsp)
movl $0x0, 0x38(%rsp)
movl $0x258, 0x2c(%rsp)      # imm = 0x258
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jge 0x23343
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x2327a
jmp 0x23333
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
movq 0x80(%rsp), %rcx
movslq 0x34(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x23331
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x80(%rsp), %rcx
movslq 0x34(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x68(%rcx), %rcx
movslq 0x30(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x2331f
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x10, %rdi
movslq 0x3c(%rsp), %rax
imulq $0x5, %rax, %rax
addq %rax, %rdi
callq 0x6340
cmpl $0x0, %eax
jne 0x23310
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x23312
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x232a7
jmp 0x23321
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x23282
jmp 0x23333
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x23250
imull $0x3, 0x38(%rsp), %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x7360
movq %rax, 0x68(%rsp)
movslq 0x38(%rsp), %rdi
shlq $0x3, %rdi
callq 0x7360
movq %rax, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jge 0x235b8
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x233b2
jmp 0x235a8
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
movq 0x80(%rsp), %rcx
movslq 0x34(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x235a6
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x80(%rsp), %rcx
movslq 0x34(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x68(%rcx), %rcx
movslq 0x30(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x23594
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x10, %rdi
movslq 0x3c(%rsp), %rax
imulq $0x5, %rax, %rax
addq %rax, %rdi
callq 0x6340
cmpl $0x0, %eax
jne 0x23582
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x188, %rax            # imm = 0x188
movslq 0x3c(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x48(%rsp)
movsd %xmm0, (%rax)
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x188, %rax            # imm = 0x188
movslq 0x3c(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x48(%rsp)
movsd %xmm0, (%rax)
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x188, %rax            # imm = 0x188
movslq 0x3c(%rsp), %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
movss 0x8(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq 0x48(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x48(%rsp)
movsd %xmm0, (%rax)
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x10, %rdi
movslq 0x3c(%rsp), %rax
imulq $0x5, %rax, %rax
addq %rax, %rdi
callq 0x5930
movsd 0x82bf(%rip), %xmm1     # 0x2b828
addsd %xmm1, %xmm0
movq 0x40(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x40(%rsp)
movsd %xmm0, (%rax)
jmp 0x23584
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x233df
jmp 0x23596
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x233ba
jmp 0x235a8
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x23388
movq 0x68(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x68(%rsp), %rdi
movq 0x60(%rsp), %rsi
movl 0x38(%rsp), %edx
movl 0x2c(%rsp), %ecx
movl $0x4, %r8d
leaq 0x58(%rsp), %r9
leaq 0x50(%rsp), %rax
xorl %r10d, %r10d
movq %rax, (%rsp)
movq $0x0, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
callq 0x213d0
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jge 0x23789
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
cmpl $0x0, 0x58(%rax)
jne 0x23647
jmp 0x23779
movl $0x0, 0x30(%rsp)
movl 0x30(%rsp), %eax
movq 0x80(%rsp), %rcx
movslq 0x34(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x23777
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x14(%rax)
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
movq 0x80(%rsp), %rcx
movslq 0x34(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
movq 0x68(%rcx), %rcx
movslq 0x30(%rsp), %rdx
movq (%rcx,%rdx,8), %rcx
cmpl (%rcx), %eax
jge 0x23765
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
addq $0x10, %rdi
movslq 0x3c(%rsp), %rax
imulq $0x5, %rax, %rax
addq %rax, %rdi
callq 0x6340
cmpl $0x0, %eax
jne 0x23753
movq 0x50(%rsp), %rax
movq %rax, %rcx
addq $0x8, %rcx
movq %rcx, 0x50(%rsp)
movsd (%rax), %xmm1
movq 0x80(%rsp), %rax
movslq 0x34(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x68(%rax), %rax
movslq 0x30(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x768(%rax), %rax
movss 0x14(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x14(%rax)
jmp 0x23755
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x236a1
jmp 0x23767
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x2364f
jmp 0x23779
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x2361d
movq 0x68(%rsp), %rdi
callq 0x2030
movq 0x60(%rsp), %rdi
callq 0x2030
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
nop