#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*/ FnMeanSigma_float(float *, long, int, float, long *,
                                     double *, double *, int *);
int /*<<< orphan*/ FnNoise1_float(float *, long, long, int, float, double *,
                                  int *);
int /*<<< orphan*/ FnNoise5_float(float *, long, long, int, float, long *,
                                  float *, float *, double *, double *,
                                  double *, int *);
int fits_img_stats_float(float *array, long nx, long ny, int nullcheck,
                         float nullvalue, long *ngoodpix, float *minvalue,
                         float *maxvalue, double *mean, double *sigma,
                         double *noise1, double *noise2, double *noise3,
                         double *noise5, int *status) {
  long ngood;
  float minval, maxval;
  double xmean = 0., xsigma = 0., xnoise = 0., xnoise2 = 0., xnoise3 = 0.,
         xnoise5 = 0.;
  if (mean || sigma) {
    FnMeanSigma_float(array, nx * ny, nullcheck, nullvalue, &ngood, &xmean,
                      &xsigma, status);
    if (ngoodpix)
      *ngoodpix = ngood;
    if (mean)
      *mean = xmean;
    if (sigma)
      *sigma = xsigma;
  }
  if (noise1) {
    FnNoise1_float(array, nx, ny, nullcheck, nullvalue, &xnoise, status);
    *noise1 = xnoise;
  }
  if (minvalue || maxvalue || noise3) {
    FnNoise5_float(array, nx, ny, nullcheck, nullvalue, &ngood, &minval,
                   &maxval, &xnoise2, &xnoise3, &xnoise5, status);
    if (ngoodpix)
      *ngoodpix = ngood;
    if (minvalue)
      *minvalue = minval;
    if (maxvalue)
      *maxvalue = maxval;
    if (noise2)
      *noise2 = xnoise2;
    if (noise3)
      *noise3 = xnoise3;
    if (noise5)
      *noise5 = xnoise5;
  }
  return (*status);
}


