#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
double pow(int, int);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  double sum_of_the_squres = 0;
  for (int i = 1; i <= 100; ++i) {
    sum_of_the_squres += pow(i, 2);
  }
  int sum = 0;
  double square_of_the_sum = 0;
  for (int i = 1; i <= 100; ++i) {
    sum += i;
  }
  square_of_the_sum = pow(sum, 2);
  printf("%f", square_of_the_sum - sum_of_the_squres);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x64,-0x1c(%rbp)
jg     1174 <main+0x54>
mov    -0x1c(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1145 <main+0x25>
movl   $0x0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
cmpl   $0x64,-0x2c(%rbp)
jg     11ab <main+0x8b>
mov    -0x2c(%rbp),%eax
add    -0x20(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    118a <main+0x6a>
mov    -0x20(%rbp),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
lea    0xe32(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x1(%rbx),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x2(%rbx),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x3(%rbx),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x4(%rbx),%edi
mov    $0x2,%esi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
add    $0x5,%ebx
cmp    $0x65,%ebx
jne    1140 <main+0x20>
mov    $0x13ba,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
subsd  0x8(%rsp),%xmm0
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
store i32 1, i32* %7
br label %11
11: ; preds = %19, %2
%12 = load i32, i32* %7
%13 = icmp sle i32 %12, 100
br i1 %13, label %14, label %22
14: ; preds = %11
%15 = load i32, i32* %7
%16 = call double @pow(i32 %15, i32 2)
%17 = load double, double* %6
%18 = fadd double %17, %16
store double %18, double* %6
br label %19
19: ; preds = %14
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
store i32 %21, i32* %7
br label %11
22: ; preds = %11
store i32 0, i32* %8
store double 0.000000e+00, double* %9
store i32 1, i32* %10
br label %23
23: ; preds = %30, %22
%24 = load i32, i32* %10
%25 = icmp sle i32 %24, 100
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = load i32, i32* %10
%28 = load i32, i32* %8
%29 = add nsw i32 %28, %27
store i32 %29, i32* %8
br label %30
30: ; preds = %26
%31 = load i32, i32* %10
%32 = add nsw i32 %31, 1
store i32 %32, i32* %10
br label %23
33: ; preds = %23
%34 = load i32, i32* %8
%35 = call double @pow(i32 %34, i32 2)
store double %35, double* %9
%36 = load double, double* %9
%37 = load double, double* %6
%38 = fsub double %36, %37
%39 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %7
3: ; preds = %7
%4 = tail call double @pow(i32 5050, i32 2)
%5 = fsub double %4, %23
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %5)
ret i32 0
7: ; preds = %7, %2
%8 = phi i32 [ 1, %2 ], [ %24, %7 ]
%9 = phi double [ 0.000000e+00, %2 ], [ %23, %7 ]
%10 = tail call double @pow(i32 %8, i32 2)
%11 = fadd double %9, %10
%12 = add nuw nsw i32 %8, 1
%13 = tail call double @pow(i32 %12, i32 2)
%14 = fadd double %11, %13
%15 = add nuw nsw i32 %8, 2
%16 = tail call double @pow(i32 %15, i32 2)
%17 = fadd double %14, %16
%18 = add nuw nsw i32 %8, 3
%19 = tail call double @pow(i32 %18, i32 2)
%20 = fadd double %17, %19
%21 = add nuw nsw i32 %8, 4
%22 = tail call double @pow(i32 %21, i32 2)
%23 = fadd double %20, %22
%24 = add nuw nsw i32 %8, 5
%25 = icmp eq i32 %24, 101
br i1 %25, label %3, label %7
}