// File: /workspace/github_cpp_makefile_star2_O1/hyrise[P]sql-parser/src/sql/statements.cpp
// Function: hsql::SelectStatement::~SelectStatement()
SelectStatement::~SelectStatement() {
  delete fromTable;
  delete whereClause;
  delete groupBy;
  delete limit;

  // Delete each element in the select list.
  if (selectList) {
    for (Expr* expr : *selectList) {
      delete expr;
    }
    delete selectList;
  }

  if (order) {
    for (OrderDescription* desc : *order) {
      delete desc;
    }
    delete order;
  }

  if (withDescriptions) {
    for (WithDescription* desc : *withDescriptions) {
      delete desc;
    }
    delete withDescriptions;
  }

  if (setOperations) {
    for (SetOperation* setOperation : *setOperations) {
      delete setOperation;
    }
    delete setOperations;
  }

  if (lockings) {
    for (LockingClause* lockingClause : *lockings) {
      if (lockingClause->tables) {
        for (char* dtable : *lockingClause->tables) {
          free(dtable);
        }
        delete lockingClause->tables;
      }
      delete lockingClause;
    }
    delete lockings;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x1a08b(%rip), %rax     # 0x3aec0
addq $0x10, %rax
movq %rax, (%rdi)
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x20e4b
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x38(%rbx), %rdi
testq %rdi, %rdi
je 0x20e5a
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x20e69
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x20e78
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x30(%rbx), %rax
testq %rax, %rax
je 0x20ecb
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x20ea1
movq (%r14), %rdi
testq %rdi, %rdi
je 0x20e9b
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %r14
jmp 0x20e88
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x20ecb
movq (%r14), %rdi
testq %rdi, %rdi
je 0x20ebe
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x12990
movl $0x18, %esi
movq %r14, %rdi
callq 0x12990
movq 0x50(%rbx), %rax
testq %rax, %rax
je 0x20f1e
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x20ef4
movq (%r14), %rdi
testq %rdi, %rdi
je 0x20eee
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %r14
jmp 0x20edb
movq 0x50(%rbx), %r14
testq %r14, %r14
je 0x20f1e
movq (%r14), %rdi
testq %rdi, %rdi
je 0x20f11
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x12990
movl $0x18, %esi
movq %r14, %rdi
callq 0x12990
movq 0x58(%rbx), %rax
testq %rax, %rax
je 0x20f80
movq (%rax), %r15
movq 0x8(%rax), %r12
cmpq %r12, %r15
je 0x20f56
movq (%r15), %r14
testq %r14, %r14
je 0x20f50
movq %r14, %rdi
callq 0x12090
movl $0x10, %esi
movq %r14, %rdi
callq 0x12990
addq $0x8, %r15
jmp 0x20f2e
movq 0x58(%rbx), %r14
testq %r14, %r14
je 0x20f80
movq (%r14), %rdi
testq %rdi, %rdi
je 0x20f73
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x12990
movl $0x18, %esi
movq %r14, %rdi
callq 0x12990
movq 0x48(%rbx), %rax
testq %rax, %rax
je 0x20fd3
movq (%rax), %r14
movq 0x8(%rax), %r15
cmpq %r15, %r14
je 0x20fa9
movq (%r14), %rdi
testq %rdi, %rdi
je 0x20fa3
movq (%rdi), %rax
callq *0x8(%rax)
addq $0x8, %r14
jmp 0x20f90
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0x20fd3
movq (%r14), %rdi
testq %rdi, %rdi
je 0x20fc6
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x12990
movl $0x18, %esi
movq %r14, %rdi
callq 0x12990
movq 0x68(%rbx), %rax
testq %rax, %rax
je 0x2107f
movq (%rax), %r12
movq 0x8(%rax), %r13
cmpq %r13, %r12
je 0x21055
movq (%r12), %r14
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x2103d
movq (%rax), %r15
movq 0x8(%rax), %rbp
cmpq %rbp, %r15
je 0x21013
movq (%r15), %rdi
callq 0x12ab0
addq $0x8, %r15
jmp 0x21000
movq 0x8(%r14), %r15
testq %r15, %r15
je 0x2103d
movq (%r15), %rdi
testq %rdi, %rdi
je 0x21030
movq 0x10(%r15), %rsi
subq %rdi, %rsi
callq 0x12990
movl $0x18, %esi
movq %r15, %rdi
callq 0x12990
testq %r14, %r14
je 0x2104f
movl $0x10, %esi
movq %r14, %rdi
callq 0x12990
addq $0x8, %r12
jmp 0x20fe7
movq 0x68(%rbx), %r14
testq %r14, %r14
je 0x2107f
movq (%r14), %rdi
testq %rdi, %rdi
je 0x21072
movq 0x10(%r14), %rsi
subq %rdi, %rsi
callq 0x12990
movl $0x18, %esi
movq %r14, %rdi
callq 0x12990
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12c10
nop