// File: /workspace/github_c_makefile_star2_O0/asford[P]tmalign/./basic_fun.h
// Function: read_ligand(char*, double**, char*, int*)
int read_ligand(char *filename, double **a, char *seq, int *resno)
{
    int i=0;
    char cstr[100];    
    string line, str;    
    string atom ("HETATM "); 
    string finish ("END"); 
    
    
    ifstream fin (filename);
    if (fin.is_open())
    {
        while ( fin.good() )
        {
            getline(fin, line);
            if(line.compare(0, atom.length(), atom)==0)
            {
                strcpy(cstr, (line.substr(12, 4)).c_str()); 
                   
                if(!strstr(cstr, "H"))
                {
                    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++;
                    }
                }                  
            }
            else if(line.compare(0, finish.length(), finish)==0) 
            {
                break;
            }          
        }
        fin.close();
    }
    else
    {
		char message[5000];
		sprintf(message, "Can not open file: %s\n", filename);
        PrintErrorAndQuit(message);     
    } 
    seq[i]='\0';   
    
    return i;
}

// Assembly:
subq $0x1748, %rsp           # imm = 0x1748
movq %rdi, 0x1740(%rsp)
movq %rsi, 0x1738(%rsp)
movq %rdx, 0x1730(%rsp)
movq %rcx, 0x1728(%rsp)
movl $0x0, 0x1724(%rsp)
leaq 0x16a0(%rsp), %rdi
callq 0x480130
leaq 0x1680(%rsp), %rdi
callq 0x480130
leaq 0x165f(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x411ca0
movq 0x48(%rsp), %rdx
leaq 0x186656(%rip), %rsi    # 0x58c200
leaq 0x1660(%rsp), %rdi
callq 0x410690
jmp 0x405bb9
leaq 0x165f(%rsp), %rdi
callq 0x411cc0
leaq 0x1627(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x411ca0
movq 0x40(%rsp), %rdx
leaq 0x186624(%rip), %rsi    # 0x58c208
leaq 0x1628(%rsp), %rdi
callq 0x410690
jmp 0x405bf3
leaq 0x1627(%rsp), %rdi
callq 0x411cc0
movq 0x1740(%rsp), %rsi
leaq 0x1418(%rsp), %rdi
movl $0x8, %edx
callq 0x456700
jmp 0x405c1c
leaq 0x1418(%rsp), %rdi
callq 0x4528b0
movb %al, 0x3f(%rsp)
jmp 0x405c2f
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x405c3c
jmp 0x405f0e
jmp 0x405c3e
movq 0x1418(%rsp), %rax
movq -0x18(%rax), %rax
leaq 0x1418(%rsp,%rax), %rdi
callq 0x45a830
movb %al, 0x3e(%rsp)
jmp 0x405c5d
movb 0x3e(%rsp), %al
testb $0x1, %al
jne 0x405c6a
jmp 0x405efd
leaq 0x1418(%rsp), %rdi
leaq 0x16a0(%rsp), %rsi
callq 0x482c80
jmp 0x405c81
leaq 0x1660(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x480470
movq 0x30(%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
leaq 0x16a0(%rsp), %rdi
callq 0x482300
movl %eax, 0x38(%rsp)
jmp 0x405cb2
movl 0x38(%rsp), %eax
cmpl $0x0, %eax
jne 0x405eba
leaq 0x16c0(%rsp), %rax
movq %rax, 0x28(%rsp)
leaq 0x13f8(%rsp), %rdi
leaq 0x16a0(%rsp), %rsi
movl $0xc, %edx
movl $0x4, %ecx
callq 0x482bf0
jmp 0x405ced
leaq 0x13f8(%rsp), %rdi
callq 0x481c80
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x401088
leaq 0x13f8(%rsp), %rdi
callq 0x480240
leaq 0x16c0(%rsp), %rdi
leaq 0x19d360(%rip), %rsi    # 0x5a3083
callq 0x4010a8
cmpq $0x0, %rax
jne 0x405eb8
leaq 0x18733a(%rip), %rcx    # 0x58d073
leaq 0x16a0(%rsp), %rdi
movl $0x10, %esi
movl $0x1, %edx
callq 0x4824c0
movl %eax, 0x24(%rsp)
jmp 0x405d56
movl 0x24(%rsp), %eax
cmpl $0x0, %eax
je 0x405d90
leaq 0x18711a(%rip), %rcx    # 0x58ce80
leaq 0x16a0(%rsp), %rdi
movl $0x10, %esi
movl $0x1, %edx
callq 0x4824c0
movl %eax, 0x20(%rsp)
jmp 0x405d83
movl 0x20(%rsp), %eax
cmpl $0x0, %eax
jne 0x405eb6
leaq 0x13d8(%rsp), %rdi
leaq 0x16a0(%rsp), %rsi
callq 0x4829d0
jmp 0x405da7
movq 0x1738(%rsp), %rax
movslq 0x1724(%rsp), %rdi
movq (%rax,%rdi,8), %rsi
movq %rsi, %rdx
addq $0x8, %rdx
movq %rsi, %rcx
addq $0x10, %rcx
movq 0x1730(%rsp), %r8
addq %rdi, %r8
movq 0x1728(%rsp), %rax
leaq (%rax,%rdi,4), %r9
leaq 0x13d8(%rsp), %rdi
callq 0x404d70
jmp 0x405def
leaq 0x13d8(%rsp), %rdi
callq 0x480240
movl 0x1724(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1724(%rsp)
jmp 0x405eb6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1650(%rsp)
movl %eax, 0x164c(%rsp)
leaq 0x165f(%rsp), %rdi
callq 0x411cc0
jmp 0x405fcf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1650(%rsp)
movl %eax, 0x164c(%rsp)
leaq 0x1627(%rsp), %rdi
callq 0x411cc0
jmp 0x405fc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1650(%rsp)
movl %eax, 0x164c(%rsp)
jmp 0x405fb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1650(%rsp)
movl %eax, 0x164c(%rsp)
jmp 0x405fa8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1650(%rsp)
movl %eax, 0x164c(%rsp)
leaq 0x13d8(%rsp), %rdi
callq 0x480240
jmp 0x405fa8
jmp 0x405eb8
jmp 0x405ef8
leaq 0x1628(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x480470
movq 0x10(%rsp), %rcx
movq %rax, %rdx
xorl %eax, %eax
movl %eax, %esi
leaq 0x16a0(%rsp), %rdi
callq 0x482300
movl %eax, 0x1c(%rsp)
jmp 0x405eeb
movl 0x1c(%rsp), %eax
cmpl $0x0, %eax
jne 0x405ef6
jmp 0x405efd
jmp 0x405ef8
jmp 0x405c3e
leaq 0x1418(%rsp), %rdi
callq 0x456cb0
jmp 0x405f0c
jmp 0x405f3c
movq 0x1740(%rsp), %rdx
leaq 0x1862cc(%rip), %rsi    # 0x58c1e9
xorl %eax, %eax
leaq 0x50(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x4e1e10
movq 0x8(%rsp), %rdi
callq 0x404740
jmp 0x405f3a
jmp 0x405f3c
movq 0x1730(%rsp), %rax
movslq 0x1724(%rsp), %rcx
movb $0x0, (%rax,%rcx)
movl 0x1724(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x1418(%rsp), %rdi
callq 0x457060
leaq 0x1628(%rsp), %rdi
callq 0x480240
leaq 0x1660(%rsp), %rdi
callq 0x480240
leaq 0x1680(%rsp), %rdi
callq 0x480240
leaq 0x16a0(%rsp), %rdi
callq 0x480240
movl 0x4(%rsp), %eax
addq $0x1748, %rsp           # imm = 0x1748
retq
leaq 0x1418(%rsp), %rdi
callq 0x457060
leaq 0x1628(%rsp), %rdi
callq 0x480240
leaq 0x1660(%rsp), %rdi
callq 0x480240
leaq 0x1680(%rsp), %rdi
callq 0x480240
leaq 0x16a0(%rsp), %rdi
callq 0x480240
movq 0x1650(%rsp), %rdi
callq 0x4bafd0
nopw %cs:(%rax,%rax)