int FindMultipleSum(int number) {
  int sum = 0;
  sum = ((3 + (number / 3) * 3) * (number / 3)) / 2 +
        ((5 + (number / 5) * 5) * (number / 5)) / 2 -
        ((15 + (number / 15) * 15) * (number / 15)) / 2;
  return sum;
}


x86 assembly (clang, -O0):
<FindMultipleSum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
imul   $0x5,%eax,%eax
add    $0x5,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
imul   $0xf,%eax,%eax
add    $0xf,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindMultipleSum>:
movslq %edi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%edx
add    $0x3,%edx
imul   %eax,%edx
mov    %edx,%esi
shr    $0x1f,%esi
add    %edx,%esi
sar    %esi
imul   $0x66666667,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
sar    %eax
add    %edx,%eax
lea    (%rax,%rax,4),%edx
add    $0x5,%edx
imul   %eax,%edx
mov    %edx,%eax
shr    $0x1f,%eax
add    %edx,%eax
sar    %eax
add    %esi,%eax
imul   $0xffffffff88888889,%rcx,%rdx
shr    $0x20,%rdx
add    %edx,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x3,%ecx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%edx
lea    (%rdx,%rdx,2),%edx
add    $0xf,%edx
imul   %ecx,%edx
mov    %edx,%ecx
shr    $0x1f,%ecx
add    %edx,%ecx
sar    %ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @FindMultipleSum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 3
%7 = add nsw i32 3, %6
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 3
%10 = mul nsw i32 %7, %9
%11 = sdiv i32 %10, 2
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 5
%14 = mul nsw i32 %13, 5
%15 = add nsw i32 5, %14
%16 = load i32, i32* %2
%17 = sdiv i32 %16, 5
%18 = mul nsw i32 %15, %17
%19 = sdiv i32 %18, 2
%20 = add nsw i32 %11, %19
%21 = load i32, i32* %2
%22 = sdiv i32 %21, 15
%23 = mul nsw i32 %22, 15
%24 = add nsw i32 15, %23
%25 = load i32, i32* %2
%26 = sdiv i32 %25, 15
%27 = mul nsw i32 %24, %26
%28 = sdiv i32 %27, 2
%29 = sub nsw i32 %20, %28
store i32 %29, i32* %3
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @FindMultipleSum(i32 %0) {
%2 = sdiv i32 %0, 3
%3 = mul nsw i32 %2, 3
%4 = add nsw i32 %3, 3
%5 = mul nsw i32 %4, %2
%6 = sdiv i32 %5, 2
%7 = sdiv i32 %0, 5
%8 = mul nsw i32 %7, 5
%9 = add nsw i32 %8, 5
%10 = mul nsw i32 %9, %7
%11 = sdiv i32 %10, 2
%12 = add nsw i32 %6, %11
%13 = sdiv i32 %0, 15
%14 = mul nsw i32 %13, 15
%15 = add nsw i32 %14, 15
%16 = mul nsw i32 %15, %13
%17 = sdiv i32 %16, -2
%18 = add i32 %12, %17
ret i32 %18
}