// File: /workspace/github_c_makefile_star2_O2/asford[P]tmalign/./basic_fun.h
// Function: read_PDB(char*, double**, char*, int*)
int read_PDB(char *filename, double **a, char *seq, int *resno)
{
    int i=0;
    string line, str;    
    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 )
                    {  
                        get_xyz(line, &a[i][0], &a[i][1], &a[i][2], &seq[i], &resno[i]);
                        i++;
                    }
                }                  
            }            
        }
        fin.close();
    }
    else
    {
		char message[5000];
		sprintf(message, "Can not open file: %s\n", filename);
        PrintErrorAndQuit(message);
    } 
    seq[i]='\0';   
    
    return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1628, %rsp           # imm = 0x1628
movq %rcx, 0x10(%rsp)
movq %rdx, (%rsp)
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x88(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x17e48f(%rip), %rsi    # 0x5831e0
leaq 0x18(%rsp), %rdi
leaq 0x2a0(%rsp), %rdx
callq 0x40aeca
leaq 0x98(%rsp), %rdi
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x450f40
leaq 0x110(%rsp), %rdi
callq 0x40c030
testb %al, %al
je 0x404f08
xorl %r12d, %r12d
leaq 0x98(%rsp), %r13
leaq 0x38(%rsp), %rbp
leaq 0x18(%rsp), %r14
pushq $0x4
popq %r15
movq 0x98(%rsp), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0xb8(%rsp,%rax)
movl %r12d, %ebx
jne 0x404eb3
movq %r13, %rdi
movq %rbp, %rsi
callq 0x47d4c0
movq 0x20(%rsp), %rdx
movq %rbp, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq 0x47cb40
testl %eax, %eax
jne 0x404da4
movq %rbp, %rdi
pushq $0xc
popq %rsi
movq %r15, %rdx
leaq 0x17e3f4(%rip), %rcx    # 0x5831e6
callq 0x47cd00
testl %eax, %eax
je 0x404e31
movq %rbp, %rdi
pushq $0xc
popq %rsi
movq %r15, %rdx
leaq 0x17e3e0(%rip), %rcx    # 0x5831eb
callq 0x47cd00
testl %eax, %eax
je 0x404e31
movq %rbp, %rdi
pushq $0xc
popq %rsi
movq %r15, %rdx
leaq 0x17e3cc(%rip), %rcx    # 0x5831f0
callq 0x47cd00
testl %eax, %eax
jne 0x404da4
movq %rbp, %rdi
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
leaq 0x17f276(%rip), %rcx    # 0x5840b7
callq 0x47cd00
testl %eax, %eax
je 0x404e67
movq %rbp, %rdi
pushq $0x10
popq %rsi
pushq $0x1
popq %rdx
leaq 0x17ee5b(%rip), %rcx    # 0x583cb5
callq 0x47cd00
testl %eax, %eax
jne 0x404da4
leaq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x47d210
movq 0x8(%rsp), %rax
movq (%rax,%rbx,8), %rsi
leaq 0x8(%rsi), %rdx
leaq 0x10(%rsi), %rcx
movq (%rsp), %rax
leaq (%rax,%rbx), %r8
movq 0x10(%rsp), %rax
leaq (%rax,%rbx,4), %r9
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x404994
movq %rbx, %rdi
callq 0x47aa80
incl %r12d
jmp 0x404da4
leaq 0x98(%rsp), %rdi
callq 0x4514f0
movq (%rsp), %rax
movb $0x0, (%rax,%rbx)
leaq 0x98(%rsp), %rdi
callq 0x4518a0
leaq 0x18(%rsp), %rdi
callq 0x47aa80
leaq 0x78(%rsp), %rdi
callq 0x47aa80
leaq 0x38(%rsp), %rdi
callq 0x47aa80
movl %r12d, %eax
addq $0x1628, %rsp           # imm = 0x1628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17e2e6(%rip), %rsi    # 0x5831f5
leaq 0x2a0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x4d87f0
movq %r14, %rdi
callq 0x404708
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x47aa80
jmp 0x404f4e
jmp 0x404f4b
jmp 0x404f4b
jmp 0x404f4b
movq %rax, %rbx
jmp 0x404f5b
movq %rax, %rbx
jmp 0x404f65
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4518a0
leaq 0x18(%rsp), %rdi
callq 0x47aa80
leaq 0x78(%rsp), %rdi
callq 0x47aa80
leaq 0x38(%rsp), %rdi
callq 0x47aa80
movq %rbx, %rdi
callq 0x4b19b0