// File: /workspace/github_cpp_makefile_star2_O1/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 $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r13
cmpq $0x0, (%rsi)
leaq 0x17dd(%rip), %r12      # 0x305f
leaq 0x17d3(%rip), %r15      # 0x305c
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x17ad(%rip), %rbp      # 0x3044
leaq 0x17c6(%rip), %rdx      # 0x3064
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq (%rbx), %r14
movq 0x3803(%rip), %rdi      # 0x50b8
callq 0x1060
cmpq %rax, %r14
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x18fa(%rip), %rdx      # 0x31c5
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq (%rbx), %r14
movq 0x37d6(%rip), %rdi      # 0x50b8
callq 0x1060
cmpq %rax, %r14
movq %r12, %rcx
cmoveq %r15, %rcx
movq %rbp, %r14
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x18c4(%rip), %rdx      # 0x31c5
xorl %eax, %eax
callq 0x1030
movq 0x8(%rbx), %rdi
movq 0x37a5(%rip), %rsi      # 0x50b8
callq 0x10f0
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x188e(%rip), %rbp      # 0x31b6
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1030
movq 0x8(%rbx), %rdi
movq 0x3775(%rip), %rsi      # 0x50b8
callq 0x10f0
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1030
leaq 0x1781(%rip), %rsi      # 0x30e9
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fb6
testl %eax, %eax
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x1756(%rip), %rdx      # 0x30db
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x371f(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1f86
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x173e(%rip), %rdx      # 0x30ef
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x1824(%rip), %rsi      # 0x31e9
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fb6
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x1718(%rip), %rdx      # 0x30fa
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x36c2(%rip), %rsi      # 0x50b8
leaq 0x18(%rsp), %rbp
leaq 0xf(%rsp), %rdx
movq %rbp, %rdi
callq 0x1050
movq (%rbp), %rsi
movq 0x8(%rbp), %rdx
movq %rbx, %rdi
callq 0x1fb6
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x16de(%rip), %rdx      # 0x3106
movq %r14, %rdi
movq %r13, 0x10(%rsp)
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq (%rbp), %rdi
leaq 0x28(%rsp), %rbp
cmpq %rbp, %rdi
je 0x1a55
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x365c(%rip), %r13      # 0x50b8
testq %r13, %r13
je 0x1a6e
movq %r13, %rdi
callq 0x1060
movq %rax, %rdx
jmp 0x1a77
leaq 0x15e6(%rip), %r13      # 0x305b
xorl %edx, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1fb6
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x15b2(%rip), %r13      # 0x3044
leaq 0x1678(%rip), %rdx      # 0x3111
movq %r13, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x1675(%rip), %rsi      # 0x3127
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fb6
testl %eax, %eax
movq %r12, %rcx
cmovgq %r15, %rcx
leaq 0x1650(%rip), %rdx      # 0x311f
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x1652(%rip), %rsi      # 0x3135
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fb6
testl %eax, %eax
movq %r12, %rcx
cmovsq %r15, %rcx
leaq 0x162d(%rip), %rdx      # 0x312d
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x35a4(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1eb6
testb %al, %al
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x160f(%rip), %rdx      # 0x313b
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x16a9(%rip), %rsi      # 0x31e9
movq %rbx, %rdi
callq 0x1eb6
testb %al, %al
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x15ed(%rip), %rdx      # 0x3145
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x354c(%rip), %rsi      # 0x50b8
leaq 0x18(%rsp), %r13
leaq 0xf(%rsp), %rdx
movq %r13, %rdi
callq 0x1050
movq (%rbx), %rdx
cmpq 0x8(%r13), %rdx
jne 0x1ba9
movq 0x18(%rsp), %rsi
movq 0x8(%rbx), %rdi
callq 0x10c0
testl %eax, %eax
leaq 0x14be(%rip), %rax      # 0x305c
leaq 0x14ba(%rip), %r12      # 0x305f
cmoveq %rax, %r12
leaq 0x1494(%rip), %rdi      # 0x3044
leaq 0x1599(%rip), %rdx      # 0x3150
movq 0x10(%rsp), %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1bdd
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x34d4(%rip), %r13      # 0x50b8
testq %r13, %r13
je 0x1bf3
movq %r13, %rdi
callq 0x1060
jmp 0x1bfc
leaq 0x1461(%rip), %r13      # 0x305b
xorl %eax, %eax
movq (%rbx), %rdx
leaq 0x1459(%rip), %r12      # 0x305f
movq %r12, %rcx
cmpq %rax, %rdx
jne 0x1c2e
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x10c0
testl %eax, %eax
leaq 0x1439(%rip), %rax      # 0x305c
leaq 0x1435(%rip), %rcx      # 0x305f
cmoveq %rax, %rcx
leaq 0x140f(%rip), %rdi      # 0x3044
leaq 0x151e(%rip), %rdx      # 0x315a
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1030
movq 0x3469(%rip), %r13      # 0x50b8
movq %r13, %rdi
callq 0x1060
movq (%rbx), %rdx
movq %r12, %rcx
cmpq %rax, %rdx
jne 0x1c82
movq 0x8(%rbx), %rdi
movq %r13, %rsi
callq 0x10c0
testl %eax, %eax
leaq 0x13e5(%rip), %rax      # 0x305c
leaq 0x13e1(%rip), %rcx      # 0x305f
cmoveq %rax, %rcx
leaq 0x13bb(%rip), %r13      # 0x3044
leaq 0x13f1(%rip), %rdx      # 0x3081
movq %r13, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x3407(%rip), %rsi      # 0x50b0
movq %rbx, %rdi
callq 0x1eb6
testb %al, %al
movq %r15, %rcx
cmovneq %r12, %rcx
leaq 0x14a6(%rip), %rdx      # 0x3167
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x1510(%rip), %rsi      # 0x31e5
movq %rbx, %rdi
callq 0x1eb6
testb %al, %al
cmoveq %r15, %r12
leaq 0x1487(%rip), %rdx      # 0x3171
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
movq 0x33af(%rip), %rsi      # 0x50b0
leaq 0x18(%rsp), %r12
leaq 0xf(%rsp), %rdx
movq %r12, %rdi
callq 0x1050
movq (%rbx), %rdx
cmpq 0x8(%r12), %rdx
jne 0x1d3f
movq 0x18(%rsp), %rsi
movq 0x8(%rbx), %rdi
callq 0x10c0
testl %eax, %eax
leaq 0x132b(%rip), %rax      # 0x305f
leaq 0x1321(%rip), %r15      # 0x305c
cmoveq %rax, %r15
leaq 0x12fe(%rip), %rdi      # 0x3044
leaq 0x142f(%rip), %rdx      # 0x317c
movq 0x10(%rsp), %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x1030
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d73
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x3336(%rip), %r12      # 0x50b0
testq %r12, %r12
je 0x1d89
movq %r12, %rdi
callq 0x1060
jmp 0x1d92
leaq 0x12cb(%rip), %r12      # 0x305b
xorl %eax, %eax
movq (%rbx), %rdx
leaq 0x12c0(%rip), %r15      # 0x305c
movq %r15, %rcx
cmpq %rax, %rdx
jne 0x1dc4
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x10c0
testl %eax, %eax
leaq 0x12a6(%rip), %rax      # 0x305f
leaq 0x129c(%rip), %rcx      # 0x305c
cmoveq %rax, %rcx
leaq 0x1279(%rip), %r12      # 0x3044
leaq 0x13b4(%rip), %rdx      # 0x3186
movq %r12, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x8(%rbx), %rax
movb (%rax), %al
movq 0x32c7(%rip), %rcx      # 0x50b8
cmpb (%rcx), %al
leaq 0x1265(%rip), %rax      # 0x305f
cmovneq %rax, %r15
leaq 0x138e(%rip), %rdx      # 0x3193
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x1030
movq (%rbx), %rdx
movq 0x8(%rbx), %rbp
testq %rdx, %rdx
jle 0x1e83
leaq 0x1234(%rip), %r14      # 0x305c
leaq 0x1215(%rip), %r15      # 0x3044
leaq 0x1367(%rip), %r12      # 0x319d
movq %rbp, %rsi
xorl %r13d, %r13d
movb (%rsi,%r13), %al
movq %r14, %rcx
cmpb (%rbp,%r13), %al
je 0x1e51
leaq 0x120e(%rip), %rcx      # 0x305f
movq %r15, %rdi
movq 0x10(%rsp), %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1030
movq (%rbx), %rdx
movq 0x8(%rbx), %rsi
leaq (%rsi,%rdx), %rax
leaq 0x1(,%r13), %rcx
addq %rbp, %rcx
incq %r13
cmpq %rax, %rcx
jb 0x1e3c
jmp 0x1e86
movq %rbp, %rsi
movq 0x314b(%rip), %rdi      # 0x4fd8
callq 0x10e0
leaq 0x18(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x10d0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq