// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH14_OverloadedOperationsAndConversions/examples/directcall.cc
// Function: main
int main()
{
	Sales_data data1, data2;
	std::cin >> data1 >> data2;    // read Sales_data transactions
	cout << data1 + data2 << endl; // write sum of Sales_data objects
	cout << 42 + 5 << endl;        // write sum of ints

	// equivalent calls to a nonmember operator function
	data1 + data2;            // normal expression
	operator+(data1, data2);  // equivalent function call
	cout << operator+(data1, data2) << endl;

	data1 += data2;           // expression-based ``call''
	data1.operator+=(data2);  // equivalent call to a member operator function
	cout << data1 << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf0, %rsp
leaq -0x40(%rbp), %r14
movq %r14, -0x10(%r14)
xorl %eax, %eax
movq %rax, -0x8(%r14)
movb %al, (%r14)
movl %eax, 0x10(%r14)
movq %rax, 0x18(%r14)
leaq -0xa0(%rbp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
movl %eax, 0x10(%r15)
movq %rax, 0x18(%r15)
movq 0x2cd8(%rip), %rdi      # 0x3fe0
leaq -0x50(%rbp), %rsi
callq 0x15f9
leaq -0xb0(%rbp), %rsi
movq %rax, %rdi
callq 0x15f9
leaq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x16fa
movq 0x2c95(%rip), %rdi      # 0x3fd0
leaq -0x80(%rbp), %rsi
callq 0x1753
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
leaq -0x70(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x1388
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x10b0
movq 0x2c41(%rip), %rdi      # 0x3fd0
movl $0x2f, %esi
callq 0x1110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
leaq -0x110(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x16fa
leaq -0x100(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x13f9
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x10b0
leaq -0xe0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x16fa
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x142f
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x10b0
leaq -0x80(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
callq 0x16fa
movq 0x2b86(%rip), %rdi      # 0x3fd0
leaq -0x80(%rbp), %rsi
callq 0x1753
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
je 0x1492
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x10b0
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x16dc
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x16dc
movq 0x2b17(%rip), %rdi      # 0x3fd0
leaq -0x50(%rbp), %rsi
callq 0x1753
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq -0xb0(%rbp), %rdi
cmpq %r15, %rdi
je 0x1507
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x151c
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x10b0
xorl %eax, %eax
addq $0xf0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x155e
jmp 0x155e
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r12, %rdi
jne 0x1550
jmp 0x1561
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1561
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x10b0
jmp 0x1561
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
cmpq %r15, %rdi
je 0x157c
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x50(%rbp), %rdi
cmpq %r14, %rdi
je 0x1591
movq -0x40(%rbp), %rsi
incq %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x1130
nopl (%rax)