#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 /*<<< orphan*/ add_sequence(char *, char *, char ***, char ***, int);
int asprintf(char **, char *, int, int);
int /*<<< orphan*/ endmarker_msa_record(char ***, char ***, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ free_msa_record(char ***, char ***, char **, char **);
char *get_line(int /*<<< orphan*/ *);
int sscanf(char *, char *, char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
scalar_t__ strstr(char *, char *);
scalar_t__ vrna_alloc(int);
int /*<<< orphan*/ vrna_message_info(int /*<<< orphan*/, char *);
int /*<<< orphan*/ vrna_message_warning(char *);
scalar_t__ vrna_realloc(char *, int);
int parse_stockholm_alignment(FILE *fp, char ***names, char ***aln, char **id,
                              char **structure, int verbosity) {
  char *line = NULL;
  int i, n, seq_num, seq_length, has_record;
  seq_num = 0;
  seq_length = 0;
  if (!fp) {
    if (verbosity >= 0)
      vrna_message_warning("Can't read from filepointer while parsing "
                           "Stockholm formatted sequence alignment!");
    return -1;
  }
  if (names && aln) {
    *names = NULL;
    *aln = NULL;
  } else {
    return -1;
  }
  if (id)
    *id = NULL;
  if (structure)
    *structure = NULL;
  int inrecord = 0;
  while ((line = get_line(fp))) {
    if (strstr(line, "STOCKHOLM 1.0")) {
      inrecord = 1;
      has_record = 1;
      free(line);
      break;
    }
    free(line);
  }
  if (inrecord) {
    while ((line = get_line(fp))) {
      if (strncmp(line, "//", 2) == 0) {
        free(line);
        line = NULL;
        break;
      }
      n = (int)strlen(line);
      switch (*line) {
      case ' ':
      case '\0':
        goto stockholm_next_line;
      case '#':
        if (strstr(line, "STOCKHOLM 1.0")) {
          if (verbosity >= 0)
            vrna_message_warning("Malformatted Stockholm record, missing // ?");
          free_msa_record(names, aln, id, structure);
          seq_num = 0;
        } else if (strncmp(line, "#=GF", 4) == 0) {
          if ((id != NULL) && (strncmp(line, "#=GF ID", 7) == 0)) {
            *id = (char *)vrna_alloc(sizeof(char) * n);
            if (sscanf(line, "#=GF ID %s", *id) == 1) {
              *id = (char *)vrna_realloc(*id, sizeof(char) * (strlen(*id) + 1));
            } else {
              free(*id);
              *id = NULL;
            }
          }
        } else if (strncmp(line, "#=GC", 4) == 0) {
          if ((structure != NULL) && (strncmp(line, "#=GC SS_cons", 12) == 0)) {
            char *ss = (char *)vrna_alloc(sizeof(char) * n);
            if (sscanf(line, "#=GC SS_cons %s", ss) == 1) {
              *structure = (char *)vrna_realloc(
                  *structure, sizeof(char) * (strlen(ss) + 1));
              strcpy(*structure, ss);
            }
            free(ss);
          }
        } else if (strncmp(line, "#=GS", 4) == 0) {
        } else if (strncmp(line, "#=GR", 4) == 0) {
        } else {
        }
        break;
      default: {
        int tmp_l;
        char *tmp_name = (char *)vrna_alloc(sizeof(char) * (n + 1));
        char *tmp_seq = (char *)vrna_alloc(sizeof(char) * (n + 1));
        if (sscanf(line, "%s %s", tmp_name, tmp_seq) == 2) {
          seq_num++;
          tmp_l = (int)strlen(tmp_seq);
          if (seq_num == 1) {
            seq_length = tmp_l;
          } else {
            if (seq_length != tmp_l) {
              if (verbosity >= 0)
                vrna_message_warning("Discarding Stockholm record! Sequence "
                                     "lengths do not match.");
              free_msa_record(names, aln, id, structure);
              seq_num = 0;
              free(tmp_name);
              free(tmp_seq);
              free(line);
              line = NULL;
              goto stockholm_exit;
            }
          }
          add_sequence(tmp_name, tmp_seq, names, aln, seq_num);
        }
        free(tmp_name);
        free(tmp_seq);
      } break;
      }
    stockholm_next_line:
      free(line);
    }
  } else {
    if (verbosity > 0)
      vrna_message_warning("Did not find any Stockholm 1.0 formatted record!");
    return -1;
  }
stockholm_exit:
  free(line);
  endmarker_msa_record(names, aln, seq_num);
  if ((seq_num > 0) && (verbosity >= 0)) {
    int r;
    char *msg = NULL;
    r = asprintf(&msg, "%d sequences; length of alignment %d.", seq_num,
                 (int)strlen((*aln)[0]));
    if (r != -1)
      vrna_message_info(stderr, msg);
    free(msg);
  }
  return seq_num;
}


x86 assembly (clang, -O0):
<parse_stockholm_alignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1256 <parse_stockholm_alignment+0x66>
cmpl   $0x0,-0x34(%rbp)
jl     124a <parse_stockholm_alignment+0x5a>
lea    0xdbb(%rip),%rdi
call   10b0 <vrna_message_warning@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    182b <parse_stockholm_alignment+0x63b>
cmpq   $0x0,-0x18(%rbp)
je     1287 <parse_stockholm_alignment+0x97>
cmpq   $0x0,-0x20(%rbp)
je     1287 <parse_stockholm_alignment+0x97>
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
jmp    1293 <parse_stockholm_alignment+0xa3>
movl   $0xffffffff,-0x4(%rbp)
jmp    182b <parse_stockholm_alignment+0x63b>
cmpq   $0x0,-0x28(%rbp)
je     12a9 <parse_stockholm_alignment+0xb9>
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x30(%rbp)
je     12bf <parse_stockholm_alignment+0xcf>
mov    -0x30(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x0,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <get_line@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     1321 <parse_stockholm_alignment+0x131>
mov    -0x40(%rbp),%rdi
lea    0xd6a(%rip),%rsi
call   1100 <strstr@plt>
cmp    $0x0,%rax
je     1313 <parse_stockholm_alignment+0x123>
movl   $0x1,-0x58(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    1321 <parse_stockholm_alignment+0x131>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    12c6 <parse_stockholm_alignment+0xd6>
cmpl   $0x0,-0x58(%rbp)
je     1765 <parse_stockholm_alignment+0x575>
jmp    1330 <parse_stockholm_alignment+0x140>
mov    -0x10(%rbp),%rdi
call   1060 <get_line@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     1760 <parse_stockholm_alignment+0x570>
mov    -0x40(%rbp),%rdi
lea    0xd0e(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    137c <parse_stockholm_alignment+0x18c>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x40(%rbp)
jmp    1760 <parse_stockholm_alignment+0x570>
mov    -0x40(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x8c(%rbp)
test   %eax,%eax
je     13ca <parse_stockholm_alignment+0x1da>
jmp    13a2 <parse_stockholm_alignment+0x1b2>
mov    -0x8c(%rbp),%eax
sub    $0x20,%eax
je     13ca <parse_stockholm_alignment+0x1da>
jmp    13b6 <parse_stockholm_alignment+0x1c6>
mov    -0x8c(%rbp),%eax
sub    $0x23,%eax
je     13cf <parse_stockholm_alignment+0x1df>
jmp    163c <parse_stockholm_alignment+0x44c>
jmp    1752 <parse_stockholm_alignment+0x562>
mov    -0x40(%rbp),%rdi
lea    0xc78(%rip),%rsi
call   1100 <strstr@plt>
cmp    $0x0,%rax
je     1420 <parse_stockholm_alignment+0x230>
cmpl   $0x0,-0x34(%rbp)
jl     13ff <parse_stockholm_alignment+0x20f>
lea    0xc69(%rip),%rdi
call   10b0 <vrna_message_warning@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1080 <free_msa_record@plt>
movl   $0x0,-0x4c(%rbp)
jmp    1637 <parse_stockholm_alignment+0x447>
mov    -0x40(%rbp),%rdi
lea    0xc64(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1505 <parse_stockholm_alignment+0x315>
cmpq   $0x0,-0x28(%rbp)
je     1500 <parse_stockholm_alignment+0x310>
mov    -0x40(%rbp),%rdi
lea    0xc3f(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1500 <parse_stockholm_alignment+0x310>
movslq -0x48(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
lea    0xc08(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jne    14e4 <parse_stockholm_alignment+0x2f4>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x98(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1070 <strlen@plt>
mov    -0x98(%rbp),%rdi
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   10c0 <vrna_realloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    14fb <parse_stockholm_alignment+0x30b>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
jmp    1500 <parse_stockholm_alignment+0x310>
jmp    1632 <parse_stockholm_alignment+0x442>
mov    -0x40(%rbp),%rdi
lea    0xb97(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15d6 <parse_stockholm_alignment+0x3e6>
cmpq   $0x0,-0x30(%rbp)
je     15d1 <parse_stockholm_alignment+0x3e1>
mov    -0x40(%rbp),%rdi
lea    0xb72(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15d1 <parse_stockholm_alignment+0x3e1>
movslq -0x48(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x60(%rbp),%rdx
lea    0xb49(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jne    15c8 <parse_stockholm_alignment+0x3d8>
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x60(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xa0(%rbp),%rdi
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%esi
call   10c0 <vrna_realloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    (%rax),%rdi
mov    -0x60(%rbp),%rsi
call   1050 <strcpy@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
jmp    162d <parse_stockholm_alignment+0x43d>
mov    -0x40(%rbp),%rdi
lea    0xae8(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15fa <parse_stockholm_alignment+0x40a>
jmp    1628 <parse_stockholm_alignment+0x438>
mov    -0x40(%rbp),%rdi
lea    0xac9(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    161e <parse_stockholm_alignment+0x42e>
jmp    1623 <parse_stockholm_alignment+0x433>
jmp    1623 <parse_stockholm_alignment+0x433>
jmp    1628 <parse_stockholm_alignment+0x438>
jmp    162d <parse_stockholm_alignment+0x43d>
jmp    1632 <parse_stockholm_alignment+0x442>
jmp    1637 <parse_stockholm_alignment+0x447>
jmp    174d <parse_stockholm_alignment+0x55d>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,-0x78(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x70(%rbp),%rdx
mov    -0x78(%rbp),%rcx
lea    0xa56(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
cmp    $0x2,%eax
jne    173b <parse_stockholm_alignment+0x54b>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x78(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x1,-0x4c(%rbp)
jne    16b7 <parse_stockholm_alignment+0x4c7>
mov    -0x64(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    1722 <parse_stockholm_alignment+0x532>
mov    -0x50(%rbp),%eax
cmp    -0x64(%rbp),%eax
je     171d <parse_stockholm_alignment+0x52d>
cmpl   $0x0,-0x34(%rbp)
jl     16d9 <parse_stockholm_alignment+0x4e9>
lea    0xa05(%rip),%rdi
call   10b0 <vrna_message_warning@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1080 <free_msa_record@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x40(%rbp)
jmp    178c <parse_stockholm_alignment+0x59c>
jmp    1722 <parse_stockholm_alignment+0x532>
mov    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x4c(%rbp),%r8d
call   1110 <add_sequence@plt>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x78(%rbp),%rdi
call   1030 <free@plt>
jmp    1752 <parse_stockholm_alignment+0x562>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    1330 <parse_stockholm_alignment+0x140>
jmp    1787 <parse_stockholm_alignment+0x597>
cmpl   $0x0,-0x34(%rbp)
jle    177b <parse_stockholm_alignment+0x58b>
lea    0x99f(%rip),%rdi
call   10b0 <vrna_message_warning@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    182b <parse_stockholm_alignment+0x63b>
jmp    178c <parse_stockholm_alignment+0x59c>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x4c(%rbp),%edx
call   1090 <endmarker_msa_record@plt>
cmpl   $0x0,-0x4c(%rbp)
jle    1825 <parse_stockholm_alignment+0x635>
cmpl   $0x0,-0x34(%rbp)
jl     1825 <parse_stockholm_alignment+0x635>
movq   $0x0,-0x88(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1070 <strlen@plt>
mov    -0xa4(%rbp),%edx
mov    %eax,%ecx
lea    -0x88(%rbp),%rdi
lea    0x954(%rip),%rsi
call   10d0 <asprintf@plt>
mov    %eax,-0x7c(%rbp)
cmpl   $0xffffffff,-0x7c(%rbp)
je     1819 <parse_stockholm_alignment+0x629>
mov    0x27d5(%rip),%rax
mov    (%rax),%edi
mov    -0x88(%rbp),%rsi
call   10f0 <vrna_message_info@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_stockholm_alignment>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    $0xffffffff,%r14d
test   %rdi,%rdi
je     12bb <parse_stockholm_alignment+0xcb>
test   %rsi,%rsi
je     12cc <parse_stockholm_alignment+0xdc>
test   %rdx,%rdx
je     12cc <parse_stockholm_alignment+0xdc>
mov    %rdi,%r15
movq   $0x0,(%rsi)
movq   $0x0,(%rdx)
test   %rcx,%rcx
je     123c <parse_stockholm_alignment+0x4c>
movq   $0x0,(%rcx)
mov    %rcx,0x18(%rsp)
mov    %rsi,0x20(%rsp)
mov    %r9d,0x8(%rsp)
mov    %rdx,0x28(%rsp)
test   %r8,%r8
je     125c <parse_stockholm_alignment+0x6c>
movq   $0x0,(%r8)
mov    %r8,0x10(%rsp)
mov    %r15,%rdi
call   1060 <get_line@plt>
test   %rax,%rax
je     12ab <parse_stockholm_alignment+0xbb>
mov    %rax,%r12
lea    0xdda(%rip),%rbp
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %rbp,%rsi
call   1100 <strstr@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1060 <get_line@plt>
mov    %rax,%r12
test   %rbx,%rbx
jne    12de <parse_stockholm_alignment+0xee>
test   %r12,%r12
jne    1280 <parse_stockholm_alignment+0x90>
cmpl   $0x0,0x8(%rsp)
jle    12cc <parse_stockholm_alignment+0xdc>
lea    0xe5c(%rip),%rdi
jmp    12c7 <parse_stockholm_alignment+0xd7>
test   %r9d,%r9d
js     12cc <parse_stockholm_alignment+0xdc>
lea    0xd39(%rip),%rdi
call   10b0 <vrna_message_warning@plt>
mov    %r14d,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r12,%r12
je     15c6 <parse_stockholm_alignment+0x3d6>
lea    0xd72(%rip),%rbx
xor    %r14d,%r14d
movl   $0x0,0xc(%rsp)
jmp    133c <parse_stockholm_alignment+0x14c>
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rcx
call   1080 <free_msa_record@plt>
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    %r12,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1060 <get_line@plt>
mov    %rax,%r12
test   %rax,%rax
je     1612 <parse_stockholm_alignment+0x422>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     160a <parse_stockholm_alignment+0x41a>
mov    %r12,%rdi
call   1070 <strlen@plt>
mov    %eax,%r13d
movsbl (%r12),%eax
test   %eax,%eax
je     1320 <parse_stockholm_alignment+0x130>
cmp    $0x20,%eax
je     1320 <parse_stockholm_alignment+0x130>
cmp    $0x23,%eax
jne    13b0 <parse_stockholm_alignment+0x1c0>
mov    %r12,%rdi
lea    0xcd5(%rip),%rsi
call   1100 <strstr@plt>
test   %rax,%rax
je     1402 <parse_stockholm_alignment+0x212>
cmpl   $0x0,0x8(%rsp)
js     12fb <parse_stockholm_alignment+0x10b>
lea    0xcca(%rip),%rdi
call   10b0 <vrna_message_warning@plt>
jmp    12fb <parse_stockholm_alignment+0x10b>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13d
mov    %r13d,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,%rbx
mov    %r13d,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,%rbp
mov    %r12,%rdi
lea    0xcff(%rip),%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x2,%eax
jne    1495 <parse_stockholm_alignment+0x2a5>
mov    %rbp,%rdi
call   1070 <strlen@plt>
test   %r14d,%r14d
je     1472 <parse_stockholm_alignment+0x282>
cmp    %eax,0xc(%rsp)
je     1476 <parse_stockholm_alignment+0x286>
jmp    15cb <parse_stockholm_alignment+0x3db>
mov    %r12,%rdi
lea    0xc83(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     14b1 <parse_stockholm_alignment+0x2c1>
mov    %r12,%rdi
lea    0xc7e(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1522 <parse_stockholm_alignment+0x332>
mov    %r12,%rdi
lea    0xc83(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1320 <parse_stockholm_alignment+0x130>
mov    %r12,%rdi
lea    0xc6b(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
jmp    1320 <parse_stockholm_alignment+0x130>
mov    %eax,0xc(%rsp)
mov    %r14d,%r8d
add    $0x1,%r8d
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    0x20(%rsp),%rdx
mov    0x28(%rsp),%rcx
mov    %r8d,%r14d
call   1110 <add_sequence@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
lea    0xbb4(%rip),%rbx
jmp    1320 <parse_stockholm_alignment+0x130>
cmpq   $0x0,0x18(%rsp)
je     1320 <parse_stockholm_alignment+0x130>
mov    %r12,%rdi
lea    0xbcd(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1320 <parse_stockholm_alignment+0x130>
mov    %r13d,%edi
call   10e0 <vrna_alloc@plt>
mov    0x18(%rsp),%rbx
mov    %rax,(%rbx)
mov    %r12,%rdi
lea    0xba8(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
mov    (%rbx),%rbp
cmp    $0x1,%eax
jne    15b2 <parse_stockholm_alignment+0x3c2>
mov    %rbp,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%esi
mov    %rbp,%rdi
call   10c0 <vrna_realloc@plt>
mov    %rax,(%rbx)
jmp    14a5 <parse_stockholm_alignment+0x2b5>
cmpq   $0x0,0x10(%rsp)
je     1320 <parse_stockholm_alignment+0x130>
mov    %r12,%rdi
lea    0xb74(%rip),%rsi
mov    $0xc,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
jne    1320 <parse_stockholm_alignment+0x130>
mov    %r13d,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,%rbp
mov    %r12,%rdi
lea    0xb59(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jne    15a5 <parse_stockholm_alignment+0x3b5>
mov    %r14d,%r13d
mov    0x10(%rsp),%rbx
mov    (%rbx),%r14
mov    %rbp,%rdi
call   1070 <strlen@plt>
lea    0x1(%rax),%esi
mov    %r14,%rdi
mov    %r13d,%r14d
call   10c0 <vrna_realloc@plt>
mov    %rax,(%rbx)
lea    0xac6(%rip),%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1050 <strcpy@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
jmp    1320 <parse_stockholm_alignment+0x130>
mov    %rbp,%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
jmp    14a5 <parse_stockholm_alignment+0x2b5>
xor    %r14d,%r14d
jmp    1612 <parse_stockholm_alignment+0x422>
cmpl   $0x0,0x8(%rsp)
js     15de <parse_stockholm_alignment+0x3ee>
lea    0xb00(%rip),%rdi
call   10b0 <vrna_message_warning@plt>
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    0x10(%rsp),%rcx
call   1080 <free_msa_record@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %r14d,%r14d
mov    %r12,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1030 <free@plt>
mov    0x20(%rsp),%rdi
mov    0x28(%rsp),%rbx
mov    %rbx,%rsi
mov    %r14d,%edx
call   1090 <endmarker_msa_record@plt>
cmpl   $0x0,0x8(%rsp)
js     12cc <parse_stockholm_alignment+0xdc>
test   %r14d,%r14d
jle    12cc <parse_stockholm_alignment+0xdc>
movq   $0x0,0x30(%rsp)
mov    (%rbx),%rax
mov    (%rax),%rdi
call   1070 <strlen@plt>
lea    0xae9(%rip),%rsi
lea    0x30(%rsp),%rdi
mov    %r14d,%edx
mov    %eax,%ecx
call   10d0 <asprintf@plt>
cmp    $0xffffffff,%eax
je     1684 <parse_stockholm_alignment+0x494>
mov    0x2968(%rip),%rax
mov    (%rax),%edi
mov    0x30(%rsp),%rsi
call   10f0 <vrna_message_info@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
jmp    12cc <parse_stockholm_alignment+0xdc>

LLVM IR (-O0):
@.str = [82 x i8] c"Can't read from filepointer while parsing Stockholm formatted sequence alignment!\00"
@.str.1 = [14 x i8] c"STOCKHOLM 1.0\00"
@.str.2 = [3 x i8] c"//\00"
@.str.3 = [44 x i8] c"Malformatted Stockholm record, missing // ?\00"
@.str.4 = [5 x i8] c"#=GF\00"
@.str.5 = [8 x i8] c"#=GF ID\00"
@.str.6 = [11 x i8] c"#=GF ID %s\00"
@.str.7 = [5 x i8] c"#=GC\00"
@.str.8 = [13 x i8] c"#=GC SS_cons\00"
@.str.9 = [16 x i8] c"#=GC SS_cons %s\00"
@.str.10 = [5 x i8] c"#=GS\00"
@.str.11 = [5 x i8] c"#=GR\00"
@.str.12 = [6 x i8] c"%s %s\00"
@.str.13 = [60 x i8] c"Discarding Stockholm record! Sequence lengths do not match.\00"
@.str.14 = [49 x i8] c"Did not find any Stockholm 1.0 formatted record!\00"
@.str.15 = [38 x i8] c"%d sequences; length of alignment %d.\00"
@stderr = global i32 0
define i32 @parse_stockholm_alignment(i32* %0, i8*** %1, i8*** %2, i8** %3, i8** %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i8***
%10 = alloca i8***
%11 = alloca i8**
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i8*
%22 = alloca i32
%23 = alloca i8*
%24 = alloca i8*
%25 = alloca i32
%26 = alloca i8*
store i32* %0, i32** %8
store i8*** %1, i8**** %9
store i8*** %2, i8**** %10
store i8** %3, i8*** %11
store i8** %4, i8*** %12
store i32 %5, i32* %13
store i8* null, i8** %14
store i32 0, i32* %17
store i32 0, i32* %18
%27 = load i32*, i32** %8
%28 = icmp ne i32* %27, null
br i1 %28, label %35, label %29
29: ; preds = %6
%30 = load i32, i32* %13
%31 = icmp sge i32 %30, 0
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
store i32 -1, i32* %7
br label %315
35: ; preds = %6
%36 = load i8***, i8**** %9
%37 = icmp ne i8*** %36, null
br i1 %37, label %38, label %44
38: ; preds = %35
%39 = load i8***, i8**** %10
%40 = icmp ne i8*** %39, null
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i8***, i8**** %9
store i8** null, i8*** %42
%43 = load i8***, i8**** %10
store i8** null, i8*** %43
br label %45
44: ; preds = %38, %35
store i32 -1, i32* %7
br label %315
45: ; preds = %41
%46 = load i8**, i8*** %11
%47 = icmp ne i8** %46, null
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = load i8**, i8*** %11
store i8* null, i8** %49
br label %50
50: ; preds = %48, %45
%51 = load i8**, i8*** %12
%52 = icmp ne i8** %51, null
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = load i8**, i8*** %12
store i8* null, i8** %54
br label %55
55: ; preds = %53, %50
store i32 0, i32* %20
br label %56
56: ; preds = %67, %55
%57 = load i32*, i32** %8
%58 = call i8* @get_line(i32* %57)
store i8* %58, i8** %14
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %70
60: ; preds = %56
%61 = load i8*, i8** %14
%62 = call i64 @strstr(i8* %61, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %60
store i32 1, i32* %20
store i32 1, i32* %19
%65 = load i8*, i8** %14
%66 = call i32 @free(i8* %65)
br label %70
67: ; preds = %60
%68 = load i8*, i8** %14
%69 = call i32 @free(i8* %68)
br label %56
70: ; preds = %64, %56
%71 = load i32, i32* %20
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %277
73: ; preds = %70
br label %74
74: ; preds = %273, %73
%75 = load i32*, i32** %8
%76 = call i8* @get_line(i32* %75)
store i8* %76, i8** %14
%77 = icmp ne i8* %76, null
br i1 %77, label %78, label %276
78: ; preds = %74
%79 = load i8*, i8** %14
%80 = call i64 @strncmp(i8* %79, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %85
82: ; preds = %78
%83 = load i8*, i8** %14
%84 = call i32 @free(i8* %83)
store i8* null, i8** %14
br label %276
85: ; preds = %78
%86 = load i8*, i8** %14
%87 = call i32 @strlen(i8* %86)
store i32 %87, i32* %16
%88 = load i8*, i8** %14
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
switch i32 %90, label %209 [
i32 32, label %91
i32 0, label %91
i32 35, label %92
]
91: ; preds = %85, %85
br label %273
92: ; preds = %85
%93 = load i8*, i8** %14
%94 = call i64 @strstr(i8* %93, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%95 = icmp ne i64 %94, 0
br i1 %95, label %96, label %107
96: ; preds = %92
%97 = load i32, i32* %13
%98 = icmp sge i32 %97, 0
br i1 %98, label %99, label %101
99: ; preds = %96
%100 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %101
101: ; preds = %99, %96
%102 = load i8***, i8**** %9
%103 = load i8***, i8**** %10
%104 = load i8**, i8*** %11
%105 = load i8**, i8*** %12
%106 = call i32 @free_msa_record(i8*** %102, i8*** %103, i8** %104, i8** %105)
store i32 0, i32* %17
br label %208
107: ; preds = %92
%108 = load i8*, i8** %14
%109 = call i64 @strncmp(i8* %108, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%110 = icmp eq i64 %109, 0
br i1 %110, label %111, label %151
111: ; preds = %107
%112 = load i8**, i8*** %11
%113 = icmp ne i8** %112, null
br i1 %113, label %114, label %150
114: ; preds = %111
%115 = load i8*, i8** %14
%116 = call i64 @strncmp(i8* %115, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %150
118: ; preds = %114
%119 = load i32, i32* %16
%120 = sext i32 %119 to i64
%121 = mul i64 1, %120
%122 = trunc i64 %121 to i32
%123 = call i64 @vrna_alloc(i32 %122)
%124 = inttoptr i64 %123 to i8*
%125 = load i8**, i8*** %11
store i8* %124, i8** %125
%126 = load i8*, i8** %14
%127 = load i8**, i8*** %11
%128 = load i8*, i8** %127
%129 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %126, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %128)
%130 = icmp eq i32 %129, 1
br i1 %130, label %131, label %144
131: ; preds = %118
%132 = load i8**, i8*** %11
%133 = load i8*, i8** %132
%134 = load i8**, i8*** %11
%135 = load i8*, i8** %134
%136 = call i32 @strlen(i8* %135)
%137 = add nsw i32 %136, 1
%138 = sext i32 %137 to i64
%139 = mul i64 1, %138
%140 = trunc i64 %139 to i32
%141 = call i64 @vrna_realloc(i8* %133, i32 %140)
%142 = inttoptr i64 %141 to i8*
%143 = load i8**, i8*** %11
store i8* %142, i8** %143
br label %149
144: ; preds = %118
%145 = load i8**, i8*** %11
%146 = load i8*, i8** %145
%147 = call i32 @free(i8* %146)
%148 = load i8**, i8*** %11
store i8* null, i8** %148
br label %149
149: ; preds = %144, %131
br label %150
150: ; preds = %149, %114, %111
br label %207
151: ; preds = %107
%152 = load i8*, i8** %14
%153 = call i64 @strncmp(i8* %152, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %193
155: ; preds = %151
%156 = load i8**, i8*** %12
%157 = icmp ne i8** %156, null
br i1 %157, label %158, label %192
158: ; preds = %155
%159 = load i8*, i8** %14
%160 = call i64 @strncmp(i8* %159, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 12)
%161 = icmp eq i64 %160, 0
br i1 %161, label %162, label %192
162: ; preds = %158
%163 = load i32, i32* %16
%164 = sext i32 %163 to i64
%165 = mul i64 1, %164
%166 = trunc i64 %165 to i32
%167 = call i64 @vrna_alloc(i32 %166)
%168 = inttoptr i64 %167 to i8*
store i8* %168, i8** %21
%169 = load i8*, i8** %14
%170 = load i8*, i8** %21
%171 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %169, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %170)
%172 = icmp eq i32 %171, 1
br i1 %172, label %173, label %189
173: ; preds = %162
%174 = load i8**, i8*** %12
%175 = load i8*, i8** %174
%176 = load i8*, i8** %21
%177 = call i32 @strlen(i8* %176)
%178 = add nsw i32 %177, 1
%179 = sext i32 %178 to i64
%180 = mul i64 1, %179
%181 = trunc i64 %180 to i32
%182 = call i64 @vrna_realloc(i8* %175, i32 %181)
%183 = inttoptr i64 %182 to i8*
%184 = load i8**, i8*** %12
store i8* %183, i8** %184
%185 = load i8**, i8*** %12
%186 = load i8*, i8** %185
%187 = load i8*, i8** %21
%188 = call i32 @strcpy(i8* %186, i8* %187)
br label %189
189: ; preds = %173, %162
%190 = load i8*, i8** %21
%191 = call i32 @free(i8* %190)
br label %192
192: ; preds = %189, %158, %155
br label %206
193: ; preds = %151
%194 = load i8*, i8** %14
%195 = call i64 @strncmp(i8* %194, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%196 = icmp eq i64 %195, 0
br i1 %196, label %197, label %198
197: ; preds = %193
br label %205
198: ; preds = %193
%199 = load i8*, i8** %14
%200 = call i64 @strncmp(i8* %199, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
%201 = icmp eq i64 %200, 0
br i1 %201, label %202, label %203
202: ; preds = %198
br label %204
203: ; preds = %198
br label %204
204: ; preds = %203, %202
br label %205
205: ; preds = %204, %197
br label %206
206: ; preds = %205, %192
br label %207
207: ; preds = %206, %150
br label %208
208: ; preds = %207, %101
br label %272
209: ; preds = %85
%210 = load i32, i32* %16
%211 = add nsw i32 %210, 1
%212 = sext i32 %211 to i64
%213 = mul i64 1, %212
%214 = trunc i64 %213 to i32
%215 = call i64 @vrna_alloc(i32 %214)
%216 = inttoptr i64 %215 to i8*
store i8* %216, i8** %23
%217 = load i32, i32* %16
%218 = add nsw i32 %217, 1
%219 = sext i32 %218 to i64
%220 = mul i64 1, %219
%221 = trunc i64 %220 to i32
%222 = call i64 @vrna_alloc(i32 %221)
%223 = inttoptr i64 %222 to i8*
store i8* %223, i8** %24
%224 = load i8*, i8** %14
%225 = load i8*, i8** %23
%226 = load i8*, i8** %24
%227 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %224, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* %225, i8* %226)
%228 = icmp eq i32 %227, 2
br i1 %228, label %229, label %267
229: ; preds = %209
%230 = load i32, i32* %17
%231 = add nsw i32 %230, 1
store i32 %231, i32* %17
%232 = load i8*, i8** %24
%233 = call i32 @strlen(i8* %232)
store i32 %233, i32* %22
%234 = load i32, i32* %17
%235 = icmp eq i32 %234, 1
br i1 %235, label %236, label %238
236: ; preds = %229
%237 = load i32, i32* %22
store i32 %237, i32* %18
br label %260
238: ; preds = %229
%239 = load i32, i32* %18
%240 = load i32, i32* %22
%241 = icmp ne i32 %239, %240
br i1 %241, label %242, label %259
242: ; preds = %238
%243 = load i32, i32* %13
%244 = icmp sge i32 %243, 0
br i1 %244, label %245, label %247
245: ; preds = %242
%246 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.13, i64 0, i64 0))
br label %247
247: ; preds = %245, %242
%248 = load i8***, i8**** %9
%249 = load i8***, i8**** %10
%250 = load i8**, i8*** %11
%251 = load i8**, i8*** %12
%252 = call i32 @free_msa_record(i8*** %248, i8*** %249, i8** %250, i8** %251)
store i32 0, i32* %17
%253 = load i8*, i8** %23
%254 = call i32 @free(i8* %253)
%255 = load i8*, i8** %24
%256 = call i32 @free(i8* %255)
%257 = load i8*, i8** %14
%258 = call i32 @free(i8* %257)
store i8* null, i8** %14
br label %284
259: ; preds = %238
br label %260
260: ; preds = %259, %236
%261 = load i8*, i8** %23
%262 = load i8*, i8** %24
%263 = load i8***, i8**** %9
%264 = load i8***, i8**** %10
%265 = load i32, i32* %17
%266 = call i32 @add_sequence(i8* %261, i8* %262, i8*** %263, i8*** %264, i32 %265)
br label %267
267: ; preds = %260, %209
%268 = load i8*, i8** %23
%269 = call i32 @free(i8* %268)
%270 = load i8*, i8** %24
%271 = call i32 @free(i8* %270)
br label %272
272: ; preds = %267, %208
br label %273
273: ; preds = %272, %91
%274 = load i8*, i8** %14
%275 = call i32 @free(i8* %274)
br label %74
276: ; preds = %82, %74
br label %283
277: ; preds = %70
%278 = load i32, i32* %13
%279 = icmp sgt i32 %278, 0
br i1 %279, label %280, label %282
280: ; preds = %277
%281 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0))
br label %282
282: ; preds = %280, %277
store i32 -1, i32* %7
br label %315
283: ; preds = %276
br label %284
284: ; preds = %283, %247
%285 = load i8*, i8** %14
%286 = call i32 @free(i8* %285)
%287 = load i8***, i8**** %9
%288 = load i8***, i8**** %10
%289 = load i32, i32* %17
%290 = call i32 @endmarker_msa_record(i8*** %287, i8*** %288, i32 %289)
%291 = load i32, i32* %17
%292 = icmp sgt i32 %291, 0
br i1 %292, label %293, label %313
293: ; preds = %284
%294 = load i32, i32* %13
%295 = icmp sge i32 %294, 0
br i1 %295, label %296, label %313
296: ; preds = %293
store i8* null, i8** %26
%297 = load i32, i32* %17
%298 = load i8***, i8**** %10
%299 = load i8**, i8*** %298
%300 = getelementptr inbounds i8*, i8** %299, i64 0
%301 = load i8*, i8** %300
%302 = call i32 @strlen(i8* %301)
%303 = call i32 @asprintf(i8** %26, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.15, i64 0, i64 0), i32 %297, i32 %302)
store i32 %303, i32* %25
%304 = load i32, i32* %25
%305 = icmp ne i32 %304, -1
br i1 %305, label %306, label %310
306: ; preds = %296
%307 = load i32, i32* @stderr
%308 = load i8*, i8** %26
%309 = call i32 @vrna_message_info(i32 %307, i8* %308)
br label %310
310: ; preds = %306, %296
%311 = load i8*, i8** %26
%312 = call i32 @free(i8* %311)
br label %313
313: ; preds = %310, %293, %284
%314 = load i32, i32* %17
store i32 %314, i32* %7
br label %315
315: ; preds = %313, %282, %44, %34
%316 = load i32, i32* %7
ret i32 %316
}

LLVM IR (-O2):
@.str = [82 x i8] c"Can't read from filepointer while parsing Stockholm formatted sequence alignment!\00"
@.str.1 = [14 x i8] c"STOCKHOLM 1.0\00"
@.str.2 = [3 x i8] c"//\00"
@.str.3 = [44 x i8] c"Malformatted Stockholm record, missing // ?\00"
@.str.4 = [5 x i8] c"#=GF\00"
@.str.5 = [8 x i8] c"#=GF ID\00"
@.str.6 = [11 x i8] c"#=GF ID %s\00"
@.str.7 = [5 x i8] c"#=GC\00"
@.str.8 = [13 x i8] c"#=GC SS_cons\00"
@.str.9 = [16 x i8] c"#=GC SS_cons %s\00"
@.str.10 = [5 x i8] c"#=GS\00"
@.str.11 = [5 x i8] c"#=GR\00"
@.str.12 = [6 x i8] c"%s %s\00"
@.str.13 = [60 x i8] c"Discarding Stockholm record! Sequence lengths do not match.\00"
@.str.14 = [49 x i8] c"Did not find any Stockholm 1.0 formatted record!\00"
@.str.15 = [38 x i8] c"%d sequences; length of alignment %d.\00"
@stderr = global i32 0
define i32 @parse_stockholm_alignment(i32* %0, i8*** %1, i8*** %2, i8** %3, i8** %4, i32 %5) {
%7 = alloca i8*
%8 = icmp eq i32* %0, null
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = icmp sgt i32 %5, -1
br i1 %10, label %11, label %166
11: ; preds = %9
%12 = tail call i32 @vrna_message_warning(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %166
13: ; preds = %6
%14 = icmp ne i8*** %1, null
%15 = icmp ne i8*** %2, null
%16 = and i1 %14, %15
br i1 %16, label %17, label %166
17: ; preds = %13
store i8** null, i8*** %1
store i8** null, i8*** %2
%18 = icmp eq i8** %3, null
br i1 %18, label %20, label %19
19: ; preds = %17
store i8* null, i8** %3
br label %20
20: ; preds = %19, %17
%21 = icmp eq i8** %4, null
br i1 %21, label %23, label %22
22: ; preds = %20
store i8* null, i8** %4
br label %23
23: ; preds = %22, %20
%24 = tail call i8* @get_line(i32* %0)
%25 = icmp eq i8* %24, null
br i1 %25, label %138, label %26
26: ; preds = %23, %36
%27 = phi i8* [ %31, %36 ], [ %24, %23 ]
%28 = tail call i64 @strstr(i8* %27, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
%30 = tail call i32 @free(i8* %27)
%31 = tail call i8* @get_line(i32* %0)
%32 = icmp eq i8* %31, null
br i1 %29, label %36, label %33
33: ; preds = %26
br i1 %32, label %145, label %34
34: ; preds = %33
%35 = icmp sgt i32 %5, -1
br label %37
36: ; preds = %26
br i1 %32, label %138, label %26
37: ; preds = %34, %132
%38 = phi i8* [ %31, %34 ], [ %136, %132 ]
%39 = phi i32 [ 0, %34 ], [ %134, %132 ]
%40 = phi i32 [ 0, %34 ], [ %133, %132 ]
%41 = tail call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 2)
%42 = icmp eq i64 %41, 0
br i1 %42, label %142, label %43
43: ; preds = %37
%44 = tail call i32 @strlen(i8* %38)
%45 = load i8, i8* %38
%46 = sext i8 %45 to i32
switch i32 %46, label %101 [
i32 32, label %132
i32 0, label %132
i32 35, label %47
]
47: ; preds = %43
%48 = tail call i64 @strstr(i8* %38, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %55, label %50
50: ; preds = %47
br i1 %35, label %51, label %53
51: ; preds = %50
%52 = tail call i32 @vrna_message_warning(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %51, %50
%54 = tail call i32 @free_msa_record(i8*** %1, i8*** %2, i8** %3, i8** %4)
br label %132
55: ; preds = %47
%56 = tail call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 4)
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %75
58: ; preds = %55
br i1 %18, label %132, label %59
59: ; preds = %58
%60 = tail call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 7)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %132
62: ; preds = %59
%63 = tail call i64 @vrna_alloc(i32 %44)
%64 = inttoptr i64 %63 to i8*
store i8* %64, i8** %3
%65 = tail call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %38, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i8* %64)
%66 = icmp eq i32 %65, 1
%67 = load i8*, i8** %3
br i1 %66, label %68, label %73
68: ; preds = %62
%69 = tail call i32 @strlen(i8* %67)
%70 = add nsw i32 %69, 1
%71 = tail call i64 @vrna_realloc(i8* %67, i32 %70)
%72 = inttoptr i64 %71 to i8*
store i8* %72, i8** %3
br label %132
73: ; preds = %62
%74 = tail call i32 @free(i8* %67)
store i8* null, i8** %3
br label %132
75: ; preds = %55
%76 = tail call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 4)
%77 = icmp eq i64 %76, 0
br i1 %77, label %78, label %96
78: ; preds = %75
br i1 %21, label %132, label %79
79: ; preds = %78
%80 = tail call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32 12)
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %132
82: ; preds = %79
%83 = tail call i64 @vrna_alloc(i32 %44)
%84 = inttoptr i64 %83 to i8*
%85 = tail call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %38, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), i8* %84)
%86 = icmp eq i32 %85, 1
br i1 %86, label %87, label %94
87: ; preds = %82
%88 = load i8*, i8** %4
%89 = tail call i32 @strlen(i8* %84)
%90 = add nsw i32 %89, 1
%91 = tail call i64 @vrna_realloc(i8* %88, i32 %90)
%92 = inttoptr i64 %91 to i8*
store i8* %92, i8** %4
%93 = tail call i32 @strcpy(i8* %92, i8* %84)
br label %94
94: ; preds = %87, %82
%95 = tail call i32 @free(i8* %84)
br label %132
96: ; preds = %75
%97 = tail call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i32 4)
%98 = icmp eq i64 %97, 0
br i1 %98, label %132, label %99
99: ; preds = %96
%100 = tail call i64 @strncmp(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 4)
br label %132
101: ; preds = %43
%102 = add nsw i32 %44, 1
%103 = tail call i64 @vrna_alloc(i32 %102)
%104 = inttoptr i64 %103 to i8*
%105 = tail call i64 @vrna_alloc(i32 %102)
%106 = inttoptr i64 %105 to i8*
%107 = tail call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i8* %104, i8* %106)
%108 = icmp eq i32 %107, 2
br i1 %108, label %109, label %123
109: ; preds = %101
%110 = add nsw i32 %39, 1
%111 = tail call i32 @strlen(i8* %106)
%112 = icmp eq i32 %39, 0
br i1 %112, label %120, label %113
113: ; preds = %109
%114 = icmp eq i32 %40, %111
br i1 %114, label %120, label %115
115: ; preds = %113
%116 = inttoptr i64 %103 to i8*
%117 = inttoptr i64 %105 to i8*
br i1 %35, label %118, label %128
118: ; preds = %115
%119 = tail call i32 @vrna_message_warning(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.13, i64 0, i64 0))
br label %128
120: ; preds = %109, %113
%121 = phi i32 [ %40, %113 ], [ %111, %109 ]
%122 = tail call i32 @add_sequence(i8* %104, i8* %106, i8*** %1, i8*** %2, i32 %110)
br label %123
123: ; preds = %101, %120
%124 = phi i32 [ %121, %120 ], [ %40, %101 ]
%125 = phi i32 [ %110, %120 ], [ %39, %101 ]
%126 = tail call i32 @free(i8* %104)
%127 = tail call i32 @free(i8* %106)
br label %132
128: ; preds = %115, %118
%129 = tail call i32 @free_msa_record(i8*** %1, i8*** %2, i8** %3, i8** %4)
%130 = tail call i32 @free(i8* %116)
%131 = tail call i32 @free(i8* %117)
br label %142
132: ; preds = %123, %68, %73, %59, %58, %99, %96, %78, %79, %94, %53, %43, %43
%133 = phi i32 [ %40, %53 ], [ %40, %68 ], [ %40, %73 ], [ %40, %59 ], [ %40, %58 ], [ %40, %94 ], [ %40, %79 ], [ %40, %78 ], [ %40, %96 ], [ %40, %99 ], [ %40, %43 ], [ %40, %43 ], [ %124, %123 ]
%134 = phi i32 [ 0, %53 ], [ %39, %68 ], [ %39, %73 ], [ %39, %59 ], [ %39, %58 ], [ %39, %94 ], [ %39, %79 ], [ %39, %78 ], [ %39, %96 ], [ %39, %99 ], [ %39, %43 ], [ %39, %43 ], [ %125, %123 ]
%135 = tail call i32 @free(i8* %38)
%136 = tail call i8* @get_line(i32* %0)
%137 = icmp eq i8* %136, null
br i1 %137, label %145, label %37
138: ; preds = %36, %23
%139 = icmp sgt i32 %5, 0
br i1 %139, label %140, label %166
140: ; preds = %138
%141 = tail call i32 @vrna_message_warning(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.14, i64 0, i64 0))
br label %166
142: ; preds = %37, %128
%143 = phi i32 [ 0, %128 ], [ %39, %37 ]
%144 = tail call i32 @free(i8* %38)
br label %145
145: ; preds = %132, %142, %33
%146 = phi i32 [ 0, %33 ], [ %143, %142 ], [ %134, %132 ]
%147 = tail call i32 @free(i8* null)
%148 = tail call i32 @endmarker_msa_record(i8*** %1, i8*** %2, i32 %146)
%149 = icmp sgt i32 %146, 0
%150 = icmp sgt i32 %5, -1
%151 = and i1 %150, %149
br i1 %151, label %152, label %166
152: ; preds = %145
%153 = bitcast i8** %7 to i8*
store i8* null, i8** %7
%154 = load i8**, i8*** %2
%155 = load i8*, i8** %154
%156 = tail call i32 @strlen(i8* %155)
%157 = call i32 @asprintf(i8** %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.15, i64 0, i64 0), i32 %146, i32 %156)
%158 = icmp eq i32 %157, -1
br i1 %158, label %163, label %159
159: ; preds = %152
%160 = load i32, i32* @stderr
%161 = load i8*, i8** %7
%162 = call i32 @vrna_message_info(i32 %160, i8* %161)
br label %163
163: ; preds = %159, %152
%164 = load i8*, i8** %7
%165 = call i32 @free(i8* %164)
br label %166
166: ; preds = %140, %138, %163, %145, %13, %9, %11
%167 = phi i32 [ -1, %11 ], [ -1, %9 ], [ -1, %13 ], [ -1, %140 ], [ -1, %138 ], [ %146, %163 ], [ %146, %145 ]
ret i32 %167
}