// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0xe0, %rsp
leaq -0x58(%rbp), %rbx
pushq $0x5
popq %r14
pushq $0x3
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14a0
movq 0x10(%rbx), %rax
movq 0x18(%rbx), %rcx
leaq (,%rax,4), %rdx
movq %rdx, (%rbx)
leaq -0x40(%rbp), %rbx
movb $0x23, (%rcx,%rax,4)
leaq -0x100(%rbp), %rdi
pushq $0x58
popq %rcx
movq %r14, %rsi
movq %r14, %rdx
callq 0x14ce
leaq -0xe8(%rbp), %r14
movq -0x8(%r14), %rax
movq (%r14), %rcx
leaq (,%rax,4), %rdx
movq %rdx, -0x18(%r14)
movb $0x23, (%rcx,%rax,4)
movq 0x2d02(%rip), %rdi      # 0x3fd8
movq %r14, %rsi
callq 0x1060
movq 0x2cf3(%rip), %rdi      # 0x3fd8
leaq 0xd18(%rip), %rsi       # 0x2004
callq 0x1070
movq 0x2ce0(%rip), %rdi      # 0x3fd8
movq %r14, %rsi
callq 0x1060
movq 0x2cd1(%rip), %rdi      # 0x3fd8
callq 0x1040
leaq -0x90(%rbp), %rdi
pushq $0x5
popq %rsi
pushq $0x3
popq %rdx
callq 0x14a0
movq -0x58(%rbp), %rax
movq -0x40(%rbp), %rcx
movb $0x23, (%rcx,%rax)
movq 0x2ca7(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1060
movq 0x2c98(%rip), %rdi      # 0x3fd8
callq 0x1040
leaq -0x78(%rbp), %r15
movq 0x2c88(%rip), %rdi      # 0x3fd8
movq %r15, %rsi
callq 0x1060
movq 0x2c79(%rip), %rdi      # 0x3fd8
callq 0x1040
leaq -0x58(%rbp), %rdi
pushq $0x5a
popq %rsi
callq 0x120c
movq 0x2c61(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1060
movq 0x2c52(%rip), %rdi      # 0x3fd8
callq 0x1040
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
leaq (,%rax,4), %rdx
movq %rdx, -0x58(%rbp)
movb $0x23, (%rcx,%rax,4)
movq 0x2c2e(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1060
movq 0x2c1f(%rip), %rdi      # 0x3fd8
callq 0x1040
leaq -0x58(%rbp), %rdi
pushq $0x5a
popq %rsi
callq 0x120c
movq 0x2c07(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1060
movq 0x2bf8(%rip), %rdi      # 0x3fd8
callq 0x1040
leaq -0x58(%rbp), %rsi
movq 0x10(%rsi), %rax
shlq $0x2, %rax
movq %rax, (%rsi)
leaq -0xc8(%rbp), %rdi
callq 0x14fa
leaq -0xb0(%rbp), %r12
movq -0x18(%r12), %rax
movq (%r12), %rcx
movb $0x23, (%rcx,%rax)
movq 0x2bbd(%rip), %rdi      # 0x3fd8
movq %rbx, %rsi
callq 0x1060
movq 0x2bae(%rip), %rdi      # 0x3fd8
callq 0x1040
movq %r12, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x147c
jmp 0x1477
movq %rax, %r15
jmp 0x1490
movq %rax, %r15
movq %r12, %rdi
callq 0x1030
jmp 0x147f
movq %rax, %r15
jmp 0x1488
movq %rax, %r15
leaq -0x78(%rbp), %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x10c0