#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 */
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int strlen(char *);
void read_obs_seq_from_file(FILE *fp, int *num_seqs_ptr, char ***obs_seqs_ptr) {
  int i, j;
  char mystring[100];
  *num_seqs_ptr = 1;
  *obs_seqs_ptr = (char **)malloc(*num_seqs_ptr * sizeof(int));
  char **obs_seqs = *obs_seqs_ptr;
  i = 0;
  j = 0;
  while (fgets(mystring, sizeof mystring, fp)) {
    if (mystring[0] == '>') {
    } else {
      i += (strlen(mystring) - 1);
    }
  }
  rewind(fp);
  obs_seqs[0] = (char *)malloc(i * sizeof(char) + 1);
  while (fgets(mystring, sizeof mystring, fp)) {
    if (mystring[0] == '>') {
    } else {
      memcpy(obs_seqs[0] + j, mystring, strlen(mystring) - 1);
      j += (strlen(mystring) - 1);
    }
  }
}


x86 assembly (clang, -O0):
<read_obs_seq_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
movslq (%rax),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x98(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x64,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     11f7 <read_obs_seq_from_file+0xa7>
movsbl -0x90(%rbp),%eax
cmp    $0x3e,%eax
jne    11dd <read_obs_seq_from_file+0x8d>
jmp    11f2 <read_obs_seq_from_file+0xa2>
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    11a9 <read_obs_seq_from_file+0x59>
mov    -0x8(%rbp),%rdi
call   1040 <rewind@plt>
movslq -0x1c(%rbp),%rax
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,%rcx
mov    -0x98(%rbp),%rax
mov    %rcx,(%rax)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x64,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     12b8 <read_obs_seq_from_file+0x168>
movsbl -0x90(%rbp),%eax
cmp    $0x3e,%eax
jne    1254 <read_obs_seq_from_file+0x104>
jmp    12b3 <read_obs_seq_from_file+0x163>
mov    -0x98(%rbp),%rax
mov    (%rax),%rax
movslq -0x20(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0xa8(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0xa8(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
mov    %eax,%edx
sub    $0x1,%edx
call   1060 <memcpy@plt>
lea    -0x90(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1220 <read_obs_seq_from_file+0xd0>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_obs_seq_from_file>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x70,%rsp
mov    %rdx,%rbx
mov    %rdi,%r15
movl   $0x1,(%rsi)
mov    $0x4,%edi
call   1070 <malloc@plt>
mov    %rax,%r14
mov    %rax,(%rbx)
mov    %rsp,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     11ca <read_obs_seq_from_file+0x7a>
mov    %rsp,%r12
jmp    11b5 <read_obs_seq_from_file+0x65>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     11ca <read_obs_seq_from_file+0x7a>
cmpb   $0x3e,(%rsp)
je     11a0 <read_obs_seq_from_file+0x50>
mov    %r12,%rdi
call   1030 <strlen@plt>
add    %eax,%ebx
add    $0xffffffff,%ebx
jmp    11a0 <read_obs_seq_from_file+0x50>
mov    %r15,%rdi
call   1040 <rewind@plt>
add    $0x1,%ebx
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    %rax,(%r14)
mov    %rsp,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     124b <read_obs_seq_from_file+0xfb>
xor    %ebx,%ebx
mov    %rsp,%r12
jmp    1215 <read_obs_seq_from_file+0xc5>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    $0x64,%esi
mov    %r15,%rdx
call   1050 <fgets@plt>
test   %rax,%rax
je     124b <read_obs_seq_from_file+0xfb>
cmpb   $0x3e,(%rsp)
je     1200 <read_obs_seq_from_file+0xb0>
movslq %ebx,%r13
mov    (%r14),%rbx
add    %r13,%rbx
mov    %r12,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%edx
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <memcpy@plt>
mov    %r12,%rdi
call   1030 <strlen@plt>
lea    (%rax,%r13,1),%ebx
add    $0xffffffff,%ebx
jmp    1200 <read_obs_seq_from_file+0xb0>
add    $0x70,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @read_obs_seq_from_file(i32* %0, i32* %1, i8*** %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8***
%7 = alloca i32
%8 = alloca i32
%9 = alloca [100 x i8]
%10 = alloca i8**
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8*** %2, i8**** %6
%11 = load i32*, i32** %5
store i32 1, i32* %11
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 4
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i8**
%19 = load i8***, i8**** %6
store i8** %18, i8*** %19
%20 = load i8***, i8**** %6
%21 = load i8**, i8*** %20
store i8** %21, i8*** %10
store i32 0, i32* %7
store i32 0, i32* %8
br label %22
22: ; preds = %39, %3
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%24 = load i32*, i32** %4
%25 = call i64 @fgets(i8* %23, i32 100, i32* %24)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %40
27: ; preds = %22
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 62
br i1 %31, label %32, label %33
32: ; preds = %27
br label %39
33: ; preds = %27
%34 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
%36 = sub nsw i32 %35, 1
%37 = load i32, i32* %7
%38 = add nsw i32 %37, %36
store i32 %38, i32* %7
br label %39
39: ; preds = %33, %32
br label %22
40: ; preds = %22
%41 = load i32*, i32** %4
%42 = call i32 @rewind(i32* %41)
%43 = load i32, i32* %7
%44 = sext i32 %43 to i64
%45 = mul i64 %44, 1
%46 = add i64 %45, 1
%47 = trunc i64 %46 to i32
%48 = call i64 @malloc(i32 %47)
%49 = inttoptr i64 %48 to i8*
%50 = load i8**, i8*** %10
%51 = getelementptr inbounds i8*, i8** %50, i64 0
store i8* %49, i8** %51
br label %52
52: ; preds = %80, %40
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%54 = load i32*, i32** %4
%55 = call i64 @fgets(i8* %53, i32 100, i32* %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %81
57: ; preds = %52
%58 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 62
br i1 %61, label %62, label %63
62: ; preds = %57
br label %80
63: ; preds = %57
%64 = load i8**, i8*** %10
%65 = getelementptr inbounds i8*, i8** %64, i64 0
%66 = load i8*, i8** %65
%67 = load i32, i32* %8
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
%70 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%71 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%72 = call i32 @strlen(i8* %71)
%73 = sub nsw i32 %72, 1
%74 = call i32 @memcpy(i8* %69, i8* %70, i32 %73)
%75 = getelementptr inbounds [100 x i8], [100 x i8]* %9, i64 0, i64 0
%76 = call i32 @strlen(i8* %75)
%77 = sub nsw i32 %76, 1
%78 = load i32, i32* %8
%79 = add nsw i32 %78, %77
store i32 %79, i32* %8
br label %80
80: ; preds = %63, %62
br label %52
81: ; preds = %52
ret void
}

LLVM IR (-O2):
define void @read_obs_seq_from_file(i32* nocapture %0, i32* nocapture writeonly %1, i8*** nocapture writeonly %2) {
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
store i32 1, i32* %1
%6 = tail call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i8**
store i8** %7, i8*** %2
%8 = call i64 @fgets(i8* %5, i32 100, i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %22, label %10
10: ; preds = %3, %18
%11 = phi i32 [ %19, %18 ], [ 0, %3 ]
%12 = load i8, i8* %5
%13 = icmp eq i8 %12, 62
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = call i32 @strlen(i8* %5)
%16 = add i32 %11, -1
%17 = add i32 %16, %15
br label %18
18: ; preds = %10, %14
%19 = phi i32 [ %11, %10 ], [ %17, %14 ]
%20 = call i64 @fgets(i8* %5, i32 100, i32* %0)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %10
22: ; preds = %18, %3
%23 = phi i32 [ 0, %3 ], [ %19, %18 ]
%24 = call i32 @rewind(i32* %0)
%25 = add i32 %23, 1
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %7
%28 = call i64 @fgets(i8* %5, i32 100, i32* %0)
%29 = icmp eq i64 %28, 0
br i1 %29, label %48, label %30
30: ; preds = %22, %44
%31 = phi i32 [ %45, %44 ], [ 0, %22 ]
%32 = load i8, i8* %5
%33 = icmp eq i8 %32, 62
br i1 %33, label %44, label %34
34: ; preds = %30
%35 = load i8*, i8** %7
%36 = sext i32 %31 to i64
%37 = getelementptr inbounds i8, i8* %35, i64 %36
%38 = call i32 @strlen(i8* %5)
%39 = add nsw i32 %38, -1
%40 = call i32 @memcpy(i8* %37, i8* %5, i32 %39)
%41 = call i32 @strlen(i8* %5)
%42 = add i32 %31, -1
%43 = add i32 %42, %41
br label %44
44: ; preds = %30, %34
%45 = phi i32 [ %31, %30 ], [ %43, %34 ]
%46 = call i64 @fgets(i8* %5, i32 100, i32* %0)
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %30
48: ; preds = %44, %22
ret void
}