// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH08_TheIOLibrary/examples/add_itemV2.cc
// Function: main
int main()
{
	Sales_data data1, data2;
	if (read(cin, data1) && read(cin, data2)) {  // read the transactions
		if (data1.isbn() == data2.isbn()) {      // check isbns
			Sales_data sum = add(data1, data2);  // add the transactions
			print(cout, sum);                    // print the results
			cout << endl;                        // followed by a newline 
		}
	} else
		cerr << "Input failed!" << endl;        

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
leaq -0xc8(%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 -0x98(%rbp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
movl %eax, 0x10(%r15)
movq %rax, 0x18(%r15)
movq 0x2cdb(%rip), %rdi      # 0x3fd8
leaq -0xd8(%rbp), %rsi
callq 0x1659
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x133c
movq 0x2cba(%rip), %rdi      # 0x3fd8
leaq -0xa8(%rbp), %rsi
callq 0x1659
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x13cc
movq 0x2cad(%rip), %rbx      # 0x3ff0
leaq 0xcba(%rip), %rsi       # 0x2004
movl $0xd, %edx
movq %rbx, %rdi
callq 0x10d0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq 0x2c7b(%rip), %rdi      # 0x3ff0
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x139d
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x13b8
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x10b0
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
movq -0xd8(%rbp), %rsi
movq -0xd0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0x155e
leaq -0x68(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x78(%rbp), %rdi
callq 0x155e
movq -0x50(%rbp), %rdx
cmpq -0x70(%rbp), %rdx
jne 0x1437
movq -0x78(%rbp), %rbx
testq %rdx, %rdx
je 0x1440
movq -0x58(%rbp), %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
sete %r12b
jmp 0x1443
movq -0x78(%rbp), %rbx
xorl %r12d, %r12d
jmp 0x1443
movb $0x1, %r12b
cmpq %r13, %rbx
je 0x1457
movq -0x68(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x10b0
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %r13
cmpq %r13, %rdi
je 0x1470
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x10b0
testb %r12b, %r12b
je 0x1382
leaq -0x58(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
callq 0x16ee
movq 0x2b31(%rip), %rbx      # 0x3fc8
leaq -0x58(%rbp), %rsi
movq %rbx, %rdi
callq 0x1747
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
movsbl %al, %esi
movq 0x2b07(%rip), %rdi      # 0x3fc8
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x1382
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x10b0
jmp 0x1382
jmp 0x151c
movq %rax, %rbx
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
jne 0x150e
jmp 0x151f
jmp 0x151c
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x151f
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x10b0
jmp 0x151f
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x153a
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x1555
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x1120
nop