// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH05_Statements/examples/add_item2.cc
// Function: main
int main() 
{
	Sales_item item1, item2;
	
	while (cin >> item1 >> item2) {
	    try {
	        // execute code that will add the two Sales_items
	        // if the addition fails, the code throws a runtime_error exception
	        // first check that the data are for the same item 
	        if (item1.isbn() != item2.isbn())
	            throw runtime_error("Data must refer to same ISBN");
	
	        // if we're still here, the ISBNs are the same
	        cout << item1 + item2 << endl;
	    } catch (runtime_error err) {
	        // remind the user that the ISBNs must match 
			// and prompt for another pair
	        cout << err.what() 
	             << "\nTry Again?  Enter y or n" << endl;
	        char c;
	        cin >> c;
	        if (!cin || c == 'n')
	            break;      // break out of the while loop
	    }  // ends the catch clause
	}  // ends the while loop
	
	return 0;   // indicate success
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
leaq -0xa8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movl %eax, 0x10(%rcx)
movq %rax, 0x18(%rcx)
leaq -0xd8(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movl %eax, 0x10(%rcx)
movq %rax, 0x18(%rcx)
leaq -0x58(%rbp), %r14
movq 0x29bc(%rip), %rbx      # 0x4fd8
leaq -0x68(%rbp), %r12
movq 0x29a1(%rip), %r13      # 0x4fc8
movq %rbx, %rdi
leaq -0xb8(%rbp), %rsi
callq 0x23d3
movq %rbx, %rdi
leaq -0xe8(%rbp), %rsi
callq 0x23d3
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x28d5
movq %r14, -0x68(%rbp)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x29ac
leaq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x88(%rbp), %rdi
callq 0x29ac
movq -0x60(%rbp), %rdx
movb $0x1, %r15b
cmpq -0x80(%rbp), %rdx
jne 0x26c9
testq %rdx, %rdx
je 0x26c6
movq -0x88(%rbp), %rsi
movq -0x68(%rbp), %rdi
callq 0x2140
testl %eax, %eax
setne %r15b
jmp 0x26c9
xorl %r15d, %r15d
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0x26e5
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x26fa
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2130
testb %r15b, %r15b
jne 0x279c
movq %r14, -0x68(%rbp)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x29ac
leaq -0xa8(%rbp), %rax
movups 0x10(%rax), %xmm0
movups %xmm0, 0x10(%r14)
movl -0xc8(%rbp), %eax
addl %eax, -0x48(%rbp)
movsd -0xc0(%rbp), %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x24a1
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2110
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x2627
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x2627
movl $0x10, %edi
callq 0x2090
movq %rax, %r15
movq %rax, %rdi
leaq 0x853(%rip), %rsi       # 0x3006
callq 0x2050
movq %r15, %rdi
movq 0x282e(%rip), %rsi      # 0x4ff0
movq 0x27f7(%rip), %rdx      # 0x4fc0
callq 0x21e0
jmp 0x292d
jmp 0x27e7
movq %rdx, -0x38(%rbp)
movq %rax, -0x30(%rbp)
movq %r15, %rdi
callq 0x20e0
jmp 0x2817
movq %rdx, %r15
movq %rax, -0x30(%rbp)
jmp 0x2839
movq %rdx, -0x38(%rbp)
movq %rax, -0x30(%rbp)
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x2817
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x2817
movq %rdx, -0x38(%rbp)
movq %rax, -0x30(%rbp)
movq -0x38(%rbp), %r15
jmp 0x2839
movq %rdx, %r15
movq %rax, -0x30(%rbp)
movq -0x68(%rbp), %rdi
cmpq %r14, %rdi
je 0x2839
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2130
cmpl $0x1, %r15d
jne 0x2951
movq -0x30(%rbp), %r15
movq %r15, %rdi
callq 0x2170
movq %r12, %rdi
movq %rax, %rsi
callq 0x2070
movq %r15, %rdi
callq 0x2060
movq %r12, %rdi
callq 0x21a0
movq %r13, %rdi
movq %rax, %rsi
callq 0x2120
movq %rax, %r15
movl $0x19, %edx
movq %rax, %rdi
leaq 0x79c(%rip), %rsi       # 0x3023
callq 0x2150
movq %r15, %rdi
callq 0x2080
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x20(%rbx,%rax), %r15d
movb -0x88(%rbp), %al
movb %al, -0x30(%rbp)
movq %r12, %rdi
callq 0x2228
callq 0x21d0
testb $0x5, %r15b
jne 0x28d5
cmpb $0x6e, -0x30(%rbp)
jne 0x2627
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x28f7
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x2919
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2130
xorl %eax, %eax
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x294d
jmp 0x2931
movq %rax, -0x30(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x2228
callq 0x21d0
jmp 0x2951
movq %rax, %rdi
callq 0x299e
movq %rax, -0x30(%rbp)
movq -0xe8(%rbp), %rdi
leaq -0xd8(%rbp), %rax
cmpq %rax, %rdi
je 0x2973
movq -0xd8(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0xb8(%rbp), %rdi
leaq -0xa8(%rbp), %rax
cmpq %rax, %rdi
je 0x2995
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0x30(%rbp), %rdi
callq 0x2200