// File: /workspace/github_cpp_makefile_star2_O3/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 $0xb8, %rsp
leaq -0xa0(%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 -0xd0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movl %eax, 0x10(%rcx)
movq %rax, 0x18(%rcx)
leaq -0x50(%rbp), %r15
movq 0x29c8(%rip), %rbx      # 0x4fd8
leaq -0x60(%rbp), %r12
movq 0x29ad(%rip), %r13      # 0x4fc8
movq %rbx, %rdi
leaq -0xb0(%rbp), %rsi
callq 0x23d3
movq %rbx, %rdi
leaq -0xe0(%rbp), %rsi
callq 0x23d3
movq (%rbx), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x20(%rbx,%rax)
jne 0x28cb
movq %r15, -0x60(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x29a0
leaq -0x70(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0xe0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x80(%rbp), %rdi
callq 0x29a0
movq -0x58(%rbp), %rdx
cmpq -0x78(%rbp), %rdx
jne 0x26b1
movq -0x80(%rbp), %r14
testq %rdx, %rdx
je 0x26ba
movq -0x60(%rbp), %rdi
movq %r14, %rsi
callq 0x2140
testl %eax, %eax
setne %r12b
jmp 0x26bd
movb $0x1, %r12b
movq -0x80(%rbp), %r14
jmp 0x26bd
xorl %r12d, %r12d
leaq -0x70(%rbp), %rax
cmpq %rax, %r14
je 0x26d5
movq -0x70(%rbp), %rsi
incq %rsi
movq %r14, %rdi
callq 0x2130
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x26ea
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2130
testb %r12b, %r12b
jne 0x2790
movq %r15, -0x60(%rbp)
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x60(%rbp), %r12
movq %r12, %rdi
callq 0x29a0
leaq -0xa0(%rbp), %rax
movups 0x10(%rax), %xmm0
movups %xmm0, 0x10(%r15)
movl -0xc0(%rbp), %eax
addl %eax, -0x40(%rbp)
movsd -0xb8(%rbp), %xmm0
addsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x38(%rbp)
movq %r13, %rdi
movq %r12, %rsi
callq 0x2495
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 -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x261b
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x261b
movl $0x10, %edi
callq 0x2090
movq %rax, %r14
movq %rax, %rdi
leaq 0x85f(%rip), %rsi       # 0x3006
callq 0x2050
movq %r14, %rdi
movq 0x283a(%rip), %rsi      # 0x4ff0
movq 0x2803(%rip), %rdx      # 0x4fc0
callq 0x21e0
jmp 0x2923
movq %rax, %r14
jmp 0x27dd
movq %rdx, %r12
movq %r14, %rdi
movq %rax, %r14
callq 0x20e0
movq %r12, %rdx
leaq -0x60(%rbp), %r12
jmp 0x2837
movq %rdx, -0x30(%rbp)
movq %rax, %r14
jmp 0x2833
movq %rdx, -0x30(%rbp)
movq %rax, %r14
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x2811
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2130
jmp 0x2811
movq %rdx, -0x30(%rbp)
movq %rax, %r14
leaq -0x60(%rbp), %r12
jmp 0x2833
movq %rdx, -0x30(%rbp)
movq %rax, %r14
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x2833
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0x30(%rbp), %rdx
cmpl $0x1, %edx
jne 0x2945
movq %r14, %rdi
callq 0x2170
movq %r12, %rdi
movq %rax, %rsi
callq 0x2070
movq %r14, %rdi
callq 0x2060
movq %r12, %rdi
callq 0x21a0
movq %r13, %rdi
movq %rax, %rsi
callq 0x2120
movq %rax, %r14
movl $0x19, %edx
movq %rax, %rdi
leaq 0x7a3(%rip), %rsi       # 0x3023
callq 0x2150
movq %r14, %rdi
callq 0x2080
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl 0x20(%rbx,%rax), %r12d
movb -0x80(%rbp), %r14b
leaq -0x60(%rbp), %rdi
callq 0x2228
callq 0x21d0
testb $0x5, %r12b
leaq -0x60(%rbp), %r12
jne 0x28cb
cmpb $0x6e, %r14b
jne 0x261b
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x28ed
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x290f
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2130
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2942
jmp 0x2927
movq %rax, %r14
leaq -0x60(%rbp), %rdi
callq 0x2228
callq 0x21d0
jmp 0x2945
movq %rax, %rdi
callq 0x2991
movq %rax, %r14
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x2967
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x2130
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x2989
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2130
movq %r14, %rdi
callq 0x2200