// File: hyrise[P]sql-parser/src/util/sqlhelper.cpp
// Function: hsql::operator<<(std::ostream&, hsql::OperatorType const&)
std::ostream& operator<<(std::ostream& os, const OperatorType& op) {
  static const std::map<const OperatorType, const std::string> operatorToToken = {
      {kOpNone, "None"},     {kOpBetween, "BETWEEN"},
      {kOpCase, "CASE"},     {kOpCaseListElement, "CASE LIST ELEMENT"},
      {kOpPlus, "+"},        {kOpMinus, "-"},
      {kOpAsterisk, "*"},    {kOpSlash, "/"},
      {kOpPercentage, "%"},  {kOpCaret, "^"},
      {kOpEquals, "="},      {kOpNotEquals, "!="},
      {kOpLess, "<"},        {kOpLessEq, "<="},
      {kOpGreater, ">"},     {kOpGreaterEq, ">="},
      {kOpLike, "LIKE"},     {kOpNotLike, "NOT LIKE"},
      {kOpILike, "ILIKE"},   {kOpAnd, "AND"},
      {kOpOr, "OR"},         {kOpIn, "IN"},
      {kOpConcat, "CONCAT"}, {kOpNot, "NOT"},
      {kOpUnaryMinus, "-"},  {kOpIsNull, "IS NULL"},
      {kOpExists, "EXISTS"}};

  const auto found = operatorToToken.find(op);
  if (found == operatorToToken.cend()) {
    return os << static_cast<uint64_t>(op);
  } else {
    return os << (*found).second;
  }
}

