// File: /workspace/github_cpp_makefile_star2_O3/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 0x17c4(%rip), %r12      # 0x305f
leaq 0x17ba(%rip), %r15      # 0x305c
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x1794(%rip), %rbp      # 0x3044
leaq 0x17ad(%rip), %rdx      # 0x3064
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq (%rbx), %r14
movq 0x37ea(%rip), %rdi      # 0x50b8
callq 0x1060
cmpq %rax, %r14
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x18e1(%rip), %rdx      # 0x31c5
movq %rbp, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq (%rbx), %r14
movq 0x37bd(%rip), %rdi      # 0x50b8
callq 0x1060
cmpq %rax, %r14
movq %r12, %rcx
cmoveq %r15, %rcx
movq %rbp, %r14
movq %rbp, %rdi
movq %r13, %rsi
leaq 0x18ab(%rip), %rdx      # 0x31c5
xorl %eax, %eax
callq 0x1030
movq 0x8(%rbx), %rdi
movq 0x378c(%rip), %rsi      # 0x50b8
callq 0x10f0
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x1875(%rip), %rbp      # 0x31b6
movq %r14, %rdi
movq %r13, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x1030
movq 0x8(%rbx), %rdi
movq 0x375c(%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 0x1768(%rip), %rsi      # 0x30e9
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fc0
testl %eax, %eax
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x173d(%rip), %rdx      # 0x30db
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x3706(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1f90
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x1725(%rip), %rdx      # 0x30ef
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x180b(%rip), %rsi      # 0x31e9
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fc0
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x16ff(%rip), %rdx      # 0x30fa
movq %r14, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x36a9(%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 0x1fc0
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x16c5(%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 0x1a6e
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x3643(%rip), %r13      # 0x50b8
testq %r13, %r13
je 0x1a87
movq %r13, %rdi
callq 0x1060
movq %rax, %rdx
jmp 0x1a90
leaq 0x15cd(%rip), %r13      # 0x305b
xorl %edx, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1fc0
testl %eax, %eax
movq %r12, %rcx
cmoveq %r15, %rcx
leaq 0x1599(%rip), %r13      # 0x3044
leaq 0x165f(%rip), %rdx      # 0x3111
movq %r13, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x165c(%rip), %rsi      # 0x3127
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fc0
testl %eax, %eax
movq %r12, %rcx
cmovgq %r15, %rcx
leaq 0x1637(%rip), %rdx      # 0x311f
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x1639(%rip), %rsi      # 0x3135
movl $0x5, %edx
movq %rbx, %rdi
callq 0x1fc0
testl %eax, %eax
movq %r12, %rcx
cmovsq %r15, %rcx
leaq 0x1614(%rip), %rdx      # 0x312d
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x358b(%rip), %rsi      # 0x50b8
movq %rbx, %rdi
callq 0x1eba
testb %al, %al
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x15f6(%rip), %rdx      # 0x313b
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x1690(%rip), %rsi      # 0x31e9
movq %rbx, %rdi
callq 0x1eba
testb %al, %al
movq %r15, %rcx
cmoveq %r12, %rcx
leaq 0x15d4(%rip), %rdx      # 0x3145
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x3533(%rip), %rsi      # 0x50b8
leaq 0x18(%rsp), %r13
leaq 0xf(%rsp), %rdx
movq %r13, %rdi
callq 0x1050
movq 0x8(%r13), %rdx
cmpq %rdx, (%rbx)
jne 0x1bc2
movq 0x18(%rsp), %rsi
movq 0x8(%rbx), %rdi
callq 0x10c0
testl %eax, %eax
leaq 0x14a5(%rip), %rax      # 0x305c
leaq 0x14a1(%rip), %r12      # 0x305f
cmoveq %rax, %r12
leaq 0x147b(%rip), %rdi      # 0x3044
leaq 0x1580(%rip), %rdx      # 0x3150
movq 0x10(%rsp), %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1bf6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x34bb(%rip), %r13      # 0x50b8
testq %r13, %r13
je 0x1c0c
movq %r13, %rdi
callq 0x1060
jmp 0x1c15
leaq 0x1448(%rip), %r13      # 0x305b
xorl %eax, %eax
leaq 0x1443(%rip), %r12      # 0x305f
movq %r12, %rcx
cmpq %rax, (%rbx)
jne 0x1c47
movq 0x8(%rbx), %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x10c0
testl %eax, %eax
leaq 0x1420(%rip), %rax      # 0x305c
leaq 0x141c(%rip), %rcx      # 0x305f
cmoveq %rax, %rcx
leaq 0x13f6(%rip), %rdi      # 0x3044
leaq 0x1505(%rip), %rdx      # 0x315a
movq 0x10(%rsp), %rsi
xorl %eax, %eax
callq 0x1030
movq 0x3450(%rip), %r13      # 0x50b8
movq %r13, %rdi
callq 0x1060
movq %r12, %rcx
cmpq %rax, (%rbx)
jne 0x1c9b
movq 0x8(%rbx), %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x10c0
testl %eax, %eax
leaq 0x13cc(%rip), %rax      # 0x305c
leaq 0x13c8(%rip), %rcx      # 0x305f
cmoveq %rax, %rcx
leaq 0x13a2(%rip), %r13      # 0x3044
leaq 0x13d8(%rip), %rdx      # 0x3081
movq %r13, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x33ee(%rip), %rsi      # 0x50b0
movq %rbx, %rdi
callq 0x1eba
testb %al, %al
movq %r15, %rcx
cmovneq %r12, %rcx
leaq 0x148d(%rip), %rdx      # 0x3167
movq %r13, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
leaq 0x14f7(%rip), %rsi      # 0x31e5
movq %rbx, %rdi
callq 0x1eba
testb %al, %al
cmoveq %r15, %r12
leaq 0x146e(%rip), %rdx      # 0x3171
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rcx
xorl %eax, %eax
callq 0x1030
movq 0x3396(%rip), %rsi      # 0x50b0
leaq 0x18(%rsp), %r12
leaq 0xf(%rsp), %rdx
movq %r12, %rdi
callq 0x1050
movq 0x8(%r12), %rdx
cmpq %rdx, (%rbx)
jne 0x1d4f
movq 0x18(%rsp), %rsi
movq 0x8(%rbx), %rdi
callq 0x10c0
testl %eax, %eax
jne 0x1d4f
leaq 0x1310(%rip), %r15      # 0x305f
leaq 0x12ee(%rip), %rdi      # 0x3044
leaq 0x141f(%rip), %rdx      # 0x317c
movq 0x10(%rsp), %rsi
movq %r15, %rcx
xorl %eax, %eax
callq 0x1030
movq 0x18(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1d83
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10b0
movq 0x3326(%rip), %r15      # 0x50b0
testq %r15, %r15
je 0x1d99
movq %r15, %rdi
callq 0x1060
jmp 0x1da2
leaq 0x12bb(%rip), %r15      # 0x305b
xorl %eax, %eax
cmpq %rax, (%rbx)
jne 0x1dbe
movq 0x8(%rbx), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x10c0
testl %eax, %eax
je 0x1ead
leaq 0x1297(%rip), %rcx      # 0x305c
leaq 0x1278(%rip), %r15      # 0x3044
leaq 0x13b3(%rip), %rdx      # 0x3186
movq %r15, %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq 0x8(%rbx), %rax
movb (%rax), %al
movq 0x32c6(%rip), %rcx      # 0x50b8
cmpb (%rcx), %al
leaq 0x1261(%rip), %r13      # 0x305c
leaq 0x125d(%rip), %rcx      # 0x305f
cmoveq %r13, %rcx
leaq 0x1386(%rip), %rdx      # 0x3193
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1030
movq (%rbx), %rdx
movq 0x8(%rbx), %r14
testq %rdx, %rdx
jle 0x1e7a
leaq 0x1217(%rip), %r15      # 0x3044
leaq 0x1369(%rip), %r12      # 0x319d
movq %r14, %rsi
xorl %ebp, %ebp
movb (%rsi,%rbp), %al
movq %r13, %rcx
cmpb (%r14,%rbp), %al
je 0x1e4c
leaq 0x1213(%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 (%r14,%rbp), %rcx
incq %rcx
incq %rbp
cmpq %rax, %rcx
jb 0x1e39
jmp 0x1e7d
movq %r14, %rsi
movq 0x3154(%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
leaq 0x11ab(%rip), %rcx      # 0x305f
jmp 0x1dc5
nop