#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 UCHAR_MAX;
double euler(double *h, double *Delta) {
  int l;
  double iChi = 0.0;
  double iVol = 0.0;
  int iu[256] = {
      0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 0, 0, 0,  0, 0,  0, 0,  0, 0,  0,
      0,  0, 1,  0, 0,  0, 0,  0, 0,  0, 1, 0, 0,  0, 0,  0, -1, 0, 0,  0,
      -1, 0, 0,  0, -1, 0, 0,  0, 0,  0, 0, 0, 0,  0, 1,  0, -1, 0, 0,  0,
      0,  0, 1,  0, 0,  0, -1, 0, 0,  0, 0, 0, -1, 0, -1, 0, 0,  0, 0,  0,
      0,  0, 0,  0, 0,  0, 1,  0, -1, 0, 0, 0, 0,  0, 1,  0, -1, 0, -1, 0,
      -1, 0, 0,  0, -2, 0, -1, 0, -1, 0, 0, 0, 0,  0, 0,  0, 0,  0, 1,  0,
      -1, 0, 0,  0, 0,  0, 1,  0, 1,  0, 0, 0, 0,  0, 0,  0, 0,  0, 0,  0,
      0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 1, 0, 0,  0, 0,  0, 0,  0, 1,  0,
      0,  0, 0,  0, -1, 0, 0,  0, -1, 0, 0, 0, -1, 0, 0,  0, 0,  0, 0,  0,
      0,  0, 1,  0, -1, 0, 0,  0, 0,  0, 1, 0, 0,  0, -1, 0, 0,  0, 0,  0,
      -1, 0, -1, 0, 0,  0, 0,  0, 0,  0, 0, 0, 0,  0, 1,  0, -1, 0, 0,  0,
      0,  0, 1,  0, -1, 0, -1, 0, -1, 0, 0, 0, -2, 0, -1, 0, -1, 0, 0,  0,
      0,  0, 0,  0, 0,  0, 1,  0, -1, 0, 0, 0, 0,  0, 1,  0};
  for (l = 0; l <= UCHAR_MAX; l++) {
    iChi += iu[l] * h[l];
    iVol += h[l];
  }
  return iChi / (iVol * Delta[0] * Delta[1] * Delta[2]);
}


