// File: /workspace/github_c_makefile_star2_O0/ugobas[P]tnm/NeedlemanWunsch.c
// Function: ReadMDM
int ReadMDM(char *mdmfile)
{
   FILE *mdm = NULL;
   int  i, j;
   char buffer[MAXBUFF],
        word[16],
        *p;
   int noenv;

   if((mdm=OpenFile(mdmfile, DATAENV, "r", &noenv))==NULL)
   {
      return(0);
   }

   /* Read over any comment lines                                       */
   while(fgets(buffer,MAXBUFF,mdm))
   {
      TERMINATE(buffer);
      KILLLEADSPACES(p,buffer);
      if(strlen(p) && p[0] != '!')
         break;
   }

   /* See how many fields there are in the buffer                       */
   for(p = buffer, sMDMSize = 0; p!=NULL; sMDMSize++)
     p = GetWord(p, word, 16, 1);


   /* Allocate memory for the MDM and the AA List                       */
   if((sMDMScore = (int **)Array2D(sizeof(int),sMDMSize,sMDMSize))==NULL)
      return(0);
   if((sMDM_AAList = (char *)malloc((sMDMSize+1)*sizeof(char)))==NULL)
   {
      FreeArray2D((char **)sMDMScore, sMDMSize, sMDMSize);
      return(0);
   }

   /* Fill the matrix with zeros                                        */
   for(i=0; i<sMDMSize; i++)
   {
      for(j=0; j<sMDMSize; j++)
      {
         sMDMScore[i][j] = 0;
      }
   }

   /* If our first word was a valid number, assume that numbers come
      first
   */
   i=0;
   do
   {
      TERMINATE(buffer);
      KILLLEADSPACES(p, buffer);
      if(strlen(p))
      {
         GetWord(buffer, word, 16, 1);
         if(sscanf(word,"%d",&j))    /* A row of numbers                */
         {
            for(p = buffer, j = 0; p!=NULL && j<sMDMSize; j++)
            {
               p = GetWord(p, word, 16, 1);
               sscanf(word,"%d",&(sMDMScore[i][j]));
            }
            i++;
         }
         else                        /* Amino acid names                */
         {
            for(p = buffer, j = 0; p!=NULL && j<sMDMSize; j++)
            {
               p = GetWord(p, word, 16, 1);
               sMDM_AAList[j] = word[0];
            }
         }
      }
   }  while(fgets(buffer,MAXBUFF,mdm));

   fclose(mdm);

   return(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x13322(%rip), %rsi     # 0x83654
leaq 0x121a4(%rip), %rdx     # 0x824dd
leaq -0x1cc(%rbp), %rcx
callq 0x6e410
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x7035b
movl $0x0, -0x4(%rbp)
jmp 0x70803
jmp 0x7035d
leaq -0x1b0(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x190, %esi            # imm = 0x190
callq 0x1130
cmpq $0x0, %rax
je 0x7045c
jmp 0x7037e
movl $0x0, -0x1d0(%rbp)
movslq -0x1d0(%rbp), %rax
cmpb $0x0, -0x1b0(%rbp,%rax)
je 0x703d1
movslq -0x1d0(%rbp), %rax
movsbl -0x1b0(%rbp,%rax), %eax
cmpl $0xa, %eax
jne 0x703be
movslq -0x1d0(%rbp), %rax
movb $0x0, -0x1b0(%rbp,%rax)
jmp 0x703d1
jmp 0x703c0
movl -0x1d0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d0(%rbp)
jmp 0x70388
jmp 0x703d3
jmp 0x703d5
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x1d5(%rbp)
je 0x70410
movq -0x1c8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x1d5(%rbp)
movb -0x1d5(%rbp), %al
testb $0x1, %al
jne 0x7041c
jmp 0x70432
jmp 0x7041e
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x703e3
jmp 0x70434
movq -0x1c8(%rbp), %rdi
callq 0x10b0
cmpq $0x0, %rax
je 0x70457
movq -0x1c8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
je 0x70457
jmp 0x7045c
jmp 0x7035d
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl $0x0, 0x2d5e4(%rip)     # 0x9da58
cmpq $0x0, -0x1c8(%rbp)
je 0x704b3
movq -0x1c8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
movl $0x10, %edx
movl $0x1, %ecx
callq 0x6e0f0
movq %rax, -0x1c8(%rbp)
movl 0x2d5b0(%rip), %eax     # 0x9da58
addl $0x1, %eax
movl %eax, 0x2d5a7(%rip)     # 0x9da58
jmp 0x70474
movl 0x2d59f(%rip), %esi     # 0x9da58
movl 0x2d599(%rip), %edx     # 0x9da58
movl $0x4, %edi
callq 0x6e550
movq %rax, 0x2d590(%rip)     # 0x9da60
cmpq $0x0, %rax
jne 0x704e2
movl $0x0, -0x4(%rbp)
jmp 0x70803
movl 0x2d570(%rip), %eax     # 0x9da58
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x0, %rdi
callq 0x1180
movq %rax, 0x2d56a(%rip)     # 0x9da68
cmpq $0x0, %rax
jne 0x70528
movq 0x2d555(%rip), %rdi     # 0x9da60
movl 0x2d547(%rip), %esi     # 0x9da58
movl 0x2d541(%rip), %edx     # 0x9da58
callq 0x6e660
movl $0x0, -0x4(%rbp)
jmp 0x70803
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x2d520(%rip), %eax     # 0x9da58
jge 0x7057e
movl $0x0, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl 0x2d50e(%rip), %eax     # 0x9da58
jge 0x70571
movq 0x2d50d(%rip), %rax     # 0x9da60
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x20(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x70541
jmp 0x70573
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x7052f
movl $0x0, -0x1c(%rbp)
jmp 0x70587
movl $0x0, -0x1d4(%rbp)
movslq -0x1d4(%rbp), %rax
cmpb $0x0, -0x1b0(%rbp,%rax)
je 0x705da
movslq -0x1d4(%rbp), %rax
movsbl -0x1b0(%rbp,%rax), %eax
cmpl $0xa, %eax
jne 0x705c7
movslq -0x1d4(%rbp), %rax
movb $0x0, -0x1b0(%rbp,%rax)
jmp 0x705da
jmp 0x705c9
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x70591
jmp 0x705dc
jmp 0x705de
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x1c8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x1d6(%rbp)
je 0x70619
movq -0x1c8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
sete %al
movb %al, -0x1d6(%rbp)
movb -0x1d6(%rbp), %al
testb $0x1, %al
jne 0x70625
jmp 0x7063b
jmp 0x70627
movq -0x1c8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1c8(%rbp)
jmp 0x705ec
jmp 0x7063d
movq -0x1c8(%rbp), %rdi
callq 0x10b0
cmpq $0x0, %rax
je 0x707d2
leaq -0x1b0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
movl $0x10, %edx
movl $0x1, %ecx
callq 0x6e0f0
leaq -0x1c0(%rbp), %rdi
leaq 0x12030(%rip), %rsi     # 0x826ae
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x11a0
cmpl $0x0, %eax
je 0x70746
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl $0x0, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x1c8(%rbp)
movb %al, -0x1d7(%rbp)
je 0x706cb
movl -0x20(%rbp), %eax
cmpl 0x2d396(%rip), %eax     # 0x9da58
setl %al
movb %al, -0x1d7(%rbp)
movb -0x1d7(%rbp), %al
testb $0x1, %al
jne 0x706d7
jmp 0x70738
movq -0x1c8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
movl $0x10, %edx
movl $0x1, %ecx
callq 0x6e0f0
movq %rax, -0x1c8(%rbp)
leaq -0x1c0(%rbp), %rdi
movq 0x2d357(%rip), %rax     # 0x9da60
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x20(%rbp), %rax
shlq $0x2, %rax
addq %rax, %rdx
leaq 0x11f8b(%rip), %rsi     # 0x826ae
movb $0x0, %al
callq 0x11a0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x706a7
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x707d0
leaq -0x1b0(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl $0x0, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x1c8(%rbp)
movb %al, -0x1d8(%rbp)
je 0x7077f
movl -0x20(%rbp), %eax
cmpl 0x2d2e2(%rip), %eax     # 0x9da58
setl %al
movb %al, -0x1d8(%rbp)
movb -0x1d8(%rbp), %al
testb $0x1, %al
jne 0x7078b
jmp 0x707ce
movq -0x1c8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
movl $0x10, %edx
movl $0x1, %ecx
callq 0x6e0f0
movq %rax, -0x1c8(%rbp)
movb -0x1c0(%rbp), %dl
movq 0x2d2ac(%rip), %rax     # 0x9da68
movslq -0x20(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x7075b
jmp 0x707d0
jmp 0x707d2
jmp 0x707d4
leaq -0x1b0(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x190, %esi            # imm = 0x190
callq 0x1130
cmpq $0x0, %rax
jne 0x70585
movq -0x18(%rbp), %rdi
callq 0x10a0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
nop