BOOST_AUTO_TEST_CASE($Mod) {
  TESTCASE2($Mod, 0, 1, 0);
  TESTCASE2($Mod, 8, 3, 2);
  TESTCASE2($Mod, 8, -3, 2);
  TESTCASE2($Mod, -8, 3, 1);
  TESTCASE2($Mod, -8, -3, 1);
  TESTCASE2($Mod, 1, 2, 1);
  TESTCASE2($Mod, 1, -2, 1);
  TESTCASE2($Mod, -1, 2, 1);
  TESTCASE2($Mod, -1, -2, 1);
  TESTCASE2($Mod, 2.25, 1, 0.25);
  TESTCASE2($Mod, 7.5, 3.5, 0.5);
  TESTCASE2($Mod, -7.5, 3.5, 3);
  TESTCASE2($Mod, -7.5, 3.5, 3);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x8,%esi
mov    $0xfffffffd,%edx
mov    $0x2,%ecx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0xfffffff8,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0xfffffff8,%esi
mov    $0xfffffffd,%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%ecx
mov    $0x2,%edx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%ecx
mov    $0xfffffffe,%edx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0xfffffffe,%edx
mov    $0x1,%ecx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
movsd  0xe25(%rip),%xmm0
mov    $0x1,%esi
movsd  0xe20(%rip),%xmm1
mov    $0x2,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
movsd  0xdf6(%rip),%xmm0
movsd  0xde6(%rip),%xmm1
movsd  0xdee(%rip),%xmm2
mov    $0x3,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
movsd  0xdc4(%rip),%xmm0
movsd  0xdc4(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
movsd  0xda5(%rip),%xmm0
movsd  0xda5(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%al
call   1030 <TESTCASE2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x8,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x8,%esi
mov    $0xfffffffd,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0xfffffff8,%esi
mov    $0x3,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0xfffffff8,%esi
mov    $0xfffffffd,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0xfffffffe,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0xffffffff,%esi
mov    $0xfffffffe,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
movsd  0xe15(%rip),%xmm0
movsd  0xe15(%rip),%xmm1
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x2,%al
call   1030 <TESTCASE2@plt>
movsd  0xe07(%rip),%xmm0
movsd  0xe07(%rip),%xmm1
movsd  0xe07(%rip),%xmm2
mov    %ebx,%edi
mov    $0x3,%al
call   1030 <TESTCASE2@plt>
movsd  0xdfe(%rip),%xmm0
mov    %ebx,%edi
movsd  0xde4(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%al
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
movsd  0xdde(%rip),%xmm0
movsd  0xdc6(%rip),%xmm1
mov    $0x3,%esi
mov    $0x2,%al
pop    %rbx
jmp    1030 <TESTCASE2@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %4, i32 0, i32 1, i32 0)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %6, i32 8, i32 3, i32 2)
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %8, i32 8, i32 -3, i32 2)
%10 = load i32, i32* %3
%11 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %10, i32 -8, i32 3, i32 1)
%12 = load i32, i32* %3
%13 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %12, i32 -8, i32 -3, i32 1)
%14 = load i32, i32* %3
%15 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %14, i32 1, i32 2, i32 1)
%16 = load i32, i32* %3
%17 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %16, i32 1, i32 -2, i32 1)
%18 = load i32, i32* %3
%19 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %18, i32 -1, i32 2, i32 1)
%20 = load i32, i32* %3
%21 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %20, i32 -1, i32 -2, i32 1)
%22 = load i32, i32* %3
%23 = call i32 (i32, double, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, i32, double, ...)*)(i32 %22, double 2.250000e+00, i32 1, double 2.500000e-01)
%24 = load i32, i32* %3
%25 = call i32 (i32, double, double, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, double, double, ...)*)(i32 %24, double 7.500000e+00, double 3.500000e+00, double 5.000000e-01)
%26 = load i32, i32* %3
%27 = call i32 (i32, double, double, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, double, i32, ...)*)(i32 %26, double -7.500000e+00, double 3.500000e+00, i32 3)
%28 = load i32, i32* %3
%29 = call i32 (i32, double, double, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, double, i32, ...)*)(i32 %28, double -7.500000e+00, double 3.500000e+00, i32 3)
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1, i32 0)
%3 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 8, i32 3, i32 2)
%4 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 8, i32 -3, i32 2)
%5 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 -8, i32 3, i32 1)
%6 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 -8, i32 -3, i32 1)
%7 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 2, i32 1)
%8 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 -2, i32 1)
%9 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 -1, i32 2, i32 1)
%10 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 -1, i32 -2, i32 1)
%11 = tail call i32 (i32, double, i32, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, i32, double, ...)*)(i32 %0, double 2.250000e+00, i32 1, double 2.500000e-01)
%12 = tail call i32 (i32, double, double, double, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, double, double, ...)*)(i32 %0, double 7.500000e+00, double 3.500000e+00, double 5.000000e-01)
%13 = tail call i32 (i32, double, double, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, double, i32, ...)*)(i32 %0, double -7.500000e+00, double 3.500000e+00, i32 3)
%14 = tail call i32 (i32, double, double, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, double, double, i32, ...)*)(i32 %0, double -7.500000e+00, double 3.500000e+00, i32 3)
ret i32 undef
}