#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*/ initCoefs(double *, int);
int /*<<< orphan*/ learnNeuron(double *, double **, double *, int, int);
void learn(double **neurons, double **exmpls, double **exmpl_vals,
           int num_exmpls, int recogn_elems_num, int data_dim) {
  int i, j;
  for (i = 0; i < recogn_elems_num; i++) {
    initCoefs(neurons[i], data_dim);
    learnNeuron(neurons[i], exmpls, exmpl_vals[i], num_exmpls, data_dim);
  }
}


x86 assembly (clang, -O0):
<learn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    119c <learn+0x7c>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x24(%rbp),%esi
call   1040 <initCoefs@plt>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x24(%rbp),%r8d
call   1030 <learnNeuron@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1146 <learn+0x26>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<learn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,0x4(%rsp)
test   %r8d,%r8d
jle    117d <learn+0x5d>
mov    %r9d,%ebx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbp
mov    %r8d,%r13d
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
mov    0x0(%rbp,%r14,8),%rdi
mov    %ebx,%esi
call   1040 <initCoefs@plt>
mov    0x0(%rbp,%r14,8),%rdi
mov    (%r15,%r14,8),%rdx
mov    %r12,%rsi
mov    0x4(%rsp),%ecx
mov    %ebx,%r8d
call   1030 <learnNeuron@plt>
add    $0x1,%r14
cmp    %r14,%r13
jne    1150 <learn+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @learn(double** %0, double** %1, double** %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca double**
%8 = alloca double**
%9 = alloca double**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store double** %0, double*** %7
store double** %1, double*** %8
store double** %2, double*** %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 0, i32* %13
br label %15
15: ; preds = %41, %6
%16 = load i32, i32* %13
%17 = load i32, i32* %11
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %44
19: ; preds = %15
%20 = load double**, double*** %7
%21 = load i32, i32* %13
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double*, double** %20, i64 %22
%24 = load double*, double** %23
%25 = load i32, i32* %12
%26 = call i32 @initCoefs(double* %24, i32 %25)
%27 = load double**, double*** %7
%28 = load i32, i32* %13
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double*, double** %27, i64 %29
%31 = load double*, double** %30
%32 = load double**, double*** %8
%33 = load double**, double*** %9
%34 = load i32, i32* %13
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double*, double** %33, i64 %35
%37 = load double*, double** %36
%38 = load i32, i32* %10
%39 = load i32, i32* %12
%40 = call i32 @learnNeuron(double* %31, double** %32, double* %37, i32 %38, i32 %39)
br label %41
41: ; preds = %19
%42 = load i32, i32* %13
%43 = add nsw i32 %42, 1
store i32 %43, i32* %13
br label %15
44: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @learn(double** nocapture %0, double** %1, double** nocapture %2, i32 %3, i32 %4, i32 %5) {
%7 = icmp sgt i32 %4, 0
br i1 %7, label %8, label %21
8: ; preds = %6
%9 = zext i32 %4 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %19, %10 ]
%12 = getelementptr inbounds double*, double** %0, i64 %11
%13 = load double*, double** %12
%14 = tail call i32 @initCoefs(double* %13, i32 %5)
%15 = load double*, double** %12
%16 = getelementptr inbounds double*, double** %2, i64 %11
%17 = load double*, double** %16
%18 = tail call i32 @learnNeuron(double* %15, double** %1, double* %17, i32 %3, i32 %5)
%19 = add nuw nsw i64 %11, 1
%20 = icmp eq i64 %19, %9
br i1 %20, label %21, label %10
21: ; preds = %10, %6
ret void
}