// File: hyrise[P]sql-parser/src/util/sqlhelper.cpp
// Function: hsql::printWindowDescription(hsql::WindowDescription*, unsigned long)
void printWindowDescription(WindowDescription* window_description, uintmax_t num_indent) {
  inprint("OVER", num_indent);
  if (window_description->partitionList) {
    inprint("PARTITION BY", num_indent + 1);
    for (const auto e : *window_description->partitionList) {
      printExpression(e, num_indent + 2);
    }
  }

  if (window_description->orderList) {
    inprint("ORDER BY", num_indent + 1);
    printOrderBy(window_description->orderList, num_indent + 2);
  }

  std::stringstream stream;
  switch (window_description->frameDescription->type) {
    case kRows:
      stream << "ROWS";
      break;
    case kRange:
      stream << "RANGE";
      break;
    case kGroups:
      stream << "GROUPS";
      break;
  }
  stream << " BETWEEN " << *window_description->frameDescription->start << " AND "
         << *window_description->frameDescription->end;
  inprint(stream.str().c_str(), num_indent + 1);
}

// Assembly:
subq $0x208, %rsp            # imm = 0x208
movq %rdi, 0x200(%rsp)
movq %rsi, 0x1f8(%rsp)
movq 0x1f8(%rsp), %rsi
leaq 0x7d23(%rip), %rdi      # 0x72659
callq 0x39830
movq 0x200(%rsp), %rax
cmpq $0x0, 0x8(%rax)
je 0x6aa01
movq 0x1f8(%rsp), %rsi
addq $0x1, %rsi
leaq 0x13f38(%rip), %rdi     # 0x7e899
callq 0x39830
movq 0x200(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x1f0(%rsp)
movq 0x1f0(%rsp), %rdi
callq 0x36b30
movq %rax, 0x1e8(%rsp)
movq 0x1f0(%rsp), %rdi
callq 0x38740
movq %rax, 0x1e0(%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x1e0(%rsp), %rsi
callq 0x39fa0
testb $0x1, %al
jne 0x6a9bf
jmp 0x6a9ff
leaq 0x1e8(%rsp), %rdi
callq 0x37b30
movq (%rax), %rax
movq %rax, 0x1d8(%rsp)
movq 0x1d8(%rsp), %rdi
movq 0x1f8(%rsp), %rsi
addq $0x2, %rsi
callq 0x37340
leaq 0x1e8(%rsp), %rdi
callq 0x36f80
jmp 0x6a9a4
jmp 0x6aa01
movq 0x200(%rsp), %rax
cmpq $0x0, 0x10(%rax)
je 0x6aa45
movq 0x1f8(%rsp), %rsi
addq $0x1, %rsi
leaq 0x13e83(%rip), %rdi     # 0x7e8a6
callq 0x39830
movq 0x200(%rsp), %rax
movq 0x10(%rax), %rdi
movq 0x1f8(%rsp), %rsi
addq $0x2, %rsi
callq 0x38ee0
leaq 0x50(%rsp), %rdi
callq 0x369b0
movq 0x200(%rsp), %rax
movq 0x18(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0x6aaa6
jmp 0x6aa68
movl 0x1c(%rsp), %eax
subl $0x1, %eax
je 0x6aa7e
jmp 0x6aa73
movl 0x1c(%rsp), %eax
subl $0x2, %eax
je 0x6aabb
jmp 0x6aad0
leaq 0x60(%rsp), %rdi
leaq 0x7d52(%rip), %rsi      # 0x727dc
callq 0x377a0
jmp 0x6aa91
jmp 0x6aad0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x6ab9f
leaq 0x60(%rsp), %rdi
leaq 0x7d24(%rip), %rsi      # 0x727d6
callq 0x377a0
jmp 0x6aab9
jmp 0x6aad0
leaq 0x60(%rsp), %rdi
leaq 0x7d1a(%rip), %rsi      # 0x727e1
callq 0x377a0
jmp 0x6aace
jmp 0x6aad0
leaq 0x60(%rsp), %rdi
leaq 0x13dd3(%rip), %rsi     # 0x7e8af
callq 0x377a0
movq %rax, 0x10(%rsp)
jmp 0x6aae8
movq 0x10(%rsp), %rdi
movq 0x200(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x390b0
movq %rax, 0x8(%rsp)
jmp 0x6ab09
movq 0x8(%rsp), %rdi
leaq 0x13da4(%rip), %rsi     # 0x7e8b9
callq 0x377a0
movq %rax, (%rsp)
jmp 0x6ab20
movq (%rsp), %rdi
movq 0x200(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rsi
callq 0x390b0
jmp 0x6ab3b
leaq 0x20(%rsp), %rdi
leaq 0x50(%rsp), %rsi
callq 0x37720
jmp 0x6ab4c
leaq 0x20(%rsp), %rdi
callq 0x35de0
movq %rax, %rdi
movq 0x1f8(%rsp), %rsi
incq %rsi
callq 0x39830
jmp 0x6ab6b
leaq 0x20(%rsp), %rdi
callq 0x36650
leaq 0x50(%rsp), %rdi
callq 0x3a3d8
addq $0x208, %rsp            # imm = 0x208
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x36650
leaq 0x50(%rsp), %rdi
callq 0x3a3d8
movq 0x48(%rsp), %rdi
callq 0x399c0
nopw %cs:(%rax,%rax)