// File: /workspace/github_cpp_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x30, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq (%rdi), %rdi
movq %rdi, 0x10(%rsp)
testq %rdi, %rdi
je 0x18ada
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x19ae0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x18af9
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x10(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x1b4ce
movq %rsp, %rdi
leaq 0x8(%rsp), %rsi
callq 0x19b62
movq (%rsp), %rbx
testq %rbx, %rbx
je 0x18c17
movl %r14d, %eax
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x28(%rsp)
movl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x20(%rsp)
movq %rsp, %r14
leaq 0x18(%rsp), %r15
leaq 0x8(%rsp), %r12
movq $0x0, (%rsp)
movq (%rbx), %rax
movq %rbx, %rdi
movl $0x29ab589c, %esi       # imm = 0x29AB589C
movq %r14, %rdx
callq *0x20(%rax)
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18c34
movq $0x0, 0x18(%rsp)
movq (%rdi), %rax
movq %r15, %rsi
callq *0x28(%rax)
testl %eax, %eax
jne 0x18ca2
movsd 0x18(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x28(%rsp), %xmm0
divsd 0xa6477(%rip), %xmm0    # 0xbf020
addsd %xmm1, %xmm0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x18c84
movsd 0x18(%rsp), %xmm1
movapd %xmm1, %xmm0
mulsd 0x20(%rsp), %xmm0
divsd 0xa644a(%rip), %xmm0    # 0xbf020
addsd %xmm1, %xmm0
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
testl %eax, %eax
jne 0x18c66
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18bf6
movq (%rdi), %rax
callq *0x18(%rax)
movq %r14, %rdi
movq %r12, %rsi
callq 0x19b62
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq (%rsp), %rbx
testq %rbx, %rbx
jne 0x18b51
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18c27
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 0xa648e(%rip), %rsi     # 0xbf0d6
movq %rax, %rdi
callq 0x2f290
leaq 0xddc59(%rip), %rsi     # 0xf68b0
leaq 0xccb2(%rip), %rdx      # 0x25910
movq %r15, %rdi
callq 0x1cda0
movl $0x10, %edi
callq 0x1bd50
movq %rax, %r15
leaq 0xa64c9(%rip), %rsi     # 0xbf143
movq %rax, %rdi
callq 0x2f290
jmp 0x18cbe
movl $0x10, %edi
callq 0x1bd50
movq %rax, %r15
leaq 0xa647f(%rip), %rsi     # 0xbf117
movq %rax, %rdi
callq 0x2f290
jmp 0x18cbe
movl $0x10, %edi
callq 0x1bd50
movq %rax, %r15
leaq 0xa643c(%rip), %rsi     # 0xbf0f2
movq %rax, %rdi
callq 0x2f290
leaq 0xddbeb(%rip), %rsi     # 0xf68b0
leaq 0xcc44(%rip), %rdx      # 0x25910
movq %r15, %rdi
callq 0x1cda0
jmp 0x18d84
jmp 0x18d84
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x18cf1
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x10(%rsp)
jmp 0x18d78
jmp 0x18d84
movq %rax, %r14
jmp 0x18d5f
jmp 0x18d0e
jmp 0x18d0e
jmp 0x18d0e
jmp 0x18d3c
movq %rax, %r14
movq %r15, %rdi
callq 0x1bdb0
jmp 0x18d3f
jmp 0x18d84
jmp 0x18d1f
movq %rax, %r14
jmp 0x18d56
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18d4e
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x18d4e
jmp 0x18d84
jmp 0x18d3c
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x18d4e
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, (%rsp)
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x18(%rax)
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x18d6f
movq (%rdi), %rax
callq *0x18(%rax)
movq $0x0, 0x8(%rsp)
movq %r14, %rdi
callq 0xbc480
jmp 0x18d84
jmp 0x18d84
movq %rax, %rdi
callq 0x19dff