// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH07_Classes/examples/useScreen.cc
// Function: main
int main()
{
	Screen myScreen(5,3);
	// move the cursor to a given position, and set that character 
	myScreen.move(4,0).set('#');

	Screen nextScreen(5, 5, 'X');
	nextScreen.move(4,0).set('#').display(cout);
	cout << "\n";
	nextScreen.display(cout);
	cout << endl;

	const Screen blank(5, 3);
	myScreen.set('#').display(cout);  // calls nonconst version
	cout << endl;
	blank.display(cout);              // calls const version
	cout << endl;

	myScreen.clear('Z').display(cout); cout << endl;
	myScreen.move(4,0);
	myScreen.set('#');
	myScreen.display(cout); cout << endl;
	myScreen.clear('Z').display(cout); cout << endl;

	// if move returns Screen not Screen&
	Screen temp = myScreen.move(4,0); // the return value would be copied
	temp.set('#'); // the contents inside myScreen would be unchanged
	myScreen.display(cout);
	cout << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
xorl %ebx, %ebx
leaq -0x48(%rbp), %rdi
movq %rbx, -0x18(%rdi)
movl $0x5, %r15d
movq %r15, -0x10(%rdi)
movq $0x3, -0x8(%rdi)
leaq -0x38(%rbp), %r14
movq %r14, -0x10(%r14)
movl $0xf, %esi
movl $0x20, %edx
callq 0x10b0
movq -0x18(%r14), %rax
movq -0x10(%r14), %rcx
leaq (,%rax,4), %rdx
movq %rdx, -0x28(%r14)
movb $0x23, (%rcx,%rax,4)
leaq -0x80(%rbp), %rdi
movq %rbx, -0x18(%rdi)
movq %r15, -0x10(%rdi)
movq %r15, -0x8(%rdi)
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
movl $0x19, %esi
movl $0x58, %edx
callq 0x10b0
movq -0x88(%rbp), %rax
movq -0x80(%rbp), %rcx
leaq (,%rax,4), %rdx
movq %rdx, -0x98(%rbp)
movb $0x23, (%rcx,%rax,4)
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq 0x2c8c(%rip), %rdi      # 0x3fd8
callq 0x10a0
movq 0x2c80(%rip), %rdi      # 0x3fd8
leaq 0xca5(%rip), %rsi       # 0x2004
movl $0x1, %edx
callq 0x10a0
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq 0x2c60(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq 0x2c3a(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1040
leaq -0xf0(%rbp), %rdi
movq $0x0, -0x18(%rdi)
movq $0x5, -0x10(%rdi)
movq $0x3, -0x8(%rdi)
leaq -0xe0(%rbp), %r12
movq %r12, -0x10(%r12)
movl $0xf, %esi
movl $0x20, %edx
callq 0x10b0
movq -0x60(%rbp), %rax
movq -0x48(%rbp), %rcx
movb $0x23, (%rcx,%rax)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2bd8(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq 0x2bb2(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq 0x2b90(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq 0x2b6a(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1040
leaq -0x60(%rbp), %rdi
movl $0x5a, %esi
callq 0x123c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2b40(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq 0x2b1a(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
leaq (,%rax,4), %rdx
movq %rdx, -0x60(%rbp)
movb $0x23, (%rcx,%rax,4)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2ae6(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq 0x2ac0(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1040
leaq -0x60(%rbp), %rdi
movl $0x5a, %esi
callq 0x123c
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2a96(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq 0x2a70(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rsi
leaq (,%rax,4), %rcx
movq %rcx, -0x60(%rbp)
leaq -0xb8(%rbp), %rdi
movq %rax, -0x8(%rdi)
movq -0x60(%rbp), %rax
movq %rax, -0x18(%rdi)
movq -0x58(%rbp), %rax
movq %rax, -0x10(%rdi)
leaq -0xa8(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
callq 0x1702
movq -0xd0(%rbp), %rax
movq -0xb8(%rbp), %rcx
movb $0x23, (%rcx,%rax)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x29fc(%rip), %rbx      # 0x3fd8
movq %rbx, %rdi
callq 0x10a0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq 0x29d6(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0x162a
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x1090
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x1645
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x1090
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x165a
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x1090
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x166f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1090
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x16b1
jmp 0x16ac
movq %rax, %rbx
jmp 0x16e4
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0x16b4
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x1090
jmp 0x16b4
movq %rax, %rbx
jmp 0x16cf
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
cmpq %r12, %rdi
je 0x16cf
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x1090
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x16e4
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x1090
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x16f9
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1090
movq %rbx, %rdi
callq 0x10e0
nop