#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 /*<<< orphan*/ printf(char *, float, float);
int shape(float s, float t, float **lag4) {
  int i, j;
  float sm, sp, tm, tp;
  printf("In function: %f %f\n", s, t);
  sp = s + 1.0;
  sm = s - 1.0;
  tp = t + 1.0;
  tm = t - 1.0;
  lag4[0][0] = 0.25 * sm * tm;
  lag4[0][1] = -0.25 * sp * tm;
  lag4[0][2] = 0.25 * sp * tp;
  lag4[0][3] = -0.25 * sm * tp;
  lag4[1][0] = 0.25 * tm;
  lag4[1][1] = -0.25 * tm;
  lag4[1][2] = 0.25 * tp;
  lag4[1][3] = -0.25 * tp;
  lag4[2][0] = 0.25 * sm;
  lag4[2][1] = -0.25 * sp;
  lag4[2][2] = 0.25 * sp;
  lag4[2][3] = -0.25 * sm;
  return 0;
}


x86 assembly (clang, -O0):
<shape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe87(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe69(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe43(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe0a(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x24(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,0x4(%rax)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xde0(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,0x8(%rax)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xda6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x28(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movss  %xmm0,0xc(%rax)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd7c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movss  %xmm0,(%rax)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd4f(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movss  %xmm0,0x4(%rax)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd31(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movss  %xmm0,0x8(%rax)
movss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd03(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movss  %xmm0,0xc(%rax)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xce5(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movss  %xmm0,(%rax)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xcb8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movss  %xmm0,0x4(%rax)
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc9a(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movss  %xmm0,0x8(%rax)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xc6c(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
movss  %xmm0,0xc(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shape>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
movaps %xmm1,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
movaps (%rsp),%xmm1
shufps $0x0,%xmm1,%xmm1
movaps 0xec4(%rip),%xmm0
addps  %xmm0,%xmm1
movaps 0x10(%rsp),%xmm3
shufps $0x0,%xmm3,%xmm3
addps  %xmm0,%xmm3
cvtps2pd %xmm1,%xmm0
movapd %xmm0,%xmm1
cvtps2pd %xmm3,%xmm2
movaps %xmm3,%xmm5
shufpd $0x1,%xmm0,%xmm1
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
unpckhpd %xmm2,%xmm2
movapd 0xe9f(%rip),%xmm4
mulpd  %xmm4,%xmm0
mulpd  %xmm4,%xmm1
mulpd  %xmm1,%xmm2
mulpd  %xmm0,%xmm3
cvtpd2ps %xmm3,%xmm3
cvtpd2ps %xmm2,%xmm2
mov    (%rbx),%rax
unpcklpd %xmm2,%xmm3
movupd %xmm3,(%rax)
mov    0x8(%rbx),%rax
unpcklps %xmm5,%xmm5
mulps  0xe7e(%rip),%xmm5
movups %xmm5,(%rax)
cvtpd2ps %xmm0,%xmm0
cvtpd2ps %xmm1,%xmm1
mov    0x10(%rbx),%rax
unpcklpd %xmm1,%xmm0
movupd %xmm0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"In function: %f %f\0A\00"
define i32 @shape(float %0, float %1, float** %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float**
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %4
store float %1, float* %5
store float** %2, float*** %6
%13 = load float, float* %4
%14 = load float, float* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %13, float %14)
%16 = load float, float* %4
%17 = fpext float %16 to double
%18 = fadd double %17, 1.000000e+00
%19 = fptrunc double %18 to float
store float %19, float* %10
%20 = load float, float* %4
%21 = fpext float %20 to double
%22 = fsub double %21, 1.000000e+00
%23 = fptrunc double %22 to float
store float %23, float* %9
%24 = load float, float* %5
%25 = fpext float %24 to double
%26 = fadd double %25, 1.000000e+00
%27 = fptrunc double %26 to float
store float %27, float* %12
%28 = load float, float* %5
%29 = fpext float %28 to double
%30 = fsub double %29, 1.000000e+00
%31 = fptrunc double %30 to float
store float %31, float* %11
%32 = load float, float* %9
%33 = fpext float %32 to double
%34 = fmul double 2.500000e-01, %33
%35 = load float, float* %11
%36 = fpext float %35 to double
%37 = fmul double %34, %36
%38 = fptrunc double %37 to float
%39 = load float**, float*** %6
%40 = getelementptr inbounds float*, float** %39, i64 0
%41 = load float*, float** %40
%42 = getelementptr inbounds float, float* %41, i64 0
store float %38, float* %42
%43 = load float, float* %10
%44 = fpext float %43 to double
%45 = fmul double -2.500000e-01, %44
%46 = load float, float* %11
%47 = fpext float %46 to double
%48 = fmul double %45, %47
%49 = fptrunc double %48 to float
%50 = load float**, float*** %6
%51 = getelementptr inbounds float*, float** %50, i64 0
%52 = load float*, float** %51
%53 = getelementptr inbounds float, float* %52, i64 1
store float %49, float* %53
%54 = load float, float* %10
%55 = fpext float %54 to double
%56 = fmul double 2.500000e-01, %55
%57 = load float, float* %12
%58 = fpext float %57 to double
%59 = fmul double %56, %58
%60 = fptrunc double %59 to float
%61 = load float**, float*** %6
%62 = getelementptr inbounds float*, float** %61, i64 0
%63 = load float*, float** %62
%64 = getelementptr inbounds float, float* %63, i64 2
store float %60, float* %64
%65 = load float, float* %9
%66 = fpext float %65 to double
%67 = fmul double -2.500000e-01, %66
%68 = load float, float* %12
%69 = fpext float %68 to double
%70 = fmul double %67, %69
%71 = fptrunc double %70 to float
%72 = load float**, float*** %6
%73 = getelementptr inbounds float*, float** %72, i64 0
%74 = load float*, float** %73
%75 = getelementptr inbounds float, float* %74, i64 3
store float %71, float* %75
%76 = load float, float* %11
%77 = fpext float %76 to double
%78 = fmul double 2.500000e-01, %77
%79 = fptrunc double %78 to float
%80 = load float**, float*** %6
%81 = getelementptr inbounds float*, float** %80, i64 1
%82 = load float*, float** %81
%83 = getelementptr inbounds float, float* %82, i64 0
store float %79, float* %83
%84 = load float, float* %11
%85 = fpext float %84 to double
%86 = fmul double -2.500000e-01, %85
%87 = fptrunc double %86 to float
%88 = load float**, float*** %6
%89 = getelementptr inbounds float*, float** %88, i64 1
%90 = load float*, float** %89
%91 = getelementptr inbounds float, float* %90, i64 1
store float %87, float* %91
%92 = load float, float* %12
%93 = fpext float %92 to double
%94 = fmul double 2.500000e-01, %93
%95 = fptrunc double %94 to float
%96 = load float**, float*** %6
%97 = getelementptr inbounds float*, float** %96, i64 1
%98 = load float*, float** %97
%99 = getelementptr inbounds float, float* %98, i64 2
store float %95, float* %99
%100 = load float, float* %12
%101 = fpext float %100 to double
%102 = fmul double -2.500000e-01, %101
%103 = fptrunc double %102 to float
%104 = load float**, float*** %6
%105 = getelementptr inbounds float*, float** %104, i64 1
%106 = load float*, float** %105
%107 = getelementptr inbounds float, float* %106, i64 3
store float %103, float* %107
%108 = load float, float* %9
%109 = fpext float %108 to double
%110 = fmul double 2.500000e-01, %109
%111 = fptrunc double %110 to float
%112 = load float**, float*** %6
%113 = getelementptr inbounds float*, float** %112, i64 2
%114 = load float*, float** %113
%115 = getelementptr inbounds float, float* %114, i64 0
store float %111, float* %115
%116 = load float, float* %10
%117 = fpext float %116 to double
%118 = fmul double -2.500000e-01, %117
%119 = fptrunc double %118 to float
%120 = load float**, float*** %6
%121 = getelementptr inbounds float*, float** %120, i64 2
%122 = load float*, float** %121
%123 = getelementptr inbounds float, float* %122, i64 1
store float %119, float* %123
%124 = load float, float* %10
%125 = fpext float %124 to double
%126 = fmul double 2.500000e-01, %125
%127 = fptrunc double %126 to float
%128 = load float**, float*** %6
%129 = getelementptr inbounds float*, float** %128, i64 2
%130 = load float*, float** %129
%131 = getelementptr inbounds float, float* %130, i64 2
store float %127, float* %131
%132 = load float, float* %9
%133 = fpext float %132 to double
%134 = fmul double -2.500000e-01, %133
%135 = fptrunc double %134 to float
%136 = load float**, float*** %6
%137 = getelementptr inbounds float*, float** %136, i64 2
%138 = load float*, float** %137
%139 = getelementptr inbounds float, float* %138, i64 3
store float %135, float* %139
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"In function: %f %f\0A\00"
define i32 @shape(float %0, float %1, float** nocapture %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), float %0, float %1)
%5 = insertelement <2 x float> poison, float %0, i64 0
%6 = shufflevector <2 x float> %5, <2 x float> poison, <2 x i32> zeroinitializer
%7 = fadd <2 x float> %6, <float -1.000000e+00, float 1.000000e+00>
%8 = insertelement <2 x float> poison, float %1, i64 0
%9 = shufflevector <2 x float> %8, <2 x float> poison, <2 x i32> zeroinitializer
%10 = fadd <2 x float> %9, <float -1.000000e+00, float 1.000000e+00>
%11 = bitcast float** %2 to <4 x float>**
%12 = load <4 x float>*, <4 x float>** %11
%13 = fpext <2 x float> %7 to <2 x double>
%14 = shufflevector <2 x double> %13, <2 x double> poison, <4 x i32> <i32 0, i32 1, i32 1, i32 0>
%15 = fpext <2 x float> %10 to <2 x double>
%16 = shufflevector <2 x double> %15, <2 x double> poison, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
%17 = fmul <4 x double> %14, <double 2.500000e-01, double -2.500000e-01, double 2.500000e-01, double -2.500000e-01>
%18 = fmul <4 x double> %17, %16
%19 = fptrunc <4 x double> %18 to <4 x float>
store <4 x float> %19, <4 x float>* %12
%20 = getelementptr inbounds float*, float** %2, i64 1
%21 = bitcast float** %20 to <4 x float>**
%22 = load <4 x float>*, <4 x float>** %21
%23 = shufflevector <2 x float> %10, <2 x float> undef, <4 x i32> <i32 0, i32 0, i32 1, i32 1>
%24 = fmul <4 x float> %23, <float 2.500000e-01, float -2.500000e-01, float 2.500000e-01, float -2.500000e-01>
store <4 x float> %24, <4 x float>* %22
%25 = getelementptr inbounds float*, float** %2, i64 2
%26 = bitcast float** %25 to <4 x float>**
%27 = load <4 x float>*, <4 x float>** %26
%28 = fptrunc <4 x double> %17 to <4 x float>
store <4 x float> %28, <4 x float>* %27
ret i32 0
}