// File: AshOlogn[P]ash-language-interpreter/src/parsetoken.cpp
// Function: getLargerNumberParseDataType(ParseDataType, ParseDataType)
ParseDataType getLargerNumberParseDataType(ParseDataType p1, ParseDataType p2) {
 
  //some special cases
  if(p1 == DOUBLE_T || p2 == DOUBLE_T)
    return DOUBLE_T;

  //CHAR_T only returned if BOTH types are CHAR_T already (otherwise it's int)
  if(p1 == CHAR_T && p2 == CHAR_T)
    return CHAR_T;

  //pre-process
  ParseDataType P1 = (p1 == CHAR_T) ? UINT8_T : p1;
  ParseDataType P2 = (p2 == CHAR_T) ? UINT8_T : p2;

  //find the larger type
  uint8_t i1 = 0;
  uint8_t i2 = 0;

  while((signedIntegerTypes[i1] != P1) &&  (unsignedIntegerTypes[i1] != P1))
    i1++;

  while((signedIntegerTypes[i2] != P2) &&  (unsignedIntegerTypes[i2] != P2))
    i2++;

  uint8_t max = (i1 > i2) ? i1 : i2;
  return (isUnsignedIntParseDataType(P1) && isUnsignedIntParseDataType(P2)) ?
          unsignedIntegerTypes[max] : signedIntegerTypes[max];  

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0xa, -0x8(%rbp)
je 0xb35a
cmpl $0xa, -0xc(%rbp)
jne 0xb366
movl $0xa, -0x4(%rbp)
jmp 0xb4b6
cmpl $0x8, -0x8(%rbp)
jne 0xb37e
cmpl $0x8, -0xc(%rbp)
jne 0xb37e
movl $0x8, -0x4(%rbp)
jmp 0xb4b6
cmpl $0x8, -0x8(%rbp)
jne 0xb38e
movl $0x4, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb394
movl -0x8(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x10(%rbp)
cmpl $0x8, -0xc(%rbp)
jne 0xb3aa
movl $0x4, %eax
movl %eax, -0x20(%rbp)
jmp 0xb3b0
movl -0xc(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x14(%rbp)
movb $0x0, -0x15(%rbp)
movb $0x0, -0x16(%rbp)
movzbl -0x15(%rbp), %eax
movl %eax, %ecx
leaq 0x34c35(%rip), %rax     # 0x40000
movl (%rax,%rcx,4), %ecx
xorl %eax, %eax
cmpl -0x10(%rbp), %ecx
movb %al, -0x21(%rbp)
je 0xb3f1
movzbl -0x15(%rbp), %eax
movl %eax, %ecx
leaq 0x34c2b(%rip), %rax     # 0x40010
movl (%rax,%rcx,4), %eax
cmpl -0x10(%rbp), %eax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0xb3fa
jmp 0xb404
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
jmp 0xb3be
jmp 0xb406
movzbl -0x16(%rbp), %eax
movl %eax, %ecx
leaq 0x34bed(%rip), %rax     # 0x40000
movl (%rax,%rcx,4), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0x22(%rbp)
je 0xb439
movzbl -0x16(%rbp), %eax
movl %eax, %ecx
leaq 0x34be3(%rip), %rax     # 0x40010
movl (%rax,%rcx,4), %eax
cmpl -0x14(%rbp), %eax
setne %al
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0xb442
jmp 0xb44c
movb -0x16(%rbp), %al
addb $0x1, %al
movb %al, -0x16(%rbp)
jmp 0xb406
movzbl -0x15(%rbp), %eax
movzbl -0x16(%rbp), %ecx
cmpl %ecx, %eax
jle 0xb460
movb -0x15(%rbp), %al
movb %al, -0x23(%rbp)
jmp 0xb466
movb -0x16(%rbp), %al
movb %al, -0x23(%rbp)
movb -0x23(%rbp), %al
movb %al, -0x17(%rbp)
movl -0x10(%rbp), %edi
callq 0xb2f0
testb $0x1, %al
jne 0xb47a
jmp 0xb49d
movl -0x14(%rbp), %edi
callq 0xb2f0
testb $0x1, %al
jne 0xb488
jmp 0xb49d
movzbl -0x17(%rbp), %eax
movl %eax, %ecx
leaq 0x34b7b(%rip), %rax     # 0x40010
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
jmp 0xb4b0
movzbl -0x17(%rbp), %eax
movl %eax, %ecx
leaq 0x34b56(%rip), %rax     # 0x40000
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop