#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__ EOF;
scalar_t__ calloc(scalar_t__, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int fa2bin(int argc, char *argv[]) {
  fprintf(stderr, "inside fa2bin\n");
  if (argc < 2) {
    fprintf(stderr, "No fasta specified.\n");
    return -1;
  }
  char *prefix = argv[1];
  char *str = (char *)calloc(strlen(prefix) + 10, 1);
  strcpy(str, prefix);
  fprintf(stderr, "fasta file is: %s\n", str);
  FILE *fin = fopen(str, "r");
  strcat(str, ".bin");
  FILE *fbin = fopen(str, "w");
  fprintf(stderr, "output bin is: %s\n", str);
  char c;
  if (fscanf(fin, "%c", &c) == EOF) {
    fprintf(stderr, "empty fasta file\n");
    return -2;
  }
  if (c != '>') {
    fprintf(stderr, "wrong fasta format\n");
    return -3;
  } else
    while (c != '\n' && fscanf(fin, "%c", &c) != EOF)
      ;
  int b = 0;
  int i = 0;
  int j = 0;
  while (fscanf(fin, "%c", &c) != EOF) {
    if (c == '>') {
      while (c != '\n' && fscanf(fin, "%c", &c) != EOF)
        ;
      continue;
    }
    if (c == '\n' || c == '\r')
      continue;
    if (j > 99999999)
      break;
    if (c == 'C' || c == 'c')
      b |= (1 << i);
    if (c == 'G' || c == 'g')
      b |= (2 << i);
    if (c == 'T' || c == 't' || c == 'U' || c == 'u')
      b |= (3 << i);
    i += 2;
    if (i == 8) {
      fputc(b, fbin);
      b = i = 0;
    }
  }
  if (i)
    fputc(b, fbin);
  fclose(fbin);
  fclose(fin);
  return 0;
}


x86 assembly (clang, -O0):
<fa2bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    11e3 <fa2bin+0x53>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
lea    0xe3f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1519 <fa2bin+0x389>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0xa,%rdi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    0x2db7(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xdf6(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
lea    0xdf7(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xde5(%rip),%rsi
call   10b0 <strcat@plt>
mov    -0x20(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xdbf(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xdc0(%rip),%rsi
lea    -0x31(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2d45(%rip),%rcx
cmp    (%rcx),%rax
jne    12cf <fa2bin+0x13f>
mov    0x2d25(%rip),%rax
mov    (%rax),%edi
lea    0xd9a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1519 <fa2bin+0x389>
movsbl -0x31(%rbp),%eax
cmp    $0x3e,%eax
je     12ff <fa2bin+0x16f>
mov    0x2cf5(%rip),%rax
mov    (%rax),%edi
lea    0xd7c(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1519 <fa2bin+0x389>
jmp    1304 <fa2bin+0x174>
movsbl -0x31(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x41(%rbp)
je     133a <fa2bin+0x1aa>
mov    -0x28(%rbp),%rdi
lea    0xd32(%rip),%rsi
lea    -0x31(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2cb7(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
test   $0x1,%al
jne    134a <fa2bin+0x1ba>
jmp    134f <fa2bin+0x1bf>
jmp    1304 <fa2bin+0x174>
jmp    1354 <fa2bin+0x1c4>
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xcdf(%rip),%rsi
lea    -0x31(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2c64(%rip),%rcx
cmp    (%rcx),%rax
je     14ea <fa2bin+0x35a>
movsbl -0x31(%rbp),%eax
cmp    $0x3e,%eax
jne    13ef <fa2bin+0x25f>
jmp    139f <fa2bin+0x20f>
movsbl -0x31(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x42(%rbp)
je     13d5 <fa2bin+0x245>
mov    -0x28(%rbp),%rdi
lea    0xc97(%rip),%rsi
lea    -0x31(%rbp),%rdx
call   1060 <fscanf@plt>
mov    0x2c1c(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
mov    %al,-0x42(%rbp)
mov    -0x42(%rbp),%al
test   $0x1,%al
jne    13e5 <fa2bin+0x255>
jmp    13ea <fa2bin+0x25a>
jmp    139f <fa2bin+0x20f>
jmp    1369 <fa2bin+0x1d9>
movsbl -0x31(%rbp),%eax
cmp    $0xa,%eax
je     1409 <fa2bin+0x279>
movsbl -0x31(%rbp),%eax
cmp    $0xd,%eax
jne    140e <fa2bin+0x27e>
jmp    1369 <fa2bin+0x1d9>
cmpl   $0x5f5e0ff,-0x40(%rbp)
jle    1420 <fa2bin+0x290>
jmp    14ea <fa2bin+0x35a>
movsbl -0x31(%rbp),%eax
cmp    $0x43,%eax
je     143a <fa2bin+0x2aa>
movsbl -0x31(%rbp),%eax
cmp    $0x63,%eax
jne    144a <fa2bin+0x2ba>
mov    -0x3c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x47,%eax
je     1464 <fa2bin+0x2d4>
movsbl -0x31(%rbp),%eax
cmp    $0x67,%eax
jne    1474 <fa2bin+0x2e4>
mov    -0x3c(%rbp),%ecx
mov    $0x2,%eax
shl    %cl,%eax
or     -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
movsbl -0x31(%rbp),%eax
cmp    $0x54,%eax
je     14a8 <fa2bin+0x318>
movsbl -0x31(%rbp),%eax
cmp    $0x74,%eax
je     14a8 <fa2bin+0x318>
movsbl -0x31(%rbp),%eax
cmp    $0x55,%eax
je     14a8 <fa2bin+0x318>
movsbl -0x31(%rbp),%eax
cmp    $0x75,%eax
jne    14b8 <fa2bin+0x328>
mov    -0x3c(%rbp),%ecx
mov    $0x3,%eax
shl    %cl,%eax
or     -0x38(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x3c(%rbp)
cmpl   $0x8,-0x3c(%rbp)
jne    14e5 <fa2bin+0x355>
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1070 <fputc@plt>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
jmp    1369 <fa2bin+0x1d9>
cmpl   $0x0,-0x3c(%rbp)
je     1500 <fa2bin+0x370>
mov    -0x38(%rbp),%edi
mov    -0x30(%rbp),%rsi
call   1070 <fputc@plt>
mov    -0x30(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1040 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa2bin>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2e31(%rip),%r15
mov    (%r15),%edi
lea    0xe4f(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
cmp    $0x1,%ebp
jg     11d8 <fa2bin+0x48>
mov    (%r15),%edi
lea    0xe48(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    13f5 <fa2bin+0x265>
mov    0x8(%rbx),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0xa(%rax),%rdi
mov    $0x1,%esi
call   1080 <calloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    (%r15),%edi
lea    0xe1a(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xe1c(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xe0c(%rip),%rsi
mov    %rbp,%rdi
call   10b0 <strcat@plt>
lea    0xe02(%rip),%rsi
mov    %rbp,%rdi
call   10a0 <fopen@plt>
mov    %rax,%r14
mov    (%r15),%edi
lea    0xdef(%rip),%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
lea    0xdf1(%rip),%rsi
lea    0x3(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <fscanf@plt>
mov    0x2d72(%rip),%r13
cmp    0x0(%r13),%rax
jne    1297 <fa2bin+0x107>
mov    (%r15),%edi
lea    0xdd0(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xfffffffe,%eax
jmp    13f5 <fa2bin+0x265>
cmpb   $0x3e,0x3(%rsp)
jne    1301 <fa2bin+0x171>
lea    0xdae(%rip),%r15
lea    0x3(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%r13),%rax
je     12cb <fa2bin+0x13b>
cmpb   $0xa,0x3(%rsp)
jne    12b0 <fa2bin+0x120>
lea    0xd81(%rip),%rsi
lea    0x3(%rsp),%rdx
mov    %rbx,%rdi
call   1060 <fscanf@plt>
cmp    0x0(%r13),%rax
je     13e3 <fa2bin+0x253>
lea    0xd63(%rip),%r15
lea    0x3(%rsp),%r12
movl   $0x0,0x4(%rsp)
xor    %ebp,%ebp
jmp    1348 <fa2bin+0x1b8>
mov    (%r15),%edi
lea    0xd5d(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0xfffffffd,%eax
jmp    13f5 <fa2bin+0x265>
mov    %ebp,%edi
mov    %r14,%rsi
call   1070 <fputc@plt>
xor    %ebp,%ebp
movl   $0x0,0x4(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%r13),%rax
je     13d2 <fa2bin+0x242>
mov    0x3(%rsp),%al
cmp    $0xa,%al
je     1330 <fa2bin+0x1a0>
cmp    $0xd,%al
je     1330 <fa2bin+0x1a0>
cmp    $0x3e,%al
jne    137d <fa2bin+0x1ed>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1060 <fscanf@plt>
cmp    0x0(%r13),%rax
je     1330 <fa2bin+0x1a0>
cmpb   $0xa,0x3(%rsp)
jne    1360 <fa2bin+0x1d0>
jmp    1330 <fa2bin+0x1a0>
mov    %eax,%edx
mov    $0x1,%esi
mov    0x4(%rsp),%ecx
shl    %cl,%esi
and    $0xdf,%dl
cmp    $0x43,%dl
mov    $0x0,%r8d
cmovne %r8d,%esi
mov    $0x2,%edi
shl    %cl,%edi
or     %ebp,%esi
cmp    $0x47,%dl
cmovne %r8d,%edi
mov    $0x3,%ebp
shl    %cl,%ebp
and    $0xde,%al
cmp    $0x54,%al
cmovne %r8d,%ebp
or     %edi,%ebp
or     %esi,%ebp
add    $0x2,%ecx
cmp    $0x8,%ecx
je     131c <fa2bin+0x18c>
mov    %ecx,0x4(%rsp)
jmp    1330 <fa2bin+0x1a0>
cmpl   $0x0,0x4(%rsp)
je     13e3 <fa2bin+0x253>
mov    %ebp,%edi
mov    %r14,%rsi
call   1070 <fputc@plt>
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"inside fa2bin\0A\00"
@.str.1 = [21 x i8] c"No fasta specified.\0A\00"
@.str.2 = [19 x i8] c"fasta file is: %s\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [5 x i8] c".bin\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [19 x i8] c"output bin is: %s\0A\00"
@.str.7 = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.8 = [18 x i8] c"empty fasta file\0A\00"
@.str.9 = [20 x i8] c"wrong fasta format\0A\00"
define i32 @fa2bin(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* @stderr
%15 = call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %4
%17 = icmp slt i32 %16, 2
br i1 %17, label %18, label %21
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %3
br label %179
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
store i8* %24, i8** %6
%25 = load i8*, i8** %6
%26 = call i64 @strlen(i8* %25)
%27 = add nsw i64 %26, 10
%28 = call i64 @calloc(i64 %27, i32 1)
%29 = inttoptr i64 %28 to i8*
store i8* %29, i8** %7
%30 = load i8*, i8** %7
%31 = load i8*, i8** %6
%32 = call i32 @strcpy(i8* %30, i8* %31)
%33 = load i32, i32* @stderr
%34 = load i8*, i8** %7
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %33, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %34)
%36 = load i8*, i8** %7
%37 = call i32* @fopen(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %37, i32** %8
%38 = load i8*, i8** %7
%39 = call i32 @strcat(i8* %38, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%40 = load i8*, i8** %7
%41 = call i32* @fopen(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %41, i32** %9
%42 = load i32, i32* @stderr
%43 = load i8*, i8** %7
%44 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %43)
%45 = load i32*, i32** %8
%46 = call i64 @fscanf(i32* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %10)
%47 = load i64, i64* @EOF
%48 = icmp eq i64 %46, %47
br i1 %48, label %49, label %52
49: ; preds = %21
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
store i32 -2, i32* %3
br label %179
52: ; preds = %21
%53 = load i8, i8* %10
%54 = sext i8 %53 to i32
%55 = icmp ne i32 %54, 62
br i1 %55, label %56, label %59
56: ; preds = %52
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
store i32 -3, i32* %3
br label %179
59: ; preds = %52
br label %60
60: ; preds = %71, %59
%61 = load i8, i8* %10
%62 = sext i8 %61 to i32
%63 = icmp ne i32 %62, 10
br i1 %63, label %64, label %69
64: ; preds = %60
%65 = load i32*, i32** %8
%66 = call i64 @fscanf(i32* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %10)
%67 = load i64, i64* @EOF
%68 = icmp ne i64 %66, %67
br label %69
69: ; preds = %64, %60
%70 = phi i1 [ false, %60 ], [ %68, %64 ]
br i1 %70, label %71, label %72
71: ; preds = %69
br label %60
72: ; preds = %69
br label %73
73: ; preds = %72
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
br label %74
74: ; preds = %166, %105, %96, %73
%75 = load i32*, i32** %8
%76 = call i64 @fscanf(i32* %75, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %10)
%77 = load i64, i64* @EOF
%78 = icmp ne i64 %76, %77
br i1 %78, label %79, label %167
79: ; preds = %74
%80 = load i8, i8* %10
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 62
br i1 %82, label %83, label %97
83: ; preds = %79
br label %84
84: ; preds = %95, %83
%85 = load i8, i8* %10
%86 = sext i8 %85 to i32
%87 = icmp ne i32 %86, 10
br i1 %87, label %88, label %93
88: ; preds = %84
%89 = load i32*, i32** %8
%90 = call i64 @fscanf(i32* %89, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %10)
%91 = load i64, i64* @EOF
%92 = icmp ne i64 %90, %91
br label %93
93: ; preds = %88, %84
%94 = phi i1 [ false, %84 ], [ %92, %88 ]
br i1 %94, label %95, label %96
95: ; preds = %93
br label %84
96: ; preds = %93
br label %74
97: ; preds = %79
%98 = load i8, i8* %10
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 10
br i1 %100, label %105, label %101
101: ; preds = %97
%102 = load i8, i8* %10
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 13
br i1 %104, label %105, label %106
105: ; preds = %101, %97
br label %74
106: ; preds = %101
%107 = load i32, i32* %13
%108 = icmp sgt i32 %107, 99999999
br i1 %108, label %109, label %110
109: ; preds = %106
br label %167
110: ; preds = %106
%111 = load i8, i8* %10
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 67
br i1 %113, label %118, label %114
114: ; preds = %110
%115 = load i8, i8* %10
%116 = sext i8 %115 to i32
%117 = icmp eq i32 %116, 99
br i1 %117, label %118, label %123
118: ; preds = %114, %110
%119 = load i32, i32* %12
%120 = shl i32 1, %119
%121 = load i32, i32* %11
%122 = or i32 %121, %120
store i32 %122, i32* %11
br label %123
123: ; preds = %118, %114
%124 = load i8, i8* %10
%125 = sext i8 %124 to i32
%126 = icmp eq i32 %125, 71
br i1 %126, label %131, label %127
127: ; preds = %123
%128 = load i8, i8* %10
%129 = sext i8 %128 to i32
%130 = icmp eq i32 %129, 103
br i1 %130, label %131, label %136
131: ; preds = %127, %123
%132 = load i32, i32* %12
%133 = shl i32 2, %132
%134 = load i32, i32* %11
%135 = or i32 %134, %133
store i32 %135, i32* %11
br label %136
136: ; preds = %131, %127
%137 = load i8, i8* %10
%138 = sext i8 %137 to i32
%139 = icmp eq i32 %138, 84
br i1 %139, label %152, label %140
140: ; preds = %136
%141 = load i8, i8* %10
%142 = sext i8 %141 to i32
%143 = icmp eq i32 %142, 116
br i1 %143, label %152, label %144
144: ; preds = %140
%145 = load i8, i8* %10
%146 = sext i8 %145 to i32
%147 = icmp eq i32 %146, 85
br i1 %147, label %152, label %148
148: ; preds = %144
%149 = load i8, i8* %10
%150 = sext i8 %149 to i32
%151 = icmp eq i32 %150, 117
br i1 %151, label %152, label %157
152: ; preds = %148, %144, %140, %136
%153 = load i32, i32* %12
%154 = shl i32 3, %153
%155 = load i32, i32* %11
%156 = or i32 %155, %154
store i32 %156, i32* %11
br label %157
157: ; preds = %152, %148
%158 = load i32, i32* %12
%159 = add nsw i32 %158, 2
store i32 %159, i32* %12
%160 = load i32, i32* %12
%161 = icmp eq i32 %160, 8
br i1 %161, label %162, label %166
162: ; preds = %157
%163 = load i32, i32* %11
%164 = load i32*, i32** %9
%165 = call i32 @fputc(i32 %163, i32* %164)
store i32 0, i32* %12
store i32 0, i32* %11
br label %166
166: ; preds = %162, %157
br label %74
167: ; preds = %109, %74
%168 = load i32, i32* %12
%169 = icmp ne i32 %168, 0
br i1 %169, label %170, label %174
170: ; preds = %167
%171 = load i32, i32* %11
%172 = load i32*, i32** %9
%173 = call i32 @fputc(i32 %171, i32* %172)
br label %174
174: ; preds = %170, %167
%175 = load i32*, i32** %9
%176 = call i32 @fclose(i32* %175)
%177 = load i32*, i32** %8
%178 = call i32 @fclose(i32* %177)
store i32 0, i32* %3
br label %179
179: ; preds = %174, %56, %49, %18
%180 = load i32, i32* %3
ret i32 %180
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"inside fa2bin\0A\00"
@.str.1 = [21 x i8] c"No fasta specified.\0A\00"
@.str.2 = [19 x i8] c"fasta file is: %s\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [5 x i8] c".bin\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [19 x i8] c"output bin is: %s\0A\00"
@.str.7 = [3 x i8] c"%c\00"
@EOF = global i64 0
@.str.8 = [18 x i8] c"empty fasta file\0A\00"
@.str.9 = [20 x i8] c"wrong fasta format\0A\00"
define i32 @fa2bin(i32 %0, i8** nocapture %1) {
%3 = alloca i8
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = icmp slt i32 %0, 2
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %100
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i64 @strlen(i8* dereferenceable(1) %12)
%14 = add nsw i64 %13, 10
%15 = tail call i64 @calloc(i64 %14, i32 1)
%16 = inttoptr i64 %15 to i8*
%17 = tail call i32 @strcpy(i8* %16, i8* %12)
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%20 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = tail call i32 @strcat(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%22 = tail call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%23 = load i32, i32* @stderr
%24 = tail call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %16)
%25 = call i64 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%26 = load i64, i64* @EOF
%27 = icmp eq i64 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %10
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
br label %98
31: ; preds = %10
%32 = load i8, i8* %3
%33 = icmp eq i8 %32, 62
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = load i32, i32* @stderr
%36 = call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
br label %98
37: ; preds = %31, %37
%38 = call i64 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%39 = load i64, i64* @EOF
%40 = icmp ne i64 %38, %39
%41 = load i8, i8* %3
%42 = icmp ne i8 %41, 10
%43 = select i1 %40, i1 %42, i1 false
br i1 %43, label %37, label %44
44: ; preds = %37
%45 = call i64 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%46 = load i64, i64* @EOF
%47 = icmp eq i64 %45, %46
br i1 %47, label %95, label %48
48: ; preds = %44, %83
%49 = phi i32 [ %85, %83 ], [ 0, %44 ]
%50 = phi i32 [ %84, %83 ], [ 0, %44 ]
br label %51
51: ; preds = %48, %53
%52 = load i8, i8* %3
switch i8 %52, label %64 [
i8 62, label %57
i8 13, label %53
i8 10, label %53
]
53: ; preds = %57, %51, %51
%54 = call i64 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%55 = load i64, i64* @EOF
%56 = icmp eq i64 %54, %55
br i1 %56, label %89, label %51
57: ; preds = %51, %57
%58 = call i64 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%59 = load i64, i64* @EOF
%60 = icmp ne i64 %58, %59
%61 = load i8, i8* %3
%62 = icmp ne i8 %61, 10
%63 = select i1 %60, i1 %62, i1 false
br i1 %63, label %57, label %53
64: ; preds = %51
%65 = and i8 %52, -33
%66 = icmp eq i8 %65, 67
%67 = shl nuw i32 1, %49
%68 = select i1 %66, i32 %67, i32 0
%69 = or i32 %68, %50
%70 = icmp eq i8 %65, 71
%71 = shl i32 2, %49
%72 = select i1 %70, i32 %71, i32 0
%73 = or i32 %69, %72
%74 = and i8 %52, -34
%75 = icmp eq i8 %74, 84
%76 = shl i32 3, %49
%77 = select i1 %75, i32 %76, i32 0
%78 = or i32 %73, %77
%79 = add nsw i32 %49, 2
%80 = icmp eq i32 %79, 8
br i1 %80, label %81, label %83
81: ; preds = %64
%82 = call i32 @fputc(i32 %78, i32* %22)
br label %83
83: ; preds = %81, %64
%84 = phi i32 [ 0, %81 ], [ %78, %64 ]
%85 = phi i32 [ 0, %81 ], [ %79, %64 ]
%86 = call i64 @fscanf(i32* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%87 = load i64, i64* @EOF
%88 = icmp eq i64 %86, %87
br i1 %88, label %89, label %48
89: ; preds = %83, %53
%90 = phi i32 [ %50, %53 ], [ %84, %83 ]
%91 = phi i32 [ %49, %53 ], [ %85, %83 ]
%92 = icmp eq i32 %91, 0
br i1 %92, label %95, label %93
93: ; preds = %89
%94 = call i32 @fputc(i32 %90, i32* %22)
br label %95
95: ; preds = %44, %93, %89
%96 = call i32 @fclose(i32* %22)
%97 = call i32 @fclose(i32* %20)
br label %98
98: ; preds = %95, %34, %28
%99 = phi i32 [ -2, %28 ], [ -3, %34 ], [ 0, %95 ]
br label %100
100: ; preds = %98, %7
%101 = phi i32 [ -1, %7 ], [ %99, %98 ]
ret i32 %101
}