// File: /workspace/github_c_makefile_star2_O0/aspone[P]OrderBook/./MessageParser.h
// Function: OrderBook::MessageParser::parseTrade(char*, TradeMessage&)
inline void MessageParser::parseTrade(char *tk_msg, TradeMessage &tm) {
   ParseStatus result = tokenizeAndConvertToUint(tk_msg, tm.trade_qty_);
   if (result != ePS_Good) {
      if (result == ePS_CorruptMessage)
         return failTradeParse(tm, result);;
      return failTradeParse(tm, ePS_BadQuantity);
   }
   if (tm.trade_qty_ == 0) return failTradeParse(tm, ePS_BadPrice);

   double price;
   result = tokenizeAndConvertToDouble(tk_msg, price);
   if (result != ePS_Good) {
      if (result == ePS_CorruptMessage)
         return failTradeParse(tm, result);
      return failTradeParse(tm, ePS_BadPrice);
   }
   // technically not supporting prices up to double here.
   if (price > ULLONG_MAX) {
      return failTradeParse(tm, ePS_BadPrice);
   }

   // Bail if not 0-2 decimals of precision
   if ((double)(price * 100) - static_cast<unsigned long long>(price * 100) != 0) {
      return failTradeParse(tm, ePS_BadPrice);
   }
   if (static_cast<unsigned long long>(price * 100) == 0) return failTradeParse(tm, ePS_BadPrice);

   tm.trade_price_ = static_cast<unsigned long long>(price * 100);
   if (tm.trade_price_ > MAXPRICE - 1) {
      DB("Price: %llu.  Max: %d\n", tm.trade_price_, MAXPRICE - 1);
      return failTradeParse(tm, ePS_BadPrice);
   }

   FHErrorTracker::instance()->goodMessage();
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
callq 0x81e0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x689f
cmpl $0x1, 0x1c(%rsp)
jne 0x6886
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
callq 0x8290
jmp 0x6abc
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x2, %edx
callq 0x8290
jmp 0x6abc
movq 0x20(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x68c2
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0x8290
jmp 0x6abc
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x82d0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x6919
cmpl $0x1, 0x1c(%rsp)
jne 0x6900
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
callq 0x8290
jmp 0x6abc
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0x8290
jmp 0x6abc
movsd 0x10(%rsp), %xmm0
movsd 0x9741(%rip), %xmm1     # 0x10068
ucomisd %xmm1, %xmm0
jbe 0x6946
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0x8290
jmp 0x6abc
movsd 0x10(%rsp), %xmm0
movsd 0x971c(%rip), %xmm2     # 0x10070
movaps %xmm0, %xmm1
mulsd %xmm2, %xmm1
movaps %xmm1, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x9706(%rip), %xmm2     # 0x10078
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, %xmm1
movaps 0x9713(%rip), %xmm2     # 0x100a0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x9717(%rip), %xmm2     # 0x100b0
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x96a9(%rip), %xmm2     # 0x10070
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x69dc
jp 0x69dc
jmp 0x69f5
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0x8290
jmp 0x6abc
movsd 0x10(%rsp), %xmm0
movsd 0x966d(%rip), %xmm1     # 0x10070
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x965a(%rip), %xmm1     # 0x10078
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
cmpq $0x0, %rax
jne 0x6a49
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0x8290
jmp 0x6abc
movsd 0x10(%rsp), %xmm0
movsd 0x9619(%rip), %xmm1     # 0x10070
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
movsd 0x9606(%rip), %xmm1     # 0x10078
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x20(%rsp), %rax
cmpq $0x98967f, 0x8(%rax)    # imm = 0x98967F
jbe 0x6aaf
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0x8290
jmp 0x6abc
callq 0x3a30
movq %rax, %rdi
callq 0x8380
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)