#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: Unequal number of sequences in file %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;
  }
}


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    $0x4,%rax
ja     11dc <printMessages+0xbc>
mov    -0x18(%rbp),%rax
lea    0xeb5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xef3(%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    $0x4,%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    0xf6b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xead(%rip),%rdi
jmp    1182 <printMessages+0x52>
lea    0xec2(%rip),%rdi
jmp    1182 <printMessages+0x52>
lea    0xee8(%rip),%rdi
jmp    1182 <printMessages+0x52>
lea    0xf1b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@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 = [47 x i8] c"ERROR: Unequal number of sequences in file %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"
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 %25 [
i32 0, label %6
i32 1, label %9
i32 2, label %13
i32 3, label %17
i32 4, label %21
]
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 ([47 x i8], [47 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
ret void
}

LLVM IR (-O2):
@.str.1 = [30 x i8] c"ERROR: Invalid fasta file %s\0A\00"
@.str.2 = [47 x i8] c"ERROR: Unequal number of sequences in file %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 = [32 x i8] c"ERROR: Invalid malloc operation\00"
define void @printMessages(i32 %0, i8* %1) {
switch i32 %0, label %18 [
i32 0, label %3
i32 1, label %6
i32 2, label %9
i32 3, label %12
i32 4, label %15
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, 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 ([47 x i8], [47 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
ret void
}