// Assembly:
subq $0x548, %rsp            # imm = 0x548
movq %rdi, 0x538(%rsp)
movq %rsi, 0x530(%rsp)
cmpb $0x0, 0x26d22(%rip)     # 0x8fa90
jne 0x6934c
leaq 0x26d15(%rip), %rdi     # 0x8fa90
callq 0x39c30
cmpl $0x0, %eax
je 0x6934c
leaq 0xe8(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x0, 0xdc(%rsp)
leaq 0x15c96(%rip), %rdx     # 0x7ea41
leaq 0xdc(%rsp), %rsi
callq 0x37170
jmp 0x68dba
leaq 0x110(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x1, 0xc8(%rsp)
leaq 0x96e6(%rip), %rdx      # 0x724c2
leaq 0xc8(%rsp), %rsi
callq 0x35170
jmp 0x68deb
leaq 0x138(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x2, 0xc4(%rsp)
leaq 0x987a(%rip), %rdx      # 0x72687
leaq 0xc4(%rsp), %rsi
callq 0x37170
jmp 0x68e1c
leaq 0x160(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x3, 0xc0(%rsp)
leaq 0x15c08(%rip), %rdx     # 0x7ea46
leaq 0xc0(%rsp), %rsi
callq 0x35580
jmp 0x68e4d
leaq 0x188(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x4, 0xbc(%rsp)
leaq 0x15be9(%rip), %rdx     # 0x7ea58
leaq 0xbc(%rsp), %rsi
callq 0x38270
jmp 0x68e7e
leaq 0x1b0(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x5, 0xb8(%rsp)
leaq 0x15bba(%rip), %rdx     # 0x7ea5a
leaq 0xb8(%rsp), %rsi
callq 0x38270
jmp 0x68eaf
leaq 0x1d8(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x6, 0xb4(%rsp)
leaq 0x1598c(%rip), %rdx     # 0x7e85d
leaq 0xb4(%rsp), %rsi
callq 0x38270
jmp 0x68ee0
leaq 0x200(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x7, 0xb0(%rsp)
leaq 0x15b5a(%rip), %rdx     # 0x7ea5c
leaq 0xb0(%rsp), %rsi
callq 0x38270
jmp 0x68f11
leaq 0x228(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x8, 0xac(%rsp)
leaq 0x15b2b(%rip), %rdx     # 0x7ea5e
leaq 0xac(%rsp), %rsi
callq 0x38270
jmp 0x68f42
leaq 0x250(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x9, 0xa8(%rsp)
leaq 0x15afc(%rip), %rdx     # 0x7ea60
leaq 0xa8(%rsp), %rsi
callq 0x38270
jmp 0x68f73
leaq 0x278(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0xa, 0xa4(%rsp)
leaq 0x15ace(%rip), %rdx     # 0x7ea63
leaq 0xa4(%rsp), %rsi
callq 0x38270
jmp 0x68fa4
leaq 0x2a0(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0xb, 0xa0(%rsp)
leaq 0x15a9c(%rip), %rdx     # 0x7ea62
leaq 0xa0(%rsp), %rsi
callq 0x377b0
jmp 0x68fd5
leaq 0x2c8(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0xc, 0x9c(%rsp)
leaq 0x15a6e(%rip), %rdx     # 0x7ea65
leaq 0x9c(%rsp), %rsi
callq 0x38270
jmp 0x69006
leaq 0x2f0(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0xd, 0x98(%rsp)
leaq 0x15a3f(%rip), %rdx     # 0x7ea67
leaq 0x98(%rsp), %rsi
callq 0x377b0
jmp 0x69037
leaq 0x318(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0xe, 0x94(%rsp)
leaq 0x157cb(%rip), %rdx     # 0x7e824
leaq 0x94(%rsp), %rsi
callq 0x38270
jmp 0x69068
leaq 0x340(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0xf, 0x90(%rsp)
leaq 0x159e0(%rip), %rdx     # 0x7ea6a
leaq 0x90(%rsp), %rsi
callq 0x377b0
jmp 0x69099
leaq 0x368(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x10, 0x8c(%rsp)
leaq 0x159b6(%rip), %rdx     # 0x7ea71
leaq 0x8c(%rsp), %rsi
callq 0x37170
jmp 0x690ca
leaq 0x390(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x11, 0x88(%rsp)
leaq 0x15981(%rip), %rdx     # 0x7ea6d
leaq 0x88(%rsp), %rsi
callq 0x39960
jmp 0x690fb
leaq 0x3b8(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x12, 0x84(%rsp)
leaq 0x961f(%rip), %rdx      # 0x7273c
leaq 0x84(%rsp), %rsi
callq 0x398d0
jmp 0x6912c
leaq 0x3e0(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x13, 0x80(%rsp)
leaq 0x95b9(%rip), %rdx      # 0x72707
leaq 0x80(%rsp), %rsi
callq 0x35f40
jmp 0x6915d
leaq 0x408(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x14, 0x7c(%rsp)
leaq 0x9598(%rip), %rdx      # 0x72714
leaq 0x7c(%rsp), %rsi
callq 0x377b0
jmp 0x69188
leaq 0x430(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x15, 0x78(%rsp)
leaq 0x9350(%rip), %rdx      # 0x724f7
leaq 0x78(%rsp), %rsi
callq 0x377b0
jmp 0x691b3
leaq 0x458(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x16, 0x74(%rsp)
leaq 0x9563(%rip), %rdx      # 0x72735
leaq 0x74(%rsp), %rsi
callq 0x366e0
jmp 0x691de
leaq 0x480(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x17, 0x70(%rsp)
leaq 0x951a(%rip), %rdx      # 0x72717
leaq 0x70(%rsp), %rsi
callq 0x35f40
jmp 0x69209
leaq 0x4a8(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x18, 0x6c(%rsp)
leaq 0x15832(%rip), %rdx     # 0x7ea5a
leaq 0x6c(%rsp), %rsi
callq 0x38270
jmp 0x69234
leaq 0x4d0(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x19, 0x68(%rsp)
leaq 0x15823(%rip), %rdx     # 0x7ea76
leaq 0x68(%rsp), %rsi
callq 0x35170
jmp 0x6925f
leaq 0x4f8(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
movl $0x1a, 0x64(%rsp)
leaq 0x931d(%rip), %rdx      # 0x7259b
leaq 0x64(%rsp), %rsi
callq 0x366e0
jmp 0x6928a
leaq 0xe8(%rsp), %rax
movq %rax, 0x520(%rsp)
movq $0x1b, 0x528(%rsp)
leaq 0x62(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x39eb0
movq 0x48(%rsp), %r8
movq 0x520(%rsp), %rsi
movq 0x528(%rsp), %rdx
leaq 0x2678f(%rip), %rdi     # 0x8fa60
leaq 0x63(%rsp), %rcx
callq 0x374e0
jmp 0x692dd
leaq 0x62(%rsp), %rdi
callq 0x39db0
leaq 0xe8(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x438, %rax            # imm = 0x438
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x30(%rsp)
callq 0x35510
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x40(%rsp)
jne 0x692ff
movq 0x23b9b(%rip), %rdi     # 0x8cec8
leaq 0x2672c(%rip), %rsi     # 0x8fa60
leaq 0x266ad(%rip), %rdx     # 0x8f9e8
callq 0x37270
leaq 0x26749(%rip), %rdi     # 0x8fa90
callq 0x36790
movq 0x530(%rsp), %rsi
leaq 0x26705(%rip), %rdi     # 0x8fa60
callq 0x35400
movq %rax, 0x58(%rsp)
leaq 0x266f4(%rip), %rdi     # 0x8fa60
callq 0x38560
movq %rax, 0x50(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x38310
testb $0x1, %al
jne 0x6938e
jmp 0x6947b
movq 0x538(%rsp), %rdi
movq 0x530(%rsp), %rax
movl (%rax), %eax
movl %eax, %esi
callq 0x35760
movq %rax, 0x540(%rsp)
jmp 0x694a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
movq 0xe0(%rsp), %rax
leaq 0xe8(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x6940c
movq 0x28(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x20(%rsp)
callq 0x35510
movq 0x20(%rsp), %rax
leaq 0xe8(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x693e2
jmp 0x6946d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xd0(%rsp)
movl %eax, 0xcc(%rsp)
leaq 0x62(%rsp), %rdi
callq 0x39db0
leaq 0xe8(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x438, %rax            # imm = 0x438
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x8(%rsp)
callq 0x35510
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x69444
jmp 0x6946d
leaq 0x2661c(%rip), %rdi     # 0x8fa90
callq 0x36720
jmp 0x694b9
movq 0x538(%rsp), %rax
movq %rax, (%rsp)
leaq 0x58(%rsp), %rdi
callq 0x386b0
movq (%rsp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x372a0
movq %rax, 0x540(%rsp)
movq 0x540(%rsp), %rax
addq $0x548, %rsp            # imm = 0x548
retq
movq 0xd0(%rsp), %rdi
callq 0x399c0
nopw %cs:(%rax,%rax)