#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 dgl48(double a, double b) {
  static double g[24] = {
      0.032380170962869362, 0.097004699209462699, 0.161222356068891718,
      0.224763790394689061, 0.287362487355455577, 0.348755886292160738,
      0.408686481990716730, 0.466902904750958405, 0.523160974722233034,
      0.577224726083972704, 0.628867396776513624, 0.677872379632663905,
      0.724034130923814655, 0.767159032515740339, 0.807066204029442627,
      0.843588261624393531, 0.876572020274247886, 0.905879136715569673,
      0.931386690706554333, 0.952987703160430861, 0.970591592546247250,
      0.984124583722826858, 0.993530172266350758, 0.998771007252426119};
  static double w[24] = {
      0.064737696812683923, 0.064466164435950082, 0.063924238584648187,
      0.063114192286254026, 0.062039423159892664, 0.060704439165893880,
      0.059114839698395636, 0.057277292100403216, 0.055199503699984163,
      0.052890189485193667, 0.050359035553854475, 0.047616658492490475,
      0.044674560856694280, 0.041545082943464749, 0.038241351065830706,
      0.034777222564770439, 0.031167227832798089, 0.027426509708356948,
      0.023570760839324379, 0.019616160457355528, 0.015579315722943849,
      0.011477234579234539, 0.007327553901276262, 0.003153346052305839};
  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 < 24; 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):
