#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 */
int pow(double const, int);
double f(const double *x) {
  double s1;
  double s2;
  double s3;
  double t1;
  double t2;
  double t3;
  double t4;
  double t5;
  s1 = x[1] - pow(x[0], 2);
  s2 = 1 - x[0];
  s3 = x[1] - 1;
  t1 = x[3] - pow(x[2], 2);
  t2 = 1 - x[2];
  t3 = x[3] - 1;
  t4 = s3 + t3;
  t5 = s3 - t3;
  return (100 * pow(s1, 2) + pow(s2, 2) + 90 * pow(t1, 2) + pow(t2, 2) +
          10 * pow(t4, 2) + pow(t5, 2) / 10);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x70(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xea6(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  0xe8c(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x68(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe44(%rip),%xmm0
subsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xe29(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x64,%eax,%eax
mov    %eax,-0x5c(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
imul   $0x5a,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x54(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x50(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%eax
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x4c(%rbp)
movsd  -0x48(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,%rbx
movsd  (%rdi),%xmm0
movsd  0x8(%rdi),%xmm1
movsd  %xmm1,0x10(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
subsd  (%rbx),%xmm0
movsd  %xmm0,0x28(%rsp)
movsd  0x8(%rbx),%xmm0
addsd  0xe9a(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rbx),%xmm0
movsd  0x18(%rbx),%xmm1
movsd  %xmm1,0x8(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
subsd  0x10(%rbx),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0xe4a(%rip),%xmm2
addsd  0x18(%rbx),%xmm2
movsd  0x18(%rsp),%xmm0
movapd %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x30(%rsp)
subsd  %xmm2,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x64,%eax,%ebp
movsd  0x28(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
imul   $0x5a,%eax,%ebp
add    %ebx,%ebp
movsd  0x20(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0x30(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rax,%rax,4),%eax
lea    (%rbx,%rax,2),%ebx
movsd  0x18(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @f(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %2
%11 = load double*, double** %2
%12 = getelementptr inbounds double, double* %11, i64 1
%13 = load double, double* %12
%14 = load double*, double** %2
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double, double* %15
%17 = call i32 @pow(double %16, i32 2)
%18 = sitofp i32 %17 to double
%19 = fsub double %13, %18
store double %19, double* %3
%20 = load double*, double** %2
%21 = getelementptr inbounds double, double* %20, i64 0
%22 = load double, double* %21
%23 = fsub double 1.000000e+00, %22
store double %23, double* %4
%24 = load double*, double** %2
%25 = getelementptr inbounds double, double* %24, i64 1
%26 = load double, double* %25
%27 = fsub double %26, 1.000000e+00
store double %27, double* %5
%28 = load double*, double** %2
%29 = getelementptr inbounds double, double* %28, i64 3
%30 = load double, double* %29
%31 = load double*, double** %2
%32 = getelementptr inbounds double, double* %31, i64 2
%33 = load double, double* %32
%34 = call i32 @pow(double %33, i32 2)
%35 = sitofp i32 %34 to double
%36 = fsub double %30, %35
store double %36, double* %6
%37 = load double*, double** %2
%38 = getelementptr inbounds double, double* %37, i64 2
%39 = load double, double* %38
%40 = fsub double 1.000000e+00, %39
store double %40, double* %7
%41 = load double*, double** %2
%42 = getelementptr inbounds double, double* %41, i64 3
%43 = load double, double* %42
%44 = fsub double %43, 1.000000e+00
store double %44, double* %8
%45 = load double, double* %5
%46 = load double, double* %8
%47 = fadd double %45, %46
store double %47, double* %9
%48 = load double, double* %5
%49 = load double, double* %8
%50 = fsub double %48, %49
store double %50, double* %10
%51 = load double, double* %3
%52 = call i32 @pow(double %51, i32 2)
%53 = mul nsw i32 100, %52
%54 = load double, double* %4
%55 = call i32 @pow(double %54, i32 2)
%56 = add nsw i32 %53, %55
%57 = load double, double* %6
%58 = call i32 @pow(double %57, i32 2)
%59 = mul nsw i32 90, %58
%60 = add nsw i32 %56, %59
%61 = load double, double* %7
%62 = call i32 @pow(double %61, i32 2)
%63 = add nsw i32 %60, %62
%64 = load double, double* %9
%65 = call i32 @pow(double %64, i32 2)
%66 = mul nsw i32 10, %65
%67 = add nsw i32 %63, %66
%68 = load double, double* %10
%69 = call i32 @pow(double %68, i32 2)
%70 = sdiv i32 %69, 10
%71 = add nsw i32 %67, %70
%72 = sitofp i32 %71 to double
ret double %72
}

LLVM IR (-O2):
define double @f(double* nocapture %0) {
%2 = getelementptr inbounds double, double* %0, i64 1
%3 = load double, double* %2
%4 = load double, double* %0
%5 = tail call i32 @pow(double %4, i32 2)
%6 = sitofp i32 %5 to double
%7 = fsub double %3, %6
%8 = load double, double* %0
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %2
%11 = fadd double %10, -1.000000e+00
%12 = getelementptr inbounds double, double* %0, i64 3
%13 = load double, double* %12
%14 = getelementptr inbounds double, double* %0, i64 2
%15 = load double, double* %14
%16 = tail call i32 @pow(double %15, i32 2)
%17 = sitofp i32 %16 to double
%18 = fsub double %13, %17
%19 = load double, double* %14
%20 = fsub double 1.000000e+00, %19
%21 = load double, double* %12
%22 = fadd double %21, -1.000000e+00
%23 = fadd double %11, %22
%24 = fsub double %11, %22
%25 = tail call i32 @pow(double %7, i32 2)
%26 = mul nsw i32 %25, 100
%27 = tail call i32 @pow(double %9, i32 2)
%28 = add nsw i32 %26, %27
%29 = tail call i32 @pow(double %18, i32 2)
%30 = mul nsw i32 %29, 90
%31 = add nsw i32 %28, %30
%32 = tail call i32 @pow(double %20, i32 2)
%33 = add nsw i32 %31, %32
%34 = tail call i32 @pow(double %23, i32 2)
%35 = mul nsw i32 %34, 10
%36 = add nsw i32 %33, %35
%37 = tail call i32 @pow(double %24, i32 2)
%38 = sdiv i32 %37, 10
%39 = add nsw i32 %36, %38
%40 = sitofp i32 %39 to double
ret double %40
}