// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebp
movq (%rdi), %rdi
movq %rdi, 0x18(%rsp)
testq %rdi, %rdi
je 0x18dad
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x19c70
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18dcc
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x18(%rsp)
leaq 0x10(%rsp), %rdi
callq 0x1b656
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x19cf2
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
je 0x18eb9
movl %ebp, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0x8(%rsp), %r14
leaq 0x20(%rsp), %r15
leaq 0x10(%rsp), %r12
movq $0x0, 0x8(%rsp)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x29ab589c, %esi       # imm = 0x29AB589C
movq %r14, %rdx
callq *0x20(%rax)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18ed6
movq $0x0, 0x20(%rsp)
movq (%rdi), %rax
movq %r15, %rsi
callq *0x28(%rax)
testl %eax, %eax
jne 0x18f26
movsd 0x20(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x28(%rsp), %xmm0
divsd 0xa61ae(%rip), %xmm0    # 0xbf020
addsd %xmm1, %xmm0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x18f08
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18e97
movq (%rdi), %rax
callq *0x18(%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x19cf2
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x8(%rsp), %rbx
testq %rbx, %rbx
jne 0x18e18
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x18ec9
movq (%rdi), %rax
callq *0x18(%rax)
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x1bd50
movq %rax, %r15
leaq 0xa61ec(%rip), %rsi     # 0xbf0d6
movq %rax, %rdi
callq 0x2f290
leaq 0xdd9b7(%rip), %rsi     # 0xf68b0
leaq 0xca10(%rip), %rdx      # 0x25910
movq %r15, %rdi
callq 0x1cda0
movl $0x10, %edi
callq 0x1bd50
movq %rax, %r15
leaq 0xa6253(%rip), %rsi     # 0xbf16f
movq %rax, %rdi
callq 0x2f290
jmp 0x18f42
movl $0x10, %edi
callq 0x1bd50
movq %rax, %r15
leaq 0xa61b8(%rip), %rsi     # 0xbf0f2
movq %rax, %rdi
callq 0x2f290
leaq 0xdd967(%rip), %rsi     # 0xf68b0
leaq 0xc9c0(%rip), %rdx      # 0x25910
movq %r15, %rdi
callq 0x1cda0
jmp 0x19009
jmp 0x19009
movq %rax, %r14
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x18f75
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x18(%rsp)
jmp 0x18ffd
jmp 0x19009
movq %rax, %r14
jmp 0x18fe4
jmp 0x18f90
jmp 0x18f90
jmp 0x18fbf
movq %rax, %r14
movq %r15, %rdi
callq 0x1bdb0
jmp 0x18fc2
jmp 0x19009
jmp 0x18fa3
jmp 0x18fbf
movq %rax, %r14
jmp 0x18fdb
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18fd2
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x18fd2
jmp 0x19009
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18fd2
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x8(%rsp)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x18ff4
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x10(%rsp)
movq %r14, %rdi
callq 0xbc480
jmp 0x19009
jmp 0x19009
movq %rax, %rdi
callq 0x19dff