// File: /workspace/github_c_makefile_star2_O1/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)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x17f61c(%rip), %rsi    # 0x584220
leaq 0x17f61a(%rip), %rdx    # 0x584225
leaq 0x8(%rsp), %rdi
callq 0x40c2be
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x452ba0
leaq 0xc0(%rsp), %rdi
callq 0x40d290
testb %al, %al
je 0x404db1
movq 0x48(%rsp), %rax
movq -0x18(%rax), %rax
xorl %ebx, %ebx
cmpl $0x0, 0x68(%rsp,%rax)
jne 0x404d51
leaq (%rsp,%rax), %rdi
addq $0x48, %rdi
xorl %ebx, %ebx
leaq 0x48(%rsp), %r14
leaq 0x28(%rsp), %r15
leaq 0x8(%rsp), %r12
leaq 0x17f5b4(%rip), %r13    # 0x584226
leaq 0x18049e(%rip), %rbp    # 0x585117
movl $0xa, %esi
callq 0x456f30
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x40e660
movq 0x10(%rsp), %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0x47e7a0
testl %eax, %eax
jne 0x404d36
movl $0xc, %esi
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rcx
callq 0x47e960
testl %eax, %eax
je 0x404cfe
movl $0xc, %esi
movl $0x4, %edx
movq %r15, %rdi
leaq 0x17f553(%rip), %rcx    # 0x58422b
callq 0x47e960
testl %eax, %eax
je 0x404cfe
movl $0xc, %esi
movl $0x4, %edx
movq %r15, %rdi
leaq 0x17f53b(%rip), %rcx    # 0x584230
callq 0x47e960
testl %eax, %eax
jne 0x404d36
movl $0x10, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbp, %rcx
callq 0x47e960
testl %eax, %eax
je 0x404d34
movl $0x10, %esi
movl $0x1, %edx
movq %r15, %rdi
leaq 0x17ffe2(%rip), %rcx    # 0x584d0d
callq 0x47e960
testl %eax, %eax
jne 0x404d36
incl %ebx
movq 0x48(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x48, %rdi
cmpl $0x0, 0x20(%rdi)
je 0x404c79
leaq 0x48(%rsp), %rdi
callq 0x453150
leaq 0x48(%rsp), %rdi
callq 0x453500
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x404d81
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40c350
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x404d9d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40c350
movl %ebx, %eax
addq $0x15d8, %rsp           # imm = 0x15D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17f47d(%rip), %rsi    # 0x584235
leaq 0x250(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4d98e0
movq %r14, %rdi
callq 0x404708
jmp 0x404de3
jmp 0x404de3
movq %rax, %rbx
jmp 0x404df0
movq %rax, %rbx
jmp 0x404e0c
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x453500
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x404e0c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40c350
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x404e28
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40c350
movq %rbx, %rdi
callq 0x4b2aa0