#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*/ epp1(double *, double *, int, double);
int /*<<< orphan*/ epp2(double *, double *, int, double);
int /*<<< orphan*/ eppInf(double *, double *, int *, double *, int, double,
                          double);
int /*<<< orphan*/ eppO(double *, double *, int *, double *, int, double,
                        double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void epp(double *x, double *c, int *iter_step, double *v, int n, double rho,
         double p, double c0) {
  if (rho < 0) {
    printf("\n rho should be non-negative!");
    exit(1);
  }
  if (p == 1) {
    epp1(x, v, n, rho);
    *c = 0;
    iter_step[0] = iter_step[1] = 0;
  } else if (p == 2) {
    epp2(x, v, n, rho);
    *c = 0;
    iter_step[0] = iter_step[1] = 0;
  } else if (p >= 1e6)
    eppInf(x, c, iter_step, v, n, rho, c0);
  else
    eppO(x, c, iter_step, v, n, rho, p);
}


x86 assembly (clang, -O0):
<epp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    11af <epp+0x4f>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
movsd  -0x38(%rbp),%xmm0
movsd  0xe44(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1206 <epp+0xa6>
jp     1206 <epp+0xa6>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1050 <epp1@plt>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    12c9 <epp+0x169>
movsd  -0x38(%rbp),%xmm0
movsd  0xdf5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    125d <epp+0xfd>
jp     125d <epp+0xfd>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
movsd  -0x30(%rbp),%xmm0
call   1080 <epp2@plt>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    12c4 <epp+0x164>
movsd  -0x38(%rbp),%xmm0
movsd  0xda6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     129c <epp+0x13c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
call   1060 <eppInf@plt>
jmp    12bf <epp+0x15f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
call   1040 <eppO@plt>
jmp    12c4 <epp+0x164>
jmp    12c9 <epp+0x169>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epp>:
push   %r14
push   %rbx
push   %rax
xorpd  %xmm3,%xmm3
ucomisd %xmm0,%xmm3
ja     11e5 <epp+0x85>
mov    %rdx,%r14
mov    %rsi,%rbx
ucomisd 0xe84(%rip),%xmm1
jne    118d <epp+0x2d>
jp     118d <epp+0x2d>
mov    %rcx,%rsi
mov    %r8d,%edx
call   1050 <epp1@plt>
jmp    11a4 <epp+0x44>
ucomisd 0xe73(%rip),%xmm1
jne    11ba <epp+0x5a>
jp     11ba <epp+0x5a>
mov    %rcx,%rsi
mov    %r8d,%edx
call   1080 <epp2@plt>
movq   $0x0,(%rbx)
movq   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rsi
mov    %r14,%rdx
ucomisd 0xe48(%rip),%xmm1
jae    11d6 <epp+0x76>
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <eppO@plt>
movaps %xmm2,%xmm1
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <eppInf@plt>
lea    0xe2c(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"\0A rho should be non-negative!\00"
define void @epp(double* %0, double* %1, i32* %2, double* %3, i32 %4, double %5, double %6, double %7) {
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double* %0, double** %9
store double* %1, double** %10
store i32* %2, i32** %11
store double* %3, double** %12
store i32 %4, i32* %13
store double %5, double* %14
store double %6, double* %15
store double %7, double* %16
%17 = load double, double* %14
%18 = fcmp olt double %17, 0.000000e+00
br i1 %18, label %19, label %22
19: ; preds = %8
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %8
%23 = load double, double* %15
%24 = fcmp oeq double %23, 1.000000e+00
br i1 %24, label %25, label %36
25: ; preds = %22
%26 = load double*, double** %9
%27 = load double*, double** %12
%28 = load i32, i32* %13
%29 = load double, double* %14
%30 = call i32 @epp1(double* %26, double* %27, i32 %28, double %29)
%31 = load double*, double** %10
store double 0.000000e+00, double* %31
%32 = load i32*, i32** %11
%33 = getelementptr inbounds i32, i32* %32, i64 1
store i32 0, i32* %33
%34 = load i32*, i32** %11
%35 = getelementptr inbounds i32, i32* %34, i64 0
store i32 0, i32* %35
br label %73
36: ; preds = %22
%37 = load double, double* %15
%38 = fcmp oeq double %37, 2.000000e+00
br i1 %38, label %39, label %50
39: ; preds = %36
%40 = load double*, double** %9
%41 = load double*, double** %12
%42 = load i32, i32* %13
%43 = load double, double* %14
%44 = call i32 @epp2(double* %40, double* %41, i32 %42, double %43)
%45 = load double*, double** %10
store double 0.000000e+00, double* %45
%46 = load i32*, i32** %11
%47 = getelementptr inbounds i32, i32* %46, i64 1
store i32 0, i32* %47
%48 = load i32*, i32** %11
%49 = getelementptr inbounds i32, i32* %48, i64 0
store i32 0, i32* %49
br label %72
50: ; preds = %36
%51 = load double, double* %15
%52 = fcmp oge double %51, 1.000000e+06
br i1 %52, label %53, label %62
53: ; preds = %50
%54 = load double*, double** %9
%55 = load double*, double** %10
%56 = load i32*, i32** %11
%57 = load double*, double** %12
%58 = load i32, i32* %13
%59 = load double, double* %14
%60 = load double, double* %16
%61 = call i32 @eppInf(double* %54, double* %55, i32* %56, double* %57, i32 %58, double %59, double %60)
br label %71
62: ; preds = %50
%63 = load double*, double** %9
%64 = load double*, double** %10
%65 = load i32*, i32** %11
%66 = load double*, double** %12
%67 = load i32, i32* %13
%68 = load double, double* %14
%69 = load double, double* %15
%70 = call i32 @eppO(double* %63, double* %64, i32* %65, double* %66, i32 %67, double %68, double %69)
br label %71
71: ; preds = %62, %53
br label %72
72: ; preds = %71, %39
br label %73
73: ; preds = %72, %25
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0A rho should be non-negative!\00"
define void @epp(double* %0, double* %1, i32* %2, double* %3, i32 %4, double %5, double %6, double %7) {
%9 = fcmp olt double %5, 0.000000e+00
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %8
%14 = fcmp oeq double %6, 1.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = tail call i32 @epp1(double* %0, double* %3, i32 %4, double %5)
store double 0.000000e+00, double* %1
%17 = getelementptr inbounds i32, i32* %2, i64 1
store i32 0, i32* %17
store i32 0, i32* %2
br label %29
18: ; preds = %13
%19 = fcmp oeq double %6, 2.000000e+00
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = tail call i32 @epp2(double* %0, double* %3, i32 %4, double %5)
store double 0.000000e+00, double* %1
%22 = getelementptr inbounds i32, i32* %2, i64 1
store i32 0, i32* %22
store i32 0, i32* %2
br label %29
23: ; preds = %18
%24 = fcmp ult double %6, 1.000000e+06
br i1 %24, label %27, label %25
25: ; preds = %23
%26 = tail call i32 @eppInf(double* %0, double* %1, i32* %2, double* %3, i32 %4, double %5, double %7)
br label %29
27: ; preds = %23
%28 = tail call i32 @eppO(double* %0, double* %1, i32* %2, double* %3, i32 %4, double %5, double %6)
br label %29
29: ; preds = %20, %27, %25, %15
ret void
}