// File: /workspace/github_cpp_makefile_star2_O2/nmmmnu[P]HM3/test/test_stringref.cc
// Function: test_stringref(char const*, StringRef const&)
static void test_stringref(const char *module, const StringRef &sr){
	PRINTF_TEST("! empty",		! sr.empty()				);

	PRINTF_TEST("size",		sr.size() == strlen(hello)		);
	PRINTF_TEST("size",		sr.length() == strlen(hello)		);

	PRINTF_TEST("data",		strcmp(sr.data(), hello) == 0		);
	PRINTF_TEST("data",		strcmp(sr.c_str(), hello) == 0		);

	PRINTF_TEST("cmp char * MO",	sr.compare("bello") != 0		);
	PRINTF_TEST("cmp char *",	sr.compare(hello) == 0			);
	PRINTF_TEST("cmp char []",	sr.compare(hello_c) == 0		);
	PRINTF_TEST("cmp string",	sr.compare(std::string(hello)) == 0	);
	PRINTF_TEST("cmp StringRef",	sr.compare(StringRef(hello)) == 0	);

	PRINTF_TEST("cmp ___",		sr.compare("_aaaa") > 0			);
	PRINTF_TEST("cmp ~~~",		sr.compare("~aaaa") < 0			);

	PRINTF_TEST("== char *",	sr == hello				);
	PRINTF_TEST("== char []",	sr == hello_c				);
	PRINTF_TEST("== string",	sr == std::string(hello)		);
	PRINTF_TEST("== StringRef",	sr == StringRef(hello)			);

	PRINTF_TEST("eq char *",	sr.equals(hello, strlen(hello))		);

	PRINTF_TEST("|= char *",	sr != bla				);
	PRINTF_TEST("!= char []",	sr != bla_c				);
	PRINTF_TEST("|= string",	sr != std::string(bla)			);
	PRINTF_TEST("|= StringRef",	sr != StringRef(bla)			);

	PRINTF_TEST("[] char *",	sr[0] == hello[0]			);

	size_t i = 0;
	for(auto it = sr.begin(); it < sr.end(); ++it){
		PRINTF_TEST("iterator",	sr[i] == *it				);
		++i;
	}

	std::cout <<  sr << '\n';
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbp
cmpq $0x0, (%rsi)
leaq 0x7d0(%rip), %rbx       # 0x205f
leaq 0x7c6(%rip), %rax       # 0x205c
movq %rax, %rcx
movq %rax, %r13
cmoveq %rbx, %rcx
leaq 0x79d(%rip), %r15       # 0x2044
leaq 0x7b6(%rip), %rdx       # 0x2064
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq (%r14), %r12
movq 0x27f3(%rip), %rdi      # 0x40b8
callq 0x1060
cmpq %rax, %r12
movq %rbx, %rcx
cmoveq %r13, %rcx
leaq 0x8ea(%rip), %r12       # 0x21c5
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
movq (%r14), %r13
movq 0x27c3(%rip), %rdi      # 0x40b8
callq 0x1060
cmpq %rax, %r13
movq %rbx, %rcx
leaq 0x755(%rip), %r13       # 0x205c
cmoveq %r13, %rcx
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
movq 0x8(%r14), %rdi
movq 0x2792(%rip), %rsi      # 0x40b8
callq 0x10f0
testl %eax, %eax
movq %rbx, %rcx
cmoveq %r13, %rcx
leaq 0x87b(%rip), %r12       # 0x21b6
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
movq 0x8(%r14), %rdi
movq 0x2762(%rip), %rsi      # 0x40b8
callq 0x10f0
testl %eax, %eax
movq %rbx, %rcx
cmoveq %r13, %rcx
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
leaq 0x76e(%rip), %rsi       # 0x20e9
movq %r14, %rdi
callq 0x1f48
testl %eax, %eax
movq %r13, %rcx
movq %r13, %r12
cmoveq %rbx, %rcx
leaq 0x745(%rip), %rdx       # 0x20db
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x270e(%rip), %rsi      # 0x40b8
movq %r14, %rdi
callq 0x1f48
testl %eax, %eax
movq %rbx, %rcx
cmoveq %r13, %rcx
leaq 0x72d(%rip), %rdx       # 0x20ef
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x813(%rip), %rsi       # 0x21e9
movq %r14, %rdi
callq 0x1f48
testl %eax, %eax
movq %rbx, %rcx
cmoveq %r13, %rcx
leaq 0x70c(%rip), %rdx       # 0x20fa
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x26b6(%rip), %rsi      # 0x40b8
leaq 0x8(%rsp), %r13
leaq 0x7(%rsp), %rdx
movq %r13, %rdi
callq 0x1050
movq %r14, %rdi
movq %r13, %rsi
callq 0x1f70
testl %eax, %eax
movq %rbx, %rcx
cmoveq %r12, %rcx
leaq 0x6d7(%rip), %rdx       # 0x2106
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq %r13, %rdi
callq 0x1080
movq 0x266d(%rip), %rsi      # 0x40b8
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x1d78
movq %r14, %rdi
movq %r13, %rsi
callq 0x1f80
testl %eax, %eax
movq %rbx, %rcx
movq %r12, %r13
cmoveq %r12, %rcx
leaq 0x69b(%rip), %rdx       # 0x2111
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x69d(%rip), %rsi       # 0x2127
movq %r14, %rdi
callq 0x1f48
testl %eax, %eax
movq %rbx, %rcx
cmovgq %r12, %rcx
leaq 0x67d(%rip), %rdx       # 0x211f
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x67f(%rip), %rsi       # 0x2135
movq %r14, %rdi
callq 0x1f48
testl %eax, %eax
movq %rbx, %rcx
cmovsq %r12, %rcx
leaq 0x65f(%rip), %rdx       # 0x212d
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x25d6(%rip), %rsi      # 0x40b8
movq %r14, %rdi
callq 0x1e0a
testb %al, %al
movq %r12, %rcx
cmoveq %rbx, %rcx
leaq 0x641(%rip), %rdx       # 0x213b
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq %r14, %rdi
leaq 0x6d8(%rip), %rsi       # 0x21e9
callq 0x1e0a
testb %al, %al
movq %r12, %rcx
cmoveq %rbx, %rcx
leaq 0x61f(%rip), %rdx       # 0x2145
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x257e(%rip), %rsi      # 0x40b8
leaq 0x8(%rsp), %r12
leaq 0x7(%rsp), %rdx
movq %r12, %rdi
callq 0x1050
movq %r14, %rdi
movq %r12, %rsi
callq 0x1e32
testb %al, %al
movq %r13, %rcx
cmoveq %rbx, %rcx
leaq 0x5e9(%rip), %rdx       # 0x2150
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq %r12, %rdi
callq 0x1080
movq 0x2535(%rip), %rsi      # 0x40b8
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x1d78
movq %r14, %rdi
movq %r12, %rsi
callq 0x1e42
testb %al, %al
movq %r13, %rcx
cmoveq %rbx, %rcx
leaq 0x5af(%rip), %rdx       # 0x215a
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x24f9(%rip), %r12      # 0x40b8
movq %r12, %rdi
callq 0x1060
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x1e4e
testb %al, %al
movq %r13, %rcx
cmoveq %rbx, %rcx
leaq 0x49c(%rip), %rdx       # 0x2081
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x24b7(%rip), %rsi      # 0x40b0
movq %r14, %rdi
callq 0x1f8c
testb %al, %al
movq %r13, %rcx
cmoveq %rbx, %rcx
leaq 0x556(%rip), %rdx       # 0x2167
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x5c0(%rip), %rsi       # 0x21e5
movq %r14, %rdi
callq 0x1f8c
testb %al, %al
movq %r13, %rcx
cmoveq %rbx, %rcx
leaq 0x534(%rip), %rdx       # 0x2171
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x245f(%rip), %rsi      # 0x40b0
leaq 0x8(%rsp), %r12
leaq 0x7(%rsp), %rdx
movq %r12, %rdi
callq 0x1050
movq %r14, %rdi
movq %r12, %rsi
callq 0x1f96
testb %al, %al
movq %r13, %rcx
cmoveq %rbx, %rcx
leaq 0x4fe(%rip), %rdx       # 0x217c
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq %r12, %rdi
callq 0x1080
movq 0x2416(%rip), %rsi      # 0x40b0
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x1d78
movq %r14, %rdi
movq %r12, %rsi
callq 0x1fa0
testb %al, %al
movq %r13, %rcx
cmoveq %rbx, %rcx
leaq 0x4c4(%rip), %rdx       # 0x2186
movq %r15, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x8(%r14), %rax
movb (%rax), %al
movq 0x23dc(%rip), %rcx      # 0x40b8
cmpb (%rcx), %al
movq %rbx, %rcx
cmoveq %r13, %rcx
leaq 0x4a7(%rip), %rdx       # 0x2193
movq %r15, %rbx
movq %r15, %rdi
movq %rbp, %r15
movq %rbp, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x8(%r14), %r13
leaq 0x493(%rip), %r12       # 0x219d
movq %r13, %rax
xorl %ebp, %ebp
movq %r13, %rdx
addq %rbp, %rdx
movq (%r14), %rcx
addq %rax, %rcx
cmpq %rcx, %rdx
jae 0x1d4e
movb (%rax,%rbp), %al
leaq 0x332(%rip), %rcx       # 0x205c
cmpb (%rdx), %al
je 0x1d35
leaq 0x32a(%rip), %rcx       # 0x205f
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
incq %rbp
movq 0x8(%r14), %rax
jmp 0x1d0f
movq 0x2283(%rip), %rdi      # 0x3fd8
movq %r14, %rsi
callq 0x1faa
pushq $0xa
popq %rsi
movq %rax, %rdi
callq 0x10d0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop