#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*/ abort();
scalar_t__ is_dna(char *);
scalar_t__ is_protein(char *);
scalar_t__ is_rna(char *);
char *mem_get(int);
char *seq_guess_type(char *seq) {
  char *type;
  type = mem_get(8);
  if (is_dna(seq)) {
    type = "DNA";
  } else if (is_rna(seq)) {
    type = "RNA";
  } else if (is_protein(seq)) {
    type = "PROTEIN";
  } else {
    abort();
  }
  return type;
}


x86 assembly (clang, -O0):
<seq_guess_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <mem_get@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <is_dna@plt>
cmp    $0x0,%rax
je     118d <seq_guess_type+0x3d>
lea    0xe7c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11e4 <seq_guess_type+0x94>
mov    -0x8(%rbp),%rdi
call   1070 <is_rna@plt>
cmp    $0x0,%rax
je     11b0 <seq_guess_type+0x60>
lea    0xe5d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11df <seq_guess_type+0x8f>
mov    -0x8(%rbp),%rdi
call   1050 <is_protein@plt>
cmp    $0x0,%rax
je     11d3 <seq_guess_type+0x83>
lea    0xe3e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11da <seq_guess_type+0x8a>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11df <seq_guess_type+0x8f>
jmp    11e4 <seq_guess_type+0x94>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_guess_type>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1040 <mem_get@plt>
mov    %rbx,%rdi
call   1060 <is_dna@plt>
test   %rax,%rax
je     1174 <seq_guess_type+0x24>
lea    0xe8e(%rip),%rax
pop    %rbx
ret
mov    %rbx,%rdi
call   1070 <is_rna@plt>
test   %rax,%rax
je     118a <seq_guess_type+0x3a>
lea    0xe7c(%rip),%rax
pop    %rbx
ret
mov    %rbx,%rdi
call   1050 <is_protein@plt>
test   %rax,%rax
je     11a0 <seq_guess_type+0x50>
lea    0xe6a(%rip),%rax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"DNA\00"
@.str.1 = [4 x i8] c"RNA\00"
@.str.2 = [8 x i8] c"PROTEIN\00"
define i8* @seq_guess_type(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @mem_get(i32 8)
store i8* %4, i8** %3
%5 = load i8*, i8** %2
%6 = call i64 @is_dna(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %3
br label %23
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i64 @is_rna(i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %22
14: ; preds = %9
%15 = load i8*, i8** %2
%16 = call i64 @is_protein(i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %21
19: ; preds = %14
%20 = call i32 (...) @abort()
unreachable
21: ; preds = %18
br label %22
22: ; preds = %21, %13
br label %23
23: ; preds = %22, %8
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
@.str = [4 x i8] c"DNA\00"
@.str.1 = [4 x i8] c"RNA\00"
@.str.2 = [8 x i8] c"PROTEIN\00"
define i8* @seq_guess_type(i8* %0) {
%2 = tail call i8* @mem_get(i32 8)
%3 = tail call i64 @is_dna(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = tail call i64 @is_rna(i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = tail call i64 @is_protein(i8* %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 (...) @abort()
unreachable
13: ; preds = %8, %5, %1
%14 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %8 ]
ret i8* %14
}