// File: /workspace/github_cpp_makefile_star2_O2/aisthesis[P]realnumber/tst/array_arithmetic_test.cpp
// Function: division_helpers::readjust::test_method()
BOOST_AUTO_TEST_CASE(readjust) {
		unsigned char arr1[] = {129, 0};
		unsigned char arr2[] = {0, 129};
		unsigned char zero_arr[] = {0, 0};
		unsigned char arr3[] = {129, 129};
		// verify proper return value
		BOOST_CHECK_EQUAL(array_arithmetic::helpers::division::readjust(arr2, arr1, 2), 8);
		// arr1 properly shifted
		BOOST_CHECK_EQUAL(arr1[0], 0);
		BOOST_CHECK_EQUAL(arr1[1], 129);
		// arr2 unchanged
		BOOST_CHECK_EQUAL(arr2[0], 0);
		BOOST_CHECK_EQUAL(arr2[1], 129);
		// check edge case when dividend is 0
		BOOST_CHECK_EQUAL(array_arithmetic::helpers::division::readjust(zero_arr, arr3, 2), 16);
		BOOST_CHECK_EQUAL(arr3[0], 0);
		BOOST_CHECK_EQUAL(arr3[1], 0);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
leaq -0x3c(%rbp), %rbx
movw $0x81, (%rbx)
leaq -0x3a(%rbp), %r15
andw $0x0, -0x3e(%rbp)
movw $0x8100, (%r15)         # imm = 0x8100
movw $0x8181, -0x2a(%rbp)    # imm = 0x8181
movq 0xca21(%rip), %rdi      # 0x16198
leaq 0x78dd(%rip), %r12      # 0x1105b
leaq -0x1e8(%rbp), %rsi
movq %r12, (%rsi)
leaq 0x78e9(%rip), %r13      # 0x11078
movq %r13, 0x8(%rsi)
leaq 0x82c6(%rip), %rax      # 0x11a60
leaq -0x1d8(%rbp), %rcx
movq %rax, (%rcx)
movq %rax, 0x8(%rcx)
movl $0xaa, %edx
callq 0x32a0
movb $0x0, -0x60(%rbp)
leaq 0xc38b(%rip), %rax      # 0x15b48
movq %rax, -0x68(%rbp)
movq 0xc800(%rip), %rax      # 0x15fc8
movq %rax, -0x58(%rbp)
leaq 0x85fe(%rip), %rax      # 0x11dd1
movq %rax, -0x50(%rbp)
movq %r12, -0x88(%rbp)
movq %r13, -0x80(%rbp)
leaq -0x38(%rbp), %rdx
movq $0x2, (%rdx)
movq %r15, %rdi
movq %rbx, %rsi
callq 0xfaf5
leaq -0x48(%rbp), %r9
movl %eax, (%r9)
leaq -0x44(%rbp), %r11
movl $0x8, (%r11)
subq $0x8, %rsp
leaq 0x7d52(%rip), %rax      # 0x11567
leaq 0x7d56(%rip), %r10      # 0x11572
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
movl $0xaa, %edx
pushq %rax
pushq %r11
pushq %r10
callq 0xede4
addq $0x20, %rsp
movq 0xc950(%rip), %rdi      # 0x16198
leaq -0x1c8(%rbp), %rsi
movq %r12, (%rsi)
movq %r13, 0x8(%rsi)
leaq -0x1b8(%rbp), %rcx
leaq 0x81fc(%rip), %r14      # 0x11a60
movq %r14, (%rcx)
movq %r14, 0x8(%rcx)
movl $0xac, %edx
callq 0x32a0
xorl %eax, %eax
movq %r13, %r15
leaq -0x68(%rbp), %r13
movb %al, 0x8(%r13)
leaq 0xc2bf(%rip), %rax      # 0x15b48
movq %rax, (%r13)
movq 0xc734(%rip), %rax      # 0x15fc8
movq %rax, 0x10(%r13)
leaq 0x8532(%rip), %rax      # 0x11dd1
movq %rax, 0x18(%r13)
leaq -0x1a8(%rbp), %rsi
movq %r12, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x38(%rbp), %rax
andl $0x0, (%rax)
subq $0x8, %rsp
leaq 0x7a25(%rip), %r10      # 0x112e8
leaq 0x7be5(%rip), %rax      # 0x114af
pushq $0x1
popq %rcx
movq %r12, %rbx
pushq $0x2
popq %r8
leaq -0x3c(%rbp), %r9
movl $0xac, %edx
movq %r13, %rdi
pushq %r10
leaq -0x38(%rbp), %r10
pushq %r10
pushq %rax
callq 0xecf5
addq $0x20, %rsp
movq 0xc89f(%rip), %rdi      # 0x16198
leaq -0x198(%rbp), %rsi
movq %r12, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x188(%rbp), %rcx
movq %r14, (%rcx)
movq %r14, 0x8(%rcx)
movl $0xad, %edx
callq 0x32a0
xorl %eax, %eax
movb %al, 0x8(%r13)
leaq 0xc21c(%rip), %rax      # 0x15b48
movq %rax, (%r13)
movq 0xc691(%rip), %rax      # 0x15fc8
movq %rax, 0x10(%r13)
leaq 0x848f(%rip), %rax      # 0x11dd1
movq %rax, 0x18(%r13)
leaq -0x178(%rbp), %rsi
movq %r12, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x3b(%rbp), %r9
movl $0x81, %eax
leaq -0x38(%rbp), %r12
movl %eax, (%r12)
subq $0x8, %rsp
leaq 0x7b62(%rip), %r10      # 0x114d2
leaq 0x7b40(%rip), %rax      # 0x114b7
movl $0xad, %edx
movq %r13, %rdi
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
pushq %r10
leaq -0x38(%rbp), %r10
pushq %r10
pushq %rax
callq 0xecf5
addq $0x20, %rsp
movq 0xc7f9(%rip), %rdi      # 0x16198
leaq -0x168(%rbp), %rsi
movq %rbx, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x158(%rbp), %rcx
movq %r14, (%rcx)
movq %r14, 0x8(%rcx)
movl $0xaf, %edx
callq 0x32a0
xorl %eax, %eax
movb %al, 0x8(%r13)
leaq 0xc176(%rip), %rax      # 0x15b48
movq %rax, (%r13)
movq 0xc5eb(%rip), %rax      # 0x15fc8
movq %rax, 0x10(%r13)
leaq 0x83e9(%rip), %rax      # 0x11dd1
movq %rax, 0x18(%r13)
leaq -0x148(%rbp), %rsi
movq %rbx, (%rsi)
movq %r15, 0x8(%rsi)
andl $0x0, (%r12)
subq $0x8, %rsp
leaq 0x7ab8(%rip), %rax      # 0x114c2
leaq -0x3a(%rbp), %r9
movl $0xaf, %edx
movq %r13, %rdi
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
leaq 0x78c4(%rip), %r10      # 0x112e8
pushq %r10
leaq -0x38(%rbp), %r10
pushq %r10
pushq %rax
callq 0xecf5
addq $0x20, %rsp
movq 0xc75b(%rip), %rdi      # 0x16198
leaq -0x138(%rbp), %rsi
movq %rbx, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x128(%rbp), %rcx
movq %r14, (%rcx)
movq %r14, 0x8(%rcx)
movl $0xb0, %edx
callq 0x32a0
xorl %eax, %eax
movb %al, 0x8(%r13)
leaq 0xc0d8(%rip), %rax      # 0x15b48
movq %rax, (%r13)
movq 0xc54d(%rip), %rax      # 0x15fc8
movq %rax, 0x10(%r13)
leaq 0x834b(%rip), %rax      # 0x11dd1
movq %rax, 0x18(%r13)
leaq -0x118(%rbp), %rsi
movq %rbx, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0x39(%rbp), %r9
movl $0x81, %eax
movl %eax, (%r12)
subq $0x8, %rsp
leaq 0x7a1a(%rip), %rax      # 0x114ca
movl $0xb0, %edx
movq %r13, %rdi
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
leaq 0x7a0c(%rip), %r10      # 0x114d2
pushq %r10
leaq -0x38(%rbp), %r10
pushq %r10
pushq %rax
callq 0xecf5
addq $0x20, %rsp
movq 0xc6b9(%rip), %rdi      # 0x16198
leaq -0x108(%rbp), %rsi
movq %rbx, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0xf8(%rbp), %rcx
movq %r14, (%rcx)
movq %r14, 0x8(%rcx)
movl $0xb2, %edx
callq 0x32a0
xorl %eax, %eax
movb %al, 0x8(%r13)
leaq 0xc036(%rip), %rax      # 0x15b48
movq %rax, (%r13)
movq 0xc4ab(%rip), %rax      # 0x15fc8
movq %rax, 0x10(%r13)
leaq 0x82a9(%rip), %rax      # 0x11dd1
movq %rax, 0x18(%r13)
movq %rbx, -0x78(%rbp)
movq %r15, -0x70(%rbp)
leaq -0x38(%rbp), %rdx
movq $0x2, (%rdx)
leaq -0x3e(%rbp), %rdi
leaq -0x2a(%rbp), %rsi
callq 0xfaf5
leaq -0x48(%rbp), %r9
movl %eax, (%r9)
movl $0x10, -0x44(%rbp)
subq $0x8, %rsp
leaq 0x7a8b(%rip), %rax      # 0x115f0
leaq 0x7a43(%rip), %r10      # 0x115af
leaq -0x68(%rbp), %rdi
leaq -0x78(%rbp), %rsi
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
movl $0xb2, %edx
pushq %rax
leaq -0x44(%rbp), %rax
pushq %rax
pushq %r10
callq 0xede4
addq $0x20, %rsp
movq 0xc600(%rip), %rdi      # 0x16198
leaq -0xe8(%rbp), %rsi
movq %rbx, (%rsi)
movq %r15, 0x8(%rsi)
leaq -0xd8(%rbp), %rcx
leaq 0x7eac(%rip), %r14      # 0x11a60
movq %r14, (%rcx)
movq %r14, 0x8(%rcx)
movl $0xb3, %edx
callq 0x32a0
xorl %eax, %eax
movq %rbx, %r13
leaq -0x68(%rbp), %r12
movb %al, 0x8(%r12)
leaq 0xbf6e(%rip), %rbx      # 0x15b48
movq %rbx, (%r12)
movq 0xc3e3(%rip), %rax      # 0x15fc8
movq %rax, 0x10(%r12)
leaq 0x81e0(%rip), %rax      # 0x11dd1
movq %rax, 0x18(%r12)
leaq -0xc8(%rbp), %rsi
movq %r13, (%rsi)
movq %r15, 0x8(%rsi)
andl $0x0, -0x38(%rbp)
subq $0x8, %rsp
leaq 0x79e0(%rip), %rax      # 0x115f3
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
leaq -0x2a(%rbp), %r9
movl $0xb3, %edx
movq %r12, %rdi
movq %r14, %r15
leaq 0x76b8(%rip), %r14      # 0x112e8
pushq %r14
leaq -0x38(%rbp), %rbx
pushq %rbx
pushq %rax
callq 0xecf5
addq $0x20, %rsp
movq 0xc550(%rip), %rdi      # 0x16198
leaq -0xb8(%rbp), %rsi
movq %r13, (%rsi)
leaq 0x741f(%rip), %rbx      # 0x11078
movq %rbx, 0x8(%rsi)
leaq -0xa8(%rbp), %rcx
movq %r15, (%rcx)
movq %r15, 0x8(%rcx)
movl $0xb4, %edx
callq 0x32a0
xorl %eax, %eax
movb %al, 0x8(%r12)
leaq 0xbec5(%rip), %rax      # 0x15b48
movq %rax, (%r12)
movq 0xc33a(%rip), %rax      # 0x15fc8
movq %rax, 0x10(%r12)
leaq 0x8137(%rip), %rax      # 0x11dd1
movq %rax, 0x18(%r12)
leaq -0x98(%rbp), %rsi
movq %r13, (%rsi)
movq %rbx, 0x8(%rsi)
leaq -0x29(%rbp), %r9
andl $0x0, -0x38(%rbp)
subq $0x8, %rsp
leaq 0x793b(%rip), %rax      # 0x115fb
leaq -0x68(%rbp), %rdi
movl $0xb4, %edx
pushq $0x1
popq %rcx
pushq $0x2
popq %r8
pushq %r14
leaq -0x38(%rbp), %r10
pushq %r10
pushq %rax
callq 0xecf5
addq $0x1e8, %rsp            # imm = 0x1E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x9cf6
jmp 0x9cf6
jmp 0x9cf6
movq %rax, %rdi
callq 0x3260