#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 cephes_igamc(int, double);
int pow(int, int);
double psi2(char *, int, int);
double Serial(char *epsilon, int n, int m) {
  double p_value1, p_value2, psim0, psim1, psim2, del1, del2;
  psim0 = psi2(epsilon, m, n);
  psim1 = psi2(epsilon, m - 1, n);
  psim2 = psi2(epsilon, m - 2, n);
  del1 = psim0 - psim1;
  del2 = psim0 - 2.0 * psim1 + psim2;
  p_value1 = cephes_igamc(pow(2, m - 1) / 2, del1 / 2.0);
  p_value2 = cephes_igamc(pow(2, m - 2) / 2, del2 / 2.0);
  return (((p_value1 < 0.01) || (p_value2 < 0.01)) ? (p_value1) : 0);
}


x86 assembly (clang, -O0):
<Serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <psi2@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    -0xc(%rbp),%edx
call   1040 <psi2@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
mov    -0xc(%rbp),%edx
call   1040 <psi2@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    $0x2,%edi
call   1050 <pow@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
movsd  -0x40(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cephes_igamc@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%esi
sub    $0x2,%esi
mov    $0x2,%edi
call   1050 <pow@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
movsd  -0x48(%rbp),%xmm0
movsd  0xdfd(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <cephes_igamc@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xddf(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     123f <Serial+0x10f>
movsd  0xdcc(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    124e <Serial+0x11e>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    125b <Serial+0x12b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    125b <Serial+0x12b>
movsd  -0x50(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Serial>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %edx,%esi
mov    %ebp,%edx
call   1040 <psi2@plt>
movsd  %xmm0,0x8(%rsp)
lea    -0x1(%r14),%r15d
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
call   1040 <psi2@plt>
movsd  %xmm0,0x20(%rsp)
add    $0xfffffffe,%r14d
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
call   1040 <psi2@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm1,%xmm2
movsd  0x20(%rsp),%xmm3
subsd  %xmm3,%xmm2
movsd  %xmm2,0x10(%rsp)
addsd  %xmm3,%xmm3
subsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
mov    %r15d,%esi
call   1050 <pow@plt>
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
movsd  0x10(%rsp),%xmm0
mulsd  0xe37(%rip),%xmm0
call   1030 <cephes_igamc@plt>
movapd %xmm0,0x10(%rsp)
mov    $0x2,%edi
mov    %r14d,%esi
call   1050 <pow@plt>
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
movsd  0x8(%rsp),%xmm0
mulsd  0xe08(%rip),%xmm0
call   1030 <cephes_igamc@plt>
movsd  0xe03(%rip),%xmm2
movapd 0x10(%rsp),%xmm4
movapd %xmm4,%xmm1
cmpltsd %xmm2,%xmm1
movapd %xmm1,%xmm3
andpd  %xmm4,%xmm3
cmpltsd %xmm2,%xmm0
andpd  %xmm4,%xmm0
andnpd %xmm0,%xmm1
orpd   %xmm3,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double @Serial(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = load i32, i32* %5
%17 = call double @psi2(i8* %14, i32 %15, i32 %16)
store double %17, double* %9
%18 = load i8*, i8** %4
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %5
%22 = call double @psi2(i8* %18, i32 %20, i32 %21)
store double %22, double* %10
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sub nsw i32 %24, 2
%26 = load i32, i32* %5
%27 = call double @psi2(i8* %23, i32 %25, i32 %26)
store double %27, double* %11
%28 = load double, double* %9
%29 = load double, double* %10
%30 = fsub double %28, %29
store double %30, double* %12
%31 = load double, double* %9
%32 = load double, double* %10
%33 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %32, double %31)
%34 = load double, double* %11
%35 = fadd double %33, %34
store double %35, double* %13
%36 = load i32, i32* %6
%37 = sub nsw i32 %36, 1
%38 = call i32 @pow(i32 2, i32 %37)
%39 = sdiv i32 %38, 2
%40 = load double, double* %12
%41 = fdiv double %40, 2.000000e+00
%42 = call double @cephes_igamc(i32 %39, double %41)
store double %42, double* %7
%43 = load i32, i32* %6
%44 = sub nsw i32 %43, 2
%45 = call i32 @pow(i32 2, i32 %44)
%46 = sdiv i32 %45, 2
%47 = load double, double* %13
%48 = fdiv double %47, 2.000000e+00
%49 = call double @cephes_igamc(i32 %46, double %48)
store double %49, double* %8
%50 = load double, double* %7
%51 = fcmp olt double %50, 1.000000e-02
br i1 %51, label %55, label %52
52: ; preds = %3
%53 = load double, double* %8
%54 = fcmp olt double %53, 1.000000e-02
br i1 %54, label %55, label %57
55: ; preds = %52, %3
%56 = load double, double* %7
br label %58
57: ; preds = %52
br label %58
58: ; preds = %57, %55
%59 = phi double [ %56, %55 ], [ 0.000000e+00, %57 ]
ret double %59
}

LLVM IR (-O2):
define double @Serial(i8* %0, i32 %1, i32 %2) {
%4 = tail call double @psi2(i8* %0, i32 %2, i32 %1)
%5 = add nsw i32 %2, -1
%6 = tail call double @psi2(i8* %0, i32 %5, i32 %1)
%7 = add nsw i32 %2, -2
%8 = tail call double @psi2(i8* %0, i32 %7, i32 %1)
%9 = fsub double %4, %6
%10 = tail call double @llvm.fmuladd.f64(double %6, double -2.000000e+00, double %4)
%11 = fadd double %10, %8
%12 = tail call i32 @pow(i32 2, i32 %5)
%13 = sdiv i32 %12, 2
%14 = fmul double %9, 5.000000e-01
%15 = tail call double @cephes_igamc(i32 %13, double %14)
%16 = tail call i32 @pow(i32 2, i32 %7)
%17 = sdiv i32 %16, 2
%18 = fmul double %11, 5.000000e-01
%19 = tail call double @cephes_igamc(i32 %17, double %18)
%20 = fcmp olt double %15, 1.000000e-02
%21 = fcmp olt double %19, 1.000000e-02
%22 = select i1 %20, i1 true, i1 %21
%23 = select i1 %22, double %15, double 0.000000e+00
ret double %23
}