// File: /workspace/github_c_makefile_star2_O3/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, 0x70(%rsp)
movq %rdx, %rbx
movq %rsi, 0x68(%rsp)
movq %rdi, %r14
leaq 0x58(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x88(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x17f38c(%rip), %rsi    # 0x584210
leaq 0x17f38a(%rip), %rdx    # 0x584215
leaq 0x28(%rsp), %rdi
callq 0x40c558
leaq 0x98(%rsp), %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0x452e40
leaq 0x110(%rsp), %rdi
callq 0x40d530
testb %al, %al
je 0x4050e2
movq 0x98(%rsp), %rax
movq -0x18(%rax), %rax
xorl %r14d, %r14d
cmpl $0x0, 0xb8(%rsp,%rax)
jne 0x405052
leaq (%rsp,%rax), %rdi
addq $0x98, %rdi
xorl %r14d, %r14d
leaq 0x98(%rsp), %r13
leaq 0x48(%rsp), %rbp
leaq 0x28(%rsp), %r15
leaq 0x17f313(%rip), %r12    # 0x584216
movl $0xa, %esi
callq 0x4571d0
movsbl %al, %edx
movq %r13, %rdi
movq %rbp, %rsi
callq 0x40e900
movq 0x30(%rsp), %rdx
movq %rbp, %rdi
xorl %esi, %esi
movq %r15, %rcx
callq 0x47ea40
testl %eax, %eax
jne 0x405031
movl $0xc, %esi
movl $0x4, %edx
movq %rbp, %rdi
movq %r12, %rcx
callq 0x47ec00
testl %eax, %eax
je 0x404f8c
movl $0xc, %esi
movl $0x4, %edx
movq %rbp, %rdi
leaq 0x17f2b9(%rip), %rcx    # 0x58421b
callq 0x47ec00
testl %eax, %eax
je 0x404f8c
movl $0xc, %esi
movl $0x4, %edx
movq %rbp, %rdi
leaq 0x17f2a1(%rip), %rcx    # 0x584220
callq 0x47ec00
testl %eax, %eax
jne 0x405031
movl $0x10, %esi
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x180147(%rip), %rcx    # 0x5850e7
callq 0x47ec00
testl %eax, %eax
je 0x404fc6
movl $0x10, %esi
movl $0x1, %edx
movq %rbp, %rdi
leaq 0x17fd28(%rip), %rcx    # 0x584ce5
callq 0x47ec00
testl %eax, %eax
jne 0x405031
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %rdi
callq 0x40c4c2
movslq %r14d, %rax
movq 0x68(%rsp), %rcx
movq (%rcx,%rax,8), %rsi
leaq 0x8(%rsi), %rdx
leaq 0x10(%rsi), %rcx
leaq (%rbx,%rax), %r8
movq 0x70(%rsp), %rdi
leaq (%rdi,%rax,4), %r9
leaq 0x8(%rsp), %rdi
callq 0x40499a
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x40502e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40c5f0
incl %r14d
movq 0x98(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x98, %rdi
cmpl $0x0, 0x20(%rdi)
je 0x404f03
leaq 0x98(%rsp), %rdi
callq 0x4533f0
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
leaq 0x98(%rsp), %rdi
callq 0x4537a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x40508f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x4050b1
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x4050cd
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movl %r14d, %eax
addq $0x1628, %rsp           # imm = 0x1628
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x17f13c(%rip), %rsi    # 0x584225
leaq 0x2a0(%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x4d9b80
movq %rbx, %rdi
callq 0x404708
jmp 0x405135
jmp 0x405135
movq %rax, %rbx
jmp 0x405145
movq %rax, %rbx
jmp 0x405161
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x405138
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x40c5f0
jmp 0x405138
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x4537a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x405161
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0x405183
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x40519f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x40c5f0
movq %rbx, %rdi
callq 0x4b2d40