#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 atoi(char *);
int /*<<< orphan*/ free(double **);
int /*<<< orphan*/ groupRecognize(double **, double **, double **, int, int,
                                  int);
scalar_t__ imagesFromFile(char *, double **, int, int);
int /*<<< orphan*/ learn(double **, double **, double **, int, int, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ out(double **, int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int i, rec_images_num, data_dim, num_images, num_exmpls;
  num_images = atoi(argv[6]);
  data_dim = atoi(argv[5]);
  num_exmpls = atoi(argv[4]);
  rec_images_num = num_exmpls;
  double **result = (double **)malloc(num_images * sizeof(double));
  for (i = 0; i < num_images; i++) {
    result[i] = (double *)malloc(rec_images_num * sizeof(double));
  }
  double **exmpls = (double **)malloc(num_exmpls * sizeof(double));
  for (i = 0; i < num_exmpls; i++) {
    exmpls[i] = (double *)malloc(data_dim * sizeof(double));
  }
  double **exmpl_vals = (double **)malloc(num_exmpls * sizeof(double));
  for (i = 0; i < num_exmpls; i++) {
    exmpl_vals[i] = (double *)malloc(num_exmpls * sizeof(double));
  }
  double **images = (double **)malloc(num_images * sizeof(double));
  for (i = 0; i < num_images; i++) {
    images[i] = (double *)malloc(data_dim * sizeof(double));
  }
  double **neurons = (double **)malloc(rec_images_num * sizeof(double));
  for (i = 0; i < rec_images_num; i++) {
    neurons[i] = (double *)malloc(data_dim * sizeof(double));
  }
  if (imagesFromFile(argv[1], exmpls, num_exmpls, data_dim)) {
    printf("File can not be openned.\n");
  }
  if (imagesFromFile(argv[2], exmpl_vals, num_exmpls, num_exmpls)) {
    printf("File can not be openned.\n");
  }
  if (imagesFromFile(argv[3], images, num_images, data_dim)) {
    printf("File can not be openned.\n");
  }
  learn(neurons, exmpls, exmpl_vals, num_exmpls, rec_images_num, data_dim);
  groupRecognize(neurons, images, result, num_images, rec_images_num, data_dim);
  out(result, num_images, rec_images_num);
  free(images);
  free(neurons);
  free(exmpls);
  free(result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x18(%rbp)
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    121e <main+0x9e>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e6 <main+0x66>
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1270 <main+0xf0>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x38(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1238 <main+0xb8>
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12c2 <main+0x142>
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x40(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128a <main+0x10a>
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1314 <main+0x194>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x48(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12dc <main+0x15c>
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1366 <main+0x1e6>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,%rdx
mov    -0x50(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    132e <main+0x1ae>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1050 <imagesFromFile@plt>
cmp    $0x0,%rax
je     1393 <main+0x213>
lea    0xc72(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1050 <imagesFromFile@plt>
cmp    $0x0,%rax
je     13c0 <main+0x240>
lea    0xc45(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1050 <imagesFromFile@plt>
cmp    $0x0,%rax
je     13ed <main+0x26d>
lea    0xc18(%rip),%rdi
call   1070 <printf@plt>
mov    -0x50(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1040 <learn@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1060 <groupRecognize@plt>
mov    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edx
call   10a0 <out@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    0x30(%rsi),%rdi
call   1090 <atoi@plt>
mov    %eax,%ebp
mov    0x28(%rbx),%rdi
call   1090 <atoi@plt>
mov    %rax,0x18(%rsp)
mov    %rbx,0x38(%rsp)
mov    0x20(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r14d
lea    0x0(,%rbp,8),%r13d
mov    %r13d,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    %r14,0x28(%rsp)
lea    0x0(,%r14,8),%r14d
mov    %ebp,%r15d
mov    %rbp,0x10(%rsp)
test   %ebp,%ebp
jle    1205 <main+0x85>
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    11f0 <main+0x70>
mov    %rbx,0x40(%rsp)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%rcx
mov    0x28(%rsp),%rax
mov    %eax,%r12d
test   %eax,%eax
mov    %rcx,0x30(%rsp)
jle    1298 <main+0x118>
mov    %r13d,0xc(%rsp)
mov    0x18(%rsp),%rax
lea    0x0(,%rax,8),%ebp
xor    %ebx,%ebx
mov    %rcx,%r13
nopl   0x0(%rax)
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,0x0(%r13,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1240 <main+0xc0>
mov    %r14d,%edi
call   1080 <malloc@plt>
cmpl   $0x0,0x28(%rsp)
mov    %rax,0x20(%rsp)
jle    12ac <main+0x12c>
mov    %rax,%rbp
xor    %ebx,%ebx
mov    0xc(%rsp),%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,0x0(%rbp,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1280 <main+0x100>
jmp    12a5 <main+0x125>
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    0x10(%rsp),%rbx
jmp    12b6 <main+0x136>
mov    0x10(%rsp),%rbx
mov    0xc(%rsp),%r13d
mov    %r13d,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
test   %ebx,%ebx
jle    12f5 <main+0x175>
mov    0x18(%rsp),%rax
lea    0x0(,%rax,8),%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x0(%r13,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r15
jne    12e0 <main+0x160>
mov    %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
mov    0x28(%rsp),%r15
test   %r15d,%r15d
jle    1334 <main+0x1b4>
mov    0x18(%rsp),%rax
mov    %eax,%ebp
shl    $0x3,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1320 <main+0x1a0>
mov    0x38(%rsp),%rax
mov    0x8(%rax),%rdi
mov    0x30(%rsp),%rsi
mov    %r15d,%edx
mov    0x18(%rsp),%rbp
mov    %ebp,%ecx
call   1060 <imagesFromFile@plt>
test   %rax,%rax
je     1362 <main+0x1e2>
lea    0xca3(%rip),%rdi
call   1050 <puts@plt>
mov    0x38(%rsp),%rax
mov    0x10(%rax),%rdi
mov    0x20(%rsp),%rsi
mov    %r15d,%edx
mov    %r15d,%ecx
call   1060 <imagesFromFile@plt>
test   %rax,%rax
mov    0x10(%rsp),%rbx
mov    0x40(%rsp),%r12
je     1396 <main+0x216>
lea    0xc6f(%rip),%rdi
call   1050 <puts@plt>
mov    0x38(%rsp),%rax
mov    0x18(%rax),%rdi
mov    %r13,%rsi
mov    %ebx,%edx
mov    %ebp,%ecx
call   1060 <imagesFromFile@plt>
test   %rax,%rax
je     13bc <main+0x23c>
lea    0xc49(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
mov    0x30(%rsp),%rsi
mov    0x20(%rsp),%rdx
mov    %r15d,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
call   1040 <learn@plt>
mov    %r14,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %ebx,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
call   1070 <groupRecognize@plt>
mov    %r12,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   10a0 <out@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"File can not be openned.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double**
%12 = alloca double**
%13 = alloca double**
%14 = alloca double**
%15 = alloca double**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 6
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %9
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 5
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
store i32 %23, i32* %8
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 4
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
store i32 %27, i32* %10
%28 = load i32, i32* %10
store i32 %28, i32* %7
%29 = load i32, i32* %9
%30 = sext i32 %29 to i64
%31 = mul i64 %30, 8
%32 = trunc i64 %31 to i32
%33 = call i64 @malloc(i32 %32)
%34 = inttoptr i64 %33 to double**
store double** %34, double*** %11
store i32 0, i32* %6
br label %35
35: ; preds = %50, %2
%36 = load i32, i32* %6
%37 = load i32, i32* %9
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %53
39: ; preds = %35
%40 = load i32, i32* %7
%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*
%46 = load double**, double*** %11
%47 = load i32, i32* %6
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double*, double** %46, i64 %48
store double* %45, double** %49
br label %50
50: ; preds = %39
%51 = load i32, i32* %6
%52 = add nsw i32 %51, 1
store i32 %52, i32* %6
br label %35
53: ; preds = %35
%54 = load i32, i32* %10
%55 = sext i32 %54 to i64
%56 = mul i64 %55, 8
%57 = trunc i64 %56 to i32
%58 = call i64 @malloc(i32 %57)
%59 = inttoptr i64 %58 to double**
store double** %59, double*** %12
store i32 0, i32* %6
br label %60
60: ; preds = %75, %53
%61 = load i32, i32* %6
%62 = load i32, i32* %10
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %78
64: ; preds = %60
%65 = load i32, i32* %8
%66 = sext i32 %65 to i64
%67 = mul i64 %66, 8
%68 = trunc i64 %67 to i32
%69 = call i64 @malloc(i32 %68)
%70 = inttoptr i64 %69 to double*
%71 = load double**, double*** %12
%72 = load i32, i32* %6
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double*, double** %71, i64 %73
store double* %70, double** %74
br label %75
75: ; preds = %64
%76 = load i32, i32* %6
%77 = add nsw i32 %76, 1
store i32 %77, i32* %6
br label %60
78: ; preds = %60
%79 = load i32, i32* %10
%80 = sext i32 %79 to i64
%81 = mul i64 %80, 8
%82 = trunc i64 %81 to i32
%83 = call i64 @malloc(i32 %82)
%84 = inttoptr i64 %83 to double**
store double** %84, double*** %13
store i32 0, i32* %6
br label %85
85: ; preds = %100, %78
%86 = load i32, i32* %6
%87 = load i32, i32* %10
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %103
89: ; preds = %85
%90 = load i32, i32* %10
%91 = sext i32 %90 to i64
%92 = mul i64 %91, 8
%93 = trunc i64 %92 to i32
%94 = call i64 @malloc(i32 %93)
%95 = inttoptr i64 %94 to double*
%96 = load double**, double*** %13
%97 = load i32, i32* %6
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double*, double** %96, i64 %98
store double* %95, double** %99
br label %100
100: ; preds = %89
%101 = load i32, i32* %6
%102 = add nsw i32 %101, 1
store i32 %102, i32* %6
br label %85
103: ; preds = %85
%104 = load i32, i32* %9
%105 = sext i32 %104 to i64
%106 = mul i64 %105, 8
%107 = trunc i64 %106 to i32
%108 = call i64 @malloc(i32 %107)
%109 = inttoptr i64 %108 to double**
store double** %109, double*** %14
store i32 0, i32* %6
br label %110
110: ; preds = %125, %103
%111 = load i32, i32* %6
%112 = load i32, i32* %9
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %128
114: ; preds = %110
%115 = load i32, i32* %8
%116 = sext i32 %115 to i64
%117 = mul i64 %116, 8
%118 = trunc i64 %117 to i32
%119 = call i64 @malloc(i32 %118)
%120 = inttoptr i64 %119 to double*
%121 = load double**, double*** %14
%122 = load i32, i32* %6
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds double*, double** %121, i64 %123
store double* %120, double** %124
br label %125
125: ; preds = %114
%126 = load i32, i32* %6
%127 = add nsw i32 %126, 1
store i32 %127, i32* %6
br label %110
128: ; preds = %110
%129 = load i32, i32* %7
%130 = sext i32 %129 to i64
%131 = mul i64 %130, 8
%132 = trunc i64 %131 to i32
%133 = call i64 @malloc(i32 %132)
%134 = inttoptr i64 %133 to double**
store double** %134, double*** %15
store i32 0, i32* %6
br label %135
135: ; preds = %150, %128
%136 = load i32, i32* %6
%137 = load i32, i32* %7
%138 = icmp slt i32 %136, %137
br i1 %138, label %139, label %153
139: ; preds = %135
%140 = load i32, i32* %8
%141 = sext i32 %140 to i64
%142 = mul i64 %141, 8
%143 = trunc i64 %142 to i32
%144 = call i64 @malloc(i32 %143)
%145 = inttoptr i64 %144 to double*
%146 = load double**, double*** %15
%147 = load i32, i32* %6
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double*, double** %146, i64 %148
store double* %145, double** %149
br label %150
150: ; preds = %139
%151 = load i32, i32* %6
%152 = add nsw i32 %151, 1
store i32 %152, i32* %6
br label %135
153: ; preds = %135
%154 = load i8**, i8*** %5
%155 = getelementptr inbounds i8*, i8** %154, i64 1
%156 = load i8*, i8** %155
%157 = load double**, double*** %12
%158 = load i32, i32* %10
%159 = load i32, i32* %8
%160 = call i64 @imagesFromFile(i8* %156, double** %157, i32 %158, i32 %159)
%161 = icmp ne i64 %160, 0
br i1 %161, label %162, label %164
162: ; preds = %153
%163 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %164
164: ; preds = %162, %153
%165 = load i8**, i8*** %5
%166 = getelementptr inbounds i8*, i8** %165, i64 2
%167 = load i8*, i8** %166
%168 = load double**, double*** %13
%169 = load i32, i32* %10
%170 = load i32, i32* %10
%171 = call i64 @imagesFromFile(i8* %167, double** %168, i32 %169, i32 %170)
%172 = icmp ne i64 %171, 0
br i1 %172, label %173, label %175
173: ; preds = %164
%174 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %175
175: ; preds = %173, %164
%176 = load i8**, i8*** %5
%177 = getelementptr inbounds i8*, i8** %176, i64 3
%178 = load i8*, i8** %177
%179 = load double**, double*** %14
%180 = load i32, i32* %9
%181 = load i32, i32* %8
%182 = call i64 @imagesFromFile(i8* %178, double** %179, i32 %180, i32 %181)
%183 = icmp ne i64 %182, 0
br i1 %183, label %184, label %186
184: ; preds = %175
%185 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %186
186: ; preds = %184, %175
%187 = load double**, double*** %15
%188 = load double**, double*** %12
%189 = load double**, double*** %13
%190 = load i32, i32* %10
%191 = load i32, i32* %7
%192 = load i32, i32* %8
%193 = call i32 @learn(double** %187, double** %188, double** %189, i32 %190, i32 %191, i32 %192)
%194 = load double**, double*** %15
%195 = load double**, double*** %14
%196 = load double**, double*** %11
%197 = load i32, i32* %9
%198 = load i32, i32* %7
%199 = load i32, i32* %8
%200 = call i32 @groupRecognize(double** %194, double** %195, double** %196, i32 %197, i32 %198, i32 %199)
%201 = load double**, double*** %11
%202 = load i32, i32* %9
%203 = load i32, i32* %7
%204 = call i32 @out(double** %201, i32 %202, i32 %203)
%205 = load double**, double*** %14
%206 = call i32 @free(double** %205)
%207 = load double**, double*** %15
%208 = call i32 @free(double** %207)
%209 = load double**, double*** %12
%210 = call i32 @free(double** %209)
%211 = load double**, double*** %11
%212 = call i32 @free(double** %211)
ret i32 0
}

LLVM IR (-O2):
@str.2 = [25 x i8] c"File can not be openned.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 6
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 5
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 4
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = shl i32 %5, 3
%13 = tail call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to double**
%15 = icmp sgt i32 %5, 0
%16 = shl i32 %11, 3
br i1 %15, label %17, label %26
17: ; preds = %2
%18 = zext i32 %5 to i64
br label %19
19: ; preds = %17, %19
%20 = phi i64 [ 0, %17 ], [ %24, %19 ]
%21 = tail call i64 @malloc(i32 %16)
%22 = inttoptr i64 %21 to double*
%23 = getelementptr inbounds double*, double** %14, i64 %20
store double* %22, double** %23
%24 = add nuw nsw i64 %20, 1
%25 = icmp eq i64 %24, %18
br i1 %25, label %26, label %19
26: ; preds = %19, %2
%27 = tail call i64 @malloc(i32 %16)
%28 = inttoptr i64 %27 to double**
%29 = icmp sgt i32 %11, 0
br i1 %29, label %33, label %30
30: ; preds = %26
%31 = tail call i64 @malloc(i32 %16)
%32 = inttoptr i64 %31 to double**
br label %55
33: ; preds = %26
%34 = shl i32 %8, 3
%35 = zext i32 %11 to i64
br label %36
36: ; preds = %33, %36
%37 = phi i64 [ 0, %33 ], [ %41, %36 ]
%38 = tail call i64 @malloc(i32 %34)
%39 = inttoptr i64 %38 to double*
%40 = getelementptr inbounds double*, double** %28, i64 %37
store double* %39, double** %40
%41 = add nuw nsw i64 %37, 1
%42 = icmp eq i64 %41, %35
br i1 %42, label %43, label %36
43: ; preds = %36
%44 = tail call i64 @malloc(i32 %16)
%45 = inttoptr i64 %44 to double**
br i1 %29, label %46, label %55
46: ; preds = %43
%47 = zext i32 %11 to i64
br label %48
48: ; preds = %46, %48
%49 = phi i64 [ 0, %46 ], [ %53, %48 ]
%50 = tail call i64 @malloc(i32 %16)
%51 = inttoptr i64 %50 to double*
%52 = getelementptr inbounds double*, double** %45, i64 %49
store double* %51, double** %52
%53 = add nuw nsw i64 %49, 1
%54 = icmp eq i64 %53, %47
br i1 %54, label %55, label %48
55: ; preds = %48, %30, %43
%56 = phi double** [ %32, %30 ], [ %45, %43 ], [ %45, %48 ]
%57 = tail call i64 @malloc(i32 %12)
%58 = inttoptr i64 %57 to double**
br i1 %15, label %59, label %69
59: ; preds = %55
%60 = shl i32 %8, 3
%61 = zext i32 %5 to i64
br label %62
62: ; preds = %59, %62
%63 = phi i64 [ 0, %59 ], [ %67, %62 ]
%64 = tail call i64 @malloc(i32 %60)
%65 = inttoptr i64 %64 to double*
%66 = getelementptr inbounds double*, double** %58, i64 %63
store double* %65, double** %66
%67 = add nuw nsw i64 %63, 1
%68 = icmp eq i64 %67, %61
br i1 %68, label %69, label %62
69: ; preds = %62, %55
%70 = tail call i64 @malloc(i32 %16)
%71 = inttoptr i64 %70 to double**
br i1 %29, label %72, label %82
72: ; preds = %69
%73 = shl i32 %8, 3
%74 = zext i32 %11 to i64
br label %75
75: ; preds = %72, %75
%76 = phi i64 [ 0, %72 ], [ %80, %75 ]
%77 = tail call i64 @malloc(i32 %73)
%78 = inttoptr i64 %77 to double*
%79 = getelementptr inbounds double*, double** %71, i64 %76
store double* %78, double** %79
%80 = add nuw nsw i64 %76, 1
%81 = icmp eq i64 %80, %74
br i1 %81, label %82, label %75
82: ; preds = %75, %69
%83 = getelementptr inbounds i8*, i8** %1, i64 1
%84 = load i8*, i8** %83
%85 = tail call i64 @imagesFromFile(i8* %84, double** %28, i32 %11, i32 %8)
%86 = icmp eq i64 %85, 0
br i1 %86, label %89, label %87
87: ; preds = %82
%88 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
br label %89
89: ; preds = %87, %82
%90 = getelementptr inbounds i8*, i8** %1, i64 2
%91 = load i8*, i8** %90
%92 = tail call i64 @imagesFromFile(i8* %91, double** %56, i32 %11, i32 %11)
%93 = icmp eq i64 %92, 0
br i1 %93, label %96, label %94
94: ; preds = %89
%95 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
br label %96
96: ; preds = %94, %89
%97 = getelementptr inbounds i8*, i8** %1, i64 3
%98 = load i8*, i8** %97
%99 = tail call i64 @imagesFromFile(i8* %98, double** %58, i32 %5, i32 %8)
%100 = icmp eq i64 %99, 0
br i1 %100, label %103, label %101
101: ; preds = %96
%102 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.2, i64 0, i64 0))
br label %103
103: ; preds = %101, %96
%104 = tail call i32 @learn(double** %71, double** %28, double** %56, i32 %11, i32 %11, i32 %8)
%105 = tail call i32 @groupRecognize(double** %71, double** %58, double** %14, i32 %5, i32 %11, i32 %8)
%106 = tail call i32 @out(double** %14, i32 %5, i32 %11)
%107 = tail call i32 @free(double** %58)
%108 = tail call i32 @free(double** %71)
%109 = tail call i32 @free(double** %28)
%110 = tail call i32 @free(double** %14)
ret i32 0
}