#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
char *get_line(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
int strlen(char *);
scalar_t__ strncmp(char *, char *, int);
int /*<<< orphan*/ strstr(char *, char *);
char toupper(char);
scalar_t__ vrna_alloc(int);
scalar_t__ vrna_realloc(char *, int);
int read_clustal(FILE *clust, char *AlignedSeqs[], char *names[]) {
  char *line, name[100] = "", *seq;
  int n, nn = 0, num_seq = 0, i;
  if ((line = get_line(clust)) == NULL) {
    fprintf(stderr, "Empty CLUSTAL file\n");
    return 0;
  }
  if ((strncmp(line, "CLUSTAL", 7) != 0) && (!strstr(line, "STOCKHOLM"))) {
    fprintf(stderr, "This doesn't look like a CLUSTAL/STOCKHOLM file, sorry\n");
    free(line);
    return 0;
  }
  free(line);
  line = get_line(clust);
  while (line != NULL) {
    if (strncmp(line, "//", 2) == 0) {
      free(line);
      break;
    }
    if (((n = strlen(line)) < 4) || isspace((int)line[0])) {
      free(line);
      line = get_line(clust);
      nn = 0;
      continue;
    }
    if (line[0] == '#') {
      free(line);
      line = get_line(clust);
      continue;
    }
    seq = (char *)vrna_alloc((n + 1) * sizeof(char));
    sscanf(line, "%99s %s", name, seq);
    for (i = 0; i < strlen(seq); i++) {
      if (seq[i] == '.')
        seq[i] = '-';
      seq[i] = toupper(seq[i]);
    }
    if (nn == num_seq) {
      names[nn] = strdup(name);
      AlignedSeqs[nn] = strdup(seq);
    } else {
      if (strcmp(name, names[nn]) != 0) {
        fprintf(stderr,
                "Sorry, your file is messed up (inconsitent seq-names)\n");
        free(line);
        free(seq);
        return 0;
      }
      AlignedSeqs[nn] = (char *)vrna_realloc(
          AlignedSeqs[nn], strlen(seq) + strlen(AlignedSeqs[nn]) + 1);
      strcat(AlignedSeqs[nn], seq);
    }
    nn++;
    if (nn > num_seq)
      num_seq = nn;
    free(seq);
    free(line);
    if (num_seq >= 500) {
      fprintf(stderr, "Too many sequences in CLUSTAL/STOCKHOLM file");
      return 0;
    }
    line = get_line(clust);
  }
  AlignedSeqs[num_seq] = NULL;
  names[num_seq] = NULL;
  if (num_seq == 0) {
    fprintf(stderr, "No sequences found in CLUSTAL/STOCKHOLM file\n");
    return 0;
  }
  n = strlen(AlignedSeqs[0]);
  for (nn = 1; nn < num_seq; nn++) {
    if (strlen(AlignedSeqs[nn]) != n) {
      fprintf(stderr, "Sorry, your file is messed up.\n"
                      "Unequal lengths!\n\n");
      return 0;
    }
  }
  fprintf(stderr, "%d sequences; length of alignment %d.\n", nn, n);
  return num_seq;
}


x86 assembly (clang, -O0):
<read_clustal>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1080 <memset@plt>
movl   $0x0,-0xa0(%rbp)
movl   $0x0,-0xa4(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <get_line@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1268 <read_clustal+0x78>
mov    0x2d94(%rip),%rax
mov    (%rax),%edi
lea    0xdab(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1733 <read_clustal+0x543>
mov    -0x28(%rbp),%rdi
lea    0xda1(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     12cc <read_clustal+0xdc>
mov    -0x28(%rbp),%rdi
lea    0xd8a(%rip),%rsi
call   1110 <strstr@plt>
cmp    $0x0,%eax
jne    12cc <read_clustal+0xdc>
mov    0x2d39(%rip),%rax
mov    (%rax),%edi
lea    0xd76(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1733 <read_clustal+0x543>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1060 <get_line@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1627 <read_clustal+0x437>
mov    -0x28(%rbp),%rdi
lea    0xd66(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    131a <read_clustal+0x12a>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
jmp    1627 <read_clustal+0x437>
mov    -0x28(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x9c(%rbp)
cmp    $0x4,%eax
jl     1348 <read_clustal+0x158>
mov    -0x28(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isspace@plt>
cmp    $0x0,%rax
je     136d <read_clustal+0x17d>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1060 <get_line@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0xa0(%rbp)
jmp    12e2 <read_clustal+0xf2>
mov    -0x28(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1398 <read_clustal+0x1a8>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1060 <get_line@plt>
mov    %rax,-0x28(%rbp)
jmp    12e2 <read_clustal+0xf2>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   10e0 <vrna_alloc@plt>
mov    %rax,-0x98(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x90(%rbp),%rdx
mov    -0x98(%rbp),%rcx
lea    0xc93(%rip),%rsi
call   10c0 <sscanf@plt>
movl   $0x0,-0xa8(%rbp)
mov    -0xa8(%rbp),%eax
mov    %eax,-0xac(%rbp)
mov    -0x98(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,%ecx
mov    -0xac(%rbp),%eax
cmp    %ecx,%eax
jge    1470 <read_clustal+0x280>
mov    -0x98(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1432 <read_clustal+0x242>
mov    -0x98(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movb   $0x2d,(%rax,%rcx,1)
mov    -0x98(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1050 <toupper@plt>
mov    %al,%dl
mov    -0x98(%rbp),%rax
movslq -0xa8(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    13dd <read_clustal+0x1ed>
mov    -0xa0(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jne    14c3 <read_clustal+0x2d3>
lea    -0x90(%rbp),%rdi
call   1100 <strdup@plt>
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x98(%rbp),%rdi
call   1100 <strdup@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
jmp    15a0 <read_clustal+0x3b0>
lea    -0x90(%rbp),%rdi
mov    -0x20(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%rax
je     1520 <read_clustal+0x330>
mov    0x2af1(%rip),%rax
mov    (%rax),%edi
lea    0xb71(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1733 <read_clustal+0x543>
mov    -0x18(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x98(%rbp),%rdi
call   1070 <strlen@plt>
mov    %eax,-0xbc(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <strlen@plt>
mov    -0xbc(%rbp),%esi
mov    -0xb8(%rbp),%rdi
add    %eax,%esi
add    $0x1,%esi
call   10d0 <vrna_realloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x98(%rbp),%rsi
call   10f0 <strcat@plt>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jle    15cd <read_clustal+0x3dd>
mov    -0xa0(%rbp),%eax
mov    %eax,-0xa4(%rbp)
mov    -0x98(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x1f4,-0xa4(%rbp)
jl     1615 <read_clustal+0x425>
mov    0x29e7(%rip),%rax
mov    (%rax),%edi
lea    0xa9e(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1733 <read_clustal+0x543>
mov    -0x10(%rbp),%rdi
call   1060 <get_line@plt>
mov    %rax,-0x28(%rbp)
jmp    12e2 <read_clustal+0xf2>
mov    -0x18(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0xa4(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
cmpl   $0x0,-0xa4(%rbp)
jne    167d <read_clustal+0x48d>
mov    0x297f(%rip),%rax
mov    (%rax),%edi
lea    0xa63(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1733 <read_clustal+0x543>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1070 <strlen@plt>
mov    %eax,-0x9c(%rbp)
movl   $0x1,-0xa0(%rbp)
mov    -0xa0(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jge    1707 <read_clustal+0x517>
mov    -0x18(%rbp),%rax
movslq -0xa0(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <strlen@plt>
cmp    -0x9c(%rbp),%eax
je     16ee <read_clustal+0x4fe>
mov    0x290e(%rip),%rax
mov    (%rax),%edi
lea    0xa20(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1733 <read_clustal+0x543>
jmp    16f3 <read_clustal+0x503>
mov    -0xa0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa0(%rbp)
jmp    1699 <read_clustal+0x4a9>
mov    0x28d2(%rip),%rax
mov    (%rax),%edi
mov    -0xa0(%rbp),%edx
mov    -0x9c(%rbp),%ecx
lea    0xa0a(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0xa4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_clustal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movl   $0x0,0x90(%rsp)
call   1060 <get_line@plt>
test   %rax,%rax
je     147c <read_clustal+0x29c>
mov    %rax,%rbp
lea    0xdd3(%rip),%rsi
mov    %rax,%rdi
mov    $0x7,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     126a <read_clustal+0x8a>
lea    0xdc2(%rip),%rsi
mov    %rbp,%rdi
call   1100 <strstr@plt>
test   %eax,%eax
je     1555 <read_clustal+0x375>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1060 <get_line@plt>
test   %rax,%rax
je     1491 <read_clustal+0x2b1>
mov    %rax,%rbp
mov    %rbx,0x10(%rsp)
xor    %r12d,%r12d
lea    0xdc9(%rip),%r13
xor    %ebx,%ebx
mov    %ebx,%eax
mov    %rax,0x18(%rsp)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     14a4 <read_clustal+0x2c4>
mov    %rbp,%rdi
call   1070 <strlen@plt>
cmp    $0x4,%eax
jl     1300 <read_clustal+0x120>
mov    %eax,%ebx
movsbl 0x0(%rbp),%edi
call   1080 <isspace@plt>
test   %rax,%rax
jne    1300 <read_clustal+0x120>
cmpb   $0x23,0x0(%rbp)
jne    1323 <read_clustal+0x143>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1060 <get_line@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    12a0 <read_clustal+0xc0>
jmp    14ac <read_clustal+0x2cc>
nopl   0x0(%rax)
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1060 <get_line@plt>
mov    %rax,%rbp
xor    %eax,%eax
test   %rbp,%rbp
jne    1299 <read_clustal+0xb9>
jmp    14ac <read_clustal+0x2cc>
mov    %r15,0x8(%rsp)
add    $0x1,%ebx
mov    %ebx,%edi
call   10d0 <vrna_alloc@plt>
mov    %rax,%r15
mov    %rbp,%rdi
lea    0xd22(%rip),%rsi
lea    0x30(%rsp),%rdx
mov    %rax,%rcx
call   10b0 <sscanf@plt>
mov    %r15,%rdi
call   1070 <strlen@plt>
test   %eax,%eax
jle    1391 <read_clustal+0x1b1>
xor    %ebx,%ebx
jmp    137f <read_clustal+0x19f>
nopl   0x0(%rax)
movsbl %al,%edi
call   1050 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    1391 <read_clustal+0x1b1>
movzbl (%r15,%rbx,1),%eax
cmp    $0x2e,%al
jne    1360 <read_clustal+0x180>
movb   $0x2d,(%r15,%rbx,1)
mov    $0x2d,%al
jmp    1360 <read_clustal+0x180>
mov    0x18(%rsp),%rax
cmp    %r12d,%eax
jne    13c4 <read_clustal+0x1e4>
lea    0x30(%rsp),%rdi
call   10f0 <strdup@plt>
movslq %r12d,%rbx
mov    0x10(%rsp),%rcx
mov    %rax,(%rcx,%rbx,8)
mov    %r15,%rdi
call   10f0 <strdup@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%rbx,8)
jmp    1435 <read_clustal+0x255>
movslq %eax,%rbx
mov    0x10(%rsp),%rax
mov    (%rax,%rbx,8),%rsi
lea    0x30(%rsp),%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    159d <read_clustal+0x3bd>
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,8),%rax
mov    %rax,0x28(%rsp)
mov    %r15,%rdi
call   1070 <strlen@plt>
mov    %rax,0x20(%rsp)
mov    0x8(%rsp),%rax
mov    (%rax,%rbx,8),%rdi
call   1070 <strlen@plt>
mov    0x20(%rsp),%rcx
lea    (%rcx,%rax,1),%esi
add    $0x1,%esi
mov    0x28(%rsp),%rdi
call   10c0 <vrna_realloc@plt>
mov    0x8(%rsp),%rcx
mov    %rax,(%rcx,%rbx,8)
mov    %rax,%rdi
mov    %r15,%rsi
call   10e0 <strcat@plt>
mov    0x18(%rsp),%rax
lea    0x1(%rax),%ebx
cmp    %r12d,%eax
cmovge %ebx,%r12d
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
cmp    $0x1f4,%r12d
jge    158b <read_clustal+0x3ab>
mov    %r14,%rdi
call   1060 <get_line@plt>
mov    %rax,%rbp
test   %rax,%rax
mov    0x8(%rsp),%r15
jne    1297 <read_clustal+0xb7>
jmp    14ac <read_clustal+0x2cc>
mov    0x2b5d(%rip),%rax
mov    (%rax),%edi
lea    0xb74(%rip),%rsi
jmp    1536 <read_clustal+0x356>
movq   $0x0,(%r15)
movq   $0x0,(%rbx)
jmp    1526 <read_clustal+0x346>
mov    %rbp,%rdi
call   1030 <free@plt>
movslq %r12d,%rax
movq   $0x0,(%r15,%rax,8)
mov    0x10(%rsp),%rcx
movq   $0x0,(%rcx,%rax,8)
test   %eax,%eax
je     1526 <read_clustal+0x346>
mov    (%r15),%rdi
call   1070 <strlen@plt>
mov    %eax,%r14d
mov    $0x1,%edx
cmp    $0x2,%r12d
jl     150a <read_clustal+0x32a>
mov    %r12d,%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1070 <strlen@plt>
cmp    %r14d,%eax
jne    1579 <read_clustal+0x399>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    14f0 <read_clustal+0x310>
mov    %r12d,%edx
mov    0x2acf(%rip),%rax
mov    (%rax),%edi
lea    0xc13(%rip),%rsi
mov    %r14d,%ecx
xor    %eax,%eax
call   10a0 <fprintf@plt>
jmp    1540 <read_clustal+0x360>
mov    0x2ab3(%rip),%rax
mov    (%rax),%edi
lea    0xb97(%rip),%rsi
xor    %r12d,%r12d
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %r12d,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2a84(%rip),%rax
mov    (%rax),%edi
lea    0xac1(%rip),%rsi
xor    %r12d,%r12d
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
jmp    1540 <read_clustal+0x360>
mov    0x2a60(%rip),%rax
mov    (%rax),%edi
lea    0xb72(%rip),%rsi
jmp    1536 <read_clustal+0x356>
mov    0x2a4e(%rip),%rax
mov    (%rax),%edi
lea    0xb05(%rip),%rsi
jmp    1536 <read_clustal+0x356>
mov    0x2a3c(%rip),%rax
mov    (%rax),%edi
lea    0xabc(%rip),%rsi
xor    %r12d,%r12d
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
jmp    1540 <read_clustal+0x360>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Empty CLUSTAL file\0A\00"
@.str.1 = [8 x i8] c"CLUSTAL\00"
@.str.2 = [10 x i8] c"STOCKHOLM\00"
@.str.3 = [56 x i8] c"This doesn't look like a CLUSTAL/STOCKHOLM file, sorry\0A\00"
@.str.4 = [3 x i8] c"//\00"
@.str.5 = [8 x i8] c"%99s %s\00"
@.str.6 = [55 x i8] c"Sorry, your file is messed up (inconsitent seq-names)\0A\00"
@.str.7 = [45 x i8] c"Too many sequences in CLUSTAL/STOCKHOLM file\00"
@.str.8 = [46 x i8] c"No sequences found in CLUSTAL/STOCKHOLM file\0A\00"
@.str.9 = [50 x i8] c"Sorry, your file is messed up.\0AUnequal lengths!\0A\0A\00"
@.str.10 = [39 x i8] c"%d sequences; length of alignment %d.\0A\00"
define i32 @read_clustal(i32* %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca [100 x i8]
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%15 = bitcast [100 x i8]* %9 to i8*
store i32 0, i32* %12
store i32 0, i32* %13
%16 = load i32*, i32** %5
%17 = call i8* @get_line(i32* %16)
store i8* %17, i8** %8
%18 = icmp eq i8* %17, null
br i1 %18, label %19, label %22
19: ; preds = %3
%20 = load i32, i32* @stderr
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %249
22: ; preds = %3
%23 = load i8*, i8** %8
%24 = call i64 @strncmp(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %35
26: ; preds = %22
%27 = load i8*, i8** %8
%28 = call i32 @strstr(i8* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%29 = icmp ne i32 %28, 0
br i1 %29, label %35, label %30
30: ; preds = %26
%31 = load i32, i32* @stderr
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%33 = load i8*, i8** %8
%34 = call i32 @free(i8* %33)
store i32 0, i32* %4
br label %249
35: ; preds = %26, %22
%36 = load i8*, i8** %8
%37 = call i32 @free(i8* %36)
%38 = load i32*, i32** %5
%39 = call i8* @get_line(i32* %38)
store i8* %39, i8** %8
br label %40
40: ; preds = %201, %72, %61, %35
%41 = load i8*, i8** %8
%42 = icmp ne i8* %41, null
br i1 %42, label %43, label %204
43: ; preds = %40
%44 = load i8*, i8** %8
%45 = call i64 @strncmp(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = load i8*, i8** %8
%49 = call i32 @free(i8* %48)
br label %204
50: ; preds = %43
%51 = load i8*, i8** %8
%52 = call i32 @strlen(i8* %51)
store i32 %52, i32* %11
%53 = icmp slt i32 %52, 4
br i1 %53, label %61, label %54
54: ; preds = %50
%55 = load i8*, i8** %8
%56 = getelementptr inbounds i8, i8* %55, i64 0
%57 = load i8, i8* %56
%58 = sext i8 %57 to i32
%59 = call i64 @isspace(i32 %58)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %66
61: ; preds = %54, %50
%62 = load i8*, i8** %8
%63 = call i32 @free(i8* %62)
%64 = load i32*, i32** %5
%65 = call i8* @get_line(i32* %64)
store i8* %65, i8** %8
store i32 0, i32* %12
br label %40
66: ; preds = %54
%67 = load i8*, i8** %8
%68 = getelementptr inbounds i8, i8* %67, i64 0
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = icmp eq i32 %70, 35
br i1 %71, label %72, label %77
72: ; preds = %66
%73 = load i8*, i8** %8
%74 = call i32 @free(i8* %73)
%75 = load i32*, i32** %5
%76 = call i8* @get_line(i32* %75)
store i8* %76, i8** %8
br label %40
77: ; preds = %66
%78 = load i32, i32* %11
%79 = add nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 1
%82 = trunc i64 %81 to i32
%83 = call i64 @vrna_alloc(i32 %82)
%84 = inttoptr i64 %83 to i8*
store i8* %84, i8** %10
%85 = load i8*, i8** %8
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%87 = load i8*, i8** %10
%88 = call i32 @sscanf(i8* %85, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %86, i8* %87)
store i32 0, i32* %14
br label %89
89: ; preds = %118, %77
%90 = load i32, i32* %14
%91 = load i8*, i8** %10
%92 = call i32 @strlen(i8* %91)
%93 = icmp slt i32 %90, %92
br i1 %93, label %94, label %121
94: ; preds = %89
%95 = load i8*, i8** %10
%96 = load i32, i32* %14
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds i8, i8* %95, i64 %97
%99 = load i8, i8* %98
%100 = sext i8 %99 to i32
%101 = icmp eq i32 %100, 46
br i1 %101, label %102, label %107
102: ; preds = %94
%103 = load i8*, i8** %10
%104 = load i32, i32* %14
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %103, i64 %105
store i8 45, i8* %106
br label %107
107: ; preds = %102, %94
%108 = load i8*, i8** %10
%109 = load i32, i32* %14
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds i8, i8* %108, i64 %110
%112 = load i8, i8* %111
%113 = call signext i8 @toupper(i8 signext %112)
%114 = load i8*, i8** %10
%115 = load i32, i32* %14
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds i8, i8* %114, i64 %116
store i8 %113, i8* %117
br label %118
118: ; preds = %107
%119 = load i32, i32* %14
%120 = add nsw i32 %119, 1
store i32 %120, i32* %14
br label %89
121: ; preds = %89
%122 = load i32, i32* %12
%123 = load i32, i32* %13
%124 = icmp eq i32 %122, %123
br i1 %124, label %125, label %138
125: ; preds = %121
%126 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%127 = call i8* @strdup(i8* %126)
%128 = load i8**, i8*** %7
%129 = load i32, i32* %12
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds i8*, i8** %128, i64 %130
store i8* %127, i8** %131
%132 = load i8*, i8** %10
%133 = call i8* @strdup(i8* %132)
%134 = load i8**, i8*** %6
%135 = load i32, i32* %12
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds i8*, i8** %134, i64 %136
store i8* %133, i8** %137
br label %183
138: ; preds = %121
%139 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%140 = load i8**, i8*** %7
%141 = load i32, i32* %12
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds i8*, i8** %140, i64 %142
%144 = load i8*, i8** %143
%145 = call i64 @strcmp(i8* %139, i8* %144)
%146 = icmp ne i64 %145, 0
br i1 %146, label %147, label %154
147: ; preds = %138
%148 = load i32, i32* @stderr
%149 = call i32 (i32, i8*, ...) @fprintf(i32 %148, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%150 = load i8*, i8** %8
%151 = call i32 @free(i8* %150)
%152 = load i8*, i8** %10
%153 = call i32 @free(i8* %152)
store i32 0, i32* %4
br label %249
154: ; preds = %138
%155 = load i8**, i8*** %6
%156 = load i32, i32* %12
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds i8*, i8** %155, i64 %157
%159 = load i8*, i8** %158
%160 = load i8*, i8** %10
%161 = call i32 @strlen(i8* %160)
%162 = load i8**, i8*** %6
%163 = load i32, i32* %12
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i8*, i8** %162, i64 %164
%166 = load i8*, i8** %165
%167 = call i32 @strlen(i8* %166)
%168 = add nsw i32 %161, %167
%169 = add nsw i32 %168, 1
%170 = call i64 @vrna_realloc(i8* %159, i32 %169)
%171 = inttoptr i64 %170 to i8*
%172 = load i8**, i8*** %6
%173 = load i32, i32* %12
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i8*, i8** %172, i64 %174
store i8* %171, i8** %175
%176 = load i8**, i8*** %6
%177 = load i32, i32* %12
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds i8*, i8** %176, i64 %178
%180 = load i8*, i8** %179
%181 = load i8*, i8** %10
%182 = call i32 @strcat(i8* %180, i8* %181)
br label %183
183: ; preds = %154, %125
%184 = load i32, i32* %12
%185 = add nsw i32 %184, 1
store i32 %185, i32* %12
%186 = load i32, i32* %12
%187 = load i32, i32* %13
%188 = icmp sgt i32 %186, %187
br i1 %188, label %189, label %191
189: ; preds = %183
%190 = load i32, i32* %12
store i32 %190, i32* %13
br label %191
191: ; preds = %189, %183
%192 = load i8*, i8** %10
%193 = call i32 @free(i8* %192)
%194 = load i8*, i8** %8
%195 = call i32 @free(i8* %194)
%196 = load i32, i32* %13
%197 = icmp sge i32 %196, 500
br i1 %197, label %198, label %201
198: ; preds = %191
%199 = load i32, i32* @stderr
%200 = call i32 (i32, i8*, ...) @fprintf(i32 %199, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %4
br label %249
201: ; preds = %191
%202 = load i32*, i32** %5
%203 = call i8* @get_line(i32* %202)
store i8* %203, i8** %8
br label %40
204: ; preds = %47, %40
%205 = load i8**, i8*** %6
%206 = load i32, i32* %13
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds i8*, i8** %205, i64 %207
store i8* null, i8** %208
%209 = load i8**, i8*** %7
%210 = load i32, i32* %13
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds i8*, i8** %209, i64 %211
store i8* null, i8** %212
%213 = load i32, i32* %13
%214 = icmp eq i32 %213, 0
br i1 %214, label %215, label %218
215: ; preds = %204
%216 = load i32, i32* @stderr
%217 = call i32 (i32, i8*, ...) @fprintf(i32 %216, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %4
br label %249
218: ; preds = %204
%219 = load i8**, i8*** %6
%220 = getelementptr inbounds i8*, i8** %219, i64 0
%221 = load i8*, i8** %220
%222 = call i32 @strlen(i8* %221)
store i32 %222, i32* %11
store i32 1, i32* %12
br label %223
223: ; preds = %240, %218
%224 = load i32, i32* %12
%225 = load i32, i32* %13
%226 = icmp slt i32 %224, %225
br i1 %226, label %227, label %243
227: ; preds = %223
%228 = load i8**, i8*** %6
%229 = load i32, i32* %12
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds i8*, i8** %228, i64 %230
%232 = load i8*, i8** %231
%233 = call i32 @strlen(i8* %232)
%234 = load i32, i32* %11
%235 = icmp ne i32 %233, %234
br i1 %235, label %236, label %239
236: ; preds = %227
%237 = load i32, i32* @stderr
%238 = call i32 (i32, i8*, ...) @fprintf(i32 %237, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %4
br label %249
239: ; preds = %227
br label %240
240: ; preds = %239
%241 = load i32, i32* %12
%242 = add nsw i32 %241, 1
store i32 %242, i32* %12
br label %223
243: ; preds = %223
%244 = load i32, i32* @stderr
%245 = load i32, i32* %12
%246 = load i32, i32* %11
%247 = call i32 (i32, i8*, ...) @fprintf(i32 %244, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i32 %245, i32 %246)
%248 = load i32, i32* %13
store i32 %248, i32* %4
br label %249
249: ; preds = %243, %236, %215, %198, %147, %30, %19
%250 = load i32, i32* %4
ret i32 %250
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Empty CLUSTAL file\0A\00"
@.str.1 = [8 x i8] c"CLUSTAL\00"
@.str.2 = [10 x i8] c"STOCKHOLM\00"
@.str.3 = [56 x i8] c"This doesn't look like a CLUSTAL/STOCKHOLM file, sorry\0A\00"
@.str.4 = [3 x i8] c"//\00"
@.str.5 = [8 x i8] c"%99s %s\00"
@.str.6 = [55 x i8] c"Sorry, your file is messed up (inconsitent seq-names)\0A\00"
@.str.7 = [45 x i8] c"Too many sequences in CLUSTAL/STOCKHOLM file\00"
@.str.8 = [46 x i8] c"No sequences found in CLUSTAL/STOCKHOLM file\0A\00"
@.str.9 = [50 x i8] c"Sorry, your file is messed up.\0AUnequal lengths!\0A\0A\00"
@.str.10 = [39 x i8] c"%d sequences; length of alignment %d.\0A\00"
define i32 @read_clustal(i32* %0, i8** nocapture %1, i8** nocapture %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%6 = tail call i8* @get_line(i32* %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %153
11: ; preds = %3
%12 = tail call i64 @strncmp(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 7)
%13 = icmp eq i64 %12, 0
br i1 %13, label %21, label %14
14: ; preds = %11
%15 = tail call i32 @strstr(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%20 = tail call i32 @free(i8* %6)
br label %153
21: ; preds = %14, %11
%22 = tail call i32 @free(i8* %6)
%23 = tail call i8* @get_line(i32* %0)
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %26
25: ; preds = %21
store i8* null, i8** %1
store i8* null, i8** %2
br label %128
26: ; preds = %21, %119
%27 = phi i32 [ %112, %119 ], [ 0, %21 ]
%28 = phi i32 [ %110, %119 ], [ 0, %21 ]
%29 = phi i8* [ %120, %119 ], [ %23, %21 ]
br label %30
30: ; preds = %26, %47
%31 = phi i32 [ %28, %26 ], [ 0, %47 ]
%32 = phi i8* [ %29, %26 ], [ %49, %47 ]
br label %33
33: ; preds = %30, %54
%34 = phi i8* [ %32, %30 ], [ %56, %54 ]
%35 = call i64 @strncmp(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 2)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @free(i8* %34)
br label %122
39: ; preds = %33
%40 = call i32 @strlen(i8* %34)
%41 = icmp slt i32 %40, 4
br i1 %41, label %47, label %42
42: ; preds = %39
%43 = load i8, i8* %34
%44 = sext i8 %43 to i32
%45 = call i64 @isspace(i32 %44)
%46 = icmp eq i64 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %42, %39
%48 = call i32 @free(i8* %34)
%49 = call i8* @get_line(i32* %0)
%50 = icmp eq i8* %49, null
br i1 %50, label %122, label %30
51: ; preds = %42
%52 = load i8, i8* %34
%53 = icmp eq i8 %52, 35
br i1 %53, label %54, label %58
54: ; preds = %51
%55 = call i32 @free(i8* %34)
%56 = call i8* @get_line(i32* %0)
%57 = icmp eq i8* %56, null
br i1 %57, label %122, label %33
58: ; preds = %51
%59 = add nuw nsw i32 %40, 1
%60 = call i64 @vrna_alloc(i32 %59)
%61 = inttoptr i64 %60 to i8*
%62 = call i32 @sscanf(i8* %34, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %5, i8* %61)
%63 = call i32 @strlen(i8* %61)
%64 = icmp sgt i32 %63, 0
br i1 %64, label %65, label %78
65: ; preds = %58, %71
%66 = phi i64 [ %74, %71 ], [ 0, %58 ]
%67 = getelementptr inbounds i8, i8* %61, i64 %66
%68 = load i8, i8* %67
%69 = icmp eq i8 %68, 46
br i1 %69, label %70, label %71
70: ; preds = %65
store i8 45, i8* %67
br label %71
71: ; preds = %70, %65
%72 = phi i8 [ 45, %70 ], [ %68, %65 ]
%73 = call signext i8 @toupper(i8 signext %72)
store i8 %73, i8* %67
%74 = add nuw nsw i64 %66, 1
%75 = call i32 @strlen(i8* %61)
%76 = sext i32 %75 to i64
%77 = icmp slt i64 %74, %76
br i1 %77, label %65, label %78
78: ; preds = %71, %58
%79 = icmp eq i32 %31, %27
br i1 %79, label %80, label %86
80: ; preds = %78
%81 = call i8* @strdup(i8* %5)
%82 = sext i32 %27 to i64
%83 = getelementptr inbounds i8*, i8** %2, i64 %82
store i8* %81, i8** %83
%84 = call i8* @strdup(i8* %61)
%85 = getelementptr inbounds i8*, i8** %1, i64 %82
store i8* %84, i8** %85
br label %109
86: ; preds = %78
%87 = sext i32 %31 to i64
%88 = getelementptr inbounds i8*, i8** %2, i64 %87
%89 = load i8*, i8** %88
%90 = call i64 @strcmp(i8* %5, i8* %89)
%91 = icmp eq i64 %90, 0
br i1 %91, label %98, label %92
92: ; preds = %86
%93 = inttoptr i64 %60 to i8*
%94 = load i32, i32* @stderr
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%96 = call i32 @free(i8* %34)
%97 = call i32 @free(i8* %93)
br label %153
98: ; preds = %86
%99 = getelementptr inbounds i8*, i8** %1, i64 %87
%100 = load i8*, i8** %99
%101 = call i32 @strlen(i8* %61)
%102 = load i8*, i8** %99
%103 = call i32 @strlen(i8* %102)
%104 = add i32 %101, 1
%105 = add i32 %104, %103
%106 = call i64 @vrna_realloc(i8* %100, i32 %105)
%107 = inttoptr i64 %106 to i8*
store i8* %107, i8** %99
%108 = call i32 @strcat(i8* %107, i8* %61)
br label %109
109: ; preds = %98, %80
%110 = add nsw i32 %31, 1
%111 = icmp slt i32 %31, %27
%112 = select i1 %111, i32 %27, i32 %110
%113 = call i32 @free(i8* %61)
%114 = call i32 @free(i8* %34)
%115 = icmp sgt i32 %112, 499
br i1 %115, label %116, label %119
116: ; preds = %109
%117 = load i32, i32* @stderr
%118 = call i32 (i32, i8*, ...) @fprintf(i32 %117, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
br label %153
119: ; preds = %109
%120 = call i8* @get_line(i32* %0)
%121 = icmp eq i8* %120, null
br i1 %121, label %122, label %26
122: ; preds = %119, %47, %54, %37
%123 = phi i32 [ %27, %37 ], [ %27, %54 ], [ %27, %47 ], [ %112, %119 ]
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds i8*, i8** %1, i64 %124
store i8* null, i8** %125
%126 = getelementptr inbounds i8*, i8** %2, i64 %124
store i8* null, i8** %126
%127 = icmp eq i32 %123, 0
br i1 %127, label %128, label %131
128: ; preds = %25, %122
%129 = load i32, i32* @stderr
%130 = call i32 (i32, i8*, ...) @fprintf(i32 %129, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0))
br label %153
131: ; preds = %122
%132 = load i8*, i8** %1
%133 = call i32 @strlen(i8* %132)
%134 = icmp sgt i32 %123, 1
br i1 %134, label %135, label %149
135: ; preds = %131
%136 = zext i32 %123 to i64
br label %137
137: ; preds = %135, %146
%138 = phi i64 [ 1, %135 ], [ %147, %146 ]
%139 = getelementptr inbounds i8*, i8** %1, i64 %138
%140 = load i8*, i8** %139
%141 = call i32 @strlen(i8* %140)
%142 = icmp eq i32 %141, %133
br i1 %142, label %146, label %143
143: ; preds = %137
%144 = load i32, i32* @stderr
%145 = call i32 (i32, i8*, ...) @fprintf(i32 %144, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
br label %153
146: ; preds = %137
%147 = add nuw nsw i64 %138, 1
%148 = icmp eq i64 %147, %136
br i1 %148, label %149, label %137
149: ; preds = %146, %131
%150 = phi i32 [ 1, %131 ], [ %123, %146 ]
%151 = load i32, i32* @stderr
%152 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.10, i64 0, i64 0), i32 %150, i32 %133)
br label %153
153: ; preds = %149, %143, %128, %116, %92, %17, %8
%154 = phi i32 [ 0, %8 ], [ 0, %128 ], [ 0, %143 ], [ %123, %149 ], [ 0, %116 ], [ 0, %92 ], [ 0, %17 ]
ret i32 %154
}