// File: pesho-ivanov[P]crispr/simulation.cpp
// Function: stat(int)
void stat (int step)
{
  vector<int> cladeHist(S.nClades);    // cladeHist[i] -- number of cells of clade 'i'  

  for(int c=0; c<CELLS; c++)
    ++cladeHist[ S.clade[c] ];

  //sort(cladeHist.begin(), cladeHist.end());

  int livingClades=0;
  for(int i=0; i<cladeHist.size(); i++)
    if (cladeHist[i])
      livingClades++;

  vector<int> mutantHist(S.nMutants);    // cladeHist[i] -- number of cells of clade 'i'  
  
  for(int m=0; m<PHAGES; m++)
    ++mutantHist[ S.mutant[m] ];
  
  int livingMutants=0;
  for(int i=0; i<mutantHist.size(); i++)
    if (mutantHist[i])
      livingMutants++;
  
//  printf("step #%d:\t%d clades(%d live)\t%d mutants(%d live)\n", step, S.nClades, livingClades, S.nMutants, livingMutants);
}

// Assembly:
subq $0x98, %rsp
movl %edi, 0x94(%rsp)
movslq 0x57ab(%rip), %rax      # 0x70d0
movq %rax, 0x20(%rsp)
leaq 0x77(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x1d90
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0x78(%rsp), %rdi
callq 0x1da0
jmp 0x194f
leaq 0x77(%rsp), %rdi
callq 0x1e20
movl $0x0, 0x60(%rsp)
cmpl $0x3e8, 0x60(%rsp)      # imm = 0x3E8
jge 0x19b7
movslq 0x60(%rsp), %rcx
leaq 0x5759(%rip), %rax      # 0x70d0
movslq 0x8(%rax,%rcx,4), %rsi
leaq 0x78(%rsp), %rdi
callq 0x1e30
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl 0x60(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x60(%rsp)
jmp 0x1961
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x77(%rsp), %rdi
callq 0x1e20
jmp 0x1b32
movl $0x0, 0x5c(%rsp)
movl $0x0, 0x58(%rsp)
movslq 0x58(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x1e50
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x1a16
movslq 0x58(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x1e30
cmpl $0x0, (%rax)
je 0x1a07
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x1a09
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x19c7
movslq 0x56b7(%rip), %rax      # 0x70d4
movq %rax, 0x8(%rsp)
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x1d90
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x40(%rsp), %rdi
callq 0x1da0
jmp 0x1a47
leaq 0x3f(%rsp), %rdi
callq 0x1e20
movl $0x0, 0x38(%rsp)
cmpl $0x2710, 0x38(%rsp)     # imm = 0x2710
jge 0x1ab9
movslq 0x38(%rsp), %rcx
leaq 0x5661(%rip), %rax      # 0x70d0
movslq 0xfa8(%rax,%rcx,4), %rsi
leaq 0x40(%rsp), %rdi
callq 0x1e30
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl 0x38(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x38(%rsp)
jmp 0x1a59
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x68(%rsp)
movl %eax, 0x64(%rsp)
leaq 0x3f(%rsp), %rdi
callq 0x1e20
leaq 0x78(%rsp), %rdi
callq 0x1e70
jmp 0x1b32
movl $0x0, 0x34(%rsp)
movl $0x0, 0x30(%rsp)
movslq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0x1e50
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x1b16
movslq 0x30(%rsp), %rsi
leaq 0x40(%rsp), %rdi
callq 0x1e30
cmpl $0x0, (%rax)
je 0x1b07
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x1b09
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x1ac9
leaq 0x40(%rsp), %rdi
callq 0x1e70
leaq 0x78(%rsp), %rdi
callq 0x1e70
addq $0x98, %rsp
retq
movq 0x68(%rsp), %rdi
callq 0x1130
nopl (%rax)