#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 */
scalar_t__ equal(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fail_test(int);
int /*<<< orphan*/ load(char *);
void test_eq() {
  if (equal(load("empty_r1"), "empty_r2"))
    fail_test(195);
  ;
  if (!equal(load("empty_r1"), "empty_r1"))
    fail_test(197);
  ;
  if (!equal(load("empty_r2"), "empty_r2"))
    fail_test(199);
  ;
  if (!equal(load("equal_r1"), "equal_r1"))
    fail_test(201);
  ;
  if (equal(load("equal_r1"), "equal_r2"))
    fail_test(203);
  ;
  if (!equal(load("equal_r1"), "equal_r3"))
    fail_test(205);
  ;
  if (equal(load("equal_r2"), "equal_r3"))
    fail_test(207);
  ;
}


x86 assembly (clang, -O0):
<test_eq>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <load@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
call   1040 <equal@plt>
cmp    $0x0,%rax
je     1162 <test_eq+0x32>
mov    $0xc3,%edi
call   1030 <fail_test@plt>
lea    0xe97(%rip),%rdi
call   1050 <load@plt>
mov    %eax,%edi
lea    0xe89(%rip),%rsi
call   1040 <equal@plt>
cmp    $0x0,%rax
jne    1190 <test_eq+0x60>
mov    $0xc5,%edi
call   1030 <fail_test@plt>
lea    0xe72(%rip),%rdi
call   1050 <load@plt>
mov    %eax,%edi
lea    0xe64(%rip),%rsi
call   1040 <equal@plt>
cmp    $0x0,%rax
jne    11be <test_eq+0x8e>
mov    $0xc7,%edi
call   1030 <fail_test@plt>
lea    0xe4d(%rip),%rdi
call   1050 <load@plt>
mov    %eax,%edi
lea    0xe3f(%rip),%rsi
call   1040 <equal@plt>
cmp    $0x0,%rax
jne    11ec <test_eq+0xbc>
mov    $0xc9,%edi
call   1030 <fail_test@plt>
lea    0xe1f(%rip),%rdi
call   1050 <load@plt>
mov    %eax,%edi
lea    0xe1a(%rip),%rsi
call   1040 <equal@plt>
cmp    $0x0,%rax
je     121a <test_eq+0xea>
mov    $0xcb,%edi
call   1030 <fail_test@plt>
lea    0xdf1(%rip),%rdi
call   1050 <load@plt>
mov    %eax,%edi
lea    0xdf5(%rip),%rsi
call   1040 <equal@plt>
cmp    $0x0,%rax
jne    1248 <test_eq+0x118>
mov    $0xcd,%edi
call   1030 <fail_test@plt>
lea    0xdcc(%rip),%rdi
call   1050 <load@plt>
mov    %eax,%edi
lea    0xdc7(%rip),%rsi
call   1040 <equal@plt>
cmp    $0x0,%rax
je     1276 <test_eq+0x146>
mov    $0xcf,%edi
call   1030 <fail_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_eq>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <load@plt>
lea    0xec5(%rip),%rsi
mov    %eax,%edi
call   1040 <equal@plt>
test   %rax,%rax
je     115a <test_eq+0x2a>
mov    $0xc3,%edi
call   1030 <fail_test@plt>
lea    0xe9f(%rip),%rbx
mov    %rbx,%rdi
call   1050 <load@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <equal@plt>
test   %rax,%rax
jne    1182 <test_eq+0x52>
mov    $0xc5,%edi
call   1030 <fail_test@plt>
lea    0xe80(%rip),%rbx
mov    %rbx,%rdi
call   1050 <load@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <equal@plt>
test   %rax,%rax
jne    11aa <test_eq+0x7a>
mov    $0xc7,%edi
call   1030 <fail_test@plt>
lea    0xe61(%rip),%rbx
mov    %rbx,%rdi
call   1050 <load@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <equal@plt>
test   %rax,%rax
jne    11d2 <test_eq+0xa2>
mov    $0xc9,%edi
call   1030 <fail_test@plt>
lea    0xe39(%rip),%rdi
call   1050 <load@plt>
lea    0xe36(%rip),%rsi
mov    %eax,%edi
call   1040 <equal@plt>
test   %rax,%rax
je     11fb <test_eq+0xcb>
mov    $0xcb,%edi
call   1030 <fail_test@plt>
lea    0xe10(%rip),%rdi
call   1050 <load@plt>
lea    0xe16(%rip),%rsi
mov    %eax,%edi
call   1040 <equal@plt>
test   %rax,%rax
jne    1224 <test_eq+0xf4>
mov    $0xcd,%edi
call   1030 <fail_test@plt>
lea    0xdf0(%rip),%rdi
call   1050 <load@plt>
lea    0xded(%rip),%rsi
mov    %eax,%edi
call   1040 <equal@plt>
test   %rax,%rax
je     124e <test_eq+0x11e>
mov    $0xcf,%edi
pop    %rbx
jmp    1030 <fail_test@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"empty_r1\00"
@.str.1 = [9 x i8] c"empty_r2\00"
@.str.2 = [9 x i8] c"equal_r1\00"
@.str.3 = [9 x i8] c"equal_r2\00"
@.str.4 = [9 x i8] c"equal_r3\00"
define void @test_eq() {
%1 = call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i64 @equal(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @fail_test(i32 195)
br label %6
6: ; preds = %4, %0
%7 = call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i64 @equal(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = call i32 @fail_test(i32 197)
br label %12
12: ; preds = %10, %6
%13 = call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%14 = call i64 @equal(i32 %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = call i32 @fail_test(i32 199)
br label %18
18: ; preds = %16, %12
%19 = call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%20 = call i64 @equal(i32 %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp ne i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %18
%23 = call i32 @fail_test(i32 201)
br label %24
24: ; preds = %22, %18
%25 = call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%26 = call i64 @equal(i32 %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = call i32 @fail_test(i32 203)
br label %30
30: ; preds = %28, %24
%31 = call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%32 = call i64 @equal(i32 %31, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%33 = icmp ne i64 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %30
%35 = call i32 @fail_test(i32 205)
br label %36
36: ; preds = %34, %30
%37 = call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%38 = call i64 @equal(i32 %37, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 @fail_test(i32 207)
br label %42
42: ; preds = %40, %36
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"empty_r1\00"
@.str.1 = [9 x i8] c"empty_r2\00"
@.str.2 = [9 x i8] c"equal_r1\00"
@.str.3 = [9 x i8] c"equal_r2\00"
@.str.4 = [9 x i8] c"equal_r3\00"
define void @test_eq() {
%1 = tail call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i64 @equal(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @fail_test(i32 195)
br label %6
6: ; preds = %4, %0
%7 = tail call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = tail call i64 @equal(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = tail call i32 @fail_test(i32 197)
br label %12
12: ; preds = %10, %6
%13 = tail call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i64 @equal(i32 %13, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = tail call i32 @fail_test(i32 199)
br label %18
18: ; preds = %16, %12
%19 = tail call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%20 = tail call i64 @equal(i32 %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = tail call i32 @fail_test(i32 201)
br label %24
24: ; preds = %22, %18
%25 = tail call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%26 = tail call i64 @equal(i32 %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 @fail_test(i32 203)
br label %30
30: ; preds = %28, %24
%31 = tail call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%32 = tail call i64 @equal(i32 %31, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %36
34: ; preds = %30
%35 = tail call i32 @fail_test(i32 205)
br label %36
36: ; preds = %34, %30
%37 = tail call i32 @load(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%38 = tail call i64 @equal(i32 %37, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %36
%41 = tail call i32 @fail_test(i32 207)
br label %42
42: ; preds = %40, %36
ret void
}