// File: tdv[P]boss/boss/examples/simple_component/client/main.cpp
// Function: main
int main()
{
  try
  {
    Boss::Loader Ldr("Registry.xml", "./" MAKE_MODULE_NAME("service_registry"),
                     "./" MAKE_MODULE_NAME("class_factory"));
    auto Obj = Boss::CreateObject<MyNs::ISum>(MyNs::Service::Id::Sum);
    int Res = 0;
    if (Obj->CalcSum(10, 20, &Res))
      std::cout << "Failed to calc sum." << std::endl;
    std::cout << "Sum: " << Res << std::endl;
  }
  catch (std::exception const &e)
  {
    std::cerr << "Error: " << e.what() << std::endl;
  }
  return 0;
}

// Assembly:
subq $0x128, %rsp            # imm = 0x128
movl $0x0, 0x124(%rsp)
leaq 0xd7(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x25790
movq 0x50(%rsp), %rdx
leaq 0xaed58(%rip), %rsi     # 0xc70e8
leaq 0xd8(%rsp), %rdi
callq 0x98c60
jmp 0x1839f
leaq 0x9f(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x25790
movq 0x48(%rsp), %rdx
leaq 0xaed38(%rip), %rsi     # 0xc70f5
leaq 0xa0(%rsp), %rdi
callq 0x98c60
jmp 0x183cc
leaq 0x77(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x25790
movq 0x40(%rsp), %rdx
leaq 0xaed27(%rip), %rsi     # 0xc710e
leaq 0x78(%rsp), %rdi
callq 0x98c60
jmp 0x183f3
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
leaq 0xa0(%rsp), %rdx
leaq 0x78(%rsp), %rcx
callq 0x188f0
jmp 0x18417
leaq 0x78(%rsp), %rdi
callq 0x962e0
leaq 0x77(%rsp), %rdi
callq 0x257b0
leaq 0xa0(%rsp), %rdi
callq 0x962e0
leaq 0x9f(%rsp), %rdi
callq 0x257b0
leaq 0xd8(%rsp), %rdi
callq 0x962e0
leaq 0xd7(%rsp), %rdi
callq 0x257b0
leaq 0x68(%rsp), %rdi
movl $0xcc46a931, %esi       # imm = 0xCC46A931
callq 0x18c10
jmp 0x18470
movl $0x0, 0x64(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x19050
movq %rax, 0x38(%rsp)
jmp 0x18489
movq 0x38(%rsp), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
movl $0xa, %esi
movl $0x14, %edx
leaq 0x64(%rsp), %rcx
callq *%rax
movl %eax, 0x34(%rsp)
jmp 0x184ac
movl 0x34(%rsp), %eax
cmpl $0x0, %eax
je 0x185c4
leaq 0xf0fc0(%rip), %rdi     # 0x109480
leaq 0xaec5d(%rip), %rsi     # 0xc7124
callq 0x8fb30
movq %rax, 0x28(%rsp)
jmp 0x184d3
movq 0x28(%rsp), %rdi
leaq 0x76f31(%rip), %rsi     # 0x8f410
callq 0x8e620
jmp 0x184e6
jmp 0x185c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x1857c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x18562
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x1854b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x962e0
leaq 0x77(%rsp), %rdi
callq 0x257b0
leaq 0xa0(%rsp), %rdi
callq 0x962e0
leaq 0x9f(%rsp), %rdi
callq 0x257b0
leaq 0xd8(%rsp), %rdi
callq 0x962e0
leaq 0xd7(%rsp), %rdi
callq 0x257b0
jmp 0x1862f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x18622
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x19060
jmp 0x18622
leaq 0xf0eb5(%rip), %rdi     # 0x109480
leaq 0xaeb66(%rip), %rsi     # 0xc7138
callq 0x8fb30
movq %rax, 0x20(%rsp)
jmp 0x185de
movq 0x20(%rsp), %rdi
movl 0x64(%rsp), %esi
callq 0x8fed0
movq %rax, 0x18(%rsp)
jmp 0x185f3
movq 0x18(%rsp), %rdi
leaq 0x76e11(%rip), %rsi     # 0x8f410
callq 0x8e620
jmp 0x18606
leaq 0x68(%rsp), %rdi
callq 0x19060
leaq 0xf8(%rsp), %rdi
callq 0x19080
jmp 0x186a9
leaq 0xf8(%rsp), %rdi
callq 0x19080
movl 0xc4(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x186d0
movq 0xc8(%rsp), %rdi
callq 0x23770
movq %rax, 0x58(%rsp)
leaq 0xf0d04(%rip), %rdi     # 0x109360
leaq 0xaeadb(%rip), %rsi     # 0xc713e
callq 0x8fb30
movq %rax, 0x10(%rsp)
jmp 0x1866f
movq 0x58(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x8fb30
movq %rax, 0x8(%rsp)
jmp 0x18691
movq 0x8(%rsp), %rdi
leaq 0x76d73(%rip), %rsi     # 0x8f410
callq 0x8e620
jmp 0x186a4
callq 0x237e0
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
callq 0x237e0
jmp 0x186ce
jmp 0x186d0
movq 0xc8(%rsp), %rdi
callq 0xc40a0
movq %rax, %rdi
callq 0x19110
nopw %cs:(%rax,%rax)