// File: nmmmnu[P]asyncore_cpp/net/test/test_iobuffer.cc
// Function: test(char const*)
void test(const char *module = "iobuffer"){
	using Buffer = net::IOBuffer<8>;

	Buffer b;

	std::string s;

	testPush(module, "push",		"aaa",	b, s);
	testPush(module, "push zero",		"",	b, s, false);
	testPush(module, "push",		"bbb",	b, s);
	testPush(module, "push overflow",	"ccc",	b, s, false);
	testPush(module, "push limit",		"dd",	b, s);
	testPush(module, "push overflow",	"ccc",	b, s, false);

	testPop( module, "pop",			3,	b, s);
	testPop( module, "pop zero",		0,	b, s, false);
	testPop( module, "pop",			3,	b, s);
	testPop( module, "pop overflow",	3,	b, s, false);
	testPop( module, "pop limit",		2,	b, s);
	testPop( module, "pop overflow",	3,	b, s, false);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x14(%rbp), %rdi
movq %rdi, -0x58(%rbp)
callq 0x1410
leaq -0x38(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x10a0
movq -0x58(%rbp), %rcx
movq -0x50(%rbp), %r8
movq -0x8(%rbp), %rdi
leaq 0xdeb(%rip), %rsi       # 0x2004
leaq 0xde9(%rip), %rdx       # 0x2009
movl $0x1, %r9d
callq 0x1430
jmp 0x122d
movq -0x8(%rbp), %rdi
leaq 0xdd5(%rip), %rsi       # 0x200d
leaq 0xe40(%rip), %rdx       # 0x207f
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
xorl %r9d, %r9d
callq 0x1430
jmp 0x1251
movq -0x8(%rbp), %rdi
leaq 0xda8(%rip), %rsi       # 0x2004
leaq 0xdb4(%rip), %rdx       # 0x2017
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
movl $0x1, %r9d
callq 0x1430
jmp 0x1278
movq -0x8(%rbp), %rdi
leaq 0xd98(%rip), %rsi       # 0x201b
leaq 0xd9f(%rip), %rdx       # 0x2029
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
xorl %r9d, %r9d
callq 0x1430
jmp 0x129c
movq -0x8(%rbp), %rdi
leaq 0xd86(%rip), %rsi       # 0x202d
leaq 0xd8a(%rip), %rdx       # 0x2038
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
movl $0x1, %r9d
callq 0x1430
jmp 0x12c3
movq -0x8(%rbp), %rdi
leaq 0xd4d(%rip), %rsi       # 0x201b
leaq 0xd54(%rip), %rdx       # 0x2029
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
xorl %r9d, %r9d
callq 0x1430
jmp 0x12e7
movq -0x8(%rbp), %rdi
leaq 0xd49(%rip), %rsi       # 0x203b
movl $0x3, %edx
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
movl $0x1, %r9d
callq 0x1530
jmp 0x130c
movq -0x8(%rbp), %rdi
leaq 0xd28(%rip), %rsi       # 0x203f
xorl %r9d, %r9d
movl %r9d, %edx
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
callq 0x1530
jmp 0x132c
movq -0x8(%rbp), %rdi
leaq 0xd04(%rip), %rsi       # 0x203b
movl $0x3, %edx
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
movl $0x1, %r9d
callq 0x1530
jmp 0x1351
movq -0x8(%rbp), %rdi
leaq 0xcec(%rip), %rsi       # 0x2048
movl $0x3, %edx
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
xorl %r9d, %r9d
callq 0x1530
jmp 0x1373
movq -0x8(%rbp), %rdi
leaq 0xcd7(%rip), %rsi       # 0x2055
movl $0x2, %edx
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
movl $0x1, %r9d
callq 0x1530
jmp 0x1398
movq -0x8(%rbp), %rdi
leaq 0xca5(%rip), %rsi       # 0x2048
movl $0x3, %edx
leaq -0x14(%rbp), %rcx
leaq -0x38(%rbp), %r8
xorl %r9d, %r9d
callq 0x1530
jmp 0x13ba
leaq -0x38(%rbp), %rdi
callq 0x1060
addq $0x60, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x1060
movq -0x40(%rbp), %rdi
callq 0x10d0
nopw (%rax,%rax)