// File: /workspace/github_c_makefile_star2_O3/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 0x17f60c(%rip), %rsi    # 0x584210
leaq 0x17f60a(%rip), %rdx    # 0x584215
leaq 0x8(%rsp), %rdi
callq 0x40c558
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
movl $0x8, %edx
callq 0x452e40
leaq 0xc0(%rsp), %rdi
callq 0x40d530
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 0x17f5a4(%rip), %r13    # 0x584216
leaq 0x18046e(%rip), %rbp    # 0x5850e7
movl $0xa, %esi
callq 0x4571d0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x40e900
movq 0x10(%rsp), %rdx
movq %r15, %rdi
xorl %esi, %esi
movq %r12, %rcx
callq 0x47ea40
testl %eax, %eax
jne 0x404d36
movl $0xc, %esi
movl $0x4, %edx
movq %r15, %rdi
movq %r13, %rcx
callq 0x47ec00
testl %eax, %eax
je 0x404cfe
movl $0xc, %esi
movl $0x4, %edx
movq %r15, %rdi
leaq 0x17f543(%rip), %rcx    # 0x58421b
callq 0x47ec00
testl %eax, %eax
je 0x404cfe
movl $0xc, %esi
movl $0x4, %edx
movq %r15, %rdi
leaq 0x17f52b(%rip), %rcx    # 0x584220
callq 0x47ec00
testl %eax, %eax
jne 0x404d36
movl $0x10, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbp, %rcx
callq 0x47ec00
testl %eax, %eax
je 0x404d34
movl $0x10, %esi
movl $0x1, %edx
movq %r15, %rdi
leaq 0x17ffba(%rip), %rcx    # 0x584ce5
callq 0x47ec00
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 0x4533f0
leaq 0x48(%rsp), %rdi
callq 0x4537a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x404d81
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x404d9d
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movl %ebx, %eax
addq $0x15d8, %rsp           # imm = 0x15D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17f46d(%rip), %rsi    # 0x584225
leaq 0x250(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4d9b80
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 0x4537a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x404e0c
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x404e28
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq %rbx, %rdi
callq 0x4b2d40