// File: /workspace/github_c_makefile_star2_O1/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, (%rsp)
leaq 0x3736(%rip), %rsi      # 0x7218
xorl %edi, %edi
callq 0x22c0
movq %rax, (%rsp)
testq %rax, %rax
je 0x3b32
movq %rax, %r14
movl $0x5, %eax
cmpb $0x2d, (%r14)
je 0x3b43
movq %r14, %rdi
callq 0x20a0
movq %r14, %rcx
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
testq %rax, %rax
je 0x3b39
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x4448
testb %al, %al
jne 0x3b3b
movq %r14, (%rsp)
jmp 0x3b3b
movl $0x1, %eax
jmp 0x3b43
xorl %eax, %eax
xorb $0x1, %al
movzbl %al, %eax
leal (%rax,%rax,4), %eax
testl %eax, %eax
je 0x3b91
cmpl $0x1, %eax
je 0x3c3f
movl $0x0, 0x14(%rbx)
leaq 0x7662(%rip), %rbx      # 0xb1c0
cmpq $0x0, (%rbx)
jne 0x3b86
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
movq (%rbx), %rax
incl 0x20(%rax)
jmp 0x3c7b
leaq 0x3680(%rip), %rsi      # 0x7218
xorl %edi, %edi
callq 0x22c0
testq %rax, %rax
je 0x3c3f
movq %rax, %r14
movzbl (%rax), %ecx
movl $0x1, %ebp
movl $0x1, %eax
cmpl $0x42, %ecx
je 0x3bc7
cmpl $0x53, %ecx
jne 0x3c3f
movl $0x2, %eax
movl %eax, 0x14(%rbx)
leaq 0x10(%rbx), %r15
movq %r14, (%rsp)
leaq 0x363f(%rip), %rsi      # 0x7218
xorl %edi, %edi
callq 0x22c0
movq %rax, (%rsp)
testq %rax, %rax
je 0x3c32
movq %rax, %r12
movl $0x5, %ebp
cmpb $0x2d, (%rax)
je 0x3c32
movq %r12, %rdi
callq 0x20a0
movq %r12, %rcx
addq %rax, %rcx
movq %rcx, 0x10(%rsp)
testq %rax, %rax
je 0x3c28
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x4448
testb %al, %al
jne 0x3c2a
movq %r12, (%rsp)
jmp 0x3c2a
xorl %eax, %eax
xorb $0x1, %al
movzbl %al, %eax
leal (%rax,%rax,4), %ebp
testl %ebp, %ebp
je 0x3c88
cmpl $0x1, %ebp
jne 0x3cef
movl $0x0, 0x14(%rbx)
leaq 0x7573(%rip), %rbx      # 0xb1c0
cmpq $0x0, (%rbx)
jne 0x3c75
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
movq (%rbx), %rax
incl 0x14(%rax)
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, (%r15)
je 0x3cef
movq $0x0, 0x18(%rsp)
movq %r14, (%rsp)
leaq 0x3576(%rip), %rsi      # 0x7218
xorl %edi, %edi
callq 0x22c0
movq %rax, (%rsp)
testq %rax, %rax
je 0x3d30
movq %rax, %r14
movl $0x5, %eax
cmpb $0x2d, (%r14)
je 0x3d35
movq %r14, %rdi
callq 0x20a0
addq %rax, %r14
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
movq %rsp, %rdi
leaq 0x18(%rsp), %rdx
leaq 0xf(%rsp), %rcx
callq 0x4658
xorb $0x1, %al
movzbl %al, %eax
leal (%rax,%rax,4), %eax
jmp 0x3d35
movl $0x0, 0x14(%rbx)
leaq 0x74c3(%rip), %rbx      # 0xb1c0
cmpq $0x0, (%rbx)
jne 0x3d25
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
movq %rax, (%rbx)
movq (%rbx), %rax
incl 0x18(%rax)
jmp 0x3c7b
movl $0x1, %eax
testl %eax, %eax
je 0x3d5a
cmpl $0x1, %eax
jne 0x3dcc
movl $0x0, 0x14(%rbx)
leaq 0x7470(%rip), %rax      # 0xb1c0
movl $0x14, %ebx
jmp 0x3ddf
movsd 0x18(%rsp), %xmm1
movsd 0x32a8(%rip), %xmm0     # 0x7010
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
movapd %xmm0, %xmm2
subsd 0x3294(%rip), %xmm2     # 0x7018
cvttsd2si %xmm2, %rax
andq %rdx, %rax
orq %rcx, %rax
je 0x3dcc
ucomisd 0x326f(%rip), %xmm1     # 0x7008
ja 0x3dcc
movq %rax, %xmm1
punpckldq 0x3288(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x3290(%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 0x3dcc
jnp 0x3e20
movl $0x0, 0x14(%rbx)
leaq 0x73e6(%rip), %rax      # 0xb1c0
movl $0x1c, %ebx
cmpq $0x0, (%rax)
jne 0x3e0e
movl $0x28, %edi
callq 0x21f0
xorpd %xmm0, %xmm0
movupd %xmm0, (%rax)
movupd %xmm0, 0x10(%rax)
movq $0x0, 0x20(%rax)
leaq 0x73b5(%rip), %rcx      # 0xb1c0
movq %rax, (%rcx)
leaq 0x73ab(%rip), %rax      # 0xb1c0
movq (%rax), %rax
incl (%rax,%rbx)
jmp 0x3c7b
movq %rax, 0x8(%rbx)
leaq 0x7395(%rip), %rax      # 0xb1c0
movl $0x24, %ebx
jmp 0x3ddf