#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 */
struct ht_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int node_compare(struct ht_node *, struct ht_node *);
int /*<<< orphan*/ printf(char *);
void assertNodeEquals(struct ht_node *node1, struct ht_node *node2,
                      struct ht_node *node3) {
  printf("Checking node1 == node1...");
  assert(node_compare(node1, node1));
  printf("OK\nChecking node2 != node3...");
  assert(!node_compare(node2, node3));
  printf("OK\n");
}


x86 assembly (clang, -O0):
<assertNodeEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <node_compare@plt>
mov    %eax,%edi
call   1040 <assert@plt>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <node_compare@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertNodeEquals>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1060 <node_compare@plt>
mov    %eax,%edi
call   1050 <assert@plt>
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <node_compare@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xea2(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.ht_node = type { i32 }
@.str = [27 x i8] c"Checking node1 == node1...\00"
@.str.1 = [30 x i8] c"OK\0AChecking node2 != node3...\00"
@.str.2 = [4 x i8] c"OK\0A\00"
define void @assertNodeEquals(%struct.ht_node* %0, %struct.ht_node* %1, %struct.ht_node* %2) {
%4 = alloca %struct.ht_node*
%5 = alloca %struct.ht_node*
%6 = alloca %struct.ht_node*
store %struct.ht_node* %0, %struct.ht_node** %4
store %struct.ht_node* %1, %struct.ht_node** %5
store %struct.ht_node* %2, %struct.ht_node** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = load %struct.ht_node*, %struct.ht_node** %4
%9 = load %struct.ht_node*, %struct.ht_node** %4
%10 = call i32 @node_compare(%struct.ht_node* %8, %struct.ht_node* %9)
%11 = call i32 @assert(i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%13 = load %struct.ht_node*, %struct.ht_node** %5
%14 = load %struct.ht_node*, %struct.ht_node** %6
%15 = call i32 @node_compare(%struct.ht_node* %13, %struct.ht_node* %14)
%16 = icmp ne i32 %15, 0
%17 = xor i1 %16, true
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ht_node = type { i32 }
@.str = [27 x i8] c"Checking node1 == node1...\00"
@.str.1 = [30 x i8] c"OK\0AChecking node2 != node3...\00"
@str = [3 x i8] c"OK\00"
define void @assertNodeEquals(%struct.ht_node* %0, %struct.ht_node* %1, %struct.ht_node* %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @node_compare(%struct.ht_node* %0, %struct.ht_node* %0)
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @node_compare(%struct.ht_node* %1, %struct.ht_node* %2)
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}