// File: /workspace/github_cpp_makefile_star2_O2/tdv[P]boss/boss/examples/simple_enum/main.cpp
// Function: SetMyOffers(Boss::RefObjPtr<Boss::IEnum>, unsigned int, unsigned int)
void SetMyOffers(Boss::RefObjPtr<Boss::IEnum> collection,
                 unsigned minPercent, unsigned maxPercent)
{
  Boss::EnumHelper<MyNs::IFaces::IBestOffer> 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->MyOffer(Price + (Price * minPercent) / 100) != Boss::Status::Ok)
      throw std::runtime_error("Failed to set my min offer for \"BestOffer\".");
    if (i->MyOffer(Price + (Price * maxPercent) / 100) != Boss::Status::Ok)
      throw std::runtime_error("Failed to set my max offer for \"BestOffer\".");
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq (%rdi), %rdi
movq %rdi, 0x20(%rsp)
testq %rdi, %rdi
je 0x178c5
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x18(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x18636
leaq 0x20(%rsp), %rdi
callq 0x18288
movq %rsp, %rdi
leaq 0x18(%rsp), %rbx
movq %rbx, %rsi
callq 0x186ac
movl %r14d, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x30(%rsp)
movl %ebp, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0x8(%rsp), %r14
movq %rsp, %r15
leaq 0x10(%rsp), %r12
leaq 0x18(%rsp), %r13
cmpq $0x0, (%rsp)
je 0x179f3
movq %r14, %rdi
movq %r15, %rsi
callq 0x186f2
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x17a4c
andq $0x0, 0x10(%rsp)
movq (%rdi), %rax
movq %r12, %rsi
callq *0x28(%rax)
testl %eax, %eax
jne 0x17a30
movq (%rsp), %rdi
movsd 0x10(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x30(%rsp), %xmm0
divsd 0xa76ab(%rip), %xmm0    # 0xbf020
addsd %xmm1, %xmm0
movq (%rdi), %rax
callq *0x28(%rax)
testl %eax, %eax
jne 0x17a14
movq (%rsp), %rdi
movsd 0x10(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x28(%rsp), %xmm0
divsd 0xa767d(%rip), %xmm0    # 0xbf020
addsd %xmm1, %xmm0
movq (%rdi), %rax
callq *0x28(%rax)
testl %eax, %eax
jne 0x17a7c
movq %r14, %rdi
callq 0x182f8
movq %r14, %rdi
movq %r13, %rsi
callq 0x1870c
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x179d7
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x8(%rsp), %rax
movq %rax, (%rsp)
andq $0x0, 0x8(%rsp)
movq %r14, %rdi
callq 0x187e2
jmp 0x1791e
movq %rsp, %rdi
callq 0x187e2
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 0xa76f1(%rip), %rsi     # 0xbf117
movq %rax, %rdi
callq 0x2dd10
jmp 0x17a96
pushq $0x10
popq %rdi
callq 0x1a7d0
movq %rax, %r15
leaq 0xa76b0(%rip), %rsi     # 0xbf0f2
movq %rax, %rdi
callq 0x2dd10
jmp 0x17a96
pushq $0x10
popq %rdi
callq 0x1a7d0
movq %rax, %r15
leaq 0xa7678(%rip), %rsi     # 0xbf0d6
movq %rax, %rdi
callq 0x2dd10
leaq 0xdfe43(%rip), %rsi     # 0xf78b0
leaq 0xc91c(%rip), %rdx      # 0x24390
movq %r15, %rdi
callq 0x1b820
pushq $0x10
popq %rdi
callq 0x1a7d0
movq %rax, %r15
leaq 0xa76b5(%rip), %rsi     # 0xbf143
movq %rax, %rdi
callq 0x2dd10
leaq 0xdfe13(%rip), %rsi     # 0xf78b0
leaq 0xc8ec(%rip), %rdx      # 0x24390
movq %r15, %rdi
callq 0x1b820
jmp 0x17aae
movq %rax, %r14
jmp 0x17af5
jmp 0x17abb
jmp 0x17ae0
jmp 0x17abb
jmp 0x17abb
movq %rax, %r14
movq %r15, %rdi
callq 0x1a830
jmp 0x17ae3
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x187e2
jmp 0x17aed
jmp 0x17ad9
movq %rax, %r14
jmp 0x17aed
jmp 0x17ae0
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x182f8
movq %rsp, %rdi
callq 0x187e2
movq %rbx, %rdi
callq 0x18288
movq %r14, %rdi
callq 0xbba60