#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*/ printf(char *, char *, ...);
void assert_equal_pointers(void *x, void *y, char *func_name, char *msg) {
  if (x == y) {
    printf("%s[PASSED] %s: passed\n", "\x1B[32m", func_name);
  } else {
    printf("%s[FAILED] %s: %s\n", "\x1B[31m", func_name, msg);
    printf("%sGot: %p\n", "\x1B[37m", y);
    printf("Expected: %p\n", x);
  }
  printf("%s", "\x1B[37m");
}


x86 assembly (clang, -O0):
<assert_equal_pointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1154 <assert_equal_pointers+0x44>
mov    -0x18(%rbp),%rdx
lea    0xebf(%rip),%rdi
lea    0xecf(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119c <assert_equal_pointers+0x8c>
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeba(%rip),%rdi
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rdi
lea    0xebe(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xe97(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal_pointers>:
push   %r14
push   %rbx
push   %rax
cmp    %rsi,%rdi
je     115f <assert_equal_pointers+0x4f>
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xef7(%rip),%rdi
lea    0xf03(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
lea    0xeff(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1174 <assert_equal_pointers+0x64>
lea    0xe9a(%rip),%rdi
lea    0xeaa(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0xebf(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"%s[PASSED] %s: passed\0A\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [19 x i8] c"%s[FAILED] %s: %s\0A\00"
@.str.3 = [6 x i8] c"\1B[31m\00"
@.str.4 = [11 x i8] c"%sGot: %p\0A\00"
@.str.5 = [6 x i8] c"\1B[37m\00"
@.str.6 = [14 x i8] c"Expected: %p\0A\00"
@.str.7 = [3 x i8] c"%s\00"
define void @assert_equal_pointers(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = icmp eq i8* %9, %10
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %7
%14 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %23
15: ; preds = %4
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %16, i8* %17)
%19 = load i8*, i8** %6
%20 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %5
%22 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %21)
br label %23
23: ; preds = %15, %12
%24 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"%s[PASSED] %s: passed\0A\00"
@.str.1 = [6 x i8] c"\1B[32m\00"
@.str.2 = [19 x i8] c"%s[FAILED] %s: %s\0A\00"
@.str.3 = [6 x i8] c"\1B[31m\00"
@.str.4 = [11 x i8] c"%sGot: %p\0A\00"
@.str.5 = [6 x i8] c"\1B[37m\00"
@.str.6 = [14 x i8] c"Expected: %p\0A\00"
@.str.7 = [3 x i8] c"%s\00"
define void @assert_equal_pointers(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = icmp eq i8* %0, %1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %12
8: ; preds = %4
%9 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %2, i8* %3)
%10 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %1)
%11 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %0)
br label %12
12: ; preds = %8, %6
%13 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}