// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/examples/simple_enum/main.cpp
// Function: SetMyBets(Boss::RefObjPtr<Boss::IEnum>, unsigned int)
void SetMyBets(Boss::RefObjPtr<Boss::IEnum> collection, unsigned percent)
{
  Boss::EnumHelper<MyNs::IFaces::IAuction> Collection(collection);
  for (auto i = Collection.First() ; i.Get() ; i = Collection.Next())
  {
    Boss::RefObjQIPtr<MyNs::IFaces::IFixPrice> FixPrice(i);
    if (!FixPrice.Get())
      throw std::runtime_error("Failed to get price object.");
    double Price = 0;
    if (FixPrice->GetPrice(&Price) != Boss::Status::Ok)
      throw std::runtime_error("Failed to get price for \"BestOffer\".");
    if (i->MyBet(Price + (Price * percent) / 100) != Boss::Status::Ok)
      throw std::runtime_error("Failed to set my bet for \"Auction\".");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
movq (%rdi), %rdi
movq %rdi, 0x28(%rsp)
testq %rdi, %rdi
je 0x17b28
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rbx
movq %rbx, %rsi
callq 0x187f2
leaq 0x28(%rsp), %rdi
callq 0x18288
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x18868
movl %ebp, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x30(%rsp)
leaq 0x10(%rsp), %r14
leaq 0x8(%rsp), %r15
leaq 0x20(%rsp), %r12
leaq 0x18(%rsp), %r13
cmpq $0x0, 0x8(%rsp)
je 0x17c22
movq %r14, %rdi
movq %r15, %rsi
callq 0x188ae
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x17c61
andq $0x0, 0x20(%rsp)
movq (%rdi), %rax
movq %r12, %rsi
callq *0x28(%rax)
testl %eax, %eax
jne 0x17c45
movq 0x8(%rsp), %rdi
movsd 0x20(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x30(%rsp), %xmm0
divsd 0xa7450(%rip), %xmm0    # 0xbf020
addsd %xmm1, %xmm0
movq (%rdi), %rax
callq *0x28(%rax)
testl %eax, %eax
jne 0x17c91
movq %r14, %rdi
callq 0x182f8
movq %r14, %rdi
movq %r13, %rsi
callq 0x188c8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x17c05
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
andq $0x0, 0x10(%rsp)
movq %r14, %rdi
callq 0x1899e
jmp 0x17b77
leaq 0x8(%rsp), %rdi
callq 0x1899e
leaq 0x18(%rsp), %rdi
callq 0x18288
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x1a7d0
movq %rax, %r15
leaq 0xa749b(%rip), %rsi     # 0xbf0f2
movq %rax, %rdi
callq 0x2dd10
jmp 0x17cab
pushq $0x10
popq %rdi
callq 0x1a7d0
movq %rax, %r15
leaq 0xa7463(%rip), %rsi     # 0xbf0d6
movq %rax, %rdi
callq 0x2dd10
leaq 0xdfc2e(%rip), %rsi     # 0xf78b0
leaq 0xc707(%rip), %rdx      # 0x24390
movq %r15, %rdi
callq 0x1b820
pushq $0x10
popq %rdi
callq 0x1a7d0
movq %rax, %r15
leaq 0xa74cc(%rip), %rsi     # 0xbf16f
movq %rax, %rdi
callq 0x2dd10
leaq 0xdfbfe(%rip), %rsi     # 0xf78b0
leaq 0xc6d7(%rip), %rdx      # 0x24390
movq %r15, %rdi
callq 0x1b820
jmp 0x17cc3
movq %rax, %r14
jmp 0x17d0a
jmp 0x17cce
jmp 0x17cf3
jmp 0x17cce
movq %rax, %r14
movq %r15, %rdi
callq 0x1a830
jmp 0x17cf6
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x1899e
jmp 0x17d00
jmp 0x17cee
jmp 0x17cf3
movq %rax, %r14
jmp 0x17d00
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x182f8
leaq 0x8(%rsp), %rdi
callq 0x1899e
movq %rbx, %rdi
callq 0x18288
movq %r14, %rdi
callq 0xbba60