#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 lowq(double *, int);
int /*<<< orphan*/ printf(char *, double, double, double);
double upq(double *, int);
int outliers(double *vals, int len) {
  double q1 = lowq(vals, len);
  double q3 = upq(vals, len);
  double iqr = q3 - q1;
  double min = q1 - (iqr * 1.5);
  double max = q3 + (iqr * 1.5);
  if (min - max == 0) {
    min -= 2;
    max += 2;
  } else if (min - max == 1) {
    min -= 1;
    max += 1;
  }
  if (min < 0) {
    min += (min * -1);
    max += (min * -1);
  }
  int ret = 0;
  for (int i = 0; i < len; i++) {
    if ((vals[i] < min) || (vals[i] > max)) {
      printf("%f is not in (%f, %f)\n", vals[i], min, max);
      ret++;
    }
  }
  return ret;
}


x86 assembly (clang, -O0):
<outliers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <lowq@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <upq@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe67(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xe48(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    120f <outliers+0xdf>
jp     120f <outliers+0xdf>
movsd  -0x30(%rbp),%xmm0
movsd  0xe21(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe10(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    125e <outliers+0x12e>
movsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  0xde7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1259 <outliers+0x129>
jp     1259 <outliers+0x129>
movsd  -0x30(%rbp),%xmm0
movsd  0xdca(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xdb9(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    125e <outliers+0x12e>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    1292 <outliers+0x162>
movsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    131f <outliers+0x1ef>
mov    -0x8(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x30(%rbp),%xmm0
ucomisd %xmm1,%xmm0
ja     12e0 <outliers+0x1b0>
mov    -0x8(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x38(%rbp),%xmm0
jbe    130c <outliers+0x1dc>
mov    -0x8(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
lea    0xd1a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1311 <outliers+0x1e1>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12a0 <outliers+0x170>
mov    -0x3c(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outliers>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ebp
mov    %rdi,%r15
call   1040 <lowq@plt>
movapd %xmm0,(%rsp)
mov    %r15,%rdi
mov    %ebp,%esi
call   1050 <upq@plt>
movapd %xmm0,%xmm2
movapd (%rsp),%xmm1
subsd  %xmm1,%xmm2
movapd 0xe96(%rip),%xmm4
xorpd  %xmm2,%xmm4
unpcklpd %xmm2,%xmm4
unpcklpd %xmm0,%xmm1
mulpd  0xe92(%rip),%xmm4
addpd  %xmm1,%xmm4
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
movapd %xmm4,%xmm0
subsd  %xmm2,%xmm0
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
jne    11a8 <outliers+0x78>
jp     11a8 <outliers+0x78>
addpd  0xe8a(%rip),%xmm4
jmp    11bc <outliers+0x8c>
ucomisd 0xe90(%rip),%xmm0
jne    11bc <outliers+0x8c>
jp     11bc <outliers+0x8c>
addpd  0xe64(%rip),%xmm4
xorpd  %xmm3,%xmm3
ucomisd %xmm4,%xmm3
movapd %xmm4,%xmm0
subsd  %xmm4,%xmm0
movapd %xmm4,%xmm2
unpckhpd %xmm4,%xmm2
jbe    11da <outliers+0xaa>
subsd  %xmm0,%xmm2
test   %ebp,%ebp
jle    1243 <outliers+0x113>
movapd %xmm4,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm4,%xmm1
orpd   %xmm0,%xmm1
mov    %ebp,%r12d
xor    %ebx,%ebx
lea    0xe49(%rip),%r14
xor    %ebp,%ebp
movapd %xmm2,(%rsp)
movapd %xmm1,0x10(%rsp)
jmp    122f <outliers+0xff>
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
movapd 0x10(%rsp),%xmm1
movapd (%rsp),%xmm2
add    $0x1,%ebp
add    $0x1,%rbx
cmp    %rbx,%r12
je     1245 <outliers+0x115>
movsd  (%r15,%rbx,8),%xmm0
ucomisd %xmm0,%xmm1
ja     1210 <outliers+0xe0>
ucomisd %xmm2,%xmm0
jbe    1226 <outliers+0xf6>
jmp    1210 <outliers+0xe0>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"%f is not in (%f, %f)\0A\00"
define i32 @outliers(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%12 = load double*, double** %3
%13 = load i32, i32* %4
%14 = call double @lowq(double* %12, i32 %13)
store double %14, double* %5
%15 = load double*, double** %3
%16 = load i32, i32* %4
%17 = call double @upq(double* %15, i32 %16)
store double %17, double* %6
%18 = load double, double* %6
%19 = load double, double* %5
%20 = fsub double %18, %19
store double %20, double* %7
%21 = load double, double* %5
%22 = load double, double* %7
%23 = fneg double %22
%24 = call double @llvm.fmuladd.f64(double %23, double 1.500000e+00, double %21)
store double %24, double* %8
%25 = load double, double* %6
%26 = load double, double* %7
%27 = call double @llvm.fmuladd.f64(double %26, double 1.500000e+00, double %25)
store double %27, double* %9
%28 = load double, double* %8
%29 = load double, double* %9
%30 = fsub double %28, %29
%31 = fcmp oeq double %30, 0.000000e+00
br i1 %31, label %32, label %37
32: ; preds = %2
%33 = load double, double* %8
%34 = fsub double %33, 2.000000e+00
store double %34, double* %8
%35 = load double, double* %9
%36 = fadd double %35, 2.000000e+00
store double %36, double* %9
br label %48
37: ; preds = %2
%38 = load double, double* %8
%39 = load double, double* %9
%40 = fsub double %38, %39
%41 = fcmp oeq double %40, 1.000000e+00
br i1 %41, label %42, label %47
42: ; preds = %37
%43 = load double, double* %8
%44 = fsub double %43, 1.000000e+00
store double %44, double* %8
%45 = load double, double* %9
%46 = fadd double %45, 1.000000e+00
store double %46, double* %9
br label %47
47: ; preds = %42, %37
br label %48
48: ; preds = %47, %32
%49 = load double, double* %8
%50 = fcmp olt double %49, 0.000000e+00
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = load double, double* %8
%53 = load double, double* %8
%54 = call double @llvm.fmuladd.f64(double %52, double -1.000000e+00, double %53)
store double %54, double* %8
%55 = load double, double* %8
%56 = load double, double* %9
%57 = call double @llvm.fmuladd.f64(double %55, double -1.000000e+00, double %56)
store double %57, double* %9
br label %58
58: ; preds = %51, %48
store i32 0, i32* %10
store i32 0, i32* %11
br label %59
59: ; preds = %91, %58
%60 = load i32, i32* %11
%61 = load i32, i32* %4
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %94
63: ; preds = %59
%64 = load double*, double** %3
%65 = load i32, i32* %11
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds double, double* %64, i64 %66
%68 = load double, double* %67
%69 = load double, double* %8
%70 = fcmp olt double %68, %69
br i1 %70, label %79, label %71
71: ; preds = %63
%72 = load double*, double** %3
%73 = load i32, i32* %11
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %72, i64 %74
%76 = load double, double* %75
%77 = load double, double* %9
%78 = fcmp ogt double %76, %77
br i1 %78, label %79, label %90
79: ; preds = %71, %63
%80 = load double*, double** %3
%81 = load i32, i32* %11
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
%85 = load double, double* %8
%86 = load double, double* %9
%87 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %84, double %85, double %86)
%88 = load i32, i32* %10
%89 = add nsw i32 %88, 1
store i32 %89, i32* %10
br label %90
90: ; preds = %79, %71
br label %91
91: ; preds = %90
%92 = load i32, i32* %11
%93 = add nsw i32 %92, 1
store i32 %93, i32* %11
br label %59
94: ; preds = %59
%95 = load i32, i32* %10
ret i32 %95
}

LLVM IR (-O2):
@.str = [23 x i8] c"%f is not in (%f, %f)\0A\00"
define i32 @outliers(double* %0, i32 %1) {
%3 = tail call double @lowq(double* %0, i32 %1)
%4 = tail call double @upq(double* %0, i32 %1)
%5 = fsub double %4, %3
%6 = fneg double %5
%7 = insertelement <2 x double> poison, double %6, i64 0
%8 = insertelement <2 x double> %7, double %5, i64 1
%9 = insertelement <2 x double> poison, double %3, i64 0
%10 = insertelement <2 x double> %9, double %4, i64 1
%11 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %8, <2 x double> <double 1.500000e+00, double 1.500000e+00>, <2 x double> %10)
%12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%13 = fsub <2 x double> %11, %12
%14 = extractelement <2 x double> %13, i64 0
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = fadd <2 x double> %11, <double -2.000000e+00, double 2.000000e+00>
br label %22
18: ; preds = %2
%19 = fcmp oeq double %14, 1.000000e+00
br i1 %19, label %20, label %22
20: ; preds = %18
%21 = fadd <2 x double> %11, <double -1.000000e+00, double 1.000000e+00>
br label %22
22: ; preds = %18, %20, %16
%23 = phi <2 x double> [ %17, %16 ], [ %21, %20 ], [ %11, %18 ]
%24 = extractelement <2 x double> %23, i64 0
%25 = fcmp olt double %24, 0.000000e+00
%26 = tail call double @llvm.fmuladd.f64(double %24, double -1.000000e+00, double %24)
%27 = extractelement <2 x double> %23, i64 1
%28 = tail call double @llvm.fmuladd.f64(double %26, double -1.000000e+00, double %27)
%29 = select i1 %25, double %26, double %24
%30 = select i1 %25, double %28, double %27
%31 = icmp sgt i32 %1, 0
br i1 %31, label %32, label %34
32: ; preds = %22
%33 = zext i32 %1 to i64
br label %36
34: ; preds = %47, %22
%35 = phi i32 [ 0, %22 ], [ %48, %47 ]
ret i32 %35
36: ; preds = %32, %47
%37 = phi i64 [ 0, %32 ], [ %49, %47 ]
%38 = phi i32 [ 0, %32 ], [ %48, %47 ]
%39 = getelementptr inbounds double, double* %0, i64 %37
%40 = load double, double* %39
%41 = fcmp olt double %40, %29
%42 = fcmp ogt double %40, %30
%43 = select i1 %41, i1 true, i1 %42
br i1 %43, label %44, label %47
44: ; preds = %36
%45 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), double %40, double %29, double %30)
%46 = add nsw i32 %38, 1
br label %47
47: ; preds = %36, %44
%48 = phi i32 [ %46, %44 ], [ %38, %36 ]
%49 = add nuw nsw i64 %37, 1
%50 = icmp eq i64 %49, %33
br i1 %50, label %34, label %36
}