// File: /workspace/github_c_makefile_star2_O2/asford[P]tmalign/./basic_fun.h
// Function: get_PDB_len(char*)
int get_PDB_len(char *filename)
{
    int i=0;   
    string line;
    string atom ("ATOM "); 
    
    
    ifstream fin (filename);
    if (fin.is_open())
    {
        while ( fin.good() )
        {
            getline(fin, line);
            if(line.compare(0, atom.length(), atom)==0)
            {
                if( line.compare(12, 4, "CA  ")==0 ||\
                    line.compare(12, 4, " CA ")==0 ||\
                    line.compare(12, 4, "  CA")==0 )
                {
                    if( line.compare(16, 1, " ")==0 ||\
                        line.compare(16, 1, "A")==0 )
                    {                                  
                        i++;
                    }
                }                  
            }            
        }
        fin.close();
    }
    else
    {
		char message[5000];
		sprintf(message, "Can not open file: %s\n", filename);
        PrintErrorAndQuit(message);
    }
    
    return i;    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x15d8, %rsp           # imm = 0x15D8
movq %rdi, %rbx
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x17e693(%rip), %rsi    # 0x5831e0
leaq 0x8(%rsp), %rdi
leaq 0x250(%rsp), %rdx
callq 0x40aeca
leaq 0x48(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x450f40
leaq 0xc0(%rsp), %rdi
callq 0x40c030
testb %al, %al
je 0x404ca8
movq $0x0, (%rsp)
leaq 0x48(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0x8(%rsp), %r12
pushq $0xc
popq %rbp
pushq $0x4
popq %rbx
pushq $0x1
popq %r13
movq 0x48(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x68(%rsp,%rax)
jne 0x404c6a
movq %r14, %rdi
movq %r15, %rsi
callq 0x47d4c0
movq 0x10(%rsp), %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0x47cb40
testl %eax, %eax
jne 0x404ba5
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x17e5fc(%rip), %rcx    # 0x5831e6
callq 0x47cd00
testl %eax, %eax
je 0x404c25
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x17e5e8(%rip), %rcx    # 0x5831eb
callq 0x47cd00
testl %eax, %eax
je 0x404c25
movq %r15, %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0x17e5d4(%rip), %rcx    # 0x5831f0
callq 0x47cd00
testl %eax, %eax
jne 0x404ba5
movq %r15, %rdi
pushq $0x10
popq %rsi
movq %r13, %rdx
leaq 0x17f482(%rip), %rcx    # 0x5840b7
callq 0x47cd00
testl %eax, %eax
je 0x404c5b
movq %r15, %rdi
pushq $0x10
popq %rsi
movq %r13, %rdx
leaq 0x17f067(%rip), %rcx    # 0x583cb5
callq 0x47cd00
testl %eax, %eax
jne 0x404ba5
movq (%rsp), %rax
incl %eax
movq %rax, (%rsp)
jmp 0x404ba5
leaq 0x48(%rsp), %rdi
callq 0x4514f0
leaq 0x48(%rsp), %rdi
callq 0x4518a0
leaq 0x8(%rsp), %rdi
callq 0x47aa80
leaq 0x28(%rsp), %rdi
callq 0x47aa80
movq (%rsp), %rax
addq $0x15d8, %rsp           # imm = 0x15D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17e546(%rip), %rsi    # 0x5831f5
leaq 0x250(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4d87f0
movq %r14, %rdi
callq 0x404708
jmp 0x404cda
jmp 0x404cda
movq %rax, %rbx
jmp 0x404ce7
movq %rax, %rbx
jmp 0x404cf1
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x4518a0
leaq 0x8(%rsp), %rdi
callq 0x47aa80
leaq 0x28(%rsp), %rdi
callq 0x47aa80
movq %rbx, %rdi
callq 0x4b19b0