// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
cmpq $0x0, 0x8(%rdi)
je 0x3772f
movq %rdi, %r13
leaq 0x3601e(%rip), %rax     # 0x6d560
movq %rsi, %rdi
movq %rax, %rsi
callq 0x95a0
testq %rax, %rax
je 0x37765
movq %rax, %r12
leaq 0x3361d(%rip), %rsi     # 0x6ab7d
leaq -0x34(%rbp), %rbx
leaq -0x30(%rbp), %rcx
leaq -0x2c(%rbp), %r8
movq %rax, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x9930
movslq (%rbx), %rbx
leaq (,%rbx,8), %r14
testq %rbx, %rbx
movq $-0x1, %rax
cmovsq %rax, %r14
movq %r14, %rdi
callq 0x9050
movq %rax, %r15
movq %r14, %rdi
callq 0x9050
movq %rax, %r14
xorpd %xmm0, %xmm0
movsd %xmm0, -0x48(%rbp)
testq %rbx, %rbx
jle 0x37741
movq %r13, -0x58(%rbp)
movslq -0x30(%rbp), %rax
leaq (,%rax,8), %rdx
testq %rax, %rax
movq $-0x1, %rsi
cmovsq %rsi, %rdx
movq %rdx, -0x40(%rbp)
movslq -0x2c(%rbp), %rax
movq %r15, -0x50(%rbp)
leaq (,%rax,8), %r15
testq %rax, %rax
cmovsq %rsi, %r15
movq %r14, %r13
xorl %r14d, %r14d
movq -0x40(%rbp), %rdi
callq 0x9050
movq -0x50(%rbp), %rcx
movq %rax, (%rcx,%r14,8)
movq %r15, %rdi
callq 0x9050
movq %rax, (%r13,%r14,8)
incq %r14
cmpq %r14, %rbx
jne 0x375f9
movq %r13, -0x40(%rbp)
testl %ebx, %ebx
jle 0x37739
leaq 0x35a2b(%rip), %r13     # 0x6d05d
xorl %ebx, %ebx
cmpl $0x0, -0x30(%rbp)
jle 0x37665
movq -0x50(%rbp), %rax
movq (%rax,%rbx,8), %r15
xorl %r14d, %r14d
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x9930
incq %r14
movslq -0x30(%rbp), %rax
addq $0x8, %r15
cmpq %rax, %r14
jl 0x37645
cmpl $0x0, -0x2c(%rbp)
jle 0x37696
movq -0x40(%rbp), %rax
movq (%rax,%rbx,8), %r15
xorl %r14d, %r14d
movq %r12, %rdi
movq %r13, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x9930
incq %r14
movslq -0x2c(%rbp), %rax
addq $0x8, %r15
cmpq %rax, %r14
jl 0x37676
incq %rbx
movslq -0x34(%rbp), %rax
cmpq %rax, %rbx
jl 0x37634
testl %eax, %eax
movq -0x50(%rbp), %r15
movq -0x40(%rbp), %r14
jle 0x37741
xorpd %xmm0, %xmm0
xorl %ebx, %ebx
movq -0x58(%rbp), %r12
movsd %xmm0, -0x48(%rbp)
movq (%r14,%rbx,8), %rax
movq %rax, 0x30(%r12)
movq (%r15,%rbx,8), %rsi
movq %r12, %rdi
xorl %edx, %edx
callq 0x36d92
movq %r12, %rdi
callq 0x36eb0
movsd -0x48(%rbp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
incq %rbx
movslq -0x34(%rbp), %rax
cmpq %rax, %rbx
jl 0x376bc
testl %eax, %eax
jle 0x37741
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rdi
testq %rdi, %rdi
je 0x37713
callq 0x9630
movq (%r14,%rbx,8), %rdi
testq %rdi, %rdi
je 0x37721
callq 0x9630
incq %rbx
movslq -0x34(%rbp), %rax
cmpq %rax, %rbx
jl 0x37705
jmp 0x37741
movsd 0x31961(%rip), %xmm0    # 0x69098
jmp 0x37756
movq -0x50(%rbp), %r15
movq -0x40(%rbp), %r14
movq %r15, %rdi
callq 0x9630
movq %r14, %rdi
callq 0x9630
movsd -0x48(%rbp), %xmm0
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x9f05
nop