// File: ocornoc[P]crolol/tests/basic_arith.cpp
// Function: sub_test()
bool sub_test()
{
	bool success = true;
	
	for (const argans& arg_and_ans: sub_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 << "Subtraction: ";
	report(success);
	
	return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movb $0x1, -0x1(%rbp)
leaq 0x383f2(%rip), %rax     # 0x40428
movq %rax, -0x10(%rbp)
leaq 0x383e7(%rip), %rdi     # 0x40428
callq 0x9170
movq %rax, -0x18(%rbp)
leaq 0x383d7(%rip), %rdi     # 0x40428
callq 0x91a0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x91d0
testb $0x1, %al
jne 0x8070
jmp 0x82d5
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 0xa350
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 0x82c5
movb $0x0, -0x1(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0x108(%rbp)
leaq -0x30(%rbp), %rsi
callq 0x9d70
movq -0x108(%rbp), %rsi
movq 0x37ea9(%rip), %rdi     # 0x3ffb8
callq 0x5380
movq %rax, -0x100(%rbp)
jmp 0x811d
movq -0x100(%rbp), %rdi
leaq 0x23fb5(%rip), %rsi     # 0x2c0e0
callq 0x53d0
movq %rax, -0x110(%rbp)
jmp 0x8139
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x9d70
jmp 0x814b
movq -0x110(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5380
movq %rax, -0x118(%rbp)
jmp 0x8167
movq -0x118(%rbp), %rdi
leaq 0x23f4d(%rip), %rsi     # 0x2c0c2
callq 0x53d0
movq %rax, -0x120(%rbp)
jmp 0x8183
leaq -0xd8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x9d70
jmp 0x8195
movq -0x120(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x5380
movq %rax, -0x128(%rbp)
jmp 0x81b1
movq -0x128(%rbp), %rdi
leaq 0x23f0f(%rip), %rsi     # 0x2c0ce
callq 0x53d0
movq %rax, -0x130(%rbp)
jmp 0x81cd
leaq -0xf8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x9d70
jmp 0x81df
movq -0x130(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x5380
movq %rax, -0x138(%rbp)
jmp 0x81fb
movq -0x138(%rbp), %rdi
movq 0x37d6f(%rip), %rsi     # 0x3ff78
callq 0x5410
jmp 0x8210
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 0x82c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x82b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x82ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x829f
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 0x8303
jmp 0x82c7
leaq -0x18(%rbp), %rdi
callq 0x9230
jmp 0x805a
movq 0x37cdc(%rip), %rdi     # 0x3ffb8
leaq 0x23e01(%rip), %rsi     # 0x2c0e4
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