// File: redpony[P]libpopt/optimize_test.cc
// Function: void TestOptimizerVariants<SGDOptimizer>(int)
void TestOptimizerVariants(int num_vars) {
  O oa(num_vars);
  const string name = oa.Name();
  cerr << "-------------------------------------------------------------------------\n";
  cerr << "TEST: " << name << endl;
  double o1 = TestOptimizer(&oa);
  O ob(num_vars);
  double o2 = TestPersistentOptimizer(&ob);
  if (o1 != o2) {
    cerr << oa.Name() << ": PERSISTENT/NON-PERSISTENT VARIANTS PERFORMED DIFFERENTLY!\n"
         << o1 << " vs. " << o2 << endl;
    exit(1);
  }
  cerr << oa.Name() << ": SUCCESS\n";
}

// Assembly:
subq $0x118, %rsp            # imm = 0x118
movl %edi, 0x114(%rsp)
movl 0x114(%rsp), %esi
leaq 0xf8(%rsp), %rdi
movq %rdi, 0x58(%rsp)
movsd 0x96de(%rip), %xmm0     # 0xe038
callq 0x6b90
movq 0x58(%rsp), %rsi
leaq 0xd8(%rsp), %rdi
callq 0x7910
jmp 0x4973
movq 0xd676(%rip), %rdi      # 0x11ff0
leaq 0x988e(%rip), %rsi      # 0xe20f
callq 0x3210
jmp 0x4988
movq 0xd661(%rip), %rdi      # 0x11ff0
leaq 0x98c4(%rip), %rsi      # 0xe25a
callq 0x3210
movq %rax, 0x50(%rsp)
jmp 0x49a2
movq 0x50(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0x3200
movq %rax, 0x48(%rsp)
jmp 0x49bb
movq 0x48(%rsp), %rdi
movq 0xd5f9(%rip), %rsi      # 0x11fc0
callq 0x3250
jmp 0x49ce
leaq 0xf8(%rsp), %rdi
callq 0x35c0
movsd %xmm0, 0x40(%rsp)
jmp 0x49e3
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0xc0(%rsp)
movl 0x114(%rsp), %esi
leaq 0xa8(%rsp), %rdi
movsd 0x962f(%rip), %xmm0     # 0xe038
callq 0x6b90
jmp 0x4a10
leaq 0xa8(%rsp), %rdi
callq 0x3cc0
movsd %xmm0, 0x38(%rsp)
jmp 0x4a25
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0xa0(%rsp)
movsd 0xc0(%rsp), %xmm0
ucomisd 0xa0(%rsp), %xmm0
jne 0x4a4f
jp 0x4a4f
jmp 0x4b80
leaq 0x80(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x7910
jmp 0x4a66
movq 0xd583(%rip), %rdi      # 0x11ff0
leaq 0x80(%rsp), %rsi
callq 0x3200
movq %rax, 0x30(%rsp)
jmp 0x4a81
movq 0x30(%rsp), %rdi
leaq 0x97d4(%rip), %rsi      # 0xe261
callq 0x3210
movq %rax, 0x28(%rsp)
jmp 0x4a99
movq 0x28(%rsp), %rdi
movsd 0xc0(%rsp), %xmm0
callq 0x3400
movq %rax, 0x20(%rsp)
jmp 0x4ab3
movq 0x20(%rsp), %rdi
leaq 0x97df(%rip), %rsi      # 0xe29e
callq 0x3210
movq %rax, 0x18(%rsp)
jmp 0x4acb
movq 0x18(%rsp), %rdi
movsd 0xa0(%rsp), %xmm0
callq 0x3400
movq %rax, 0x10(%rsp)
jmp 0x4ae5
movq 0x10(%rsp), %rdi
movq 0xd4cf(%rip), %rsi      # 0x11fc0
callq 0x3250
jmp 0x4af8
leaq 0x80(%rsp), %rdi
callq 0x3140
movl $0x1, %edi
callq 0x32a0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x4c30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x4c23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
jmp 0x4c16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x80(%rsp), %rdi
callq 0x3140
jmp 0x4c16
leaq 0x60(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x7910
jmp 0x4b94
movq 0xd455(%rip), %rdi      # 0x11ff0
leaq 0x60(%rsp), %rsi
callq 0x3200
movq %rax, 0x8(%rsp)
jmp 0x4bac
movq 0x8(%rsp), %rdi
leaq 0x96ec(%rip), %rsi      # 0xe2a4
callq 0x3210
jmp 0x4bbf
leaq 0x60(%rsp), %rdi
callq 0x3140
leaq 0xa8(%rsp), %rdi
callq 0x6be0
leaq 0xd8(%rsp), %rdi
callq 0x3140
leaq 0xf8(%rsp), %rdi
callq 0x6be0
addq $0x118, %rsp            # imm = 0x118
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x3140
leaq 0xa8(%rsp), %rdi
callq 0x6be0
leaq 0xd8(%rsp), %rdi
callq 0x3140
leaq 0xf8(%rsp), %rdi
callq 0x6be0
movq 0xd0(%rsp), %rdi
callq 0x33b0
nopw (%rax,%rax)