// File: /workspace/github_cpp_makefile_star2_O1/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 $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x48(%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 0x2b752
movq %rsi, %r14
movq %rsp, %r15
leaq 0x40(%rsp), %r12
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
leaq 0x40(%rbp), %r13
movq %r13, %rdx
callq 0x2fdda
cmpq 0x8(%rsp), %rax
je 0x2b726
movq %r12, %rdi
movq %r13, %rsi
callq 0x2f84c
incl (%rax)
jmp 0x2b742
movq %r15, %rdi
movq %r13, %rsi
callq 0x2f74c
movq %r12, %rdi
movq %r13, %rsi
callq 0x2f84c
movl $0x1, (%rax)
addq $0x98, %rbp
cmpq 0x2f8(%r14), %rbp
jne 0x2b6fb
leaq 0x10(%rbx), %rax
movq %rax, 0x38(%rsp)
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movq 0x58(%rsp), %r14
leaq 0x48(%rsp), %rax
cmpq %rax, %r14
je 0x2b829
leaq 0xf0(%rsp), %r13
leaq 0x70(%rsp), %rbp
leaq 0x18(%rsp), %r15
movq 0x16b7ea(%rip), %r12    # 0x196f80
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq %rbx, %rdi
callq 0x4190
movq %rbp, %rdi
callq 0x42e0
movl 0x40(%r14), %esi
leaq 0x80(%rsp), %rdi
callq 0x4750
movq %r15, %rdi
leaq 0x88(%rsp), %rsi
callq 0x46a0
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %rbx, %rdi
callq 0x4190
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2b7fd
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4470
movq %rbp, %rdi
movq %r12, %rsi
callq 0x4310
movq %r13, %rdi
callq 0x41a0
movq %r14, %rdi
callq 0x42d0
movq %rax, %r14
leaq 0x48(%rsp), %rax
cmpq %rax, %r14
jne 0x2b796
leaq 0x40(%rsp), %rdi
callq 0x224d4
movq %rsp, %rdi
callq 0x2f6f0
movq %rbx, %rax
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2b852
movq %rax, %r14
jmp 0x2b89b
jmp 0x2b859
movq %rax, %r14
jmp 0x2b87d
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x2b87d
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x4470
movq 0x16b6fc(%rip), %rsi    # 0x196f80
leaq 0x70(%rsp), %rdi
callq 0x4310
leaq 0xf0(%rsp), %rdi
callq 0x41a0
movq (%rbx), %rdi
movq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x2b8ba
movq (%rax), %rsi
incq %rsi
callq 0x4470
jmp 0x2b8ba
jmp 0x2b8b7
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x224d4
movq %rsp, %rdi
callq 0x2f6f0
movq %r14, %rdi
callq 0x4780