// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x1638, %rsp           # imm = 0x1638
movq %rdi, 0x1630(%rsp)
movl $0x0, 0x162c(%rsp)
leaq 0x1608(%rsp), %rdi
callq 0x480130
leaq 0x15e7(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x411ca0
movq 0x38(%rsp), %rdx
leaq 0x18717f(%rip), %rsi    # 0x58c1d4
leaq 0x15e8(%rsp), %rdi
callq 0x410690
jmp 0x405064
leaq 0x15e7(%rsp), %rdi
callq 0x411cc0
movq 0x1630(%rsp), %rsi
leaq 0x13c8(%rsp), %rdi
movl $0x8, %edx
callq 0x456700
jmp 0x40508d
leaq 0x13c8(%rsp), %rdi
callq 0x4528b0
movb %al, 0x37(%rsp)
jmp 0x4050a0
movb 0x37(%rsp), %al
testb $0x1, %al
jne 0x4050ad
jmp 0x4052a7
jmp 0x4050af
movq 0x13c8(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x13c8(%rsp,%rax), %rdi
callq 0x45a830
movb %al, 0x36(%rsp)
jmp 0x4050ce
movb 0x36(%rsp), %al
testb $0x1, %al
jne 0x4050db
jmp 0x405296
leaq 0x13c8(%rsp), %rdi
leaq 0x1608(%rsp), %rsi
callq 0x482c80
jmp 0x4050f2
leaq 0x15e8(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x480470
movq 0x28(%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
leaq 0x1608(%rsp), %rdi
callq 0x482300
movl %eax, 0x30(%rsp)
jmp 0x405123
movl 0x30(%rsp), %eax
cmpl $0x0, %eax
jne 0x405291
leaq 0x1870a3(%rip), %rcx    # 0x58c1da
leaq 0x1608(%rsp), %rdi
movl $0xc, %esi
movl $0x4, %edx
callq 0x4824c0
movl %eax, 0x24(%rsp)
jmp 0x405154
movl 0x24(%rsp), %eax
cmpl $0x0, %eax
je 0x4051bb
leaq 0x18707b(%rip), %rcx    # 0x58c1df
leaq 0x1608(%rsp), %rdi
movl $0xc, %esi
movl $0x4, %edx
callq 0x4824c0
movl %eax, 0x20(%rsp)
jmp 0x405181
movl 0x20(%rsp), %eax
cmpl $0x0, %eax
je 0x4051bb
leaq 0x187053(%rip), %rcx    # 0x58c1e4
leaq 0x1608(%rsp), %rdi
movl $0xc, %esi
movl $0x4, %edx
callq 0x4824c0
movl %eax, 0x1c(%rsp)
jmp 0x4051ae
movl 0x1c(%rsp), %eax
cmpl $0x0, %eax
jne 0x40528f
leaq 0x187eb1(%rip), %rcx    # 0x58d073
leaq 0x1608(%rsp), %rdi
movl $0x10, %esi
movl $0x1, %edx
callq 0x4824c0
movl %eax, 0x18(%rsp)
jmp 0x4051df
movl 0x18(%rsp), %eax
cmpl $0x0, %eax
je 0x405215
leaq 0x187c91(%rip), %rcx    # 0x58ce80
leaq 0x1608(%rsp), %rdi
movl $0x10, %esi
movl $0x1, %edx
callq 0x4824c0
movl %eax, 0x14(%rsp)
jmp 0x40520c
movl 0x14(%rsp), %eax
cmpl $0x0, %eax
jne 0x40528d
movl 0x162c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x162c(%rsp)
jmp 0x40528d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x15d8(%rsp)
movl %eax, 0x15d4(%rsp)
leaq 0x15e7(%rsp), %rdi
callq 0x411cc0
jmp 0x405320
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x15d8(%rsp)
movl %eax, 0x15d4(%rsp)
jmp 0x405313
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x15d8(%rsp)
movl %eax, 0x15d4(%rsp)
leaq 0x13c8(%rsp), %rdi
callq 0x457060
jmp 0x405313
jmp 0x40528f
jmp 0x405291
jmp 0x4050af
leaq 0x13c8(%rsp), %rdi
callq 0x456cb0
jmp 0x4052a5
jmp 0x4052d5
movq 0x1630(%rsp), %rdx
leaq 0x186f33(%rip), %rsi    # 0x58c1e9
xorl %eax, %eax
leaq 0x40(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x4e1e10
movq 0x8(%rsp), %rdi
callq 0x404740
jmp 0x4052d3
jmp 0x4052d5
movl 0x162c(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x13c8(%rsp), %rdi
callq 0x457060
leaq 0x15e8(%rsp), %rdi
callq 0x480240
leaq 0x1608(%rsp), %rdi
callq 0x480240
movl 0x4(%rsp), %eax
addq $0x1638, %rsp           # imm = 0x1638
retq
leaq 0x15e8(%rsp), %rdi
callq 0x480240
leaq 0x1608(%rsp), %rdi
callq 0x480240
movq 0x15d8(%rsp), %rdi
callq 0x4bafd0
nopw (%rax,%rax)