// File: /workspace/github_c_makefile_star2_O0/aspone[P]OrderBook/./OrderBook.h
// Function: OrderBook::OrderBook<unsigned int, OrderLevelEntry>::modifyOrder(OrderLevelEntry*)
void modifyOrder(ORDERTYPE* ole) {
      checkCross();

      auto ooit = orders_.find(ole->order_id_);
      if (ooit == orders_.end()) {
         FHErrorTracker::instance()->invalidModify();
         delete ole;
         return;
      }

      OrderListMap &map = ooit->second->order_side_ == eS_Buy ? buy_book_map_ : sell_book_map_;

      if (ole->order_price_ == ooit->second->order_price_) {
         // Cancel reduce, retain time priority
         if (ole->order_qty_ <= ooit->second->order_qty_) {
            typename OrderListMap::iterator pit = map.find(ooit->second->order_price_);
            pit->second.changeNodeQuantity(ooit->second, ole->order_qty_);
            delete ole;
         }
         // Cancel replace, remove and re-add at back of list
         else {
            typename OrderListMap::iterator pit = map.find(ooit->second->order_price_);
            pit->second.removeNode(ooit->second);
            delete ooit->second;
            orders_.erase(ooit);

            pit->second.addNode(ole);
            orders_[ole->order_id_] = ole;
         }
      }
      // Price change - remove from old level and insert in new
      else {
         typename OrderListMap::iterator opit = map.find(ooit->second->order_price_);
         opit->second.removeNode(ooit->second);
         delete ooit->second;
         orders_.erase(ooit);

         if (opit->second.getQuantity() == 0) {
            map.erase(opit);
         }

         std::pair<typename OrderListMap::iterator, bool> ret;
         ret = map.insert(
            std::pair<unsigned long long, CountedOrderList<ORDERTYPE>>(
               ole->order_price_, CountedOrderList<ORDERTYPE>()));
         ret.first->second.addNode(ole);
         orders_[ole->order_id_] = ole;
      }
   }

