#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 */
scalar_t__ EOF;
float atoff(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, float *);
int main(int argc, char **argv) {
  float expect, val;
  if (argc < 2) {
    perror("Usage: mse expected-val < values");
    exit(1);
  }
  expect = atoff(argv[1]);
  if (0)
    printf("%f\n", expect);
  while (scanf("%f ", &val) != EOF) {
    printf("%f ", (expect - val) * (expect - val));
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1186 <main+0x36>
lea    0xe89(%rip),%rdi
call   1060 <perror@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoff@plt>
movss  %xmm0,-0x14(%rbp)
lea    0xe82(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e39(%rip),%rcx
cmp    (%rcx),%rax
je     11e7 <main+0x97>
movss  -0x14(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
subss  -0x18(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe46(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1198 <main+0x48>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    $0x1,%edi
jle    11f4 <main+0x94>
mov    0x8(%rsi),%rdi
call   1030 <atoff@plt>
movss  %xmm0,0xc(%rsp)
lea    0xe99(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x2e4f(%rip),%r15
cmp    (%r15),%rax
je     11de <main+0x7e>
lea    0xe7c(%rip),%rbx
lea    0x8(%rsp),%r14
nopw   0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm0
subss  0x8(%rsp),%xmm0
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
cmp    (%r15),%rax
jne    11b0 <main+0x50>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe05(%rip),%rdi
call   1070 <perror@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: mse expected-val < values\00"
@.str.1 = [4 x i8] c"%f \00"
@EOF = global i64 0
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call float @atoff(i8* %16)
store float %17, float* %6
br label %18
18: ; preds = %22, %13
%19 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %7)
%20 = load i64, i64* @EOF
%21 = icmp ne i64 %19, %20
br i1 %21, label %22, label %32
22: ; preds = %18
%23 = load float, float* %6
%24 = load float, float* %7
%25 = fsub float %23, %24
%26 = load float, float* %6
%27 = load float, float* %7
%28 = fsub float %26, %27
%29 = fmul float %25, %28
%30 = fpext float %29 to double
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %30)
br label %18
32: ; preds = %18
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: mse expected-val < values\00"
@.str.1 = [4 x i8] c"%f \00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = bitcast float* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call float @atoff(i8* %11)
%13 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %3)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %25, label %16
16: ; preds = %9, %16
%17 = load float, float* %3
%18 = fsub float %12, %17
%19 = fmul float %18, %18
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float* %3)
%23 = load i64, i64* @EOF
%24 = icmp eq i64 %22, %23
br i1 %24, label %25, label %16
25: ; preds = %16, %9
%26 = call i32 @putchar(i32 10)
ret i32 0
}