// File: /workspace/github_c_makefile_star2_O0/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:
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 0x71cf
cmpl $0x1, 0x1c(%rsp)
jne 0x71b6
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
callq 0xd8c0
jmp 0x74b7
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x4, %edx
callq 0xd8c0
jmp 0x74b7
xorl %eax, %eax
movl %eax, %edi
leaq 0x9088(%rip), %rsi      # 0x10262
callq 0x22b0
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x7205
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0xd8c0
jmp 0x74b7
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
movl %eax, 0x4(%rsp)
subl $0x42, %eax
je 0x7223
jmp 0x7218
movl 0x4(%rsp), %eax
subl $0x53, %eax
je 0x7231
jmp 0x723f
movq 0x20(%rsp), %rax
movl $0x1, 0x14(%rax)
jmp 0x7258
movq 0x20(%rsp), %rax
movl $0x2, 0x14(%rax)
jmp 0x7258
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0xd8c0
jmp 0x74b7
jmp 0x725a
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x20(%rsp), %rdx
addq $0x10, %rdx
callq 0x81e0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x72b5
cmpl $0x1, 0x1c(%rsp)
jne 0x729c
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
callq 0xd8c0
jmp 0x74b7
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x2, %edx
callq 0xd8c0
jmp 0x74b7
movq 0x20(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x72d9
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x2, %edx
callq 0xd8c0
jmp 0x74b7
movq 0x8(%rsp), %rdi
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movq 0x28(%rsp), %rsi
leaq 0x10(%rsp), %rdx
callq 0x82d0
movl %eax, 0x1c(%rsp)
cmpl $0x0, 0x1c(%rsp)
je 0x7339
cmpl $0x1, 0x1c(%rsp)
jne 0x7320
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl 0x1c(%rsp), %edx
callq 0xd8c0
jmp 0x74b7
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0xd8c0
jmp 0x74b7
movsd 0x10(%rsp), %xmm0
movsd 0x8d29(%rip), %xmm1     # 0x10070
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x8d16(%rip), %xmm1     # 0x10078
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
cmpq $0x0, %rax
jne 0x7390
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0xd8c0
jmp 0x74b7
movsd 0x10(%rsp), %xmm0
movsd 0x8cca(%rip), %xmm1     # 0x10068
ucomisd %xmm1, %xmm0
jbe 0x73bd
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0xd8c0
jmp 0x74b7
movsd 0x10(%rsp), %xmm0
movsd 0x8ca5(%rip), %xmm2     # 0x10070
movaps %xmm0, %xmm1
mulsd %xmm2, %xmm1
movaps %xmm1, %xmm2
cvttsd2si %xmm2, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x8c8f(%rip), %xmm2     # 0x10078
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, %xmm1
movaps 0x8c9c(%rip), %xmm2     # 0x100a0
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movapd 0x8ca0(%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 0x8c32(%rip), %xmm2     # 0x10070
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x7453
jp 0x7453
jmp 0x7469
movq 0x8(%rsp), %rdi
movq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0xd8c0
jmp 0x74b7
movsd 0x10(%rsp), %xmm0
movsd 0x8bf9(%rip), %xmm1     # 0x10070
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
movsd 0x8be6(%rip), %xmm1     # 0x10078
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, 0x8(%rax)
callq 0x3a30
movq %rax, %rdi
callq 0x8380
addq $0x38, %rsp
retq
nopl (%rax)