// File: /workspace/github_c_makefile_star2_O0/richarddurbin[P]hash10x/readseq.c
// Function: readMatrix
int readMatrix (char *name, int *conv, int** *mat)
{
  char matdirname[256] ;
  char fullname[512] ;
  FILE *fil ;
  char line[1024] = "#", *p;
  int i, j, nsymb, smax = 0 ;
  int symb[128] ;
  extern char* strtok (char*, const char*) ;

  if (getenv ("BLASTMAT")) 
    strcpy (matdirname, getenv ("BLASTMAT")) ;
  else
    strcpy (matdirname, "/nfs/disk100/pubseq/blastdb/") ;
  strcpy (fullname, matdirname) ;
  strcat (fullname, name) ;

  if (!(fil = fopen (name, "r")) && !(fil = fopen (fullname, "r")))
    { fprintf (stderr, "ERROR in readMatrix: could not open %s or %s\n",
	       name, matdirname) ;
      return 0 ;
    }
    
  while (!feof(fil) && *line == '#' && fgets (line, 1023, fil)) ; /* comments */
  if (feof(fil) || ferror(fil))
    { fprintf (stderr, "ERROR in readMatrix: empty file or read error\n") ;
      return 0 ;
    }

				/* character set */
  p = line ; while (*p == ' ' || *p == '\t' || *p == '\n') ++p ;
  for (i = 0 ; *p && i < 128 ; ++i)
    { symb[i] = conv[*p] ;
      if (symb[i] < -2)
	{ fprintf (stderr, "ERROR in readMatrix: illegal symbol %c\n", *p) ;
	  fclose (fil) ;
	  return 0 ;
	}
      if (symb[i] > smax)
	smax = symb[i] ;
      ++p ; while (*p == ' ' || *p == '\t' || *p == '\n') ++p ;
    }
  nsymb = i ;

  ++smax ;
  *mat = (int**) messalloc (smax * sizeof (int*)) ;
  for (i = 0 ; i < smax ; ++i)
    (*mat)[i] = (int*) messalloc (smax * sizeof (int)) ;

  for (i = 0 ; fgets(line, 1023, fil) && i < nsymb ; ++i)
    { p = line ; while (*p == ' ' || *p == '\t' || *p == '\n') ++p ;
      if (p && conv[*p] == symb[i])
	{ ++p ; while (*p == ' ' || *p == '\t' || *p == '\n') ++p ; }
      for (j = 0 ; *p && j < 128 ; ++j)
	{ if (symb[i] >= 0 && symb[j] >= 0) 
	    (*mat)[symb[i]][symb[j]] = atoi(p) ;
	  if (*p == '-') ++p ;
	  while (p && *p >= '0' && *p <= '9') ++p ;
	  while (*p == ' ' || *p == '\t' || *p == '\n') ++p ;
	}
      if (j != nsymb)
	{ fprintf (stderr, "ERROR in readMatrix: bad line: %s\n", line) ;
	  fclose (fil) ;
	  return 0 ;
	} 
    }

  fclose (fil) ;
  return 1 ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x970, %rsp            # imm = 0x970
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x730(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x10f0
movb $0x23, -0x730(%rbp)
movl $0x0, -0x748(%rbp)
leaq 0x5fe8(%rip), %rdi      # 0xf84a
callq 0x1030
cmpq $0x0, %rax
je 0x9898
leaq -0x120(%rbp), %rax
movq %rax, -0x958(%rbp)
leaq 0x5fc8(%rip), %rdi      # 0xf84a
callq 0x1030
movq -0x958(%rbp), %rdi
movq %rax, %rsi
callq 0x1070
jmp 0x98ab
leaq -0x120(%rbp), %rdi
leaq 0x5fad(%rip), %rsi      # 0xf853
callq 0x1070
leaq -0x320(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0x1070
leaq -0x320(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1220
movq -0x10(%rbp), %rdi
leaq 0x594f(%rip), %rsi      # 0xf228
callq 0x11e0
movq %rax, -0x328(%rbp)
cmpq $0x0, %rax
jne 0x993a
leaq -0x320(%rbp), %rdi
leaq 0x592f(%rip), %rsi      # 0xf228
callq 0x11e0
movq %rax, -0x328(%rbp)
cmpq $0x0, %rax
jne 0x993a
movq 0x96e6(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq -0x120(%rbp), %rcx
leaq 0x5f49(%rip), %rsi      # 0xf870
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9fba
jmp 0x993c
movq -0x328(%rbp), %rdi
callq 0x1160
movl %eax, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x959(%rbp)
jne 0x9990
movsbl -0x730(%rbp), %ecx
xorl %eax, %eax
cmpl $0x23, %ecx
movb %al, -0x959(%rbp)
jne 0x9990
leaq -0x730(%rbp), %rdi
movq -0x328(%rbp), %rdx
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1110
cmpq $0x0, %rax
setne %al
movb %al, -0x959(%rbp)
movb -0x959(%rbp), %al
testb $0x1, %al
jne 0x999c
jmp 0x999e
jmp 0x993c
movq -0x328(%rbp), %rdi
callq 0x1160
cmpl $0x0, %eax
jne 0x99c0
movq -0x328(%rbp), %rdi
callq 0x1080
cmpl $0x0, %eax
je 0x99e4
movq 0x9631(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x5ecd(%rip), %rsi      # 0xf89e
movb $0x0, %al
callq 0x1150
movl $0x0, -0x4(%rbp)
jmp 0x9fba
leaq -0x730(%rbp), %rax
movq %rax, -0x738(%rbp)
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x95a(%rbp)
je 0x9a36
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x95a(%rbp)
je 0x9a36
movq -0x738(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x95a(%rbp)
movb -0x95a(%rbp), %al
testb $0x1, %al
jne 0x9a42
jmp 0x9a56
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
jmp 0x99f2
movl $0x0, -0x73c(%rbp)
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x95b(%rbp)
je 0x9a8a
cmpl $0x80, -0x73c(%rbp)
setl %al
movb %al, -0x95b(%rbp)
movb -0x95b(%rbp), %al
testb $0x1, %al
jne 0x9a99
jmp 0x9bba
movq -0x18(%rbp), %rax
movq -0x738(%rbp), %rcx
movsbq (%rcx), %rcx
movl (%rax,%rcx,4), %ecx
movslq -0x73c(%rbp), %rax
movl %ecx, -0x950(%rbp,%rax,4)
movslq -0x73c(%rbp), %rax
cmpl $-0x2, -0x950(%rbp,%rax,4)
jge 0x9b04
movq 0x9527(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movq -0x738(%rbp), %rax
movsbl (%rax), %edx
leaq 0x5de8(%rip), %rsi      # 0xf8cd
movb $0x0, %al
callq 0x1150
movq -0x328(%rbp), %rdi
callq 0x10b0
movl $0x0, -0x4(%rbp)
jmp 0x9fba
movslq -0x73c(%rbp), %rax
movl -0x950(%rbp,%rax,4), %eax
cmpl -0x748(%rbp), %eax
jle 0x9b2e
movslq -0x73c(%rbp), %rax
movl -0x950(%rbp,%rax,4), %eax
movl %eax, -0x748(%rbp)
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x95c(%rbp)
je 0x9b84
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x95c(%rbp)
je 0x9b84
movq -0x738(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x95c(%rbp)
movb -0x95c(%rbp), %al
testb $0x1, %al
jne 0x9b90
jmp 0x9ba4
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
jmp 0x9b40
jmp 0x9ba6
movl -0x73c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x73c(%rbp)
jmp 0x9a60
movl -0x73c(%rbp), %eax
movl %eax, -0x744(%rbp)
movl -0x748(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x748(%rbp)
movslq -0x748(%rbp), %rax
shlq $0x3, %rax
movl %eax, %edi
callq 0x9fd0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x73c(%rbp)
movl -0x73c(%rbp), %eax
cmpl -0x748(%rbp), %eax
jge 0x9c41
movslq -0x748(%rbp), %rax
shlq $0x2, %rax
movl %eax, %edi
callq 0x9fd0
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x73c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x73c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x73c(%rbp)
jmp 0x9bfb
movl $0x0, -0x73c(%rbp)
leaq -0x730(%rbp), %rdi
movq -0x328(%rbp), %rdx
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x1110
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x95d(%rbp)
je 0x9c89
movl -0x73c(%rbp), %eax
cmpl -0x744(%rbp), %eax
setl %al
movb %al, -0x95d(%rbp)
movb -0x95d(%rbp), %al
testb $0x1, %al
jne 0x9c98
jmp 0x9fa7
leaq -0x730(%rbp), %rax
movq %rax, -0x738(%rbp)
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x95e(%rbp)
je 0x9cea
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x95e(%rbp)
je 0x9cea
movq -0x738(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x95e(%rbp)
movb -0x95e(%rbp), %al
testb $0x1, %al
jne 0x9cf6
jmp 0x9d0a
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
jmp 0x9ca6
cmpq $0x0, -0x738(%rbp)
je 0x9db2
movq -0x18(%rbp), %rax
movq -0x738(%rbp), %rcx
movsbq (%rcx), %rcx
movl (%rax,%rcx,4), %eax
movslq -0x73c(%rbp), %rcx
cmpl -0x950(%rbp,%rcx,4), %eax
jne 0x9db2
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x95f(%rbp)
je 0x9d90
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x95f(%rbp)
je 0x9d90
movq -0x738(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x95f(%rbp)
movb -0x95f(%rbp), %al
testb $0x1, %al
jne 0x9d9c
jmp 0x9db0
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
jmp 0x9d4c
jmp 0x9db2
movl $0x0, -0x740(%rbp)
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x960(%rbp)
je 0x9de6
cmpl $0x80, -0x740(%rbp)
setl %al
movb %al, -0x960(%rbp)
movb -0x960(%rbp), %al
testb $0x1, %al
jne 0x9df5
jmp 0x9f4f
movslq -0x73c(%rbp), %rax
cmpl $0x0, -0x950(%rbp,%rax,4)
jl 0x9e51
movslq -0x740(%rbp), %rax
cmpl $0x0, -0x950(%rbp,%rax,4)
jl 0x9e51
movq -0x738(%rbp), %rdi
callq 0x1210
movl %eax, %edx
movq -0x20(%rbp), %rax
movq (%rax), %rax
movslq -0x73c(%rbp), %rcx
movslq -0x950(%rbp,%rcx,4), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x740(%rbp), %rcx
movslq -0x950(%rbp,%rcx,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x738(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x9e72
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
jmp 0x9e74
xorl %eax, %eax
cmpq $0x0, -0x738(%rbp)
movb %al, -0x961(%rbp)
je 0x9eb3
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x961(%rbp)
jl 0x9eb3
movq -0x738(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x961(%rbp)
movb -0x961(%rbp), %al
testb $0x1, %al
jne 0x9ebf
jmp 0x9ed3
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
jmp 0x9e74
jmp 0x9ed5
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x962(%rbp)
je 0x9f19
movq -0x738(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x962(%rbp)
je 0x9f19
movq -0x738(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
sete %al
movb %al, -0x962(%rbp)
movb -0x962(%rbp), %al
testb $0x1, %al
jne 0x9f25
jmp 0x9f39
movq -0x738(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x738(%rbp)
jmp 0x9ed5
jmp 0x9f3b
movl -0x740(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x740(%rbp)
jmp 0x9dbc
movl -0x740(%rbp), %eax
cmpl -0x744(%rbp), %eax
je 0x9f91
movq 0x9094(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq -0x730(%rbp), %rdx
leaq 0x5980(%rip), %rsi      # 0xf8f5
movb $0x0, %al
callq 0x1150
movq -0x328(%rbp), %rdi
callq 0x10b0
movl $0x0, -0x4(%rbp)
jmp 0x9fba
jmp 0x9f93
movl -0x73c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x73c(%rbp)
jmp 0x9c4b
movq -0x328(%rbp), %rdi
callq 0x10b0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x970, %rsp            # imm = 0x970
popq %rbp
retq
nopw %cs:(%rax,%rax)