// File: tdv[P]boss/boss/examples/string_enum/main.cpp
// Function: main
int main()
{
  try
  {
    Boss::RefObjPtr<MyNs::ISimpleObject> Obj = Boss::Base<MyNs::SimpleObject>::Create();
    Boss::RefObjPtr<Boss::IEnum> Strings;
    if (Obj->GetStrings(Strings.GetPPtr()) != Boss::Status::Ok)
    {
      std::cerr << "failed to get strings." << std::endl;
      return -1;
    }
    Boss::EnumHelper<Boss::IString> Enum(Strings);
    for (Boss::RefObjPtr<Boss::IString> i = Enum.First() ; i.Get() ; i = Enum.Next())
      std::cout << Boss::StringHelper(i).GetString<Boss::IString::AnsiString>() << std::endl;
  }
  catch (std::exception const &e)
  {
    std::cerr << "Error: " << e.what() << std::endl;
  }
  return 0;
}

// Assembly:
subq $0xd8, %rsp
movl $0x0, 0xd4(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x189c0
jmp 0x183c1
leaq 0xc8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x18ab0
jmp 0x183d8
leaq 0xc0(%rsp), %rdi
callq 0x18b10
xorl %eax, %eax
movl %eax, %esi
leaq 0xa8(%rsp), %rdi
callq 0x18b30
jmp 0x183f8
leaq 0xc8(%rsp), %rdi
callq 0x18b70
movq %rax, 0x40(%rsp)
jmp 0x1840c
leaq 0xa8(%rsp), %rdi
callq 0x18b80
movq %rax, 0x38(%rsp)
jmp 0x18420
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movl %eax, 0x34(%rsp)
jmp 0x18439
movl 0x34(%rsp), %eax
cmpl $0x0, %eax
je 0x184ff
leaq 0xecef3(%rip), %rdi     # 0x105340
leaq 0xaccc8(%rip), %rsi     # 0xc511c
callq 0x8d0e0
movq %rax, 0x28(%rsp)
jmp 0x18460
movq 0x28(%rsp), %rdi
leaq 0x74554(%rip), %rsi     # 0x8c9c0
callq 0x8bbd0
jmp 0x18473
movl $0xffffffff, 0xd4(%rsp) # imm = 0xFFFFFFFF
movl $0x1, 0xa4(%rsp)
jmp 0x18742
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x1879a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x18b10
jmp 0x1879a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x1878d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x18780
leaq 0x90(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x18b90
jmp 0x18516
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x18bd0
jmp 0x1852d
leaq 0x90(%rsp), %rdi
callq 0x18c90
leaq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x18cb0
jmp 0x18551
jmp 0x18553
leaq 0x88(%rsp), %rdi
callq 0x18d40
movq %rax, 0x20(%rsp)
jmp 0x18567
movq 0x20(%rsp), %rax
cmpq $0x0, %rax
jne 0x185e7
movl $0x2, 0xa4(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x19090
jmp 0x1872a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x18c90
jmp 0x18780
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x18773
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x1871b
leaq 0x58(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x18d50
jmp 0x185fb
leaq 0x60(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x18d90
jmp 0x1860c
leaq 0x68(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x18e50
jmp 0x1861d
leaq 0xece3c(%rip), %rdi     # 0x105460
leaq 0x68(%rsp), %rsi
callq 0x96390
movq %rax, 0x18(%rsp)
jmp 0x18635
movq 0x18(%rsp), %rdi
leaq 0x7437f(%rip), %rsi     # 0x8c9c0
callq 0x8bbd0
jmp 0x18648
leaq 0x68(%rsp), %rdi
callq 0x93890
leaq 0x60(%rsp), %rdi
callq 0x19080
leaq 0x58(%rsp), %rdi
callq 0x19090
leaq 0x50(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x190b0
jmp 0x1867a
leaq 0x88(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x19240
jmp 0x1868e
leaq 0x50(%rsp), %rdi
callq 0x19090
jmp 0x18553
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x186f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
jmp 0x186e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x93890
leaq 0x60(%rsp), %rdi
callq 0x19080
leaq 0x58(%rsp), %rdi
callq 0x19090
jmp 0x1871b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x19090
leaq 0x88(%rsp), %rdi
callq 0x19090
jmp 0x18773
leaq 0x98(%rsp), %rdi
callq 0x19280
movl $0x0, 0xa4(%rsp)
leaq 0xa8(%rsp), %rdi
callq 0x19290
leaq 0xc8(%rsp), %rdi
callq 0x192b0
movl 0xa4(%rsp), %eax
testl %eax, %eax
je 0x1876e
jmp 0x18769
jmp 0x1883e
jmp 0x18814
leaq 0x98(%rsp), %rdi
callq 0x19280
leaq 0xa8(%rsp), %rdi
callq 0x19290
leaq 0xc8(%rsp), %rdi
callq 0x192b0
movl 0xb4(%rsp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x1884d
movq 0xb8(%rsp), %rdi
callq 0x21330
movq %rax, 0x48(%rsp)
leaq 0xecb79(%rip), %rdi     # 0x105340
leaq 0xac965(%rip), %rsi     # 0xc5133
callq 0x8d0e0
movq %rax, 0x10(%rsp)
jmp 0x187da
movq 0x48(%rsp), %rdi
movq (%rdi), %rax
movq 0x10(%rax), %rax
callq *%rax
movq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0x8d0e0
movq %rax, 0x8(%rsp)
jmp 0x187fc
movq 0x8(%rsp), %rdi
leaq 0x741b8(%rip), %rsi     # 0x8c9c0
callq 0x8bbd0
jmp 0x1880f
callq 0x213a0
movl $0x0, 0xd4(%rsp)
jmp 0x1883e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb8(%rsp)
movl %eax, 0xb4(%rsp)
callq 0x213a0
jmp 0x1883c
jmp 0x1884d
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq
movq 0xb8(%rsp), %rdi
callq 0xc24c0
movq %rax, %rdi
callq 0x192d0
nopw %cs:(%rax,%rax)