#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 compute(char *, char *);
int /*<<< orphan*/ printf(char *);
int main() {
  if (compute("", "AAGC") != 0) {
    printf("Test failed");
  }
  if (compute("AGA", "AGC") != 1) {
    printf("Test failed");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xede(%rip),%rdi
lea    0xec3(%rip),%rsi
call   1040 <compute@plt>
cmp    $0x0,%eax
je     1157 <main+0x37>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0xe9c(%rip),%rsi
call   1040 <compute@plt>
cmp    $0x1,%eax
je     117f <main+0x5f>
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <compute@plt>
test   %eax,%eax
je     1144 <main+0x24>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1040 <compute@plt>
cmp    $0x1,%eax
je     1168 <main+0x48>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"AAGC\00"
@.str.2 = [12 x i8] c"Test failed\00"
@.str.3 = [4 x i8] c"AGA\00"
@.str.4 = [4 x i8] c"AGC\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @compute(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = call i32 @compute(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [5 x i8] c"AAGC\00"
@.str.2 = [12 x i8] c"Test failed\00"
@.str.3 = [4 x i8] c"AGA\00"
@.str.4 = [4 x i8] c"AGC\00"
define i32 @main() {
%1 = tail call i32 @compute(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i32 @compute(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret i32 0
}