#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 */

/* Variables and functions */
int byg_end(char *, char *);
int count_sequences_clustalw(char *string) {
  char *p1 = string;
  int i = 0;
  int j = 0;
  int c = 0;
  int n = 0;
  int f = 0;
  while ((i = byg_end("\n", p1)) != -1) {
    p1 += i;
    j = byg_end(" ", p1);
    f = byg_end("\n", p1);
    if (f > 2 && f > j && j != 1) {
      if (c == 0) {
        i = j;
        while (p1[i] != '\n') {
          i++;
        }
      }
      c++;
    } else {
      if (c) {
        if (c > n) {
          n = c;
        }
        c = 0;
      }
    }
  }
  if (!n) {
    return 0;
  }
  return n;
}


x86 assembly (clang, -O0):
<count_sequences_clustalw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <byg_end@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     122d <count_sequences_clustalw+0x11d>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <byg_end@plt>
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe6e(%rip),%rdi
call   1030 <byg_end@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jle    1200 <count_sequences_clustalw+0xf0>
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1200 <count_sequences_clustalw+0xf0>
cmpl   $0x1,-0x20(%rbp)
je     1200 <count_sequences_clustalw+0xf0>
cmpl   $0x0,-0x24(%rbp)
jne    11f2 <count_sequences_clustalw+0xe2>
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     11ed <count_sequences_clustalw+0xdd>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11ca <count_sequences_clustalw+0xba>
jmp    11f2 <count_sequences_clustalw+0xe2>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1228 <count_sequences_clustalw+0x118>
cmpl   $0x0,-0x24(%rbp)
je     1223 <count_sequences_clustalw+0x113>
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jle    121c <count_sequences_clustalw+0x10c>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
jmp    1228 <count_sequences_clustalw+0x118>
jmp    1147 <count_sequences_clustalw+0x37>
cmpl   $0x0,-0x28(%rbp)
jne    1243 <count_sequences_clustalw+0x133>
movl   $0x0,-0x4(%rbp)
jmp    1249 <count_sequences_clustalw+0x139>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_sequences_clustalw>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xedb(%rip),%rdi
mov    %rbx,%rsi
call   1030 <byg_end@plt>
xor    %r15d,%r15d
cmp    $0xffffffff,%eax
je     11b9 <count_sequences_clustalw+0xa9>
lea    0xec2(%rip),%r14
lea    0xeb9(%rip),%r12
xor    %ebp,%ebp
jmp    116a <count_sequences_clustalw+0x5a>
nopl   0x0(%rax,%rax,1)
xor    %r13d,%r13d
test   %ebp,%ebp
jne    11b0 <count_sequences_clustalw+0xa0>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <byg_end@plt>
mov    %r13d,%ebp
cmp    $0xffffffff,%eax
je     11b9 <count_sequences_clustalw+0xa9>
mov    %rbx,%rcx
movslq %eax,%rbx
add    %rcx,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <byg_end@plt>
mov    %eax,%r13d
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <byg_end@plt>
cmp    $0x3,%eax
jl     1150 <count_sequences_clustalw+0x40>
cmp    $0x1,%r13d
je     1150 <count_sequences_clustalw+0x40>
cmp    %r13d,%eax
jle    1150 <count_sequences_clustalw+0x40>
add    $0x1,%ebp
mov    %ebp,%r13d
jmp    1157 <count_sequences_clustalw+0x47>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    %r15d,%ebp
cmovg  %ebp,%r15d
jmp    1157 <count_sequences_clustalw+0x47>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c" \00"
define i32 @count_sequences_clustalw(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %3
%10 = load i8*, i8** %3
store i8* %10, i8** %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %11
11: ; preds = %64, %1
%12 = load i8*, i8** %4
%13 = call i32 @byg_end(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 %13, i32* %5
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %65
15: ; preds = %11
%16 = load i32, i32* %5
%17 = load i8*, i8** %4
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8* %19, i8** %4
%20 = load i8*, i8** %4
%21 = call i32 @byg_end(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %20)
store i32 %21, i32* %6
%22 = load i8*, i8** %4
%23 = call i32 @byg_end(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %22)
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = icmp sgt i32 %24, 2
br i1 %25, label %26, label %53
26: ; preds = %15
%27 = load i32, i32* %9
%28 = load i32, i32* %6
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %53
30: ; preds = %26
%31 = load i32, i32* %6
%32 = icmp ne i32 %31, 1
br i1 %32, label %33, label %53
33: ; preds = %30
%34 = load i32, i32* %7
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %50
36: ; preds = %33
%37 = load i32, i32* %6
store i32 %37, i32* %5
br label %38
38: ; preds = %46, %36
%39 = load i8*, i8** %4
%40 = load i32, i32* %5
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8, i8* %39, i64 %41
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp ne i32 %44, 10
br i1 %45, label %46, label %49
46: ; preds = %38
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %38
49: ; preds = %38
br label %50
50: ; preds = %49, %33
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %64
53: ; preds = %30, %26, %15
%54 = load i32, i32* %7
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %63
56: ; preds = %53
%57 = load i32, i32* %7
%58 = load i32, i32* %8
%59 = icmp sgt i32 %57, %58
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = load i32, i32* %7
store i32 %61, i32* %8
br label %62
62: ; preds = %60, %56
store i32 0, i32* %7
br label %63
63: ; preds = %62, %53
br label %64
64: ; preds = %63, %50
br label %11
65: ; preds = %11
%66 = load i32, i32* %8
%67 = icmp ne i32 %66, 0
br i1 %67, label %69, label %68
68: ; preds = %65
store i32 0, i32* %2
br label %71
69: ; preds = %65
%70 = load i32, i32* %8
store i32 %70, i32* %2
br label %71
71: ; preds = %69, %68
%72 = load i32, i32* %2
ret i32 %72
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [2 x i8] c" \00"
define i32 @count_sequences_clustalw(i8* %0) {
%2 = tail call i32 @byg_end(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %30, label %4
4: ; preds = %1, %25
%5 = phi i32 [ %28, %25 ], [ %2, %1 ]
%6 = phi i32 [ %27, %25 ], [ 0, %1 ]
%7 = phi i32 [ %26, %25 ], [ 0, %1 ]
%8 = phi i8* [ %10, %25 ], [ %0, %1 ]
%9 = sext i32 %5 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = tail call i32 @byg_end(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = tail call i32 @byg_end(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %10)
%13 = icmp sgt i32 %12, 2
br i1 %13, label %14, label %20
14: ; preds = %4
%15 = icmp sgt i32 %12, %11
%16 = icmp ne i32 %11, 1
%17 = and i1 %16, %15
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = add nsw i32 %7, 1
br label %25
20: ; preds = %14, %4
%21 = icmp eq i32 %7, 0
br i1 %21, label %25, label %22
22: ; preds = %20
%23 = icmp sgt i32 %7, %6
%24 = select i1 %23, i32 %7, i32 %6
br label %25
25: ; preds = %20, %22, %18
%26 = phi i32 [ %19, %18 ], [ 0, %22 ], [ 0, %20 ]
%27 = phi i32 [ %6, %18 ], [ %24, %22 ], [ %6, %20 ]
%28 = tail call i32 @byg_end(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %10)
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %4
30: ; preds = %25, %1
%31 = phi i32 [ 0, %1 ], [ %27, %25 ]
ret i32 %31
}