// File: /workspace/github_cpp_makefile_star2_O3/Luthaf[P]zeopp/networkio.cc
// Function: get_formula[abi:cxx11](ATOM_NETWORK const*)
string get_formula(ATOM_NETWORK const *const cell)
{
    vector<string> atomtypes;
    map<string,int>  typecount;

    for (vector<ATOM>::const_iterator it=cell->atoms.begin(); it!=cell->atoms.end(); ++it){
        if (find(atomtypes.begin(), atomtypes.end(), it->type) != atomtypes.end()){
            ++(typecount[it->type]);
        }
        else{
            atomtypes.push_back(it->type);
            typecount[it->type] = 1;
        }
    }
    string formula;
    for (map<string,int>::iterator it=typecount.begin(); it!=typecount.end(); ++it){
        formula.append(it->first);
        stringstream ss;
        ss << it->second;
        formula.append(ss.str());
    }
    return formula;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x20(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rsp)
leaq 0x58(%rsp), %rcx
movl $0x0, (%rcx)
movq %rax, 0x8(%rcx)
movq %rcx, 0x10(%rcx)
movq %rcx, 0x18(%rcx)
movq %rax, 0x20(%rcx)
movq 0x2f0(%rsi), %rbp
cmpq 0x2f8(%rsi), %rbp
je 0x2b5e8
movq %rsi, %r14
leaq 0x10(%rsp), %r15
leaq 0x50(%rsp), %r12
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
leaq 0x40(%rbp), %r13
movq %r13, %rdx
callq 0x2fb7e
cmpq 0x18(%rsp), %rax
je 0x2b4e0
movq %r12, %rdi
movq %r13, %rsi
callq 0x2f620
incl (%rax)
jmp 0x2b4fc
movq %r15, %rdi
movq %r13, %rsi
callq 0x2f520
movq %r12, %rdi
movq %r13, %rsi
callq 0x2f620
movl $0x1, (%rax)
addq $0x98, %rbp
cmpq 0x2f8(%r14), %rbp
jne 0x2b4b4
movq 0x68(%rsp), %r15
leaq 0x10(%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x58(%rsp), %rax
cmpq %rax, %r15
je 0x2b5fb
leaq 0x98(%rsp), %r13
leaq 0x80(%rsp), %rbp
leaq 0x30(%rsp), %r14
movq 0x169a2d(%rip), %r12    # 0x194f80
movq 0x20(%r15), %rsi
movq 0x28(%r15), %rdx
movq %rbx, %rdi
callq 0x4190
movq %rbp, %rdi
callq 0x42e0
movl 0x40(%r15), %esi
leaq 0x90(%rsp), %rdi
callq 0x4750
movq %r14, %rdi
movq %r13, %rsi
callq 0x46a0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x4190
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2b5b5
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4310
leaq 0x100(%rsp), %rdi
callq 0x41a0
movq %r15, %rdi
callq 0x42d0
movq %rax, %r15
leaq 0x58(%rsp), %rax
cmpq %rax, %r15
jne 0x2b553
jmp 0x2b5fb
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
leaq 0x50(%rsp), %rdi
callq 0x223d0
leaq 0x10(%rsp), %rdi
callq 0x2f4c2
movq %rbx, %rax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b626
movq %rax, %r15
jmp 0x2b672
jmp 0x2b62d
movq %rax, %r15
jmp 0x2b651
movq %rax, %r15
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x2b651
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x169928(%rip), %rsi    # 0x194f80
leaq 0x80(%rsp), %rdi
callq 0x4310
leaq 0x100(%rsp), %rdi
callq 0x41a0
movq (%rbx), %rdi
cmpq 0x8(%rsp), %rdi
je 0x2b693
movq 0x8(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0x4470
jmp 0x2b693
jmp 0x2b690
movq %rax, %r15
leaq 0x50(%rsp), %rdi
callq 0x223d0
leaq 0x10(%rsp), %rdi
callq 0x2f4c2
movq %r15, %rdi
callq 0x4780