// Assembly:
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rdi, 0x1a0(%rsp)
movq %rsi, 0x198(%rsp)
movq 0x1a0(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0xb980
movq 0xa8(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq 0x198(%rsp), %rsi
callq 0xb830
movq 0xa8(%rsp), %rdi
movq %rax, 0x190(%rsp)
addq $0x138, %rdi            # imm = 0x138
callq 0xd920
movq %rax, 0x188(%rsp)
leaq 0x190(%rsp), %rdi
leaq 0x188(%rsp), %rsi
callq 0xef70
testb $0x1, %al
jne 0x7797
jmp 0x77cc
callq 0x3a30
movq %rax, %rdi
callq 0xef90
movq 0x198(%rsp), %rax
movq %rax, 0xa0(%rsp)
cmpq $0x0, %rax
je 0x77c7
movq 0xa0(%rsp), %rdi
callq 0x21a0
jmp 0x7cbb
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x8(%rax), %rax
cmpl $0x1, 0x14(%rax)
jne 0x77fb
movq 0xa8(%rsp), %rax
addq $0xd8, %rax
movq %rax, 0x98(%rsp)
jmp 0x7811
movq 0xa8(%rsp), %rax
addq $0x108, %rax            # imm = 0x108
movq %rax, 0x98(%rsp)
movq 0x98(%rsp), %rax
movq %rax, 0x180(%rsp)
movq 0x198(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x90(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq %rax, %rcx
movq 0x90(%rsp), %rax
movq 0x8(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jne 0x7a3f
movq 0x198(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x8c(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq %rax, %rcx
movl 0x8c(%rsp), %eax
movq 0x8(%rcx), %rcx
cmpl 0x10(%rcx), %eax
ja 0x7929
movq 0x180(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x70(%rsp), %rdi
movq 0x8(%rax), %rsi
addq $0x8, %rsi
callq 0xb7d0
movq %rax, 0x178(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x5340
addq $0x8, %rax
movq %rax, 0x78(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x78(%rsp), %rdi
movq 0x8(%rax), %rsi
movq 0x198(%rsp), %rax
movl 0x10(%rax), %edx
callq 0xb860
movq 0x198(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, %rax
je 0x7924
movq 0x80(%rsp), %rdi
callq 0x21a0
jmp 0x7a3a
movq 0x180(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x58(%rsp), %rdi
movq 0x8(%rax), %rsi
addq $0x8, %rsi
callq 0xb7d0
movq %rax, 0x170(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x5340
addq $0x8, %rax
movq %rax, 0x60(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x60(%rsp), %rdi
movq 0x8(%rax), %rsi
callq 0x5690
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x8(%rax), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, %rax
je 0x79b4
movq 0x68(%rsp), %rdi
callq 0x21a0
movq 0xa8(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq 0x190(%rsp), %rax
movq %rax, 0x168(%rsp)
movq 0x168(%rsp), %rsi
callq 0x54a0
movq %rax, 0x160(%rsp)
leaq 0x170(%rsp), %rdi
callq 0x5340
movq %rax, %rdi
addq $0x8, %rdi
movq 0x198(%rsp), %rsi
callq 0xdac0
movq 0xa8(%rsp), %rdi
movq 0x198(%rsp), %rax
movq %rax, 0x50(%rsp)
addq $0x138, %rdi            # imm = 0x138
movq 0x198(%rsp), %rsi
callq 0xdaf0
movq 0x50(%rsp), %rcx
movq %rcx, (%rax)
jmp 0x7cbb
movq 0x180(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x38(%rsp), %rdi
movq 0x8(%rax), %rsi
addq $0x8, %rsi
callq 0xb7d0
movq %rax, 0x158(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x5340
addq $0x8, %rax
movq %rax, 0x40(%rsp)
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x40(%rsp), %rdi
movq 0x8(%rax), %rsi
callq 0x5690
leaq 0x190(%rsp), %rdi
callq 0x5480
movq 0x8(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0x7aca
movq 0x48(%rsp), %rdi
callq 0x21a0
movq 0xa8(%rsp), %rdi
addq $0x138, %rdi            # imm = 0x138
movq 0x190(%rsp), %rax
movq %rax, 0x150(%rsp)
movq 0x150(%rsp), %rsi
callq 0x54a0
movq %rax, 0x148(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x5340
movq %rax, %rdi
addq $0x8, %rdi
callq 0xb820
cmpl $0x0, %eax
jne 0x7b49
movq 0x180(%rsp), %rdi
movq 0x158(%rsp), %rax
movq %rax, 0x140(%rsp)
movq 0x140(%rsp), %rsi
callq 0xb8a0
movq %rax, 0x138(%rsp)
leaq 0x128(%rsp), %rdi
callq 0xd970
movq 0x180(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x198(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x28(%rsp)
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xd9f0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0xf0(%rsp), %rdi
callq 0xda30
jmp 0x7b9f
movq 0x20(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0xd9a0
movb %dl, 0x17(%rsp)
movq %rax, 0x18(%rsp)
jmp 0x7bbc
movb 0x17(%rsp), %al
movq 0x18(%rsp), %rcx
movq %rcx, 0xb0(%rsp)
movb %al, 0xb8(%rsp)
movq 0xb0(%rsp), %rax
movq %rax, 0x118(%rsp)
movb 0xb8(%rsp), %al
movb %al, 0x120(%rsp)
leaq 0x128(%rsp), %rdi
leaq 0x118(%rsp), %rsi
callq 0xda70
leaq 0xf0(%rsp), %rdi
callq 0xdaa0
leaq 0xd0(%rsp), %rdi
callq 0x5a00
leaq 0x128(%rsp), %rdi
callq 0x5340
movq %rax, %rdi
addq $0x8, %rdi
movq 0x198(%rsp), %rsi
callq 0xdac0
movq 0xa8(%rsp), %rdi
movq 0x198(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x138, %rdi            # imm = 0x138
movq 0x198(%rsp), %rsi
callq 0xdaf0
movq 0x8(%rsp), %rcx
movq %rcx, (%rax)
jmp 0x7cbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
jmp 0x7cac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc8(%rsp)
movl %eax, 0xc4(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xdaa0
leaq 0xd0(%rsp), %rdi
callq 0x5a00
jmp 0x7cc3
addq $0x1a8, %rsp            # imm = 0x1A8
retq
movq 0xc8(%rsp), %rdi
callq 0x2300