#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 atan(double);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
int /*<<< orphan*/ morphological_feature_central_moments(double, double, int **,
                                                         int, int, int,
                                                         unsigned char *,
                                                         double *);
int /*<<< orphan*/ printf(char *, int);
int morphological_feature_object_orientation(int **obj_id, int width,
                                             int height, int n_object,
                                             unsigned char *image,
                                             double *object_orientation) {
  unsigned int i = 0;
  double *mi00 = NULL;
  mi00 = (double *)malloc(n_object * sizeof(double));
  if (mi00 == NULL) {
    printf("Cannot allocate %d bytes for memory.\n",
           (n_object * sizeof(double)));
    exit(-1);
  }
  memset(mi00, 0, (n_object * sizeof(double)));
  double *mi11 = NULL;
  mi11 = (double *)malloc(n_object * sizeof(double));
  if (mi11 == NULL) {
    printf("Cannot allocate %d bytes for memory.\n",
           (n_object * sizeof(double)));
    exit(-1);
  }
  memset(mi11, 0, (n_object * sizeof(double)));
  double *mi20 = NULL;
  mi20 = (double *)malloc(n_object * sizeof(double));
  if (mi20 == NULL) {
    printf("Cannot allocate %d bytes for memory.\n",
           (n_object * sizeof(double)));
    exit(-1);
  }
  memset(mi20, 0, (n_object * sizeof(double)));
  double *mi02 = NULL;
  mi02 = (double *)malloc(n_object * sizeof(double));
  if (mi02 == NULL) {
    printf("Cannot allocate %d bytes for memory.\n",
           (n_object * sizeof(double)));
    exit(-1);
  }
  memset(mi02, 0, (n_object * sizeof(double)));
  morphological_feature_central_moments(0.0, 0.0, obj_id, width, height,
                                        n_object, image, mi00);
  morphological_feature_central_moments(1.0, 1.0, obj_id, width, height,
                                        n_object, image, mi11);
  morphological_feature_central_moments(2.0, 0.0, obj_id, width, height,
                                        n_object, image, mi20);
  morphological_feature_central_moments(0.0, 2.0, obj_id, width, height,
                                        n_object, image, mi02);
  for (i = 0; i < n_object; i++) {
    object_orientation[i] =
        0.5 * atan((2.0 * (mi11[i] / mi00[i])) /
                   ((mi20[i] / mi00[i]) - (mi02[i] / mi00[i])));
  }
  free(mi00);
  free(mi11);
  free(mi20);
  free(mi02);
  return 1;
}


