#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*/ assert(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ wtree_compare(char *, char *);
void test_wtree_compare() {
  char a, b;
  a = 'a';
  b = 'b';
  assert(wtree_compare(&a, &a) == 0);
  assert(wtree_compare(&a, &b) < 0);
  assert(wtree_compare(&b, &a) > 0);
  printf("\twtree_compare test passed\n");
}


x86 assembly (clang, -O0):
<test_wtree_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x61,-0x1(%rbp)
movb   $0x62,-0x2(%rbp)
lea    -0x1(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <wtree_compare@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
call   1030 <wtree_compare@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    -0x2(%rbp),%rdi
lea    -0x1(%rbp),%rsi
call   1030 <wtree_compare@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_wtree_compare>:
push   %r14
push   %rbx
push   %rax
movb   $0x61,0x7(%rsp)
movb   $0x62,0x6(%rsp)
lea    0x7(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <wtree_compare@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0x6(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <wtree_compare@plt>
shr    $0x3f,%rax
mov    %eax,%edi
call   1050 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <wtree_compare@plt>
xor    %edi,%edi
test   %rax,%rax
setg   %dil
call   1050 <assert@plt>
lea    0xe69(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\09wtree_compare test passed\0A\00"
define void @test_wtree_compare() {
%1 = alloca i8
%2 = alloca i8
store i8 97, i8* %1
store i8 98, i8* %2
%3 = call i64 @wtree_compare(i8* %1, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i64 @wtree_compare(i8* %1, i8* %2)
%8 = icmp slt i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i64 @wtree_compare(i8* %2, i8* %1)
%12 = icmp sgt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"\09wtree_compare test passed\00"
define void @test_wtree_compare() {
%1 = alloca i8
%2 = alloca i8
store i8 97, i8* %1
store i8 98, i8* %2
%3 = call i64 @wtree_compare(i8* %1, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i64 @wtree_compare(i8* %1, i8* %2)
%8 = lshr i64 %7, 63
%9 = trunc i64 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i64 @wtree_compare(i8* %2, i8* %1)
%12 = icmp sgt i64 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}