x86 assembly (clang, -O0):
<euler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    -0x430(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x400,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%eax
jg     11b5 <euler+0xa5>
movslq -0x14(%rbp),%rax
cvtsi2sdl -0x430(%rbp,%rax,4),%xmm0
ff ff
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <euler+0x42>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulsd  0x10(%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euler>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%eax
test   %eax,%eax
js     1175 <euler+0x75>
lea    0x1(%rax),%r8
test   %rax,%rax
je     117f <euler+0x7f>
mov    %r8d,%edx
and    $0xfffffffe,%edx
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
lea    0xed7(%rip),%rax
xorpd  %xmm0,%xmm0
nopl   (%rax)
xorps  %xmm2,%xmm2
cvtsi2sdl (%rax,%rcx,4),%xmm2
movsd  (%rdi,%rcx,8),%xmm3
movsd  0x8(%rdi,%rcx,8),%xmm4
mulsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
addsd  %xmm3,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0x4(%rax,%rcx,4),%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm4,%xmm1
add    $0x2,%rcx
cmp    %rcx,%rdx
jne    1130 <euler+0x30>
test   $0x1,%r8b
jne    118f <euler+0x8f>
jmp    11af <euler+0xaf>
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
jmp    11af <euler+0xaf>
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
xorpd  %xmm0,%xmm0
test   $0x1,%r8b
je     11af <euler+0xaf>
lea    0xe6a(%rip),%rax
xorps  %xmm2,%xmm2
cvtsi2sdl (%rax,%rcx,4),%xmm2
movsd  (%rdi,%rcx,8),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm3,%xmm1
mulsd  (%rsi),%xmm1
mulsd  0x8(%rsi),%xmm1
mulsd  0x10(%rsi),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@__const.euler.iu = [256 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -2, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -2, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0]
@UCHAR_MAX = global i32 0
define double @euler(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca [256 x i32]
store double* %0, double** %3
store double* %1, double** %4
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
%9 = bitcast [256 x i32]* %8 to i8*
store i32 0, i32* %5
br label %10
10: ; preds = %34, %2
%11 = load i32, i32* %5
%12 = load i32, i32* @UCHAR_MAX
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %37
14: ; preds = %10
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [256 x i32], [256 x i32]* %8, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to double
%20 = load double*, double** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
%24 = load double, double* %23
%25 = load double, double* %6
%26 = call double @llvm.fmuladd.f64(double %19, double %24, double %25)
store double %26, double* %6
%27 = load double*, double** %3
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double, double* %27, i64 %29
%31 = load double, double* %30
%32 = load double, double* %7
%33 = fadd double %32, %31
store double %33, double* %7
br label %34
34: ; preds = %14
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 1
store i32 %36, i32* %5
br label %10
37: ; preds = %10
%38 = load double, double* %6
%39 = load double, double* %7
%40 = load double*, double** %4
%41 = getelementptr inbounds double, double* %40, i64 0
%42 = load double, double* %41
%43 = fmul double %39, %42
%44 = load double*, double** %4
%45 = getelementptr inbounds double, double* %44, i64 1
%46 = load double, double* %45
%47 = fmul double %43, %46
%48 = load double*, double** %4
%49 = getelementptr inbounds double, double* %48, i64 2
%50 = load double, double* %49
%51 = fmul double %47, %50
%52 = fdiv double %38, %51
ret double %52
}

LLVM IR (-O2):
@__const.euler.iu = [256 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -2, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 -2, i32 0, i32 -1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0, i32 -1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 0]
@UCHAR_MAX = global i32 0
define double @euler(double* nocapture %0, double* nocapture %1) {
%3 = load i32, i32* @UCHAR_MAX
%4 = icmp slt i32 %3, 0
br i1 %4, label %50, label %5
5: ; preds = %2
%6 = add nuw i32 %3, 1
%7 = zext i32 %6 to i64
%8 = and i64 %7, 1
%9 = icmp eq i32 %3, 0
br i1 %9, label %35, label %10
10: ; preds = %5
%11 = and i64 %7, 4294967294
br label %12
12: ; preds = %12, %10
%13 = phi i64 [ 0, %10 ], [ %32, %12 ]
%14 = phi double [ 0.000000e+00, %10 ], [ %31, %12 ]
%15 = phi double [ 0.000000e+00, %10 ], [ %30, %12 ]
%16 = phi i64 [ 0, %10 ], [ %33, %12 ]
%17 = getelementptr inbounds [256 x i32], [256 x i32]* @__const.euler.iu, i64 0, i64 %13
%18 = load i32, i32* %17
%19 = sitofp i32 %18 to double
%20 = getelementptr inbounds double, double* %0, i64 %13
%21 = load double, double* %20
%22 = tail call double @llvm.fmuladd.f64(double %19, double %21, double %15)
%23 = fadd double %14, %21
%24 = or i64 %13, 1
%25 = getelementptr inbounds [256 x i32], [256 x i32]* @__const.euler.iu, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = sitofp i32 %26 to double
%28 = getelementptr inbounds double, double* %0, i64 %24
%29 = load double, double* %28
%30 = tail call double @llvm.fmuladd.f64(double %27, double %29, double %22)
%31 = fadd double %23, %29
%32 = add nuw nsw i64 %13, 2
%33 = add i64 %16, 2
%34 = icmp eq i64 %33, %11
br i1 %34, label %35, label %12
35: ; preds = %12, %5
%36 = phi double [ undef, %5 ], [ %30, %12 ]
%37 = phi double [ undef, %5 ], [ %31, %12 ]
%38 = phi i64 [ 0, %5 ], [ %32, %12 ]
%39 = phi double [ 0.000000e+00, %5 ], [ %31, %12 ]
%40 = phi double [ 0.000000e+00, %5 ], [ %30, %12 ]
%41 = icmp eq i64 %8, 0
br i1 %41, label %50, label %42
42: ; preds = %35
%43 = getelementptr inbounds [256 x i32], [256 x i32]* @__const.euler.iu, i64 0, i64 %38
%44 = load i32, i32* %43
%45 = sitofp i32 %44 to double
%46 = getelementptr inbounds double, double* %0, i64 %38
%47 = load double, double* %46
%48 = tail call double @llvm.fmuladd.f64(double %45, double %47, double %40)
%49 = fadd double %39, %47
br label %50
50: ; preds = %42, %35, %2
%51 = phi double [ 0.000000e+00, %2 ], [ %36, %35 ], [ %48, %42 ]
%52 = phi double [ 0.000000e+00, %2 ], [ %37, %35 ], [ %49, %42 ]
%53 = load double, double* %1
%54 = fmul double %52, %53
%55 = getelementptr inbounds double, double* %1, i64 1
%56 = load double, double* %55
%57 = fmul double %54, %56
%58 = getelementptr inbounds double, double* %1, i64 2
%59 = load double, double* %58
%60 = fmul double %57, %59
%61 = fdiv double %51, %60
ret double %61
}