#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(char *, char *);
int test_equal() {
  return !equal("", "abc") && !equal("abc", "") && equal("", "") &&
         equal("abc", "abc") && !equal("abc", "abcd") &&
         !equal("abcd", "abc") && equal("abcd", "abcd");
}


x86 assembly (clang, -O0):
<test_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee4(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1207 <test_equal+0xf7>
lea    0xebc(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1207 <test_equal+0xf7>
lea    0xe9a(%rip),%rsi
mov    %rsi,%rdi
call   1030 <equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1207 <test_equal+0xf7>
lea    0xe76(%rip),%rsi
mov    %rsi,%rdi
call   1030 <equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1207 <test_equal+0xf7>
lea    0xe55(%rip),%rdi
lea    0xe52(%rip),%rsi
call   1030 <equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1207 <test_equal+0xf7>
lea    0xe34(%rip),%rdi
lea    0xe29(%rip),%rsi
call   1030 <equal@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1207 <test_equal+0xf7>
lea    0xe0f(%rip),%rsi
mov    %rsi,%rdi
call   1030 <equal@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_equal>:
push   %rbx
lea    0xeeb(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <equal@plt>
xor    %ebx,%ebx
test   %rax,%rax
jne    1143 <test_equal+0x33>
lea    0xece(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <equal@plt>
test   %rax,%rax
je     1147 <test_equal+0x37>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xeb5(%rip),%rdi
mov    %rdi,%rsi
call   1030 <equal@plt>
test   %rax,%rax
je     1143 <test_equal+0x33>
lea    0xe9e(%rip),%rdi
mov    %rdi,%rsi
call   1030 <equal@plt>
test   %rax,%rax
je     1143 <test_equal+0x33>
lea    0xe8a(%rip),%rdi
lea    0xe87(%rip),%rsi
call   1030 <equal@plt>
test   %rax,%rax
jne    1143 <test_equal+0x33>
lea    0xe76(%rip),%rdi
lea    0xe6b(%rip),%rsi
call   1030 <equal@plt>
test   %rax,%rax
jne    1143 <test_equal+0x33>
lea    0xe5e(%rip),%rdi
mov    %rdi,%rsi
call   1030 <equal@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
jmp    1143 <test_equal+0x33>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [5 x i8] c"abcd\00"
define i32 @test_equal() {
%1 = call i64 @equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %21, label %3
3: ; preds = %0
%4 = call i64 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %21, label %6
6: ; preds = %3
%7 = call i64 @equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = call i64 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = call i64 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = call i64 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = call i64 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
br label %21
21: ; preds = %18, %15, %12, %9, %6, %3, %0
%22 = phi i1 [ false, %15 ], [ false, %12 ], [ false, %9 ], [ false, %6 ], [ false, %3 ], [ false, %0 ], [ %20, %18 ]
%23 = zext i1 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [5 x i8] c"abcd\00"
define i32 @test_equal() {
%1 = tail call i64 @equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %22
3: ; preds = %0
%4 = tail call i64 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %22
6: ; preds = %3
%7 = tail call i64 @equal(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %22, label %9
9: ; preds = %6
%10 = tail call i64 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %22, label %12
12: ; preds = %9
%13 = tail call i64 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = tail call i64 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = tail call i64 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp ne i64 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %18, %15, %12, %9, %6, %3, %0
%23 = phi i32 [ 0, %15 ], [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 0, %3 ], [ 0, %0 ], [ %21, %18 ]
ret i32 %23
}