<dgl48>:
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 <dgl48+0x35>
jp     1155 <dgl48+0x35>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b2 <dgl48+0x192>
movl   $0x0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1191 <dgl48+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   $0x18,-0x24(%rbp)
jge    1258 <dgl48+0x138>
movslq -0x24(%rbp),%rcx
lea    0x2f4b(%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 <dgl48+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 <dgl48+0x188>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12b2 <dgl48+0x192>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgl48>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm2
jne    113d <dgl48+0x1d>
jnp    1224 <dgl48+0x104>
movapd %xmm1,%xmm0
minsd  %xmm2,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x28(%rsp)
maxsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
xorpd  %xmm1,%xmm1
xor    %ebx,%ebx
lea    0xf72(%rip),%r14
lea    0xeab(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm1,0x38(%rsp)
movsd  (%rbx,%r15,1),%xmm2
movaps %xmm2,0x40(%rsp)
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  %xmm0,0x30(%rsp)
movapd 0x40(%rsp),%xmm2
xorpd  0xe44(%rip),%xmm2
movsd  0x8(%rsp),%xmm0
movaps 0x10(%rsp),%xmm1
call   1030 <_Normal@plt>
mov    %eax,%edi
call   1040 <_f@plt>
movsd  0x38(%rsp),%xmm1
addsd  0x30(%rsp),%xmm0
mulsd  (%rbx,%r14,1),%xmm0
addsd  %xmm0,%xmm1
add    $0x8,%rbx
cmp    $0xc0,%rbx
jne    1180 <dgl48+0x60>
movsd  0x20(%rsp),%xmm0
ucomisd 0x28(%rsp),%xmm0
movapd 0x10(%rsp),%xmm0
subsd  0x8(%rsp),%xmm0
mulsd  0xdfa(%rip),%xmm0
mulsd  %xmm1,%xmm0
jbe    1224 <dgl48+0x104>
xorpd  0xddc(%rip),%xmm0
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@dgl48.g = internal global [24 x double] [double 0x3FA094223EA6196D, double 0x3FB8D54CCAA9B7B4, double 0x3FC4A2EF25599831, double 0x3FCCC50F5488FBEF, double 0x3FD26425A1527D42, double 0x3FD65204357A6389, double 0x3FDA27EB589DEA3B, double 0x3FDDE1BCB894046A, double 0x3FE0BDBC159F3714, double 0x3FE2789FFD1F24A0, double 0x3FE41FAE84D5A001, double 0x3FE5B1216AAC49A1, double 0x3FE72B49A0302D99, double 0x3FE88C91196F8E2D, double 0x3FE9D37C81006D1D, double 0x3FEAFEACCF5EEB9E, double 0x3FEC0CE0C3F55453, double 0x3FECFCF63E4A4E84, double 0x3FEDCDEB7610754B, double 0x3FEE7EE011520DFB, double 0x3FEF0F161978472F, double 0x3FEF7DF2D6C8EED7, double 0x3FEFCAFFC9AF24A4, double 0x3FEFF5EE9D8AF2E2]
@dgl48.w = internal global [24 x double] [double 0x3FB092A652A0FBB7, double 0x3FB080DAC3F3725F, double 0x3FB05D56C2248C44, double 0x3FB028406FC86D37, double 0x3FAFC3A19B11A2A4, double 0x3FAF14A6F9E10AD4, double 0x3FAE444CDE6D0026, double 0x3FAD537300BFD4DF, double 0x3FAC431BFE4B31A0, double 0x3FAB146C443C7E24, double 0x3FA9C8A8D5861892, double 0x3FA86135EDF0AA09, double 0x3FA6DF9583AF719D, double 0x3FA54565A91A8406, double 0x3FA3945ED05D7D70, double 0x3FA1CE51F31F701F, double 0x3F9FEA4D40FED235, double 0x3F9C15B1E8F69969, double 0x3F9822EEFBC97517, double 0x3F9416423E8CBA8E, double 0x3F8FE80C5C315C9D, double 0x3F8781605954A638, double 0x3F7E037F45D9BCFF, double 0x3F69D50BC55D2D9A]
define double @dgl48(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, 24
br i1 %24, label %25, label %53
25: ; preds = %22
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [24 x double], [24 x double]* @dgl48.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 [24 x double], [24 x double]* @dgl48.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 [24 x double], [24 x double]* @dgl48.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):
@dgl48.g = internal unnamed_addr constant [24 x double] [double 0x3FA094223EA6196D, double 0x3FB8D54CCAA9B7B4, double 0x3FC4A2EF25599831, double 0x3FCCC50F5488FBEF, double 0x3FD26425A1527D42, double 0x3FD65204357A6389, double 0x3FDA27EB589DEA3B, double 0x3FDDE1BCB894046A, double 0x3FE0BDBC159F3714, double 0x3FE2789FFD1F24A0, double 0x3FE41FAE84D5A001, double 0x3FE5B1216AAC49A1, double 0x3FE72B49A0302D99, double 0x3FE88C91196F8E2D, double 0x3FE9D37C81006D1D, double 0x3FEAFEACCF5EEB9E, double 0x3FEC0CE0C3F55453, double 0x3FECFCF63E4A4E84, double 0x3FEDCDEB7610754B, double 0x3FEE7EE011520DFB, double 0x3FEF0F161978472F, double 0x3FEF7DF2D6C8EED7, double 0x3FEFCAFFC9AF24A4, double 0x3FEFF5EE9D8AF2E2]
@dgl48.w = internal unnamed_addr constant [24 x double] [double 0x3FB092A652A0FBB7, double 0x3FB080DAC3F3725F, double 0x3FB05D56C2248C44, double 0x3FB028406FC86D37, double 0x3FAFC3A19B11A2A4, double 0x3FAF14A6F9E10AD4, double 0x3FAE444CDE6D0026, double 0x3FAD537300BFD4DF, double 0x3FAC431BFE4B31A0, double 0x3FAB146C443C7E24, double 0x3FA9C8A8D5861892, double 0x3FA86135EDF0AA09, double 0x3FA6DF9583AF719D, double 0x3FA54565A91A8406, double 0x3FA3945ED05D7D70, double 0x3FA1CE51F31F701F, double 0x3F9FEA4D40FED235, double 0x3F9C15B1E8F69969, double 0x3F9822EEFBC97517, double 0x3F9416423E8CBA8E, double 0x3F8FE80C5C315C9D, double 0x3F8781605954A638, double 0x3F7E037F45D9BCFF, double 0x3F69D50BC55D2D9A]
define double @dgl48(double %0, double %1) {
%3 = fcmp oeq double %0, %1
br i1 %3, label %30, 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
br label %8
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %22, %8 ]
%10 = phi double [ 0.000000e+00, %4 ], [ %21, %8 ]
%11 = getelementptr inbounds [24 x double], [24 x double]* @dgl48.w, i64 0, i64 %9
%12 = load double, double* %11
%13 = getelementptr inbounds [24 x double], [24 x double]* @dgl48.g, i64 0, i64 %9
%14 = load double, double* %13
%15 = tail call i32 @_Normal(double %6, double %7, double %14)
%16 = tail call double @_f(i32 %15)
%17 = fneg double %14
%18 = tail call i32 @_Normal(double %6, double %7, double %17)
%19 = tail call double @_f(i32 %18)
%20 = fadd double %16, %19
%21 = tail call double @llvm.fmuladd.f64(double %12, double %20, double %10)
%22 = add nuw nsw i64 %9, 1
%23 = icmp eq i64 %22, 24
br i1 %23, label %24, label %8
24: ; preds = %8
%25 = fsub double %7, %6
%26 = fmul double %25, 5.000000e-01
%27 = fmul double %26, %21
br i1 %5, label %28, label %30
28: ; preds = %24
%29 = fneg double %27
br label %30
30: ; preds = %24, %2, %28
%31 = phi double [ %29, %28 ], [ 0.000000e+00, %2 ], [ %27, %24 ]
ret double %31
}