// File: nmmmnu[P]HM3/test/test_stringref.cc
// Function: test_tools_compare_ref(char const*)
static void test_tools_compare_ref(const char *module){
	PRINTF_TEST("null",		! StringRef::compare(	"", 0,			"", 0)			);

	PRINTF_TEST("<",		StringRef::compare(	"a", 1,			"b", 1) < 0		);
	PRINTF_TEST(">",		StringRef::compare(	"b", 1,			"a", 1) > 0		);

	PRINTF_TEST("eq",		! StringRef::compare(	hello, strlen(hello),	hello, strlen(hello))	);

	PRINTF_TEST("! eq",		StringRef::compare(	hello, 0,		hello, strlen(hello))	);
	PRINTF_TEST("! eq",		StringRef::compare(	hello, 1,		hello, strlen(hello))	);
	PRINTF_TEST("! eq",		StringRef::compare(	hello, strlen(hello),	hello, 0)		);
	PRINTF_TEST("! eq",		StringRef::compare(	hello, strlen(hello),	hello, 1)		);

}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x2a52(%rip), %rdx      # 0x4065
xorl %eax, %eax
movl %eax, %ecx
movq %rdx, %rdi
movq %rcx, %rsi
callq 0x2d10
movq 0x8(%rsp), %rsi
cmpl $0x0, %eax
setne %dl
xorb $-0x1, %dl
leaq 0x2a32(%rip), %rcx      # 0x4069
leaq 0x2a28(%rip), %rax      # 0x4066
testb $0x1, %dl
cmovneq %rax, %rcx
leaq 0x2a02(%rip), %rdi      # 0x404e
leaq 0x29da(%rip), %rdx      # 0x402d
movb $0x0, %al
callq 0x1030
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x2a9d(%rip), %rdi      # 0x410b
movl $0x1, %ecx
leaq 0x2a08(%rip), %rdx      # 0x4082
movq %rcx, %rsi
callq 0x2d10
movq 0x10(%rsp), %rsi
movl %eax, %edx
leaq 0x29d9(%rip), %rcx      # 0x4069
leaq 0x29cf(%rip), %rax      # 0x4066
cmpl $0x0, %edx
cmovlq %rax, %rcx
leaq 0x29a9(%rip), %rdi      # 0x404e
leaq 0x29d4(%rip), %rdx      # 0x4080
movb $0x0, %al
callq 0x1030
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x29bb(%rip), %rdi      # 0x4082
movl $0x1, %ecx
leaq 0x2a38(%rip), %rdx      # 0x410b
movq %rcx, %rsi
callq 0x2d10
movq 0x18(%rsp), %rsi
movl %eax, %edx
leaq 0x2980(%rip), %rcx      # 0x4069
leaq 0x2976(%rip), %rax      # 0x4066
cmpl $0x0, %edx
cmovgq %rax, %rcx
leaq 0x2950(%rip), %rdi      # 0x404e
leaq 0x297f(%rip), %rdx      # 0x4084
movb $0x0, %al
callq 0x1030
movq 0x90(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x49b0(%rip), %rax      # 0x60d0
movq %rax, 0x20(%rsp)
movq 0x49a4(%rip), %rdi      # 0x60d0
callq 0x1070
movq %rax, 0x28(%rsp)
movq 0x4993(%rip), %rax      # 0x60d0
movq %rax, 0x30(%rsp)
movq 0x4987(%rip), %rdi      # 0x60d0
callq 0x1070
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %rax, %rcx
callq 0x2d10
movq 0x38(%rsp), %rsi
cmpl $0x0, %eax
setne %dl
xorb $-0x1, %dl
leaq 0x28ef(%rip), %rcx      # 0x4069
leaq 0x28e5(%rip), %rax      # 0x4066
testb $0x1, %dl
cmovneq %rax, %rcx
leaq 0x28bf(%rip), %rdi      # 0x404e
leaq 0x28f2(%rip), %rdx      # 0x4088
movb $0x0, %al
callq 0x1030
movq 0x90(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x491f(%rip), %rax      # 0x60d0
movq %rax, 0x40(%rsp)
movq 0x4913(%rip), %rax      # 0x60d0
movq %rax, 0x48(%rsp)
movq 0x4907(%rip), %rdi      # 0x60d0
callq 0x1070
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
movq %rax, %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x2d10
movq 0x50(%rsp), %rsi
movl %eax, %edx
leaq 0x2877(%rip), %rcx      # 0x4069
leaq 0x286d(%rip), %rax      # 0x4066
cmpl $0x0, %edx
cmovneq %rax, %rcx
leaq 0x2847(%rip), %rdi      # 0x404e
leaq 0x2878(%rip), %rdx      # 0x4086
movb $0x0, %al
callq 0x1030
movq 0x90(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x48a7(%rip), %rax      # 0x60d0
movq %rax, 0x58(%rsp)
movq 0x489b(%rip), %rax      # 0x60d0
movq %rax, 0x60(%rsp)
movq 0x488f(%rip), %rdi      # 0x60d0
callq 0x1070
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rdx
movq %rax, %rcx
movl $0x1, %esi
callq 0x2d10
movq 0x68(%rsp), %rsi
movl %eax, %edx
leaq 0x27fe(%rip), %rcx      # 0x4069
leaq 0x27f4(%rip), %rax      # 0x4066
cmpl $0x0, %edx
cmovneq %rax, %rcx
leaq 0x27ce(%rip), %rdi      # 0x404e
leaq 0x27ff(%rip), %rdx      # 0x4086
movb $0x0, %al
callq 0x1030
movq 0x90(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x482e(%rip), %rax      # 0x60d0
movq %rax, 0x70(%rsp)
movq 0x4822(%rip), %rdi      # 0x60d0
callq 0x1070
movq 0x70(%rsp), %rdi
movq %rax, %rsi
movq 0x480e(%rip), %rdx      # 0x60d0
xorl %eax, %eax
movl %eax, %ecx
callq 0x2d10
movq 0x78(%rsp), %rsi
movl %eax, %edx
leaq 0x2790(%rip), %rcx      # 0x4069
leaq 0x2786(%rip), %rax      # 0x4066
cmpl $0x0, %edx
cmovneq %rax, %rcx
leaq 0x2760(%rip), %rdi      # 0x404e
leaq 0x2791(%rip), %rdx      # 0x4086
movb $0x0, %al
callq 0x1030
movq 0x90(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x47bd(%rip), %rax      # 0x60d0
movq %rax, 0x80(%rsp)
movq 0x47ae(%rip), %rdi      # 0x60d0
callq 0x1070
movq 0x80(%rsp), %rdi
movq %rax, %rsi
movq 0x4797(%rip), %rdx      # 0x60d0
movl $0x1, %ecx
callq 0x2d10
movq 0x88(%rsp), %rsi
movl %eax, %edx
leaq 0x2715(%rip), %rcx      # 0x4069
leaq 0x270b(%rip), %rax      # 0x4066
cmpl $0x0, %edx
cmovneq %rax, %rcx
leaq 0x26e5(%rip), %rdi      # 0x404e
leaq 0x2716(%rip), %rdx      # 0x4086
movb $0x0, %al
callq 0x1030
addq $0x98, %rsp
retq
nop