// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH07_Classes/examples/add_item.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
			data1.combine(data2);                // add the transactions
			print(cout, data1);                  // 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 $0xa8, %rsp
leaq -0x68(%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 -0xb8(%rbp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
movl %eax, 0x10(%r15)
movq %rax, 0x18(%r15)
movq 0x2cde(%rip), %rdi      # 0x3fd8
leaq -0x78(%rbp), %rsi
callq 0x160d
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1336
movq 0x2cc0(%rip), %rdi      # 0x3fd8
leaq -0xc8(%rbp), %rsi
callq 0x160d
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x13bc
movq 0x2cb3(%rip), %rbx      # 0x3ff0
leaq 0xcc0(%rip), %rsi       # 0x2004
movl $0xd, %edx
movq %rbx, %rdi
callq 0x10d0
movq (%rbx), %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 -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0x1393
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0x13a8
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x10b0
xorl %eax, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x1510
leaq -0x88(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq -0xc8(%rbp), %rsi
movq -0xc0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0x1510
movq -0x40(%rbp), %rdx
cmpq -0x90(%rbp), %rdx
jne 0x1431
movq %rbx, %r12
movq -0x98(%rbp), %rbx
testq %rdx, %rdx
je 0x1440
movq -0x48(%rbp), %rdi
movq %rbx, %rsi
callq 0x10c0
testl %eax, %eax
sete %r13b
jmp 0x1443
movq %rbx, %r12
movq -0x98(%rbp), %rbx
xorl %r13d, %r13d
jmp 0x1443
movb $0x1, %r13b
cmpq %r12, %rbx
je 0x145a
movq -0x88(%rbp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x10b0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x1473
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10b0
testb %r13b, %r13b
je 0x1378
leaq -0x78(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x1684
movq 0x2b35(%rip), %rbx      # 0x3fc8
leaq -0x78(%rbp), %rsi
movq %rbx, %rdi
callq 0x16fb
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10a0
jmp 0x1365
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x14d7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10b0
jmp 0x14d7
jmp 0x14d4
movq %rax, %rbx
movq -0xc8(%rbp), %rdi
cmpq %r15, %rdi
je 0x14f2
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x10b0
movq -0x78(%rbp), %rdi
cmpq %r14, %rdi
je 0x1507
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x1120
nop