// File: wrighteagle2d[P]wrighteaglebase/Debug/../src/Net.cpp
// Function: Net::TestOnFile(char const*)
real Net::TestOnFile(const char *fname) {
  if (mUnits == 0)
    return -1.0;
  FILE *fp;
  if ((fp = fopen(fname, "r")) == 0) {
    perror("BPN::TrainOnFile(char *fname)");
    exit(1);
  }
  int patterns;
  int input_size;
  int desire_size;
  real **input;
  real **desire;

  SCAN_PARAMS(patterns, input_size, desire_size)

  input = new real *[patterns];
  desire = new real *[patterns];
  for (int i = 0; i < patterns; ++i) {
    input[i] = new real[input_size];
    desire[i] = new real[desire_size];
  }

  SCAN_TRAIN(patterns, input_size, desire_size, input, desire)

  real error = 0.0;
  for (int p = 0; p < patterns; ++p) {
    SetDesire(desire[p]);
    Run(input[p], 0);
    error += Error();
  }

  for (int i = 0; i < patterns; ++i) {
    delete[] input[i];
    delete[] desire[i];
  }
  delete[] input;
  delete[] desire;

  return error;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x61204
movsd 0x6062e(%rip), %xmm0    # 0xc1828
movsd %xmm0, -0x8(%rbp)
jmp 0x614e3
movq -0x18(%rbp), %rdi
leaq 0x64411(%rip), %rsi     # 0xc5620
callq 0xa710
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x61234
leaq 0x6189e(%rip), %rdi     # 0xc2ac3
callq 0xa4c0
movl $0x1, %edi
callq 0xa740
movq -0x20(%rbp), %rdi
leaq 0x618a2(%rip), %rsi     # 0xc2ae1
leaq -0x24(%rbp), %rdx
leaq -0x28(%rbp), %rcx
leaq -0x2c(%rbp), %r8
movb $0x0, %al
callq 0xab10
cmpl $0x1, %eax
jge 0x61259
jmp 0x61259
movslq -0x24(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xa050
movq %rax, -0x38(%rbp)
movslq -0x24(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xa050
movq %rax, -0x40(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x6132d
movslq -0x28(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xa050
movq %rax, %rdx
movq -0x38(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movslq -0x2c(%rbp), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0xa050
movq %rax, %rdx
movq -0x40(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x612b2
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x613e8
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x28(%rbp), %eax
jge 0x6138c
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x4c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x63dab(%rip), %rsi     # 0xc511c
movb $0x0, %al
callq 0xab10
cmpl $0x1, %eax
jge 0x6137f
jmp 0x6137f
jmp 0x61381
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x61347
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x613d8
movq -0x20(%rbp), %rdi
movq -0x40(%rbp), %rax
movslq -0x48(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movslq -0x50(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdx
leaq 0x63d5f(%rip), %rsi     # 0xc511c
movb $0x0, %al
callq 0xab10
cmpl $0x1, %eax
jge 0x613cb
jmp 0x613cb
jmp 0x613cd
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x61393
jmp 0x613da
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x61334
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x6144b
movq -0x68(%rbp), %rdi
movq -0x40(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x616d0
movq -0x68(%rbp), %rdi
movq -0x38(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x60c40
movq -0x68(%rbp), %rdi
callq 0x60ce0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x613f7
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x614a5
movq -0x38(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, %rax
je 0x61479
movq -0x70(%rbp), %rdi
callq 0xa7b0
movq -0x40(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x78(%rbp)
cmpq $0x0, %rax
je 0x61498
movq -0x78(%rbp), %rdi
callq 0xa7b0
jmp 0x6149a
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x61452
movq -0x38(%rbp), %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, %rax
je 0x614bc
movq -0x80(%rbp), %rdi
callq 0xa7b0
movq -0x40(%rbp), %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, %rax
je 0x614d9
movq -0x88(%rbp), %rdi
callq 0xa7b0
movsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)