#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *getenv(char *);
scalar_t__ messalloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
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);
  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;
}


x86 assembly (clang, -O0):
<readMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x970,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x730(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
movb   $0x23,-0x730(%rbp)
movl   $0x0,-0x748(%rbp)
lea    0xe0e(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     122f <readMatrix+0x7f>
lea    -0x120(%rbp),%rax
mov    %rax,-0x958(%rbp)
lea    0xdea(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x958(%rbp),%rdi
mov    %rax,%rsi
call   1050 <strcpy@plt>
jmp    1242 <readMatrix+0x92>
lea    -0x120(%rbp),%rdi
lea    0xdcc(%rip),%rsi
call   1050 <strcpy@plt>
lea    -0x320(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1050 <strcpy@plt>
lea    -0x320(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10d0 <strcat@plt>
mov    -0x10(%rbp),%rdi
lea    0xdb6(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x328(%rbp)
cmp    $0x0,%rax
jne    12d8 <readMatrix+0x128>
lea    -0x320(%rbp),%rdi
lea    0xd92(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x328(%rbp)
cmp    $0x0,%rax
jne    12d8 <readMatrix+0x128>
mov    0x2d2f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    -0x120(%rbp),%rcx
lea    0xd63(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    19cf <readMatrix+0x81f>
jmp    12dd <readMatrix+0x12d>
mov    -0x328(%rbp),%rdi
call   10a0 <feof@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x959(%rbp)
jne    130f <readMatrix+0x15f>
movsbl -0x730(%rbp),%eax
cmp    $0x23,%eax
sete   %al
mov    %al,-0x959(%rbp)
mov    -0x959(%rbp),%al
test   $0x1,%al
jne    1322 <readMatrix+0x172>
jmp    133f <readMatrix+0x18f>
lea    -0x730(%rbp),%rdi
mov    -0x328(%rbp),%rdx
mov    $0x3ff,%esi
call   1080 <fgets@plt>
jmp    12dd <readMatrix+0x12d>
lea    -0x730(%rbp),%rax
mov    %rax,-0x738(%rbp)
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x95a(%rbp)
je     1399 <readMatrix+0x1e9>
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x95a(%rbp)
je     1399 <readMatrix+0x1e9>
mov    -0x738(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x95a(%rbp)
mov    -0x95a(%rbp),%al
test   $0x1,%al
jne    13ac <readMatrix+0x1fc>
jmp    13c3 <readMatrix+0x213>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
jmp    134d <readMatrix+0x19d>
movl   $0x0,-0x73c(%rbp)
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x95b(%rbp)
je     13fb <readMatrix+0x24b>
cmpl   $0x80,-0x73c(%rbp)
setl   %al
mov    %al,-0x95b(%rbp)
mov    -0x95b(%rbp),%al
test   $0x1,%al
jne    140e <readMatrix+0x25e>
jmp    154b <readMatrix+0x39b>
mov    -0x18(%rbp),%rax
mov    -0x738(%rbp),%rcx
movsbq (%rcx),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x73c(%rbp),%rax
mov    %ecx,-0x950(%rbp,%rax,4)
movslq -0x73c(%rbp),%rax
cmpl   $0xfffffffe,-0x950(%rbp,%rax,4)
fe
jge    147c <readMatrix+0x2cc>
mov    0x2b96(%rip),%rax
mov    (%rax),%edi
mov    -0x738(%rbp),%rax
movsbl (%rax),%edx
lea    0xbf9(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x328(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    19cf <readMatrix+0x81f>
movslq -0x73c(%rbp),%rax
mov    -0x950(%rbp,%rax,4),%eax
cmp    -0x748(%rbp),%eax
jle    14aa <readMatrix+0x2fa>
movslq -0x73c(%rbp),%rax
mov    -0x950(%rbp,%rax,4),%eax
mov    %eax,-0x748(%rbp)
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x95c(%rbp)
je     1508 <readMatrix+0x358>
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x95c(%rbp)
je     1508 <readMatrix+0x358>
mov    -0x738(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x95c(%rbp)
mov    -0x95c(%rbp),%al
test   $0x1,%al
jne    151b <readMatrix+0x36b>
jmp    1532 <readMatrix+0x382>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
jmp    14bc <readMatrix+0x30c>
jmp    1537 <readMatrix+0x387>
mov    -0x73c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x73c(%rbp)
jmp    13cd <readMatrix+0x21d>
mov    -0x73c(%rbp),%eax
mov    %eax,-0x744(%rbp)
mov    -0x748(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x748(%rbp)
movslq -0x748(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <messalloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x73c(%rbp)
mov    -0x73c(%rbp),%eax
cmp    -0x748(%rbp),%eax
jge    15d9 <readMatrix+0x429>
movslq -0x748(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <messalloc@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x73c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x73c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x73c(%rbp)
jmp    158c <readMatrix+0x3dc>
movl   $0x0,-0x73c(%rbp)
lea    -0x730(%rbp),%rdi
mov    -0x328(%rbp),%rdx
mov    $0x3ff,%esi
call   1080 <fgets@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x95d(%rbp)
je     1625 <readMatrix+0x475>
mov    -0x73c(%rbp),%eax
cmp    -0x744(%rbp),%eax
setl   %al
mov    %al,-0x95d(%rbp)
mov    -0x95d(%rbp),%al
test   $0x1,%al
jne    1638 <readMatrix+0x488>
jmp    19bc <readMatrix+0x80c>
lea    -0x730(%rbp),%rax
mov    %rax,-0x738(%rbp)
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x95e(%rbp)
je     1692 <readMatrix+0x4e2>
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x95e(%rbp)
je     1692 <readMatrix+0x4e2>
mov    -0x738(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x95e(%rbp)
mov    -0x95e(%rbp),%al
test   $0x1,%al
jne    16a5 <readMatrix+0x4f5>
jmp    16bc <readMatrix+0x50c>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
jmp    1646 <readMatrix+0x496>
cmpq   $0x0,-0x738(%rbp)
je     177d <readMatrix+0x5cd>
mov    -0x18(%rbp),%rax
mov    -0x738(%rbp),%rcx
movsbq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x73c(%rbp),%rcx
cmp    -0x950(%rbp,%rcx,4),%eax
jne    177d <readMatrix+0x5cd>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x95f(%rbp)
je     174e <readMatrix+0x59e>
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x95f(%rbp)
je     174e <readMatrix+0x59e>
mov    -0x738(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x95f(%rbp)
mov    -0x95f(%rbp),%al
test   $0x1,%al
jne    1761 <readMatrix+0x5b1>
jmp    1778 <readMatrix+0x5c8>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
jmp    1702 <readMatrix+0x552>
jmp    177d <readMatrix+0x5cd>
movl   $0x0,-0x740(%rbp)
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x960(%rbp)
je     17b5 <readMatrix+0x605>
cmpl   $0x80,-0x740(%rbp)
setl   %al
mov    %al,-0x960(%rbp)
mov    -0x960(%rbp),%al
test   $0x1,%al
jne    17c8 <readMatrix+0x618>
jmp    195b <readMatrix+0x7ab>
movslq -0x73c(%rbp),%rax
cmpl   $0x0,-0x950(%rbp,%rax,4)
jl     182c <readMatrix+0x67c>
movslq -0x740(%rbp),%rax
cmpl   $0x0,-0x950(%rbp,%rax,4)
jl     182c <readMatrix+0x67c>
mov    -0x738(%rbp),%rdi
call   10c0 <atoi@plt>
mov    %eax,%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x73c(%rbp),%rcx
movslq -0x950(%rbp,%rcx,4),%rcx
ff
mov    (%rax,%rcx,8),%rax
movslq -0x740(%rbp),%rcx
movslq -0x950(%rbp,%rcx,4),%rcx
ff
mov    %edx,(%rax,%rcx,4)
mov    -0x738(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1851 <readMatrix+0x6a1>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
jmp    1856 <readMatrix+0x6a6>
xor    %eax,%eax
cmpq   $0x0,-0x738(%rbp)
mov    %al,-0x961(%rbp)
je     189d <readMatrix+0x6ed>
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x961(%rbp)
jl     189d <readMatrix+0x6ed>
mov    -0x738(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x961(%rbp)
mov    -0x961(%rbp),%al
test   $0x1,%al
jne    18b0 <readMatrix+0x700>
jmp    18c7 <readMatrix+0x717>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
jmp    1856 <readMatrix+0x6a6>
jmp    18cc <readMatrix+0x71c>
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x962(%rbp)
je     1918 <readMatrix+0x768>
mov    -0x738(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x962(%rbp)
je     1918 <readMatrix+0x768>
mov    -0x738(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x962(%rbp)
mov    -0x962(%rbp),%al
test   $0x1,%al
jne    192b <readMatrix+0x77b>
jmp    1942 <readMatrix+0x792>
mov    -0x738(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x738(%rbp)
jmp    18cc <readMatrix+0x71c>
jmp    1947 <readMatrix+0x797>
mov    -0x740(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x740(%rbp)
jmp    1787 <readMatrix+0x5d7>
mov    -0x740(%rbp),%eax
cmp    -0x744(%rbp),%eax
je     19a3 <readMatrix+0x7f3>
mov    0x266c(%rip),%rax
mov    (%rax),%edi
lea    -0x730(%rbp),%rdx
lea    0x6fa(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x328(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x0,-0x4(%rbp)
jmp    19cf <readMatrix+0x81f>
jmp    19a8 <readMatrix+0x7f8>
mov    -0x73c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x73c(%rbp)
jmp    15e3 <readMatrix+0x433>
mov    -0x328(%rbp),%rdi
call   1060 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x970,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x938,%rsp
mov    %rdx,%r14
mov    %rsi,%r13
mov    %rdi,%r12
lea    0x130(%rsp),%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
movb   $0x23,0x130(%rsp)
23
lea    0xe10(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1204 <readMatrix+0x54>
lea    0x30(%rsp),%rdi
mov    %rax,%rsi
jmp    1210 <readMatrix+0x60>
lea    0xdfe(%rip),%rsi
lea    0x30(%rsp),%rdi
call   1050 <strcpy@plt>
lea    0x730(%rsp),%r15
lea    0x30(%rsp),%rsi
mov    %r15,%rdi
call   1050 <strcpy@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   10d0 <strcat@plt>
lea    0xdea(%rip),%rsi
mov    %r12,%rdi
call   10b0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
jne    126c <readMatrix+0xbc>
lea    0xdd3(%rip),%rsi
lea    0x730(%rsp),%rdi
call   10b0 <fopen@plt>
mov    %rax,%r15
test   %rax,%rax
je     1596 <readMatrix+0x3e6>
mov    %r15,%rdi
call   10a0 <feof@plt>
mov    0x130(%rsp),%cl
test   %eax,%eax
jne    12c8 <readMatrix+0x118>
cmp    $0x23,%cl
jne    12c8 <readMatrix+0x118>
lea    0x130(%rsp),%r12
nopl   0x0(%rax)
mov    %r12,%rdi
mov    $0x3ff,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
mov    %r15,%rdi
call   10a0 <feof@plt>
movzbl 0x130(%rsp),%ecx
test   %eax,%eax
jne    12c8 <readMatrix+0x118>
cmp    $0x23,%cl
je     1290 <readMatrix+0xe0>
jmp    12c8 <readMatrix+0x118>
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%ecx
add    $0x1,%rbx
lea    -0x9(%rcx),%eax
cmp    $0x2,%al
jb     12c0 <readMatrix+0x110>
cmp    $0x20,%cl
je     12c0 <readMatrix+0x110>
xor    %eax,%eax
test   %cl,%cl
jne    12e4 <readMatrix+0x134>
mov    %rax,0x8(%rsp)
xor    %r12d,%r12d
jmp    1350 <readMatrix+0x1a0>
movabs $0x100000600,%rdx
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbq %cl,%rcx
mov    0x0(%r13,%rcx,4),%esi
mov    %esi,0x530(%rsp,%rax,4)
cmp    $0xfffffffd,%esi
jle    154d <readMatrix+0x39d>
nopl   0x0(%rax)
add    $0x1,%rbx
movzbl (%rbx),%ecx
cmp    $0x20,%rcx
ja     1333 <readMatrix+0x183>
bt     %rcx,%rdx
jb     1320 <readMatrix+0x170>
cmp    %r12d,%esi
cmovg  %esi,%r12d
lea    0x1(%rax),%rsi
test   %cl,%cl
je     134b <readMatrix+0x19b>
cmp    $0x7f,%rax
mov    %rsi,%rax
jb     1300 <readMatrix+0x150>
mov    %rsi,0x8(%rsp)
lea    0x8(,%r12,8),%edi
call   1040 <messalloc@plt>
mov    %rax,(%r14)
test   %r12d,%r12d
js     1398 <readMatrix+0x1e8>
add    $0x1,%r12d
mov    %r12d,%ebx
shl    $0x2,%r12d
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12d,%edi
call   1040 <messalloc@plt>
mov    (%r14),%rcx
mov    %rax,(%rcx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1380 <readMatrix+0x1d0>
mov    %r14,0x28(%rsp)
lea    0x130(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3ff,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
mov    0x8(%rsp),%rax
je     153e <readMatrix+0x38e>
test   %eax,%eax
je     153e <readMatrix+0x38e>
mov    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %r12d,%r12d
movabs $0x100000600,%r14
mov    %r13,0x18(%rsp)
mov    %r15,0x20(%rsp)
nopl   0x0(%rax)
lea    0x131(%rsp),%rcx
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
cmp    $0x20,%rax
ja     1420 <readMatrix+0x270>
bt     %rax,%r14
jae    1420 <readMatrix+0x270>
add    $0x1,%rbx
add    $0x1,%rcx
jmp    1400 <readMatrix+0x250>
nopl   0x0(%rax)
movsbq %al,%rdx
mov    0x530(%rsp,%r12,4),%r15d
cmp    %r15d,0x0(%r13,%rdx,4)
jne    1463 <readMatrix+0x2b3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rcx),%eax
cmp    $0x20,%rax
ja     1460 <readMatrix+0x2b0>
bt     %rax,%r14
jae    1460 <readMatrix+0x2b0>
add    $0x1,%rcx
jmp    1440 <readMatrix+0x290>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rbx
test   %al,%al
je     1500 <readMatrix+0x350>
xor    %r13d,%r13d
xchg   %ax,%ax
test   %r15d,%r15d
js     149a <readMatrix+0x2ea>
mov    0x530(%rsp,%r13,4),%ebp
test   %ebp,%ebp
js     149a <readMatrix+0x2ea>
mov    %rbx,%rdi
call   10c0 <atoi@plt>
mov    0x28(%rsp),%rcx
mov    (%rcx),%rcx
mov    (%rcx,%r15,8),%rcx
mov    %eax,(%rcx,%rbp,4)
mov    (%rbx),%al
xor    %ecx,%ecx
cmp    $0x2d,%al
sete   %cl
add    %rcx,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
lea    -0x30(%rax),%ecx
cmp    $0xa,%cl
jb     14b0 <readMatrix+0x300>
jmp    14d8 <readMatrix+0x328>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
cmp    $0x20,%al
ja     14e5 <readMatrix+0x335>
movzbl %al,%ecx
bt     %rcx,%r14
jb     14d0 <readMatrix+0x320>
lea    0x1(%r13),%rcx
test   %al,%al
je     1502 <readMatrix+0x352>
cmp    $0x7f,%r13
mov    %rcx,%r13
jb     1470 <readMatrix+0x2c0>
jmp    1502 <readMatrix+0x352>
nopl   0x0(%rax)
xor    %ecx,%ecx
cmp    0x8(%rsp),%ecx
mov    0x20(%rsp),%r15
lea    0x130(%rsp),%rbx
jne    156b <readMatrix+0x3bb>
mov    %rbx,%rdi
mov    $0x3ff,%esi
mov    %r15,%rdx
call   1080 <fgets@plt>
test   %rax,%rax
mov    0x18(%rsp),%r13
je     153e <readMatrix+0x38e>
add    $0x1,%r12
cmp    0x10(%rsp),%r12
jb     13f0 <readMatrix+0x240>
mov    %r15,%rdi
call   1060 <fclose@plt>
mov    $0x1,%ebx
jmp    15b7 <readMatrix+0x407>
mov    0x2a8c(%rip),%rax
mov    (%rax),%edi
movsbl (%rbx),%edx
lea    0xaf6(%rip),%rsi
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    158c <readMatrix+0x3dc>
mov    0x2a6e(%rip),%rax
mov    (%rax),%edi
lea    0xb03(%rip),%rsi
xor    %ebx,%ebx
lea    0x130(%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
jmp    15b7 <readMatrix+0x407>
mov    0x2a43(%rip),%rax
mov    (%rax),%edi
lea    0xa82(%rip),%rsi
xor    %ebx,%ebx
lea    0x30(%rsp),%rcx
mov    %r12,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %ebx,%eax
add    $0x938,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"BLASTMAT\00"
@.str.1 = [29 x i8] c"/nfs/disk100/pubseq/blastdb/\00"
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [46 x i8] c"ERROR in readMatrix: could not open %s or %s\0A\00"
@.str.4 = [40 x i8] c"ERROR in readMatrix: illegal symbol %c\0A\00"
@.str.5 = [35 x i8] c"ERROR in readMatrix: bad line: %s\0A\00"
define i32 @readMatrix(i8* %0, i32* %1, i32*** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32***
%8 = alloca [256 x i8]
%9 = alloca [512 x i8]
%10 = alloca i32*
%11 = alloca [1024 x i8]
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [128 x i32]
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32*** %2, i32**** %7
%18 = bitcast [1024 x i8]* %11 to i8*
%19 = bitcast i8* %18 to [1024 x i8]*
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %19, i32 0, i32 0
store i8 35, i8* %20
store i32 0, i32* %16
%21 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %27
23: ; preds = %3
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%25 = call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%26 = call i32 @strcpy(i8* %24, i8* %25)
br label %30
27: ; preds = %3
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%29 = call i32 @strcpy(i8* %28, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %27, %23
%31 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%32 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%33 = call i32 @strcpy(i8* %31, i8* %32)
%34 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%35 = load i8*, i8** %5
%36 = call i32 @strcat(i8* %34, i8* %35)
%37 = load i8*, i8** %5
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %38, i32** %10
%39 = icmp ne i32* %38, null
br i1 %39, label %49, label %40
40: ; preds = %30
%41 = getelementptr inbounds [512 x i8], [512 x i8]* %9, i64 0, i64 0
%42 = call i32* @fopen(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %42, i32** %10
%43 = icmp ne i32* %42, null
br i1 %43, label %49, label %44
44: ; preds = %40
%45 = load i32, i32* @stderr
%46 = load i8*, i8** %5
%47 = getelementptr inbounds [256 x i8], [256 x i8]* %8, i64 0, i64 0
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* %46, i8* %47)
store i32 0, i32* %4
br label %373
49: ; preds = %40, %30
br label %50
50: ; preds = %61, %49
%51 = load i32*, i32** %10
%52 = call i32 @feof(i32* %51)
%53 = icmp ne i32 %52, 0
br i1 %53, label %59, label %54
54: ; preds = %50
%55 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = icmp eq i32 %57, 35
br label %59
59: ; preds = %54, %50
%60 = phi i1 [ false, %50 ], [ %58, %54 ]
br i1 %60, label %61, label %65
61: ; preds = %59
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%63 = load i32*, i32** %10
%64 = call i64 @fgets(i8* %62, i32 1023, i32* %63)
br label %50
65: ; preds = %59
%66 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
store i8* %66, i8** %12
br label %67
67: ; preds = %84, %65
%68 = load i8*, i8** %12
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 32
br i1 %71, label %82, label %72
72: ; preds = %67
%73 = load i8*, i8** %12
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = icmp eq i32 %75, 9
br i1 %76, label %82, label %77
77: ; preds = %72
%78 = load i8*, i8** %12
%79 = load i8, i8* %78
%80 = sext i8 %79 to i32
%81 = icmp eq i32 %80, 10
br label %82
82: ; preds = %77, %72, %67
%83 = phi i1 [ true, %72 ], [ true, %67 ], [ %81, %77 ]
br i1 %83, label %84, label %87
84: ; preds = %82
%85 = load i8*, i8** %12
%86 = getelementptr inbounds i8, i8* %85, i32 1
store i8* %86, i8** %12
br label %67
87: ; preds = %82
store i32 0, i32* %13
br label %88
88: ; preds = %157, %87
%89 = load i8*, i8** %12
%90 = load i8, i8* %89
%91 = sext i8 %90 to i32
%92 = icmp ne i32 %91, 0
br i1 %92, label %93, label %96
93: ; preds = %88
%94 = load i32, i32* %13
%95 = icmp slt i32 %94, 128
br label %96
96: ; preds = %93, %88
%97 = phi i1 [ false, %88 ], [ %95, %93 ]
br i1 %97, label %98, label %160
98: ; preds = %96
%99 = load i32*, i32** %6
%100 = load i8*, i8** %12
%101 = load i8, i8* %100
%102 = sext i8 %101 to i64
%103 = getelementptr inbounds i32, i32* %99, i64 %102
%104 = load i32, i32* %103
%105 = load i32, i32* %13
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %106
store i32 %104, i32* %107
%108 = load i32, i32* %13
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = icmp slt i32 %111, -2
br i1 %112, label %113, label %121
113: ; preds = %98
%114 = load i32, i32* @stderr
%115 = load i8*, i8** %12
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %117)
%119 = load i32*, i32** %10
%120 = call i32 @fclose(i32* %119)
store i32 0, i32* %4
br label %373
121: ; preds = %98
%122 = load i32, i32* %13
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %123
%125 = load i32, i32* %124
%126 = load i32, i32* %16
%127 = icmp sgt i32 %125, %126
br i1 %127, label %128, label %133
128: ; preds = %121
%129 = load i32, i32* %13
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %130
%132 = load i32, i32* %131
store i32 %132, i32* %16
br label %133
133: ; preds = %128, %121
%134 = load i8*, i8** %12
%135 = getelementptr inbounds i8, i8* %134, i32 1
store i8* %135, i8** %12
br label %136
136: ; preds = %153, %133
%137 = load i8*, i8** %12
%138 = load i8, i8* %137
%139 = sext i8 %138 to i32
%140 = icmp eq i32 %139, 32
br i1 %140, label %151, label %141
141: ; preds = %136
%142 = load i8*, i8** %12
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = icmp eq i32 %144, 9
br i1 %145, label %151, label %146
146: ; preds = %141
%147 = load i8*, i8** %12
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = icmp eq i32 %149, 10
br label %151
151: ; preds = %146, %141, %136
%152 = phi i1 [ true, %141 ], [ true, %136 ], [ %150, %146 ]
br i1 %152, label %153, label %156
153: ; preds = %151
%154 = load i8*, i8** %12
%155 = getelementptr inbounds i8, i8* %154, i32 1
store i8* %155, i8** %12
br label %136
156: ; preds = %151
br label %157
157: ; preds = %156
%158 = load i32, i32* %13
%159 = add nsw i32 %158, 1
store i32 %159, i32* %13
br label %88
160: ; preds = %96
%161 = load i32, i32* %13
store i32 %161, i32* %15
%162 = load i32, i32* %16
%163 = add nsw i32 %162, 1
store i32 %163, i32* %16
%164 = load i32, i32* %16
%165 = sext i32 %164 to i64
%166 = mul i64 %165, 8
%167 = trunc i64 %166 to i32
%168 = call i64 @messalloc(i32 %167)
%169 = inttoptr i64 %168 to i32**
%170 = load i32***, i32**** %7
store i32** %169, i32*** %170
store i32 0, i32* %13
br label %171
171: ; preds = %187, %160
%172 = load i32, i32* %13
%173 = load i32, i32* %16
%174 = icmp slt i32 %172, %173
br i1 %174, label %175, label %190
175: ; preds = %171
%176 = load i32, i32* %16
%177 = sext i32 %176 to i64
%178 = mul i64 %177, 4
%179 = trunc i64 %178 to i32
%180 = call i64 @messalloc(i32 %179)
%181 = inttoptr i64 %180 to i32*
%182 = load i32***, i32**** %7
%183 = load i32**, i32*** %182
%184 = load i32, i32* %13
%185 = sext i32 %184 to i64
%186 = getelementptr inbounds i32*, i32** %183, i64 %185
store i32* %181, i32** %186
br label %187
187: ; preds = %175
%188 = load i32, i32* %13
%189 = add nsw i32 %188, 1
store i32 %189, i32* %13
br label %171
190: ; preds = %171
store i32 0, i32* %13
br label %191
191: ; preds = %367, %190
%192 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%193 = load i32*, i32** %10
%194 = call i64 @fgets(i8* %192, i32 1023, i32* %193)
%195 = icmp ne i64 %194, 0
br i1 %195, label %196, label %200
196: ; preds = %191
%197 = load i32, i32* %13
%198 = load i32, i32* %15
%199 = icmp slt i32 %197, %198
br label %200
200: ; preds = %196, %191
%201 = phi i1 [ false, %191 ], [ %199, %196 ]
br i1 %201, label %202, label %370
202: ; preds = %200
%203 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
store i8* %203, i8** %12
br label %204
204: ; preds = %221, %202
%205 = load i8*, i8** %12
%206 = load i8, i8* %205
%207 = sext i8 %206 to i32
%208 = icmp eq i32 %207, 32
br i1 %208, label %219, label %209
209: ; preds = %204
%210 = load i8*, i8** %12
%211 = load i8, i8* %210
%212 = sext i8 %211 to i32
%213 = icmp eq i32 %212, 9
br i1 %213, label %219, label %214
214: ; preds = %209
%215 = load i8*, i8** %12
%216 = load i8, i8* %215
%217 = sext i8 %216 to i32
%218 = icmp eq i32 %217, 10
br label %219
219: ; preds = %214, %209, %204
%220 = phi i1 [ true, %209 ], [ true, %204 ], [ %218, %214 ]
br i1 %220, label %221, label %224
221: ; preds = %219
%222 = load i8*, i8** %12
%223 = getelementptr inbounds i8, i8* %222, i32 1
store i8* %223, i8** %12
br label %204
224: ; preds = %219
%225 = load i8*, i8** %12
%226 = icmp ne i8* %225, null
br i1 %226, label %227, label %263
227: ; preds = %224
%228 = load i32*, i32** %6
%229 = load i8*, i8** %12
%230 = load i8, i8* %229
%231 = sext i8 %230 to i64
%232 = getelementptr inbounds i32, i32* %228, i64 %231
%233 = load i32, i32* %232
%234 = load i32, i32* %13
%235 = sext i32 %234 to i64
%236 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %235
%237 = load i32, i32* %236
%238 = icmp eq i32 %233, %237
br i1 %238, label %239, label %263
239: ; preds = %227
%240 = load i8*, i8** %12
%241 = getelementptr inbounds i8, i8* %240, i32 1
store i8* %241, i8** %12
br label %242
242: ; preds = %259, %239
%243 = load i8*, i8** %12
%244 = load i8, i8* %243
%245 = sext i8 %244 to i32
%246 = icmp eq i32 %245, 32
br i1 %246, label %257, label %247
247: ; preds = %242
%248 = load i8*, i8** %12
%249 = load i8, i8* %248
%250 = sext i8 %249 to i32
%251 = icmp eq i32 %250, 9
br i1 %251, label %257, label %252
252: ; preds = %247
%253 = load i8*, i8** %12
%254 = load i8, i8* %253
%255 = sext i8 %254 to i32
%256 = icmp eq i32 %255, 10
br label %257
257: ; preds = %252, %247, %242
%258 = phi i1 [ true, %247 ], [ true, %242 ], [ %256, %252 ]
br i1 %258, label %259, label %262
259: ; preds = %257
%260 = load i8*, i8** %12
%261 = getelementptr inbounds i8, i8* %260, i32 1
store i8* %261, i8** %12
br label %242
262: ; preds = %257
br label %263
263: ; preds = %262, %227, %224
store i32 0, i32* %14
br label %264
264: ; preds = %353, %263
%265 = load i8*, i8** %12
%266 = load i8, i8* %265
%267 = sext i8 %266 to i32
%268 = icmp ne i32 %267, 0
br i1 %268, label %269, label %272
269: ; preds = %264
%270 = load i32, i32* %14
%271 = icmp slt i32 %270, 128
br label %272
272: ; preds = %269, %264
%273 = phi i1 [ false, %264 ], [ %271, %269 ]
br i1 %273, label %274, label %356
274: ; preds = %272
%275 = load i32, i32* %13
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %276
%278 = load i32, i32* %277
%279 = icmp sge i32 %278, 0
br i1 %279, label %280, label %304
280: ; preds = %274
%281 = load i32, i32* %14
%282 = sext i32 %281 to i64
%283 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %282
%284 = load i32, i32* %283
%285 = icmp sge i32 %284, 0
br i1 %285, label %286, label %304
286: ; preds = %280
%287 = load i8*, i8** %12
%288 = call i32 @atoi(i8* %287)
%289 = load i32***, i32**** %7
%290 = load i32**, i32*** %289
%291 = load i32, i32* %13
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %292
%294 = load i32, i32* %293
%295 = sext i32 %294 to i64
%296 = getelementptr inbounds i32*, i32** %290, i64 %295
%297 = load i32*, i32** %296
%298 = load i32, i32* %14
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds [128 x i32], [128 x i32]* %17, i64 0, i64 %299
%301 = load i32, i32* %300
%302 = sext i32 %301 to i64
%303 = getelementptr inbounds i32, i32* %297, i64 %302
store i32 %288, i32* %303
br label %304
304: ; preds = %286, %280, %274
%305 = load i8*, i8** %12
%306 = load i8, i8* %305
%307 = sext i8 %306 to i32
%308 = icmp eq i32 %307, 45
br i1 %308, label %309, label %312
309: ; preds = %304
%310 = load i8*, i8** %12
%311 = getelementptr inbounds i8, i8* %310, i32 1
store i8* %311, i8** %12
br label %312
312: ; preds = %309, %304
br label %313
313: ; preds = %328, %312
%314 = load i8*, i8** %12
%315 = icmp ne i8* %314, null
br i1 %315, label %316, label %326
316: ; preds = %313
%317 = load i8*, i8** %12
%318 = load i8, i8* %317
%319 = sext i8 %318 to i32
%320 = icmp sge i32 %319, 48
br i1 %320, label %321, label %326
321: ; preds = %316
%322 = load i8*, i8** %12
%323 = load i8, i8* %322
%324 = sext i8 %323 to i32
%325 = icmp sle i32 %324, 57
br label %326
326: ; preds = %321, %316, %313
%327 = phi i1 [ false, %316 ], [ false, %313 ], [ %325, %321 ]
br i1 %327, label %328, label %331
328: ; preds = %326
%329 = load i8*, i8** %12
%330 = getelementptr inbounds i8, i8* %329, i32 1
store i8* %330, i8** %12
br label %313
331: ; preds = %326
br label %332
332: ; preds = %349, %331
%333 = load i8*, i8** %12
%334 = load i8, i8* %333
%335 = sext i8 %334 to i32
%336 = icmp eq i32 %335, 32
br i1 %336, label %347, label %337
337: ; preds = %332
%338 = load i8*, i8** %12
%339 = load i8, i8* %338
%340 = sext i8 %339 to i32
%341 = icmp eq i32 %340, 9
br i1 %341, label %347, label %342
342: ; preds = %337
%343 = load i8*, i8** %12
%344 = load i8, i8* %343
%345 = sext i8 %344 to i32
%346 = icmp eq i32 %345, 10
br label %347
347: ; preds = %342, %337, %332
%348 = phi i1 [ true, %337 ], [ true, %332 ], [ %346, %342 ]
br i1 %348, label %349, label %352
349: ; preds = %347
%350 = load i8*, i8** %12
%351 = getelementptr inbounds i8, i8* %350, i32 1
store i8* %351, i8** %12
br label %332
352: ; preds = %347
br label %353
353: ; preds = %352
%354 = load i32, i32* %14
%355 = add nsw i32 %354, 1
store i32 %355, i32* %14
br label %264
356: ; preds = %272
%357 = load i32, i32* %14
%358 = load i32, i32* %15
%359 = icmp ne i32 %357, %358
br i1 %359, label %360, label %366
360: ; preds = %356
%361 = load i32, i32* @stderr
%362 = getelementptr inbounds [1024 x i8], [1024 x i8]* %11, i64 0, i64 0
%363 = call i32 (i32, i8*, ...) @fprintf(i32 %361, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* %362)
%364 = load i32*, i32** %10
%365 = call i32 @fclose(i32* %364)
store i32 0, i32* %4
br label %373
366: ; preds = %356
br label %367
367: ; preds = %366
%368 = load i32, i32* %13
%369 = add nsw i32 %368, 1
store i32 %369, i32* %13
br label %191
370: ; preds = %200
%371 = load i32*, i32** %10
%372 = call i32 @fclose(i32* %371)
store i32 1, i32* %4
br label %373
373: ; preds = %370, %360, %113, %44
%374 = load i32, i32* %4
ret i32 %374
}

LLVM IR (-O2):
@.str = [9 x i8] c"BLASTMAT\00"
@.str.1 = [29 x i8] c"/nfs/disk100/pubseq/blastdb/\00"
@.str.2 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.3 = [46 x i8] c"ERROR in readMatrix: could not open %s or %s\0A\00"
@.str.4 = [40 x i8] c"ERROR in readMatrix: illegal symbol %c\0A\00"
@.str.5 = [35 x i8] c"ERROR in readMatrix: bad line: %s\0A\00"
define i32 @readMatrix(i8* %0, i32* nocapture %1, i32*** nocapture %2) {
%4 = alloca [256 x i8]
%5 = alloca [512 x i8]
%6 = alloca [1024 x i8]
%7 = alloca [128 x i32]
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
store i8 35, i8* %10
%11 = bitcast [128 x i32]* %7 to i8*
%12 = tail call i8* @getenv(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i8* %12, null
br i1 %13, label %16, label %14
14: ; preds = %3
%15 = call i32 @strcpy(i8* %8, i8* %12)
br label %18
16: ; preds = %3
%17 = call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
%19 = call i32 @strcpy(i8* %9, i8* %8)
%20 = call i32 @strcat(i8* %9, i8* %0)
%21 = call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %29
23: ; preds = %18
%24 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i32* %24, null
br i1 %25, label %26, label %29
26: ; preds = %23
%27 = load i32, i32* @stderr
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %8)
br label %189
29: ; preds = %23, %18
%30 = phi i32* [ %21, %18 ], [ %24, %23 ]
%31 = call i32 @feof(i32* %30)
%32 = icmp eq i32 %31, 0
%33 = load i8, i8* %10
%34 = icmp eq i8 %33, 35
%35 = select i1 %32, i1 %34, i1 false
br i1 %35, label %36, label %43
36: ; preds = %29, %36
%37 = call i64 @fgets(i8* %10, i32 1023, i32* %30)
%38 = call i32 @feof(i32* %30)
%39 = icmp eq i32 %38, 0
%40 = load i8, i8* %10
%41 = icmp eq i8 %40, 35
%42 = select i1 %39, i1 %41, i1 false
br i1 %42, label %36, label %43
43: ; preds = %36, %29
%44 = phi i8 [ %33, %29 ], [ %40, %36 ]
br label %45
45: ; preds = %43, %48
%46 = phi i8 [ %50, %48 ], [ %44, %43 ]
%47 = phi i8* [ %49, %48 ], [ %10, %43 ]
switch i8 %46, label %51 [
i8 32, label %48
i8 9, label %48
i8 10, label %48
i8 0, label %82
]
48: ; preds = %45, %45, %45
%49 = getelementptr inbounds i8, i8* %47, i64 1
%50 = load i8, i8* %49
br label %45
51: ; preds = %45, %74
%52 = phi i64 [ %76, %74 ], [ 0, %45 ]
%53 = phi i8 [ %72, %74 ], [ %46, %45 ]
%54 = phi i32 [ %75, %74 ], [ 0, %45 ]
%55 = phi i8* [ %71, %74 ], [ %47, %45 ]
%56 = sext i8 %53 to i64
%57 = getelementptr inbounds i32, i32* %1, i64 %56
%58 = load i32, i32* %57
%59 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 %52
store i32 %58, i32* %59
%60 = icmp slt i32 %58, -2
br i1 %60, label %61, label %67
61: ; preds = %51
%62 = load i32, i32* @stderr
%63 = load i8, i8* %55
%64 = sext i8 %63 to i32
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0), i32 %64)
%66 = call i32 @fclose(i32* %30)
br label %189
67: ; preds = %51
%68 = icmp sgt i32 %58, %54
br label %69
69: ; preds = %73, %67
%70 = phi i8* [ %55, %67 ], [ %71, %73 ]
%71 = getelementptr inbounds i8, i8* %70, i64 1
%72 = load i8, i8* %71
switch i8 %72, label %74 [
i8 32, label %73
i8 9, label %73
i8 10, label %73
]
73: ; preds = %69, %69, %69
br label %69
74: ; preds = %69
%75 = select i1 %68, i32 %58, i32 %54
%76 = add nuw nsw i64 %52, 1
%77 = icmp ne i8 %72, 0
%78 = icmp ult i64 %52, 127
%79 = select i1 %77, i1 %78, i1 false
br i1 %79, label %51, label %80
80: ; preds = %74
%81 = trunc i64 %76 to i32
br label %82
82: ; preds = %45, %80
%83 = phi i32 [ %81, %80 ], [ 0, %45 ]
%84 = phi i32 [ %75, %80 ], [ 0, %45 ]
%85 = add i32 %84, 1
%86 = shl i32 %85, 3
%87 = call i64 @messalloc(i32 %86)
%88 = inttoptr i64 %87 to i32**
store i32** %88, i32*** %2
%89 = icmp slt i32 %84, 0
br i1 %89, label %93, label %90
90: ; preds = %82
%91 = shl i32 %85, 2
%92 = zext i32 %85 to i64
br label %100
93: ; preds = %100, %82
%94 = call i64 @fgets(i8* %10, i32 1023, i32* %30)
%95 = icmp ne i64 %94, 0
%96 = icmp ne i32 %83, 0
%97 = select i1 %95, i1 %96, i1 false
br i1 %97, label %98, label %187
98: ; preds = %93
%99 = zext i32 %83 to i64
br label %113
100: ; preds = %90, %100
%101 = phi i64 [ 0, %90 ], [ %106, %100 ]
%102 = call i64 @messalloc(i32 %91)
%103 = inttoptr i64 %102 to i32*
%104 = load i32**, i32*** %2
%105 = getelementptr inbounds i32*, i32** %104, i64 %101
store i32* %103, i32** %105
%106 = add nuw nsw i64 %101, 1
%107 = icmp eq i64 %106, %92
br i1 %107, label %93, label %100
108: ; preds = %179
%109 = call i64 @fgets(i8* %10, i32 1023, i32* %30)
%110 = icmp ne i64 %109, 0
%111 = icmp ult i64 %182, %99
%112 = select i1 %110, i1 %111, i1 false
br i1 %112, label %113, label %187
113: ; preds = %98, %108
%114 = phi i64 [ 0, %98 ], [ %182, %108 ]
br label %115
115: ; preds = %113, %118
%116 = phi i8* [ %119, %118 ], [ %10, %113 ]
%117 = load i8, i8* %116
switch i8 %117, label %120 [
i8 32, label %118
i8 9, label %118
i8 10, label %118
]
118: ; preds = %115, %115, %115
%119 = getelementptr inbounds i8, i8* %116, i64 1
br label %115
120: ; preds = %115
%121 = sext i8 %117 to i64
%122 = getelementptr inbounds i32, i32* %1, i64 %121
%123 = load i32, i32* %122
%124 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 %114
%125 = load i32, i32* %124
%126 = icmp eq i32 %123, %125
br i1 %126, label %127, label %132
127: ; preds = %120, %131
%128 = phi i8* [ %129, %131 ], [ %116, %120 ]
%129 = getelementptr inbounds i8, i8* %128, i64 1
%130 = load i8, i8* %129
switch i8 %130, label %132 [
i8 32, label %131
i8 9, label %131
i8 10, label %131
]
131: ; preds = %127, %127, %127
br label %127
132: ; preds = %127, %120
%133 = phi i8 [ %117, %120 ], [ %130, %127 ]
%134 = phi i8* [ %116, %120 ], [ %129, %127 ]
%135 = icmp eq i8 %133, 0
br i1 %135, label %179, label %136
136: ; preds = %132
%137 = icmp sgt i32 %125, -1
%138 = zext i32 %125 to i64
br label %139
139: ; preds = %136, %172
%140 = phi i8 [ %133, %136 ], [ %167, %172 ]
%141 = phi i64 [ 0, %136 ], [ %173, %172 ]
%142 = phi i8* [ %134, %136 ], [ %168, %172 ]
br i1 %137, label %143, label %155
143: ; preds = %139
%144 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 %141
%145 = load i32, i32* %144
%146 = icmp sgt i32 %145, -1
br i1 %146, label %147, label %155
147: ; preds = %143
%148 = call i32 @atoi(i8* %142)
%149 = load i32**, i32*** %2
%150 = getelementptr inbounds i32*, i32** %149, i64 %138
%151 = load i32*, i32** %150
%152 = zext i32 %145 to i64
%153 = getelementptr inbounds i32, i32* %151, i64 %152
store i32 %148, i32* %153
%154 = load i8, i8* %142
br label %155
155: ; preds = %147, %143, %139
%156 = phi i8 [ %154, %147 ], [ %140, %143 ], [ %140, %139 ]
%157 = icmp eq i8 %156, 45
%158 = zext i1 %157 to i64
%159 = getelementptr i8, i8* %142, i64 %158
br label %160
160: ; preds = %160, %155
%161 = phi i8* [ %159, %155 ], [ %165, %160 ]
%162 = load i8, i8* %161
%163 = add i8 %162, -48
%164 = icmp ult i8 %163, 10
%165 = getelementptr inbounds i8, i8* %161, i64 1
br i1 %164, label %160, label %166
166: ; preds = %160, %169
%167 = phi i8 [ %171, %169 ], [ %162, %160 ]
%168 = phi i8* [ %170, %169 ], [ %161, %160 ]
switch i8 %167, label %172 [
i8 32, label %169
i8 9, label %169
i8 10, label %169
]
169: ; preds = %166, %166, %166
%170 = getelementptr inbounds i8, i8* %168, i64 1
%171 = load i8, i8* %170
br label %166
172: ; preds = %166
%173 = add nuw nsw i64 %141, 1
%174 = icmp ne i8 %167, 0
%175 = icmp ult i64 %141, 127
%176 = select i1 %174, i1 %175, i1 false
br i1 %176, label %139, label %177
177: ; preds = %172
%178 = trunc i64 %173 to i32
br label %179
179: ; preds = %177, %132
%180 = phi i32 [ 0, %132 ], [ %178, %177 ]
%181 = icmp eq i32 %180, %83
%182 = add nuw nsw i64 %114, 1
br i1 %181, label %108, label %183
183: ; preds = %179
%184 = load i32, i32* @stderr
%185 = call i32 (i32, i8*, ...) @fprintf(i32 %184, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0), i8* %10)
%186 = call i32 @fclose(i32* %30)
br label %189
187: ; preds = %108, %93
%188 = call i32 @fclose(i32* %30)
br label %189
189: ; preds = %187, %183, %61, %26
%190 = phi i32 [ 0, %61 ], [ 0, %183 ], [ 1, %187 ], [ 0, %26 ]
ret i32 %190
}