// File: /workspace/github_c_makefile_star2_O3/aspone[P]OrderBook/./MessageParser.h
// Function: OrderBook::MessageParser::parseOrder(char*, OrderLevelEntry&)
inline void MessageParser::parseOrder(char *tk_msg, OrderLevelEntry &ole) {
   ParseStatus result = tokenizeAndConvertToUint(tk_msg, ole.order_id_);
   if (result != ePS_Good) {
      if (result == ePS_CorruptMessage)
         return failOrderParse(ole, result);
      return failOrderParse(ole, ePS_BadID);
   }

   tk_msg = strtok(NULL, ",");
   if (tk_msg == NULL) {
      return failOrderParse(ole, ePS_CorruptMessage);
   }
   else {
      switch(tk_msg[0]) {
         case 'B':
            ole.order_side_ = eS_Buy;
            break;
         case 'S':
            ole.order_side_ = eS_Sell;
            break;
         default:
            return failOrderParse(ole, ePS_CorruptMessage);
            break;
      }
   }

   result = tokenizeAndConvertToUint(tk_msg, ole.order_qty_);
   if (result != ePS_Good) {
      if (result == ePS_CorruptMessage)
         return failOrderParse(ole, result);
      return failOrderParse(ole, ePS_BadQuantity);
   }
   if (ole.order_qty_ == 0) return failOrderParse(ole, ePS_BadQuantity);

   double price = 0;
   result = tokenizeAndConvertToDouble(tk_msg, price);
   if (result != ePS_Good) {
      if (result == ePS_CorruptMessage)
         return failOrderParse(ole, result);
      return failOrderParse(ole, ePS_BadPrice);
   }
   if (static_cast<unsigned long long>(price * 100) == 0) return failOrderParse(ole, ePS_BadPrice);
   // technically not supporting prices up to double here.
   if (price > ULLONG_MAX) {
      return failOrderParse(ole, ePS_BadPrice);
   }

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

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
leaq 0x37b9(%rip), %rsi      # 0x71dc
xorl %edi, %edi
callq 0x22c0
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x3c5e
movq %rax, %r14
cmpb $0x2d, (%rax)
je 0x3a9a
movq %r14, %rdi
callq 0x20a0
addq %rax, %r14
movq %r14, 0x18(%rsp)
testq %rax, %rax
je 0x3a9a
leaq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %rbx, %rdx
callq 0x4308
testb %al, %al
je 0x3a9a
leaq 0x376a(%rip), %rsi      # 0x71dc
xorl %edi, %edi
callq 0x22c0
testq %rax, %rax
je 0x3c5e
movzbl (%rax), %eax
cmpl $0x42, %eax
je 0x3ada
cmpl $0x53, %eax
jne 0x3c5e
movl $0x2, %eax
jmp 0x3adf
movl $0x0, 0x14(%rbx)
leaq 0x7718(%rip), %rbx      # 0xb1c0
movq (%rbx), %rax
testq %rax, %rax
jne 0x3ad2
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
incl 0x20(%rax)
jmp 0x3c99
movl $0x1, %eax
movl %eax, 0x14(%rbx)
leaq 0x36f3(%rip), %rsi      # 0x71dc
xorl %edi, %edi
callq 0x22c0
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x3c5e
movq %rax, %r14
cmpb $0x2d, (%rax)
je 0x3ca1
movq %r14, %rdi
callq 0x20a0
addq %rax, %r14
movq %r14, 0x18(%rsp)
testq %rax, %rax
je 0x3ca1
leaq 0x10(%rbx), %r14
leaq 0x10(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movq %r14, %rdx
callq 0x4308
testb %al, %al
je 0x3ca1
cmpl $0x0, (%r14)
je 0x3ca1
movq $0x0, 0x20(%rsp)
leaq 0x3681(%rip), %rsi      # 0x71dc
xorl %edi, %edi
callq 0x22c0
movq %rax, 0x10(%rsp)
testq %rax, %rax
je 0x3cde
movq %rax, %r14
cmpb $0x2d, (%rax)
je 0x3c1d
movq %r14, %rdi
callq 0x20a0
addq %rax, %r14
leaq 0x18(%rsp), %rsi
movq %r14, (%rsi)
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rdx
leaq 0xf(%rsp), %rcx
callq 0x44b0
testb %al, %al
je 0x3c1d
movsd 0x20(%rsp), %xmm1
movsd 0x345b(%rip), %xmm0     # 0x7010
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
movapd %xmm0, %xmm2
subsd 0x3447(%rip), %xmm2     # 0x7018
cvttsd2si %xmm2, %rax
andq %rdx, %rax
orq %rcx, %rax
je 0x3c1d
ucomisd 0x3422(%rip), %xmm1     # 0x7008
ja 0x3c1d
movq %rax, %xmm1
punpckldq 0x343b(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3443(%rip), %xmm1     # 0x7040
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
subsd %xmm2, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x3c1d
jnp 0x3d21
movl $0x0, 0x14(%rbx)
leaq 0x7595(%rip), %rbx      # 0xb1c0
movq (%rbx), %rax
testq %rax, %rax
jne 0x3c55
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
addq $0x1c, %rax
jmp 0x3d1a
movl $0x0, 0x14(%rbx)
leaq 0x7554(%rip), %rbx      # 0xb1c0
movq (%rbx), %rax
testq %rax, %rax
jne 0x3c96
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
incl 0x14(%rax)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
movl $0x0, 0x14(%rbx)
leaq 0x7511(%rip), %rbx      # 0xb1c0
movq (%rbx), %rax
testq %rax, %rax
jne 0x3cd9
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
incl 0x18(%rax)
jmp 0x3c99
movl $0x0, 0x14(%rbx)
leaq 0x74d4(%rip), %rbx      # 0xb1c0
movq (%rbx), %rax
testq %rax, %rax
jne 0x3d16
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
addq $0x14, %rax
incl (%rax)
jmp 0x3c99
movq %rax, 0x8(%rbx)
leaq 0x7494(%rip), %rbx      # 0xb1c0
movq (%rbx), %rax
testq %rax, %rax
jne 0x3d56
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
addq $0x24, %rax
jmp 0x3d1a