x86 assembly (clang, -O0):
<morphological_feature_object_orientation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    11da <morphological_feature_object_orientation+0x6a>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
lea    0xe4d(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x38(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movq   $0x0,-0x40(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1235 <morphological_feature_object_orientation+0xc5>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
lea    0xdf2(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x40(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movq   $0x0,-0x48(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1290 <morphological_feature_object_orientation+0x120>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
lea    0xd97(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x48(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
movq   $0x0,-0x50(%rbp)
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    12eb <morphological_feature_object_orientation+0x17b>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
lea    0xd3c(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>
mov    -0x50(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x38(%rbp),%r9
xorps  %xmm1,%xmm1
movaps %xmm1,%xmm0
call   1060 <morphological_feature_central_moments@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x40(%rbp),%r9
movsd  0xccb(%rip),%xmm1
movaps %xmm1,%xmm0
call   1060 <morphological_feature_central_moments@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x48(%rbp),%r9
movsd  0xc9e(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1060 <morphological_feature_central_moments@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x50(%rbp),%r9
xorps  %xmm0,%xmm0
movsd  0xc76(%rip),%xmm1
call   1060 <morphological_feature_central_moments@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    142c <morphological_feature_object_orientation+0x2bc>
mov    -0x40(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
divsd  (%rax,%rcx,8),%xmm1
movsd  0xc3e(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
divsd  (%rax,%rcx,8),%xmm1
mov    -0x50(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
divsd  (%rax,%rcx,8),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1070 <atan@plt>
movaps %xmm0,%xmm1
movsd  0xc02(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1396 <morphological_feature_object_orientation+0x226>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<morphological_feature_object_orientation>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9,0x38(%rsp)
mov    %r8,%r13
mov    %edx,%r14d
mov    %esi,0x14(%rsp)
mov    %rdi,%r12
mov    %rcx,0x40(%rsp)
lea    0x0(,%rcx,8),%ebx
mov    %ebx,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1379 <morphological_feature_object_orientation+0x209>
mov    %rax,%r15
mov    %r14d,0x10(%rsp)
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1050 <memset@plt>
mov    %ebx,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1379 <morphological_feature_object_orientation+0x209>
mov    %rax,%rbp
mov    %r13,0x30(%rsp)
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1050 <memset@plt>
mov    %ebx,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1379 <morphological_feature_object_orientation+0x209>
mov    %rbp,%r13
mov    %r15,0x18(%rsp)
mov    %rax,0x28(%rsp)
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1050 <memset@plt>
mov    %ebx,%edi
call   1080 <malloc@plt>
test   %rax,%rax
je     1379 <morphological_feature_object_orientation+0x209>
mov    %rax,%rdi
mov    %rax,0x8(%rsp)
xor    %esi,%esi
mov    %ebx,%edx
call   1050 <memset@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    %r12,%rdi
mov    0x14(%rsp),%r14d
mov    %r14d,%esi
mov    0x10(%rsp),%r15d
mov    %r15d,%edx
mov    0x40(%rsp),%rbx
mov    %ebx,%ecx
mov    0x30(%rsp),%rbp
mov    %rbp,%r8
mov    0x18(%rsp),%r9
call   1060 <morphological_feature_central_moments@plt>
movsd  0xd98(%rip),%xmm0
movaps %xmm0,%xmm1
mov    %r12,%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %rbp,%r8
mov    %r13,%r9
mov    %r13,0x20(%rsp)
call   1060 <morphological_feature_central_moments@plt>
movsd  0xd7a(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    %r12,%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %rbp,%r8
mov    0x28(%rsp),%r13
mov    %r13,%r9
call   1060 <morphological_feature_central_moments@plt>
xorpd  %xmm0,%xmm0
movsd  0xd50(%rip),%xmm1
mov    %r12,%rdi
mov    %r14d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
mov    %rbp,%r8
mov    0x8(%rsp),%r9
call   1060 <morphological_feature_central_moments@plt>
test   %ebx,%ebx
mov    0x18(%rsp),%r15
mov    %r13,%rbp
mov    0x20(%rsp),%r13
mov    0x38(%rsp),%r12
je     1343 <morphological_feature_object_orientation+0x1d3>
mov    %ebx,%ebx
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
movsd  0x0(%r13,%r14,8),%xmm0
movsd  (%r15,%r14,8),%xmm1
divsd  %xmm1,%xmm0
addsd  %xmm0,%xmm0
movsd  0x0(%rbp,%r14,8),%xmm2
divsd  %xmm1,%xmm2
mov    0x8(%rsp),%rax
movsd  (%rax,%r14,8),%xmm3
divsd  %xmm1,%xmm3
subsd  %xmm3,%xmm2
divsd  %xmm2,%xmm0
call   1070 <atan@plt>
mulsd  0xcdc(%rip),%xmm0
movsd  %xmm0,(%r12,%r14,8)
add    $0x1,%r14
cmp    %r14,%rbx
jne    12f0 <morphological_feature_object_orientation+0x180>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc98(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"Cannot allocate %d bytes for memory.\0A\00"
define i32 @morphological_feature_object_orientation(i32** %0, i32 %1, i32 %2, i32 %3, i8* %4, double* %5) {
%7 = alloca i32**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
store i32** %0, i32*** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store double* %5, double** %12
store i32 0, i32* %13
store double* null, double** %14
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 8
%21 = trunc i64 %20 to i32
%22 = call i64 @malloc(i32 %21)
%23 = inttoptr i64 %22 to double*
store double* %23, double** %14
%24 = load double*, double** %14
%25 = icmp eq double* %24, null
br i1 %25, label %26, label %33
26: ; preds = %6
%27 = load i32, i32* %10
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 8
%30 = trunc i64 %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = call i32 @exit(i32 -1)
unreachable
33: ; preds = %6
%34 = load double*, double** %14
%35 = load i32, i32* %10
%36 = sext i32 %35 to i64
%37 = mul i64 %36, 8
%38 = trunc i64 %37 to i32
%39 = call i32 @memset(double* %34, i32 0, i32 %38)
store double* null, double** %15
%40 = load i32, i32* %10
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 8
%43 = trunc i64 %42 to i32
%44 = call i64 @malloc(i32 %43)
%45 = inttoptr i64 %44 to double*
store double* %45, double** %15
%46 = load double*, double** %15
%47 = icmp eq double* %46, null
br i1 %47, label %48, label %55
48: ; preds = %33
%49 = load i32, i32* %10
%50 = sext i32 %49 to i64
%51 = mul i64 %50, 8
%52 = trunc i64 %51 to i32
%53 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = call i32 @exit(i32 -1)
unreachable
55: ; preds = %33
%56 = load double*, double** %15
%57 = load i32, i32* %10
%58 = sext i32 %57 to i64
%59 = mul i64 %58, 8
%60 = trunc i64 %59 to i32
%61 = call i32 @memset(double* %56, i32 0, i32 %60)
store double* null, double** %16
%62 = load i32, i32* %10
%63 = sext i32 %62 to i64
%64 = mul i64 %63, 8
%65 = trunc i64 %64 to i32
%66 = call i64 @malloc(i32 %65)
%67 = inttoptr i64 %66 to double*
store double* %67, double** %16
%68 = load double*, double** %16
%69 = icmp eq double* %68, null
br i1 %69, label %70, label %77
70: ; preds = %55
%71 = load i32, i32* %10
%72 = sext i32 %71 to i64
%73 = mul i64 %72, 8
%74 = trunc i64 %73 to i32
%75 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %74)
%76 = call i32 @exit(i32 -1)
unreachable
77: ; preds = %55
%78 = load double*, double** %16
%79 = load i32, i32* %10
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 8
%82 = trunc i64 %81 to i32
%83 = call i32 @memset(double* %78, i32 0, i32 %82)
store double* null, double** %17
%84 = load i32, i32* %10
%85 = sext i32 %84 to i64
%86 = mul i64 %85, 8
%87 = trunc i64 %86 to i32
%88 = call i64 @malloc(i32 %87)
%89 = inttoptr i64 %88 to double*
store double* %89, double** %17
%90 = load double*, double** %17
%91 = icmp eq double* %90, null
br i1 %91, label %92, label %99
92: ; preds = %77
%93 = load i32, i32* %10
%94 = sext i32 %93 to i64
%95 = mul i64 %94, 8
%96 = trunc i64 %95 to i32
%97 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %96)
%98 = call i32 @exit(i32 -1)
unreachable
99: ; preds = %77
%100 = load double*, double** %17
%101 = load i32, i32* %10
%102 = sext i32 %101 to i64
%103 = mul i64 %102, 8
%104 = trunc i64 %103 to i32
%105 = call i32 @memset(double* %100, i32 0, i32 %104)
%106 = load i32**, i32*** %7
%107 = load i32, i32* %8
%108 = load i32, i32* %9
%109 = load i32, i32* %10
%110 = load i8*, i8** %11
%111 = load double*, double** %14
%112 = call i32 @morphological_feature_central_moments(double 0.000000e+00, double 0.000000e+00, i32** %106, i32 %107, i32 %108, i32 %109, i8* %110, double* %111)
%113 = load i32**, i32*** %7
%114 = load i32, i32* %8
%115 = load i32, i32* %9
%116 = load i32, i32* %10
%117 = load i8*, i8** %11
%118 = load double*, double** %15
%119 = call i32 @morphological_feature_central_moments(double 1.000000e+00, double 1.000000e+00, i32** %113, i32 %114, i32 %115, i32 %116, i8* %117, double* %118)
%120 = load i32**, i32*** %7
%121 = load i32, i32* %8
%122 = load i32, i32* %9
%123 = load i32, i32* %10
%124 = load i8*, i8** %11
%125 = load double*, double** %16
%126 = call i32 @morphological_feature_central_moments(double 2.000000e+00, double 0.000000e+00, i32** %120, i32 %121, i32 %122, i32 %123, i8* %124, double* %125)
%127 = load i32**, i32*** %7
%128 = load i32, i32* %8
%129 = load i32, i32* %9
%130 = load i32, i32* %10
%131 = load i8*, i8** %11
%132 = load double*, double** %17
%133 = call i32 @morphological_feature_central_moments(double 0.000000e+00, double 2.000000e+00, i32** %127, i32 %128, i32 %129, i32 %130, i8* %131, double* %132)
store i32 0, i32* %13
br label %134
134: ; preds = %181, %99
%135 = load i32, i32* %13
%136 = load i32, i32* %10
%137 = icmp ult i32 %135, %136
br i1 %137, label %138, label %184
138: ; preds = %134
%139 = load double*, double** %15
%140 = load i32, i32* %13
%141 = zext i32 %140 to i64
%142 = getelementptr inbounds double, double* %139, i64 %141
%143 = load double, double* %142
%144 = load double*, double** %14
%145 = load i32, i32* %13
%146 = zext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = fdiv double %143, %148
%150 = fmul double 2.000000e+00, %149
%151 = load double*, double** %16
%152 = load i32, i32* %13
%153 = zext i32 %152 to i64
%154 = getelementptr inbounds double, double* %151, i64 %153
%155 = load double, double* %154
%156 = load double*, double** %14
%157 = load i32, i32* %13
%158 = zext i32 %157 to i64
%159 = getelementptr inbounds double, double* %156, i64 %158
%160 = load double, double* %159
%161 = fdiv double %155, %160
%162 = load double*, double** %17
%163 = load i32, i32* %13
%164 = zext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = load double*, double** %14
%168 = load i32, i32* %13
%169 = zext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
%171 = load double, double* %170
%172 = fdiv double %166, %171
%173 = fsub double %161, %172
%174 = fdiv double %150, %173
%175 = call double @atan(double %174)
%176 = fmul double 5.000000e-01, %175
%177 = load double*, double** %12
%178 = load i32, i32* %13
%179 = zext i32 %178 to i64
%180 = getelementptr inbounds double, double* %177, i64 %179
store double %176, double* %180
br label %181
181: ; preds = %138
%182 = load i32, i32* %13
%183 = add i32 %182, 1
store i32 %183, i32* %13
br label %134
184: ; preds = %134
%185 = load double*, double** %14
%186 = call i32 @free(double* %185)
%187 = load double*, double** %15
%188 = call i32 @free(double* %187)
%189 = load double*, double** %16
%190 = call i32 @free(double* %189)
%191 = load double*, double** %17
%192 = call i32 @free(double* %191)
ret i32 1
}

LLVM IR (-O2):
@.str = [38 x i8] c"Cannot allocate %d bytes for memory.\0A\00"
define i32 @morphological_feature_object_orientation(i32** %0, i32 %1, i32 %2, i32 %3, i8* %4, double* nocapture writeonly %5) {
%7 = shl i32 %3, 3
%8 = tail call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to double*
%10 = icmp eq i64 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7)
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %6
%15 = tail call i32 @memset(double* %9, i32 0, i32 %7)
%16 = tail call i64 @malloc(i32 %7)
%17 = inttoptr i64 %16 to double*
%18 = icmp eq i64 %16, 0
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7)
%21 = tail call i32 @exit(i32 -1)
unreachable
22: ; preds = %14
%23 = tail call i32 @memset(double* %17, i32 0, i32 %7)
%24 = tail call i64 @malloc(i32 %7)
%25 = inttoptr i64 %24 to double*
%26 = icmp eq i64 %24, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7)
%29 = tail call i32 @exit(i32 -1)
unreachable
30: ; preds = %22
%31 = tail call i32 @memset(double* %25, i32 0, i32 %7)
%32 = tail call i64 @malloc(i32 %7)
%33 = inttoptr i64 %32 to double*
%34 = icmp eq i64 %32, 0
br i1 %34, label %35, label %38
35: ; preds = %30
%36 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i32 %7)
%37 = tail call i32 @exit(i32 -1)
unreachable
38: ; preds = %30
%39 = tail call i32 @memset(double* %33, i32 0, i32 %7)
%40 = tail call i32 @morphological_feature_central_moments(double 0.000000e+00, double 0.000000e+00, i32** %0, i32 %1, i32 %2, i32 %3, i8* %4, double* %9)
%41 = tail call i32 @morphological_feature_central_moments(double 1.000000e+00, double 1.000000e+00, i32** %0, i32 %1, i32 %2, i32 %3, i8* %4, double* %17)
%42 = tail call i32 @morphological_feature_central_moments(double 2.000000e+00, double 0.000000e+00, i32** %0, i32 %1, i32 %2, i32 %3, i8* %4, double* %25)
%43 = tail call i32 @morphological_feature_central_moments(double 0.000000e+00, double 2.000000e+00, i32** %0, i32 %1, i32 %2, i32 %3, i8* %4, double* %33)
%44 = icmp eq i32 %3, 0
br i1 %44, label %68, label %45
45: ; preds = %38
%46 = zext i32 %3 to i64
br label %47
47: ; preds = %45, %47
%48 = phi i64 [ 0, %45 ], [ %66, %47 ]
%49 = getelementptr inbounds double, double* %17, i64 %48
%50 = load double, double* %49
%51 = getelementptr inbounds double, double* %9, i64 %48
%52 = load double, double* %51
%53 = fdiv double %50, %52
%54 = fmul double %53, 2.000000e+00
%55 = getelementptr inbounds double, double* %25, i64 %48
%56 = load double, double* %55
%57 = fdiv double %56, %52
%58 = getelementptr inbounds double, double* %33, i64 %48
%59 = load double, double* %58
%60 = fdiv double %59, %52
%61 = fsub double %57, %60
%62 = fdiv double %54, %61
%63 = tail call double @atan(double %62)
%64 = fmul double %63, 5.000000e-01
%65 = getelementptr inbounds double, double* %5, i64 %48
store double %64, double* %65
%66 = add nuw nsw i64 %48, 1
%67 = icmp eq i64 %66, %46
br i1 %67, label %68, label %47
68: ; preds = %47, %38
%69 = tail call i32 @free(double* %9)
%70 = tail call i32 @free(double* %17)
%71 = tail call i32 @free(double* %25)
%72 = tail call i32 @free(double* %33)
ret i32 1
}