#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void printMessages(int i, char *s) {
  switch (i) {
  case 0:
    printf("ERROR: Invalid malloc operation\n");
    exit(1);
    break;
  case 1:
    printf("ERROR: Invalid fasta file %s\n", s);
    exit(1);
    break;
  case 2:
    printf("ERROR: 0 number of sequences in line %s\n", s);
    exit(1);
    break;
  case 3:
    printf("ERROR: Invalid fasta file %s. Cannot have both T's and U's\n", s);
    exit(1);
    break;
  case 4:
    printf("ERROR: Could not open file %s\n", s);
    exit(1);
    break;
  case 5:
    printf("ERROR: Not enough information present in FASTA file. Please check "
           "if any sequence contains too many N's\n");
    exit(1);
    break;
  }
}


x86 assembly (clang, -O0):
<printMessages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x5,%rax
ja     11f4 <printMessages+0xd4>
mov    -0x18(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMessages>:
push   %rax
cmp    $0x5,%edi
jbe    1138 <printMessages+0x8>
pop    %rax
ret
mov    %edi,%eax
lea    0xebf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xfd1(%rip),%rdi
jmp    118d <printMessages+0x5d>
lea    0xebe(%rip),%rdi
jmp    1175 <printMessages+0x45>
lea    0xed3(%rip),%rdi
jmp    1175 <printMessages+0x45>
lea    0xef3(%rip),%rdi
jmp    1175 <printMessages+0x45>
lea    0xf26(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xf2d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"ERROR: Invalid malloc operation\0A\00"
@.str.1 = [30 x i8] c"ERROR: Invalid fasta file %s\0A\00"
@.str.2 = [41 x i8] c"ERROR: 0 number of sequences in line %s\0A\00"
@.str.3 = [60 x i8] c"ERROR: Invalid fasta file %s. Cannot have both T's and U's\0A\00"
@.str.4 = [31 x i8] c"ERROR: Could not open file %s\0A\00"
@.str.5 = [105 x i8] c"ERROR: Not enough information present in FASTA file. Please check if any sequence contains too many N's\0A\00"
define void @printMessages(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %28 [
i32 0, label %6
i32 1, label %9
i32 2, label %13
i32 3, label %17
i32 4, label %21
i32 5, label %25
]
6: ; preds = %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = load i8*, i8** %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %2
%22 = load i8*, i8** %4
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %22)
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
28: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"ERROR: Invalid fasta file %s\0A\00"
@.str.2 = [41 x i8] c"ERROR: 0 number of sequences in line %s\0A\00"
@.str.3 = [60 x i8] c"ERROR: Invalid fasta file %s. Cannot have both T's and U's\0A\00"
@.str.4 = [31 x i8] c"ERROR: Could not open file %s\0A\00"
@str = [104 x i8] c"ERROR: Not enough information present in FASTA file. Please check if any sequence contains too many N's\00"
@str.6 = [32 x i8] c"ERROR: Invalid malloc operation\00"
define void @printMessages(i32 %0, i8* %1) {
switch i32 %0, label %21 [
i32 0, label %3
i32 1, label %6
i32 2, label %9
i32 3, label %12
i32 4, label %15
i32 5, label %18
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0), i8* %1)
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %1)
%17 = tail call i32 @exit(i32 1)
unreachable
18: ; preds = %2
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str, i64 0, i64 0))
%20 = tail call i32 @exit(i32 1)
unreachable
21: ; preds = %2
ret void
}