// File: aisthesis[P]realnumber/tst/array_arithmetic_test.cpp
// Function: bits::shift_right_invoker()
BOOST_AUTO_TEST_CASE(shift_right) {
		unsigned char arr[] = {129, 129, 129};
		array_arithmetic::bits::shift_right(arr, 1, 3);
		BOOST_CHECK_EQUAL(arr[0], 64);
		BOOST_CHECK_EQUAL(arr[1], 192);
		BOOST_CHECK_EQUAL(arr[2], 192);
		// reset array to original values
		for (std::size_t i = 0; i < 3; ++i) { arr[i] = 129; }
		array_arithmetic::bits::shift_right(arr, 15, 3);
		BOOST_CHECK_EQUAL(arr[0], 0);
		BOOST_CHECK_EQUAL(arr[1], 1);
		BOOST_CHECK_EQUAL(arr[2], 3);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9c0, %rsp            # imm = 0x9C0
movq 0x15bfe(%rip), %rax     # 0x25220
movq %rax, -0x8e8(%rbp)
leaq 0xd9df(%rip), %rsi      # 0x1d00f
leaq -0x10(%rbp), %rdi
movl $0x1d, %edx
callq 0x17390
leaq -0x1b8(%rbp), %rdi
movq %rdi, -0x8e0(%rbp)
xorl %esi, %esi
movl $0x198, %edx            # imm = 0x198
callq 0x30d0
movq -0x8e0(%rbp), %rdi
callq 0x18120
movq -0x8e0(%rbp), %rdi
callq 0x18150
movq %rax, %rdi
movb $0x22, -0x1b9(%rbp)
leaq -0x1b9(%rbp), %rsi
callq 0x180e0
movq %rax, -0x8d8(%rbp)
jmp 0xf68f
movq -0x8d8(%rbp), %rdi
leaq 0xdc01(%rip), %rsi      # 0x1d29e
callq 0x184d0
movq %rax, -0x8f0(%rbp)
jmp 0xf6ab
movq -0x8f0(%rbp), %rdi
leaq 0xe2d0(%rip), %rsi      # 0x1d989
callq 0x18080
movq %rax, -0x8f8(%rbp)
jmp 0xf6c7
movq -0x8f8(%rbp), %rdi
callq 0x18160
movq %rax, -0x900(%rbp)
jmp 0xf6dc
movq -0x900(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x18020
jmp 0xf6ee
movq -0x8e8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
movl $0xbf, %edx
leaq -0x20(%rbp), %rcx
callq 0x3390
jmp 0xf709
leaq -0x1b8(%rbp), %rdi
callq 0x181b0
movq 0x15b04(%rip), %rax     # 0x25220
movq %rax, -0x918(%rbp)
leaq 0xd8e5(%rip), %rsi      # 0x1d00f
leaq -0x1e0(%rbp), %rdi
movl $0x1d, %edx
callq 0x17390
leaq -0x388(%rbp), %rdi
movq %rdi, -0x910(%rbp)
xorl %esi, %esi
movl $0x198, %edx            # imm = 0x198
callq 0x30d0
movq -0x910(%rbp), %rdi
callq 0x18120
movq -0x910(%rbp), %rdi
callq 0x18150
movq %rax, %rdi
movb $0x22, -0x389(%rbp)
leaq -0x389(%rbp), %rsi
callq 0x180e0
movq %rax, -0x908(%rbp)
jmp 0xf78c
movq -0x908(%rbp), %rdi
leaq 0xdb04(%rip), %rsi      # 0x1d29e
callq 0x184d0
movq %rax, -0x920(%rbp)
jmp 0xf7a8
movq -0x920(%rbp), %rdi
leaq 0xe1e2(%rip), %rsi      # 0x1d998
callq 0x18200
movq %rax, -0x928(%rbp)
jmp 0xf7c4
movq -0x928(%rbp), %rdi
callq 0x18160
movq %rax, -0x930(%rbp)
jmp 0xf7d9
movq -0x930(%rbp), %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x18020
jmp 0xf7ee
movq -0x918(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
movl $0xbf, %edx
leaq -0x1f0(%rbp), %rcx
callq 0x3390
jmp 0xf80f
leaq -0x388(%rbp), %rdi
callq 0x181b0
leaq -0x1cd(%rbp), %rdi
callq 0x18d50
movq 0x159f2(%rip), %rax     # 0x25220
movq %rax, -0x948(%rbp)
leaq 0xd7d3(%rip), %rsi      # 0x1d00f
leaq -0x3a0(%rbp), %rdi
movl $0x1d, %edx
callq 0x17390
leaq -0x548(%rbp), %rdi
movq %rdi, -0x940(%rbp)
xorl %esi, %esi
movl $0x198, %edx            # imm = 0x198
callq 0x30d0
movq -0x940(%rbp), %rdi
callq 0x18120
movq -0x940(%rbp), %rdi
callq 0x18150
movq %rax, %rdi
movb $0x22, -0x549(%rbp)
leaq -0x549(%rbp), %rsi
callq 0x180e0
movq %rax, -0x938(%rbp)
jmp 0xf89e
movq -0x938(%rbp), %rdi
leaq 0xd9f2(%rip), %rsi      # 0x1d29e
callq 0x184d0
movq %rax, -0x950(%rbp)
jmp 0xf8ba
movq -0x950(%rbp), %rdi
leaq 0xe0e0(%rip), %rsi      # 0x1d9a8
callq 0x18250
movq %rax, -0x958(%rbp)
jmp 0xf8d6
movq -0x958(%rbp), %rdi
callq 0x18160
movq %rax, -0x960(%rbp)
jmp 0xf8eb
movq -0x960(%rbp), %rsi
leaq -0x3b0(%rbp), %rdi
callq 0x18020
jmp 0xf900
movq -0x948(%rbp), %rdi
leaq -0x3a0(%rbp), %rsi
movl $0xbf, %edx
leaq -0x3b0(%rbp), %rcx
callq 0x3390
jmp 0xf921
leaq -0x548(%rbp), %rdi
callq 0x181b0
leaq -0x1cd(%rbp), %rdi
callq 0xfc10
movq 0x158e0(%rip), %rax     # 0x25220
movq %rax, -0x978(%rbp)
leaq 0xd6c1(%rip), %rsi      # 0x1d00f
leaq -0x560(%rbp), %rdi
movl $0x1d, %edx
callq 0x17390
leaq -0x708(%rbp), %rdi
movq %rdi, -0x970(%rbp)
xorl %esi, %esi
movl $0x198, %edx            # imm = 0x198
callq 0x30d0
movq -0x970(%rbp), %rdi
callq 0x18120
movq -0x970(%rbp), %rdi
callq 0x18150
movq %rax, %rdi
movb $0x22, -0x709(%rbp)
leaq -0x709(%rbp), %rsi
callq 0x180e0
movq %rax, -0x968(%rbp)
jmp 0xf9b0
movq -0x968(%rbp), %rdi
leaq 0xd8e0(%rip), %rsi      # 0x1d29e
callq 0x184d0
movq %rax, -0x980(%rbp)
jmp 0xf9cc
movq -0x980(%rbp), %rdi
leaq 0xdfdb(%rip), %rsi      # 0x1d9b5
callq 0x18280
movq %rax, -0x988(%rbp)
jmp 0xf9e8
movq -0x988(%rbp), %rdi
callq 0x18160
movq %rax, -0x990(%rbp)
jmp 0xf9fd
movq -0x990(%rbp), %rsi
leaq -0x570(%rbp), %rdi
callq 0x18020
jmp 0xfa12
movq -0x978(%rbp), %rdi
leaq -0x560(%rbp), %rsi
movl $0xbf, %edx
leaq -0x570(%rbp), %rcx
callq 0x3390
jmp 0xfa33
leaq -0x708(%rbp), %rdi
callq 0x181b0
leaq -0x1cd(%rbp), %rdi
callq 0x18d70
movq 0x157ce(%rip), %rax     # 0x25220
movq %rax, -0x9a8(%rbp)
leaq 0xd5af(%rip), %rsi      # 0x1d00f
leaq -0x720(%rbp), %rdi
movl $0x1d, %edx
callq 0x17390
leaq -0x8c8(%rbp), %rdi
movq %rdi, -0x9a0(%rbp)
xorl %esi, %esi
movl $0x198, %edx            # imm = 0x198
callq 0x30d0
movq -0x9a0(%rbp), %rdi
callq 0x18120
movq -0x9a0(%rbp), %rdi
callq 0x18150
movq %rax, %rdi
movb $0x22, -0x8c9(%rbp)
leaq -0x8c9(%rbp), %rsi
callq 0x180e0
movq %rax, -0x998(%rbp)
jmp 0xfac2
movq -0x998(%rbp), %rdi
leaq 0xd7ce(%rip), %rsi      # 0x1d29e
callq 0x184d0
movq %rax, -0x9b0(%rbp)
jmp 0xfade
movq -0x9b0(%rbp), %rdi
leaq 0xdedc(%rip), %rsi      # 0x1d9c8
callq 0x18080
movq %rax, -0x9b8(%rbp)
jmp 0xfafa
movq -0x9b8(%rbp), %rdi
callq 0x18160
movq %rax, -0x9c0(%rbp)
jmp 0xfb0f
movq -0x9c0(%rbp), %rsi
leaq -0x730(%rbp), %rdi
callq 0x18020
jmp 0xfb24
movq -0x9a8(%rbp), %rdi
leaq -0x720(%rbp), %rsi
movl $0xbf, %edx
leaq -0x730(%rbp), %rcx
callq 0x3390
jmp 0xfb45
leaq -0x8c8(%rbp), %rdi
callq 0x181b0
addq $0x9c0, %rsp            # imm = 0x9C0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x181b0
jmp 0xfbf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x388(%rbp), %rdi
callq 0x181b0
jmp 0xfbf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x548(%rbp), %rdi
callq 0x181b0
jmp 0xfbf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x708(%rbp), %rdi
callq 0x181b0
jmp 0xfbf8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1c8(%rbp)
movl %eax, -0x1cc(%rbp)
leaq -0x8c8(%rbp), %rdi
callq 0x181b0
movq -0x1c8(%rbp), %rdi
callq 0x3340
nopw %cs:(%rax,%rax)