#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 sqrt(double);
double trans(double *, int, double);
double f(double x, double y) {
  double fp[2][5] = {{1.0, 0.7, -0.3, 0.0, 0.0}, {1.0, 0.7, -0.3, 0.0, 0.0}};
  double v;
  v = trans(fp[0], 5, 0.5 * (x + y));
  v *= 2.0 * sqrt(2.0);
  return v;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe75(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x60(%rbp),%rdi
movsd  -0x8(%rbp),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe52(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0x5,%esi
call   1030 <trans@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  0xe2f(%rip),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe1f(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x58,%rsp
xorps  %xmm2,%xmm2
movaps %xmm2,0x10(%rsp)
movaps %xmm2,0x30(%rsp)
movaps %xmm2,0x20(%rsp)
movaps %xmm2,0x40(%rsp)
movaps 0xece(%rip),%xmm2
movaps %xmm2,(%rsp)
movabs $0xbfd3333333333333,%rax
33 d3 bf
mov    %rax,0x10(%rsp)
movups %xmm2,0x28(%rsp)
mov    %rax,0x38(%rsp)
addsd  %xmm1,%xmm0
mulsd  0xeb5(%rip),%xmm0
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <trans@plt>
mulsd  0xea8(%rip),%xmm0
add    $0x58,%rsp
ret

LLVM IR (-O0):
define double @f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca [2 x [5 x double]]
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = bitcast [2 x [5 x double]]* %5 to i8*
%8 = bitcast i8* %7 to [2 x [5 x double]]*
%9 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %8, i32 0, i32 0
%10 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 0
store double 1.000000e+00, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 1
store double 0x3FE6666666666666, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %9, i32 0, i32 2
store double -3.000000e-01, double* %12
%13 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %8, i32 0, i32 1
%14 = getelementptr inbounds [5 x double], [5 x double]* %13, i32 0, i32 0
store double 1.000000e+00, double* %14
%15 = getelementptr inbounds [5 x double], [5 x double]* %13, i32 0, i32 1
store double 0x3FE6666666666666, double* %15
%16 = getelementptr inbounds [5 x double], [5 x double]* %13, i32 0, i32 2
store double -3.000000e-01, double* %16
%17 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %5, i64 0, i64 0
%18 = getelementptr inbounds [5 x double], [5 x double]* %17, i64 0, i64 0
%19 = load double, double* %3
%20 = load double, double* %4
%21 = fadd double %19, %20
%22 = fmul double 5.000000e-01, %21
%23 = call double @trans(double* %18, i32 5, double %22)
store double %23, double* %6
%24 = call double @sqrt(double 2.000000e+00)
%25 = fmul double 2.000000e+00, %24
%26 = load double, double* %6
%27 = fmul double %26, %25
store double %27, double* %6
%28 = load double, double* %6
ret double %28
}

LLVM IR (-O2):
define double @f(double %0, double %1) {
%3 = alloca [2 x [5 x double]]
%4 = bitcast [2 x [5 x double]]* %3 to i8*
%5 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %3, i64 0, i64 0, i64 2
%6 = bitcast double* %5 to i8*
%7 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %3, i64 0, i64 0, i64 0
%8 = bitcast [2 x [5 x double]]* %3 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0x3FE6666666666666>, <2 x double>* %8
%9 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %3, i64 0, i64 0, i64 2
store double -3.000000e-01, double* %9
%10 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %3, i64 0, i64 1, i64 0
%11 = bitcast double* %10 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0x3FE6666666666666>, <2 x double>* %11
%12 = getelementptr inbounds [2 x [5 x double]], [2 x [5 x double]]* %3, i64 0, i64 1, i64 2
store double -3.000000e-01, double* %12
%13 = fadd double %0, %1
%14 = fmul double %13, 5.000000e-01
%15 = call double @trans(double* %7, i32 5, double %14)
%16 = fmul double %15, 0x4006A09E667F3BCD
ret double %16
}