#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 GET_ELEM_N1(int);
int GET_ELEM_N2(int);
double GET_ELEM_NA(int);
double GET_ELEM_NB(int);
double GET_ELEM_VA(int);
double GET_ELEM_VB(int);
double GET_ERES_A_FX(int);
double GET_ERES_A_FY(int);
double GET_ERES_A_MZ(int);
double GET_ERES_B_FX(int);
double GET_ERES_B_FY(int);
double GET_ERES_B_MZ(int);
double GET_NODE_X(int);
double GET_NODE_Y(int);
double sqrt(double);
double compute_e_res(int type, int epos, int div, int ppos) {
  int n1, n2;
  double x1, x2, y1, y2;
  double Na, Nb, Va, Vb, Ma, Mb, L, lenx, lenxx, na, nb, no, nt;
  double Xo = 0.0;
  Na = GET_ERES_A_FX(epos);
  Va = GET_ERES_A_FY(epos);
  Ma = GET_ERES_A_MZ(epos);
  Nb = GET_ERES_B_FX(epos);
  Vb = GET_ERES_B_FY(epos);
  Mb = GET_ERES_B_MZ(epos);
  n1 = GET_ELEM_N1(epos);
  n2 = GET_ELEM_N2(epos);
  x1 = GET_NODE_X(n1);
  y1 = GET_NODE_Y(n1);
  x2 = GET_NODE_X(n2);
  y2 = GET_NODE_Y(n2);
  L = sqrt((y2 - y1) * (y2 - y1) + (x2 - x1) * (x2 - x1));
  lenx = L * ((double)((double)ppos / (double)(div)));
  lenxx = L - lenx;
  switch (type) {
  case 1:
    na = GET_ELEM_NA(epos);
    nb = GET_ELEM_NB(epos);
    no = na;
    nt = nb - no;
    Xo = lenx * no + 0.5 * lenx * ((nt * lenx / L));
    return (Xo - (Na));
    break;
  case 2:
    na = GET_ELEM_VA(epos);
    nb = GET_ELEM_VB(epos);
    no = na;
    nt = nb - no;
    Xo = (no * L) / 2 - (no * lenx) +
         ((nt * L) / 6 - ((nt * lenx * lenx) / (2 * L)));
    return (Xo - ((Mb + Ma) / L));
    break;
  case 3:
    na = GET_ELEM_VA(epos);
    nb = GET_ELEM_VB(epos);
    no = na;
    nt = nb - no;
    Xo = (no * L * lenx) / 2 - (no * lenx * lenx) / 2 +
         ((nt * L * lenx) / 6.0 - (nt * lenx * lenx * lenx) / (6 * L));
    return ((-1.0) * (Xo + ((Ma * lenxx - Mb * lenx) / L)));
    break;
  }
  return (0.0);
}


