// File: /workspace/github_cpp_makefile_star2_O1/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
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
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 -0x86(%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 0x2976
movq -0xc8(%rbp), %r15
movq 0x3c04(%rip), %rdi      # 0x4fd8
leaq 0x1c29(%rip), %rsi      # 0x3004
movl $0xe, %edx
callq 0x10e0
movq 0x3bec(%rip), %rdi      # 0x4fd8
leaq 0x1c20(%rip), %rsi      # 0x3013
movl $0x3, %edx
callq 0x10e0
movsd (%r15), %xmm0
movq 0x3bcf(%rip), %rdi      # 0x4fd8
callq 0x1110
movq %rax, %r14
leaq 0x1d83(%rip), %rsi      # 0x319b
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movsd 0x8(%r15), %xmm0
movq %r14, %rdi
callq 0x1110
movq %rax, %r14
leaq 0x1d5e(%rip), %rsi      # 0x319b
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movsd 0x10(%r15), %xmm0
movq %r14, %rdi
callq 0x1110
leaq 0x1cbd(%rip), %rsi      # 0x311c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3b65(%rip), %rdi      # 0x4fd8
leaq 0x1b9d(%rip), %rsi      # 0x3017
movl $0x3, %edx
callq 0x10e0
movsd -0xb0(%rbp), %xmm0
movq 0x3b45(%rip), %rdi      # 0x4fd8
callq 0x1110
leaq 0x1c7d(%rip), %rsi      # 0x311c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3b25(%rip), %rdi      # 0x4fd8
leaq 0x1b61(%rip), %rsi      # 0x301b
movl $0x5, %edx
callq 0x10e0
movsd -0x90(%rbp), %xmm0
movq 0x3b05(%rip), %rdi      # 0x4fd8
callq 0x1110
leaq 0x1c3d(%rip), %rsi      # 0x311c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3ae5(%rip), %rdi      # 0x4fd8
leaq 0x1b27(%rip), %rsi      # 0x3021
movl $0x6, %edx
callq 0x10e0
movl -0xcc(%rbp), %esi
movq 0x3ac7(%rip), %rdi      # 0x4fd8
callq 0x1150
leaq 0x1bff(%rip), %rsi      # 0x311c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
movq 0x3aa7(%rip), %rdi      # 0x4fd8
leaq 0x1af0(%rip), %rsi      # 0x3028
movl $0x9, %edx
callq 0x10e0
leaq -0x100(%rbp), %rdi
callq 0x29aa
movzbl %al, %esi
movq 0x3a80(%rip), %rdi      # 0x4fd8
callq 0x1140
leaq 0x1bb8(%rip), %rsi      # 0x311c
movl $0x1, %edx
movq %rax, %rdi
callq 0x10e0
leaq -0x100(%rbp), %rdi
callq 0x15c6
movl $0x18, %esi
movq %rbx, %rdi
callq 0x10d0
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
jmp 0x15a1
movq %rax, %r14
jmp 0x15b0
movq %rax, %r14
leaq -0x100(%rbp), %rdi
callq 0x15c6
movl $0x18, %esi
movq %rbx, %rdi
callq 0x10d0
movq %r14, %rdi
callq 0x1160
nop