#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 pow(double, int);
double sqrt(double);
double EStrag(int ZP, double MP, int ZT[10], double CT[10], int NTarEl,
              double dEdX1, double dEdX2, double ELoss_) {
  double Power = 1.0 / 3.0, Z = 0.0, StSqr = 0.0;
  int TEl = 0;
  if ((dEdX1 < 1E-10) || (dEdX2 < 1E-10))
    return 0;
  for (TEl = 0; TEl < NTarEl; TEl++) {
    Z = pow(ZT[TEl], Power) + pow(ZP, Power);
    StSqr = StSqr + pow(0.014 * sqrt(ZP * ZT[TEl] / Z) * pow(ELoss_, 0.53) *
                            (dEdX2 / dEdX1),
                        2) *
                        CT[TEl];
  };
  return sqrt(StSqr) / 1.386294361;
}


x86 assembly (clang, -O0):
<EStrag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
movsd  %xmm3,-0x48(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movsd  0xe87(%rip),%xmm0
ucomisd -0x38(%rbp),%xmm0
ja     1197 <EStrag+0x77>
movsd  0xe74(%rip),%xmm0
ucomisd -0x40(%rbp),%xmm0
jbe    11a4 <EStrag+0x84>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12a6 <EStrag+0x186>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    128b <EStrag+0x16b>
mov    -0x20(%rbp),%rax
movslq -0x64(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
cvttsd2si -0x50(%rbp),%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x80(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
cvttsd2si -0x50(%rbp),%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x20(%rbp),%rcx
movslq -0x64(%rbp),%rdx
imul   (%rcx,%rdx,4),%eax
cvtsi2sd %eax,%xmm0
divsd  -0x58(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xdf3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x48(%rbp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
divsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  -0x70(%rbp),%xmm1
mov    -0x28(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11ab <EStrag+0x8b>
movsd  -0x60(%rbp),%xmm0
call   1040 <sqrt@plt>
movsd  0xd73(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EStrag>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
movsd  %xmm3,0x20(%rsp)
movsd  0xec6(%rip),%xmm3
ucomisd %xmm1,%xmm3
xorpd  %xmm0,%xmm0
ja     126b <EStrag+0x14b>
ucomisd %xmm2,%xmm3
ja     126b <EStrag+0x14b>
movsd  %xmm2,0x8(%rsp)
xorpd  %xmm0,%xmm0
test   %ecx,%ecx
jle    124e <EStrag+0x12e>
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %ecx,%r12d
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
jmp    11f3 <EStrag+0xd3>
cs nopw 0x0(%rax,%rax,1)
nop
call   1040 <sqrt@plt>
mulsd  0xe5b(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
mulsd  0x10(%rsp),%xmm0
mulsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mulsd  (%r14,%rbp,8),%xmm0
movsd  0x28(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x1,%rbp
cmp    %rbp,%r12
je     124e <EStrag+0x12e>
movsd  %xmm0,0x28(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx,%rbp,4),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
xor    %edi,%edi
call   1030 <pow@plt>
movapd %xmm0,%xmm1
mov    (%rbx,%rbp,4),%eax
imul   %r15d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
ucomisd 0xdd9(%rip),%xmm0
jb     11a0 <EStrag+0x80>
sqrtsd %xmm0,%xmm0
jmp    11a5 <EStrag+0x85>
ucomisd 0xdc2(%rip),%xmm0
jb     125e <EStrag+0x13e>
sqrtsd %xmm0,%xmm0
jmp    1263 <EStrag+0x143>
call   1040 <sqrt@plt>
divsd  0xda5(%rip),%xmm0
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @EStrag(i32 %0, double %1, i32* %2, double* %3, i32 %4, double %5, double %6, double %7) {
%9 = alloca double
%10 = alloca i32
%11 = alloca double
%12 = alloca i32*
%13 = alloca double*
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca i32
store i32 %0, i32* %10
store double %1, double* %11
store i32* %2, i32** %12
store double* %3, double** %13
store i32 %4, i32* %14
store double %5, double* %15
store double %6, double* %16
store double %7, double* %17
store double 0x3FD5555555555555, double* %18
store double 0.000000e+00, double* %19
store double 0.000000e+00, double* %20
store i32 0, i32* %21
%22 = load double, double* %15
%23 = fcmp olt double %22, 1.000000e-10
br i1 %23, label %27, label %24
24: ; preds = %8
%25 = load double, double* %16
%26 = fcmp olt double %25, 1.000000e-10
br i1 %26, label %27, label %28
27: ; preds = %24, %8
store double 0.000000e+00, double* %9
br label %83
28: ; preds = %24
store i32 0, i32* %21
br label %29
29: ; preds = %76, %28
%30 = load i32, i32* %21
%31 = load i32, i32* %14
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %79
33: ; preds = %29
%34 = load i32*, i32** %12
%35 = load i32, i32* %21
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %34, i64 %36
%38 = load i32, i32* %37
%39 = sitofp i32 %38 to double
%40 = load double, double* %18
%41 = fptosi double %40 to i32
%42 = call double @pow(double %39, i32 %41)
%43 = load i32, i32* %10
%44 = sitofp i32 %43 to double
%45 = load double, double* %18
%46 = fptosi double %45 to i32
%47 = call double @pow(double %44, i32 %46)
%48 = fadd double %42, %47
store double %48, double* %19
%49 = load double, double* %20
%50 = load i32, i32* %10
%51 = load i32*, i32** %12
%52 = load i32, i32* %21
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i32, i32* %51, i64 %53
%55 = load i32, i32* %54
%56 = mul nsw i32 %50, %55
%57 = sitofp i32 %56 to double
%58 = load double, double* %19
%59 = fdiv double %57, %58
%60 = call double @sqrt(double %59)
%61 = fmul double 1.400000e-02, %60
%62 = load double, double* %17
%63 = call double @pow(double %62, i32 0)
%64 = fmul double %61, %63
%65 = load double, double* %16
%66 = load double, double* %15
%67 = fdiv double %65, %66
%68 = fmul double %64, %67
%69 = call double @pow(double %68, i32 2)
%70 = load double*, double** %13
%71 = load i32, i32* %21
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = call double @llvm.fmuladd.f64(double %69, double %74, double %49)
store double %75, double* %20
br label %76
76: ; preds = %33
%77 = load i32, i32* %21
%78 = add nsw i32 %77, 1
store i32 %78, i32* %21
br label %29
79: ; preds = %29
%80 = load double, double* %20
%81 = call double @sqrt(double %80)
%82 = fdiv double %81, 0x3FF62E42FEF1FCCC
store double %82, double* %9
br label %83
83: ; preds = %79, %27
%84 = load double, double* %9
ret double %84
}

LLVM IR (-O2):
define double @EStrag(i32 %0, double %1, i32* nocapture %2, double* nocapture %3, i32 %4, double %5, double %6, double %7) {
%9 = fcmp olt double %5, 1.000000e-10
%10 = fcmp olt double %6, 1.000000e-10
%11 = or i1 %9, %10
br i1 %11, label %46, label %12
12: ; preds = %8
%13 = icmp sgt i32 %4, 0
br i1 %13, label %14, label %42
14: ; preds = %12
%15 = sitofp i32 %0 to double
%16 = fdiv double %6, %5
%17 = zext i32 %4 to i64
br label %18
18: ; preds = %14, %18
%19 = phi i64 [ 0, %14 ], [ %40, %18 ]
%20 = phi double [ 0.000000e+00, %14 ], [ %39, %18 ]
%21 = getelementptr inbounds i32, i32* %2, i64 %19
%22 = load i32, i32* %21
%23 = sitofp i32 %22 to double
%24 = tail call double @pow(double %23, i32 0)
%25 = tail call double @pow(double %15, i32 0)
%26 = fadd double %24, %25
%27 = load i32, i32* %21
%28 = mul nsw i32 %27, %0
%29 = sitofp i32 %28 to double
%30 = fdiv double %29, %26
%31 = tail call double @sqrt(double %30)
%32 = fmul double %31, 1.400000e-02
%33 = tail call double @pow(double %7, i32 0)
%34 = fmul double %32, %33
%35 = fmul double %16, %34
%36 = tail call double @pow(double %35, i32 2)
%37 = getelementptr inbounds double, double* %3, i64 %19
%38 = load double, double* %37
%39 = tail call double @llvm.fmuladd.f64(double %36, double %38, double %20)
%40 = add nuw nsw i64 %19, 1
%41 = icmp eq i64 %40, %17
br i1 %41, label %42, label %18
42: ; preds = %18, %12
%43 = phi double [ 0.000000e+00, %12 ], [ %39, %18 ]
%44 = tail call double @sqrt(double %43)
%45 = fdiv double %44, 0x3FF62E42FEF1FCCC
br label %46
46: ; preds = %8, %42
%47 = phi double [ %45, %42 ], [ 0.000000e+00, %8 ]
ret double %47
}