// File: /workspace/github_cpp_makefile_star2_O3/js850[P]lbfgs_cpp/example.cpp
// Function: main
int main(){
  int N = 3;
  int M = 4;
  vector<double> x0(N);

  x0[0] = .13;
  x0[1] = 1.23;
  x0[2] = -5.03;

  LBFGS_ns::LBFGS lbfgs(&func2, &x0[0], N, M);
  lbfgs.set_max_iter(30);
  lbfgs.set_iprint(1);
  lbfgs.run();
  
  double const * x = lbfgs.get_x();
  cout << "final result:\n";
  cout << "x: " << x[0] << " " << x[1] << " " << x[2] << "\n";
  cout << "f: " << lbfgs.get_f() << "\n";
  cout << "rms: " << lbfgs.get_rms() << "\n";
  cout << "nfev: " << lbfgs.get_nfev() << "\n";
  cout << "success: " << lbfgs.success() << "\n";

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xe8, %rsp
movl $0x18, %edi
callq 0x10c0
movq %rax, %rbx
movabsq $0x3fc0a3d70a3d70a4, %rax # imm = 0x3FC0A3D70A3D70A4
movq %rax, (%rbx)
movabsq $0x3ff3ae147ae147ae, %rax # imm = 0x3FF3AE147AE147AE
movq %rax, 0x8(%rbx)
movabsq $-0x3febe147ae147ae1, %rax # imm = 0xC0141EB851EB851F
movq %rax, 0x10(%rbx)
leaq -0x80(%rip), %rsi       # 0x130c
leaq -0x100(%rbp), %rdi
movl $0x3, %ecx
movq %rbx, %rdx
movl $0x4, %r8d
callq 0x17c6
movabsq $0x10000001e, %rax      # imm = 0x10000001E
leaq -0x100(%rbp), %rdi
movq %rax, 0x28(%rdi)
callq 0x29b0
movq -0xc8(%rbp), %r15
movq 0x3c0a(%rip), %rdi      # 0x4fd8
leaq 0x1c2f(%rip), %rsi      # 0x3004
movl $0xe, %edx
callq 0x10e0
movq 0x3bf2(%rip), %rdi      # 0x4fd8
leaq 0x1c26(%rip), %rsi      # 0x3013
movl $0x3, %edx
callq 0x10e0
movsd (%r15), %xmm0
movq 0x3bd5(%rip), %rdi      # 0x4fd8
callq 0x1110
movq %rax, %r14
leaq 0x1d99(%rip), %rsi      # 0x31ab
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movsd 0x8(%r15), %xmm0
movq %r14, %rdi
callq 0x1110
movq %rax, %r14
leaq 0x1d74(%rip), %rsi      # 0x31ab
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movsd 0x10(%r15), %xmm0
movq %r14, %rdi
callq 0x1110
leaq 0x1cd3(%rip), %rsi      # 0x312c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3b6b(%rip), %rdi      # 0x4fd8
leaq 0x1ba3(%rip), %rsi      # 0x3017
movl $0x3, %edx
callq 0x10e0
movsd -0xb0(%rbp), %xmm0
movq 0x3b4b(%rip), %rdi      # 0x4fd8
callq 0x1110
leaq 0x1c93(%rip), %rsi      # 0x312c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3b2b(%rip), %rdi      # 0x4fd8
leaq 0x1b67(%rip), %rsi      # 0x301b
movl $0x5, %edx
callq 0x10e0
movsd -0x90(%rbp), %xmm0
movq 0x3b0b(%rip), %rdi      # 0x4fd8
callq 0x1110
leaq 0x1c53(%rip), %rsi      # 0x312c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3aeb(%rip), %rdi      # 0x4fd8
leaq 0x1b2d(%rip), %rsi      # 0x3021
movl $0x6, %edx
callq 0x10e0
movl -0xcc(%rbp), %esi
movq 0x3acd(%rip), %rdi      # 0x4fd8
callq 0x1150
leaq 0x1c15(%rip), %rsi      # 0x312c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3aad(%rip), %rdi      # 0x4fd8
leaq 0x1af6(%rip), %rsi      # 0x3028
movl $0x9, %edx
callq 0x10e0
leaq -0x100(%rbp), %rdi
callq 0x29e4
movzbl %al, %esi
movq 0x3a86(%rip), %rdi      # 0x4fd8
callq 0x1140
leaq 0x1bce(%rip), %rsi      # 0x312c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
leaq -0x100(%rbp), %rdi
callq 0x15c0
movl $0x18, %esi
movq %rbx, %rdi
callq 0x10d0
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x159b
movq %rax, %r14
jmp 0x15aa
movq %rax, %r14
leaq -0x100(%rbp), %rdi
callq 0x15c0
movl $0x18, %esi
movq %rbx, %rdi
callq 0x10d0
movq %r14, %rdi
callq 0x1160
nop