// File: ocornoc[P]crolol/tests/basic_arith.cpp
// Function: add_test()
bool add_test()
{
	bool success = true;
	
	for (const argans& arg_and_ans: add_args) {
		const crolol::num lhs = arg_and_ans.first.first;
		const crolol::num rhs = arg_and_ans.first.second;
		const crolol::num ans = arg_and_ans.second;
		const crolol::num result = lhs + rhs;
		
		if (!crolol::equals(ans, result)) {
			success = false;
			
			std::cout << static_cast<std::string>(lhs) << " + "
				<< static_cast<std::string>(rhs)
				<< " should be "
				<< static_cast<std::string>(ans) << ", was "
				<< static_cast<std::string>(result)
				<< std::endl;
		}
	}
	
	std::cout << "Addition: ";
	report(success);
	
	return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movb $0x1, -0x1(%rbp)
leaq 0x386ca(%rip), %rax     # 0x40410
movq %rax, -0x10(%rbp)
leaq 0x386bf(%rip), %rdi     # 0x40410
callq 0x9170
movq %rax, -0x18(%rbp)
leaq 0x386af(%rip), %rdi     # 0x40410
callq 0x91a0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x91d0
testb $0x1, %al
jne 0x7d80
jmp 0x7fe5
leaq -0x18(%rbp), %rdi
callq 0x9210
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0xa310
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x9cd0
testb $0x1, %al
jne 0x7fd5
movb $0x0, -0x1(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0x108(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x9d70
movq -0x108(%rbp), %rsi
movq 0x38199(%rip), %rdi     # 0x3ffb8
callq 0x5380
movq %rax, -0x100(%rbp)
jmp 0x7e2d
movq -0x100(%rbp), %rdi
leaq 0x24283(%rip), %rsi     # 0x2c0be
callq 0x53d0
movq %rax, -0x110(%rbp)
jmp 0x7e49
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9d70
jmp 0x7e5b
movq -0x110(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5380
movq %rax, -0x118(%rbp)
jmp 0x7e77
movq -0x118(%rbp), %rdi
leaq 0x2423d(%rip), %rsi     # 0x2c0c2
callq 0x53d0
movq %rax, -0x120(%rbp)
jmp 0x7e93
leaq -0xd8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x9d70
jmp 0x7ea5
movq -0x120(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x5380
movq %rax, -0x128(%rbp)
jmp 0x7ec1
movq -0x128(%rbp), %rdi
leaq 0x241ff(%rip), %rsi     # 0x2c0ce
callq 0x53d0
movq %rax, -0x130(%rbp)
jmp 0x7edd
leaq -0xf8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x9d70
jmp 0x7eef
movq -0x130(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5380
movq %rax, -0x138(%rbp)
jmp 0x7f0b
movq -0x138(%rbp), %rdi
movq 0x3805f(%rip), %rsi     # 0x3ff78
callq 0x5410
jmp 0x7f20
leaq -0xf8(%rbp), %rdi
callq 0x5250
leaq -0xd8(%rbp), %rdi
callq 0x5250
leaq -0xb8(%rbp), %rdi
callq 0x5250
leaq -0x88(%rbp), %rdi
callq 0x5250
jmp 0x7fd5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x7fc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x7fbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x7faf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0xf8(%rbp), %rdi
callq 0x5250
leaq -0xd8(%rbp), %rdi
callq 0x5250
leaq -0xb8(%rbp), %rdi
callq 0x5250
leaq -0x88(%rbp), %rdi
callq 0x5250
jmp 0x8013
jmp 0x7fd7
leaq -0x18(%rbp), %rdi
callq 0x9230
jmp 0x7d6a
movq 0x37fcc(%rip), %rdi     # 0x3ffb8
leaq 0x240e2(%rip), %rsi     # 0x2c0d5
callq 0x53d0
movb -0x1(%rbp), %al
andb $0x1, %al
movzbl %al, %edi
callq 0x7b80
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x56b0
nop