#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 pow(double, int);
double tanh(double);
void evaluateBeta(double x, double y, double z, double *B, double *Bx,
                  double *By, double *Bz) {
  double Bmin = 1.0;
  double Bmax = 10.0;
  double c2 = (Bmax - Bmin) / 2;
  double c1 = (Bmax + Bmin) / 2;
  double c3 = 10.0;
  double xcenter = 0.50;
  double ycenter = 0.50;
  double zcenter = 0.50;
  double r2 =
      pow((x - xcenter), 2) + pow((y - ycenter), 2) + pow((z - zcenter), 2);
  double r2x = 2.0 * (x - xcenter);
  double r2y = 2.0 * (y - ycenter);
  double r2z = 2.0 * (z - zcenter);
  double r = pow(r2, 0.5);
  double rx = 0.5 * r2x * pow(r2, -0.5);
  double ry = 0.5 * r2y * pow(r2, -0.5);
  double rz = 0.5 * r2z * pow(r2, -0.5);
  *B = c1 + c2 * tanh(c3 * (r - 0.25));
  *Bx = c2 * c3 * rx * (1 - pow(tanh(c3 * (r - 0.25)), 2));
  *By = c2 * c3 * ry * (1 - pow(tanh(c3 * (r - 0.25)), 2));
  *Bz = c2 * c3 * rz * (1 - pow(tanh(c3 * (r - 0.25)), 2));
}


x86 assembly (clang, -O0):
<evaluateBeta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  0xe7f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe76(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe59(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xe4c(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  0xe3f(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x68(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,-0x100(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0x100(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xfc(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0xfc(%rbp),%eax
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x8(%rbp),%xmm1
subsd  -0x68(%rbp),%xmm1
movsd  0xdcb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x10(%rbp),%xmm1
subsd  -0x70(%rbp),%xmm1
movsd  0xdad(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x18(%rbp),%xmm1
subsd  -0x78(%rbp),%xmm1
movsd  0xd8f(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  0xd5b(%rip),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0xf8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  -0xf8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xd1f(%rip),%xmm0
mulsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  -0xf0(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xce3(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0xe8(%rbp)
ff
movsd  -0x80(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  -0xe8(%rbp),%xmm0
ff
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xc78(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <tanh@plt>
movsd  -0xe0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0xd8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xc19(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <tanh@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  -0xd0(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xbb2(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <tanh@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  -0xc8(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x50(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
mulsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movsd  -0xa0(%rbp),%xmm1
ff
movsd  0xb4b(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <tanh@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  -0xc0(%rbp),%xmm0
ff
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluateBeta>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
addsd  0xeb3(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ebp
movsd  (%rsp),%xmm0
addsd  0xe94(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ebx
add    %ebp,%ebx
movsd  0x8(%rsp),%xmm0
addsd  0xe73(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1040 <pow@plt>
add    %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0xe08(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xdd5(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
mulsd  0xda4(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
addsd  0xd78(%rip),%xmm0
mulsd  0xd78(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
call   1030 <tanh@plt>
mulsd  0xd6d(%rip),%xmm0
addsd  0xd6d(%rip),%xmm0
movsd  %xmm0,0x0(%r13)
movsd  0x10(%rsp),%xmm0
mulsd  0xd61(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <tanh@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mov    $0x1,%ebx
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r12)
movsd  (%rsp),%xmm0
mulsd  0xd1a(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <tanh@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%r15)
movsd  0x8(%rsp),%xmm0
mulsd  0xcda(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1030 <tanh@plt>
mov    $0x2,%edi
call   1040 <pow@plt>
sub    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @evaluateBeta(double %0, double %1, double %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture writeonly %5, double* nocapture writeonly %6) {
%8 = fadd double %0, -5.000000e-01
%9 = tail call i32 @pow(double %8, i32 2)
%10 = fadd double %1, -5.000000e-01
%11 = tail call i32 @pow(double %10, i32 2)
%12 = add nsw i32 %11, %9
%13 = fadd double %2, -5.000000e-01
%14 = tail call i32 @pow(double %13, i32 2)
%15 = add nsw i32 %12, %14
%16 = sitofp i32 %15 to double
%17 = fmul double %8, 2.000000e+00
%18 = fmul double %10, 2.000000e+00
%19 = fmul double %13, 2.000000e+00
%20 = tail call i32 @pow(double %16, i32 0)
%21 = sitofp i32 %20 to double
%22 = fmul double %17, 5.000000e-01
%23 = tail call i32 @pow(double %16, i32 0)
%24 = sitofp i32 %23 to double
%25 = fmul double %22, %24
%26 = fmul double %18, 5.000000e-01
%27 = tail call i32 @pow(double %16, i32 0)
%28 = sitofp i32 %27 to double
%29 = fmul double %26, %28
%30 = fmul double %19, 5.000000e-01
%31 = tail call i32 @pow(double %16, i32 0)
%32 = sitofp i32 %31 to double
%33 = fmul double %30, %32
%34 = fadd double %21, -2.500000e-01
%35 = fmul double %34, 1.000000e+01
%36 = tail call double @tanh(double %35)
%37 = tail call double @llvm.fmuladd.f64(double %36, double 4.500000e+00, double 5.500000e+00)
store double %37, double* %3
%38 = fmul double %25, 4.500000e+01
%39 = tail call double @tanh(double %35)
%40 = tail call i32 @pow(double %39, i32 2)
%41 = sub nsw i32 1, %40
%42 = sitofp i32 %41 to double
%43 = fmul double %38, %42
store double %43, double* %4
%44 = fmul double %29, 4.500000e+01
%45 = tail call double @tanh(double %35)
%46 = tail call i32 @pow(double %45, i32 2)
%47 = sub nsw i32 1, %46
%48 = sitofp i32 %47 to double
%49 = fmul double %44, %48
store double %49, double* %5
%50 = fmul double %33, 4.500000e+01
%51 = tail call double @tanh(double %35)
%52 = tail call i32 @pow(double %51, i32 2)
%53 = sub nsw i32 1, %52
%54 = sitofp i32 %53 to double
%55 = fmul double %50, %54
store double %55, double* %6
ret void
}