x86 assembly (clang, -O0):
<fits_img_stats_float>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
movss  %xmm0,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
cmpq   $0x0,0x18(%rbp)
jne    11c0 <fits_img_stats_float+0x90>
cmpq   $0x0,0x20(%rbp)
je     1239 <fits_img_stats_float+0x109>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
imul   -0x28(%rbp),%rsi
mov    -0x2c(%rbp),%edx
movss  -0x30(%rbp),%xmm0
mov    0x48(%rbp),%rax
lea    -0x48(%rbp),%rcx
lea    -0x58(%rbp),%r8
lea    -0x60(%rbp),%r9
mov    %rax,(%rsp)
call   1050 <FnMeanSigma_float@plt>
cmpq   $0x0,-0x38(%rbp)
je     1204 <fits_img_stats_float+0xd4>
mov    -0x48(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,0x18(%rbp)
je     121c <fits_img_stats_float+0xec>
movsd  -0x58(%rbp),%xmm0
mov    0x18(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,0x20(%rbp)
je     1234 <fits_img_stats_float+0x104>
movsd  -0x60(%rbp),%xmm0
mov    0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1239 <fits_img_stats_float+0x109>
cmpq   $0x0,0x28(%rbp)
je     1272 <fits_img_stats_float+0x142>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
movss  -0x30(%rbp),%xmm0
mov    0x48(%rbp),%r9
lea    -0x68(%rbp),%r8
call   1040 <FnNoise1_float@plt>
movsd  -0x68(%rbp),%xmm0
mov    0x28(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,-0x40(%rbp)
jne    1293 <fits_img_stats_float+0x163>
cmpq   $0x0,0x10(%rbp)
jne    1293 <fits_img_stats_float+0x163>
cmpq   $0x0,0x38(%rbp)
je     1373 <fits_img_stats_float+0x243>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
movss  -0x30(%rbp),%xmm0
mov    0x48(%rbp),%rax
lea    -0x48(%rbp),%r8
lea    -0x4c(%rbp),%r9
lea    -0x50(%rbp),%r14
lea    -0x70(%rbp),%rbx
lea    -0x78(%rbp),%r11
lea    -0x80(%rbp),%r10
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <FnNoise5_float@plt>
cmpq   $0x0,-0x38(%rbp)
je     12f6 <fits_img_stats_float+0x1c6>
mov    -0x48(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x40(%rbp)
je     130e <fits_img_stats_float+0x1de>
movss  -0x4c(%rbp),%xmm0
mov    -0x40(%rbp),%rax
movss  %xmm0,(%rax)
cmpq   $0x0,0x10(%rbp)
je     1326 <fits_img_stats_float+0x1f6>
movss  -0x50(%rbp),%xmm0
mov    0x10(%rbp),%rax
movss  %xmm0,(%rax)
cmpq   $0x0,0x30(%rbp)
je     133e <fits_img_stats_float+0x20e>
movsd  -0x70(%rbp),%xmm0
mov    0x30(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,0x38(%rbp)
je     1356 <fits_img_stats_float+0x226>
movsd  -0x78(%rbp),%xmm0
mov    0x38(%rbp),%rax
movsd  %xmm0,(%rax)
cmpq   $0x0,0x40(%rbp)
je     136e <fits_img_stats_float+0x23e>
movsd  -0x80(%rbp),%xmm0
mov    0x40(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    1373 <fits_img_stats_float+0x243>
mov    0x48(%rbp),%rax
mov    (%rax),%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<fits_img_stats_float>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,0x18(%rsp)
mov    %ecx,%r13d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%r14
mov    0xa0(%rsp),%rbx
mov    0x98(%rsp),%r12
movq   $0x0,0x50(%rsp)
movq   $0x0,0x48(%rsp)
movq   $0x0,0x40(%rsp)
movq   $0x0,0x38(%rsp)
movq   $0x0,0x30(%rsp)
movq   $0x0,0x28(%rsp)
mov    %r12,%rax
or     %rbx,%rax
movss  %xmm0,0x4(%rsp)
je     1210 <fits_img_stats_float+0xe0>
mov    %r15,%rsi
imul   %rbp,%rsi
sub    $0x8,%rsp
lea    0x10(%rsp),%rcx
lea    0x58(%rsp),%r8
lea    0x50(%rsp),%r9
mov    %r14,%rdi
mov    %r13d,%edx
push   0xd0(%rsp)
call   1050 <FnMeanSigma_float@plt>
add    $0x10,%rsp
mov    0x18(%rsp),%rcx
test   %rcx,%rcx
je     11ea <fits_img_stats_float+0xba>
mov    0x8(%rsp),%rax
mov    %rax,(%rcx)
test   %r12,%r12
je     11fb <fits_img_stats_float+0xcb>
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,(%r12)
test   %rbx,%rbx
movss  0x4(%rsp),%xmm0
je     1210 <fits_img_stats_float+0xe0>
movsd  0x48(%rsp),%xmm1
movsd  %xmm1,(%rbx)
mov    0xa8(%rsp),%rbx
test   %rbx,%rbx
mov    0xc8(%rsp),%r12
je     124e <fits_img_stats_float+0x11e>
lea    0x40(%rsp),%r8
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r13d,%ecx
mov    %r12,%r9
call   1040 <FnNoise1_float@plt>
movss  0x4(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
movsd  %xmm1,(%rbx)
cmpq   $0x0,0x20(%rsp)
jne    1270 <fits_img_stats_float+0x140>
cmpq   $0x0,0x90(%rsp)
jne    1270 <fits_img_stats_float+0x140>
cmpq   $0x0,0xb8(%rsp)
je     1331 <fits_img_stats_float+0x201>
sub    $0x8,%rsp
lea    0x30(%rsp),%rax
lea    0x38(%rsp),%r10
lea    0x40(%rsp),%r11
lea    0x18(%rsp),%rbx
lea    0x10(%rsp),%r8
lea    0x1c(%rsp),%r9
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r13d,%ecx
push   %r12
push   %rax
push   %r10
push   %r11
push   %rbx
call   1030 <FnNoise5_float@plt>
add    $0x30,%rsp
mov    0x18(%rsp),%rcx
test   %rcx,%rcx
je     12c1 <fits_img_stats_float+0x191>
mov    0x8(%rsp),%rax
mov    %rax,(%rcx)
mov    0x20(%rsp),%rax
test   %rax,%rax
mov    0x90(%rsp),%rdx
je     12dd <fits_img_stats_float+0x1ad>
movss  0x14(%rsp),%xmm0
movss  %xmm0,(%rax)
mov    0xb0(%rsp),%rax
test   %rdx,%rdx
mov    0xb8(%rsp),%rcx
je     12fc <fits_img_stats_float+0x1cc>
movss  0x10(%rsp),%xmm0
movss  %xmm0,(%rdx)
test   %rax,%rax
je     130b <fits_img_stats_float+0x1db>
movsd  0x38(%rsp),%xmm0
movsd  %xmm0,(%rax)
mov    0xc0(%rsp),%rax
test   %rcx,%rcx
je     1322 <fits_img_stats_float+0x1f2>
movsd  0x30(%rsp),%xmm0
movsd  %xmm0,(%rcx)
test   %rax,%rax
je     1331 <fits_img_stats_float+0x201>
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,(%rax)
mov    (%r12),%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fits_img_stats_float(float* %0, i64 %1, i64 %2, i32 %3, float %4, i64* %5, float* %6, float* %7, double* %8, double* %9, double* %10, double* %11, double* %12, double* %13, i32* %14) {
%16 = alloca float*
%17 = alloca i64
%18 = alloca i64
%19 = alloca i32
%20 = alloca float
%21 = alloca i64*
%22 = alloca float*
%23 = alloca float*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca i32*
%31 = alloca i64
%32 = alloca float
%33 = alloca float
%34 = alloca double
%35 = alloca double
%36 = alloca double
%37 = alloca double
%38 = alloca double
%39 = alloca double
store float* %0, float** %16
store i64 %1, i64* %17
store i64 %2, i64* %18
store i32 %3, i32* %19
store float %4, float* %20
store i64* %5, i64** %21
store float* %6, float** %22
store float* %7, float** %23
store double* %8, double** %24
store double* %9, double** %25
store double* %10, double** %26
store double* %11, double** %27
store double* %12, double** %28
store double* %13, double** %29
store i32* %14, i32** %30
store double 0.000000e+00, double* %34
store double 0.000000e+00, double* %35
store double 0.000000e+00, double* %36
store double 0.000000e+00, double* %37
store double 0.000000e+00, double* %38
store double 0.000000e+00, double* %39
%40 = load double*, double** %24
%41 = icmp ne double* %40, null
br i1 %41, label %45, label %42
42: ; preds = %15
%43 = load double*, double** %25
%44 = icmp ne double* %43, null
br i1 %44, label %45, label %72
45: ; preds = %42, %15
%46 = load float*, float** %16
%47 = load i64, i64* %17
%48 = load i64, i64* %18
%49 = mul nsw i64 %47, %48
%50 = load i32, i32* %19
%51 = load float, float* %20
%52 = load i32*, i32** %30
%53 = call i32 @FnMeanSigma_float(float* %46, i64 %49, i32 %50, float %51, i64* %31, double* %34, double* %35, i32* %52)
%54 = load i64*, i64** %21
%55 = icmp ne i64* %54, null
br i1 %55, label %56, label %59
56: ; preds = %45
%57 = load i64, i64* %31
%58 = load i64*, i64** %21
store i64 %57, i64* %58
br label %59
59: ; preds = %56, %45
%60 = load double*, double** %24
%61 = icmp ne double* %60, null
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load double, double* %34
%64 = load double*, double** %24
store double %63, double* %64
br label %65
65: ; preds = %62, %59
%66 = load double*, double** %25
%67 = icmp ne double* %66, null
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load double, double* %35
%70 = load double*, double** %25
store double %69, double* %70
br label %71
71: ; preds = %68, %65
br label %72
72: ; preds = %71, %42
%73 = load double*, double** %26
%74 = icmp ne double* %73, null
br i1 %74, label %75, label %85
75: ; preds = %72
%76 = load float*, float** %16
%77 = load i64, i64* %17
%78 = load i64, i64* %18
%79 = load i32, i32* %19
%80 = load float, float* %20
%81 = load i32*, i32** %30
%82 = call i32 @FnNoise1_float(float* %76, i64 %77, i64 %78, i32 %79, float %80, double* %36, i32* %81)
%83 = load double, double* %36
%84 = load double*, double** %26
store double %83, double* %84
br label %85
85: ; preds = %75, %72
%86 = load float*, float** %22
%87 = icmp ne float* %86, null
br i1 %87, label %94, label %88
88: ; preds = %85
%89 = load float*, float** %23
%90 = icmp ne float* %89, null
br i1 %90, label %94, label %91
91: ; preds = %88
%92 = load double*, double** %28
%93 = icmp ne double* %92, null
br i1 %93, label %94, label %138
94: ; preds = %91, %88, %85
%95 = load float*, float** %16
%96 = load i64, i64* %17
%97 = load i64, i64* %18
%98 = load i32, i32* %19
%99 = load float, float* %20
%100 = load i32*, i32** %30
%101 = call i32 @FnNoise5_float(float* %95, i64 %96, i64 %97, i32 %98, float %99, i64* %31, float* %32, float* %33, double* %37, double* %38, double* %39, i32* %100)
%102 = load i64*, i64** %21
%103 = icmp ne i64* %102, null
br i1 %103, label %104, label %107
104: ; preds = %94
%105 = load i64, i64* %31
%106 = load i64*, i64** %21
store i64 %105, i64* %106
br label %107
107: ; preds = %104, %94
%108 = load float*, float** %22
%109 = icmp ne float* %108, null
br i1 %109, label %110, label %113
110: ; preds = %107
%111 = load float, float* %32
%112 = load float*, float** %22
store float %111, float* %112
br label %113
113: ; preds = %110, %107
%114 = load float*, float** %23
%115 = icmp ne float* %114, null
br i1 %115, label %116, label %119
116: ; preds = %113
%117 = load float, float* %33
%118 = load float*, float** %23
store float %117, float* %118
br label %119
119: ; preds = %116, %113
%120 = load double*, double** %27
%121 = icmp ne double* %120, null
br i1 %121, label %122, label %125
122: ; preds = %119
%123 = load double, double* %37
%124 = load double*, double** %27
store double %123, double* %124
br label %125
125: ; preds = %122, %119
%126 = load double*, double** %28
%127 = icmp ne double* %126, null
br i1 %127, label %128, label %131
128: ; preds = %125
%129 = load double, double* %38
%130 = load double*, double** %28
store double %129, double* %130
br label %131
131: ; preds = %128, %125
%132 = load double*, double** %29
%133 = icmp ne double* %132, null
br i1 %133, label %134, label %137
134: ; preds = %131
%135 = load double, double* %39
%136 = load double*, double** %29
store double %135, double* %136
br label %137
137: ; preds = %134, %131
br label %138
138: ; preds = %137, %91
%139 = load i32*, i32** %30
%140 = load i32, i32* %139
ret i32 %140
}

LLVM IR (-O2):
define i32 @fits_img_stats_float(float* %0, i64 %1, i64 %2, i32 %3, float %4, i64* writeonly %5, float* writeonly %6, float* writeonly %7, double* writeonly %8, double* writeonly %9, double* writeonly %10, double* writeonly %11, double* writeonly %12, double* writeonly %13, i32* %14) {
%16 = alloca i64
%17 = alloca float
%18 = alloca float
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = bitcast i64* %16 to i8*
%26 = bitcast float* %17 to i8*
%27 = bitcast float* %18 to i8*
%28 = bitcast double* %19 to i8*
store double 0.000000e+00, double* %19
%29 = bitcast double* %20 to i8*
store double 0.000000e+00, double* %20
%30 = bitcast double* %21 to i8*
store double 0.000000e+00, double* %21
%31 = bitcast double* %22 to i8*
store double 0.000000e+00, double* %22
%32 = bitcast double* %23 to i8*
store double 0.000000e+00, double* %23
%33 = bitcast double* %24 to i8*
store double 0.000000e+00, double* %24
%34 = icmp ne double* %8, null
%35 = icmp ne double* %9, null
%36 = or i1 %34, %35
br i1 %36, label %37, label %49
37: ; preds = %15
%38 = mul nsw i64 %2, %1
%39 = call i32 @FnMeanSigma_float(float* %0, i64 %38, i32 %3, float %4, i64* %16, double* %19, double* %20, i32* %14)
%40 = icmp eq i64* %5, null
br i1 %40, label %43, label %41
41: ; preds = %37
%42 = load i64, i64* %16
store i64 %42, i64* %5
br label %43
43: ; preds = %41, %37
br i1 %34, label %44, label %46
44: ; preds = %43
%45 = load double, double* %19
store double %45, double* %8
br label %46
46: ; preds = %44, %43
br i1 %35, label %47, label %49
47: ; preds = %46
%48 = load double, double* %20
store double %48, double* %9
br label %49
49: ; preds = %46, %47, %15
%50 = icmp eq double* %10, null
br i1 %50, label %54, label %51
51: ; preds = %49
%52 = call i32 @FnNoise1_float(float* %0, i64 %1, i64 %2, i32 %3, float %4, double* %21, i32* %14)
%53 = load double, double* %21
store double %53, double* %10
br label %54
54: ; preds = %51, %49
%55 = icmp ne float* %6, null
%56 = icmp ne float* %7, null
%57 = or i1 %55, %56
%58 = icmp ne double* %12, null
%59 = or i1 %57, %58
br i1 %59, label %60, label %82
60: ; preds = %54
%61 = call i32 @FnNoise5_float(float* %0, i64 %1, i64 %2, i32 %3, float %4, i64* %16, float* %17, float* %18, double* %22, double* %23, double* %24, i32* %14)
%62 = icmp eq i64* %5, null
br i1 %62, label %65, label %63
63: ; preds = %60
%64 = load i64, i64* %16
store i64 %64, i64* %5
br label %65
65: ; preds = %63, %60
br i1 %55, label %66, label %68
66: ; preds = %65
%67 = load float, float* %17
store float %67, float* %6
br label %68
68: ; preds = %66, %65
br i1 %56, label %69, label %71
69: ; preds = %68
%70 = load float, float* %18
store float %70, float* %7
br label %71
71: ; preds = %69, %68
%72 = icmp eq double* %11, null
br i1 %72, label %75, label %73
73: ; preds = %71
%74 = load double, double* %22
store double %74, double* %11
br label %75
75: ; preds = %73, %71
br i1 %58, label %76, label %78
76: ; preds = %75
%77 = load double, double* %23
store double %77, double* %12
br label %78
78: ; preds = %76, %75
%79 = icmp eq double* %13, null
br i1 %79, label %82, label %80
80: ; preds = %78
%81 = load double, double* %24
store double %81, double* %13
br label %82
82: ; preds = %78, %80, %54
%83 = load i32, i32* %14
ret i32 %83
}