#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 log(double);
int pow(double, double);
double sqrt(double);
double AStrag(int ZP, double MP, int ZT[10], double MT[10], double CT[10],
              int NTarEl, double TT, double E) {
  int i = 0;
  double A = 0., A_ = 0., Zz = 0., Tau = 0., Exp = 0., Power = 2.0 / 3.0;
  for (i = 0; i < NTarEl; i++) {
    Zz = sqrt(pow(ZT[i], Power) + pow(ZP, Power));
    Tau = (41470.0 * CT[i] * TT) / (Zz * Zz * MT[i]);
    Exp = pow(log(1.03 + Tau), -0.115) - 0.115;
    A_ = ZT[i] * Zz * pow(Tau, Exp) * 0.0022 * ZP / E;
    A += A_ * A_;
  };
  return sqrt(A);
}


x86 assembly (clang, -O0):
<AStrag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe6c(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12da <AStrag+0x1aa>
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  -0x78(%rbp),%xmm1
call   1040 <pow@plt>
mov    %eax,-0x84(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm1
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
movsd  0xe28(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  -0x60(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x44(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xdee(%rip),%xmm0
addsd  -0x68(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xdd4(%rip),%xmm1
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  0xdbb(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x44(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
call   1040 <pow@plt>
movsd  -0x80(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd6f(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11a0 <AStrag+0x70>
movsd  -0x50(%rbp),%xmm0
call   1050 <sqrt@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AStrag>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
xorpd  %xmm0,%xmm0
test   %r8d,%r8d
jle    1293 <AStrag+0x163>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r13
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
mov    %r8d,%r12d
xor    %ebx,%ebx
xorpd  %xmm0,%xmm0
movsd  %xmm1,0x10(%rsp)
jmp    1241 <AStrag+0x111>
nopl   0x0(%rax,%rax,1)
call   1050 <sqrt@plt>
movsd  (%r14,%rbx,8),%xmm1
mulsd  0xe75(%rip),%xmm1
mulsd  0x18(%rsp),%xmm1
movsd  %xmm0,0x8(%rsp)
mulsd  %xmm0,%xmm0
mulsd  (%r15,%rbx,8),%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x28(%rsp)
movapd %xmm1,%xmm0
addsd  0xe51(%rip),%xmm0
call   1030 <log@plt>
movsd  0xe4c(%rip),%xmm1
call   1040 <pow@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xe38(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0x0(%r13,%rbx,4),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x28(%rsp),%xmm0
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xe0a(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
mulsd  %xmm1,%xmm0
divsd  0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0x30(%rsp),%xmm2
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
add    $0x1,%rbx
cmp    %rbx,%r12
je     1293 <AStrag+0x163>
movsd  %xmm0,0x30(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl 0x0(%r13,%rbx,4),%xmm0
movsd  0xda7(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%ebp
movsd  0x10(%rsp),%xmm0
movsd  0xd92(%rip),%xmm1
call   1040 <pow@plt>
add    %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ucomisd 0xda4(%rip),%xmm0
jb     1180 <AStrag+0x50>
sqrtsd %xmm0,%xmm0
jmp    1185 <AStrag+0x55>
ucomisd 0xd8d(%rip),%xmm0
jb     12b0 <AStrag+0x180>
sqrtsd %xmm0,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <sqrt@plt>

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

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