x86 assembly (clang, -O0):
<compute_e_res>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movq   $0x0,-0xb0(%rbp)
mov    -0x10(%rbp),%edi
call   10d0 <GET_ERES_A_FX@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%edi
call   1060 <GET_ERES_A_FY@plt>
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%edi
call   1050 <GET_ERES_A_MZ@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%edi
call   1070 <GET_ERES_B_FX@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%edi
call   10c0 <GET_ERES_B_FY@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%edi
call   1100 <GET_ERES_B_MZ@plt>
movsd  %xmm0,-0x70(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <GET_ELEM_N1@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
call   1090 <GET_ELEM_N2@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%edi
call   1080 <GET_NODE_X@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
call   10f0 <GET_NODE_Y@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x20(%rbp),%edi
call   1080 <GET_NODE_X@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x20(%rbp),%edi
call   10f0 <GET_NODE_Y@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
call   10e0 <sqrt@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm0
cvtsi2sdl -0x18(%rbp),%xmm1
cvtsi2sdl -0x14(%rbp),%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
movsd  -0x80(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0xc(%rbp),%eax
mov    %eax,-0xb4(%rbp)
sub    $0x1,%eax
je     134d <compute_e_res+0x15d>
jmp    1325 <compute_e_res+0x135>
mov    -0xb4(%rbp),%eax
sub    $0x2,%eax
je     13ec <compute_e_res+0x1fc>
jmp    1339 <compute_e_res+0x149>
mov    -0xb4(%rbp),%eax
sub    $0x3,%eax
je     14ea <compute_e_res+0x2fa>
jmp    1625 <compute_e_res+0x435>
mov    -0x10(%rbp),%edi
call   1110 <GET_ELEM_NA@plt>
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%edi
call   10a0 <GET_ELEM_NB@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm2
ff
movsd  0xc6e(%rip),%xmm1
mulsd  -0x80(%rbp),%xmm1
movsd  -0xa8(%rbp),%xmm3
ff
mulsd  -0x80(%rbp),%xmm3
divsd  -0x78(%rbp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    162d <compute_e_res+0x43d>
mov    -0x10(%rbp),%edi
call   10b0 <GET_ELEM_VA@plt>
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%edi
call   1040 <GET_ELEM_VB@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x78(%rbp),%xmm1
movsd  0xbc7(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x80(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0x78(%rbp),%xmm1
movsd  0xb7a(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  -0x80(%rbp),%xmm2
mulsd  -0x80(%rbp),%xmm2
movsd  0xb64(%rip),%xmm3
mulsd  -0x78(%rbp),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
movsd  -0x70(%rbp),%xmm1
addsd  -0x68(%rbp),%xmm1
divsd  -0x78(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    162d <compute_e_res+0x43d>
mov    -0x10(%rbp),%edi
call   10b0 <GET_ELEM_VA@plt>
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x10(%rbp),%edi
call   1040 <GET_ELEM_VB@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
subsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  -0x78(%rbp),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  0xac4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  -0x80(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
movsd  0xaa6(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  -0xa8(%rbp),%xmm1
ff
mulsd  -0x78(%rbp),%xmm1
mulsd  -0x80(%rbp),%xmm1
movsd  0xa7c(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  -0xa8(%rbp),%xmm2
ff
mulsd  -0x80(%rbp),%xmm2
mulsd  -0x80(%rbp),%xmm2
mulsd  -0x80(%rbp),%xmm2
movsd  0xa59(%rip),%xmm3
mulsd  -0x78(%rbp),%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0xb0(%rbp),%xmm1
ff
movsd  -0x68(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm3
ff
movsd  -0x70(%rbp),%xmm2
mulsd  -0x80(%rbp),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
divsd  -0x78(%rbp),%xmm0
addsd  %xmm0,%xmm1
movsd  0x9e9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    162d <compute_e_res+0x43d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_e_res>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%r13d
mov    %edi,%r12d
mov    %esi,%edi
call   10d0 <GET_ERES_A_FX@plt>
movsd  %xmm0,0x40(%rsp)
mov    %r13d,%edi
call   1060 <GET_ERES_A_FY@plt>
mov    %r13d,%edi
call   1050 <GET_ERES_A_MZ@plt>
movapd %xmm0,0x50(%rsp)
mov    %r13d,%edi
call   1070 <GET_ERES_B_FX@plt>
mov    %r13d,%edi
call   10c0 <GET_ERES_B_FY@plt>
mov    %r13d,%edi
call   1100 <GET_ERES_B_MZ@plt>
movsd  %xmm0,0x38(%rsp)
mov    %r13d,%edi
call   1030 <GET_ELEM_N1@plt>
mov    %eax,%ebp
mov    %r13d,%edi
call   1090 <GET_ELEM_N2@plt>
mov    %eax,%ebx
mov    %ebp,%edi
call   1080 <GET_NODE_X@plt>
movsd  %xmm0,0x20(%rsp)
mov    %ebp,%edi
call   10f0 <GET_NODE_Y@plt>
movsd  %xmm0,0x10(%rsp)
mov    %ebx,%edi
call   1080 <GET_NODE_X@plt>
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   10f0 <GET_NODE_Y@plt>
subsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm3,%xmm3
ucomisd %xmm3,%xmm0
jb     12b9 <compute_e_res+0xc9>
sqrtsd %xmm0,%xmm0
jmp    12c2 <compute_e_res+0xd2>
call   10e0 <sqrt@plt>
xorpd  %xmm3,%xmm3
cvtsi2sd %r15d,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %r14d,%xmm1
divsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
cmp    $0x3,%r12d
je     134e <compute_e_res+0x15e>
cmp    $0x2,%r12d
je     1431 <compute_e_res+0x241>
cmp    $0x1,%r12d
jne    14d7 <compute_e_res+0x2e7>
mov    %r13d,%edi
movapd %xmm0,0x20(%rsp)
movapd %xmm2,0x10(%rsp)
call   1110 <GET_ELEM_NA@plt>
movsd  %xmm0,(%rsp)
mov    %r13d,%edi
call   10a0 <GET_ELEM_NB@plt>
movsd  (%rsp),%xmm2
subsd  %xmm2,%xmm0
movsd  0xd15(%rip),%xmm1
movapd 0x10(%rsp),%xmm3
mulsd  %xmm3,%xmm1
mulsd  %xmm3,%xmm0
divsd  0x20(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm3
addsd  %xmm0,%xmm3
subsd  0x40(%rsp),%xmm3
jmp    14d7 <compute_e_res+0x2e7>
movapd %xmm0,%xmm1
subsd  %xmm2,%xmm1
movapd %xmm1,(%rsp)
mov    %r13d,%edi
movapd %xmm0,0x20(%rsp)
movapd %xmm2,0x10(%rsp)
call   10b0 <GET_ELEM_VA@plt>
movapd %xmm0,0x40(%rsp)
mov    %r13d,%edi
call   1040 <GET_ELEM_VB@plt>
movapd 0x40(%rsp),%xmm5
subsd  %xmm5,%xmm0
movapd 0x20(%rsp),%xmm4
movapd %xmm4,%xmm1
movapd 0x10(%rsp),%xmm6
unpcklpd %xmm6,%xmm1
unpcklpd %xmm5,%xmm5
mulpd  %xmm1,%xmm5
movapd %xmm6,%xmm2
unpcklpd %xmm6,%xmm2
mulpd  %xmm2,%xmm5
mulpd  0xc49(%rip),%xmm5
movapd %xmm6,%xmm3
mulsd  %xmm0,%xmm3
unpcklpd %xmm3,%xmm0
mulpd  %xmm1,%xmm0
mulpd  %xmm2,%xmm0
movsd  0xc5d(%rip),%xmm1
mulsd  %xmm4,%xmm1
movapd 0xc31(%rip),%xmm2
unpcklpd %xmm1,%xmm2
divpd  %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm5,%xmm1
unpckhpd %xmm5,%xmm1
subsd  %xmm1,%xmm5
addsd  %xmm0,%xmm5
movsd  0x38(%rsp),%xmm1
mulsd  %xmm6,%xmm1
movapd 0x50(%rsp),%xmm3
mulsd  (%rsp),%xmm3
subsd  %xmm1,%xmm3
divsd  %xmm4,%xmm3
addsd  %xmm5,%xmm3
xorpd  0xbf4(%rip),%xmm3
jmp    14d7 <compute_e_res+0x2e7>
mov    %r13d,%edi
movapd %xmm0,0x20(%rsp)
movapd %xmm2,0x10(%rsp)
call   10b0 <GET_ELEM_VA@plt>
movsd  %xmm0,(%rsp)
mov    %r13d,%edi
call   1040 <GET_ELEM_VB@plt>
movapd %xmm0,%xmm3
movsd  (%rsp),%xmm1
subsd  %xmm1,%xmm3
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xbc3(%rip),%xmm0
movapd 0x10(%rsp),%xmm4
mulsd  %xmm4,%xmm1
subsd  %xmm1,%xmm0
movapd %xmm2,%xmm1
unpcklpd %xmm4,%xmm1
mulsd  %xmm3,%xmm4
unpcklpd %xmm4,%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm2,%xmm1
movapd %xmm2,%xmm4
addsd  %xmm2,%xmm1
movapd 0xb65(%rip),%xmm2
unpcklpd %xmm1,%xmm2
divpd  %xmm2,%xmm3
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
subsd  %xmm1,%xmm3
addsd  %xmm0,%xmm3
movapd 0x50(%rsp),%xmm0
addsd  0x38(%rsp),%xmm0
divsd  %xmm4,%xmm0
subsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @compute_e_res(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store double 0.000000e+00, double* %29
%30 = load i32, i32* %7
%31 = call double @GET_ERES_A_FX(i32 %30)
store double %31, double* %16
%32 = load i32, i32* %7
%33 = call double @GET_ERES_A_FY(i32 %32)
store double %33, double* %18
%34 = load i32, i32* %7
%35 = call double @GET_ERES_A_MZ(i32 %34)
store double %35, double* %20
%36 = load i32, i32* %7
%37 = call double @GET_ERES_B_FX(i32 %36)
store double %37, double* %17
%38 = load i32, i32* %7
%39 = call double @GET_ERES_B_FY(i32 %38)
store double %39, double* %19
%40 = load i32, i32* %7
%41 = call double @GET_ERES_B_MZ(i32 %40)
store double %41, double* %21
%42 = load i32, i32* %7
%43 = call i32 @GET_ELEM_N1(i32 %42)
store i32 %43, i32* %10
%44 = load i32, i32* %7
%45 = call i32 @GET_ELEM_N2(i32 %44)
store i32 %45, i32* %11
%46 = load i32, i32* %10
%47 = call double @GET_NODE_X(i32 %46)
store double %47, double* %12
%48 = load i32, i32* %10
%49 = call double @GET_NODE_Y(i32 %48)
store double %49, double* %14
%50 = load i32, i32* %11
%51 = call double @GET_NODE_X(i32 %50)
store double %51, double* %13
%52 = load i32, i32* %11
%53 = call double @GET_NODE_Y(i32 %52)
store double %53, double* %15
%54 = load double, double* %15
%55 = load double, double* %14
%56 = fsub double %54, %55
%57 = load double, double* %15
%58 = load double, double* %14
%59 = fsub double %57, %58
%60 = load double, double* %13
%61 = load double, double* %12
%62 = fsub double %60, %61
%63 = load double, double* %13
%64 = load double, double* %12
%65 = fsub double %63, %64
%66 = fmul double %62, %65
%67 = call double @llvm.fmuladd.f64(double %56, double %59, double %66)
%68 = call double @sqrt(double %67)
store double %68, double* %22
%69 = load double, double* %22
%70 = load i32, i32* %9
%71 = sitofp i32 %70 to double
%72 = load i32, i32* %8
%73 = sitofp i32 %72 to double
%74 = fdiv double %71, %73
%75 = fmul double %69, %74
store double %75, double* %23
%76 = load double, double* %22
%77 = load double, double* %23
%78 = fsub double %76, %77
store double %78, double* %24
%79 = load i32, i32* %6
switch i32 %79, label %193 [
i32 1, label %80
i32 2, label %103
i32 3, label %141
]
80: ; preds = %4
%81 = load i32, i32* %7
%82 = call double @GET_ELEM_NA(i32 %81)
store double %82, double* %25
%83 = load i32, i32* %7
%84 = call double @GET_ELEM_NB(i32 %83)
store double %84, double* %26
%85 = load double, double* %25
store double %85, double* %27
%86 = load double, double* %26
%87 = load double, double* %27
%88 = fsub double %86, %87
store double %88, double* %28
%89 = load double, double* %23
%90 = load double, double* %27
%91 = load double, double* %23
%92 = fmul double 5.000000e-01, %91
%93 = load double, double* %28
%94 = load double, double* %23
%95 = fmul double %93, %94
%96 = load double, double* %22
%97 = fdiv double %95, %96
%98 = fmul double %92, %97
%99 = call double @llvm.fmuladd.f64(double %89, double %90, double %98)
store double %99, double* %29
%100 = load double, double* %29
%101 = load double, double* %16
%102 = fsub double %100, %101
store double %102, double* %5
br label %194
103: ; preds = %4
%104 = load i32, i32* %7
%105 = call double @GET_ELEM_VA(i32 %104)
store double %105, double* %25
%106 = load i32, i32* %7
%107 = call double @GET_ELEM_VB(i32 %106)
store double %107, double* %26
%108 = load double, double* %25
store double %108, double* %27
%109 = load double, double* %26
%110 = load double, double* %27
%111 = fsub double %109, %110
store double %111, double* %28
%112 = load double, double* %27
%113 = load double, double* %22
%114 = fmul double %112, %113
%115 = fdiv double %114, 2.000000e+00
%116 = load double, double* %27
%117 = load double, double* %23
%118 = fneg double %116
%119 = call double @llvm.fmuladd.f64(double %118, double %117, double %115)
%120 = load double, double* %28
%121 = load double, double* %22
%122 = fmul double %120, %121
%123 = fdiv double %122, 6.000000e+00
%124 = load double, double* %28
%125 = load double, double* %23
%126 = fmul double %124, %125
%127 = load double, double* %23
%128 = fmul double %126, %127
%129 = load double, double* %22
%130 = fmul double 2.000000e+00, %129
%131 = fdiv double %128, %130
%132 = fsub double %123, %131
%133 = fadd double %119, %132
store double %133, double* %29
%134 = load double, double* %29
%135 = load double, double* %21
%136 = load double, double* %20
%137 = fadd double %135, %136
%138 = load double, double* %22
%139 = fdiv double %137, %138
%140 = fsub double %134, %139
store double %140, double* %5
br label %194
141: ; preds = %4
%142 = load i32, i32* %7
%143 = call double @GET_ELEM_VA(i32 %142)
store double %143, double* %25
%144 = load i32, i32* %7
%145 = call double @GET_ELEM_VB(i32 %144)
store double %145, double* %26
%146 = load double, double* %25
store double %146, double* %27
%147 = load double, double* %26
%148 = load double, double* %27
%149 = fsub double %147, %148
store double %149, double* %28
%150 = load double, double* %27
%151 = load double, double* %22
%152 = fmul double %150, %151
%153 = load double, double* %23
%154 = fmul double %152, %153
%155 = fdiv double %154, 2.000000e+00
%156 = load double, double* %27
%157 = load double, double* %23
%158 = fmul double %156, %157
%159 = load double, double* %23
%160 = fmul double %158, %159
%161 = fdiv double %160, 2.000000e+00
%162 = fsub double %155, %161
%163 = load double, double* %28
%164 = load double, double* %22
%165 = fmul double %163, %164
%166 = load double, double* %23
%167 = fmul double %165, %166
%168 = fdiv double %167, 6.000000e+00
%169 = load double, double* %28
%170 = load double, double* %23
%171 = fmul double %169, %170
%172 = load double, double* %23
%173 = fmul double %171, %172
%174 = load double, double* %23
%175 = fmul double %173, %174
%176 = load double, double* %22
%177 = fmul double 6.000000e+00, %176
%178 = fdiv double %175, %177
%179 = fsub double %168, %178
%180 = fadd double %162, %179
store double %180, double* %29
%181 = load double, double* %29
%182 = load double, double* %20
%183 = load double, double* %24
%184 = load double, double* %21
%185 = load double, double* %23
%186 = fmul double %184, %185
%187 = fneg double %186
%188 = call double @llvm.fmuladd.f64(double %182, double %183, double %187)
%189 = load double, double* %22
%190 = fdiv double %188, %189
%191 = fadd double %181, %190
%192 = fmul double -1.000000e+00, %191
store double %192, double* %5
br label %194
193: ; preds = %4
store double 0.000000e+00, double* %5
br label %194
194: ; preds = %193, %141, %103, %80
%195 = load double, double* %5
ret double %195
}

LLVM IR (-O2):
define double @compute_e_res(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call double @GET_ERES_A_FX(i32 %1)
%6 = tail call double @GET_ERES_A_FY(i32 %1)
%7 = tail call double @GET_ERES_A_MZ(i32 %1)
%8 = tail call double @GET_ERES_B_FX(i32 %1)
%9 = tail call double @GET_ERES_B_FY(i32 %1)
%10 = tail call double @GET_ERES_B_MZ(i32 %1)
%11 = tail call i32 @GET_ELEM_N1(i32 %1)
%12 = tail call i32 @GET_ELEM_N2(i32 %1)
%13 = tail call double @GET_NODE_X(i32 %11)
%14 = tail call double @GET_NODE_Y(i32 %11)
%15 = tail call double @GET_NODE_X(i32 %12)
%16 = tail call double @GET_NODE_Y(i32 %12)
%17 = fsub double %16, %14
%18 = fsub double %15, %13
%19 = fmul double %18, %18
%20 = tail call double @llvm.fmuladd.f64(double %17, double %17, double %19)
%21 = tail call double @sqrt(double %20)
%22 = sitofp i32 %3 to double
%23 = sitofp i32 %2 to double
%24 = fdiv double %22, %23
%25 = fmul double %24, %21
switch i32 %0, label %94 [
i32 1, label %26
i32 2, label %36
i32 3, label %60
]
26: ; preds = %4
%27 = tail call double @GET_ELEM_NA(i32 %1)
%28 = tail call double @GET_ELEM_NB(i32 %1)
%29 = fsub double %28, %27
%30 = fmul double %25, 5.000000e-01
%31 = fmul double %25, %29
%32 = fdiv double %31, %21
%33 = fmul double %30, %32
%34 = tail call double @llvm.fmuladd.f64(double %25, double %27, double %33)
%35 = fsub double %34, %5
br label %94
36: ; preds = %4
%37 = tail call double @GET_ELEM_VA(i32 %1)
%38 = tail call double @GET_ELEM_VB(i32 %1)
%39 = fsub double %38, %37
%40 = fmul double %21, %37
%41 = fmul double %40, 5.000000e-01
%42 = fneg double %37
%43 = tail call double @llvm.fmuladd.f64(double %42, double %25, double %41)
%44 = fmul double %25, %39
%45 = insertelement <2 x double> poison, double %21, i64 0
%46 = insertelement <2 x double> %45, double %25, i64 1
%47 = insertelement <2 x double> poison, double %39, i64 0
%48 = insertelement <2 x double> %47, double %44, i64 1
%49 = fmul <2 x double> %46, %48
%50 = fmul double %21, 2.000000e+00
%51 = insertelement <2 x double> <double 6.000000e+00, double poison>, double %50, i64 1
%52 = fdiv <2 x double> %49, %51
%53 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%54 = fsub <2 x double> %52, %53
%55 = extractelement <2 x double> %54, i64 0
%56 = fadd double %43, %55
%57 = fadd double %7, %10
%58 = fdiv double %57, %21
%59 = fsub double %56, %58
br label %94
60: ; preds = %4
%61 = fsub double %21, %25
%62 = tail call double @GET_ELEM_VA(i32 %1)
%63 = tail call double @GET_ELEM_VB(i32 %1)
%64 = fsub double %63, %62
%65 = insertelement <2 x double> poison, double %21, i64 0
%66 = insertelement <2 x double> %65, double %25, i64 1
%67 = insertelement <2 x double> poison, double %62, i64 0
%68 = shufflevector <2 x double> %67, <2 x double> poison, <2 x i32> zeroinitializer
%69 = fmul <2 x double> %66, %68
%70 = insertelement <2 x double> poison, double %25, i64 0
%71 = shufflevector <2 x double> %70, <2 x double> poison, <2 x i32> zeroinitializer
%72 = fmul <2 x double> %71, %69
%73 = fmul <2 x double> %72, <double 5.000000e-01, double 5.000000e-01>
%74 = shufflevector <2 x double> %73, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%75 = fsub <2 x double> %73, %74
%76 = fmul double %25, %64
%77 = insertelement <2 x double> poison, double %64, i64 0
%78 = insertelement <2 x double> %77, double %76, i64 1
%79 = fmul <2 x double> %66, %78
%80 = fmul <2 x double> %71, %79
%81 = fmul double %21, 6.000000e+00
%82 = insertelement <2 x double> <double 6.000000e+00, double poison>, double %81, i64 1
%83 = fdiv <2 x double> %80, %82
%84 = shufflevector <2 x double> %83, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%85 = fsub <2 x double> %83, %84
%86 = fadd <2 x double> %75, %85
%87 = extractelement <2 x double> %86, i64 0
%88 = fneg double %10
%89 = fmul double %25, %88
%90 = tail call double @llvm.fmuladd.f64(double %7, double %61, double %89)
%91 = fdiv double %90, %21
%92 = fadd double %91, %87
%93 = fneg double %92
br label %94
94: ; preds = %4, %60, %36, %26
%95 = phi double [ %93, %60 ], [ %59, %36 ], [ %35, %26 ], [ 0.000000e+00, %4 ]
ret double %95
}