#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 /*<<< orphan*/ _Normal(double, double, double);
double _f(int /*<<< orphan*/);
double dgl10(double a, double b) {
  static double g[5] = {0.148874338981631, 0.433395394129247, 0.679409568299024,
                        0.865063366688985, 0.973906528517172};
  static double w[5] = {0.295524224714753, 0.269266719309996, 0.219086362515982,
                        0.149451349150581, 0.066671344308688};
  double s;
  int i, mflag;
  if (a == b)
    return 0.;
  mflag = 0;
  if (a > b) {
    mflag = 1;
    s = a;
    a = b;
    b = s;
  }
  for (i = 0, s = 0.; i < 5; i++)
    s += w[i] * (_f(_Normal(a, b, g[i])) + _f(_Normal(a, b, -g[i])));
  s *= ((b - a) / 2.);
  if (mflag)
    return -s;
  return s;
}


x86 assembly (clang, -O0):
<dgl10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jne    1155 <dgl10+0x35>
jp     1155 <dgl10+0x35>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b2 <dgl10+0x192>
movl   $0x0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1191 <dgl10+0x71>
movl   $0x1,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1258 <dgl10+0x138>
movslq -0x24(%rbp),%rcx
lea    0x2ebb(%rip),%rax
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movslq -0x24(%rbp),%rcx
lea    0x2e6c(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movslq -0x24(%rbp),%rcx
lea    0x2e41(%rip),%rax
movsd  (%rax,%rcx,8),%xmm2
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  -0x38(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
addsd  %xmm1,%xmm2
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a0 <dgl10+0x80>
movsd  -0x18(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xd96(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     12a8 <dgl10+0x188>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b2 <dgl10+0x192>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgl10>:
sub    $0x78,%rsp
movapd %xmm1,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm2,%xmm0
jne    1138 <dgl10+0x18>
jnp    136d <dgl10+0x24d>
movapd %xmm0,%xmm3
movapd %xmm2,%xmm0
minsd  %xmm3,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm3,%xmm1
maxsd  %xmm2,%xmm1
movapd %xmm1,0x10(%rsp)
movsd  %xmm2,0x70(%rsp)
movsd  0xe9a(%rip),%xmm2
movsd  %xmm3,0x68(%rsp)
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x60(%rsp)
movsd  0xe82(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x58(%rsp)
movsd  0xe65(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x50(%rsp)
movsd  0xe48(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x48(%rsp)
movsd  0xe2b(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x40(%rsp)
movsd  0xe0e(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x38(%rsp)
movsd  0xdf1(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x30(%rsp)
movsd  0xdd4(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x28(%rsp)
movsd  0xdb7(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xd9a(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  0x68(%rsp),%xmm1
ucomisd 0x70(%rsp),%xmm1
movsd  0x58(%rsp),%xmm1
addsd  0x60(%rsp),%xmm1
mulsd  0xd6b(%rip),%xmm1
movapd %xmm1,%xmm2
xorpd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0x48(%rsp),%xmm2
addsd  0x50(%rsp),%xmm2
mulsd  0xd53(%rip),%xmm2
addsd  %xmm1,%xmm2
movapd 0x10(%rsp),%xmm1
movsd  0x38(%rsp),%xmm3
addsd  0x40(%rsp),%xmm3
mulsd  0xd3d(%rip),%xmm3
addsd  %xmm2,%xmm3
movsd  0x28(%rsp),%xmm2
addsd  0x30(%rsp),%xmm2
mulsd  0xd2d(%rip),%xmm2
addsd  %xmm3,%xmm2
addsd  0x20(%rsp),%xmm0
mulsd  0xd23(%rip),%xmm0
addsd  %xmm2,%xmm0
subsd  0x8(%rsp),%xmm1
mulsd  0xd19(%rip),%xmm1
mulsd  %xmm0,%xmm1
jbe    136d <dgl10+0x24d>
xorpd  0xd13(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x78,%rsp
ret

LLVM IR (-O0):
@dgl10.g = internal global [5 x double] [double 0x3FC30E507891E272, double 0x3FDBBCC009016AD8, double 0x3FE5BDB9228DE194, double 0x3FEBAE995E9CB2F7, double 0x3FEF2A3E062AF2DA]
@dgl10.w = internal global [5 x double] [double 0x3FD2E9DE7014D6F1, double 0x3FD13BAA7A559BF8, double 0x3FCC0B059D00BC30, double 0x3FC32138C878EFF4, double 0x3FB1115F8B62DC15]
define double @dgl10(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store double %0, double* %4
store double %1, double* %5
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fcmp oeq double %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store double 0.000000e+00, double* %3
br label %67
13: ; preds = %2
store i32 0, i32* %8
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fcmp ogt double %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
store i32 1, i32* %8
%18 = load double, double* %4
store double %18, double* %6
%19 = load double, double* %5
store double %19, double* %4
%20 = load double, double* %6
store double %20, double* %5
br label %21
21: ; preds = %17, %13
store i32 0, i32* %7
store double 0.000000e+00, double* %6
br label %22
22: ; preds = %50, %21
%23 = load i32, i32* %7
%24 = icmp slt i32 %23, 5
br i1 %24, label %25, label %53
25: ; preds = %22
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [5 x double], [5 x double]* @dgl10.w, i64 0, i64 %27
%29 = load double, double* %28
%30 = load double, double* %4
%31 = load double, double* %5
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [5 x double], [5 x double]* @dgl10.g, i64 0, i64 %33
%35 = load double, double* %34
%36 = call i32 @_Normal(double %30, double %31, double %35)
%37 = call double @_f(i32 %36)
%38 = load double, double* %4
%39 = load double, double* %5
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x double], [5 x double]* @dgl10.g, i64 0, i64 %41
%43 = load double, double* %42
%44 = fneg double %43
%45 = call i32 @_Normal(double %38, double %39, double %44)
%46 = call double @_f(i32 %45)
%47 = fadd double %37, %46
%48 = load double, double* %6
%49 = call double @llvm.fmuladd.f64(double %29, double %47, double %48)
store double %49, double* %6
br label %50
50: ; preds = %25
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %22
53: ; preds = %22
%54 = load double, double* %5
%55 = load double, double* %4
%56 = fsub double %54, %55
%57 = fdiv double %56, 2.000000e+00
%58 = load double, double* %6
%59 = fmul double %58, %57
store double %59, double* %6
%60 = load i32, i32* %8
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %53
%63 = load double, double* %6
%64 = fneg double %63
store double %64, double* %3
br label %67
65: ; preds = %53
%66 = load double, double* %6
store double %66, double* %3
br label %67
67: ; preds = %65, %62, %12
%68 = load double, double* %3
ret double %68
}

LLVM IR (-O2):
define double @dgl10(double %0, double %1) {
%3 = fcmp oeq double %0, %1
br i1 %3, label %43, label %4
4: ; preds = %2
%5 = fcmp ogt double %0, %1
%6 = select i1 %5, double %1, double %0
%7 = select i1 %5, double %0, double %1
%8 = tail call i32 @_Normal(double %6, double %7, double 0x3FC30E507891E272)
%9 = tail call double @_f(i32 %8)
%10 = tail call i32 @_Normal(double %6, double %7, double 0xBFC30E507891E272)
%11 = tail call double @_f(i32 %10)
%12 = fadd double %9, %11
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3FD2E9DE7014D6F1, double 0.000000e+00)
%14 = tail call i32 @_Normal(double %6, double %7, double 0x3FDBBCC009016AD8)
%15 = tail call double @_f(i32 %14)
%16 = tail call i32 @_Normal(double %6, double %7, double 0xBFDBBCC009016AD8)
%17 = tail call double @_f(i32 %16)
%18 = fadd double %15, %17
%19 = tail call double @llvm.fmuladd.f64(double %18, double 0x3FD13BAA7A559BF8, double %13)
%20 = tail call i32 @_Normal(double %6, double %7, double 0x3FE5BDB9228DE194)
%21 = tail call double @_f(i32 %20)
%22 = tail call i32 @_Normal(double %6, double %7, double 0xBFE5BDB9228DE194)
%23 = tail call double @_f(i32 %22)
%24 = fadd double %21, %23
%25 = tail call double @llvm.fmuladd.f64(double %24, double 0x3FCC0B059D00BC30, double %19)
%26 = tail call i32 @_Normal(double %6, double %7, double 0x3FEBAE995E9CB2F7)
%27 = tail call double @_f(i32 %26)
%28 = tail call i32 @_Normal(double %6, double %7, double 0xBFEBAE995E9CB2F7)
%29 = tail call double @_f(i32 %28)
%30 = fadd double %27, %29
%31 = tail call double @llvm.fmuladd.f64(double %30, double 0x3FC32138C878EFF4, double %25)
%32 = tail call i32 @_Normal(double %6, double %7, double 0x3FEF2A3E062AF2DA)
%33 = tail call double @_f(i32 %32)
%34 = tail call i32 @_Normal(double %6, double %7, double 0xBFEF2A3E062AF2DA)
%35 = tail call double @_f(i32 %34)
%36 = fadd double %33, %35
%37 = tail call double @llvm.fmuladd.f64(double %36, double 0x3FB1115F8B62DC15, double %31)
%38 = fsub double %7, %6
%39 = fmul double %38, 5.000000e-01
%40 = fmul double %39, %37
br i1 %5, label %41, label %43
41: ; preds = %4
%42 = fneg double %40
br label %43
43: ; preds = %4, %2, %41
%44 = phi double [ %42, %41 ], [ 0.000000e+00, %2 ], [ %40, %4 ]
ret double %44
}